@artooi/ag-ui-web-component 0.22.0 → 0.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/CHANGELOG.md +134 -36
  2. package/README.md +7 -7
  3. package/dist/ag-ui-web-component.bundle.js +145 -118
  4. package/dist/ag-ui-web-component.bundle.js.map +3 -3
  5. package/dist/constants.d.ts +65 -78
  6. package/dist/constants.d.ts.map +1 -1
  7. package/dist/core/ag_ui_chat.d.ts +93 -126
  8. package/dist/core/ag_ui_chat.d.ts.map +1 -1
  9. package/dist/core/agui_client.d.ts +24 -30
  10. package/dist/core/agui_client.d.ts.map +1 -1
  11. package/dist/core/attachment.d.ts +9 -14
  12. package/dist/core/attachment.d.ts.map +1 -1
  13. package/dist/core/conversation_store.d.ts +20 -27
  14. package/dist/core/conversation_store.d.ts.map +1 -1
  15. package/dist/core/create_http_agent.d.ts +13 -15
  16. package/dist/core/create_http_agent.d.ts.map +1 -1
  17. package/dist/core/remote_conversation_store.d.ts +8 -9
  18. package/dist/core/remote_conversation_store.d.ts.map +1 -1
  19. package/dist/core/run_index.d.ts +11 -20
  20. package/dist/core/run_index.d.ts.map +1 -1
  21. package/dist/core/transcribe_audio.d.ts +8 -8
  22. package/dist/core/transcribe_audio.d.ts.map +1 -1
  23. package/dist/core/upload_attachment.d.ts +15 -18
  24. package/dist/core/upload_attachment.d.ts.map +1 -1
  25. package/dist/core/utils.d.ts +4 -6
  26. package/dist/core/utils.d.ts.map +1 -1
  27. package/dist/dom/animations.d.ts +22 -30
  28. package/dist/dom/animations.d.ts.map +1 -1
  29. package/dist/dom/dom_driver.d.ts +7 -7
  30. package/dist/dom/native_setter.d.ts +2 -2
  31. package/dist/dom/native_setter.d.ts.map +1 -1
  32. package/dist/index.js +347 -401
  33. package/dist/index.js.map +2 -2
  34. package/dist/skills/fill_template.d.ts +4 -5
  35. package/dist/skills/fill_template.d.ts.map +1 -1
  36. package/dist/skills/parse_skills.d.ts.map +1 -1
  37. package/dist/skills/skill.d.ts +7 -8
  38. package/dist/skills/skill.d.ts.map +1 -1
  39. package/dist/tools/client_tool_registry.d.ts +2 -2
  40. package/dist/tools/page_action_tools.d.ts +7 -10
  41. package/dist/tools/page_action_tools.d.ts.map +1 -1
  42. package/dist/tools/page_state.d.ts +5 -8
  43. package/dist/tools/page_state.d.ts.map +1 -1
  44. package/dist/tools/route_map.d.ts +7 -10
  45. package/dist/tools/route_map.d.ts.map +1 -1
  46. package/dist/ui/approval_card.d.ts +15 -20
  47. package/dist/ui/approval_card.d.ts.map +1 -1
  48. package/dist/ui/attach_copy_buttons.d.ts +4 -10
  49. package/dist/ui/attach_copy_buttons.d.ts.map +1 -1
  50. package/dist/ui/attachment_chips.d.ts +13 -5
  51. package/dist/ui/attachment_chips.d.ts.map +1 -1
  52. package/dist/ui/attachment_tray.d.ts +6 -6
  53. package/dist/ui/attachment_tray.d.ts.map +1 -1
  54. package/dist/ui/checkpoint_menu.d.ts +7 -8
  55. package/dist/ui/checkpoint_menu.d.ts.map +1 -1
  56. package/dist/ui/confirmation_card.d.ts +10 -15
  57. package/dist/ui/confirmation_card.d.ts.map +1 -1
  58. package/dist/ui/question_card.d.ts +12 -15
  59. package/dist/ui/question_card.d.ts.map +1 -1
  60. package/dist/ui/relative_time.d.ts +5 -7
  61. package/dist/ui/relative_time.d.ts.map +1 -1
  62. package/dist/ui/render_markdown.d.ts +8 -8
  63. package/dist/ui/render_markdown.d.ts.map +1 -1
  64. package/dist/ui/resize_handle.d.ts +21 -34
  65. package/dist/ui/resize_handle.d.ts.map +1 -1
  66. package/dist/ui/run_notice.d.ts +5 -7
  67. package/dist/ui/run_notice.d.ts.map +1 -1
  68. package/dist/ui/skills_menu.d.ts +4 -5
  69. package/dist/ui/skills_menu.d.ts.map +1 -1
  70. package/dist/ui/styles.d.ts +1 -1
  71. package/dist/ui/styles.d.ts.map +1 -1
  72. package/dist/ui/thoughts_block.d.ts +9 -11
  73. package/dist/ui/thoughts_block.d.ts.map +1 -1
  74. package/dist/ui/thread_drawer.d.ts +6 -5
  75. package/dist/ui/thread_drawer.d.ts.map +1 -1
  76. package/dist/ui/tool_call_card.d.ts +17 -25
  77. package/dist/ui/tool_call_card.d.ts.map +1 -1
  78. package/dist/ui/ui_strings.d.ts +6 -12
  79. package/dist/ui/ui_strings.d.ts.map +1 -1
  80. package/dist/ui/voice_input.d.ts +10 -11
  81. package/dist/ui/voice_input.d.ts.map +1 -1
  82. package/package.json +1 -1
  83. package/src/constants.ts +71 -80
  84. package/src/core/ag_ui_chat.ts +242 -292
  85. package/src/core/agui_client.ts +60 -71
  86. package/src/core/attachment.ts +9 -14
  87. package/src/core/conversation_store.ts +25 -33
  88. package/src/core/create_http_agent.ts +18 -22
  89. package/src/core/remote_conversation_store.ts +14 -15
  90. package/src/core/run_index.ts +14 -23
  91. package/src/core/transcribe_audio.ts +9 -10
  92. package/src/core/upload_attachment.ts +18 -21
  93. package/src/core/utils.ts +4 -6
  94. package/src/dom/animations.ts +33 -43
  95. package/src/dom/dom_driver.ts +7 -7
  96. package/src/dom/native_setter.ts +11 -12
  97. package/src/skills/fill_template.ts +4 -5
  98. package/src/skills/parse_skills.ts +3 -4
  99. package/src/skills/skill.ts +7 -8
  100. package/src/tools/client_tool_registry.ts +2 -2
  101. package/src/tools/page_action_tools.ts +12 -15
  102. package/src/tools/page_state.ts +5 -8
  103. package/src/tools/route_map.ts +15 -19
  104. package/src/ui/approval_card.ts +15 -20
  105. package/src/ui/attach_copy_buttons.ts +9 -18
  106. package/src/ui/attachment_chips.ts +19 -10
  107. package/src/ui/attachment_tray.ts +8 -7
  108. package/src/ui/checkpoint_menu.ts +7 -8
  109. package/src/ui/confirmation_card.ts +10 -15
  110. package/src/ui/question_card.ts +12 -15
  111. package/src/ui/relative_time.ts +5 -7
  112. package/src/ui/render_markdown.ts +25 -51
  113. package/src/ui/resize_handle.ts +25 -38
  114. package/src/ui/run_notice.ts +9 -12
  115. package/src/ui/skills_menu.ts +4 -5
  116. package/src/ui/styles.ts +122 -93
  117. package/src/ui/thoughts_block.ts +11 -13
  118. package/src/ui/thread_drawer.ts +6 -5
  119. package/src/ui/tool_call_card.ts +22 -32
  120. package/src/ui/ui_strings.ts +6 -12
  121. package/src/ui/voice_input.ts +10 -11
  122. package/src/version.ts +1 -1
@@ -6,12 +6,11 @@ export interface TemplateResult {
6
6
  readonly missing: readonly string[];
7
7
  }
8
8
  /**
9
- * Substitute `{name}` placeholders in ``template`` from ``values``.
9
+ * Substitute `{name}` placeholders in `template` from `values`.
10
10
  *
11
- * A placeholder whose value is missing, ``null``, or an empty string is left
12
- * verbatim and reported in ``missing`` the caller blocks send and tells the
13
- * user what's needed (e.g. "select rows first") rather than sending a
14
- * half-filled prompt.
11
+ * A placeholder whose value is missing, `null`, or an empty string is left
12
+ * verbatim and reported in `missing`, so the caller can block the send rather
13
+ * than dispatch a half-filled prompt.
15
14
  */
16
15
  export declare function fillTemplate(template: string, values: Record<string, unknown>): TemplateResult;
17
16
  //# sourceMappingURL=fill_template.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fill_template.d.ts","sourceRoot":"","sources":["../../src/skills/fill_template.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,MAAM,WAAW,cAAc;IAC7B,6DAA6D;IAC7D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,gFAAgF;IAChF,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAID;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,cAAc,CAa9F"}
1
+ {"version":3,"file":"fill_template.d.ts","sourceRoot":"","sources":["../../src/skills/fill_template.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,MAAM,WAAW,cAAc;IAC7B,6DAA6D;IAC7D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,gFAAgF;IAChF,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAID;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,cAAc,CAa9F"}
@@ -1 +1 @@
1
- {"version":3,"file":"parse_skills.d.ts","sourceRoot":"","sources":["../../src/skills/parse_skills.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAqBxC;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,EAAE,CAKnD"}
1
+ {"version":3,"file":"parse_skills.d.ts","sourceRoot":"","sources":["../../src/skills/parse_skills.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAoBxC;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,EAAE,CAKnD"}
@@ -15,17 +15,16 @@ export interface Skill {
15
15
  * The prompt to send. May contain `{placeholder}`s filled from the host's
16
16
  * skill context before send; an unfilled placeholder blocks send.
17
17
  *
18
- * **Omit it to keep the prompt on the server.** The skill then sends the bare
19
- * `/name` token and the agent resolves what it means, so the wording never
20
- * reaches the browser worth preferring for anything internal, since a
21
- * fetched catalog is a plain GET and an embedded one sits in the page source.
18
+ * Omit it to keep the prompt server-side: the skill then sends the bare
19
+ * `/name` token for the agent to resolve, and the wording never reaches the
20
+ * browser. Prefer that for anything internal a fetched catalog is a plain
21
+ * GET and an embedded one sits in the page source.
22
22
  */
23
23
  readonly prompt?: string;
24
24
  /**
25
- * Set `false` to pre-fill the composer instead of sending on pick. Only
26
- * meaningful for a skill that carries its own `prompt`; a server-resolved one
27
- * always sends. Defaults to sending — a chip that needs a second click to do
28
- * anything is a two-step shortcut.
25
+ * Set `false` to pre-fill the composer instead of sending on pick. Defaults
26
+ * to sending, and is only meaningful for a skill carrying its own `prompt`;
27
+ * a server-resolved one always sends.
29
28
  */
30
29
  readonly sendImmediately?: boolean;
31
30
  /** Also surface this skill as a chip (default false; the palette shows all). */
@@ -1 +1 @@
1
- {"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../../src/skills/skill.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,KAAK;IACpB,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4CAA4C;IAC5C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,2CAA2C;IAC3C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;;;;;OAQG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;OAKG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC,gFAAgF;IAChF,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;CACzB"}
1
+ {"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../../src/skills/skill.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,KAAK;IACpB,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4CAA4C;IAC5C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,2CAA2C;IAC3C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;;;;;OAQG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC,gFAAgF;IAChF,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;CACzB"}
@@ -24,8 +24,8 @@ export declare class ClientToolRegistry {
24
24
  /**
25
25
  * Register a tool, replacing any existing one with the same name.
26
26
  *
27
- * Idempotent on the name so re-fired host refs / React StrictMode's
28
- * double-invoke don't throw re-registering is a replace, not an error.
27
+ * Idempotent on the name so a re-fired host ref or React StrictMode's
28
+ * double-invoke replaces rather than throws.
29
29
  */
30
30
  register(tool: ClientTool): void;
31
31
  has(name: string): boolean;
@@ -1,10 +1,8 @@
1
1
  import type { ClientTool } from "./client_tool_registry.js";
2
2
  /**
3
3
  * Resolve a page-action target string to a host-page element, or `null` when it
4
- * matches nothing. The default (`document.querySelector`) treats the string as a
5
- * CSS selector; a host with a page map overrides it to map its own element ids,
6
- * the same way host packages wrap the DOM-driver primitives with environment-
7
- * aware lookups.
4
+ * matches nothing. The default treats the string as a CSS selector; a host with
5
+ * a page map overrides it to map its own element ids.
8
6
  */
9
7
  export type ResolvePageTarget = (target: string) => HTMLElement | null;
10
8
  /** The built-in page-action tool tokens, opted in via `data-page-actions`. */
@@ -19,13 +17,12 @@ export declare const PAGE_ACTIONS: {
19
17
  * - `scroll_to` — scroll a target (`top` / `bottom` / a resolver target) into
20
18
  * view. Benign; no confirmation.
21
19
  * - `drag_and_drop` — drag one element onto another, firing the standard HTML5
22
- * drag sequence so the host page's own drop handler reacts. Not stamped
23
- * destructive: a drag rearranges transient state and the durable change
24
- * happens at the page's explicit commit. A host whose page persists *on drop*
25
- * gates it with the element's `confirmPredicate`.
20
+ * drag sequence so the host page's own drop handler reacts. Deliberately not
21
+ * stamped destructive: a drag rearranges transient state, and the durable
22
+ * change happens at the page's explicit commit. A host whose page persists on
23
+ * drop must gate it with the element's `confirmPredicate`.
26
24
  *
27
- * Both report a clean, model-readable error when a target resolves to nothing,
28
- * rather than throwing an opaque crash.
25
+ * Both report a model-readable error when a target resolves to nothing.
29
26
  */
30
27
  export declare function createPageActionTools(enabled: ReadonlySet<string>, resolveTarget: ResolvePageTarget): ClientTool[];
31
28
  //# sourceMappingURL=page_action_tools.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"page_action_tools.d.ts","sourceRoot":"","sources":["../../src/tools/page_action_tools.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,WAAW,GAAG,IAAI,CAAC;AAEvE,8EAA8E;AAC9E,eAAO,MAAM,YAAY;aACvB,MAAM,EAAE,QAAQ;aAChB,IAAI,EAAE,MAAM;CACJ,CAAC;AAEX;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,EAC5B,aAAa,EAAE,iBAAiB,GAC/B,UAAU,EAAE,CASd"}
1
+ {"version":3,"file":"page_action_tools.d.ts","sourceRoot":"","sources":["../../src/tools/page_action_tools.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,WAAW,GAAG,IAAI,CAAC;AAEvE,8EAA8E;AAC9E,eAAO,MAAM,YAAY;aACvB,MAAM,EAAE,QAAQ;aAChB,IAAI,EAAE,MAAM;CACJ,CAAC;AAEX;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,EAC5B,aAAa,EAAE,iBAAiB,GAC/B,UAAU,EAAE,CASd"}
@@ -5,11 +5,9 @@ import type { ClientTool } from "./client_tool_registry.js";
5
5
  * Ergonomic sugar over `registerTool` for SPA state (Redux/Zustand/signals):
6
6
  * generates a read tool and, when `write` is given, a destructive set tool.
7
7
  *
8
- * This is **not** AG-UI shared state. `STATE_SNAPSHOT` / `STATE_DELTA` are
9
- * protocol events carrying state between agent and client; this is a pair of
10
- * ordinary client tools the agent calls like any other. The two are unrelated,
11
- * which is why this no longer carries the word "hook" — the old name read as
12
- * protocol state sync, which this component does not implement.
8
+ * Not AG-UI shared state. `STATE_SNAPSHOT` / `STATE_DELTA` are protocol events
9
+ * carrying state between agent and client; these are ordinary client tools the
10
+ * agent calls like any other.
13
11
  */
14
12
  export interface PageState {
15
13
  /** Base name; tools become `read_<name>` and `set_<name>`. */
@@ -27,9 +25,8 @@ export interface PageState {
27
25
  */
28
26
  export declare function createPageStateTools(binding: PageState): ClientTool[];
29
27
  /**
30
- * @deprecated Renamed to {@link PageState}. The old name read as AG-UI
31
- * shared-state sync (`STATE_SNAPSHOT` / `STATE_DELTA`), which this component
32
- * does not implement. Will be removed in a future major.
28
+ * @deprecated Renamed to {@link PageState} the old name read as AG-UI
29
+ * shared-state sync. Will be removed in a future major.
33
30
  */
34
31
  export type StateHook = PageState;
35
32
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"page_state.d.ts","sourceRoot":"","sources":["../../src/tools/page_state.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,SAAS;IACxB,8DAA8D;IAC9D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,uCAAuC;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC;IAC7B,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC;IAC5D,uEAAuE;IACvE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC3C;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,SAAS,GAAG,UAAU,EAAE,CA4BrE;AAED;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC;AAElC;;;GAGG;AACH,eAAO,MAAM,oBAAoB,6BAAuB,CAAC"}
1
+ {"version":3,"file":"page_state.d.ts","sourceRoot":"","sources":["../../src/tools/page_state.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D;;;;;;;;;GASG;AACH,MAAM,WAAW,SAAS;IACxB,8DAA8D;IAC9D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,uCAAuC;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC;IAC7B,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC;IAC5D,uEAAuE;IACvE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC3C;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,SAAS,GAAG,UAAU,EAAE,CA4BrE;AAED;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC;AAElC;;;GAGG;AACH,eAAO,MAAM,oBAAoB,6BAAuB,CAAC"}
@@ -5,9 +5,8 @@ export interface Route {
5
5
  readonly id: string;
6
6
  /**
7
7
  * The URL path to navigate to. May contain `:name` placeholders for dynamic
8
- * segments (e.g. `/admin/shop/book/:pk/change/`); the agent fills them via
9
- * the `navigate_to_route` `params` argument. Real apps are mostly
10
- * parameterised — few pages have a truly static path.
8
+ * segments (e.g. `/admin/shop/book/:pk/change/`), which the agent fills via
9
+ * `navigate_to_route`'s `params` argument.
11
10
  */
12
11
  readonly path: string;
13
12
  /** Human label shown to the agent. */
@@ -28,13 +27,11 @@ export interface RouteWithParams extends Route {
28
27
  * The built-in `route.*` tools, bound to live getters so a host can set
29
28
  * `routeMap` / `navigate` before or after mount.
30
29
  *
31
- * `list_routes` is read-only and advertises each route's dynamic
32
- * `pathParams` so the model knows what to supply. `navigate_to_route` is marked
33
- * `x-navigates` so an MPA reload checkpoints + resumes; it substitutes path
34
- * params into the template and appends any remaining params as a query string.
35
- * When the host supplies a `navigate(path)` callback (an SPA), the element
36
- * routes client-side instead and the run loop simply continues — see
37
- * `AgUiChat`'s execute path.
30
+ * `list_routes` is read-only and advertises each route's `pathParams` so the
31
+ * model knows what to supply. `navigate_to_route` fills those params, appends
32
+ * the rest as a query string, and is stamped `x-navigates` so an MPA reload
33
+ * checkpoints and resumes; with a host `navigate(path)` callback (an SPA) it
34
+ * routes client-side and the run loop continues instead.
38
35
  */
39
36
  export declare function createRouteTools(getRouteMap: () => RouteMap, getNavigate: () => ((path: string) => void) | null): ClientTool[];
40
37
  //# sourceMappingURL=route_map.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"route_map.d.ts","sourceRoot":"","sources":["../../src/tools/route_map.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D,gEAAgE;AAChE,MAAM,WAAW,KAAK;IACpB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sCAAsC;IACtC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,kDAAkD;IAClD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,4DAA4D;IAC5D,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,qDAAqD;AACrD,MAAM,MAAM,QAAQ,GAAG,SAAS,KAAK,EAAE,CAAC;AAExC,yEAAyE;AACzE,MAAM,WAAW,eAAgB,SAAQ,KAAK;IAC5C,8EAA8E;IAC9E,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;CACxC;AAgDD;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,QAAQ,EAC3B,WAAW,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,IAAI,GACjD,UAAU,EAAE,CA6Cd"}
1
+ {"version":3,"file":"route_map.d.ts","sourceRoot":"","sources":["../../src/tools/route_map.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D,gEAAgE;AAChE,MAAM,WAAW,KAAK;IACpB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sCAAsC;IACtC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,kDAAkD;IAClD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,4DAA4D;IAC5D,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,qDAAqD;AACrD,MAAM,MAAM,QAAQ,GAAG,SAAS,KAAK,EAAE,CAAC;AAExC,yEAAyE;AACzE,MAAM,WAAW,eAAgB,SAAQ,KAAK;IAC5C,8EAA8E;IAC9E,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;CACxC;AA+CD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,QAAQ,EAC3B,WAAW,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,IAAI,GACjD,UAAU,EAAE,CA6Cd"}
@@ -13,9 +13,8 @@ export interface ApprovalRequest {
13
13
  /** Options for {@link requestApproval}. */
14
14
  export interface ApprovalOptions {
15
15
  /**
16
- * Aborting this signal resolves the card as **denied** (buttons disabled,
17
- * `data-resolved="denied"`)the hook a Stop control uses to dismiss a
18
- * pending approval when the user cancels the whole run.
16
+ * Aborting this signal resolves the card as denied, with buttons disabled and
17
+ * `data-resolved="denied"` — how a Stop control dismisses a pending approval.
19
18
  */
20
19
  signal?: AbortSignal;
21
20
  /** Localized strings; defaults to the English {@link DEFAULT_UI_STRINGS}. */
@@ -23,29 +22,25 @@ export interface ApprovalOptions {
23
22
  }
24
23
  /**
25
24
  * A fully custom renderer for a server-side-tool approval, set via
26
- * `AgUiChat.approvalRenderer`. Receives the {@link ApprovalRequest} (the
27
- * interrupt's message + tool name) and an `AbortSignal` that fires when the run
28
- * is stopped, and resolves `true` to approve or `false` to deny. When provided
29
- * it **replaces** the built-in {@link requestApproval} card entirely the host
30
- * owns the DOM, so it can render a native modal, a framework component, or
31
- * anything else. See the `strings` / `::part()` seams for styling the built-in
32
- * card instead of replacing it.
25
+ * `AgUiChat.approvalRenderer`. Receives the {@link ApprovalRequest} and an
26
+ * `AbortSignal` that fires when the run is stopped, and resolves `true` to
27
+ * approve or `false` to deny. Replaces the built-in {@link requestApproval}
28
+ * card entirely, the host owning the DOM; to restyle the built-in card instead,
29
+ * use the `strings` and `::part()` seams.
33
30
  */
34
31
  export type ApprovalRenderer = (request: ApprovalRequest, options: {
35
32
  signal: AbortSignal;
36
33
  }) => Promise<boolean>;
37
34
  /**
38
- * Append an inline **approval** card to ``host`` and resolve when the user
39
- * decides whether a gated *server-side* tool may run.
35
+ * Append an inline approval card to `host` and resolve `true` to run a gated
36
+ * server-side tool or `false` to deny it.
40
37
  *
41
- * The server-side approval gate is distinct from the client-tool confirmation
42
- * card ({@link requestConfirmation}): a destructive server tool defers instead
43
- * of executing, and the run finishes on an AG-UI *interrupt* the client answers
44
- * with `resume[]`. This card is the browser half of that loop it reads
45
- * naturally after the tool-call card whose execution it gates, and resolves
46
- * ``true`` to approve (run the tool) or ``false`` to deny. The card stays in the
47
- * transcript as a resolved record (buttons disabled, `data-resolved` set)
48
- * rather than vanishing.
38
+ * Distinct from the client-tool confirmation card
39
+ * ({@link requestConfirmation}): a gated server tool defers instead of
40
+ * executing, so the run finishes on an AG-UI interrupt the client answers with
41
+ * `resume[]`, and this is the browser half of that loop. Unlike the
42
+ * confirmation card, this one stays in the transcript as a resolved record,
43
+ * buttons disabled and `data-resolved` set.
49
44
  */
50
45
  export declare function requestApproval(host: Node & ParentNode, request: ApprovalRequest, options?: ApprovalOptions): Promise<boolean>;
51
46
  //# sourceMappingURL=approval_card.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"approval_card.d.ts","sourceRoot":"","sources":["../../src/ui/approval_card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErE,iFAAiF;AACjF,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAYD,2CAA2C;AAC3C,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAC7B,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,KAC7B,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtB;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,IAAI,GAAG,UAAU,EACvB,OAAO,EAAE,eAAe,EACxB,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,OAAO,CAAC,CAkDlB"}
1
+ {"version":3,"file":"approval_card.d.ts","sourceRoot":"","sources":["../../src/ui/approval_card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErE,iFAAiF;AACjF,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAYD,2CAA2C;AAC3C,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAC7B,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,KAC7B,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtB;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,IAAI,GAAG,UAAU,EACvB,OAAO,EAAE,eAAe,EACxB,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,OAAO,CAAC,CAkDlB"}
@@ -2,17 +2,11 @@ import type { UiStrings } from "./ui_strings.js";
2
2
  /**
3
3
  * Give every fenced code block in `root` a copy button.
4
4
  *
5
- * An agent that answers with code is answering with something the reader means
6
- * to *use*, and selecting it by hand out of a scrolling transcript — inside a
7
- * shadow root, in a narrow sidebar — is the one interaction the chat surface
8
- * made harder than the page around it.
5
+ * Call only on finished bubbles: the streaming bubble reassigns its `innerHTML`
6
+ * on every delta, so a button attached mid-stream is discarded and rebuilt for
7
+ * each one.
9
8
  *
10
- * Applied to **finished** bubbles only. The streaming bubble reassigns its
11
- * `innerHTML` on every delta, so a button attached mid-stream would be
12
- * discarded and rebuilt for each one; waiting until the turn ends costs
13
- * nothing and does that work once.
14
- *
15
- * Idempotent: a bubble already processed is skipped, so a re-render or a second
9
+ * Idempotent a bubble already processed is skipped, so a re-render or a second
16
10
  * call cannot stack buttons.
17
11
  */
18
12
  export declare function attachCopyButtons(root: ParentNode, strings: UiStrings): void;
@@ -1 +1 @@
1
- {"version":3,"file":"attach_copy_buttons.d.ts","sourceRoot":"","sources":["../../src/ui/attach_copy_buttons.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAKjD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,IAAI,CAS5E"}
1
+ {"version":3,"file":"attach_copy_buttons.d.ts","sourceRoot":"","sources":["../../src/ui/attach_copy_buttons.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAKjD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,IAAI,CAS5E"}
@@ -1,12 +1,20 @@
1
1
  import type { AttachmentRef } from "../core/attachment.js";
2
2
  /**
3
- * Render the read-only attachment chips shown on a sent user message bubble
4
- * (and on restored history) — one chip per ref with a type icon, the filename,
5
- * and a human size. Static by design: no progress, no remove (that lives in the
6
- * composer tray); a restored bubble re-renders these with no animation.
3
+ * Render the read-only attachment chips on a sent user message bubble and on
4
+ * restored history — one chip per ref with a type icon, filename, and human
5
+ * size. Static: no progress and no remove, both of which live in the composer
6
+ * tray.
7
7
  */
8
8
  export declare function renderAttachmentChips(refs: readonly AttachmentRef[]): HTMLDivElement;
9
- /** A coarse type icon for a chip — image, document, or generic file. */
9
+ /**
10
+ * A coarse type mark for a chip — image, PDF, text document, or generic file —
11
+ * as inline SVG markup rather than a character, so it matches the composer's
12
+ * SVG buttons in weight and takes the glyph size and `currentColor`, which
13
+ * emoji do not.
14
+ *
15
+ * The MIME string only selects among author-written constants and is never
16
+ * interpolated into one, so the result is safe to assign as markup.
17
+ */
10
18
  export declare function iconFor(mime: string): string;
11
19
  /** A compact human-readable byte size (e.g. `1.2 MB`). */
12
20
  export declare function formatBytes(bytes: number): string;
@@ -1 +1 @@
1
- {"version":3,"file":"attachment_chips.d.ts","sourceRoot":"","sources":["../../src/ui/attachment_chips.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,SAAS,aAAa,EAAE,GAAG,cAAc,CAQpF;AA4BD,wEAAwE;AACxE,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAW5C;AAED,0DAA0D;AAC1D,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAajD"}
1
+ {"version":3,"file":"attachment_chips.d.ts","sourceRoot":"","sources":["../../src/ui/attachment_chips.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,SAAS,aAAa,EAAE,GAAG,cAAc,CAQpF;AA4BD;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAW5C;AAED,0DAA0D;AAC1D,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAajD"}
@@ -16,13 +16,13 @@ export interface AttachmentTrayConfig {
16
16
  }
17
17
  /**
18
18
  * The composer's pending-attachments tray: a chip per picked file with a
19
- * progress bar while it uploads, settling to a ready chip (holding the durable
20
- * ref) or an error chip (with retry). A *stateful view* in the spirit of
21
- * {@link ThreadDrawer} — the host appends {@link element}, calls {@link add} on
22
- * pick/drop, reads {@link readyRefs} when the user sends, and clears it.
19
+ * progress bar while it uploads, settling to a ready chip holding the durable
20
+ * ref or an error chip with retry. A stateful view like {@link ThreadDrawer}:
21
+ * the host appends {@link element}, calls {@link add} on pick or drop, reads
22
+ * {@link readyRefs} on send, and clears it.
23
23
  *
24
- * Client-side size/type guards reject a bad file into an error chip without
25
- * uploading instant feedback, but the server is the authority.
24
+ * Client-side size and type guards reject a bad file into an error chip without
25
+ * uploading, for instant feedback, but the server stays the authority.
26
26
  */
27
27
  export declare class AttachmentTray {
28
28
  #private;
@@ -1 +1 @@
1
- {"version":3,"file":"attachment_tray.d.ts","sourceRoot":"","sources":["../../src/ui/attachment_tray.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAKrE,yDAAyD;AACzD,MAAM,WAAW,oBAAoB;IACnC,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,oFAAoF;IACpF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,qEAAqE;IACrE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,yEAAyE;IACzE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,6EAA6E;IAC7E,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;CAC9B;AAcD;;;;;;;;;GASG;AACH,qBAAa,cAAc;;IACzB,qEAAqE;IACrE,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IAMjC,YAAY,MAAM,EAAE,oBAAoB,EAOvC;IAED,gFAAgF;IAChF,GAAG,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAsBpB;IAED,8DAA8D;IAC9D,SAAS,IAAI,SAAS,aAAa,EAAE,CAQpC;IAED,gFAAgF;IAChF,UAAU,IAAI,OAAO,CAEpB;IAED,+EAA+E;IAC/E,YAAY,IAAI,MAAM,CAErB;IAED,uCAAuC;IACvC,OAAO,IAAI,OAAO,CAEjB;IAED,2EAA2E;IAC3E,UAAU,IAAI,IAAI,CAGjB;IAED,2EAA2E;IAC3E,KAAK,IAAI,IAAI,CAMZ;IAED;;;;OAIG;IACH,OAAO,IAAI,IAAI,CAId;CAoIF"}
1
+ {"version":3,"file":"attachment_tray.d.ts","sourceRoot":"","sources":["../../src/ui/attachment_tray.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAKrE,yDAAyD;AACzD,MAAM,WAAW,oBAAoB;IACnC,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,oFAAoF;IACpF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,qEAAqE;IACrE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,yEAAyE;IACzE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,6EAA6E;IAC7E,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;CAC9B;AAcD;;;;;;;;;GASG;AACH,qBAAa,cAAc;;IACzB,qEAAqE;IACrE,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IAMjC,YAAY,MAAM,EAAE,oBAAoB,EAOvC;IAED,gFAAgF;IAChF,GAAG,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAsBpB;IAED,8DAA8D;IAC9D,SAAS,IAAI,SAAS,aAAa,EAAE,CAQpC;IAED,gFAAgF;IAChF,UAAU,IAAI,OAAO,CAEpB;IAED,+EAA+E;IAC/E,YAAY,IAAI,MAAM,CAErB;IAED,uCAAuC;IACvC,OAAO,IAAI,OAAO,CAEjB;IAED,2EAA2E;IAC3E,UAAU,IAAI,IAAI,CAGjB;IAED,2EAA2E;IAC3E,KAAK,IAAI,IAAI,CAMZ;IAED;;;;OAIG;IACH,OAAO,IAAI,IAAI,CAId;CAqIF"}
@@ -5,16 +5,15 @@ export type CheckpointVerb = "resume" | "fork";
5
5
  /**
6
6
  * The checkpoint panel: continuable runs, each offering **resume** or **fork**.
7
7
  *
8
- * A separate surface from the thread drawer on purpose they are different
9
- * axes. A thread is a conversation you switch *to*; a checkpoint is a run you
10
- * continue *from*, and one thread can hold many. Folding them into one list
11
- * would make "resume" look like "open", which it isn't: resuming starts a new
8
+ * Deliberately separate from the thread drawer: a thread is a conversation you
9
+ * switch to, a checkpoint is a run you continue from, and one thread holds
10
+ * many. One list would make "resume" read as "open", when resuming starts a new
12
11
  * run seeded from a snapshot.
13
12
  *
14
- * Only rows the server marked `continuable` are worth offering, so the host
15
- * feeds those; a run with no snapshot would resume from nothing. Pure DOM in
16
- * the spirit of {@link SkillsMenu} the host appends {@link element}, toggles
17
- * it, feeds rows via {@link setRuns}, and acts on {@link onPick}.
13
+ * The host feeds only rows the server marked `continuable`, a run without a
14
+ * snapshot having nothing to resume from. Pure DOM, like {@link SkillsMenu}:
15
+ * append {@link element}, toggle it, feed {@link setRuns}, act on
16
+ * {@link onPick}.
18
17
  */
19
18
  export declare class CheckpointMenu {
20
19
  #private;
@@ -1 +1 @@
1
- {"version":3,"file":"checkpoint_menu.d.ts","sourceRoot":"","sources":["../../src/ui/checkpoint_menu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErE,2CAA2C;AAC3C,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE/C;;;;;;;;;;;;;GAaG;AACH,qBAAa,cAAc;;IACzB,qEAAqE;IACrE,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IAUjC,YACE,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,KAAK,IAAI,EACrD,OAAO,GAAE,SAA8B,EA+BxC;IAED,iEAAiE;IACjE,OAAO,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAGrC;IAED,oEAAoE;IACpE,UAAU,CAAC,OAAO,EAAE,SAAS,GAAG,IAAI,CAKnC;IAED,IAAI,IAAI,IAAI,CAYX;IAED,KAAK,IAAI,IAAI,CAOZ;IAqCD,IAAI,KAAK,IAAI,OAAO,CAEnB;CA+DF"}
1
+ {"version":3,"file":"checkpoint_menu.d.ts","sourceRoot":"","sources":["../../src/ui/checkpoint_menu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErE,2CAA2C;AAC3C,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE/C;;;;;;;;;;;;GAYG;AACH,qBAAa,cAAc;;IACzB,qEAAqE;IACrE,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IAUjC,YACE,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,KAAK,IAAI,EACrD,OAAO,GAAE,SAA8B,EA+BxC;IAED,iEAAiE;IACjE,OAAO,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAGrC;IAED,oEAAoE;IACpE,UAAU,CAAC,OAAO,EAAE,SAAS,GAAG,IAAI,CAKnC;IAED,IAAI,IAAI,IAAI,CAYX;IAED,KAAK,IAAI,IAAI,CAOZ;IAqCD,IAAI,KAAK,IAAI,OAAO,CAEnB;CA+DF"}
@@ -12,29 +12,24 @@ export interface ConfirmationRequest {
12
12
  /** Options for {@link requestConfirmation}. */
13
13
  export interface ConfirmationOptions {
14
14
  /**
15
- * Aborting this signal resolves the card as declined (buttons disabled,
16
- * `data-resolved="declined"`)the hook a Stop control uses to dismiss a
17
- * pending confirmation when the user cancels the whole run.
15
+ * Aborting this signal resolves the card as declined, with buttons disabled
16
+ * and `data-resolved="declined"` — how a Stop control dismisses a pending
17
+ * confirmation.
18
18
  */
19
19
  signal?: AbortSignal;
20
20
  /** Localized strings; defaults to the English {@link DEFAULT_UI_STRINGS}. */
21
21
  strings?: UiStrings;
22
22
  }
23
23
  /**
24
- * Append an inline confirmation card to ``host`` (the chat message list) and
25
- * resolve when the user decides.
24
+ * Append an inline confirmation card to `host` (the chat message list) and
25
+ * resolve `true` on confirm, `false` on cancel.
26
26
  *
27
- * Unlike a modal overlay, the card lives in the transcript right where the
28
- * action is — it reads naturally after the assistant's explanation and never
29
- * steals focus from the page. Resolves ``true`` on confirm, ``false`` on
30
- * cancel.
27
+ * The card lives in the transcript rather than in a modal overlay, so it reads
28
+ * after the assistant's explanation and never steals focus from the page.
31
29
  *
32
- * **Answering it removes it.** A prompt and a record are two different objects:
33
- * the prompt owns the user's attention until it is answered, and the record of
34
- * what was decided belongs in the transcript, in order, scrolling with
35
- * everything else. The tool card this gates is that record — it settles to
36
- * `done` or `declined` and carries the decision. Leaving the spent form in
37
- * place made an answered question read as outstanding.
30
+ * Answering it removes it: the record of the decision belongs to the tool card
31
+ * this gates, which settles to `done` or `declined` and carries it. A spent
32
+ * form left in place reads as still outstanding.
38
33
  */
39
34
  export declare function requestConfirmation(host: Node & ParentNode, request: ConfirmationRequest, options?: ConfirmationOptions): Promise<boolean>;
40
35
  //# sourceMappingURL=confirmation_card.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"confirmation_card.d.ts","sourceRoot":"","sources":["../../src/ui/confirmation_card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErE,kDAAkD;AAClD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAYD,+CAA+C;AAC/C,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,IAAI,GAAG,UAAU,EACvB,OAAO,EAAE,mBAAmB,EAC5B,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,OAAO,CAAC,CAyDlB"}
1
+ {"version":3,"file":"confirmation_card.d.ts","sourceRoot":"","sources":["../../src/ui/confirmation_card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErE,kDAAkD;AAClD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAYD,+CAA+C;AAC/C,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,IAAI,GAAG,UAAU,EACvB,OAAO,EAAE,mBAAmB,EAC5B,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,OAAO,CAAC,CAyDlB"}
@@ -17,9 +17,8 @@ export interface QuestionRequest {
17
17
  /** Options for {@link requestQuestion}. */
18
18
  export interface QuestionOptions {
19
19
  /**
20
- * Aborting this signal resolves the card with an empty answer (fields
21
- * disabled)the hook a Stop control uses to dismiss an open question when
22
- * the user cancels the whole run.
20
+ * Aborting this signal resolves the card with an empty answer and disabled
21
+ * fieldshow a Stop control dismisses an open question.
23
22
  */
24
23
  signal?: AbortSignal;
25
24
  /** Localized strings; defaults to the English {@link DEFAULT_UI_STRINGS}. */
@@ -29,24 +28,22 @@ export interface QuestionOptions {
29
28
  * A fully custom renderer for the `ask_user` question, set via
30
29
  * `AgUiChat.askUserRenderer`. Receives the parsed {@link QuestionRequest} and an
31
30
  * `AbortSignal` that fires when the run is stopped, and resolves with the user's
32
- * answer (an empty string signals "no answer", e.g. on abort). When provided it
33
- * **replaces** the built-in {@link requestQuestion} card entirely — the host owns
34
- * the DOM, so it can render a native modal, a framework component, or anything
35
- * else. See the `strings` / `::part()` seams for styling the built-in card
36
- * instead of replacing it.
31
+ * answer; an empty string means no answer. Replaces the built-in
32
+ * {@link requestQuestion} card entirely — see {@link ApprovalRenderer} for the
33
+ * same seam on approvals.
37
34
  */
38
35
  export type QuestionRenderer = (request: QuestionRequest, options: {
39
36
  signal: AbortSignal;
40
37
  }) => Promise<string>;
41
38
  /**
42
- * Append an inline **question** card to ``host`` and resolve with the user's
43
- * answer — the browser half of the built-in `ask_user` frontend tool.
39
+ * Append an inline question card to `host` and resolve with the user's answer —
40
+ * the browser half of the built-in `ask_user` frontend tool.
44
41
  *
45
- * Unlike the confirmation/approval cards (which resolve a yes/no), this collects
46
- * a typed answer: a radio pick from ``options``, or free text (when
47
- * ``allowCustom`` or no ``options`` are given). The card stays in the transcript
48
- * as a resolved record (controls disabled, `data-resolved` set) rather than
49
- * vanishing. A Stop while it is open resolves it with an empty string.
42
+ * Collects a typed answer rather than the yes/no the confirmation and approval
43
+ * cards return: a radio pick from `options`, or free text when `allowCustom` is
44
+ * set or no `options` are given. Stays in the transcript as a resolved record,
45
+ * controls disabled and `data-resolved` set; a Stop while it is open resolves
46
+ * it with an empty string.
50
47
  */
51
48
  export declare function requestQuestion(host: Node & ParentNode, request: QuestionRequest, options?: QuestionOptions): Promise<string>;
52
49
  //# sourceMappingURL=question_card.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"question_card.d.ts","sourceRoot":"","sources":["../../src/ui/question_card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErE,gFAAgF;AAChF,MAAM,WAAW,eAAe;IAC9B,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,2CAA2C;AAC3C,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAC7B,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,KAC7B,OAAO,CAAC,MAAM,CAAC,CAAC;AAYrB;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,IAAI,GAAG,UAAU,EACvB,OAAO,EAAE,eAAe,EACxB,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,MAAM,CAAC,CAkJjB"}
1
+ {"version":3,"file":"question_card.d.ts","sourceRoot":"","sources":["../../src/ui/question_card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErE,gFAAgF;AAChF,MAAM,WAAW,eAAe;IAC9B,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,2CAA2C;AAC3C,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAC7B,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,KAC7B,OAAO,CAAC,MAAM,CAAC,CAAC;AAYrB;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,IAAI,GAAG,UAAU,EACvB,OAAO,EAAE,eAAe,EACxB,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,MAAM,CAAC,CAkJjB"}
@@ -3,13 +3,11 @@ import { type UiStrings } from "./ui_strings.js";
3
3
  * A compact relative timestamp for a thread row — e.g. `"just now"`, `"5m ago"`,
4
4
  * `"3h ago"`, `"2d ago"`, `"4w ago"`.
5
5
  *
6
- * `now` is injectable so callers (and tests) can pin the reference point; it
7
- * defaults to the current time. A timestamp in the future (clock skew) reads as
8
- * `"just now"`. A non-finite timestamp an unparseable or missing `updated_at`
9
- * that arrived as `NaN` has no meaningful age, so it falls back to `justNow`
10
- * rather than rendering `"NaNw ago"` or `"~2950w ago"`. The unit words come from
11
- * {@link UiStrings} (the `{n}` token is filled in here) so a localized host
12
- * translates them; the bucketing stays integer-rounded and locale-neutral.
6
+ * `now` is injectable so callers and tests can pin the reference point. A
7
+ * future timestamp (clock skew) and a non-finite one (an unparseable or missing
8
+ * `updated_at`, arriving as `NaN`) both read as `justNow`, rather than
9
+ * rendering a nonsense age. Unit words come from {@link UiStrings} with `{n}`
10
+ * filled in here; the bucketing stays integer-rounded and locale-neutral.
13
11
  */
14
12
  export declare function relativeTime(timestamp: number, now?: number, strings?: UiStrings): string;
15
13
  //# sourceMappingURL=relative_time.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"relative_time.d.ts","sourceRoot":"","sources":["../../src/ui/relative_time.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErE;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAC1B,SAAS,EAAE,MAAM,EACjB,GAAG,GAAE,MAAmB,EACxB,OAAO,GAAE,SAA8B,GACtC,MAAM,CAqBR"}
1
+ {"version":3,"file":"relative_time.d.ts","sourceRoot":"","sources":["../../src/ui/relative_time.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErE;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAC1B,SAAS,EAAE,MAAM,EACjB,GAAG,GAAE,MAAmB,EACxB,OAAO,GAAE,SAA8B,GACtC,MAAM,CAqBR"}
@@ -1,22 +1,22 @@
1
1
  /** Options for {@link renderMarkdown}. */
2
2
  export interface RenderMarkdownOptions {
3
3
  /**
4
- * Permit `<img>` tags (and their `src`/`alt`/`width`/`height` attributes)
5
- * in the sanitised output. **Off by default** see the allowlist note on
6
- * the exfiltration risk. Only enable for trusted content sources.
4
+ * Permit `<img>` tags (and their `src`/`alt`/`width`/`height` attributes) in
5
+ * the sanitised output. Off by default; see the exfiltration note on the
6
+ * allowlist above. Only enable for trusted content sources.
7
7
  */
8
8
  readonly allowImages?: boolean;
9
9
  }
10
10
  /**
11
11
  * Render markdown (and any embedded raw HTML) to a sanitised HTML string.
12
12
  *
13
- * Both markdown syntax and literal HTML flow through one path: `marked` emits
14
- * HTML, then DOMPurify strips everything outside {@link ALLOWED_TAGS} /
15
- * {@link ALLOWED_ATTR} (scripts, event handlers, `javascript:` URLs, etc.).
16
- * Links are hardened with `target="_blank"` + `rel="noopener noreferrer"`.
13
+ * Markdown syntax and literal HTML share one path: `marked` emits HTML, then
14
+ * DOMPurify strips everything outside {@link ALLOWED_TAGS} /
15
+ * {@link ALLOWED_ATTR} scripts, event handlers, `javascript:` URLs. Links are
16
+ * hardened with `target="_blank"` and `rel="noopener noreferrer"`.
17
17
  *
18
18
  * The result is trimmed so a single-paragraph message round-trips to clean
19
- * `textContent` (no trailing newline from the wrapping `<p>`).
19
+ * `textContent`, without the wrapping paragraph's trailing newline.
20
20
  */
21
21
  export declare function renderMarkdown(text: string, options?: RenderMarkdownOptions): string;
22
22
  //# sourceMappingURL=render_markdown.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"render_markdown.d.ts","sourceRoot":"","sources":["../../src/ui/render_markdown.ts"],"names":[],"mappings":"AAwFA,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;CAChC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAcpF"}
1
+ {"version":3,"file":"render_markdown.d.ts","sourceRoot":"","sources":["../../src/ui/render_markdown.ts"],"names":[],"mappings":"AA8DA,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;CAChC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAcpF"}