@artooi/ag-ui-web-component 0.19.0 → 0.20.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 +102 -5
- package/README.md +63 -6
- package/dist/ag-ui-web-component.bundle.js +173 -29
- package/dist/ag-ui-web-component.bundle.js.map +4 -4
- package/dist/core/ag_ui_chat.d.ts.map +1 -1
- package/dist/core/agui_client.d.ts.map +1 -1
- package/dist/index.js +401 -12
- package/dist/index.js.map +4 -4
- package/dist/skills/parse_skills.d.ts.map +1 -1
- package/dist/skills/skill.d.ts +14 -4
- package/dist/skills/skill.d.ts.map +1 -1
- package/dist/ui/resize_handle.d.ts +81 -0
- package/dist/ui/resize_handle.d.ts.map +1 -0
- package/dist/ui/skills_menu.d.ts.map +1 -1
- package/dist/ui/styles.d.ts +1 -1
- package/dist/ui/styles.d.ts.map +1 -1
- package/dist/ui/ui_strings.d.ts +2 -0
- package/dist/ui/ui_strings.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/core/ag_ui_chat.ts +203 -5
- package/src/core/agui_client.ts +27 -1
- package/src/skills/parse_skills.ts +8 -2
- package/src/skills/skill.ts +14 -4
- package/src/ui/resize_handle.ts +176 -0
- package/src/ui/skills_menu.ts +13 -1
- package/src/ui/styles.ts +146 -2
- package/src/ui/ui_strings.ts +4 -1
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,72 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.20.0] — 2026-08-11
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **The panel is resizable.** A drag handle on the corner the layout grows
|
|
15
|
+
toward (or the inner edge when docked), with the size persisted per tab and
|
|
16
|
+
restored before the first paint. Arrow keys resize from the keyboard, since a pointer-only control
|
|
17
|
+
has no equivalent elsewhere in the UI; style it via the `resize-handle` part.
|
|
18
|
+
|
|
19
|
+
Which axes are draggable is the placement's call: `full` and `page` get no
|
|
20
|
+
handle at all (a `100vw`/`100vh` layout has nothing to drag), `sidebar` /
|
|
21
|
+
`side` get width only, everything else gets both.
|
|
22
|
+
|
|
23
|
+
⚠ **It writes the custom properties, not inline `width` / `height`.** The
|
|
24
|
+
placement rules set those same properties, so an inline dimension would
|
|
25
|
+
outrank them — a panel dragged while floating would keep that width after
|
|
26
|
+
switching to fullscreen.
|
|
27
|
+
|
|
28
|
+
⭐ **Which corner the grip sits on is measured, not assumed.** A resize is
|
|
29
|
+
computed from the edge that stays still, and which edge that is belongs to the
|
|
30
|
+
*host's* layout rather than to `placement` — a floating panel is pinned
|
|
31
|
+
bottom-right, an embedded one goes wherever the page's CSS puts it. Deriving
|
|
32
|
+
it from `placement` was wrong for any host that right-aligns the element, and
|
|
33
|
+
the symptom was bad enough to read as a broken control: the panel shrank when
|
|
34
|
+
dragged outward and travelled by its opposite corner. The element now probes
|
|
35
|
+
its own geometry and reflects the result as `data-resize-anchor`.
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
|
|
39
|
+
- **The `/` palette leads with the command.** Each row now reads
|
|
40
|
+
`/fill-article Fill the article` rather than the label alone (part
|
|
41
|
+
`skill-item-token`), and a chip's tooltip names the token it stands for. A
|
|
42
|
+
palette that shows only labels cannot teach its own vocabulary — a user who
|
|
43
|
+
never sees `/fill-article` has no way to learn to type it.
|
|
44
|
+
|
|
45
|
+
- **A skill blocked on an unfilled `{placeholder}` now hands back the
|
|
46
|
+
template.** The partially-filled prompt goes into the composer with the first
|
|
47
|
+
unresolved placeholder selected, so the next keystroke replaces it. Previously
|
|
48
|
+
the pick was refused with a hint and whatever the user had typed to open the
|
|
49
|
+
palette — a lone `/` — was left in the composer, which said nothing about what
|
|
50
|
+
the skill wanted or how to supply it. The hint now says what to do, too.
|
|
51
|
+
|
|
52
|
+
- ⚠ **Picking a skill now sends it.** It used to write the text into the
|
|
53
|
+
composer and wait for a second click unless the skill set
|
|
54
|
+
`sendImmediately: true` — so the default behaviour of a shortcut was to not
|
|
55
|
+
take the shortcut. Set `sendImmediately: false` to keep pre-filling, which is
|
|
56
|
+
worth doing where the user is expected to edit before sending.
|
|
57
|
+
|
|
58
|
+
- **`Skill.prompt` is now optional, and omitting it is the better default for
|
|
59
|
+
anything internal.** A skill with no prompt is **server-resolved**: picking it
|
|
60
|
+
sends the bare `/name` token and the agent expands it, from the harness
|
|
61
|
+
`Skills` capability or the server's own instructions.
|
|
62
|
+
|
|
63
|
+
⛔ **The prompt was the leak.** A catalog is either a fetched `GET` or an
|
|
64
|
+
inline `data-skills` attribute sitting in the page source, and a skill is
|
|
65
|
+
often where a project's internal workflow is written down most plainly — so
|
|
66
|
+
the client-side catalog published it to anyone who opened the page. Sending a
|
|
67
|
+
token instead keeps the wording on the server entirely, which is what
|
|
68
|
+
"trigger a `/command` without exposing the prompt" actually requires; hiding
|
|
69
|
+
the text behind a chip label would only have moved it off screen.
|
|
70
|
+
|
|
71
|
+
`parseSkills` accepts a catalog entry with no `prompt` rather than dropping
|
|
72
|
+
it — requiring the field would have silently discarded exactly the skills
|
|
73
|
+
whose wording was kept off the browser. Pairs with `django-ag-ui`'s
|
|
74
|
+
`SkillSpec.prompt` becoming optional.
|
|
75
|
+
|
|
10
76
|
## [0.19.0] — 2026-08-11
|
|
11
77
|
|
|
12
78
|
### Changed
|
|
@@ -45,10 +111,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
45
111
|
|
|
46
112
|
### Added
|
|
47
113
|
|
|
48
|
-
- **A gated call records the decision
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
114
|
+
- **A gated call records the decision**, from the client-side confirmation card
|
|
115
|
+
**and** the server-side approval interrupt. The tool card carries
|
|
116
|
+
`approved by you` / `declined by you` (part `tool-card-decision`, attribute
|
|
117
|
+
`data-decision`). Previously only a *refusal* left a trace — an approved call
|
|
118
|
+
simply ran, making a gated call's transcript identical to one that was never
|
|
119
|
+
gated, and the server-side gate left nothing at all even though it is the one
|
|
120
|
+
guarding tools that run on the backend.
|
|
121
|
+
|
|
122
|
+
⚠ **Session-scoped, like the "run interrupted" notice.** AG-UI carries no
|
|
123
|
+
approval message — the answer rides `resume[]` as transient run input — so a
|
|
124
|
+
reload restores the call and its result but not the note. Durable "who
|
|
125
|
+
approved what" is an audit concern, not a transcript one.
|
|
52
126
|
|
|
53
127
|
- **Each header control takes its own icon slot** — `icon-history`,
|
|
54
128
|
`icon-checkpoints`, `icon-new`, `icon-collapse` — with the built-in glyph as
|
|
@@ -64,6 +138,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
64
138
|
|
|
65
139
|
### Fixed
|
|
66
140
|
|
|
141
|
+
- **A server that reuses a message id now gets a warning.** `@ag-ui/client`
|
|
142
|
+
appends to a message id already in its history rather than starting a new one,
|
|
143
|
+
so two answers merge into one transcript entry — silently, and the merged
|
|
144
|
+
entry is what gets persisted. The protocol has no rule to enforce and refusing
|
|
145
|
+
the event would be worse than the merge, so this warns and continues.
|
|
146
|
+
|
|
147
|
+
⭐ Found because the demo harness was doing exactly this, which is the
|
|
148
|
+
argument for the harness in miniature: the bug was the consumer's, the
|
|
149
|
+
invisibility was ours.
|
|
150
|
+
|
|
151
|
+
- **The demo playground covers the surface it is meant to demonstrate.** The
|
|
152
|
+
scripted agent now dispatches on the latest turn — a server-resolved skill, a
|
|
153
|
+
tool that throws, an `ask_user` question, or the form-filling script — instead
|
|
154
|
+
of replaying one script for everything, and the page gained header-icon,
|
|
155
|
+
German-strings and reset-size controls plus a short "what to try" guide.
|
|
156
|
+
|
|
157
|
+
⚠ Two harness defects were making the component look broken. Its follow-up
|
|
158
|
+
detection matched **any** tool message in the thread, so once a conversation
|
|
159
|
+
had run a single tool every later turn answered "Done" to everything. And the
|
|
160
|
+
page forced `flex: 1` on the element, which silently outranks the width a
|
|
161
|
+
resize writes — the drag worked and nothing moved.
|
|
162
|
+
|
|
67
163
|
- **The demo harness reused message ids**, which produced three symptoms that
|
|
68
164
|
all read as component bugs and were none of them. It streamed every follow-up
|
|
69
165
|
answer under a hardcoded id, and `@ag-ui/client` appends to a message id
|
|
@@ -943,7 +1039,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
943
1039
|
### Notes
|
|
944
1040
|
- First release — exercising the automated npm OIDC publish pipeline end-to-end.
|
|
945
1041
|
|
|
946
|
-
[Unreleased]: https://github.com/Artui/ag-ui-web-component/compare/v0.
|
|
1042
|
+
[Unreleased]: https://github.com/Artui/ag-ui-web-component/compare/v0.20.0...HEAD
|
|
1043
|
+
[0.20.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.19.0...v0.20.0
|
|
947
1044
|
[0.19.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.18.0...v0.19.0
|
|
948
1045
|
[0.18.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.17.0...v0.18.0
|
|
949
1046
|
[0.17.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.16.0...v0.17.0
|
package/README.md
CHANGED
|
@@ -529,10 +529,16 @@ visible. Style them via the `tool-card-args` / `tool-card-result` parts, their h
|
|
|
529
529
|
transcript, the way `data-answer-well` does — the modes are pure visibility over one DOM shape,
|
|
530
530
|
selected by the shadow CSS from the host attribute.
|
|
531
531
|
|
|
532
|
-
A
|
|
533
|
-
`
|
|
534
|
-
|
|
535
|
-
card.
|
|
532
|
+
A gated call carries the decision (`approved by you` / `declined by you`, part
|
|
533
|
+
`tool-card-decision`, attribute `data-decision`) — from the client-side confirmation card and
|
|
534
|
+
from the server-side approval interrupt alike. The prompt itself disappears once answered: a
|
|
535
|
+
prompt and a record are different objects, and the record is the card.
|
|
536
|
+
|
|
537
|
+
⚠ **The annotation is session-scoped**, like the "run interrupted" notice. AG-UI carries no
|
|
538
|
+
approval message — the answer rides `resume[]` as transient run input — so a reload restores the
|
|
539
|
+
tool call and its result but not the note that a human waved it through. If you need "who
|
|
540
|
+
approved what" durably, that is an audit concern rather than a transcript one; record it
|
|
541
|
+
server-side.
|
|
536
542
|
|
|
537
543
|
If a tool's schema carries an `x-summary` string (use `X_SUMMARY_KEY`), the card shows it on the
|
|
538
544
|
label instead of the raw tool name.
|
|
@@ -549,6 +555,43 @@ speed; the spin respects `prefers-reduced-motion`).
|
|
|
549
555
|
|
|
550
556
|
---
|
|
551
557
|
|
|
558
|
+
## Resizing the panel
|
|
559
|
+
|
|
560
|
+
The panel carries a drag handle on its leading corner (or leading edge, docked),
|
|
561
|
+
so a reader can widen it without the host having to re-theme anything.
|
|
562
|
+
|
|
563
|
+
- `placement="full"` / `placement="page"` get **no handle** — a full-bleed layout
|
|
564
|
+
is `100vw`/`100vh` by definition, so there is nothing to drag.
|
|
565
|
+
- `placement="sidebar"` / `placement="side"` get **width only**; the placement
|
|
566
|
+
owns the height.
|
|
567
|
+
- Everything else resizes on both axes.
|
|
568
|
+
|
|
569
|
+
**The grip sits at the corner your layout grows toward, and the component
|
|
570
|
+
measures which one that is.** A resize has to be computed from the edge that
|
|
571
|
+
stays still, and that belongs to *your* CSS rather than to `placement` — a
|
|
572
|
+
floating panel is pinned bottom-right, an embedded one goes wherever the page
|
|
573
|
+
puts it. The element probes its own geometry and reflects the result as
|
|
574
|
+
`data-resize-anchor` (e.g. `bottom-right` means those two edges are fixed), which
|
|
575
|
+
is what positions the grip.
|
|
576
|
+
|
|
577
|
+
A drag writes `--ag-ui-width` / `--ag-ui-height` on the host **as custom
|
|
578
|
+
properties, not inline `width`/`height`** — the placement rules set those same
|
|
579
|
+
properties, so an inline dimension would outrank them and a panel dragged while
|
|
580
|
+
floating would keep that width after switching to fullscreen.
|
|
581
|
+
|
|
582
|
+
⚠ **A host rule that sizes the element wins over both.** `ag-ui-chat { flex: 1 }`
|
|
583
|
+
stretches the panel to its container and the dragged width has no visible
|
|
584
|
+
effect — which reads as a broken control rather than as your stylesheet winning.
|
|
585
|
+
Give the element `flex: 0 1 auto` (plus `max-width: 100%`) if it lives in a flex
|
|
586
|
+
container.
|
|
587
|
+
|
|
588
|
+
The size persists per tab (`sessionStorage`, namespaced per element like the
|
|
589
|
+
collapsed and theme preferences) and is restored before the first paint.
|
|
590
|
+
Arrow keys resize from the keyboard (`Shift` for a larger step); style the grip
|
|
591
|
+
via the `resize-handle` part.
|
|
592
|
+
|
|
593
|
+
---
|
|
594
|
+
|
|
552
595
|
## Markdown rendering
|
|
553
596
|
|
|
554
597
|
Assistant bubbles render sanitized markdown/HTML via [`marked`](https://www.npmjs.com/package/marked)
|
|
@@ -614,7 +657,7 @@ opt-in via two attributes:
|
|
|
614
657
|
<ag-ui-chat endpoint="/agent/" data-prompt-chips="true" data-slash-commands="true"></ag-ui-chat>
|
|
615
658
|
```
|
|
616
659
|
|
|
617
|
-
A `Skill` is `{ name, title, description?, prompt
|
|
660
|
+
A `Skill` is `{ name, title, description?, prompt?, sendImmediately?, chip? }`. Skills are merged
|
|
618
661
|
from three sources — **backend → embed → client** (later wins by `name`):
|
|
619
662
|
|
|
620
663
|
- `data-skills-url` — a JSON endpoint, fetched with the element's `headers`.
|
|
@@ -623,11 +666,21 @@ from three sources — **backend → embed → client** (later wins by `name`):
|
|
|
623
666
|
|
|
624
667
|
```js
|
|
625
668
|
chat.setSkills([
|
|
669
|
+
// Server-resolved: no prompt here, so picking it sends the bare "/triage"
|
|
670
|
+
// token and the agent decides what it means.
|
|
671
|
+
{ name: "triage", title: "Triage this", chip: true },
|
|
672
|
+
// Client-side: the page owns the wording and fills the placeholders.
|
|
626
673
|
{ name: "summarize", title: "Summarize page", prompt: "Summarize {title}.", chip: true },
|
|
627
674
|
]);
|
|
628
675
|
```
|
|
629
676
|
|
|
630
|
-
|
|
677
|
+
**Prefer omitting `prompt` for anything internal.** A skill is often where a project's workflow is
|
|
678
|
+
written down most plainly, and a catalog is either a plain `GET` or sits in the page source — so
|
|
679
|
+
shipping the wording to the browser publishes it. Without a `prompt` the component sends `/name`
|
|
680
|
+
and the agent expands it (from the harness `Skills` capability, or your own instructions); the text
|
|
681
|
+
never leaves the server. `django-ag-ui`'s `SkillRegistry` supports this by leaving `prompt` unset.
|
|
682
|
+
|
|
683
|
+
A skill that *does* carry a `prompt` may use `{placeholder}` tokens; the `skillContext` property
|
|
631
684
|
(`() => Record<string, unknown>`) supplies the values, filled in before send. A missing placeholder
|
|
632
685
|
blocks the send and shows a hint instead.
|
|
633
686
|
|
|
@@ -635,6 +688,10 @@ blocks the send and shows a hint instead.
|
|
|
635
688
|
chat.skillContext = () => ({ title: document.title });
|
|
636
689
|
```
|
|
637
690
|
|
|
691
|
+
**Picking a skill sends it.** A chip that needs a second click to do anything is a two-step
|
|
692
|
+
shortcut. Set `sendImmediately: false` on a prompt-carrying skill to pre-fill the composer instead —
|
|
693
|
+
useful when the user is expected to edit before sending. A server-resolved skill always sends.
|
|
694
|
+
|
|
638
695
|
---
|
|
639
696
|
|
|
640
697
|
## MPA durability: surviving full page reloads
|