@copilotkit/shared 1.84.2-canary.openbot-intel-fixes → 1.86.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 (116) hide show
  1. package/dist/event-transforms/recorded-events.cjs +7 -1
  2. package/dist/event-transforms/recorded-events.cjs.map +1 -1
  3. package/dist/event-transforms/recorded-events.mjs +8 -2
  4. package/dist/event-transforms/recorded-events.mjs.map +1 -1
  5. package/dist/generative-ui/clone-value.cjs +364 -0
  6. package/dist/generative-ui/clone-value.cjs.map +1 -0
  7. package/dist/generative-ui/clone-value.d.cts +51 -0
  8. package/dist/generative-ui/clone-value.d.cts.map +1 -0
  9. package/dist/generative-ui/clone-value.d.mts +51 -0
  10. package/dist/generative-ui/clone-value.d.mts.map +1 -0
  11. package/dist/generative-ui/clone-value.mjs +363 -0
  12. package/dist/generative-ui/clone-value.mjs.map +1 -0
  13. package/dist/generative-ui/index.cjs +39 -0
  14. package/dist/generative-ui/index.d.cts +8 -2
  15. package/dist/generative-ui/index.d.mts +8 -2
  16. package/dist/generative-ui/index.mjs +8 -2
  17. package/dist/generative-ui/is-record.d.cts +3 -1
  18. package/dist/generative-ui/is-record.d.cts.map +1 -1
  19. package/dist/generative-ui/is-record.d.mts +3 -1
  20. package/dist/generative-ui/is-record.d.mts.map +1 -1
  21. package/dist/generative-ui/schema-render.cjs +2 -1
  22. package/dist/generative-ui/schema-render.cjs.map +1 -1
  23. package/dist/generative-ui/schema-render.d.cts.map +1 -1
  24. package/dist/generative-ui/schema-render.d.mts.map +1 -1
  25. package/dist/generative-ui/schema-render.mjs +2 -1
  26. package/dist/generative-ui/schema-render.mjs.map +1 -1
  27. package/dist/generative-ui/standard/chart-config.cjs +347 -0
  28. package/dist/generative-ui/standard/chart-config.cjs.map +1 -0
  29. package/dist/generative-ui/standard/chart-config.d.cts +97 -0
  30. package/dist/generative-ui/standard/chart-config.d.cts.map +1 -0
  31. package/dist/generative-ui/standard/chart-config.d.mts +97 -0
  32. package/dist/generative-ui/standard/chart-config.d.mts.map +1 -0
  33. package/dist/generative-ui/standard/chart-config.mjs +342 -0
  34. package/dist/generative-ui/standard/chart-config.mjs.map +1 -0
  35. package/dist/generative-ui/standard/chart.d.cts +10 -10
  36. package/dist/generative-ui/standard/chart.d.mts +10 -10
  37. package/dist/generative-ui/standard/composites.d.cts +46 -46
  38. package/dist/generative-ui/standard/composites.d.mts +46 -46
  39. package/dist/generative-ui/standard/data.d.cts +42 -42
  40. package/dist/generative-ui/standard/data.d.mts +42 -42
  41. package/dist/generative-ui/standard/declarations.d.cts +226 -226
  42. package/dist/generative-ui/standard/declarations.d.mts +226 -226
  43. package/dist/generative-ui/standard/feedback.d.cts +4 -4
  44. package/dist/generative-ui/standard/feedback.d.mts +4 -4
  45. package/dist/generative-ui/standard/index.d.mts +5 -1
  46. package/dist/generative-ui/standard/inputs.d.cts +72 -72
  47. package/dist/generative-ui/standard/inputs.d.mts +72 -72
  48. package/dist/generative-ui/standard/layout.d.cts +156 -156
  49. package/dist/generative-ui/standard/layout.d.mts +156 -156
  50. package/dist/generative-ui/standard/map-helpers.cjs +104 -0
  51. package/dist/generative-ui/standard/map-helpers.cjs.map +1 -0
  52. package/dist/generative-ui/standard/map-helpers.d.cts +88 -0
  53. package/dist/generative-ui/standard/map-helpers.d.cts.map +1 -0
  54. package/dist/generative-ui/standard/map-helpers.d.mts +88 -0
  55. package/dist/generative-ui/standard/map-helpers.d.mts.map +1 -0
  56. package/dist/generative-ui/standard/map-helpers.mjs +95 -0
  57. package/dist/generative-ui/standard/map-helpers.mjs.map +1 -0
  58. package/dist/generative-ui/standard/map.d.cts +10 -10
  59. package/dist/generative-ui/standard/map.d.mts +10 -10
  60. package/dist/generative-ui/standard/media.d.cts +76 -76
  61. package/dist/generative-ui/standard/media.d.mts +76 -76
  62. package/dist/generative-ui/standard/style-helpers.cjs +151 -0
  63. package/dist/generative-ui/standard/style-helpers.cjs.map +1 -0
  64. package/dist/generative-ui/standard/style-helpers.d.cts +56 -0
  65. package/dist/generative-ui/standard/style-helpers.d.cts.map +1 -0
  66. package/dist/generative-ui/standard/style-helpers.d.mts +56 -0
  67. package/dist/generative-ui/standard/style-helpers.d.mts.map +1 -0
  68. package/dist/generative-ui/standard/style-helpers.mjs +142 -0
  69. package/dist/generative-ui/standard/style-helpers.mjs.map +1 -0
  70. package/dist/generative-ui/standard/text.d.cts +28 -28
  71. package/dist/generative-ui/standard/text.d.mts +28 -28
  72. package/dist/generative-ui/standard/url.cjs +54 -0
  73. package/dist/generative-ui/standard/url.cjs.map +1 -0
  74. package/dist/generative-ui/standard/url.d.cts +32 -0
  75. package/dist/generative-ui/standard/url.d.cts.map +1 -0
  76. package/dist/generative-ui/standard/url.d.mts +32 -0
  77. package/dist/generative-ui/standard/url.d.mts.map +1 -0
  78. package/dist/generative-ui/standard/url.mjs +50 -0
  79. package/dist/generative-ui/standard/url.mjs.map +1 -0
  80. package/dist/generative-ui/thrown.cjs +69 -0
  81. package/dist/generative-ui/thrown.cjs.map +1 -0
  82. package/dist/generative-ui/thrown.d.cts +21 -0
  83. package/dist/generative-ui/thrown.d.cts.map +1 -0
  84. package/dist/generative-ui/thrown.d.mts +21 -0
  85. package/dist/generative-ui/thrown.d.mts.map +1 -0
  86. package/dist/generative-ui/thrown.mjs +67 -0
  87. package/dist/generative-ui/thrown.mjs.map +1 -0
  88. package/dist/index.cjs +2 -0
  89. package/dist/index.cjs.map +1 -1
  90. package/dist/index.d.cts +2 -1
  91. package/dist/index.d.cts.map +1 -1
  92. package/dist/index.d.mts +2 -1
  93. package/dist/index.d.mts.map +1 -1
  94. package/dist/index.mjs +2 -1
  95. package/dist/index.mjs.map +1 -1
  96. package/dist/index.umd.js +368 -2
  97. package/dist/index.umd.js.map +1 -1
  98. package/dist/package.cjs +1 -1
  99. package/dist/package.mjs +1 -1
  100. package/package.json +2 -2
  101. package/src/__tests__/schema-render.test.ts +78 -0
  102. package/src/event-transforms/recorded-events.test.ts +35 -3
  103. package/src/event-transforms/recorded-events.ts +15 -2
  104. package/src/generative-ui/__tests__/clone-value-differential.test.ts +480 -0
  105. package/src/generative-ui/__tests__/clone-value.test.ts +226 -0
  106. package/src/generative-ui/clone-value.ts +511 -0
  107. package/src/generative-ui/index.ts +6 -2
  108. package/src/generative-ui/schema-render.ts +2 -1
  109. package/src/generative-ui/standard/__tests__/standard-helpers.test.ts +407 -0
  110. package/src/generative-ui/standard/chart-config.ts +434 -0
  111. package/src/generative-ui/standard/index.ts +36 -0
  112. package/src/generative-ui/standard/map-helpers.ts +155 -0
  113. package/src/generative-ui/standard/style-helpers.ts +170 -0
  114. package/src/generative-ui/standard/url.ts +51 -0
  115. package/src/generative-ui/thrown.ts +90 -0
  116. package/src/index.ts +5 -0
@@ -0,0 +1,54 @@
1
+
2
+ //#region src/generative-ui/standard/url.ts
3
+ const SAFE_URL = /^(https?:|mailto:)/i;
4
+ /**
5
+ * The trimmed URL when its scheme is http, https or mailto, else
6
+ * `undefined`. Use it before a URL from agent data becomes an `href`.
7
+ *
8
+ * @example safeHref(" https://example.com ") // "https://example.com"
9
+ */
10
+ function safeHref(url) {
11
+ const trimmed = url.trim();
12
+ return SAFE_URL.test(trimmed) ? trimmed : void 0;
13
+ }
14
+ /**
15
+ * The host name of a URL, with or without a scheme. `undefined` when the
16
+ * text is not a URL.
17
+ *
18
+ * @example hostOf("example.com/page") // "example.com"
19
+ */
20
+ function hostOf(url) {
21
+ try {
22
+ return new URL(url.includes("://") ? url : `https://${url}`).hostname;
23
+ } catch {
24
+ return;
25
+ }
26
+ }
27
+ /**
28
+ * The URL of the favicon of a host, from Google's favicon service.
29
+ *
30
+ * @param host - A host name, for example the result of `hostOf`.
31
+ */
32
+ function faviconSrc(host) {
33
+ return `https://www.google.com/s2/favicons?domain=${encodeURIComponent(host)}&sz=64`;
34
+ }
35
+ /**
36
+ * Opens a URL in a new tab. An unsafe scheme (javascript:, data:) is
37
+ * ignored. Does nothing where there is no `window.open`, for example on
38
+ * the server or on React Native.
39
+ *
40
+ * @param href - The URL to open. `undefined` does nothing.
41
+ */
42
+ function openUrl(href) {
43
+ if (!href || typeof window === "undefined") return;
44
+ if (typeof window.open !== "function") return;
45
+ const safe = safeHref(href);
46
+ if (safe) window.open(safe, "_blank", "noopener,noreferrer");
47
+ }
48
+
49
+ //#endregion
50
+ exports.faviconSrc = faviconSrc;
51
+ exports.hostOf = hostOf;
52
+ exports.openUrl = openUrl;
53
+ exports.safeHref = safeHref;
54
+ //# sourceMappingURL=url.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url.cjs","names":[],"sources":["../../../src/generative-ui/standard/url.ts"],"sourcesContent":["// Framework-free URL helpers of the standard components.\n\nconst SAFE_URL = /^(https?:|mailto:)/i;\n\n/**\n * The trimmed URL when its scheme is http, https or mailto, else\n * `undefined`. Use it before a URL from agent data becomes an `href`.\n *\n * @example safeHref(\" https://example.com \") // \"https://example.com\"\n */\nexport function safeHref(url: string) {\n const trimmed = url.trim();\n return SAFE_URL.test(trimmed) ? trimmed : undefined;\n}\n\n/**\n * The host name of a URL, with or without a scheme. `undefined` when the\n * text is not a URL.\n *\n * @example hostOf(\"example.com/page\") // \"example.com\"\n */\nexport function hostOf(url: string) {\n try {\n return new URL(url.includes(\"://\") ? url : `https://${url}`).hostname;\n } catch {\n return undefined;\n }\n}\n\n/**\n * The URL of the favicon of a host, from Google's favicon service.\n *\n * @param host - A host name, for example the result of `hostOf`.\n */\nexport function faviconSrc(host: string) {\n return `https://www.google.com/s2/favicons?domain=${encodeURIComponent(host)}&sz=64`;\n}\n\n/**\n * Opens a URL in a new tab. An unsafe scheme (javascript:, data:) is\n * ignored. Does nothing where there is no `window.open`, for example on\n * the server or on React Native.\n *\n * @param href - The URL to open. `undefined` does nothing.\n */\nexport function openUrl(href: string | undefined) {\n if (!href || typeof window === \"undefined\") return;\n if (typeof window.open !== \"function\") return; // hermes-ok: feature check\n const safe = safeHref(href);\n if (safe) window.open(safe, \"_blank\", \"noopener,noreferrer\"); // hermes-ok: checked above\n}\n"],"mappings":";;AAEA,MAAM,WAAW;;;;;;;AAQjB,SAAgB,SAAS,KAAa;CACpC,MAAM,UAAU,IAAI,MAAM;AAC1B,QAAO,SAAS,KAAK,QAAQ,GAAG,UAAU;;;;;;;;AAS5C,SAAgB,OAAO,KAAa;AAClC,KAAI;AACF,SAAO,IAAI,IAAI,IAAI,SAAS,MAAM,GAAG,MAAM,WAAW,MAAM,CAAC;SACvD;AACN;;;;;;;;AASJ,SAAgB,WAAW,MAAc;AACvC,QAAO,6CAA6C,mBAAmB,KAAK,CAAC;;;;;;;;;AAU/E,SAAgB,QAAQ,MAA0B;AAChD,KAAI,CAAC,QAAQ,OAAO,WAAW,YAAa;AAC5C,KAAI,OAAO,OAAO,SAAS,WAAY;CACvC,MAAM,OAAO,SAAS,KAAK;AAC3B,KAAI,KAAM,QAAO,KAAK,MAAM,UAAU,sBAAsB"}
@@ -0,0 +1,32 @@
1
+ //#region src/generative-ui/standard/url.d.ts
2
+ /**
3
+ * The trimmed URL when its scheme is http, https or mailto, else
4
+ * `undefined`. Use it before a URL from agent data becomes an `href`.
5
+ *
6
+ * @example safeHref(" https://example.com ") // "https://example.com"
7
+ */
8
+ declare function safeHref(url: string): string | undefined;
9
+ /**
10
+ * The host name of a URL, with or without a scheme. `undefined` when the
11
+ * text is not a URL.
12
+ *
13
+ * @example hostOf("example.com/page") // "example.com"
14
+ */
15
+ declare function hostOf(url: string): string | undefined;
16
+ /**
17
+ * The URL of the favicon of a host, from Google's favicon service.
18
+ *
19
+ * @param host - A host name, for example the result of `hostOf`.
20
+ */
21
+ declare function faviconSrc(host: string): string;
22
+ /**
23
+ * Opens a URL in a new tab. An unsafe scheme (javascript:, data:) is
24
+ * ignored. Does nothing where there is no `window.open`, for example on
25
+ * the server or on React Native.
26
+ *
27
+ * @param href - The URL to open. `undefined` does nothing.
28
+ */
29
+ declare function openUrl(href: string | undefined): void;
30
+ //#endregion
31
+ export { faviconSrc, hostOf, openUrl, safeHref };
32
+ //# sourceMappingURL=url.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url.d.cts","names":[],"sources":["../../../src/generative-ui/standard/url.ts"],"mappings":";;AAUA;;;;;iBAAgB,QAAA,CAAS,GAAA;;;;;AAwBzB;;iBAbgB,MAAA,CAAO,GAAA;;;AAwBvB;;;iBAXgB,UAAA,CAAW,IAAA;;;;;;;;iBAWX,OAAA,CAAQ,IAAA"}
@@ -0,0 +1,32 @@
1
+ //#region src/generative-ui/standard/url.d.ts
2
+ /**
3
+ * The trimmed URL when its scheme is http, https or mailto, else
4
+ * `undefined`. Use it before a URL from agent data becomes an `href`.
5
+ *
6
+ * @example safeHref(" https://example.com ") // "https://example.com"
7
+ */
8
+ declare function safeHref(url: string): string | undefined;
9
+ /**
10
+ * The host name of a URL, with or without a scheme. `undefined` when the
11
+ * text is not a URL.
12
+ *
13
+ * @example hostOf("example.com/page") // "example.com"
14
+ */
15
+ declare function hostOf(url: string): string | undefined;
16
+ /**
17
+ * The URL of the favicon of a host, from Google's favicon service.
18
+ *
19
+ * @param host - A host name, for example the result of `hostOf`.
20
+ */
21
+ declare function faviconSrc(host: string): string;
22
+ /**
23
+ * Opens a URL in a new tab. An unsafe scheme (javascript:, data:) is
24
+ * ignored. Does nothing where there is no `window.open`, for example on
25
+ * the server or on React Native.
26
+ *
27
+ * @param href - The URL to open. `undefined` does nothing.
28
+ */
29
+ declare function openUrl(href: string | undefined): void;
30
+ //#endregion
31
+ export { faviconSrc, hostOf, openUrl, safeHref };
32
+ //# sourceMappingURL=url.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url.d.mts","names":[],"sources":["../../../src/generative-ui/standard/url.ts"],"mappings":";;AAUA;;;;;iBAAgB,QAAA,CAAS,GAAA;;;;;AAwBzB;;iBAbgB,MAAA,CAAO,GAAA;;;AAwBvB;;;iBAXgB,UAAA,CAAW,IAAA;;;;;;;;iBAWX,OAAA,CAAQ,IAAA"}
@@ -0,0 +1,50 @@
1
+ //#region src/generative-ui/standard/url.ts
2
+ const SAFE_URL = /^(https?:|mailto:)/i;
3
+ /**
4
+ * The trimmed URL when its scheme is http, https or mailto, else
5
+ * `undefined`. Use it before a URL from agent data becomes an `href`.
6
+ *
7
+ * @example safeHref(" https://example.com ") // "https://example.com"
8
+ */
9
+ function safeHref(url) {
10
+ const trimmed = url.trim();
11
+ return SAFE_URL.test(trimmed) ? trimmed : void 0;
12
+ }
13
+ /**
14
+ * The host name of a URL, with or without a scheme. `undefined` when the
15
+ * text is not a URL.
16
+ *
17
+ * @example hostOf("example.com/page") // "example.com"
18
+ */
19
+ function hostOf(url) {
20
+ try {
21
+ return new URL(url.includes("://") ? url : `https://${url}`).hostname;
22
+ } catch {
23
+ return;
24
+ }
25
+ }
26
+ /**
27
+ * The URL of the favicon of a host, from Google's favicon service.
28
+ *
29
+ * @param host - A host name, for example the result of `hostOf`.
30
+ */
31
+ function faviconSrc(host) {
32
+ return `https://www.google.com/s2/favicons?domain=${encodeURIComponent(host)}&sz=64`;
33
+ }
34
+ /**
35
+ * Opens a URL in a new tab. An unsafe scheme (javascript:, data:) is
36
+ * ignored. Does nothing where there is no `window.open`, for example on
37
+ * the server or on React Native.
38
+ *
39
+ * @param href - The URL to open. `undefined` does nothing.
40
+ */
41
+ function openUrl(href) {
42
+ if (!href || typeof window === "undefined") return;
43
+ if (typeof window.open !== "function") return;
44
+ const safe = safeHref(href);
45
+ if (safe) window.open(safe, "_blank", "noopener,noreferrer");
46
+ }
47
+
48
+ //#endregion
49
+ export { faviconSrc, hostOf, openUrl, safeHref };
50
+ //# sourceMappingURL=url.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url.mjs","names":[],"sources":["../../../src/generative-ui/standard/url.ts"],"sourcesContent":["// Framework-free URL helpers of the standard components.\n\nconst SAFE_URL = /^(https?:|mailto:)/i;\n\n/**\n * The trimmed URL when its scheme is http, https or mailto, else\n * `undefined`. Use it before a URL from agent data becomes an `href`.\n *\n * @example safeHref(\" https://example.com \") // \"https://example.com\"\n */\nexport function safeHref(url: string) {\n const trimmed = url.trim();\n return SAFE_URL.test(trimmed) ? trimmed : undefined;\n}\n\n/**\n * The host name of a URL, with or without a scheme. `undefined` when the\n * text is not a URL.\n *\n * @example hostOf(\"example.com/page\") // \"example.com\"\n */\nexport function hostOf(url: string) {\n try {\n return new URL(url.includes(\"://\") ? url : `https://${url}`).hostname;\n } catch {\n return undefined;\n }\n}\n\n/**\n * The URL of the favicon of a host, from Google's favicon service.\n *\n * @param host - A host name, for example the result of `hostOf`.\n */\nexport function faviconSrc(host: string) {\n return `https://www.google.com/s2/favicons?domain=${encodeURIComponent(host)}&sz=64`;\n}\n\n/**\n * Opens a URL in a new tab. An unsafe scheme (javascript:, data:) is\n * ignored. Does nothing where there is no `window.open`, for example on\n * the server or on React Native.\n *\n * @param href - The URL to open. `undefined` does nothing.\n */\nexport function openUrl(href: string | undefined) {\n if (!href || typeof window === \"undefined\") return;\n if (typeof window.open !== \"function\") return; // hermes-ok: feature check\n const safe = safeHref(href);\n if (safe) window.open(safe, \"_blank\", \"noopener,noreferrer\"); // hermes-ok: checked above\n}\n"],"mappings":";AAEA,MAAM,WAAW;;;;;;;AAQjB,SAAgB,SAAS,KAAa;CACpC,MAAM,UAAU,IAAI,MAAM;AAC1B,QAAO,SAAS,KAAK,QAAQ,GAAG,UAAU;;;;;;;;AAS5C,SAAgB,OAAO,KAAa;AAClC,KAAI;AACF,SAAO,IAAI,IAAI,IAAI,SAAS,MAAM,GAAG,MAAM,WAAW,MAAM,CAAC;SACvD;AACN;;;;;;;;AASJ,SAAgB,WAAW,MAAc;AACvC,QAAO,6CAA6C,mBAAmB,KAAK,CAAC;;;;;;;;;AAU/E,SAAgB,QAAQ,MAA0B;AAChD,KAAI,CAAC,QAAQ,OAAO,WAAW,YAAa;AAC5C,KAAI,OAAO,OAAO,SAAS,WAAY;CACvC,MAAM,OAAO,SAAS,KAAK;AAC3B,KAAI,KAAM,QAAO,KAAK,MAAM,UAAU,sBAAsB"}
@@ -0,0 +1,69 @@
1
+
2
+ //#region src/generative-ui/thrown.ts
3
+ /**
4
+ * Sets `cause` as an own property. `new Error(message, { cause })` needs
5
+ * ES2022 error options, which an engine without them (the JavaScriptCore of
6
+ * iOS before 15, which React Native 0.70 can still run on) ignores without a
7
+ * word, so it is set by hand on every engine.
8
+ */
9
+ function withCause(error, cause) {
10
+ Object.defineProperty(error, "cause", {
11
+ value: cause,
12
+ writable: true,
13
+ configurable: true,
14
+ enumerable: false
15
+ });
16
+ return error;
17
+ }
18
+ /** The longest description of a thrown object's data. */
19
+ const MAX_DESCRIPTION = 200;
20
+ /**
21
+ * Reads what a thrown value says without letting the reading throw: a
22
+ * getter, a Proxy trap, a `toJSON` or a `toString` may throw too.
23
+ */
24
+ function attempt(read) {
25
+ try {
26
+ return read();
27
+ } catch {
28
+ return;
29
+ }
30
+ }
31
+ /** The `message` of a thrown object, when it is a non-empty string. */
32
+ function messageOf(value) {
33
+ if (typeof value !== "object" || value === null) return void 0;
34
+ const message = attempt(() => value.message);
35
+ return typeof message === "string" && message !== "" ? message : void 0;
36
+ }
37
+ /** A thrown value as text, for a value that is not an Error. */
38
+ function describeThrown(value) {
39
+ if (typeof value === "string") return JSON.stringify(value);
40
+ if (typeof value === "object" && value !== null) {
41
+ const json = attempt(() => JSON.stringify(value));
42
+ if (typeof json === "string") return json.length > MAX_DESCRIPTION ? `${json.slice(0, MAX_DESCRIPTION)}…` : json;
43
+ }
44
+ return attempt(() => String(value)) ?? attempt(() => Object.prototype.toString.call(value)) ?? typeof value;
45
+ }
46
+ /** An Error of this realm, or of another one (a frame, a VM context). */
47
+ function isError(value) {
48
+ if (attempt(() => value instanceof Error)) return true;
49
+ return attempt(() => Object.prototype.toString.call(value)) === "[object Error]" && typeof attempt(() => value.message) === "string";
50
+ }
51
+ /**
52
+ * The Error for any thrown value. Code may throw anything: a string, or a
53
+ * falsy value (`undefined`, `null`, `0`, `""`) that a boundary which keeps
54
+ * the thrown value and tests it for truth would take for "no error". An
55
+ * Error comes back as it is; a non-empty string, or the string `message`
56
+ * of a thrown object, becomes the message; any other value is described in
57
+ * the message. A value that is not an Error is kept as the `cause`. This
58
+ * never throws, whatever the value.
59
+ */
60
+ function toError(value) {
61
+ if (isError(value)) return value;
62
+ const message = typeof value === "string" && value !== "" ? value : messageOf(value) ?? `A value that is not an Error was thrown: ${describeThrown(value)}`;
63
+ return withCause(new Error(message), value);
64
+ }
65
+
66
+ //#endregion
67
+ exports.toError = toError;
68
+ exports.withCause = withCause;
69
+ //# sourceMappingURL=thrown.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thrown.cjs","names":[],"sources":["../../src/generative-ui/thrown.ts"],"sourcesContent":["// Turns any thrown value into an Error, for the error boundaries of the\n// framework packages. Framework-free, and safe on Hermes.\n\n/**\n * Sets `cause` as an own property. `new Error(message, { cause })` needs\n * ES2022 error options, which an engine without them (the JavaScriptCore of\n * iOS before 15, which React Native 0.70 can still run on) ignores without a\n * word, so it is set by hand on every engine.\n */\nexport function withCause(error: Error, cause: unknown): Error {\n Object.defineProperty(error, \"cause\", {\n value: cause,\n writable: true,\n configurable: true,\n enumerable: false,\n });\n return error;\n}\n\n/** The longest description of a thrown object's data. */\nconst MAX_DESCRIPTION = 200;\n\n/**\n * Reads what a thrown value says without letting the reading throw: a\n * getter, a Proxy trap, a `toJSON` or a `toString` may throw too.\n */\nfunction attempt<T>(read: () => T): T | undefined {\n try {\n return read();\n } catch {\n return undefined;\n }\n}\n\n/** The `message` of a thrown object, when it is a non-empty string. */\nfunction messageOf(value: unknown): string | undefined {\n if (typeof value !== \"object\" || value === null) return undefined;\n const message = attempt(() => (value as { message?: unknown }).message);\n return typeof message === \"string\" && message !== \"\" ? message : undefined;\n}\n\n/** A thrown value as text, for a value that is not an Error. */\nfunction describeThrown(value: unknown): string {\n if (typeof value === \"string\") return JSON.stringify(value);\n if (typeof value === \"object\" && value !== null) {\n // Its data, not \"[object Object]\".\n const json = attempt(() => JSON.stringify(value));\n if (typeof json === \"string\") {\n return json.length > MAX_DESCRIPTION\n ? `${json.slice(0, MAX_DESCRIPTION)}…`\n : json;\n }\n }\n return (\n attempt(() => String(value)) ??\n attempt(() => Object.prototype.toString.call(value)) ??\n typeof value\n );\n}\n\n/** An Error of this realm, or of another one (a frame, a VM context). */\nfunction isError(value: unknown): value is Error {\n // `instanceof` runs a Proxy's getPrototypeOf trap, which may throw.\n if (attempt(() => value instanceof Error)) return true;\n // Another realm's Error fails `instanceof`; its tag says what it is. A\n // tag can be set on any object, so it must have a message as well.\n return (\n attempt(() => Object.prototype.toString.call(value)) === \"[object Error]\" &&\n typeof attempt(() => (value as { message?: unknown }).message) === \"string\"\n );\n}\n\n/**\n * The Error for any thrown value. Code may throw anything: a string, or a\n * falsy value (`undefined`, `null`, `0`, `\"\"`) that a boundary which keeps\n * the thrown value and tests it for truth would take for \"no error\". An\n * Error comes back as it is; a non-empty string, or the string `message`\n * of a thrown object, becomes the message; any other value is described in\n * the message. A value that is not an Error is kept as the `cause`. This\n * never throws, whatever the value.\n */\nexport function toError(value: unknown): Error {\n if (isError(value)) return value;\n const message =\n typeof value === \"string\" && value !== \"\"\n ? value\n : (messageOf(value) ??\n `A value that is not an Error was thrown: ${describeThrown(value)}`);\n return withCause(new Error(message), value);\n}\n"],"mappings":";;;;;;;;AASA,SAAgB,UAAU,OAAc,OAAuB;AAC7D,QAAO,eAAe,OAAO,SAAS;EACpC,OAAO;EACP,UAAU;EACV,cAAc;EACd,YAAY;EACb,CAAC;AACF,QAAO;;;AAIT,MAAM,kBAAkB;;;;;AAMxB,SAAS,QAAW,MAA8B;AAChD,KAAI;AACF,SAAO,MAAM;SACP;AACN;;;;AAKJ,SAAS,UAAU,OAAoC;AACrD,KAAI,OAAO,UAAU,YAAY,UAAU,KAAM,QAAO;CACxD,MAAM,UAAU,cAAe,MAAgC,QAAQ;AACvE,QAAO,OAAO,YAAY,YAAY,YAAY,KAAK,UAAU;;;AAInE,SAAS,eAAe,OAAwB;AAC9C,KAAI,OAAO,UAAU,SAAU,QAAO,KAAK,UAAU,MAAM;AAC3D,KAAI,OAAO,UAAU,YAAY,UAAU,MAAM;EAE/C,MAAM,OAAO,cAAc,KAAK,UAAU,MAAM,CAAC;AACjD,MAAI,OAAO,SAAS,SAClB,QAAO,KAAK,SAAS,kBACjB,GAAG,KAAK,MAAM,GAAG,gBAAgB,CAAC,KAClC;;AAGR,QACE,cAAc,OAAO,MAAM,CAAC,IAC5B,cAAc,OAAO,UAAU,SAAS,KAAK,MAAM,CAAC,IACpD,OAAO;;;AAKX,SAAS,QAAQ,OAAgC;AAE/C,KAAI,cAAc,iBAAiB,MAAM,CAAE,QAAO;AAGlD,QACE,cAAc,OAAO,UAAU,SAAS,KAAK,MAAM,CAAC,KAAK,oBACzD,OAAO,cAAe,MAAgC,QAAQ,KAAK;;;;;;;;;;;AAavE,SAAgB,QAAQ,OAAuB;AAC7C,KAAI,QAAQ,MAAM,CAAE,QAAO;CAC3B,MAAM,UACJ,OAAO,UAAU,YAAY,UAAU,KACnC,QACC,UAAU,MAAM,IACjB,4CAA4C,eAAe,MAAM;AACvE,QAAO,UAAU,IAAI,MAAM,QAAQ,EAAE,MAAM"}
@@ -0,0 +1,21 @@
1
+ //#region src/generative-ui/thrown.d.ts
2
+ /**
3
+ * Sets `cause` as an own property. `new Error(message, { cause })` needs
4
+ * ES2022 error options, which an engine without them (the JavaScriptCore of
5
+ * iOS before 15, which React Native 0.70 can still run on) ignores without a
6
+ * word, so it is set by hand on every engine.
7
+ */
8
+ declare function withCause(error: Error, cause: unknown): Error;
9
+ /**
10
+ * The Error for any thrown value. Code may throw anything: a string, or a
11
+ * falsy value (`undefined`, `null`, `0`, `""`) that a boundary which keeps
12
+ * the thrown value and tests it for truth would take for "no error". An
13
+ * Error comes back as it is; a non-empty string, or the string `message`
14
+ * of a thrown object, becomes the message; any other value is described in
15
+ * the message. A value that is not an Error is kept as the `cause`. This
16
+ * never throws, whatever the value.
17
+ */
18
+ declare function toError(value: unknown): Error;
19
+ //#endregion
20
+ export { toError, withCause };
21
+ //# sourceMappingURL=thrown.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thrown.d.cts","names":[],"sources":["../../src/generative-ui/thrown.ts"],"mappings":";;AASA;;;;;iBAAgB,SAAA,CAAU,KAAA,EAAO,KAAA,EAAO,KAAA,YAAiB,KAAA;;;;;AAwEzD;;;;;iBAAgB,OAAA,CAAQ,KAAA,YAAiB,KAAA"}
@@ -0,0 +1,21 @@
1
+ //#region src/generative-ui/thrown.d.ts
2
+ /**
3
+ * Sets `cause` as an own property. `new Error(message, { cause })` needs
4
+ * ES2022 error options, which an engine without them (the JavaScriptCore of
5
+ * iOS before 15, which React Native 0.70 can still run on) ignores without a
6
+ * word, so it is set by hand on every engine.
7
+ */
8
+ declare function withCause(error: Error, cause: unknown): Error;
9
+ /**
10
+ * The Error for any thrown value. Code may throw anything: a string, or a
11
+ * falsy value (`undefined`, `null`, `0`, `""`) that a boundary which keeps
12
+ * the thrown value and tests it for truth would take for "no error". An
13
+ * Error comes back as it is; a non-empty string, or the string `message`
14
+ * of a thrown object, becomes the message; any other value is described in
15
+ * the message. A value that is not an Error is kept as the `cause`. This
16
+ * never throws, whatever the value.
17
+ */
18
+ declare function toError(value: unknown): Error;
19
+ //#endregion
20
+ export { toError, withCause };
21
+ //# sourceMappingURL=thrown.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thrown.d.mts","names":[],"sources":["../../src/generative-ui/thrown.ts"],"mappings":";;AASA;;;;;iBAAgB,SAAA,CAAU,KAAA,EAAO,KAAA,EAAO,KAAA,YAAiB,KAAA;;;;;AAwEzD;;;;;iBAAgB,OAAA,CAAQ,KAAA,YAAiB,KAAA"}
@@ -0,0 +1,67 @@
1
+ //#region src/generative-ui/thrown.ts
2
+ /**
3
+ * Sets `cause` as an own property. `new Error(message, { cause })` needs
4
+ * ES2022 error options, which an engine without them (the JavaScriptCore of
5
+ * iOS before 15, which React Native 0.70 can still run on) ignores without a
6
+ * word, so it is set by hand on every engine.
7
+ */
8
+ function withCause(error, cause) {
9
+ Object.defineProperty(error, "cause", {
10
+ value: cause,
11
+ writable: true,
12
+ configurable: true,
13
+ enumerable: false
14
+ });
15
+ return error;
16
+ }
17
+ /** The longest description of a thrown object's data. */
18
+ const MAX_DESCRIPTION = 200;
19
+ /**
20
+ * Reads what a thrown value says without letting the reading throw: a
21
+ * getter, a Proxy trap, a `toJSON` or a `toString` may throw too.
22
+ */
23
+ function attempt(read) {
24
+ try {
25
+ return read();
26
+ } catch {
27
+ return;
28
+ }
29
+ }
30
+ /** The `message` of a thrown object, when it is a non-empty string. */
31
+ function messageOf(value) {
32
+ if (typeof value !== "object" || value === null) return void 0;
33
+ const message = attempt(() => value.message);
34
+ return typeof message === "string" && message !== "" ? message : void 0;
35
+ }
36
+ /** A thrown value as text, for a value that is not an Error. */
37
+ function describeThrown(value) {
38
+ if (typeof value === "string") return JSON.stringify(value);
39
+ if (typeof value === "object" && value !== null) {
40
+ const json = attempt(() => JSON.stringify(value));
41
+ if (typeof json === "string") return json.length > MAX_DESCRIPTION ? `${json.slice(0, MAX_DESCRIPTION)}…` : json;
42
+ }
43
+ return attempt(() => String(value)) ?? attempt(() => Object.prototype.toString.call(value)) ?? typeof value;
44
+ }
45
+ /** An Error of this realm, or of another one (a frame, a VM context). */
46
+ function isError(value) {
47
+ if (attempt(() => value instanceof Error)) return true;
48
+ return attempt(() => Object.prototype.toString.call(value)) === "[object Error]" && typeof attempt(() => value.message) === "string";
49
+ }
50
+ /**
51
+ * The Error for any thrown value. Code may throw anything: a string, or a
52
+ * falsy value (`undefined`, `null`, `0`, `""`) that a boundary which keeps
53
+ * the thrown value and tests it for truth would take for "no error". An
54
+ * Error comes back as it is; a non-empty string, or the string `message`
55
+ * of a thrown object, becomes the message; any other value is described in
56
+ * the message. A value that is not an Error is kept as the `cause`. This
57
+ * never throws, whatever the value.
58
+ */
59
+ function toError(value) {
60
+ if (isError(value)) return value;
61
+ const message = typeof value === "string" && value !== "" ? value : messageOf(value) ?? `A value that is not an Error was thrown: ${describeThrown(value)}`;
62
+ return withCause(new Error(message), value);
63
+ }
64
+
65
+ //#endregion
66
+ export { toError, withCause };
67
+ //# sourceMappingURL=thrown.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thrown.mjs","names":[],"sources":["../../src/generative-ui/thrown.ts"],"sourcesContent":["// Turns any thrown value into an Error, for the error boundaries of the\n// framework packages. Framework-free, and safe on Hermes.\n\n/**\n * Sets `cause` as an own property. `new Error(message, { cause })` needs\n * ES2022 error options, which an engine without them (the JavaScriptCore of\n * iOS before 15, which React Native 0.70 can still run on) ignores without a\n * word, so it is set by hand on every engine.\n */\nexport function withCause(error: Error, cause: unknown): Error {\n Object.defineProperty(error, \"cause\", {\n value: cause,\n writable: true,\n configurable: true,\n enumerable: false,\n });\n return error;\n}\n\n/** The longest description of a thrown object's data. */\nconst MAX_DESCRIPTION = 200;\n\n/**\n * Reads what a thrown value says without letting the reading throw: a\n * getter, a Proxy trap, a `toJSON` or a `toString` may throw too.\n */\nfunction attempt<T>(read: () => T): T | undefined {\n try {\n return read();\n } catch {\n return undefined;\n }\n}\n\n/** The `message` of a thrown object, when it is a non-empty string. */\nfunction messageOf(value: unknown): string | undefined {\n if (typeof value !== \"object\" || value === null) return undefined;\n const message = attempt(() => (value as { message?: unknown }).message);\n return typeof message === \"string\" && message !== \"\" ? message : undefined;\n}\n\n/** A thrown value as text, for a value that is not an Error. */\nfunction describeThrown(value: unknown): string {\n if (typeof value === \"string\") return JSON.stringify(value);\n if (typeof value === \"object\" && value !== null) {\n // Its data, not \"[object Object]\".\n const json = attempt(() => JSON.stringify(value));\n if (typeof json === \"string\") {\n return json.length > MAX_DESCRIPTION\n ? `${json.slice(0, MAX_DESCRIPTION)}…`\n : json;\n }\n }\n return (\n attempt(() => String(value)) ??\n attempt(() => Object.prototype.toString.call(value)) ??\n typeof value\n );\n}\n\n/** An Error of this realm, or of another one (a frame, a VM context). */\nfunction isError(value: unknown): value is Error {\n // `instanceof` runs a Proxy's getPrototypeOf trap, which may throw.\n if (attempt(() => value instanceof Error)) return true;\n // Another realm's Error fails `instanceof`; its tag says what it is. A\n // tag can be set on any object, so it must have a message as well.\n return (\n attempt(() => Object.prototype.toString.call(value)) === \"[object Error]\" &&\n typeof attempt(() => (value as { message?: unknown }).message) === \"string\"\n );\n}\n\n/**\n * The Error for any thrown value. Code may throw anything: a string, or a\n * falsy value (`undefined`, `null`, `0`, `\"\"`) that a boundary which keeps\n * the thrown value and tests it for truth would take for \"no error\". An\n * Error comes back as it is; a non-empty string, or the string `message`\n * of a thrown object, becomes the message; any other value is described in\n * the message. A value that is not an Error is kept as the `cause`. This\n * never throws, whatever the value.\n */\nexport function toError(value: unknown): Error {\n if (isError(value)) return value;\n const message =\n typeof value === \"string\" && value !== \"\"\n ? value\n : (messageOf(value) ??\n `A value that is not an Error was thrown: ${describeThrown(value)}`);\n return withCause(new Error(message), value);\n}\n"],"mappings":";;;;;;;AASA,SAAgB,UAAU,OAAc,OAAuB;AAC7D,QAAO,eAAe,OAAO,SAAS;EACpC,OAAO;EACP,UAAU;EACV,cAAc;EACd,YAAY;EACb,CAAC;AACF,QAAO;;;AAIT,MAAM,kBAAkB;;;;;AAMxB,SAAS,QAAW,MAA8B;AAChD,KAAI;AACF,SAAO,MAAM;SACP;AACN;;;;AAKJ,SAAS,UAAU,OAAoC;AACrD,KAAI,OAAO,UAAU,YAAY,UAAU,KAAM,QAAO;CACxD,MAAM,UAAU,cAAe,MAAgC,QAAQ;AACvE,QAAO,OAAO,YAAY,YAAY,YAAY,KAAK,UAAU;;;AAInE,SAAS,eAAe,OAAwB;AAC9C,KAAI,OAAO,UAAU,SAAU,QAAO,KAAK,UAAU,MAAM;AAC3D,KAAI,OAAO,UAAU,YAAY,UAAU,MAAM;EAE/C,MAAM,OAAO,cAAc,KAAK,UAAU,MAAM,CAAC;AACjD,MAAI,OAAO,SAAS,SAClB,QAAO,KAAK,SAAS,kBACjB,GAAG,KAAK,MAAM,GAAG,gBAAgB,CAAC,KAClC;;AAGR,QACE,cAAc,OAAO,MAAM,CAAC,IAC5B,cAAc,OAAO,UAAU,SAAS,KAAK,MAAM,CAAC,IACpD,OAAO;;;AAKX,SAAS,QAAQ,OAAgC;AAE/C,KAAI,cAAc,iBAAiB,MAAM,CAAE,QAAO;AAGlD,QACE,cAAc,OAAO,UAAU,SAAS,KAAK,MAAM,CAAC,KAAK,oBACzD,OAAO,cAAe,MAAgC,QAAQ,KAAK;;;;;;;;;;;AAavE,SAAgB,QAAQ,OAAuB;AAC7C,KAAI,QAAQ,MAAM,CAAE,QAAO;CAC3B,MAAM,UACJ,OAAO,UAAU,YAAY,UAAU,KACnC,QACC,UAAU,MAAM,IACjB,4CAA4C,eAAe,MAAM;AACvE,QAAO,UAAU,IAAI,MAAM,QAAQ,EAAE,MAAM"}
package/dist/index.cjs CHANGED
@@ -36,6 +36,7 @@ const require_a2ui_envelope = require('./a2ui-envelope.cjs');
36
36
  const require_open_generative_ui_prompts = require('./open-generative-ui-prompts.cjs');
37
37
  const require_validate_operation = require('./generative-ui/validate-operation.cjs');
38
38
  const require_render_ui_args = require('./generative-ui/render-ui-args.cjs');
39
+ const require_clone_value = require('./generative-ui/clone-value.cjs');
39
40
  const require_compact_schema = require('./generative-ui/compact-schema.cjs');
40
41
  const require_schema_render = require('./generative-ui/schema-render.cjs');
41
42
  const require_prompt = require('./generative-ui/prompt.cjs');
@@ -166,6 +167,7 @@ exports.callerProblem = require_validate_operation.callerProblem;
166
167
  exports.childIdsAtRefs = require_child_refs.childIdsAtRefs;
167
168
  exports.childRefKind = require_child_refs.childRefKind;
168
169
  exports.classifyModelHost = require_model_host.classifyModelHost;
170
+ exports.cloneValue = require_clone_value.cloneValue;
169
171
  exports.collectChildRefs = require_child_refs.collectChildRefs;
170
172
  exports.commitRowKeyStore = require_row_render_keys.commitRowKeyStore;
171
173
  exports.computeSamplingMeta = require_sampling.computeSamplingMeta;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["export * from \"./types\";\nexport * from \"./utils\";\nexport * from \"./constants\";\n// Telemetry is split deliberately. `TelemetryClient` imports\n// `@segment/analytics-node`, which imports `node-fetch`, which imports the\n// Node built-ins `stream`, `http`, `https` and `zlib`. Browser bundlers\n// resolve the whole module graph before they tree-shake, so re-exporting\n// that module here made every browser build of a dependent package print\n// \"Module ... has been externalized for browser compatibility\" warnings,\n// even when the consumer never touched telemetry (#4151). Only the\n// browser-safe telemetry surface is re-exported from this entry. Server\n// code that needs the client imports it from `@copilotkit/shared/telemetry`.\n// This mirrors the license-verifier note below.\nexport { isTelemetryDisabled } from \"./telemetry/telemetry-disabled\";\nexport * from \"./telemetry/sampling\";\n// Pure string classification with no imports, so it carries no runtime edge\n// into browser builds — same reasoning as `sampling` above.\nexport * from \"./telemetry/model-host\";\nexport {\n firstNonBlankTelemetryId,\n lambdaClient,\n parseTelemetryIdFromLicense,\n parseAndWarnTelemetryId,\n} from \"./telemetry/lambda-client\";\nexport type { LambdaSendOptions } from \"./telemetry/lambda-client\";\n// Types only: erased at build time, so they add no runtime edge to\n// `telemetry-client.ts` and therefore none to @segment/analytics-node.\nexport type {\n TelemetryCapture,\n TelemetryIdentity,\n} from \"./telemetry/telemetry-client\";\nexport * from \"./debug\";\nexport * from \"./standard-schema\";\nexport * from \"./attachments\";\n\nexport { logger } from \"./logger\";\nexport {\n createRunEventFinalizer,\n finalizeRunEvents,\n type FinalizeRunOptions,\n type RunEventFinalizer,\n} from \"./finalize-events\";\nexport { stripIntelligenceRoutingFields } from \"./intelligence-routing-fields\";\n\nexport {\n TranscriptionErrorCode,\n TranscriptionErrors,\n type TranscriptionErrorResponse,\n} from \"./transcription-errors\";\n\nimport * as packageJson from \"../package.json\";\nexport const COPILOTKIT_VERSION = packageJson.version;\n\n// Re-export only types from license-verifier (types are erased at compile time,\n// so they don't pull in the Node-only `crypto` dependency into client bundles).\n// Server-side packages (e.g. @copilotkit/runtime) should import runtime functions\n// like createLicenseChecker and getLicenseWarningHeader directly from\n// @copilotkit/license-verifier.\nexport type {\n LicenseChecker,\n LicenseStatus,\n LicensePayload,\n LicenseFeatures,\n LicenseTier,\n LicenseOwner,\n} from \"@copilotkit/license-verifier\";\n\nimport type { LicensePayload } from \"@copilotkit/license-verifier\";\nimport type {\n RuntimeEntitlementResponse,\n RuntimeLicenseStatus,\n} from \"./utils/types\";\n\n// LicenseContextValue was dropped from license-verifier's public API in\n// 0.3.0, so it is defined here. The context shape is owned by this package\n// anyway via createLicenseContextValue below.\n\n/**\n * License context value exposed to child components.\n * Frontend providers create their own context using this shape.\n */\nexport interface LicenseContextValue {\n /** Effective license status after structured entitlement precedence. Null until known. */\n status: RuntimeLicenseStatus | null;\n /** The license payload if available. Always null on the client; the payload stays server-side. */\n license: LicensePayload | null;\n /** Whether a feature is licensed. Ready entitlements override legacy status behavior. */\n checkFeature: (feature: string) => boolean;\n /** Get a numeric feature limit. Zero means unlimited; null means not applicable. */\n getLimit: (feature: string) => number | null;\n}\n\n/** Read a record value without traversing its prototype chain. */\nfunction getOwnRecordValue<Value>(\n record: Readonly<Record<string, Value>>,\n key: string,\n): Value | undefined {\n return Object.prototype.hasOwnProperty.call(record, key)\n ? record[key]\n : undefined;\n}\n\n/** Legacy UI surfaces that remain available for every active entitlement. */\nfunction isLegacyUiFeature(feature: string): boolean {\n return feature === \"chat\" || feature === \"popup\" || feature === \"sidebar\";\n}\n\n/**\n * Client-safe license context factory, driven by the license authority the\n * runtime reports via /info.\n *\n * A ready managed entitlement is authoritative in both directions. A ready\n * active self-hosted entitlement is also authoritative, while an inactive\n * self-hosted response preserves the legacy signed-license fallback. Active\n * entitlements supply feature grants and limits; authoritative inactive\n * entitlements deny every feature and limit. Older runtimes that report only a\n * status retain the legacy behavior: features are enabled unless the status is\n * \"expired\" or \"invalid\", and no limits are reported. This is inlined here to\n * avoid importing the full license-verifier bundle (which depends on Node's\n * `crypto`) into browser bundles.\n */\nexport function createLicenseContextValue(\n status: RuntimeLicenseStatus | null | undefined,\n runtimeEntitlements?: RuntimeEntitlementResponse,\n): LicenseContextValue {\n const readyEntitlement =\n runtimeEntitlements?.status === \"ready\"\n ? runtimeEntitlements.entitlement\n : null;\n const hasUsableSelfHostedLegacyFallback =\n readyEntitlement &&\n !readyEntitlement.active &&\n readyEntitlement.source === \"selfHostedDeploymentLicense\" &&\n (status === \"valid\" || status === \"expiring\");\n const featureAuthority =\n readyEntitlement && !hasUsableSelfHostedLegacyFallback\n ? readyEntitlement\n : null;\n const activeEntitlement = featureAuthority?.active ? featureAuthority : null;\n const resolvedStatus = activeEntitlement\n ? \"valid\"\n : readyEntitlement?.source === \"managedOrgSubscription\" ||\n readyEntitlement?.source === \"awsMarketplaceDeploymentLicense\"\n ? \"none\"\n : featureAuthority\n ? (status ?? \"none\")\n : (status ?? null);\n const featuresEnabled =\n resolvedStatus !== \"expired\" && resolvedStatus !== \"invalid\";\n\n return {\n status: resolvedStatus,\n license: null,\n checkFeature: (feature) =>\n featureAuthority\n ? activeEntitlement\n ? feature === \"threads\" &&\n Object.prototype.hasOwnProperty.call(\n activeEntitlement.limits,\n \"threads.max_count\",\n )\n ? true\n : (getOwnRecordValue(activeEntitlement.features, feature) ??\n isLegacyUiFeature(feature))\n : false\n : featuresEnabled,\n getLimit: (feature) =>\n activeEntitlement\n ? (getOwnRecordValue(activeEntitlement.limits, feature) ?? null)\n : null,\n };\n}\n\nexport {\n A2UI_DEFAULT_GENERATION_GUIDELINES,\n A2UI_DEFAULT_DESIGN_GUIDELINES,\n ALL_GENERATIVE_UI_GUIDE_FEATURES,\n buildGenerativeUIMarkdownGuidelines,\n generativeUIGuideFeatures,\n GENERATIVE_UI_MARKDOWN_GUIDELINES,\n GENERATIVE_UI_MARKDOWN_GUIDELINES_DESCRIPTION,\n GENERATIVE_UI_MARKDOWN_SCHEMA_CONTEXT_DESCRIPTION,\n} from \"./a2ui-prompts\";\nexport type { GenerativeUIGuideFeatures } from \"./a2ui-prompts\";\nexport {\n A2UI_BASIC_CATALOG_ID,\n A2UI_SCHEMA_CONTEXT_DESCRIPTION,\n buildA2UICatalogContextValue,\n extractA2UICatalogSchemas,\n serializeA2UISchema,\n} from \"./a2ui-catalog-schema\";\nexport type {\n A2UICatalogSchemaSource,\n A2UICommonTypes,\n A2UIFunctionSchema,\n A2UIInlineCatalogSchema,\n} from \"./a2ui-catalog-schema\";\nexport {\n COPILOTKIT_FORWARDED_PROPS_KEY,\n COPILOTKIT_UI_ENVELOPE_FORMAT,\n envelopeToManifest,\n readCopilotKitUIEnvelope,\n} from \"./a2ui-envelope\";\nexport type { CopilotKitUIEnvelope } from \"./a2ui-envelope\";\n\nexport type { DebugEventEnvelope } from \"./debug-event-envelope\";\n\nexport { GENERATE_SANDBOXED_UI_DESCRIPTION } from \"./open-generative-ui-prompts\";\nexport * from \"./generative-ui/base\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,MAAa;;AA0Cb,SAAS,kBACP,QACA,KACmB;AACnB,QAAO,OAAO,UAAU,eAAe,KAAK,QAAQ,IAAI,GACpD,OAAO,OACP;;;AAIN,SAAS,kBAAkB,SAA0B;AACnD,QAAO,YAAY,UAAU,YAAY,WAAW,YAAY;;;;;;;;;;;;;;;;AAiBlE,SAAgB,0BACd,QACA,qBACqB;CACrB,MAAM,mBACJ,qBAAqB,WAAW,UAC5B,oBAAoB,cACpB;CACN,MAAM,oCACJ,oBACA,CAAC,iBAAiB,UAClB,iBAAiB,WAAW,kCAC3B,WAAW,WAAW,WAAW;CACpC,MAAM,mBACJ,oBAAoB,CAAC,oCACjB,mBACA;CACN,MAAM,oBAAoB,kBAAkB,SAAS,mBAAmB;CACxE,MAAM,iBAAiB,oBACnB,UACA,kBAAkB,WAAW,4BAC3B,kBAAkB,WAAW,oCAC7B,SACA,mBACG,UAAU,SACV,UAAU;CACnB,MAAM,kBACJ,mBAAmB,aAAa,mBAAmB;AAErD,QAAO;EACL,QAAQ;EACR,SAAS;EACT,eAAe,YACb,mBACI,oBACE,YAAY,aACZ,OAAO,UAAU,eAAe,KAC9B,kBAAkB,QAClB,oBACD,GACC,OACC,kBAAkB,kBAAkB,UAAU,QAAQ,IACvD,kBAAkB,QAAQ,GAC5B,QACF;EACN,WAAW,YACT,oBACK,kBAAkB,kBAAkB,QAAQ,QAAQ,IAAI,OACzD;EACP"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["export * from \"./types\";\nexport * from \"./utils\";\nexport * from \"./constants\";\n// Telemetry is split deliberately. `TelemetryClient` imports\n// `@segment/analytics-node`, which imports `node-fetch`, which imports the\n// Node built-ins `stream`, `http`, `https` and `zlib`. Browser bundlers\n// resolve the whole module graph before they tree-shake, so re-exporting\n// that module here made every browser build of a dependent package print\n// \"Module ... has been externalized for browser compatibility\" warnings,\n// even when the consumer never touched telemetry (#4151). Only the\n// browser-safe telemetry surface is re-exported from this entry. Server\n// code that needs the client imports it from `@copilotkit/shared/telemetry`.\n// This mirrors the license-verifier note below.\nexport { isTelemetryDisabled } from \"./telemetry/telemetry-disabled\";\nexport * from \"./telemetry/sampling\";\n// Pure string classification with no imports, so it carries no runtime edge\n// into browser builds — same reasoning as `sampling` above.\nexport * from \"./telemetry/model-host\";\nexport {\n firstNonBlankTelemetryId,\n lambdaClient,\n parseTelemetryIdFromLicense,\n parseAndWarnTelemetryId,\n} from \"./telemetry/lambda-client\";\nexport type { LambdaSendOptions } from \"./telemetry/lambda-client\";\n// Types only: erased at build time, so they add no runtime edge to\n// `telemetry-client.ts` and therefore none to @segment/analytics-node.\nexport type {\n TelemetryCapture,\n TelemetryIdentity,\n} from \"./telemetry/telemetry-client\";\nexport * from \"./debug\";\nexport * from \"./standard-schema\";\nexport * from \"./attachments\";\n\nexport { logger } from \"./logger\";\nexport {\n createRunEventFinalizer,\n finalizeRunEvents,\n type FinalizeRunOptions,\n type RunEventFinalizer,\n} from \"./finalize-events\";\nexport { stripIntelligenceRoutingFields } from \"./intelligence-routing-fields\";\n\nexport {\n TranscriptionErrorCode,\n TranscriptionErrors,\n type TranscriptionErrorResponse,\n} from \"./transcription-errors\";\n\nimport * as packageJson from \"../package.json\";\nexport const COPILOTKIT_VERSION = packageJson.version;\n\n// Re-export only types from license-verifier (types are erased at compile time,\n// so they don't pull in the Node-only `crypto` dependency into client bundles).\n// Server-side packages (e.g. @copilotkit/runtime) should import runtime functions\n// like createLicenseChecker and getLicenseWarningHeader directly from\n// @copilotkit/license-verifier.\nexport type {\n LicenseChecker,\n LicenseStatus,\n LicensePayload,\n LicenseFeatures,\n LicenseTier,\n LicenseOwner,\n} from \"@copilotkit/license-verifier\";\n\nimport type { LicensePayload } from \"@copilotkit/license-verifier\";\nimport type {\n RuntimeEntitlementResponse,\n RuntimeLicenseStatus,\n} from \"./utils/types\";\n\n// LicenseContextValue was dropped from license-verifier's public API in\n// 0.3.0, so it is defined here. The context shape is owned by this package\n// anyway via createLicenseContextValue below.\n\n/**\n * License context value exposed to child components.\n * Frontend providers create their own context using this shape.\n */\nexport interface LicenseContextValue {\n /** Effective license status after structured entitlement precedence. Null until known. */\n status: RuntimeLicenseStatus | null;\n /** The license payload if available. Always null on the client; the payload stays server-side. */\n license: LicensePayload | null;\n /** Whether a feature is licensed. Ready entitlements override legacy status behavior. */\n checkFeature: (feature: string) => boolean;\n /** Get a numeric feature limit. Zero means unlimited; null means not applicable. */\n getLimit: (feature: string) => number | null;\n}\n\n/** Read a record value without traversing its prototype chain. */\nfunction getOwnRecordValue<Value>(\n record: Readonly<Record<string, Value>>,\n key: string,\n): Value | undefined {\n return Object.prototype.hasOwnProperty.call(record, key)\n ? record[key]\n : undefined;\n}\n\n/** Legacy UI surfaces that remain available for every active entitlement. */\nfunction isLegacyUiFeature(feature: string): boolean {\n return feature === \"chat\" || feature === \"popup\" || feature === \"sidebar\";\n}\n\n/**\n * Client-safe license context factory, driven by the license authority the\n * runtime reports via /info.\n *\n * A ready managed entitlement is authoritative in both directions. A ready\n * active self-hosted entitlement is also authoritative, while an inactive\n * self-hosted response preserves the legacy signed-license fallback. Active\n * entitlements supply feature grants and limits; authoritative inactive\n * entitlements deny every feature and limit. Older runtimes that report only a\n * status retain the legacy behavior: features are enabled unless the status is\n * \"expired\" or \"invalid\", and no limits are reported. This is inlined here to\n * avoid importing the full license-verifier bundle (which depends on Node's\n * `crypto`) into browser bundles.\n */\nexport function createLicenseContextValue(\n status: RuntimeLicenseStatus | null | undefined,\n runtimeEntitlements?: RuntimeEntitlementResponse,\n): LicenseContextValue {\n const readyEntitlement =\n runtimeEntitlements?.status === \"ready\"\n ? runtimeEntitlements.entitlement\n : null;\n const hasUsableSelfHostedLegacyFallback =\n readyEntitlement &&\n !readyEntitlement.active &&\n readyEntitlement.source === \"selfHostedDeploymentLicense\" &&\n (status === \"valid\" || status === \"expiring\");\n const featureAuthority =\n readyEntitlement && !hasUsableSelfHostedLegacyFallback\n ? readyEntitlement\n : null;\n const activeEntitlement = featureAuthority?.active ? featureAuthority : null;\n const resolvedStatus = activeEntitlement\n ? \"valid\"\n : readyEntitlement?.source === \"managedOrgSubscription\" ||\n readyEntitlement?.source === \"awsMarketplaceDeploymentLicense\"\n ? \"none\"\n : featureAuthority\n ? (status ?? \"none\")\n : (status ?? null);\n const featuresEnabled =\n resolvedStatus !== \"expired\" && resolvedStatus !== \"invalid\";\n\n return {\n status: resolvedStatus,\n license: null,\n checkFeature: (feature) =>\n featureAuthority\n ? activeEntitlement\n ? feature === \"threads\" &&\n Object.prototype.hasOwnProperty.call(\n activeEntitlement.limits,\n \"threads.max_count\",\n )\n ? true\n : (getOwnRecordValue(activeEntitlement.features, feature) ??\n isLegacyUiFeature(feature))\n : false\n : featuresEnabled,\n getLimit: (feature) =>\n activeEntitlement\n ? (getOwnRecordValue(activeEntitlement.limits, feature) ?? null)\n : null,\n };\n}\n\nexport {\n A2UI_DEFAULT_GENERATION_GUIDELINES,\n A2UI_DEFAULT_DESIGN_GUIDELINES,\n ALL_GENERATIVE_UI_GUIDE_FEATURES,\n buildGenerativeUIMarkdownGuidelines,\n generativeUIGuideFeatures,\n GENERATIVE_UI_MARKDOWN_GUIDELINES,\n GENERATIVE_UI_MARKDOWN_GUIDELINES_DESCRIPTION,\n GENERATIVE_UI_MARKDOWN_SCHEMA_CONTEXT_DESCRIPTION,\n} from \"./a2ui-prompts\";\nexport type { GenerativeUIGuideFeatures } from \"./a2ui-prompts\";\nexport {\n A2UI_BASIC_CATALOG_ID,\n A2UI_SCHEMA_CONTEXT_DESCRIPTION,\n buildA2UICatalogContextValue,\n extractA2UICatalogSchemas,\n serializeA2UISchema,\n} from \"./a2ui-catalog-schema\";\nexport type {\n A2UICatalogSchemaSource,\n A2UICommonTypes,\n A2UIFunctionSchema,\n A2UIInlineCatalogSchema,\n} from \"./a2ui-catalog-schema\";\nexport {\n COPILOTKIT_FORWARDED_PROPS_KEY,\n COPILOTKIT_UI_ENVELOPE_FORMAT,\n envelopeToManifest,\n readCopilotKitUIEnvelope,\n} from \"./a2ui-envelope\";\nexport type { CopilotKitUIEnvelope } from \"./a2ui-envelope\";\n\nexport type { DebugEventEnvelope } from \"./debug-event-envelope\";\n\nexport { GENERATE_SANDBOXED_UI_DESCRIPTION } from \"./open-generative-ui-prompts\";\nexport * from \"./generative-ui/base\";\n// On the root, not only on `@copilotkit/shared/generative-ui`: the core\n// root entry needs it, and importing the generative UI barrel there would\n// load its validators and catalogs in every app (Metro does not\n// tree-shake), and leave the UMD build without a global for the subpath.\nexport { cloneValue } from \"./generative-ui/clone-value\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,MAAa;;AA0Cb,SAAS,kBACP,QACA,KACmB;AACnB,QAAO,OAAO,UAAU,eAAe,KAAK,QAAQ,IAAI,GACpD,OAAO,OACP;;;AAIN,SAAS,kBAAkB,SAA0B;AACnD,QAAO,YAAY,UAAU,YAAY,WAAW,YAAY;;;;;;;;;;;;;;;;AAiBlE,SAAgB,0BACd,QACA,qBACqB;CACrB,MAAM,mBACJ,qBAAqB,WAAW,UAC5B,oBAAoB,cACpB;CACN,MAAM,oCACJ,oBACA,CAAC,iBAAiB,UAClB,iBAAiB,WAAW,kCAC3B,WAAW,WAAW,WAAW;CACpC,MAAM,mBACJ,oBAAoB,CAAC,oCACjB,mBACA;CACN,MAAM,oBAAoB,kBAAkB,SAAS,mBAAmB;CACxE,MAAM,iBAAiB,oBACnB,UACA,kBAAkB,WAAW,4BAC3B,kBAAkB,WAAW,oCAC7B,SACA,mBACG,UAAU,SACV,UAAU;CACnB,MAAM,kBACJ,mBAAmB,aAAa,mBAAmB;AAErD,QAAO;EACL,QAAQ;EACR,SAAS;EACT,eAAe,YACb,mBACI,oBACE,YAAY,aACZ,OAAO,UAAU,eAAe,KAC9B,kBAAkB,QAClB,oBACD,GACC,OACC,kBAAkB,kBAAkB,UAAU,QAAQ,IACvD,kBAAkB,QAAQ,GAC5B,QACF;EACN,WAAW,YACT,oBACK,kBAAkB,kBAAkB,QAAQ,QAAQ,IAAI,OACzD;EACP"}
package/dist/index.d.cts CHANGED
@@ -8,6 +8,7 @@ import { GENERATIVE_UI_CONTEXT_DESCRIPTION, buildGenerativeUIPrompt } from "./ge
8
8
  import { buildCompactGenerativeUISchema } from "./generative-ui/compact-schema.cjs";
9
9
  import { applyDescriptionOverrides, renderGenerativeUIComponentList, renderGenerativeUISchema, schemaCoverage } from "./generative-ui/schema-render.cjs";
10
10
  import { InferSchemaOutput, SchemaToJsonSchemaOptions, StandardJSONSchemaV1, StandardSchemaV1, schemaToJsonSchema } from "./standard-schema.cjs";
11
+ import { cloneValue } from "./generative-ui/clone-value.cjs";
11
12
  import { AssistantMessage, CoAgentStateRenderHandler, CoAgentStateRenderHandlerArguments, FunctionCallHandler, FunctionCallHandlerArguments, FunctionDefinition, JSONValue, ToolDefinition } from "./types/openai-assistant.cjs";
12
13
  import { Action, MappedParameterTypes, Parameter } from "./types/action.cjs";
13
14
  import { CopilotCloudConfig } from "./types/copilot-cloud-config.cjs";
@@ -80,5 +81,5 @@ interface LicenseContextValue {
80
81
  */
81
82
  declare function createLicenseContextValue(status: RuntimeLicenseStatus | null | undefined, runtimeEntitlements?: RuntimeEntitlementResponse): LicenseContextValue;
82
83
  //#endregion
83
- export { A2UIActionMessage, A2UIAllowedCallers, A2UIBasicFunctionInfo, type A2UICatalogSchemaSource, type A2UICommonTypes, A2UIComponentNode, A2UIFunctionCall, A2UIFunctionPermissions, A2UIFunctionReturnType, type A2UIFunctionSchema, type A2UIInlineCatalogSchema, A2UIOperation, A2UIRuntimeInfo, A2UIValidationResult, A2UIValidationSeverity, A2UI_BASIC_CATALOG_ID, A2UI_BASIC_FUNCTIONS, A2UI_CHILD_LIST_MARK, A2UI_CHILD_LIST_REF, A2UI_COMPONENT_ENVELOPE_KEYS, A2UI_COMPONENT_ID_MARK, A2UI_COMPONENT_ID_REF, A2UI_DEFAULT_DESIGN_GUIDELINES, A2UI_DEFAULT_GENERATION_GUIDELINES, A2UI_INDEX_FUNCTION, A2UI_SCHEMA_CONTEXT_DESCRIPTION, A2UI_VERSION, AG_UI_CHANNEL_EVENT, AIMessage, ALL_GENERATIVE_UI_GUIDE_FEATURES, Action, ActivityMessage, AgentDescription, AllowedComponents, AssistantMessage, Attachment, AttachmentModality, AttachmentUploadError, AttachmentUploadErrorReason, AttachmentUploadResult, AttachmentsConfig, AudioInputPart, BANNER_ERROR_NAMES, BaseCondition, COPILOTKIT_FORWARDED_PROPS_KEY, COPILOTKIT_FUNCTIONS, COPILOTKIT_UI_ENVELOPE_FORMAT, COPILOTKIT_VERSION, COPILOT_CLOUD_API_URL, COPILOT_CLOUD_CHAT_URL, COPILOT_CLOUD_ERROR_NAMES, COPILOT_CLOUD_PUBLIC_API_KEY_HEADER, COPILOT_CLOUD_VERSION, ChildRef, ChildRefKind, CoAgentStateRenderHandler, CoAgentStateRenderHandlerArguments, ComparisonCondition, ComparisonRule, Condition, ConfigurationError, ConsoleColors, ConsoleStyles, CopilotCloudConfig, CopilotErrorEvent, CopilotErrorHandler, CopilotKitAgentDiscoveryError, CopilotKitApiDiscoveryError, CopilotKitError, CopilotKitErrorCode, CopilotKitLowLevelError, CopilotKitMisuseError, CopilotKitRemoteEndpointDiscoveryError, type CopilotKitUIEnvelope, CopilotKitVersionMismatchError, CopilotRequestContext, DEFAULT_AGENT_ID, DebugConfig, type DebugEventEnvelope, DeveloperMessage, DocumentInputPart, ERROR_CONFIG, ERROR_NAMES, ErrorVisibility, ExistenceCondition, ExistenceRule, ExtractedRenderUIArgs, type FinalizeRunOptions, FunctionCallHandler, FunctionCallHandlerArguments, FunctionDefinition, GENERATE_SANDBOXED_UI_DESCRIPTION, GENERATIVE_UI_ACTIVITY_TYPE, GENERATIVE_UI_AGENT_FUNCTION_CALLS, GENERATIVE_UI_AGENT_FUNCTION_CALLS_OFF_REASON, GENERATIVE_UI_CHAT_TARGET, GENERATIVE_UI_CONTEXT_DESCRIPTION, GENERATIVE_UI_DEFAULT_ALLOWED_CALLERS, GENERATIVE_UI_FUNCTIONS, GENERATIVE_UI_FUNCTION_CALL_ACTIVITY_TYPE, GENERATIVE_UI_MARKDOWN_GUIDELINES, GENERATIVE_UI_MARKDOWN_GUIDELINES_DESCRIPTION, GENERATIVE_UI_MARKDOWN_SCHEMA_CONTEXT_DESCRIPTION, GENERATIVE_UI_MARKDOWN_WHEN_TO_SHOW, GENERATIVE_UI_MAX_REJECTION_LENGTH, GENERATIVE_UI_MAX_SUMMARY_REJECTIONS, GENERATIVE_UI_MAX_TARGET_COMPONENTS, GENERATIVE_UI_RENDER_TOOL, GENERATIVE_UI_ROOT_ID, GENERATIVE_UI_WHEN_TO_SHOW, GUIDE_COMPONENTS, GenerativeUIActionBinding, GenerativeUIComponentManifest, GenerativeUIFunctionCallContent, GenerativeUIFunctionManifest, type GenerativeUIGuideFeatures, GenerativeUIJSONSchema, GenerativeUIManifest, GenerativeUIPromptFeature, GenerativeUIPromptFeatures, GenerativeUIPromptItem, GenerativeUIPromptSection, GenerativeUIPromptSpec, GenerativeUIRejectedOperation, GenerativeUISchemaSettings, GenerativeUISurfaceContent, GenerativeUISurfaceStatus, GenerativeUISurfaceSummary, GenerativeUITarget, GenerativeUITemplateChildren, GenerativeUIUserEvent, ImageData, ImageInputPart, InferSchemaOutput, InputContent, InputContentDataSource, InputContentSource, InputContentUrlSource, InspectorLearningEvidence, InspectorLearningInsight, InspectorLearningPage, InspectorLearningRequestV1, InspectorLearningSkill, InspectorLearningSnapshotV1, InspectorLearningTrajectoryEvidence, InspectorMetadataV1, InspectorVisibilityOptions, IntelligenceRuntimeInfo, JSONSchema, JSONSchemaArray, JSONSchemaBoolean, JSONSchemaNumber, JSONSchemaObject, JSONSchemaString, JSONValue, type LambdaSendOptions, type LicenseChecker, LicenseContextValue, type LicenseFeatures, type LicenseOwner, type LicensePayload, type LicenseStatus, type LicenseTier, LogicalCondition, LogicalRule, MODEL_HOST_CLASSES, MappedParameterTypes, MaybePromise, Message, MissingPublicApiKeyError, ModelHostClass, NonEmptyRecord, OperationKind, OperationValidation, Parameter, PartialBy, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, ReasoningMessage, RenderUIArgsStream, RequiredBy, ResolvedCopilotKitError, ResolvedDebugConfig, Role, RowKeyStore, Rule, type RunEventFinalizer, RuntimeEntitlementResponse, RuntimeInfo, RuntimeLicenseStatus, RuntimeMode, SamplingMeta, SchemaToJsonSchemaOptions, Severity, SingleRouteRuntimeInfo, StandardJSONSchemaV1, StandardSchemaV1, SystemMessage, TELEMETRY_EMITTER_V1, TELEMETRY_EMITTER_V2, TELEMETRY_SURFACE_V1, TELEMETRY_SURFACE_V2, THREAD_ALREADY_RUNNING_ERROR_CODE, type TelemetryCapture, TelemetryEmitter, type TelemetryIdentity, TelemetrySurface, TelemetryTransport, TextInputPart, ThreadEndpointRuntimeInfo, ToolCall, ToolDefinition, ToolResult, TranscriptionErrorCode, type TranscriptionErrorResponse, TranscriptionErrors, UNSAMPLED_RATE, UpgradeRequiredError, UserMessage, ValidateOperationOptions, VideoInputPart, actionParametersToJsonSchema, applyChildRefMarks, applyDescriptionOverrides, buildA2UICatalogContextValue, buildCompactGenerativeUISchema, buildGenerativeUIMarkdownGuidelines, buildGenerativeUIPrompt, callerProblem, childIdsAtRefs, childRefKind, classifyModelHost, collectChildRefs, commitRowKeyStore, computeSamplingMeta, convertJsonSchemaToZodSchema, copyToClipboard, createAttachmentContent, createLicenseContextValue, createRowKeyStore, createRunEventFinalizer, dataToUUID, defaultGenerativeUIPromptSpec, ensureStructuredError, envelopeToManifest, exceedsMaxSize, executeConditions, extractA2UICatalogSchemas, extractRenderUIArgs, finalizeRunEvents, firstNonBlankTelemetryId, formatFileSize, functionCallers, generateVideoThumbnail, generativeUIFunctionCallMessageId, generativeUIGuideFeatures, generativeUIPromptFeatures, generativeUISurfaceMessageId, getDocumentIcon, getModalityFromMimeType, getOperationKind, getOperationSurfaceId, getPossibleVersionMismatch, getSourceUrl, getZodParameters, hasBoundChildRef, isA2UIBasicFunction, isA2UIValueFunction, isActionBinding, isCallBinding, isIndexCall, isMacOS, isPathBinding, isStructuredCopilotKitError, isTelemetryDisabled, isValidUUID, isValidationResult, jsonSchemaToActionParameters, lambdaClient, logCopilotKitPlatformMessage, logStyled, logger, mapAtChildRef, matchesAcceptFilter, parseAndWarnTelemetryId, parseInspectorLearningRequestV1, parseInspectorLearningSnapshotV1, parseInspectorLearningUrl, parseInspectorMetadataV1, parseJson, parseTelemetryIdFromLicense, partialJSONParse, phoenixExponentialBackoff, pruneRowKeyStore, publicApiKeyRequired, randomId, randomUUID, readBody, readCopilotKitUIEnvelope, readFileAsBase64, renderGenerativeUIComponentList, renderGenerativeUISchema, resolveDebugConfig, resolveRowRenderKeys, resolveRowRenderKeysById, safeParseToolArgs, schemaCoverage, schemaToJsonSchema, selectPromptItems, serializeA2UISchema, shouldEnableInspector, stripIntelligenceRoutingFields, styledConsole, toA2UIActionMessage, tryMap, validateOperation };
84
+ export { A2UIActionMessage, A2UIAllowedCallers, A2UIBasicFunctionInfo, type A2UICatalogSchemaSource, type A2UICommonTypes, A2UIComponentNode, A2UIFunctionCall, A2UIFunctionPermissions, A2UIFunctionReturnType, type A2UIFunctionSchema, type A2UIInlineCatalogSchema, A2UIOperation, A2UIRuntimeInfo, A2UIValidationResult, A2UIValidationSeverity, A2UI_BASIC_CATALOG_ID, A2UI_BASIC_FUNCTIONS, A2UI_CHILD_LIST_MARK, A2UI_CHILD_LIST_REF, A2UI_COMPONENT_ENVELOPE_KEYS, A2UI_COMPONENT_ID_MARK, A2UI_COMPONENT_ID_REF, A2UI_DEFAULT_DESIGN_GUIDELINES, A2UI_DEFAULT_GENERATION_GUIDELINES, A2UI_INDEX_FUNCTION, A2UI_SCHEMA_CONTEXT_DESCRIPTION, A2UI_VERSION, AG_UI_CHANNEL_EVENT, AIMessage, ALL_GENERATIVE_UI_GUIDE_FEATURES, Action, ActivityMessage, AgentDescription, AllowedComponents, AssistantMessage, Attachment, AttachmentModality, AttachmentUploadError, AttachmentUploadErrorReason, AttachmentUploadResult, AttachmentsConfig, AudioInputPart, BANNER_ERROR_NAMES, BaseCondition, COPILOTKIT_FORWARDED_PROPS_KEY, COPILOTKIT_FUNCTIONS, COPILOTKIT_UI_ENVELOPE_FORMAT, COPILOTKIT_VERSION, COPILOT_CLOUD_API_URL, COPILOT_CLOUD_CHAT_URL, COPILOT_CLOUD_ERROR_NAMES, COPILOT_CLOUD_PUBLIC_API_KEY_HEADER, COPILOT_CLOUD_VERSION, ChildRef, ChildRefKind, CoAgentStateRenderHandler, CoAgentStateRenderHandlerArguments, ComparisonCondition, ComparisonRule, Condition, ConfigurationError, ConsoleColors, ConsoleStyles, CopilotCloudConfig, CopilotErrorEvent, CopilotErrorHandler, CopilotKitAgentDiscoveryError, CopilotKitApiDiscoveryError, CopilotKitError, CopilotKitErrorCode, CopilotKitLowLevelError, CopilotKitMisuseError, CopilotKitRemoteEndpointDiscoveryError, type CopilotKitUIEnvelope, CopilotKitVersionMismatchError, CopilotRequestContext, DEFAULT_AGENT_ID, DebugConfig, type DebugEventEnvelope, DeveloperMessage, DocumentInputPart, ERROR_CONFIG, ERROR_NAMES, ErrorVisibility, ExistenceCondition, ExistenceRule, ExtractedRenderUIArgs, type FinalizeRunOptions, FunctionCallHandler, FunctionCallHandlerArguments, FunctionDefinition, GENERATE_SANDBOXED_UI_DESCRIPTION, GENERATIVE_UI_ACTIVITY_TYPE, GENERATIVE_UI_AGENT_FUNCTION_CALLS, GENERATIVE_UI_AGENT_FUNCTION_CALLS_OFF_REASON, GENERATIVE_UI_CHAT_TARGET, GENERATIVE_UI_CONTEXT_DESCRIPTION, GENERATIVE_UI_DEFAULT_ALLOWED_CALLERS, GENERATIVE_UI_FUNCTIONS, GENERATIVE_UI_FUNCTION_CALL_ACTIVITY_TYPE, GENERATIVE_UI_MARKDOWN_GUIDELINES, GENERATIVE_UI_MARKDOWN_GUIDELINES_DESCRIPTION, GENERATIVE_UI_MARKDOWN_SCHEMA_CONTEXT_DESCRIPTION, GENERATIVE_UI_MARKDOWN_WHEN_TO_SHOW, GENERATIVE_UI_MAX_REJECTION_LENGTH, GENERATIVE_UI_MAX_SUMMARY_REJECTIONS, GENERATIVE_UI_MAX_TARGET_COMPONENTS, GENERATIVE_UI_RENDER_TOOL, GENERATIVE_UI_ROOT_ID, GENERATIVE_UI_WHEN_TO_SHOW, GUIDE_COMPONENTS, GenerativeUIActionBinding, GenerativeUIComponentManifest, GenerativeUIFunctionCallContent, GenerativeUIFunctionManifest, type GenerativeUIGuideFeatures, GenerativeUIJSONSchema, GenerativeUIManifest, GenerativeUIPromptFeature, GenerativeUIPromptFeatures, GenerativeUIPromptItem, GenerativeUIPromptSection, GenerativeUIPromptSpec, GenerativeUIRejectedOperation, GenerativeUISchemaSettings, GenerativeUISurfaceContent, GenerativeUISurfaceStatus, GenerativeUISurfaceSummary, GenerativeUITarget, GenerativeUITemplateChildren, GenerativeUIUserEvent, ImageData, ImageInputPart, InferSchemaOutput, InputContent, InputContentDataSource, InputContentSource, InputContentUrlSource, InspectorLearningEvidence, InspectorLearningInsight, InspectorLearningPage, InspectorLearningRequestV1, InspectorLearningSkill, InspectorLearningSnapshotV1, InspectorLearningTrajectoryEvidence, InspectorMetadataV1, InspectorVisibilityOptions, IntelligenceRuntimeInfo, JSONSchema, JSONSchemaArray, JSONSchemaBoolean, JSONSchemaNumber, JSONSchemaObject, JSONSchemaString, JSONValue, type LambdaSendOptions, type LicenseChecker, LicenseContextValue, type LicenseFeatures, type LicenseOwner, type LicensePayload, type LicenseStatus, type LicenseTier, LogicalCondition, LogicalRule, MODEL_HOST_CLASSES, MappedParameterTypes, MaybePromise, Message, MissingPublicApiKeyError, ModelHostClass, NonEmptyRecord, OperationKind, OperationValidation, Parameter, PartialBy, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, ReasoningMessage, RenderUIArgsStream, RequiredBy, ResolvedCopilotKitError, ResolvedDebugConfig, Role, RowKeyStore, Rule, type RunEventFinalizer, RuntimeEntitlementResponse, RuntimeInfo, RuntimeLicenseStatus, RuntimeMode, SamplingMeta, SchemaToJsonSchemaOptions, Severity, SingleRouteRuntimeInfo, StandardJSONSchemaV1, StandardSchemaV1, SystemMessage, TELEMETRY_EMITTER_V1, TELEMETRY_EMITTER_V2, TELEMETRY_SURFACE_V1, TELEMETRY_SURFACE_V2, THREAD_ALREADY_RUNNING_ERROR_CODE, type TelemetryCapture, TelemetryEmitter, type TelemetryIdentity, TelemetrySurface, TelemetryTransport, TextInputPart, ThreadEndpointRuntimeInfo, ToolCall, ToolDefinition, ToolResult, TranscriptionErrorCode, type TranscriptionErrorResponse, TranscriptionErrors, UNSAMPLED_RATE, UpgradeRequiredError, UserMessage, ValidateOperationOptions, VideoInputPart, actionParametersToJsonSchema, applyChildRefMarks, applyDescriptionOverrides, buildA2UICatalogContextValue, buildCompactGenerativeUISchema, buildGenerativeUIMarkdownGuidelines, buildGenerativeUIPrompt, callerProblem, childIdsAtRefs, childRefKind, classifyModelHost, cloneValue, collectChildRefs, commitRowKeyStore, computeSamplingMeta, convertJsonSchemaToZodSchema, copyToClipboard, createAttachmentContent, createLicenseContextValue, createRowKeyStore, createRunEventFinalizer, dataToUUID, defaultGenerativeUIPromptSpec, ensureStructuredError, envelopeToManifest, exceedsMaxSize, executeConditions, extractA2UICatalogSchemas, extractRenderUIArgs, finalizeRunEvents, firstNonBlankTelemetryId, formatFileSize, functionCallers, generateVideoThumbnail, generativeUIFunctionCallMessageId, generativeUIGuideFeatures, generativeUIPromptFeatures, generativeUISurfaceMessageId, getDocumentIcon, getModalityFromMimeType, getOperationKind, getOperationSurfaceId, getPossibleVersionMismatch, getSourceUrl, getZodParameters, hasBoundChildRef, isA2UIBasicFunction, isA2UIValueFunction, isActionBinding, isCallBinding, isIndexCall, isMacOS, isPathBinding, isStructuredCopilotKitError, isTelemetryDisabled, isValidUUID, isValidationResult, jsonSchemaToActionParameters, lambdaClient, logCopilotKitPlatformMessage, logStyled, logger, mapAtChildRef, matchesAcceptFilter, parseAndWarnTelemetryId, parseInspectorLearningRequestV1, parseInspectorLearningSnapshotV1, parseInspectorLearningUrl, parseInspectorMetadataV1, parseJson, parseTelemetryIdFromLicense, partialJSONParse, phoenixExponentialBackoff, pruneRowKeyStore, publicApiKeyRequired, randomId, randomUUID, readBody, readCopilotKitUIEnvelope, readFileAsBase64, renderGenerativeUIComponentList, renderGenerativeUISchema, resolveDebugConfig, resolveRowRenderKeys, resolveRowRenderKeysById, safeParseToolArgs, schemaCoverage, schemaToJsonSchema, selectPromptItems, serializeA2UISchema, shouldEnableInspector, stripIntelligenceRoutingFields, styledConsole, toA2UIActionMessage, tryMap, validateOperation };
84
85
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAmDa,kBAAA;;;;;UA8BI,mBAAA;;EAEf,MAAA,EAAQ,oBAAA;;EAER,OAAA,EAAS,gBAAA;;EAET,YAAA,GAAe,OAAA;;EAEf,QAAA,GAAW,OAAA;AAAA;;;;;;;;;;;;;;;iBAgCG,yBAAA,CACd,MAAA,EAAQ,oBAAA,qBACR,mBAAA,GAAsB,0BAAA,GACrB,mBAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAmDa,kBAAA;;;;;UA8BI,mBAAA;;EAEf,MAAA,EAAQ,oBAAA;;EAER,OAAA,EAAS,gBAAA;;EAET,YAAA,GAAe,OAAA;;EAEf,QAAA,GAAW,OAAA;AAAA;;;;;;;;;;;;;;;iBAgCG,yBAAA,CACd,MAAA,EAAQ,oBAAA,qBACR,mBAAA,GAAsB,0BAAA,GACrB,mBAAA"}
package/dist/index.d.mts CHANGED
@@ -8,6 +8,7 @@ import { GENERATIVE_UI_CONTEXT_DESCRIPTION, buildGenerativeUIPrompt } from "./ge
8
8
  import { buildCompactGenerativeUISchema } from "./generative-ui/compact-schema.mjs";
9
9
  import { applyDescriptionOverrides, renderGenerativeUIComponentList, renderGenerativeUISchema, schemaCoverage } from "./generative-ui/schema-render.mjs";
10
10
  import { InferSchemaOutput, SchemaToJsonSchemaOptions, StandardJSONSchemaV1, StandardSchemaV1, schemaToJsonSchema } from "./standard-schema.mjs";
11
+ import { cloneValue } from "./generative-ui/clone-value.mjs";
11
12
  import { AssistantMessage, CoAgentStateRenderHandler, CoAgentStateRenderHandlerArguments, FunctionCallHandler, FunctionCallHandlerArguments, FunctionDefinition, JSONValue, ToolDefinition } from "./types/openai-assistant.mjs";
12
13
  import { Action, MappedParameterTypes, Parameter } from "./types/action.mjs";
13
14
  import { CopilotCloudConfig } from "./types/copilot-cloud-config.mjs";
@@ -80,5 +81,5 @@ interface LicenseContextValue {
80
81
  */
81
82
  declare function createLicenseContextValue(status: RuntimeLicenseStatus | null | undefined, runtimeEntitlements?: RuntimeEntitlementResponse): LicenseContextValue;
82
83
  //#endregion
83
- export { A2UIActionMessage, A2UIAllowedCallers, A2UIBasicFunctionInfo, type A2UICatalogSchemaSource, type A2UICommonTypes, A2UIComponentNode, A2UIFunctionCall, A2UIFunctionPermissions, A2UIFunctionReturnType, type A2UIFunctionSchema, type A2UIInlineCatalogSchema, A2UIOperation, A2UIRuntimeInfo, A2UIValidationResult, A2UIValidationSeverity, A2UI_BASIC_CATALOG_ID, A2UI_BASIC_FUNCTIONS, A2UI_CHILD_LIST_MARK, A2UI_CHILD_LIST_REF, A2UI_COMPONENT_ENVELOPE_KEYS, A2UI_COMPONENT_ID_MARK, A2UI_COMPONENT_ID_REF, A2UI_DEFAULT_DESIGN_GUIDELINES, A2UI_DEFAULT_GENERATION_GUIDELINES, A2UI_INDEX_FUNCTION, A2UI_SCHEMA_CONTEXT_DESCRIPTION, A2UI_VERSION, AG_UI_CHANNEL_EVENT, AIMessage, ALL_GENERATIVE_UI_GUIDE_FEATURES, Action, ActivityMessage, AgentDescription, AllowedComponents, AssistantMessage, Attachment, AttachmentModality, AttachmentUploadError, AttachmentUploadErrorReason, AttachmentUploadResult, AttachmentsConfig, AudioInputPart, BANNER_ERROR_NAMES, BaseCondition, COPILOTKIT_FORWARDED_PROPS_KEY, COPILOTKIT_FUNCTIONS, COPILOTKIT_UI_ENVELOPE_FORMAT, COPILOTKIT_VERSION, COPILOT_CLOUD_API_URL, COPILOT_CLOUD_CHAT_URL, COPILOT_CLOUD_ERROR_NAMES, COPILOT_CLOUD_PUBLIC_API_KEY_HEADER, COPILOT_CLOUD_VERSION, ChildRef, ChildRefKind, CoAgentStateRenderHandler, CoAgentStateRenderHandlerArguments, ComparisonCondition, ComparisonRule, Condition, ConfigurationError, ConsoleColors, ConsoleStyles, CopilotCloudConfig, CopilotErrorEvent, CopilotErrorHandler, CopilotKitAgentDiscoveryError, CopilotKitApiDiscoveryError, CopilotKitError, CopilotKitErrorCode, CopilotKitLowLevelError, CopilotKitMisuseError, CopilotKitRemoteEndpointDiscoveryError, type CopilotKitUIEnvelope, CopilotKitVersionMismatchError, CopilotRequestContext, DEFAULT_AGENT_ID, DebugConfig, type DebugEventEnvelope, DeveloperMessage, DocumentInputPart, ERROR_CONFIG, ERROR_NAMES, ErrorVisibility, ExistenceCondition, ExistenceRule, ExtractedRenderUIArgs, type FinalizeRunOptions, FunctionCallHandler, FunctionCallHandlerArguments, FunctionDefinition, GENERATE_SANDBOXED_UI_DESCRIPTION, GENERATIVE_UI_ACTIVITY_TYPE, GENERATIVE_UI_AGENT_FUNCTION_CALLS, GENERATIVE_UI_AGENT_FUNCTION_CALLS_OFF_REASON, GENERATIVE_UI_CHAT_TARGET, GENERATIVE_UI_CONTEXT_DESCRIPTION, GENERATIVE_UI_DEFAULT_ALLOWED_CALLERS, GENERATIVE_UI_FUNCTIONS, GENERATIVE_UI_FUNCTION_CALL_ACTIVITY_TYPE, GENERATIVE_UI_MARKDOWN_GUIDELINES, GENERATIVE_UI_MARKDOWN_GUIDELINES_DESCRIPTION, GENERATIVE_UI_MARKDOWN_SCHEMA_CONTEXT_DESCRIPTION, GENERATIVE_UI_MARKDOWN_WHEN_TO_SHOW, GENERATIVE_UI_MAX_REJECTION_LENGTH, GENERATIVE_UI_MAX_SUMMARY_REJECTIONS, GENERATIVE_UI_MAX_TARGET_COMPONENTS, GENERATIVE_UI_RENDER_TOOL, GENERATIVE_UI_ROOT_ID, GENERATIVE_UI_WHEN_TO_SHOW, GUIDE_COMPONENTS, GenerativeUIActionBinding, GenerativeUIComponentManifest, GenerativeUIFunctionCallContent, GenerativeUIFunctionManifest, type GenerativeUIGuideFeatures, GenerativeUIJSONSchema, GenerativeUIManifest, GenerativeUIPromptFeature, GenerativeUIPromptFeatures, GenerativeUIPromptItem, GenerativeUIPromptSection, GenerativeUIPromptSpec, GenerativeUIRejectedOperation, GenerativeUISchemaSettings, GenerativeUISurfaceContent, GenerativeUISurfaceStatus, GenerativeUISurfaceSummary, GenerativeUITarget, GenerativeUITemplateChildren, GenerativeUIUserEvent, ImageData, ImageInputPart, InferSchemaOutput, InputContent, InputContentDataSource, InputContentSource, InputContentUrlSource, InspectorLearningEvidence, InspectorLearningInsight, InspectorLearningPage, InspectorLearningRequestV1, InspectorLearningSkill, InspectorLearningSnapshotV1, InspectorLearningTrajectoryEvidence, InspectorMetadataV1, InspectorVisibilityOptions, IntelligenceRuntimeInfo, JSONSchema, JSONSchemaArray, JSONSchemaBoolean, JSONSchemaNumber, JSONSchemaObject, JSONSchemaString, JSONValue, type LambdaSendOptions, type LicenseChecker, LicenseContextValue, type LicenseFeatures, type LicenseOwner, type LicensePayload, type LicenseStatus, type LicenseTier, LogicalCondition, LogicalRule, MODEL_HOST_CLASSES, MappedParameterTypes, MaybePromise, Message, MissingPublicApiKeyError, ModelHostClass, NonEmptyRecord, OperationKind, OperationValidation, Parameter, PartialBy, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, ReasoningMessage, RenderUIArgsStream, RequiredBy, ResolvedCopilotKitError, ResolvedDebugConfig, Role, RowKeyStore, Rule, type RunEventFinalizer, RuntimeEntitlementResponse, RuntimeInfo, RuntimeLicenseStatus, RuntimeMode, SamplingMeta, SchemaToJsonSchemaOptions, Severity, SingleRouteRuntimeInfo, StandardJSONSchemaV1, StandardSchemaV1, SystemMessage, TELEMETRY_EMITTER_V1, TELEMETRY_EMITTER_V2, TELEMETRY_SURFACE_V1, TELEMETRY_SURFACE_V2, THREAD_ALREADY_RUNNING_ERROR_CODE, type TelemetryCapture, TelemetryEmitter, type TelemetryIdentity, TelemetrySurface, TelemetryTransport, TextInputPart, ThreadEndpointRuntimeInfo, ToolCall, ToolDefinition, ToolResult, TranscriptionErrorCode, type TranscriptionErrorResponse, TranscriptionErrors, UNSAMPLED_RATE, UpgradeRequiredError, UserMessage, ValidateOperationOptions, VideoInputPart, actionParametersToJsonSchema, applyChildRefMarks, applyDescriptionOverrides, buildA2UICatalogContextValue, buildCompactGenerativeUISchema, buildGenerativeUIMarkdownGuidelines, buildGenerativeUIPrompt, callerProblem, childIdsAtRefs, childRefKind, classifyModelHost, collectChildRefs, commitRowKeyStore, computeSamplingMeta, convertJsonSchemaToZodSchema, copyToClipboard, createAttachmentContent, createLicenseContextValue, createRowKeyStore, createRunEventFinalizer, dataToUUID, defaultGenerativeUIPromptSpec, ensureStructuredError, envelopeToManifest, exceedsMaxSize, executeConditions, extractA2UICatalogSchemas, extractRenderUIArgs, finalizeRunEvents, firstNonBlankTelemetryId, formatFileSize, functionCallers, generateVideoThumbnail, generativeUIFunctionCallMessageId, generativeUIGuideFeatures, generativeUIPromptFeatures, generativeUISurfaceMessageId, getDocumentIcon, getModalityFromMimeType, getOperationKind, getOperationSurfaceId, getPossibleVersionMismatch, getSourceUrl, getZodParameters, hasBoundChildRef, isA2UIBasicFunction, isA2UIValueFunction, isActionBinding, isCallBinding, isIndexCall, isMacOS, isPathBinding, isStructuredCopilotKitError, isTelemetryDisabled, isValidUUID, isValidationResult, jsonSchemaToActionParameters, lambdaClient, logCopilotKitPlatformMessage, logStyled, logger, mapAtChildRef, matchesAcceptFilter, parseAndWarnTelemetryId, parseInspectorLearningRequestV1, parseInspectorLearningSnapshotV1, parseInspectorLearningUrl, parseInspectorMetadataV1, parseJson, parseTelemetryIdFromLicense, partialJSONParse, phoenixExponentialBackoff, pruneRowKeyStore, publicApiKeyRequired, randomId, randomUUID, readBody, readCopilotKitUIEnvelope, readFileAsBase64, renderGenerativeUIComponentList, renderGenerativeUISchema, resolveDebugConfig, resolveRowRenderKeys, resolveRowRenderKeysById, safeParseToolArgs, schemaCoverage, schemaToJsonSchema, selectPromptItems, serializeA2UISchema, shouldEnableInspector, stripIntelligenceRoutingFields, styledConsole, toA2UIActionMessage, tryMap, validateOperation };
84
+ export { A2UIActionMessage, A2UIAllowedCallers, A2UIBasicFunctionInfo, type A2UICatalogSchemaSource, type A2UICommonTypes, A2UIComponentNode, A2UIFunctionCall, A2UIFunctionPermissions, A2UIFunctionReturnType, type A2UIFunctionSchema, type A2UIInlineCatalogSchema, A2UIOperation, A2UIRuntimeInfo, A2UIValidationResult, A2UIValidationSeverity, A2UI_BASIC_CATALOG_ID, A2UI_BASIC_FUNCTIONS, A2UI_CHILD_LIST_MARK, A2UI_CHILD_LIST_REF, A2UI_COMPONENT_ENVELOPE_KEYS, A2UI_COMPONENT_ID_MARK, A2UI_COMPONENT_ID_REF, A2UI_DEFAULT_DESIGN_GUIDELINES, A2UI_DEFAULT_GENERATION_GUIDELINES, A2UI_INDEX_FUNCTION, A2UI_SCHEMA_CONTEXT_DESCRIPTION, A2UI_VERSION, AG_UI_CHANNEL_EVENT, AIMessage, ALL_GENERATIVE_UI_GUIDE_FEATURES, Action, ActivityMessage, AgentDescription, AllowedComponents, AssistantMessage, Attachment, AttachmentModality, AttachmentUploadError, AttachmentUploadErrorReason, AttachmentUploadResult, AttachmentsConfig, AudioInputPart, BANNER_ERROR_NAMES, BaseCondition, COPILOTKIT_FORWARDED_PROPS_KEY, COPILOTKIT_FUNCTIONS, COPILOTKIT_UI_ENVELOPE_FORMAT, COPILOTKIT_VERSION, COPILOT_CLOUD_API_URL, COPILOT_CLOUD_CHAT_URL, COPILOT_CLOUD_ERROR_NAMES, COPILOT_CLOUD_PUBLIC_API_KEY_HEADER, COPILOT_CLOUD_VERSION, ChildRef, ChildRefKind, CoAgentStateRenderHandler, CoAgentStateRenderHandlerArguments, ComparisonCondition, ComparisonRule, Condition, ConfigurationError, ConsoleColors, ConsoleStyles, CopilotCloudConfig, CopilotErrorEvent, CopilotErrorHandler, CopilotKitAgentDiscoveryError, CopilotKitApiDiscoveryError, CopilotKitError, CopilotKitErrorCode, CopilotKitLowLevelError, CopilotKitMisuseError, CopilotKitRemoteEndpointDiscoveryError, type CopilotKitUIEnvelope, CopilotKitVersionMismatchError, CopilotRequestContext, DEFAULT_AGENT_ID, DebugConfig, type DebugEventEnvelope, DeveloperMessage, DocumentInputPart, ERROR_CONFIG, ERROR_NAMES, ErrorVisibility, ExistenceCondition, ExistenceRule, ExtractedRenderUIArgs, type FinalizeRunOptions, FunctionCallHandler, FunctionCallHandlerArguments, FunctionDefinition, GENERATE_SANDBOXED_UI_DESCRIPTION, GENERATIVE_UI_ACTIVITY_TYPE, GENERATIVE_UI_AGENT_FUNCTION_CALLS, GENERATIVE_UI_AGENT_FUNCTION_CALLS_OFF_REASON, GENERATIVE_UI_CHAT_TARGET, GENERATIVE_UI_CONTEXT_DESCRIPTION, GENERATIVE_UI_DEFAULT_ALLOWED_CALLERS, GENERATIVE_UI_FUNCTIONS, GENERATIVE_UI_FUNCTION_CALL_ACTIVITY_TYPE, GENERATIVE_UI_MARKDOWN_GUIDELINES, GENERATIVE_UI_MARKDOWN_GUIDELINES_DESCRIPTION, GENERATIVE_UI_MARKDOWN_SCHEMA_CONTEXT_DESCRIPTION, GENERATIVE_UI_MARKDOWN_WHEN_TO_SHOW, GENERATIVE_UI_MAX_REJECTION_LENGTH, GENERATIVE_UI_MAX_SUMMARY_REJECTIONS, GENERATIVE_UI_MAX_TARGET_COMPONENTS, GENERATIVE_UI_RENDER_TOOL, GENERATIVE_UI_ROOT_ID, GENERATIVE_UI_WHEN_TO_SHOW, GUIDE_COMPONENTS, GenerativeUIActionBinding, GenerativeUIComponentManifest, GenerativeUIFunctionCallContent, GenerativeUIFunctionManifest, type GenerativeUIGuideFeatures, GenerativeUIJSONSchema, GenerativeUIManifest, GenerativeUIPromptFeature, GenerativeUIPromptFeatures, GenerativeUIPromptItem, GenerativeUIPromptSection, GenerativeUIPromptSpec, GenerativeUIRejectedOperation, GenerativeUISchemaSettings, GenerativeUISurfaceContent, GenerativeUISurfaceStatus, GenerativeUISurfaceSummary, GenerativeUITarget, GenerativeUITemplateChildren, GenerativeUIUserEvent, ImageData, ImageInputPart, InferSchemaOutput, InputContent, InputContentDataSource, InputContentSource, InputContentUrlSource, InspectorLearningEvidence, InspectorLearningInsight, InspectorLearningPage, InspectorLearningRequestV1, InspectorLearningSkill, InspectorLearningSnapshotV1, InspectorLearningTrajectoryEvidence, InspectorMetadataV1, InspectorVisibilityOptions, IntelligenceRuntimeInfo, JSONSchema, JSONSchemaArray, JSONSchemaBoolean, JSONSchemaNumber, JSONSchemaObject, JSONSchemaString, JSONValue, type LambdaSendOptions, type LicenseChecker, LicenseContextValue, type LicenseFeatures, type LicenseOwner, type LicensePayload, type LicenseStatus, type LicenseTier, LogicalCondition, LogicalRule, MODEL_HOST_CLASSES, MappedParameterTypes, MaybePromise, Message, MissingPublicApiKeyError, ModelHostClass, NonEmptyRecord, OperationKind, OperationValidation, Parameter, PartialBy, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, ReasoningMessage, RenderUIArgsStream, RequiredBy, ResolvedCopilotKitError, ResolvedDebugConfig, Role, RowKeyStore, Rule, type RunEventFinalizer, RuntimeEntitlementResponse, RuntimeInfo, RuntimeLicenseStatus, RuntimeMode, SamplingMeta, SchemaToJsonSchemaOptions, Severity, SingleRouteRuntimeInfo, StandardJSONSchemaV1, StandardSchemaV1, SystemMessage, TELEMETRY_EMITTER_V1, TELEMETRY_EMITTER_V2, TELEMETRY_SURFACE_V1, TELEMETRY_SURFACE_V2, THREAD_ALREADY_RUNNING_ERROR_CODE, type TelemetryCapture, TelemetryEmitter, type TelemetryIdentity, TelemetrySurface, TelemetryTransport, TextInputPart, ThreadEndpointRuntimeInfo, ToolCall, ToolDefinition, ToolResult, TranscriptionErrorCode, type TranscriptionErrorResponse, TranscriptionErrors, UNSAMPLED_RATE, UpgradeRequiredError, UserMessage, ValidateOperationOptions, VideoInputPart, actionParametersToJsonSchema, applyChildRefMarks, applyDescriptionOverrides, buildA2UICatalogContextValue, buildCompactGenerativeUISchema, buildGenerativeUIMarkdownGuidelines, buildGenerativeUIPrompt, callerProblem, childIdsAtRefs, childRefKind, classifyModelHost, cloneValue, collectChildRefs, commitRowKeyStore, computeSamplingMeta, convertJsonSchemaToZodSchema, copyToClipboard, createAttachmentContent, createLicenseContextValue, createRowKeyStore, createRunEventFinalizer, dataToUUID, defaultGenerativeUIPromptSpec, ensureStructuredError, envelopeToManifest, exceedsMaxSize, executeConditions, extractA2UICatalogSchemas, extractRenderUIArgs, finalizeRunEvents, firstNonBlankTelemetryId, formatFileSize, functionCallers, generateVideoThumbnail, generativeUIFunctionCallMessageId, generativeUIGuideFeatures, generativeUIPromptFeatures, generativeUISurfaceMessageId, getDocumentIcon, getModalityFromMimeType, getOperationKind, getOperationSurfaceId, getPossibleVersionMismatch, getSourceUrl, getZodParameters, hasBoundChildRef, isA2UIBasicFunction, isA2UIValueFunction, isActionBinding, isCallBinding, isIndexCall, isMacOS, isPathBinding, isStructuredCopilotKitError, isTelemetryDisabled, isValidUUID, isValidationResult, jsonSchemaToActionParameters, lambdaClient, logCopilotKitPlatformMessage, logStyled, logger, mapAtChildRef, matchesAcceptFilter, parseAndWarnTelemetryId, parseInspectorLearningRequestV1, parseInspectorLearningSnapshotV1, parseInspectorLearningUrl, parseInspectorMetadataV1, parseJson, parseTelemetryIdFromLicense, partialJSONParse, phoenixExponentialBackoff, pruneRowKeyStore, publicApiKeyRequired, randomId, randomUUID, readBody, readCopilotKitUIEnvelope, readFileAsBase64, renderGenerativeUIComponentList, renderGenerativeUISchema, resolveDebugConfig, resolveRowRenderKeys, resolveRowRenderKeysById, safeParseToolArgs, schemaCoverage, schemaToJsonSchema, selectPromptItems, serializeA2UISchema, shouldEnableInspector, stripIntelligenceRoutingFields, styledConsole, toA2UIActionMessage, tryMap, validateOperation };
84
85
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAmDa,kBAAA;;;;;UA8BI,mBAAA;;EAEf,MAAA,EAAQ,oBAAA;;EAER,OAAA,EAAS,gBAAA;;EAET,YAAA,GAAe,OAAA;;EAEf,QAAA,GAAW,OAAA;AAAA;;;;;;;;;;;;;;;iBAgCG,yBAAA,CACd,MAAA,EAAQ,oBAAA,qBACR,mBAAA,GAAsB,0BAAA,GACrB,mBAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAmDa,kBAAA;;;;;UA8BI,mBAAA;;EAEf,MAAA,EAAQ,oBAAA;;EAER,OAAA,EAAS,gBAAA;;EAET,YAAA,GAAe,OAAA;;EAEf,QAAA,GAAW,OAAA;AAAA;;;;;;;;;;;;;;;iBAgCG,yBAAA,CACd,MAAA,EAAQ,oBAAA,qBACR,mBAAA,GAAsB,0BAAA,GACrB,mBAAA"}
package/dist/index.mjs CHANGED
@@ -35,6 +35,7 @@ import { COPILOTKIT_FORWARDED_PROPS_KEY, COPILOTKIT_UI_ENVELOPE_FORMAT, envelope
35
35
  import { GENERATE_SANDBOXED_UI_DESCRIPTION } from "./open-generative-ui-prompts.mjs";
36
36
  import { callerProblem, getOperationKind, getOperationSurfaceId, isActionBinding, isIndexCall, isPathBinding, validateOperation } from "./generative-ui/validate-operation.mjs";
37
37
  import { RenderUIArgsStream, extractRenderUIArgs } from "./generative-ui/render-ui-args.mjs";
38
+ import { cloneValue } from "./generative-ui/clone-value.mjs";
38
39
  import { buildCompactGenerativeUISchema } from "./generative-ui/compact-schema.mjs";
39
40
  import { applyDescriptionOverrides, renderGenerativeUIComponentList, renderGenerativeUISchema, schemaCoverage } from "./generative-ui/schema-render.mjs";
40
41
  import { GENERATIVE_UI_CONTEXT_DESCRIPTION, buildGenerativeUIPrompt } from "./generative-ui/prompt.mjs";
@@ -79,5 +80,5 @@ function createLicenseContextValue(status, runtimeEntitlements) {
79
80
  }
80
81
 
81
82
  //#endregion
82
- export { A2UI_BASIC_CATALOG_ID, A2UI_BASIC_FUNCTIONS, A2UI_CHILD_LIST_MARK, A2UI_CHILD_LIST_REF, A2UI_COMPONENT_ENVELOPE_KEYS, A2UI_COMPONENT_ID_MARK, A2UI_COMPONENT_ID_REF, A2UI_DEFAULT_DESIGN_GUIDELINES, A2UI_DEFAULT_GENERATION_GUIDELINES, A2UI_INDEX_FUNCTION, A2UI_SCHEMA_CONTEXT_DESCRIPTION, A2UI_VERSION, AG_UI_CHANNEL_EVENT, ALL_GENERATIVE_UI_GUIDE_FEATURES, BANNER_ERROR_NAMES, COPILOTKIT_FORWARDED_PROPS_KEY, COPILOTKIT_FUNCTIONS, COPILOTKIT_UI_ENVELOPE_FORMAT, COPILOTKIT_VERSION, COPILOT_CLOUD_API_URL, COPILOT_CLOUD_CHAT_URL, COPILOT_CLOUD_ERROR_NAMES, COPILOT_CLOUD_PUBLIC_API_KEY_HEADER, COPILOT_CLOUD_VERSION, ConfigurationError, ConsoleColors, ConsoleStyles, CopilotKitAgentDiscoveryError, CopilotKitApiDiscoveryError, CopilotKitError, CopilotKitErrorCode, CopilotKitLowLevelError, CopilotKitMisuseError, CopilotKitRemoteEndpointDiscoveryError, CopilotKitVersionMismatchError, DEFAULT_AGENT_ID, ERROR_CONFIG, ERROR_NAMES, ErrorVisibility, GENERATE_SANDBOXED_UI_DESCRIPTION, GENERATIVE_UI_ACTIVITY_TYPE, GENERATIVE_UI_AGENT_FUNCTION_CALLS, GENERATIVE_UI_AGENT_FUNCTION_CALLS_OFF_REASON, GENERATIVE_UI_CHAT_TARGET, GENERATIVE_UI_CONTEXT_DESCRIPTION, GENERATIVE_UI_DEFAULT_ALLOWED_CALLERS, GENERATIVE_UI_FUNCTIONS, GENERATIVE_UI_FUNCTION_CALL_ACTIVITY_TYPE, GENERATIVE_UI_MARKDOWN_GUIDELINES, GENERATIVE_UI_MARKDOWN_GUIDELINES_DESCRIPTION, GENERATIVE_UI_MARKDOWN_SCHEMA_CONTEXT_DESCRIPTION, GENERATIVE_UI_MARKDOWN_WHEN_TO_SHOW, GENERATIVE_UI_MAX_REJECTION_LENGTH, GENERATIVE_UI_MAX_SUMMARY_REJECTIONS, GENERATIVE_UI_MAX_TARGET_COMPONENTS, GENERATIVE_UI_RENDER_TOOL, GENERATIVE_UI_ROOT_ID, GENERATIVE_UI_WHEN_TO_SHOW, GUIDE_COMPONENTS, MODEL_HOST_CLASSES, MissingPublicApiKeyError, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, RenderUIArgsStream, ResolvedCopilotKitError, Severity, TELEMETRY_EMITTER_V1, TELEMETRY_EMITTER_V2, TELEMETRY_SURFACE_V1, TELEMETRY_SURFACE_V2, THREAD_ALREADY_RUNNING_ERROR_CODE, TranscriptionErrorCode, TranscriptionErrors, UNSAMPLED_RATE, UpgradeRequiredError, actionParametersToJsonSchema, applyChildRefMarks, applyDescriptionOverrides, buildA2UICatalogContextValue, buildCompactGenerativeUISchema, buildGenerativeUIMarkdownGuidelines, buildGenerativeUIPrompt, callerProblem, childIdsAtRefs, childRefKind, classifyModelHost, collectChildRefs, commitRowKeyStore, computeSamplingMeta, convertJsonSchemaToZodSchema, copyToClipboard, createAttachmentContent, createLicenseContextValue, createRowKeyStore, createRunEventFinalizer, dataToUUID, defaultGenerativeUIPromptSpec, ensureStructuredError, envelopeToManifest, exceedsMaxSize, executeConditions, extractA2UICatalogSchemas, extractRenderUIArgs, finalizeRunEvents, firstNonBlankTelemetryId, formatFileSize, functionCallers, generateVideoThumbnail, generativeUIFunctionCallMessageId, generativeUIGuideFeatures, generativeUIPromptFeatures, generativeUISurfaceMessageId, getDocumentIcon, getModalityFromMimeType, getOperationKind, getOperationSurfaceId, getPossibleVersionMismatch, getSourceUrl, getZodParameters, hasBoundChildRef, isA2UIBasicFunction, isA2UIValueFunction, isActionBinding, isCallBinding, isIndexCall, isMacOS, isPathBinding, isStructuredCopilotKitError, isTelemetryDisabled, isValidUUID, isValidationResult, jsonSchemaToActionParameters, lambdaClient, logCopilotKitPlatformMessage, logStyled, logger, mapAtChildRef, matchesAcceptFilter, parseAndWarnTelemetryId, parseInspectorLearningRequestV1, parseInspectorLearningSnapshotV1, parseInspectorLearningUrl, parseInspectorMetadataV1, parseJson, parseTelemetryIdFromLicense, partialJSONParse, phoenixExponentialBackoff, pruneRowKeyStore, publicApiKeyRequired, randomId, randomUUID, readBody, readCopilotKitUIEnvelope, readFileAsBase64, renderGenerativeUIComponentList, renderGenerativeUISchema, resolveDebugConfig, resolveRowRenderKeys, resolveRowRenderKeysById, safeParseToolArgs, schemaCoverage, schemaToJsonSchema, selectPromptItems, serializeA2UISchema, shouldEnableInspector, stripIntelligenceRoutingFields, styledConsole, toA2UIActionMessage, tryMap, validateOperation };
83
+ export { A2UI_BASIC_CATALOG_ID, A2UI_BASIC_FUNCTIONS, A2UI_CHILD_LIST_MARK, A2UI_CHILD_LIST_REF, A2UI_COMPONENT_ENVELOPE_KEYS, A2UI_COMPONENT_ID_MARK, A2UI_COMPONENT_ID_REF, A2UI_DEFAULT_DESIGN_GUIDELINES, A2UI_DEFAULT_GENERATION_GUIDELINES, A2UI_INDEX_FUNCTION, A2UI_SCHEMA_CONTEXT_DESCRIPTION, A2UI_VERSION, AG_UI_CHANNEL_EVENT, ALL_GENERATIVE_UI_GUIDE_FEATURES, BANNER_ERROR_NAMES, COPILOTKIT_FORWARDED_PROPS_KEY, COPILOTKIT_FUNCTIONS, COPILOTKIT_UI_ENVELOPE_FORMAT, COPILOTKIT_VERSION, COPILOT_CLOUD_API_URL, COPILOT_CLOUD_CHAT_URL, COPILOT_CLOUD_ERROR_NAMES, COPILOT_CLOUD_PUBLIC_API_KEY_HEADER, COPILOT_CLOUD_VERSION, ConfigurationError, ConsoleColors, ConsoleStyles, CopilotKitAgentDiscoveryError, CopilotKitApiDiscoveryError, CopilotKitError, CopilotKitErrorCode, CopilotKitLowLevelError, CopilotKitMisuseError, CopilotKitRemoteEndpointDiscoveryError, CopilotKitVersionMismatchError, DEFAULT_AGENT_ID, ERROR_CONFIG, ERROR_NAMES, ErrorVisibility, GENERATE_SANDBOXED_UI_DESCRIPTION, GENERATIVE_UI_ACTIVITY_TYPE, GENERATIVE_UI_AGENT_FUNCTION_CALLS, GENERATIVE_UI_AGENT_FUNCTION_CALLS_OFF_REASON, GENERATIVE_UI_CHAT_TARGET, GENERATIVE_UI_CONTEXT_DESCRIPTION, GENERATIVE_UI_DEFAULT_ALLOWED_CALLERS, GENERATIVE_UI_FUNCTIONS, GENERATIVE_UI_FUNCTION_CALL_ACTIVITY_TYPE, GENERATIVE_UI_MARKDOWN_GUIDELINES, GENERATIVE_UI_MARKDOWN_GUIDELINES_DESCRIPTION, GENERATIVE_UI_MARKDOWN_SCHEMA_CONTEXT_DESCRIPTION, GENERATIVE_UI_MARKDOWN_WHEN_TO_SHOW, GENERATIVE_UI_MAX_REJECTION_LENGTH, GENERATIVE_UI_MAX_SUMMARY_REJECTIONS, GENERATIVE_UI_MAX_TARGET_COMPONENTS, GENERATIVE_UI_RENDER_TOOL, GENERATIVE_UI_ROOT_ID, GENERATIVE_UI_WHEN_TO_SHOW, GUIDE_COMPONENTS, MODEL_HOST_CLASSES, MissingPublicApiKeyError, RUNTIME_MODE_INTELLIGENCE, RUNTIME_MODE_SSE, RenderUIArgsStream, ResolvedCopilotKitError, Severity, TELEMETRY_EMITTER_V1, TELEMETRY_EMITTER_V2, TELEMETRY_SURFACE_V1, TELEMETRY_SURFACE_V2, THREAD_ALREADY_RUNNING_ERROR_CODE, TranscriptionErrorCode, TranscriptionErrors, UNSAMPLED_RATE, UpgradeRequiredError, actionParametersToJsonSchema, applyChildRefMarks, applyDescriptionOverrides, buildA2UICatalogContextValue, buildCompactGenerativeUISchema, buildGenerativeUIMarkdownGuidelines, buildGenerativeUIPrompt, callerProblem, childIdsAtRefs, childRefKind, classifyModelHost, cloneValue, collectChildRefs, commitRowKeyStore, computeSamplingMeta, convertJsonSchemaToZodSchema, copyToClipboard, createAttachmentContent, createLicenseContextValue, createRowKeyStore, createRunEventFinalizer, dataToUUID, defaultGenerativeUIPromptSpec, ensureStructuredError, envelopeToManifest, exceedsMaxSize, executeConditions, extractA2UICatalogSchemas, extractRenderUIArgs, finalizeRunEvents, firstNonBlankTelemetryId, formatFileSize, functionCallers, generateVideoThumbnail, generativeUIFunctionCallMessageId, generativeUIGuideFeatures, generativeUIPromptFeatures, generativeUISurfaceMessageId, getDocumentIcon, getModalityFromMimeType, getOperationKind, getOperationSurfaceId, getPossibleVersionMismatch, getSourceUrl, getZodParameters, hasBoundChildRef, isA2UIBasicFunction, isA2UIValueFunction, isActionBinding, isCallBinding, isIndexCall, isMacOS, isPathBinding, isStructuredCopilotKitError, isTelemetryDisabled, isValidUUID, isValidationResult, jsonSchemaToActionParameters, lambdaClient, logCopilotKitPlatformMessage, logStyled, logger, mapAtChildRef, matchesAcceptFilter, parseAndWarnTelemetryId, parseInspectorLearningRequestV1, parseInspectorLearningSnapshotV1, parseInspectorLearningUrl, parseInspectorMetadataV1, parseJson, parseTelemetryIdFromLicense, partialJSONParse, phoenixExponentialBackoff, pruneRowKeyStore, publicApiKeyRequired, randomId, randomUUID, readBody, readCopilotKitUIEnvelope, readFileAsBase64, renderGenerativeUIComponentList, renderGenerativeUISchema, resolveDebugConfig, resolveRowRenderKeys, resolveRowRenderKeysById, safeParseToolArgs, schemaCoverage, schemaToJsonSchema, selectPromptItems, serializeA2UISchema, shouldEnableInspector, stripIntelligenceRoutingFields, styledConsole, toA2UIActionMessage, tryMap, validateOperation };
83
84
  //# sourceMappingURL=index.mjs.map