@copilotkit/web-inspector 1.59.5 → 1.60.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 (2) hide show
  1. package/package.json +3 -3
  2. package/vitest.config.ts +54 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@copilotkit/web-inspector",
3
- "version": "1.59.5",
3
+ "version": "1.60.0",
4
4
  "description": "Lit-based web component for the CopilotKit web inspector",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,11 +23,11 @@
23
23
  "access": "public"
24
24
  },
25
25
  "dependencies": {
26
- "@ag-ui/client": "0.0.53",
26
+ "@ag-ui/client": "0.0.56",
27
27
  "lit": "^3.2.0",
28
28
  "lucide": "^0.525.0",
29
29
  "marked": "^12.0.2",
30
- "@copilotkit/core": "1.59.5"
30
+ "@copilotkit/core": "1.60.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@tailwindcss/cli": "^4.1.11",
package/vitest.config.ts CHANGED
@@ -1,5 +1,55 @@
1
1
  import { defineConfig } from "vitest/config";
2
2
 
3
+ // Node 25.0 unflagged the experimental Web Storage API (nodejs/node#57658),
4
+ // so on Node 25+ a stub `window.localStorage` is installed BEFORE vitest's
5
+ // jsdom environment runs. vitest's jsdom env does NOT replace it, so the
6
+ // stub stays in place — and it has no `.clear()` / `.getItem()` /
7
+ // `.setItem()` methods. Any test that touches localStorage crashes with
8
+ // `TypeError: window.localStorage.clear is not a function`.
9
+ //
10
+ // This is NOT fixed by upgrading vitest or jsdom:
11
+ // - vitest 4.x + jsdom 29 still leave Node's stub in place — confirmed
12
+ // in vitest-dev/vitest#8757 (closed as "non-LTS, won't fix").
13
+ // - Node 25.2.0 tried throwing on access; 25.2.1 reverted it as too
14
+ // breaking. The real Node-side fix is targeted for Node 26.0
15
+ // (semver-major), no backport — see nodejs/node#60303.
16
+ //
17
+ // On Node 22.4–24.x, the API exists but stays behind
18
+ // `--experimental-webstorage`, so nothing gets installed and tests pass
19
+ // without any workaround. The bug ONLY bites on Node 25+.
20
+ //
21
+ // Workaround: pass `--no-experimental-webstorage` to the vitest worker so
22
+ // Node doesn't install the stub and jsdom owns the localStorage globals
23
+ // cleanly. This is the canonical community workaround (also used by
24
+ // happy-dom#1950, ArkType, and the vitest#8757 thread).
25
+ //
26
+ // Version gate:
27
+ // - Lower bound (Node 22.4+): the flag only exists from Node 22.4
28
+ // onward. Passing it to older Node (e.g. CI's Node 20) makes Node
29
+ // refuse to start with "not allowed in NODE_OPTIONS". On Node
30
+ // 22.4–24.x the flag is a harmless no-op since webstorage is still
31
+ // gated by --experimental-webstorage, but we keep the lower bound
32
+ // strict so we don't silently fail closed on Node 20.
33
+ // - Upper bound (Node < 26): Node 26 is expected to land the upstream
34
+ // fix and may remove / rename this flag as part of the unflagging
35
+ // cleanup. We gate the upper bound so this config doesn't blow up
36
+ // on Node 26+ in the future. Node 26 isn't out as of this commit,
37
+ // so the upper bound is purely defensive.
38
+ //
39
+ // When the minimum supported Node version is >=26 (which will be a long
40
+ // time — Node 26 will likely arrive in late 2026 and need to age into
41
+ // LTS), this whole block can be removed outright.
42
+ const [nodeMajor, nodeMinor] = process.versions.node.split(".").map(Number);
43
+ const needsNoExperimentalWebstorage =
44
+ // lower bound: flag exists (Node 22.4+)
45
+ (nodeMajor! > 22 || (nodeMajor === 22 && nodeMinor! >= 4)) &&
46
+ // upper bound: Node hasn't fixed the underlying bug yet (< 26)
47
+ nodeMajor! < 26;
48
+
49
+ const workerExecArgv = needsNoExperimentalWebstorage
50
+ ? ["--no-experimental-webstorage"]
51
+ : [];
52
+
3
53
  export default defineConfig({
4
54
  test: {
5
55
  environment: "jsdom",
@@ -8,5 +58,9 @@ export default defineConfig({
8
58
  setupFiles: ["./vitest.setup.ts"],
9
59
  reporters: [["default", { summary: false }]],
10
60
  silent: true,
61
+ poolOptions: {
62
+ forks: { execArgv: workerExecArgv },
63
+ threads: { execArgv: workerExecArgv },
64
+ },
11
65
  },
12
66
  });