@copilotkit/react-native 1.57.0-canary.1778116520
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/LICENSE +21 -0
- package/README.md +54 -0
- package/dist/index.cjs +203 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +51 -0
- package/dist/index.d.mts +51 -0
- package/dist/index.mjs +101 -0
- package/dist/index.mjs.map +1 -0
- package/dist/polyfills/crypto.cjs +15 -0
- package/dist/polyfills/crypto.cjs.map +1 -0
- package/dist/polyfills/crypto.d.cts +1 -0
- package/dist/polyfills/crypto.d.mts +1 -0
- package/dist/polyfills/crypto.mjs +15 -0
- package/dist/polyfills/crypto.mjs.map +1 -0
- package/dist/polyfills/dom.cjs +59 -0
- package/dist/polyfills/dom.cjs.map +1 -0
- package/dist/polyfills/dom.d.cts +1 -0
- package/dist/polyfills/dom.d.mts +1 -0
- package/dist/polyfills/dom.mjs +59 -0
- package/dist/polyfills/dom.mjs.map +1 -0
- package/dist/polyfills/encoding.cjs +19 -0
- package/dist/polyfills/encoding.cjs.map +1 -0
- package/dist/polyfills/encoding.d.cts +1 -0
- package/dist/polyfills/encoding.d.mts +1 -0
- package/dist/polyfills/encoding.mjs +19 -0
- package/dist/polyfills/encoding.mjs.map +1 -0
- package/dist/polyfills/location.cjs +18 -0
- package/dist/polyfills/location.cjs.map +1 -0
- package/dist/polyfills/location.d.cts +1 -0
- package/dist/polyfills/location.d.mts +1 -0
- package/dist/polyfills/location.mjs +18 -0
- package/dist/polyfills/location.mjs.map +1 -0
- package/dist/polyfills/streams.cjs +20 -0
- package/dist/polyfills/streams.cjs.map +1 -0
- package/dist/polyfills/streams.d.cts +1 -0
- package/dist/polyfills/streams.d.mts +1 -0
- package/dist/polyfills/streams.mjs +20 -0
- package/dist/polyfills/streams.mjs.map +1 -0
- package/dist/polyfills.cjs +196 -0
- package/dist/polyfills.cjs.map +1 -0
- package/dist/polyfills.d.cts +1 -0
- package/dist/polyfills.d.mts +1 -0
- package/dist/polyfills.mjs +196 -0
- package/dist/polyfills.mjs.map +1 -0
- package/package.json +92 -0
- package/project.json +18 -0
- package/src/CopilotKitProvider.tsx +188 -0
- package/src/__tests__/copilotkit-provider.test.tsx +424 -0
- package/src/__tests__/headless-integration.test.tsx +378 -0
- package/src/__tests__/polyfills.test.ts +242 -0
- package/src/__tests__/setup.ts +9 -0
- package/src/__tests__/streaming-fetch.test.ts +486 -0
- package/src/index.ts +44 -0
- package/src/polyfills/crypto.ts +34 -0
- package/src/polyfills/dom.ts +85 -0
- package/src/polyfills/encoding.ts +20 -0
- package/src/polyfills/location.ts +30 -0
- package/src/polyfills/streams.ts +27 -0
- package/src/polyfills.ts +22 -0
- package/src/streaming-fetch.ts +336 -0
- package/src/types.d.ts +23 -0
- package/tsconfig.json +16 -0
- package/tsdown.config.ts +25 -0
- package/vitest.config.mjs +17 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
//#region src/polyfills/dom.ts
|
|
2
|
+
const g = globalThis;
|
|
3
|
+
if (typeof g.DOMException === "undefined") {
|
|
4
|
+
class DOMExceptionPolyfill extends Error {
|
|
5
|
+
code;
|
|
6
|
+
constructor(message, name) {
|
|
7
|
+
super(message);
|
|
8
|
+
this.name = name || "DOMException";
|
|
9
|
+
this.code = 0;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
g.DOMException = DOMExceptionPolyfill;
|
|
13
|
+
}
|
|
14
|
+
if (typeof g.Headers === "undefined") {
|
|
15
|
+
class HeadersPolyfill {
|
|
16
|
+
_map = {};
|
|
17
|
+
constructor(init) {
|
|
18
|
+
if (init) if (init instanceof HeadersPolyfill) this._map = { ...init._map };
|
|
19
|
+
else for (const [key, value] of Object.entries(init)) this._map[key.toLowerCase()] = value;
|
|
20
|
+
}
|
|
21
|
+
get(name) {
|
|
22
|
+
return this._map[name.toLowerCase()] ?? null;
|
|
23
|
+
}
|
|
24
|
+
set(name, value) {
|
|
25
|
+
this._map[name.toLowerCase()] = value;
|
|
26
|
+
}
|
|
27
|
+
has(name) {
|
|
28
|
+
return name.toLowerCase() in this._map;
|
|
29
|
+
}
|
|
30
|
+
delete(name) {
|
|
31
|
+
delete this._map[name.toLowerCase()];
|
|
32
|
+
}
|
|
33
|
+
append(name, value) {
|
|
34
|
+
const key = name.toLowerCase();
|
|
35
|
+
if (key in this._map) this._map[key] += ", " + value;
|
|
36
|
+
else this._map[key] = value;
|
|
37
|
+
}
|
|
38
|
+
entries() {
|
|
39
|
+
return Object.entries(this._map)[Symbol.iterator]();
|
|
40
|
+
}
|
|
41
|
+
keys() {
|
|
42
|
+
return Object.keys(this._map)[Symbol.iterator]();
|
|
43
|
+
}
|
|
44
|
+
values() {
|
|
45
|
+
return Object.values(this._map)[Symbol.iterator]();
|
|
46
|
+
}
|
|
47
|
+
forEach(callback) {
|
|
48
|
+
for (const [key, value] of Object.entries(this._map)) callback(value, key, this);
|
|
49
|
+
}
|
|
50
|
+
[Symbol.iterator]() {
|
|
51
|
+
return this.entries();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
g.Headers = HeadersPolyfill;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
//#endregion
|
|
58
|
+
export { };
|
|
59
|
+
//# sourceMappingURL=dom.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom.mjs","names":[],"sources":["../../src/polyfills/dom.ts"],"sourcesContent":["/**\n * Polyfill: DOMException, Headers\n *\n * DOMException is used by CopilotKit's isAbortError check.\n * Headers is used by CopilotKit's request construction.\n * Skipped if the globals are already defined.\n *\n * Usage:\n * import \"@copilotkit/react-native/polyfills/dom\";\n */\n\nexport {};\n\nconst g = globalThis as Record<string, unknown>;\n\n// DOMException\nif (typeof g.DOMException === \"undefined\") {\n class DOMExceptionPolyfill extends Error {\n code: number;\n constructor(message?: string, name?: string) {\n super(message);\n this.name = name || \"DOMException\";\n this.code = 0;\n }\n }\n g.DOMException = DOMExceptionPolyfill;\n}\n\n// Headers\nif (typeof g.Headers === \"undefined\") {\n class HeadersPolyfill {\n private _map: Record<string, string> = {};\n constructor(init?: Record<string, string> | HeadersPolyfill) {\n if (init) {\n if (init instanceof HeadersPolyfill) {\n this._map = { ...init._map };\n } else {\n for (const [key, value] of Object.entries(init)) {\n this._map[key.toLowerCase()] = value;\n }\n }\n }\n }\n get(name: string): string | null {\n return this._map[name.toLowerCase()] ?? null;\n }\n set(name: string, value: string): void {\n this._map[name.toLowerCase()] = value;\n }\n has(name: string): boolean {\n return name.toLowerCase() in this._map;\n }\n delete(name: string): void {\n delete this._map[name.toLowerCase()];\n }\n append(name: string, value: string): void {\n const key = name.toLowerCase();\n if (key in this._map) {\n this._map[key] += \", \" + value;\n } else {\n this._map[key] = value;\n }\n }\n entries(): IterableIterator<[string, string]> {\n return Object.entries(this._map)[Symbol.iterator]();\n }\n keys(): IterableIterator<string> {\n return Object.keys(this._map)[Symbol.iterator]();\n }\n values(): IterableIterator<string> {\n return Object.values(this._map)[Symbol.iterator]();\n }\n forEach(\n callback: (value: string, key: string, parent: HeadersPolyfill) => void,\n ): void {\n for (const [key, value] of Object.entries(this._map)) {\n callback(value, key, this);\n }\n }\n [Symbol.iterator](): IterableIterator<[string, string]> {\n return this.entries();\n }\n }\n g.Headers = HeadersPolyfill;\n}\n"],"mappings":";AAaA,MAAM,IAAI;AAGV,IAAI,OAAO,EAAE,iBAAiB,aAAa;CACzC,MAAM,6BAA6B,MAAM;EACvC;EACA,YAAY,SAAkB,MAAe;AAC3C,SAAM,QAAQ;AACd,QAAK,OAAO,QAAQ;AACpB,QAAK,OAAO;;;AAGhB,GAAE,eAAe;;AAInB,IAAI,OAAO,EAAE,YAAY,aAAa;CACpC,MAAM,gBAAgB;EACpB,AAAQ,OAA+B,EAAE;EACzC,YAAY,MAAiD;AAC3D,OAAI,KACF,KAAI,gBAAgB,gBAClB,MAAK,OAAO,EAAE,GAAG,KAAK,MAAM;OAE5B,MAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,KAAK,CAC7C,MAAK,KAAK,IAAI,aAAa,IAAI;;EAKvC,IAAI,MAA6B;AAC/B,UAAO,KAAK,KAAK,KAAK,aAAa,KAAK;;EAE1C,IAAI,MAAc,OAAqB;AACrC,QAAK,KAAK,KAAK,aAAa,IAAI;;EAElC,IAAI,MAAuB;AACzB,UAAO,KAAK,aAAa,IAAI,KAAK;;EAEpC,OAAO,MAAoB;AACzB,UAAO,KAAK,KAAK,KAAK,aAAa;;EAErC,OAAO,MAAc,OAAqB;GACxC,MAAM,MAAM,KAAK,aAAa;AAC9B,OAAI,OAAO,KAAK,KACd,MAAK,KAAK,QAAQ,OAAO;OAEzB,MAAK,KAAK,OAAO;;EAGrB,UAA8C;AAC5C,UAAO,OAAO,QAAQ,KAAK,KAAK,CAAC,OAAO,WAAW;;EAErD,OAAiC;AAC/B,UAAO,OAAO,KAAK,KAAK,KAAK,CAAC,OAAO,WAAW;;EAElD,SAAmC;AACjC,UAAO,OAAO,OAAO,KAAK,KAAK,CAAC,OAAO,WAAW;;EAEpD,QACE,UACM;AACN,QAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,KAAK,KAAK,CAClD,UAAS,OAAO,KAAK,KAAK;;EAG9B,CAAC,OAAO,YAAgD;AACtD,UAAO,KAAK,SAAS;;;AAGzB,GAAE,UAAU"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const require_index = require('../index.cjs');
|
|
2
|
+
let text_encoding = require("text-encoding");
|
|
3
|
+
|
|
4
|
+
//#region src/polyfills/encoding.ts
|
|
5
|
+
/**
|
|
6
|
+
* Polyfill: TextEncoder, TextDecoder
|
|
7
|
+
*
|
|
8
|
+
* Required for stream chunk processing in CopilotKit.
|
|
9
|
+
* Skipped if the globals are already defined.
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* import "@copilotkit/react-native/polyfills/encoding";
|
|
13
|
+
*/
|
|
14
|
+
const g = globalThis;
|
|
15
|
+
if (typeof g.TextEncoder === "undefined") g.TextEncoder = text_encoding.TextEncoder;
|
|
16
|
+
if (typeof g.TextDecoder === "undefined") g.TextDecoder = text_encoding.TextDecoder;
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
//# sourceMappingURL=encoding.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encoding.cjs","names":["TextEncoder","TextDecoder"],"sources":["../../src/polyfills/encoding.ts"],"sourcesContent":["/**\n * Polyfill: TextEncoder, TextDecoder\n *\n * Required for stream chunk processing in CopilotKit.\n * Skipped if the globals are already defined.\n *\n * Usage:\n * import \"@copilotkit/react-native/polyfills/encoding\";\n */\n\nimport { TextEncoder, TextDecoder } from \"text-encoding\";\n\nconst g = globalThis as Record<string, unknown>;\n\nif (typeof g.TextEncoder === \"undefined\") {\n g.TextEncoder = TextEncoder;\n}\nif (typeof g.TextDecoder === \"undefined\") {\n g.TextDecoder = TextDecoder;\n}\n"],"mappings":";;;;;;;;;;;;;AAYA,MAAM,IAAI;AAEV,IAAI,OAAO,EAAE,gBAAgB,YAC3B,GAAE,cAAcA;AAElB,IAAI,OAAO,EAAE,gBAAgB,YAC3B,GAAE,cAAcC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TextDecoder, TextEncoder } from "text-encoding";
|
|
2
|
+
|
|
3
|
+
//#region src/polyfills/encoding.ts
|
|
4
|
+
/**
|
|
5
|
+
* Polyfill: TextEncoder, TextDecoder
|
|
6
|
+
*
|
|
7
|
+
* Required for stream chunk processing in CopilotKit.
|
|
8
|
+
* Skipped if the globals are already defined.
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
* import "@copilotkit/react-native/polyfills/encoding";
|
|
12
|
+
*/
|
|
13
|
+
const g = globalThis;
|
|
14
|
+
if (typeof g.TextEncoder === "undefined") g.TextEncoder = TextEncoder;
|
|
15
|
+
if (typeof g.TextDecoder === "undefined") g.TextDecoder = TextDecoder;
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { };
|
|
19
|
+
//# sourceMappingURL=encoding.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encoding.mjs","names":[],"sources":["../../src/polyfills/encoding.ts"],"sourcesContent":["/**\n * Polyfill: TextEncoder, TextDecoder\n *\n * Required for stream chunk processing in CopilotKit.\n * Skipped if the globals are already defined.\n *\n * Usage:\n * import \"@copilotkit/react-native/polyfills/encoding\";\n */\n\nimport { TextEncoder, TextDecoder } from \"text-encoding\";\n\nconst g = globalThis as Record<string, unknown>;\n\nif (typeof g.TextEncoder === \"undefined\") {\n g.TextEncoder = TextEncoder;\n}\nif (typeof g.TextDecoder === \"undefined\") {\n g.TextDecoder = TextDecoder;\n}\n"],"mappings":";;;;;;;;;;;;AAYA,MAAM,IAAI;AAEV,IAAI,OAAO,EAAE,gBAAgB,YAC3B,GAAE,cAAc;AAElB,IAAI,OAAO,EAAE,gBAAgB,YAC3B,GAAE,cAAc"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/polyfills/location.ts
|
|
3
|
+
if (typeof window !== "undefined") {
|
|
4
|
+
const w = window;
|
|
5
|
+
if (!w.location) w.location = {
|
|
6
|
+
hostname: "react-native.invalid",
|
|
7
|
+
href: "http://react-native.invalid",
|
|
8
|
+
origin: "http://react-native.invalid",
|
|
9
|
+
protocol: "http:",
|
|
10
|
+
host: "react-native.invalid",
|
|
11
|
+
pathname: "/",
|
|
12
|
+
search: "",
|
|
13
|
+
hash: ""
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
//# sourceMappingURL=location.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location.cjs","names":[],"sources":["../../src/polyfills/location.ts"],"sourcesContent":["/**\n * Polyfill: window.location\n *\n * Required by shouldShowDevConsole (hostname check) and agent runtime\n * URL resolution (window.location.origin). Uses an obviously invalid\n * hostname to avoid tricking localhost-detection code.\n *\n * Skipped if window.location is already defined.\n *\n * Usage:\n * import \"@copilotkit/react-native/polyfills/location\";\n */\n\nexport {};\n\nif (typeof window !== \"undefined\") {\n const w = window as unknown as Record<string, unknown>;\n if (!w.location) {\n w.location = {\n hostname: \"react-native.invalid\",\n href: \"http://react-native.invalid\",\n origin: \"http://react-native.invalid\",\n protocol: \"http:\",\n host: \"react-native.invalid\",\n pathname: \"/\",\n search: \"\",\n hash: \"\",\n };\n }\n}\n"],"mappings":";;AAeA,IAAI,OAAO,WAAW,aAAa;CACjC,MAAM,IAAI;AACV,KAAI,CAAC,EAAE,SACL,GAAE,WAAW;EACX,UAAU;EACV,MAAM;EACN,QAAQ;EACR,UAAU;EACV,MAAM;EACN,UAAU;EACV,QAAQ;EACR,MAAM;EACP"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/polyfills/location.ts
|
|
2
|
+
if (typeof window !== "undefined") {
|
|
3
|
+
const w = window;
|
|
4
|
+
if (!w.location) w.location = {
|
|
5
|
+
hostname: "react-native.invalid",
|
|
6
|
+
href: "http://react-native.invalid",
|
|
7
|
+
origin: "http://react-native.invalid",
|
|
8
|
+
protocol: "http:",
|
|
9
|
+
host: "react-native.invalid",
|
|
10
|
+
pathname: "/",
|
|
11
|
+
search: "",
|
|
12
|
+
hash: ""
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { };
|
|
18
|
+
//# sourceMappingURL=location.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location.mjs","names":[],"sources":["../../src/polyfills/location.ts"],"sourcesContent":["/**\n * Polyfill: window.location\n *\n * Required by shouldShowDevConsole (hostname check) and agent runtime\n * URL resolution (window.location.origin). Uses an obviously invalid\n * hostname to avoid tricking localhost-detection code.\n *\n * Skipped if window.location is already defined.\n *\n * Usage:\n * import \"@copilotkit/react-native/polyfills/location\";\n */\n\nexport {};\n\nif (typeof window !== \"undefined\") {\n const w = window as unknown as Record<string, unknown>;\n if (!w.location) {\n w.location = {\n hostname: \"react-native.invalid\",\n href: \"http://react-native.invalid\",\n origin: \"http://react-native.invalid\",\n protocol: \"http:\",\n host: \"react-native.invalid\",\n pathname: \"/\",\n search: \"\",\n hash: \"\",\n };\n }\n}\n"],"mappings":";AAeA,IAAI,OAAO,WAAW,aAAa;CACjC,MAAM,IAAI;AACV,KAAI,CAAC,EAAE,SACL,GAAE,WAAW;EACX,UAAU;EACV,MAAM;EACN,QAAQ;EACR,UAAU;EACV,MAAM;EACN,UAAU;EACV,QAAQ;EACR,MAAM;EACP"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const require_index = require('../index.cjs');
|
|
2
|
+
let web_streams_polyfill = require("web-streams-polyfill");
|
|
3
|
+
|
|
4
|
+
//#region src/polyfills/streams.ts
|
|
5
|
+
/**
|
|
6
|
+
* Polyfill: ReadableStream, WritableStream, TransformStream
|
|
7
|
+
*
|
|
8
|
+
* Required for SSE streaming in CopilotKit.
|
|
9
|
+
* Skipped individually if the global already has each class defined.
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* import "@copilotkit/react-native/polyfills/streams";
|
|
13
|
+
*/
|
|
14
|
+
const g = globalThis;
|
|
15
|
+
if (typeof g.ReadableStream === "undefined") g.ReadableStream = web_streams_polyfill.ReadableStream;
|
|
16
|
+
if (typeof g.WritableStream === "undefined") g.WritableStream = web_streams_polyfill.WritableStream;
|
|
17
|
+
if (typeof g.TransformStream === "undefined") g.TransformStream = web_streams_polyfill.TransformStream;
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
//# sourceMappingURL=streams.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streams.cjs","names":["ReadableStream","WritableStream","TransformStream"],"sources":["../../src/polyfills/streams.ts"],"sourcesContent":["/**\n * Polyfill: ReadableStream, WritableStream, TransformStream\n *\n * Required for SSE streaming in CopilotKit.\n * Skipped individually if the global already has each class defined.\n *\n * Usage:\n * import \"@copilotkit/react-native/polyfills/streams\";\n */\n\nimport {\n ReadableStream,\n WritableStream,\n TransformStream,\n} from \"web-streams-polyfill\";\n\nconst g = globalThis as Record<string, unknown>;\n\nif (typeof g.ReadableStream === \"undefined\") {\n g.ReadableStream = ReadableStream;\n}\nif (typeof g.WritableStream === \"undefined\") {\n g.WritableStream = WritableStream;\n}\nif (typeof g.TransformStream === \"undefined\") {\n g.TransformStream = TransformStream;\n}\n"],"mappings":";;;;;;;;;;;;;AAgBA,MAAM,IAAI;AAEV,IAAI,OAAO,EAAE,mBAAmB,YAC9B,GAAE,iBAAiBA;AAErB,IAAI,OAAO,EAAE,mBAAmB,YAC9B,GAAE,iBAAiBC;AAErB,IAAI,OAAO,EAAE,oBAAoB,YAC/B,GAAE,kBAAkBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReadableStream, TransformStream, WritableStream } from "web-streams-polyfill";
|
|
2
|
+
|
|
3
|
+
//#region src/polyfills/streams.ts
|
|
4
|
+
/**
|
|
5
|
+
* Polyfill: ReadableStream, WritableStream, TransformStream
|
|
6
|
+
*
|
|
7
|
+
* Required for SSE streaming in CopilotKit.
|
|
8
|
+
* Skipped individually if the global already has each class defined.
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
* import "@copilotkit/react-native/polyfills/streams";
|
|
12
|
+
*/
|
|
13
|
+
const g = globalThis;
|
|
14
|
+
if (typeof g.ReadableStream === "undefined") g.ReadableStream = ReadableStream;
|
|
15
|
+
if (typeof g.WritableStream === "undefined") g.WritableStream = WritableStream;
|
|
16
|
+
if (typeof g.TransformStream === "undefined") g.TransformStream = TransformStream;
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { };
|
|
20
|
+
//# sourceMappingURL=streams.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streams.mjs","names":[],"sources":["../../src/polyfills/streams.ts"],"sourcesContent":["/**\n * Polyfill: ReadableStream, WritableStream, TransformStream\n *\n * Required for SSE streaming in CopilotKit.\n * Skipped individually if the global already has each class defined.\n *\n * Usage:\n * import \"@copilotkit/react-native/polyfills/streams\";\n */\n\nimport {\n ReadableStream,\n WritableStream,\n TransformStream,\n} from \"web-streams-polyfill\";\n\nconst g = globalThis as Record<string, unknown>;\n\nif (typeof g.ReadableStream === \"undefined\") {\n g.ReadableStream = ReadableStream;\n}\nif (typeof g.WritableStream === \"undefined\") {\n g.WritableStream = WritableStream;\n}\nif (typeof g.TransformStream === \"undefined\") {\n g.TransformStream = TransformStream;\n}\n"],"mappings":";;;;;;;;;;;;AAgBA,MAAM,IAAI;AAEV,IAAI,OAAO,EAAE,mBAAmB,YAC9B,GAAE,iBAAiB;AAErB,IAAI,OAAO,EAAE,mBAAmB,YAC9B,GAAE,iBAAiB;AAErB,IAAI,OAAO,EAAE,oBAAoB,YAC/B,GAAE,kBAAkB"}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/streaming-fetch.ts
|
|
3
|
+
function createAbortError() {
|
|
4
|
+
return new global.DOMException("The operation was aborted.", "AbortError");
|
|
5
|
+
}
|
|
6
|
+
function installStreamingFetch() {
|
|
7
|
+
try {
|
|
8
|
+
const testResponse = new Response("");
|
|
9
|
+
if (testResponse.body != null && typeof testResponse.body.getReader === "function") return;
|
|
10
|
+
} catch (e) {
|
|
11
|
+
if (__DEV__ && e instanceof Error && !(e instanceof ReferenceError) && !(e instanceof TypeError)) console.warn("[CopilotKit] Unexpected error during streaming fetch feature detection, installing XHR-based polyfill:", e);
|
|
12
|
+
}
|
|
13
|
+
const originalFetch = global.fetch;
|
|
14
|
+
const TextEncoder = global.TextEncoder;
|
|
15
|
+
const streamingFetch = function streamingFetch(input, init) {
|
|
16
|
+
const request = typeof input !== "string" && !(input instanceof URL) ? input : null;
|
|
17
|
+
let url;
|
|
18
|
+
if (typeof input === "string") url = input;
|
|
19
|
+
else if (input instanceof URL) url = input.href;
|
|
20
|
+
else url = input.url;
|
|
21
|
+
const method = init?.method || request?.method || "GET";
|
|
22
|
+
const headers = init?.headers || (request ? request.headers : {});
|
|
23
|
+
const body = init?.body ?? request?.body;
|
|
24
|
+
const signal = init?.signal || request?.signal;
|
|
25
|
+
return new Promise((resolve, reject) => {
|
|
26
|
+
if (signal?.aborted) {
|
|
27
|
+
reject(createAbortError());
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const xhr = new XMLHttpRequest();
|
|
31
|
+
xhr.open(method, url);
|
|
32
|
+
xhr.timeout = 6e4;
|
|
33
|
+
let headerEntries;
|
|
34
|
+
if (headers instanceof Headers) headerEntries = Array.from(headers.entries());
|
|
35
|
+
else if (Array.isArray(headers)) headerEntries = headers;
|
|
36
|
+
else headerEntries = Object.entries(headers);
|
|
37
|
+
for (const [key, value] of headerEntries) xhr.setRequestHeader(key, value);
|
|
38
|
+
xhr.responseType = "text";
|
|
39
|
+
let streamController = null;
|
|
40
|
+
let lastIndex = 0;
|
|
41
|
+
let streamClosed = false;
|
|
42
|
+
let settled = false;
|
|
43
|
+
const encoder = new TextEncoder();
|
|
44
|
+
let resolveFullText;
|
|
45
|
+
let rejectFullText;
|
|
46
|
+
const fullTextPromise = new Promise((res, rej) => {
|
|
47
|
+
resolveFullText = res;
|
|
48
|
+
rejectFullText = rej;
|
|
49
|
+
});
|
|
50
|
+
fullTextPromise.catch(() => {});
|
|
51
|
+
function closeStream() {
|
|
52
|
+
if (streamController && !streamClosed) {
|
|
53
|
+
streamClosed = true;
|
|
54
|
+
streamController.close();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function errorStream(err) {
|
|
58
|
+
if (streamController && !streamClosed) {
|
|
59
|
+
streamClosed = true;
|
|
60
|
+
streamController.error(err);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function flushChunks() {
|
|
64
|
+
if (streamController && !streamClosed && xhr.responseText.length > lastIndex) {
|
|
65
|
+
const newData = xhr.responseText.slice(lastIndex);
|
|
66
|
+
lastIndex = xhr.responseText.length;
|
|
67
|
+
streamController.enqueue(encoder.encode(newData));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/** Centralized error handler — errors the stream, rejects fullTextPromise,
|
|
71
|
+
* and rejects the outer fetch promise if not yet settled. */
|
|
72
|
+
function fail(err) {
|
|
73
|
+
cleanupAbortListener();
|
|
74
|
+
errorStream(err);
|
|
75
|
+
rejectFullText(err);
|
|
76
|
+
if (!settled) {
|
|
77
|
+
settled = true;
|
|
78
|
+
reject(err);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const onAbort = () => {
|
|
82
|
+
fail(createAbortError());
|
|
83
|
+
xhr.abort();
|
|
84
|
+
};
|
|
85
|
+
if (signal) signal.addEventListener("abort", onAbort);
|
|
86
|
+
function cleanupAbortListener() {
|
|
87
|
+
if (signal) signal.removeEventListener("abort", onAbort);
|
|
88
|
+
}
|
|
89
|
+
const stream = new ReadableStream({
|
|
90
|
+
start(controller) {
|
|
91
|
+
streamController = controller;
|
|
92
|
+
},
|
|
93
|
+
cancel() {
|
|
94
|
+
xhr.abort();
|
|
95
|
+
rejectFullText(createAbortError());
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
xhr.onprogress = function() {
|
|
99
|
+
try {
|
|
100
|
+
flushChunks();
|
|
101
|
+
} catch (err) {
|
|
102
|
+
fail(err instanceof Error ? err : new Error(String(err)));
|
|
103
|
+
xhr.abort();
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
xhr.onload = function() {
|
|
107
|
+
cleanupAbortListener();
|
|
108
|
+
try {
|
|
109
|
+
flushChunks();
|
|
110
|
+
} catch (err) {
|
|
111
|
+
fail(err instanceof Error ? err : new Error(String(err)));
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
closeStream();
|
|
115
|
+
resolveFullText(xhr.responseText);
|
|
116
|
+
};
|
|
117
|
+
xhr.onerror = function() {
|
|
118
|
+
fail(/* @__PURE__ */ new TypeError("Network request failed"));
|
|
119
|
+
};
|
|
120
|
+
xhr.ontimeout = function() {
|
|
121
|
+
fail(/* @__PURE__ */ new TypeError("Network request timed out"));
|
|
122
|
+
};
|
|
123
|
+
let resp = null;
|
|
124
|
+
xhr.onreadystatechange = function() {
|
|
125
|
+
if (xhr.readyState === 4 && !settled && !resp) {
|
|
126
|
+
fail(/* @__PURE__ */ new TypeError(`Network request to ${url} completed with status ${xhr.status} but no response was produced. This may indicate a CORS failure, DNS error, or React Native networking issue.`));
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
if (xhr.readyState >= 2 && !resp && xhr.status !== 0) {
|
|
130
|
+
const respHeaders = {};
|
|
131
|
+
const rawHeaders = xhr.getAllResponseHeaders() || "";
|
|
132
|
+
for (const line of rawHeaders.trim().split("\r\n")) {
|
|
133
|
+
const idx = line.indexOf(": ");
|
|
134
|
+
if (idx > 0) respHeaders[line.slice(0, idx).toLowerCase()] = line.slice(idx + 2);
|
|
135
|
+
}
|
|
136
|
+
const responseHeaders = new Headers(respHeaders);
|
|
137
|
+
let bodyUsed = false;
|
|
138
|
+
resp = {
|
|
139
|
+
ok: xhr.status >= 200 && xhr.status < 300,
|
|
140
|
+
status: xhr.status,
|
|
141
|
+
statusText: xhr.statusText,
|
|
142
|
+
url,
|
|
143
|
+
type: "basic",
|
|
144
|
+
redirected: false,
|
|
145
|
+
get bodyUsed() {
|
|
146
|
+
return bodyUsed;
|
|
147
|
+
},
|
|
148
|
+
headers: responseHeaders,
|
|
149
|
+
body: stream,
|
|
150
|
+
json: async () => {
|
|
151
|
+
bodyUsed = true;
|
|
152
|
+
const text = await fullTextPromise;
|
|
153
|
+
try {
|
|
154
|
+
return JSON.parse(text);
|
|
155
|
+
} catch (e) {
|
|
156
|
+
throw new TypeError(`Failed to parse JSON from ${method} ${url} (status ${xhr.status}): ${text.length > 200 ? text.slice(0, 200) + "..." : text}`);
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
text: async () => {
|
|
160
|
+
bodyUsed = true;
|
|
161
|
+
return fullTextPromise;
|
|
162
|
+
},
|
|
163
|
+
arrayBuffer: async () => {
|
|
164
|
+
bodyUsed = true;
|
|
165
|
+
return encoder.encode(await fullTextPromise).buffer;
|
|
166
|
+
},
|
|
167
|
+
blob: async () => {
|
|
168
|
+
bodyUsed = true;
|
|
169
|
+
const buf = encoder.encode(await fullTextPromise);
|
|
170
|
+
if (typeof Blob !== "undefined") return new Blob([buf], { type: responseHeaders.get("content-type") || "" });
|
|
171
|
+
throw new Error("Blob is not available in this React Native environment.");
|
|
172
|
+
},
|
|
173
|
+
clone: () => {
|
|
174
|
+
throw new Error("Response.clone() is not supported by the React Native streaming fetch polyfill.");
|
|
175
|
+
},
|
|
176
|
+
formData: async () => {
|
|
177
|
+
throw new Error("Response.formData() is not supported by the React Native streaming fetch polyfill.");
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
settled = true;
|
|
181
|
+
resolve(resp);
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
xhr.send(body ?? null);
|
|
185
|
+
});
|
|
186
|
+
};
|
|
187
|
+
streamingFetch.__originalFetch = originalFetch;
|
|
188
|
+
global.fetch = streamingFetch;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
//#endregion
|
|
192
|
+
//#region src/polyfills.ts
|
|
193
|
+
installStreamingFetch();
|
|
194
|
+
|
|
195
|
+
//#endregion
|
|
196
|
+
//# sourceMappingURL=polyfills.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polyfills.cjs","names":[],"sources":["../src/streaming-fetch.ts","../src/polyfills.ts"],"sourcesContent":["/**\n * Streaming fetch implementation for React Native.\n *\n * React Native's built-in fetch doesn't support response.body.getReader()\n * (ReadableStream). This replaces global.fetch with an XHR-based\n * implementation that streams chunks via ReadableStream, enabling\n * CopilotKit's SSE-based agent communication.\n *\n * If native fetch already supports ReadableStream bodies (newer RN / Hermes),\n * the replacement is skipped entirely.\n *\n * Call `installStreamingFetch()` once at app startup after polyfills.\n */\n\ndeclare const global: typeof globalThis;\n\n/** Subset of the Response interface implemented by the streaming fetch polyfill. */\ninterface StreamingFetchResponse {\n readonly ok: boolean;\n readonly status: number;\n readonly statusText: string;\n readonly url: string;\n readonly type: string;\n readonly redirected: boolean;\n readonly bodyUsed: boolean;\n readonly headers: Headers;\n readonly body: ReadableStream<Uint8Array>;\n json(): Promise<unknown>;\n text(): Promise<string>;\n arrayBuffer(): Promise<ArrayBuffer>;\n blob(): Promise<Blob>;\n clone(): never;\n formData(): Promise<never>;\n}\n\nfunction createAbortError(): DOMException {\n return new (global as any).DOMException(\n \"The operation was aborted.\",\n \"AbortError\",\n );\n}\n\nexport function installStreamingFetch(): void {\n // Skip if native fetch already supports ReadableStream body.\n // Newer React Native versions (Hermes) may support this natively.\n try {\n const testResponse = new Response(\"\");\n if (\n testResponse.body != null &&\n typeof testResponse.body.getReader === \"function\"\n ) {\n return;\n }\n } catch (e) {\n // Response constructor unavailable — expected in older RN environments.\n if (\n __DEV__ &&\n e instanceof Error &&\n !(e instanceof ReferenceError) &&\n !(e instanceof TypeError)\n ) {\n console.warn(\n \"[CopilotKit] Unexpected error during streaming fetch feature detection, \" +\n \"installing XHR-based polyfill:\",\n e,\n );\n }\n }\n\n const originalFetch = global.fetch;\n const TextEncoder = global.TextEncoder;\n\n const streamingFetch = function streamingFetch(\n input: RequestInfo | URL,\n init?: RequestInit,\n ): Promise<Response> {\n // Extract defaults from Request object when input is a Request\n const request =\n typeof input !== \"string\" && !(input instanceof URL) ? input : null;\n let url: string;\n if (typeof input === \"string\") {\n url = input;\n } else if (input instanceof URL) {\n url = input.href;\n } else {\n url = (input as Request).url;\n }\n const method = init?.method || request?.method || \"GET\";\n const headers = init?.headers || (request ? request.headers : {});\n const body = (init?.body ?? request?.body) as string | null | undefined;\n const signal = init?.signal || request?.signal;\n\n return new Promise((resolve, reject) => {\n // Reject immediately if signal is already aborted (per fetch spec)\n if (signal?.aborted) {\n reject(createAbortError());\n return;\n }\n\n const xhr = new XMLHttpRequest();\n xhr.open(method, url);\n\n // Default 60s timeout to prevent hanging on stalled mobile connections\n // (WiFi→cellular transitions, tunnels, serverless cold starts).\n // Callers can still use AbortSignal.timeout() for finer control.\n xhr.timeout = 60_000;\n\n let headerEntries: [string, string][];\n if (headers instanceof Headers) {\n headerEntries = Array.from(headers.entries());\n } else if (Array.isArray(headers)) {\n headerEntries = headers as [string, string][];\n } else {\n headerEntries = Object.entries(headers as Record<string, string>);\n }\n for (const [key, value] of headerEntries) {\n xhr.setRequestHeader(key, value as string);\n }\n\n xhr.responseType = \"text\";\n\n let streamController: ReadableStreamDefaultController<Uint8Array> | null =\n null;\n let lastIndex = 0;\n let streamClosed = false;\n let settled = false;\n const encoder = new TextEncoder();\n\n // Promise that resolves/rejects when XHR completes or fails\n let resolveFullText: (text: string) => void;\n let rejectFullText: (error: Error) => void;\n const fullTextPromise = new Promise<string>((res, rej) => {\n resolveFullText = res;\n rejectFullText = rej;\n });\n // Prevent unhandled rejection when error occurs but .text()/.json() is never called\n fullTextPromise.catch(() => {});\n\n function closeStream() {\n if (streamController && !streamClosed) {\n streamClosed = true;\n streamController.close();\n }\n }\n\n function errorStream(err: Error) {\n if (streamController && !streamClosed) {\n streamClosed = true;\n streamController.error(err);\n }\n }\n\n function flushChunks() {\n if (\n streamController &&\n !streamClosed &&\n xhr.responseText.length > lastIndex\n ) {\n const newData = xhr.responseText.slice(lastIndex);\n lastIndex = xhr.responseText.length;\n streamController.enqueue(encoder.encode(newData));\n }\n }\n\n /** Centralized error handler — errors the stream, rejects fullTextPromise,\n * and rejects the outer fetch promise if not yet settled. */\n function fail(err: Error) {\n cleanupAbortListener();\n errorStream(err);\n rejectFullText(err);\n if (!settled) {\n settled = true;\n reject(err);\n }\n }\n\n const onAbort = () => {\n fail(createAbortError());\n xhr.abort();\n };\n\n if (signal) {\n signal.addEventListener(\"abort\", onAbort);\n }\n\n function cleanupAbortListener() {\n if (signal) {\n signal.removeEventListener(\"abort\", onAbort);\n }\n }\n\n const stream = new ReadableStream<Uint8Array>({\n start(controller) {\n streamController = controller;\n },\n cancel() {\n xhr.abort();\n rejectFullText(createAbortError());\n },\n });\n\n xhr.onprogress = function () {\n try {\n flushChunks();\n } catch (err) {\n fail(err instanceof Error ? err : new Error(String(err)));\n xhr.abort();\n }\n };\n\n xhr.onload = function () {\n cleanupAbortListener();\n try {\n flushChunks();\n } catch (err) {\n fail(err instanceof Error ? err : new Error(String(err)));\n return;\n }\n closeStream();\n resolveFullText(xhr.responseText);\n };\n\n xhr.onerror = function () {\n fail(new TypeError(\"Network request failed\"));\n };\n\n xhr.ontimeout = function () {\n fail(new TypeError(\"Network request timed out\"));\n };\n\n // Resolve with Response once headers arrive.\n // Guard against status === 0 which XHR produces for CORS failures,\n // DNS errors, and mixed-content blocks — let onerror handle those.\n let resp: StreamingFetchResponse | null = null;\n xhr.onreadystatechange = function () {\n // Safety net: if XHR completed but we never resolved/rejected, fail explicitly.\n // This can happen when status === 0 and onerror doesn't fire (some RN networking impls).\n if (xhr.readyState === 4 && !settled && !resp) {\n fail(\n new TypeError(\n `Network request to ${url} completed with status ${xhr.status} but no response was produced. ` +\n `This may indicate a CORS failure, DNS error, or React Native networking issue.`,\n ),\n );\n return;\n }\n\n if (xhr.readyState >= 2 && !resp && xhr.status !== 0) {\n const respHeaders: Record<string, string> = {};\n const rawHeaders = xhr.getAllResponseHeaders() || \"\";\n for (const line of rawHeaders.trim().split(\"\\r\\n\")) {\n const idx = line.indexOf(\": \");\n if (idx > 0) {\n respHeaders[line.slice(0, idx).toLowerCase()] = line.slice(\n idx + 2,\n );\n }\n }\n\n const responseHeaders = new Headers(respHeaders);\n\n let bodyUsed = false;\n\n resp = {\n // Duck-typed Response object (not a native Response instance)\n ok: xhr.status >= 200 && xhr.status < 300,\n status: xhr.status,\n statusText: xhr.statusText,\n url: url,\n type: \"basic\",\n redirected: false,\n get bodyUsed() {\n return bodyUsed;\n },\n headers: responseHeaders,\n body: stream,\n json: async () => {\n bodyUsed = true;\n const text = await fullTextPromise;\n try {\n return JSON.parse(text);\n } catch (e) {\n throw new TypeError(\n `Failed to parse JSON from ${method} ${url} (status ${xhr.status}): ${\n text.length > 200 ? text.slice(0, 200) + \"...\" : text\n }`,\n );\n }\n },\n text: async () => {\n bodyUsed = true;\n return fullTextPromise;\n },\n arrayBuffer: async () => {\n bodyUsed = true;\n return encoder.encode(await fullTextPromise).buffer;\n },\n blob: async () => {\n bodyUsed = true;\n const buf = encoder.encode(await fullTextPromise);\n if (typeof Blob !== \"undefined\") {\n return new Blob([buf], {\n type: responseHeaders.get(\"content-type\") || \"\",\n });\n }\n throw new Error(\n \"Blob is not available in this React Native environment.\",\n );\n },\n clone: () => {\n throw new Error(\n \"Response.clone() is not supported by the React Native streaming fetch polyfill.\",\n );\n },\n formData: async () => {\n throw new Error(\n \"Response.formData() is not supported by the React Native streaming fetch polyfill.\",\n );\n },\n };\n settled = true;\n // NOTE: abort listener is NOT removed here — the signal must remain\n // wired to xhr.abort() for mid-stream cancellation. Cleanup happens\n // in terminal handlers (onload, onerror, ontimeout) or onAbort itself.\n resolve(resp as unknown as Response);\n }\n };\n\n xhr.send(body ?? null);\n });\n };\n\n // Expose original fetch for opt-out (e.g., third-party libs that need native behavior)\n (streamingFetch as any).__originalFetch = originalFetch;\n global.fetch = streamingFetch;\n}\n","/**\n * All polyfills required for CopilotKit to work in React Native.\n *\n * Import this BEFORE any CopilotKit code in your app entry point:\n * import \"@copilotkit/react-native/polyfills\";\n *\n * For granular control, import individual polyfills instead:\n * import \"@copilotkit/react-native/polyfills/streams\";\n * import \"@copilotkit/react-native/polyfills/encoding\";\n * import \"@copilotkit/react-native/polyfills/crypto\";\n * import \"@copilotkit/react-native/polyfills/dom\";\n * import \"@copilotkit/react-native/polyfills/location\";\n */\n\nimport \"./polyfills/streams\";\nimport \"./polyfills/encoding\";\nimport \"./polyfills/crypto\";\nimport \"./polyfills/dom\";\nimport \"./polyfills/location\";\n\nimport { installStreamingFetch } from \"./streaming-fetch\";\ninstallStreamingFetch();\n"],"mappings":";;AAmCA,SAAS,mBAAiC;AACxC,QAAO,IAAK,OAAe,aACzB,8BACA,aACD;;AAGH,SAAgB,wBAA8B;AAG5C,KAAI;EACF,MAAM,eAAe,IAAI,SAAS,GAAG;AACrC,MACE,aAAa,QAAQ,QACrB,OAAO,aAAa,KAAK,cAAc,WAEvC;UAEK,GAAG;AAEV,MACE,WACA,aAAa,SACb,EAAE,aAAa,mBACf,EAAE,aAAa,WAEf,SAAQ,KACN,0GAEA,EACD;;CAIL,MAAM,gBAAgB,OAAO;CAC7B,MAAM,cAAc,OAAO;CAE3B,MAAM,iBAAiB,SAAS,eAC9B,OACA,MACmB;EAEnB,MAAM,UACJ,OAAO,UAAU,YAAY,EAAE,iBAAiB,OAAO,QAAQ;EACjE,IAAI;AACJ,MAAI,OAAO,UAAU,SACnB,OAAM;WACG,iBAAiB,IAC1B,OAAM,MAAM;MAEZ,OAAO,MAAkB;EAE3B,MAAM,SAAS,MAAM,UAAU,SAAS,UAAU;EAClD,MAAM,UAAU,MAAM,YAAY,UAAU,QAAQ,UAAU,EAAE;EAChE,MAAM,OAAQ,MAAM,QAAQ,SAAS;EACrC,MAAM,SAAS,MAAM,UAAU,SAAS;AAExC,SAAO,IAAI,SAAS,SAAS,WAAW;AAEtC,OAAI,QAAQ,SAAS;AACnB,WAAO,kBAAkB,CAAC;AAC1B;;GAGF,MAAM,MAAM,IAAI,gBAAgB;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