@artooi/ag-ui-web-component 0.45.0 → 0.46.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.
Files changed (56) hide show
  1. package/CHANGELOG.md +60 -1
  2. package/README.md +64 -9
  3. package/dist/ag-ui-web-component.bundle.js +384 -147
  4. package/dist/ag-ui-web-component.bundle.js.map +4 -4
  5. package/dist/constants.d.ts +4 -1
  6. package/dist/constants.d.ts.map +1 -1
  7. package/dist/core/ag_ui_chat.d.ts +10 -5
  8. package/dist/core/ag_ui_chat.d.ts.map +1 -1
  9. package/dist/index.js +609 -33
  10. package/dist/index.js.map +4 -4
  11. package/dist/tools/tool_catalog.d.ts +5 -0
  12. package/dist/tools/tool_catalog.d.ts.map +1 -1
  13. package/dist/tools/tool_dispatch.d.ts.map +1 -1
  14. package/dist/ui/interrupts/confirmation_styles.d.ts.map +1 -1
  15. package/dist/ui/placement/surface_for.d.ts +12 -1
  16. package/dist/ui/placement/surface_for.d.ts.map +1 -1
  17. package/dist/ui/progress/thoughts_styles.d.ts.map +1 -1
  18. package/dist/ui/progress/tool_call_card.d.ts +8 -0
  19. package/dist/ui/progress/tool_call_card.d.ts.map +1 -1
  20. package/dist/ui/progress/tool_group_styles.d.ts +2 -0
  21. package/dist/ui/progress/tool_group_styles.d.ts.map +1 -0
  22. package/dist/ui/progress/tool_step_group.d.ts +47 -0
  23. package/dist/ui/progress/tool_step_group.d.ts.map +1 -0
  24. package/dist/ui/progress/tool_step_styles.d.ts.map +1 -1
  25. package/dist/ui/shell/token_styles.d.ts.map +1 -1
  26. package/dist/ui/styles.d.ts.map +1 -1
  27. package/dist/ui/themes/ledger_styles.d.ts.map +1 -1
  28. package/dist/ui/themes/soft_styles.d.ts.map +1 -1
  29. package/dist/ui/transcript/groups_tool_steps.d.ts +13 -0
  30. package/dist/ui/transcript/groups_tool_steps.d.ts.map +1 -0
  31. package/dist/ui/transcript/message_styles.d.ts.map +1 -1
  32. package/dist/ui/transcript/transcript.d.ts +16 -1
  33. package/dist/ui/transcript/transcript.d.ts.map +1 -1
  34. package/dist/ui/ui_strings.d.ts +18 -0
  35. package/dist/ui/ui_strings.d.ts.map +1 -1
  36. package/package.json +1 -1
  37. package/src/constants.ts +4 -1
  38. package/src/core/ag_ui_chat.ts +14 -6
  39. package/src/tools/tool_catalog.ts +23 -10
  40. package/src/tools/tool_dispatch.ts +26 -11
  41. package/src/ui/interrupts/confirmation_styles.ts +0 -2
  42. package/src/ui/placement/surface_for.ts +12 -1
  43. package/src/ui/progress/thoughts_styles.ts +0 -2
  44. package/src/ui/progress/tool_call_card.ts +11 -0
  45. package/src/ui/progress/tool_group_styles.ts +232 -0
  46. package/src/ui/progress/tool_step_group.ts +269 -0
  47. package/src/ui/progress/tool_step_styles.ts +0 -2
  48. package/src/ui/shell/token_styles.ts +2 -0
  49. package/src/ui/styles.ts +5 -0
  50. package/src/ui/themes/ledger_styles.ts +15 -0
  51. package/src/ui/themes/soft_styles.ts +20 -0
  52. package/src/ui/transcript/groups_tool_steps.ts +16 -0
  53. package/src/ui/transcript/message_styles.ts +0 -2
  54. package/src/ui/transcript/transcript.ts +109 -3
  55. package/src/ui/ui_strings.ts +31 -0
  56. package/src/version.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,64 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.46.0] — 2026-11-05
11
+
12
+ ### Changed
13
+
14
+ - **Tool calls fold into a step group by default.** `data-tool-display`
15
+ gains `grouped`, and it is the new default (also for an absent or unknown
16
+ value). A run's consecutive tool calls fold into one quiet row, "Worked
17
+ through 5 steps", with a note such as "1 failed", and the per-call cards one
18
+ click down as `full` cards. Anything else in the turn ends the group, except
19
+ a call's own rendered output. **No
20
+ opt-in is needed, and a host that wants the old per-call cards opts out with
21
+ `data-tool-display="full"`**; `inline`, `minimal`, `compact` and `full`
22
+ render exactly as in 0.45.0. Grouping is the same under every theme; Soft
23
+ draws the row as a tinted pill and Ledger as a monospace heading.
24
+ - The group opens itself while a step waits on the user (a server-side
25
+ approval, which renders inside its card), once per wait; the user can
26
+ fold it again. It opens before the approval is drawn, so the Approve
27
+ button takes focus and scrolls into view, as it does under `full`. A
28
+ client-side confirmation or an `ask_user` question renders beside the
29
+ group and is in view without it opening, and the row reads "waiting for
30
+ you" for as long as one is open rather than "running".
31
+ - A running sub-agent does not open it: the folded row keeps its spinner
32
+ and names the delegation ("Delegated to researcher").
33
+ - Repeated labels are told apart inside a group, "Fill field" then "Fill
34
+ field (2)", in an element of its own; `tool-card-name` is never rewritten.
35
+ - A tool's rendered output (a chart) is placed after the group, in call
36
+ order, so it is never folded away, and a later call still joins the
37
+ group above it.
38
+ - Grouping is decided as each card is built. Switching to `grouped` folds
39
+ only calls drawn afterwards; switching to a card mode flattens existing
40
+ groups by CSS into the cards that mode builds.
41
+ - A restored conversation folds the same way as the live one.
42
+
43
+ ### Added
44
+
45
+ - Parts `tool-group`, `tool-group-head`, `tool-group-icon`,
46
+ `tool-group-label`, `tool-group-meta`, `tool-group-list`, and
47
+ `tool-card-repeat` on a repeated step.
48
+ - The `--ag-ui-ring` token (the group head's focus outline) and the
49
+ `--ag-ui-ico-chevron` mask image (its disclosure chevron).
50
+ - Strings `toolGroupSteps`, `toolGroupWorking`, `toolGroupWorked`,
51
+ `toolGroupWaiting`, `toolGroupFailed`, `toolGroupDeclined` (`{count}`) and
52
+ `toolStepRepeat` (`{n}`).
53
+ - `TOOL_DISPLAY.GROUPED`.
54
+ - A `data-asking` attribute on a tool-call card while a question or a
55
+ confirmation is open on it. It is internal, read by the step group; the
56
+ card's `data-status` is unchanged.
57
+
58
+ ### Fixed
59
+
60
+ - **The wheel scrolls the transcript when the pointer rests on a tool call's
61
+ arguments or result, a code block, the reasoning or a confirmation's
62
+ arguments.** Those blocks swallowed the wheel even when they had nothing
63
+ left to scroll, so the transcript sat still until the pointer moved to plain
64
+ text. They now hand the wheel on to the transcript, including a wheel that
65
+ carries a little sideways motion, as a real mouse or trackpad nearly always
66
+ does. This is long-standing and needs no opt-in.
67
+
10
68
  ## [0.45.0] — 2026-11-05
11
69
 
12
70
  ### Added
@@ -4703,7 +4761,8 @@ hosts that both arrange the page the way it expects.
4703
4761
  ### Notes
4704
4762
  - First release — exercising the automated npm OIDC publish pipeline end-to-end.
4705
4763
 
4706
- [Unreleased]: https://github.com/Artui/ag-ui-web-component/compare/v0.45.0...HEAD
4764
+ [Unreleased]: https://github.com/Artui/ag-ui-web-component/compare/v0.46.0...HEAD
4765
+ [0.46.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.45.0...v0.46.0
4707
4766
  [0.45.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.44.0...v0.45.0
4708
4767
  [0.44.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.43.0...v0.44.0
4709
4768
  [0.43.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.42.0...v0.43.0
package/README.md CHANGED
@@ -177,7 +177,7 @@ another origin, add `credentials="include"` too; see
177
177
  | `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. |
178
178
  | `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). |
179
179
  | `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). |
180
- | `data-tool-display` | `toolDisplay` | Tool-call card detail: `inline` / `minimal` / `compact` / `full` (default `full`). |
180
+ | `data-tool-display` | `toolDisplay` | How tool calls are drawn: `grouped` (the default: a run's consecutive calls fold into one row) / `inline` / `minimal` / `compact` / `full` (per-call cards; `full` was the default before `grouped`). An unknown value reads as `grouped`. See [Tool-call display modes](#tool-call-display-modes). |
181
181
  | `data-text-animation` | — | Incoming-text reveal: `none` (default) / `fade` / `word`. |
182
182
  | `data-prompt-chips` | — | Present (bare, or any value but `"false"`) to surface skills as chips. |
183
183
  | `data-slash-commands` | — | Present (bare, or any value but `"false"`) to enable the `/`-command palette. |
@@ -1475,15 +1475,22 @@ is the honest answer to "I pushed a chart and nothing happened".
1475
1475
 
1476
1476
  ## Tool-call display modes
1477
1477
 
1478
- How much a tool-call card shows is set via the `data-tool-display` attribute (or `toolDisplay`
1479
- property), one of `inline` / `minimal` / `compact` / `full` (default `full`):
1478
+ How tool calls are drawn is set via the `data-tool-display` attribute (or `toolDisplay`
1479
+ property), one of `grouped` / `inline` / `minimal` / `compact` / `full` (default `grouped`; an
1480
+ absent or unknown value reads as `grouped`):
1480
1481
 
1482
+ - `grouped` — the default. A run's consecutive tool calls fold into one quiet row, **"Worked
1483
+ through 5 steps"**, with a note such as **"1 failed"** beside it, and the calls one click down
1484
+ as `full` cards. Anything else in the turn (text, a confirmation, a question) ends the group, and
1485
+ the next call starts a new one; a call's own rendered output does not. A group of one call shows that call's own label. See
1486
+ [The step group](#the-step-group).
1481
1487
  - `inline` — the lightest mode: a single status row (icon + summary, no card chrome) with the
1482
1488
  result behind its own toggle. Reads as one line of the answer — pairs with [the answer
1483
1489
  well](#the-answer-well).
1484
1490
  - `minimal` — tool name + status pill only.
1485
1491
  - `compact` — name + status, with arguments *and* result behind a single collapsed toggle.
1486
- - `full` — arguments visible, result behind the toggle (the default).
1492
+ - `full` — arguments visible, result behind the toggle. The default before `grouped`: set
1493
+ `data-tool-display="full"` to keep per-call cards.
1487
1494
 
1488
1495
  Whichever mode is on, a settled card's body holds **two labelled regions** — `Arguments` and
1489
1496
  `Result` (or `Error` / `Declined`) — each with its own part and each pretty-printed. They are
@@ -1491,9 +1498,55 @@ never run together into one block, so where the call ends and the answer begins
1491
1498
  visible. Style them via the `tool-card-args` / `tool-card-result` parts, their headings via
1492
1499
  `tool-card-section-label`, and the whole body via `tool-card-body`.
1493
1500
 
1494
- **The attribute is live.** Changing `data-tool-display` restyles every card already in the
1495
- transcript, the way `data-answer-well` does — the modes are pure visibility over one DOM shape,
1496
- selected by the shadow CSS from the host attribute.
1501
+ **The attribute is live.** Changing `data-tool-display` between the four card modes restyles every
1502
+ card already in the transcript, the way `data-answer-well` does — the modes are pure visibility
1503
+ over one DOM shape, selected by the shadow CSS from the host attribute. Grouping is decided as
1504
+ each card is built: switching **to** `grouped` folds only the calls drawn afterwards, and
1505
+ switching **away** from it flattens the groups already drawn, by CSS, into exactly the cards the
1506
+ new mode builds (the group stops generating a box and its row is hidden).
1507
+
1508
+ ### The step group
1509
+
1510
+ Under `grouped` the row reads, by state:
1511
+
1512
+ | State (`data-state` on the `tool-group` part) | Label | Mark |
1513
+ | --- | --- | --- |
1514
+ | `running` | "Working through 3 steps", and the running step's label as a note | spinner |
1515
+ | `waiting` | "3 steps", with "1 waiting for you" | accent dot |
1516
+ | `done` | "Worked through 3 steps" | check |
1517
+ | `error` | "Worked through 3 steps", with "1 failed" in the danger colour | error mark |
1518
+
1519
+ "N declined" is added as a note whenever a step was declined. `data-count` carries the number of
1520
+ steps and `data-open` whether the cards are showing; the head is a button with `aria-expanded`.
1521
+
1522
+ - **It opens itself while a step waits on you.** A server-side approval renders inside the gated
1523
+ call's own card, so a folded group would hide the question it is asking: the group opens when a
1524
+ step goes `deferred`, once per wait, and stays folded if you fold it again. It opens before the
1525
+ approval is drawn, so the Approve button takes focus and scrolls into view. A client-side
1526
+ confirmation and an `ask_user` question render in the answer beside the group rather than inside
1527
+ a card, so they are in view without it opening; the row still reads `waiting` ("1 waiting for
1528
+ you") while one is open, as the card carries a `data-asking` flag for the group to read, and its
1529
+ `data-status` stays `pending`.
1530
+ - **A running sub-agent does not open it.** The row keeps its spinner and names the delegation
1531
+ instead, "Delegated to researcher" (the `subAgentDelegatedTo` string).
1532
+ - **Repeated labels are told apart.** Two "Fill field" steps read "Fill field" and "Fill field
1533
+ (2)": the ordinal is an element of its own (part `tool-card-repeat`) beside the card's name, so
1534
+ `tool-card-name` is never rewritten, and a card mode hides the ordinal.
1535
+ - **Rendered output stays in view.** A tool's `render` output is placed after the group, in call
1536
+ order, rather than inside it, so a chart is never one click down. It does not end the group: a
1537
+ later call joins the group above it, which is also how a restored conversation draws the run.
1538
+
1539
+ Parts: `tool-group`, `tool-group-head` (the button), `tool-group-icon`, `tool-group-label`,
1540
+ `tool-group-meta` (holding one `.tool-group-note` per note), `tool-group-list` (the cards), and
1541
+ `tool-card-repeat` on a repeated step. The focus ring is `--ag-ui-ring` and the disclosure chevron
1542
+ `--ag-ui-ico-chevron`. Strings (`strings` / `data-strings`): `toolGroupSteps`,
1543
+ `toolGroupWorking`, `toolGroupWorked` (each with `{count}`, always 2 or more), `toolGroupWaiting`,
1544
+ `toolGroupFailed`, `toolGroupDeclined` (each with `{count}`) and `toolStepRepeat` (with `{n}`).
1545
+
1546
+ ```html
1547
+ <!-- Keep per-call cards, as before grouped was the default -->
1548
+ <ag-ui-chat endpoint="/agent/" data-tool-display="full"></ag-ui-chat>
1549
+ ```
1497
1550
 
1498
1551
  ### Drawing a card's body yourself
1499
1552
 
@@ -2960,7 +3013,8 @@ first, so each stays an override point. The tokens the themes add:
2960
3013
  placement squares or flattens.
2961
3014
  - **Charts:** `--ag-ui-chart-1` to `--ag-ui-chart-6`. A host's value beats the theme's.
2962
3015
  - **Status marks:** `--ag-ui-ico-check`, `--ag-ui-ico-error`, `--ag-ui-ico-declined`, mask images
2963
- drawn in the state's colour.
3016
+ drawn in the state's colour, and `--ag-ui-ico-chevron`, the step group's disclosure chevron.
3017
+ - **Focus:** `--ag-ui-ring`, the step group head's focus outline (the accent at 55%).
2964
3018
 
2965
3019
  The font is part of the theme: Quiet, Soft and Ledger set their own stack (Inter, then the system
2966
3020
  UI font), and Classic inherits the page's font as the component always did. Set
@@ -3297,7 +3351,8 @@ component sets, so a new one cannot ship undocumented.
3297
3351
  | 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`) |
3298
3352
  | Queued messages | `queued`, `queued-chip` |
3299
3353
  | 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` |
3300
- | 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` |
3354
+ | 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`, `tool-card-repeat` |
3355
+ | Tool-step group | `tool-group`, `tool-group-head`, `tool-group-icon`, `tool-group-label`, `tool-group-meta`, `tool-group-list` |
3301
3356
  | Delegated sub-agents | `subagent`, `subagent-row`, `subagent-icon`, `subagent-status`, `subagent-steps`, `subagent-step`, `subagent-step-icon`, `subagent-step-name` |
3302
3357
  | Client-side confirmation | `confirm`, `confirm-body`, `confirm-args`, `confirm-actions`, `confirm-button` (plus `confirm-confirm`, `confirm-cancel`, `confirm-always`) |
3303
3358
  | Server-side approval | `approval`, `approval-body`, `approval-actions`, `approval-button` (plus `approval-approve`, `approval-deny`), `approval-edit`, `approval-args`, `approval-error` |