@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
@@ -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 */
@@ -1493,27 +1493,66 @@ interface ComposerSegmentedTokens {
1493
1493
  itemPadding?: string;
1494
1494
  }
1495
1495
  /**
1496
- * Model picker popover (`composer.modelPicker.presentation: "popover"`).
1496
+ * Model picker chrome (`composer.models`).
1497
+ *
1498
+ * The surface keys (`background`, `hoverBackground`, `borderColor`,
1499
+ * `borderRadius`, `labelColor`) style the CLOSED control, so the native
1500
+ * `<select>` and the `presentation: "popover"` trigger share one vocabulary.
1501
+ * The `menu*`, `rowHoverBackground`, and `descriptionColor` keys style the
1502
+ * popover panel and are inert under the native select, as is `suffixColor`,
1503
+ * which a `<select>` cannot carry either.
1497
1504
  *
1498
1505
  * Every key is optional and unset ones emit nothing: the stylesheet's `var()`
1499
1506
  * fallbacks own the default look, which derives from the surface and ghost
1500
- * button tokens. Inert under the native `<select>` presentation, except
1501
- * `suffixColor`, which the native control cannot carry either.
1507
+ * button tokens.
1502
1508
  */
1503
1509
  interface ComposerModelPickerTokens {
1510
+ /** Closed control fill. @default the ghost button fill (transparent) */
1511
+ background?: TokenReference<'color'>;
1512
+ /** Closed control fill under hover. @default the ghost hover wash */
1513
+ hoverBackground?: TokenReference<'color'>;
1514
+ /**
1515
+ * Closed control outline, drawn as a 1px inset ring so setting it never
1516
+ * resizes the control. @default none
1517
+ */
1518
+ borderColor?: TokenReference<'color'>;
1519
+ /** Closed control corner radius. @default the ghost button radius */
1520
+ borderRadius?: TokenReference<'radius'>;
1504
1521
  /** Panel fill behind the rows. @default semantic.colors.surface */
1505
1522
  menuBackground?: TokenReference<'color'>;
1506
1523
  /** Panel corner radius. @default palette.radius.lg */
1507
1524
  menuBorderRadius?: TokenReference<'radius'>;
1508
1525
  /** Row fill under hover and the focused option. @default the ghost hover wash */
1509
1526
  rowHoverBackground?: TokenReference<'color'>;
1510
- /** Row label and closed-control label color. @default inherited text */
1527
+ /**
1528
+ * Row label color, plus the closed control's text and chevron in both
1529
+ * presentations. @default the ghost button foreground
1530
+ */
1511
1531
  labelColor?: TokenReference<'color'>;
1512
1532
  /** Second line under a row label. @default semantic.colors.textMuted */
1513
1533
  descriptionColor?: TokenReference<'color'>;
1514
1534
  /** `composer.modelPicker.suffix` on the closed control. @default semantic.colors.textMuted */
1515
1535
  suffixColor?: TokenReference<'color'>;
1516
1536
  }
1537
+ /**
1538
+ * Composer overflow `+` menu panel (`composer.actionOverflow`).
1539
+ *
1540
+ * Every key is optional and unset ones emit nothing: the stylesheet's `var()`
1541
+ * fallbacks own the default look. The panel is portaled outside the themed
1542
+ * mount, so the menu forwards the configured values onto it when it opens.
1543
+ */
1544
+ interface ComposerOverflowMenuTokens {
1545
+ /** Panel fill behind the rows. @default semantic.colors.surface */
1546
+ background?: TokenReference<'color'>;
1547
+ /** Panel border color. @default semantic.colors.border */
1548
+ borderColor?: TokenReference<'color'>;
1549
+ /** Panel corner radius. @default palette.radius.lg */
1550
+ borderRadius?: TokenReference<'radius'>;
1551
+ /** Row text and glyph color. @default semantic.colors.text */
1552
+ foreground?: TokenReference<'color'>;
1553
+ /** Panel elevation (raw CSS box-shadow, `none` allowed). @default palette.shadows.md */
1554
+ shadow?: string;
1555
+ }
1517
1556
  /** Composer (message input) chrome. */
1518
1557
  interface ComposerChromeTokens {
1519
1558
  /** Box-shadow on the composer form (raw CSS, e.g. `none`). */
@@ -1548,8 +1587,10 @@ interface ComposerChromeTokens {
1548
1587
  overlayBand?: string;
1549
1588
  /** Segmented mode-group track. */
1550
1589
  segmented?: ComposerSegmentedTokens;
1551
- /** Model picker popover chrome. */
1590
+ /** Model picker chrome (closed control plus popover panel). */
1552
1591
  modelPicker?: ComposerModelPickerTokens;
1592
+ /** Overflow `+` menu panel chrome. */
1593
+ overflowMenu?: ComposerOverflowMenuTokens;
1553
1594
  }
1554
1595
  /**
1555
1596
  * Motion timing shared by every composer animation.
@@ -1872,8 +1913,10 @@ type RuntypeExecutionStreamEvent = ({
1872
1913
  message: string;
1873
1914
  };
1874
1915
  executionId: string;
1916
+ finalOutput?: string;
1875
1917
  kind: "agent" | "flow";
1876
1918
  seq: number;
1919
+ stopReason?: string;
1877
1920
  type: "execution_error";
1878
1921
  upgradeUrl?: string;
1879
1922
  }) | ({
@@ -3207,6 +3250,22 @@ type AgentWidgetWebMcpConfig = {
3207
3250
  * `window.confirm` fallback only applies when no widget UI is attached.
3208
3251
  */
3209
3252
  onConfirm?: WebMcpConfirmHandler;
3253
+ /**
3254
+ * How the widget runs the `webmcp:*` calls of ONE turn when the model emits
3255
+ * several at once.
3256
+ *
3257
+ * - `'parallel'` (default): every call executes concurrently and a gated
3258
+ * sibling's approval never blocks another's execution. Right for
3259
+ * independent, order-insensitive tools (catalog lookups, add-to-cart).
3260
+ * - `'sequential'`: calls execute one at a time, in the order the model
3261
+ * emitted them; the next starts only after the previous one settles
3262
+ * (including its approval bubble). Use this when the page tools share
3263
+ * mutable state that concurrent execution would interleave, e.g. a
3264
+ * canvas where every stroke selects a color/tool before drawing.
3265
+ *
3266
+ * Either way, all outputs still return to the server in a single `/resume`.
3267
+ */
3268
+ execution?: 'parallel' | 'sequential';
3210
3269
  };
3211
3270
  /**
3212
3271
  * The coordinates needed to resume a durable agent turn after the SSE
@@ -5986,6 +6045,15 @@ type ComposerActionPlacement = "start" | "end";
5986
6045
  * it, `"overflow"` and `"auto"` both render in the bar.
5987
6046
  */
5988
6047
  type ComposerActionPresentation = "bar" | "overflow" | "auto";
6048
+ /**
6049
+ * When a composer action is mounted, as a function of the draft.
6050
+ *
6051
+ * - `"always"` (default): the control is always mounted.
6052
+ * - `"when-empty"`: hidden as soon as the draft holds text or an attachment,
6053
+ * and while a response streams.
6054
+ * - `"when-text"`: the inverse, on the same draft state the send control reads.
6055
+ */
6056
+ type ComposerActionVisibility = "always" | "when-empty" | "when-text";
5989
6057
  /**
5990
6058
  * Fields shared by every composer action.
5991
6059
  *
@@ -6001,6 +6069,13 @@ type ComposerActionBase = {
6001
6069
  presentation?: ComposerActionPresentation;
6002
6070
  order?: number;
6003
6071
  visible?: boolean | ((state: Readonly<ComposerState>) => boolean);
6072
+ /**
6073
+ * Draft-driven visibility, on the same state `sendButton.visibility` reads.
6074
+ * Hidden removes the control from layout and tab order. Combined with
6075
+ * `visible`: both must pass.
6076
+ * @default "always"
6077
+ */
6078
+ visibility?: ComposerActionVisibility;
6004
6079
  disabled?: boolean | ((state: Readonly<ComposerState>) => boolean);
6005
6080
  /** Disable while a response streams, through the composer's own mechanism. */
6006
6081
  disableWhenStreaming?: boolean;
@@ -6147,6 +6222,15 @@ type ComposerMode = {
6147
6222
  * row, never in the overflow menu.
6148
6223
  */
6149
6224
  type ComposerModeGroupPresentation = "buttons" | "segmented";
6225
+ /**
6226
+ * Whether a group's active modes also render as removable chips.
6227
+ *
6228
+ * - `"auto"` (default): one chip per active mode, except under `"segmented"`
6229
+ * presentation, where the track already shows the state.
6230
+ * - `"hidden"`: no chips for this group under any presentation. The pressed bar
6231
+ * button carries the state, and deselection stays on the button.
6232
+ */
6233
+ type ComposerModeChipVisibility = "auto" | "hidden";
6150
6234
  /**
6151
6235
  * Selection policy for a set of modes. `"single"` deselects siblings when one
6152
6236
  * is chosen; `"multiple"` toggles independently.
@@ -6156,6 +6240,12 @@ type ComposerModeGroup = {
6156
6240
  selection: "single" | "multiple";
6157
6241
  /** @default "buttons" */
6158
6242
  presentation?: ComposerModeGroupPresentation;
6243
+ /**
6244
+ * Chip row policy for this group's active modes. The chip row itself is
6245
+ * derived from its children, so a group with no other chips leaves no gap.
6246
+ * @default "auto"
6247
+ */
6248
+ chipVisibility?: ComposerModeChipVisibility;
6159
6249
  /**
6160
6250
  * Accessible name for a segmented track. With it the track is a labelled
6161
6251
  * `role="group"`; without it the segments stand on their own names.
@@ -7465,6 +7555,10 @@ type ClientSession = {
7465
7555
  targetId?: string;
7466
7556
  /** Opaque change token; differs whenever the conversation transcript mutated. */
7467
7557
  conversationRevision?: string;
7558
+ /** Server-negotiated durable reconnect support for this client-token session. */
7559
+ durableRecovery?: {
7560
+ enabled: boolean;
7561
+ };
7468
7562
  /** Visitor grant backing history. `token` appears only at mint. */
7469
7563
  visitor?: ClientVisitorGrant;
7470
7564
  /** Configuration from the server */