@artooi/ag-ui-web-component 0.8.0 → 0.9.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,39 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.9.0] — 2026-06-30
11
+
12
+ ### Added
13
+
14
+ - **Model thoughts (THINK-1).** When the server forwards a reasoning model's
15
+ chain-of-thought, the element now renders a muted, collapsible **thoughts
16
+ region** (part `thoughts`) at the top of the current answer group — it streams
17
+ while the model reasons and folds away on the answer's first token (the reader
18
+ can reopen it). `AgUiClientHandlers` gains `onReasoningStart` / `onReasoningDelta`
19
+ / `onReasoningEnd`, wired from `@ag-ui/client`'s `REASONING_*` subscriber
20
+ callbacks (which also cover the deprecated `THINKING_*` family).
21
+ - **Voice input (VOICE-1).** Set `data-transcribe-url` (django-ag-ui's
22
+ `TranscribeView`) to reveal a 🎤 mic button in the composer (part
23
+ `voice-button`): it records via `MediaRecorder`, POSTs the clip, and drops the
24
+ returned transcript into the textarea. A pluggable `transcribeHandler` —
25
+ `(audio: Blob) => Promise<string>` — swaps the transport (a different STT
26
+ endpoint, a Web Speech adapter) and reveals the mic even without the attribute.
27
+ New exports: `transcribeAudio`, `TranscribeOptions`, `TranscribeHandler`.
28
+ - **Built-in theme toggle (THEME-1).** The boolean `data-theme-toggle` attribute
29
+ adds an optional light⇄dark toggle to the header (part `theme-toggle`,
30
+ `toggleTheme()`) that flips `theme` and persists per tab. Off by default, so a
31
+ host-supplied switch in `slot="header-actions"` stays unaffected.
32
+
33
+ ## [0.8.1] — 2026-06-30
34
+
35
+ ### Fixed
36
+
37
+ - **Page-mode column alignment.** In `placement="page"`, the rows between the
38
+ message list and the composer — skill chips, the `/`-command palette, the
39
+ missing-placeholder hint, and the upload tray — stayed left-anchored while
40
+ `.messages` and `.input-row` centred on `--ag-ui-content-max-width`. They now
41
+ share the same column gutter, so the whole page reads as one centred column.
42
+
10
43
  ## [0.8.0] — 2026-06-30
11
44
 
12
45
  ### Added
@@ -367,7 +400,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
367
400
  ### Notes
368
401
  - First release — exercising the automated npm OIDC publish pipeline end-to-end.
369
402
 
370
- [Unreleased]: https://github.com/Artui/ag-ui-web-component/compare/v0.8.0...HEAD
403
+ [Unreleased]: https://github.com/Artui/ag-ui-web-component/compare/v0.9.0...HEAD
404
+ [0.9.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.8.1...v0.9.0
405
+ [0.8.1]: https://github.com/Artui/ag-ui-web-component/compare/v0.8.0...v0.8.1
371
406
  [0.8.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.7.0...v0.8.0
372
407
  [0.7.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.6.0...v0.7.0
373
408
  [0.6.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.5.0...v0.6.0
package/README.md CHANGED
@@ -158,6 +158,8 @@ That's the whole integration: an `endpoint` attribute pointing at your AG-UI ser
158
158
  | `data-attachments-url` | — | URL of the file-upload endpoint (django-ag-ui's `AttachmentsView`); reveals the composer's 📎 picker + drag-and-drop. |
159
159
  | `data-attachment-accept` | — | `<input accept>` list for client-side type filtering (e.g. `image/*,.pdf`). The server stays authoritative. |
160
160
  | `data-attachment-max-bytes` | — | Client-side upload size cap in bytes (default 10 MiB; `0` disables). The server stays authoritative. |
161
+ | `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). |
162
+ | `data-theme-toggle` | — | Boolean: show a built-in header light⇄dark toggle (persists per tab). Off by default. See [Theme toggle](#theme-toggle). |
161
163
  | `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). |
162
164
  | `data-icon-url` | — | Header (and sidebar-rail) icon image URL. A slotted `slot="icon"` wins; see [Header & launcher icon](#header-and-launcher-icon). |
163
165
  | `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). |
@@ -170,9 +172,9 @@ That's the whole integration: an `endpoint` attribute pointing at your AG-UI ser
170
172
 
171
173
  **Properties** (JS only, not attributes): `headers`, `allowImages`, `autoConfirm`,
172
174
  `confirmPredicate`, `agentFactory`, `getTools`, `getContext`, `routeMap`, `navigate`,
173
- `getPageMap`, `autoInjectPageMap`, `conversationStore`, `uploadHandler`, `navigationResult`,
174
- `skillContext`, `toolSummaries`, `strings`, `resolvePageTarget`, plus the mirrors
175
- `endpoint` / `toolDisplay` / `collapsed`.
175
+ `getPageMap`, `autoInjectPageMap`, `conversationStore`, `uploadHandler`, `transcribeHandler`,
176
+ `navigationResult`, `skillContext`, `toolSummaries`, `strings`, `resolvePageTarget`, plus the
177
+ mirrors `endpoint` / `toolDisplay` / `collapsed`.
176
178
 
177
179
  `allowImages` (default `false`) re-enables `<img>` in rendered assistant markdown.
178
180
  It is off by default because a model-controlled image URL is fetched by the browser
@@ -772,7 +774,8 @@ have to hand-tune the variables:
772
774
 
773
775
  See [`src/ui/styles.ts`](src/ui/styles.ts) for the full variable + preset list. The
774
776
  [`demo/`](demo/) live playground (`node demo/mock-server.mjs`) flips theme, density, placement,
775
- text-animation, tool-display, and the answer well live from a single page.
777
+ text-animation, tool-display, and the answer well live from a single page, and demos the
778
+ streamed thoughts region, the 🎤 mic, and the header theme toggle.
776
779
 
777
780
  ### Parts and slots
778
781
 
@@ -788,12 +791,13 @@ ag-ui-chat::part(tool-card) { font-family: var(--my-mono); }
788
791
  ```
789
792
 
790
793
  Available parts: `panel`, `header`, `title`, `icon`, `header-controls`, `header-button`
791
- (plus `history-button` / `new-button` / `collapse-button`), `messages`, `answer` (the per-turn
792
- group), `message` (plus `message-user` / `message-assistant`), `empty`, `pending`, `tool-card`
794
+ (plus `history-button` / `new-button` / `collapse-button` / `theme-toggle`), `messages`,
795
+ `answer` (the per-turn group), `thoughts` (plus `thoughts-toggle` / `thoughts-body`), `message`
796
+ (plus `message-user` / `message-assistant`), `empty`, `pending`, `tool-card`
793
797
  (plus `tool-card-head` / `-icon` / `-name` / `-status` / `-args` / `-toggle` / `-result`),
794
798
  `confirm` (plus `confirm-body` /
795
799
  `-args` / `-actions` / `-button` / `-cancel` / `-confirm`), `composer`, `input`, `send`,
796
- `attach-button`, `attachment-tray`, `launcher`, `launcher-icon`, and the drawer parts
800
+ `attach-button`, `voice-button`, `attachment-tray`, `launcher`, `launcher-icon`, and the drawer parts
797
801
  (`drawer`, `drawer-backdrop`, `drawer-panel`, `drawer-header`, `drawer-title`, `drawer-new`,
798
802
  `drawer-list`, `drawer-empty`, `drawer-row`, `drawer-row-select`).
799
803
 
@@ -865,6 +869,40 @@ pure CSS and turn-scoped — no JS API — and themeable via `--ag-ui-well-bg` /
865
869
  <ag-ui-chat endpoint="/agent/" data-answer-well></ag-ui-chat>
866
870
  ```
867
871
 
872
+ ### Model reasoning (thoughts)
873
+
874
+ When a reasoning model streams its chain-of-thought (django-ag-ui forwards it as AG-UI reasoning
875
+ events — enable a thinking budget via `MODEL_SETTINGS`, see its docs), the element renders a muted,
876
+ collapsible **thoughts region** (part `thoughts`) at the top of the current answer group. It opens
877
+ while the model reasons and folds away on the answer's first token; the reader can reopen it. The
878
+ web component handles the `REASONING_*` event family (and the deprecated `THINKING_*`, which
879
+ `@ag-ui/client` maps onto it), so no client config is needed — the thoughts appear whenever the
880
+ server forwards reasoning.
881
+
882
+ ### Voice input
883
+
884
+ Set `data-transcribe-url` (django-ag-ui's `TranscribeView`) to reveal a 🎤 mic button in the
885
+ composer (part `voice-button`). Click it to record via `MediaRecorder`, click again to stop — the
886
+ clip is POSTed to the endpoint and the returned transcript is dropped into the textarea. Swap the
887
+ transport with a custom `transcribeHandler` — `(audio: Blob) => Promise<string>` — to use a
888
+ different STT endpoint or a browser Web Speech adapter without touching the button; when set, the
889
+ mic appears even with no `data-transcribe-url`.
890
+
891
+ ```html
892
+ <ag-ui-chat endpoint="/agent/" data-transcribe-url="/agent/transcribe/"></ag-ui-chat>
893
+ ```
894
+
895
+ ### Theme toggle
896
+
897
+ `theme` is a plain attribute you can set yourself, and a host can always drop its own switch into
898
+ `slot="header-actions"`. For convenience, the boolean `data-theme-toggle` attribute adds a built-in
899
+ light⇄dark toggle to the header (part `theme-toggle`) that flips `theme` and persists the choice
900
+ per tab. Off by default so it never competes with a host-supplied control.
901
+
902
+ ```html
903
+ <ag-ui-chat endpoint="/agent/" data-theme-toggle></ag-ui-chat>
904
+ ```
905
+
868
906
  ---
869
907
 
870
908
  ## Internationalization (i18n)