@copilotkit/shared 2.0.0-rc.5 → 2.0.0-rc.50
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/README.md +4 -15
- package/dist/a2ui-envelope.cjs +3 -3
- package/dist/a2ui-envelope.cjs.map +1 -1
- package/dist/a2ui-envelope.d.cts +1 -1
- package/dist/a2ui-envelope.d.cts.map +1 -1
- package/dist/a2ui-envelope.d.mts +1 -1
- package/dist/a2ui-envelope.d.mts.map +1 -1
- package/dist/a2ui-envelope.mjs +3 -3
- package/dist/a2ui-envelope.mjs.map +1 -1
- package/dist/a2ui-prompts.cjs +21 -62
- package/dist/a2ui-prompts.cjs.map +1 -1
- package/dist/a2ui-prompts.d.cts +8 -1
- package/dist/a2ui-prompts.d.cts.map +1 -1
- package/dist/a2ui-prompts.d.mts +8 -1
- package/dist/a2ui-prompts.d.mts.map +1 -1
- package/dist/a2ui-prompts.mjs +22 -62
- package/dist/a2ui-prompts.mjs.map +1 -1
- package/dist/attachments/types.d.cts +1 -3
- package/dist/attachments/types.d.cts.map +1 -1
- package/dist/attachments/types.d.mts +1 -3
- package/dist/attachments/types.d.mts.map +1 -1
- package/dist/attachments/utils.cjs +16 -5
- package/dist/attachments/utils.cjs.map +1 -1
- package/dist/attachments/utils.d.cts +3 -1
- package/dist/attachments/utils.d.cts.map +1 -1
- package/dist/attachments/utils.d.mts +3 -1
- package/dist/attachments/utils.d.mts.map +1 -1
- package/dist/attachments/utils.mjs +16 -5
- package/dist/attachments/utils.mjs.map +1 -1
- package/dist/finalize-events.cjs +16 -0
- package/dist/finalize-events.cjs.map +1 -1
- package/dist/finalize-events.d.cts.map +1 -1
- package/dist/finalize-events.d.mts.map +1 -1
- package/dist/finalize-events.mjs +16 -0
- package/dist/finalize-events.mjs.map +1 -1
- package/dist/generative-ui/basic-functions.cjs +1 -1
- package/dist/generative-ui/basic-functions.cjs.map +1 -1
- package/dist/generative-ui/basic-functions.mjs +1 -1
- package/dist/generative-ui/basic-functions.mjs.map +1 -1
- package/dist/generative-ui/catalog/catalog-export.cjs +329 -0
- package/dist/generative-ui/catalog/catalog-export.cjs.map +1 -0
- package/dist/generative-ui/catalog/catalog-export.d.cts +92 -0
- package/dist/generative-ui/catalog/catalog-export.d.cts.map +1 -0
- package/dist/generative-ui/catalog/catalog-export.d.mts +92 -0
- package/dist/generative-ui/catalog/catalog-export.d.mts.map +1 -0
- package/dist/generative-ui/catalog/catalog-export.mjs +328 -0
- package/dist/generative-ui/catalog/catalog-export.mjs.map +1 -0
- package/dist/generative-ui/catalog/catalog.cjs +315 -0
- package/dist/generative-ui/catalog/catalog.cjs.map +1 -0
- package/dist/generative-ui/catalog/catalog.d.cts +407 -0
- package/dist/generative-ui/catalog/catalog.d.cts.map +1 -0
- package/dist/generative-ui/catalog/catalog.d.mts +407 -0
- package/dist/generative-ui/catalog/catalog.d.mts.map +1 -0
- package/dist/generative-ui/catalog/catalog.mjs +312 -0
- package/dist/generative-ui/catalog/catalog.mjs.map +1 -0
- package/dist/generative-ui/catalog/errors.cjs +13 -0
- package/dist/generative-ui/catalog/errors.cjs.map +1 -0
- package/dist/generative-ui/catalog/errors.d.cts +46 -0
- package/dist/generative-ui/catalog/errors.d.cts.map +1 -0
- package/dist/generative-ui/catalog/errors.d.mts +46 -0
- package/dist/generative-ui/catalog/errors.d.mts.map +1 -0
- package/dist/generative-ui/catalog/errors.mjs +12 -0
- package/dist/generative-ui/catalog/errors.mjs.map +1 -0
- package/dist/generative-ui/catalog/index.d.mts +6 -0
- package/dist/generative-ui/catalog/json-schema.cjs +16 -0
- package/dist/generative-ui/catalog/json-schema.cjs.map +1 -0
- package/dist/generative-ui/catalog/json-schema.d.cts +12 -0
- package/dist/generative-ui/catalog/json-schema.d.cts.map +1 -0
- package/dist/generative-ui/catalog/json-schema.d.mts +12 -0
- package/dist/generative-ui/catalog/json-schema.d.mts.map +1 -0
- package/dist/generative-ui/catalog/json-schema.mjs +16 -0
- package/dist/generative-ui/catalog/json-schema.mjs.map +1 -0
- package/dist/generative-ui/catalog/refs.cjs +21 -0
- package/dist/generative-ui/catalog/refs.cjs.map +1 -0
- package/dist/generative-ui/catalog/refs.d.cts +55 -0
- package/dist/generative-ui/catalog/refs.d.cts.map +1 -0
- package/dist/generative-ui/catalog/refs.d.mts +55 -0
- package/dist/generative-ui/catalog/refs.d.mts.map +1 -0
- package/dist/generative-ui/catalog/refs.mjs +18 -0
- package/dist/generative-ui/catalog/refs.mjs.map +1 -0
- package/dist/generative-ui/catalog/schema.cjs +74 -0
- package/dist/generative-ui/catalog/schema.cjs.map +1 -0
- package/dist/generative-ui/catalog/schema.d.cts +43 -0
- package/dist/generative-ui/catalog/schema.d.cts.map +1 -0
- package/dist/generative-ui/catalog/schema.d.mts +43 -0
- package/dist/generative-ui/catalog/schema.d.mts.map +1 -0
- package/dist/generative-ui/catalog/schema.mjs +68 -0
- package/dist/generative-ui/catalog/schema.mjs.map +1 -0
- package/dist/generative-ui/child-refs.cjs +3 -3
- package/dist/generative-ui/child-refs.cjs.map +1 -1
- package/dist/generative-ui/child-refs.d.cts.map +1 -1
- package/dist/generative-ui/child-refs.d.mts.map +1 -1
- package/dist/generative-ui/child-refs.mjs +3 -3
- package/dist/generative-ui/child-refs.mjs.map +1 -1
- package/dist/generative-ui/clone-value.cjs +364 -0
- package/dist/generative-ui/clone-value.cjs.map +1 -0
- package/dist/generative-ui/clone-value.d.cts +51 -0
- package/dist/generative-ui/clone-value.d.cts.map +1 -0
- package/dist/generative-ui/clone-value.d.mts +51 -0
- package/dist/generative-ui/clone-value.d.mts.map +1 -0
- package/dist/generative-ui/clone-value.mjs +363 -0
- package/dist/generative-ui/clone-value.mjs.map +1 -0
- package/dist/generative-ui/compact-schema.cjs +187 -0
- package/dist/generative-ui/compact-schema.cjs.map +1 -0
- package/dist/generative-ui/compact-schema.d.cts +55 -0
- package/dist/generative-ui/compact-schema.d.cts.map +1 -0
- package/dist/generative-ui/compact-schema.d.mts +55 -0
- package/dist/generative-ui/compact-schema.d.mts.map +1 -0
- package/dist/generative-ui/compact-schema.mjs +185 -0
- package/dist/generative-ui/compact-schema.mjs.map +1 -0
- package/dist/generative-ui/index.cjs +286 -0
- package/dist/generative-ui/index.d.cts +39 -0
- package/dist/generative-ui/index.d.mts +41 -0
- package/dist/generative-ui/index.mjs +40 -0
- package/dist/generative-ui/is-record.cjs +6 -1
- package/dist/generative-ui/is-record.cjs.map +1 -1
- package/dist/generative-ui/is-record.d.cts +8 -0
- package/dist/generative-ui/is-record.d.cts.map +1 -0
- package/dist/generative-ui/is-record.d.mts +8 -0
- package/dist/generative-ui/is-record.d.mts.map +1 -0
- package/dist/generative-ui/is-record.mjs +6 -2
- package/dist/generative-ui/is-record.mjs.map +1 -1
- package/dist/generative-ui/prompt-spec.cjs +225 -0
- package/dist/generative-ui/prompt-spec.cjs.map +1 -0
- package/dist/generative-ui/prompt-spec.d.cts +94 -0
- package/dist/generative-ui/prompt-spec.d.cts.map +1 -0
- package/dist/generative-ui/prompt-spec.d.mts +94 -0
- package/dist/generative-ui/prompt-spec.d.mts.map +1 -0
- package/dist/generative-ui/prompt-spec.mjs +220 -0
- package/dist/generative-ui/prompt-spec.mjs.map +1 -0
- package/dist/generative-ui/prompt.cjs +10 -36
- package/dist/generative-ui/prompt.cjs.map +1 -1
- package/dist/generative-ui/prompt.d.cts +2 -1
- package/dist/generative-ui/prompt.d.cts.map +1 -1
- package/dist/generative-ui/prompt.d.mts +2 -1
- package/dist/generative-ui/prompt.d.mts.map +1 -1
- package/dist/generative-ui/prompt.mjs +12 -38
- package/dist/generative-ui/prompt.mjs.map +1 -1
- package/dist/generative-ui/render-ui-args.cjs +1 -0
- package/dist/generative-ui/render-ui-args.cjs.map +1 -1
- package/dist/generative-ui/render-ui-args.d.cts.map +1 -1
- package/dist/generative-ui/render-ui-args.d.mts.map +1 -1
- package/dist/generative-ui/render-ui-args.mjs +1 -0
- package/dist/generative-ui/render-ui-args.mjs.map +1 -1
- package/dist/generative-ui/schema-render.cjs +243 -0
- package/dist/generative-ui/schema-render.cjs.map +1 -0
- package/dist/generative-ui/schema-render.d.cts +44 -0
- package/dist/generative-ui/schema-render.d.cts.map +1 -0
- package/dist/generative-ui/schema-render.d.mts +44 -0
- package/dist/generative-ui/schema-render.d.mts.map +1 -0
- package/dist/generative-ui/schema-render.mjs +240 -0
- package/dist/generative-ui/schema-render.mjs.map +1 -0
- package/dist/generative-ui/standard/chart-config.cjs +347 -0
- package/dist/generative-ui/standard/chart-config.cjs.map +1 -0
- package/dist/generative-ui/standard/chart-config.d.cts +97 -0
- package/dist/generative-ui/standard/chart-config.d.cts.map +1 -0
- package/dist/generative-ui/standard/chart-config.d.mts +97 -0
- package/dist/generative-ui/standard/chart-config.d.mts.map +1 -0
- package/dist/generative-ui/standard/chart-config.mjs +342 -0
- package/dist/generative-ui/standard/chart-config.mjs.map +1 -0
- package/dist/generative-ui/standard/chart.cjs +56 -0
- package/dist/generative-ui/standard/chart.cjs.map +1 -0
- package/dist/generative-ui/standard/chart.d.cts +62 -0
- package/dist/generative-ui/standard/chart.d.cts.map +1 -0
- package/dist/generative-ui/standard/chart.d.mts +62 -0
- package/dist/generative-ui/standard/chart.d.mts.map +1 -0
- package/dist/generative-ui/standard/chart.mjs +54 -0
- package/dist/generative-ui/standard/chart.mjs.map +1 -0
- package/dist/generative-ui/standard/checks.cjs +74 -0
- package/dist/generative-ui/standard/checks.cjs.map +1 -0
- package/dist/generative-ui/standard/checks.d.cts +56 -0
- package/dist/generative-ui/standard/checks.d.cts.map +1 -0
- package/dist/generative-ui/standard/checks.d.mts +56 -0
- package/dist/generative-ui/standard/checks.d.mts.map +1 -0
- package/dist/generative-ui/standard/checks.mjs +71 -0
- package/dist/generative-ui/standard/checks.mjs.map +1 -0
- package/dist/generative-ui/standard/components.cjs +23 -0
- package/dist/generative-ui/standard/components.cjs.map +1 -0
- package/dist/generative-ui/standard/components.d.cts +24 -0
- package/dist/generative-ui/standard/components.d.cts.map +1 -0
- package/dist/generative-ui/standard/components.d.mts +24 -0
- package/dist/generative-ui/standard/components.d.mts.map +1 -0
- package/dist/generative-ui/standard/components.mjs +22 -0
- package/dist/generative-ui/standard/components.mjs.map +1 -0
- package/dist/generative-ui/standard/composites.cjs +143 -0
- package/dist/generative-ui/standard/composites.cjs.map +1 -0
- package/dist/generative-ui/standard/composites.d.cts +233 -0
- package/dist/generative-ui/standard/composites.d.cts.map +1 -0
- package/dist/generative-ui/standard/composites.d.mts +233 -0
- package/dist/generative-ui/standard/composites.d.mts.map +1 -0
- package/dist/generative-ui/standard/composites.mjs +132 -0
- package/dist/generative-ui/standard/composites.mjs.map +1 -0
- package/dist/generative-ui/standard/data.cjs +176 -0
- package/dist/generative-ui/standard/data.cjs.map +1 -0
- package/dist/generative-ui/standard/data.d.cts +365 -0
- package/dist/generative-ui/standard/data.d.cts.map +1 -0
- package/dist/generative-ui/standard/data.d.mts +365 -0
- package/dist/generative-ui/standard/data.d.mts.map +1 -0
- package/dist/generative-ui/standard/data.mjs +167 -0
- package/dist/generative-ui/standard/data.mjs.map +1 -0
- package/dist/generative-ui/standard/declarations.cjs +40 -0
- package/dist/generative-ui/standard/declarations.cjs.map +1 -0
- package/dist/generative-ui/standard/declarations.d.cts +2570 -0
- package/dist/generative-ui/standard/declarations.d.cts.map +1 -0
- package/dist/generative-ui/standard/declarations.d.mts +2571 -0
- package/dist/generative-ui/standard/declarations.d.mts.map +1 -0
- package/dist/generative-ui/standard/declarations.mjs +39 -0
- package/dist/generative-ui/standard/declarations.mjs.map +1 -0
- package/dist/generative-ui/standard/feedback.cjs +97 -0
- package/dist/generative-ui/standard/feedback.cjs.map +1 -0
- package/dist/generative-ui/standard/feedback.d.cts +133 -0
- package/dist/generative-ui/standard/feedback.d.cts.map +1 -0
- package/dist/generative-ui/standard/feedback.d.mts +133 -0
- package/dist/generative-ui/standard/feedback.d.mts.map +1 -0
- package/dist/generative-ui/standard/feedback.mjs +90 -0
- package/dist/generative-ui/standard/feedback.mjs.map +1 -0
- package/dist/generative-ui/standard/index.d.mts +20 -0
- package/dist/generative-ui/standard/inputs.cjs +333 -0
- package/dist/generative-ui/standard/inputs.cjs.map +1 -0
- package/dist/generative-ui/standard/inputs.d.cts +1128 -0
- package/dist/generative-ui/standard/inputs.d.cts.map +1 -0
- package/dist/generative-ui/standard/inputs.d.mts +1128 -0
- package/dist/generative-ui/standard/inputs.d.mts.map +1 -0
- package/dist/generative-ui/standard/inputs.mjs +318 -0
- package/dist/generative-ui/standard/inputs.mjs.map +1 -0
- package/dist/generative-ui/standard/layout.cjs +289 -0
- package/dist/generative-ui/standard/layout.cjs.map +1 -0
- package/dist/generative-ui/standard/layout.d.cts +1974 -0
- package/dist/generative-ui/standard/layout.d.cts.map +1 -0
- package/dist/generative-ui/standard/layout.d.mts +1975 -0
- package/dist/generative-ui/standard/layout.d.mts.map +1 -0
- package/dist/generative-ui/standard/layout.mjs +269 -0
- package/dist/generative-ui/standard/layout.mjs.map +1 -0
- package/dist/generative-ui/standard/map-helpers.cjs +104 -0
- package/dist/generative-ui/standard/map-helpers.cjs.map +1 -0
- package/dist/generative-ui/standard/map-helpers.d.cts +88 -0
- package/dist/generative-ui/standard/map-helpers.d.cts.map +1 -0
- package/dist/generative-ui/standard/map-helpers.d.mts +88 -0
- package/dist/generative-ui/standard/map-helpers.d.mts.map +1 -0
- package/dist/generative-ui/standard/map-helpers.mjs +95 -0
- package/dist/generative-ui/standard/map-helpers.mjs.map +1 -0
- package/dist/generative-ui/standard/map.cjs +27 -0
- package/dist/generative-ui/standard/map.cjs.map +1 -0
- package/dist/generative-ui/standard/map.d.cts +31 -0
- package/dist/generative-ui/standard/map.d.cts.map +1 -0
- package/dist/generative-ui/standard/map.d.mts +31 -0
- package/dist/generative-ui/standard/map.d.mts.map +1 -0
- package/dist/generative-ui/standard/map.mjs +25 -0
- package/dist/generative-ui/standard/map.mjs.map +1 -0
- package/dist/generative-ui/standard/media.cjs +215 -0
- package/dist/generative-ui/standard/media.cjs.map +1 -0
- package/dist/generative-ui/standard/media.d.cts +396 -0
- package/dist/generative-ui/standard/media.d.cts.map +1 -0
- package/dist/generative-ui/standard/media.d.mts +396 -0
- package/dist/generative-ui/standard/media.d.mts.map +1 -0
- package/dist/generative-ui/standard/media.mjs +205 -0
- package/dist/generative-ui/standard/media.mjs.map +1 -0
- package/dist/generative-ui/standard/parameter-order.cjs +231 -0
- package/dist/generative-ui/standard/parameter-order.cjs.map +1 -0
- package/dist/generative-ui/standard/parameter-order.d.cts +84 -0
- package/dist/generative-ui/standard/parameter-order.d.cts.map +1 -0
- package/dist/generative-ui/standard/parameter-order.d.mts +84 -0
- package/dist/generative-ui/standard/parameter-order.d.mts.map +1 -0
- package/dist/generative-ui/standard/parameter-order.mjs +230 -0
- package/dist/generative-ui/standard/parameter-order.mjs.map +1 -0
- package/dist/generative-ui/standard/style-helpers.cjs +151 -0
- package/dist/generative-ui/standard/style-helpers.cjs.map +1 -0
- package/dist/generative-ui/standard/style-helpers.d.cts +56 -0
- package/dist/generative-ui/standard/style-helpers.d.cts.map +1 -0
- package/dist/generative-ui/standard/style-helpers.d.mts +56 -0
- package/dist/generative-ui/standard/style-helpers.d.mts.map +1 -0
- package/dist/generative-ui/standard/style-helpers.mjs +142 -0
- package/dist/generative-ui/standard/style-helpers.mjs.map +1 -0
- package/dist/generative-ui/standard/styles.cjs +62 -0
- package/dist/generative-ui/standard/styles.cjs.map +1 -0
- package/dist/generative-ui/standard/styles.d.cts +17 -0
- package/dist/generative-ui/standard/styles.d.cts.map +1 -0
- package/dist/generative-ui/standard/styles.d.mts +17 -0
- package/dist/generative-ui/standard/styles.d.mts.map +1 -0
- package/dist/generative-ui/standard/styles.mjs +60 -0
- package/dist/generative-ui/standard/styles.mjs.map +1 -0
- package/dist/generative-ui/standard/text.cjs +226 -0
- package/dist/generative-ui/standard/text.cjs.map +1 -0
- package/dist/generative-ui/standard/text.d.cts +522 -0
- package/dist/generative-ui/standard/text.d.cts.map +1 -0
- package/dist/generative-ui/standard/text.d.mts +522 -0
- package/dist/generative-ui/standard/text.d.mts.map +1 -0
- package/dist/generative-ui/standard/text.mjs +209 -0
- package/dist/generative-ui/standard/text.mjs.map +1 -0
- package/dist/generative-ui/standard/theme.cjs +115 -0
- package/dist/generative-ui/standard/theme.cjs.map +1 -0
- package/dist/generative-ui/standard/theme.d.cts +60 -0
- package/dist/generative-ui/standard/theme.d.cts.map +1 -0
- package/dist/generative-ui/standard/theme.d.mts +60 -0
- package/dist/generative-ui/standard/theme.d.mts.map +1 -0
- package/dist/generative-ui/standard/theme.mjs +112 -0
- package/dist/generative-ui/standard/theme.mjs.map +1 -0
- package/dist/generative-ui/standard/tokens.cjs +336 -0
- package/dist/generative-ui/standard/tokens.cjs.map +1 -0
- package/dist/generative-ui/standard/tokens.d.cts +76 -0
- package/dist/generative-ui/standard/tokens.d.cts.map +1 -0
- package/dist/generative-ui/standard/tokens.d.mts +76 -0
- package/dist/generative-ui/standard/tokens.d.mts.map +1 -0
- package/dist/generative-ui/standard/tokens.mjs +305 -0
- package/dist/generative-ui/standard/tokens.mjs.map +1 -0
- package/dist/generative-ui/standard/url.cjs +54 -0
- package/dist/generative-ui/standard/url.cjs.map +1 -0
- package/dist/generative-ui/standard/url.d.cts +32 -0
- package/dist/generative-ui/standard/url.d.cts.map +1 -0
- package/dist/generative-ui/standard/url.d.mts +32 -0
- package/dist/generative-ui/standard/url.d.mts.map +1 -0
- package/dist/generative-ui/standard/url.mjs +50 -0
- package/dist/generative-ui/standard/url.mjs.map +1 -0
- package/dist/generative-ui/thrown.cjs +69 -0
- package/dist/generative-ui/thrown.cjs.map +1 -0
- package/dist/generative-ui/thrown.d.cts +21 -0
- package/dist/generative-ui/thrown.d.cts.map +1 -0
- package/dist/generative-ui/thrown.d.mts +21 -0
- package/dist/generative-ui/thrown.d.mts.map +1 -0
- package/dist/generative-ui/thrown.mjs +67 -0
- package/dist/generative-ui/thrown.mjs.map +1 -0
- package/dist/generative-ui/types.cjs +2 -2
- package/dist/generative-ui/types.cjs.map +1 -1
- package/dist/generative-ui/types.d.cts +20 -7
- package/dist/generative-ui/types.d.cts.map +1 -1
- package/dist/generative-ui/types.d.mts +20 -7
- package/dist/generative-ui/types.d.mts.map +1 -1
- package/dist/generative-ui/types.mjs +2 -2
- package/dist/generative-ui/types.mjs.map +1 -1
- package/dist/generative-ui/validate-operation.cjs +2 -2
- package/dist/generative-ui/validate-operation.cjs.map +1 -1
- package/dist/generative-ui/validate-operation.mjs +2 -2
- package/dist/generative-ui/validate-operation.mjs.map +1 -1
- package/dist/index.cjs +18 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -17
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +18 -17
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +10 -8
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +1233 -456
- package/dist/index.umd.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.mjs +1 -1
- package/dist/standard-schema.cjs +20 -7
- package/dist/standard-schema.cjs.map +1 -1
- package/dist/standard-schema.d.cts +15 -16
- package/dist/standard-schema.d.cts.map +1 -1
- package/dist/standard-schema.d.mts +15 -16
- package/dist/standard-schema.d.mts.map +1 -1
- package/dist/standard-schema.mjs +20 -8
- package/dist/standard-schema.mjs.map +1 -1
- package/dist/telemetry/lambda-client.cjs +1 -1
- package/dist/telemetry/lambda-client.cjs.map +1 -1
- package/dist/telemetry/lambda-client.d.cts.map +1 -1
- package/dist/telemetry/lambda-client.d.mts.map +1 -1
- package/dist/telemetry/lambda-client.mjs +1 -1
- package/dist/telemetry/lambda-client.mjs.map +1 -1
- package/dist/telemetry/telemetry-disabled.cjs +0 -5
- package/dist/telemetry/telemetry-disabled.cjs.map +1 -1
- package/dist/telemetry/telemetry-disabled.d.cts +0 -5
- package/dist/telemetry/telemetry-disabled.d.cts.map +1 -1
- package/dist/telemetry/telemetry-disabled.d.mts +0 -5
- package/dist/telemetry/telemetry-disabled.d.mts.map +1 -1
- package/dist/telemetry/telemetry-disabled.mjs +0 -5
- package/dist/telemetry/telemetry-disabled.mjs.map +1 -1
- package/dist/types/message.d.cts +1 -18
- package/dist/types/message.d.cts.map +1 -1
- package/dist/types/message.d.mts +1 -18
- package/dist/types/message.d.mts.map +1 -1
- package/dist/utils/errors.cjs +5 -42
- package/dist/utils/errors.cjs.map +1 -1
- package/dist/utils/errors.d.cts +16 -34
- package/dist/utils/errors.d.cts.map +1 -1
- package/dist/utils/errors.d.mts +16 -34
- package/dist/utils/errors.d.mts.map +1 -1
- package/dist/utils/errors.mjs +6 -41
- package/dist/utils/errors.mjs.map +1 -1
- package/dist/utils/index.cjs +0 -2
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.cts +5 -7
- package/dist/utils/index.d.cts.map +1 -1
- package/dist/utils/index.d.mts +5 -7
- package/dist/utils/index.d.mts.map +1 -1
- package/dist/utils/index.mjs +4 -6
- package/dist/utils/index.mjs.map +1 -1
- package/dist/utils/inspector-visibility.cjs +25 -3
- package/dist/utils/inspector-visibility.cjs.map +1 -1
- package/dist/utils/inspector-visibility.d.cts +26 -3
- package/dist/utils/inspector-visibility.d.cts.map +1 -1
- package/dist/utils/inspector-visibility.d.mts +26 -3
- package/dist/utils/inspector-visibility.d.mts.map +1 -1
- package/dist/utils/inspector-visibility.mjs +25 -4
- package/dist/utils/inspector-visibility.mjs.map +1 -1
- package/dist/utils/json-schema.cjs +4 -79
- package/dist/utils/json-schema.cjs.map +1 -1
- package/dist/utils/json-schema.d.cts +1 -4
- package/dist/utils/json-schema.d.cts.map +1 -1
- package/dist/utils/json-schema.d.mts +1 -4
- package/dist/utils/json-schema.d.mts.map +1 -1
- package/dist/utils/json-schema.mjs +5 -78
- package/dist/utils/json-schema.mjs.map +1 -1
- package/dist/utils/random-id.cjs +13 -26
- package/dist/utils/random-id.cjs.map +1 -1
- package/dist/utils/random-id.d.cts +6 -3
- package/dist/utils/random-id.d.cts.map +1 -1
- package/dist/utils/random-id.d.mts +6 -3
- package/dist/utils/random-id.d.mts.map +1 -1
- package/dist/utils/random-id.mjs +14 -25
- package/dist/utils/random-id.mjs.map +1 -1
- package/dist/utils/types.cjs.map +1 -1
- package/dist/utils/types.d.cts +5 -12
- package/dist/utils/types.d.cts.map +1 -1
- package/dist/utils/types.d.mts +5 -12
- package/dist/utils/types.d.mts.map +1 -1
- package/dist/utils/types.mjs.map +1 -1
- package/package.json +19 -32
- package/scripts/verify-cjs-exports.cjs +1 -1
- package/src/__tests__/a2ui-envelope.test.ts +38 -13
- package/src/__tests__/a2ui-prompts.test.ts +47 -14
- package/src/__tests__/fixtures/prompt-goldens.json +354 -0
- package/src/__tests__/prompt-spec.test.ts +191 -0
- package/src/__tests__/root-entry-browser-safety.test.ts +5 -7
- package/src/__tests__/schema-render.test.ts +323 -0
- package/src/__tests__/standard-schema.test.ts +61 -101
- package/src/a2ui-envelope.ts +9 -7
- package/src/a2ui-prompts.ts +47 -96
- package/src/attachments/__tests__/utils.test.ts +22 -0
- package/src/attachments/types.ts +1 -3
- package/src/attachments/utils.ts +23 -5
- package/src/finalize-events.ts +16 -0
- package/src/generative-ui/__tests__/clone-value-differential.test.ts +480 -0
- package/src/generative-ui/__tests__/clone-value.test.ts +226 -0
- package/src/generative-ui/__tests__/render-ui-args.test.ts +7 -7
- package/src/generative-ui/__tests__/validate-operation.test.ts +19 -13
- package/src/generative-ui/base.ts +9 -0
- package/src/generative-ui/basic-functions.ts +1 -1
- package/src/generative-ui/catalog/catalog-export.ts +478 -0
- package/src/generative-ui/catalog/catalog.ts +1167 -0
- package/src/generative-ui/catalog/errors.ts +102 -0
- package/src/generative-ui/catalog/index.ts +6 -0
- package/src/generative-ui/catalog/json-schema.ts +14 -0
- package/src/generative-ui/catalog/refs.ts +87 -0
- package/src/generative-ui/catalog/schema.ts +107 -0
- package/src/generative-ui/child-refs.ts +5 -4
- package/src/generative-ui/clone-value.ts +511 -0
- package/src/generative-ui/compact-schema.ts +277 -0
- package/src/generative-ui/index.ts +14 -0
- package/src/generative-ui/is-record.ts +6 -1
- package/src/generative-ui/prompt-spec.ts +335 -0
- package/src/generative-ui/prompt.ts +25 -75
- package/src/generative-ui/render-ui-args.ts +3 -0
- package/src/generative-ui/schema-render.ts +378 -0
- package/src/generative-ui/standard/__tests__/standard-helpers.test.ts +407 -0
- package/src/generative-ui/standard/__tests__/theme.test.ts +61 -0
- package/src/generative-ui/standard/__tests__/tokens.test.ts +139 -0
- package/src/generative-ui/standard/chart-config.ts +434 -0
- package/src/generative-ui/standard/chart.ts +79 -0
- package/src/generative-ui/standard/checks.ts +98 -0
- package/src/generative-ui/standard/components.ts +35 -0
- package/src/generative-ui/standard/composites.ts +158 -0
- package/src/generative-ui/standard/data.ts +213 -0
- package/src/generative-ui/standard/declarations.ts +57 -0
- package/src/generative-ui/standard/feedback.ts +105 -0
- package/src/generative-ui/standard/index.ts +55 -0
- package/src/generative-ui/standard/inputs.ts +423 -0
- package/src/generative-ui/standard/layout.ts +312 -0
- package/src/generative-ui/standard/map-helpers.ts +155 -0
- package/src/generative-ui/standard/map.ts +32 -0
- package/src/generative-ui/standard/media.ts +265 -0
- package/src/generative-ui/standard/parameter-order.ts +155 -0
- package/src/generative-ui/standard/style-helpers.ts +170 -0
- package/src/generative-ui/standard/styles.ts +79 -0
- package/src/generative-ui/standard/text.ts +210 -0
- package/src/generative-ui/standard/theme.ts +198 -0
- package/src/generative-ui/standard/tokens.ts +317 -0
- package/src/generative-ui/standard/url.ts +51 -0
- package/src/generative-ui/thrown.ts +90 -0
- package/src/generative-ui/types.ts +23 -7
- package/src/generative-ui/validate-operation.ts +2 -2
- package/src/index.ts +9 -17
- package/src/standard-schema.ts +24 -27
- package/src/telemetry/lambda-client.ts +8 -3
- package/src/telemetry/model-host.test.ts +2 -5
- package/src/telemetry/telemetry-disabled.ts +0 -5
- package/src/types/message.ts +1 -19
- package/src/utils/__tests__/errors.test.ts +44 -0
- package/src/utils/__tests__/json-schema.test.ts +3 -479
- package/src/utils/__tests__/random-id.test.ts +37 -0
- package/src/utils/errors.ts +28 -85
- package/src/utils/index.ts +0 -2
- package/src/utils/inspector-visibility.test.ts +26 -0
- package/src/utils/inspector-visibility.ts +35 -3
- package/src/utils/json-schema.ts +5 -152
- package/src/utils/random-id.ts +17 -37
- package/src/utils/types.ts +4 -11
- package/tsconfig.json +3 -1
- package/tsdown.config.ts +2 -19
- package/dist/event-transforms/index.cjs +0 -15
- package/dist/event-transforms/index.d.cts +0 -4
- package/dist/event-transforms/index.d.mts +0 -4
- package/dist/event-transforms/index.mjs +0 -5
- package/dist/event-transforms/open-generative-ui-middleware.cjs +0 -286
- package/dist/event-transforms/open-generative-ui-middleware.cjs.map +0 -1
- package/dist/event-transforms/open-generative-ui-middleware.d.cts +0 -60
- package/dist/event-transforms/open-generative-ui-middleware.d.cts.map +0 -1
- package/dist/event-transforms/open-generative-ui-middleware.d.mts +0 -60
- package/dist/event-transforms/open-generative-ui-middleware.d.mts.map +0 -1
- package/dist/event-transforms/open-generative-ui-middleware.mjs +0 -283
- package/dist/event-transforms/open-generative-ui-middleware.mjs.map +0 -1
- package/dist/event-transforms/recorded-events.cjs +0 -59
- package/dist/event-transforms/recorded-events.cjs.map +0 -1
- package/dist/event-transforms/recorded-events.d.cts +0 -23
- package/dist/event-transforms/recorded-events.d.cts.map +0 -1
- package/dist/event-transforms/recorded-events.d.mts +0 -23
- package/dist/event-transforms/recorded-events.d.mts.map +0 -1
- package/dist/event-transforms/recorded-events.mjs +0 -58
- package/dist/event-transforms/recorded-events.mjs.map +0 -1
- package/dist/telemetry/events.d.cts +0 -72
- package/dist/telemetry/events.d.cts.map +0 -1
- package/dist/telemetry/events.d.mts +0 -72
- package/dist/telemetry/events.d.mts.map +0 -1
- package/dist/telemetry/index.cjs +0 -18
- package/dist/telemetry/index.d.cts +0 -5
- package/dist/telemetry/index.d.mts +0 -5
- package/dist/telemetry/index.mjs +0 -6
- package/dist/telemetry/telemetry-client.cjs +0 -165
- package/dist/telemetry/telemetry-client.cjs.map +0 -1
- package/dist/telemetry/telemetry-client.d.cts +0 -87
- package/dist/telemetry/telemetry-client.d.cts.map +0 -1
- package/dist/telemetry/telemetry-client.d.mts +0 -87
- package/dist/telemetry/telemetry-client.d.mts.map +0 -1
- package/dist/telemetry/telemetry-client.mjs +0 -164
- package/dist/telemetry/telemetry-client.mjs.map +0 -1
- package/dist/telemetry/utils.cjs +0 -14
- package/dist/telemetry/utils.cjs.map +0 -1
- package/dist/telemetry/utils.mjs +0 -13
- package/dist/telemetry/utils.mjs.map +0 -1
- package/dist/utils/conditions.cjs +0 -32
- package/dist/utils/conditions.cjs.map +0 -1
- package/dist/utils/conditions.d.cts +0 -31
- package/dist/utils/conditions.d.cts.map +0 -1
- package/dist/utils/conditions.d.mts +0 -31
- package/dist/utils/conditions.d.mts.map +0 -1
- package/dist/utils/conditions.mjs +0 -31
- package/dist/utils/conditions.mjs.map +0 -1
- package/dist/utils/console-styling.cjs +0 -91
- package/dist/utils/console-styling.cjs.map +0 -1
- package/dist/utils/console-styling.d.cts +0 -65
- package/dist/utils/console-styling.d.cts.map +0 -1
- package/dist/utils/console-styling.d.mts +0 -65
- package/dist/utils/console-styling.d.mts.map +0 -1
- package/dist/utils/console-styling.mjs +0 -85
- package/dist/utils/console-styling.mjs.map +0 -1
- package/src/__tests__/zod-regression.test.ts +0 -319
- package/src/event-transforms/index.ts +0 -5
- package/src/event-transforms/open-generative-ui-middleware.ts +0 -392
- package/src/event-transforms/recorded-events.test.ts +0 -166
- package/src/event-transforms/recorded-events.ts +0 -74
- package/src/telemetry/events.ts +0 -68
- package/src/telemetry/index.ts +0 -9
- package/src/telemetry/telemetry-blank-license-identity.test.ts +0 -128
- package/src/telemetry/telemetry-client.test.ts +0 -798
- package/src/telemetry/telemetry-client.ts +0 -328
- package/src/telemetry/utils.ts +0 -15
- package/src/utils/__tests__/conditions.test.ts +0 -161
- package/src/utils/conditions.ts +0 -116
- package/src/utils/console-styling.ts +0 -126
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/generative-ui/standard/composites.d.ts
|
|
4
|
+
declare const linkCardSchema: z.ZodObject<{
|
|
5
|
+
href: z.ZodString;
|
|
6
|
+
title: z.ZodString;
|
|
7
|
+
description: z.ZodOptional<z.ZodString>;
|
|
8
|
+
image: z.ZodOptional<z.ZodString>;
|
|
9
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
10
|
+
favicon: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
declare const citationSchema: z.ZodObject<{
|
|
13
|
+
index: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
label: z.ZodOptional<z.ZodString>;
|
|
15
|
+
title: z.ZodOptional<z.ZodString>;
|
|
16
|
+
url: z.ZodOptional<z.ZodString>;
|
|
17
|
+
snippet: z.ZodOptional<z.ZodString>;
|
|
18
|
+
source: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
declare const followUpItem: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
21
|
+
label: z.ZodString;
|
|
22
|
+
message: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.core.$strip>]>;
|
|
24
|
+
declare const followUpSchema: z.ZodObject<{
|
|
25
|
+
items: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
26
|
+
label: z.ZodString;
|
|
27
|
+
message: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}, z.core.$strip>]>>>;
|
|
29
|
+
title: z.ZodOptional<z.ZodString>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
declare const followUpArgs: z.ZodObject<{
|
|
32
|
+
message: z.ZodString;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
declare const cardAction: z.ZodObject<{
|
|
35
|
+
label: z.ZodString;
|
|
36
|
+
href: z.ZodOptional<z.ZodString>;
|
|
37
|
+
variant: z.ZodOptional<z.ZodEnum<{
|
|
38
|
+
outline: "outline";
|
|
39
|
+
soft: "soft";
|
|
40
|
+
solid: "solid";
|
|
41
|
+
ghost: "ghost";
|
|
42
|
+
}>>;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
declare const entityCardSchema: z.ZodObject<{
|
|
45
|
+
title: z.ZodString;
|
|
46
|
+
subtitle: z.ZodOptional<z.ZodString>;
|
|
47
|
+
description: z.ZodOptional<z.ZodString>;
|
|
48
|
+
image: z.ZodOptional<z.ZodString>;
|
|
49
|
+
imageAspectRatio: z.ZodOptional<z.ZodString>;
|
|
50
|
+
meta: z.ZodOptional<z.ZodString>;
|
|
51
|
+
badge: z.ZodOptional<z.ZodObject<{
|
|
52
|
+
label: z.ZodString;
|
|
53
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
54
|
+
secondary: "secondary";
|
|
55
|
+
success: "success";
|
|
56
|
+
info: "info";
|
|
57
|
+
warning: "warning";
|
|
58
|
+
danger: "danger";
|
|
59
|
+
discovery: "discovery";
|
|
60
|
+
}>>;
|
|
61
|
+
}, z.core.$strip>>;
|
|
62
|
+
rating: z.ZodOptional<z.ZodNumber>;
|
|
63
|
+
ratingCount: z.ZodOptional<z.ZodNumber>;
|
|
64
|
+
href: z.ZodOptional<z.ZodString>;
|
|
65
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
66
|
+
label: z.ZodString;
|
|
67
|
+
href: z.ZodOptional<z.ZodString>;
|
|
68
|
+
variant: z.ZodOptional<z.ZodEnum<{
|
|
69
|
+
outline: "outline";
|
|
70
|
+
soft: "soft";
|
|
71
|
+
solid: "solid";
|
|
72
|
+
ghost: "ghost";
|
|
73
|
+
}>>;
|
|
74
|
+
}, z.core.$strip>>>;
|
|
75
|
+
layout: z.ZodOptional<z.ZodEnum<{
|
|
76
|
+
horizontal: "horizontal";
|
|
77
|
+
vertical: "vertical";
|
|
78
|
+
}>>;
|
|
79
|
+
width: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
declare const entityActionArgs: z.ZodObject<{
|
|
82
|
+
label: z.ZodString;
|
|
83
|
+
}, z.core.$strip>;
|
|
84
|
+
declare const gridImage: z.ZodObject<{
|
|
85
|
+
url: z.ZodString;
|
|
86
|
+
description: z.ZodOptional<z.ZodString>;
|
|
87
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
88
|
+
href: z.ZodOptional<z.ZodString>;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
declare const imageGridSchema: z.ZodObject<{
|
|
91
|
+
images: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
92
|
+
url: z.ZodString;
|
|
93
|
+
description: z.ZodOptional<z.ZodString>;
|
|
94
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
95
|
+
href: z.ZodOptional<z.ZodString>;
|
|
96
|
+
}, z.core.$strip>>>;
|
|
97
|
+
columns: z.ZodOptional<z.ZodNumber>;
|
|
98
|
+
aspectRatio: z.ZodOptional<z.ZodString>;
|
|
99
|
+
gap: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
100
|
+
layout: z.ZodOptional<z.ZodEnum<{
|
|
101
|
+
grid: "grid";
|
|
102
|
+
bento: "bento";
|
|
103
|
+
}>>;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
/**
|
|
106
|
+
* The standard composite components, without their framework components.
|
|
107
|
+
*
|
|
108
|
+
* - LinkCard and EntityCard open `href`, or send `onClick` when it is bound.
|
|
109
|
+
* - FollowUp sends `onFollowUp` with the message of the pill. Unbound, the
|
|
110
|
+
* engine turns it into a visible user message with that text.
|
|
111
|
+
* - EntityCard buttons without href send `onAction` with their label.
|
|
112
|
+
*/
|
|
113
|
+
declare const compositeDeclarations: {
|
|
114
|
+
LinkCard: {
|
|
115
|
+
description: string;
|
|
116
|
+
props: z.ZodObject<{
|
|
117
|
+
href: z.ZodString;
|
|
118
|
+
title: z.ZodString;
|
|
119
|
+
description: z.ZodOptional<z.ZodString>;
|
|
120
|
+
image: z.ZodOptional<z.ZodString>;
|
|
121
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
122
|
+
favicon: z.ZodOptional<z.ZodBoolean>;
|
|
123
|
+
}, z.core.$strip>;
|
|
124
|
+
events: {
|
|
125
|
+
onClick: {
|
|
126
|
+
description: string;
|
|
127
|
+
parameters: z.ZodObject<{}, z.core.$strip>;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
Citation: {
|
|
132
|
+
description: string;
|
|
133
|
+
props: z.ZodObject<{
|
|
134
|
+
index: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
label: z.ZodOptional<z.ZodString>;
|
|
136
|
+
title: z.ZodOptional<z.ZodString>;
|
|
137
|
+
url: z.ZodOptional<z.ZodString>;
|
|
138
|
+
snippet: z.ZodOptional<z.ZodString>;
|
|
139
|
+
source: z.ZodOptional<z.ZodString>;
|
|
140
|
+
}, z.core.$strip>;
|
|
141
|
+
};
|
|
142
|
+
FollowUp: {
|
|
143
|
+
description: string;
|
|
144
|
+
props: z.ZodObject<{
|
|
145
|
+
items: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
146
|
+
label: z.ZodString;
|
|
147
|
+
message: z.ZodOptional<z.ZodString>;
|
|
148
|
+
}, z.core.$strip>]>>>;
|
|
149
|
+
title: z.ZodOptional<z.ZodString>;
|
|
150
|
+
}, z.core.$strip>;
|
|
151
|
+
events: {
|
|
152
|
+
onFollowUp: {
|
|
153
|
+
description: string;
|
|
154
|
+
parameters: z.ZodObject<{
|
|
155
|
+
message: z.ZodString;
|
|
156
|
+
}, z.core.$strip>;
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
EntityCard: {
|
|
161
|
+
description: string;
|
|
162
|
+
props: z.ZodObject<{
|
|
163
|
+
title: z.ZodString;
|
|
164
|
+
subtitle: z.ZodOptional<z.ZodString>;
|
|
165
|
+
description: z.ZodOptional<z.ZodString>;
|
|
166
|
+
image: z.ZodOptional<z.ZodString>;
|
|
167
|
+
imageAspectRatio: z.ZodOptional<z.ZodString>;
|
|
168
|
+
meta: z.ZodOptional<z.ZodString>;
|
|
169
|
+
badge: z.ZodOptional<z.ZodObject<{
|
|
170
|
+
label: z.ZodString;
|
|
171
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
172
|
+
secondary: "secondary";
|
|
173
|
+
success: "success";
|
|
174
|
+
info: "info";
|
|
175
|
+
warning: "warning";
|
|
176
|
+
danger: "danger";
|
|
177
|
+
discovery: "discovery";
|
|
178
|
+
}>>;
|
|
179
|
+
}, z.core.$strip>>;
|
|
180
|
+
rating: z.ZodOptional<z.ZodNumber>;
|
|
181
|
+
ratingCount: z.ZodOptional<z.ZodNumber>;
|
|
182
|
+
href: z.ZodOptional<z.ZodString>;
|
|
183
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
184
|
+
label: z.ZodString;
|
|
185
|
+
href: z.ZodOptional<z.ZodString>;
|
|
186
|
+
variant: z.ZodOptional<z.ZodEnum<{
|
|
187
|
+
outline: "outline";
|
|
188
|
+
soft: "soft";
|
|
189
|
+
solid: "solid";
|
|
190
|
+
ghost: "ghost";
|
|
191
|
+
}>>;
|
|
192
|
+
}, z.core.$strip>>>;
|
|
193
|
+
layout: z.ZodOptional<z.ZodEnum<{
|
|
194
|
+
horizontal: "horizontal";
|
|
195
|
+
vertical: "vertical";
|
|
196
|
+
}>>;
|
|
197
|
+
width: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
198
|
+
}, z.core.$strip>;
|
|
199
|
+
events: {
|
|
200
|
+
onClick: {
|
|
201
|
+
description: string;
|
|
202
|
+
parameters: z.ZodObject<{}, z.core.$strip>;
|
|
203
|
+
};
|
|
204
|
+
onAction: {
|
|
205
|
+
description: string;
|
|
206
|
+
parameters: z.ZodObject<{
|
|
207
|
+
label: z.ZodString;
|
|
208
|
+
}, z.core.$strip>;
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
ImageGrid: {
|
|
213
|
+
description: string;
|
|
214
|
+
props: z.ZodObject<{
|
|
215
|
+
images: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
216
|
+
url: z.ZodString;
|
|
217
|
+
description: z.ZodOptional<z.ZodString>;
|
|
218
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
219
|
+
href: z.ZodOptional<z.ZodString>;
|
|
220
|
+
}, z.core.$strip>>>;
|
|
221
|
+
columns: z.ZodOptional<z.ZodNumber>;
|
|
222
|
+
aspectRatio: z.ZodOptional<z.ZodString>;
|
|
223
|
+
gap: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
224
|
+
layout: z.ZodOptional<z.ZodEnum<{
|
|
225
|
+
grid: "grid";
|
|
226
|
+
bento: "bento";
|
|
227
|
+
}>>;
|
|
228
|
+
}, z.core.$strip>;
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
//#endregion
|
|
232
|
+
export { cardAction, citationSchema, compositeDeclarations, entityActionArgs, entityCardSchema, followUpArgs, followUpItem, followUpSchema, gridImage, imageGridSchema, linkCardSchema };
|
|
233
|
+
//# sourceMappingURL=composites.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composites.d.cts","names":[],"sources":["../../../src/generative-ui/standard/composites.ts"],"mappings":";;;cAQa,cAAA,EAAc,CAAA,CAAA,SAAA;;;;;;;;cAQd,cAAA,EAAc,CAAA,CAAA,SAAA;;;;;;;;cAQd,YAAA,EAAY,CAAA,CAAA,QAAA,WAAA,CAAA,CAAA,SAAA,EAAA,CAAA,CAAA,SAAA;;;;cAOZ,cAAA,EAAc,CAAA,CAAA,SAAA;;;;;;;cAId,YAAA,EAAY,CAAA,CAAA,SAAA;;;cAWZ,UAAA,EAAU,CAAA,CAAA,SAAA;;;;;;;;;;cAKV,gBAAA,EAAgB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA4BhB,gBAAA,EAAgB,CAAA,CAAA,SAAA;;;cAGhB,SAAA,EAAS,CAAA,CAAA,SAAA;;;;;;cAMT,eAAA,EAAe,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;AAhE5B;cAmFa,qBAAA"}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/generative-ui/standard/composites.d.ts
|
|
4
|
+
declare const linkCardSchema: z.ZodObject<{
|
|
5
|
+
href: z.ZodString;
|
|
6
|
+
title: z.ZodString;
|
|
7
|
+
description: z.ZodOptional<z.ZodString>;
|
|
8
|
+
image: z.ZodOptional<z.ZodString>;
|
|
9
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
10
|
+
favicon: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
declare const citationSchema: z.ZodObject<{
|
|
13
|
+
index: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
label: z.ZodOptional<z.ZodString>;
|
|
15
|
+
title: z.ZodOptional<z.ZodString>;
|
|
16
|
+
url: z.ZodOptional<z.ZodString>;
|
|
17
|
+
snippet: z.ZodOptional<z.ZodString>;
|
|
18
|
+
source: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
declare const followUpItem: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
21
|
+
label: z.ZodString;
|
|
22
|
+
message: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.core.$strip>]>;
|
|
24
|
+
declare const followUpSchema: z.ZodObject<{
|
|
25
|
+
items: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
26
|
+
label: z.ZodString;
|
|
27
|
+
message: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}, z.core.$strip>]>>>;
|
|
29
|
+
title: z.ZodOptional<z.ZodString>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
declare const followUpArgs: z.ZodObject<{
|
|
32
|
+
message: z.ZodString;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
declare const cardAction: z.ZodObject<{
|
|
35
|
+
label: z.ZodString;
|
|
36
|
+
href: z.ZodOptional<z.ZodString>;
|
|
37
|
+
variant: z.ZodOptional<z.ZodEnum<{
|
|
38
|
+
outline: "outline";
|
|
39
|
+
soft: "soft";
|
|
40
|
+
solid: "solid";
|
|
41
|
+
ghost: "ghost";
|
|
42
|
+
}>>;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
declare const entityCardSchema: z.ZodObject<{
|
|
45
|
+
title: z.ZodString;
|
|
46
|
+
subtitle: z.ZodOptional<z.ZodString>;
|
|
47
|
+
description: z.ZodOptional<z.ZodString>;
|
|
48
|
+
image: z.ZodOptional<z.ZodString>;
|
|
49
|
+
imageAspectRatio: z.ZodOptional<z.ZodString>;
|
|
50
|
+
meta: z.ZodOptional<z.ZodString>;
|
|
51
|
+
badge: z.ZodOptional<z.ZodObject<{
|
|
52
|
+
label: z.ZodString;
|
|
53
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
54
|
+
secondary: "secondary";
|
|
55
|
+
success: "success";
|
|
56
|
+
info: "info";
|
|
57
|
+
warning: "warning";
|
|
58
|
+
danger: "danger";
|
|
59
|
+
discovery: "discovery";
|
|
60
|
+
}>>;
|
|
61
|
+
}, z.core.$strip>>;
|
|
62
|
+
rating: z.ZodOptional<z.ZodNumber>;
|
|
63
|
+
ratingCount: z.ZodOptional<z.ZodNumber>;
|
|
64
|
+
href: z.ZodOptional<z.ZodString>;
|
|
65
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
66
|
+
label: z.ZodString;
|
|
67
|
+
href: z.ZodOptional<z.ZodString>;
|
|
68
|
+
variant: z.ZodOptional<z.ZodEnum<{
|
|
69
|
+
outline: "outline";
|
|
70
|
+
soft: "soft";
|
|
71
|
+
solid: "solid";
|
|
72
|
+
ghost: "ghost";
|
|
73
|
+
}>>;
|
|
74
|
+
}, z.core.$strip>>>;
|
|
75
|
+
layout: z.ZodOptional<z.ZodEnum<{
|
|
76
|
+
horizontal: "horizontal";
|
|
77
|
+
vertical: "vertical";
|
|
78
|
+
}>>;
|
|
79
|
+
width: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
declare const entityActionArgs: z.ZodObject<{
|
|
82
|
+
label: z.ZodString;
|
|
83
|
+
}, z.core.$strip>;
|
|
84
|
+
declare const gridImage: z.ZodObject<{
|
|
85
|
+
url: z.ZodString;
|
|
86
|
+
description: z.ZodOptional<z.ZodString>;
|
|
87
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
88
|
+
href: z.ZodOptional<z.ZodString>;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
declare const imageGridSchema: z.ZodObject<{
|
|
91
|
+
images: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
92
|
+
url: z.ZodString;
|
|
93
|
+
description: z.ZodOptional<z.ZodString>;
|
|
94
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
95
|
+
href: z.ZodOptional<z.ZodString>;
|
|
96
|
+
}, z.core.$strip>>>;
|
|
97
|
+
columns: z.ZodOptional<z.ZodNumber>;
|
|
98
|
+
aspectRatio: z.ZodOptional<z.ZodString>;
|
|
99
|
+
gap: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
100
|
+
layout: z.ZodOptional<z.ZodEnum<{
|
|
101
|
+
grid: "grid";
|
|
102
|
+
bento: "bento";
|
|
103
|
+
}>>;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
/**
|
|
106
|
+
* The standard composite components, without their framework components.
|
|
107
|
+
*
|
|
108
|
+
* - LinkCard and EntityCard open `href`, or send `onClick` when it is bound.
|
|
109
|
+
* - FollowUp sends `onFollowUp` with the message of the pill. Unbound, the
|
|
110
|
+
* engine turns it into a visible user message with that text.
|
|
111
|
+
* - EntityCard buttons without href send `onAction` with their label.
|
|
112
|
+
*/
|
|
113
|
+
declare const compositeDeclarations: {
|
|
114
|
+
LinkCard: {
|
|
115
|
+
description: string;
|
|
116
|
+
props: z.ZodObject<{
|
|
117
|
+
href: z.ZodString;
|
|
118
|
+
title: z.ZodString;
|
|
119
|
+
description: z.ZodOptional<z.ZodString>;
|
|
120
|
+
image: z.ZodOptional<z.ZodString>;
|
|
121
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
122
|
+
favicon: z.ZodOptional<z.ZodBoolean>;
|
|
123
|
+
}, z.core.$strip>;
|
|
124
|
+
events: {
|
|
125
|
+
onClick: {
|
|
126
|
+
description: string;
|
|
127
|
+
parameters: z.ZodObject<{}, z.core.$strip>;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
Citation: {
|
|
132
|
+
description: string;
|
|
133
|
+
props: z.ZodObject<{
|
|
134
|
+
index: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
label: z.ZodOptional<z.ZodString>;
|
|
136
|
+
title: z.ZodOptional<z.ZodString>;
|
|
137
|
+
url: z.ZodOptional<z.ZodString>;
|
|
138
|
+
snippet: z.ZodOptional<z.ZodString>;
|
|
139
|
+
source: z.ZodOptional<z.ZodString>;
|
|
140
|
+
}, z.core.$strip>;
|
|
141
|
+
};
|
|
142
|
+
FollowUp: {
|
|
143
|
+
description: string;
|
|
144
|
+
props: z.ZodObject<{
|
|
145
|
+
items: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
146
|
+
label: z.ZodString;
|
|
147
|
+
message: z.ZodOptional<z.ZodString>;
|
|
148
|
+
}, z.core.$strip>]>>>;
|
|
149
|
+
title: z.ZodOptional<z.ZodString>;
|
|
150
|
+
}, z.core.$strip>;
|
|
151
|
+
events: {
|
|
152
|
+
onFollowUp: {
|
|
153
|
+
description: string;
|
|
154
|
+
parameters: z.ZodObject<{
|
|
155
|
+
message: z.ZodString;
|
|
156
|
+
}, z.core.$strip>;
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
EntityCard: {
|
|
161
|
+
description: string;
|
|
162
|
+
props: z.ZodObject<{
|
|
163
|
+
title: z.ZodString;
|
|
164
|
+
subtitle: z.ZodOptional<z.ZodString>;
|
|
165
|
+
description: z.ZodOptional<z.ZodString>;
|
|
166
|
+
image: z.ZodOptional<z.ZodString>;
|
|
167
|
+
imageAspectRatio: z.ZodOptional<z.ZodString>;
|
|
168
|
+
meta: z.ZodOptional<z.ZodString>;
|
|
169
|
+
badge: z.ZodOptional<z.ZodObject<{
|
|
170
|
+
label: z.ZodString;
|
|
171
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
172
|
+
secondary: "secondary";
|
|
173
|
+
success: "success";
|
|
174
|
+
info: "info";
|
|
175
|
+
warning: "warning";
|
|
176
|
+
danger: "danger";
|
|
177
|
+
discovery: "discovery";
|
|
178
|
+
}>>;
|
|
179
|
+
}, z.core.$strip>>;
|
|
180
|
+
rating: z.ZodOptional<z.ZodNumber>;
|
|
181
|
+
ratingCount: z.ZodOptional<z.ZodNumber>;
|
|
182
|
+
href: z.ZodOptional<z.ZodString>;
|
|
183
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
184
|
+
label: z.ZodString;
|
|
185
|
+
href: z.ZodOptional<z.ZodString>;
|
|
186
|
+
variant: z.ZodOptional<z.ZodEnum<{
|
|
187
|
+
outline: "outline";
|
|
188
|
+
soft: "soft";
|
|
189
|
+
solid: "solid";
|
|
190
|
+
ghost: "ghost";
|
|
191
|
+
}>>;
|
|
192
|
+
}, z.core.$strip>>>;
|
|
193
|
+
layout: z.ZodOptional<z.ZodEnum<{
|
|
194
|
+
horizontal: "horizontal";
|
|
195
|
+
vertical: "vertical";
|
|
196
|
+
}>>;
|
|
197
|
+
width: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
198
|
+
}, z.core.$strip>;
|
|
199
|
+
events: {
|
|
200
|
+
onClick: {
|
|
201
|
+
description: string;
|
|
202
|
+
parameters: z.ZodObject<{}, z.core.$strip>;
|
|
203
|
+
};
|
|
204
|
+
onAction: {
|
|
205
|
+
description: string;
|
|
206
|
+
parameters: z.ZodObject<{
|
|
207
|
+
label: z.ZodString;
|
|
208
|
+
}, z.core.$strip>;
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
ImageGrid: {
|
|
213
|
+
description: string;
|
|
214
|
+
props: z.ZodObject<{
|
|
215
|
+
images: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
216
|
+
url: z.ZodString;
|
|
217
|
+
description: z.ZodOptional<z.ZodString>;
|
|
218
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
219
|
+
href: z.ZodOptional<z.ZodString>;
|
|
220
|
+
}, z.core.$strip>>>;
|
|
221
|
+
columns: z.ZodOptional<z.ZodNumber>;
|
|
222
|
+
aspectRatio: z.ZodOptional<z.ZodString>;
|
|
223
|
+
gap: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
224
|
+
layout: z.ZodOptional<z.ZodEnum<{
|
|
225
|
+
grid: "grid";
|
|
226
|
+
bento: "bento";
|
|
227
|
+
}>>;
|
|
228
|
+
}, z.core.$strip>;
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
//#endregion
|
|
232
|
+
export { cardAction, citationSchema, compositeDeclarations, entityActionArgs, entityCardSchema, followUpArgs, followUpItem, followUpSchema, gridImage, imageGridSchema, linkCardSchema };
|
|
233
|
+
//# sourceMappingURL=composites.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composites.d.mts","names":[],"sources":["../../../src/generative-ui/standard/composites.ts"],"mappings":";;;cAQa,cAAA,EAAc,CAAA,CAAA,SAAA;;;;;;;;cAQd,cAAA,EAAc,CAAA,CAAA,SAAA;;;;;;;;cAQd,YAAA,EAAY,CAAA,CAAA,QAAA,WAAA,CAAA,CAAA,SAAA,EAAA,CAAA,CAAA,SAAA;;;;cAOZ,cAAA,EAAc,CAAA,CAAA,SAAA;;;;;;;cAId,YAAA,EAAY,CAAA,CAAA,SAAA;;;cAWZ,UAAA,EAAU,CAAA,CAAA,SAAA;;;;;;;;;;cAKV,gBAAA,EAAgB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA4BhB,gBAAA,EAAgB,CAAA,CAAA,SAAA;;;cAGhB,SAAA,EAAS,CAAA,CAAA,SAAA;;;;;;cAMT,eAAA,EAAe,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;AAhE5B;cAmFa,qBAAA"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { NO_ARGS, sizeValue } from "./layout.mjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
//#region src/generative-ui/standard/composites.ts
|
|
5
|
+
const text = (description) => z.string().optional().describe(description);
|
|
6
|
+
const linkCardSchema = z.object({
|
|
7
|
+
href: z.string().describe("The URL (http, https)"),
|
|
8
|
+
title: z.string().describe("The page title"),
|
|
9
|
+
description: text("One or two lines"),
|
|
10
|
+
image: text("A thumbnail URL"),
|
|
11
|
+
domain: text("Shown next to the favicon. Default: the host of href"),
|
|
12
|
+
favicon: z.boolean().optional().describe("Default true")
|
|
13
|
+
});
|
|
14
|
+
const citationSchema = z.object({
|
|
15
|
+
index: z.number().optional().describe("The marker number. Default 1"),
|
|
16
|
+
label: text("Marker text instead of the number, for example a domain"),
|
|
17
|
+
title: text("The source title"),
|
|
18
|
+
url: text("The source URL (http, https)"),
|
|
19
|
+
snippet: text("The quoted passage, one or two lines"),
|
|
20
|
+
source: text("The publisher or domain. Default: the host of url")
|
|
21
|
+
});
|
|
22
|
+
const followUpItem = z.union([z.string(), z.object({
|
|
23
|
+
label: z.string(),
|
|
24
|
+
message: text("The text sent when the user clicks. Default: label")
|
|
25
|
+
})]);
|
|
26
|
+
const followUpSchema = z.object({
|
|
27
|
+
items: z.array(followUpItem).optional(),
|
|
28
|
+
title: text("A caption above the pills")
|
|
29
|
+
});
|
|
30
|
+
const followUpArgs = z.object({ message: z.string().describe("The message of the clicked pill") });
|
|
31
|
+
const BADGE_COLORS = [
|
|
32
|
+
"secondary",
|
|
33
|
+
"success",
|
|
34
|
+
"danger",
|
|
35
|
+
"warning",
|
|
36
|
+
"info",
|
|
37
|
+
"discovery"
|
|
38
|
+
];
|
|
39
|
+
const cardAction = z.object({
|
|
40
|
+
label: z.string(),
|
|
41
|
+
href: text("Opens this URL in a new tab"),
|
|
42
|
+
variant: z.enum([
|
|
43
|
+
"solid",
|
|
44
|
+
"soft",
|
|
45
|
+
"outline",
|
|
46
|
+
"ghost"
|
|
47
|
+
]).optional()
|
|
48
|
+
});
|
|
49
|
+
const entityCardSchema = z.object({
|
|
50
|
+
title: z.string().describe("The name"),
|
|
51
|
+
subtitle: text("A second line, for example the brand or category"),
|
|
52
|
+
description: text("Up to three lines"),
|
|
53
|
+
image: text("An image URL"),
|
|
54
|
+
imageAspectRatio: z.string().optional().describe("Default \"4 / 3\""),
|
|
55
|
+
meta: text("A short fact line, for example \"$29 / month\" or \"Open until 22:00\""),
|
|
56
|
+
badge: z.object({
|
|
57
|
+
label: z.string(),
|
|
58
|
+
color: z.enum(BADGE_COLORS).optional()
|
|
59
|
+
}).optional(),
|
|
60
|
+
rating: z.number().optional().describe("0 to 5, shown as stars"),
|
|
61
|
+
ratingCount: z.number().optional().describe("The number of ratings"),
|
|
62
|
+
href: text("Opens this URL in a new tab when the user clicks the card"),
|
|
63
|
+
actions: z.array(cardAction).max(3).optional().describe("Up to three buttons. A button without href sends onAction with its label"),
|
|
64
|
+
layout: z.enum(["vertical", "horizontal"]).optional().describe("Default \"vertical\". \"horizontal\" puts the image on the left"),
|
|
65
|
+
width: sizeValue.optional()
|
|
66
|
+
});
|
|
67
|
+
const entityActionArgs = z.object({ label: z.string().describe("The label of the clicked button") });
|
|
68
|
+
const gridImage = z.object({
|
|
69
|
+
url: z.string(),
|
|
70
|
+
description: z.string().optional().describe("What the image shows"),
|
|
71
|
+
caption: z.string().optional(),
|
|
72
|
+
href: text("Opens this URL instead of the full-screen view")
|
|
73
|
+
});
|
|
74
|
+
const imageGridSchema = z.object({
|
|
75
|
+
images: z.array(gridImage).optional(),
|
|
76
|
+
columns: z.number().optional().describe("Default 3"),
|
|
77
|
+
aspectRatio: z.string().optional().describe("Default \"1 / 1\""),
|
|
78
|
+
gap: sizeValue.optional().describe("Default 2"),
|
|
79
|
+
layout: z.enum(["grid", "bento"]).optional().describe("Default \"grid\". \"bento\" makes the first image twice as large")
|
|
80
|
+
});
|
|
81
|
+
/**
|
|
82
|
+
* The standard composite components, without their framework components.
|
|
83
|
+
*
|
|
84
|
+
* - LinkCard and EntityCard open `href`, or send `onClick` when it is bound.
|
|
85
|
+
* - FollowUp sends `onFollowUp` with the message of the pill. Unbound, the
|
|
86
|
+
* engine turns it into a visible user message with that text.
|
|
87
|
+
* - EntityCard buttons without href send `onAction` with their label.
|
|
88
|
+
*/
|
|
89
|
+
const compositeDeclarations = {
|
|
90
|
+
LinkCard: {
|
|
91
|
+
description: "A preview of a URL: favicon and domain, title, description, thumbnail. A click opens it in a new tab, or sends onClick when bound. For sources, articles and products with a page.",
|
|
92
|
+
props: linkCardSchema,
|
|
93
|
+
events: { onClick: {
|
|
94
|
+
description: "Sent when the user clicks the card, instead of the link.",
|
|
95
|
+
parameters: NO_ARGS
|
|
96
|
+
} }
|
|
97
|
+
},
|
|
98
|
+
Citation: {
|
|
99
|
+
description: "An inline source marker ([1]) showing title, snippet and link on hover or click. Put it right after the sentence it supports, as a child of a Text or in a Row.",
|
|
100
|
+
props: citationSchema
|
|
101
|
+
},
|
|
102
|
+
FollowUp: {
|
|
103
|
+
description: "Suggested next prompts as pills; a click sends the pill's message as the user's next turn, no event needed. At the end of a surface, two to four short items.",
|
|
104
|
+
props: followUpSchema,
|
|
105
|
+
events: { onFollowUp: {
|
|
106
|
+
description: "Sent when the user clicks a pill. The args carry the message of the pill.",
|
|
107
|
+
parameters: followUpArgs
|
|
108
|
+
} }
|
|
109
|
+
},
|
|
110
|
+
EntityCard: {
|
|
111
|
+
description: "A card for one product, place, person or listing: image, title, subtitle, description, a price or meta line, badge, rating and up to three buttons. href opens a page; onClick is sent when bound. Use a Grid of them for several things.",
|
|
112
|
+
props: entityCardSchema,
|
|
113
|
+
events: {
|
|
114
|
+
onClick: {
|
|
115
|
+
description: "Sent when the user clicks the card and it has no href.",
|
|
116
|
+
parameters: NO_ARGS
|
|
117
|
+
},
|
|
118
|
+
onAction: {
|
|
119
|
+
description: "Sent when the user clicks a button without href. The args carry the label of the button.",
|
|
120
|
+
parameters: entityActionArgs
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
ImageGrid: {
|
|
125
|
+
description: "A gallery of images in a grid. A click opens the image full-screen, with arrows to the other images. layout \"bento\" makes the first image twice as large.",
|
|
126
|
+
props: imageGridSchema
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
//#endregion
|
|
131
|
+
export { cardAction, citationSchema, compositeDeclarations, entityActionArgs, entityCardSchema, followUpArgs, followUpItem, followUpSchema, gridImage, imageGridSchema, linkCardSchema };
|
|
132
|
+
//# sourceMappingURL=composites.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composites.mjs","names":[],"sources":["../../../src/generative-ui/standard/composites.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { NO_ARGS, sizeValue } from \"./layout\";\n\n// ---- Schemas ----\n\nconst text = (description: string) =>\n z.string().optional().describe(description);\n\nexport const linkCardSchema = z.object({\n href: z.string().describe(\"The URL (http, https)\"),\n title: z.string().describe(\"The page title\"),\n description: text(\"One or two lines\"),\n image: text(\"A thumbnail URL\"),\n domain: text(\"Shown next to the favicon. Default: the host of href\"),\n favicon: z.boolean().optional().describe(\"Default true\"),\n});\nexport const citationSchema = z.object({\n index: z.number().optional().describe(\"The marker number. Default 1\"),\n label: text(\"Marker text instead of the number, for example a domain\"),\n title: text(\"The source title\"),\n url: text(\"The source URL (http, https)\"),\n snippet: text(\"The quoted passage, one or two lines\"),\n source: text(\"The publisher or domain. Default: the host of url\"),\n});\nexport const followUpItem = z.union([\n z.string(),\n z.object({\n label: z.string(),\n message: text(\"The text sent when the user clicks. Default: label\"),\n }),\n]);\nexport const followUpSchema = z.object({\n items: z.array(followUpItem).optional(),\n title: text(\"A caption above the pills\"),\n});\nexport const followUpArgs = z.object({\n message: z.string().describe(\"The message of the clicked pill\"),\n});\nconst BADGE_COLORS = [\n \"secondary\",\n \"success\",\n \"danger\",\n \"warning\",\n \"info\",\n \"discovery\",\n] as const;\nexport const cardAction = z.object({\n label: z.string(),\n href: text(\"Opens this URL in a new tab\"),\n variant: z.enum([\"solid\", \"soft\", \"outline\", \"ghost\"]).optional(),\n});\nexport const entityCardSchema = z.object({\n title: z.string().describe(\"The name\"),\n subtitle: text(\"A second line, for example the brand or category\"),\n description: text(\"Up to three lines\"),\n image: text(\"An image URL\"),\n imageAspectRatio: z.string().optional().describe('Default \"4 / 3\"'),\n meta: text(\n 'A short fact line, for example \"$29 / month\" or \"Open until 22:00\"',\n ),\n badge: z\n .object({ label: z.string(), color: z.enum(BADGE_COLORS).optional() })\n .optional(),\n rating: z.number().optional().describe(\"0 to 5, shown as stars\"),\n ratingCount: z.number().optional().describe(\"The number of ratings\"),\n href: text(\"Opens this URL in a new tab when the user clicks the card\"),\n actions: z\n .array(cardAction)\n .max(3)\n .optional()\n .describe(\n \"Up to three buttons. A button without href sends onAction with its label\",\n ),\n layout: z\n .enum([\"vertical\", \"horizontal\"])\n .optional()\n .describe('Default \"vertical\". \"horizontal\" puts the image on the left'),\n width: sizeValue.optional(),\n});\nexport const entityActionArgs = z.object({\n label: z.string().describe(\"The label of the clicked button\"),\n});\nexport const gridImage = z.object({\n url: z.string(),\n description: z.string().optional().describe(\"What the image shows\"),\n caption: z.string().optional(),\n href: text(\"Opens this URL instead of the full-screen view\"),\n});\nexport const imageGridSchema = z.object({\n images: z.array(gridImage).optional(),\n columns: z.number().optional().describe(\"Default 3\"),\n aspectRatio: z.string().optional().describe('Default \"1 / 1\"'),\n gap: sizeValue.optional().describe(\"Default 2\"),\n layout: z\n .enum([\"grid\", \"bento\"])\n .optional()\n .describe('Default \"grid\". \"bento\" makes the first image twice as large'),\n});\n\n/**\n * The standard composite components, without their framework components.\n *\n * - LinkCard and EntityCard open `href`, or send `onClick` when it is bound.\n * - FollowUp sends `onFollowUp` with the message of the pill. Unbound, the\n * engine turns it into a visible user message with that text.\n * - EntityCard buttons without href send `onAction` with their label.\n */\nexport const compositeDeclarations = {\n LinkCard: {\n description:\n \"A preview of a URL: favicon and domain, title, description, thumbnail. A click opens it in a new tab, or sends onClick when bound. For sources, articles and products with a page.\",\n props: linkCardSchema,\n events: {\n onClick: {\n description: \"Sent when the user clicks the card, instead of the link.\",\n parameters: NO_ARGS,\n },\n },\n },\n Citation: {\n description:\n \"An inline source marker ([1]) showing title, snippet and link on hover or click. Put it right after the sentence it supports, as a child of a Text or in a Row.\",\n props: citationSchema,\n },\n FollowUp: {\n description:\n \"Suggested next prompts as pills; a click sends the pill's message as the user's next turn, no event needed. At the end of a surface, two to four short items.\",\n props: followUpSchema,\n events: {\n onFollowUp: {\n description:\n \"Sent when the user clicks a pill. The args carry the message of the pill.\",\n parameters: followUpArgs,\n },\n },\n },\n EntityCard: {\n description:\n \"A card for one product, place, person or listing: image, title, subtitle, description, a price or meta line, badge, rating and up to three buttons. href opens a page; onClick is sent when bound. Use a Grid of them for several things.\",\n props: entityCardSchema,\n events: {\n onClick: {\n description: \"Sent when the user clicks the card and it has no href.\",\n parameters: NO_ARGS,\n },\n onAction: {\n description:\n \"Sent when the user clicks a button without href. The args carry the label of the button.\",\n parameters: entityActionArgs,\n },\n },\n },\n ImageGrid: {\n description:\n 'A gallery of images in a grid. A click opens the image full-screen, with arrows to the other images. layout \"bento\" makes the first image twice as large.',\n props: imageGridSchema,\n },\n};\n"],"mappings":";;;;AAKA,MAAM,QAAQ,gBACZ,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,YAAY;AAE7C,MAAa,iBAAiB,EAAE,OAAO;CACrC,MAAM,EAAE,QAAQ,CAAC,SAAS,wBAAwB;CAClD,OAAO,EAAE,QAAQ,CAAC,SAAS,iBAAiB;CAC5C,aAAa,KAAK,mBAAmB;CACrC,OAAO,KAAK,kBAAkB;CAC9B,QAAQ,KAAK,uDAAuD;CACpE,SAAS,EAAE,SAAS,CAAC,UAAU,CAAC,SAAS,eAAe;CACzD,CAAC;AACF,MAAa,iBAAiB,EAAE,OAAO;CACrC,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,+BAA+B;CACrE,OAAO,KAAK,0DAA0D;CACtE,OAAO,KAAK,mBAAmB;CAC/B,KAAK,KAAK,+BAA+B;CACzC,SAAS,KAAK,uCAAuC;CACrD,QAAQ,KAAK,oDAAoD;CAClE,CAAC;AACF,MAAa,eAAe,EAAE,MAAM,CAClC,EAAE,QAAQ,EACV,EAAE,OAAO;CACP,OAAO,EAAE,QAAQ;CACjB,SAAS,KAAK,qDAAqD;CACpE,CAAC,CACH,CAAC;AACF,MAAa,iBAAiB,EAAE,OAAO;CACrC,OAAO,EAAE,MAAM,aAAa,CAAC,UAAU;CACvC,OAAO,KAAK,4BAA4B;CACzC,CAAC;AACF,MAAa,eAAe,EAAE,OAAO,EACnC,SAAS,EAAE,QAAQ,CAAC,SAAS,kCAAkC,EAChE,CAAC;AACF,MAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACD;AACD,MAAa,aAAa,EAAE,OAAO;CACjC,OAAO,EAAE,QAAQ;CACjB,MAAM,KAAK,8BAA8B;CACzC,SAAS,EAAE,KAAK;EAAC;EAAS;EAAQ;EAAW;EAAQ,CAAC,CAAC,UAAU;CAClE,CAAC;AACF,MAAa,mBAAmB,EAAE,OAAO;CACvC,OAAO,EAAE,QAAQ,CAAC,SAAS,WAAW;CACtC,UAAU,KAAK,mDAAmD;CAClE,aAAa,KAAK,oBAAoB;CACtC,OAAO,KAAK,eAAe;CAC3B,kBAAkB,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,oBAAkB;CACnE,MAAM,KACJ,yEACD;CACD,OAAO,EACJ,OAAO;EAAE,OAAO,EAAE,QAAQ;EAAE,OAAO,EAAE,KAAK,aAAa,CAAC,UAAU;EAAE,CAAC,CACrE,UAAU;CACb,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,yBAAyB;CAChE,aAAa,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,wBAAwB;CACpE,MAAM,KAAK,4DAA4D;CACvE,SAAS,EACN,MAAM,WAAW,CACjB,IAAI,EAAE,CACN,UAAU,CACV,SACC,2EACD;CACH,QAAQ,EACL,KAAK,CAAC,YAAY,aAAa,CAAC,CAChC,UAAU,CACV,SAAS,kEAA8D;CAC1E,OAAO,UAAU,UAAU;CAC5B,CAAC;AACF,MAAa,mBAAmB,EAAE,OAAO,EACvC,OAAO,EAAE,QAAQ,CAAC,SAAS,kCAAkC,EAC9D,CAAC;AACF,MAAa,YAAY,EAAE,OAAO;CAChC,KAAK,EAAE,QAAQ;CACf,aAAa,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,uBAAuB;CACnE,SAAS,EAAE,QAAQ,CAAC,UAAU;CAC9B,MAAM,KAAK,iDAAiD;CAC7D,CAAC;AACF,MAAa,kBAAkB,EAAE,OAAO;CACtC,QAAQ,EAAE,MAAM,UAAU,CAAC,UAAU;CACrC,SAAS,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,YAAY;CACpD,aAAa,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,oBAAkB;CAC9D,KAAK,UAAU,UAAU,CAAC,SAAS,YAAY;CAC/C,QAAQ,EACL,KAAK,CAAC,QAAQ,QAAQ,CAAC,CACvB,UAAU,CACV,SAAS,mEAA+D;CAC5E,CAAC;;;;;;;;;AAUF,MAAa,wBAAwB;CACnC,UAAU;EACR,aACE;EACF,OAAO;EACP,QAAQ,EACN,SAAS;GACP,aAAa;GACb,YAAY;GACb,EACF;EACF;CACD,UAAU;EACR,aACE;EACF,OAAO;EACR;CACD,UAAU;EACR,aACE;EACF,OAAO;EACP,QAAQ,EACN,YAAY;GACV,aACE;GACF,YAAY;GACb,EACF;EACF;CACD,YAAY;EACV,aACE;EACF,OAAO;EACP,QAAQ;GACN,SAAS;IACP,aAAa;IACb,YAAY;IACb;GACD,UAAU;IACR,aACE;IACF,YAAY;IACb;GACF;EACF;CACD,WAAW;EACT,aACE;EACF,OAAO;EACR;CACF"}
|