@assistant-ui/react-generative-ui 0.0.18 → 0.0.20
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/JSONGenerativeUI.client.d.ts +15 -17
- package/dist/JSONGenerativeUI.client.d.ts.map +1 -1
- package/dist/JSONGenerativeUI.client.js +28 -8
- package/dist/JSONGenerativeUI.client.js.map +1 -1
- package/dist/JSONGenerativeUI.server.d.ts +6 -9
- package/dist/JSONGenerativeUI.server.d.ts.map +1 -1
- package/dist/JSONGenerativeUI.shared.d.ts +42 -44
- package/dist/JSONGenerativeUI.shared.d.ts.map +1 -1
- package/dist/a2ui/convert.d.ts +7 -8
- package/dist/a2ui/convert.d.ts.map +1 -1
- package/dist/a2ui/convert.js +115 -16
- package/dist/a2ui/convert.js.map +1 -1
- package/dist/a2ui/reducer.d.ts +2 -5
- package/dist/a2ui/reducer.d.ts.map +1 -1
- package/dist/a2ui/reducer.js +8 -0
- package/dist/a2ui/reducer.js.map +1 -1
- package/dist/a2ui/snapshot.d.ts +3 -0
- package/dist/a2ui/snapshot.d.ts.map +1 -0
- package/dist/a2ui/snapshot.js +33 -0
- package/dist/a2ui/snapshot.js.map +1 -0
- package/dist/a2ui/types.d.ts +67 -58
- package/dist/a2ui/types.d.ts.map +1 -1
- package/dist/a2ui/types.js.map +1 -1
- package/dist/a2ui.d.ts +5 -4
- package/dist/a2ui.d.ts.map +1 -0
- package/dist/a2ui.js +2 -1
- package/dist/actionRegistry.d.ts +17 -20
- package/dist/actionRegistry.d.ts.map +1 -1
- package/dist/actionRegistry.js.map +1 -1
- package/dist/buildPresentParameters.d.ts +3 -6
- package/dist/buildPresentParameters.d.ts.map +1 -1
- package/dist/buildPresentParameters.js +16 -4
- package/dist/buildPresentParameters.js.map +1 -1
- package/dist/constants.d.ts +2 -4
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +2 -1
- package/dist/constants.js.map +1 -1
- package/dist/convert/boundSpec.d.ts +7 -10
- package/dist/convert/boundSpec.d.ts.map +1 -1
- package/dist/convert/copyBounded.d.ts +3 -6
- package/dist/convert/copyBounded.d.ts.map +1 -1
- package/dist/convert/isElement.d.ts +2 -5
- package/dist/convert/isElement.d.ts.map +1 -1
- package/dist/convert/takeRun.d.ts +4 -7
- package/dist/convert/takeRun.d.ts.map +1 -1
- package/dist/defineGenerativeComponents.d.ts +2 -5
- package/dist/defineGenerativeComponents.d.ts.map +1 -1
- package/dist/generativeUIToJSX.d.ts +6 -9
- package/dist/generativeUIToJSX.d.ts.map +1 -1
- package/dist/index.d.ts +3 -13
- package/dist/index.d.ts.map +1 -0
- package/dist/index.server.d.ts +3 -13
- package/dist/index.server.d.ts.map +1 -0
- package/dist/index.shared.d.ts +15 -11
- package/dist/index.shared.d.ts.map +1 -0
- package/dist/ir.d.ts +45 -48
- package/dist/ir.d.ts.map +1 -1
- package/dist/renderGenerativeUI.d.ts +3 -6
- package/dist/renderGenerativeUI.d.ts.map +1 -1
- package/dist/scopeSchema.d.ts +6 -0
- package/dist/scopeSchema.d.ts.map +1 -0
- package/dist/scopeSchema.js +56 -0
- package/dist/scopeSchema.js.map +1 -0
- package/dist/slack/constants.d.ts +43 -45
- package/dist/slack/constants.d.ts.map +1 -1
- package/dist/slack/decodeBlockAction.d.ts +2 -5
- package/dist/slack/decodeBlockAction.d.ts.map +1 -1
- package/dist/slack/fromSlackBlocks.d.ts +2 -5
- package/dist/slack/fromSlackBlocks.d.ts.map +1 -1
- package/dist/slack/toSlackBlocks.d.ts +2 -5
- package/dist/slack/toSlackBlocks.d.ts.map +1 -1
- package/dist/slack/toSlackBlocks.js +1 -1
- package/dist/slack/types.d.ts +110 -113
- package/dist/slack/types.d.ts.map +1 -1
- package/dist/slack.d.ts +5 -5
- package/dist/slack.d.ts.map +1 -0
- package/dist/teams/constants.d.ts +15 -18
- package/dist/teams/constants.d.ts.map +1 -1
- package/dist/teams/decodeSubmitData.d.ts +2 -5
- package/dist/teams/decodeSubmitData.d.ts.map +1 -1
- package/dist/teams/toAdaptiveCard.d.ts +10 -13
- package/dist/teams/toAdaptiveCard.d.ts.map +1 -1
- package/dist/teams/toTeamsAttachments.d.ts +2 -5
- package/dist/teams/toTeamsAttachments.d.ts.map +1 -1
- package/dist/teams/types.d.ts +136 -138
- package/dist/teams/types.d.ts.map +1 -1
- package/dist/teams.d.ts +5 -5
- package/dist/teams.d.ts.map +1 -0
- package/dist/types.d.ts +45 -47
- package/dist/types.d.ts.map +1 -1
- package/dist/vocabulary/alert.d.ts +22 -25
- package/dist/vocabulary/alert.d.ts.map +1 -1
- package/dist/vocabulary/collectFormValues.d.ts +12 -13
- package/dist/vocabulary/collectFormValues.d.ts.map +1 -1
- package/dist/vocabulary/collectFormValues.js +3 -2
- package/dist/vocabulary/collectFormValues.js.map +1 -1
- package/dist/vocabulary/data.d.ts +46 -49
- package/dist/vocabulary/data.d.ts.map +1 -1
- package/dist/vocabulary/dispatch.d.ts +4 -7
- package/dist/vocabulary/dispatch.d.ts.map +1 -1
- package/dist/vocabulary/fact.d.ts +9 -12
- package/dist/vocabulary/fact.d.ts.map +1 -1
- package/dist/vocabulary/form.d.ts +8 -11
- package/dist/vocabulary/form.d.ts.map +1 -1
- package/dist/vocabulary/icon.d.ts +38 -41
- package/dist/vocabulary/icon.d.ts.map +1 -1
- package/dist/vocabulary/index.d.ts +2 -5
- package/dist/vocabulary/index.d.ts.map +1 -1
- package/dist/vocabulary/interactive.d.ts +88 -87
- package/dist/vocabulary/interactive.d.ts.map +1 -1
- package/dist/vocabulary/interactive.js +6 -4
- package/dist/vocabulary/interactive.js.map +1 -1
- package/dist/vocabulary/layout.d.ts +76 -79
- package/dist/vocabulary/layout.d.ts.map +1 -1
- package/dist/vocabulary/list.d.ts +11 -14
- package/dist/vocabulary/list.d.ts.map +1 -1
- package/dist/vocabulary/media.d.ts +22 -25
- package/dist/vocabulary/media.d.ts.map +1 -1
- package/dist/vocabulary/text.d.ts +54 -57
- package/dist/vocabulary/text.d.ts.map +1 -1
- package/dist/vocabulary/toTextContent.d.ts +1 -4
- package/dist/vocabulary/toTextContent.d.ts.map +1 -1
- package/package.json +12 -10
- package/src/JSONGenerativeUI.client.tsx +57 -15
- package/src/JSONGenerativeUI.test.tsx +298 -4
- package/src/a2ui/convert.test.ts +496 -0
- package/src/a2ui/convert.ts +170 -25
- package/src/a2ui/reducer.test.ts +18 -0
- package/src/a2ui/reducer.ts +16 -0
- package/src/a2ui/snapshot.test.ts +52 -0
- package/src/a2ui/snapshot.ts +52 -0
- package/src/a2ui/types.ts +16 -0
- package/src/a2ui.ts +2 -0
- package/src/actionRegistry.ts +5 -5
- package/src/buildPresentParameters.test.ts +246 -0
- package/src/buildPresentParameters.ts +18 -3
- package/src/constants.ts +2 -0
- package/src/scopeSchema.test.ts +72 -0
- package/src/scopeSchema.ts +71 -0
- package/src/slack/fromSlackBlocks.test.ts +4 -1
- package/src/slack/toSlackBlocks.test.ts +8 -4
- package/src/teams/toAdaptiveCard.test.ts +5 -3
- package/src/vocabulary/collectFormValues.test.ts +38 -0
- package/src/vocabulary/collectFormValues.ts +11 -2
- package/src/vocabulary/form.test.tsx +1 -0
- package/src/vocabulary/interactive.dispatch.test.tsx +17 -3
- package/src/vocabulary/interactive.test.tsx +33 -1
- package/src/vocabulary/interactive.tsx +12 -2
- package/src/vocabulary/layout.test.tsx +1 -0
- package/src/vocabulary/list.test.tsx +5 -4
- package/dist/node_modules/.pnpm/@types_json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts +0 -141
- package/dist/node_modules/.pnpm/@types_json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts.map +0 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { JSONSchema7 } from "
|
|
2
|
-
import { GenerativeUILibrary } from "./types.js";
|
|
3
|
-
//#region src/buildPresentParameters.d.ts
|
|
1
|
+
import type { JSONSchema7 } from "json-schema";
|
|
2
|
+
import type { GenerativeUILibrary } from "./types.js";
|
|
4
3
|
/**
|
|
5
4
|
* Builds the JSON schema for the `present` tool from a {@link GenerativeUILibrary}.
|
|
6
5
|
*
|
|
@@ -18,7 +17,5 @@ import { GenerativeUILibrary } from "./types.js";
|
|
|
18
17
|
* renderer validates nothing here — an unknown `$type` or stray prop is handled
|
|
19
18
|
* at render time — so a looser schema only costs the model a hint, not safety.
|
|
20
19
|
*/
|
|
21
|
-
declare function buildPresentParameters(library: GenerativeUILibrary): JSONSchema7;
|
|
22
|
-
//#endregion
|
|
23
|
-
export { buildPresentParameters };
|
|
20
|
+
export declare function buildPresentParameters(library: GenerativeUILibrary): JSONSchema7;
|
|
24
21
|
//# sourceMappingURL=buildPresentParameters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildPresentParameters.d.ts","
|
|
1
|
+
{"version":3,"file":"buildPresentParameters.d.ts","sourceRoot":"","sources":["../src/buildPresentParameters.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAyB,MAAM,aAAa,CAAC;AAEtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAgB;AAGnD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,mBAAmB,GAC3B,WAAW,CA+Fb"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TYPE_KEY } from "./constants.js";
|
|
2
|
+
import { scopeSchema } from "./scopeSchema.js";
|
|
2
3
|
import { toJSONSchema } from "assistant-stream";
|
|
3
4
|
//#region src/buildPresentParameters.ts
|
|
4
5
|
/**
|
|
@@ -22,15 +23,25 @@ function buildPresentParameters(library) {
|
|
|
22
23
|
const names = Object.keys(library);
|
|
23
24
|
const props = /* @__PURE__ */ new Map();
|
|
24
25
|
const propOwners = /* @__PURE__ */ new Map();
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
const componentSchemas = {};
|
|
27
|
+
for (const [index, name] of names.entries()) {
|
|
28
|
+
const definition = `component${index}`;
|
|
29
|
+
const { schema: propsSchema, referenced } = scopeSchema(toJSONSchema(library[name].properties), `#/$defs/${definition}`);
|
|
27
30
|
if (propsSchema.type !== "object") throw new Error(`[@assistant-ui/react-generative-ui] Component "${name}": \`properties\` must be an object schema (e.g. \`z.object({ ... })\`).`);
|
|
31
|
+
let merged = false;
|
|
28
32
|
for (const [key, schema] of Object.entries(propsSchema.properties ?? {})) {
|
|
29
33
|
if (key.startsWith("$") || key === "children") continue;
|
|
30
34
|
if (key === "__proto__") continue;
|
|
31
|
-
if (!props.has(key))
|
|
35
|
+
if (!props.has(key)) {
|
|
36
|
+
props.set(key, schema);
|
|
37
|
+
merged = true;
|
|
38
|
+
}
|
|
32
39
|
propOwners.set(key, [...propOwners.get(key) ?? [], name]);
|
|
33
40
|
}
|
|
41
|
+
if (referenced && merged) {
|
|
42
|
+
const { $schema: _, $id: _id, ...embedded } = propsSchema;
|
|
43
|
+
componentSchemas[definition] = embedded;
|
|
44
|
+
}
|
|
34
45
|
}
|
|
35
46
|
if (process.env["NODE_ENV"] !== "production") for (const [key, owners] of propOwners) {
|
|
36
47
|
if (owners.length < 2) continue;
|
|
@@ -69,7 +80,8 @@ function buildPresentParameters(library) {
|
|
|
69
80
|
...node,
|
|
70
81
|
$defs: {
|
|
71
82
|
node,
|
|
72
|
-
children
|
|
83
|
+
children,
|
|
84
|
+
...componentSchemas
|
|
73
85
|
}
|
|
74
86
|
};
|
|
75
87
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildPresentParameters.js","names":[],"sources":["../src/buildPresentParameters.ts"],"sourcesContent":["import { toJSONSchema } from \"assistant-stream\";\nimport type { JSONSchema7, JSONSchema7Definition } from \"json-schema\";\nimport { TYPE_KEY } from \"./constants\";\nimport type { GenerativeUILibrary } from \"./types\";\n\n/**\n * Builds the JSON schema for the `present` tool from a {@link GenerativeUILibrary}.\n *\n * The model produces a node `{ $type, $key?, ...props }` where `$type` selects\n * a component, the optional `$key` pins a stable identity for list items that\n * may reorder, and the rest are its props. The schema is a flat object: `$type`\n * is an enum of the component names, every component's props are merged into\n * one optional bag, and `children` recurses via `$defs` so the tree can nest.\n *\n * It is intentionally flat rather than a per-`$type` discriminated union. Tool /\n * function-call schemas (OpenAI and others) require the top-level parameters to\n * be a plain object and reject a top-level `oneOf`/`anyOf`/`enum`. So props can't\n * be refined per `$type` at the root; the model is guided instead by `$type`'s\n * description (which lists each component) and each prop's own description. The\n * renderer validates nothing here — an unknown `$type` or stray prop is handled\n * at render time — so a looser schema only costs the model a hint, not safety.\n */\nexport function buildPresentParameters(\n library: GenerativeUILibrary,\n): JSONSchema7 {\n const names = Object.keys(library);\n\n // Merge every component's props into one optional bag. `$`-prefixed keys and\n // `children` are framework-reserved (see ir.ts), so drop any author-declared\n // copies. On a name clash the first component's schema wins — props are an\n // advisory hint here, not a strict per-component contract.\n const props = new Map<string, JSONSchema7Definition>();\n const propOwners = new Map<string, string[]>();\n for (const name of names) {\n const propsSchema = toJSONSchema(library[name]!.properties);\n if (propsSchema.type !== \"object\") {\n throw new Error(\n `[@assistant-ui/react-generative-ui] Component \"${name}\": ` +\n \"`properties` must be an object schema (e.g. `z.object({ ... })`).\",\n );\n }\n for (const [key, schema] of Object.entries(propsSchema.properties ?? {})) {\n if (key.startsWith(\"$\") || key === \"children\") continue;\n // secure-json-parse rejects the whole tool-argument payload on this key,\n // so advertising it would cost the model the node rather than one prop.\n if (key === \"__proto__\") continue;\n if (!props.has(key)) {\n props.set(key, schema);\n }\n propOwners.set(key, [...(propOwners.get(key) ?? []), name]);\n }\n }\n\n if (process.env[\"NODE_ENV\"] !== \"production\") {\n for (const [key, owners] of propOwners) {\n if (owners.length < 2) continue;\n // eslint-disable-next-line no-console\n console.warn(\n `[@assistant-ui/react-generative-ui] Prop \"${key}\" is declared by ` +\n `${formatComponentList(owners)}; keeping \"${owners[0]}\"'s schema. ` +\n \"Rename or align the prop type to avoid an ambiguous schema.\",\n );\n }\n }\n\n // Carry each component's description on the `$type` enum, since there are no\n // per-branch schemas to hang them on anymore.\n const typeDescription =\n names.length > 0\n ? `The component to render. ${names\n .map((name) => `\"${name}\": ${library[name]!.description}`)\n .join(\"; \")}`\n : \"The component to render.\";\n\n const node: JSONSchema7 = {\n type: \"object\",\n properties: {\n [TYPE_KEY]: { type: \"string\", enum: names, description: typeDescription },\n $key: {\n description:\n \"Stable identity for this UI node. Use it for list items that may reorder.\",\n anyOf: [{ type: \"string\" }, { type: \"number\" }],\n },\n ...Object.fromEntries(props),\n children: { $ref: \"#/$defs/children\" },\n },\n required: [TYPE_KEY],\n };\n\n const children: JSONSchema7 = {\n description: \"Nested generative UI rendered inside this component.\",\n anyOf: [\n { type: \"string\" },\n { $ref: \"#/$defs/node\" },\n {\n type: \"array\",\n items: { anyOf: [{ type: \"string\" }, { $ref: \"#/$defs/node\" }] },\n },\n ],\n };\n\n return {\n ...node,\n $defs: { node, children },\n };\n}\n\nfunction formatComponentList(names: string[]) {\n if (names.length <= 2) return names.map((name) => `\"${name}\"`).join(\" and \");\n\n return `${names\n .slice(0, -1)\n .map((name) => `\"${name}\"`)\n .join(\", \")}, and \"${names[names.length - 1]}\"`;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"buildPresentParameters.js","names":[],"sources":["../src/buildPresentParameters.ts"],"sourcesContent":["import { toJSONSchema } from \"assistant-stream\";\nimport type { JSONSchema7, JSONSchema7Definition } from \"json-schema\";\nimport { TYPE_KEY } from \"./constants\";\nimport type { GenerativeUILibrary } from \"./types\";\nimport { scopeSchema } from \"./scopeSchema\";\n\n/**\n * Builds the JSON schema for the `present` tool from a {@link GenerativeUILibrary}.\n *\n * The model produces a node `{ $type, $key?, ...props }` where `$type` selects\n * a component, the optional `$key` pins a stable identity for list items that\n * may reorder, and the rest are its props. The schema is a flat object: `$type`\n * is an enum of the component names, every component's props are merged into\n * one optional bag, and `children` recurses via `$defs` so the tree can nest.\n *\n * It is intentionally flat rather than a per-`$type` discriminated union. Tool /\n * function-call schemas (OpenAI and others) require the top-level parameters to\n * be a plain object and reject a top-level `oneOf`/`anyOf`/`enum`. So props can't\n * be refined per `$type` at the root; the model is guided instead by `$type`'s\n * description (which lists each component) and each prop's own description. The\n * renderer validates nothing here — an unknown `$type` or stray prop is handled\n * at render time — so a looser schema only costs the model a hint, not safety.\n */\nexport function buildPresentParameters(\n library: GenerativeUILibrary,\n): JSONSchema7 {\n const names = Object.keys(library);\n\n // Merge every component's props into one optional bag. `$`-prefixed keys and\n // `children` are framework-reserved (see ir.ts), so drop any author-declared\n // copies. On a name clash the first component's schema wins — props are an\n // advisory hint here, not a strict per-component contract.\n const props = new Map<string, JSONSchema7Definition>();\n const propOwners = new Map<string, string[]>();\n const componentSchemas: Record<string, JSONSchema7> = {};\n for (const [index, name] of names.entries()) {\n const definition = `component${index}`;\n const { schema: propsSchema, referenced } = scopeSchema(\n toJSONSchema(library[name]!.properties),\n `#/$defs/${definition}`,\n );\n if (propsSchema.type !== \"object\") {\n throw new Error(\n `[@assistant-ui/react-generative-ui] Component \"${name}\": ` +\n \"`properties` must be an object schema (e.g. `z.object({ ... })`).\",\n );\n }\n let merged = false;\n for (const [key, schema] of Object.entries(propsSchema.properties ?? {})) {\n if (key.startsWith(\"$\") || key === \"children\") continue;\n // secure-json-parse rejects the whole tool-argument payload on this key,\n // so advertising it would cost the model the node rather than one prop.\n if (key === \"__proto__\") continue;\n if (!props.has(key)) {\n props.set(key, schema);\n merged = true;\n }\n propOwners.set(key, [...(propOwners.get(key) ?? []), name]);\n }\n if (referenced && merged) {\n // `$schema` is only valid at a schema-resource root, and an embedded\n // `$id` would both collide across components and re-base the pointers\n // scopeSchema just rewrote to be document-root relative.\n const { $schema: _, $id: _id, ...embedded } = propsSchema;\n componentSchemas[definition] = embedded;\n }\n }\n\n if (process.env[\"NODE_ENV\"] !== \"production\") {\n for (const [key, owners] of propOwners) {\n if (owners.length < 2) continue;\n // eslint-disable-next-line no-console\n console.warn(\n `[@assistant-ui/react-generative-ui] Prop \"${key}\" is declared by ` +\n `${formatComponentList(owners)}; keeping \"${owners[0]}\"'s schema. ` +\n \"Rename or align the prop type to avoid an ambiguous schema.\",\n );\n }\n }\n\n // Carry each component's description on the `$type` enum, since there are no\n // per-branch schemas to hang them on anymore.\n const typeDescription =\n names.length > 0\n ? `The component to render. ${names\n .map((name) => `\"${name}\": ${library[name]!.description}`)\n .join(\"; \")}`\n : \"The component to render.\";\n\n const node: JSONSchema7 = {\n type: \"object\",\n properties: {\n [TYPE_KEY]: { type: \"string\", enum: names, description: typeDescription },\n $key: {\n description:\n \"Stable identity for this UI node. Use it for list items that may reorder.\",\n anyOf: [{ type: \"string\" }, { type: \"number\" }],\n },\n ...Object.fromEntries(props),\n children: { $ref: \"#/$defs/children\" },\n },\n required: [TYPE_KEY],\n };\n\n const children: JSONSchema7 = {\n description: \"Nested generative UI rendered inside this component.\",\n anyOf: [\n { type: \"string\" },\n { $ref: \"#/$defs/node\" },\n {\n type: \"array\",\n items: { anyOf: [{ type: \"string\" }, { $ref: \"#/$defs/node\" }] },\n },\n ],\n };\n\n return {\n ...node,\n $defs: { node, children, ...componentSchemas },\n };\n}\n\nfunction formatComponentList(names: string[]) {\n if (names.length <= 2) return names.map((name) => `\"${name}\"`).join(\" and \");\n\n return `${names\n .slice(0, -1)\n .map((name) => `\"${name}\"`)\n .join(\", \")}, and \"${names[names.length - 1]}\"`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuBA,SAAgB,uBACd,SACa;CACb,MAAM,QAAQ,OAAO,KAAK,OAAO;CAMjC,MAAM,wBAAQ,IAAI,IAAmC;CACrD,MAAM,6BAAa,IAAI,IAAsB;CAC7C,MAAM,mBAAgD,CAAC;CACvD,KAAK,MAAM,CAAC,OAAO,SAAS,MAAM,QAAQ,GAAG;EAC3C,MAAM,aAAa,YAAY;EAC/B,MAAM,EAAE,QAAQ,aAAa,eAAe,YAC1C,aAAa,QAAQ,KAAK,CAAE,UAAU,GACtC,WAAW,YACb;EACA,IAAI,YAAY,SAAS,UACvB,MAAM,IAAI,MACR,kDAAkD,KAAK,yEAEzD;EAEF,IAAI,SAAS;EACb,KAAK,MAAM,CAAC,KAAK,WAAW,OAAO,QAAQ,YAAY,cAAc,CAAC,CAAC,GAAG;GACxE,IAAI,IAAI,WAAW,GAAG,KAAK,QAAQ,YAAY;GAG/C,IAAI,QAAQ,aAAa;GACzB,IAAI,CAAC,MAAM,IAAI,GAAG,GAAG;IACnB,MAAM,IAAI,KAAK,MAAM;IACrB,SAAS;GACX;GACA,WAAW,IAAI,KAAK,CAAC,GAAI,WAAW,IAAI,GAAG,KAAK,CAAC,GAAI,IAAI,CAAC;EAC5D;EACA,IAAI,cAAc,QAAQ;GAIxB,MAAM,EAAE,SAAS,GAAG,KAAK,KAAK,GAAG,aAAa;GAC9C,iBAAiB,cAAc;EACjC;CACF;CAEA,IAAI,QAAQ,IAAI,gBAAgB,cAC9B,KAAK,MAAM,CAAC,KAAK,WAAW,YAAY;EACtC,IAAI,OAAO,SAAS,GAAG;EAEvB,QAAQ,KACN,6CAA6C,IAAI,mBAC5C,oBAAoB,MAAM,EAAE,aAAa,OAAO,GAAG,wEAE1D;CACF;CAKF,MAAM,kBACJ,MAAM,SAAS,IACX,4BAA4B,MACzB,KAAK,SAAS,IAAI,KAAK,KAAK,QAAQ,KAAK,CAAE,aAAa,CAAC,CACzD,KAAK,IAAI,MACZ;CAEN,MAAM,OAAoB;EACxB,MAAM;EACN,YAAY;IACT,WAAW;IAAE,MAAM;IAAU,MAAM;IAAO,aAAa;GAAgB;GACxE,MAAM;IACJ,aACE;IACF,OAAO,CAAC,EAAE,MAAM,SAAS,GAAG,EAAE,MAAM,SAAS,CAAC;GAChD;GACA,GAAG,OAAO,YAAY,KAAK;GAC3B,UAAU,EAAE,MAAM,mBAAmB;EACvC;EACA,UAAU,CAAC,QAAQ;CACrB;CAEA,MAAM,WAAwB;EAC5B,aAAa;EACb,OAAO;GACL,EAAE,MAAM,SAAS;GACjB,EAAE,MAAM,eAAe;GACvB;IACE,MAAM;IACN,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,SAAS,GAAG,EAAE,MAAM,eAAe,CAAC,EAAE;GACjE;EACF;CACF;CAEA,OAAO;EACL,GAAG;EACH,OAAO;GAAE;GAAM;GAAU,GAAG;EAAiB;CAC/C;AACF;AAEA,SAAS,oBAAoB,OAAiB;CAC5C,IAAI,MAAM,UAAU,GAAG,OAAO,MAAM,KAAK,SAAS,IAAI,KAAK,EAAE,CAAC,CAAC,KAAK,OAAO;CAE3E,OAAO,GAAG,MACP,MAAM,GAAG,EAAE,CAAC,CACZ,KAAK,SAAS,IAAI,KAAK,EAAE,CAAC,CAC1B,KAAK,IAAI,EAAE,SAAS,MAAM,MAAM,SAAS,GAAG;AACjD"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/constants.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* The wire key naming the component to render.
|
|
4
3
|
*
|
|
@@ -8,7 +7,6 @@
|
|
|
8
7
|
* colliding with the discriminator. It mirrors the `$type` discriminator
|
|
9
8
|
* convention used by JSON polymorphism elsewhere.
|
|
10
9
|
*/
|
|
11
|
-
declare const TYPE_KEY = "$type";
|
|
12
|
-
|
|
13
|
-
export { TYPE_KEY };
|
|
10
|
+
export declare const TYPE_KEY = "$type";
|
|
11
|
+
export declare const GENERATED_NAME_ATTR = "data-aui-generated-name";
|
|
14
12
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ,UAAU,CAAC;AAEhC,eAAO,MAAM,mBAAmB,4BAA4B,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
* convention used by JSON polymorphism elsewhere.
|
|
10
10
|
*/
|
|
11
11
|
const TYPE_KEY = "$type";
|
|
12
|
+
const GENERATED_NAME_ATTR = "data-aui-generated-name";
|
|
12
13
|
//#endregion
|
|
13
|
-
export { TYPE_KEY };
|
|
14
|
+
export { GENERATED_NAME_ATTR, TYPE_KEY };
|
|
14
15
|
|
|
15
16
|
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","names":[],"sources":["../src/constants.ts"],"sourcesContent":["/**\n * The wire key naming the component to render.\n *\n * The model emits nodes as flat objects `{ [TYPE_KEY]: name, ...props }`. We\n * use `$type` rather than `type` so a component's own `type` prop (e.g. a\n * button's `type=\"submit\"`) flows through as an ordinary prop without\n * colliding with the discriminator. It mirrors the `$type` discriminator\n * convention used by JSON polymorphism elsewhere.\n */\nexport const TYPE_KEY = \"$type\";\n"],"mappings":";;;;;;;;;;AASA,MAAa,WAAW"}
|
|
1
|
+
{"version":3,"file":"constants.js","names":[],"sources":["../src/constants.ts"],"sourcesContent":["/**\n * The wire key naming the component to render.\n *\n * The model emits nodes as flat objects `{ [TYPE_KEY]: name, ...props }`. We\n * use `$type` rather than `type` so a component's own `type` prop (e.g. a\n * button's `type=\"submit\"`) flows through as an ordinary prop without\n * colliding with the discriminator. It mirrors the `$type` discriminator\n * convention used by JSON polymorphism elsewhere.\n */\nexport const TYPE_KEY = \"$type\";\n\nexport const GENERATED_NAME_ATTR = \"data-aui-generated-name\";\n"],"mappings":";;;;;;;;;;AASA,MAAa,WAAW;AAExB,MAAa,sBAAsB"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
//#region src/convert/boundSpec.d.ts
|
|
2
1
|
/** The maximum traversal depth, counted in visited values, not tree levels. */
|
|
3
|
-
declare const MAX_TRAVERSAL_DEPTH = 64;
|
|
2
|
+
export declare const MAX_TRAVERSAL_DEPTH = 64;
|
|
4
3
|
/**
|
|
5
4
|
* The element-nesting ceiling a caller observes. `boundNode` visits an element
|
|
6
5
|
* and its `children` array separately, so one level of nesting spends two of
|
|
7
6
|
* {@link MAX_TRAVERSAL_DEPTH}; it runs before the conversion walk and is never
|
|
8
7
|
* the looser of the two. A root array costs one more level than a root object.
|
|
9
8
|
*/
|
|
10
|
-
declare const MAX_ELEMENT_DEPTH: number;
|
|
9
|
+
export declare const MAX_ELEMENT_DEPTH: number;
|
|
11
10
|
/**
|
|
12
11
|
* The maximum number of entries kept at any single level (root, or a
|
|
13
12
|
* `children` array at any depth) of the raw spec, before it ever reaches
|
|
@@ -15,7 +14,7 @@ declare const MAX_ELEMENT_DEPTH: number;
|
|
|
15
14
|
* can never be made to walk further than this regardless of what the array
|
|
16
15
|
* claims about itself.
|
|
17
16
|
*/
|
|
18
|
-
declare const CHILDREN_CAP = 200;
|
|
17
|
+
export declare const CHILDREN_CAP = 200;
|
|
19
18
|
/**
|
|
20
19
|
* The total number of nodes {@link boundSpec} will visit across one walk,
|
|
21
20
|
* regardless of how many times a shared reference recurs. Bounds the
|
|
@@ -23,10 +22,10 @@ declare const CHILDREN_CAP = 200;
|
|
|
23
22
|
* otherwise force even though each individual array stays within
|
|
24
23
|
* {@link CHILDREN_CAP}.
|
|
25
24
|
*/
|
|
26
|
-
declare const NODE_BUDGET = 5000;
|
|
27
|
-
type ClampReason = "children" | "budget" | "cycle" | "depth";
|
|
25
|
+
export declare const NODE_BUDGET = 5000;
|
|
26
|
+
export type ClampReason = "children" | "budget" | "cycle" | "depth";
|
|
28
27
|
/** Renders the warning detail a protocol reports for one {@link ClampReason}. */
|
|
29
|
-
declare function clampReasonDetail(reason: ClampReason): string;
|
|
28
|
+
export declare function clampReasonDetail(reason: ClampReason): string;
|
|
30
29
|
/**
|
|
31
30
|
* Produces a bounded plain copy of a raw generative-ui spec before it
|
|
32
31
|
* reaches `normalizeSpec`, whose own traversal of the root array or any
|
|
@@ -45,7 +44,5 @@ declare function clampReasonDetail(reason: ClampReason): string;
|
|
|
45
44
|
* {@link NODE_BUDGET} nodes, so shared references cannot multiply work
|
|
46
45
|
* exponentially, and a node that is its own ancestor is cut to `null`.
|
|
47
46
|
*/
|
|
48
|
-
declare function boundSpec(spec: unknown, onClamp: (reason: ClampReason) => void): unknown;
|
|
49
|
-
//#endregion
|
|
50
|
-
export { CHILDREN_CAP, ClampReason, MAX_ELEMENT_DEPTH, MAX_TRAVERSAL_DEPTH, NODE_BUDGET, boundSpec, clampReasonDetail };
|
|
47
|
+
export declare function boundSpec(spec: unknown, onClamp: (reason: ClampReason) => void): unknown;
|
|
51
48
|
//# sourceMappingURL=boundSpec.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boundSpec.d.ts","
|
|
1
|
+
{"version":3,"file":"boundSpec.d.ts","sourceRoot":"","sources":["../../src/convert/boundSpec.ts"],"names":[],"mappings":"AAEA,+EAA+E;AAC/E,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,QAA0B,CAAC;AAEzD;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,MAAM,CAAC;AAEhC;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,OAAO,CAAC;AAEhC,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;AAEpE,iFAAiF;AACjF,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAS7D;AA6DD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,GACrC,OAAO,CAQT"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/convert/copyBounded.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Copies at most `cap` entries out of `value` by index.
|
|
4
3
|
*
|
|
@@ -19,10 +18,8 @@
|
|
|
19
18
|
* that same normalized figure, so a `length` whose `valueOf` answers differently
|
|
20
19
|
* on a second conversion cannot separate the warning from the bound.
|
|
21
20
|
*/
|
|
22
|
-
declare const copyBounded: <T>(value: readonly T[], cap: number) => {
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
export declare const copyBounded: <T>(value: readonly T[], cap: number) => {
|
|
22
|
+
readonly items: T[];
|
|
23
|
+
readonly truncated: boolean;
|
|
25
24
|
};
|
|
26
|
-
//#endregion
|
|
27
|
-
export { copyBounded };
|
|
28
25
|
//# sourceMappingURL=copyBounded.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copyBounded.d.ts","
|
|
1
|
+
{"version":3,"file":"copyBounded.d.ts","sourceRoot":"","sources":["../../src/convert/copyBounded.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,EAC3B,OAAO,SAAS,CAAC,EAAE,EACnB,KAAK,MAAM,KACV;IAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;CAcpD,CAAC"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { NormalizedUIElement, NormalizedUINode } from "../ir.js";
|
|
2
|
-
|
|
3
|
-
declare const isElement: (node: NormalizedUINode) => node is NormalizedUIElement;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { isElement };
|
|
1
|
+
import type { NormalizedUIElement, NormalizedUINode } from "../ir.js";
|
|
2
|
+
export declare const isElement: (node: NormalizedUINode) => node is NormalizedUIElement;
|
|
6
3
|
//# sourceMappingURL=isElement.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isElement.d.ts","
|
|
1
|
+
{"version":3,"file":"isElement.d.ts","sourceRoot":"","sources":["../../src/convert/isElement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,iBAAc;AAEnE,eAAO,MAAM,SAAS,GACpB,MAAM,gBAAgB,KACrB,IAAI,IAAI,mBACwD,CAAC"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { NormalizedUIElement, NormalizedUINode } from "../ir.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
next: number;
|
|
1
|
+
import type { NormalizedUIElement, NormalizedUINode } from "../ir.js";
|
|
2
|
+
export declare function takeRun(nodes: readonly (NormalizedUINode | undefined)[], index: number, matches: (element: NormalizedUIElement) => boolean): {
|
|
3
|
+
run: NormalizedUIElement[];
|
|
4
|
+
next: number;
|
|
6
5
|
};
|
|
7
|
-
//#endregion
|
|
8
|
-
export { takeRun };
|
|
9
6
|
//# sourceMappingURL=takeRun.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"takeRun.d.ts","
|
|
1
|
+
{"version":3,"file":"takeRun.d.ts","sourceRoot":"","sources":["../../src/convert/takeRun.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,iBAAc;AAGnE,wBAAgB,OAAO,CACrB,KAAK,EAAE,SAAS,CAAC,gBAAgB,GAAG,SAAS,CAAC,EAAE,EAChD,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,OAAO,GACjD;IAAE,GAAG,EAAE,mBAAmB,EAAE,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAW9C"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { GenerativeUILibrary } from "./types.js";
|
|
2
|
-
//#region src/defineGenerativeComponents.d.ts
|
|
1
|
+
import type { GenerativeUILibrary } from "./types.js";
|
|
3
2
|
/**
|
|
4
3
|
* Authoring helper for a `"use generative"` generative-UI library — the set of
|
|
5
4
|
* components the model may render. Each component colocates its `properties`
|
|
@@ -26,7 +25,5 @@ import { GenerativeUILibrary } from "./types.js";
|
|
|
26
25
|
* is missing, or it was used outside a `"use generative"` file), so it throws
|
|
27
26
|
* rather than shipping client `render` code to the server.
|
|
28
27
|
*/
|
|
29
|
-
declare function defineGenerativeComponents(_library: GenerativeUILibrary): GenerativeUILibrary;
|
|
30
|
-
//#endregion
|
|
31
|
-
export { defineGenerativeComponents };
|
|
28
|
+
export declare function defineGenerativeComponents(_library: GenerativeUILibrary): GenerativeUILibrary;
|
|
32
29
|
//# sourceMappingURL=defineGenerativeComponents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineGenerativeComponents.d.ts","
|
|
1
|
+
{"version":3,"file":"defineGenerativeComponents.d.ts","sourceRoot":"","sources":["../src/defineGenerativeComponents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAgB;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,mBAAmB,GAC5B,mBAAmB,CAOrB"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
//#region src/generativeUIToJSX.d.ts
|
|
2
1
|
/** Options for {@link generativeUIToJSX}. */
|
|
3
|
-
interface GenerativeUIToJSXOptions {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
export interface GenerativeUIToJSXOptions {
|
|
3
|
+
/** Escape string children so the output is safe to paste back into a JSX file. Defaults to `false`. */
|
|
4
|
+
escape?: boolean;
|
|
5
|
+
/** Pretty-print nested element trees with two-space indentation. Defaults to `false`. */
|
|
6
|
+
pretty?: boolean;
|
|
8
7
|
}
|
|
9
8
|
/**
|
|
10
9
|
* Serializes a generative-UI node to a JSX-like string for display: the "view source" of a model-produced tree. The wire form `{ $type: "Weather", id: "x" }` becomes `<Weather id="x" />`, and nested `children` render between tags: `<Card title="Hi"><Text>hello</Text></Card>`. A model-provided `$key` becomes the JSX `key` attribute.
|
|
@@ -15,7 +14,5 @@ interface GenerativeUIToJSXOptions {
|
|
|
15
14
|
*
|
|
16
15
|
* Pass `{ pretty: true }` to pretty-print nested element trees with two-space indentation, while pure text children stay on one line.
|
|
17
16
|
*/
|
|
18
|
-
declare function generativeUIToJSX(node: unknown, options?: GenerativeUIToJSXOptions): string;
|
|
19
|
-
//#endregion
|
|
20
|
-
export { GenerativeUIToJSXOptions, generativeUIToJSX };
|
|
17
|
+
export declare function generativeUIToJSX(node: unknown, options?: GenerativeUIToJSXOptions): string;
|
|
21
18
|
//# sourceMappingURL=generativeUIToJSX.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generativeUIToJSX.d.ts","
|
|
1
|
+
{"version":3,"file":"generativeUIToJSX.d.ts","sourceRoot":"","sources":["../src/generativeUIToJSX.ts"],"names":[],"mappings":"AAEA,6CAA6C;AAC7C,MAAM,WAAW,wBAAwB;IACvC,uGAAuG;IACvG,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,yFAAyF;IACzF,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,OAAO,EACb,OAAO,CAAC,EAAE,wBAAwB,GACjC,MAAM,CAER"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { JSONGenerativeUIOptions, PresentTool, PresentToolOptions, PromptUserTool } from "./JSONGenerativeUI.shared.js";
|
|
5
|
-
import { JSONGenerativeUI } from "./JSONGenerativeUI.client.js";
|
|
6
|
-
import { buildPresentParameters } from "./buildPresentParameters.js";
|
|
7
|
-
import { TYPE_KEY } from "./constants.js";
|
|
8
|
-
import { defineGenerativeComponents } from "./defineGenerativeComponents.js";
|
|
9
|
-
import { GenerativeUIToJSXOptions, generativeUIToJSX } from "./generativeUIToJSX.js";
|
|
10
|
-
import { renderGenerativeUI } from "./renderGenerativeUI.js";
|
|
11
|
-
import { defaultGenerativeUILibrary } from "./vocabulary/index.js";
|
|
12
|
-
import "./index.shared.js";
|
|
13
|
-
export { ALERT_TONES, ALIGNS, type Action, type ActionDispatchContext, type ActionHandler, type ActionRegistry, type AlertTone, type Align, BUTTON_STYLES, type ButtonStyle, COLORS, type Color, type GenerativeUIAction, type GenerativeUIComponent, type GenerativeUIDispatch, type GenerativeUIElement, type GenerativeUILibrary, type GenerativeUINode, type GenerativeUIProps, type GenerativeUIRenderContext, type GenerativeUIStatus, type GenerativeUIToJSXOptions, ICON_NAMES, IMAGE_SIZE_TOKENS, type IconName, type ImageSize, JSONGenerativeUI, type JSONGenerativeUIOptions, JUSTIFIES, type Justify, type LegacyComponentNode, type NormalizedUIElement, type NormalizedUINode, type PresentTool, type PresentToolOptions, type PromptUserTool, TEXT_SIZES, TYPE_KEY, type TextSize, type UIChildren, type UIElement, type UINode, type UISpec, WEIGHTS, type Weight, buildPresentParameters, createActionRegistry, defaultGenerativeUILibrary, defineGenerativeComponents, emptyActionRegistry, generativeUIToJSX, normalizeSpec, normalizeUINode, renderGenerativeUI };
|
|
1
|
+
export { JSONGenerativeUI } from "./JSONGenerativeUI.client.js";
|
|
2
|
+
export * from "./index.shared.js";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,qCAAkC;AAC7D,kCAA+B"}
|
package/dist/index.server.d.ts
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { JSONGenerativeUIOptions, PresentTool, PresentToolOptions, PromptUserTool } from "./JSONGenerativeUI.shared.js";
|
|
5
|
-
import { JSONGenerativeUI } from "./JSONGenerativeUI.server.js";
|
|
6
|
-
import { buildPresentParameters } from "./buildPresentParameters.js";
|
|
7
|
-
import { TYPE_KEY } from "./constants.js";
|
|
8
|
-
import { defineGenerativeComponents } from "./defineGenerativeComponents.js";
|
|
9
|
-
import { GenerativeUIToJSXOptions, generativeUIToJSX } from "./generativeUIToJSX.js";
|
|
10
|
-
import { renderGenerativeUI } from "./renderGenerativeUI.js";
|
|
11
|
-
import { defaultGenerativeUILibrary } from "./vocabulary/index.js";
|
|
12
|
-
import "./index.shared.js";
|
|
13
|
-
export { ALERT_TONES, ALIGNS, type Action, type ActionDispatchContext, type ActionHandler, type ActionRegistry, type AlertTone, type Align, BUTTON_STYLES, type ButtonStyle, COLORS, type Color, type GenerativeUIAction, type GenerativeUIComponent, type GenerativeUIDispatch, type GenerativeUIElement, type GenerativeUILibrary, type GenerativeUINode, type GenerativeUIProps, type GenerativeUIRenderContext, type GenerativeUIStatus, type GenerativeUIToJSXOptions, ICON_NAMES, IMAGE_SIZE_TOKENS, type IconName, type ImageSize, JSONGenerativeUI, type JSONGenerativeUIOptions, JUSTIFIES, type Justify, type LegacyComponentNode, type NormalizedUIElement, type NormalizedUINode, type PresentTool, type PresentToolOptions, type PromptUserTool, TEXT_SIZES, TYPE_KEY, type TextSize, type UIChildren, type UIElement, type UINode, type UISpec, WEIGHTS, type Weight, buildPresentParameters, createActionRegistry, defaultGenerativeUILibrary, defineGenerativeComponents, emptyActionRegistry, generativeUIToJSX, normalizeSpec, normalizeUINode, renderGenerativeUI };
|
|
1
|
+
export { JSONGenerativeUI } from "./JSONGenerativeUI.server.js";
|
|
2
|
+
export * from "./index.shared.js";
|
|
3
|
+
//# sourceMappingURL=index.server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.server.d.ts","sourceRoot":"","sources":["../src/index.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,qCAAkC;AAC7D,kCAA+B"}
|
package/dist/index.shared.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export
|
|
1
|
+
export { renderGenerativeUI } from "./renderGenerativeUI.js";
|
|
2
|
+
export { generativeUIToJSX } from "./generativeUIToJSX.js";
|
|
3
|
+
export type { GenerativeUIToJSXOptions } from "./generativeUIToJSX.js";
|
|
4
|
+
export { buildPresentParameters } from "./buildPresentParameters.js";
|
|
5
|
+
export { defineGenerativeComponents } from "./defineGenerativeComponents.js";
|
|
6
|
+
export { TYPE_KEY } from "./constants.js";
|
|
7
|
+
export { normalizeUINode, normalizeSpec } from "./ir.js";
|
|
8
|
+
export { TEXT_SIZES, IMAGE_SIZE_TOKENS, WEIGHTS, COLORS, ALIGNS, JUSTIFIES, BUTTON_STYLES, ALERT_TONES, ICON_NAMES, } from "./ir.js";
|
|
9
|
+
export { defaultGenerativeUILibrary } from "./vocabulary/index.js";
|
|
10
|
+
export { createActionRegistry, emptyActionRegistry } from "./actionRegistry.js";
|
|
11
|
+
export type { ActionHandler, ActionRegistry, ActionDispatchContext, } from "./actionRegistry.js";
|
|
12
|
+
export type { JSONGenerativeUIOptions, PresentTool, PresentToolOptions, PromptUserTool, } from "./JSONGenerativeUI.shared.js";
|
|
13
|
+
export type { GenerativeUILibrary, GenerativeUIComponent, GenerativeUIElement, GenerativeUIProps, GenerativeUINode, GenerativeUIStatus, GenerativeUIRenderContext, GenerativeUIAction, GenerativeUIDispatch, } from "./types.js";
|
|
14
|
+
export type { UINode, UIElement, UIChildren, LegacyComponentNode, Action, UISpec, NormalizedUINode, NormalizedUIElement, TextSize, ImageSize, Weight, Color, Align, Justify, ButtonStyle, AlertTone, IconName, } from "./ir.js";
|
|
15
|
+
//# sourceMappingURL=index.shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.shared.d.ts","sourceRoot":"","sources":["../src/index.shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,gCAA6B;AAC1D,OAAO,EAAE,iBAAiB,EAAE,+BAA4B;AACxD,YAAY,EAAE,wBAAwB,EAAE,+BAA4B;AACpE,OAAO,EAAE,sBAAsB,EAAE,oCAAiC;AAClE,OAAO,EAAE,0BAA0B,EAAE,wCAAqC;AAC1E,OAAO,EAAE,QAAQ,EAAE,uBAAoB;AACvC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,gBAAa;AACtD,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,OAAO,EACP,MAAM,EACN,MAAM,EACN,SAAS,EACT,aAAa,EACb,WAAW,EACX,UAAU,GACX,gBAAa;AACd,OAAO,EAAE,0BAA0B,EAAE,8BAAqB;AAC1D,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,4BAAyB;AAC7E,YAAY,EACV,aAAa,EACb,cAAc,EACd,qBAAqB,GACtB,4BAAyB;AAC1B,YAAY,EACV,uBAAuB,EACvB,WAAW,EACX,kBAAkB,EAClB,cAAc,GACf,qCAAkC;AACnC,YAAY,EACV,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,EAClB,oBAAoB,GACrB,mBAAgB;AACjB,YAAY,EACV,MAAM,EACN,SAAS,EACT,UAAU,EACV,mBAAmB,EACnB,MAAM,EACN,MAAM,EACN,gBAAgB,EAChB,mBAAmB,EACnB,QAAQ,EACR,SAAS,EACT,MAAM,EACN,KAAK,EACL,KAAK,EACL,OAAO,EACP,WAAW,EACX,SAAS,EACT,QAAQ,GACT,gBAAa"}
|
package/dist/ir.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/ir.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* The generative-ui intermediate representation: a model-emitted, cross-platform
|
|
4
3
|
* UI tree. React-free, so converters and non-web runtimes consume it without
|
|
@@ -15,32 +14,32 @@
|
|
|
15
14
|
* - `children` is additionally reserved (the JSX convention).
|
|
16
15
|
* - every other key is an inline prop passed straight to the component.
|
|
17
16
|
*/
|
|
18
|
-
declare const TEXT_SIZES: readonly ["sm", "md", "lg", "xl", "2xl", "3xl"];
|
|
19
|
-
type TextSize = (typeof TEXT_SIZES)[number];
|
|
20
|
-
declare const IMAGE_SIZE_TOKENS: readonly ["sm", "md", "lg"];
|
|
21
|
-
type ImageSize = (typeof IMAGE_SIZE_TOKENS)[number] | number;
|
|
22
|
-
declare const WEIGHTS: readonly ["normal", "medium", "semibold", "bold"];
|
|
23
|
-
type Weight = (typeof WEIGHTS)[number];
|
|
24
|
-
declare const COLORS: readonly ["emphasis", "secondary", "alpha-70", "white", "white-70", "white-50"];
|
|
25
|
-
type Color = (typeof COLORS)[number];
|
|
26
|
-
declare const ALIGNS: readonly ["start", "center", "end"];
|
|
27
|
-
type Align = (typeof ALIGNS)[number];
|
|
28
|
-
declare const JUSTIFIES: readonly ["start", "center", "end", "between"];
|
|
29
|
-
type Justify = (typeof JUSTIFIES)[number];
|
|
30
|
-
declare const BUTTON_STYLES: readonly ["primary", "secondary", "outline", "ghost", "danger"];
|
|
31
|
-
type ButtonStyle = (typeof BUTTON_STYLES)[number];
|
|
32
|
-
declare const ALERT_TONES: readonly ["info", "success", "warning", "danger"];
|
|
17
|
+
export declare const TEXT_SIZES: readonly ["sm", "md", "lg", "xl", "2xl", "3xl"];
|
|
18
|
+
export type TextSize = (typeof TEXT_SIZES)[number];
|
|
19
|
+
export declare const IMAGE_SIZE_TOKENS: readonly ["sm", "md", "lg"];
|
|
20
|
+
export type ImageSize = (typeof IMAGE_SIZE_TOKENS)[number] | number;
|
|
21
|
+
export declare const WEIGHTS: readonly ["normal", "medium", "semibold", "bold"];
|
|
22
|
+
export type Weight = (typeof WEIGHTS)[number];
|
|
23
|
+
export declare const COLORS: readonly ["emphasis", "secondary", "alpha-70", "white", "white-70", "white-50"];
|
|
24
|
+
export type Color = (typeof COLORS)[number];
|
|
25
|
+
export declare const ALIGNS: readonly ["start", "center", "end"];
|
|
26
|
+
export type Align = (typeof ALIGNS)[number];
|
|
27
|
+
export declare const JUSTIFIES: readonly ["start", "center", "end", "between"];
|
|
28
|
+
export type Justify = (typeof JUSTIFIES)[number];
|
|
29
|
+
export declare const BUTTON_STYLES: readonly ["primary", "secondary", "outline", "ghost", "danger"];
|
|
30
|
+
export type ButtonStyle = (typeof BUTTON_STYLES)[number];
|
|
31
|
+
export declare const ALERT_TONES: readonly ["info", "success", "warning", "danger"];
|
|
33
32
|
/** A severity level, from informational to destructive. */
|
|
34
|
-
type AlertTone = (typeof ALERT_TONES)[number];
|
|
35
|
-
declare const ICON_NAMES: readonly ["sun", "moon", "cloud", "rain", "snow", "wind", "play", "pause", "check", "x", "star", "heart", "arrow-right", "arrow-up-right", "chevron-right", "calendar", "clock", "map-pin", "plane", "truck", "credit-card", "user", "search", "bell"];
|
|
33
|
+
export type AlertTone = (typeof ALERT_TONES)[number];
|
|
34
|
+
export declare const ICON_NAMES: readonly ["sun", "moon", "cloud", "rain", "snow", "wind", "play", "pause", "check", "x", "star", "heart", "arrow-right", "arrow-up-right", "chevron-right", "calendar", "clock", "map-pin", "plane", "truck", "credit-card", "user", "search", "bell"];
|
|
36
35
|
/** A name from the built-in icon set; the closed enum lets the model see exactly which icons exist. */
|
|
37
|
-
type IconName = (typeof ICON_NAMES)[number];
|
|
36
|
+
export type IconName = (typeof ICON_NAMES)[number];
|
|
38
37
|
/**
|
|
39
38
|
* Behavior payload carried by an interactive node. `type` is resolved by the host's action registry, not the renderer; keeping behavior as data keeps the tree serializable, so the same node renders on web while converters may bind the type to a native action id on other platforms.
|
|
40
39
|
*/
|
|
41
|
-
interface Action {
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
export interface Action {
|
|
41
|
+
readonly type: string;
|
|
42
|
+
readonly [payload: string]: unknown;
|
|
44
43
|
}
|
|
45
44
|
/**
|
|
46
45
|
* Anything renderable as generative UI, as the model emits it. The renderer
|
|
@@ -48,30 +47,30 @@ interface Action {
|
|
|
48
47
|
* input boundary (numbers render as text, falsy/boolean as nothing, arrays as
|
|
49
48
|
* lists); {@link normalizeUINode} accepts that full range.
|
|
50
49
|
*/
|
|
51
|
-
type UINode = string | number | UIElement | LegacyComponentNode;
|
|
52
|
-
type UIChildren = UINode | readonly UINode[];
|
|
50
|
+
export type UINode = string | number | UIElement | LegacyComponentNode;
|
|
51
|
+
export type UIChildren = UINode | readonly UINode[];
|
|
53
52
|
/** The flat node shape: inline props keep the tree compact and natural for a
|
|
54
53
|
* model to emit, instead of a nested `{ type, props }` bag. Reserved keys are
|
|
55
54
|
* stripped before props reach the component (see the module header). */
|
|
56
|
-
interface UIElement {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
export interface UIElement {
|
|
56
|
+
readonly $type: string;
|
|
57
|
+
readonly $key?: string | number;
|
|
58
|
+
readonly children?: UIChildren;
|
|
59
|
+
readonly $action?: Action;
|
|
60
|
+
readonly [prop: string]: unknown;
|
|
62
61
|
}
|
|
63
62
|
/**
|
|
64
63
|
* The legacy node shape: a `component` name plus a nested `props` bag. Kept
|
|
65
64
|
* for backward compatibility. New code authors the flat {@link UIElement}
|
|
66
65
|
* shape instead.
|
|
67
66
|
*/
|
|
68
|
-
interface LegacyComponentNode {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
export interface LegacyComponentNode {
|
|
68
|
+
readonly component: string;
|
|
69
|
+
readonly props?: Record<string, unknown>;
|
|
70
|
+
readonly children?: UIChildren;
|
|
71
|
+
readonly key?: string;
|
|
73
72
|
}
|
|
74
|
-
type UISpec = UINode | readonly UINode[];
|
|
73
|
+
export type UISpec = UINode | readonly UINode[];
|
|
75
74
|
/**
|
|
76
75
|
* A node normalized to a single canonical shape: a `type` string, an inline
|
|
77
76
|
* `props` bag, recursive `children`, an optional `key`, and an optional
|
|
@@ -80,14 +79,14 @@ type UISpec = UINode | readonly UINode[];
|
|
|
80
79
|
* `component` shape, and they never see the reserved `$`-prefixed keys leak
|
|
81
80
|
* into component props.
|
|
82
81
|
*/
|
|
83
|
-
interface NormalizedUIElement {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
82
|
+
export interface NormalizedUIElement {
|
|
83
|
+
readonly type: string;
|
|
84
|
+
readonly props: Readonly<Record<string, unknown>>;
|
|
85
|
+
readonly children?: NormalizedUINode | undefined;
|
|
86
|
+
readonly key?: string | number | undefined;
|
|
87
|
+
readonly action?: Action | undefined;
|
|
89
88
|
}
|
|
90
|
-
type NormalizedUINode = string | number | readonly NormalizedUINode[] | NormalizedUIElement | null;
|
|
89
|
+
export type NormalizedUINode = string | number | readonly NormalizedUINode[] | NormalizedUIElement | null;
|
|
91
90
|
/**
|
|
92
91
|
* Normalizes a generative-ui input to {@link NormalizedUINode}. The flat
|
|
93
92
|
* `$type` shape and the legacy `component` shape both map to the same canonical
|
|
@@ -102,14 +101,12 @@ type NormalizedUINode = string | number | readonly NormalizedUINode[] | Normaliz
|
|
|
102
101
|
* node is held back while completed siblings render. Omit it for a
|
|
103
102
|
* non-streaming (converter) normalize.
|
|
104
103
|
*/
|
|
105
|
-
declare function normalizeUINode(node: unknown, partialPath?: readonly string[] | undefined, depth?: number): NormalizedUINode;
|
|
104
|
+
export declare function normalizeUINode(node: unknown, partialPath?: readonly string[] | undefined, depth?: number): NormalizedUINode;
|
|
106
105
|
/**
|
|
107
106
|
* Normalizes the root of a {@link UISpec}, preserving whether the root was a
|
|
108
107
|
* single node or a list.
|
|
109
108
|
*/
|
|
110
|
-
declare function normalizeSpec(spec: UISpec): {
|
|
111
|
-
|
|
109
|
+
export declare function normalizeSpec(spec: UISpec): {
|
|
110
|
+
readonly root: NormalizedUINode | readonly NormalizedUINode[];
|
|
112
111
|
};
|
|
113
|
-
//#endregion
|
|
114
|
-
export { ALERT_TONES, ALIGNS, Action, AlertTone, Align, BUTTON_STYLES, ButtonStyle, COLORS, Color, ICON_NAMES, IMAGE_SIZE_TOKENS, IconName, ImageSize, JUSTIFIES, Justify, LegacyComponentNode, NormalizedUIElement, NormalizedUINode, TEXT_SIZES, TextSize, UIChildren, UIElement, UINode, UISpec, WEIGHTS, Weight, normalizeSpec, normalizeUINode };
|
|
115
112
|
//# sourceMappingURL=ir.d.ts.map
|
package/dist/ir.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ir.d.ts","
|
|
1
|
+
{"version":3,"file":"ir.d.ts","sourceRoot":"","sources":["../src/ir.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
//#region src/renderGenerativeUI.d.ts
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { GenerativeUILibrary, GenerativeUIRenderContext } from "./types.js";
|
|
4
3
|
/**
|
|
5
4
|
* Renders a generative-ui tree against a {@link GenerativeUILibrary}.
|
|
6
5
|
*
|
|
@@ -11,7 +10,5 @@ import { ReactNode } from "react";
|
|
|
11
10
|
* `render(props, context)`, with `children` rendered recursively so components
|
|
12
11
|
* can nest.
|
|
13
12
|
*/
|
|
14
|
-
declare function renderGenerativeUI(node: unknown, library: GenerativeUILibrary, context?: GenerativeUIRenderContext): ReactNode;
|
|
15
|
-
//#endregion
|
|
16
|
-
export { renderGenerativeUI };
|
|
13
|
+
export declare function renderGenerativeUI(node: unknown, library: GenerativeUILibrary, context?: GenerativeUIRenderContext): ReactNode;
|
|
17
14
|
//# sourceMappingURL=renderGenerativeUI.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderGenerativeUI.d.ts","
|
|
1
|
+
{"version":3,"file":"renderGenerativeUI.d.ts","sourceRoot":"","sources":["../src/renderGenerativeUI.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAMjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,mBAAgB;AAO9E;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,mBAAmB,EAC5B,OAAO,GAAE,yBAA2C,GACnD,SAAS,CAOX"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scopeSchema.d.ts","sourceRoot":"","sources":["../src/scopeSchema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAyB,MAAM,aAAa,CAAC;AAYtE,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM;;;EA0D5D"}
|