@copilotkit/shared 2.0.0-rc.37 → 2.0.0-rc.39

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 (102) hide show
  1. package/dist/generative-ui/clone-value.cjs +364 -0
  2. package/dist/generative-ui/clone-value.cjs.map +1 -0
  3. package/dist/generative-ui/clone-value.d.cts +51 -0
  4. package/dist/generative-ui/clone-value.d.cts.map +1 -0
  5. package/dist/generative-ui/clone-value.d.mts +51 -0
  6. package/dist/generative-ui/clone-value.d.mts.map +1 -0
  7. package/dist/generative-ui/clone-value.mjs +363 -0
  8. package/dist/generative-ui/clone-value.mjs.map +1 -0
  9. package/dist/generative-ui/index.cjs +39 -0
  10. package/dist/generative-ui/index.d.cts +8 -2
  11. package/dist/generative-ui/index.d.mts +8 -2
  12. package/dist/generative-ui/index.mjs +8 -2
  13. package/dist/generative-ui/is-record.d.cts +3 -1
  14. package/dist/generative-ui/is-record.d.cts.map +1 -1
  15. package/dist/generative-ui/is-record.d.mts +3 -1
  16. package/dist/generative-ui/is-record.d.mts.map +1 -1
  17. package/dist/generative-ui/schema-render.cjs +2 -1
  18. package/dist/generative-ui/schema-render.cjs.map +1 -1
  19. package/dist/generative-ui/schema-render.d.cts.map +1 -1
  20. package/dist/generative-ui/schema-render.d.mts.map +1 -1
  21. package/dist/generative-ui/schema-render.mjs +2 -1
  22. package/dist/generative-ui/schema-render.mjs.map +1 -1
  23. package/dist/generative-ui/standard/chart-config.cjs +347 -0
  24. package/dist/generative-ui/standard/chart-config.cjs.map +1 -0
  25. package/dist/generative-ui/standard/chart-config.d.cts +97 -0
  26. package/dist/generative-ui/standard/chart-config.d.cts.map +1 -0
  27. package/dist/generative-ui/standard/chart-config.d.mts +97 -0
  28. package/dist/generative-ui/standard/chart-config.d.mts.map +1 -0
  29. package/dist/generative-ui/standard/chart-config.mjs +342 -0
  30. package/dist/generative-ui/standard/chart-config.mjs.map +1 -0
  31. package/dist/generative-ui/standard/composites.d.cts +2 -2
  32. package/dist/generative-ui/standard/composites.d.mts +2 -2
  33. package/dist/generative-ui/standard/declarations.d.cts +68 -68
  34. package/dist/generative-ui/standard/declarations.d.mts +68 -68
  35. package/dist/generative-ui/standard/index.d.mts +5 -1
  36. package/dist/generative-ui/standard/inputs.d.cts +22 -22
  37. package/dist/generative-ui/standard/inputs.d.mts +22 -22
  38. package/dist/generative-ui/standard/layout.d.cts +90 -90
  39. package/dist/generative-ui/standard/layout.d.mts +90 -90
  40. package/dist/generative-ui/standard/map-helpers.cjs +104 -0
  41. package/dist/generative-ui/standard/map-helpers.cjs.map +1 -0
  42. package/dist/generative-ui/standard/map-helpers.d.cts +88 -0
  43. package/dist/generative-ui/standard/map-helpers.d.cts.map +1 -0
  44. package/dist/generative-ui/standard/map-helpers.d.mts +88 -0
  45. package/dist/generative-ui/standard/map-helpers.d.mts.map +1 -0
  46. package/dist/generative-ui/standard/map-helpers.mjs +95 -0
  47. package/dist/generative-ui/standard/map-helpers.mjs.map +1 -0
  48. package/dist/generative-ui/standard/media.d.cts +6 -6
  49. package/dist/generative-ui/standard/media.d.mts +6 -6
  50. package/dist/generative-ui/standard/style-helpers.cjs +151 -0
  51. package/dist/generative-ui/standard/style-helpers.cjs.map +1 -0
  52. package/dist/generative-ui/standard/style-helpers.d.cts +56 -0
  53. package/dist/generative-ui/standard/style-helpers.d.cts.map +1 -0
  54. package/dist/generative-ui/standard/style-helpers.d.mts +56 -0
  55. package/dist/generative-ui/standard/style-helpers.d.mts.map +1 -0
  56. package/dist/generative-ui/standard/style-helpers.mjs +142 -0
  57. package/dist/generative-ui/standard/style-helpers.mjs.map +1 -0
  58. package/dist/generative-ui/standard/text.d.cts +14 -14
  59. package/dist/generative-ui/standard/text.d.mts +14 -14
  60. package/dist/generative-ui/standard/url.cjs +54 -0
  61. package/dist/generative-ui/standard/url.cjs.map +1 -0
  62. package/dist/generative-ui/standard/url.d.cts +32 -0
  63. package/dist/generative-ui/standard/url.d.cts.map +1 -0
  64. package/dist/generative-ui/standard/url.d.mts +32 -0
  65. package/dist/generative-ui/standard/url.d.mts.map +1 -0
  66. package/dist/generative-ui/standard/url.mjs +50 -0
  67. package/dist/generative-ui/standard/url.mjs.map +1 -0
  68. package/dist/generative-ui/thrown.cjs +69 -0
  69. package/dist/generative-ui/thrown.cjs.map +1 -0
  70. package/dist/generative-ui/thrown.d.cts +21 -0
  71. package/dist/generative-ui/thrown.d.cts.map +1 -0
  72. package/dist/generative-ui/thrown.d.mts +21 -0
  73. package/dist/generative-ui/thrown.d.mts.map +1 -0
  74. package/dist/generative-ui/thrown.mjs +67 -0
  75. package/dist/generative-ui/thrown.mjs.map +1 -0
  76. package/dist/index.cjs +2 -0
  77. package/dist/index.cjs.map +1 -1
  78. package/dist/index.d.cts +2 -1
  79. package/dist/index.d.cts.map +1 -1
  80. package/dist/index.d.mts +2 -1
  81. package/dist/index.d.mts.map +1 -1
  82. package/dist/index.mjs +2 -1
  83. package/dist/index.mjs.map +1 -1
  84. package/dist/index.umd.js +368 -2
  85. package/dist/index.umd.js.map +1 -1
  86. package/dist/package.cjs +1 -1
  87. package/dist/package.mjs +1 -1
  88. package/package.json +1 -1
  89. package/src/__tests__/schema-render.test.ts +78 -0
  90. package/src/generative-ui/__tests__/clone-value-differential.test.ts +480 -0
  91. package/src/generative-ui/__tests__/clone-value.test.ts +226 -0
  92. package/src/generative-ui/clone-value.ts +511 -0
  93. package/src/generative-ui/index.ts +6 -2
  94. package/src/generative-ui/schema-render.ts +2 -1
  95. package/src/generative-ui/standard/__tests__/standard-helpers.test.ts +407 -0
  96. package/src/generative-ui/standard/chart-config.ts +434 -0
  97. package/src/generative-ui/standard/index.ts +36 -0
  98. package/src/generative-ui/standard/map-helpers.ts +155 -0
  99. package/src/generative-ui/standard/style-helpers.ts +170 -0
  100. package/src/generative-ui/standard/url.ts +51 -0
  101. package/src/generative-ui/thrown.ts +90 -0
  102. package/src/index.ts +5 -0
@@ -0,0 +1,363 @@
1
+ //#region src/generative-ui/clone-value.ts
2
+ /**
3
+ * A deep copy of `value` with `structuredClone` semantics. Uses the global
4
+ * `structuredClone` when there is one. Hermes (React Native) has none, so
5
+ * there a local copy runs. It decides the kind of an object by the same
6
+ * internal slots that `structuredClone` reads (brand checks), not by
7
+ * `instanceof` or `Symbol.toStringTag`, and gives what the native
8
+ * `structuredClone` of V8 gives:
9
+ *
10
+ * - `undefined`, `null`, strings, booleans, numbers (also `NaN`,
11
+ * `Infinity` and `-0`) and bigints are returned as they are.
12
+ * - Arrays and ordinary objects are copied deeply: own enumerable string
13
+ * keys only, so a class instance, or an object with its own
14
+ * `Symbol.toStringTag`, becomes a plain object. A sparse array keeps its
15
+ * holes and its length.
16
+ * - `Date`, `RegExp`, `Map`, `Set`, boxed primitives, `ArrayBuffer`s (a
17
+ * resizable one stays resizable), typed arrays (as the base type, never a
18
+ * subclass), `DataView`s, `Blob`s and `File`s are copied.
19
+ * - An `Error` becomes an `Error` of its standard type (a custom name or
20
+ * `AggregateError` becomes `Error`), with its own `message`, its `stack`
21
+ * and its own `cause`. A `DOMException` stays one where the global exists.
22
+ * - A `SharedArrayBuffer` is shared, not copied, like `structuredClone`.
23
+ * - Cycles and shared references are kept: an object reached twice is
24
+ * copied once.
25
+ * - Functions, symbols, `Symbol` wrappers, `arguments`, `WeakMap`,
26
+ * `WeakSet`, `WeakRef`, `Promise`, iterators, generators and the web
27
+ * platform objects that cannot be cloned (`URL`, `Headers`, streams...)
28
+ * throw an error named `"DataCloneError"`: a `DOMException` where the
29
+ * global exists, else an `Error` (Hermes has no `DOMException`).
30
+ *
31
+ * Two differences are left. A `Proxy` cannot be told from its target in
32
+ * JavaScript, so the local copy reads it through its traps, where the
33
+ * native one throws. And an ordinary object takes a fast path that runs no
34
+ * brand check (each failed one throws and catches an exception, slow on
35
+ * Hermes), so a `Map`, `Set`, `Promise` or other object whose prototype
36
+ * was changed to `Object.prototype` or `null` is copied as a plain object.
37
+ *
38
+ * It never installs a global `structuredClone`, and it does not use the
39
+ * JSON round trip of `structuredClone_` from `@ag-ui/client`, which turns
40
+ * `undefined` into `{}` and drops or changes values JSON cannot hold.
41
+ *
42
+ * @param value - The value to copy.
43
+ * @returns A copy that shares no object with `value`, except a
44
+ * `SharedArrayBuffer`.
45
+ * @throws An error named `"DataCloneError"` for a value that cannot be
46
+ * cloned.
47
+ */
48
+ function cloneValue(value) {
49
+ const native = globalThis.structuredClone;
50
+ if (typeof native === "function") return native(value);
51
+ return cloneInto(value, /* @__PURE__ */ new Map());
52
+ }
53
+ /** A global, or `undefined` when this engine does not have it. */
54
+ function globalNamed(name) {
55
+ return globalThis[name];
56
+ }
57
+ /** True when `method` accepts `value` as its `this`: a brand check. */
58
+ function hasBrand(value, method, ...args) {
59
+ if (typeof method !== "function") return false;
60
+ try {
61
+ method.call(value, ...args);
62
+ return true;
63
+ } catch {
64
+ return false;
65
+ }
66
+ }
67
+ /** The getter of `key` on `proto`, for a brand check. */
68
+ function getterOf(proto, key) {
69
+ if (!proto) return void 0;
70
+ return Object.getOwnPropertyDescriptor(proto, key)?.get;
71
+ }
72
+ function protoOf(name) {
73
+ return (globalNamed(name) ?? {}).prototype;
74
+ }
75
+ function methodOf(name, key) {
76
+ return protoOf(name)?.[key];
77
+ }
78
+ const ERROR_NAMES = new Set([
79
+ "Error",
80
+ "EvalError",
81
+ "RangeError",
82
+ "ReferenceError",
83
+ "SyntaxError",
84
+ "TypeError",
85
+ "URIError"
86
+ ]);
87
+ /** Web platform objects that `structuredClone` refuses, where they exist. */
88
+ const PLATFORM_UNCLONEABLE = [
89
+ "URL",
90
+ "URLSearchParams",
91
+ "Headers",
92
+ "Request",
93
+ "Response",
94
+ "FormData",
95
+ "ReadableStream",
96
+ "WritableStream",
97
+ "TransformStream",
98
+ "MessagePort"
99
+ ];
100
+ function* emptyGenerator() {}
101
+ /** The prototypes of the built-in iterators and generators. */
102
+ function iteratorPrototypes() {
103
+ const protos = [];
104
+ const add = (iterator) => {
105
+ const proto = iterator && Object.getPrototypeOf(iterator);
106
+ if (proto) protos.push(proto);
107
+ };
108
+ add([][Symbol.iterator]());
109
+ add((/* @__PURE__ */ new Map())[Symbol.iterator]());
110
+ add((/* @__PURE__ */ new Set())[Symbol.iterator]());
111
+ add(""[Symbol.iterator]());
112
+ protos.push(Object.getPrototypeOf(emptyGenerator.prototype));
113
+ const matchAllKey = Symbol.matchAll;
114
+ const matchAll = matchAllKey ? RegExp.prototype[matchAllKey] : void 0;
115
+ if (typeof matchAll === "function") add(matchAll.call(/a/g, ""));
116
+ return protos;
117
+ }
118
+ let iteratorProtos;
119
+ function inheritsFrom(value, protos) {
120
+ for (let proto = Object.getPrototypeOf(value); proto !== null; proto = Object.getPrototypeOf(proto)) if (protos.includes(proto)) return true;
121
+ return false;
122
+ }
123
+ function dataCloneError(what) {
124
+ const message = `${what} could not be cloned.`;
125
+ const DOMExceptionClass = globalNamed("DOMException");
126
+ if (typeof DOMExceptionClass === "function") return new DOMExceptionClass(message, "DataCloneError");
127
+ const error = new Error(message);
128
+ error.name = "DataCloneError";
129
+ return error;
130
+ }
131
+ function describe(value) {
132
+ if (typeof value === "function") return value.name ? `function ${value.name}` : "A function";
133
+ if (typeof value === "symbol") return String(value);
134
+ return Object.prototype.toString.call(value);
135
+ }
136
+ /** True for an object with the [[ErrorData]] slot. */
137
+ function isError(value) {
138
+ const isErrorCheck = Error.isError;
139
+ if (typeof isErrorCheck === "function") return isErrorCheck.call(Error, value) === true;
140
+ if (!(Symbol.toStringTag in value)) return Object.prototype.toString.call(value) === "[object Error]";
141
+ return value instanceof Error;
142
+ }
143
+ function isDOMException(value) {
144
+ return hasBrand(value, getterOf(protoOf("DOMException"), "code"));
145
+ }
146
+ /** The name of the base typed-array type of a view, or `undefined`. */
147
+ function typedArrayName(value) {
148
+ const getter = getterOf(Object.getPrototypeOf(Uint8Array.prototype), Symbol.toStringTag);
149
+ if (!getter) return void 0;
150
+ const name = getter.call(value);
151
+ return typeof name === "string" ? name : void 0;
152
+ }
153
+ function cloneArrayBuffer(value) {
154
+ const source = value;
155
+ if (source.resizable === true) {
156
+ const copy = new ArrayBuffer(source.byteLength, { maxByteLength: source.maxByteLength });
157
+ new Uint8Array(copy).set(new Uint8Array(source));
158
+ return copy;
159
+ }
160
+ return ArrayBuffer.prototype.slice.call(value, 0);
161
+ }
162
+ function cloneError(value, seen) {
163
+ let copy;
164
+ const own = (key) => Object.prototype.hasOwnProperty.call(value, key);
165
+ const messageDescriptor = Object.getOwnPropertyDescriptor(value, "message");
166
+ const message = messageDescriptor && "value" in messageDescriptor ? `${messageDescriptor.value}` : void 0;
167
+ if (isDOMException(value)) copy = new (globalNamed("DOMException"))(value.message, value.name);
168
+ else {
169
+ const ErrorClass = globalNamed(ERROR_NAMES.has(value.name) ? value.name : "Error") ?? Error;
170
+ copy = message === void 0 ? new ErrorClass() : new ErrorClass(message);
171
+ }
172
+ seen.set(value, copy);
173
+ if (typeof value.stack === "string") copy.stack = value.stack;
174
+ if (!isDOMException(value)) {
175
+ const causeDescriptor = Object.getOwnPropertyDescriptor(value, "cause");
176
+ if (own("cause") && causeDescriptor && "value" in causeDescriptor) Object.defineProperty(copy, "cause", {
177
+ value: cloneInto(causeDescriptor.value, seen),
178
+ writable: true,
179
+ enumerable: false,
180
+ configurable: true
181
+ });
182
+ }
183
+ return copy;
184
+ }
185
+ function cloneInto(value, seen) {
186
+ if (typeof value === "function" || typeof value === "symbol") throw dataCloneError(describe(value));
187
+ if (typeof value !== "object" || value === null) return value;
188
+ const known = seen.get(value);
189
+ if (known !== void 0) return known;
190
+ if (Array.isArray(value)) {
191
+ const copy = [];
192
+ copy.length = value.length;
193
+ seen.set(value, copy);
194
+ copyKeys(value, copy, seen);
195
+ return copy;
196
+ }
197
+ if (isPlainObject(value)) {
198
+ const copy = {};
199
+ seen.set(value, copy);
200
+ copyKeys(value, copy, seen);
201
+ return copy;
202
+ }
203
+ if (hasBrand(value, Date.prototype.getTime)) {
204
+ const copy = new Date(Date.prototype.getTime.call(value));
205
+ seen.set(value, copy);
206
+ return copy;
207
+ }
208
+ if (hasBrand(value, getterOf(RegExp.prototype, "source"))) {
209
+ const source = getterOf(RegExp.prototype, "source").call(value);
210
+ const flags = getterOf(RegExp.prototype, "flags").call(value);
211
+ const copy = new RegExp(source, flags);
212
+ seen.set(value, copy);
213
+ return copy;
214
+ }
215
+ if (hasBrand(value, Map.prototype.has, void 0)) {
216
+ const copy = /* @__PURE__ */ new Map();
217
+ seen.set(value, copy);
218
+ const entries = [];
219
+ Map.prototype.forEach.call(value, (entry, key) => {
220
+ entries.push([key, entry]);
221
+ });
222
+ for (const [key, entry] of entries) copy.set(cloneInto(key, seen), cloneInto(entry, seen));
223
+ return copy;
224
+ }
225
+ if (hasBrand(value, Set.prototype.has, void 0)) {
226
+ const copy = /* @__PURE__ */ new Set();
227
+ seen.set(value, copy);
228
+ const entries = [];
229
+ Set.prototype.forEach.call(value, (entry) => {
230
+ entries.push(entry);
231
+ });
232
+ for (const entry of entries) copy.add(cloneInto(entry, seen));
233
+ return copy;
234
+ }
235
+ if (hasBrand(value, getterOf(ArrayBuffer.prototype, "byteLength"))) {
236
+ const copy = cloneArrayBuffer(value);
237
+ seen.set(value, copy);
238
+ return copy;
239
+ }
240
+ if (hasBrand(value, getterOf(protoOf("SharedArrayBuffer"), "byteLength"))) {
241
+ seen.set(value, value);
242
+ return value;
243
+ }
244
+ if (ArrayBuffer.isView(value)) {
245
+ const view = value;
246
+ const buffer = cloneInto(view.buffer, seen);
247
+ const isDataView = hasBrand(value, getterOf(DataView.prototype, "byteLength"));
248
+ let copy;
249
+ if (isDataView) copy = new DataView(buffer, view.byteOffset, view.byteLength);
250
+ else {
251
+ const name = typedArrayName(value);
252
+ const TypedArray = name ? globalNamed(name) : void 0;
253
+ if (!TypedArray) throw dataCloneError(describe(value));
254
+ const proto = Object.getPrototypeOf(Uint8Array.prototype);
255
+ copy = new TypedArray(buffer, getterOf(proto, "byteOffset").call(value), getterOf(proto, "length").call(value));
256
+ }
257
+ seen.set(value, copy);
258
+ return copy;
259
+ }
260
+ if (isError(value)) return cloneError(value, seen);
261
+ for (const [name, Boxed] of [
262
+ ["Boolean", Boolean],
263
+ ["Number", Number],
264
+ ["String", String],
265
+ ["BigInt", globalNamed("BigInt")]
266
+ ]) {
267
+ const valueOf = methodOf(name, "valueOf");
268
+ if (Boxed && hasBrand(value, valueOf)) {
269
+ const copy = Object(valueOf.call(value));
270
+ seen.set(value, copy);
271
+ return copy;
272
+ }
273
+ }
274
+ if (hasBrand(value, methodOf("Symbol", "valueOf"))) throw dataCloneError(describe(value));
275
+ const BlobClass = globalNamed("Blob");
276
+ if (typeof BlobClass === "function" && value instanceof BlobClass) {
277
+ const copy = cloneBlob(value);
278
+ seen.set(value, copy);
279
+ return copy;
280
+ }
281
+ if (isUncloneable(value)) throw dataCloneError(describe(value));
282
+ const copy = {};
283
+ seen.set(value, copy);
284
+ copyKeys(value, copy, seen);
285
+ return copy;
286
+ }
287
+ function cloneBlob(value) {
288
+ const FileClass = globalNamed("File");
289
+ if (typeof FileClass === "function" && value instanceof FileClass) {
290
+ const file = value;
291
+ return new FileClass([value], file.name, {
292
+ type: value.type,
293
+ lastModified: file.lastModified
294
+ });
295
+ }
296
+ return new (globalNamed("Blob"))([value], { type: value.type });
297
+ }
298
+ /**
299
+ * True for an ordinary object of this realm: its prototype is
300
+ * `Object.prototype` or `null`, it has no `Symbol.toStringTag`, and its
301
+ * built-in tag is "Object" (so not `arguments`, an `Error`, a `Date`, a
302
+ * `RegExp` or a boxed primitive, whatever their prototype). Throws nothing.
303
+ * An object with another slot (a `Map`, a `Set`, a `Promise`...) whose
304
+ * prototype was changed to one of those passes too; only a brand check,
305
+ * which throws, could tell, so it is copied as a plain object.
306
+ */
307
+ function isPlainObject(value) {
308
+ const proto = Object.getPrototypeOf(value);
309
+ if (proto !== Object.prototype && proto !== null) return false;
310
+ if (Symbol.toStringTag in value) return false;
311
+ if (ArrayBuffer.isView(value)) return false;
312
+ return Object.prototype.toString.call(value) === "[object Object]";
313
+ }
314
+ /** The globals of PLATFORM_UNCLONEABLE and their prototypes, when last read. */
315
+ let platformCache;
316
+ /**
317
+ * The prototypes of the PLATFORM_UNCLONEABLE globals that exist. Kept
318
+ * between calls, and built again only when one of the globals changed (a
319
+ * polyfill installed late).
320
+ */
321
+ function platformPrototypes() {
322
+ const globals = globalThis;
323
+ const cached = platformCache;
324
+ if (cached && PLATFORM_UNCLONEABLE.every((name, index) => globals[name] === cached.classes[index])) return cached.protos;
325
+ const classes = PLATFORM_UNCLONEABLE.map((name) => globals[name]);
326
+ const protos = PLATFORM_UNCLONEABLE.map(protoOf).filter((proto) => proto !== void 0);
327
+ platformCache = {
328
+ classes,
329
+ protos
330
+ };
331
+ return protos;
332
+ }
333
+ /** An object that structuredClone refuses, though it has no data slot. */
334
+ function isUncloneable(value) {
335
+ if (!(Symbol.toStringTag in value) && Object.prototype.toString.call(value) === "[object Arguments]") return true;
336
+ if (hasBrand(value, methodOf("WeakMap", "has"), {}) || hasBrand(value, methodOf("WeakSet", "has"), {}) || hasBrand(value, methodOf("WeakRef", "deref")) || hasBrand(value, methodOf("FinalizationRegistry", "unregister"), {})) return true;
337
+ const PromiseClass = globalNamed("Promise");
338
+ if (PromiseClass && value instanceof PromiseClass) return true;
339
+ if (!iteratorProtos) iteratorProtos = iteratorPrototypes();
340
+ if (inheritsFrom(value, iteratorProtos)) return true;
341
+ return inheritsFrom(value, platformPrototypes());
342
+ }
343
+ /** Copies the own enumerable string keys, as structuredClone does. */
344
+ function copyKeys(source, target, seen) {
345
+ for (const key of Object.keys(source)) assign(target, key, cloneInto(source[key], seen));
346
+ }
347
+ /**
348
+ * Sets an own property. A plain assignment of "__proto__" would change the
349
+ * prototype of the copy instead (JSON.parse makes "__proto__" an own key).
350
+ */
351
+ function assign(target, key, value) {
352
+ if (key === "__proto__") Object.defineProperty(target, key, {
353
+ value,
354
+ enumerable: true,
355
+ configurable: true,
356
+ writable: true
357
+ });
358
+ else target[key] = value;
359
+ }
360
+
361
+ //#endregion
362
+ export { cloneValue };
363
+ //# sourceMappingURL=clone-value.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clone-value.mjs","names":[],"sources":["../../src/generative-ui/clone-value.ts"],"sourcesContent":["/**\n * A deep copy of `value` with `structuredClone` semantics. Uses the global\n * `structuredClone` when there is one. Hermes (React Native) has none, so\n * there a local copy runs. It decides the kind of an object by the same\n * internal slots that `structuredClone` reads (brand checks), not by\n * `instanceof` or `Symbol.toStringTag`, and gives what the native\n * `structuredClone` of V8 gives:\n *\n * - `undefined`, `null`, strings, booleans, numbers (also `NaN`,\n * `Infinity` and `-0`) and bigints are returned as they are.\n * - Arrays and ordinary objects are copied deeply: own enumerable string\n * keys only, so a class instance, or an object with its own\n * `Symbol.toStringTag`, becomes a plain object. A sparse array keeps its\n * holes and its length.\n * - `Date`, `RegExp`, `Map`, `Set`, boxed primitives, `ArrayBuffer`s (a\n * resizable one stays resizable), typed arrays (as the base type, never a\n * subclass), `DataView`s, `Blob`s and `File`s are copied.\n * - An `Error` becomes an `Error` of its standard type (a custom name or\n * `AggregateError` becomes `Error`), with its own `message`, its `stack`\n * and its own `cause`. A `DOMException` stays one where the global exists.\n * - A `SharedArrayBuffer` is shared, not copied, like `structuredClone`.\n * - Cycles and shared references are kept: an object reached twice is\n * copied once.\n * - Functions, symbols, `Symbol` wrappers, `arguments`, `WeakMap`,\n * `WeakSet`, `WeakRef`, `Promise`, iterators, generators and the web\n * platform objects that cannot be cloned (`URL`, `Headers`, streams...)\n * throw an error named `\"DataCloneError\"`: a `DOMException` where the\n * global exists, else an `Error` (Hermes has no `DOMException`).\n *\n * Two differences are left. A `Proxy` cannot be told from its target in\n * JavaScript, so the local copy reads it through its traps, where the\n * native one throws. And an ordinary object takes a fast path that runs no\n * brand check (each failed one throws and catches an exception, slow on\n * Hermes), so a `Map`, `Set`, `Promise` or other object whose prototype\n * was changed to `Object.prototype` or `null` is copied as a plain object.\n *\n * It never installs a global `structuredClone`, and it does not use the\n * JSON round trip of `structuredClone_` from `@ag-ui/client`, which turns\n * `undefined` into `{}` and drops or changes values JSON cannot hold.\n *\n * @param value - The value to copy.\n * @returns A copy that shares no object with `value`, except a\n * `SharedArrayBuffer`.\n * @throws An error named `\"DataCloneError\"` for a value that cannot be\n * cloned.\n */\nexport function cloneValue<T>(value: T): T {\n const native = (globalThis as { structuredClone?: <V>(value: V) => V })\n .structuredClone;\n if (typeof native === \"function\") return native(value);\n return cloneInto(value, new Map()) as T;\n}\n\ntype AnyFunction = (this: unknown, ...args: unknown[]) => unknown;\ntype Constructor = new (...args: unknown[]) => unknown;\n\n/** A global, or `undefined` when this engine does not have it. */\nfunction globalNamed<T = Constructor>(name: string): T | undefined {\n return (globalThis as unknown as Record<string, T | undefined>)[name];\n}\n\n/** True when `method` accepts `value` as its `this`: a brand check. */\nfunction hasBrand(\n value: object,\n method: AnyFunction | undefined,\n ...args: unknown[]\n) {\n if (typeof method !== \"function\") return false;\n try {\n method.call(value, ...args);\n return true;\n } catch {\n return false;\n }\n}\n\n/** The getter of `key` on `proto`, for a brand check. */\nfunction getterOf(proto: object | undefined, key: PropertyKey) {\n if (!proto) return undefined;\n return Object.getOwnPropertyDescriptor(proto, key)?.get as\n | AnyFunction\n | undefined;\n}\n\nfunction protoOf(name: string): object | undefined {\n return (globalNamed<{ prototype?: object }>(name) ?? {}).prototype;\n}\n\nfunction methodOf(name: string, key: string): AnyFunction | undefined {\n const proto = protoOf(name) as Record<string, AnyFunction> | undefined;\n return proto?.[key];\n}\n\nconst ERROR_NAMES = new Set([\n \"Error\",\n \"EvalError\",\n \"RangeError\",\n \"ReferenceError\",\n \"SyntaxError\",\n \"TypeError\",\n \"URIError\",\n]);\n\n/** Web platform objects that `structuredClone` refuses, where they exist. */\nconst PLATFORM_UNCLONEABLE = [\n \"URL\",\n \"URLSearchParams\",\n \"Headers\",\n \"Request\",\n \"Response\",\n \"FormData\",\n \"ReadableStream\",\n \"WritableStream\",\n \"TransformStream\",\n \"MessagePort\",\n];\n\nfunction* emptyGenerator() {\n // Only its prototype chain is used.\n}\n\n/** The prototypes of the built-in iterators and generators. */\nfunction iteratorPrototypes(): object[] {\n const protos: object[] = [];\n const add = (iterator: unknown) => {\n const proto = iterator && Object.getPrototypeOf(iterator);\n if (proto) protos.push(proto);\n };\n add([][Symbol.iterator]());\n add(new Map()[Symbol.iterator]());\n add(new Set()[Symbol.iterator]());\n add(\"\"[Symbol.iterator]());\n // The prototype of a generator object is its function's own `prototype`;\n // the shared one is above it.\n protos.push(Object.getPrototypeOf(emptyGenerator.prototype) as object);\n const matchAllKey = (Symbol as unknown as Record<string, symbol | undefined>)\n .matchAll;\n const matchAll = matchAllKey\n ? (RegExp.prototype as unknown as Record<symbol, AnyFunction | undefined>)[\n matchAllKey\n ]\n : undefined;\n if (typeof matchAll === \"function\") add(matchAll.call(/a/g, \"\"));\n return protos;\n}\n\nlet iteratorProtos: object[] | undefined;\n\nfunction inheritsFrom(value: object, protos: readonly object[]) {\n for (\n let proto = Object.getPrototypeOf(value);\n proto !== null;\n proto = Object.getPrototypeOf(proto)\n ) {\n if (protos.includes(proto)) return true;\n }\n return false;\n}\n\nfunction dataCloneError(what: string): Error {\n const message = `${what} could not be cloned.`;\n const DOMExceptionClass =\n globalNamed<new (message: string, name: string) => Error>(\"DOMException\");\n if (typeof DOMExceptionClass === \"function\") {\n return new DOMExceptionClass(message, \"DataCloneError\");\n }\n const error = new Error(message);\n error.name = \"DataCloneError\";\n return error;\n}\n\nfunction describe(value: unknown): string {\n if (typeof value === \"function\") {\n return value.name ? `function ${value.name}` : \"A function\";\n }\n if (typeof value === \"symbol\") return String(value);\n return Object.prototype.toString.call(value);\n}\n\n/** True for an object with the [[ErrorData]] slot. */\nfunction isError(value: object) {\n const isErrorCheck = (Error as unknown as { isError?: AnyFunction }).isError;\n if (typeof isErrorCheck === \"function\") {\n return isErrorCheck.call(Error, value) === true;\n }\n // Without Error.isError the built-in tag shows the slot, unless a\n // Symbol.toStringTag hides it (a DOMException has one).\n if (!(Symbol.toStringTag in value)) {\n return Object.prototype.toString.call(value) === \"[object Error]\";\n }\n return value instanceof Error;\n}\n\nfunction isDOMException(value: object) {\n return hasBrand(value, getterOf(protoOf(\"DOMException\"), \"code\"));\n}\n\n/** The name of the base typed-array type of a view, or `undefined`. */\nfunction typedArrayName(value: object): string | undefined {\n const TypedArrayProto = Object.getPrototypeOf(Uint8Array.prototype) as object;\n const getter = getterOf(TypedArrayProto, Symbol.toStringTag);\n if (!getter) return undefined;\n const name = getter.call(value);\n return typeof name === \"string\" ? name : undefined;\n}\n\nfunction cloneArrayBuffer(value: ArrayBuffer): ArrayBuffer {\n const source = value as ArrayBuffer & {\n resizable?: boolean;\n maxByteLength?: number;\n };\n if (source.resizable === true) {\n const ArrayBufferClass = ArrayBuffer as unknown as new (\n length: number,\n options: { maxByteLength: number },\n ) => ArrayBuffer;\n const copy = new ArrayBufferClass(source.byteLength, {\n maxByteLength: source.maxByteLength as number,\n });\n new Uint8Array(copy).set(new Uint8Array(source));\n return copy;\n }\n return ArrayBuffer.prototype.slice.call(value, 0) as ArrayBuffer;\n}\n\nfunction cloneError(value: Error, seen: Map<object, unknown>): Error {\n let copy: Error;\n const own = (key: string) => Object.prototype.hasOwnProperty.call(value, key);\n const messageDescriptor = Object.getOwnPropertyDescriptor(value, \"message\");\n const message =\n messageDescriptor && \"value\" in messageDescriptor\n ? `${messageDescriptor.value}`\n : undefined;\n if (isDOMException(value)) {\n const DOMExceptionClass =\n globalNamed<new (message?: string, name?: string) => Error>(\n \"DOMException\",\n )!;\n copy = new DOMExceptionClass(value.message, value.name);\n } else {\n const name = ERROR_NAMES.has(value.name) ? value.name : \"Error\";\n const ErrorClass = globalNamed<ErrorConstructor>(name) ?? Error;\n copy = message === undefined ? new ErrorClass() : new ErrorClass(message);\n }\n seen.set(value, copy);\n if (typeof value.stack === \"string\") copy.stack = value.stack;\n if (!isDOMException(value)) {\n const causeDescriptor = Object.getOwnPropertyDescriptor(value, \"cause\");\n if (own(\"cause\") && causeDescriptor && \"value\" in causeDescriptor) {\n // Defined, not passed as an option: Hermes may not read ErrorOptions.\n Object.defineProperty(copy, \"cause\", {\n value: cloneInto(causeDescriptor.value, seen),\n writable: true,\n enumerable: false,\n configurable: true,\n });\n }\n }\n return copy;\n}\n\nfunction cloneInto(value: unknown, seen: Map<object, unknown>): unknown {\n if (typeof value === \"function\" || typeof value === \"symbol\") {\n throw dataCloneError(describe(value));\n }\n if (typeof value !== \"object\" || value === null) return value;\n const known = seen.get(value);\n if (known !== undefined) return known;\n\n if (Array.isArray(value)) {\n // The same length, so a sparse array keeps its holes.\n const copy: unknown[] = [];\n copy.length = value.length;\n seen.set(value, copy);\n copyKeys(value, copy, seen);\n return copy;\n }\n // The common case, before the brand checks below: each one that fails\n // throws and catches an exception, which is slow on Hermes.\n if (isPlainObject(value)) {\n const copy: Record<string, unknown> = {};\n seen.set(value, copy);\n copyKeys(value, copy, seen);\n return copy;\n }\n if (hasBrand(value, Date.prototype.getTime as AnyFunction)) {\n const copy = new Date(Date.prototype.getTime.call(value));\n seen.set(value, copy);\n return copy;\n }\n if (hasBrand(value, getterOf(RegExp.prototype, \"source\"))) {\n const source = getterOf(RegExp.prototype, \"source\")!.call(value) as string;\n const flags = getterOf(RegExp.prototype, \"flags\")!.call(value) as string;\n const copy = new RegExp(source, flags);\n seen.set(value, copy);\n return copy;\n }\n if (hasBrand(value, Map.prototype.has as AnyFunction, undefined)) {\n const copy = new Map<unknown, unknown>();\n seen.set(value, copy);\n const entries: [unknown, unknown][] = [];\n Map.prototype.forEach.call(value, (entry: unknown, key: unknown) => {\n entries.push([key, entry]);\n });\n for (const [key, entry] of entries) {\n copy.set(cloneInto(key, seen), cloneInto(entry, seen));\n }\n return copy;\n }\n if (hasBrand(value, Set.prototype.has as AnyFunction, undefined)) {\n const copy = new Set<unknown>();\n seen.set(value, copy);\n const entries: unknown[] = [];\n Set.prototype.forEach.call(value, (entry: unknown) => {\n entries.push(entry);\n });\n for (const entry of entries) copy.add(cloneInto(entry, seen));\n return copy;\n }\n if (hasBrand(value, getterOf(ArrayBuffer.prototype, \"byteLength\"))) {\n const copy = cloneArrayBuffer(value as ArrayBuffer);\n seen.set(value, copy);\n return copy;\n }\n if (hasBrand(value, getterOf(protoOf(\"SharedArrayBuffer\"), \"byteLength\"))) {\n // structuredClone shares the memory of a SharedArrayBuffer.\n seen.set(value, value);\n return value;\n }\n if (ArrayBuffer.isView(value)) {\n const view = value as ArrayBufferView;\n const buffer = cloneInto(view.buffer, seen) as ArrayBuffer;\n const isDataView = hasBrand(\n value,\n getterOf(DataView.prototype, \"byteLength\"),\n );\n let copy: ArrayBufferView;\n if (isDataView) {\n copy = new DataView(buffer, view.byteOffset, view.byteLength);\n } else {\n const name = typedArrayName(value);\n const TypedArray = name\n ? globalNamed<\n new (\n buffer: ArrayBuffer,\n byteOffset: number,\n length: number,\n ) => ArrayBufferView\n >(name)\n : undefined;\n if (!TypedArray) throw dataCloneError(describe(value));\n const proto = Object.getPrototypeOf(Uint8Array.prototype) as object;\n const offset = getterOf(proto, \"byteOffset\")!.call(value) as number;\n const length = getterOf(proto, \"length\")!.call(value) as number;\n copy = new TypedArray(buffer, offset, length);\n }\n seen.set(value, copy);\n return copy;\n }\n if (isError(value)) return cloneError(value as Error, seen);\n\n for (const [name, Boxed] of [\n [\"Boolean\", Boolean],\n [\"Number\", Number],\n [\"String\", String],\n [\"BigInt\", globalNamed(\"BigInt\")],\n ] as const) {\n const valueOf = methodOf(name, \"valueOf\");\n if (Boxed && hasBrand(value, valueOf)) {\n const copy = Object(valueOf!.call(value));\n seen.set(value, copy);\n return copy;\n }\n }\n if (hasBrand(value, methodOf(\"Symbol\", \"valueOf\"))) {\n throw dataCloneError(describe(value));\n }\n const BlobClass = globalNamed<{ prototype: Blob }>(\"Blob\");\n if (typeof BlobClass === \"function\" && value instanceof BlobClass) {\n const copy = cloneBlob(value as Blob);\n seen.set(value, copy);\n return copy;\n }\n if (isUncloneable(value)) throw dataCloneError(describe(value));\n\n const copy: Record<string, unknown> = {};\n seen.set(value, copy);\n copyKeys(value, copy, seen);\n return copy;\n}\n\nfunction cloneBlob(value: Blob): Blob {\n const FileClass =\n globalNamed<\n new (\n parts: Blob[],\n name: string,\n options: { type: string; lastModified: number },\n ) => Blob\n >(\"File\");\n if (typeof FileClass === \"function\" && value instanceof FileClass) {\n const file = value as Blob & { name: string; lastModified: number };\n return new FileClass([value], file.name, {\n type: value.type,\n lastModified: file.lastModified,\n });\n }\n const BlobClass =\n globalNamed<new (parts: Blob[], options: { type: string }) => Blob>(\n \"Blob\",\n )!;\n return new BlobClass([value], { type: value.type });\n}\n\n/**\n * True for an ordinary object of this realm: its prototype is\n * `Object.prototype` or `null`, it has no `Symbol.toStringTag`, and its\n * built-in tag is \"Object\" (so not `arguments`, an `Error`, a `Date`, a\n * `RegExp` or a boxed primitive, whatever their prototype). Throws nothing.\n * An object with another slot (a `Map`, a `Set`, a `Promise`...) whose\n * prototype was changed to one of those passes too; only a brand check,\n * which throws, could tell, so it is copied as a plain object.\n */\nfunction isPlainObject(value: object): boolean {\n const proto = Object.getPrototypeOf(value);\n if (proto !== Object.prototype && proto !== null) return false;\n if (Symbol.toStringTag in value) return false;\n if (ArrayBuffer.isView(value)) return false;\n return Object.prototype.toString.call(value) === \"[object Object]\";\n}\n\n/** The globals of PLATFORM_UNCLONEABLE and their prototypes, when last read. */\nlet platformCache: { classes: unknown[]; protos: object[] } | undefined;\n\n/**\n * The prototypes of the PLATFORM_UNCLONEABLE globals that exist. Kept\n * between calls, and built again only when one of the globals changed (a\n * polyfill installed late).\n */\nfunction platformPrototypes(): object[] {\n const globals = globalThis as unknown as Record<string, unknown>;\n const cached = platformCache;\n if (\n cached &&\n PLATFORM_UNCLONEABLE.every(\n (name, index) => globals[name] === cached.classes[index],\n )\n ) {\n return cached.protos;\n }\n const classes = PLATFORM_UNCLONEABLE.map((name) => globals[name]);\n const protos = PLATFORM_UNCLONEABLE.map(protoOf).filter(\n (proto): proto is object => proto !== undefined,\n );\n platformCache = { classes, protos };\n return protos;\n}\n\n/** An object that structuredClone refuses, though it has no data slot. */\nfunction isUncloneable(value: object) {\n // An arguments object: V8 refuses it. Only the built-in tag says so; an\n // object that only claims the tag is a plain object.\n if (\n !(Symbol.toStringTag in value) &&\n Object.prototype.toString.call(value) === \"[object Arguments]\"\n ) {\n return true;\n }\n if (\n hasBrand(value, methodOf(\"WeakMap\", \"has\"), {}) ||\n hasBrand(value, methodOf(\"WeakSet\", \"has\"), {}) ||\n hasBrand(value, methodOf(\"WeakRef\", \"deref\")) ||\n hasBrand(value, methodOf(\"FinalizationRegistry\", \"unregister\"), {})\n ) {\n return true;\n }\n const PromiseClass = globalNamed<{ prototype: object }>(\"Promise\");\n if (PromiseClass && value instanceof (PromiseClass as unknown as Constructor))\n return true;\n if (!iteratorProtos) iteratorProtos = iteratorPrototypes();\n if (inheritsFrom(value, iteratorProtos)) return true;\n return inheritsFrom(value, platformPrototypes());\n}\n\n/** Copies the own enumerable string keys, as structuredClone does. */\nfunction copyKeys(source: object, target: object, seen: Map<object, unknown>) {\n for (const key of Object.keys(source)) {\n assign(\n target as Record<string, unknown>,\n key,\n cloneInto((source as Record<string, unknown>)[key], seen),\n );\n }\n}\n\n/**\n * Sets an own property. A plain assignment of \"__proto__\" would change the\n * prototype of the copy instead (JSON.parse makes \"__proto__\" an own key).\n */\nfunction assign(target: Record<string, unknown>, key: string, value: unknown) {\n if (key === \"__proto__\") {\n Object.defineProperty(target, key, {\n value,\n enumerable: true,\n configurable: true,\n writable: true,\n });\n } else {\n target[key] = value;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,SAAgB,WAAc,OAAa;CACzC,MAAM,SAAU,WACb;AACH,KAAI,OAAO,WAAW,WAAY,QAAO,OAAO,MAAM;AACtD,QAAO,UAAU,uBAAO,IAAI,KAAK,CAAC;;;AAOpC,SAAS,YAA6B,MAA6B;AACjE,QAAQ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AO;;;AAIT,SAAS,cAAc,OAAe;AAGpC,KACE,EAAE,OAAO,eAAe,UACxB,OAAO,UAAU,SAAS,KAAK,MAAM,KAAK,qBAE1C,QAAO;AAET,KACE,SAAS,OAAO,SAAS,WAAW,MAAM,EAAE,EAAE,CAAC,IAC/C,SAAS,OAAO,SAAS,WAAW,MAAM,EAAE,EAAE,CAAC,IAC/C,SAAS,OAAO,SAAS,WAAW,QAAQ,CAAC,IAC7C,SAAS,OAAO,SAAS,wBAAwB,aAAa,EAAE,EAAE,CAAC,CAEnE,QAAO;CAET,MAAM,eAAe,YAAmC,UAAU;AAClE,KAAI,gBAAgB,iBAAkB,aACpC,QAAO;AACT,KAAI,CAAC,eAAgB,kBAAiB,oBAAoB;AAC1D,KAAI,aAAa,OAAO,eAAe,CAAE,QAAO;AAChD,QAAO,aAAa,OAAO,oBAAoB,CAAC;;;AAIlD,SAAS,SAAS,QAAgB,QAAgB,MAA4B;AAC5E,MAAK,MAAM,OAAO,OAAO,KAAK,OAAO,CACnC,QACE,QACA,KACA,UAAW,OAAmC,MAAM,KAAK,CAC1D;;;;;;AAQL,SAAS,OAAO,QAAiC,KAAa,OAAgB;AAC5E,KAAI,QAAQ,YACV,QAAO,eAAe,QAAQ,KAAK;EACjC;EACA,YAAY;EACZ,cAAc;EACd,UAAU;EACX,CAAC;KAEF,QAAO,OAAO"}
@@ -6,6 +6,7 @@ const require_types = require('./types.cjs');
6
6
  const require_prompt_spec = require('./prompt-spec.cjs');
7
7
  const require_validate_operation = require('./validate-operation.cjs');
8
8
  const require_render_ui_args = require('./render-ui-args.cjs');
9
+ const require_clone_value = require('./clone-value.cjs');
9
10
  const require_compact_schema = require('./compact-schema.cjs');
10
11
  const require_schema_render = require('./schema-render.cjs');
11
12
  const require_prompt = require('./prompt.cjs');
@@ -31,6 +32,11 @@ const require_data = require('./standard/data.cjs');
31
32
  const require_media = require('./standard/media.cjs');
32
33
  const require_composites = require('./standard/composites.cjs');
33
34
  const require_declarations = require('./standard/declarations.cjs');
35
+ const require_style_helpers = require('./standard/style-helpers.cjs');
36
+ const require_url = require('./standard/url.cjs');
37
+ const require_chart_config = require('./standard/chart-config.cjs');
38
+ const require_map_helpers = require('./standard/map-helpers.cjs');
39
+ const require_thrown = require('./thrown.cjs');
34
40
 
35
41
  exports.A2UI_BASIC_FUNCTIONS = require_basic_functions.A2UI_BASIC_FUNCTIONS;
36
42
  exports.A2UI_CHILD_LIST_MARK = require_child_refs.A2UI_CHILD_LIST_MARK;
@@ -42,6 +48,7 @@ exports.A2UI_INDEX_FUNCTION = require_basic_functions.A2UI_INDEX_FUNCTION;
42
48
  exports.A2UI_VERSION = require_types.A2UI_VERSION;
43
49
  exports.ACCENT = require_styles.ACCENT;
44
50
  exports.ALIGN = require_tokens.ALIGN;
51
+ exports.ALIGN_CSS = require_style_helpers.ALIGN_CSS;
45
52
  exports.BACKDROP = require_tokens.BACKDROP;
46
53
  exports.BACKGROUNDS = require_tokens.BACKGROUNDS;
47
54
  exports.BADGE_SIZES = require_text.BADGE_SIZES;
@@ -55,6 +62,9 @@ exports.CONTROL_BG = require_tokens.CONTROL_BG;
55
62
  exports.COPILOTKIT_FUNCTIONS = require_basic_functions.COPILOTKIT_FUNCTIONS;
56
63
  exports.DARK_THEME = require_theme.DARK_THEME;
57
64
  exports.DARK_THEME_CSS = require_theme.DARK_THEME_CSS;
65
+ exports.DEFAULT_DARK_MAP_STYLE = require_map_helpers.DEFAULT_DARK_MAP_STYLE;
66
+ exports.DEFAULT_MAP_STYLE = require_map_helpers.DEFAULT_MAP_STYLE;
67
+ exports.FOCUS_RING = require_style_helpers.FOCUS_RING;
58
68
  exports.FONT_FAMILY = require_tokens.FONT_FAMILY;
59
69
  exports.FONT_WEIGHT = require_tokens.FONT_WEIGHT;
60
70
  exports.GENERATIVE_UI_ACTIVITY_TYPE = require_types.GENERATIVE_UI_ACTIVITY_TYPE;
@@ -79,10 +89,14 @@ exports.IMAGE_VARIANTS = require_media.IMAGE_VARIANTS;
79
89
  exports.INNER_PANEL_BG = require_tokens.INNER_PANEL_BG;
80
90
  exports.INPUT_SIZES = require_inputs.INPUT_SIZES;
81
91
  exports.JUSTIFY = require_tokens.JUSTIFY;
92
+ exports.JUSTIFY_CSS = require_style_helpers.JUSTIFY_CSS;
82
93
  exports.LIST_MARKERS = require_data.LIST_MARKERS;
94
+ exports.MAP_CSS = require_map_helpers.MAP_CSS;
95
+ exports.MAP_STYLE_ID = require_map_helpers.MAP_STYLE_ID;
83
96
  exports.NO_ARGS = require_layout.NO_ARGS;
84
97
  exports.ON_ACCENT = require_tokens.ON_ACCENT;
85
98
  exports.RADII = require_tokens.RADII;
99
+ exports.ROUTE_SOURCE = require_map_helpers.ROUTE_SOURCE;
86
100
  exports.RenderUIArgsStream = require_render_ui_args.RenderUIArgsStream;
87
101
  exports.SHADOW_MD = require_tokens.SHADOW_MD;
88
102
  exports.SHADOW_SM = require_tokens.SHADOW_SM;
@@ -97,6 +111,7 @@ exports.TEXT_COLORS = require_tokens.TEXT_COLORS;
97
111
  exports.TEXT_SIZES = require_tokens.TEXT_SIZES;
98
112
  exports.TITLE_SIZES = require_tokens.TITLE_SIZES;
99
113
  exports.VISIBLE_EVENT = require_layout.VISIBLE_EVENT;
114
+ exports.VISUALLY_HIDDEN = require_style_helpers.VISUALLY_HIDDEN;
100
115
  exports.WEIGHTS = require_tokens.WEIGHTS;
101
116
  exports.WRAP = require_tokens.WRAP;
102
117
  exports.applyChildRefMarks = require_child_refs.applyChildRefMarks;
@@ -119,6 +134,7 @@ exports.cardSchema = require_layout.cardSchema;
119
134
  exports.carouselMediaItemSchema = require_layout.carouselMediaItemSchema;
120
135
  exports.carouselSchema = require_layout.carouselSchema;
121
136
  exports.catalogIdsOf = require_catalog.catalogIdsOf;
137
+ exports.chartConfig = require_chart_config.chartConfig;
122
138
  exports.chartSchema = require_chart.chartSchema;
123
139
  exports.chartSeries = require_chart.chartSeries;
124
140
  exports.checkBoxSchema = require_inputs.checkBoxSchema;
@@ -130,6 +146,7 @@ exports.childList = require_refs.childList;
130
146
  exports.childRefKind = require_child_refs.childRefKind;
131
147
  exports.choicePickerSchema = require_inputs.choicePickerSchema;
132
148
  exports.citationSchema = require_composites.citationSchema;
149
+ exports.cloneValue = require_clone_value.cloneValue;
133
150
  exports.codeSchema = require_text.codeSchema;
134
151
  exports.collectChildRefs = require_child_refs.collectChildRefs;
135
152
  exports.componentCatalogIds = require_catalog.componentCatalogIds;
@@ -138,12 +155,14 @@ exports.createGenerativeUI = require_catalog.createGenerativeUI;
138
155
  exports.dataDeclarations = require_data.dataDeclarations;
139
156
  exports.dateTimeInputSchema = require_inputs.dateTimeInputSchema;
140
157
  exports.defaultGenerativeUIPromptSpec = require_prompt_spec.defaultGenerativeUIPromptSpec;
158
+ exports.defined = require_style_helpers.defined;
141
159
  exports.dividerSchema = require_layout.dividerSchema;
142
160
  exports.entityActionArgs = require_composites.entityActionArgs;
143
161
  exports.entityCardSchema = require_composites.entityCardSchema;
144
162
  exports.exportA2UICatalog = require_catalog_export.exportA2UICatalog;
145
163
  exports.extractRenderUIArgs = require_render_ui_args.extractRenderUIArgs;
146
164
  exports.faviconSchema = require_media.faviconSchema;
165
+ exports.faviconSrc = require_url.faviconSrc;
147
166
  exports.feedbackDeclarations = require_feedback.feedbackDeclarations;
148
167
  exports.firstFailedCheck = require_checks.firstFailedCheck;
149
168
  exports.flashcardSchema = require_feedback.flashcardSchema;
@@ -163,7 +182,11 @@ exports.getOperationSurfaceId = require_validate_operation.getOperationSurfaceId
163
182
  exports.gridImage = require_composites.gridImage;
164
183
  exports.gridItemSchema = require_layout.gridItemSchema;
165
184
  exports.gridSchema = require_layout.gridSchema;
185
+ exports.guardNumericFilter = require_map_helpers.guardNumericFilter;
186
+ exports.guardStyleFilters = require_map_helpers.guardStyleFilters;
166
187
  exports.hasBoundChildRef = require_child_refs.hasBoundChildRef;
188
+ exports.hasOwnKey = require_is_record.hasOwnKey;
189
+ exports.hostOf = require_url.hostOf;
167
190
  exports.htmlViewSchema = require_media.htmlViewSchema;
168
191
  exports.iconSchema = require_media.iconSchema;
169
192
  exports.imageGridSchema = require_composites.imageGridSchema;
@@ -176,18 +199,24 @@ exports.isActionBinding = require_validate_operation.isActionBinding;
176
199
  exports.isAsyncIssue = require_schema.isAsyncIssue;
177
200
  exports.isCallBinding = require_basic_functions.isCallBinding;
178
201
  exports.isIndexCall = require_validate_operation.isIndexCall;
202
+ exports.isMapLibre = require_map_helpers.isMapLibre;
179
203
  exports.isPathBinding = require_validate_operation.isPathBinding;
180
204
  exports.isRecord = require_is_record.isRecord;
205
+ exports.isValidMarker = require_map_helpers.isValidMarker;
181
206
  exports.isValidationResult = require_basic_functions.isValidationResult;
182
207
  exports.issueKey = require_schema.issueKey;
208
+ exports.jsonEqual = require_style_helpers.jsonEqual;
183
209
  exports.labelSchema = require_text.labelSchema;
184
210
  exports.layoutDeclarations = require_layout.layoutDeclarations;
185
211
  exports.layoutProps = require_layout.layoutProps;
212
+ exports.layoutStyle = require_style_helpers.layoutStyle;
213
+ exports.lineClamp = require_style_helpers.lineClamp;
186
214
  exports.linkCardSchema = require_composites.linkCardSchema;
187
215
  exports.linkSchema = require_text.linkSchema;
188
216
  exports.listItemSchema = require_data.listItemSchema;
189
217
  exports.listSchema = require_data.listSchema;
190
218
  exports.listSelection = require_data.listSelection;
219
+ exports.makeFormatter = require_chart_config.makeFormatter;
191
220
  exports.mapAtChildRef = require_child_refs.mapAtChildRef;
192
221
  exports.mapMarker = require_map.mapMarker;
193
222
  exports.mapSchema = require_map.mapSchema;
@@ -195,18 +224,24 @@ exports.markdownSchema = require_text.markdownSchema;
195
224
  exports.mathSchema = require_text.mathSchema;
196
225
  exports.mediaDeclarations = require_media.mediaDeclarations;
197
226
  exports.modalSchema = require_feedback.modalSchema;
227
+ exports.normalizeSeries = require_chart_config.normalizeSeries;
228
+ exports.openUrl = require_url.openUrl;
198
229
  exports.panelBackground = require_tokens.panelBackground;
199
230
  exports.popoverContentSchema = require_feedback.popoverContentSchema;
200
231
  exports.popoverSchema = require_feedback.popoverSchema;
201
232
  exports.popoverTriggerSchema = require_feedback.popoverTriggerSchema;
202
233
  exports.pressableSchema = require_inputs.pressableSchema;
203
234
  exports.pulseIndicatorSchema = require_feedback.pulseIndicatorSchema;
235
+ exports.px = require_style_helpers.px;
204
236
  exports.radioGroupSchema = require_inputs.radioGroupSchema;
205
237
  exports.radioSchema = require_inputs.radioSchema;
206
238
  exports.radius = require_tokens.radius;
239
+ exports.radiusStyle = require_style_helpers.radiusStyle;
207
240
  exports.radiusValue = require_layout.radiusValue;
208
241
  exports.renderGenerativeUIComponentList = require_schema_render.renderGenerativeUIComponentList;
209
242
  exports.renderGenerativeUISchema = require_schema_render.renderGenerativeUISchema;
243
+ exports.resolveCssColor = require_chart_config.resolveCssColor;
244
+ exports.safeHref = require_url.safeHref;
210
245
  exports.schemaCoverage = require_schema_render.schemaCoverage;
211
246
  exports.segmentedControlSchema = require_inputs.segmentedControlSchema;
212
247
  exports.selectPromptItems = require_prompt_spec.selectPromptItems;
@@ -235,13 +270,17 @@ exports.themeStyleSheet = require_theme.themeStyleSheet;
235
270
  exports.titleFont = require_tokens.titleFont;
236
271
  exports.titleSchema = require_text.titleSchema;
237
272
  exports.toA2UIActionMessage = require_types.toA2UIActionMessage;
273
+ exports.toError = require_thrown.toError;
238
274
  exports.toJsonSchema = require_json_schema.toJsonSchema;
239
275
  exports.typographySchema = require_text.typographySchema;
240
276
  exports.validateOperation = require_validate_operation.validateOperation;
241
277
  exports.validateSchema = require_schema.validateSchema;
242
278
  exports.validateSchemaSync = require_schema.validateSchemaSync;
279
+ exports.valueLabelsPlugin = require_chart_config.valueLabelsPlugin;
243
280
  exports.videoSchema = require_media.videoSchema;
244
281
  exports.weightProp = require_layout.weightProp;
282
+ exports.withAlpha = require_chart_config.withAlpha;
283
+ exports.withCause = require_thrown.withCause;
245
284
  exports.withComponents = require_components.withComponents;
246
285
  exports.withStandardParameterOrder = require_declarations.withStandardParameterOrder;
247
286
  exports.withoutRejectedNulls = require_schema.withoutRejectedNulls;
@@ -29,5 +29,11 @@ import { MapMarker, mapMarker, mapSchema } from "./standard/map.cjs";
29
29
  import { ICON_SIZES, IMAGE_VARIANTS, IconSize, audioPlayerSchema, faviconSchema, htmlViewSchema, iconSchema, imageSchema, mediaDeclarations, svgSchema, videoSchema } from "./standard/media.cjs";
30
30
  import { cardAction, citationSchema, compositeDeclarations, entityActionArgs, entityCardSchema, followUpArgs, followUpItem, followUpSchema, gridImage, imageGridSchema, linkCardSchema } from "./standard/composites.cjs";
31
31
  import { StandardComponentName, standardDeclarations, withStandardParameterOrder } from "./standard/declarations.cjs";
32
- import { isRecord } from "./is-record.cjs";
33
- export { A2UIActionMessage, A2UIAllowedCallers, A2UIBasicFunctionInfo, A2UIComponentNode, A2UIFunctionCall, A2UIFunctionPermissions, A2UIFunctionReturnType, A2UIOperation, A2UIValidationResult, A2UIValidationSeverity, A2UI_BASIC_FUNCTIONS, A2UI_CHILD_LIST_MARK, A2UI_CHILD_LIST_REF, A2UI_COMPONENT_ENVELOPE_KEYS, A2UI_COMPONENT_ID_MARK, A2UI_COMPONENT_ID_REF, A2UI_INDEX_FUNCTION, A2UI_VERSION, ACCENT, ALIGN, AllowedComponents, AnyGenerativeUI, BACKDROP, BACKGROUNDS, BADGE_SIZES, BORDER_COLORS, CAPTION_SIZES, CAROUSEL_MEDIA_SIZES, CHART_CURSOR, CHART_PALETTE, CHILDREN_SLOT, CONTROL_BG, COPILOTKIT_FUNCTIONS, ChartProps, ChartSeries, ChildRef, ChildRefKind, CreateGenerativeUIConfig, DARK_THEME, DARK_THEME_CSS, ExportA2UICatalogOptions, ExtractedRenderUIArgs, FONT_FAMILY, FONT_WEIGHT, FailedCheck, 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_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, GenerativeUI, GenerativeUIActionBinding, GenerativeUIAnyComponent, GenerativeUIBasesDefinitions, GenerativeUIChildNode, GenerativeUIComponentDeclaration, GenerativeUIComponentDefinition, GenerativeUIComponentManifest, GenerativeUIComponentName, GenerativeUIComponentProps, GenerativeUIComponentTypes, GenerativeUIDefinitions, GenerativeUIDefinitionsOf, GenerativeUIError, GenerativeUIErrorCode, GenerativeUIErrorInfo, GenerativeUIEventDefinition, GenerativeUIEventHandler, GenerativeUIEventInput, GenerativeUIEventName, GenerativeUIFunctionArgs, GenerativeUIFunctionCallContent, GenerativeUIFunctionDefinition, GenerativeUIFunctionInput, GenerativeUIFunctionManifest, GenerativeUIFunctionName, GenerativeUIFunctionsOf, GenerativeUIInvokeResult, GenerativeUIJSONSchema, GenerativeUIManifest, GenerativeUIOverridesConfig, GenerativeUIPromptFeature, GenerativeUIPromptFeatures, GenerativeUIPromptItem, GenerativeUIPromptSection, GenerativeUIPromptSpec, GenerativeUIRejectedOperation, GenerativeUIResultDefinitions, GenerativeUISchema, GenerativeUISchemaSettings, GenerativeUISelector, GenerativeUISlotKind, GenerativeUIStateOf, GenerativeUISurfaceContent, GenerativeUISurfaceStatus, GenerativeUISurfaceSummary, GenerativeUITarget, GenerativeUITemplateChildren, GenerativeUITheme, GenerativeUIThemeValues, GenerativeUIThemeVariable, GenerativeUIThemeVariables, GenerativeUIUserEvent, ICON_SIZES, IMAGE_VARIANTS, INNER_PANEL_BG, INPUT_SIZES, IconSize, InputOptionList, InputSize, JUSTIFY, LIST_MARKERS, LayoutProps, ListItemValue, ListMarker, ListSelection, MapMarker, NO_ARGS, ON_ACCENT, OperationKind, OperationValidation, PropsSchema, RADII, Radius, RenderUIArgsStream, ResolvedChecks, ResolvedGenerativeUIComponent, SHADOW_MD, SHADOW_SM, SHADOW_SOFT, SHADOW_XS, SHIMMER_HIGHLIGHT, STANDARD_ARGUMENT_PREFIXES, STANDARD_CATALOG_ID, STANDARD_CSS, STANDARD_STYLE_ID, SchemaInput, SchemaOutput, StandardComponentName, TEXT_COLORS, TEXT_SIZES, TITLE_SIZES, TableColumn, TextSize, TitleSize, UnionToIntersection, VISIBLE_EVENT, ValidateOperationOptions, ValidationResult, WEIGHTS, WRAP, Weight, applyChildRefMarks, applyDescriptionOverrides, argsSchemaFromSignature, audioPlayerSchema, backgroundColor, badgeSchema, blockquoteSchema, boldSchema, borderColor, boxSchema, buildCompactGenerativeUISchema, buildGenerativeUIPrompt, buttonSchema, callerProblem, captionSchema, cardAction, cardSchema, carouselMediaItemSchema, carouselSchema, catalogIdsOf, chartSchema, chartSeries, checkBoxSchema, checkMessageStyle, checksProp, child, childIdsAtRefs, childList, childRefKind, choicePickerSchema, citationSchema, codeSchema, collectChildRefs, componentCatalogIds, compositeDeclarations, createGenerativeUI, dataDeclarations, dateTimeInputSchema, defaultGenerativeUIPromptSpec, dividerSchema, entityActionArgs, entityCardSchema, exportA2UICatalog, extractRenderUIArgs, faviconSchema, feedbackDeclarations, firstFailedCheck, flashcardSchema, flowItemSchema, flowSchema, followUpArgs, followUpItem, followUpSchema, formSchema, formatIssues, functionCallers, generativeUIFunctionCallMessageId, generativeUIPromptFeatures, generativeUISurfaceMessageId, getOperationKind, getOperationSurfaceId, gridImage, gridItemSchema, gridSchema, hasBoundChildRef, htmlViewSchema, iconSchema, imageGridSchema, imageSchema, inlineTextSchema, inputDeclarations, isA2UIBasicFunction, isA2UIValueFunction, isActionBinding, isAsyncIssue, isCallBinding, isIndexCall, isPathBinding, isRecord, isValidationResult, issueKey, labelSchema, layoutDeclarations, layoutProps, linkCardSchema, linkSchema, listItemSchema, listSchema, listSelection, mapAtChildRef, mapMarker, mapSchema, markdownSchema, mathSchema, mediaDeclarations, modalSchema, panelBackground, popoverContentSchema, popoverSchema, popoverTriggerSchema, pressableSchema, pulseIndicatorSchema, radioGroupSchema, radioSchema, radius, radiusValue, renderGenerativeUIComponentList, renderGenerativeUISchema, schemaCoverage, segmentedControlSchema, selectPromptItems, selectSchema, setterNameOf, shimmerSchema, sizeValue, sliderSchema, spacerSchema, spacing, standardDeclarations, standardParameterOrder, svgSchema, tableCellSchema, tableRowSchema, tableSchema, tableSectionSchema, tabsSchema, textAreaSchema, textColor, textDeclarations, textFieldSchema, textFont, textSchema, themeStyleSheet, titleFont, titleSchema, toA2UIActionMessage, toJsonSchema, typographySchema, validateOperation, validateSchema, validateSchemaSync, videoSchema, weightProp, withComponents, withStandardParameterOrder, withoutRejectedNulls };
32
+ import { ALIGN_CSS, FOCUS_RING, JUSTIFY_CSS, StyleMap, VISUALLY_HIDDEN, defined, jsonEqual, layoutStyle, lineClamp, px, radiusStyle } from "./standard/style-helpers.cjs";
33
+ import { faviconSrc, hostOf, openUrl, safeHref } from "./standard/url.cjs";
34
+ import { ChartConstructor, chartConfig, makeFormatter, normalizeSeries, resolveCssColor, valueLabelsPlugin, withAlpha } from "./standard/chart-config.cjs";
35
+ import { DEFAULT_DARK_MAP_STYLE, DEFAULT_MAP_STYLE, MAP_CSS, MAP_STYLE_ID, MapLibre, MapLibreMap, MapLibreMarker, ROUTE_SOURCE, guardNumericFilter, guardStyleFilters, isMapLibre, isValidMarker } from "./standard/map-helpers.cjs";
36
+ import { hasOwnKey, isRecord } from "./is-record.cjs";
37
+ import { cloneValue } from "./clone-value.cjs";
38
+ import { toError, withCause } from "./thrown.cjs";
39
+ export { A2UIActionMessage, A2UIAllowedCallers, A2UIBasicFunctionInfo, A2UIComponentNode, A2UIFunctionCall, A2UIFunctionPermissions, A2UIFunctionReturnType, A2UIOperation, A2UIValidationResult, A2UIValidationSeverity, A2UI_BASIC_FUNCTIONS, A2UI_CHILD_LIST_MARK, A2UI_CHILD_LIST_REF, A2UI_COMPONENT_ENVELOPE_KEYS, A2UI_COMPONENT_ID_MARK, A2UI_COMPONENT_ID_REF, A2UI_INDEX_FUNCTION, A2UI_VERSION, ACCENT, ALIGN, ALIGN_CSS, AllowedComponents, AnyGenerativeUI, BACKDROP, BACKGROUNDS, BADGE_SIZES, BORDER_COLORS, CAPTION_SIZES, CAROUSEL_MEDIA_SIZES, CHART_CURSOR, CHART_PALETTE, CHILDREN_SLOT, CONTROL_BG, COPILOTKIT_FUNCTIONS, ChartConstructor, ChartProps, ChartSeries, ChildRef, ChildRefKind, CreateGenerativeUIConfig, DARK_THEME, DARK_THEME_CSS, DEFAULT_DARK_MAP_STYLE, DEFAULT_MAP_STYLE, ExportA2UICatalogOptions, ExtractedRenderUIArgs, FOCUS_RING, FONT_FAMILY, FONT_WEIGHT, FailedCheck, 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_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, GenerativeUI, GenerativeUIActionBinding, GenerativeUIAnyComponent, GenerativeUIBasesDefinitions, GenerativeUIChildNode, GenerativeUIComponentDeclaration, GenerativeUIComponentDefinition, GenerativeUIComponentManifest, GenerativeUIComponentName, GenerativeUIComponentProps, GenerativeUIComponentTypes, GenerativeUIDefinitions, GenerativeUIDefinitionsOf, GenerativeUIError, GenerativeUIErrorCode, GenerativeUIErrorInfo, GenerativeUIEventDefinition, GenerativeUIEventHandler, GenerativeUIEventInput, GenerativeUIEventName, GenerativeUIFunctionArgs, GenerativeUIFunctionCallContent, GenerativeUIFunctionDefinition, GenerativeUIFunctionInput, GenerativeUIFunctionManifest, GenerativeUIFunctionName, GenerativeUIFunctionsOf, GenerativeUIInvokeResult, GenerativeUIJSONSchema, GenerativeUIManifest, GenerativeUIOverridesConfig, GenerativeUIPromptFeature, GenerativeUIPromptFeatures, GenerativeUIPromptItem, GenerativeUIPromptSection, GenerativeUIPromptSpec, GenerativeUIRejectedOperation, GenerativeUIResultDefinitions, GenerativeUISchema, GenerativeUISchemaSettings, GenerativeUISelector, GenerativeUISlotKind, GenerativeUIStateOf, GenerativeUISurfaceContent, GenerativeUISurfaceStatus, GenerativeUISurfaceSummary, GenerativeUITarget, GenerativeUITemplateChildren, GenerativeUITheme, GenerativeUIThemeValues, GenerativeUIThemeVariable, GenerativeUIThemeVariables, GenerativeUIUserEvent, ICON_SIZES, IMAGE_VARIANTS, INNER_PANEL_BG, INPUT_SIZES, IconSize, InputOptionList, InputSize, JUSTIFY, JUSTIFY_CSS, LIST_MARKERS, LayoutProps, ListItemValue, ListMarker, ListSelection, MAP_CSS, MAP_STYLE_ID, MapLibre, MapLibreMap, MapLibreMarker, MapMarker, NO_ARGS, ON_ACCENT, OperationKind, OperationValidation, PropsSchema, RADII, ROUTE_SOURCE, Radius, RenderUIArgsStream, ResolvedChecks, ResolvedGenerativeUIComponent, SHADOW_MD, SHADOW_SM, SHADOW_SOFT, SHADOW_XS, SHIMMER_HIGHLIGHT, STANDARD_ARGUMENT_PREFIXES, STANDARD_CATALOG_ID, STANDARD_CSS, STANDARD_STYLE_ID, SchemaInput, SchemaOutput, StandardComponentName, StyleMap, TEXT_COLORS, TEXT_SIZES, TITLE_SIZES, TableColumn, TextSize, TitleSize, UnionToIntersection, VISIBLE_EVENT, VISUALLY_HIDDEN, ValidateOperationOptions, ValidationResult, WEIGHTS, WRAP, Weight, applyChildRefMarks, applyDescriptionOverrides, argsSchemaFromSignature, audioPlayerSchema, backgroundColor, badgeSchema, blockquoteSchema, boldSchema, borderColor, boxSchema, buildCompactGenerativeUISchema, buildGenerativeUIPrompt, buttonSchema, callerProblem, captionSchema, cardAction, cardSchema, carouselMediaItemSchema, carouselSchema, catalogIdsOf, chartConfig, chartSchema, chartSeries, checkBoxSchema, checkMessageStyle, checksProp, child, childIdsAtRefs, childList, childRefKind, choicePickerSchema, citationSchema, cloneValue, codeSchema, collectChildRefs, componentCatalogIds, compositeDeclarations, createGenerativeUI, dataDeclarations, dateTimeInputSchema, defaultGenerativeUIPromptSpec, defined, dividerSchema, entityActionArgs, entityCardSchema, exportA2UICatalog, extractRenderUIArgs, faviconSchema, faviconSrc, feedbackDeclarations, firstFailedCheck, flashcardSchema, flowItemSchema, flowSchema, followUpArgs, followUpItem, followUpSchema, formSchema, formatIssues, functionCallers, generativeUIFunctionCallMessageId, generativeUIPromptFeatures, generativeUISurfaceMessageId, getOperationKind, getOperationSurfaceId, gridImage, gridItemSchema, gridSchema, guardNumericFilter, guardStyleFilters, hasBoundChildRef, hasOwnKey, hostOf, htmlViewSchema, iconSchema, imageGridSchema, imageSchema, inlineTextSchema, inputDeclarations, isA2UIBasicFunction, isA2UIValueFunction, isActionBinding, isAsyncIssue, isCallBinding, isIndexCall, isMapLibre, isPathBinding, isRecord, isValidMarker, isValidationResult, issueKey, jsonEqual, labelSchema, layoutDeclarations, layoutProps, layoutStyle, lineClamp, linkCardSchema, linkSchema, listItemSchema, listSchema, listSelection, makeFormatter, mapAtChildRef, mapMarker, mapSchema, markdownSchema, mathSchema, mediaDeclarations, modalSchema, normalizeSeries, openUrl, panelBackground, popoverContentSchema, popoverSchema, popoverTriggerSchema, pressableSchema, pulseIndicatorSchema, px, radioGroupSchema, radioSchema, radius, radiusStyle, radiusValue, renderGenerativeUIComponentList, renderGenerativeUISchema, resolveCssColor, safeHref, schemaCoverage, segmentedControlSchema, selectPromptItems, selectSchema, setterNameOf, shimmerSchema, sizeValue, sliderSchema, spacerSchema, spacing, standardDeclarations, standardParameterOrder, svgSchema, tableCellSchema, tableRowSchema, tableSchema, tableSectionSchema, tabsSchema, textAreaSchema, textColor, textDeclarations, textFieldSchema, textFont, textSchema, themeStyleSheet, titleFont, titleSchema, toA2UIActionMessage, toError, toJsonSchema, typographySchema, validateOperation, validateSchema, validateSchemaSync, valueLabelsPlugin, videoSchema, weightProp, withAlpha, withCause, withComponents, withStandardParameterOrder, withoutRejectedNulls };