@artooi/ag-ui-web-component 0.17.0 → 0.19.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 CHANGED
@@ -7,6 +7,116 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.19.0] — 2026-08-11
11
+
12
+ ### Changed
13
+
14
+ - **A tool card's arguments and its result are now two labelled regions, not one
15
+ block.** Compact mode emitted `args: {...}` and the result into a single
16
+ `<pre>` separated by a blank line, with nothing marking where the call ended
17
+ and the answer began. Both payloads now have their own heading, their own
18
+ `part` (`tool-card-args` / `tool-card-result`, headings via
19
+ `tool-card-section-label`, body via `tool-card-body`), and are pretty-printed.
20
+
21
+ ⚠ Breaking for anyone styling `tool-card-result` as a single combined block.
22
+ A call with no arguments no longer renders an empty `{}` in a box of its own.
23
+
24
+ - ⭐ **`data-tool-display` is now live.** Changing it restyles every card already
25
+ in the transcript, the way `data-answer-well` always has. The modes are pure
26
+ visibility over **one DOM shape**, selected by the shadow CSS from the host
27
+ attribute; previously each card baked its structure at construction from the
28
+ value read at that moment, so a change reached only cards created afterwards
29
+ and the setting appeared not to work until the next conversation.
30
+
31
+ `ToolCallCard`'s constructor consequently no longer takes a mode argument.
32
+
33
+ - **The confirmation card leaves once it is answered.** It stayed in the
34
+ transcript as a spent form with its buttons disabled, which read as an
35
+ outstanding question rather than a settled one. A prompt and a record are
36
+ different objects: the record is the tool card it gates, which settles to the
37
+ outcome and scrolls with the rest of the transcript.
38
+
39
+ - ⛔ **The confirmation card was appended to the wrong parent**, and it is the
40
+ reason it drifted to the foot of a turn. Every other inline card — tool,
41
+ approval, `ask_user`, run notices — goes into the turn's answer group; this
42
+ one went into the message list, so it became a sibling *after* the group and
43
+ anything that streamed afterwards rendered above it. It now joins the group
44
+ like its siblings.
45
+
46
+ ### Added
47
+
48
+ - **A gated call records the decision.** The tool card carries `approved by you`
49
+ / `declined by you` (part `tool-card-decision`, attribute `data-decision`).
50
+ Previously only a *refusal* left a trace — an approved call simply ran, making
51
+ a gated call's transcript identical to one that was never gated.
52
+
53
+ - **Each header control takes its own icon slot** — `icon-history`,
54
+ `icon-checkpoints`, `icon-new`, `icon-collapse` — with the built-in glyph as
55
+ the fallback, so existing embeds are unchanged. The glyph used to be the
56
+ button's own `textContent`: a host could restyle a control through its `part`,
57
+ or swap one character for another with a CSS `content` override, but could
58
+ never supply a brand `<img>` or `<svg>`.
59
+
60
+ - **`argumentsLabel`, `decisionApproved` and `decisionDeclined`** in `UiStrings`.
61
+ `resultLabel` / `errorLabel` / `declinedLabel` are now the result region's
62
+ heading rather than a toggle label, and `details` labels the toggle in every
63
+ mode.
64
+
65
+ ### Fixed
66
+
67
+ - **The demo harness reused message ids**, which produced three symptoms that
68
+ all read as component bugs and were none of them. It streamed every follow-up
69
+ answer under a hardcoded id, and `@ag-ui/client` appends to a message id
70
+ already in its history rather than starting a new one — so repeating a prompt
71
+ grew a single entry, that entry replayed out of order after a reload (sitting
72
+ where it was first created, with the later prompts after it), and the
73
+ unfinished-run notice then fired correctly over the corrupted history. Fresh
74
+ ids per message, as a real server issues.
75
+
76
+ ## [0.18.0] — 2026-08-10
77
+
78
+ ### Added
79
+
80
+ - **A copy button on code blocks in agent answers.** An agent answering with
81
+ code is answering with something the reader means to *use*, and selecting it
82
+ by hand out of a scrolling transcript — inside a shadow root, in a narrow
83
+ sidebar — was the one interaction the chat surface made harder than the page
84
+ around it.
85
+
86
+ Revealed on hover **and keyboard focus** (hidden-until-hover is invisible to a
87
+ keyboard user), styleable via the `code-copy` part, with `copyCode` /
88
+ `copied` / `copyFailed` in `UiStrings`.
89
+
90
+ ⚠ **It reports failure rather than always claiming success.** The Clipboard
91
+ API needs a secure context and is simply absent in some embeddings; a button
92
+ that always says "Copied" sends the reader off to paste stale clipboard
93
+ content and find out somewhere else entirely.
94
+
95
+ ### Fixed
96
+
97
+ - **A bare `data-prompt-chips` or `data-slash-commands` now enables the
98
+ feature**, instead of silently disabling it. Both were compared against the
99
+ string `"true"`, so writing the attribute bare — the spelling every native
100
+ boolean attribute uses, and the one a reader reaches for first — turned off
101
+ the thing it names, with nothing to indicate why the chips never appeared.
102
+ `="false"` still turns them off.
103
+
104
+ - **The checkpoint panel manages focus.** It declared `role="dialog"` and took
105
+ no focus at all, so a keyboard user was left behind an open dialog; the thread
106
+ drawer had done this correctly all along. Focus now moves in on open, is
107
+ restored on close, and Tab is trapped while it is open.
108
+
109
+ ⚠ **With no continuable runs the panel holds no controls**, so the panel
110
+ itself is focusable as the fallback — otherwise "move focus to the first
111
+ control" silently does nothing in exactly the case where the user has least to
112
+ go on.
113
+
114
+ - **The README described a `dist/ag-ui-web-component.bundle.css` that the build
115
+ has never emitted.** The styles are a template literal injected into the
116
+ shadow root, so there is no sidecar to load — and a reader looking for the
117
+ file to override was looking for the wrong seam. Documented as CSS custom
118
+ properties and `part` attributes instead.
119
+
10
120
  ## [0.17.0] — 2026-08-10
11
121
 
12
122
  ### Added
@@ -833,7 +943,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
833
943
  ### Notes
834
944
  - First release — exercising the automated npm OIDC publish pipeline end-to-end.
835
945
 
836
- [Unreleased]: https://github.com/Artui/ag-ui-web-component/compare/v0.17.0...HEAD
946
+ [Unreleased]: https://github.com/Artui/ag-ui-web-component/compare/v0.19.0...HEAD
947
+ [0.19.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.18.0...v0.19.0
948
+ [0.18.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.17.0...v0.18.0
837
949
  [0.17.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.16.0...v0.17.0
838
950
  [0.16.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.15.0...v0.16.0
839
951
  [0.15.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.14.1...v0.15.0
package/README.md CHANGED
@@ -150,8 +150,8 @@ That's the whole integration: an `endpoint` attribute pointing at your AG-UI ser
150
150
  | `title-text` | — | Header label; defaults to `"Assistant"`. The only **observed** attribute (live-updates the header). |
151
151
  | `data-tool-display` | `toolDisplay` | Tool-call card detail: `inline` / `minimal` / `compact` / `full` (default `full`). |
152
152
  | `data-text-animation` | — | Incoming-text reveal: `none` (default) / `fade` / `word`. |
153
- | `data-prompt-chips` | — | `"true"` to surface skills as chips. |
154
- | `data-slash-commands` | — | `"true"` to enable the `/`-command palette. |
153
+ | `data-prompt-chips` | — | Present (bare, or any value but `"false"`) to surface skills as chips. |
154
+ | `data-slash-commands` | — | Present (bare, or any value but `"false"`) to enable the `/`-command palette. |
155
155
  | `data-skills` | — | Inline JSON skill catalog. |
156
156
  | `data-skills-url` | — | URL of a JSON skill catalog (fetched with `headers`). |
157
157
  | `data-tools-url` | — | URL of a server tool-label catalog (`[{ name, summary, description? }]`), fetched with `headers`; labels tool-call cards for server-side tools. |
@@ -164,6 +164,16 @@ That's the whole integration: an `endpoint` attribute pointing at your AG-UI ser
164
164
  | `data-theme-toggle` | — | Boolean: show a built-in header light⇄dark toggle (persists per tab). Off by default. See [Theme toggle](#theme-toggle). |
165
165
  | `data-strings` | `strings` | Partial JSON override of the UI string table (localization). The property wins key-by-key over the attribute; see [Internationalization](#internationalization-i18n). |
166
166
  | `data-icon-url` | — | Header (and sidebar-rail) icon image URL. A slotted `slot="icon"` wins; see [Header & launcher icon](#header-and-launcher-icon). |
167
+
168
+ Each header control also takes its own icon slot — `icon-history`, `icon-checkpoints`,
169
+ `icon-new`, `icon-collapse` — with the built-in glyph as the fallback, so a host can project a
170
+ brand `<img>` or `<svg>` rather than only restyling the character:
171
+
172
+ ```html
173
+ <ag-ui-chat endpoint="/agent/">
174
+ <svg slot="icon-new" width="16" height="16"><!-- ... --></svg>
175
+ </ag-ui-chat>
176
+ ```
167
177
  | `data-page-actions` | — | Opt-in built-in page-action tools: a comma list of `scroll` / `drag` (e.g. `"scroll,drag"`). See [Page-action tools](#page-action-tools). |
168
178
  | `data-side` | — | CSS-only, for `placement="sidebar"`: which edge it docks to — `right` (default) / `left`. |
169
179
  | `data-answer-well` | — | CSS-only boolean: box each assistant turn (its text, tool cards, and thinking) in one bordered "well". Off by default. See [The answer well](#the-answer-well). |
@@ -194,6 +204,10 @@ labels are fetched automatically — per card, `x-summary` → an explicit
194
204
 
195
205
  **Properties** (selected): `sharedState` — AG-UI shared state (documented under Tools & state).
196
206
 
207
+ Code blocks in an agent's answer carry a **copy button**, revealed on hover or
208
+ keyboard focus and styleable via the `code-copy` part. Override its labels with
209
+ the `copyCode` / `copied` / `copyFailed` strings.
210
+
197
211
  **Methods**: `registerTool`, `registerPageState`, `setSkills`, `sendMessage`, `attachFile`,
198
212
  `appendMessage`, `newChat`, `setCollapsed`, `toggleCollapsed`.
199
213
 
@@ -502,8 +516,23 @@ property), one of `inline` / `minimal` / `compact` / `full` (default `full`):
502
516
  result behind its own toggle. Reads as one line of the answer — pairs with [the answer
503
517
  well](#the-answer-well).
504
518
  - `minimal` — tool name + status pill only.
505
- - `compact` — name + status, with args *and* result behind a single collapsed "Details" toggle.
506
- - `full` — args inline, result behind its own toggle (the original behaviour).
519
+ - `compact` — name + status, with arguments *and* result behind a single collapsed toggle.
520
+ - `full` — arguments visible, result behind the toggle (the default).
521
+
522
+ Whichever mode is on, a settled card's body holds **two labelled regions** — `Arguments` and
523
+ `Result` (or `Error` / `Declined`) — each with its own part and each pretty-printed. They are
524
+ never run together into one block, so where the call ends and the answer begins is always
525
+ visible. Style them via the `tool-card-args` / `tool-card-result` parts, their headings via
526
+ `tool-card-section-label`, and the whole body via `tool-card-body`.
527
+
528
+ **The attribute is live.** Changing `data-tool-display` restyles every card already in the
529
+ transcript, the way `data-answer-well` does — the modes are pure visibility over one DOM shape,
530
+ selected by the shadow CSS from the host attribute.
531
+
532
+ A call gated behind the confirmation card also carries the decision (`approved by you` /
533
+ `declined by you`, part `tool-card-decision`, attribute `data-decision`). The prompt itself
534
+ disappears once answered: a prompt and a record are different objects, and the record is the
535
+ card.
507
536
 
508
537
  If a tool's schema carries an `x-summary` string (use `X_SUMMARY_KEY`), the card shows it on the
509
538
  label instead of the raw tool name.
@@ -1189,10 +1218,14 @@ This produces, into `dist/`:
1189
1218
  them.
1190
1219
  - `ag-ui-web-component.bundle.js` — the **vendored** ESM bundle, every dependency inlined and
1191
1220
  minified, suitable for direct `<script type="module">` embedding.
1192
- - `ag-ui-web-component.bundle.css` — the extracted CSS sidecar.
1193
1221
  - `index.d.ts` (+ source maps) — type declarations; emitted `.js` import specifiers are preserved
1194
1222
  so consumers resolve types without extra flags.
1195
1223
 
1224
+ There is **no CSS file to load**. The styles are a template literal injected into
1225
+ the shadow root at construction, so they ship inside the JS and cannot leak into
1226
+ the host page. Restyle through the [CSS custom properties](#theming-density-and-placement) and the
1227
+ `part` attributes, not a stylesheet override.
1228
+
1196
1229
  Other workflow targets (all identical in name to the sibling Python packages):
1197
1230
 
1198
1231
  | Target | What it does |