@artooi/ag-ui-web-component 0.3.1 → 0.5.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,62 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.5.0] — 2026-06-24
11
+
12
+ ### Added
13
+
14
+ - **Chat-history drawer.** A history toggle (☰) in the header opens a slide-over
15
+ listing the user's past conversations (title · relative time · preview), with
16
+ select, new chat, inline rename, and delete-with-confirm. The
17
+ `ClientConversationStore` interface gains `listThreads` / `setActiveThread` /
18
+ `renameThread` and a `ThreadMeta` row shape; the default `SessionStorageStore`
19
+ now keeps a per-tab thread index so the drawer works with no server. Selecting
20
+ a row switches the active conversation and replays its history. The drawer is a
21
+ slide-over by default, with an inline side-panel variant for
22
+ `placement="embedded"`.
23
+ - **Server-backed history via `data-threads-url`.** Set the attribute (to
24
+ django-ag-ui's `ThreadsView` URL) and the drawer routes list / load / rename /
25
+ delete through that endpoint via a new `RemoteConversationStore`, showing
26
+ durable, cross-device threads. The client store remains the offline fallback;
27
+ rename / delete apply optimistically.
28
+
29
+ ## [0.4.0] — 2026-06-12
30
+
31
+ ### Added
32
+
33
+ - **Cancel / stop a run.** `AgUiClient.cancel()` aborts the in-flight
34
+ streaming request (`abortRun()` — AG-UI's transport-level cancel; the
35
+ server observes the disconnect) and stops the multi-round run loop: tool
36
+ calls collected before the abort are not executed and no further round
37
+ starts (a frontend tool handler already running completes, but its result
38
+ doesn't trigger a re-run). Safe no-op with no run in flight.
39
+ - **`onCancelled()` handler** on `AgUiClientHandlers` — the deliberate-stop
40
+ sibling of `onError`. Partial assistant text stays in the transcript and
41
+ is persisted (`onPersist`), so a reload shows the truncated exchange;
42
+ `onSettled` still fires (terminal-rest guarantee). Both the
43
+ abort-resolves and abort-rejects behaviours of `@ag-ui/client` are
44
+ handled (its `runAgent` filters `AbortError` and resolves normally;
45
+ re-throwing versions are caught via the error's name).
46
+ - **The Send button becomes Stop while a run is in flight** — same button,
47
+ label + `aria-label` swap, `data-state="running"` for styling — through
48
+ the whole interaction including between tool rounds. **Escape** in the
49
+ composer also cancels (only when the skills palette is closed; the
50
+ palette keeps its own Escape). After a cancel the transcript gets a muted
51
+ **"⏹ Stopped"** note (`.stopped-note`), not an error bubble.
52
+ - **Cancelling declines an open confirmation card.**
53
+ `requestConfirmation` accepts `ConfirmationOptions` with an
54
+ `AbortSignal`; aborting resolves the pending decision as declined
55
+ (`data-resolved="declined"`). A decision already made wins over a late
56
+ abort.
57
+
58
+ ### Changed
59
+
60
+ - `newChat()` now cancels any in-flight run before discarding the client —
61
+ previously the old agent kept streaming into a cleared transcript.
62
+ - The Send button is no longer `disabled` during a run (it's the Stop
63
+ control now); `AgUiClientHandlers.onCancelled` is required, so hosts
64
+ implementing the handlers interface must add it.
65
+
10
66
  ## [0.3.1] — 2026-06-10
11
67
 
12
68
  ### Security
@@ -213,7 +269,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
213
269
  ### Notes
214
270
  - First release — exercising the automated npm OIDC publish pipeline end-to-end.
215
271
 
216
- [Unreleased]: https://github.com/Artui/ag-ui-web-component/compare/v0.3.1...HEAD
272
+ [Unreleased]: https://github.com/Artui/ag-ui-web-component/compare/v0.5.0...HEAD
273
+ [0.5.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.4.0...v0.5.0
274
+ [0.4.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.3.1...v0.4.0
217
275
  [0.3.1]: https://github.com/Artui/ag-ui-web-component/compare/v0.3.0...v0.3.1
218
276
  [0.3.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.2.2...v0.3.0
219
277
  [0.2.2]: https://github.com/Artui/ag-ui-web-component/compare/v0.2.1...v0.2.2
package/README.md CHANGED
@@ -40,6 +40,7 @@ No framework, no Django, no admin specifics live here. Downstream consumers (e.g
40
40
  - [Quickstart](#quickstart)
41
41
  - [Core concepts](#core-concepts)
42
42
  - [The run loop and the AG-UI client](#the-run-loop-and-the-ag-ui-client)
43
+ - [Stopping a run](#stopping-a-run)
43
44
  - [Registering tools](#registering-tools)
44
45
  - [Inline confirmation (`x-destructive` / `x-confirm` / `confirmPredicate`)](#inline-confirmation-x-destructive--x-confirm--confirmpredicate)
45
46
  - [DOM-driver and animation primitives](#dom-driver-and-animation-primitives)
@@ -204,6 +205,28 @@ card (honouring `data-tool-display`), so server-side output is visible too. The
204
205
  and context are read **fresh on every run** (`getTools()` / `getContext()`), so they always reflect
205
206
  the current page state.
206
207
 
208
+ ### Stopping a run
209
+
210
+ While a run is in flight the **Send button becomes Stop** (same button, label/`aria-label` swap,
211
+ `data-state="running"` for styling); clicking it — or pressing **Escape** in the composer (when
212
+ the skills palette is closed; the palette owns Escape while open) — calls `AgUiClient.cancel()`.
213
+ AG-UI has no server-side cancel route: cancelling **aborts the streaming request**
214
+ (`abortRun()`), and the server observes the disconnect. On cancel:
215
+
216
+ - Partial assistant text already streamed **stays in the transcript** and is persisted via
217
+ `onPersist`, so a reload shows the truncated exchange. A muted **"⏹ Stopped"** note is appended
218
+ (`.stopped-note`) — a deliberate stop is not an error, so no ⚠️ bubble.
219
+ - The run loop stops: tool calls collected before the abort are **not executed**, and no further
220
+ round starts. A frontend tool handler already running completes, but its result doesn't trigger
221
+ a re-run.
222
+ - An **open confirmation card is declined** (`data-resolved="declined"`) — cancelling the run
223
+ answers the pending question.
224
+ - The new `onCancelled()` handler fires instead of `onError()`; `onSettled()` still follows
225
+ (the terminal-rest guarantee), returning the button to **Send**.
226
+
227
+ `cancel()` with no run in flight is a safe no-op. `newChat()` cancels any in-flight run before
228
+ discarding the client.
229
+
207
230
  ### Registering tools
208
231
 
209
232
  A tool is a `ClientTool`: `{ name, description, parameters, handler }`, where `parameters` is a
@@ -566,8 +589,9 @@ re-export point. Internal modules import from leaf paths.
566
589
  | --- | --- | --- |
567
590
  | `ToolCallCard` | class | A live tool-call card for the transcript. |
568
591
  | `ToolCallStatus` / `SettledStatus` / `ToolDisplayMode` | type | Card lifecycle states + display mode. |
569
- | `requestConfirmation(host, request)` | function | Append the inline confirmation card to the transcript. |
592
+ | `requestConfirmation(host, request, options?)` | function | Append the inline confirmation card to the transcript. |
570
593
  | `ConfirmationRequest` | type | What the card displays. |
594
+ | `ConfirmationOptions` | type | `{ signal? }` — aborting resolves the card as declined (the Stop control's hook). |
571
595
  | `renderMarkdown(text)` | function | Render sanitized markdown/HTML (marked + DOMPurify). |
572
596
  | `typeInto` / `highlightThenClick` / `pressThenClick` / `selectOption` / `toggleControl` / `scrollIntoCenterView` / `focusWithFlash` / `prefersReducedMotion` | function | Animation primitives. |
573
597
  | `fillField` / `clickElement` / `pressButton` / `selectControl` / `setControlValue` / `toggleCheckbox` | function | DOM-driver primitives. |