@artooi/ag-ui-web-component 0.35.2 → 0.37.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,115 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.37.0] — 2026-09-06
11
+
12
+ ### Fixed
13
+
14
+ - **The README attribute gate only checked one direction, so it could not see its
15
+ own weakening.** It asked whether every attribute the element *reads* is
16
+ documented; an attribute falling out of the scanned set shrinks the set being
17
+ filtered, so the answer stays empty and nothing goes red. Adding a
18
+ variable-named read and raising the declared count -- without teaching the
19
+ matcher the new helper -- dropped two attributes out of the scan and the whole
20
+ suite still passed. Verified by doing exactly that: 1651 tests green.
21
+
22
+ There is now a reverse check. It refuses a documented row that nothing
23
+ consumes, and "consumes" had to be defined carefully: four documented
24
+ attributes (`density`, `data-side`, `data-small-viewport`, `data-answer-well`)
25
+ are host-set and read by the stylesheet alone through `:host([...])`, never by
26
+ any `getAttribute` call. A first version that looked only at JavaScript called
27
+ all four stale, which would have deleted four working rows.
28
+
29
+ - **A message sent with no `endpoint` disappeared without a word.** The send path
30
+ returned early when the attribute was unset, and by then the two visible halves
31
+ of a successful send had already happened: the user's bubble was in the
32
+ transcript and `ag-ui-submit` had been dispatched. So the composer cleared, the
33
+ message appeared to go, Send never became Stop, no request was made, and
34
+ nothing at all reached the console. What that looks like is an agent ignoring
35
+ you, and what it gets reported as is a server that never answers.
36
+
37
+ The refusal stays -- there is nowhere to send to, and an agent built on an
38
+ empty endpoint would post to the current page -- but both audiences are now
39
+ told, because they need different things. A `console.error` names the missing
40
+ attribute and what to set it to, since a missing attribute is the page's
41
+ mistake and the page's author is not reading the transcript. A `not-connected`
42
+ run notice tells the reader their message went nowhere, because the honest
43
+ alternative to one muted line is an indefinite wait in front of their own
44
+ question. Both fire on every attempt rather than once: a one-shot report is the
45
+ same silence again for the second try, which is the try a puzzled user makes.
46
+
47
+ - **Picking a run to continue with an empty composer closed the panel over
48
+ nothing.** A continuation sends only the new turn -- the server supplies
49
+ everything before it from the snapshot -- so with nothing typed there was
50
+ nothing to send, and the handler returned. The row's button had already
51
+ dismissed the panel by then, so the widget visibly reacted and then did
52
+ nothing, which reads as a resume that was attempted and lost rather than one
53
+ that never started. It now says what the composer still needs, above the input
54
+ and cleared by the next keystroke, and puts the caret there.
55
+
56
+ - **A `data-strings` or `data-skills` value that would not parse was discarded
57
+ without a word.** Quoting JSON inside an HTML attribute is fiddly, and the
58
+ result of getting it wrong was indistinguishable from never having set the
59
+ attribute: the strings stayed English, or the palette came up empty, with
60
+ nothing anywhere naming the attribute. Both now warn on the console, naming
61
+ which one and what to check -- the answer `data-paste-attach` already gave for
62
+ a value it could not read. Console only: a page author's typo is not the
63
+ reader's business, nothing the reader did was refused, and the widget is still
64
+ perfectly usable without the override.
65
+
66
+ ### Changed
67
+
68
+ - The composer hint above the input is no longer only a skills affordance: it
69
+ also carries the message above. Its `skill-hint` `part` is unchanged, since
70
+ renaming a part is breaking and a second hint in the same slot would be worse
71
+ than one whose name is older than its job. Two new `UiStrings` keys,
72
+ `notConnected` and `continueNeedsTurn`, are overridable like every other.
73
+
74
+ ## [0.36.0] — 2026-09-05
75
+
76
+ ### Added
77
+
78
+ - **A tool call that failed can now say so.** `TOOL_CALL_RESULT` may carry an
79
+ optional `outcome` field -- `success`, `failed` or `denied`, read off the new
80
+ `TOOL_OUTCOME` constant -- and the card settles to *done*, *error* or
81
+ *declined* accordingly. **Absent is a success**, so every server written before
82
+ the field existed renders exactly as it did, and so does any value this release
83
+ does not recognise: a card is a claim about what happened, and not knowing a
84
+ word is not grounds for claiming failure.
85
+
86
+ Nothing in `@ag-ui/core` declares the field. AG-UI's event schemas extend a
87
+ `passthrough` base, so an unknown key survives parsing and reaches the
88
+ subscriber -- asserted in `tests/ag_ui_event_contract.test.ts`, because if that
89
+ ever stops being true every card silently goes back to claiming success.
90
+
91
+ `AgUiClientHandlers.onToolResult` gains a third parameter for it, typed
92
+ `unknown` because the protocol does not validate it; `toolStatusFromOutcome`
93
+ does the narrowing. A handler written against the two-parameter form still
94
+ satisfies the interface and still behaves as before. A **frontend** tool states
95
+ its own outcome on the `ToolExecution` it returns, since no server ran it.
96
+
97
+ ### Fixed
98
+
99
+ - **A refused tool call rendered as a successful one.** Every `TOOL_CALL_RESULT`
100
+ settled its card as *done*, whatever the server said, so a refusal arrived
101
+ green with the reason folded into its result body -- in a sibling demo, a
102
+ booking the server had declined read at a glance as a booking that was made.
103
+ `ERROR` and `DECLINED` existed and the card rendered all three distinctly; they
104
+ were simply unreachable from the server's side.
105
+
106
+ - **A reload turned every tool card green**, which was the same bug reached by a
107
+ second path and needed no server involvement at all: restoring a conversation
108
+ settled *every* historical `tool` message as *done*, so a confirmation the user
109
+ had cancelled came back as an action that went through. The outcome is now
110
+ persisted beside the tool message and read back through the same mapping the
111
+ live path uses.
112
+
113
+ It is written onto the copy handed to the store, never onto `agent.messages` --
114
+ so it does not travel back to the server on the next run -- and a store that
115
+ drops fields it does not know loses only the distinction, falling back to
116
+ *done*. `Message` does not declare the field, exactly as it does not declare
117
+ the `attachments` an upload rides on a user message.
118
+
10
119
  ## [0.35.2] — 2026-09-05
11
120
 
12
121
  ### Fixed
@@ -3432,7 +3541,9 @@ hosts that both arrange the page the way it expects.
3432
3541
  ### Notes
3433
3542
  - First release — exercising the automated npm OIDC publish pipeline end-to-end.
3434
3543
 
3435
- [Unreleased]: https://github.com/Artui/ag-ui-web-component/compare/v0.35.2...HEAD
3544
+ [Unreleased]: https://github.com/Artui/ag-ui-web-component/compare/v0.37.0...HEAD
3545
+ [0.37.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.36.0...v0.37.0
3546
+ [0.36.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.35.2...v0.36.0
3436
3547
  [0.35.2]: https://github.com/Artui/ag-ui-web-component/compare/v0.35.1...v0.35.2
3437
3548
  [0.35.1]: https://github.com/Artui/ag-ui-web-component/compare/v0.35.0...v0.35.1
3438
3549
  [0.35.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.34.0...v0.35.0
package/README.md CHANGED
@@ -173,14 +173,14 @@ another origin, add `credentials="include"` too; see
173
173
 
174
174
  | Attribute | Property | Notes |
175
175
  | --- | --- | --- |
176
- | `endpoint` | `endpoint` | The AG-UI endpoint URL. Required to send. Reflecting getter + setter. |
176
+ | `endpoint` | `endpoint` | The AG-UI endpoint URL. Required to send: without it a send is refused with a `console.error` naming the missing attribute and a `not-connected` run notice in the transcript. Reflecting getter + setter. |
177
177
  | `credentials` | `credentials` | Cookie policy for every request the element makes: `omit` / `same-origin` / `include`. Unset means the browser default (`same-origin`), which sends no cookies cross-origin. See [Authenticating requests](#authenticating-requests). |
178
178
  | `title-text` | — | Header label; defaults to `"Assistant"`. Live: writing it after the element connects re-labels the header. See [When each attribute is read](#when-each-attribute-is-read). |
179
179
  | `data-tool-display` | `toolDisplay` | Tool-call card detail: `inline` / `minimal` / `compact` / `full` (default `full`). |
180
180
  | `data-text-animation` | — | Incoming-text reveal: `none` (default) / `fade` / `word`. |
181
181
  | `data-prompt-chips` | — | Present (bare, or any value but `"false"`) to surface skills as chips. |
182
182
  | `data-slash-commands` | — | Present (bare, or any value but `"false"`) to enable the `/`-command palette. |
183
- | `data-skills` | — | Inline JSON skill catalog. |
183
+ | `data-skills` | — | Inline JSON skill catalog. A value that will not parse is ignored and reported on the console, rather than reading as an empty catalog. |
184
184
  | `data-skills-url` | — | URL of a JSON skill catalog (fetched with the element's headers and cookie policy). |
185
185
  | `data-tools-url` | — | URL of a server tool-label catalog (`[{ name, summary, description? }]`), fetched with the element's headers and cookie policy; labels tool-call cards for server-side tools. |
186
186
  | `user-key` | `userKey` | Who the stored conversation belongs to — any string identifying the signed-in principal. Joins the storage namespace, and **changing it purges what the previous principal left behind**. Live (not connect-time): a logout is the host's to announce. See [Who the stored conversation belongs to](#who-the-stored-conversation-belongs-to-user-key). |
@@ -192,7 +192,7 @@ another origin, add `credentials="include"` too; see
192
192
  | `data-attachment-max-bytes` | — | Client-side upload size cap in bytes (default 10 MiB; `0` disables). The server stays authoritative. |
193
193
  | `data-transcribe-url` | — | URL of the voice-transcription endpoint (django-ag-ui's `TranscribeView`); reveals the composer's mic button. See [Voice input](#voice-input). |
194
194
  | `data-theme-toggle` | — | Boolean: show a built-in header light⇄dark toggle (persists per tab). Off by default. See [Theme toggle](#theme-toggle). |
195
- | `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). |
195
+ | `data-strings` | `strings` | Partial JSON override of the UI string table (localization). The property wins key-by-key over the attribute; a value that will not parse is ignored and reported on the console. See [Internationalization](#internationalization-i18n). |
196
196
  | `data-icon-url` | — | Header (and launcher) icon image URL. A slotted `slot="icon"` wins; see [Header & launcher icon](#header-and-launcher-icon). |
197
197
  | `data-launcher-icon-url` | — | Icon image URL for the collapsed launcher only, when it should differ from the header's. Falls back to `data-icon-url`; a slotted `slot="launcher"` wins over both. |
198
198
  | `data-unread-badge` | — | **On by default.** `="false"` hides the launcher's unread badge; the count and the `ag-ui-unread` event keep running. See [Collapsing to the launcher](#collapsing-to-the-launcher). |
@@ -555,6 +555,38 @@ card (honouring `data-tool-display`), so server-side output is visible too. The
555
555
  and context are read **fresh on every run** (`getTools()` / `getContext()`), so they always reflect
556
556
  the current page state.
557
557
 
558
+ #### A tool call that failed
559
+
560
+ A `TOOL_CALL_RESULT` may carry an optional **`outcome`** field saying how the call ended. It takes
561
+ pydantic-ai's own `ToolReturnPart` vocabulary — read the values off `TOOL_OUTCOME`:
562
+
563
+ | `outcome` | Card | Means |
564
+ | --- | --- | --- |
565
+ | *(absent)* | done | A result, said the way every server has always said it. |
566
+ | `success` | done | The same thing, stated. |
567
+ | `failed` | error | The call ran and failed. |
568
+ | `denied` | declined | A person or a guard refused it, so it never ran. |
569
+
570
+ **Absent is a success, and anything unrecognised is too** — including a value from a later protocol
571
+ version, and pydantic-ai's own `interrupted`. A card is a claim about what happened, and refusing to
572
+ recognise a word is not grounds for claiming failure. So no server has to change to keep the
573
+ rendering it has today, and a server that adds the field gets the truth on screen instead of a
574
+ green card with a refusal folded inside it.
575
+
576
+ Nothing in `@ag-ui/core` needs to declare the field: AG-UI's event schemas are zod `passthrough`, so
577
+ an unknown key survives parsing and reaches the subscriber. It arrives on
578
+ `AgUiClientHandlers.onToolResult` as an optional third argument, typed `unknown` because the
579
+ protocol does not validate it; `toolStatusFromOutcome` does the narrowing.
580
+
581
+ A **frontend** tool never streams this event — the client posts its own result — so its outcome is
582
+ recorded on the `ToolExecution` the executor returns (`{ content, outcome: "denied" }`). That covers
583
+ the two refusals the component makes itself: a confirmation card the user declined, and a call
584
+ blocked because the page moved under the round.
585
+
586
+ Either way the outcome is **persisted beside the tool message**, so a reload replays the card as it
587
+ settled rather than as a plain result. See
588
+ [MPA durability](#mpa-durability-surviving-full-page-reloads).
589
+
558
590
  The catalog a run advertises is also the set that run can execute. Override `getTools` to scope
559
591
  what a page offers — say, exposing `delete_record` only where deleting makes sense — and a call
560
592
  naming a tool you withheld is treated exactly as a call naming a tool you never registered: no
@@ -1923,6 +1955,15 @@ On mount the element rehydrates the transcript from the store, so the chat looks
1923
1955
  including tool-call cards and their results (reconstructed from the persisted `toolCalls` and `tool`
1924
1956
  messages), not just the text turns.
1925
1957
 
1958
+ A tool message is saved with an extra **`outcome`** field when the call did not simply succeed, in
1959
+ the same vocabulary the wire uses (see [A tool call that failed](#a-tool-call-that-failed)), so a
1960
+ failed or declined card replays as failed or declined instead of turning green on reload. `Message`
1961
+ does not declare the field, exactly as it does not declare the `attachments` an upload rides on a
1962
+ user message; the default store round-trips both through `JSON.stringify`. **A store that drops
1963
+ unknown fields loses only the distinction** — the card falls back to *done*, which is what it did
1964
+ before. It is written onto the copy handed to the store and never onto `agent.messages`, so it is
1965
+ not sent back to the server on the next run.
1966
+
1926
1967
  **3. Resumable loop (`x-navigates` + `navigationResult`).** A tool whose schema carries
1927
1968
  `x-navigates: true` (use `X_NAVIGATES_KEY`; read back by [`isNavigates`](src/tools/is_navigates.ts))
1928
1969
  triggers a full reload. Before the handler navigates, the element writes a checkpoint
@@ -2271,6 +2312,10 @@ Type the next turn in the composer, then pick a row:
2271
2312
 
2272
2313
  Both send to the matching server endpoint and stream into the same transcript.
2273
2314
 
2315
+ Picking a row with an empty composer says so above the input and puts the caret
2316
+ there, rather than closing the panel over nothing: a continuation sends **only**
2317
+ the new turn, so with nothing typed there is nothing to send.
2318
+
2274
2319
  ### One URL, three endpoints
2275
2320
 
2276
2321
  `data-runs-url` is the only thing to configure. `resume/<id>/` and `fork/<id>/`
@@ -2397,6 +2442,8 @@ re-export point. Internal modules import from leaf paths.
2397
2442
  | `AgUiClient` | class | Orchestration layer over an AG-UI `AbstractAgent`. |
2398
2443
  | `AgUiClientConfig` / `AgUiClientHandlers` / `AgUiRunInputs` | type | Client config, lifecycle handlers, per-run input providers. |
2399
2444
  | `AgUiToolCall` / `ToolExecution` / `ExecuteTool` | type | Tool-call shape, execution result, executor signature. |
2445
+ | `ToolOutcome` | type | The `TOOL_OUTCOME` values as a union. |
2446
+ | `toolStatusFromOutcome` | function | Map a wire outcome to the card status it settles into; anything absent or unrecognised is a success. |
2400
2447
  | `ConnectionLostError` | class | Raised (→ `onError`) when a run's stream closes with no terminal AG-UI event. |
2401
2448
  | `createHttpAgent(options)` | function | Default agent factory (wraps `HttpAgent`). |
2402
2449
  | `AgentFactory` / `HttpAgentOptions` | type | Factory signature and its options. |
@@ -2551,6 +2598,7 @@ re-export point. Internal modules import from leaf paths.
2551
2598
  | `MESSAGE_ACTIONS` | The message-action tokens `data-message-actions` selects by (`copy` / `retry` / `feedback`). |
2552
2599
  | `TOOL_CALL_STATUS` | Tool-call card status constants. |
2553
2600
  | `TOOL_DISPLAY` | Tool-call display-mode constants (`inline` / `minimal` / `compact` / `full`). |
2601
+ | `TOOL_OUTCOME` | How a tool call ended, as a server states it on `TOOL_CALL_RESULT` (`success` / `failed` / `denied`). |
2554
2602
  | `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. |
2555
2603
  | `X_SUMMARY_KEY` | JSON-Schema key carrying a short tool-card label. |
2556
2604
  | `MAX_TOOL_ROUNDS` | Upper bound on tool-call → re-run rounds per send. |
@@ -2829,7 +2877,7 @@ component sets, so a new one cannot ship undocumented.
2829
2877
  | Follow-up suggestions | `suggestions`, `suggestion-chip` |
2830
2878
  | Message actions | `message-actions`, `message-action` (plus `message-action-retry`, `message-action-copy`, `message-action-up`, `message-action-down`), and the icon holder inside each: `message-action-icon` (plus `message-action-icon-retry`, `message-action-icon-copy`, `message-action-icon-up`, `message-action-icon-down`) |
2831
2879
  | Queued messages | `queued`, `queued-chip` |
2832
- | Run notices | `run-notice` (plus `run-notice-interrupted`, `run-notice-attachment-pending`, `run-notice-compaction`, `run-notice-skill`, `run-notice-history-replaced`, `run-notice-chart-undrawable`, `run-notice-surface`), `run-notice-icon`, `run-notice-text`, `run-notice-undo` |
2880
+ | Run notices | `run-notice` (plus `run-notice-interrupted`, `run-notice-attachment-pending`, `run-notice-compaction`, `run-notice-skill`, `run-notice-history-replaced`, `run-notice-chart-undrawable`, `run-notice-surface`, `run-notice-not-connected`), `run-notice-icon`, `run-notice-text`, `run-notice-undo` |
2833
2881
  | Tool cards | `tool-card`, `tool-card-head`, `tool-card-icon`, `tool-card-name`, `tool-card-status`, `tool-card-decision`, `tool-card-toggle`, `tool-card-body`, `tool-card-section` (plus `tool-card-args-section`, `tool-card-result-section`), `tool-card-section-label` (plus `tool-card-args-label`, `tool-card-result-label`), `tool-card-args`, `tool-card-result`, `tool-card-approval`, `tool-card-subagent` |
2834
2882
  | Delegated sub-agents | `subagent`, `subagent-row`, `subagent-icon`, `subagent-status`, `subagent-steps`, `subagent-step`, `subagent-step-icon`, `subagent-step-name` |
2835
2883
  | Client-side confirmation | `confirm`, `confirm-body`, `confirm-args`, `confirm-actions`, `confirm-button` (plus `confirm-confirm`, `confirm-cancel`, `confirm-always`) |
@@ -2837,7 +2885,7 @@ component sets, so a new one cannot ship undocumented.
2837
2885
  | Typed question | `question`, `question-body`, `question-options`, `question-choice`, `question-choice-text`, `question-radio`, `question-input`, `question-actions`, `question-button` |
2838
2886
  | Composer | `composer`, `composer-surface`, `composer-tools`, `input`, `send`, `attach-button`, `voice-button` |
2839
2887
  | Attachments | `attachment-tray`, `attachment-chips` (the read-only chips on sent bubbles), and the shared chip parts `attachment-chip`, `attachment-chip-icon`, `attachment-chip-name`, `attachment-chip-size`, `attachment-chip-bar`, `attachment-chip-bar-fill`, `attachment-chip-retry`, `attachment-chip-remove` |
2840
- | Skills | `skill-chips`, `skill-chip`, `skill-palette`, `skill-item`, `skill-item-title`, `skill-item-desc`, `skill-item-token`, `skill-hint` (the missing-placeholder hint) |
2888
+ | Skills | `skill-chips`, `skill-chip`, `skill-palette`, `skill-item`, `skill-item-title`, `skill-item-desc`, `skill-item-token`, `skill-hint` (the composer hint: a skill’s missing placeholders, and a run continuation with nothing typed) |
2841
2889
  | Thread drawer | `drawer`, `drawer-backdrop`, `drawer-panel`, `drawer-header`, `drawer-title`, `drawer-new`, `drawer-close`, `drawer-filter`, `drawer-list`, `drawer-empty`, `drawer-row`, `drawer-row-select`, `drawer-row-title`, `drawer-row-time`, `drawer-row-preview`, `drawer-row-actions`, `drawer-row-rename`, `drawer-row-delete`, `drawer-rename-input`, `drawer-confirm`, `drawer-confirm-label`, `drawer-confirm-yes`, `drawer-confirm-no` |
2842
2890
  | Charts | `chart-block`, `chart-title`, `chart-legend` |
2843
2891
  | Checkpoints panel | `checkpoints`, `checkpoints-header`, `checkpoints-title`, `checkpoints-list`, `checkpoints-empty`, `checkpoint-row`, `checkpoint-label`, `checkpoint-time`, `checkpoint-id`, `checkpoint-branch`, `checkpoint-action` (plus `checkpoint-resume`, `checkpoint-fork`) |