{expanded || preview === undefined ? brief : preview}
+{expanded || preview === undefined ? text : preview}
{preview !== undefined && } + onClick={() => { setExpanded(value => !value) }}>{expanded ? collapseLabel : expandLabel}} > } @@ -135,7 +135,11 @@ export function RecommendationCard({ recommendation, useProjection, act, useInfo }{t(decision.application)}
} {error !== undefined &&{t(error)}
} diff --git a/packages/experimental/client-ui-creation-recommendations/src/client/definition.ts b/packages/experimental/client-ui-creation-recommendations/src/client/definition.ts index f91204f808..4eda577fc5 100644 --- a/packages/experimental/client-ui-creation-recommendations/src/client/definition.ts +++ b/packages/experimental/client-ui-creation-recommendations/src/client/definition.ts @@ -25,8 +25,10 @@ export function recommendationOf(event: { readonly type: string; readonly data: const value = record(card) && card.action === 'create_personalized_page' ? card.data : result.meta.creationRecommendation if (!record(value) || typeof value.callId !== 'string' || value.callId === '' || typeof value.title !== 'string' || value.title === '' || typeof value.brief !== 'string' || value.brief === '' - || value.slot !== 'sidebar-right' && value.slot !== 'page' && value.slot !== 'sidebar-left') return undefined - return { callId: value.callId as ToolCallId, title: value.title, brief: value.brief, slot: value.slot } + || value.slot !== 'sidebar-right' && value.slot !== 'page' && value.slot !== 'sidebar-left' + || value.initialContent !== undefined && typeof value.initialContent !== 'string') return undefined + return { callId: value.callId as ToolCallId, title: value.title, brief: value.brief, slot: value.slot, + ...value.initialContent === undefined ? {} : { initialContent: value.initialContent } } } /** Retain proposal data without rendering inside the tool sequence. */ diff --git a/packages/experimental/client-ui-creation-recommendations/src/client/locales.ts b/packages/experimental/client-ui-creation-recommendations/src/client/locales.ts index daca031238..46bd97c402 100644 --- a/packages/experimental/client-ui-creation-recommendations/src/client/locales.ts +++ b/packages/experimental/client-ui-creation-recommendations/src/client/locales.ts @@ -6,6 +6,7 @@ export const en = { creationCost: 'Creation may take a while and use a large number of tokens.', creationBackground: 'Click Create to start in the background. You can keep chatting here.', expandPlan: 'View full plan', collapsePlan: 'Collapse plan', + initialContent: 'Starts with', expandContent: 'View all content', collapseContent: 'Collapse content', 'sidebar-right': 'Right sidebar', page: 'Session tab', 'sidebar-left': 'Global page', custom: 'Write your own', 'sidebar-rightHint': 'View alongside this conversation', pageHint: 'Open beside Chat and Trajectory', @@ -15,7 +16,7 @@ export const en = { customPlaceholder: 'For example, a left sidebar entry that opens a full-page calendar', create: 'Create', starting: 'Starting…', dismiss: 'Not now', retry: 'Create again', keep: 'Keep', undo: 'Undo', scope: 'You can remove it at any time', - dismissed: 'Dismissed', expired: 'Expired', creating: 'Creating in the background', + dismissed: 'Dismissed', replaced: 'Replaced', creating: 'Creating in the background', cancel: 'Cancel creation', cancelling: 'Cancelling…', installing: 'Installing…', sourceRetained: 'Undo keeps the source files in the original workspace’s .dsh-created-plugins/ folder.', installed: 'Installed', kept: 'Kept', removed: 'Removed', @@ -44,6 +45,7 @@ export const zh: Record