@artooi/ag-ui-web-component 0.26.0 → 0.26.1

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,55 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.26.1] — 2026-08-25
11
+
12
+ ### Fixed
13
+
14
+ - **A chart the server retracted stayed on screen.** When an update replaced a
15
+ chart with a payload that could not be drawn, the superseded chart was left in
16
+ place — showing numbers the server had already withdrawn, reading as current —
17
+ and then vanished on the next reload, because the *stored* content was the
18
+ version that could not be drawn. Live and reload now agree, and both say gone.
19
+
20
+ - **`enableCharts()` after the element connected silently dropped every chart in
21
+ restored history.** History replays on connect, and charts were off at that
22
+ moment, so they were skipped. That is the ordinary way to call it — you have
23
+ to query the element to call anything on it — so the first call now redraws
24
+ rather than the docs asking for an ordering nobody can satisfy. The README
25
+ example was that order.
26
+
27
+ - **A stacked chart wrote `NaN` into the DOM** for a series carrying more points
28
+ than there are labels. `renderChart` is exported, so it can be handed a spec
29
+ the validator would have refused; a cast there claimed that could not happen.
30
+
31
+ - **A sparse `labels` array was accepted**, drawing a chart with blank axis
32
+ labels — `Array.prototype.some` skips holes.
33
+
34
+ - **A spec inside the point budget could still block the main thread.** The
35
+ point limit bounds the data; the DOM is bounded by labels, since each emits an
36
+ axis node whatever the series count. Now capped at 2,000 labels, and the
37
+ ceiling applies again on every reload of a stored conversation.
38
+
39
+ ### Documentation
40
+
41
+ - **Whether a pushed chart survives a reload depends on where the conversation
42
+ is stored**, and the README now says which is which. A client-side store keeps
43
+ activities; a server storing the thread as the model's message history does
44
+ not, because a pushed chart is deliberately not in that history. An
45
+ agent-requested chart survives either way — its spec travels as the tool
46
+ call's arguments.
47
+
48
+ ### Changed
49
+
50
+ - **The handler/render split is now enforced by a signature rather than a
51
+ comment.** The replay path is handed the `render` function alone, never the
52
+ tool that owns it, so the code that runs on restore cannot reach `handler`.
53
+ The documentation claimed this guarantee was structural while the code passed
54
+ the whole tool around and relied on two call sites happening not to use it.
55
+
56
+ - The built-in chart tool no longer builds the chart twice per call, once only
57
+ to choose its reply string.
58
+
10
59
  ## [0.26.0] — 2026-08-25
11
60
 
12
61
  ### Added
@@ -1613,7 +1662,8 @@ hosts that both arrange the page the way it expects.
1613
1662
  ### Notes
1614
1663
  - First release — exercising the automated npm OIDC publish pipeline end-to-end.
1615
1664
 
1616
- [Unreleased]: https://github.com/Artui/ag-ui-web-component/compare/v0.26.0...HEAD
1665
+ [Unreleased]: https://github.com/Artui/ag-ui-web-component/compare/v0.26.1...HEAD
1666
+ [0.26.1]: https://github.com/Artui/ag-ui-web-component/compare/v0.26.0...v0.26.1
1617
1667
  [0.26.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.25.2...v0.26.0
1618
1668
  [0.25.2]: https://github.com/Artui/ag-ui-web-component/compare/v0.25.1...v0.25.2
1619
1669
  [0.25.1]: https://github.com/Artui/ag-ui-web-component/compare/v0.25.0...v0.25.1
package/README.md CHANGED
@@ -871,6 +871,16 @@ const chat = document.querySelector("ag-ui-chat");
871
871
  chat.enableCharts(["tool", "activity"]);
872
872
  ```
873
873
 
874
+ Order does not matter. Calling it after the element is on the page redraws any
875
+ charts already in the restored history, so you do not have to reach the element
876
+ before it connects — which you generally cannot.
877
+
878
+ Specs are bounded, and anything outside is dropped rather than half-drawn: at
879
+ most **20,000 points** and **2,000 labels**, and every point a finite number no
880
+ larger than **1e15**. The first two keep a stored transcript from blocking the
881
+ main thread on every reload; the last one keeps the value range finite, since
882
+ scaling divides by it.
883
+
874
884
  **`"tool"`** registers a `render_chart` tool the agent may call. The numbers are
875
885
  in its context, so it can talk about them; it costs one model round.
876
886
 
@@ -880,6 +890,13 @@ reaches the model, there is no extra round, and this is the only route that can
880
890
  **update a chart in place** — the server repeats the same `messageId` to redraw
881
891
  it, or sends an `ACTIVITY_DELTA` to move one series as a computation advances.
882
892
 
893
+ **Whether a pushed chart survives a reload depends on where the conversation is
894
+ stored.** A client-side store keeps activities, so it comes back. A server that
895
+ stores the thread as the model's message history does not — a pushed chart is
896
+ deliberately not in that history, which is the reason to push it. A chart the
897
+ agent asked for survives either way, because its spec travels as the tool call's
898
+ arguments and the component redraws from those without re-running anything.
899
+
883
900
  Either way the payload is the same shape:
884
901
 
885
902
  ```json
@@ -917,10 +934,13 @@ chat.registerTool({
917
934
 
918
935
  **`render` is the only half a restored transcript replays.** Replaying a tool's
919
936
  *effect* is out of the question — re-running a form-filling tool on every reload
920
- is a bug so the restore path holds no reference to `handler` and cannot run
921
- it. That makes the guarantee structural rather than a promise, and it is why
922
- `render` has to be a pure, deterministic function of its arguments: it runs
923
- again every time the conversation is restored.
937
+ is a bug. The replay path is handed the `render` function alone, never the tool
938
+ that owns it, so the code that runs on restore cannot reach `handler` even by
939
+ mistake: adding a "no render? fall back to the handler" convenience there means
940
+ changing a type signature first, which is the moment the question gets asked.
941
+
942
+ That is why `render` has to be a pure, deterministic function of its arguments —
943
+ it runs again every time the conversation is restored.
924
944
 
925
945
  ---
926
946