@artooi/ag-ui-web-component 0.2.0 → 0.2.2
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 +55 -1
- package/README.md +15 -5
- package/dist/ag-ui-web-component.bundle.js +28 -25
- package/dist/ag-ui-web-component.bundle.js.map +3 -3
- package/dist/core/ag_ui_chat.d.ts +9 -0
- package/dist/core/ag_ui_chat.d.ts.map +1 -1
- package/dist/core/agui_client.d.ts +13 -0
- package/dist/core/agui_client.d.ts.map +1 -1
- package/dist/index.js +118 -23
- package/dist/index.js.map +2 -2
- package/dist/tools/route_map.d.ts.map +1 -1
- package/dist/tools/state_hook.d.ts.map +1 -1
- package/dist/ui/styles.d.ts +1 -1
- package/dist/ui/styles.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/core/ag_ui_chat.ts +116 -18
- package/src/core/agui_client.ts +18 -0
- package/src/tools/route_map.ts +3 -2
- package/src/tools/state_hook.ts +12 -3
- package/src/ui/styles.ts +4 -1
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,58 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.2.2] — 2026-06-02
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **Friendly tool-call card labels.** The built-in tools now carry `x-summary`
|
|
14
|
+
labels (`navigate_to_route` → "Navigate", `list_routes` → "List pages",
|
|
15
|
+
`read_page` → "Read the page", state-hook `read_*`/`set_*` → "Read/Update
|
|
16
|
+
<name>"). For tools whose schema never reaches the browser — **server-side
|
|
17
|
+
tools** (drf-mcp, `@tool` registry) — a new `toolSummaries: Record<string,
|
|
18
|
+
string>` property maps tool name → label as a fallback (e.g.
|
|
19
|
+
`chat.toolSummaries = { list_projects: "Search projects" }`).
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
- A tool call that ends with **no client handler and no `TOOL_CALL_RESULT`** now
|
|
23
|
+
settles the card as **"No result returned."** instead of the misleading
|
|
24
|
+
"Executed on the server." (nothing executed it).
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
- **Incoming-text animations no longer double-fire.** Two distinct cases:
|
|
28
|
+
- *End of stream:* `data-text-animation="word"` wrapped the finished assistant
|
|
29
|
+
message into staggered `.word` spans on `TEXT_MESSAGE_END`, so a response
|
|
30
|
+
that had already streamed in re-animated itself one word at a time. The word
|
|
31
|
+
reveal now runs only when a message arrives **at once** (single text delta,
|
|
32
|
+
or an error bubble); a message streamed across multiple deltas keeps its
|
|
33
|
+
progressive reveal and isn't re-wrapped.
|
|
34
|
+
- *Reload from memory:* on rehydrate the whole transcript mounts at once, so
|
|
35
|
+
every restored assistant bubble animated its text in parallel (fade) or
|
|
36
|
+
re-wrapped word-by-word — wrong, since it's old content, not arriving. Restored
|
|
37
|
+
bubbles are now marked `message--restored`, excluded from the fade entrance
|
|
38
|
+
animation and never word-wrapped, so history appears statically.
|
|
39
|
+
|
|
40
|
+
## [0.2.1] — 2026-06-02
|
|
41
|
+
|
|
42
|
+
### Added
|
|
43
|
+
- **Server-side tool results in the card.** The element now subscribes to
|
|
44
|
+
AG-UI's `TOOL_CALL_RESULT` event and settles the matching tool-call card with
|
|
45
|
+
the real server output (honouring the `data-tool-display` mode), instead of
|
|
46
|
+
the generic "Executed on the server." placeholder — which remains only as a
|
|
47
|
+
fallback when no result event is streamed.
|
|
48
|
+
- **Tool calls and results survive a page refresh.** History replay now
|
|
49
|
+
reconstructs tool-call cards (from assistant `toolCalls`) and settles them
|
|
50
|
+
from the persisted `tool` result messages, so a rehydrated transcript shows
|
|
51
|
+
the full tool activity, not just the prose. Applies to every conversation
|
|
52
|
+
store (the data was already persisted; only the replay was incomplete).
|
|
53
|
+
|
|
54
|
+
### Fixed
|
|
55
|
+
- **Pending indicator could hang after a server-only round.** A round whose
|
|
56
|
+
tool calls were all server-side re-showed the "thinking" indicator after the
|
|
57
|
+
run had already finished, leaving it stuck. The indicator is no longer shown
|
|
58
|
+
speculatively for server tools, and a terminal `onSettled` guarantee clears
|
|
59
|
+
it (and re-enables input) on every run-loop exit — including the
|
|
60
|
+
`MAX_TOOL_ROUNDS` ceiling and errors.
|
|
61
|
+
|
|
10
62
|
## [0.2.0] — 2026-06-02
|
|
11
63
|
|
|
12
64
|
### Added
|
|
@@ -107,7 +159,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
107
159
|
### Notes
|
|
108
160
|
- First release — exercising the automated npm OIDC publish pipeline end-to-end.
|
|
109
161
|
|
|
110
|
-
[Unreleased]: https://github.com/Artui/ag-ui-web-component/compare/v0.2.
|
|
162
|
+
[Unreleased]: https://github.com/Artui/ag-ui-web-component/compare/v0.2.2...HEAD
|
|
163
|
+
[0.2.2]: https://github.com/Artui/ag-ui-web-component/compare/v0.2.1...v0.2.2
|
|
164
|
+
[0.2.1]: https://github.com/Artui/ag-ui-web-component/compare/v0.2.0...v0.2.1
|
|
111
165
|
[0.2.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.1.1...v0.2.0
|
|
112
166
|
[0.1.1]: https://github.com/Artui/ag-ui-web-component/compare/v0.1.0...v0.1.1
|
|
113
167
|
[0.1.0]: https://github.com/Artui/ag-ui-web-component/releases/tag/v0.1.0
|
package/README.md
CHANGED
|
@@ -158,8 +158,14 @@ That's the whole integration: an `endpoint` attribute pointing at your AG-UI ser
|
|
|
158
158
|
|
|
159
159
|
**Properties** (JS only, not attributes): `headers`, `autoConfirm`, `confirmPredicate`,
|
|
160
160
|
`agentFactory`, `getTools`, `getContext`, `routeMap`, `navigate`, `getPageMap`,
|
|
161
|
-
`autoInjectPageMap`, `conversationStore`, `navigationResult`, `skillContext`,
|
|
162
|
-
`endpoint` / `toolDisplay` / `collapsed`.
|
|
161
|
+
`autoInjectPageMap`, `conversationStore`, `navigationResult`, `skillContext`, `toolSummaries`,
|
|
162
|
+
plus the mirrors `endpoint` / `toolDisplay` / `collapsed`.
|
|
163
|
+
|
|
164
|
+
`toolSummaries` is a `Record<string, string>` mapping tool name → a friendly card
|
|
165
|
+
label, used when a tool has no `x-summary` in its own schema. Built-in and client tools
|
|
166
|
+
should carry `x-summary` directly; this map is the seam for **server-side tools** (drf-mcp,
|
|
167
|
+
the django-ag-ui `@tool` registry), whose schema never reaches the browser — e.g.
|
|
168
|
+
`chat.toolSummaries = { list_projects: "Search projects" }`.
|
|
163
169
|
|
|
164
170
|
**Methods**: `registerTool`, `registerStateHook`, `setSkills`, `appendMessage`, `newChat`,
|
|
165
171
|
`setCollapsed`, `toggleCollapsed`.
|
|
@@ -185,8 +191,10 @@ an AG-UI `AbstractAgent`. On the first send the element builds a client (via the
|
|
|
185
191
|
4. This repeats until the agent stops calling frontend tools, bounded by `MAX_TOOL_ROUNDS`.
|
|
186
192
|
|
|
187
193
|
Tool calls the client doesn't own (server-side tools the server already executed) are left alone —
|
|
188
|
-
the loop doesn't re-run them
|
|
189
|
-
(
|
|
194
|
+
the loop doesn't re-run them, but their streamed `TOOL_CALL_RESULT` is rendered into the tool-call
|
|
195
|
+
card (honouring `data-tool-display`), so server-side output is visible too. The current tool catalog
|
|
196
|
+
and context are read **fresh on every run** (`getTools()` / `getContext()`), so they always reflect
|
|
197
|
+
the current page state.
|
|
190
198
|
|
|
191
199
|
### Registering tools
|
|
192
200
|
|
|
@@ -406,7 +414,9 @@ history endpoint) for cross-tab/device durability:
|
|
|
406
414
|
chat.conversationStore = new MyServerBackedStore();
|
|
407
415
|
```
|
|
408
416
|
|
|
409
|
-
On mount the element rehydrates the transcript from the store, so the chat looks continuous
|
|
417
|
+
On mount the element rehydrates the transcript from the store, so the chat looks continuous —
|
|
418
|
+
including tool-call cards and their results (reconstructed from the persisted `toolCalls` and `tool`
|
|
419
|
+
messages), not just the text turns.
|
|
410
420
|
|
|
411
421
|
**3. Resumable loop (`x-navigates` + `navigationResult`).** A tool whose schema carries
|
|
412
422
|
`x-navigates: true` (use `X_NAVIGATES_KEY`; read back by [`isNavigates`](src/tools/is_navigates.ts))
|