@copilotkit/shared 1.84.0 → 1.84.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/a2ui-catalog-schema.cjs +264 -0
- package/dist/a2ui-catalog-schema.cjs.map +1 -0
- package/dist/a2ui-catalog-schema.d.cts +112 -0
- package/dist/a2ui-catalog-schema.d.cts.map +1 -0
- package/dist/a2ui-catalog-schema.d.mts +112 -0
- package/dist/a2ui-catalog-schema.d.mts.map +1 -0
- package/dist/a2ui-catalog-schema.mjs +259 -0
- package/dist/a2ui-catalog-schema.mjs.map +1 -0
- package/dist/index.cjs +6 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +268 -5
- package/dist/index.umd.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.mjs +1 -1
- package/package.json +1 -1
- package/src/__tests__/a2ui-catalog-schema.test.ts +403 -0
- package/src/a2ui-catalog-schema.ts +404 -0
- package/src/index.ts +13 -0
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { ignoreOverride, zodToJsonSchema } from "zod-to-json-schema";
|
|
2
|
+
|
|
3
|
+
//#region src/a2ui-catalog-schema.ts
|
|
4
|
+
/**
|
|
5
|
+
* Context description used to identify the A2UI component schema in
|
|
6
|
+
* RunAgentInput.context. Must match the constant in @ag-ui/a2ui-middleware so
|
|
7
|
+
* the middleware can overwrite a frontend-provided schema with a server-side one.
|
|
8
|
+
*/
|
|
9
|
+
const A2UI_SCHEMA_CONTEXT_DESCRIPTION = "A2UI Component Schema — available components for generating UI surfaces. Use these component names and properties when creating A2UI operations.";
|
|
10
|
+
/** Id of the A2UI v0.9 basic catalog. */
|
|
11
|
+
const A2UI_BASIC_CATALOG_ID = "https://a2ui.org/specification/v0_9/basic_catalog.json";
|
|
12
|
+
/**
|
|
13
|
+
* Serialize a catalog's Zod schemas in the A2UI v0.9 inline catalog format.
|
|
14
|
+
*
|
|
15
|
+
* Each component composes `ComponentCommon` with its own properties, matching
|
|
16
|
+
* the flat wire format the agent must produce:
|
|
17
|
+
*
|
|
18
|
+
* { "Column": { "allOf": [
|
|
19
|
+
* { "$ref": "common_types.json#/$defs/ComponentCommon" },
|
|
20
|
+
* { "properties": { "component": {"const":"Column"}, "gap": ..., "children": ... },
|
|
21
|
+
* "required": ["component"] }
|
|
22
|
+
* ]}}
|
|
23
|
+
*
|
|
24
|
+
* This follows `getClientCapabilities` in `@a2ui/web_core` with these
|
|
25
|
+
* deliberate differences:
|
|
26
|
+
*
|
|
27
|
+
* - Reused Zod schemas are inlined rather than emitted as local `$ref`s, which
|
|
28
|
+
* would dangle once properties move under `allOf[1]`.
|
|
29
|
+
* - A `REF:<ref>|<description>` marker becomes a bare `$ref`, as upstream, but
|
|
30
|
+
* the shape it replaced is kept once under
|
|
31
|
+
* `"common_types.json": { "$defs": { <Name>: ... } }`. Every
|
|
32
|
+
* `common_types.json#/$defs/<Name>` ref therefore resolves within the
|
|
33
|
+
* payload, both for agents that only see it as prompt text and for SDKs
|
|
34
|
+
* (such as Google's A2UI SDK used by ADK) that read the `$ref`. Each type is
|
|
35
|
+
* stated once rather than at every use site, which keeps the payload small.
|
|
36
|
+
* A use whose shape differs from the stored one keeps its shape inline next
|
|
37
|
+
* to the `$ref`, so the agent never sees a looser type than the client
|
|
38
|
+
* accepts.
|
|
39
|
+
* - A `REF:` marker on a schema's root only sets its description; replacing
|
|
40
|
+
* the root would drop every property.
|
|
41
|
+
* - A component's root `.describe()` is kept as the component `description`.
|
|
42
|
+
* - Function parameters drop `$schema` and the description already given on
|
|
43
|
+
* the function itself, to keep the prompt small.
|
|
44
|
+
*/
|
|
45
|
+
function extractA2UICatalogSchemas(catalog) {
|
|
46
|
+
const components = Object.create(null);
|
|
47
|
+
const commonTypes = Object.create(null);
|
|
48
|
+
for (const [name, component] of catalog.components) {
|
|
49
|
+
const schema = serializeA2UISchema(component.schema, commonTypes);
|
|
50
|
+
const properties = schema.properties ?? {};
|
|
51
|
+
const required = schema.required ?? [];
|
|
52
|
+
components[name] = {
|
|
53
|
+
...typeof schema.description === "string" ? { description: schema.description } : {},
|
|
54
|
+
allOf: [{ $ref: "common_types.json#/$defs/ComponentCommon" }, {
|
|
55
|
+
properties: {
|
|
56
|
+
component: { const: name },
|
|
57
|
+
...properties
|
|
58
|
+
},
|
|
59
|
+
required: ["component", ...required]
|
|
60
|
+
}]
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
const functions = catalogFunctions(catalog.functions).map((fn) => {
|
|
64
|
+
const { description, ...parameters } = serializeA2UISchema(fn.schema, commonTypes);
|
|
65
|
+
return {
|
|
66
|
+
name: fn.name,
|
|
67
|
+
...typeof description === "string" ? { description } : {},
|
|
68
|
+
returnType: fn.returnType ?? "any",
|
|
69
|
+
parameters
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
const theme = catalog.themeSchema ? serializeA2UISchema(catalog.themeSchema, commonTypes).properties : void 0;
|
|
73
|
+
return {
|
|
74
|
+
catalogId: catalog.id,
|
|
75
|
+
components,
|
|
76
|
+
...functions.length > 0 ? { functions } : {},
|
|
77
|
+
...theme ? { theme } : {},
|
|
78
|
+
...Object.keys(commonTypes).length > 0 ? { "common_types.json": { $defs: commonTypes } } : {}
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Build a context string describing the catalog's id and the components it
|
|
83
|
+
* adds beyond the basic catalog.
|
|
84
|
+
*
|
|
85
|
+
* Schemas are serialized as in {@link extractA2UICatalogSchemas}, with the
|
|
86
|
+
* common types they reference listed once after the components.
|
|
87
|
+
*
|
|
88
|
+
* When `options.includeSchema` is `false`, custom components are listed by name
|
|
89
|
+
* only and their JSON schemas are omitted.
|
|
90
|
+
*/
|
|
91
|
+
function buildA2UICatalogContextValue(catalog, basicComponentNames, options) {
|
|
92
|
+
const lines = ["Available A2UI catalog:"];
|
|
93
|
+
if (catalog.id === A2UI_BASIC_CATALOG_ID) {
|
|
94
|
+
lines.push(`- ${catalog.id} (basic catalog)`);
|
|
95
|
+
return lines.join("\n");
|
|
96
|
+
}
|
|
97
|
+
const isSuperset = [...basicComponentNames].every((name) => catalog.components.has(name));
|
|
98
|
+
lines.push(`- ${catalog.id}`);
|
|
99
|
+
if (isSuperset) lines.push(" Extends the basic catalog with all standard components plus:");
|
|
100
|
+
else {
|
|
101
|
+
lines.push(" Custom catalog (does NOT include all basic components).");
|
|
102
|
+
lines.push(" Custom components:");
|
|
103
|
+
}
|
|
104
|
+
const commonTypes = Object.create(null);
|
|
105
|
+
for (const [name, component] of catalog.components) {
|
|
106
|
+
if (basicComponentNames.has(name)) continue;
|
|
107
|
+
if (options?.includeSchema === false) {
|
|
108
|
+
lines.push(` - ${name}`);
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
lines.push(` - ${name}:`);
|
|
112
|
+
lines.push(indented(serializeA2UISchema(component.schema, commonTypes)));
|
|
113
|
+
}
|
|
114
|
+
if (Object.keys(commonTypes).length > 0) {
|
|
115
|
+
lines.push(" Common types referenced above (common_types.json#/$defs):");
|
|
116
|
+
lines.push(indented(commonTypes));
|
|
117
|
+
}
|
|
118
|
+
return lines.join("\n");
|
|
119
|
+
}
|
|
120
|
+
/** JSON for the catalog context value, indented under a list item. */
|
|
121
|
+
function indented(value) {
|
|
122
|
+
return ` ${JSON.stringify(value, null, 2).split("\n").join("\n ")}`;
|
|
123
|
+
}
|
|
124
|
+
/** Raw zod-to-json-schema output per Zod schema, stored as JSON text. */
|
|
125
|
+
const serializedSchemas = /* @__PURE__ */ new WeakMap();
|
|
126
|
+
/**
|
|
127
|
+
* Convert one A2UI Zod schema to JSON Schema 2019-09, inlining reused schemas
|
|
128
|
+
* and resolving `REF:` markers (see {@link extractA2UICatalogSchemas}). The
|
|
129
|
+
* shapes behind `common_types.json` refs are recorded in `commonTypes`; pass
|
|
130
|
+
* the same map for every schema of one payload.
|
|
131
|
+
*
|
|
132
|
+
* The raw conversion is cached per schema object as JSON text, and every call
|
|
133
|
+
* parses a fresh copy. The JSON round-trip, unlike structuredClone, never
|
|
134
|
+
* throws on values such as a function or a Vue reactive proxy in a
|
|
135
|
+
* `.default()`, and yields exactly what the agent receives.
|
|
136
|
+
*/
|
|
137
|
+
function serializeA2UISchema(schema, commonTypes = Object.create(null)) {
|
|
138
|
+
const key = typeof schema === "object" && schema !== null ? schema : null;
|
|
139
|
+
let serialized = key ? serializedSchemas.get(key) : void 0;
|
|
140
|
+
if (serialized === void 0) {
|
|
141
|
+
const jsonSchema = zodToJsonSchema(schema, {
|
|
142
|
+
target: "jsonSchema2019-09",
|
|
143
|
+
$refStrategy: "none",
|
|
144
|
+
override: (_def, refs, seen, forceResolution) => seen && !forceResolution && seen.path.length < refs.currentPath.length && seen.path.every((part, i) => refs.currentPath[i] === part) ? {} : ignoreOverride
|
|
145
|
+
});
|
|
146
|
+
delete jsonSchema.$schema;
|
|
147
|
+
serialized = JSON.stringify(jsonSchema);
|
|
148
|
+
if (key) serializedSchemas.set(key, serialized);
|
|
149
|
+
}
|
|
150
|
+
const root = JSON.parse(serialized);
|
|
151
|
+
const marker = parseRefMarker(root.description);
|
|
152
|
+
if (marker) {
|
|
153
|
+
delete root.description;
|
|
154
|
+
if (marker.description) root.description = marker.description;
|
|
155
|
+
}
|
|
156
|
+
return resolveSubschemas(root, commonTypes);
|
|
157
|
+
}
|
|
158
|
+
/** Keywords whose value is a subschema, or an array of subschemas. */
|
|
159
|
+
const SUBSCHEMA_KEYWORDS = [
|
|
160
|
+
"items",
|
|
161
|
+
"additionalItems",
|
|
162
|
+
"additionalProperties",
|
|
163
|
+
"unevaluatedItems",
|
|
164
|
+
"unevaluatedProperties",
|
|
165
|
+
"contains",
|
|
166
|
+
"propertyNames",
|
|
167
|
+
"not",
|
|
168
|
+
"if",
|
|
169
|
+
"then",
|
|
170
|
+
"else",
|
|
171
|
+
"allOf",
|
|
172
|
+
"anyOf",
|
|
173
|
+
"oneOf",
|
|
174
|
+
"prefixItems"
|
|
175
|
+
];
|
|
176
|
+
/** Keywords whose value maps names to subschemas. */
|
|
177
|
+
const SUBSCHEMA_MAP_KEYWORDS = [
|
|
178
|
+
"properties",
|
|
179
|
+
"patternProperties",
|
|
180
|
+
"dependentSchemas",
|
|
181
|
+
"$defs",
|
|
182
|
+
"definitions"
|
|
183
|
+
];
|
|
184
|
+
const COMMON_TYPE_REF = /^common_types\.json#\/\$defs\/([^/]+)$/;
|
|
185
|
+
function isObject(value) {
|
|
186
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Split a `REF:<ref>|<description>` marker at its first `|`, so a description
|
|
190
|
+
* containing `|` is kept whole. The convention comes from
|
|
191
|
+
* `MessageProcessor.processRefs` in `@a2ui/web_core`.
|
|
192
|
+
*/
|
|
193
|
+
function parseRefMarker(description) {
|
|
194
|
+
if (typeof description !== "string" || !description.startsWith("REF:")) return;
|
|
195
|
+
const body = description.slice(4);
|
|
196
|
+
const separator = body.indexOf("|");
|
|
197
|
+
return separator === -1 ? { ref: body } : {
|
|
198
|
+
ref: body.slice(0, separator),
|
|
199
|
+
description: body.slice(separator + 1)
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Resolve `REF:` markers in a schema's subschemas, innermost first, so a
|
|
204
|
+
* stored common type refers to the types it contains by bare `$ref` too.
|
|
205
|
+
*
|
|
206
|
+
* Only schema-valued keywords are traversed, so literal values under
|
|
207
|
+
* `default`, `const`, `enum` or `examples` are never rewritten.
|
|
208
|
+
*/
|
|
209
|
+
function resolveSubschemas(node, commonTypes) {
|
|
210
|
+
const resolve = (value) => Array.isArray(value) ? value.map(resolve) : isObject(value) ? resolveRefMarker(resolveSubschemas(value, commonTypes), commonTypes) : value;
|
|
211
|
+
const out = { ...node };
|
|
212
|
+
for (const keyword of SUBSCHEMA_KEYWORDS) if (keyword in out) out[keyword] = resolve(out[keyword]);
|
|
213
|
+
for (const keyword of SUBSCHEMA_MAP_KEYWORDS) {
|
|
214
|
+
const map = out[keyword];
|
|
215
|
+
if (isObject(map)) out[keyword] = Object.fromEntries(Object.entries(map).map(([name, child]) => [name, resolve(child)]));
|
|
216
|
+
}
|
|
217
|
+
return out;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Turn a node carrying a `REF:` marker into a bare `$ref`, recording the
|
|
221
|
+
* shape it replaced under its `common_types.json` name. A shape that differs
|
|
222
|
+
* from the one already recorded, or a ref outside `common_types.json`, stays
|
|
223
|
+
* inline next to the `$ref`.
|
|
224
|
+
*/
|
|
225
|
+
function resolveRefMarker(node, commonTypes) {
|
|
226
|
+
const marker = parseRefMarker(node.description);
|
|
227
|
+
if (!marker) return node;
|
|
228
|
+
const { description: _marker, ...shape } = node;
|
|
229
|
+
const ref = {
|
|
230
|
+
$ref: marker.ref,
|
|
231
|
+
...marker.description ? { description: marker.description } : {}
|
|
232
|
+
};
|
|
233
|
+
const name = COMMON_TYPE_REF.exec(marker.ref)?.[1];
|
|
234
|
+
if (name !== void 0) {
|
|
235
|
+
const known = commonTypes[name];
|
|
236
|
+
if (known === void 0) {
|
|
237
|
+
commonTypes[name] = shape;
|
|
238
|
+
return ref;
|
|
239
|
+
}
|
|
240
|
+
if (JSON.stringify(known) === JSON.stringify(shape)) return ref;
|
|
241
|
+
}
|
|
242
|
+
return {
|
|
243
|
+
...ref,
|
|
244
|
+
...shape
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Read a catalog's functions, tolerating catalog-shaped objects whose
|
|
249
|
+
* `functions` is missing, a plain object or an array, and skipping entries
|
|
250
|
+
* without a name or schema.
|
|
251
|
+
*/
|
|
252
|
+
function catalogFunctions(functions) {
|
|
253
|
+
if (typeof functions !== "object" || functions === null) return [];
|
|
254
|
+
return (functions instanceof Map ? [...functions.values()] : Array.isArray(functions) ? functions : Object.values(functions)).filter((fn) => typeof fn === "object" && fn !== null && typeof fn.name === "string" && typeof fn.schema === "object" && fn.schema !== null);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
//#endregion
|
|
258
|
+
export { A2UI_BASIC_CATALOG_ID, A2UI_SCHEMA_CONTEXT_DESCRIPTION, buildA2UICatalogContextValue, extractA2UICatalogSchemas, serializeA2UISchema };
|
|
259
|
+
//# sourceMappingURL=a2ui-catalog-schema.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"a2ui-catalog-schema.mjs","names":[],"sources":["../src/a2ui-catalog-schema.ts"],"sourcesContent":["import { ignoreOverride, zodToJsonSchema } from \"zod-to-json-schema\";\n\n/**\n * Context description used to identify the A2UI component schema in\n * RunAgentInput.context. Must match the constant in @ag-ui/a2ui-middleware so\n * the middleware can overwrite a frontend-provided schema with a server-side one.\n */\nexport const A2UI_SCHEMA_CONTEXT_DESCRIPTION =\n \"A2UI Component Schema — available components for generating UI surfaces. Use these component names and properties when creating A2UI operations.\";\n\n/** Id of the A2UI v0.9 basic catalog. */\nexport const A2UI_BASIC_CATALOG_ID =\n \"https://a2ui.org/specification/v0_9/basic_catalog.json\";\n\ntype JsonSchema = Record<string, unknown>;\n\n/**\n * The parts of an `@a2ui/web_core` v0.9 `Catalog` that the serializers read.\n * Typed structurally so this module does not depend on web_core, and so the\n * minimal catalog-shaped objects some apps pass in still work.\n */\nexport interface A2UICatalogSchemaSource {\n readonly id: string;\n readonly components: ReadonlyMap<string, { readonly schema: unknown }>;\n /** A `ReadonlyMap` on a real `Catalog`; anything else is tolerated. */\n readonly functions?: unknown;\n readonly themeSchema?: unknown;\n}\n\n/** One entry of {@link A2UIInlineCatalogSchema.functions}. */\nexport interface A2UIFunctionSchema {\n name: string;\n description?: string;\n returnType: string;\n parameters: JsonSchema;\n}\n\n/**\n * A2UI v0.9 inline catalog, the shape of `InlineCatalog` in\n * `@a2ui/web_core/v0_9`, sent to the agent as the component schema.\n */\nexport interface A2UIInlineCatalogSchema {\n catalogId: string;\n components: Record<string, JsonSchema>;\n functions?: A2UIFunctionSchema[];\n theme?: Record<string, JsonSchema>;\n /**\n * One copy of each common type the schemas reference, so every\n * `common_types.json#/$defs/<Name>` ref resolves within this payload.\n */\n \"common_types.json\"?: { $defs: A2UICommonTypes };\n}\n\n/** Common type shapes keyed by their `common_types.json` `$defs` name. */\nexport type A2UICommonTypes = Record<string, JsonSchema>;\n\n/**\n * Serialize a catalog's Zod schemas in the A2UI v0.9 inline catalog format.\n *\n * Each component composes `ComponentCommon` with its own properties, matching\n * the flat wire format the agent must produce:\n *\n * { \"Column\": { \"allOf\": [\n * { \"$ref\": \"common_types.json#/$defs/ComponentCommon\" },\n * { \"properties\": { \"component\": {\"const\":\"Column\"}, \"gap\": ..., \"children\": ... },\n * \"required\": [\"component\"] }\n * ]}}\n *\n * This follows `getClientCapabilities` in `@a2ui/web_core` with these\n * deliberate differences:\n *\n * - Reused Zod schemas are inlined rather than emitted as local `$ref`s, which\n * would dangle once properties move under `allOf[1]`.\n * - A `REF:<ref>|<description>` marker becomes a bare `$ref`, as upstream, but\n * the shape it replaced is kept once under\n * `\"common_types.json\": { \"$defs\": { <Name>: ... } }`. Every\n * `common_types.json#/$defs/<Name>` ref therefore resolves within the\n * payload, both for agents that only see it as prompt text and for SDKs\n * (such as Google's A2UI SDK used by ADK) that read the `$ref`. Each type is\n * stated once rather than at every use site, which keeps the payload small.\n * A use whose shape differs from the stored one keeps its shape inline next\n * to the `$ref`, so the agent never sees a looser type than the client\n * accepts.\n * - A `REF:` marker on a schema's root only sets its description; replacing\n * the root would drop every property.\n * - A component's root `.describe()` is kept as the component `description`.\n * - Function parameters drop `$schema` and the description already given on\n * the function itself, to keep the prompt small.\n */\nexport function extractA2UICatalogSchemas(\n catalog: A2UICatalogSchemaSource,\n): A2UIInlineCatalogSchema {\n // Null prototypes, so a component or type named `__proto__` is kept as an\n // entry.\n const components: Record<string, JsonSchema> = Object.create(null);\n const commonTypes: A2UICommonTypes = Object.create(null);\n\n for (const [name, component] of catalog.components) {\n const schema = serializeA2UISchema(component.schema, commonTypes);\n const properties = (schema.properties ?? {}) as Record<string, JsonSchema>;\n const required = (schema.required ?? []) as string[];\n\n components[name] = {\n ...(typeof schema.description === \"string\"\n ? { description: schema.description }\n : {}),\n allOf: [\n { $ref: \"common_types.json#/$defs/ComponentCommon\" },\n {\n properties: { component: { const: name }, ...properties },\n required: [\"component\", ...required],\n },\n ],\n };\n }\n\n const functions = catalogFunctions(catalog.functions).map((fn) => {\n const { description, ...parameters } = serializeA2UISchema(\n fn.schema,\n commonTypes,\n );\n return {\n name: fn.name,\n ...(typeof description === \"string\" ? { description } : {}),\n returnType: fn.returnType ?? \"any\",\n parameters,\n };\n });\n\n const theme = catalog.themeSchema\n ? (serializeA2UISchema(catalog.themeSchema, commonTypes).properties as\n | Record<string, JsonSchema>\n | undefined)\n : undefined;\n\n return {\n catalogId: catalog.id,\n components,\n ...(functions.length > 0 ? { functions } : {}),\n ...(theme ? { theme } : {}),\n ...(Object.keys(commonTypes).length > 0\n ? { \"common_types.json\": { $defs: commonTypes } }\n : {}),\n };\n}\n\n/**\n * Build a context string describing the catalog's id and the components it\n * adds beyond the basic catalog.\n *\n * Schemas are serialized as in {@link extractA2UICatalogSchemas}, with the\n * common types they reference listed once after the components.\n *\n * When `options.includeSchema` is `false`, custom components are listed by name\n * only and their JSON schemas are omitted.\n */\nexport function buildA2UICatalogContextValue(\n catalog: A2UICatalogSchemaSource,\n basicComponentNames: ReadonlySet<string>,\n options?: { includeSchema?: boolean },\n): string {\n const lines: string[] = [\"Available A2UI catalog:\"];\n\n if (catalog.id === A2UI_BASIC_CATALOG_ID) {\n lines.push(`- ${catalog.id} (basic catalog)`);\n return lines.join(\"\\n\");\n }\n\n const isSuperset = [...basicComponentNames].every((name) =>\n catalog.components.has(name),\n );\n\n lines.push(`- ${catalog.id}`);\n if (isSuperset) {\n lines.push(\n \" Extends the basic catalog with all standard components plus:\",\n );\n } else {\n lines.push(\" Custom catalog (does NOT include all basic components).\");\n lines.push(\" Custom components:\");\n }\n\n const commonTypes: A2UICommonTypes = Object.create(null);\n\n for (const [name, component] of catalog.components) {\n if (basicComponentNames.has(name)) continue;\n if (options?.includeSchema === false) {\n lines.push(` - ${name}`);\n continue;\n }\n lines.push(` - ${name}:`);\n lines.push(indented(serializeA2UISchema(component.schema, commonTypes)));\n }\n\n if (Object.keys(commonTypes).length > 0) {\n lines.push(\" Common types referenced above (common_types.json#/$defs):\");\n lines.push(indented(commonTypes));\n }\n\n return lines.join(\"\\n\");\n}\n\n/** JSON for the catalog context value, indented under a list item. */\nfunction indented(value: unknown): string {\n return ` ${JSON.stringify(value, null, 2).split(\"\\n\").join(\"\\n \")}`;\n}\n\n/** Raw zod-to-json-schema output per Zod schema, stored as JSON text. */\nconst serializedSchemas = new WeakMap<object, string>();\n\n/**\n * zod-to-json-schema's own parameter type. Casting to it (rather than to\n * `ZodTypeAny`) avoids a TS2589 \"excessively deep\" instantiation.\n */\ntype ZodSchemaArg = Parameters<typeof zodToJsonSchema>[0];\n\n/**\n * Convert one A2UI Zod schema to JSON Schema 2019-09, inlining reused schemas\n * and resolving `REF:` markers (see {@link extractA2UICatalogSchemas}). The\n * shapes behind `common_types.json` refs are recorded in `commonTypes`; pass\n * the same map for every schema of one payload.\n *\n * The raw conversion is cached per schema object as JSON text, and every call\n * parses a fresh copy. The JSON round-trip, unlike structuredClone, never\n * throws on values such as a function or a Vue reactive proxy in a\n * `.default()`, and yields exactly what the agent receives.\n */\nexport function serializeA2UISchema(\n schema: unknown,\n commonTypes: A2UICommonTypes = Object.create(null),\n): JsonSchema {\n const key = typeof schema === \"object\" && schema !== null ? schema : null;\n let serialized = key ? serializedSchemas.get(key) : undefined;\n if (serialized === undefined) {\n const jsonSchema = zodToJsonSchema(schema as ZodSchemaArg, {\n target: \"jsonSchema2019-09\",\n $refStrategy: \"none\",\n // With \"none\", zod-to-json-schema already turns a recursive reference\n // into `{}` (any), but logs a warning every time it does. Return `{}`\n // here directly so re-serializing a recursive catalog stays quiet.\n override: (_def, refs, seen, forceResolution) =>\n seen &&\n !forceResolution &&\n seen.path.length < refs.currentPath.length &&\n seen.path.every((part, i) => refs.currentPath[i] === part)\n ? {}\n : ignoreOverride,\n }) as JsonSchema;\n delete jsonSchema.$schema;\n serialized = JSON.stringify(jsonSchema);\n if (key) serializedSchemas.set(key, serialized);\n }\n\n const root = JSON.parse(serialized) as JsonSchema;\n const marker = parseRefMarker(root.description);\n if (marker) {\n delete root.description;\n if (marker.description) root.description = marker.description;\n }\n return resolveSubschemas(root, commonTypes);\n}\n\n/** Keywords whose value is a subschema, or an array of subschemas. */\nconst SUBSCHEMA_KEYWORDS = [\n \"items\",\n \"additionalItems\",\n \"additionalProperties\",\n \"unevaluatedItems\",\n \"unevaluatedProperties\",\n \"contains\",\n \"propertyNames\",\n \"not\",\n \"if\",\n \"then\",\n \"else\",\n \"allOf\",\n \"anyOf\",\n \"oneOf\",\n \"prefixItems\",\n];\n/** Keywords whose value maps names to subschemas. */\nconst SUBSCHEMA_MAP_KEYWORDS = [\n \"properties\",\n \"patternProperties\",\n \"dependentSchemas\",\n \"$defs\",\n \"definitions\",\n];\n\nconst COMMON_TYPE_REF = /^common_types\\.json#\\/\\$defs\\/([^/]+)$/;\n\nfunction isObject(value: unknown): value is JsonSchema {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/**\n * Split a `REF:<ref>|<description>` marker at its first `|`, so a description\n * containing `|` is kept whole. The convention comes from\n * `MessageProcessor.processRefs` in `@a2ui/web_core`.\n */\nfunction parseRefMarker(\n description: unknown,\n): { ref: string; description?: string } | undefined {\n if (typeof description !== \"string\" || !description.startsWith(\"REF:\")) {\n return undefined;\n }\n const body = description.slice(4);\n const separator = body.indexOf(\"|\");\n return separator === -1\n ? { ref: body }\n : { ref: body.slice(0, separator), description: body.slice(separator + 1) };\n}\n\n/**\n * Resolve `REF:` markers in a schema's subschemas, innermost first, so a\n * stored common type refers to the types it contains by bare `$ref` too.\n *\n * Only schema-valued keywords are traversed, so literal values under\n * `default`, `const`, `enum` or `examples` are never rewritten.\n */\nfunction resolveSubschemas(\n node: JsonSchema,\n commonTypes: A2UICommonTypes,\n): JsonSchema {\n const resolve = (value: unknown): unknown =>\n Array.isArray(value)\n ? value.map(resolve)\n : isObject(value)\n ? resolveRefMarker(resolveSubschemas(value, commonTypes), commonTypes)\n : value;\n\n const out: JsonSchema = { ...node };\n for (const keyword of SUBSCHEMA_KEYWORDS) {\n if (keyword in out) out[keyword] = resolve(out[keyword]);\n }\n for (const keyword of SUBSCHEMA_MAP_KEYWORDS) {\n const map = out[keyword];\n if (isObject(map)) {\n out[keyword] = Object.fromEntries(\n Object.entries(map).map(([name, child]) => [name, resolve(child)]),\n );\n }\n }\n return out;\n}\n\n/**\n * Turn a node carrying a `REF:` marker into a bare `$ref`, recording the\n * shape it replaced under its `common_types.json` name. A shape that differs\n * from the one already recorded, or a ref outside `common_types.json`, stays\n * inline next to the `$ref`.\n */\nfunction resolveRefMarker(\n node: JsonSchema,\n commonTypes: A2UICommonTypes,\n): JsonSchema {\n const marker = parseRefMarker(node.description);\n if (!marker) return node;\n\n const { description: _marker, ...shape } = node;\n const ref: JsonSchema = {\n $ref: marker.ref,\n ...(marker.description ? { description: marker.description } : {}),\n };\n const name = COMMON_TYPE_REF.exec(marker.ref)?.[1];\n if (name !== undefined) {\n const known = commonTypes[name];\n if (known === undefined) {\n commonTypes[name] = shape;\n return ref;\n }\n if (JSON.stringify(known) === JSON.stringify(shape)) return ref;\n }\n return { ...ref, ...shape };\n}\n\ninterface CatalogFunction {\n name: string;\n returnType?: string;\n schema: unknown;\n}\n\n/**\n * Read a catalog's functions, tolerating catalog-shaped objects whose\n * `functions` is missing, a plain object or an array, and skipping entries\n * without a name or schema.\n */\nfunction catalogFunctions(functions: unknown): CatalogFunction[] {\n if (typeof functions !== \"object\" || functions === null) return [];\n const entries =\n functions instanceof Map\n ? [...functions.values()]\n : Array.isArray(functions)\n ? functions\n : Object.values(functions);\n return entries.filter(\n (fn): fn is CatalogFunction =>\n typeof fn === \"object\" &&\n fn !== null &&\n typeof fn.name === \"string\" &&\n typeof fn.schema === \"object\" &&\n fn.schema !== null,\n );\n}\n"],"mappings":";;;;;;;;AAOA,MAAa,kCACX;;AAGF,MAAa,wBACX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6EF,SAAgB,0BACd,SACyB;CAGzB,MAAM,aAAyC,OAAO,OAAO,KAAK;CAClE,MAAM,cAA+B,OAAO,OAAO,KAAK;AAExD,MAAK,MAAM,CAAC,MAAM,cAAc,QAAQ,YAAY;EAClD,MAAM,SAAS,oBAAoB,UAAU,QAAQ,YAAY;EACjE,MAAM,aAAc,OAAO,cAAc,EAAE;EAC3C,MAAM,WAAY,OAAO,YAAY,EAAE;AAEvC,aAAW,QAAQ;GACjB,GAAI,OAAO,OAAO,gBAAgB,WAC9B,EAAE,aAAa,OAAO,aAAa,GACnC,EAAE;GACN,OAAO,CACL,EAAE,MAAM,4CAA4C,EACpD;IACE,YAAY;KAAE,WAAW,EAAE,OAAO,MAAM;KAAE,GAAG;KAAY;IACzD,UAAU,CAAC,aAAa,GAAG,SAAS;IACrC,CACF;GACF;;CAGH,MAAM,YAAY,iBAAiB,QAAQ,UAAU,CAAC,KAAK,OAAO;EAChE,MAAM,EAAE,aAAa,GAAG,eAAe,oBACrC,GAAG,QACH,YACD;AACD,SAAO;GACL,MAAM,GAAG;GACT,GAAI,OAAO,gBAAgB,WAAW,EAAE,aAAa,GAAG,EAAE;GAC1D,YAAY,GAAG,cAAc;GAC7B;GACD;GACD;CAEF,MAAM,QAAQ,QAAQ,cACjB,oBAAoB,QAAQ,aAAa,YAAY,CAAC,aAGvD;AAEJ,QAAO;EACL,WAAW,QAAQ;EACnB;EACA,GAAI,UAAU,SAAS,IAAI,EAAE,WAAW,GAAG,EAAE;EAC7C,GAAI,QAAQ,EAAE,OAAO,GAAG,EAAE;EAC1B,GAAI,OAAO,KAAK,YAAY,CAAC,SAAS,IAClC,EAAE,qBAAqB,EAAE,OAAO,aAAa,EAAE,GAC/C,EAAE;EACP;;;;;;;;;;;;AAaH,SAAgB,6BACd,SACA,qBACA,SACQ;CACR,MAAM,QAAkB,CAAC,0BAA0B;AAEnD,KAAI,QAAQ,OAAO,uBAAuB;AACxC,QAAM,KAAK,KAAK,QAAQ,GAAG,kBAAkB;AAC7C,SAAO,MAAM,KAAK,KAAK;;CAGzB,MAAM,aAAa,CAAC,GAAG,oBAAoB,CAAC,OAAO,SACjD,QAAQ,WAAW,IAAI,KAAK,CAC7B;AAED,OAAM,KAAK,KAAK,QAAQ,KAAK;AAC7B,KAAI,WACF,OAAM,KACJ,iEACD;MACI;AACL,QAAM,KAAK,4DAA4D;AACvE,QAAM,KAAK,uBAAuB;;CAGpC,MAAM,cAA+B,OAAO,OAAO,KAAK;AAExD,MAAK,MAAM,CAAC,MAAM,cAAc,QAAQ,YAAY;AAClD,MAAI,oBAAoB,IAAI,KAAK,CAAE;AACnC,MAAI,SAAS,kBAAkB,OAAO;AACpC,SAAM,KAAK,OAAO,OAAO;AACzB;;AAEF,QAAM,KAAK,OAAO,KAAK,GAAG;AAC1B,QAAM,KAAK,SAAS,oBAAoB,UAAU,QAAQ,YAAY,CAAC,CAAC;;AAG1E,KAAI,OAAO,KAAK,YAAY,CAAC,SAAS,GAAG;AACvC,QAAM,KAAK,8DAA8D;AACzE,QAAM,KAAK,SAAS,YAAY,CAAC;;AAGnC,QAAO,MAAM,KAAK,KAAK;;;AAIzB,SAAS,SAAS,OAAwB;AACxC,QAAO,OAAO,KAAK,UAAU,OAAO,MAAM,EAAE,CAAC,MAAM,KAAK,CAAC,KAAK,SAAS;;;AAIzE,MAAM,oCAAoB,IAAI,SAAyB;;;;;;;;;;;;AAmBvD,SAAgB,oBACd,QACA,cAA+B,OAAO,OAAO,KAAK,EACtC;CACZ,MAAM,MAAM,OAAO,WAAW,YAAY,WAAW,OAAO,SAAS;CACrE,IAAI,aAAa,MAAM,kBAAkB,IAAI,IAAI,GAAG;AACpD,KAAI,eAAe,QAAW;EAC5B,MAAM,aAAa,gBAAgB,QAAwB;GACzD,QAAQ;GACR,cAAc;GAId,WAAW,MAAM,MAAM,MAAM,oBAC3B,QACA,CAAC,mBACD,KAAK,KAAK,SAAS,KAAK,YAAY,UACpC,KAAK,KAAK,OAAO,MAAM,MAAM,KAAK,YAAY,OAAO,KAAK,GACtD,EAAE,GACF;GACP,CAAC;AACF,SAAO,WAAW;AAClB,eAAa,KAAK,UAAU,WAAW;AACvC,MAAI,IAAK,mBAAkB,IAAI,KAAK,WAAW;;CAGjD,MAAM,OAAO,KAAK,MAAM,WAAW;CACnC,MAAM,SAAS,eAAe,KAAK,YAAY;AAC/C,KAAI,QAAQ;AACV,SAAO,KAAK;AACZ,MAAI,OAAO,YAAa,MAAK,cAAc,OAAO;;AAEpD,QAAO,kBAAkB,MAAM,YAAY;;;AAI7C,MAAM,qBAAqB;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;AAED,MAAM,yBAAyB;CAC7B;CACA;CACA;CACA;CACA;CACD;AAED,MAAM,kBAAkB;AAExB,SAAS,SAAS,OAAqC;AACrD,QAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,MAAM;;;;;;;AAQ7E,SAAS,eACP,aACmD;AACnD,KAAI,OAAO,gBAAgB,YAAY,CAAC,YAAY,WAAW,OAAO,CACpE;CAEF,MAAM,OAAO,YAAY,MAAM,EAAE;CACjC,MAAM,YAAY,KAAK,QAAQ,IAAI;AACnC,QAAO,cAAc,KACjB,EAAE,KAAK,MAAM,GACb;EAAE,KAAK,KAAK,MAAM,GAAG,UAAU;EAAE,aAAa,KAAK,MAAM,YAAY,EAAE;EAAE;;;;;;;;;AAU/E,SAAS,kBACP,MACA,aACY;CACZ,MAAM,WAAW,UACf,MAAM,QAAQ,MAAM,GAChB,MAAM,IAAI,QAAQ,GAClB,SAAS,MAAM,GACb,iBAAiB,kBAAkB,OAAO,YAAY,EAAE,YAAY,GACpE;CAER,MAAM,MAAkB,EAAE,GAAG,MAAM;AACnC,MAAK,MAAM,WAAW,mBACpB,KAAI,WAAW,IAAK,KAAI,WAAW,QAAQ,IAAI,SAAS;AAE1D,MAAK,MAAM,WAAW,wBAAwB;EAC5C,MAAM,MAAM,IAAI;AAChB,MAAI,SAAS,IAAI,CACf,KAAI,WAAW,OAAO,YACpB,OAAO,QAAQ,IAAI,CAAC,KAAK,CAAC,MAAM,WAAW,CAAC,MAAM,QAAQ,MAAM,CAAC,CAAC,CACnE;;AAGL,QAAO;;;;;;;;AAST,SAAS,iBACP,MACA,aACY;CACZ,MAAM,SAAS,eAAe,KAAK,YAAY;AAC/C,KAAI,CAAC,OAAQ,QAAO;CAEpB,MAAM,EAAE,aAAa,SAAS,GAAG,UAAU;CAC3C,MAAM,MAAkB;EACtB,MAAM,OAAO;EACb,GAAI,OAAO,cAAc,EAAE,aAAa,OAAO,aAAa,GAAG,EAAE;EAClE;CACD,MAAM,OAAO,gBAAgB,KAAK,OAAO,IAAI,GAAG;AAChD,KAAI,SAAS,QAAW;EACtB,MAAM,QAAQ,YAAY;AAC1B,MAAI,UAAU,QAAW;AACvB,eAAY,QAAQ;AACpB,UAAO;;AAET,MAAI,KAAK,UAAU,MAAM,KAAK,KAAK,UAAU,MAAM,CAAE,QAAO;;AAE9D,QAAO;EAAE,GAAG;EAAK,GAAG;EAAO;;;;;;;AAc7B,SAAS,iBAAiB,WAAuC;AAC/D,KAAI,OAAO,cAAc,YAAY,cAAc,KAAM,QAAO,EAAE;AAOlE,SALE,qBAAqB,MACjB,CAAC,GAAG,UAAU,QAAQ,CAAC,GACvB,MAAM,QAAQ,UAAU,GACtB,YACA,OAAO,OAAO,UAAU,EACjB,QACZ,OACC,OAAO,OAAO,YACd,OAAO,QACP,OAAO,GAAG,SAAS,YACnB,OAAO,GAAG,WAAW,YACrB,GAAG,WAAW,KACjB"}
|
package/dist/index.cjs
CHANGED
|
@@ -31,6 +31,7 @@ const require_child_refs = require('./generative-ui/child-refs.cjs');
|
|
|
31
31
|
const require_types$1 = require('./generative-ui/types.cjs');
|
|
32
32
|
const require_prompt_spec = require('./generative-ui/prompt-spec.cjs');
|
|
33
33
|
const require_a2ui_prompts = require('./a2ui-prompts.cjs');
|
|
34
|
+
const require_a2ui_catalog_schema = require('./a2ui-catalog-schema.cjs');
|
|
34
35
|
const require_a2ui_envelope = require('./a2ui-envelope.cjs');
|
|
35
36
|
const require_open_generative_ui_prompts = require('./open-generative-ui-prompts.cjs');
|
|
36
37
|
const require_validate_operation = require('./generative-ui/validate-operation.cjs');
|
|
@@ -79,6 +80,7 @@ function createLicenseContextValue(status, runtimeEntitlements) {
|
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
//#endregion
|
|
83
|
+
exports.A2UI_BASIC_CATALOG_ID = require_a2ui_catalog_schema.A2UI_BASIC_CATALOG_ID;
|
|
82
84
|
exports.A2UI_BASIC_FUNCTIONS = require_basic_functions.A2UI_BASIC_FUNCTIONS;
|
|
83
85
|
exports.A2UI_CHILD_LIST_MARK = require_child_refs.A2UI_CHILD_LIST_MARK;
|
|
84
86
|
exports.A2UI_CHILD_LIST_REF = require_child_refs.A2UI_CHILD_LIST_REF;
|
|
@@ -88,6 +90,7 @@ exports.A2UI_COMPONENT_ID_REF = require_child_refs.A2UI_COMPONENT_ID_REF;
|
|
|
88
90
|
exports.A2UI_DEFAULT_DESIGN_GUIDELINES = require_a2ui_prompts.A2UI_DEFAULT_DESIGN_GUIDELINES;
|
|
89
91
|
exports.A2UI_DEFAULT_GENERATION_GUIDELINES = require_a2ui_prompts.A2UI_DEFAULT_GENERATION_GUIDELINES;
|
|
90
92
|
exports.A2UI_INDEX_FUNCTION = require_basic_functions.A2UI_INDEX_FUNCTION;
|
|
93
|
+
exports.A2UI_SCHEMA_CONTEXT_DESCRIPTION = require_a2ui_catalog_schema.A2UI_SCHEMA_CONTEXT_DESCRIPTION;
|
|
91
94
|
exports.A2UI_VERSION = require_types$1.A2UI_VERSION;
|
|
92
95
|
exports.AG_UI_CHANNEL_EVENT = require_index$1.AG_UI_CHANNEL_EVENT;
|
|
93
96
|
exports.ALL_GENERATIVE_UI_GUIDE_FEATURES = require_a2ui_prompts.ALL_GENERATIVE_UI_GUIDE_FEATURES;
|
|
@@ -155,6 +158,7 @@ exports.UpgradeRequiredError = require_errors.UpgradeRequiredError;
|
|
|
155
158
|
exports.actionParametersToJsonSchema = require_json_schema.actionParametersToJsonSchema;
|
|
156
159
|
exports.applyChildRefMarks = require_child_refs.applyChildRefMarks;
|
|
157
160
|
exports.applyDescriptionOverrides = require_schema_render.applyDescriptionOverrides;
|
|
161
|
+
exports.buildA2UICatalogContextValue = require_a2ui_catalog_schema.buildA2UICatalogContextValue;
|
|
158
162
|
exports.buildCompactGenerativeUISchema = require_compact_schema.buildCompactGenerativeUISchema;
|
|
159
163
|
exports.buildGenerativeUIMarkdownGuidelines = require_a2ui_prompts.buildGenerativeUIMarkdownGuidelines;
|
|
160
164
|
exports.buildGenerativeUIPrompt = require_prompt.buildGenerativeUIPrompt;
|
|
@@ -177,6 +181,7 @@ exports.ensureStructuredError = require_errors.ensureStructuredError;
|
|
|
177
181
|
exports.envelopeToManifest = require_a2ui_envelope.envelopeToManifest;
|
|
178
182
|
exports.exceedsMaxSize = require_utils.exceedsMaxSize;
|
|
179
183
|
exports.executeConditions = require_conditions.executeConditions;
|
|
184
|
+
exports.extractA2UICatalogSchemas = require_a2ui_catalog_schema.extractA2UICatalogSchemas;
|
|
180
185
|
exports.extractRenderUIArgs = require_render_ui_args.extractRenderUIArgs;
|
|
181
186
|
exports.finalizeRunEvents = require_finalize_events.finalizeRunEvents;
|
|
182
187
|
exports.firstNonBlankTelemetryId = require_lambda_client.firstNonBlankTelemetryId;
|
|
@@ -238,6 +243,7 @@ exports.safeParseToolArgs = require_index.safeParseToolArgs;
|
|
|
238
243
|
exports.schemaCoverage = require_schema_render.schemaCoverage;
|
|
239
244
|
exports.schemaToJsonSchema = require_standard_schema.schemaToJsonSchema;
|
|
240
245
|
exports.selectPromptItems = require_prompt_spec.selectPromptItems;
|
|
246
|
+
exports.serializeA2UISchema = require_a2ui_catalog_schema.serializeA2UISchema;
|
|
241
247
|
exports.shouldEnableInspector = require_inspector_visibility.shouldEnableInspector;
|
|
242
248
|
exports.stripIntelligenceRoutingFields = require_intelligence_routing_fields.stripIntelligenceRoutingFields;
|
|
243
249
|
exports.styledConsole = require_console_styling.styledConsole;
|
package/dist/index.cjs.map
CHANGED
|
@@ -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 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\";\n"],"mappings":"
|
|
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\";\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
|
@@ -36,6 +36,7 @@ import { A2UIAllowedCallers, A2UIBasicFunctionInfo, A2UIFunctionPermissions, A2U
|
|
|
36
36
|
import { A2UIActionMessage, A2UIComponentNode, A2UIFunctionCall, A2UIOperation, A2UI_COMPONENT_ENVELOPE_KEYS, A2UI_VERSION, GENERATIVE_UI_ACTIVITY_TYPE, GENERATIVE_UI_AGENT_FUNCTION_CALLS, GENERATIVE_UI_AGENT_FUNCTION_CALLS_OFF_REASON, GENERATIVE_UI_CHAT_TARGET, GENERATIVE_UI_FUNCTION_CALL_ACTIVITY_TYPE, GENERATIVE_UI_MAX_REJECTION_LENGTH, GENERATIVE_UI_MAX_SUMMARY_REJECTIONS, GENERATIVE_UI_MAX_TARGET_COMPONENTS, GENERATIVE_UI_RENDER_TOOL, GENERATIVE_UI_ROOT_ID, GenerativeUIActionBinding, GenerativeUIComponentManifest, GenerativeUIFunctionCallContent, GenerativeUIFunctionManifest, GenerativeUIJSONSchema, GenerativeUIManifest, GenerativeUIRejectedOperation, GenerativeUISurfaceContent, GenerativeUISurfaceStatus, GenerativeUISurfaceSummary, GenerativeUITarget, GenerativeUITemplateChildren, GenerativeUIUserEvent, generativeUIFunctionCallMessageId, generativeUISurfaceMessageId, toA2UIActionMessage } from "./generative-ui/types.cjs";
|
|
37
37
|
import { GENERATIVE_UI_MARKDOWN_WHEN_TO_SHOW, GENERATIVE_UI_WHEN_TO_SHOW, GUIDE_COMPONENTS, GenerativeUIPromptFeature, GenerativeUIPromptFeatures, GenerativeUIPromptItem, GenerativeUIPromptSection, GenerativeUIPromptSpec, GenerativeUISchemaSettings, defaultGenerativeUIPromptSpec, generativeUIPromptFeatures, selectPromptItems } from "./generative-ui/prompt-spec.cjs";
|
|
38
38
|
import { A2UI_DEFAULT_DESIGN_GUIDELINES, A2UI_DEFAULT_GENERATION_GUIDELINES, ALL_GENERATIVE_UI_GUIDE_FEATURES, GENERATIVE_UI_MARKDOWN_GUIDELINES, GENERATIVE_UI_MARKDOWN_GUIDELINES_DESCRIPTION, GENERATIVE_UI_MARKDOWN_SCHEMA_CONTEXT_DESCRIPTION, GenerativeUIGuideFeatures, buildGenerativeUIMarkdownGuidelines, generativeUIGuideFeatures } from "./a2ui-prompts.cjs";
|
|
39
|
+
import { A2UICatalogSchemaSource, A2UICommonTypes, A2UIFunctionSchema, A2UIInlineCatalogSchema, A2UI_BASIC_CATALOG_ID, A2UI_SCHEMA_CONTEXT_DESCRIPTION, buildA2UICatalogContextValue, extractA2UICatalogSchemas, serializeA2UISchema } from "./a2ui-catalog-schema.cjs";
|
|
39
40
|
import { COPILOTKIT_FORWARDED_PROPS_KEY, COPILOTKIT_UI_ENVELOPE_FORMAT, CopilotKitUIEnvelope, envelopeToManifest, readCopilotKitUIEnvelope } from "./a2ui-envelope.cjs";
|
|
40
41
|
import { DebugEventEnvelope } from "./debug-event-envelope.cjs";
|
|
41
42
|
import { GENERATE_SANDBOXED_UI_DESCRIPTION } from "./open-generative-ui-prompts.cjs";
|
|
@@ -79,5 +80,5 @@ interface LicenseContextValue {
|
|
|
79
80
|
*/
|
|
80
81
|
declare function createLicenseContextValue(status: RuntimeLicenseStatus | null | undefined, runtimeEntitlements?: RuntimeEntitlementResponse): LicenseContextValue;
|
|
81
82
|
//#endregion
|
|
82
|
-
export { A2UIActionMessage, A2UIAllowedCallers, A2UIBasicFunctionInfo, A2UIComponentNode, A2UIFunctionCall, A2UIFunctionPermissions, A2UIFunctionReturnType, A2UIOperation, A2UIRuntimeInfo, 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_DEFAULT_DESIGN_GUIDELINES, A2UI_DEFAULT_GENERATION_GUIDELINES, A2UI_INDEX_FUNCTION, 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, buildCompactGenerativeUISchema, buildGenerativeUIMarkdownGuidelines, buildGenerativeUIPrompt, callerProblem, childIdsAtRefs, childRefKind, classifyModelHost, collectChildRefs, commitRowKeyStore, computeSamplingMeta, convertJsonSchemaToZodSchema, copyToClipboard, createAttachmentContent, createLicenseContextValue, createRowKeyStore, createRunEventFinalizer, dataToUUID, defaultGenerativeUIPromptSpec, ensureStructuredError, envelopeToManifest, exceedsMaxSize, executeConditions, 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, shouldEnableInspector, stripIntelligenceRoutingFields, styledConsole, toA2UIActionMessage, tryMap, validateOperation };
|
|
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 };
|
|
83
84
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":"
|
|
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
|
@@ -36,6 +36,7 @@ import { A2UIAllowedCallers, A2UIBasicFunctionInfo, A2UIFunctionPermissions, A2U
|
|
|
36
36
|
import { A2UIActionMessage, A2UIComponentNode, A2UIFunctionCall, A2UIOperation, A2UI_COMPONENT_ENVELOPE_KEYS, A2UI_VERSION, GENERATIVE_UI_ACTIVITY_TYPE, GENERATIVE_UI_AGENT_FUNCTION_CALLS, GENERATIVE_UI_AGENT_FUNCTION_CALLS_OFF_REASON, GENERATIVE_UI_CHAT_TARGET, GENERATIVE_UI_FUNCTION_CALL_ACTIVITY_TYPE, GENERATIVE_UI_MAX_REJECTION_LENGTH, GENERATIVE_UI_MAX_SUMMARY_REJECTIONS, GENERATIVE_UI_MAX_TARGET_COMPONENTS, GENERATIVE_UI_RENDER_TOOL, GENERATIVE_UI_ROOT_ID, GenerativeUIActionBinding, GenerativeUIComponentManifest, GenerativeUIFunctionCallContent, GenerativeUIFunctionManifest, GenerativeUIJSONSchema, GenerativeUIManifest, GenerativeUIRejectedOperation, GenerativeUISurfaceContent, GenerativeUISurfaceStatus, GenerativeUISurfaceSummary, GenerativeUITarget, GenerativeUITemplateChildren, GenerativeUIUserEvent, generativeUIFunctionCallMessageId, generativeUISurfaceMessageId, toA2UIActionMessage } from "./generative-ui/types.mjs";
|
|
37
37
|
import { GENERATIVE_UI_MARKDOWN_WHEN_TO_SHOW, GENERATIVE_UI_WHEN_TO_SHOW, GUIDE_COMPONENTS, GenerativeUIPromptFeature, GenerativeUIPromptFeatures, GenerativeUIPromptItem, GenerativeUIPromptSection, GenerativeUIPromptSpec, GenerativeUISchemaSettings, defaultGenerativeUIPromptSpec, generativeUIPromptFeatures, selectPromptItems } from "./generative-ui/prompt-spec.mjs";
|
|
38
38
|
import { A2UI_DEFAULT_DESIGN_GUIDELINES, A2UI_DEFAULT_GENERATION_GUIDELINES, ALL_GENERATIVE_UI_GUIDE_FEATURES, GENERATIVE_UI_MARKDOWN_GUIDELINES, GENERATIVE_UI_MARKDOWN_GUIDELINES_DESCRIPTION, GENERATIVE_UI_MARKDOWN_SCHEMA_CONTEXT_DESCRIPTION, GenerativeUIGuideFeatures, buildGenerativeUIMarkdownGuidelines, generativeUIGuideFeatures } from "./a2ui-prompts.mjs";
|
|
39
|
+
import { A2UICatalogSchemaSource, A2UICommonTypes, A2UIFunctionSchema, A2UIInlineCatalogSchema, A2UI_BASIC_CATALOG_ID, A2UI_SCHEMA_CONTEXT_DESCRIPTION, buildA2UICatalogContextValue, extractA2UICatalogSchemas, serializeA2UISchema } from "./a2ui-catalog-schema.mjs";
|
|
39
40
|
import { COPILOTKIT_FORWARDED_PROPS_KEY, COPILOTKIT_UI_ENVELOPE_FORMAT, CopilotKitUIEnvelope, envelopeToManifest, readCopilotKitUIEnvelope } from "./a2ui-envelope.mjs";
|
|
40
41
|
import { DebugEventEnvelope } from "./debug-event-envelope.mjs";
|
|
41
42
|
import { GENERATE_SANDBOXED_UI_DESCRIPTION } from "./open-generative-ui-prompts.mjs";
|
|
@@ -79,5 +80,5 @@ interface LicenseContextValue {
|
|
|
79
80
|
*/
|
|
80
81
|
declare function createLicenseContextValue(status: RuntimeLicenseStatus | null | undefined, runtimeEntitlements?: RuntimeEntitlementResponse): LicenseContextValue;
|
|
81
82
|
//#endregion
|
|
82
|
-
export { A2UIActionMessage, A2UIAllowedCallers, A2UIBasicFunctionInfo, A2UIComponentNode, A2UIFunctionCall, A2UIFunctionPermissions, A2UIFunctionReturnType, A2UIOperation, A2UIRuntimeInfo, 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_DEFAULT_DESIGN_GUIDELINES, A2UI_DEFAULT_GENERATION_GUIDELINES, A2UI_INDEX_FUNCTION, 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, buildCompactGenerativeUISchema, buildGenerativeUIMarkdownGuidelines, buildGenerativeUIPrompt, callerProblem, childIdsAtRefs, childRefKind, classifyModelHost, collectChildRefs, commitRowKeyStore, computeSamplingMeta, convertJsonSchemaToZodSchema, copyToClipboard, createAttachmentContent, createLicenseContextValue, createRowKeyStore, createRunEventFinalizer, dataToUUID, defaultGenerativeUIPromptSpec, ensureStructuredError, envelopeToManifest, exceedsMaxSize, executeConditions, 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, shouldEnableInspector, stripIntelligenceRoutingFields, styledConsole, toA2UIActionMessage, tryMap, validateOperation };
|
|
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 };
|
|
83
84
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":"
|
|
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
|
@@ -30,6 +30,7 @@ import { A2UI_CHILD_LIST_MARK, A2UI_CHILD_LIST_REF, A2UI_COMPONENT_ID_MARK, A2UI
|
|
|
30
30
|
import { A2UI_COMPONENT_ENVELOPE_KEYS, A2UI_VERSION, GENERATIVE_UI_ACTIVITY_TYPE, GENERATIVE_UI_AGENT_FUNCTION_CALLS, GENERATIVE_UI_AGENT_FUNCTION_CALLS_OFF_REASON, GENERATIVE_UI_CHAT_TARGET, GENERATIVE_UI_FUNCTION_CALL_ACTIVITY_TYPE, GENERATIVE_UI_MAX_REJECTION_LENGTH, GENERATIVE_UI_MAX_SUMMARY_REJECTIONS, GENERATIVE_UI_MAX_TARGET_COMPONENTS, GENERATIVE_UI_RENDER_TOOL, GENERATIVE_UI_ROOT_ID, generativeUIFunctionCallMessageId, generativeUISurfaceMessageId, toA2UIActionMessage } from "./generative-ui/types.mjs";
|
|
31
31
|
import { GENERATIVE_UI_MARKDOWN_WHEN_TO_SHOW, GENERATIVE_UI_WHEN_TO_SHOW, GUIDE_COMPONENTS, defaultGenerativeUIPromptSpec, generativeUIPromptFeatures, selectPromptItems } from "./generative-ui/prompt-spec.mjs";
|
|
32
32
|
import { A2UI_DEFAULT_DESIGN_GUIDELINES, A2UI_DEFAULT_GENERATION_GUIDELINES, ALL_GENERATIVE_UI_GUIDE_FEATURES, GENERATIVE_UI_MARKDOWN_GUIDELINES, GENERATIVE_UI_MARKDOWN_GUIDELINES_DESCRIPTION, GENERATIVE_UI_MARKDOWN_SCHEMA_CONTEXT_DESCRIPTION, buildGenerativeUIMarkdownGuidelines, generativeUIGuideFeatures } from "./a2ui-prompts.mjs";
|
|
33
|
+
import { A2UI_BASIC_CATALOG_ID, A2UI_SCHEMA_CONTEXT_DESCRIPTION, buildA2UICatalogContextValue, extractA2UICatalogSchemas, serializeA2UISchema } from "./a2ui-catalog-schema.mjs";
|
|
33
34
|
import { COPILOTKIT_FORWARDED_PROPS_KEY, COPILOTKIT_UI_ENVELOPE_FORMAT, envelopeToManifest, readCopilotKitUIEnvelope } from "./a2ui-envelope.mjs";
|
|
34
35
|
import { GENERATE_SANDBOXED_UI_DESCRIPTION } from "./open-generative-ui-prompts.mjs";
|
|
35
36
|
import { callerProblem, getOperationKind, getOperationSurfaceId, isActionBinding, isIndexCall, isPathBinding, validateOperation } from "./generative-ui/validate-operation.mjs";
|
|
@@ -78,5 +79,5 @@ function createLicenseContextValue(status, runtimeEntitlements) {
|
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
//#endregion
|
|
81
|
-
export { 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_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, buildCompactGenerativeUISchema, buildGenerativeUIMarkdownGuidelines, buildGenerativeUIPrompt, callerProblem, childIdsAtRefs, childRefKind, classifyModelHost, collectChildRefs, commitRowKeyStore, computeSamplingMeta, convertJsonSchemaToZodSchema, copyToClipboard, createAttachmentContent, createLicenseContextValue, createRowKeyStore, createRunEventFinalizer, dataToUUID, defaultGenerativeUIPromptSpec, ensureStructuredError, envelopeToManifest, exceedsMaxSize, executeConditions, 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, shouldEnableInspector, stripIntelligenceRoutingFields, styledConsole, toA2UIActionMessage, tryMap, validateOperation };
|
|
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 };
|
|
82
83
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["packageJson.version"],"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 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\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["packageJson.version"],"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\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,MAAa,qBAAqBA;;AA0ClC,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"}
|