@helpai/elements 6.5.2 → 6.6.1
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/elements-web-component.esm.js +28 -27
- package/elements-web-component.esm.js.map +3 -3
- package/elements.cjs.js +28 -27
- package/elements.cjs.js.map +3 -3
- package/elements.esm.js +28 -27
- package/elements.esm.js.map +3 -3
- package/elements.js +28 -27
- package/elements.js.map +3 -3
- package/index.d.ts +1 -1
- package/index.mjs +20 -19
- package/llms-full.txt +140 -140
- package/llms.txt +19 -19
- package/package.json +1 -1
- package/react.d.ts +1 -1
- package/react.mjs +37 -36
- package/step-display.d.ts +32 -5
- package/step-display.mjs +2 -1
- package/style.css +1 -1
- package/web-component.d.ts +1 -1
- package/web-component.mjs +20 -19
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' | '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' | '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';
|
|
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()`).
|
|
@@ -123,8 +123,15 @@ export type StepDecider = 'you' | 'visitor' | 'teamMember' | 'rules';
|
|
|
123
123
|
export interface StepDecision {
|
|
124
124
|
approved: boolean;
|
|
125
125
|
by: StepDecider;
|
|
126
|
-
/**
|
|
126
|
+
/**
|
|
127
|
+
* The mark's words, as short as says who: "Approved" for the reader's own decision and for a named team member (whose
|
|
128
|
+
* picture or initials the surface draws beside it), else who decided ("Visitor approved", "Auto-approved").
|
|
129
|
+
*/
|
|
127
130
|
label: string;
|
|
131
|
+
/** The whole sentence, for hover and screen readers: "You approved", "Approved by Sara Kim". */
|
|
132
|
+
title: string;
|
|
133
|
+
/** The team member who decided, when it was someone else: a surface shows who they are (their picture, their email). */
|
|
134
|
+
userId?: string;
|
|
128
135
|
}
|
|
129
136
|
export interface StepField {
|
|
130
137
|
label: string;
|
|
@@ -150,11 +157,14 @@ export interface StepCallView {
|
|
|
150
157
|
summary?: string;
|
|
151
158
|
/** What the call does, in labelled lines: every value except ids, which only Show step details adds. */
|
|
152
159
|
fields: StepField[];
|
|
153
|
-
/**
|
|
160
|
+
/** What came back, in labelled lines, with Show step details on: the result read through its envelope. */
|
|
161
|
+
resultFields?: StepField[];
|
|
162
|
+
/** Why it failed, in the words the tool or its server gave. */
|
|
163
|
+
error?: string;
|
|
164
|
+
/** Raw input and result as indented JSON, with Show step details on: the result read through its envelope. */
|
|
154
165
|
raw?: {
|
|
155
166
|
input?: string;
|
|
156
167
|
output?: string;
|
|
157
|
-
error?: string;
|
|
158
168
|
};
|
|
159
169
|
/** The approval card: its question, the buttons it offers and the line under them. */
|
|
160
170
|
approval?: {
|
|
@@ -163,7 +173,7 @@ export interface StepCallView {
|
|
|
163
173
|
note?: string;
|
|
164
174
|
};
|
|
165
175
|
}
|
|
166
|
-
export type StepStringKey = 'approvalPrompt' | 'approvalEditHint' | 'stepWorking' | 'stepWorkingOnIt' | 'stepNeedsYourApproval' | 'stepWaitingForVisitor' | 'stepApproved' | 'stepDeclined' | 'stepReplaced' | 'stepFailed' | 'stepDidNotWork' | 'statusStopped' | 'decidedYouApproved' | 'decidedYouDeclined' | 'decidedVisitorApproved' | 'decidedVisitorDeclined' | 'decidedTeamApproved' | 'decidedTeamDeclined' | 'decidedRulesApproved' | 'decidedRulesDeclined' | 'toolStepsFailed' | 'toolStepsStopped' | 'toolStepsStoppedOne';
|
|
176
|
+
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';
|
|
167
177
|
export type StepStrings = Pick<Strings, StepStringKey>;
|
|
168
178
|
/** `place_order` / `getIssue` / `list-repos` → "Place order" / "Get issue" / "List repos". */
|
|
169
179
|
export declare function nameInWords(name: string): string;
|
|
@@ -179,12 +189,26 @@ export declare function stepFields(input: unknown, opts: {
|
|
|
179
189
|
}): StepField[];
|
|
180
190
|
/** A payload as raw text: indented JSON, a string as it is; nothing for an empty one. */
|
|
181
191
|
export declare function rawText(value: unknown, maxChars?: number): string | undefined;
|
|
192
|
+
/** A result read through its envelope: what came back (a failure's too, for its raw data), and why it failed. */
|
|
193
|
+
interface StepResult {
|
|
194
|
+
value?: unknown;
|
|
195
|
+
error?: string;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* What a result says, read from its shape, never its tool: a large result saved by reference (`{ storage:
|
|
199
|
+
* "tool-result-ref", summary }`) as its summary; an MCP result (`content` parts) as its `structuredContent`, else its
|
|
200
|
+
* text parsed when it holds JSON, and as failed when it says `isError`; help.ai's tool error (`{ error, instruction }`)
|
|
201
|
+
* as failed with its `error`. The model-facing `instruction` is never a reader's to see.
|
|
202
|
+
*/
|
|
203
|
+
export declare function stepResult(output: unknown): StepResult;
|
|
182
204
|
/** Everything a surface draws for one call, under the given settings. */
|
|
183
205
|
export declare function stepCallView(call: StepCall, ctx: {
|
|
184
206
|
turn: StepTurn;
|
|
185
207
|
reader: StepReader;
|
|
186
208
|
display: StepDisplay;
|
|
187
209
|
strings: StepStrings;
|
|
210
|
+
/** Team members' names by user id, where the surface knows them, so a decision names who made it. */
|
|
211
|
+
names?: ReadonlyMap<string, string>;
|
|
188
212
|
}): StepCallView;
|
|
189
213
|
export interface StepGroupLine {
|
|
190
214
|
/** Each action once, in first-seen order, with how often it ran. */
|
|
@@ -195,6 +219,7 @@ export interface StepGroupLine {
|
|
|
195
219
|
/** A group of one call names it with what it ran on, like its row, and how it ended when no decision says it. */
|
|
196
220
|
single?: {
|
|
197
221
|
name: string;
|
|
222
|
+
system?: string;
|
|
198
223
|
summary?: string;
|
|
199
224
|
outcome?: string;
|
|
200
225
|
};
|
|
@@ -202,6 +227,8 @@ export interface StepGroupLine {
|
|
|
202
227
|
marks: Array<{
|
|
203
228
|
approved: boolean;
|
|
204
229
|
label: string;
|
|
230
|
+
title: string;
|
|
231
|
+
userId?: string;
|
|
205
232
|
}>;
|
|
206
233
|
failed: number;
|
|
207
234
|
/** The reply was cut off with a call in progress: how many calls finished first. */
|
package/step-display.mjs
CHANGED
|
@@ -1,2 +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:`Approved by the visitor`,decidedVisitorDeclined:`Declined by the visitor`,decidedTeamApproved:`Approved by a team member`,decidedTeamDeclined:`Declined by a team member`,decidedRulesApproved:`Approved automatically`,decidedRulesDeclined:`Declined automatically`,edit:`Edit`,statusError:`Error`,toolStepsFailed:`{count} failed`,statusStopped:`Stopped`,toolStepsStopped:`Stopped after {count} steps`,toolStepsStoppedOne:`Stopped after 1 step`},t={simple:{showSteps:!1,showStepDetails:!1,showStepSystem:!1,showDecidedBy:!1,foldApprovals:!0},technical:{showSteps:!0,showStepDetails:!0,showStepSystem:!0,showDecidedBy:!0,foldApprovals:!0}},n=[`showSteps`,`showStepDetails`,`showStepSystem`,`showDecidedBy`,`foldApprovals`];function r(e){return Object.hasOwn(t,e)}function i(e,n){return{...t[n],...e}}function a(e){return Object.keys(t).filter(r).find(r=>n.every(n=>t[r][n]===e[n]))}const o=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function s(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 c(e){if(e.title)return e.title;let t=e.toolName.replace(/^tool[:-]/,``),n=t.indexOf(`__`);return s(n>0?t.slice(n+2):t)}function l(e,t){let n=e.approval;return n?.replacedByMessageId?`replaced`:e.state===`output-available`?`done`:e.state===`output-error`?t.interrupted?`stopped`:`failed`:e.state===`output-denied`||n?.approved===!1?`declined`:e.state===`approval-responded`||n?.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 u(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`}const d={you:[`decidedYouApproved`,`decidedYouDeclined`],visitor:[`decidedVisitorApproved`,`decidedVisitorDeclined`],teamMember:[`decidedTeamApproved`,`decidedTeamDeclined`],rules:[`decidedRulesApproved`,`decidedRulesDeclined`]};function f(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.showStepDetails?t.strings.stepFailed:t.strings.stepDidNotWork;case`done`:return``;default:return e}}function p(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function m(e){return typeof e==`string`?e.trim():typeof e==`number`||typeof e==`boolean`?String(e):``}function h(e){return m(e)||(typeof e==`object`&&e?JSON.stringify(e):``)}function g(e){if(!p(e))return h(e);let[t,...n]=Object.values(e).map(h).filter(Boolean);return t===void 0?``:n.length>0?`${t} (${n.join(`, `)})`:t}function _(e,t){if(!p(e))return[];let n=[];function r(e,i){if(Array.isArray(e)){let t=e.map(g).filter(Boolean).join(`, `);t&&n.push({path:i,value:t});return}if(p(e)){for(let[t,n]of Object.entries(e))r(n,[...i,t]);return}let a=m(e);a&&(t.withIds||!o.test(a))&&n.push({path:i,value:a})}r(e,[]);let i=n.map(({path:e})=>s(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?`${s(e.at(-2)??``)} · ${r.toLowerCase()}`:r,value:t}})}function v(e){if(p(e))return Object.values(e).find(e=>typeof e==`string`&&e.trim().length>0&&!o.test(e.trim()))?.trim()}function y(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 b(e){return p(e)&&e.storage===`tool-result-ref`&&`summary`in e?e.summary:e}function x(e){return y(e.input)!==void 0||y(b(e.output))!==void 0||!!e.errorText}function S(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&&C(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&&x(e)?`step`:`hidden`}function C(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 w(e,t){let{turn:n,reader:r,display:i,strings:a}=t,o=l(e,n),s=e.approval,p=s?.replacedByMessageId?void 0:s?.approved,m=s&&p!==void 0?u(s,r):void 0,h=m&&p!==void 0&&(m===`you`||i.showDecidedBy)?{approved:p,by:m,label:a[d[m][+!p]]}:void 0,g=c(e),x=typeof e.toolMetadata?.system==`string`&&(i.showStepSystem||e.toolMetadata.nameShared===!0)?e.toolMetadata.system:void 0,w=v(e.input),E=b(e.output),D=i.showStepDetails?{input:y(e.input),output:y(E,4e3),error:e.errorText}:void 0,O=s!==void 0&&!s.isAutomatic&&!e.toolMetadata?.card,k={toolCallId:e.toolCallId,placement:`hidden`,...typeof e.toolMetadata?.card==`string`&&s?{card:e.toolMetadata.card}:{},name:g,...x?{system:x}:{},status:o,statusLabel:f(o,{reader:r,display:i,strings:a}),...h?{decision:h}:{},...h?.by===`rules`&&s?.reason?{reason:s.reason}:{},...w?{summary:w}:{},fields:_(e.input,{withIds:i.showStepDetails||s!==void 0&&!s.isAutomatic&&C(e,n)}),...D?{raw:D}:{},...O?{approval:T(e,o,{turn:n,reader:r,strings:a,name:g})}:{}};return{...k,placement:S(e,k,{turn:n,reader:r,display:i})}}function T(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`||!C(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 E(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.label)??{approved:t.approved,label:t.label,count:0};n.set(t.label,{...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.summary?{summary:r.summary}:{},...D(r)}}:{},marks:[...n.values()].map(({approved:e,label:t,count:n})=>({approved:e,label:n>1?`${t} ×${n}`:t})),failed:e.filter(e=>e.status===`failed`).length,...i?{stopped:{finished:e.filter(e=>e.status!==`stopped`).length}}:{}}}function D(e){return!e.decision&&(e.status===`replaced`||e.status===`declined`)?{outcome:e.statusLabel}:{}}function O(e,t){return e===0?t.statusStopped:e===1?t.toolStepsStoppedOne:t.toolStepsStopped.replace(`{count}`,String(e))}const k=e;export{n as STEP_DISPLAY_KEYS,t as STEP_DISPLAY_PRESETS,k as STEP_STRINGS_EN,r as isStepDisplayPreset,a as matchStepDisplayPreset,s as nameInWords,y as rawText,i as resolveStepDisplay,w as stepCallView,_ as stepFields,E as stepGroupLine,c as stepName,O 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`,statusError:`Error`,toolStepsFailed:`{count} failed`,statusStopped:`Stopped`,toolStepsStopped:`Stopped after {count} steps`,toolStepsStoppedOne:`Stopped after 1 step`},t={simple:{showSteps:!1,showStepDetails:!1,showStepSystem:!1,showDecidedBy:!1,foldApprovals:!0},technical:{showSteps:!0,showStepDetails:!0,showStepSystem:!0,showDecidedBy:!0,foldApprovals:!0}},n=[`showSteps`,`showStepDetails`,`showStepSystem`,`showDecidedBy`,`foldApprovals`];function r(e){return Object.hasOwn(t,e)}function i(e,n){return{...t[n],...e}}function a(e){return Object.keys(t).filter(r).find(r=>n.every(n=>t[r][n]===e[n]))}const o=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function s(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 c(e){if(e.title)return e.title;let t=e.toolName.replace(/^tool[:-]/,``),n=t.indexOf(`__`);return s(n>0?t.slice(n+2):t)}function l(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 u(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 d(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[f[e][+!t]];return e===`you`?{label:i,title:a}:{label:a,title:a}}const f={you:[`decidedYouApproved`,`decidedYouDeclined`],visitor:[`decidedVisitorApproved`,`decidedVisitorDeclined`],teamMember:[`decidedTeamApproved`,`decidedTeamDeclined`],rules:[`decidedRulesApproved`,`decidedRulesDeclined`]};function p(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.showStepDetails?t.strings.stepFailed:t.strings.stepDidNotWork;case`done`:return``;default:return e}}function m(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function h(e){return typeof e==`string`?e.trim():typeof e==`number`||typeof e==`boolean`?String(e):``}function g(e){return h(e)||(typeof e==`object`&&e?JSON.stringify(e):``)}function _(e){if(!m(e))return g(e);let[t,...n]=Object.values(e).map(g).filter(Boolean);return t===void 0?``:n.length>0?`${t} (${n.join(`, `)})`:t}function v(e,t){if(!m(e))return[];let n=[];function r(e,i){if(Array.isArray(e)){let t=e.map(_).filter(Boolean).join(`, `);t&&n.push({path:i,value:t});return}if(m(e)){for(let[t,n]of Object.entries(e))r(n,[...i,t]);return}let a=h(e);a&&(t.withIds||!o.test(a))&&n.push({path:i,value:a})}r(e,[]);let i=n.map(({path:e})=>s(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?`${s(e.at(-2)??``)} · ${r.toLowerCase()}`:r,value:t}})}function y(e){if(m(e))return Object.values(e).find(e=>typeof e==`string`&&e.trim().length>0&&!o.test(e.trim()))?.trim()}function b(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 x(e){let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`))return e;try{return JSON.parse(t)}catch{return e}}function S(e){if(m(e)&&e.storage===`tool-result-ref`&&`summary`in e)return{value:e.summary};if(m(e)&&Array.isArray(e.content)){let t=e.content.flatMap(e=>m(e)&&typeof e.text==`string`?[e.text]:[]).join(`
|
|
2
|
+
`),n=m(e.structuredContent)?e.structuredContent:x(t);return e.isError===!0?{value:n,error:m(n)&&typeof n.error==`string`?n.error:t}:{value:n}}return m(e)&&typeof e.error==`string`&&typeof e.instruction==`string`?{value:e,error:e.error}:{value:e}}function C(e){return b(e.input)!==void 0||b(e.output)!==void 0||!!e.errorText}function w(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&&T(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&&C(e)?`step`:`hidden`}function T(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 E(e,t){let{turn:n,reader:r,display:i,strings:a}=t,o=S(e.output),s=l(e,n,o),f=e.approval,m=f?.replacedByMessageId?void 0:f?.approved,h=f&&m!==void 0?u(f,r):void 0,g=h===`teamMember`?f?.respondedBy?.userId:void 0,_=h&&m!==void 0&&(h===`you`||i.showDecidedBy)?{approved:m,by:h,...d(h,m,g&&t.names?.get(g),a),...g?{userId:g}:{}}:void 0,x=c(e),C=typeof e.toolMetadata?.system==`string`&&(i.showStepSystem||e.toolMetadata.nameShared===!0)?e.toolMetadata.system:void 0,E=y(e.input),O=e.errorText??o.error,k=i.showStepDetails&&o.error===void 0?v(o.value,{withIds:!0}):[],A=i.showStepDetails?{input:b(e.input),output:b(o.value,4e3)}:void 0,j=f!==void 0&&!f.isAutomatic&&!e.toolMetadata?.card,M={toolCallId:e.toolCallId,placement:`hidden`,...typeof e.toolMetadata?.card==`string`&&f?{card:e.toolMetadata.card}:{},name:x,...C?{system:C}:{},status:s,statusLabel:p(s,{reader:r,display:i,strings:a}),..._?{decision:_}:{},..._?.by===`rules`&&f?.reason?{reason:f.reason}:{},...E?{summary:E}:{},fields:v(e.input,{withIds:i.showStepDetails||f!==void 0&&!f.isAutomatic&&T(e,n)}),...k.length>0?{resultFields:k}:{},...O&&i.showStepDetails?{error:O}:{},...A?{raw:A}:{},...j?{approval:D(e,s,{turn:n,reader:r,strings:a,name:x})}:{}};return{...M,placement:w(e,M,{turn:n,reader:r,display:i})}}function D(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`||!T(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 O(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}:{},...k(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 k(e){return!e.decision&&(e.status===`replaced`||e.status===`declined`)?{outcome:e.statusLabel}:{}}function A(e,t){return e===0?t.statusStopped:e===1?t.toolStepsStoppedOne:t.toolStepsStopped.replace(`{count}`,String(e))}const j=e;export{n as STEP_DISPLAY_KEYS,t as STEP_DISPLAY_PRESETS,j as STEP_STRINGS_EN,r as isStepDisplayPreset,a as matchStepDisplayPreset,s as nameInWords,b as rawText,i as resolveStepDisplay,E as stepCallView,v as stepFields,O as stepGroupLine,c as stepName,S as stepResult,A as stoppedLineLabel};
|
|
2
3
|
//# sourceMappingURL=step-display.mjs.map
|