Skip to content

Commit bcda2a1

Browse files
authored
Merge branch 'main' into fix/ENT-658-sdk-thread-tool-roundtrip
2 parents daff127 + f8e38ee commit bcda2a1

25 files changed

Lines changed: 156 additions & 36 deletions

File tree

packages/web-inspector/vitest.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export default defineConfig({
55
environment: "jsdom",
66
globals: true,
77
clearMocks: true,
8+
setupFiles: ["./vitest.setup.ts"],
89
reporters: [["default", { summary: false }]],
910
silent: true,
1011
},
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
// Node 25 ships an experimental built-in `localStorage` global (gated on the
2+
// `--localstorage-file` flag, but the accessor exists unconditionally). When
3+
// vitest boots the jsdom environment, jsdom defines its own `localStorage` on
4+
// the synthetic `window`, but Node's global accessor still wins on
5+
// `globalThis.localStorage` AND — because vitest's jsdom integration aliases
6+
// `window` to `globalThis` — also on `window.localStorage`. The result is that
7+
// `window.localStorage` resolves to Node's stub object which has no `clear`,
8+
// `setItem`, `removeItem`, etc., breaking every test that touches localStorage.
9+
//
10+
// This setup file installs a proper in-memory Storage implementation on both
11+
// `globalThis` and `window` BEFORE any test code runs. The shim is a plain
12+
// object (not a class) so `vi.spyOn(window.localStorage, "getItem")` works —
13+
// vitest needs the methods to be own properties on the spied target.
14+
//
15+
// We re-install the shim in `beforeEach` so a test that did
16+
// `vi.restoreAllMocks()` (which restores spied methods) still sees the shim's
17+
// methods, and so each test starts with a fresh empty store.
18+
19+
import { beforeEach } from "vitest";
20+
21+
function createStorageShim(): Storage {
22+
const store = new Map<string, string>();
23+
const shim = {
24+
get length() {
25+
return store.size;
26+
},
27+
key(index: number): string | null {
28+
return Array.from(store.keys())[index] ?? null;
29+
},
30+
getItem(key: string): string | null {
31+
return store.has(key) ? store.get(key)! : null;
32+
},
33+
setItem(key: string, value: string): void {
34+
store.set(String(key), String(value));
35+
},
36+
removeItem(key: string): void {
37+
store.delete(key);
38+
},
39+
clear(): void {
40+
store.clear();
41+
},
42+
} as Storage;
43+
return shim;
44+
}
45+
46+
function installLocalStorageShim(): void {
47+
const shim = createStorageShim();
48+
// Override the Node 25 global accessor (and any jsdom accessor) with a
49+
// plain data property pointing at our shim. `configurable: true` so a
50+
// subsequent install can replace it.
51+
Object.defineProperty(globalThis, "localStorage", {
52+
value: shim,
53+
writable: true,
54+
configurable: true,
55+
enumerable: true,
56+
});
57+
if (typeof window !== "undefined" && window !== (globalThis as unknown)) {
58+
Object.defineProperty(window, "localStorage", {
59+
value: shim,
60+
writable: true,
61+
configurable: true,
62+
enumerable: true,
63+
});
64+
}
65+
}
66+
67+
// Install once at module load so any top-level code in test files (e.g.
68+
// imports that read localStorage on init) sees the shim.
69+
installLocalStorageShim();
70+
71+
// Re-install before each test so `vi.restoreAllMocks()` from a prior test
72+
// can't leave behind spied/replaced methods, and each test starts with an
73+
// empty store.
74+
beforeEach(() => {
75+
installLocalStorageShim();
76+
});

showcase/integrations/ag2/manifest.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ description: >-
99
partner_docs: null
1010
repo: https://github.com/CopilotKit/CopilotKit/tree/main/showcase/integrations/ag2
1111
copilotkit_version: 2.0.0
12-
backend_url: https://showcase-ag2-production.up.railway.app
1312
deployed: true
1413
docs_mode: authored
1514
sort_order: 100

showcase/integrations/agno/manifest.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ description: >-
99
partner_docs: null
1010
repo: https://github.com/CopilotKit/CopilotKit/tree/main/showcase/integrations/agno
1111
copilotkit_version: 2.0.0
12-
backend_url: https://showcase-agno-production.up.railway.app
1312
deployed: true
1413
docs_mode: authored
1514
sort_order: 90

showcase/integrations/built-in-agent/manifest.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ description: >-
99
partner_docs: null
1010
repo: https://github.com/CopilotKit/CopilotKit/tree/main/showcase/integrations/built-in-agent
1111
copilotkit_version: 2.0.0
12-
backend_url: https://showcase-built-in-agent-production.up.railway.app
1312
deployed: true
1413
docs_mode: authored
1514
sort_order: 5

showcase/integrations/claude-sdk-python/manifest.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ description: >-
1010
partner_docs: null
1111
repo: https://github.com/CopilotKit/CopilotKit/tree/main/showcase/integrations/claude-sdk-python
1212
copilotkit_version: 2.0.0
13-
backend_url: https://showcase-claude-sdk-python-production.up.railway.app
1413
deployed: true
1514
docs_mode: hidden
1615
sort_order: 70

showcase/integrations/claude-sdk-typescript/manifest.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ description: CopilotKit integration with Anthropic's Claude via the Claude SDK f
77
partner_docs: null
88
repo: https://github.com/CopilotKit/CopilotKit/tree/main/showcase/integrations/claude-sdk-typescript
99
copilotkit_version: 2.0.0
10-
backend_url: https://showcase-claude-sdk-typescript-production.up.railway.app
1110
deployed: true
1211
docs_mode: hidden
1312
sort_order: 80

showcase/integrations/crewai-crews/manifest.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ description: CopilotKit integration with CrewAI (Crews)
77
partner_docs: null
88
repo: https://github.com/CopilotKit/CopilotKit/tree/main/showcase/integrations/crewai-crews
99
copilotkit_version: 2.0.0
10-
backend_url: https://showcase-crewai-crews-production.up.railway.app
1110
deployed: true
1211
docs_mode: authored
1312
sort_order: 40

showcase/integrations/google-adk/manifest.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ description: >-
1111
partner_docs: null
1212
repo: https://github.com/CopilotKit/CopilotKit/tree/main/showcase/integrations/google-adk
1313
copilotkit_version: 2.0.0
14-
backend_url: https://showcase-google-adk-production.up.railway.app
1514
deployed: true
1615
docs_mode: generated
1716
sort_order: 15

showcase/integrations/langgraph-fastapi/manifest.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ description: CopilotKit integration with LangGraph (FastAPI)
77
partner_docs: null
88
repo: https://github.com/CopilotKit/CopilotKit/tree/main/showcase/integrations/langgraph-fastapi
99
copilotkit_version: 2.0.0
10-
backend_url: https://showcase-langgraph-fastapi-production.up.railway.app
1110
deployed: true
1211
docs_mode: authored
1312
sort_order: 12

0 commit comments

Comments
 (0)