@artooi/ag-ui-web-component 0.14.1 → 0.15.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.
@@ -1 +1 @@
1
- {"version":3,"file":"render_markdown.d.ts","sourceRoot":"","sources":["../../src/ui/render_markdown.ts"],"names":[],"mappings":"AAoEA,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;CAChC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAcpF"}
1
+ {"version":3,"file":"render_markdown.d.ts","sourceRoot":"","sources":["../../src/ui/render_markdown.ts"],"names":[],"mappings":"AAwFA,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;CAChC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAcpF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artooi/ag-ui-web-component",
3
- "version": "0.14.1",
3
+ "version": "0.15.0",
4
4
  "description": "Framework-free <ag-ui-chat> Web Component over the AG-UI protocol. Drop-in chat sidebar with a pluggable client-side tool registry, DOM driver primitives, animations, and destructive-action confirmation modal.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -56,15 +56,17 @@
56
56
  "dependencies": {
57
57
  "@ag-ui/client": ">=0.0.54 <0.1",
58
58
  "@ag-ui/core": ">=0.0.54 <0.1",
59
- "dompurify": "3.4.7",
59
+ "dompurify": "^3.4.13",
60
60
  "marked": "^18.0.4"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@biomejs/biome": "^2.4.0",
64
64
  "@types/node": "^26.1.0",
65
+ "@vitest/browser": "^3.2.7",
65
66
  "@vitest/coverage-v8": "^3.0.0",
66
67
  "esbuild": "^0.28.1",
67
68
  "happy-dom": "^20.11.1",
69
+ "playwright": "^1.62.1",
68
70
  "typescript": "^5.7.0",
69
71
  "vitest": "^3.0.0"
70
72
  },
@@ -1,13 +1,33 @@
1
- // ``dompurify`` is pinned at exactly 3.4.7 in package.json not a caret
2
- // range. 3.4.8 through at least 3.4.13 mis-sanitise under happy-dom: the
3
- // sanitiser silently passes ``<script>`` and ``<img>`` straight through, which
4
- // this module's own tests catch. Verified again 2026-08-07 against happy-dom
5
- // 20.11.1, so it is not fixed by moving the test DOM forward either.
1
+ // DOMPurify is exercised in a **real browser** by the `chromium` project in
2
+ // vitest.config.ts, not by the happy-dom suite. That is deliberate: 3.4.8+ do
3
+ // not sanitise under happy-dom at all — `<script>` and `<img>` pass straight
4
+ // through so a happy-dom-only suite can go green while this module ships no
5
+ // sanitisation whatsoever.
6
6
  //
7
- // That leaves four open dompurify advisories (three LOW, one MEDIUM) knowingly
8
- // unpatched. The trade is deliberate: those advisories describe narrow bypasses,
9
- // while taking them costs *all* sanitisation under the only DOM we can test in.
10
- // Revisit whenever either project moves; the tests are the acceptance check.
7
+ // **Root cause, upstream, and both are refusing to move.** DOMPurify 3.4.8
8
+ // changed one line, reading the tag name through
9
+ // `lookupGetter(Node.prototype, "nodeName")` instead of `currentNode.nodeName`
10
+ // (cure53/DOMPurify 3.4.7...3.4.8). happy-dom defines an *own* `nodeName`
11
+ // getter on **both** `Node.prototype` (returning `""`) and `Element.prototype`,
12
+ // so grabbing the base one defeats the dispatch and every element resolves to
13
+ // `tagName === ""`. Not in ALLOWED_TAGS, so the wrapper is stripped and its
14
+ // children are re-inserted as clones the NodeIterator never revisits — which is
15
+ // why nested payloads come back *entirely* unsanitised. Real browsers and jsdom
16
+ // define `nodeName` only on `Node.prototype` and are unaffected.
17
+ //
18
+ // happy-dom bug: capricorn86/happy-dom#2182 (open)
19
+ // working fix: capricorn86/happy-dom#2183 (closed, never merged)
20
+ // DOMPurify's answer: cure53/DOMPurify#1457, #1496 (closed, wontfix —
21
+ // "happy-dom is not supported")
22
+ //
23
+ // ⚠ DOMPurify's README names happy-dom as **not safe**: combining them "will
24
+ // likely lead to XSS". jsdom is the only non-browser DOM it supports. So the
25
+ // old exact pin at 3.4.7 was never the safety it looked like — cure53 notes it
26
+ // "doesn't really work, it just appears so". Running these assertions in
27
+ // Chromium is the fix; the pin was a placebo.
28
+ //
29
+ // ⚠ If you ever move these assertions back under happy-dom to make them faster,
30
+ // you remove the only check that this module does anything at all.
11
31
  import DOMPurify from "dompurify";
12
32
  import { Marked } from "marked";
13
33
 
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION: string = "0.14.1";
1
+ export const VERSION: string = "0.15.0";