@copilotkit/shared 2.0.0-rc.31 → 2.0.0-rc.33
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 +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/index.cjs +247 -0
- package/dist/generative-ui/index.d.cts +33 -0
- package/dist/generative-ui/index.d.mts +35 -0
- package/dist/generative-ui/index.mjs +34 -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 +6 -0
- package/dist/generative-ui/is-record.d.cts.map +1 -0
- package/dist/generative-ui/is-record.d.mts +6 -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/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 +16 -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.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/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/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -10
- package/dist/index.d.mts +10 -10
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.mjs +1 -1
- package/package.json +7 -3
- package/src/generative-ui/base.ts +9 -0
- 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/index.ts +7 -0
- package/src/generative-ui/is-record.ts +6 -1
- 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.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 +19 -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.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/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/index.ts +1 -1
- package/tsdown.config.ts +1 -1
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
import { A2UIFunctionPermissions, A2UIFunctionReturnType } from "../basic-functions.mjs";
|
|
2
|
+
import { GenerativeUIComponentManifest } from "../types.mjs";
|
|
3
|
+
import { ChildRef } from "../child-refs.mjs";
|
|
4
|
+
import { StandardSchemaV1 } from "../../standard-schema.mjs";
|
|
5
|
+
import { GenerativeUISchema, SchemaInput, SchemaOutput } from "./schema.mjs";
|
|
6
|
+
import { GenerativeUIChildNode } from "./refs.mjs";
|
|
7
|
+
import { GenerativeUIInvokeResult } from "./errors.mjs";
|
|
8
|
+
|
|
9
|
+
//#region src/generative-ui/catalog/catalog.d.ts
|
|
10
|
+
type GenerativeUISlotKind = "single" | "multiple";
|
|
11
|
+
/**
|
|
12
|
+
* The schema of the props of a component: any Standard Schema of an object,
|
|
13
|
+
* for example `z.object({ ... })` or `v.object({ ... })`. The model gets
|
|
14
|
+
* the props as JSON Schema, so the schema must give one: Standard JSON
|
|
15
|
+
* Schema (zod 4.2+, ArkType, Valibot with `toStandardJsonSchema`).
|
|
16
|
+
* It must validate synchronously, because props are checked while a
|
|
17
|
+
* surface renders.
|
|
18
|
+
*/
|
|
19
|
+
type PropsSchema = StandardSchemaV1<Record<string, unknown>, Record<string, unknown>>;
|
|
20
|
+
/** An event prop of a component. */
|
|
21
|
+
interface GenerativeUIEventDefinition {
|
|
22
|
+
description?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Arguments the component passes when it calls the event prop. An event
|
|
25
|
+
* that matches a declared function can leave this out. Then the function
|
|
26
|
+
* parameters are used.
|
|
27
|
+
*/
|
|
28
|
+
parameters?: GenerativeUISchema;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A function that generated UI can call. The handler comes from
|
|
32
|
+
* `useGenerativeUIFunction`.
|
|
33
|
+
*/
|
|
34
|
+
interface GenerativeUIFunctionDefinition extends A2UIFunctionPermissions {
|
|
35
|
+
description?: string;
|
|
36
|
+
parameters: GenerativeUISchema;
|
|
37
|
+
/**
|
|
38
|
+
* Who may call it. `"rendererOnly"` (the default, as in A2UI 1.0): event
|
|
39
|
+
* bindings and prop values. `"agentOnly"`: `callRendererFunction`.
|
|
40
|
+
* `"rendererOrAgent"`: both. The agent calls only what you allow.
|
|
41
|
+
*/
|
|
42
|
+
allowedCallers?: A2UIFunctionPermissions["allowedCallers"];
|
|
43
|
+
/**
|
|
44
|
+
* True for a function that runs only from a user gesture, like `openUrl`.
|
|
45
|
+
* It is then for the renderer only.
|
|
46
|
+
*/
|
|
47
|
+
requiresUserActivation?: boolean;
|
|
48
|
+
/** What the handler gives back, as A2UI 1.0 names it. */
|
|
49
|
+
returnType?: A2UIFunctionReturnType;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Gives a bound prop its value. It gets the full state and the model-set
|
|
53
|
+
* props of the node, before the props schema parses them (no defaults or
|
|
54
|
+
* transforms). It runs in the browser and must be pure.
|
|
55
|
+
*/
|
|
56
|
+
type GenerativeUISelector = (state: Record<string, unknown>, props: Record<string, unknown>) => unknown;
|
|
57
|
+
/**
|
|
58
|
+
* Method syntax makes the parameters bivariant. So a selector with typed
|
|
59
|
+
* parameters fits this runtime type.
|
|
60
|
+
*/
|
|
61
|
+
type RuntimeSelector = {
|
|
62
|
+
select(state: Record<string, unknown>, props: Record<string, unknown>): unknown;
|
|
63
|
+
}["select"];
|
|
64
|
+
/**
|
|
65
|
+
* Any function or class component. Unlike a framework's component type,
|
|
66
|
+
* checking a value against it does not read the component's props type. So
|
|
67
|
+
* a component can type its props from `typeof ui` without a circular type
|
|
68
|
+
* reference. A framework narrows it with the `TComponent` parameter of
|
|
69
|
+
* `GenerativeUI` and the definition types.
|
|
70
|
+
*/
|
|
71
|
+
type GenerativeUIAnyComponent = ((...args: never) => unknown) | (abstract new (...args: never) => unknown);
|
|
72
|
+
/** One component of a generative UI, as the renderer reads it. */
|
|
73
|
+
interface GenerativeUIComponentDefinition<TComponent = GenerativeUIAnyComponent> {
|
|
74
|
+
component: TComponent;
|
|
75
|
+
description?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Positional prefix across props, slots and events for catalog consumers.
|
|
78
|
+
* Remaining visible keys follow in declaration order (props, slots, events).
|
|
79
|
+
* A2UI exports encode this as property order, not a protocol field.
|
|
80
|
+
*/
|
|
81
|
+
parameterOrder?: readonly string[];
|
|
82
|
+
/** All data props: the props the model sets and the bound props. */
|
|
83
|
+
props?: PropsSchema;
|
|
84
|
+
/** Explicit selectors for bound props. */
|
|
85
|
+
bind?: Record<string, RuntimeSelector>;
|
|
86
|
+
/** Callback props. */
|
|
87
|
+
events?: Record<string, GenerativeUIEventDefinition>;
|
|
88
|
+
/**
|
|
89
|
+
* Child props, filled with rendered child components. A "multiple" slot
|
|
90
|
+
* takes a list of component ids, or a template `{ componentId, path }`
|
|
91
|
+
* that renders one component for each item of the list at `path`.
|
|
92
|
+
*/
|
|
93
|
+
slots?: Record<string, GenerativeUISlotKind>;
|
|
94
|
+
/**
|
|
95
|
+
* Props that the component can write. Each one gets a setter prop named
|
|
96
|
+
* `set` + the prop name: `value` gets `setValue`. When the model binds the
|
|
97
|
+
* prop to `{ "@path" }`, the setter writes the surface data model at that
|
|
98
|
+
* path, and the agent can no longer change that path. Else the setter
|
|
99
|
+
* changes local state only.
|
|
100
|
+
*/
|
|
101
|
+
writable?: readonly string[];
|
|
102
|
+
/**
|
|
103
|
+
* Who applies the `accessibility` envelope of the component: by default
|
|
104
|
+
* the engine, in a wrapper element around the component. `"self"` for a
|
|
105
|
+
* component that must not be wrapped (a table row or cell) and applies
|
|
106
|
+
* the attributes itself with `useGenerativeUIAccessibility()`.
|
|
107
|
+
*/
|
|
108
|
+
accessibility?: "wrapper" | "self";
|
|
109
|
+
}
|
|
110
|
+
/** A component after `createGenerativeUI` resolved its bindings. */
|
|
111
|
+
interface ResolvedGenerativeUIComponent<TComponent = GenerativeUIAnyComponent> extends GenerativeUIComponentDefinition<TComponent> {
|
|
112
|
+
/**
|
|
113
|
+
* One selector for each bound prop. A prop with the name of a top-level
|
|
114
|
+
* state key reads `state[key]`. A `bind` entry wins over the name rule.
|
|
115
|
+
*/
|
|
116
|
+
selectors: Record<string, GenerativeUISelector>;
|
|
117
|
+
/** Event name to the name of the declared function it calls. */
|
|
118
|
+
eventFunctions: Record<string, string>;
|
|
119
|
+
/** The keys of `props`, read from its JSON Schema. */
|
|
120
|
+
propKeys: readonly string[];
|
|
121
|
+
/**
|
|
122
|
+
* The component references in `props` (`child()`, `childList()`), at any
|
|
123
|
+
* depth. The renderer replaces each one with the rendered component. The
|
|
124
|
+
* `slots` of the definition are not in here.
|
|
125
|
+
*/
|
|
126
|
+
childRefs: readonly ChildRef[];
|
|
127
|
+
/** Who applies the `accessibility` envelope; see the definition. */
|
|
128
|
+
accessibility: "wrapper" | "self";
|
|
129
|
+
}
|
|
130
|
+
/** Type-level data of one component, kept in `GenerativeUI["definitions"]`. */
|
|
131
|
+
interface GenerativeUIComponentTypes {
|
|
132
|
+
/** The `props` schema, or `unknown` when the component has none. */
|
|
133
|
+
props: unknown;
|
|
134
|
+
/** The `events` object, or `unknown` when the component has none. */
|
|
135
|
+
events: unknown;
|
|
136
|
+
/** The `slots` object, or `unknown` when the component has none. */
|
|
137
|
+
slots: unknown;
|
|
138
|
+
/** The `writable` list, or `unknown` when the component has none. */
|
|
139
|
+
writable: unknown;
|
|
140
|
+
}
|
|
141
|
+
/** Type-level data of a generative UI, with the keys of its bases merged in. */
|
|
142
|
+
interface GenerativeUIDefinitions {
|
|
143
|
+
state: Record<string, GenerativeUISchema>;
|
|
144
|
+
functions: Record<string, GenerativeUIFunctionDefinition>;
|
|
145
|
+
components: Record<string, GenerativeUIComponentTypes>;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Experimental. The result of `createGenerativeUI`: the components the model
|
|
149
|
+
* can render, the app state they read, and the functions they call. Give it
|
|
150
|
+
* to the provider (`generativeUI={{ ui }}`) and to the typed hooks.
|
|
151
|
+
*/
|
|
152
|
+
interface GenerativeUI<Definitions extends GenerativeUIDefinitions = GenerativeUIDefinitions, TComponent = GenerativeUIAnyComponent> {
|
|
153
|
+
/** Surfaces pin to this id. */
|
|
154
|
+
readonly id: string;
|
|
155
|
+
/** State schemas, bases first. */
|
|
156
|
+
readonly state: ReadonlyMap<string, GenerativeUISchema>;
|
|
157
|
+
/** Declared functions, bases first. */
|
|
158
|
+
readonly functions: ReadonlyMap<string, GenerativeUIFunctionDefinition>;
|
|
159
|
+
/** Components, bases first. */
|
|
160
|
+
readonly components: ReadonlyMap<string, ResolvedGenerativeUIComponent<TComponent>>;
|
|
161
|
+
/** What the model sees: model-set props and unmatched events only. */
|
|
162
|
+
readonly manifestComponents: Record<string, GenerativeUIComponentManifest>;
|
|
163
|
+
/** Type only, never set at runtime. */
|
|
164
|
+
readonly definitions?: Definitions;
|
|
165
|
+
/**
|
|
166
|
+
* A copy without the named components. The model no longer sees them, so
|
|
167
|
+
* the prompt gets smaller. State and functions stay. Call it once, at
|
|
168
|
+
* module level, like `createGenerativeUI`.
|
|
169
|
+
*
|
|
170
|
+
* @throws Error when a name is not a component of this UI.
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* ```ts
|
|
174
|
+
* const ui = createGenerativeUI({
|
|
175
|
+
* id: "acme/app@1",
|
|
176
|
+
* extends: [standardUI.omit(["Map", "Chart"])],
|
|
177
|
+
* components: {},
|
|
178
|
+
* });
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
omit<Names extends keyof Definitions["components"] & string>(names: readonly Names[]): GenerativeUI<OmitComponents<Definitions, Names>, TComponent>;
|
|
182
|
+
}
|
|
183
|
+
/** Definitions without some components. */
|
|
184
|
+
type OmitComponents<Definitions extends GenerativeUIDefinitions, Names extends PropertyKey> = {
|
|
185
|
+
state: Definitions["state"];
|
|
186
|
+
functions: Definitions["functions"];
|
|
187
|
+
components: Omit<Definitions["components"], Names>;
|
|
188
|
+
};
|
|
189
|
+
/** A generative UI of any definitions and any component type. */
|
|
190
|
+
type AnyGenerativeUI = GenerativeUI<any, any>;
|
|
191
|
+
type Simplify<T> = { [Key in keyof T]: T[Key] } & {};
|
|
192
|
+
/** `A | B` to `A & B`. */
|
|
193
|
+
type UnionToIntersection<U> = (U extends unknown ? (value: U) => void : never) extends ((value: infer I) => void) ? I : never;
|
|
194
|
+
type OutputOf<Schema> = SchemaOutput<Schema>;
|
|
195
|
+
type InputOf<Schema> = SchemaInput<Schema>;
|
|
196
|
+
/** The prop names. None for a component without `props`. */
|
|
197
|
+
type PropKeys<Props> = Props extends PropsSchema ? keyof OutputOf<Props> & string : never;
|
|
198
|
+
/** The input type of one prop of a props schema. */
|
|
199
|
+
type PropInput<Props, Key> = Key extends keyof InputOf<Props> ? InputOf<Props>[Key] : never;
|
|
200
|
+
/** The type-level data of a generative UI. */
|
|
201
|
+
type GenerativeUIDefinitionsOf<UI extends AnyGenerativeUI> = NonNullable<UI["definitions"]>;
|
|
202
|
+
type StateValues<State> = Simplify<{ [Key in keyof State]: OutputOf<State[Key]> }>;
|
|
203
|
+
/**
|
|
204
|
+
* The state object of a generative UI, bases included. Selectors get it, and
|
|
205
|
+
* `useGenerativeUIState(ui, key, value)` sets one key of it.
|
|
206
|
+
*/
|
|
207
|
+
type GenerativeUIStateOf<UI extends AnyGenerativeUI> = StateValues<GenerativeUIDefinitionsOf<UI>["state"]>;
|
|
208
|
+
/** The declared functions of a generative UI, bases included. */
|
|
209
|
+
type GenerativeUIFunctionsOf<UI extends AnyGenerativeUI> = GenerativeUIDefinitionsOf<UI>["functions"];
|
|
210
|
+
/** The name of a declared function of a generative UI. */
|
|
211
|
+
type GenerativeUIFunctionName<UI extends AnyGenerativeUI> = keyof GenerativeUIFunctionsOf<UI> & string;
|
|
212
|
+
/**
|
|
213
|
+
* The name of a component of a generative UI, bases included. For
|
|
214
|
+
* `GenerativeUI<any>`, it is `string`.
|
|
215
|
+
*/
|
|
216
|
+
type GenerativeUIComponentName<UI extends AnyGenerativeUI> = keyof GenerativeUIDefinitionsOf<UI>["components"] & string;
|
|
217
|
+
type FunctionInput<Functions, Name> = Name extends keyof Functions ? Functions[Name] extends GenerativeUIFunctionDefinition ? InputOf<Functions[Name]["parameters"]> : never : never;
|
|
218
|
+
/** What a caller passes to a declared function (the schema input). */
|
|
219
|
+
type GenerativeUIFunctionInput<UI extends AnyGenerativeUI, Name extends GenerativeUIFunctionName<UI>> = FunctionInput<GenerativeUIFunctionsOf<UI>, Name>;
|
|
220
|
+
/**
|
|
221
|
+
* What the handler of a declared function gets: the parsed arguments (the
|
|
222
|
+
* schema output, with defaults set).
|
|
223
|
+
*/
|
|
224
|
+
type GenerativeUIFunctionArgs<UI extends AnyGenerativeUI, Name extends GenerativeUIFunctionName<UI>> = OutputOf<GenerativeUIFunctionsOf<UI>[Name]["parameters"]>;
|
|
225
|
+
/**
|
|
226
|
+
* The function an event calls: the function with the same name, else the
|
|
227
|
+
* name without `on` and with a lowercase first letter. `never` when none.
|
|
228
|
+
*/
|
|
229
|
+
type MatchedFunction<Name extends string, Functions> = Name extends keyof Functions ? Name : Name extends `on${infer Rest}` ? Uncapitalize<Rest> extends keyof Functions ? Uncapitalize<Rest> : never : never;
|
|
230
|
+
/**
|
|
231
|
+
* The argument type of an event prop. The event `parameters` input when it
|
|
232
|
+
* declares them, else the input of the matched function.
|
|
233
|
+
*/
|
|
234
|
+
type GenerativeUIEventInput<Name extends string, Event, Functions> = "parameters" extends keyof Event ? InputOf<Event["parameters" & keyof Event]> : FunctionInput<Functions, MatchedFunction<Name, Functions>>;
|
|
235
|
+
/** `Value` with each `GenerativeUIChildNode` replaced by `TNode`. */
|
|
236
|
+
type WithNodes<Value, TNode> = Value extends GenerativeUIChildNode ? TNode : Value extends readonly (infer Item)[] ? WithNodes<Item, TNode>[] : Value extends Record<string, unknown> ? { [Key in keyof Value]: WithNodes<Value[Key], TNode> } : Value;
|
|
237
|
+
type DataProps<Props, TNode> = Props extends PropsSchema ? WithNodes<OutputOf<Props>, TNode> : {};
|
|
238
|
+
type EventProps<Events, Functions> = Events extends Record<string, unknown> ? { [Name in keyof Events]?: (args: GenerativeUIEventInput<Name & string, Events[Name], Functions>) => Promise<GenerativeUIInvokeResult> } : {};
|
|
239
|
+
type SlotProps<Slots, TNode> = Slots extends Record<string, unknown> ? { [Name in keyof Slots]?: TNode } : {};
|
|
240
|
+
type WritableKeys<Writable> = Writable extends readonly (infer Key)[] ? Key & string : never;
|
|
241
|
+
/** One setter for each writable prop: `value` gets `setValue`. */
|
|
242
|
+
type SetterProps<Props, Writable> = { [Key in WritableKeys<Writable> & PropKeys<Props> as `set${Capitalize<Key>}`]: (value: PropInput<Props, Key>) => void };
|
|
243
|
+
/**
|
|
244
|
+
* Props that the renderer passes to a component:
|
|
245
|
+
* `function CheckoutForm(props: GenerativeUIComponentProps<typeof ui, "CheckoutForm">)`.
|
|
246
|
+
* Data props are the parsed `props` schema, bound props included. Event and
|
|
247
|
+
* slot props are present only when they are bound or filled. Each writable
|
|
248
|
+
* prop gets a setter (`value` gets `setValue`), which is always present.
|
|
249
|
+
* `TNode` is the type of a rendered child: what a slot prop holds, and what
|
|
250
|
+
* replaces each `GenerativeUIChildNode` of the data props.
|
|
251
|
+
*/
|
|
252
|
+
type GenerativeUIComponentProps<UI extends AnyGenerativeUI, Name extends keyof GenerativeUIDefinitionsOf<UI>["components"] & string, TNode = unknown> = Simplify<DataProps<GenerativeUIDefinitionsOf<UI>["components"][Name]["props"], TNode> & EventProps<GenerativeUIDefinitionsOf<UI>["components"][Name]["events"], GenerativeUIDefinitionsOf<UI>["functions"]> & SlotProps<GenerativeUIDefinitionsOf<UI>["components"][Name]["slots"], TNode> & SetterProps<GenerativeUIDefinitionsOf<UI>["components"][Name]["props"], GenerativeUIDefinitionsOf<UI>["components"][Name]["writable"]>>;
|
|
253
|
+
type BaseDefinitions<Bases extends readonly AnyGenerativeUI[]> = GenerativeUIDefinitionsOf<Bases[number]>;
|
|
254
|
+
type MergedState<Bases extends readonly AnyGenerativeUI[], State> = Simplify<UnionToIntersection<BaseDefinitions<Bases>["state"]> & State>;
|
|
255
|
+
type MergedFunctions<Bases extends readonly AnyGenerativeUI[], Functions> = Simplify<UnionToIntersection<BaseDefinitions<Bases>["functions"]> & Functions>;
|
|
256
|
+
/** Props keys with the name of a top-level state key. */
|
|
257
|
+
type NameKeys<Props, State> = PropKeys<Props> & keyof State;
|
|
258
|
+
type SelectorFor<Props, State, Key extends PropKeys<Props>> = (state: StateValues<State>, props: Simplify<Omit<InputOf<Props>, NameKeys<Props, State> | Key>>) => PropInput<Props, Key>;
|
|
259
|
+
type BindSelectors<Props, State> = { [Key in PropKeys<Props>]?: SelectorFor<Props, State, Key> };
|
|
260
|
+
/** Name-bound keys whose state type does not fit the prop schema input. */
|
|
261
|
+
type MismatchedNameKeys<Props, State> = { [Key in NameKeys<Props, State>]: [OutputOf<State[Key]>] extends [PropInput<Props, Key>] ? never : Key }[NameKeys<Props, State>];
|
|
262
|
+
/**
|
|
263
|
+
* `bind` is optional. When a prop has the name of a state key but the state
|
|
264
|
+
* type does not fit, `bind` must give that prop a selector.
|
|
265
|
+
*/
|
|
266
|
+
type BindField<Props, State> = [MismatchedNameKeys<Props, State>] extends [never] ? {
|
|
267
|
+
bind?: BindSelectors<Props, State>;
|
|
268
|
+
} : {
|
|
269
|
+
bind: BindSelectors<Props, State> & { [Key in MismatchedNameKeys<Props, State>]-?: SelectorFor<Props, State, Key> };
|
|
270
|
+
};
|
|
271
|
+
/** `unknown` (no props) or an object schema. Else `props` gets an error. */
|
|
272
|
+
type PropsCheck<Props> = unknown extends Props ? unknown : Props extends PropsSchema ? unknown : {
|
|
273
|
+
props?: PropsSchema;
|
|
274
|
+
};
|
|
275
|
+
type MatchCheck<Name extends string, Event, Functions> = [MatchedFunction<Name, Functions>] extends [never] ? "parameters" extends keyof Event ? unknown : {
|
|
276
|
+
parameters: GenerativeUISchema;
|
|
277
|
+
} : "parameters" extends keyof Event ? [OutputOf<Event["parameters" & keyof Event]>] extends [FunctionInput<Functions, MatchedFunction<Name, Functions>>] ? unknown : {
|
|
278
|
+
parameters: `The output of these parameters does not fit the input of function "${MatchedFunction<Name, Functions> & string}".`;
|
|
279
|
+
} : unknown;
|
|
280
|
+
/**
|
|
281
|
+
* `unknown` when the event is valid. Else a type the event does not fit, so
|
|
282
|
+
* `tsc` reports the error on the event.
|
|
283
|
+
*/
|
|
284
|
+
type EventCheck<Name extends string, Event, Functions> = Event extends GenerativeUIEventDefinition ? MatchCheck<Name, Event, Functions> : GenerativeUIEventDefinition;
|
|
285
|
+
type EventsCheck<Events, Functions> = { [Name in keyof Events]: EventCheck<Name & string, Events[Name], Functions> };
|
|
286
|
+
/** Props that a component can list in `writable`: not bound by name. */
|
|
287
|
+
type WritableKey<Props, State> = Exclude<PropKeys<Props>, NameKeys<Props, State>>;
|
|
288
|
+
/**
|
|
289
|
+
* Each component config is split over four mapped types. Each one infers
|
|
290
|
+
* one part (props, events, slots, writable) of every component. The checks
|
|
291
|
+
* are in `NoInfer`, so they do not change what is inferred. They are not
|
|
292
|
+
* intersected with schema types directly, because two schema class types do
|
|
293
|
+
* not intersect cleanly.
|
|
294
|
+
*/
|
|
295
|
+
type ComponentsConfig<Props, Events, Slots, Writable, State, Functions> = { [Name in keyof Props]: {
|
|
296
|
+
component: GenerativeUIAnyComponent;
|
|
297
|
+
description?: string;
|
|
298
|
+
parameterOrder?: readonly string[];
|
|
299
|
+
props?: Props[Name];
|
|
300
|
+
accessibility?: "wrapper" | "self";
|
|
301
|
+
} & NoInfer<PropsCheck<Props[Name]> & BindField<Props[Name], State>> } & { [Name in keyof Events]: {
|
|
302
|
+
events?: Events[Name] & NoInfer<EventsCheck<Events[Name], Functions>>;
|
|
303
|
+
} } & { [Name in keyof Slots]: {
|
|
304
|
+
slots?: Slots[Name] & Record<string, GenerativeUISlotKind>;
|
|
305
|
+
} } & { [Name in keyof Writable]: {
|
|
306
|
+
writable?: Writable[Name] & NoInfer<readonly WritableKey<Props[Name & keyof Props], State>[]>;
|
|
307
|
+
} };
|
|
308
|
+
/** The config of `createGenerativeUI`. */
|
|
309
|
+
interface CreateGenerativeUIConfig<Bases extends readonly AnyGenerativeUI[], State extends Record<string, GenerativeUISchema>, Functions extends Record<string, GenerativeUIFunctionDefinition>, Props extends Record<string, unknown>, Events extends Record<string, unknown>, Slots extends Record<string, unknown>, Writable extends Record<string, unknown>, Overrides = GenerativeUIOverridesConfig<Bases>> {
|
|
310
|
+
/** Surfaces pin to it. Use a versioned id, for example "acme/store@1". */
|
|
311
|
+
id: string;
|
|
312
|
+
/** Bases. Their state, functions and components merge in, in order. */
|
|
313
|
+
extends?: Bases;
|
|
314
|
+
/** App state schemas, by top-level key. Put it before `components`. */
|
|
315
|
+
state?: State;
|
|
316
|
+
/** Functions that components can call. */
|
|
317
|
+
functions?: Functions;
|
|
318
|
+
/**
|
|
319
|
+
* New components for components of the bases, by name. The model
|
|
320
|
+
* sees the same component: its description, props, events and slots stay.
|
|
321
|
+
* The new component gets the same props as the one it replaces.
|
|
322
|
+
*/
|
|
323
|
+
overrides?: NoInfer<Overrides>;
|
|
324
|
+
/** The components the model can render. */
|
|
325
|
+
components: ComponentsConfig<Props, Events, Slots, Writable, MergedState<Bases, State>, MergedFunctions<Bases, Functions>>;
|
|
326
|
+
}
|
|
327
|
+
/** The definitions of the bases, merged. */
|
|
328
|
+
type GenerativeUIBasesDefinitions<Bases extends readonly AnyGenerativeUI[]> = GenerativeUIResultDefinitions<Bases, {}, {}, {}, {}, {}, {}>;
|
|
329
|
+
/**
|
|
330
|
+
* One new component for each component of the bases that it names. A
|
|
331
|
+
* framework package narrows `component` to its component type, with the
|
|
332
|
+
* props of the component it replaces.
|
|
333
|
+
*/
|
|
334
|
+
type GenerativeUIOverridesConfig<Bases extends readonly AnyGenerativeUI[]> = { [Name in keyof GenerativeUIBasesDefinitions<Bases>["components"] & string]?: {
|
|
335
|
+
component: GenerativeUIAnyComponent;
|
|
336
|
+
} };
|
|
337
|
+
type OwnComponents<Props, Events, Slots, Writable> = { [Name in keyof Props]: {
|
|
338
|
+
props: Props[Name];
|
|
339
|
+
events: Name extends keyof Events ? Events[Name] : unknown;
|
|
340
|
+
slots: Name extends keyof Slots ? Slots[Name] : unknown;
|
|
341
|
+
writable: Name extends keyof Writable ? Writable[Name] : unknown;
|
|
342
|
+
} };
|
|
343
|
+
/** The definitions of the result of `createGenerativeUI`. */
|
|
344
|
+
type GenerativeUIResultDefinitions<Bases extends readonly AnyGenerativeUI[], State, Functions, Props, Events, Slots, Writable> = {
|
|
345
|
+
state: MergedState<Bases, State>;
|
|
346
|
+
functions: MergedFunctions<Bases, Functions>;
|
|
347
|
+
components: Simplify<UnionToIntersection<BaseDefinitions<Bases>["components"]> & OwnComponents<Props, Events, Slots, Writable>>;
|
|
348
|
+
};
|
|
349
|
+
/**
|
|
350
|
+
* The id of the catalog that declared each component of `ui`. A component
|
|
351
|
+
* from `extends` keeps the id of its base. Not exported from the package.
|
|
352
|
+
*/
|
|
353
|
+
declare function componentCatalogIds(ui: AnyGenerativeUI): ReadonlyMap<string, string>;
|
|
354
|
+
/**
|
|
355
|
+
* The catalogs that an operation can name: the id of `ui`, then the ids of
|
|
356
|
+
* the catalogs in its `extends` that declared a component. Not exported
|
|
357
|
+
* from the package.
|
|
358
|
+
*/
|
|
359
|
+
declare function catalogIdsOf(ui: Pick<AnyGenerativeUI, "id">): string[];
|
|
360
|
+
/**
|
|
361
|
+
* Experimental. Declares the components the model can render, the app state
|
|
362
|
+
* they read, and the functions they call.
|
|
363
|
+
*
|
|
364
|
+
* - A prop with the name of a top-level state key is bound to that state.
|
|
365
|
+
* - `bind: { prop: (state, props) => value }` binds a prop to a selector.
|
|
366
|
+
* - An event binds to the function with its name, else to the name without
|
|
367
|
+
* `on` (`onAddToCart` calls `addToCart`).
|
|
368
|
+
* - `writable: ["value"]` gives the component a `setValue` prop. See
|
|
369
|
+
* `GenerativeUIComponentDefinition.writable`.
|
|
370
|
+
*
|
|
371
|
+
* The model does not see bound props or matched events.
|
|
372
|
+
*
|
|
373
|
+
* @param config - `id`, then optional `extends`, `state`, `functions` and
|
|
374
|
+
* `overrides`, then `components`. Put `state` before `components`, so the selectors
|
|
375
|
+
* get typed state.
|
|
376
|
+
* @throws Error when a name comes from two places, an override names no
|
|
377
|
+
* component of the bases, `props` is not an object
|
|
378
|
+
* schema with a JSON Schema, a key is reserved or used
|
|
379
|
+
* twice on a component, an event matches two functions, an unmatched event
|
|
380
|
+
* has no `parameters`, a `bind` key is not a prop, a `writable` key is not
|
|
381
|
+
* a prop or is a bound prop, or a setter name is already a key of the
|
|
382
|
+
* component. Also throws when `parameterOrder` contains duplicate or unknown
|
|
383
|
+
* keys, or an ordered component declares integer-index keys whose JSON object
|
|
384
|
+
* enumeration order cannot be controlled.
|
|
385
|
+
*
|
|
386
|
+
* @example
|
|
387
|
+
* ```ts
|
|
388
|
+
* const ui = createGenerativeUI({
|
|
389
|
+
* id: "acme/store@1",
|
|
390
|
+
* state: { cart: cartSchema },
|
|
391
|
+
* functions: { addToCart: { parameters: z.object({ productId: z.string() }) } },
|
|
392
|
+
* components: {
|
|
393
|
+
* CartSummary: {
|
|
394
|
+
* component: CartSummary,
|
|
395
|
+
* props: z.object({ count: z.number() }),
|
|
396
|
+
* bind: { count: (state) => state.cart.count },
|
|
397
|
+
* },
|
|
398
|
+
* },
|
|
399
|
+
* });
|
|
400
|
+
* ```
|
|
401
|
+
*/
|
|
402
|
+
declare function createGenerativeUI<Bases extends readonly AnyGenerativeUI[] = [], State extends Record<string, GenerativeUISchema> = {}, Functions extends Record<string, GenerativeUIFunctionDefinition> = {}, Props extends Record<string, unknown> = {}, Events extends Record<string, unknown> = {}, Slots extends Record<string, unknown> = {}, Writable extends Record<string, unknown> = {}>(config: CreateGenerativeUIConfig<Bases, State, Functions, Props, Events, Slots, Writable>): GenerativeUI<GenerativeUIResultDefinitions<Bases, State, Functions, Props, Events, Slots, Writable>, GenerativeUIAnyComponent>;
|
|
403
|
+
/** The setter prop of a writable prop: `value` gives `setValue`. */
|
|
404
|
+
declare function setterNameOf(key: string): string;
|
|
405
|
+
//#endregion
|
|
406
|
+
export { AnyGenerativeUI, CreateGenerativeUIConfig, GenerativeUI, GenerativeUIAnyComponent, GenerativeUIBasesDefinitions, GenerativeUIComponentDefinition, GenerativeUIComponentName, GenerativeUIComponentProps, GenerativeUIComponentTypes, GenerativeUIDefinitions, GenerativeUIDefinitionsOf, GenerativeUIEventDefinition, GenerativeUIEventInput, GenerativeUIFunctionArgs, GenerativeUIFunctionDefinition, GenerativeUIFunctionInput, GenerativeUIFunctionName, GenerativeUIFunctionsOf, GenerativeUIOverridesConfig, GenerativeUIResultDefinitions, GenerativeUISelector, GenerativeUISlotKind, GenerativeUIStateOf, PropsSchema, ResolvedGenerativeUIComponent, UnionToIntersection, catalogIdsOf, componentCatalogIds, createGenerativeUI, setterNameOf };
|
|
407
|
+
//# sourceMappingURL=catalog.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.d.mts","names":[],"sources":["../../../src/generative-ui/catalog/catalog.ts"],"mappings":";;;;;;;;;KAmBY,oBAAA;;;;AAAZ;;;;;KAUY,WAAA,GAAc,gBAAA,CACxB,MAA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