@helpai/elements 6.9.0 → 6.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/step-display.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * widget (the dashboard's AI Chat, AI Agent Chat and Inbox). They draw the same views the widget draws, from the same
4
4
  * settings and words, so the two never decide differently (docs/features/step-display.md). Framework-free.
5
5
  */
6
- type StringKey = 'launcherOpen' | 'launcherAsk' | 'panelTitle' | 'composerPlaceholder' | 'send' | 'stop' | 'queueMessage' | 'removeQueuedMessage' | 'removeAttachment' | 'suggestedReplies' | 'compactingContext' | 'attach' | 'file' | 'micBlocked' | 'micStart' | 'micStop' | 'expand' | 'collapse' | 'fullscreen' | 'exitFullscreen' | 'popOut' | 'resizeHandle' | 'scrollToBottom' | 'close' | 'moreActions' | 'soundOn' | 'soundOff' | 'language' | 'theme' | 'themeAuto' | 'themeLight' | 'themeDark' | 'textSize' | 'textSizeSmall' | 'textSizeNormal' | 'textSizeLarge' | 'history' | 'historyTitle' | 'historyEmpty' | 'historyLoading' | 'historyBack' | 'historyContinue' | 'loadMoreConversations' | 'conversationLoading' | 'loadPreviousMessages' | 'talkToOperator' | 'connectingOperator' | 'noOperatorAvailable' | 'chattingWithOperator' | 'operatorBadgeTitle' | 'chatNotice' | 'cancelOperatorRequest' | 'loginPrompt' | 'loginAction' | 'loginRequired' | 'loginExpired' | 'loginExpiredGuest' | 'startAsGuest' | 'loggedInAs' | 'loggedIn' | 'dismissLoginPrompt' | 'emailTranscript' | 'emailTranscriptPrompt' | 'emailTranscriptEmailLabel' | 'emailTranscriptSend' | 'emailTranscriptSending' | 'emailTranscriptSent' | 'emailTranscriptAlreadySent' | 'emailTranscriptLimited' | 'emailTranscriptFailed' | 'emailTranscriptNotDelivered' | 'emailTranscriptCancel' | 'emailTranscriptDone' | 'dateToday' | 'dateYesterday' | 'dateLastWeek' | 'dateOlder' | 'newConversation' | 'dropZone' | 'dropZoneRejected' | 'attachmentTooLarge' | 'poweredBy' | 'attachmentTooMany' | 'attachmentMimeRejected' | 'attachmentUploadFailed' | 'errorRetry' | 'errorGeneric' | 'errorRateLimited' | 'errorRateLimitedIn' | 'errorOffline' | 'errorServer' | 'errorOriginNotAllowed' | 'errorMessageTooLong' | 'errorReconnecting' | 'loading' | 'visualPreparing' | 'visualError' | 'visualPartial' | 'visualSoldOut' | 'visualCartEmpty' | 'visualQuantity' | 'visualChoose' | 'thinking' | 'thought' | 'thoughtFor' | 'toolResult' | 'sources' | 'feedbackUp' | 'feedbackDown' | 'feedbackThanks' | 'copy' | 'copied' | 'copyTicketReference' | 'collapseSidebar' | 'expandSidebar' | 'formRequired' | 'formInvalidEmail' | 'formInvalidTel' | 'formInvalidNumber' | 'formOtherPlaceholder' | 'inputRequired' | 'askFallbackQuestion' | 'inputBadge' | 'inputAnswered' | 'inputSkipped' | 'inputSubmit' | 'inputSubmitHint' | 'inputSkip' | 'showOptions' | 'hideOptions' | 'qtypeText' | 'qtypeEmail' | 'qtypePhone' | 'qtypeNumber' | 'qtypeDate' | 'qtypeChooseOne' | 'qtypeChooseAny' | 'qtypeBoolean' | 'confirmYes' | 'confirmNo' | 'approve' | 'decline' | 'changeAnswer' | 'approvalPrompt' | 'approvalEditHint' | 'stepInput' | 'stepWorking' | 'stepWorkingOnIt' | 'stepNeedsYourApproval' | 'stepWaitingForVisitor' | 'stepApproved' | 'stepDeclined' | 'stepReplaced' | 'stepFailed' | 'stepDidNotWork' | 'decidedYouApproved' | 'decidedYouDeclined' | 'decidedVisitorApproved' | 'decidedVisitorDeclined' | 'decidedTeamApproved' | 'decidedTeamDeclined' | 'decidedMemberApproved' | 'decidedMemberDeclined' | 'stepRawData' | 'decidedRulesApproved' | 'decidedRulesDeclined' | 'edit' | 'statusError' | 'toolStepsFailed' | 'statusStopped' | 'toolStepsStopped' | 'toolStepsStoppedOne' | 'tabHome' | 'tabConversations' | 'tabHelp' | 'tabNews' | 'modulesEmpty' | 'chatUnavailable' | 'moduleBack' | 'contentLoading' | 'contentHelpful' | 'homeGreeting' | 'homeGreetingNamed' | 'homeGreetingLead' | 'homeSearchPlaceholder' | 'homeAskPlaceholder' | 'homeWhatsNew' | 'homeContentTitle' | 'homeStatus' | 'helpTitle' | 'helpSearchPlaceholder' | 'helpEmpty' | 'helpLoading' | 'helpSearchEmpty' | 'helpShowMore' | 'newsTitle' | 'newsEmpty' | 'newsLoading' | 'newsShowMore' | 'newsUnseen' | 'unread';
6
+ type StringKey = 'launcherOpen' | 'launcherAsk' | 'panelTitle' | 'composerPlaceholder' | 'send' | 'stop' | 'queueMessage' | 'removeQueuedMessage' | 'removeAttachment' | 'suggestedReplies' | 'compactingContext' | 'attach' | 'file' | 'micBlocked' | 'micStart' | 'micStop' | 'expand' | 'collapse' | 'fullscreen' | 'exitFullscreen' | 'popOut' | 'resizeHandle' | 'scrollToBottom' | 'close' | 'moreActions' | 'soundOn' | 'soundOff' | 'language' | 'theme' | 'themeAuto' | 'themeLight' | 'themeDark' | 'textSize' | 'textSizeSmall' | 'textSizeNormal' | 'textSizeLarge' | 'history' | 'historyTitle' | 'historyEmpty' | 'historyLoading' | 'historyBack' | 'historyContinue' | 'loadMoreConversations' | 'conversationLoading' | 'loadPreviousMessages' | 'talkToOperator' | 'connectingOperator' | 'noOperatorAvailable' | 'chattingWithOperator' | 'operatorBadgeTitle' | 'chatNotice' | 'cancelOperatorRequest' | 'loginPrompt' | 'loginAction' | 'loginRequired' | 'loginExpired' | 'loginExpiredGuest' | 'startAsGuest' | 'loggedInAs' | 'loggedIn' | 'dismissLoginPrompt' | 'emailTranscript' | 'emailTranscriptPrompt' | 'emailTranscriptEmailLabel' | 'emailTranscriptSend' | 'emailTranscriptSending' | 'emailTranscriptSent' | 'emailTranscriptAlreadySent' | 'emailTranscriptLimited' | 'emailTranscriptFailed' | 'emailTranscriptNotDelivered' | 'emailTranscriptCancel' | 'emailTranscriptDone' | 'dateToday' | 'dateYesterday' | 'dateLastWeek' | 'dateOlder' | 'newConversation' | 'dropZone' | 'dropZoneRejected' | 'attachmentTooLarge' | 'poweredBy' | 'attachmentTooMany' | 'attachmentMimeRejected' | 'attachmentUploadFailed' | 'errorRetry' | 'errorGeneric' | 'errorRateLimited' | 'errorRateLimitedIn' | 'errorOffline' | 'errorServer' | 'errorOriginNotAllowed' | 'errorMessageTooLong' | 'errorReconnecting' | 'loading' | 'visualPreparing' | 'visualError' | 'visualPartial' | 'visualSoldOut' | 'visualCartEmpty' | 'visualQuantity' | 'visualChoose' | 'thinking' | 'thought' | 'thoughtFor' | 'toolResult' | 'sources' | 'feedbackUp' | 'feedbackDown' | 'feedbackThanks' | 'copy' | 'copied' | 'copyTicketReference' | 'collapseSidebar' | 'expandSidebar' | 'formRequired' | 'formInvalidEmail' | 'formInvalidTel' | 'formInvalidNumber' | 'formOtherPlaceholder' | 'inputRequired' | 'askFallbackQuestion' | 'inputBadge' | 'inputAnswered' | 'inputSkipped' | 'inputSubmit' | 'inputSubmitHint' | 'inputSkip' | 'showOptions' | 'hideOptions' | 'qtypeText' | 'qtypeEmail' | 'qtypePhone' | 'qtypeNumber' | 'qtypeDate' | 'qtypeChooseOne' | 'qtypeChooseAny' | 'qtypeBoolean' | 'confirmYes' | 'confirmNo' | 'approve' | 'decline' | 'changeAnswer' | 'approvalPrompt' | 'approvalEditHint' | 'stepInput' | 'stepWorking' | 'stepWorkingOnIt' | 'stepNeedsYourApproval' | 'stepWaitingForVisitor' | 'stepApproved' | 'stepDeclined' | 'stepReplaced' | 'stepFailed' | 'stepDidNotWork' | 'decidedYouApproved' | 'decidedYouDeclined' | 'decidedVisitorApproved' | 'decidedVisitorDeclined' | 'decidedTeamApproved' | 'decidedTeamDeclined' | 'decidedMemberApproved' | 'decidedMemberDeclined' | 'stepRawData' | 'decidedRulesApproved' | 'decidedRulesDeclined' | 'edit' | 'toolStepsFailed' | 'statusStopped' | 'toolStepsStopped' | 'toolStepsStoppedOne' | 'tabHome' | 'tabConversations' | 'tabHelp' | 'tabNews' | 'modulesEmpty' | 'chatUnavailable' | 'moduleBack' | 'contentLoading' | 'contentHelpful' | 'homeGreeting' | 'homeGreetingNamed' | 'homeGreetingLead' | 'homeSearchPlaceholder' | 'homeAskPlaceholder' | 'homeWhatsNew' | 'homeContentTitle' | 'homeStatus' | 'helpTitle' | 'helpSearchPlaceholder' | 'helpEmpty' | 'helpLoading' | 'helpSearchEmpty' | 'helpShowMore' | 'newsTitle' | 'newsEmpty' | 'newsLoading' | 'newsShowMore' | 'newsUnseen' | 'unread';
7
7
  /**
8
8
  * The post-resolution map — every key guaranteed present. UI components
9
9
  * receive this shape and read it via direct property access (no `t()`).
@@ -37,6 +37,23 @@ interface ToolApproval {
37
37
  * `approval-requested` like any other tool.
38
38
  */
39
39
  type ToolState = 'input-streaming' | 'input-available' | 'approval-requested' | 'approval-responded' | 'output-available' | 'output-error' | 'output-denied';
40
+ /**
41
+ * The kinds of steps a reader may choose to see, folded into one line under the reply: `decided`, it asked a person
42
+ * (a visitor or another member); `auto-decided`, the rules decided it; `unasked`, it ran without asking; `failed`, it
43
+ * failed, whoever decided it. A step has every kind that applies ("auto-decided" and "failed" both, for an approved
44
+ * call that then failed) and shows when any of them is chosen. The reader's own decisions and anything waiting on
45
+ * someone always show.
46
+ */
47
+ export declare const STEP_KINDS: readonly ['decided', 'auto-decided', 'unasked', 'failed'];
48
+ export type StepKind = (typeof STEP_KINDS)[number];
49
+ /**
50
+ * Where a step came from, as the server marks every call (`toolMetadata.origin`), set once where each family of tools
51
+ * is built: `platform`, help.ai's own tools; `mcp`, an MCP server's (an integration, help.ai's own MCP included);
52
+ * `api`, a call to an API integration; `webmcp`, the page's own tools, run in the visitor's browser (those the site
53
+ * hands the widget and those the browser offers through WebMCP).
54
+ */
55
+ export declare const STEP_ORIGINS: readonly ['platform', 'mcp', 'api', 'webmcp'];
56
+ export type StepOrigin = (typeof STEP_ORIGINS)[number];
40
57
  /**
41
58
  * What an opened step shows: `none`, nothing (the step line alone, for a business that never shows a visitor's data
42
59
  * back); `values`, its values as quiet label and value lines without ids; `table`, tables of what it ran on (ids
@@ -45,47 +62,50 @@ type ToolState = 'input-streaming' | 'input-available' | 'approval-requested' |
45
62
  */
46
63
  export declare const STEP_DETAILS: readonly ['none', 'values', 'table', 'json', 'table-and-json'];
47
64
  export type StepDetails = (typeof STEP_DETAILS)[number];
48
- export declare function isStepDetails(value: unknown): value is StepDetails;
49
- /** The settings, the same keys on a Deployment (`config.behavior.stepDisplay`) and in a member's Preferences. */
65
+ /** The settings, the same keys on a Deployment (`config.behavior.stepDisplay`) and in the dashboard's Message display. */
50
66
  export interface StepDisplay {
51
- /** Every step appears as one folded line under the reply; off, only the steps that involve the reader do. */
52
- showSteps: boolean;
67
+ /** The origins whose steps may appear (`STEP_ORIGINS`), in any combination. */
68
+ stepsFrom: readonly StepOrigin[];
69
+ /** The kinds of steps that appear (`STEP_KINDS`), in any combination: a step from a chosen origin shows when any of its kinds is chosen. */
70
+ stepsShown: readonly StepKind[];
53
71
  /** What an opened step shows (`STEP_DETAILS`). */
54
72
  stepDetails: StepDetails;
55
73
  /** The system that ran a step follows its name: "Ship an order · BC Co. back office". */
56
74
  showStepSystem: boolean;
57
- /** Each approval says who decided it, and steps the rules decided show as steps. */
75
+ /** Each decision someone else or the rules made says who made it. */
58
76
  showDecidedBy: boolean;
59
77
  /** A decided approval folds into the steps line; off, it stays in the reply as a card. */
60
78
  foldApprovals: boolean;
61
79
  }
62
- export declare const STEP_DISPLAY_PRESETS: {
63
- readonly simple: {
64
- readonly showSteps: false;
80
+ /**
81
+ * Each audience's settings where nothing is stored: a visitor sees only their own decisions, as plain values; a member
82
+ * sees every step from everywhere, with tables and the raw JSON, which system ran it and who decided.
83
+ */
84
+ export declare const STEP_DISPLAY_DEFAULTS: {
85
+ readonly visitor: {
86
+ readonly stepsFrom: readonly ["platform", "mcp", "api", "webmcp"];
87
+ readonly stepsShown: readonly [];
65
88
  readonly stepDetails: 'values';
66
89
  readonly showStepSystem: false;
67
90
  readonly showDecidedBy: false;
68
91
  readonly foldApprovals: true;
69
92
  };
70
- readonly technical: {
71
- readonly showSteps: true;
93
+ readonly member: {
94
+ readonly stepsFrom: readonly ["platform", "mcp", "api", "webmcp"];
95
+ readonly stepsShown: readonly ["decided", "auto-decided", "unasked", "failed"];
72
96
  readonly stepDetails: 'table-and-json';
73
97
  readonly showStepSystem: true;
74
98
  readonly showDecidedBy: true;
75
99
  readonly foldApprovals: true;
76
100
  };
77
101
  };
78
- export type StepDisplayPreset = keyof typeof STEP_DISPLAY_PRESETS;
79
- /** The on/off settings; `stepDetails` is the one choice. */
80
- export declare const STEP_DISPLAY_SWITCHES: readonly ["showSteps", "showStepSystem", "showDecidedBy", "foldApprovals"];
81
- export declare const STEP_DISPLAY_KEYS: readonly ["showSteps", "showStepSystem", "showDecidedBy", "foldApprovals", "stepDetails"];
102
+ export type StepDisplayAudience = keyof typeof STEP_DISPLAY_DEFAULTS;
103
+ /** The on/off settings; `stepsFrom`, `stepsShown` and `stepDetails` are the choices. */
104
+ export declare const STEP_DISPLAY_SWITCHES: readonly ["showStepSystem", "showDecidedBy", "foldApprovals"];
82
105
  /** The settings found in an untyped stored bag (a member's preferences, a host's attribute): known keys of the right kind only. */
83
106
  export declare function readStepDisplay(stored: unknown): Partial<StepDisplay>;
84
- export declare function isStepDisplayPreset(name: string): name is StepDisplayPreset;
85
- /** The settings a surface uses: what was stored over its default preset, so a partial or absent setting reads whole. */
86
- export declare function resolveStepDisplay(stored: Partial<StepDisplay> | undefined, preset: StepDisplayPreset): StepDisplay;
87
- /** The preset these settings match, for the editor's preset picker; none is a custom mix. */
88
- export declare function matchStepDisplayPreset(display: StepDisplay): StepDisplayPreset | undefined;
107
+ /** The settings a surface uses: what was stored over its audience's defaults, so a partial or absent setting reads whole. */
108
+ export declare function resolveStepDisplay(stored: Partial<StepDisplay> | undefined, audience: StepDisplayAudience): StepDisplay;
89
109
  /** Who made an approval's decision, as the stored approval records it. The visitor's own view never carries it. */
90
110
  export interface StepApproval extends ToolApproval {
91
111
  respondedBy?: {
@@ -106,9 +126,9 @@ export interface StepCall {
106
126
  errorText?: string;
107
127
  approval?: StepApproval;
108
128
  /**
109
- * The server's marks: `system` (who ran it), `systemField` (the input field that names who runs each call, such as
110
- * the integration an API call signs in with), `nameShared` (another integration offers an action of this name),
111
- * `card` (a card of its own), `execution: "client"` (a page tool).
129
+ * The server's marks: `origin` (`STEP_ORIGINS`), `system` (who ran it), `systemField` (the input field that names
130
+ * who runs each call, such as the integration an API call signs in with), `nameShared` (another integration offers
131
+ * an action of this name), `card` (it asks for input on a card of its own), `execution: "client"` (the browser runs it).
112
132
  */
113
133
  toolMetadata?: Record<string, unknown>;
114
134
  }
@@ -161,7 +181,7 @@ export interface StepCallView {
161
181
  /** Who ran it, with Show which system on, or always when another integration shares the action's name. */
162
182
  system?: string;
163
183
  status: StepStatus;
164
- /** The status in words; empty for a finished step, whose icon says it. */
184
+ /** The status in words; empty when the step's icon or its decision mark already says it (done, approved, declined). */
165
185
  statusLabel: string;
166
186
  /** The decision, shown for the reader's own and, with Show who decided on, for everyone's. */
167
187
  decision?: StepDecision;
@@ -191,12 +211,8 @@ export interface StepCallView {
191
211
  note?: string;
192
212
  };
193
213
  }
194
- export type StepStringKey = 'approvalPrompt' | 'approvalEditHint' | 'stepWorking' | 'stepWorkingOnIt' | 'stepNeedsYourApproval' | 'stepWaitingForVisitor' | 'stepApproved' | 'stepDeclined' | 'stepReplaced' | 'stepFailed' | 'stepDidNotWork' | 'statusStopped' | 'decidedYouApproved' | 'decidedYouDeclined' | 'decidedVisitorApproved' | 'decidedVisitorDeclined' | 'decidedTeamApproved' | 'decidedTeamDeclined' | 'decidedMemberApproved' | 'decidedMemberDeclined' | 'stepRawData' | 'decidedRulesApproved' | 'decidedRulesDeclined' | 'toolStepsFailed' | 'toolStepsStopped' | 'toolStepsStoppedOne';
214
+ export type StepStringKey = 'approvalPrompt' | 'approvalEditHint' | 'stepWorking' | 'stepWorkingOnIt' | 'stepNeedsYourApproval' | 'stepWaitingForVisitor' | 'stepApproved' | 'stepDeclined' | 'stepReplaced' | 'inputSkipped' | 'inputAnswered' | 'stepFailed' | 'stepDidNotWork' | 'statusStopped' | 'decidedYouApproved' | 'decidedYouDeclined' | 'decidedVisitorApproved' | 'decidedVisitorDeclined' | 'decidedTeamApproved' | 'decidedTeamDeclined' | 'decidedMemberApproved' | 'decidedMemberDeclined' | 'stepRawData' | 'decidedRulesApproved' | 'decidedRulesDeclined' | 'toolStepsFailed' | 'toolStepsStopped' | 'toolStepsStoppedOne';
195
215
  export type StepStrings = Pick<Strings, StepStringKey>;
196
- /** `place_order` / `getIssue` / `list-repos` → "Place order" / "Get issue" / "List repos". */
197
- export declare function nameInWords(name: string): string;
198
- /** The action's name: its title, else the call's own name in words, never a `site__` or `<integration>__` prefix. */
199
- export declare function stepName(call: Pick<StepCall, 'toolName' | 'title'>): string;
200
216
  /**
201
217
  * What a call does, read from the shape of its input, never its tool: every value as one labelled line, a list as its
202
218
  * items, a nested object as its own lines. An id means nothing to a reader, so it shows only with step details, or
@@ -205,20 +221,6 @@ export declare function stepName(call: Pick<StepCall, 'toolName' | 'title'>): st
205
221
  export declare function stepFields(input: unknown, opts: {
206
222
  withIds: boolean;
207
223
  }): StepField[];
208
- /** A payload as raw text: indented JSON, a string as it is; nothing for an empty one. */
209
- export declare function rawText(value: unknown, maxChars?: number): string | undefined;
210
- /** A result read through its envelope: what came back (a failure's too, for its raw data), and why it failed. */
211
- interface StepResult {
212
- value?: unknown;
213
- error?: string;
214
- }
215
- /**
216
- * What a result says, read from its shape, never its tool: a large result saved by reference (`{ storage:
217
- * "tool-result-ref", summary }`) as its summary; an MCP result (`content` parts) as its `structuredContent`, else its
218
- * text parsed when it holds JSON, and as failed when it says `isError`; help.ai's tool error (`{ error, instruction }`)
219
- * as failed with its `error`. The model-facing `instruction` is never a reader's to see.
220
- */
221
- export declare function stepResult(output: unknown): StepResult;
222
224
  /** Everything a surface draws for one call, under the given settings. */
223
225
  export declare function stepCallView(call: StepCall, ctx: {
224
226
  turn: StepTurn;
package/step-display.mjs CHANGED
@@ -1,3 +1,3 @@
1
- const e={attach:`Attach files`,file:`File`,attachmentMimeRejected:`{name} isn't a file type this chat accepts.`,attachmentTooLarge:`{name} is too large. Files can be up to {max} together.`,poweredBy:`Powered by {name}`,attachmentTooMany:`The attachment limit is {count}.`,attachmentUploadFailed:`{name} couldn't be uploaded.`,conversationLoading:`Loading chat…`,loadPreviousMessages:`Load previous messages`,close:`Close`,collapse:`Collapse`,collapseSidebar:`Collapse sidebar`,composerPlaceholder:`Type a message…`,dateLastWeek:`Last 7 days`,dateOlder:`Older`,dateToday:`Today`,dateYesterday:`Yesterday`,dropZone:`Drop files to attach`,dropZoneRejected:`These files can't be attached here`,errorGeneric:`Something went wrong`,errorRateLimited:`Too many requests — please try again in a moment.`,errorRateLimitedIn:`Too many requests — please try again in {seconds} s.`,errorOffline:`Can't reach the server. Check your connection and try again.`,errorServer:`Something went wrong on our side. Please try again.`,errorOriginNotAllowed:`This chat isn't set up for this website yet.`,errorMessageTooLong:`That message is too long. Shorten it and send it again.`,errorReconnecting:`Connection lost. Reconnecting…`,errorRetry:`Retry`,expand:`Expand`,expandSidebar:`Expand sidebar`,exitFullscreen:`Exit fullscreen`,fullscreen:`Fullscreen`,history:`History`,historyBack:`Back to chat`,historyEmpty:`No previous chats yet`,historyLoading:`Loading your chats…`,historyContinue:`Continue the chat`,historyTitle:`Chat history`,loadMoreConversations:`Load more conversations`,language:`Language`,launcherOpen:`Open chat`,launcherAsk:`Ask {name}`,micBlocked:`The microphone is blocked for this site, so voice input can't start.`,micStart:`Start voice input`,micStop:`Stop voice input`,moreActions:`More actions`,newConversation:`New chat`,panelTitle:`Chat`,popOut:`Open in new tab`,resizeHandle:`Drag to resize`,scrollToBottom:`Scroll to latest`,send:`Send`,queueMessage:`Queue message`,removeQueuedMessage:`Remove queued message`,removeAttachment:`Remove {name}`,suggestedReplies:`Suggested replies`,compactingContext:`Optimizing conversation context…`,soundOff:`Sound off`,soundOn:`Sound on`,talkToOperator:`Talk to a person`,connectingOperator:`Connecting you to a person…`,noOperatorAvailable:`No one's available right now — leave your details and we'll follow up.`,chattingWithOperator:`You're chatting with {operator}`,operatorBadgeTitle:`Live chat`,chatNotice:`You're chatting with an AI assistant.`,cancelOperatorRequest:`Keep chatting with the AI`,loginPrompt:`Log in for faster, more personalized support`,loginAction:`Log in`,loginRequired:`Log in to chat with us`,loginExpired:`Your login expired. Log in to continue this chat.`,loginExpiredGuest:`Your login expired. Log in to continue this chat, or start a new conversation as a guest.`,startAsGuest:`Start new conversation`,loggedInAs:`Logged in as {name}`,loggedIn:`Logged in`,dismissLoginPrompt:`Hide`,emailTranscript:`Email transcript`,emailTranscriptPrompt:`Get a copy of this conversation by email.`,emailTranscriptEmailLabel:`Email address`,emailTranscriptSend:`Send transcript`,emailTranscriptSending:`Sending…`,emailTranscriptSent:`Sent to {email}.`,emailTranscriptAlreadySent:`This conversation was already emailed. Send a new message to email it again.`,emailTranscriptLimited:`You've reached the limit for now. Try again later.`,emailTranscriptFailed:`Couldn't send it. Try again.`,emailTranscriptNotDelivered:`Couldn't send to this address. Check it and try again.`,emailTranscriptCancel:`Cancel`,emailTranscriptDone:`Done`,stop:`Stop`,theme:`Theme`,themeAuto:`Auto`,themeDark:`Dark`,themeLight:`Light`,textSize:`Text size`,textSizeSmall:`Small`,textSizeNormal:`Normal`,textSizeLarge:`Large`,loading:`Loading…`,visualPreparing:`Preparing visual…`,visualError:`This visual could not be displayed.`,visualPartial:`Some parts of this visual could not be displayed.`,visualSoldOut:`Sold out`,visualCartEmpty:`Your cart is empty.`,visualQuantity:`Qty`,visualChoose:`Choose`,thinking:`Thinking…`,thought:`Thought`,thoughtFor:`Thought for {time}`,toolResult:`Result`,sources:`Sources`,feedbackUp:`Good response`,feedbackDown:`Bad response`,feedbackThanks:`Thanks for your feedback`,copy:`Copy`,copied:`Copied`,copyTicketReference:`Ticket {reference}, copy`,tabHome:`Home`,tabConversations:`Chats`,tabHelp:`Help`,tabNews:`News`,modulesEmpty:`Nothing here yet`,chatUnavailable:`This chat isn't available right now`,moduleBack:`Back`,contentLoading:`Loading…`,contentHelpful:`Was this helpful?`,homeGreeting:`How can we help?`,homeGreetingNamed:`Hi {name} 👋`,homeGreetingLead:`How can we help?`,homeSearchPlaceholder:`Search for help`,homeAskPlaceholder:`Ask a question…`,homeWhatsNew:`What's new`,homeContentTitle:`Popular articles`,homeStatus:`Status`,helpTitle:`Help`,helpSearchPlaceholder:`Search for help`,helpEmpty:`No help articles yet`,helpLoading:`Loading help…`,helpSearchEmpty:`No results for “{query}”`,helpShowMore:`Show more`,newsTitle:`News`,newsEmpty:`No news yet`,newsLoading:`Loading news…`,newsShowMore:`Show more`,newsUnseen:`New post`,unread:`Unread`,formRequired:`This field is required`,formInvalidEmail:`Enter a valid email address`,formInvalidTel:`Enter a valid phone number`,formInvalidNumber:`Enter a valid number`,formOtherPlaceholder:`Type your answer…`,inputRequired:`Questions for you`,askFallbackQuestion:`Please provide the missing information.`,inputBadge:`Questions`,inputAnswered:`Answered`,inputSkipped:`Skipped`,showOptions:`Show options`,hideOptions:`Hide options`,qtypeText:`Your answer`,qtypeEmail:`Email address`,qtypePhone:`Phone number`,qtypeNumber:`Number`,qtypeDate:`Date`,qtypeChooseOne:`Pick one`,qtypeChooseAny:`Pick any`,qtypeBoolean:`Yes / No`,inputSubmit:`Submit answers`,inputSubmitHint:`Enter to send · Shift+Enter = new line`,inputSkip:`Skip`,confirmYes:`Yes`,confirmNo:`No`,approve:`Approve`,decline:`Decline`,changeAnswer:`Change answer`,approvalPrompt:`{action}?`,approvalEditHint:`You can change your answer until this step continues.`,stepInput:`Input`,stepWorking:`Working`,stepWorkingOnIt:`Working on it…`,stepNeedsYourApproval:`Needs your approval`,stepWaitingForVisitor:`Waiting for the visitor`,stepApproved:`Approved`,stepDeclined:`Declined`,stepReplaced:`Replaced`,stepFailed:`Failed`,stepDidNotWork:`Didn't work`,decidedYouApproved:`You approved`,decidedYouDeclined:`You declined`,decidedVisitorApproved:`Visitor approved`,decidedVisitorDeclined:`Visitor declined`,decidedTeamApproved:`Approved by a team member`,decidedTeamDeclined:`Declined by a team member`,decidedMemberApproved:`Approved by {name}`,decidedMemberDeclined:`Declined by {name}`,stepRawData:`Raw data`,decidedRulesApproved:`Auto-approved`,decidedRulesDeclined:`Auto-declined`,edit:`Edit`,statusError:`Error`,toolStepsFailed:`{count} failed`,statusStopped:`Stopped`,toolStepsStopped:`Stopped after {count} steps`,toolStepsStoppedOne:`Stopped after 1 step`},t=[`none`,`values`,`table`,`json`,`table-and-json`];function n(e){return typeof e==`string`&&t.some(t=>t===e)}const r={simple:{showSteps:!1,stepDetails:`values`,showStepSystem:!1,showDecidedBy:!1,foldApprovals:!0},technical:{showSteps:!0,stepDetails:`table-and-json`,showStepSystem:!0,showDecidedBy:!0,foldApprovals:!0}},i=[`showSteps`,`showStepSystem`,`showDecidedBy`,`foldApprovals`],a=[...i,`stepDetails`];function o(e){let t={};if(typeof e!=`object`||!e)return t;for(let n of i){let r=Reflect.get(e,n);typeof r==`boolean`&&(t[n]=r)}let r=Reflect.get(e,`stepDetails`);return n(r)&&(t.stepDetails=r),t}function s(e){return Object.hasOwn(r,e)}function c(e,t){return{...r[t],...e}}function l(e){return Object.keys(r).filter(s).find(t=>a.every(n=>r[t][n]===e[n]))}const u=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function d(e){let t=e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[_-]+/g,` `).trim().toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)}function f(e){if(e.title)return e.title;let t=e.toolName.replace(/^tool[:-]/,``),n=t.indexOf(`__`);return d(n>0?t.slice(n+2):t)}function p(e,t,n){let r=e.approval;return r?.replacedByMessageId?`replaced`:e.state===`output-available`?n.error===void 0?`done`:`failed`:e.state===`output-error`?t.interrupted?`stopped`:`failed`:e.state===`output-denied`||r?.approved===!1?`declined`:e.state===`approval-responded`||r?.approved===!0?t.cutOff?`stopped`:`approved`:e.state===`approval-requested`?t.submitted?`submitted`:t.cutOff?`stopped`:t.superseded?`replaced`:`waiting`:t.live?`running`:`stopped`}function m(e,t){if(e.isAutomatic)return`rules`;let n=e.respondedBy;return n?.visitorId?`visitor`:n?.userId?n.userId===t.userId?`you`:`teamMember`:t.decides?`you`:`visitor`}function h(e,t,n,r){let i=r[t?`stepApproved`:`stepDeclined`];if(e===`teamMember`&&n)return{label:i,title:r[t?`decidedMemberApproved`:`decidedMemberDeclined`].replace(`{name}`,n)};let a=r[g[e][+!t]];return e===`you`?{label:i,title:a}:{label:a,title:a}}const g={you:[`decidedYouApproved`,`decidedYouDeclined`],visitor:[`decidedVisitorApproved`,`decidedVisitorDeclined`],teamMember:[`decidedTeamApproved`,`decidedTeamDeclined`],rules:[`decidedRulesApproved`,`decidedRulesDeclined`]};function _(e,t){switch(e){case`running`:return t.strings.stepWorking;case`waiting`:return t.reader.decides?t.strings.stepNeedsYourApproval:t.strings.stepWaitingForVisitor;case`submitted`:return t.strings.stepWorkingOnIt;case`approved`:return t.strings.stepApproved;case`declined`:return t.strings.stepDeclined;case`replaced`:return t.strings.stepReplaced;case`stopped`:return t.strings.statusStopped;case`failed`:return t.display.stepDetails===`none`||t.display.stepDetails===`values`?t.strings.stepDidNotWork:t.strings.stepFailed;case`done`:return``;default:return e}}function v(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function y(e){return typeof e==`string`?e.trim():typeof e==`number`||typeof e==`boolean`?String(e):``}function b(e){return y(e)||(typeof e==`object`&&e?JSON.stringify(e):``)}function x(e){if(!v(e))return b(e);let[t,...n]=Object.values(e).map(b).filter(Boolean);return t===void 0?``:n.length>0?`${t} (${n.join(`, `)})`:t}function S(e,t){if(!v(e))return[];let n=[];function r(e,i){if(Array.isArray(e)){let t=e.map(x).filter(Boolean).join(`, `);t&&n.push({path:i,value:t});return}if(v(e)){for(let[t,n]of Object.entries(e))r(n,[...i,t]);return}let a=y(e);a&&(t.withIds||!u.test(a))&&n.push({path:i,value:a})}r(e,[]);let i=n.map(({path:e})=>d(e.at(-1)??``));return n.map(({path:e,value:t},n)=>{let r=i[n]??``;return{label:i.filter(e=>e===r).length>1&&e.length>1?`${d(e.at(-2)??``)} · ${r.toLowerCase()}`:r,value:t}})}function C(e,t){if(v(e))return Object.entries(e).find(e=>e[0]!==t&&typeof e[1]==`string`&&e[1].trim().length>0&&!u.test(e[1].trim()))?.[1].trim()}function w(e){if(typeof e.toolMetadata?.system==`string`)return e.toolMetadata.system;let t=e.toolMetadata?.systemField,n=typeof t==`string`&&v(e.input)?e.input[t]:void 0;return typeof n==`string`&&n.trim()?n.trim():void 0}function T(e,t=1/0){if(e==null)return;let n=typeof e==`string`?e:JSON.stringify(e,null,2);if(n&&n!==`{}`&&n!==`[]`&&n!==`""`)return n.length>t?`${n.slice(0,t)}…`:n}function E(e){let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`))return e;try{return JSON.parse(t)}catch{return e}}function D(e){if(v(e)&&e.storage===`tool-result-ref`&&`summary`in e)return D(e.summary);if(v(e)&&Array.isArray(e.content)){let t=e.content.flatMap(e=>v(e)&&typeof e.text==`string`?[e.text]:[]).join(`
2
- `),n=v(e.structuredContent)?e.structuredContent:E(t);return e.isError===!0?{value:n,error:v(n)&&typeof n.error==`string`?n.error:t}:{value:n}}return v(e)&&typeof e.error==`string`&&typeof e.instruction==`string`?{value:e,error:e.error}:{value:e}}function O(e){return T(e.input)!==void 0||T(e.output)!==void 0||!!e.errorText}function k(e,t,n){let{display:r}=n,i=e.approval;if(typeof e.toolMetadata?.card==`string`&&i)return`card`;let a=i!==void 0&&!i.isAutomatic;if(a&&A(e,n.turn))return`card`;let o=t.decision?.by===`you`||a&&t.decision===void 0&&n.reader.decides;return a&&o?r.foldApprovals?`step`:`card`:a?r.showSteps||r.showDecidedBy?r.foldApprovals?`step`:`card`:`hidden`:i?.isAutomatic?r.showSteps||r.showDecidedBy?`step`:`hidden`:r.showSteps&&O(e)?`step`:`hidden`}function A(e,t){return e.approval?.replacedByMessageId||(t.superseded||t.cutOff)&&e.approval?.approved===void 0?!1:e.state===`approval-requested`||e.state===`approval-responded`}function j(e,t){let{turn:n,reader:r,display:i,strings:a}=t,o=D(e.output),s=p(e,n,o),c=e.approval,l=c?.replacedByMessageId?void 0:c?.approved,u=c&&l!==void 0?m(c,r):void 0,d=u===`teamMember`?c?.respondedBy?.userId:void 0,g=u&&l!==void 0&&(u===`you`||i.showDecidedBy)?{approved:l,by:u,...h(u,l,d&&t.names?.get(d),a),...d?{userId:d}:{}}:void 0,v=f(e),y=i.showStepSystem||e.toolMetadata?.nameShared===!0?w(e):void 0,b=C(e.input,typeof e.toolMetadata?.systemField==`string`?e.toolMetadata.systemField:void 0),x=e.errorText??o.error,E=i.stepDetails===`table`||i.stepDetails===`table-and-json`,O=E&&o.error===void 0?S(o.value,{withIds:!0}):[],j=i.stepDetails===`json`||i.stepDetails===`table-and-json`?{input:T(e.input),output:T(o.value,4e3)}:void 0,N=c!==void 0&&!c.isAutomatic&&!e.toolMetadata?.card,P=c!==void 0&&!c.isAutomatic&&A(e,n),F=i.stepDetails===`none`&&!P?[]:S(e.input,{withIds:E||P}),I=x!==void 0&&x!==``&&i.stepDetails!==`none`&&i.stepDetails!==`values`,L=g?.by===`rules`&&i.stepDetails!==`none`?c?.reason:void 0,R={toolCallId:e.toolCallId,placement:`hidden`,...typeof e.toolMetadata?.card==`string`&&c?{card:e.toolMetadata.card}:{},name:v,...y?{system:y}:{},status:s,statusLabel:_(s,{reader:r,display:i,strings:a}),...g?{decision:g}:{},...L?{reason:L}:{},...b?{summary:b}:{},fields:F,tables:E,...O.length>0?{resultFields:O}:{},...I?{error:x}:{},...j?{raw:j}:{},opens:F.length>0||O.length>0||j!==void 0||I||L!==void 0,...N?{approval:M(e,s,{turn:n,reader:r,strings:a,name:v})}:{}};return{...R,placement:k(e,R,{turn:n,reader:r,display:i})}}function M(e,t,n){let r=n.strings.approvalPrompt.replace(`{action}`,n.name);return t===`waiting`?{ask:r,buttons:n.reader.decides?`decide`:`none`}:t===`submitted`||!A(e,n.turn)?{ask:r,buttons:`none`}:n.turn.canAct&&n.reader.decides?{ask:r,buttons:`change`,note:n.strings.approvalEditHint}:t===`approved`?{ask:r,buttons:`none`,note:n.strings.stepWorkingOnIt}:{ask:r,buttons:`none`}}function N(e){let t=/* @__PURE__ */ new Map;for(let n of e)t.set(n.name,(t.get(n.name)??0)+1);let n=/* @__PURE__ */ new Map;for(let{decision:t}of e){if(!t)continue;let e=n.get(t.title)??{approved:t.approved,label:t.label,title:t.title,...t.userId?{userId:t.userId}:{},count:0};n.set(t.title,{...e,count:e.count+1})}let[r]=e,i=e.some(e=>e.status===`stopped`);return{tools:[...t].map(([e,t])=>({name:e,count:t})),...e.length===1&&r?{single:{name:r.name,...r.system?{system:r.system}:{},...r.summary?{summary:r.summary}:{},...P(r)}}:{},marks:[...n.values()].map(({count:e,...t})=>Object.assign(t,{label:e>1?`${t.label} ×${e}`:t.label})),failed:e.filter(e=>e.status===`failed`).length,...i?{stopped:{finished:e.filter(e=>e.status!==`stopped`).length}}:{}}}function P(e){return!e.decision&&(e.status===`replaced`||e.status===`declined`)?{outcome:e.statusLabel}:{}}function F(e,t){return e===0?t.statusStopped:e===1?t.toolStepsStoppedOne:t.toolStepsStopped.replace(`{count}`,String(e))}const I=e;export{t as STEP_DETAILS,a as STEP_DISPLAY_KEYS,r as STEP_DISPLAY_PRESETS,i as STEP_DISPLAY_SWITCHES,I as STEP_STRINGS_EN,n as isStepDetails,s as isStepDisplayPreset,l as matchStepDisplayPreset,d as nameInWords,T as rawText,o as readStepDisplay,c as resolveStepDisplay,j as stepCallView,S as stepFields,N as stepGroupLine,f as stepName,D as stepResult,F as stoppedLineLabel};
1
+ const e={attach:`Attach files`,file:`File`,attachmentMimeRejected:`{name} isn't a file type this chat accepts.`,attachmentTooLarge:`{name} is too large. Files can be up to {max} together.`,poweredBy:`Powered by {name}`,attachmentTooMany:`The attachment limit is {count}.`,attachmentUploadFailed:`{name} couldn't be uploaded.`,conversationLoading:`Loading chat…`,loadPreviousMessages:`Load previous messages`,close:`Close`,collapse:`Collapse`,collapseSidebar:`Collapse sidebar`,composerPlaceholder:`Type a message…`,dateLastWeek:`Last 7 days`,dateOlder:`Older`,dateToday:`Today`,dateYesterday:`Yesterday`,dropZone:`Drop files to attach`,dropZoneRejected:`These files can't be attached here`,errorGeneric:`Something went wrong`,errorRateLimited:`Too many requests — please try again in a moment.`,errorRateLimitedIn:`Too many requests — please try again in {seconds} s.`,errorOffline:`Can't reach the server. Check your connection and try again.`,errorServer:`Something went wrong on our side. Please try again.`,errorOriginNotAllowed:`This chat isn't set up for this website yet.`,errorMessageTooLong:`That message is too long. Shorten it and send it again.`,errorReconnecting:`Connection lost. Reconnecting…`,errorRetry:`Retry`,expand:`Expand`,expandSidebar:`Expand sidebar`,exitFullscreen:`Exit fullscreen`,fullscreen:`Fullscreen`,history:`History`,historyBack:`Back to chat`,historyEmpty:`No previous chats yet`,historyLoading:`Loading your chats…`,historyContinue:`Continue the chat`,historyTitle:`Chat history`,loadMoreConversations:`Load more conversations`,language:`Language`,launcherOpen:`Open chat`,launcherAsk:`Ask {name}`,micBlocked:`The microphone is blocked for this site, so voice input can't start.`,micStart:`Start voice input`,micStop:`Stop voice input`,moreActions:`More actions`,newConversation:`New chat`,panelTitle:`Chat`,popOut:`Open in new tab`,resizeHandle:`Drag to resize`,scrollToBottom:`Scroll to latest`,send:`Send`,queueMessage:`Queue message`,removeQueuedMessage:`Remove queued message`,removeAttachment:`Remove {name}`,suggestedReplies:`Suggested replies`,compactingContext:`Optimizing conversation context…`,soundOff:`Sound off`,soundOn:`Sound on`,talkToOperator:`Talk to a person`,connectingOperator:`Connecting you to a person…`,noOperatorAvailable:`No one's available right now — leave your details and we'll follow up.`,chattingWithOperator:`You're chatting with {operator}`,operatorBadgeTitle:`Live chat`,chatNotice:`You're chatting with an AI assistant.`,cancelOperatorRequest:`Keep chatting with the AI`,loginPrompt:`Log in for faster, more personalized support`,loginAction:`Log in`,loginRequired:`Log in to chat with us`,loginExpired:`Your login expired. Log in to continue this chat.`,loginExpiredGuest:`Your login expired. Log in to continue this chat, or start a new conversation as a guest.`,startAsGuest:`Start new conversation`,loggedInAs:`Logged in as {name}`,loggedIn:`Logged in`,dismissLoginPrompt:`Hide`,emailTranscript:`Email transcript`,emailTranscriptPrompt:`Get a copy of this conversation by email.`,emailTranscriptEmailLabel:`Email address`,emailTranscriptSend:`Send transcript`,emailTranscriptSending:`Sending…`,emailTranscriptSent:`Sent to {email}.`,emailTranscriptAlreadySent:`This conversation was already emailed. Send a new message to email it again.`,emailTranscriptLimited:`You've reached the limit for now. Try again later.`,emailTranscriptFailed:`Couldn't send it. Try again.`,emailTranscriptNotDelivered:`Couldn't send to this address. Check it and try again.`,emailTranscriptCancel:`Cancel`,emailTranscriptDone:`Done`,stop:`Stop`,theme:`Theme`,themeAuto:`Auto`,themeDark:`Dark`,themeLight:`Light`,textSize:`Text size`,textSizeSmall:`Small`,textSizeNormal:`Normal`,textSizeLarge:`Large`,loading:`Loading…`,visualPreparing:`Preparing visual…`,visualError:`This visual could not be displayed.`,visualPartial:`Some parts of this visual could not be displayed.`,visualSoldOut:`Sold out`,visualCartEmpty:`Your cart is empty.`,visualQuantity:`Qty`,visualChoose:`Choose`,thinking:`Thinking…`,thought:`Thought`,thoughtFor:`Thought for {time}`,toolResult:`Result`,sources:`Sources`,feedbackUp:`Good response`,feedbackDown:`Bad response`,feedbackThanks:`Thanks for your feedback`,copy:`Copy`,copied:`Copied`,copyTicketReference:`Ticket {reference}, copy`,tabHome:`Home`,tabConversations:`Chats`,tabHelp:`Help`,tabNews:`News`,modulesEmpty:`Nothing here yet`,chatUnavailable:`This chat isn't available right now`,moduleBack:`Back`,contentLoading:`Loading…`,contentHelpful:`Was this helpful?`,homeGreeting:`How can we help?`,homeGreetingNamed:`Hi {name} 👋`,homeGreetingLead:`How can we help?`,homeSearchPlaceholder:`Search for help`,homeAskPlaceholder:`Ask a question…`,homeWhatsNew:`What's new`,homeContentTitle:`Popular articles`,homeStatus:`Status`,helpTitle:`Help`,helpSearchPlaceholder:`Search for help`,helpEmpty:`No help articles yet`,helpLoading:`Loading help…`,helpSearchEmpty:`No results for “{query}”`,helpShowMore:`Show more`,newsTitle:`News`,newsEmpty:`No news yet`,newsLoading:`Loading news…`,newsShowMore:`Show more`,newsUnseen:`New post`,unread:`Unread`,formRequired:`This field is required`,formInvalidEmail:`Enter a valid email address`,formInvalidTel:`Enter a valid phone number`,formInvalidNumber:`Enter a valid number`,formOtherPlaceholder:`Type your answer…`,inputRequired:`Questions for you`,askFallbackQuestion:`Please provide the missing information.`,inputBadge:`Questions`,inputAnswered:`Answered`,inputSkipped:`Skipped`,showOptions:`Show options`,hideOptions:`Hide options`,qtypeText:`Your answer`,qtypeEmail:`Email address`,qtypePhone:`Phone number`,qtypeNumber:`Number`,qtypeDate:`Date`,qtypeChooseOne:`Pick one`,qtypeChooseAny:`Pick any`,qtypeBoolean:`Yes / No`,inputSubmit:`Submit answers`,inputSubmitHint:`Enter to send · Shift+Enter = new line`,inputSkip:`Skip`,confirmYes:`Yes`,confirmNo:`No`,approve:`Approve`,decline:`Decline`,changeAnswer:`Change answer`,approvalPrompt:`{action}?`,approvalEditHint:`You can change your answer until this step continues.`,stepInput:`Input`,stepWorking:`Working`,stepWorkingOnIt:`Working on it…`,stepNeedsYourApproval:`Needs your approval`,stepWaitingForVisitor:`Waiting for the visitor`,stepApproved:`Approved`,stepDeclined:`Declined`,stepReplaced:`Replaced`,stepFailed:`Failed`,stepDidNotWork:`Didn't work`,decidedYouApproved:`You approved`,decidedYouDeclined:`You declined`,decidedVisitorApproved:`Visitor approved`,decidedVisitorDeclined:`Visitor declined`,decidedTeamApproved:`Approved by a team member`,decidedTeamDeclined:`Declined by a team member`,decidedMemberApproved:`Approved by {name}`,decidedMemberDeclined:`Declined by {name}`,stepRawData:`Raw data`,decidedRulesApproved:`Auto-approved`,decidedRulesDeclined:`Auto-declined`,edit:`Edit`,toolStepsFailed:`{count} failed`,statusStopped:`Stopped`,toolStepsStopped:`Stopped after {count} steps`,toolStepsStoppedOne:`Stopped after 1 step`},t=[`decided`,`auto-decided`,`unasked`,`failed`],n=[`platform`,`mcp`,`api`,`webmcp`],r=[`none`,`values`,`table`,`json`,`table-and-json`];function i(e,t){return typeof t==`string`&&e.some(e=>e===t)}const a={visitor:{stepsFrom:n,stepsShown:[],stepDetails:`values`,showStepSystem:!1,showDecidedBy:!1,foldApprovals:!0},member:{stepsFrom:n,stepsShown:t,stepDetails:`table-and-json`,showStepSystem:!0,showDecidedBy:!0,foldApprovals:!0}},o=[`showStepSystem`,`showDecidedBy`,`foldApprovals`];function s(e){let a={};if(typeof e!=`object`||!e)return a;for(let t of o){let n=Reflect.get(e,t);typeof n==`boolean`&&(a[t]=n)}let s=Reflect.get(e,`stepsFrom`);Array.isArray(s)&&(a.stepsFrom=n.filter(e=>s.includes(e)));let c=Reflect.get(e,`stepsShown`);Array.isArray(c)&&(a.stepsShown=t.filter(e=>c.includes(e)));let l=Reflect.get(e,`stepDetails`);return i(r,l)&&(a.stepDetails=l),a}function c(e,t){return{...a[t],...e}}const l=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function u(e){let t=e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[_-]+/g,` `).trim().toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)}function d(e){if(e.title)return e.title;let t=e.toolName.replace(/^tool[:-]/,``),n=t.indexOf(`__`);return u(n>0?t.slice(n+2):t)}function f(e,t,n){let r=e.approval;return r?.replacedByMessageId?`replaced`:e.state===`output-available`?n.error===void 0?`done`:`failed`:e.state===`output-error`?t.interrupted?`stopped`:`failed`:e.state===`output-denied`||r?.approved===!1?`declined`:e.state===`approval-responded`||r?.approved===!0?t.cutOff?`stopped`:`approved`:e.state===`approval-requested`?t.submitted?`submitted`:t.cutOff?`stopped`:t.superseded?`replaced`:`waiting`:t.live?`running`:`stopped`}function p(e,t){if(e.isAutomatic)return`rules`;let n=e.respondedBy;return n?.visitorId?`visitor`:n?.userId?n.userId===t.userId?`you`:`teamMember`:t.decides?`you`:`visitor`}function m(e,t,n,r,i){let a=r[t?`inputAnswered`:`inputSkipped`];if(i)return{label:a,title:a};let o=r[t?`stepApproved`:`stepDeclined`];if(e===`teamMember`&&n)return{label:o,title:r[t?`decidedMemberApproved`:`decidedMemberDeclined`].replace(`{name}`,n)};let s=r[h[e][+!t]];return e===`you`?{label:o,title:s}:{label:s,title:s}}const h={you:[`decidedYouApproved`,`decidedYouDeclined`],visitor:[`decidedVisitorApproved`,`decidedVisitorDeclined`],teamMember:[`decidedTeamApproved`,`decidedTeamDeclined`],rules:[`decidedRulesApproved`,`decidedRulesDeclined`]};function g(e,t){switch(e){case`running`:return t.strings.stepWorking;case`waiting`:return t.reader.decides?t.strings.stepNeedsYourApproval:t.strings.stepWaitingForVisitor;case`submitted`:return t.strings.stepWorkingOnIt;case`approved`:return t.strings.stepApproved;case`declined`:return t.card?t.strings.inputSkipped:t.strings.stepDeclined;case`replaced`:return t.card?t.strings.inputSkipped:t.strings.stepReplaced;case`stopped`:return t.strings.statusStopped;case`failed`:return t.plain?t.strings.stepDidNotWork:t.strings.stepFailed;case`done`:return``;default:return e}}function _(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function v(e){return typeof e==`string`?e.trim():typeof e==`number`||typeof e==`boolean`?String(e):``}function y(e){return v(e)||(typeof e==`object`&&e?JSON.stringify(e):``)}function b(e){if(!_(e))return y(e);let[t,...n]=Object.values(e).map(y).filter(Boolean);return t===void 0?``:n.length>0?`${t} (${n.join(`, `)})`:t}function x(e,t){if(!_(e))return[];let n=[];function r(e,i){if(Array.isArray(e)){let t=e.map(b).filter(Boolean).join(`, `);t&&n.push({path:i,value:t});return}if(_(e)){for(let[t,n]of Object.entries(e))r(n,[...i,t]);return}let a=v(e);a&&(t.withIds||!l.test(a))&&n.push({path:i,value:a})}r(e,[]);let i=n.map(({path:e})=>u(e.at(-1)??``));return n.map(({path:e,value:t},n)=>{let r=i[n]??``;return{label:i.filter(e=>e===r).length>1&&e.length>1?`${u(e.at(-2)??``)} · ${r.toLowerCase()}`:r,value:t}})}function S(e,t){if(_(e))return Object.entries(e).find(e=>e[0]!==t&&typeof e[1]==`string`&&e[1].trim().length>0&&!l.test(e[1].trim()))?.[1].trim()}function C(e){if(typeof e.toolMetadata?.system==`string`)return e.toolMetadata.system;let t=e.toolMetadata?.systemField,n=typeof t==`string`&&_(e.input)?e.input[t]:void 0;return typeof n==`string`&&n.trim()?n.trim():void 0}function w(e,t=1/0){if(e==null)return;let n=typeof e==`string`?e:JSON.stringify(e,null,2);if(n&&n!==`{}`&&n!==`[]`&&n!==`""`)return n.length>t?`${n.slice(0,t)}…`:n}function T(e){let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`))return e;try{return JSON.parse(t)}catch{return e}}function E(e){if(_(e)&&e.storage===`tool-result-ref`&&`summary`in e)return E(e.summary);if(_(e)&&Array.isArray(e.content)){let t=e.content.flatMap(e=>_(e)&&typeof e.text==`string`?[e.text]:[]).join(`
2
+ `),n=_(e.structuredContent)?e.structuredContent:T(t);return e.isError===!0?{value:n,error:_(n)&&typeof n.error==`string`?n.error:t}:{value:n}}return _(e)&&typeof e.error==`string`&&typeof e.instruction==`string`?{value:e,error:e.error}:{value:e}}function D(e){return w(e.input)!==void 0||w(e.output)!==void 0||!!e.errorText}function O(e,t){let n=e.approval?`decided`:`unasked`,r=e.approval?.isAutomatic?`auto-decided`:n;return t===`failed`?[r,`failed`]:[r]}function k(e){let t=e.toolMetadata?.origin;return i(n,t)?t:void 0}function A(e,t,n){let{display:r}=n,i=e.approval,a=i!==void 0&&!i.isAutomatic;if(a&&j(e,n.turn))return`card`;let o=n.by===`you`||a&&n.by===void 0&&n.reader.decides,s=k(e),c=(s===void 0||r.stepsFrom.includes(s))&&O(e,t.status).some(e=>r.stepsShown.includes(e));return!(o||c)||!i&&!D(e)?`hidden`:a&&!r.foldApprovals?`card`:`step`}function j(e,t){return e.approval?.replacedByMessageId||(t.superseded||t.cutOff)&&e.approval?.approved===void 0?!1:e.state===`approval-requested`||e.state===`approval-responded`}function M(e,t){let{turn:n,reader:r,display:i,strings:a}=t,o=E(e.output),s=f(e,n,o),c=e.approval,l=c!==void 0&&!c.isAutomatic,u=typeof e.toolMetadata?.card==`string`?e.toolMetadata.card:void 0,h=i.stepDetails,_=h===`table`||h===`table-and-json`,v=h===`none`||h===`values`,y=c?.replacedByMessageId?void 0:c?.approved,b=c&&y!==void 0?p(c,r):void 0,T=b===`teamMember`?c?.respondedBy?.userId:void 0,D=b&&y!==void 0&&(b===`you`||b===`rules`||i.showDecidedBy)?{approved:y,by:b,...m(b,y,T&&t.names?.get(T),a,u!==void 0),...T?{userId:T}:{}}:void 0,O=d(e),k=i.showStepSystem||e.toolMetadata?.nameShared===!0?C(e):void 0,M=S(e.input,typeof e.toolMetadata?.systemField==`string`?e.toolMetadata.systemField:void 0),P=e.errorText??o.error,F=_&&o.error===void 0?x(o.value,{withIds:!0}):[],I=h===`json`||h===`table-and-json`?{input:w(e.input),output:w(o.value,4e3)}:void 0,L=l&&j(e,n),R=h===`none`&&!L?[]:x(e.input,{withIds:_||L}),z=P!==void 0&&P!==``&&!v,B=D?.by===`rules`&&h!==`none`?c?.reason:void 0,V=D!==void 0&&(s===`approved`||s===`declined`),H={toolCallId:e.toolCallId,placement:`hidden`,...u&&c?{card:u}:{},name:O,...k?{system:k}:{},status:s,statusLabel:V?``:g(s,{reader:r,strings:a,card:u!==void 0,plain:v}),...D?{decision:D}:{},...B?{reason:B}:{},...M?{summary:M}:{},fields:R,tables:_,...F.length>0?{resultFields:F}:{},...z?{error:P}:{},...I?{raw:I}:{},opens:R.length>0||F.length>0||I!==void 0||z||B!==void 0,...l&&!u?{approval:N(e,s,{turn:n,reader:r,strings:a,name:O})}:{}};return{...H,placement:A(e,H,{turn:n,reader:r,display:i,by:b})}}function N(e,t,n){let r=n.strings.approvalPrompt.replace(`{action}`,n.name);return t===`waiting`?{ask:r,buttons:n.reader.decides?`decide`:`none`}:t===`submitted`||!j(e,n.turn)?{ask:r,buttons:`none`}:n.turn.canAct&&n.reader.decides?{ask:r,buttons:`change`,note:n.strings.approvalEditHint}:t===`approved`?{ask:r,buttons:`none`,note:n.strings.stepWorkingOnIt}:{ask:r,buttons:`none`}}function P(e){let t=/* @__PURE__ */ new Map;for(let n of e)t.set(n.name,(t.get(n.name)??0)+1);let n=/* @__PURE__ */ new Map;for(let{decision:t}of e){if(!t)continue;let e=n.get(t.title)??{approved:t.approved,label:t.label,title:t.title,...t.userId?{userId:t.userId}:{},count:0};n.set(t.title,{...e,count:e.count+1})}let[r]=e,i=e.some(e=>e.status===`stopped`);return{tools:[...t].map(([e,t])=>({name:e,count:t})),...e.length===1&&r?{single:{name:r.name,...r.system?{system:r.system}:{},...r.summary?{summary:r.summary}:{},...F(r)}}:{},marks:[...n.values()].map(({count:e,...t})=>Object.assign(t,{label:e>1?`${t.label} ×${e}`:t.label})),failed:e.filter(e=>e.status===`failed`).length,...i?{stopped:{finished:e.filter(e=>e.status!==`stopped`).length}}:{}}}function F(e){return!e.decision&&(e.status===`replaced`||e.status===`declined`)?{outcome:e.statusLabel}:{}}function I(e,t){return e===0?t.statusStopped:e===1?t.toolStepsStoppedOne:t.toolStepsStopped.replace(`{count}`,String(e))}const L=e;export{r as STEP_DETAILS,a as STEP_DISPLAY_DEFAULTS,o as STEP_DISPLAY_SWITCHES,t as STEP_KINDS,n as STEP_ORIGINS,L as STEP_STRINGS_EN,s as readStepDisplay,c as resolveStepDisplay,M as stepCallView,x as stepFields,P as stepGroupLine,I as stoppedLineLabel};
3
3
  //# sourceMappingURL=step-display.mjs.map
@@ -46,7 +46,7 @@ interface ClientStorage {
46
46
  /** Removes `key`. No-op if absent. */
47
47
  remove(key: string): void;
48
48
  }
49
- type StringKey = 'launcherOpen' | 'launcherAsk' | 'panelTitle' | 'composerPlaceholder' | 'send' | 'stop' | 'queueMessage' | 'removeQueuedMessage' | 'removeAttachment' | 'suggestedReplies' | 'compactingContext' | 'attach' | 'file' | 'micBlocked' | 'micStart' | 'micStop' | 'expand' | 'collapse' | 'fullscreen' | 'exitFullscreen' | 'popOut' | 'resizeHandle' | 'scrollToBottom' | 'close' | 'moreActions' | 'soundOn' | 'soundOff' | 'language' | 'theme' | 'themeAuto' | 'themeLight' | 'themeDark' | 'textSize' | 'textSizeSmall' | 'textSizeNormal' | 'textSizeLarge' | 'history' | 'historyTitle' | 'historyEmpty' | 'historyLoading' | 'historyBack' | 'historyContinue' | 'loadMoreConversations' | 'conversationLoading' | 'loadPreviousMessages' | 'talkToOperator' | 'connectingOperator' | 'noOperatorAvailable' | 'chattingWithOperator' | 'operatorBadgeTitle' | 'chatNotice' | 'cancelOperatorRequest' | 'loginPrompt' | 'loginAction' | 'loginRequired' | 'loginExpired' | 'loginExpiredGuest' | 'startAsGuest' | 'loggedInAs' | 'loggedIn' | 'dismissLoginPrompt' | 'emailTranscript' | 'emailTranscriptPrompt' | 'emailTranscriptEmailLabel' | 'emailTranscriptSend' | 'emailTranscriptSending' | 'emailTranscriptSent' | 'emailTranscriptAlreadySent' | 'emailTranscriptLimited' | 'emailTranscriptFailed' | 'emailTranscriptNotDelivered' | 'emailTranscriptCancel' | 'emailTranscriptDone' | 'dateToday' | 'dateYesterday' | 'dateLastWeek' | 'dateOlder' | 'newConversation' | 'dropZone' | 'dropZoneRejected' | 'attachmentTooLarge' | 'poweredBy' | 'attachmentTooMany' | 'attachmentMimeRejected' | 'attachmentUploadFailed' | 'errorRetry' | 'errorGeneric' | 'errorRateLimited' | 'errorRateLimitedIn' | 'errorOffline' | 'errorServer' | 'errorOriginNotAllowed' | 'errorMessageTooLong' | 'errorReconnecting' | 'loading' | 'visualPreparing' | 'visualError' | 'visualPartial' | 'visualSoldOut' | 'visualCartEmpty' | 'visualQuantity' | 'visualChoose' | 'thinking' | 'thought' | 'thoughtFor' | 'toolResult' | 'sources' | 'feedbackUp' | 'feedbackDown' | 'feedbackThanks' | 'copy' | 'copied' | 'copyTicketReference' | 'collapseSidebar' | 'expandSidebar' | 'formRequired' | 'formInvalidEmail' | 'formInvalidTel' | 'formInvalidNumber' | 'formOtherPlaceholder' | 'inputRequired' | 'askFallbackQuestion' | 'inputBadge' | 'inputAnswered' | 'inputSkipped' | 'inputSubmit' | 'inputSubmitHint' | 'inputSkip' | 'showOptions' | 'hideOptions' | 'qtypeText' | 'qtypeEmail' | 'qtypePhone' | 'qtypeNumber' | 'qtypeDate' | 'qtypeChooseOne' | 'qtypeChooseAny' | 'qtypeBoolean' | 'confirmYes' | 'confirmNo' | 'approve' | 'decline' | 'changeAnswer' | 'approvalPrompt' | 'approvalEditHint' | 'stepInput' | 'stepWorking' | 'stepWorkingOnIt' | 'stepNeedsYourApproval' | 'stepWaitingForVisitor' | 'stepApproved' | 'stepDeclined' | 'stepReplaced' | 'stepFailed' | 'stepDidNotWork' | 'decidedYouApproved' | 'decidedYouDeclined' | 'decidedVisitorApproved' | 'decidedVisitorDeclined' | 'decidedTeamApproved' | 'decidedTeamDeclined' | 'decidedMemberApproved' | 'decidedMemberDeclined' | 'stepRawData' | 'decidedRulesApproved' | 'decidedRulesDeclined' | 'edit' | 'statusError' | 'toolStepsFailed' | 'statusStopped' | 'toolStepsStopped' | 'toolStepsStoppedOne' | 'tabHome' | 'tabConversations' | 'tabHelp' | 'tabNews' | 'modulesEmpty' | 'chatUnavailable' | 'moduleBack' | 'contentLoading' | 'contentHelpful' | 'homeGreeting' | 'homeGreetingNamed' | 'homeGreetingLead' | 'homeSearchPlaceholder' | 'homeAskPlaceholder' | 'homeWhatsNew' | 'homeContentTitle' | 'homeStatus' | 'helpTitle' | 'helpSearchPlaceholder' | 'helpEmpty' | 'helpLoading' | 'helpSearchEmpty' | 'helpShowMore' | 'newsTitle' | 'newsEmpty' | 'newsLoading' | 'newsShowMore' | 'newsUnseen' | 'unread';
49
+ type StringKey = 'launcherOpen' | 'launcherAsk' | 'panelTitle' | 'composerPlaceholder' | 'send' | 'stop' | 'queueMessage' | 'removeQueuedMessage' | 'removeAttachment' | 'suggestedReplies' | 'compactingContext' | 'attach' | 'file' | 'micBlocked' | 'micStart' | 'micStop' | 'expand' | 'collapse' | 'fullscreen' | 'exitFullscreen' | 'popOut' | 'resizeHandle' | 'scrollToBottom' | 'close' | 'moreActions' | 'soundOn' | 'soundOff' | 'language' | 'theme' | 'themeAuto' | 'themeLight' | 'themeDark' | 'textSize' | 'textSizeSmall' | 'textSizeNormal' | 'textSizeLarge' | 'history' | 'historyTitle' | 'historyEmpty' | 'historyLoading' | 'historyBack' | 'historyContinue' | 'loadMoreConversations' | 'conversationLoading' | 'loadPreviousMessages' | 'talkToOperator' | 'connectingOperator' | 'noOperatorAvailable' | 'chattingWithOperator' | 'operatorBadgeTitle' | 'chatNotice' | 'cancelOperatorRequest' | 'loginPrompt' | 'loginAction' | 'loginRequired' | 'loginExpired' | 'loginExpiredGuest' | 'startAsGuest' | 'loggedInAs' | 'loggedIn' | 'dismissLoginPrompt' | 'emailTranscript' | 'emailTranscriptPrompt' | 'emailTranscriptEmailLabel' | 'emailTranscriptSend' | 'emailTranscriptSending' | 'emailTranscriptSent' | 'emailTranscriptAlreadySent' | 'emailTranscriptLimited' | 'emailTranscriptFailed' | 'emailTranscriptNotDelivered' | 'emailTranscriptCancel' | 'emailTranscriptDone' | 'dateToday' | 'dateYesterday' | 'dateLastWeek' | 'dateOlder' | 'newConversation' | 'dropZone' | 'dropZoneRejected' | 'attachmentTooLarge' | 'poweredBy' | 'attachmentTooMany' | 'attachmentMimeRejected' | 'attachmentUploadFailed' | 'errorRetry' | 'errorGeneric' | 'errorRateLimited' | 'errorRateLimitedIn' | 'errorOffline' | 'errorServer' | 'errorOriginNotAllowed' | 'errorMessageTooLong' | 'errorReconnecting' | 'loading' | 'visualPreparing' | 'visualError' | 'visualPartial' | 'visualSoldOut' | 'visualCartEmpty' | 'visualQuantity' | 'visualChoose' | 'thinking' | 'thought' | 'thoughtFor' | 'toolResult' | 'sources' | 'feedbackUp' | 'feedbackDown' | 'feedbackThanks' | 'copy' | 'copied' | 'copyTicketReference' | 'collapseSidebar' | 'expandSidebar' | 'formRequired' | 'formInvalidEmail' | 'formInvalidTel' | 'formInvalidNumber' | 'formOtherPlaceholder' | 'inputRequired' | 'askFallbackQuestion' | 'inputBadge' | 'inputAnswered' | 'inputSkipped' | 'inputSubmit' | 'inputSubmitHint' | 'inputSkip' | 'showOptions' | 'hideOptions' | 'qtypeText' | 'qtypeEmail' | 'qtypePhone' | 'qtypeNumber' | 'qtypeDate' | 'qtypeChooseOne' | 'qtypeChooseAny' | 'qtypeBoolean' | 'confirmYes' | 'confirmNo' | 'approve' | 'decline' | 'changeAnswer' | 'approvalPrompt' | 'approvalEditHint' | 'stepInput' | 'stepWorking' | 'stepWorkingOnIt' | 'stepNeedsYourApproval' | 'stepWaitingForVisitor' | 'stepApproved' | 'stepDeclined' | 'stepReplaced' | 'stepFailed' | 'stepDidNotWork' | 'decidedYouApproved' | 'decidedYouDeclined' | 'decidedVisitorApproved' | 'decidedVisitorDeclined' | 'decidedTeamApproved' | 'decidedTeamDeclined' | 'decidedMemberApproved' | 'decidedMemberDeclined' | 'stepRawData' | 'decidedRulesApproved' | 'decidedRulesDeclined' | 'edit' | 'toolStepsFailed' | 'statusStopped' | 'toolStepsStopped' | 'toolStepsStoppedOne' | 'tabHome' | 'tabConversations' | 'tabHelp' | 'tabNews' | 'modulesEmpty' | 'chatUnavailable' | 'moduleBack' | 'contentLoading' | 'contentHelpful' | 'homeGreeting' | 'homeGreetingNamed' | 'homeGreetingLead' | 'homeSearchPlaceholder' | 'homeAskPlaceholder' | 'homeWhatsNew' | 'homeContentTitle' | 'homeStatus' | 'helpTitle' | 'helpSearchPlaceholder' | 'helpEmpty' | 'helpLoading' | 'helpSearchEmpty' | 'helpShowMore' | 'newsTitle' | 'newsEmpty' | 'newsLoading' | 'newsShowMore' | 'newsUnseen' | 'unread';
50
50
  /** A partial map for one locale — what overrides look like on the wire. */
51
51
  type LocaleStrings = Partial<Record<StringKey, string>>;
52
52
  /**
@@ -474,6 +474,23 @@ interface PresentationOptions {
474
474
  type PageToolCallStatus = 'completed' | 'failed' | 'interrupted';
475
475
  /** A 👍/👎 reaction on a rateable (assistant/operator) message; `null` clears a prior choice. */
476
476
  type FeedbackValue = 'up' | 'down' | null;
477
+ /**
478
+ * The kinds of steps a reader may choose to see, folded into one line under the reply: `decided`, it asked a person
479
+ * (a visitor or another member); `auto-decided`, the rules decided it; `unasked`, it ran without asking; `failed`, it
480
+ * failed, whoever decided it. A step has every kind that applies ("auto-decided" and "failed" both, for an approved
481
+ * call that then failed) and shows when any of them is chosen. The reader's own decisions and anything waiting on
482
+ * someone always show.
483
+ */
484
+ declare const STEP_KINDS: readonly ['decided', 'auto-decided', 'unasked', 'failed'];
485
+ type StepKind = (typeof STEP_KINDS)[number];
486
+ /**
487
+ * Where a step came from, as the server marks every call (`toolMetadata.origin`), set once where each family of tools
488
+ * is built: `platform`, help.ai's own tools; `mcp`, an MCP server's (an integration, help.ai's own MCP included);
489
+ * `api`, a call to an API integration; `webmcp`, the page's own tools, run in the visitor's browser (those the site
490
+ * hands the widget and those the browser offers through WebMCP).
491
+ */
492
+ declare const STEP_ORIGINS: readonly ['platform', 'mcp', 'api', 'webmcp'];
493
+ type StepOrigin = (typeof STEP_ORIGINS)[number];
477
494
  /**
478
495
  * What an opened step shows: `none`, nothing (the step line alone, for a business that never shows a visitor's data
479
496
  * back); `values`, its values as quiet label and value lines without ids; `table`, tables of what it ran on (ids
@@ -482,15 +499,17 @@ type FeedbackValue = 'up' | 'down' | null;
482
499
  */
483
500
  declare const STEP_DETAILS: readonly ['none', 'values', 'table', 'json', 'table-and-json'];
484
501
  type StepDetails = (typeof STEP_DETAILS)[number];
485
- /** The settings, the same keys on a Deployment (`config.behavior.stepDisplay`) and in a member's Preferences. */
502
+ /** The settings, the same keys on a Deployment (`config.behavior.stepDisplay`) and in the dashboard's Message display. */
486
503
  interface StepDisplay {
487
- /** Every step appears as one folded line under the reply; off, only the steps that involve the reader do. */
488
- showSteps: boolean;
504
+ /** The origins whose steps may appear (`STEP_ORIGINS`), in any combination. */
505
+ stepsFrom: readonly StepOrigin[];
506
+ /** The kinds of steps that appear (`STEP_KINDS`), in any combination: a step from a chosen origin shows when any of its kinds is chosen. */
507
+ stepsShown: readonly StepKind[];
489
508
  /** What an opened step shows (`STEP_DETAILS`). */
490
509
  stepDetails: StepDetails;
491
510
  /** The system that ran a step follows its name: "Ship an order · BC Co. back office". */
492
511
  showStepSystem: boolean;
493
- /** Each approval says who decided it, and steps the rules decided show as steps. */
512
+ /** Each decision someone else or the rules made says who made it. */
494
513
  showDecidedBy: boolean;
495
514
  /** A decided approval folds into the steps line; off, it stays in the reply as a card. */
496
515
  foldApprovals: boolean;
@@ -506,7 +525,7 @@ interface BehaviorOptions {
506
525
  responseMode?: ResponseMode;
507
526
  /** Show the model's reasoning ("thoughts") as a collapsible block. Default `false`. */
508
527
  showReasoning?: boolean;
509
- /** How the AI's steps and approvals show; unset keys take the Simple preset. */
528
+ /** How the AI's steps and approvals show; unset keys take the visitor defaults. */
510
529
  stepDisplay?: Partial<StepDisplay>;
511
530
  /** Show citation sources (web links + document references) in the transcript. Default `false`. */
512
531
  showSources?: boolean;
@@ -868,8 +887,7 @@ interface ChatWidgetOptions {
868
887
  }
869
888
  /** `true` for any string other than the literal `"false"`. Useful for boolean attrs. */
870
889
  declare function boolAttr(v: string): boolean;
871
- /** A preset's name (`simple`, `technical`) → its five step settings; any other value leaves the Deployment's. */
872
- /** A preset's name (`technical`), or the settings as JSON (`{"stepDetails":"table"}`): known keys of the right kind only. */
890
+ /** The settings as JSON (`{"stepsShown":["failed"],"stepDetails":"table"}`): known keys of the right kind only. */
873
891
  declare function stepDisplayAttr(v: string): Partial<StepDisplay> | undefined;
874
892
  /** A whole number of seconds, 0 or more; anything else is left unset so the default applies. */
875
893
  declare function secondsAttr(v: string): number | undefined;
@@ -957,7 +975,18 @@ declare const handshakeResponseSchema: z.ZodObject<{
957
975
  }>>;
958
976
  showReasoning: z.ZodDefault<z.ZodBoolean>;
959
977
  stepDisplay: z.ZodOptional<z.ZodObject<{
960
- showSteps: z.ZodOptional<z.ZodBoolean>;
978
+ stepsFrom: z.ZodOptional<z.ZodArray<z.ZodEnum<{
979
+ api: "api";
980
+ mcp: "mcp";
981
+ platform: "platform";
982
+ webmcp: "webmcp";
983
+ }>>>;
984
+ stepsShown: z.ZodOptional<z.ZodArray<z.ZodEnum<{
985
+ "auto-decided": "auto-decided";
986
+ decided: "decided";
987
+ failed: "failed";
988
+ unasked: "unasked";
989
+ }>>>;
961
990
  stepDetails: z.ZodOptional<z.ZodEnum<{
962
991
  json: "json";
963
992
  none: "none";