@artooi/ag-ui-web-component 0.23.0 → 0.24.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 (124) hide show
  1. package/CHANGELOG.md +149 -36
  2. package/README.md +140 -9
  3. package/dist/ag-ui-web-component.bundle.js +113 -122
  4. package/dist/ag-ui-web-component.bundle.js.map +3 -3
  5. package/dist/constants.d.ts +71 -85
  6. package/dist/constants.d.ts.map +1 -1
  7. package/dist/core/ag_ui_chat.d.ts +105 -127
  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 +38 -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 +10 -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.d.ts +2 -2
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +357 -383
  35. package/dist/index.js.map +2 -2
  36. package/dist/skills/fill_template.d.ts +4 -5
  37. package/dist/skills/fill_template.d.ts.map +1 -1
  38. package/dist/skills/parse_skills.d.ts.map +1 -1
  39. package/dist/skills/skill.d.ts +7 -8
  40. package/dist/skills/skill.d.ts.map +1 -1
  41. package/dist/tools/client_tool_registry.d.ts +2 -2
  42. package/dist/tools/page_action_tools.d.ts +7 -10
  43. package/dist/tools/page_action_tools.d.ts.map +1 -1
  44. package/dist/tools/page_state.d.ts +5 -8
  45. package/dist/tools/page_state.d.ts.map +1 -1
  46. package/dist/tools/route_map.d.ts +7 -10
  47. package/dist/tools/route_map.d.ts.map +1 -1
  48. package/dist/ui/approval_card.d.ts +15 -20
  49. package/dist/ui/approval_card.d.ts.map +1 -1
  50. package/dist/ui/attach_copy_buttons.d.ts +4 -10
  51. package/dist/ui/attach_copy_buttons.d.ts.map +1 -1
  52. package/dist/ui/attachment_chips.d.ts +7 -10
  53. package/dist/ui/attachment_chips.d.ts.map +1 -1
  54. package/dist/ui/attachment_tray.d.ts +6 -6
  55. package/dist/ui/checkpoint_menu.d.ts +7 -8
  56. package/dist/ui/checkpoint_menu.d.ts.map +1 -1
  57. package/dist/ui/confirmation_card.d.ts +10 -15
  58. package/dist/ui/confirmation_card.d.ts.map +1 -1
  59. package/dist/ui/question_card.d.ts +12 -15
  60. package/dist/ui/question_card.d.ts.map +1 -1
  61. package/dist/ui/relative_time.d.ts +5 -7
  62. package/dist/ui/relative_time.d.ts.map +1 -1
  63. package/dist/ui/render_markdown.d.ts +8 -8
  64. package/dist/ui/render_markdown.d.ts.map +1 -1
  65. package/dist/ui/resize_handle.d.ts +21 -34
  66. package/dist/ui/resize_handle.d.ts.map +1 -1
  67. package/dist/ui/run_notice.d.ts +5 -7
  68. package/dist/ui/run_notice.d.ts.map +1 -1
  69. package/dist/ui/skills_menu.d.ts +4 -5
  70. package/dist/ui/skills_menu.d.ts.map +1 -1
  71. package/dist/ui/styles.d.ts +1 -1
  72. package/dist/ui/styles.d.ts.map +1 -1
  73. package/dist/ui/thoughts_block.d.ts +9 -11
  74. package/dist/ui/thoughts_block.d.ts.map +1 -1
  75. package/dist/ui/thread_drawer.d.ts +6 -5
  76. package/dist/ui/thread_drawer.d.ts.map +1 -1
  77. package/dist/ui/tool_call_card.d.ts +17 -25
  78. package/dist/ui/tool_call_card.d.ts.map +1 -1
  79. package/dist/ui/ui_strings.d.ts +6 -12
  80. package/dist/ui/ui_strings.d.ts.map +1 -1
  81. package/dist/ui/voice_input.d.ts +10 -11
  82. package/dist/ui/voice_input.d.ts.map +1 -1
  83. package/package.json +1 -1
  84. package/src/constants.ts +74 -87
  85. package/src/core/ag_ui_chat.ts +313 -269
  86. package/src/core/agui_client.ts +60 -71
  87. package/src/core/attachment.ts +9 -14
  88. package/src/core/conversation_store.ts +55 -33
  89. package/src/core/create_http_agent.ts +18 -22
  90. package/src/core/remote_conversation_store.ts +28 -15
  91. package/src/core/run_index.ts +14 -23
  92. package/src/core/transcribe_audio.ts +9 -10
  93. package/src/core/upload_attachment.ts +18 -21
  94. package/src/core/utils.ts +4 -6
  95. package/src/dom/animations.ts +33 -43
  96. package/src/dom/dom_driver.ts +7 -7
  97. package/src/dom/native_setter.ts +11 -12
  98. package/src/index.ts +3 -0
  99. package/src/skills/fill_template.ts +4 -5
  100. package/src/skills/parse_skills.ts +3 -4
  101. package/src/skills/skill.ts +7 -8
  102. package/src/tools/client_tool_registry.ts +2 -2
  103. package/src/tools/page_action_tools.ts +12 -15
  104. package/src/tools/page_state.ts +5 -8
  105. package/src/tools/route_map.ts +15 -19
  106. package/src/ui/approval_card.ts +15 -20
  107. package/src/ui/attach_copy_buttons.ts +9 -18
  108. package/src/ui/attachment_chips.ts +7 -10
  109. package/src/ui/attachment_tray.ts +6 -6
  110. package/src/ui/checkpoint_menu.ts +7 -8
  111. package/src/ui/confirmation_card.ts +10 -15
  112. package/src/ui/question_card.ts +12 -15
  113. package/src/ui/relative_time.ts +5 -7
  114. package/src/ui/render_markdown.ts +25 -51
  115. package/src/ui/resize_handle.ts +25 -38
  116. package/src/ui/run_notice.ts +9 -12
  117. package/src/ui/skills_menu.ts +4 -5
  118. package/src/ui/styles.ts +92 -101
  119. package/src/ui/thoughts_block.ts +11 -13
  120. package/src/ui/thread_drawer.ts +6 -5
  121. package/src/ui/tool_call_card.ts +22 -32
  122. package/src/ui/ui_strings.ts +6 -12
  123. package/src/ui/voice_input.ts +10 -11
  124. package/src/version.ts +1 -1
@@ -1,88 +1,80 @@
1
1
  /** The Custom Element tag name registered by {@link defineAgUiChat}. */
2
2
  export declare const ELEMENT_TAG = "ag-ui-chat";
3
- /**
4
- * Event dispatched by `<ag-ui-chat>` when the user submits a message.
5
- * `detail` carries `{ content: string }`. Later phases wire this to the
6
- * AG-UI client; for now it is the public seam for host integration.
7
- */
3
+ /** User submitted a message. `detail` is {@link SubmitDetail}. */
8
4
  export declare const SUBMIT_EVENT = "ag-ui-submit";
9
5
  /**
10
- * Event dispatched by `<ag-ui-chat>` when its collapsed state changes (via the
11
- * built-in toggle or {@link setCollapsed}). `detail` carries
12
- * `{ collapsed: boolean }`. A host can listen to drive its own chrome, or hide
13
- * the built-in toggle and drive the `collapsed` attribute itself.
6
+ * Collapsed state changed, via the built-in toggle or `setCollapsed`.
7
+ * `detail` is {@link ToggleDetail}.
14
8
  */
15
9
  export declare const TOGGLE_EVENT = "ag-ui-toggle";
16
10
  /**
17
- * Event dispatched by `<ag-ui-chat>` when the number of answers that arrived
18
- * while it was collapsed changes one more finished, or expanding cleared them
19
- * all. `detail` carries `{ unread: number }`.
20
- *
21
- * The built-in badge on the launcher renders exactly this. A host driving its
22
- * own chrome can turn the badge off with `data-unread-badge="false"` and listen
23
- * here instead.
11
+ * The count of answers that arrived while collapsed changed. `detail` is
12
+ * {@link UnreadDetail}. The built-in launcher badge renders exactly this; a
13
+ * host driving its own chrome sets `data-unread-badge="false"` and listens.
24
14
  */
25
15
  export declare const UNREAD_EVENT = "ag-ui-unread";
26
16
  /**
27
- * Event dispatched by `<ag-ui-chat>` when AG-UI **shared state** changesthe
28
- * server streamed a `STATE_SNAPSHOT` / `STATE_DELTA`, or the host assigned
29
- * {@link AgUiChat.sharedState}. `detail` carries `{ state }`.
17
+ * AG-UI shared state changeda streamed `STATE_SNAPSHOT` / `STATE_DELTA`, or
18
+ * a host assignment to `sharedState`. `detail` is {@link StateDetail}.
30
19
  *
31
- * This is the protocol's own state channel, distinct from `registerPageState`,
32
- * which exposes host state to the agent as ordinary *tools*.
20
+ * The protocol's own state channel, distinct from `registerPageState`, which
21
+ * exposes host state to the agent as ordinary tools.
33
22
  */
34
23
  export declare const STATE_EVENT = "ag-ui-state";
35
24
  /**
36
- * Event dispatched by `<ag-ui-chat>` whenever the attachment tray changes a
37
- * file queued, an upload finishing or failing, a chip removed, the tray
38
- * cleared after a send. `detail` carries `{ attachments, pending }`:
39
- * the durable refs of everything that has finished uploading, and how many are
40
- * still in flight.
41
- *
42
- * This is the seam for a host that drives its own composer: without it the tray
43
- * only ever spoke to the built-in Send button, so a custom send had no way to
44
- * know whether a file was ready or still uploading.
25
+ * The attachment tray changed a file queued, an upload finishing or failing,
26
+ * a chip removed, the tray cleared after a send. `detail` is
27
+ * {@link AttachmentsDetail}, carrying the refs that finished uploading and how
28
+ * many are still in flight. A host driving its own composer uses this to know
29
+ * whether a send would leave files behind.
45
30
  */
46
31
  export declare const ATTACHMENT_EVENT = "ag-ui-attachments";
32
+ /**
33
+ * An interaction has finished, whatever ended it. `detail` is
34
+ * {@link RunFinishedDetail}, listing the tools that ran and which side ran them.
35
+ *
36
+ * For hosts that render data the agent can change. A server-side tool writes
37
+ * without the page's knowledge — nothing else the element dispatches implies
38
+ * "something may have moved underneath you", so a page showing that data has no
39
+ * reason to refetch and quietly goes stale. Shared state
40
+ * ({@link STATE_EVENT}) is the richer channel, but it needs the agent to emit
41
+ * state; this needs nothing of the agent at all.
42
+ *
43
+ * Fires once per interaction rather than once per tool round, on completion,
44
+ * error and cancellation alike, since a partial write is still a write.
45
+ */
46
+ export declare const RUN_FINISHED_EVENT = "ag-ui-run-finished";
47
47
  /** Roles a chat message can take. */
48
48
  export declare const MESSAGE_ROLE: {
49
49
  readonly USER: "user";
50
50
  readonly ASSISTANT: "assistant";
51
51
  };
52
52
  /**
53
- * JSON-Schema extension key marking a tool as destructive. Mirrors the
54
- * `django-ag-ui` server side. When a tool's `parameters` carries
55
- * `{ "x-destructive": true }`, the element gates its execution behind the
56
- * confirmation modal (unless `autoConfirm` is set).
53
+ * Schema-root key marking a tool destructive: the element gates its execution
54
+ * behind the confirmation card unless `autoConfirm` is set. All four `x-*` keys
55
+ * below mirror the `django-ag-ui` server side.
57
56
  */
58
57
  export declare const X_DESTRUCTIVE_KEY = "x-destructive";
59
58
  /**
60
- * JSON-Schema extension key carrying a human-readable confirmation prompt for a
61
- * destructive tool (e.g. `"Activate this project?"`). Mirrors the `django-ag-ui`
62
- * server side. When present, the inline confirmation card shows this instead of
63
- * the generic `Run "<tool>"?`.
59
+ * Schema-root key holding a confirmation prompt (e.g. `"Activate this
60
+ * project?"`), shown instead of the generic `Run "<tool>"?`.
64
61
  */
65
62
  export declare const X_CONFIRM_KEY = "x-confirm";
66
63
  /**
67
- * JSON-Schema extension key carrying a short human-readable label for a tool
68
- * (e.g. `"Query orders"` for `query_model`). Mirrors the `django-ag-ui` server
69
- * side; the tool-call card shows it instead of the raw tool name when present.
64
+ * Schema-root key holding a short label for a tool (e.g. `"Query orders"` for
65
+ * `query_model`), shown on the card instead of the raw tool name.
70
66
  */
71
67
  export declare const X_SUMMARY_KEY = "x-summary";
72
68
  /**
73
- * JSON-Schema extension key marking a tool as navigating — its handler triggers
74
- * a full page reload (an MPA navigation). When a tool's `parameters` carries
75
- * `{ "x-navigates": true }`, the element checkpoints the call before the reload
76
- * and resumes the run loop once the next page mounts. Mirrors `x-destructive`.
69
+ * Schema-root key marking a tool as navigating — its handler triggers a full
70
+ * page reload. The element checkpoints the call before the reload and resumes
71
+ * the run loop once the next page mounts.
77
72
  */
78
73
  export declare const X_NAVIGATES_KEY = "x-navigates";
79
74
  /**
80
- * Name of the built-in tool that re-reads the current page.
81
- *
82
- * Registered only when a page-map provider is set. Named here because it is
83
- * also the documented recovery from a stale page, so the stale-page guard has
84
- * to exempt it — refusing the very call that would refresh the agent's view
85
- * would be a deadlock.
75
+ * The built-in tool that re-reads the current page, registered only when a
76
+ * page-map provider is set. Named here because the stale-page guard must exempt
77
+ * it: refusing the one call that would refresh the agent's view deadlocks.
86
78
  */
87
79
  export declare const READ_PAGE_TOOL = "read_page";
88
80
  /** Upper bound on frontend tool-call → re-run rounds within one send. */
@@ -109,22 +101,19 @@ export declare const ATTACHMENT_STATUS: {
109
101
  };
110
102
  /**
111
103
  * Default client-side upload size cap (10 MiB), matching django-ag-ui's
112
- * `ATTACHMENT_MAX_BYTES` default. Overridable per element via
113
- * `data-attachment-max-bytes`; the server stays authoritative.
104
+ * `ATTACHMENT_MAX_BYTES`. Overridable via `data-attachment-max-bytes`; the
105
+ * server stays authoritative.
114
106
  */
115
107
  export declare const DEFAULT_ATTACHMENT_MAX_BYTES: number;
116
108
  /**
117
- * How much detail a tool-call card shows. Set via the `data-tool-display`
118
- * attribute on `<ag-ui-chat>`; defaults to `full` (back-compatible).
109
+ * How much detail a tool-call card shows. Set via `data-tool-display`; the
110
+ * default is `full`.
119
111
  *
120
- * - `inline` — the lightest mode: a single status row (icon + summary) with no
121
- * surrounding card chrome, the result tucked behind its own toggle. Reads as
122
- * one line of the answer rather than a boxed card pairs with the answer
123
- * well (page mode).
124
- * - `minimal` — just the tool name + status pill. No args, no result body.
125
- * - `compact` — name + status, with args *and* result tucked behind a single
126
- * collapsed "Details" toggle. The light default for dense UIs.
127
- * - `full` — args shown inline, result behind its own toggle (the original).
112
+ * - `inline` — one status row (icon + summary), no card chrome, result behind
113
+ * its own toggle. Reads as a line of the answer rather than a boxed card.
114
+ * - `minimal` tool name + status pill only. No args, no result body.
115
+ * - `compact` — name + status, args and result behind one "Details" toggle.
116
+ * - `full` — args inline, result behind its own toggle.
128
117
  */
129
118
  export declare const TOOL_DISPLAY: {
130
119
  readonly INLINE: "inline";
@@ -133,30 +122,30 @@ export declare const TOOL_DISPLAY: {
133
122
  readonly FULL: "full";
134
123
  };
135
124
  /**
136
- * `activityType` of the AG-UI `ACTIVITY_SNAPSHOT` event `django-ag-ui` emits
137
- * when a compaction capability trimmed the message history. Its `content`
138
- * carries `{ removed, before, after }`.
125
+ * `activityType` of the `ACTIVITY_SNAPSHOT` event django-ag-ui emits when a
126
+ * compaction capability trimmed the history. `content` carries
127
+ * `{ removed, before, after }`.
139
128
  */
140
129
  export declare const COMPACTION_ACTIVITY_TYPE = "compaction";
141
130
  /**
142
- * Pydantic-AI's built-in tool the model calls to load a *deferred* capability,
143
- * with `{ id }` naming it. Agent skills are deferred capabilities whose id is
144
- * the skill name, so a call to this tool is how "the agent picked skill X"
145
- * reaches the client — there is no separate event for it.
131
+ * Pydantic-AI's built-in tool for loading a deferred capability, with `{ id }`
132
+ * naming it. Agent skills are deferred capabilities keyed by skill name, so a
133
+ * call to this tool is the only signal that the agent picked a skill.
146
134
  *
147
- * Not to be confused with the host-provided {@link Skill} catalog, which is a
148
- * *human* affordance (a prompt the user launches from the `/`-palette).
135
+ * Distinct from the host-provided {@link Skill} catalog, which is a human
136
+ * affordance launched from the slash palette.
149
137
  */
150
138
  export declare const LOAD_CAPABILITY_TOOL = "load_capability";
151
139
  /**
152
140
  * The chrome's glyphs, as inline SVG markup.
153
141
  *
154
- * Static, author-written markup assigned to a `<slot>`'s fallback content, so
155
- * it never passes through the sanitiser — nothing here is user or server data.
156
- * Each icon is a 24x24 viewBox carrying the shared `glyph` class, which
157
- * `STYLES` sizes and paints from `currentColor`; `glyph--solid` fills instead
158
- * of stroking. A host that wants its own mark projects a matching
159
- * `slot="icon-…"` child rather than editing these.
142
+ * Static author-written markup assigned as a `<slot>`'s fallback content, so it
143
+ * never passes through the sanitiser — nothing here is user or server data, and
144
+ * nothing user-supplied may be interpolated into it. Each icon is a 24x24
145
+ * viewBox carrying the shared `glyph` class, which `STYLES` sizes and paints
146
+ * from `currentColor`; `glyph--solid` fills instead of stroking. A host wanting
147
+ * its own mark projects a matching `slot="icon-…"` child instead of editing
148
+ * these.
160
149
  */
161
150
  export declare const ICON_SEND = "<svg class=\"glyph\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M12 19.5V5m-6.5 6.5L12 5l6.5 6.5\"/></svg>";
162
151
  /** The Stop glyph the composer button wears while a run is in flight. */
@@ -168,13 +157,10 @@ export declare const ICON_VOICE = "<svg class=\"glyph\" viewBox=\"0 0 24 24\" ar
168
157
  /** The default launcher mark (a speech bubble), shown when the host slots none. */
169
158
  export declare const ICON_LAUNCHER = "<svg class=\"glyph\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M4 5.5A2.5 2.5 0 0 1 6.5 3h11A2.5 2.5 0 0 1 20 5.5v8a2.5 2.5 0 0 1-2.5 2.5H9l-5 4z\"/></svg>";
170
159
  /**
171
- * The attachment-chip type marks, one per coarse file family. Same contract as
172
- * the chrome's glyphs above: static author-written markup on a 24x24 viewBox
173
- * carrying the shared `glyph` class. A chip picks one by MIME family through
174
- * `iconFor`; the MIME string selects a constant and is never interpolated into
175
- * one, so nothing user- or server-supplied reaches the markup.
176
- *
177
- * The generic mark, for a family with nothing more specific to say.
160
+ * The generic attachment-chip mark, for a file family with nothing more
161
+ * specific to say. The chip marks share the contract of the chrome glyphs
162
+ * above; `iconFor` selects one by MIME family, never interpolating the MIME
163
+ * string into the markup.
178
164
  */
179
165
  export declare const ICON_FILE = "<svg class=\"glyph\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z\"/><path d=\"M14 3v5h5\"/></svg>";
180
166
  /** An image attachment: a framed picture with a horizon and a sun. */
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAGA,w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kOAA0M,CAAC;AAEvO,sEAAsE;AACtE,eAAO,MAAM,aAAa,iQAA2O,CAAC;AAEtQ,gDAAgD;AAChD,eAAO,MAAM,cAAc,8MAAkM,CAAC"}
@@ -34,6 +34,21 @@ export interface AttachmentsDetail {
34
34
  export interface StateDetail {
35
35
  readonly state: Readonly<Record<string, unknown>>;
36
36
  }
37
+ /** One tool that ran during an interaction, as {@link RunFinishedDetail} lists it. */
38
+ export interface ToolRun {
39
+ readonly name: string;
40
+ /**
41
+ * Where it executed. `"server"` is the one a data-rendering host cares about:
42
+ * a `"client"` tool ran in the host's own handler, so the host already knows
43
+ * whatever it did.
44
+ */
45
+ readonly side: "server" | "client";
46
+ }
47
+ /** `detail` shape of the {@link RUN_FINISHED_EVENT} CustomEvent. */
48
+ export interface RunFinishedDetail {
49
+ /** In settle order. Empty when the interaction called no tools. */
50
+ readonly tools: readonly ToolRun[];
51
+ }
37
52
  /** `detail` shape of the {@link TOGGLE_EVENT} CustomEvent. */
38
53
  export interface ToggleDetail {
39
54
  readonly collapsed: boolean;
@@ -46,42 +61,35 @@ export interface UnreadDetail {
46
61
  * `<ag-ui-chat>` — a framework-free chat sidebar Web Component over AG-UI.
47
62
  *
48
63
  * Owns the Shadow DOM shell (header, scrolling message list, input row),
49
- * builds an {@link AgUiClient} on first send (via the overridable
50
- * {@link agentFactory}), and renders streaming assistant text plus tool-call
64
+ * builds an {@link AgUiClient} on first send via the overridable
65
+ * {@link agentFactory}, and renders streaming assistant text plus tool-call
51
66
  * activity. Emits a {@link SUBMIT_EVENT} for host visibility.
52
67
  *
53
- * The per-run frontend tool catalog and context are supplied by
54
- * {@link getTools} / {@link getContext}, which later phases (the tool
55
- * registry, DOM driver) populate.
68
+ * The per-run frontend tool catalog and context come from {@link getTools} and
69
+ * {@link getContext}.
56
70
  */
57
71
  export declare class AgUiChat extends HTMLElement {
58
72
  #private;
59
73
  /** Agent factory; override to inject a custom or fake agent (tests). */
60
74
  agentFactory: AgentFactory;
61
75
  /**
62
- * Static extra HTTP headers, sent with **every** request this element makes
63
- * the agent run, the thread index and its messages, the tool and skill
64
- * catalogs, the run index, uploads and transcription.
76
+ * Static extra HTTP headers, sent with every request this element makes: the
77
+ * agent run, the thread index and its messages, the tool and skill catalogs,
78
+ * the run index, uploads and transcription.
65
79
  *
66
- * Right for values fixed for the element's lifetime. A credential that
67
- * rotates (a short-lived JWT, a re-issued CSRF token) belongs in
68
- * {@link getHeaders} instead: this is read at request time, but only a
69
- * re-assignment updates it, so a token captured here is pinned until the host
70
- * remembers to assign again.
80
+ * For values fixed for the element's lifetime. A rotating credential belongs
81
+ * in {@link getHeaders} instead — only a re-assignment updates this, so a
82
+ * token captured here is pinned until the host assigns again.
71
83
  */
72
84
  headers: Record<string, string>;
73
85
  /**
74
- * Live header source, consulted immediately before every request — the way to
75
- * supply rotating credentials.
76
- *
77
- * Set it to a function and each request calls it afresh: a token refreshed by
78
- * the host between two requests reaches the second one, with nothing to
79
- * re-assign and nothing to keep in sync.
86
+ * Live header source, called afresh immediately before every request — the
87
+ * way to supply rotating credentials, with nothing to re-assign or keep in
88
+ * sync.
80
89
  *
81
- * Composes with {@link headers} rather than replacing it: the two are merged
82
- * per key with `getHeaders()` winning, so a static `X-Client` and a rotating
83
- * `Authorization` can be configured independently and neither silently drops
84
- * the other.
90
+ * Composes with {@link headers} rather than replacing it: merged per key with
91
+ * `getHeaders()` winning, so a static `X-Client` and a rotating
92
+ * `Authorization` are configured independently and neither drops the other.
85
93
  */
86
94
  getHeaders: (() => Record<string, string>) | null;
87
95
  /**
@@ -95,37 +103,31 @@ export declare class AgUiChat extends HTMLElement {
95
103
  autoConfirm: boolean;
96
104
  /**
97
105
  * When true, the built-in `ask_user` frontend tool is offered to the agent:
98
- * calling it renders an inline question card (radio choices and/or a free-text
99
- * field) and returns the user's answer. Off by default — like the other
100
- * built-in tool groups (route / page-action), it is opt-in so it doesn't
101
- * change the advertised catalog until a host asks for it.
106
+ * calling it renders an inline question card and returns the user's answer.
107
+ * Off by default, like the other built-in tool groups, so the advertised
108
+ * catalog does not change until a host asks for it.
102
109
  */
103
110
  askUser: boolean;
104
111
  /**
105
- * Optional full replacement for the `ask_user` question UI. When set, calling
106
- * `ask_user` invokes this instead of the built-in inline card: the host
107
- * renders whatever it likes (a native modal, a framework component, …) and
108
- * resolves with the answer. Unset (default) uses the built-in
109
- * {@link requestQuestion} card — style that via the `strings` override and the
110
- * `question*` CSS `::part()`s. Requires {@link askUser} to be enabled.
112
+ * Optional full replacement for the `ask_user` question UI, resolving with
113
+ * the answer; the same seam as {@link approvalRenderer}, styled via `strings`
114
+ * and the `question*` `::part()`s when left unset. Requires {@link askUser}.
111
115
  */
112
116
  askUserRenderer: QuestionRenderer | null;
113
117
  /**
114
- * Optional full replacement for the server-side-tool approval UI. When set, an
115
- * approval interrupt invokes this instead of the built-in inline approval
116
- * card: the host renders whatever it likes and resolves `true` to approve /
117
- * `false` to deny. Unset (default) uses the built-in {@link requestApproval}
118
- * card style that via the `strings` override and the `approval*` CSS
119
- * `::part()`s. The gate itself is enabled server-side; this only changes how
120
- * the decision is collected.
118
+ * Optional full replacement for the server-side-tool approval UI: an approval
119
+ * interrupt invokes this instead of the built-in {@link requestApproval}
120
+ * card, resolving `true` to approve or `false` to deny. Style the built-in
121
+ * card via `strings` and the `approval*` `::part()`s instead. The gate itself
122
+ * is enabled server-side; this only changes how the decision is collected.
121
123
  */
122
124
  approvalRenderer: ApprovalRenderer | null;
123
125
  /**
124
- * Optional per-call confirmation predicate. When set, it is authoritative:
125
- * given a tool name + args it decides whether *this* call needs confirmation
126
- * (so one tool can be instant for some args and confirmed for others — what a
127
- * static `x-destructive` flag can't express). When unset, the `x-destructive`
128
- * schema flag is used. `autoConfirm` short-circuits both.
126
+ * Optional per-call confirmation predicate. When set it is authoritative,
127
+ * deciding from the tool name and args whether this particular call needs
128
+ * confirmation — so one tool can be instant for some args and confirmed for
129
+ * others, which a static `x-destructive` flag cannot express. When unset the
130
+ * `x-destructive` flag decides. `autoConfirm` short-circuits both.
129
131
  */
130
132
  confirmPredicate: ((toolName: string, args: Record<string, unknown>) => boolean | Promise<boolean>) | null;
131
133
  /**
@@ -139,11 +141,8 @@ export declare class AgUiChat extends HTMLElement {
139
141
  * Per-run context provider. Defaults to the compact page map, when a
140
142
  * {@link getPageMap} provider is set and {@link autoInjectPageMap} is on.
141
143
  *
142
- * It used to append a one-line manifest of the message's attachments too.
143
- * The server now derives that manifest from the refs riding the messages, so
144
- * the client's copy only duplicated it, on exactly the turn a file was
145
- * attached. Attachments still reach the agent; they reach it through the
146
- * message, which is where they were already.
144
+ * Attachments are deliberately not restated here: the server derives its own
145
+ * manifest from the refs riding the messages.
147
146
  */
148
147
  getContext: () => Context[];
149
148
  /**
@@ -169,21 +168,17 @@ export declare class AgUiChat extends HTMLElement {
169
168
  conversationStore: ClientConversationStore;
170
169
  /**
171
170
  * How attached files are uploaded. `null` (default) uses the built-in
172
- * multipart `POST` to `data-attachments-url`. Set a custom
173
- * {@link UploadHandler} `(file, onProgress) => Promise<AttachmentRef>` to
174
- * swap the transport (e.g. a `tus-js-client` resumable adapter or
175
- * direct-to-S3 multipart) without changing the tray, the chips, or the AG-UI
176
- * wire (refs are transport-agnostic). When set, the 📎 affordance appears even
177
- * with no `data-attachments-url`; the handler owns its own endpoint + headers.
171
+ * multipart `POST` to `data-attachments-url`; a custom {@link UploadHandler}
172
+ * swaps the transport without changing the tray, the chips, or the AG-UI
173
+ * wire. When set, the 📎 affordance appears even with no
174
+ * `data-attachments-url`, and the handler owns its own endpoint and headers.
178
175
  */
179
176
  uploadHandler: UploadHandler | null;
180
177
  /**
181
178
  * How recorded voice clips are transcribed. `null` (default) POSTs the clip
182
- * to `data-transcribe-url` (django-ag-ui's `TranscribeView`). Set a custom
183
- * {@link TranscribeHandler} `(audio: Blob) => Promise<string>` to swap the
184
- * transport (a different STT endpoint, a browser Web Speech adapter) without
185
- * touching the mic button. When set, the 🎤 affordance appears even with no
186
- * `data-transcribe-url`.
179
+ * to `data-transcribe-url`; a custom {@link TranscribeHandler} swaps the
180
+ * transport without touching the mic button. When set, the 🎤 affordance
181
+ * appears even with no `data-transcribe-url`.
187
182
  */
188
183
  transcribeHandler: TranscribeHandler | null;
189
184
  /**
@@ -199,12 +194,10 @@ export declare class AgUiChat extends HTMLElement {
199
194
  */
200
195
  skillContext: () => Record<string, unknown>;
201
196
  /**
202
- * Friendly display labels for tool-call cards, keyed by tool name (e.g.
203
- * `{ list_projects: "Search projects" }`). Used as a fallback when a tool has
204
- * no `x-summary` in its own schema chiefly **server-side tools** (drf-mcp,
205
- * `@tool` registry), whose schema never reaches the browser (AG-UI streams
206
- * only the tool-call name). Client tools should prefer `x-summary` on their
207
- * schema; this map is the seam for everything else.
197
+ * Friendly display labels for tool-call cards, keyed by tool name. The
198
+ * fallback when a tool has no `x-summary` in its own schema, which chiefly
199
+ * means server-side tools: AG-UI streams only the tool-call name, so their
200
+ * schema never reaches the browser. Client tools should prefer `x-summary`.
208
201
  */
209
202
  toolSummaries: Record<string, string>;
210
203
  /**
@@ -233,21 +226,17 @@ export declare class AgUiChat extends HTMLElement {
233
226
  * when the server streams `STATE_SNAPSHOT` / `STATE_DELTA`. Assigning seeds
234
227
  * the next run; reading returns whatever the agent last applied.
235
228
  *
236
- * Listen for {@link STATE_EVENT} to react to server-driven changes.
237
- *
238
- * Not to be confused with {@link registerPageState}, which exposes host
239
- * state to the agent as ordinary *tools*.
229
+ * Listen for {@link STATE_EVENT} to react to server-driven changes. Distinct
230
+ * from {@link registerPageState}, which exposes host state as ordinary tools.
240
231
  */
241
232
  get sharedState(): Readonly<Record<string, unknown>>;
242
233
  set sharedState(state: Readonly<Record<string, unknown>>);
243
234
  /** Bind a piece of host page state to `read_<name>` / `set_<name>` tools. */
244
235
  registerPageState(binding: PageState): void;
245
236
  /**
246
- * @deprecated Renamed to {@link registerPageState}. The old name read as
247
- * AG-UI shared-state sync (`STATE_SNAPSHOT` / `STATE_DELTA`), which this
248
- * component does not implement — these are ordinary client tools over host
249
- * page state. Behaviour is unchanged; this alias will be removed in a future
250
- * major.
237
+ * @deprecated Renamed to {@link registerPageState} the old name read as
238
+ * AG-UI shared-state sync. Behaviour is unchanged; the alias will be removed
239
+ * in a future major.
251
240
  */
252
241
  registerStateHook(binding: PageState): void;
253
242
  /** The AG-UI endpoint URL, read from the `endpoint` attribute. */
@@ -258,19 +247,18 @@ export declare class AgUiChat extends HTMLElement {
258
247
  * `credentials` mode (`"omit"` / `"same-origin"` / `"include"`). Mirrored to
259
248
  * the `credentials` attribute, so markup embeds can set it without script.
260
249
  *
261
- * `null` (the default) leaves the browser's default of `same-origin` in
262
- * place. That default sends **no cookies at all** when the endpoints live on
263
- * a different origin from the page app.example.com calling
264
- * api.example.com is cross-origin and the request goes out anonymously
265
- * rather than failing, so the symptom is a 401 from a server that looks
266
- * correctly configured. A cookie-authenticated cross-origin deployment wants
267
- * `"include"`, plus `Access-Control-Allow-Credentials: true` and a concrete
268
- * (non-wildcard) `Access-Control-Allow-Origin` on the server.
250
+ * `null` (the default) leaves the browser's `same-origin` default in place,
251
+ * which sends no cookies at all to an endpoint on a different origin — and
252
+ * the request goes out anonymously rather than failing, so the symptom is a
253
+ * 401 from a server that looks correctly configured. A cookie-authenticated
254
+ * cross-origin deployment wants `"include"`, plus
255
+ * `Access-Control-Allow-Credentials: true` and a concrete, non-wildcard
256
+ * `Access-Control-Allow-Origin` on the server.
269
257
  *
270
258
  * Read per request, so a late assignment applies to everything after it.
271
- * `"omit"` cannot be honoured by the built-in **upload** transport, which is
272
- * an `XMLHttpRequest` and only has a two-state cookie switch; every other
273
- * endpoint honours all three modes.
259
+ * `"omit"` cannot be honoured by the built-in upload transport, an
260
+ * `XMLHttpRequest` with only a two-state cookie switch; every other endpoint
261
+ * honours all three modes.
274
262
  */
275
263
  get credentials(): RequestCredentials | null;
276
264
  set credentials(value: RequestCredentials | null);
@@ -290,24 +278,20 @@ export declare class AgUiChat extends HTMLElement {
290
278
  * the backend skill catalog and the thread's history — with the transport
291
279
  * configuration as it stands now.
292
280
  *
293
- * This is the answer for a host that can only configure the element after the
294
- * fact (a token fetched in a passive effect, an async auth handshake): the
295
- * startup requests already went out with whatever was set then, and this says
296
- * "try again, properly authenticated" without removing and re-inserting the
297
- * node.
281
+ * For a host that can only configure the element after the fact (a token
282
+ * fetched in a passive effect, an async auth handshake), this re-issues the
283
+ * startup requests authenticated, without removing and re-inserting the node.
298
284
  *
299
- * A reload, not a merge the in-flight run is cancelled and the transcript
300
- * is rebuilt from the persisted history, so anything streamed since is
301
- * dropped. Call it once, when configuration lands; not between turns.
285
+ * A reload, not a merge: the in-flight run is cancelled and the transcript is
286
+ * rebuilt from persisted history, so anything streamed since is dropped. Call
287
+ * it once, when configuration lands, not between turns.
302
288
  */
303
289
  reload(): Promise<void>;
304
290
  /**
305
- * Tear down live resources when the element leaves the DOM (a removed node, a
306
- * client-side route swap): cancel the in-flight run so its SSE stream closes,
307
- * abort any in-flight uploads so they don't orphan server-side files, and
308
- * release the mic so the browser's recording indicator clears. Without this a
309
- * removed `<ag-ui-chat>` leaks a streaming request, uploads, and a live
310
- * `MediaRecorder`.
291
+ * Tear down live resources when the element leaves the DOM: cancel the
292
+ * in-flight run so its stream closes, abort in-flight uploads so they do not
293
+ * orphan server-side files, and release the mic so the browser's recording
294
+ * indicator clears. Without this a removed element leaks all three.
311
295
  */
312
296
  disconnectedCallback(): void;
313
297
  /**
@@ -344,12 +328,10 @@ export declare class AgUiChat extends HTMLElement {
344
328
  * Open the thread-history drawer: the imperative route to the control that
345
329
  * renders as `::part(history-button)`.
346
330
  *
347
- * A host that hides `::part(header)` to render its own title bar hides the
348
- * history, new-chat and collapse buttons with it and thread switching then
349
- * has no route at all, because those controls live inside the header. Each of
350
- * them has a method, so a host chrome can rebuild the set: this one,
351
- * {@link openCheckpoints}, {@link newChat}, {@link toggleCollapsed} and
352
- * {@link toggleTheme}.
331
+ * A host that hides `::part(header)` for its own title bar hides the history,
332
+ * new-chat and collapse buttons with it. Each has a method so that chrome can
333
+ * be rebuilt: this one, {@link openCheckpoints}, {@link newChat},
334
+ * {@link toggleCollapsed} and {@link toggleTheme}.
353
335
  */
354
336
  openThreads(): void;
355
337
  /**
@@ -368,32 +350,28 @@ export declare class AgUiChat extends HTMLElement {
368
350
  /**
369
351
  * Append a message bubble and return it.
370
352
  *
371
- * Assistant content is rendered as sanitised markdown/HTML; user content
372
- * stays literal text (no need to parse what the user typed, and it avoids
373
- * rendering user-authored markup).
353
+ * Assistant content renders as sanitised markdown/HTML; user content stays
354
+ * literal text, which also avoids rendering user-authored markup.
374
355
  *
375
- * Assistant bubbles land in the current answer group, opening one if
376
- * needed; a user bubble closes the prior group and sits directly in the list
377
- * (the well wraps the *assistant* turn, the user message precedes it).
356
+ * Assistant bubbles land in the current answer group, opening one if needed;
357
+ * a user bubble closes the prior group and sits directly in the list, the
358
+ * well wrapping only the assistant turn.
378
359
  */
379
360
  appendMessage(role: MessageRole, content: string): HTMLDivElement;
380
361
  /**
381
362
  * Send a message as if the user had typed it — renders the user bubble,
382
363
  * dispatches {@link SUBMIT_EVENT}, and starts the run.
383
364
  *
384
- * The programmatic half of the composer, for a host driving its own input
385
- * (a "Ask about this order" button, a command palette, a custom composer
386
- * replacing the built-in one). Everything the built-in Send does happens
387
- * here; Send itself now reads the composer, clears it, and calls this.
365
+ * The programmatic half of the composer, for a host driving its own input.
366
+ * Everything the built-in Send does happens here; Send reads the composer,
367
+ * clears it, and calls this.
388
368
  *
389
- * `attachments` are durable {@link AttachmentRef}s — the shape
390
- * {@link attachFile}'s upload resolves to, and the shape
391
- * {@link ATTACHMENT_EVENT} reports. Pass them to attach files to the message.
369
+ * `attachments` are durable {@link AttachmentRef}s — what {@link attachFile}
370
+ * resolves to and what {@link ATTACHMENT_EVENT} reports.
392
371
  *
393
- * No-ops while a run is in flight (a second concurrent run would orphan the
394
- * first) and for an entirely empty message. Unlike the built-in Send, this
395
- * does **not** consult the tray: what you pass is what is sent, so a host
396
- * composer stays in charge of its own state.
372
+ * No-ops on an empty message, and while a run is in flight, since a second
373
+ * concurrent run would orphan the first. Unlike the built-in Send it does not
374
+ * consult the tray: what you pass is what is sent.
397
375
  */
398
376
  sendMessage(content: string, attachments?: readonly AttachmentRef[]): Promise<void>;
399
377
  /**
@@ -401,11 +379,11 @@ export declare class AgUiChat extends HTMLElement {
401
379
  * picker and drag-and-drop do — validation, progress chip, and all.
402
380
  *
403
381
  * Returns `false` when uploads are not configured (no `data-attachments-url`
404
- * and no {@link uploadHandler}), which is the only way for a host to tell;
405
- * the tray does not exist to report anything in that case.
382
+ * and no {@link uploadHandler}) the only signal a host gets, since the tray
383
+ * does not exist to report anything then.
406
384
  *
407
385
  * Uploading is asynchronous: watch {@link ATTACHMENT_EVENT} for the resulting
408
- * {@link AttachmentRef}, and pass it to {@link sendMessage} once `pending`
386
+ * {@link AttachmentRef} and pass it to {@link sendMessage} once `pending`
409
387
  * reaches zero.
410
388
  */
411
389
  attachFile(file: File): boolean;