@runtypelabs/persona 4.19.0 → 4.21.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 (77) hide show
  1. package/dist/animations/glyph-cycle.d.cts +1 -1
  2. package/dist/animations/glyph-cycle.d.ts +1 -1
  3. package/dist/animations/{types-CG-bLFmk.d.cts → types-B_JdVK9o.d.cts} +2 -0
  4. package/dist/animations/{types-CG-bLFmk.d.ts → types-B_JdVK9o.d.ts} +2 -0
  5. package/dist/animations/wipe.d.cts +1 -1
  6. package/dist/animations/wipe.d.ts +1 -1
  7. package/dist/animations-extra.d.cts +2 -0
  8. package/dist/animations-extra.d.ts +2 -0
  9. package/dist/approval-ui.d.cts +99 -5
  10. package/dist/approval-ui.d.ts +99 -5
  11. package/dist/artifacts-ui.d.cts +99 -5
  12. package/dist/artifacts-ui.d.ts +99 -5
  13. package/dist/codegen.cjs +1 -1
  14. package/dist/codegen.js +1 -1
  15. package/dist/context-mentions.d.cts +99 -5
  16. package/dist/context-mentions.d.ts +99 -5
  17. package/dist/event-stream-view.d.cts +99 -5
  18. package/dist/event-stream-view.d.ts +99 -5
  19. package/dist/forms-ui.d.cts +123 -9
  20. package/dist/forms-ui.d.ts +123 -9
  21. package/dist/history-view.d.cts +2 -0
  22. package/dist/history-view.d.ts +2 -0
  23. package/dist/index.cjs +51 -51
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +128 -10
  26. package/dist/index.d.ts +128 -10
  27. package/dist/index.global.js +34 -34
  28. package/dist/index.global.js.map +1 -1
  29. package/dist/index.js +51 -51
  30. package/dist/index.js.map +1 -1
  31. package/dist/launcher.global.js.map +1 -1
  32. package/dist/session-reconnect.d.cts +99 -5
  33. package/dist/session-reconnect.d.ts +99 -5
  34. package/dist/smart-dom-reader.d.cts +99 -5
  35. package/dist/smart-dom-reader.d.ts +99 -5
  36. package/dist/theme-editor-preview.cjs +53 -53
  37. package/dist/theme-editor-preview.d.cts +99 -5
  38. package/dist/theme-editor-preview.d.ts +99 -5
  39. package/dist/theme-editor-preview.js +31 -31
  40. package/dist/theme-editor.d.cts +99 -5
  41. package/dist/theme-editor.d.ts +99 -5
  42. package/dist/theme-reference.cjs +1 -1
  43. package/dist/theme-reference.d.cts +46 -5
  44. package/dist/theme-reference.d.ts +46 -5
  45. package/dist/theme-reference.js +1 -1
  46. package/dist/webmcp-runtime.d.cts +16 -0
  47. package/dist/webmcp-runtime.d.ts +16 -0
  48. package/dist/widget.css +1 -1
  49. package/package.json +1 -1
  50. package/src/client-visitor-history.test.ts +342 -3
  51. package/src/client.test.ts +141 -3
  52. package/src/client.ts +157 -39
  53. package/src/components/composer-actions.ts +27 -1
  54. package/src/components/composer-model-picker.ts +4 -14
  55. package/src/components/composer-overflow-menu.ts +14 -0
  56. package/src/components/composer-parts.ts +20 -0
  57. package/src/generated/runtype-openapi-contract.ts +2 -0
  58. package/src/index-core.ts +2 -0
  59. package/src/session.ts +139 -103
  60. package/src/session.webmcp.test.ts +48 -1
  61. package/src/styles/widget-styles.test.ts +83 -1
  62. package/src/styles/widget.css +50 -14
  63. package/src/theme-reference.ts +1 -1
  64. package/src/types/theme.ts +47 -5
  65. package/src/types.ts +63 -0
  66. package/src/ui.composer-action-visibility.test.ts +202 -0
  67. package/src/ui.composer-models.test.ts +37 -0
  68. package/src/ui.composer-modes.test.ts +82 -0
  69. package/src/ui.composer-overflow.test.ts +78 -0
  70. package/src/ui.history-lifecycle.test.ts +2 -2
  71. package/src/ui.ts +77 -6
  72. package/src/utils/__snapshots__/tokens-parity.test.ts.snap +1633 -686
  73. package/src/utils/composer-modes.test.ts +33 -0
  74. package/src/utils/composer-modes.ts +19 -2
  75. package/src/utils/tokens-parity.test.ts +20 -0
  76. package/src/utils/tokens.test.ts +76 -0
  77. package/src/utils/tokens.ts +4 -4
@@ -1,4 +1,4 @@
1
- import { S as StreamAnimationPlugin } from './types-CG-bLFmk.cjs';
1
+ import { S as StreamAnimationPlugin } from './types-B_JdVK9o.cjs';
2
2
 
3
3
  declare const glyphCycle: StreamAnimationPlugin;
4
4
 
@@ -1,4 +1,4 @@
1
- import { S as StreamAnimationPlugin } from './types-CG-bLFmk.js';
1
+ import { S as StreamAnimationPlugin } from './types-B_JdVK9o.js';
2
2
 
3
3
  declare const glyphCycle: StreamAnimationPlugin;
4
4
 
@@ -49,8 +49,10 @@ type RuntypeExecutionStreamEvent = ({
49
49
  message: string;
50
50
  };
51
51
  executionId: string;
52
+ finalOutput?: string;
52
53
  kind: "agent" | "flow";
53
54
  seq: number;
55
+ stopReason?: string;
54
56
  type: "execution_error";
55
57
  upgradeUrl?: string;
56
58
  }) | ({
@@ -49,8 +49,10 @@ type RuntypeExecutionStreamEvent = ({
49
49
  message: string;
50
50
  };
51
51
  executionId: string;
52
+ finalOutput?: string;
52
53
  kind: "agent" | "flow";
53
54
  seq: number;
55
+ stopReason?: string;
54
56
  type: "execution_error";
55
57
  upgradeUrl?: string;
56
58
  }) | ({
@@ -1,4 +1,4 @@
1
- import { S as StreamAnimationPlugin } from './types-CG-bLFmk.cjs';
1
+ import { S as StreamAnimationPlugin } from './types-B_JdVK9o.cjs';
2
2
 
3
3
  declare const wipe: StreamAnimationPlugin;
4
4
 
@@ -1,4 +1,4 @@
1
- import { S as StreamAnimationPlugin } from './types-CG-bLFmk.js';
1
+ import { S as StreamAnimationPlugin } from './types-B_JdVK9o.js';
2
2
 
3
3
  declare const wipe: StreamAnimationPlugin;
4
4
 
@@ -49,8 +49,10 @@ type RuntypeExecutionStreamEvent = ({
49
49
  message: string;
50
50
  };
51
51
  executionId: string;
52
+ finalOutput?: string;
52
53
  kind: "agent" | "flow";
53
54
  seq: number;
55
+ stopReason?: string;
54
56
  type: "execution_error";
55
57
  upgradeUrl?: string;
56
58
  }) | ({
@@ -49,8 +49,10 @@ type RuntypeExecutionStreamEvent = ({
49
49
  message: string;
50
50
  };
51
51
  executionId: string;
52
+ finalOutput?: string;
52
53
  kind: "agent" | "flow";
53
54
  seq: number;
55
+ stopReason?: string;
54
56
  type: "execution_error";
55
57
  upgradeUrl?: string;
56
58
  }) | ({
@@ -1224,27 +1224,66 @@ interface ComposerSegmentedTokens {
1224
1224
  itemPadding?: string;
1225
1225
  }
1226
1226
  /**
1227
- * Model picker popover (`composer.modelPicker.presentation: "popover"`).
1227
+ * Model picker chrome (`composer.models`).
1228
+ *
1229
+ * The surface keys (`background`, `hoverBackground`, `borderColor`,
1230
+ * `borderRadius`, `labelColor`) style the CLOSED control, so the native
1231
+ * `<select>` and the `presentation: "popover"` trigger share one vocabulary.
1232
+ * The `menu*`, `rowHoverBackground`, and `descriptionColor` keys style the
1233
+ * popover panel and are inert under the native select, as is `suffixColor`,
1234
+ * which a `<select>` cannot carry either.
1228
1235
  *
1229
1236
  * Every key is optional and unset ones emit nothing: the stylesheet's `var()`
1230
1237
  * fallbacks own the default look, which derives from the surface and ghost
1231
- * button tokens. Inert under the native `<select>` presentation, except
1232
- * `suffixColor`, which the native control cannot carry either.
1238
+ * button tokens.
1233
1239
  */
1234
1240
  interface ComposerModelPickerTokens {
1241
+ /** Closed control fill. @default the ghost button fill (transparent) */
1242
+ background?: TokenReference<'color'>;
1243
+ /** Closed control fill under hover. @default the ghost hover wash */
1244
+ hoverBackground?: TokenReference<'color'>;
1245
+ /**
1246
+ * Closed control outline, drawn as a 1px inset ring so setting it never
1247
+ * resizes the control. @default none
1248
+ */
1249
+ borderColor?: TokenReference<'color'>;
1250
+ /** Closed control corner radius. @default the ghost button radius */
1251
+ borderRadius?: TokenReference<'radius'>;
1235
1252
  /** Panel fill behind the rows. @default semantic.colors.surface */
1236
1253
  menuBackground?: TokenReference<'color'>;
1237
1254
  /** Panel corner radius. @default palette.radius.lg */
1238
1255
  menuBorderRadius?: TokenReference<'radius'>;
1239
1256
  /** Row fill under hover and the focused option. @default the ghost hover wash */
1240
1257
  rowHoverBackground?: TokenReference<'color'>;
1241
- /** Row label and closed-control label color. @default inherited text */
1258
+ /**
1259
+ * Row label color, plus the closed control's text and chevron in both
1260
+ * presentations. @default the ghost button foreground
1261
+ */
1242
1262
  labelColor?: TokenReference<'color'>;
1243
1263
  /** Second line under a row label. @default semantic.colors.textMuted */
1244
1264
  descriptionColor?: TokenReference<'color'>;
1245
1265
  /** `composer.modelPicker.suffix` on the closed control. @default semantic.colors.textMuted */
1246
1266
  suffixColor?: TokenReference<'color'>;
1247
1267
  }
1268
+ /**
1269
+ * Composer overflow `+` menu panel (`composer.actionOverflow`).
1270
+ *
1271
+ * Every key is optional and unset ones emit nothing: the stylesheet's `var()`
1272
+ * fallbacks own the default look. The panel is portaled outside the themed
1273
+ * mount, so the menu forwards the configured values onto it when it opens.
1274
+ */
1275
+ interface ComposerOverflowMenuTokens {
1276
+ /** Panel fill behind the rows. @default semantic.colors.surface */
1277
+ background?: TokenReference<'color'>;
1278
+ /** Panel border color. @default semantic.colors.border */
1279
+ borderColor?: TokenReference<'color'>;
1280
+ /** Panel corner radius. @default palette.radius.lg */
1281
+ borderRadius?: TokenReference<'radius'>;
1282
+ /** Row text and glyph color. @default semantic.colors.text */
1283
+ foreground?: TokenReference<'color'>;
1284
+ /** Panel elevation (raw CSS box-shadow, `none` allowed). @default palette.shadows.md */
1285
+ shadow?: string;
1286
+ }
1248
1287
  /** Composer (message input) chrome. */
1249
1288
  interface ComposerChromeTokens {
1250
1289
  /** Box-shadow on the composer form (raw CSS, e.g. `none`). */
@@ -1279,8 +1318,10 @@ interface ComposerChromeTokens {
1279
1318
  overlayBand?: string;
1280
1319
  /** Segmented mode-group track. */
1281
1320
  segmented?: ComposerSegmentedTokens;
1282
- /** Model picker popover chrome. */
1321
+ /** Model picker chrome (closed control plus popover panel). */
1283
1322
  modelPicker?: ComposerModelPickerTokens;
1323
+ /** Overflow `+` menu panel chrome. */
1324
+ overflowMenu?: ComposerOverflowMenuTokens;
1284
1325
  }
1285
1326
  /**
1286
1327
  * Motion timing shared by every composer animation.
@@ -1603,8 +1644,10 @@ type RuntypeExecutionStreamEvent = ({
1603
1644
  message: string;
1604
1645
  };
1605
1646
  executionId: string;
1647
+ finalOutput?: string;
1606
1648
  kind: "agent" | "flow";
1607
1649
  seq: number;
1650
+ stopReason?: string;
1608
1651
  type: "execution_error";
1609
1652
  upgradeUrl?: string;
1610
1653
  }) | ({
@@ -2938,6 +2981,22 @@ type AgentWidgetWebMcpConfig = {
2938
2981
  * `window.confirm` fallback only applies when no widget UI is attached.
2939
2982
  */
2940
2983
  onConfirm?: WebMcpConfirmHandler;
2984
+ /**
2985
+ * How the widget runs the `webmcp:*` calls of ONE turn when the model emits
2986
+ * several at once.
2987
+ *
2988
+ * - `'parallel'` (default): every call executes concurrently and a gated
2989
+ * sibling's approval never blocks another's execution. Right for
2990
+ * independent, order-insensitive tools (catalog lookups, add-to-cart).
2991
+ * - `'sequential'`: calls execute one at a time, in the order the model
2992
+ * emitted them; the next starts only after the previous one settles
2993
+ * (including its approval bubble). Use this when the page tools share
2994
+ * mutable state that concurrent execution would interleave, e.g. a
2995
+ * canvas where every stroke selects a color/tool before drawing.
2996
+ *
2997
+ * Either way, all outputs still return to the server in a single `/resume`.
2998
+ */
2999
+ execution?: 'parallel' | 'sequential';
2941
3000
  };
2942
3001
  /**
2943
3002
  * The coordinates needed to resume a durable agent turn after the SSE
@@ -5717,6 +5776,15 @@ type ComposerActionPlacement = "start" | "end";
5717
5776
  * it, `"overflow"` and `"auto"` both render in the bar.
5718
5777
  */
5719
5778
  type ComposerActionPresentation = "bar" | "overflow" | "auto";
5779
+ /**
5780
+ * When a composer action is mounted, as a function of the draft.
5781
+ *
5782
+ * - `"always"` (default): the control is always mounted.
5783
+ * - `"when-empty"`: hidden as soon as the draft holds text or an attachment,
5784
+ * and while a response streams.
5785
+ * - `"when-text"`: the inverse, on the same draft state the send control reads.
5786
+ */
5787
+ type ComposerActionVisibility = "always" | "when-empty" | "when-text";
5720
5788
  /**
5721
5789
  * Fields shared by every composer action.
5722
5790
  *
@@ -5732,6 +5800,13 @@ type ComposerActionBase = {
5732
5800
  presentation?: ComposerActionPresentation;
5733
5801
  order?: number;
5734
5802
  visible?: boolean | ((state: Readonly<ComposerState>) => boolean);
5803
+ /**
5804
+ * Draft-driven visibility, on the same state `sendButton.visibility` reads.
5805
+ * Hidden removes the control from layout and tab order. Combined with
5806
+ * `visible`: both must pass.
5807
+ * @default "always"
5808
+ */
5809
+ visibility?: ComposerActionVisibility;
5735
5810
  disabled?: boolean | ((state: Readonly<ComposerState>) => boolean);
5736
5811
  /** Disable while a response streams, through the composer's own mechanism. */
5737
5812
  disableWhenStreaming?: boolean;
@@ -5878,6 +5953,15 @@ type ComposerMode = {
5878
5953
  * row, never in the overflow menu.
5879
5954
  */
5880
5955
  type ComposerModeGroupPresentation = "buttons" | "segmented";
5956
+ /**
5957
+ * Whether a group's active modes also render as removable chips.
5958
+ *
5959
+ * - `"auto"` (default): one chip per active mode, except under `"segmented"`
5960
+ * presentation, where the track already shows the state.
5961
+ * - `"hidden"`: no chips for this group under any presentation. The pressed bar
5962
+ * button carries the state, and deselection stays on the button.
5963
+ */
5964
+ type ComposerModeChipVisibility = "auto" | "hidden";
5881
5965
  /**
5882
5966
  * Selection policy for a set of modes. `"single"` deselects siblings when one
5883
5967
  * is chosen; `"multiple"` toggles independently.
@@ -5887,6 +5971,12 @@ type ComposerModeGroup = {
5887
5971
  selection: "single" | "multiple";
5888
5972
  /** @default "buttons" */
5889
5973
  presentation?: ComposerModeGroupPresentation;
5974
+ /**
5975
+ * Chip row policy for this group's active modes. The chip row itself is
5976
+ * derived from its children, so a group with no other chips leaves no gap.
5977
+ * @default "auto"
5978
+ */
5979
+ chipVisibility?: ComposerModeChipVisibility;
5890
5980
  /**
5891
5981
  * Accessible name for a segmented track. With it the track is a labelled
5892
5982
  * `role="group"`; without it the segments stand on their own names.
@@ -7196,6 +7286,10 @@ type ClientSession = {
7196
7286
  targetId?: string;
7197
7287
  /** Opaque change token; differs whenever the conversation transcript mutated. */
7198
7288
  conversationRevision?: string;
7289
+ /** Server-negotiated durable reconnect support for this client-token session. */
7290
+ durableRecovery?: {
7291
+ enabled: boolean;
7292
+ };
7199
7293
  /** Visitor grant backing history. `token` appears only at mint. */
7200
7294
  visitor?: ClientVisitorGrant;
7201
7295
  /** Configuration from the server */
@@ -1224,27 +1224,66 @@ interface ComposerSegmentedTokens {
1224
1224
  itemPadding?: string;
1225
1225
  }
1226
1226
  /**
1227
- * Model picker popover (`composer.modelPicker.presentation: "popover"`).
1227
+ * Model picker chrome (`composer.models`).
1228
+ *
1229
+ * The surface keys (`background`, `hoverBackground`, `borderColor`,
1230
+ * `borderRadius`, `labelColor`) style the CLOSED control, so the native
1231
+ * `<select>` and the `presentation: "popover"` trigger share one vocabulary.
1232
+ * The `menu*`, `rowHoverBackground`, and `descriptionColor` keys style the
1233
+ * popover panel and are inert under the native select, as is `suffixColor`,
1234
+ * which a `<select>` cannot carry either.
1228
1235
  *
1229
1236
  * Every key is optional and unset ones emit nothing: the stylesheet's `var()`
1230
1237
  * fallbacks own the default look, which derives from the surface and ghost
1231
- * button tokens. Inert under the native `<select>` presentation, except
1232
- * `suffixColor`, which the native control cannot carry either.
1238
+ * button tokens.
1233
1239
  */
1234
1240
  interface ComposerModelPickerTokens {
1241
+ /** Closed control fill. @default the ghost button fill (transparent) */
1242
+ background?: TokenReference<'color'>;
1243
+ /** Closed control fill under hover. @default the ghost hover wash */
1244
+ hoverBackground?: TokenReference<'color'>;
1245
+ /**
1246
+ * Closed control outline, drawn as a 1px inset ring so setting it never
1247
+ * resizes the control. @default none
1248
+ */
1249
+ borderColor?: TokenReference<'color'>;
1250
+ /** Closed control corner radius. @default the ghost button radius */
1251
+ borderRadius?: TokenReference<'radius'>;
1235
1252
  /** Panel fill behind the rows. @default semantic.colors.surface */
1236
1253
  menuBackground?: TokenReference<'color'>;
1237
1254
  /** Panel corner radius. @default palette.radius.lg */
1238
1255
  menuBorderRadius?: TokenReference<'radius'>;
1239
1256
  /** Row fill under hover and the focused option. @default the ghost hover wash */
1240
1257
  rowHoverBackground?: TokenReference<'color'>;
1241
- /** Row label and closed-control label color. @default inherited text */
1258
+ /**
1259
+ * Row label color, plus the closed control's text and chevron in both
1260
+ * presentations. @default the ghost button foreground
1261
+ */
1242
1262
  labelColor?: TokenReference<'color'>;
1243
1263
  /** Second line under a row label. @default semantic.colors.textMuted */
1244
1264
  descriptionColor?: TokenReference<'color'>;
1245
1265
  /** `composer.modelPicker.suffix` on the closed control. @default semantic.colors.textMuted */
1246
1266
  suffixColor?: TokenReference<'color'>;
1247
1267
  }
1268
+ /**
1269
+ * Composer overflow `+` menu panel (`composer.actionOverflow`).
1270
+ *
1271
+ * Every key is optional and unset ones emit nothing: the stylesheet's `var()`
1272
+ * fallbacks own the default look. The panel is portaled outside the themed
1273
+ * mount, so the menu forwards the configured values onto it when it opens.
1274
+ */
1275
+ interface ComposerOverflowMenuTokens {
1276
+ /** Panel fill behind the rows. @default semantic.colors.surface */
1277
+ background?: TokenReference<'color'>;
1278
+ /** Panel border color. @default semantic.colors.border */
1279
+ borderColor?: TokenReference<'color'>;
1280
+ /** Panel corner radius. @default palette.radius.lg */
1281
+ borderRadius?: TokenReference<'radius'>;
1282
+ /** Row text and glyph color. @default semantic.colors.text */
1283
+ foreground?: TokenReference<'color'>;
1284
+ /** Panel elevation (raw CSS box-shadow, `none` allowed). @default palette.shadows.md */
1285
+ shadow?: string;
1286
+ }
1248
1287
  /** Composer (message input) chrome. */
1249
1288
  interface ComposerChromeTokens {
1250
1289
  /** Box-shadow on the composer form (raw CSS, e.g. `none`). */
@@ -1279,8 +1318,10 @@ interface ComposerChromeTokens {
1279
1318
  overlayBand?: string;
1280
1319
  /** Segmented mode-group track. */
1281
1320
  segmented?: ComposerSegmentedTokens;
1282
- /** Model picker popover chrome. */
1321
+ /** Model picker chrome (closed control plus popover panel). */
1283
1322
  modelPicker?: ComposerModelPickerTokens;
1323
+ /** Overflow `+` menu panel chrome. */
1324
+ overflowMenu?: ComposerOverflowMenuTokens;
1284
1325
  }
1285
1326
  /**
1286
1327
  * Motion timing shared by every composer animation.
@@ -1603,8 +1644,10 @@ type RuntypeExecutionStreamEvent = ({
1603
1644
  message: string;
1604
1645
  };
1605
1646
  executionId: string;
1647
+ finalOutput?: string;
1606
1648
  kind: "agent" | "flow";
1607
1649
  seq: number;
1650
+ stopReason?: string;
1608
1651
  type: "execution_error";
1609
1652
  upgradeUrl?: string;
1610
1653
  }) | ({
@@ -2938,6 +2981,22 @@ type AgentWidgetWebMcpConfig = {
2938
2981
  * `window.confirm` fallback only applies when no widget UI is attached.
2939
2982
  */
2940
2983
  onConfirm?: WebMcpConfirmHandler;
2984
+ /**
2985
+ * How the widget runs the `webmcp:*` calls of ONE turn when the model emits
2986
+ * several at once.
2987
+ *
2988
+ * - `'parallel'` (default): every call executes concurrently and a gated
2989
+ * sibling's approval never blocks another's execution. Right for
2990
+ * independent, order-insensitive tools (catalog lookups, add-to-cart).
2991
+ * - `'sequential'`: calls execute one at a time, in the order the model
2992
+ * emitted them; the next starts only after the previous one settles
2993
+ * (including its approval bubble). Use this when the page tools share
2994
+ * mutable state that concurrent execution would interleave, e.g. a
2995
+ * canvas where every stroke selects a color/tool before drawing.
2996
+ *
2997
+ * Either way, all outputs still return to the server in a single `/resume`.
2998
+ */
2999
+ execution?: 'parallel' | 'sequential';
2941
3000
  };
2942
3001
  /**
2943
3002
  * The coordinates needed to resume a durable agent turn after the SSE
@@ -5717,6 +5776,15 @@ type ComposerActionPlacement = "start" | "end";
5717
5776
  * it, `"overflow"` and `"auto"` both render in the bar.
5718
5777
  */
5719
5778
  type ComposerActionPresentation = "bar" | "overflow" | "auto";
5779
+ /**
5780
+ * When a composer action is mounted, as a function of the draft.
5781
+ *
5782
+ * - `"always"` (default): the control is always mounted.
5783
+ * - `"when-empty"`: hidden as soon as the draft holds text or an attachment,
5784
+ * and while a response streams.
5785
+ * - `"when-text"`: the inverse, on the same draft state the send control reads.
5786
+ */
5787
+ type ComposerActionVisibility = "always" | "when-empty" | "when-text";
5720
5788
  /**
5721
5789
  * Fields shared by every composer action.
5722
5790
  *
@@ -5732,6 +5800,13 @@ type ComposerActionBase = {
5732
5800
  presentation?: ComposerActionPresentation;
5733
5801
  order?: number;
5734
5802
  visible?: boolean | ((state: Readonly<ComposerState>) => boolean);
5803
+ /**
5804
+ * Draft-driven visibility, on the same state `sendButton.visibility` reads.
5805
+ * Hidden removes the control from layout and tab order. Combined with
5806
+ * `visible`: both must pass.
5807
+ * @default "always"
5808
+ */
5809
+ visibility?: ComposerActionVisibility;
5735
5810
  disabled?: boolean | ((state: Readonly<ComposerState>) => boolean);
5736
5811
  /** Disable while a response streams, through the composer's own mechanism. */
5737
5812
  disableWhenStreaming?: boolean;
@@ -5878,6 +5953,15 @@ type ComposerMode = {
5878
5953
  * row, never in the overflow menu.
5879
5954
  */
5880
5955
  type ComposerModeGroupPresentation = "buttons" | "segmented";
5956
+ /**
5957
+ * Whether a group's active modes also render as removable chips.
5958
+ *
5959
+ * - `"auto"` (default): one chip per active mode, except under `"segmented"`
5960
+ * presentation, where the track already shows the state.
5961
+ * - `"hidden"`: no chips for this group under any presentation. The pressed bar
5962
+ * button carries the state, and deselection stays on the button.
5963
+ */
5964
+ type ComposerModeChipVisibility = "auto" | "hidden";
5881
5965
  /**
5882
5966
  * Selection policy for a set of modes. `"single"` deselects siblings when one
5883
5967
  * is chosen; `"multiple"` toggles independently.
@@ -5887,6 +5971,12 @@ type ComposerModeGroup = {
5887
5971
  selection: "single" | "multiple";
5888
5972
  /** @default "buttons" */
5889
5973
  presentation?: ComposerModeGroupPresentation;
5974
+ /**
5975
+ * Chip row policy for this group's active modes. The chip row itself is
5976
+ * derived from its children, so a group with no other chips leaves no gap.
5977
+ * @default "auto"
5978
+ */
5979
+ chipVisibility?: ComposerModeChipVisibility;
5890
5980
  /**
5891
5981
  * Accessible name for a segmented track. With it the track is a labelled
5892
5982
  * `role="group"`; without it the segments stand on their own names.
@@ -7196,6 +7286,10 @@ type ClientSession = {
7196
7286
  targetId?: string;
7197
7287
  /** Opaque change token; differs whenever the conversation transcript mutated. */
7198
7288
  conversationRevision?: string;
7289
+ /** Server-negotiated durable reconnect support for this client-token session. */
7290
+ durableRecovery?: {
7291
+ enabled: boolean;
7292
+ };
7199
7293
  /** Visitor grant backing history. `token` appears only at mint. */
7200
7294
  visitor?: ClientVisitorGrant;
7201
7295
  /** Configuration from the server */
@@ -1226,27 +1226,66 @@ interface ComposerSegmentedTokens {
1226
1226
  itemPadding?: string;
1227
1227
  }
1228
1228
  /**
1229
- * Model picker popover (`composer.modelPicker.presentation: "popover"`).
1229
+ * Model picker chrome (`composer.models`).
1230
+ *
1231
+ * The surface keys (`background`, `hoverBackground`, `borderColor`,
1232
+ * `borderRadius`, `labelColor`) style the CLOSED control, so the native
1233
+ * `<select>` and the `presentation: "popover"` trigger share one vocabulary.
1234
+ * The `menu*`, `rowHoverBackground`, and `descriptionColor` keys style the
1235
+ * popover panel and are inert under the native select, as is `suffixColor`,
1236
+ * which a `<select>` cannot carry either.
1230
1237
  *
1231
1238
  * Every key is optional and unset ones emit nothing: the stylesheet's `var()`
1232
1239
  * fallbacks own the default look, which derives from the surface and ghost
1233
- * button tokens. Inert under the native `<select>` presentation, except
1234
- * `suffixColor`, which the native control cannot carry either.
1240
+ * button tokens.
1235
1241
  */
1236
1242
  interface ComposerModelPickerTokens {
1243
+ /** Closed control fill. @default the ghost button fill (transparent) */
1244
+ background?: TokenReference<'color'>;
1245
+ /** Closed control fill under hover. @default the ghost hover wash */
1246
+ hoverBackground?: TokenReference<'color'>;
1247
+ /**
1248
+ * Closed control outline, drawn as a 1px inset ring so setting it never
1249
+ * resizes the control. @default none
1250
+ */
1251
+ borderColor?: TokenReference<'color'>;
1252
+ /** Closed control corner radius. @default the ghost button radius */
1253
+ borderRadius?: TokenReference<'radius'>;
1237
1254
  /** Panel fill behind the rows. @default semantic.colors.surface */
1238
1255
  menuBackground?: TokenReference<'color'>;
1239
1256
  /** Panel corner radius. @default palette.radius.lg */
1240
1257
  menuBorderRadius?: TokenReference<'radius'>;
1241
1258
  /** Row fill under hover and the focused option. @default the ghost hover wash */
1242
1259
  rowHoverBackground?: TokenReference<'color'>;
1243
- /** Row label and closed-control label color. @default inherited text */
1260
+ /**
1261
+ * Row label color, plus the closed control's text and chevron in both
1262
+ * presentations. @default the ghost button foreground
1263
+ */
1244
1264
  labelColor?: TokenReference<'color'>;
1245
1265
  /** Second line under a row label. @default semantic.colors.textMuted */
1246
1266
  descriptionColor?: TokenReference<'color'>;
1247
1267
  /** `composer.modelPicker.suffix` on the closed control. @default semantic.colors.textMuted */
1248
1268
  suffixColor?: TokenReference<'color'>;
1249
1269
  }
1270
+ /**
1271
+ * Composer overflow `+` menu panel (`composer.actionOverflow`).
1272
+ *
1273
+ * Every key is optional and unset ones emit nothing: the stylesheet's `var()`
1274
+ * fallbacks own the default look. The panel is portaled outside the themed
1275
+ * mount, so the menu forwards the configured values onto it when it opens.
1276
+ */
1277
+ interface ComposerOverflowMenuTokens {
1278
+ /** Panel fill behind the rows. @default semantic.colors.surface */
1279
+ background?: TokenReference<'color'>;
1280
+ /** Panel border color. @default semantic.colors.border */
1281
+ borderColor?: TokenReference<'color'>;
1282
+ /** Panel corner radius. @default palette.radius.lg */
1283
+ borderRadius?: TokenReference<'radius'>;
1284
+ /** Row text and glyph color. @default semantic.colors.text */
1285
+ foreground?: TokenReference<'color'>;
1286
+ /** Panel elevation (raw CSS box-shadow, `none` allowed). @default palette.shadows.md */
1287
+ shadow?: string;
1288
+ }
1250
1289
  /** Composer (message input) chrome. */
1251
1290
  interface ComposerChromeTokens {
1252
1291
  /** Box-shadow on the composer form (raw CSS, e.g. `none`). */
@@ -1281,8 +1320,10 @@ interface ComposerChromeTokens {
1281
1320
  overlayBand?: string;
1282
1321
  /** Segmented mode-group track. */
1283
1322
  segmented?: ComposerSegmentedTokens;
1284
- /** Model picker popover chrome. */
1323
+ /** Model picker chrome (closed control plus popover panel). */
1285
1324
  modelPicker?: ComposerModelPickerTokens;
1325
+ /** Overflow `+` menu panel chrome. */
1326
+ overflowMenu?: ComposerOverflowMenuTokens;
1286
1327
  }
1287
1328
  /**
1288
1329
  * Motion timing shared by every composer animation.
@@ -1605,8 +1646,10 @@ type RuntypeExecutionStreamEvent = ({
1605
1646
  message: string;
1606
1647
  };
1607
1648
  executionId: string;
1649
+ finalOutput?: string;
1608
1650
  kind: "agent" | "flow";
1609
1651
  seq: number;
1652
+ stopReason?: string;
1610
1653
  type: "execution_error";
1611
1654
  upgradeUrl?: string;
1612
1655
  }) | ({
@@ -2940,6 +2983,22 @@ type AgentWidgetWebMcpConfig = {
2940
2983
  * `window.confirm` fallback only applies when no widget UI is attached.
2941
2984
  */
2942
2985
  onConfirm?: WebMcpConfirmHandler;
2986
+ /**
2987
+ * How the widget runs the `webmcp:*` calls of ONE turn when the model emits
2988
+ * several at once.
2989
+ *
2990
+ * - `'parallel'` (default): every call executes concurrently and a gated
2991
+ * sibling's approval never blocks another's execution. Right for
2992
+ * independent, order-insensitive tools (catalog lookups, add-to-cart).
2993
+ * - `'sequential'`: calls execute one at a time, in the order the model
2994
+ * emitted them; the next starts only after the previous one settles
2995
+ * (including its approval bubble). Use this when the page tools share
2996
+ * mutable state that concurrent execution would interleave, e.g. a
2997
+ * canvas where every stroke selects a color/tool before drawing.
2998
+ *
2999
+ * Either way, all outputs still return to the server in a single `/resume`.
3000
+ */
3001
+ execution?: 'parallel' | 'sequential';
2943
3002
  };
2944
3003
  /**
2945
3004
  * The coordinates needed to resume a durable agent turn after the SSE
@@ -5719,6 +5778,15 @@ type ComposerActionPlacement = "start" | "end";
5719
5778
  * it, `"overflow"` and `"auto"` both render in the bar.
5720
5779
  */
5721
5780
  type ComposerActionPresentation = "bar" | "overflow" | "auto";
5781
+ /**
5782
+ * When a composer action is mounted, as a function of the draft.
5783
+ *
5784
+ * - `"always"` (default): the control is always mounted.
5785
+ * - `"when-empty"`: hidden as soon as the draft holds text or an attachment,
5786
+ * and while a response streams.
5787
+ * - `"when-text"`: the inverse, on the same draft state the send control reads.
5788
+ */
5789
+ type ComposerActionVisibility = "always" | "when-empty" | "when-text";
5722
5790
  /**
5723
5791
  * Fields shared by every composer action.
5724
5792
  *
@@ -5734,6 +5802,13 @@ type ComposerActionBase = {
5734
5802
  presentation?: ComposerActionPresentation;
5735
5803
  order?: number;
5736
5804
  visible?: boolean | ((state: Readonly<ComposerState>) => boolean);
5805
+ /**
5806
+ * Draft-driven visibility, on the same state `sendButton.visibility` reads.
5807
+ * Hidden removes the control from layout and tab order. Combined with
5808
+ * `visible`: both must pass.
5809
+ * @default "always"
5810
+ */
5811
+ visibility?: ComposerActionVisibility;
5737
5812
  disabled?: boolean | ((state: Readonly<ComposerState>) => boolean);
5738
5813
  /** Disable while a response streams, through the composer's own mechanism. */
5739
5814
  disableWhenStreaming?: boolean;
@@ -5880,6 +5955,15 @@ type ComposerMode = {
5880
5955
  * row, never in the overflow menu.
5881
5956
  */
5882
5957
  type ComposerModeGroupPresentation = "buttons" | "segmented";
5958
+ /**
5959
+ * Whether a group's active modes also render as removable chips.
5960
+ *
5961
+ * - `"auto"` (default): one chip per active mode, except under `"segmented"`
5962
+ * presentation, where the track already shows the state.
5963
+ * - `"hidden"`: no chips for this group under any presentation. The pressed bar
5964
+ * button carries the state, and deselection stays on the button.
5965
+ */
5966
+ type ComposerModeChipVisibility = "auto" | "hidden";
5883
5967
  /**
5884
5968
  * Selection policy for a set of modes. `"single"` deselects siblings when one
5885
5969
  * is chosen; `"multiple"` toggles independently.
@@ -5889,6 +5973,12 @@ type ComposerModeGroup = {
5889
5973
  selection: "single" | "multiple";
5890
5974
  /** @default "buttons" */
5891
5975
  presentation?: ComposerModeGroupPresentation;
5976
+ /**
5977
+ * Chip row policy for this group's active modes. The chip row itself is
5978
+ * derived from its children, so a group with no other chips leaves no gap.
5979
+ * @default "auto"
5980
+ */
5981
+ chipVisibility?: ComposerModeChipVisibility;
5892
5982
  /**
5893
5983
  * Accessible name for a segmented track. With it the track is a labelled
5894
5984
  * `role="group"`; without it the segments stand on their own names.
@@ -7198,6 +7288,10 @@ type ClientSession = {
7198
7288
  targetId?: string;
7199
7289
  /** Opaque change token; differs whenever the conversation transcript mutated. */
7200
7290
  conversationRevision?: string;
7291
+ /** Server-negotiated durable reconnect support for this client-token session. */
7292
+ durableRecovery?: {
7293
+ enabled: boolean;
7294
+ };
7201
7295
  /** Visitor grant backing history. `token` appears only at mint. */
7202
7296
  visitor?: ClientVisitorGrant;
7203
7297
  /** Configuration from the server */