@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.
- package/CHANGELOG.md +149 -36
- package/README.md +140 -9
- package/dist/ag-ui-web-component.bundle.js +113 -122
- package/dist/ag-ui-web-component.bundle.js.map +3 -3
- package/dist/constants.d.ts +71 -85
- package/dist/constants.d.ts.map +1 -1
- package/dist/core/ag_ui_chat.d.ts +105 -127
- package/dist/core/ag_ui_chat.d.ts.map +1 -1
- package/dist/core/agui_client.d.ts +24 -30
- package/dist/core/agui_client.d.ts.map +1 -1
- package/dist/core/attachment.d.ts +9 -14
- package/dist/core/attachment.d.ts.map +1 -1
- package/dist/core/conversation_store.d.ts +38 -27
- package/dist/core/conversation_store.d.ts.map +1 -1
- package/dist/core/create_http_agent.d.ts +13 -15
- package/dist/core/create_http_agent.d.ts.map +1 -1
- package/dist/core/remote_conversation_store.d.ts +10 -9
- package/dist/core/remote_conversation_store.d.ts.map +1 -1
- package/dist/core/run_index.d.ts +11 -20
- package/dist/core/run_index.d.ts.map +1 -1
- package/dist/core/transcribe_audio.d.ts +8 -8
- package/dist/core/transcribe_audio.d.ts.map +1 -1
- package/dist/core/upload_attachment.d.ts +15 -18
- package/dist/core/upload_attachment.d.ts.map +1 -1
- package/dist/core/utils.d.ts +4 -6
- package/dist/core/utils.d.ts.map +1 -1
- package/dist/dom/animations.d.ts +22 -30
- package/dist/dom/animations.d.ts.map +1 -1
- package/dist/dom/dom_driver.d.ts +7 -7
- package/dist/dom/native_setter.d.ts +2 -2
- package/dist/dom/native_setter.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +357 -383
- package/dist/index.js.map +2 -2
- package/dist/skills/fill_template.d.ts +4 -5
- package/dist/skills/fill_template.d.ts.map +1 -1
- package/dist/skills/parse_skills.d.ts.map +1 -1
- package/dist/skills/skill.d.ts +7 -8
- package/dist/skills/skill.d.ts.map +1 -1
- package/dist/tools/client_tool_registry.d.ts +2 -2
- package/dist/tools/page_action_tools.d.ts +7 -10
- package/dist/tools/page_action_tools.d.ts.map +1 -1
- package/dist/tools/page_state.d.ts +5 -8
- package/dist/tools/page_state.d.ts.map +1 -1
- package/dist/tools/route_map.d.ts +7 -10
- package/dist/tools/route_map.d.ts.map +1 -1
- package/dist/ui/approval_card.d.ts +15 -20
- package/dist/ui/approval_card.d.ts.map +1 -1
- package/dist/ui/attach_copy_buttons.d.ts +4 -10
- package/dist/ui/attach_copy_buttons.d.ts.map +1 -1
- package/dist/ui/attachment_chips.d.ts +7 -10
- package/dist/ui/attachment_chips.d.ts.map +1 -1
- package/dist/ui/attachment_tray.d.ts +6 -6
- package/dist/ui/checkpoint_menu.d.ts +7 -8
- package/dist/ui/checkpoint_menu.d.ts.map +1 -1
- package/dist/ui/confirmation_card.d.ts +10 -15
- package/dist/ui/confirmation_card.d.ts.map +1 -1
- package/dist/ui/question_card.d.ts +12 -15
- package/dist/ui/question_card.d.ts.map +1 -1
- package/dist/ui/relative_time.d.ts +5 -7
- package/dist/ui/relative_time.d.ts.map +1 -1
- package/dist/ui/render_markdown.d.ts +8 -8
- package/dist/ui/render_markdown.d.ts.map +1 -1
- package/dist/ui/resize_handle.d.ts +21 -34
- package/dist/ui/resize_handle.d.ts.map +1 -1
- package/dist/ui/run_notice.d.ts +5 -7
- package/dist/ui/run_notice.d.ts.map +1 -1
- package/dist/ui/skills_menu.d.ts +4 -5
- package/dist/ui/skills_menu.d.ts.map +1 -1
- package/dist/ui/styles.d.ts +1 -1
- package/dist/ui/styles.d.ts.map +1 -1
- package/dist/ui/thoughts_block.d.ts +9 -11
- package/dist/ui/thoughts_block.d.ts.map +1 -1
- package/dist/ui/thread_drawer.d.ts +6 -5
- package/dist/ui/thread_drawer.d.ts.map +1 -1
- package/dist/ui/tool_call_card.d.ts +17 -25
- package/dist/ui/tool_call_card.d.ts.map +1 -1
- package/dist/ui/ui_strings.d.ts +6 -12
- package/dist/ui/ui_strings.d.ts.map +1 -1
- package/dist/ui/voice_input.d.ts +10 -11
- package/dist/ui/voice_input.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/constants.ts +74 -87
- package/src/core/ag_ui_chat.ts +313 -269
- package/src/core/agui_client.ts +60 -71
- package/src/core/attachment.ts +9 -14
- package/src/core/conversation_store.ts +55 -33
- package/src/core/create_http_agent.ts +18 -22
- package/src/core/remote_conversation_store.ts +28 -15
- package/src/core/run_index.ts +14 -23
- package/src/core/transcribe_audio.ts +9 -10
- package/src/core/upload_attachment.ts +18 -21
- package/src/core/utils.ts +4 -6
- package/src/dom/animations.ts +33 -43
- package/src/dom/dom_driver.ts +7 -7
- package/src/dom/native_setter.ts +11 -12
- package/src/index.ts +3 -0
- package/src/skills/fill_template.ts +4 -5
- package/src/skills/parse_skills.ts +3 -4
- package/src/skills/skill.ts +7 -8
- package/src/tools/client_tool_registry.ts +2 -2
- package/src/tools/page_action_tools.ts +12 -15
- package/src/tools/page_state.ts +5 -8
- package/src/tools/route_map.ts +15 -19
- package/src/ui/approval_card.ts +15 -20
- package/src/ui/attach_copy_buttons.ts +9 -18
- package/src/ui/attachment_chips.ts +7 -10
- package/src/ui/attachment_tray.ts +6 -6
- package/src/ui/checkpoint_menu.ts +7 -8
- package/src/ui/confirmation_card.ts +10 -15
- package/src/ui/question_card.ts +12 -15
- package/src/ui/relative_time.ts +5 -7
- package/src/ui/render_markdown.ts +25 -51
- package/src/ui/resize_handle.ts +25 -38
- package/src/ui/run_notice.ts +9 -12
- package/src/ui/skills_menu.ts +4 -5
- package/src/ui/styles.ts +92 -101
- package/src/ui/thoughts_block.ts +11 -13
- package/src/ui/thread_drawer.ts +6 -5
- package/src/ui/tool_call_card.ts +22 -32
- package/src/ui/ui_strings.ts +6 -12
- package/src/ui/voice_input.ts +10 -11
- package/src/version.ts +1 -1
package/README.md
CHANGED
|
@@ -387,6 +387,45 @@ with the configuration as it then stands. It is a reload, not a merge: the in-fl
|
|
|
387
387
|
cancelled and the transcript is rebuilt from the persisted history, so call it when configuration
|
|
388
388
|
lands rather than between turns.
|
|
389
389
|
|
|
390
|
+
#### The same boundary in four frameworks
|
|
391
|
+
|
|
392
|
+
Each framework reaches that pre-insertion window differently, and only one of them reaches it
|
|
393
|
+
declaratively. Built and driven in all four:
|
|
394
|
+
|
|
395
|
+
| Host | Pre-insertion window | What to do |
|
|
396
|
+
| --- | --- | --- |
|
|
397
|
+
| React | None — refs attach after insertion | `createElement`, configure, `appendChild` (above) |
|
|
398
|
+
| **Vue 3** | **Yes** — a directive's `beforeMount` | Attributes in the template, properties in the directive |
|
|
399
|
+
| Svelte 5 | None — `use:` actions and `$effect` run after insertion | Same as React |
|
|
400
|
+
| Angular | None — bindings apply during change detection | Same as React, in `ngOnInit` with `@ViewChild({ static: true })` |
|
|
401
|
+
|
|
402
|
+
**Vue** is the one host that can configure declaratively, because a custom directive's `beforeMount`
|
|
403
|
+
runs while the element is still detached:
|
|
404
|
+
|
|
405
|
+
```vue
|
|
406
|
+
<script setup>
|
|
407
|
+
const vConfigure = {
|
|
408
|
+
beforeMount(element) {
|
|
409
|
+
element.getHeaders = () => ({ Authorization: `Bearer ${token()}` });
|
|
410
|
+
element.registerTool(myTool);
|
|
411
|
+
},
|
|
412
|
+
};
|
|
413
|
+
</script>
|
|
414
|
+
|
|
415
|
+
<template>
|
|
416
|
+
<ag-ui-chat v-configure endpoint="/agent/" data-threads-url="/agent/threads/" />
|
|
417
|
+
</template>
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
Tell Vue's compiler the tag is a custom element, or it will warn and try to resolve a component:
|
|
421
|
+
`vue({ template: { compilerOptions: { isCustomElement: (tag) => tag === "ag-ui-chat" } } })`.
|
|
422
|
+
|
|
423
|
+
**Svelte 5**'s `use:` action and `$effect` both run after the node is in the DOM, so build the
|
|
424
|
+
element by hand in an `$effect` and append it — the React shape, in runes. **Angular** needs
|
|
425
|
+
`CUSTOM_ELEMENTS_SCHEMA` on the component and, if it wraps the panel in its own component, one line
|
|
426
|
+
of CSS: `:host { display: contents }`. Angular's host element otherwise lands between your grid and
|
|
427
|
+
the children it sizes, and the panel renders a few hundred pixels tall in the middle of the page.
|
|
428
|
+
|
|
390
429
|
---
|
|
391
430
|
|
|
392
431
|
## Core concepts
|
|
@@ -420,7 +459,7 @@ AG-UI has no server-side cancel route: cancelling **aborts the streaming request
|
|
|
420
459
|
|
|
421
460
|
- Partial assistant text already streamed **stays in the transcript** and is persisted via
|
|
422
461
|
`onPersist`, so a reload shows the truncated exchange. A muted **"⏹ Stopped"** note is appended
|
|
423
|
-
(`.stopped-note`) — a deliberate stop is not an error, so no
|
|
462
|
+
(`.stopped-note`) — a deliberate stop is not an error, so no bubble.
|
|
424
463
|
- The run loop stops: tool calls collected before the abort are **not executed**, and no further
|
|
425
464
|
round starts. A frontend tool handler already running completes, but its result doesn't trigger
|
|
426
465
|
a re-run.
|
|
@@ -520,6 +559,30 @@ This uses the AG-UI protocol's own interrupt/resume mechanism (`RunAgentInput.re
|
|
|
520
559
|
wire stays vanilla AG-UI. A **Stop** while an approval card is open denies every open card and
|
|
521
560
|
cancels the run. No configuration is needed on the client; the gate is enabled server-side.
|
|
522
561
|
|
|
562
|
+
**What the card asks.** An AG-UI interrupt carries the question as `message`, and the default is the
|
|
563
|
+
call spelled out — `Approve create_event({"title": "Design sync", …})?` — which is accurate and not
|
|
564
|
+
something to put in front of a person. A server can supply its own wording as **`x-confirm` in the
|
|
565
|
+
interrupt's `metadata`**, the same key a client-side confirmation reads off the tool's schema, and
|
|
566
|
+
the card prefers it:
|
|
567
|
+
|
|
568
|
+
```json
|
|
569
|
+
{ "id": "int-1", "reason": "tool_call", "toolCallId": "call-1",
|
|
570
|
+
"message": "Approve create_event({\"title\": \"Design sync\"})?",
|
|
571
|
+
"metadata": { "x-confirm": "Book Design sync on Friday at 14:00?" } }
|
|
572
|
+
```
|
|
573
|
+
|
|
574
|
+
Anything non-string or blank under that key is ignored in favour of `message`, and with neither the
|
|
575
|
+
card falls back to `strings.approvalPrompt`.
|
|
576
|
+
|
|
577
|
+
**The card approves or denies, and nothing else.** The interrupt's `responseSchema` also advertises
|
|
578
|
+
`editedArgs` and `reason` — the protocol allows a client to rewrite a gated call's arguments before
|
|
579
|
+
letting it run. The built-in card does not offer that; a host that wants it can implement
|
|
580
|
+
`approvalRenderer` and resolve the interrupt itself.
|
|
581
|
+
|
|
582
|
+
**A gated write is still a write the page cannot see.** Approving one runs a *server-side* tool, so
|
|
583
|
+
if your page renders the data it touched, listen for
|
|
584
|
+
[`ag-ui-run-finished`](#host-seams-the-spa-story) and refetch.
|
|
585
|
+
|
|
523
586
|
Like the question card, the approval card is customizable at three levels: **text** (`strings`:
|
|
524
587
|
`approveAction` / `approvalPrompt` / `approve` / `deny`), **CSS** (`::part()`: `approval`,
|
|
525
588
|
`approval-body`, `approval-actions`, `approval-button`, `approval-approve`, `approval-deny`), and
|
|
@@ -648,11 +711,33 @@ want — so you control the agent's interaction surface:
|
|
|
648
711
|
```
|
|
649
712
|
|
|
650
713
|
- **`scroll_to`** — scroll a target into view. `target` is `"top"`, `"bottom"`, or a CSS selector
|
|
651
|
-
/ page-map element id. Read-only (no confirmation).
|
|
714
|
+
/ page-map element id. Read-only (no confirmation). It centres the target **vertically** and
|
|
715
|
+
brings it into view **horizontally** (`inline: "nearest"`), so on a two-axis surface a
|
|
716
|
+
horizontal target lands at the near edge rather than in the middle. In view is the contract;
|
|
717
|
+
"centred" is not, in that axis.
|
|
652
718
|
- **`drag_and_drop`** — drag the `from` element onto the `to` element (selectors / page-map ids),
|
|
653
719
|
firing the standard HTML5 drag sequence (`dragstart` → `dragenter`/`dragover`/`drop` → `dragend`)
|
|
654
720
|
so the page's own drop handler reacts. Useful for reordering sortable lists.
|
|
655
721
|
|
|
722
|
+
**Your drag surface must listen to drag events, and many "modern" ones do not.** `drag_and_drop`
|
|
723
|
+
dispatches the native HTML5 sequence with one shared `DataTransfer`. A surface built on a
|
|
724
|
+
pointer-event drag library — dnd-kit, most React DnD packages, the Angular CDK — listens to
|
|
725
|
+
`pointerdown`/`pointermove` and **never sees any of it**: the agent's drag is a silent no-op that
|
|
726
|
+
still reports success. Either use the native API or pick a library that listens to drag events.
|
|
727
|
+
React's synthetic `onDrop` does receive the dispatched sequence, `DataTransfer` included.
|
|
728
|
+
|
|
729
|
+
**A page action reports that it fired, not that it worked.** `drag_and_drop` returns as soon as the
|
|
730
|
+
sequence is dispatched; whether your drop handler's save succeeded is invisible to it, so a refused
|
|
731
|
+
change still looks like a successful tool call. Two things follow. Have the page report its own
|
|
732
|
+
refusals somewhere the agent can read them, and have the agent re-read the page before claiming
|
|
733
|
+
anything. Where the outcome matters more than the gesture, call the operation as a **server tool**
|
|
734
|
+
instead — it can return the real error.
|
|
735
|
+
|
|
736
|
+
**A page that saves asynchronously should say so.** A verification read straight after a drag can
|
|
737
|
+
outrun the page's own save and conclude that nothing happened. Report a busy flag in your
|
|
738
|
+
`getPageMap` (`{ saving: true }` while a write is in flight) and the agent can wait for a page that
|
|
739
|
+
says it is busy. It cannot wait for one that does not.
|
|
740
|
+
|
|
656
741
|
Targets resolve through the overridable `resolvePageTarget` property — `(target) => HTMLElement |
|
|
657
742
|
null`, defaulting to `document.querySelector`. A host with a page map overrides it to map its own
|
|
658
743
|
element ids (the same way the DOM-driver primitives are wrapped with environment-aware lookups):
|
|
@@ -784,7 +869,7 @@ A gated call carries the decision (`approved by you` / `declined by you`, part
|
|
|
784
869
|
from the server-side approval interrupt alike. The prompt itself disappears once answered: a
|
|
785
870
|
prompt and a record are different objects, and the record is the card.
|
|
786
871
|
|
|
787
|
-
|
|
872
|
+
**The annotation is session-scoped**, like the "run interrupted" notice. AG-UI carries no
|
|
788
873
|
approval message — the answer rides `resume[]` as transient run input — so a reload restores the
|
|
789
874
|
tool call and its result but not the note that a human waved it through. If you need "who
|
|
790
875
|
approved what" durably, that is an audit concern rather than a transcript one; record it
|
|
@@ -827,14 +912,14 @@ is what positions the grip.
|
|
|
827
912
|
A drag writes `--ag-ui-width` / `--ag-ui-height` on the host as custom
|
|
828
913
|
properties.
|
|
829
914
|
|
|
830
|
-
|
|
915
|
+
**That alone does not leave placement in charge** — an inline custom property
|
|
831
916
|
still outranks a `:host([placement=…])` rule setting the same property. So the
|
|
832
917
|
component enforces the split directly: **a placement owns the axes it fixes**,
|
|
833
918
|
and a dragged or persisted size is only ever applied to the ones it leaves free.
|
|
834
919
|
Switching placement hands the owned axes back. Without that, a height dragged
|
|
835
920
|
while floating capped a docked sidebar that had asked for `100vh`.
|
|
836
921
|
|
|
837
|
-
|
|
922
|
+
**A host rule that sizes the element wins over both.** `ag-ui-chat { flex: 1 }`
|
|
838
923
|
stretches the panel to its container and the dragged width has no visible
|
|
839
924
|
effect — which reads as a broken control rather than as your stylesheet winning.
|
|
840
925
|
Give the element `flex: 0 1 auto` (plus `max-width: 100%`) if it lives in a flex
|
|
@@ -1027,6 +1112,13 @@ acts, the next round already sees the resulting page. Within a round the agent c
|
|
|
1027
1112
|
view at any time with the built-in `read_page` tool, which is registered whenever this provider is
|
|
1028
1113
|
set.
|
|
1029
1114
|
|
|
1115
|
+
**Check that your server reads `context` at all — pydantic-ai's AG-UI adapter does not.** The
|
|
1116
|
+
auto-injected `page_map` rides in `RunAgentInput.context`, and an adapter that ignores that field
|
|
1117
|
+
drops it silently: nothing errors, and the model simply never sees the page. On such a backend
|
|
1118
|
+
`read_page` is the channel that works, and it is the one to rely on. Nothing to configure — just do
|
|
1119
|
+
not assume the injected copy arrived, and if the page map matters to your prompt, put it there
|
|
1120
|
+
server-side or let the agent call `read_page`.
|
|
1121
|
+
|
|
1030
1122
|
That leaves one window: the page can move *after* a round's context was built but *before* the
|
|
1031
1123
|
agent's tool call arrives — the user clicks a link, or presses back. Calls landing in that window
|
|
1032
1124
|
are **refused** with a result telling the agent to call `read_page` and retry. Most would have
|
|
@@ -1096,6 +1188,34 @@ chat.navigate = (path) => router.push(path); // SPA: in-page, no reload
|
|
|
1096
1188
|
|
|
1097
1189
|
Route map + `navigate()` and the reload model are the same feature seen from two ends.
|
|
1098
1190
|
|
|
1191
|
+
**`ag-ui-run-finished`** *(event)* — an interaction has ended, and here is what ran in it.
|
|
1192
|
+
`detail: { tools: readonly ToolRun[] }` (typed `RunFinishedDetail`), where each `ToolRun` is
|
|
1193
|
+
`{ name, side: "server" | "client" }` in settle order.
|
|
1194
|
+
|
|
1195
|
+
**This is the seam for a host that renders data the agent can change.** A server-side tool writes
|
|
1196
|
+
without your page's knowledge: nothing else the element dispatches implies "something may have moved
|
|
1197
|
+
underneath you", so a page that fetched its data on mount has no reason to refetch and quietly goes
|
|
1198
|
+
stale. Approve a server-side booking on a calendar and the row exists while the calendar keeps
|
|
1199
|
+
showing the week it loaded.
|
|
1200
|
+
|
|
1201
|
+
```js
|
|
1202
|
+
chat.addEventListener("ag-ui-run-finished", (e) => {
|
|
1203
|
+
// A "client" tool ran in your own handler, so you already know what it did.
|
|
1204
|
+
if (e.detail.tools.some((tool) => tool.side === "server")) {
|
|
1205
|
+
void refetchBoard();
|
|
1206
|
+
}
|
|
1207
|
+
});
|
|
1208
|
+
```
|
|
1209
|
+
|
|
1210
|
+
It fires **once per interaction**, not once per tool round, and it fires on completion, error and
|
|
1211
|
+
cancellation alike — a partial write is still a write. A capability load (an agent skill activating)
|
|
1212
|
+
is not counted: it moves nothing a host renders.
|
|
1213
|
+
|
|
1214
|
+
`sharedState` above is the richer channel and this is not a replacement for it — but it is not a
|
|
1215
|
+
substitute the other way round either, because shared state requires the *agent* to emit
|
|
1216
|
+
`STATE_SNAPSHOT`, which is not the host's decision to make. Use state when the two ends edit one
|
|
1217
|
+
object; use this when your page owns the data and just needs to know it moved.
|
|
1218
|
+
|
|
1099
1219
|
## Resuming a run
|
|
1100
1220
|
|
|
1101
1221
|
When the server persists run checkpoints (django-ag-ui's `step_store`), a run
|
|
@@ -1149,7 +1269,7 @@ error — a history affordance that fails is empty, not broken.
|
|
|
1149
1269
|
## File uploads
|
|
1150
1270
|
|
|
1151
1271
|
Set **`data-attachments-url`** (django-ag-ui's `AttachmentsView`) to let the user attach files
|
|
1152
|
-
to a message. A
|
|
1272
|
+
to a message. A button and drag-and-drop appear on the composer; each picked file uploads
|
|
1153
1273
|
out-of-band (multipart, with the element's `headers`) and shows a chip in a pending tray —
|
|
1154
1274
|
`uploading` (with a progress bar) → `ready`, or `error` with a retry. On send, the ready files'
|
|
1155
1275
|
**refs** ride on the user bubble as read-only chips and the agent reads their contents
|
|
@@ -1178,7 +1298,7 @@ See [Authenticating requests](#authenticating-requests).
|
|
|
1178
1298
|
`uploadHandler`. Set your own to use a different transport — a resumable
|
|
1179
1299
|
[`tus-js-client`](https://github.com/tus/tus-js-client) adapter, direct-to-S3 multipart, etc.
|
|
1180
1300
|
— without touching the tray, the chips, or the AG-UI wire (refs are transport-agnostic). The
|
|
1181
|
-
handler is `(file, onProgress) => Promise<AttachmentRef>`; when set, the
|
|
1301
|
+
handler is `(file, onProgress) => Promise<AttachmentRef>`; when set, the affordance appears
|
|
1182
1302
|
even with no `data-attachments-url`, and your handler owns its own endpoint and headers:
|
|
1183
1303
|
|
|
1184
1304
|
```js
|
|
@@ -1256,6 +1376,7 @@ re-export point. Internal modules import from leaf paths.
|
|
|
1256
1376
|
| `createPageStateTools(binding)` | function | Build `read_<name>` / `set_<name>` tools. |
|
|
1257
1377
|
| `PageState` | type | A page-state binding declaration. |
|
|
1258
1378
|
| `Skill` | type | A launchable prompt (chip / `/`-command). |
|
|
1379
|
+
| `RunFinishedDetail` / `ToolRun` | type | `ag-ui-run-finished` detail: the tools an interaction ran, and which side ran them. |
|
|
1259
1380
|
|
|
1260
1381
|
### Durability
|
|
1261
1382
|
|
|
@@ -1307,10 +1428,11 @@ re-export point. Internal modules import from leaf paths.
|
|
|
1307
1428
|
| `SUBMIT_EVENT` | The submit CustomEvent name. |
|
|
1308
1429
|
| `TOGGLE_EVENT` | The collapse-toggle CustomEvent name (`ag-ui-toggle`). |
|
|
1309
1430
|
| `UNREAD_EVENT` | The unread-count CustomEvent name (`ag-ui-unread`). |
|
|
1431
|
+
| `RUN_FINISHED_EVENT` | The interaction-finished CustomEvent name (`ag-ui-run-finished`). |
|
|
1310
1432
|
| `MESSAGE_ROLE` | Message role constants. |
|
|
1311
1433
|
| `TOOL_CALL_STATUS` | Tool-call card status constants. |
|
|
1312
1434
|
| `TOOL_DISPLAY` | Tool-call display-mode constants (`minimal` / `compact` / `full`). |
|
|
1313
|
-
| `X_CONFIRM_KEY` |
|
|
1435
|
+
| `X_CONFIRM_KEY` | Confirmation-prompt key: on a tool's JSON Schema for a client-side confirmation, and in an AG-UI interrupt's `metadata` for a server-side approval. |
|
|
1314
1436
|
| `X_SUMMARY_KEY` | JSON-Schema key carrying a short tool-card label. |
|
|
1315
1437
|
| `MAX_TOOL_ROUNDS` | Upper bound on tool-call → re-run rounds per send. |
|
|
1316
1438
|
| `VERSION` | The package version string. |
|
|
@@ -1402,6 +1524,15 @@ have to hand-tune the variables:
|
|
|
1402
1524
|
`embedded`. `embedded` drops the fixed positioning and z-index so the widget sits in normal
|
|
1403
1525
|
document flow; `page` is a full-screen [centred reading column](#page-placement).
|
|
1404
1526
|
|
|
1527
|
+
**`embedded` fills the box your page gives it, so give it one.** It is the placement app-shell
|
|
1528
|
+
layouts reach for, and a grid or flex item defaults to `min-height: auto` — which lets a growing
|
|
1529
|
+
transcript push the composer off the bottom of the window instead of scrolling inside the panel. The
|
|
1530
|
+
fix belongs to the containing element, not to the widget:
|
|
1531
|
+
|
|
1532
|
+
```css
|
|
1533
|
+
.assistant-pane { min-height: 0; overflow: hidden; } /* the box the element is given */
|
|
1534
|
+
```
|
|
1535
|
+
|
|
1405
1536
|
```html
|
|
1406
1537
|
<ag-ui-chat endpoint="/agent/" theme="dark" density="compact" placement="side"></ag-ui-chat>
|
|
1407
1538
|
```
|
|
@@ -1409,7 +1540,7 @@ have to hand-tune the variables:
|
|
|
1409
1540
|
See [`src/ui/styles.ts`](src/ui/styles.ts) for the full variable + preset list. The
|
|
1410
1541
|
[`demo/`](demo/) live playground (`node demo/mock-server.mjs`) flips theme, density, placement,
|
|
1411
1542
|
text-animation, tool-display, and the answer well live from a single page, and demos the
|
|
1412
|
-
streamed thoughts region, the
|
|
1543
|
+
streamed thoughts region, the mic, and the header theme toggle.
|
|
1413
1544
|
|
|
1414
1545
|
### Parts and slots
|
|
1415
1546
|
|