@runtypelabs/persona 3.16.0 → 3.18.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.
Files changed (71) hide show
  1. package/README.md +142 -0
  2. package/dist/animations/glyph-cycle.cjs +279 -0
  3. package/dist/animations/glyph-cycle.d.cts +5 -0
  4. package/dist/animations/glyph-cycle.d.ts +5 -0
  5. package/dist/animations/glyph-cycle.js +252 -0
  6. package/dist/animations/types-cwY5HaFD.d.cts +307 -0
  7. package/dist/animations/types-cwY5HaFD.d.ts +307 -0
  8. package/dist/animations/wipe.cjs +107 -0
  9. package/dist/animations/wipe.d.cts +5 -0
  10. package/dist/animations/wipe.d.ts +5 -0
  11. package/dist/animations/wipe.js +80 -0
  12. package/dist/index.cjs +49 -48
  13. package/dist/index.cjs.map +1 -1
  14. package/dist/index.d.cts +504 -1
  15. package/dist/index.d.ts +504 -1
  16. package/dist/index.global.js +143 -88
  17. package/dist/index.global.js.map +1 -1
  18. package/dist/index.js +49 -48
  19. package/dist/index.js.map +1 -1
  20. package/dist/testing.cjs +85 -0
  21. package/dist/testing.d.cts +39 -0
  22. package/dist/testing.d.ts +39 -0
  23. package/dist/testing.js +56 -0
  24. package/dist/theme-editor.cjs +2095 -207
  25. package/dist/theme-editor.d.cts +432 -2
  26. package/dist/theme-editor.d.ts +432 -2
  27. package/dist/theme-editor.js +2093 -207
  28. package/dist/theme-reference.cjs +1 -1
  29. package/dist/theme-reference.d.cts +14 -0
  30. package/dist/theme-reference.d.ts +14 -0
  31. package/dist/widget.css +565 -0
  32. package/package.json +20 -3
  33. package/src/animations/glyph-cycle.ts +332 -0
  34. package/src/animations/wipe.ts +66 -0
  35. package/src/client.test.ts +275 -0
  36. package/src/client.ts +99 -0
  37. package/src/components/ask-user-question-bubble.test.ts +583 -0
  38. package/src/components/ask-user-question-bubble.ts +924 -0
  39. package/src/components/composer-builder.ts +61 -10
  40. package/src/components/message-bubble.test.ts +181 -2
  41. package/src/components/message-bubble.ts +209 -14
  42. package/src/components/messages.ts +33 -1
  43. package/src/components/panel.ts +45 -5
  44. package/src/defaults.ts +37 -0
  45. package/src/index-global.ts +31 -0
  46. package/src/index.ts +34 -1
  47. package/src/plugins/types.ts +57 -0
  48. package/src/session.test.ts +276 -1
  49. package/src/session.ts +247 -3
  50. package/src/styles/widget.css +565 -0
  51. package/src/testing/index.ts +11 -0
  52. package/src/testing/mock-stream.test.ts +80 -0
  53. package/src/testing/mock-stream.ts +94 -0
  54. package/src/testing.ts +2 -0
  55. package/src/theme-editor/index.ts +4 -0
  56. package/src/theme-editor/preview-utils.test.ts +60 -0
  57. package/src/theme-editor/preview-utils.ts +129 -0
  58. package/src/theme-editor/sections.test.ts +19 -0
  59. package/src/theme-editor/sections.ts +84 -1
  60. package/src/types/theme.ts +15 -0
  61. package/src/types.ts +360 -0
  62. package/src/ui.ask-user-question-plugin.test.ts +649 -0
  63. package/src/ui.stop-button.test.ts +165 -0
  64. package/src/ui.ts +706 -11
  65. package/src/utils/message-fingerprint.ts +2 -0
  66. package/src/utils/morph.ts +7 -0
  67. package/src/utils/storage.ts +10 -2
  68. package/src/utils/stream-animation.test.ts +417 -0
  69. package/src/utils/stream-animation.ts +449 -0
  70. package/src/utils/theme.test.ts +36 -0
  71. package/src/utils/tokens.ts +23 -0
package/dist/index.d.cts CHANGED
@@ -91,6 +91,61 @@ interface AgentWidgetPlugin {
91
91
  defaultRenderer: () => HTMLElement;
92
92
  config: AgentWidgetConfig;
93
93
  }) => HTMLElement | null;
94
+ /**
95
+ * Custom renderer for `ask_user_question` tool calls.
96
+ *
97
+ * When a plugin returns an `HTMLElement`, it is inserted into the transcript
98
+ * in place of the default (which is no transcript bubble — the built-in
99
+ * renders a sheet over the composer). The built-in composer-overlay sheet
100
+ * is suppressed so the plugin's UI fully owns the interaction.
101
+ *
102
+ * Return `null` to fall through to the built-in overlay sheet.
103
+ *
104
+ * The context gives you a pre-parsed `payload` (may be partial while the
105
+ * tool call is still streaming — check `complete`) and two callbacks:
106
+ * `resolve(answer)` resumes the paused LOCAL tool with the user's answer,
107
+ * and `dismiss()` cancels with the sentinel `"(dismissed)"`.
108
+ *
109
+ * @example
110
+ * ```typescript
111
+ * renderAskUserQuestion: ({ payload, resolve, dismiss }) => {
112
+ * const prompt = payload.questions?.[0];
113
+ * if (!prompt) return null;
114
+ * const root = document.createElement("div");
115
+ * root.textContent = prompt.question ?? "";
116
+ * (prompt.options ?? []).forEach((option) => {
117
+ * const btn = document.createElement("button");
118
+ * btn.textContent = option.label;
119
+ * btn.addEventListener("click", () => resolve(option.label));
120
+ * root.appendChild(btn);
121
+ * });
122
+ * return root;
123
+ * }
124
+ * ```
125
+ */
126
+ renderAskUserQuestion?: (context: {
127
+ message: AgentWidgetMessage;
128
+ /**
129
+ * Parsed `{ questions: [...] }` payload. May be partial while the tool
130
+ * call is still streaming; see `complete`. `null` when no payload has
131
+ * arrived yet.
132
+ */
133
+ payload: Partial<AskUserQuestionPayload> | null;
134
+ /** `true` once the tool-call args have fully streamed in. */
135
+ complete: boolean;
136
+ /**
137
+ * Resume the paused LOCAL tool with the user's answer. Posts to the
138
+ * resume endpoint, pipes the SSE stream back into the session, and
139
+ * appends a user-visible answer bubble to the transcript.
140
+ */
141
+ resolve: (answer: string) => void;
142
+ /**
143
+ * Cancel the question. Resumes with the sentinel `"(dismissed)"` so the
144
+ * server doesn't sit in `waiting_for_local` forever. Idempotent.
145
+ */
146
+ dismiss: () => void;
147
+ config: AgentWidgetConfig;
148
+ }) => HTMLElement | null;
94
149
  /**
95
150
  * Custom renderer for approval bubbles
96
151
  * Return null to use default renderer
@@ -384,6 +439,18 @@ interface MessageTokens {
384
439
  /** Border color between messages in the thread. */
385
440
  border?: TokenReference<'color'>;
386
441
  }
442
+ /**
443
+ * Welcome / intro card rendered above the message list when no messages exist.
444
+ * Set `copy.showWelcomeCard: false` to hide it; use `layout.slots["body-top"]`
445
+ * to replace it wholesale.
446
+ */
447
+ interface IntroCardTokens extends ComponentTokenSet {
448
+ background?: TokenReference<'color'>;
449
+ borderRadius?: TokenReference<'radius'>;
450
+ padding?: TokenReference<'spacing'>;
451
+ /** Box-shadow on the intro card (token ref or raw CSS, e.g. `none`). */
452
+ shadow?: string;
453
+ }
387
454
  /** Collapsible widget chrome (tool bubbles, reasoning bubbles, approval bubbles). */
388
455
  interface CollapsibleWidgetTokens {
389
456
  /** Background for content areas. */
@@ -581,6 +648,8 @@ interface ComponentTokens {
581
648
  panel: PanelTokens;
582
649
  header: HeaderTokens;
583
650
  message: MessageTokens;
651
+ /** Welcome / intro card shown above the message list. */
652
+ introCard?: IntroCardTokens;
584
653
  /** Markdown surfaces (chat + artifact pane). */
585
654
  markdown?: MarkdownTokens;
586
655
  voice: VoiceTokens;
@@ -829,6 +898,31 @@ type AgentMessageMetadata = {
829
898
  * or `prompt` step inside the nested flow). Stable key for that step.
830
899
  */
831
900
  parentStepId?: string;
901
+ /**
902
+ * Set to `true` on a tool-variant message produced from a `step_await`
903
+ * event (`awaitReason: "local_tool_required"`). Signals to UI code that
904
+ * the tool call is a LOCAL tool and the server is paused waiting for a
905
+ * `POST /v1/dispatch/resume` with the user's answer keyed by tool name.
906
+ */
907
+ awaitingLocalTool?: boolean;
908
+ /**
909
+ * Set to `true` once the user has picked / typed / dismissed an answer for
910
+ * an `ask_user_question` tool call, so renderers stop re-mounting the
911
+ * answer-pill sheet for this tool call on subsequent render passes.
912
+ */
913
+ askUserQuestionAnswered?: boolean;
914
+ /**
915
+ * In-progress answers for a multi-question `ask_user_question` payload,
916
+ * keyed by question text. Persisted across refresh so the user lands back
917
+ * where they were if the page reloads mid-flow. Cleared once
918
+ * `askUserQuestionAnswered` flips to `true`.
919
+ */
920
+ askUserQuestionAnswers?: Record<string, string | string[]>;
921
+ /**
922
+ * Current page index for a multi-question `ask_user_question` payload's
923
+ * paginated stepper. Persists alongside `askUserQuestionAnswers`.
924
+ */
925
+ askUserQuestionIndex?: number;
832
926
  };
833
927
  type AgentWidgetRequestMiddlewareContext = {
834
928
  payload: AgentWidgetRequestPayload;
@@ -876,6 +970,8 @@ type AgentWidgetActionHandler = (action: AgentWidgetParsedAction, context: Agent
876
970
  type AgentWidgetStoredState = {
877
971
  messages?: AgentWidgetMessage[];
878
972
  metadata?: Record<string, unknown>;
973
+ artifacts?: PersonaArtifactRecord[];
974
+ selectedArtifactId?: string | null;
879
975
  };
880
976
  interface AgentWidgetStorageAdapter {
881
977
  load?: () => AgentWidgetStoredState | null | Promise<AgentWidgetStoredState | null>;
@@ -1272,6 +1368,151 @@ type AgentWidgetReasoningDisplayFeature = {
1272
1368
  */
1273
1369
  loadingAnimation?: AgentWidgetToolCallLoadingAnimation;
1274
1370
  };
1371
+ /**
1372
+ * Reveal animation applied to assistant message text while it is streaming.
1373
+ *
1374
+ * Built-in types always available:
1375
+ * - `none` — text appears as tokens arrive (default).
1376
+ * - `typewriter` — characters fade in with a blinking caret.
1377
+ * - `pop-bubble` — the bubble scales in; text streams normally afterward.
1378
+ * - `letter-rise` — per-char translateY + fade reveal.
1379
+ * - `word-fade` — per-word blur + translateY fade-in.
1380
+ *
1381
+ * Subpath plugins (import from `@runtypelabs/persona/animations/*` to register):
1382
+ * - `wipe`, `glyph-cycle`.
1383
+ *
1384
+ * Custom types are allowed — register a plugin with any string name and
1385
+ * reference it by that name in `type`.
1386
+ */
1387
+ type AgentWidgetStreamAnimationBuiltinType = "none" | "typewriter" | "word-fade" | "letter-rise" | "glyph-cycle" | "wipe" | "pop-bubble";
1388
+ type AgentWidgetStreamAnimationType = AgentWidgetStreamAnimationBuiltinType | (string & {});
1389
+ /**
1390
+ * Placeholder shown inside a streaming assistant bubble before the first token arrives.
1391
+ * - `none` — use the default typing-dots indicator (existing behavior).
1392
+ * - `skeleton` — shimmer bars, replaced by streaming content once it starts.
1393
+ */
1394
+ type AgentWidgetStreamAnimationPlaceholder = "none" | "skeleton";
1395
+ /**
1396
+ * How much of the accumulated streaming content to display while tokens are
1397
+ * still arriving. Trimming to a boundary means in-progress words or lines
1398
+ * stay hidden until they complete — useful for animations that benefit from
1399
+ * unit-complete reveals (e.g. wipe, glyph-cycle).
1400
+ * - `none` — show every character as it arrives (default).
1401
+ * - `word` — trim to the last whitespace boundary.
1402
+ * - `line` — trim to the last newline boundary.
1403
+ */
1404
+ type AgentWidgetStreamAnimationBuffer = "none" | "word" | "line";
1405
+ /**
1406
+ * Context passed to plugin lifecycle hooks. Carries the live DOM references
1407
+ * and resolved animation settings for the currently-streaming message.
1408
+ */
1409
+ type StreamAnimationContext = {
1410
+ /** The `.persona-message-content` element owning the streamed text. */
1411
+ container: HTMLElement;
1412
+ /** The outer message bubble element. */
1413
+ bubble: HTMLElement;
1414
+ /** ID of the streaming message. */
1415
+ messageId: string;
1416
+ /** Read-only reference to the message being streamed. */
1417
+ message: AgentWidgetMessage;
1418
+ /** Effective `speed` from `streamAnimation.speed`. */
1419
+ speed: number;
1420
+ /** Effective `duration` from `streamAnimation.duration`. */
1421
+ duration: number;
1422
+ };
1423
+ /**
1424
+ * Pluggable stream animation. Third-party packages and inline registrations
1425
+ * implement this interface to add custom reveal effects.
1426
+ *
1427
+ * Lifecycle:
1428
+ * - When the widget mounts and detects a plugin (either passed via config or
1429
+ * auto-registered in the IIFE bundle), it injects `styles` once into the
1430
+ * widget's style host.
1431
+ * - For each streaming assistant message whose `type` matches `name`, the
1432
+ * widget applies `containerClass` / `bubbleClass`, wraps text per `wrap`,
1433
+ * and — if `useCaret` is true — appends a blinking caret.
1434
+ * - Hooks fire after the live DOM is morphed; plugins use stable element IDs
1435
+ * and `data-preserve-animation` to safely mutate per-char or per-word spans
1436
+ * without idiomorph clobbering in-flight work.
1437
+ */
1438
+ type StreamAnimationPlugin = {
1439
+ /** Plugin identifier. Matches the `type` field in `streamAnimation`. */
1440
+ name: string;
1441
+ /** Class added to `.persona-message-content` while streaming. */
1442
+ containerClass?: string;
1443
+ /** Class added to the bubble element (e.g. a one-shot scale animation). */
1444
+ bubbleClass?: string;
1445
+ /** Wrap mode applied to text nodes during streaming. @default "none" */
1446
+ wrap?: "none" | "char" | "word";
1447
+ /**
1448
+ * HTML tags whose descendant text is skipped during wrapping. Defaults to
1449
+ * `["pre", "code", "a", "script", "style"]` — useful for keeping code
1450
+ * blocks legible and link click-targets intact. Plugins that want to
1451
+ * animate characters inside inline code (e.g. `glyph-cycle`) can narrow
1452
+ * the list.
1453
+ */
1454
+ skipTags?: string[];
1455
+ /** Append a blinking caret after the last rendered char/word. */
1456
+ useCaret?: boolean;
1457
+ /** CSS string injected into the widget style host on first activation. */
1458
+ styles?: string;
1459
+ /**
1460
+ * Optional custom buffering strategy. Returns the portion of `content`
1461
+ * that should be rendered during streaming. Use this for buffering
1462
+ * schemes beyond the built-in `word` / `line` strategies.
1463
+ */
1464
+ bufferContent?: (content: string, message: AgentWidgetMessage) => string;
1465
+ /**
1466
+ * Fires once when the plugin is first activated inside a widget instance.
1467
+ * Use this to set up MutationObservers or other long-lived listeners.
1468
+ * Return an optional cleanup function that runs on widget destroy.
1469
+ */
1470
+ onAttach?: (root: HTMLElement | ShadowRoot) => (() => void) | void;
1471
+ /** Fires after each render that reaches the live DOM. */
1472
+ onAfterRender?: (ctx: StreamAnimationContext) => void;
1473
+ /** Fires when a streamed message's `streaming` flag flips to false. */
1474
+ onStreamComplete?: (ctx: StreamAnimationContext) => void;
1475
+ /**
1476
+ * Report whether the plugin still has in-flight animation work for a
1477
+ * message. When `true`, the widget keeps rendering the message in its
1478
+ * "streaming-animated" mode even after `message.streaming` flips false —
1479
+ * preventing the final non-animated render from yanking the rug out from
1480
+ * under unfinished per-char cycles or reveals.
1481
+ */
1482
+ isAnimating?: (message: AgentWidgetMessage) => boolean;
1483
+ };
1484
+ type AgentWidgetStreamAnimationFeature = {
1485
+ /** Reveal animation to apply while streaming. @default "none" */
1486
+ type?: AgentWidgetStreamAnimationType;
1487
+ /** Pre-first-token placeholder. @default "none" */
1488
+ placeholder?: AgentWidgetStreamAnimationPlaceholder;
1489
+ /**
1490
+ * Per-unit animation duration (ms) for `typewriter`, `letter-rise`, `word-fade`,
1491
+ * and per-unit plugin animations. Each arriving character/word animates from
1492
+ * invisible to visible over this duration, independent of its position — the
1493
+ * streaming cadence itself provides the visible stagger.
1494
+ * @default 120
1495
+ */
1496
+ speed?: number;
1497
+ /**
1498
+ * Total duration of container-level animations (`pop-bubble` and custom
1499
+ * plugin animations), in milliseconds.
1500
+ * @default 1800
1501
+ */
1502
+ duration?: number;
1503
+ /**
1504
+ * Trim the accumulated streaming content to a word or line boundary before
1505
+ * rendering. Hides in-progress units until they complete.
1506
+ * @default "none"
1507
+ */
1508
+ buffer?: AgentWidgetStreamAnimationBuffer;
1509
+ /**
1510
+ * Extra animation plugins available to this widget instance. Keys are
1511
+ * plugin names; the matching plugin activates when `type` is set to that
1512
+ * name. Built-in types (`typewriter`, `pop-bubble`) are always registered.
1513
+ */
1514
+ plugins?: Record<string, StreamAnimationPlugin>;
1515
+ };
1275
1516
  type AgentWidgetFeatureFlags = {
1276
1517
  showReasoning?: boolean;
1277
1518
  showToolCalls?: boolean;
@@ -1286,6 +1527,115 @@ type AgentWidgetFeatureFlags = {
1286
1527
  eventStream?: EventStreamConfig;
1287
1528
  /** Optional artifact sidebar (split pane / mobile drawer) */
1288
1529
  artifacts?: AgentWidgetArtifactsFeature;
1530
+ /** Reveal animation for streaming assistant text. */
1531
+ streamAnimation?: AgentWidgetStreamAnimationFeature;
1532
+ /**
1533
+ * Built-in interactive answer-pill sheet shown when the assistant invokes
1534
+ * the `ask_user_question` tool. Slides up over the composer with tappable
1535
+ * pills + optional free-text input.
1536
+ */
1537
+ askUserQuestion?: AgentWidgetAskUserQuestionFeature;
1538
+ };
1539
+ /**
1540
+ * Single selectable option in an `ask_user_question` prompt.
1541
+ * Mirrors Anthropic's AskUserQuestion schema.
1542
+ */
1543
+ type AskUserQuestionOption = {
1544
+ /** Pill label (required). */
1545
+ label: string;
1546
+ /** Optional long-form description (shown as a subtitle on tap-hover). */
1547
+ description?: string;
1548
+ /** Optional rich preview — reserved for future rendering; ignored in v1. */
1549
+ preview?: string;
1550
+ };
1551
+ /**
1552
+ * A single question in an `ask_user_question` tool call.
1553
+ * The tool may carry 1–8 prompts. When more than one is supplied, the built-in
1554
+ * renderer paginates them as a "Question N of M" stepper with Back / Next /
1555
+ * Submit-all controls; single-question payloads render without stepper chrome.
1556
+ */
1557
+ type AskUserQuestionPrompt = {
1558
+ /** The question text shown to the user. */
1559
+ question: string;
1560
+ /** Optional short header label (≤12 chars) used as a compact group title. */
1561
+ header?: string;
1562
+ /** 2–4 selectable options. */
1563
+ options: AskUserQuestionOption[];
1564
+ /** When true, the user can pick multiple options and submit together. Default false. */
1565
+ multiSelect?: boolean;
1566
+ /** When true, a free-text "Other…" pill expands to an input. Default true. */
1567
+ allowFreeText?: boolean;
1568
+ };
1569
+ /** Parsed payload of an `ask_user_question` tool call. */
1570
+ type AskUserQuestionPayload = {
1571
+ /** 1–8 questions. Anything beyond the renderer's cap is truncated with a console warning. */
1572
+ questions: AskUserQuestionPrompt[];
1573
+ };
1574
+ /**
1575
+ * Style overrides for the answer-pill sheet. All values are raw CSS strings
1576
+ * and are plumbed through as CSS custom properties on the sheet root.
1577
+ */
1578
+ type AgentWidgetAskUserQuestionStyles = {
1579
+ sheetBackground?: string;
1580
+ sheetBorder?: string;
1581
+ sheetShadow?: string;
1582
+ pillBackground?: string;
1583
+ pillBackgroundSelected?: string;
1584
+ pillTextColor?: string;
1585
+ pillTextColorSelected?: string;
1586
+ pillBorderRadius?: string;
1587
+ customInputBackground?: string;
1588
+ };
1589
+ /**
1590
+ * Feature config for the built-in `ask_user_question` answer-pill sheet.
1591
+ * When a tool call with the name `ask_user_question` arrives, the widget
1592
+ * renders an interactive sheet over the composer in place of the generic
1593
+ * tool bubble.
1594
+ */
1595
+ type AgentWidgetAskUserQuestionFeature = {
1596
+ /** Enable the feature. Defaults to true. When false, `ask_user_question` renders as a regular tool bubble. */
1597
+ enabled?: boolean;
1598
+ /** Slide-in animation duration in ms. Defaults to 180. */
1599
+ slideInMs?: number;
1600
+ /** Label for the free-text pill. Defaults to "Other…". */
1601
+ freeTextLabel?: string;
1602
+ /** Placeholder text in the free-text input. Defaults to "Type your answer…". */
1603
+ freeTextPlaceholder?: string;
1604
+ /** Button label for submitting multi-select / free-text answers. Defaults to "Send". */
1605
+ submitLabel?: string;
1606
+ /** Button label advancing to the next question in grouped (paginated) payloads. Defaults to "Next". */
1607
+ nextLabel?: string;
1608
+ /** Button label moving back to the previous question in grouped payloads. Defaults to "Back". */
1609
+ backLabel?: string;
1610
+ /** Button label submitting all answers from the final page of a grouped payload. Defaults to "Submit all". */
1611
+ submitAllLabel?: string;
1612
+ /**
1613
+ * In grouped (multi-question) mode, auto-advance to the next page after a
1614
+ * single-select pill pick or free-text submit on intermediate pages.
1615
+ * Defaults to `true`. The final page never auto-submits — users always
1616
+ * confirm with an explicit "Submit all" click. Multi-select pages always
1617
+ * require an explicit Next regardless of this setting.
1618
+ */
1619
+ groupedAutoAdvance?: boolean;
1620
+ /**
1621
+ * Visual layout for the option list.
1622
+ * - `"rows"` (default) — full-width stacked rows with always-visible
1623
+ * descriptions, right-edge number badges (single-select) or checkboxes
1624
+ * (multi-select), and an always-visible inline "Other" input.
1625
+ * - `"pills"` — legacy compact pill list with horizontal wrap; description
1626
+ * surfaces as a tooltip and the "Other…" pill expands on click.
1627
+ */
1628
+ layout?: "rows" | "pills";
1629
+ /**
1630
+ * Button label for skipping the current question in grouped payloads.
1631
+ * Defaults to "Skip". On intermediate pages Skip advances without recording
1632
+ * an answer; on the final page Skip submits the partial answer record
1633
+ * (skipped questions absent from the resolved object). For single-question
1634
+ * payloads Skip behaves like dismiss.
1635
+ */
1636
+ skipLabel?: string;
1637
+ /** Style overrides for the sheet and pills. */
1638
+ styles?: AgentWidgetAskUserQuestionStyles;
1289
1639
  };
1290
1640
  type SSEEventRecord = {
1291
1641
  id: string;
@@ -1574,6 +1924,10 @@ type AgentWidgetSendButtonConfig = {
1574
1924
  backgroundColor?: string;
1575
1925
  textColor?: string;
1576
1926
  size?: string;
1927
+ /** Lucide icon name shown while a response is streaming. Clicking the button in this state aborts the stream. Default: "square". */
1928
+ stopIconName?: string;
1929
+ /** Tooltip text shown while streaming. Default: "Stop generating". */
1930
+ stopTooltipText?: string;
1577
1931
  };
1578
1932
  /** Optional composer UI state for custom `renderComposer` implementations. */
1579
1933
  type AgentWidgetComposerConfig = {
@@ -3089,11 +3443,21 @@ type AgentWidgetConfig = {
3089
3443
  welcomeSubtitle?: string;
3090
3444
  inputPlaceholder?: string;
3091
3445
  sendButtonLabel?: string;
3446
+ /** Button label shown in text mode while a response is streaming. Default: "Stop". */
3447
+ stopButtonLabel?: string;
3092
3448
  /**
3093
3449
  * When false, the welcome / intro card is not shown above the message list.
3094
3450
  * @default true
3095
3451
  */
3096
3452
  showWelcomeCard?: boolean;
3453
+ /**
3454
+ * Per-stop-reason copy for the inline notice rendered on assistant
3455
+ * bubbles when the runtime reports a non-natural stop (e.g. the agent
3456
+ * loop hit `max_tool_calls` and was cut off mid-loop). Each key is
3457
+ * optional — keys you omit fall back to the built-in defaults. Set a
3458
+ * key to an empty string to suppress the notice for that reason.
3459
+ */
3460
+ stopReasonNotice?: Partial<Record<StopReasonKind, string>>;
3097
3461
  };
3098
3462
  /**
3099
3463
  * Semantic design tokens (`palette`, `semantic`, `components`).
@@ -3127,6 +3491,17 @@ type AgentWidgetConfig = {
3127
3491
  autoFocusInput?: boolean;
3128
3492
  launcher?: AgentWidgetLauncherConfig;
3129
3493
  initialMessages?: AgentWidgetMessage[];
3494
+ /**
3495
+ * Artifacts to hydrate into the pane at init. Typically populated from
3496
+ * `storageAdapter.load()` alongside `initialMessages` so the artifact pane
3497
+ * survives a page refresh.
3498
+ */
3499
+ initialArtifacts?: PersonaArtifactRecord[];
3500
+ /**
3501
+ * Which artifact id (if any) should be selected in the pane at init. Paired
3502
+ * with `initialArtifacts`.
3503
+ */
3504
+ initialSelectedArtifactId?: string | null;
3130
3505
  suggestionChips?: string[];
3131
3506
  suggestionChipsConfig?: AgentWidgetSuggestionChipsConfig;
3132
3507
  debug?: boolean;
@@ -3591,6 +3966,21 @@ type AgentWidgetApproval = {
3591
3966
  resolvedAt?: number;
3592
3967
  };
3593
3968
  type AgentWidgetMessageVariant = "assistant" | "reasoning" | "tool" | "approval";
3969
+ /**
3970
+ * Per-turn / per-step stop reason emitted by the runtime on
3971
+ * `agent_turn_complete` and `step_complete` SSE events. The vocabulary is
3972
+ * owned by the upstream Runtype API — do not extend without coordination.
3973
+ *
3974
+ * - `end_turn` — natural completion (no affordance needed)
3975
+ * - `max_tool_calls` — agent loop tripped the configured tool-call ceiling
3976
+ * - `length` — provider hit max output tokens
3977
+ * - `content_filter` — provider content filter intervened
3978
+ * - `error` — provider/runtime error (prefer existing error rendering)
3979
+ * - `unknown` — explicitly reported but uninformative
3980
+ *
3981
+ * Absent (`undefined`) means "not reported" — distinct from `'unknown'`.
3982
+ */
3983
+ type StopReasonKind = 'end_turn' | 'max_tool_calls' | 'length' | 'content_filter' | 'error' | 'unknown';
3594
3984
  /**
3595
3985
  * Represents a message in the chat conversation.
3596
3986
  *
@@ -3677,6 +4067,17 @@ type AgentWidgetMessage = {
3677
4067
  * Contains execution context like iteration number and turn ID.
3678
4068
  */
3679
4069
  agentMetadata?: AgentMessageMetadata;
4070
+ /**
4071
+ * Per-turn stop reason reported by the runtime on `agent_turn_complete`
4072
+ * (agent-loop path) or the last `step_complete` for a prompt step
4073
+ * (dispatch / flow path). Absent when the API did not report a value.
4074
+ *
4075
+ * When set to a non-natural value (`max_tool_calls`, `length`,
4076
+ * `content_filter`, `error`), the widget renders an inline notice on
4077
+ * the assistant bubble. See `config.copy.stopReasonNotice` to override
4078
+ * the default copy.
4079
+ */
4080
+ stopReason?: StopReasonKind;
3680
4081
  };
3681
4082
  /**
3682
4083
  * Options for injecting a message into the conversation.
@@ -3970,6 +4371,22 @@ declare class AgentWidgetClient {
3970
4371
  executionId: string;
3971
4372
  approvalId: string;
3972
4373
  }, decision: 'approved' | 'denied'): Promise<Response>;
4374
+ /**
4375
+ * Resume a paused flow execution by supplying outputs for LOCAL
4376
+ * (client-executed) tools. Used by the built-in `ask_user_question`
4377
+ * answer-pill sheet, but generic enough for any LOCAL tool.
4378
+ *
4379
+ * Posts to the upstream `/resume` endpoint (the dispatch URL with
4380
+ * `/dispatch` replaced by `/resume` — works for both direct-to-Runtype
4381
+ * and the persona proxy) and returns the raw Response so the caller can
4382
+ * pipe its SSE body through `connectStream()`.
4383
+ *
4384
+ * @param executionId - The paused execution id carried on `step_await`.
4385
+ * @param toolOutputs - Map keyed by tool name → the tool's result value.
4386
+ */
4387
+ resumeFlow(executionId: string, toolOutputs: Record<string, unknown>, options?: {
4388
+ streamResponse?: boolean;
4389
+ }): Promise<Response>;
3973
4390
  private buildAgentPayload;
3974
4391
  private buildPayload;
3975
4392
  /**
@@ -4232,6 +4649,37 @@ declare class AgentWidgetSession {
4232
4649
  * and pipes the response stream through connectStream().
4233
4650
  */
4234
4651
  resolveApproval(approval: AgentWidgetApproval, decision: 'approved' | 'denied'): Promise<void>;
4652
+ /**
4653
+ * Resolve a paused `ask_user_question` LOCAL tool call.
4654
+ *
4655
+ * When the server emits `step_await` for `ask_user_question`, the widget
4656
+ * renders the answer-pill sheet and calls this method once the user
4657
+ * picks. Steps:
4658
+ * 1. POST the answer to `/resume` via `client.resumeFlow`.
4659
+ * 2. Pipe the resulting SSE stream through `connectStream()` so the
4660
+ * paused agent execution continues.
4661
+ * 3. Append a user-visible bubble with the answer text so the
4662
+ * transcript reads naturally.
4663
+ */
4664
+ /**
4665
+ * Persist in-progress answers and the current page index for a multi-question
4666
+ * `ask_user_question` payload, so a refresh resumes on the same page with
4667
+ * prior answers intact. Called by ui.ts on every Back/Next/pick interaction.
4668
+ */
4669
+ persistAskUserQuestionProgress(toolMessage: AgentWidgetMessage, progress: {
4670
+ answers: Record<string, string | string[]>;
4671
+ currentIndex: number;
4672
+ }): void;
4673
+ /**
4674
+ * Flip an `ask_user_question` tool message from awaiting → answered so
4675
+ * render passes stop re-mounting its answer-pill sheet. Idempotent.
4676
+ * When `answers` is provided, persists the full structured answer Record
4677
+ * atomically with the answered flag — guarding against later events that
4678
+ * could re-emit the tool message and clobber the per-pick persisted
4679
+ * answers via top-level merge.
4680
+ */
4681
+ markAskUserQuestionResolved(toolMessage: AgentWidgetMessage, answers?: Record<string, string | string[]>): void;
4682
+ resolveAskUserQuestion(toolMessage: AgentWidgetMessage, answer: string | Record<string, string | string[]>): Promise<void>;
4235
4683
  cancel(): void;
4236
4684
  clearMessages(): void;
4237
4685
  getArtifacts(): PersonaArtifactRecord[];
@@ -4244,6 +4692,7 @@ declare class AgentWidgetSession {
4244
4692
  private emitArtifactsState;
4245
4693
  private applyArtifactStreamEvent;
4246
4694
  hydrateMessages(messages: AgentWidgetMessage[]): void;
4695
+ hydrateArtifacts(artifacts: PersonaArtifactRecord[], selectedId?: string | null): void;
4247
4696
  private handleEvent;
4248
4697
  private setStatus;
4249
4698
  private setStreaming;
@@ -4405,6 +4854,10 @@ type Controller = {
4405
4854
  upsertArtifact: (manual: PersonaArtifactManualUpsert) => PersonaArtifactRecord | null;
4406
4855
  selectArtifact: (id: string) => void;
4407
4856
  clearArtifacts: () => void;
4857
+ /** Read current artifacts (useful on init to rebuild host-side tab state after hydration). */
4858
+ getArtifacts: () => PersonaArtifactRecord[];
4859
+ /** Read the currently selected artifact id (paired with `getArtifacts`). */
4860
+ getSelectedArtifactId: () => string | null;
4408
4861
  /**
4409
4862
  * Focus the chat input. Returns true if focus succeeded, false if panel is closed
4410
4863
  * (launcher mode) or textarea is unavailable.
@@ -4427,6 +4880,39 @@ type AgentWidgetInitHandle = AgentWidgetController & {
4427
4880
  };
4428
4881
  declare const initAgentWidget: (options: AgentWidgetInitOptions) => AgentWidgetInitHandle;
4429
4882
 
4883
+ declare const ASK_USER_QUESTION_TOOL_NAME = "ask_user_question";
4884
+ declare const isAskUserQuestionMessage: (message: AgentWidgetMessage) => boolean;
4885
+ /**
4886
+ * Parse an `ask_user_question` tool-variant message into a partial payload.
4887
+ * Safe to call mid-stream — will walk the tool call's `chunks` via
4888
+ * `partial-json` and return `{ payload: null, complete: false }` when there
4889
+ * isn't enough data yet. `complete` flips to `true` once the tool call
4890
+ * reports status `"complete"`.
4891
+ *
4892
+ * Exported for plugin authors implementing `renderAskUserQuestion`.
4893
+ */
4894
+ declare const parseAskUserQuestionPayload: (message: AgentWidgetMessage) => {
4895
+ payload: Partial<AskUserQuestionPayload> | null;
4896
+ complete: boolean;
4897
+ };
4898
+ /**
4899
+ * Create the small in-transcript stub for an `ask_user_question` tool call.
4900
+ * The stub is passive — the interactive sheet is mounted separately into
4901
+ * the composer overlay via `ensureAskUserQuestionSheet`.
4902
+ */
4903
+ declare const createAskUserQuestionBubble: (message: AgentWidgetMessage, config?: AgentWidgetConfig) => HTMLElement;
4904
+ /**
4905
+ * Mount or update the interactive answer-pill sheet for a given message.
4906
+ * Idempotent — if a sheet already exists for the tool-call id, it is hydrated
4907
+ * in-place instead of remounted, so streaming updates don't flicker.
4908
+ */
4909
+ declare const ensureAskUserQuestionSheet: (message: AgentWidgetMessage, config: AgentWidgetConfig | undefined, overlay: HTMLElement | null | undefined) => void;
4910
+ /**
4911
+ * Remove the sheet for a specific tool-call id, or all sheets if omitted.
4912
+ * Runs a slide-out transition before removing.
4913
+ */
4914
+ declare const removeAskUserQuestionSheet: (overlay: HTMLElement | null | undefined, toolCallId?: string) => void;
4915
+
4430
4916
  type WidgetHostLayoutMode = "direct" | "docked";
4431
4917
  type WidgetHostLayout = {
4432
4918
  mode: WidgetHostLayoutMode;
@@ -5075,6 +5561,16 @@ declare class PluginRegistry {
5075
5561
  }
5076
5562
  declare const pluginRegistry: PluginRegistry;
5077
5563
 
5564
+ /**
5565
+ * Register a custom stream animation plugin globally. Subsequent widget
5566
+ * instances can reference the plugin by `name` in `features.streamAnimation.type`.
5567
+ * Per-widget plugin overrides via `features.streamAnimation.plugins` take
5568
+ * precedence over the global registry.
5569
+ */
5570
+ declare const registerStreamAnimationPlugin: (plugin: StreamAnimationPlugin) => void;
5571
+ declare const unregisterStreamAnimationPlugin: (name: string) => void;
5572
+ declare const listRegisteredStreamAnimations: () => string[];
5573
+
5078
5574
  interface DropdownMenuItem {
5079
5575
  id: string;
5080
5576
  label: string;
@@ -5833,6 +6329,13 @@ interface ComposerElements {
5833
6329
  actionsRow: HTMLElement;
5834
6330
  leftActions: HTMLElement;
5835
6331
  rightActions: HTMLElement;
6332
+ /**
6333
+ * Swap the send button between its idle ("send") appearance and its
6334
+ * streaming ("stop") appearance. In icon mode this swaps the SVG; in text
6335
+ * mode it swaps the button label. Tooltip text is updated when a tooltip
6336
+ * element is present.
6337
+ */
6338
+ setSendButtonMode: (mode: "send" | "stop") => void;
5836
6339
  }
5837
6340
  interface ComposerBuildContext {
5838
6341
  config?: AgentWidgetConfig;
@@ -5880,4 +6383,4 @@ declare function createVoiceProvider(config: VoiceConfig): VoiceProvider;
5880
6383
  declare function createBestAvailableVoiceProvider(config?: Partial<VoiceConfig>): VoiceProvider;
5881
6384
  declare function isVoiceSupported(config?: Partial<VoiceConfig>): boolean;
5882
6385
 
5883
- export { type AgentConfig, type AgentExecutionState, type AgentLoopConfig, type AgentMessageMetadata, type AgentRequestOptions, type AgentToolsConfig, type AgentWidgetAgentRequestPayload, type AgentWidgetApproval, type AgentWidgetApprovalConfig, type AgentWidgetArtifactsFeature, type AgentWidgetArtifactsLayoutConfig, type AgentWidgetAttachmentsConfig, type AgentWidgetAvatarConfig, AgentWidgetClient, type AgentWidgetComposerConfig, type AgentWidgetConfig, type AgentWidgetController, type AgentWidgetControllerEventMap, type AgentWidgetCustomFetch, type AgentWidgetDockConfig, type AgentWidgetEvent, type AgentWidgetFeatureFlags, type AgentWidgetHeaderLayoutConfig, type AgentWidgetHeadersFunction, type AgentWidgetInitHandle, type AgentWidgetInitOptions, type AgentWidgetLauncherConfig, type AgentWidgetLayoutConfig, type AgentWidgetLoadingIndicatorConfig, type AgentWidgetMarkdownConfig, type AgentWidgetMarkdownOptions, type AgentWidgetMarkdownRendererOverrides, type AgentWidgetMessage, type AgentWidgetMessageActionsConfig, type AgentWidgetMessageFeedback, type AgentWidgetMessageLayoutConfig, type AgentWidgetPlugin, type AgentWidgetRequestPayload, type AgentWidgetSSEEventParser, type AgentWidgetSSEEventResult, AgentWidgetSession, type AgentWidgetSessionStatus, type AgentWidgetStreamParser, type AgentWidgetStreamParserResult, type AgentWidgetTimestampConfig, type ArtifactConfigPayload, type ArtifactPaneTokens, type ArtifactTabTokens, type ArtifactToolbarTokens, AttachmentManager, type AttachmentManagerConfig, type BorderScale, type CSATFeedbackOptions, type ClientChatRequest, type ClientFeedbackRequest, type ClientFeedbackType, type ClientInitResponse, type ClientSession, type CodeFormat, type CodeGeneratorHooks, type CodeGeneratorOptions, type ColorPalette, type ColorShade, type ComboButtonHandle, type ComponentContext, type ComponentDirective, type ComponentRenderer, type ComponentTokens, type ComposerBuildContext, type ComposerElements, type ContentPart, type CreateComboButtonOptions, type CreateDropdownOptions, type CreateIconButtonOptions, type CreateLabelButtonOptions, type CreateStandardBubbleOptions, type CreateThemeOptions, type CreateToggleGroupOptions, DEFAULT_COMPONENTS, DEFAULT_FLOATING_LAUNCHER_MAX_WIDTH, DEFAULT_FLOATING_LAUNCHER_WIDTH, DEFAULT_PALETTE, DEFAULT_SEMANTIC, DEFAULT_WIDGET_CONFIG, type DeepPartial, type DemoCarouselHandle, type DemoCarouselItem, type DemoCarouselOptions, type DomContextMode, type DomContextOptions, type DropdownMenuHandle, type DropdownMenuItem, type EnrichedPageElement, type EventStreamBadgeColor, type EventStreamConfig, type EventStreamPayloadRenderContext, type EventStreamRowRenderContext, type EventStreamToolbarRenderContext, type EventStreamViewRenderContext, type FormatEnrichedContextOptions, type HeaderBuildContext, type HeaderElements, type HeaderLayoutContext, type HeaderLayoutRenderer, type HeaderRenderContext, type IconButtonTokens, type IdleIndicatorRenderContext, type ImageContentPart, type InjectAssistantMessageOptions, type InjectMessageOptions, type InjectSystemMessageOptions, type InjectUserMessageOptions, type LabelButtonTokens, type LoadingIndicatorRenderContext, type LoadingIndicatorRenderer, type MarkdownProcessorOptions, type MessageActionCallbacks, type MessageContent, type MessageRenderContext, type MessageTransform, type NPSFeedbackOptions, PRESETS, PRESET_FULLSCREEN, PRESET_MINIMAL, PRESET_SHOP, type ParseOptionsConfig, type ParseRule, type PendingAttachment, type PersonaArtifactKind, type PersonaArtifactManualUpsert, type PersonaArtifactRecord, type PersonaTheme, type PersonaThemePlugin, type RadiusScale, type RuleScoringContext, type SSEEventCallback, type SSEEventRecord, type SanitizeFunction, type SemanticColors, type SemanticSpacing, type SemanticTypography, type ShadowScale, type SlotRenderContext, type SlotRenderer, type SpacingScale, THEME_ZONES, type TextContentPart, type ThemeValidationError, type ThemeValidationResult, type ThemeZone, type ToggleGroupHandle, type ToggleGroupItem, type ToggleGroupTokens, type TokenReference, type TypographyScale, VERSION, type VoiceConfig, type VoiceProvider, type VoiceResult, type VoiceStatus, type WidgetHostLayout, type WidgetHostLayoutMode, type WidgetLayoutSlot, type WidgetPreset, accessibilityPlugin, animationsPlugin, applyThemeVariables, attachHeaderToContainer, brandPlugin, buildComposer, buildDefaultHeader, buildHeader, buildHeaderWithLayout, buildMinimalHeader, collectEnrichedPageContext, componentRegistry, createActionManager, createAgentExperience, createBestAvailableVoiceProvider, createBubbleWithLayout, createCSATFeedback, createComboButton, createComponentMiddleware, createComponentStreamParser, createDefaultSanitizer, createDemoCarousel, createDirectivePostprocessor, createDropdownMenu, createFlexibleJsonStreamParser, createIconButton, createImagePart, createJsonStreamParser, createLabelButton, createLocalStorageAdapter, createMarkdownProcessor, createMarkdownProcessorFromConfig, createMessageActions, createNPSFeedback, createPlainTextParser, createPlugin, createRegexJsonParser, createStandardBubble, createTextPart, createTheme, createThemeObserver, createToggleGroup, createTypingIndicator, createVoiceProvider, createWidgetHostLayout, createXmlParser, initAgentWidget as default, defaultActionHandlers, defaultJsonActionParser, defaultParseRules, detectColorScheme, directivePostprocessor, escapeHtml, extractComponentDirectiveFromMessage, fileToImagePart, formatEnrichedContext, generateAssistantMessageId, generateCodeSnippet, generateMessageId, generateStableSelector, generateUserMessageId, getActiveTheme, getColorScheme, getDisplayText, getHeaderLayout, getImageParts, getPreset, hasComponentDirective, hasImages, headerLayouts, highContrastPlugin, initAgentWidget, isComponentDirectiveType, isDockedMountMode, isVoiceSupported, markdownPostprocessor, mergeWithDefaults, normalizeContent, pluginRegistry, reducedMotionPlugin, renderComponentDirective, renderLoadingIndicatorWithFallback, resolveDockConfig, resolveSanitizer, resolveTokens, themeToCssVariables, validateImageFile, validateTheme };
6386
+ export { ASK_USER_QUESTION_TOOL_NAME, type AgentConfig, type AgentExecutionState, type AgentLoopConfig, type AgentMessageMetadata, type AgentRequestOptions, type AgentToolsConfig, type AgentWidgetAgentRequestPayload, type AgentWidgetApproval, type AgentWidgetApprovalConfig, type AgentWidgetArtifactsFeature, type AgentWidgetArtifactsLayoutConfig, type AgentWidgetAskUserQuestionFeature, type AgentWidgetAskUserQuestionStyles, type AgentWidgetAttachmentsConfig, type AgentWidgetAvatarConfig, AgentWidgetClient, type AgentWidgetComposerConfig, type AgentWidgetConfig, type AgentWidgetController, type AgentWidgetControllerEventMap, type AgentWidgetCustomFetch, type AgentWidgetDockConfig, type AgentWidgetEvent, type AgentWidgetFeatureFlags, type AgentWidgetHeaderLayoutConfig, type AgentWidgetHeadersFunction, type AgentWidgetInitHandle, type AgentWidgetInitOptions, type AgentWidgetLauncherConfig, type AgentWidgetLayoutConfig, type AgentWidgetLoadingIndicatorConfig, type AgentWidgetMarkdownConfig, type AgentWidgetMarkdownOptions, type AgentWidgetMarkdownRendererOverrides, type AgentWidgetMessage, type AgentWidgetMessageActionsConfig, type AgentWidgetMessageFeedback, type AgentWidgetMessageLayoutConfig, type AgentWidgetPlugin, type AgentWidgetRequestPayload, type AgentWidgetSSEEventParser, type AgentWidgetSSEEventResult, AgentWidgetSession, type AgentWidgetSessionStatus, type AgentWidgetStreamAnimationBuffer, type AgentWidgetStreamAnimationBuiltinType, type AgentWidgetStreamAnimationFeature, type AgentWidgetStreamAnimationPlaceholder, type AgentWidgetStreamAnimationType, type AgentWidgetStreamParser, type AgentWidgetStreamParserResult, type AgentWidgetTimestampConfig, type ArtifactConfigPayload, type ArtifactPaneTokens, type ArtifactTabTokens, type ArtifactToolbarTokens, type AskUserQuestionOption, type AskUserQuestionPayload, type AskUserQuestionPrompt, AttachmentManager, type AttachmentManagerConfig, type BorderScale, type CSATFeedbackOptions, type ClientChatRequest, type ClientFeedbackRequest, type ClientFeedbackType, type ClientInitResponse, type ClientSession, type CodeFormat, type CodeGeneratorHooks, type CodeGeneratorOptions, type ColorPalette, type ColorShade, type ComboButtonHandle, type ComponentContext, type ComponentDirective, type ComponentRenderer, type ComponentTokens, type ComposerBuildContext, type ComposerElements, type ContentPart, type CreateComboButtonOptions, type CreateDropdownOptions, type CreateIconButtonOptions, type CreateLabelButtonOptions, type CreateStandardBubbleOptions, type CreateThemeOptions, type CreateToggleGroupOptions, DEFAULT_COMPONENTS, DEFAULT_FLOATING_LAUNCHER_MAX_WIDTH, DEFAULT_FLOATING_LAUNCHER_WIDTH, DEFAULT_PALETTE, DEFAULT_SEMANTIC, DEFAULT_WIDGET_CONFIG, type DeepPartial, type DemoCarouselHandle, type DemoCarouselItem, type DemoCarouselOptions, type DomContextMode, type DomContextOptions, type DropdownMenuHandle, type DropdownMenuItem, type EnrichedPageElement, type EventStreamBadgeColor, type EventStreamConfig, type EventStreamPayloadRenderContext, type EventStreamRowRenderContext, type EventStreamToolbarRenderContext, type EventStreamViewRenderContext, type FormatEnrichedContextOptions, type HeaderBuildContext, type HeaderElements, type HeaderLayoutContext, type HeaderLayoutRenderer, type HeaderRenderContext, type IconButtonTokens, type IdleIndicatorRenderContext, type ImageContentPart, type InjectAssistantMessageOptions, type InjectMessageOptions, type InjectSystemMessageOptions, type InjectUserMessageOptions, type LabelButtonTokens, type LoadingIndicatorRenderContext, type LoadingIndicatorRenderer, type MarkdownProcessorOptions, type MessageActionCallbacks, type MessageContent, type MessageRenderContext, type MessageTransform, type NPSFeedbackOptions, PRESETS, PRESET_FULLSCREEN, PRESET_MINIMAL, PRESET_SHOP, type ParseOptionsConfig, type ParseRule, type PendingAttachment, type PersonaArtifactKind, type PersonaArtifactManualUpsert, type PersonaArtifactRecord, type PersonaTheme, type PersonaThemePlugin, type RadiusScale, type RuleScoringContext, type SSEEventCallback, type SSEEventRecord, type SanitizeFunction, type SemanticColors, type SemanticSpacing, type SemanticTypography, type ShadowScale, type SlotRenderContext, type SlotRenderer, type SpacingScale, type StreamAnimationContext, type StreamAnimationPlugin, THEME_ZONES, type TextContentPart, type ThemeValidationError, type ThemeValidationResult, type ThemeZone, type ToggleGroupHandle, type ToggleGroupItem, type ToggleGroupTokens, type TokenReference, type TypographyScale, VERSION, type VoiceConfig, type VoiceProvider, type VoiceResult, type VoiceStatus, type WidgetHostLayout, type WidgetHostLayoutMode, type WidgetLayoutSlot, type WidgetPreset, accessibilityPlugin, animationsPlugin, applyThemeVariables, attachHeaderToContainer, brandPlugin, buildComposer, buildDefaultHeader, buildHeader, buildHeaderWithLayout, buildMinimalHeader, collectEnrichedPageContext, componentRegistry, createActionManager, createAgentExperience, createAskUserQuestionBubble, createBestAvailableVoiceProvider, createBubbleWithLayout, createCSATFeedback, createComboButton, createComponentMiddleware, createComponentStreamParser, createDefaultSanitizer, createDemoCarousel, createDirectivePostprocessor, createDropdownMenu, createFlexibleJsonStreamParser, createIconButton, createImagePart, createJsonStreamParser, createLabelButton, createLocalStorageAdapter, createMarkdownProcessor, createMarkdownProcessorFromConfig, createMessageActions, createNPSFeedback, createPlainTextParser, createPlugin, createRegexJsonParser, createStandardBubble, createTextPart, createTheme, createThemeObserver, createToggleGroup, createTypingIndicator, createVoiceProvider, createWidgetHostLayout, createXmlParser, initAgentWidget as default, defaultActionHandlers, defaultJsonActionParser, defaultParseRules, detectColorScheme, directivePostprocessor, ensureAskUserQuestionSheet, escapeHtml, extractComponentDirectiveFromMessage, fileToImagePart, formatEnrichedContext, generateAssistantMessageId, generateCodeSnippet, generateMessageId, generateStableSelector, generateUserMessageId, getActiveTheme, getColorScheme, getDisplayText, getHeaderLayout, getImageParts, getPreset, hasComponentDirective, hasImages, headerLayouts, highContrastPlugin, initAgentWidget, isAskUserQuestionMessage, isComponentDirectiveType, isDockedMountMode, isVoiceSupported, listRegisteredStreamAnimations, markdownPostprocessor, mergeWithDefaults, normalizeContent, parseAskUserQuestionPayload, pluginRegistry, reducedMotionPlugin, registerStreamAnimationPlugin, removeAskUserQuestionSheet, renderComponentDirective, renderLoadingIndicatorWithFallback, resolveDockConfig, resolveSanitizer, resolveTokens, themeToCssVariables, unregisterStreamAnimationPlugin, validateImageFile, validateTheme };