@tdesign-react/chat 1.0.2-alpha.11 → 1.0.2-alpha.13
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/es/_util/reactify.js +4 -4
- package/es/_util/reactify.js.map +1 -1
- package/es/_util/useDynamicStyle.js +1 -1
- package/es/attachments/index.js +1 -1
- package/es/chat-actionbar/index.js +1 -1
- package/es/chat-engine/components/a2ui/A2UIActivityRenderer.d.ts +91 -0
- package/es/chat-engine/components/a2ui/A2UIActivityRenderer.js +236 -0
- package/es/chat-engine/components/a2ui/A2UIActivityRenderer.js.map +1 -0
- package/es/chat-engine/components/a2ui/A2UIComponentRenderer.d.ts +37 -0
- package/es/chat-engine/components/a2ui/A2UIComponentRenderer.js +116 -0
- package/es/chat-engine/components/a2ui/A2UIComponentRenderer.js.map +1 -0
- package/es/chat-engine/components/a2ui/A2UIErrorBoundary.d.ts +42 -0
- package/es/chat-engine/components/a2ui/A2UIErrorBoundary.js +113 -0
- package/es/chat-engine/components/a2ui/A2UIErrorBoundary.js.map +1 -0
- package/es/chat-engine/components/a2ui/A2UISkeleton.d.ts +60 -0
- package/es/chat-engine/components/a2ui/A2UISkeleton.js +197 -0
- package/es/chat-engine/components/a2ui/A2UISkeleton.js.map +1 -0
- package/es/chat-engine/components/a2ui/A2UISurfaceRenderer.d.ts +44 -0
- package/es/chat-engine/components/a2ui/A2UISurfaceRenderer.js +139 -0
- package/es/chat-engine/components/a2ui/A2UISurfaceRenderer.js.map +1 -0
- package/es/chat-engine/components/a2ui/containers/A2UICard.d.ts +22 -0
- package/es/chat-engine/components/a2ui/containers/A2UICard.js +82 -0
- package/es/chat-engine/components/a2ui/containers/A2UICard.js.map +1 -0
- package/es/chat-engine/components/a2ui/containers/A2UIColumn.d.ts +18 -0
- package/es/chat-engine/components/a2ui/containers/A2UIColumn.js +81 -0
- package/es/chat-engine/components/a2ui/containers/A2UIColumn.js.map +1 -0
- package/es/chat-engine/components/a2ui/containers/A2UIList.d.ts +14 -0
- package/es/chat-engine/components/a2ui/containers/A2UIList.js +62 -0
- package/es/chat-engine/components/a2ui/containers/A2UIList.js.map +1 -0
- package/es/chat-engine/components/a2ui/containers/A2UIRow.d.ts +20 -0
- package/es/chat-engine/components/a2ui/containers/A2UIRow.js +84 -0
- package/es/chat-engine/components/a2ui/containers/A2UIRow.js.map +1 -0
- package/es/chat-engine/components/a2ui/containers/A2UITabs.d.ts +14 -0
- package/es/chat-engine/components/a2ui/containers/A2UITabs.js +69 -0
- package/es/chat-engine/components/a2ui/containers/A2UITabs.js.map +1 -0
- package/es/chat-engine/components/a2ui/containers/index.d.ts +8 -0
- package/es/chat-engine/components/a2ui/containers/index.js +30 -0
- package/es/chat-engine/components/a2ui/containers/index.js.map +1 -0
- package/es/chat-engine/components/a2ui/index.d.ts +11 -0
- package/es/chat-engine/components/a2ui/index.js +60 -0
- package/es/chat-engine/components/a2ui/index.js.map +1 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIButton.d.ts +31 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIButton.js +76 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIButton.js.map +1 -0
- package/es/chat-engine/components/a2ui/primitives/A2UICheckBox.d.ts +12 -0
- package/es/chat-engine/components/a2ui/primitives/A2UICheckBox.js +43 -0
- package/es/chat-engine/components/a2ui/primitives/A2UICheckBox.js.map +1 -0
- package/es/chat-engine/components/a2ui/primitives/A2UICheckboxGroup.d.ts +50 -0
- package/es/chat-engine/components/a2ui/primitives/A2UICheckboxGroup.js +54 -0
- package/es/chat-engine/components/a2ui/primitives/A2UICheckboxGroup.js.map +1 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIChoicePicker.d.ts +13 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIChoicePicker.js +89 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIChoicePicker.js.map +1 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIDivider.d.ts +12 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIDivider.js +25 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIDivider.js.map +1 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIIcon.d.ts +13 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIIcon.js +138942 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIIcon.js.map +1 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIImage.d.ts +12 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIImage.js +75 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIImage.js.map +1 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIInput.d.ts +20 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIInput.js +63 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIInput.js.map +1 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIRadioGroup.d.ts +56 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIRadioGroup.js +64 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIRadioGroup.js.map +1 -0
- package/es/chat-engine/components/a2ui/primitives/A2UISlider.d.ts +12 -0
- package/es/chat-engine/components/a2ui/primitives/A2UISlider.js +55 -0
- package/es/chat-engine/components/a2ui/primitives/A2UISlider.js.map +1 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIText.d.ts +12 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIText.js +104 -0
- package/es/chat-engine/components/a2ui/primitives/A2UIText.js.map +1 -0
- package/es/chat-engine/components/a2ui/primitives/A2UITextField.d.ts +12 -0
- package/es/chat-engine/components/a2ui/primitives/A2UITextField.js +80 -0
- package/es/chat-engine/components/a2ui/primitives/A2UITextField.js.map +1 -0
- package/es/chat-engine/components/a2ui/primitives/index.d.ts +15 -0
- package/es/chat-engine/components/a2ui/primitives/index.js +39 -0
- package/es/chat-engine/components/a2ui/primitives/index.js.map +1 -0
- package/es/chat-engine/components/a2ui/registry.d.ts +35 -0
- package/es/chat-engine/components/a2ui/registry.js +74 -0
- package/es/chat-engine/components/a2ui/registry.js.map +1 -0
- package/es/chat-engine/components/activity/index.js +1 -1
- package/es/chat-engine/components/activity/registry.js +4 -4
- package/es/chat-engine/components/activity/registry.js.map +1 -1
- package/es/chat-engine/components/activity/render.js +6 -6
- package/es/chat-engine/components/activity/render.js.map +1 -1
- package/es/chat-engine/components/activity/types.js +1 -1
- package/es/chat-engine/components/index.js +4 -1
- package/es/chat-engine/components/index.js.map +1 -1
- package/es/chat-engine/components/provider/agent-state.js +6 -3
- package/es/chat-engine/components/provider/agent-state.js.map +1 -1
- package/es/chat-engine/components/toolcall/index.js +4 -1
- package/es/chat-engine/components/toolcall/index.js.map +1 -1
- package/es/chat-engine/components/toolcall/registry.js +4 -4
- package/es/chat-engine/components/toolcall/registry.js.map +1 -1
- package/es/chat-engine/components/toolcall/render.js +14 -11
- package/es/chat-engine/components/toolcall/render.js.map +1 -1
- package/es/chat-engine/components/toolcall/types.js +1 -1
- package/es/chat-engine/core/a2ui/index.d.ts +10 -0
- package/es/chat-engine/core/a2ui/index.js +24 -0
- package/es/chat-engine/core/a2ui/index.js.map +1 -0
- package/es/chat-engine/core/a2ui/processor/A2uiMessageProcessor.d.ts +197 -0
- package/es/chat-engine/core/a2ui/processor/A2uiMessageProcessor.js +438 -0
- package/es/chat-engine/core/a2ui/processor/A2uiMessageProcessor.js.map +1 -0
- package/es/chat-engine/core/a2ui/processor/ComponentTree.d.ts +53 -0
- package/es/chat-engine/core/a2ui/processor/ComponentTree.js +158 -0
- package/es/chat-engine/core/a2ui/processor/ComponentTree.js.map +1 -0
- package/es/chat-engine/core/a2ui/processor/DataStore.d.ts +63 -0
- package/es/chat-engine/core/a2ui/processor/DataStore.js +172 -0
- package/es/chat-engine/core/a2ui/processor/DataStore.js.map +1 -0
- package/es/chat-engine/core/a2ui/processor/PathResolver.d.ts +47 -0
- package/es/chat-engine/core/a2ui/processor/PathResolver.js +99 -0
- package/es/chat-engine/core/a2ui/processor/PathResolver.js.map +1 -0
- package/es/chat-engine/core/a2ui/types/index.d.ts +4 -0
- package/es/chat-engine/core/a2ui/types/index.js +9 -0
- package/es/chat-engine/core/a2ui/types/index.js.map +1 -0
- package/es/chat-engine/core/a2ui/types/types.d.ts +769 -0
- package/es/chat-engine/core/a2ui/types/types.js +104 -0
- package/es/chat-engine/core/a2ui/types/types.js.map +1 -0
- package/es/chat-engine/core/a2ui/utils/binding.d.ts +34 -0
- package/es/chat-engine/core/a2ui/utils/binding.js +1784 -0
- package/es/chat-engine/core/a2ui/utils/binding.js.map +1 -0
- package/es/chat-engine/core/a2ui/utils/index.d.ts +5 -0
- package/es/chat-engine/core/a2ui/utils/index.js +13 -0
- package/es/chat-engine/core/a2ui/utils/index.js.map +1 -0
- package/es/chat-engine/core/a2ui/utils/validation.d.ts +70 -0
- package/es/chat-engine/core/a2ui/utils/validation.js +333 -0
- package/es/chat-engine/core/a2ui/utils/validation.js.map +1 -0
- package/es/chat-engine/core/adapters/agui/event-mapper.d.ts +16 -0
- package/es/chat-engine/core/adapters/agui/event-mapper.js +60 -6
- package/es/chat-engine/core/adapters/agui/event-mapper.js.map +1 -1
- package/es/chat-engine/core/adapters/agui/events.js +1 -1
- package/es/chat-engine/core/adapters/agui/index.d.ts +1 -1
- package/es/chat-engine/core/adapters/agui/index.js +1 -1
- package/es/chat-engine/core/adapters/agui/index.js.map +1 -1
- package/es/chat-engine/core/adapters/agui/state-manager.js +1 -1
- package/es/chat-engine/core/adapters/agui/types.js +1 -1
- package/es/chat-engine/core/adapters/agui/utils.d.ts +5 -1
- package/es/chat-engine/core/adapters/agui/utils.js +6 -2
- package/es/chat-engine/core/adapters/agui/utils.js.map +1 -1
- package/es/chat-engine/core/event-bus/ChatEventBus.d.ts +88 -0
- package/es/chat-engine/core/event-bus/ChatEventBus.js +295 -0
- package/es/chat-engine/core/event-bus/ChatEventBus.js.map +1 -0
- package/es/chat-engine/core/event-bus/index.d.ts +5 -0
- package/es/chat-engine/core/event-bus/index.js +13 -0
- package/es/chat-engine/core/event-bus/index.js.map +1 -0
- package/es/chat-engine/core/event-bus/types.d.ts +230 -0
- package/es/chat-engine/core/event-bus/types.js +32 -0
- package/es/chat-engine/core/event-bus/types.js.map +1 -0
- package/es/chat-engine/core/index.d.ts +8 -1
- package/es/chat-engine/core/index.js +128 -10
- package/es/chat-engine/core/index.js.map +1 -1
- package/es/chat-engine/core/processor/index.js +1 -1
- package/es/chat-engine/core/server/batch-client.js +1 -1
- package/es/chat-engine/core/server/connection-manager.js +1 -1
- package/es/chat-engine/core/server/errors.js +1 -1
- package/es/chat-engine/core/server/index.js +1 -1
- package/es/chat-engine/core/server/llm-service.js +17 -15
- package/es/chat-engine/core/server/llm-service.js.map +1 -1
- package/es/chat-engine/core/server/sse-client.js +1 -1
- package/es/chat-engine/core/server/sse-parser.js +1 -1
- package/es/chat-engine/core/server/types.js +1 -1
- package/es/chat-engine/core/store/message.js +1 -1
- package/es/chat-engine/core/store/model.js +1 -1
- package/es/chat-engine/core/store/reactiveState.js +1 -1
- package/es/chat-engine/core/type.d.ts +18 -2
- package/es/chat-engine/core/type.js +1 -1
- package/es/chat-engine/core/utils/eventEmitter.js +1 -1
- package/es/chat-engine/core/utils/index.js +1 -1
- package/es/chat-engine/core/utils/logger.js +1 -1
- package/es/chat-engine/hooks/a2ui/A2UIContext.d.ts +90 -0
- package/es/chat-engine/hooks/a2ui/A2UIContext.js +97 -0
- package/es/chat-engine/hooks/a2ui/A2UIContext.js.map +1 -0
- package/es/chat-engine/hooks/a2ui/index.d.ts +7 -0
- package/es/chat-engine/hooks/a2ui/index.js +19 -0
- package/es/chat-engine/hooks/a2ui/index.js.map +1 -0
- package/es/chat-engine/hooks/a2ui/useA2UIAction.d.ts +40 -0
- package/es/chat-engine/hooks/a2ui/useA2UIAction.js +74 -0
- package/es/chat-engine/hooks/a2ui/useA2UIAction.js.map +1 -0
- package/es/chat-engine/hooks/a2ui/useA2UISurface.d.ts +36 -0
- package/es/chat-engine/hooks/a2ui/useA2UISurface.js +39 -0
- package/es/chat-engine/hooks/a2ui/useA2UISurface.js.map +1 -0
- package/es/chat-engine/hooks/a2ui/useDataBinding.d.ts +53 -0
- package/es/chat-engine/hooks/a2ui/useDataBinding.js +111 -0
- package/es/chat-engine/hooks/a2ui/useDataBinding.js.map +1 -0
- package/es/chat-engine/hooks/index.js +4 -1
- package/es/chat-engine/hooks/index.js.map +1 -1
- package/es/chat-engine/hooks/useAgentActivity.js +1 -1
- package/es/chat-engine/hooks/useAgentState.js +4 -1
- package/es/chat-engine/hooks/useAgentState.js.map +1 -1
- package/es/chat-engine/hooks/useAgentToolcall.js +1 -1
- package/es/chat-engine/hooks/useChat.js +4 -1
- package/es/chat-engine/hooks/useChat.js.map +1 -1
- package/es/chat-engine/index.js +4 -1
- package/es/chat-engine/index.js.map +1 -1
- package/es/chat-filecard/index.js +1 -1
- package/es/chat-loading/index.js +1 -1
- package/es/chat-markdown/index.js +1 -1
- package/es/chat-message/index.js +1 -1
- package/es/chat-sender/index.js +1 -1
- package/es/chat-thinking/index.js +1 -1
- package/es/chatbot/docs/react-best-practice.d.ts +13 -0
- package/es/chatbot/index.js +1 -1
- package/es/index.js +4 -1
- package/es/index.js.map +1 -1
- package/es/style/index.js +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,769 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A2UI v0.9 协议类型定义
|
|
3
|
+
* 参考 A2UI Specification 0.9 和 @a2ui/core 实现
|
|
4
|
+
*
|
|
5
|
+
* 核心层:框架无关,可跨 React/Vue 复用
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
/**
|
|
9
|
+
* 数据绑定路径 - 支持从数据模型读取值
|
|
10
|
+
* @example { path: "/user/name" }
|
|
11
|
+
*/
|
|
12
|
+
export declare const PathBindingSchema: z.ZodObject<{
|
|
13
|
+
path: z.ZodString;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
path?: string;
|
|
16
|
+
}, {
|
|
17
|
+
path?: string;
|
|
18
|
+
}>;
|
|
19
|
+
export type PathBinding = z.infer<typeof PathBindingSchema>;
|
|
20
|
+
/**
|
|
21
|
+
* 表达式绑定 - 支持简单计算表达式
|
|
22
|
+
* @example { expr: "basePrice + addonTotal", vars: { basePrice: { path: "/config/basePrice" } } }
|
|
23
|
+
*/
|
|
24
|
+
export declare const ExprBindingSchema: z.ZodObject<{
|
|
25
|
+
expr: z.ZodString;
|
|
26
|
+
vars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
27
|
+
path: z.ZodString;
|
|
28
|
+
}, "strip", z.ZodTypeAny, {
|
|
29
|
+
path?: string;
|
|
30
|
+
}, {
|
|
31
|
+
path?: string;
|
|
32
|
+
}>, z.ZodAny]>>>;
|
|
33
|
+
format: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
expr?: string;
|
|
36
|
+
vars?: Record<string, any>;
|
|
37
|
+
format?: string;
|
|
38
|
+
}, {
|
|
39
|
+
expr?: string;
|
|
40
|
+
vars?: Record<string, any>;
|
|
41
|
+
format?: string;
|
|
42
|
+
}>;
|
|
43
|
+
export type ExprBinding = z.infer<typeof ExprBindingSchema>;
|
|
44
|
+
/**
|
|
45
|
+
* 可绑定值 - 字面值、路径绑定或表达式绑定
|
|
46
|
+
*/
|
|
47
|
+
export type Bindable<T> = T | PathBinding | ExprBinding;
|
|
48
|
+
export declare const stringOrPathSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
49
|
+
path: z.ZodString;
|
|
50
|
+
}, "strip", z.ZodTypeAny, {
|
|
51
|
+
path?: string;
|
|
52
|
+
}, {
|
|
53
|
+
path?: string;
|
|
54
|
+
}>]>;
|
|
55
|
+
export declare const numberOrPathSchema: z.ZodUnion<[z.ZodNumber, z.ZodObject<{
|
|
56
|
+
path: z.ZodString;
|
|
57
|
+
}, "strip", z.ZodTypeAny, {
|
|
58
|
+
path?: string;
|
|
59
|
+
}, {
|
|
60
|
+
path?: string;
|
|
61
|
+
}>]>;
|
|
62
|
+
export declare const booleanOrPathSchema: z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
|
|
63
|
+
path: z.ZodString;
|
|
64
|
+
}, "strip", z.ZodTypeAny, {
|
|
65
|
+
path?: string;
|
|
66
|
+
}, {
|
|
67
|
+
path?: string;
|
|
68
|
+
}>]>;
|
|
69
|
+
export declare const stringArrayOrPathSchema: z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodObject<{
|
|
70
|
+
path: z.ZodString;
|
|
71
|
+
}, "strip", z.ZodTypeAny, {
|
|
72
|
+
path?: string;
|
|
73
|
+
}, {
|
|
74
|
+
path?: string;
|
|
75
|
+
}>]>;
|
|
76
|
+
/**
|
|
77
|
+
* A2UI Action - 服务端定义的用户交互
|
|
78
|
+
* 支持两种格式:
|
|
79
|
+
* 1. A2UI v0.9 规范格式:{ name: string, context?: Record<string, unknown> }
|
|
80
|
+
* 2. 简化格式(向后兼容):{ type: string, payload?: unknown }
|
|
81
|
+
*/
|
|
82
|
+
export declare const A2UIActionSchema: z.ZodEffects<z.ZodObject<{
|
|
83
|
+
name: z.ZodOptional<z.ZodString>;
|
|
84
|
+
context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
85
|
+
type: z.ZodOptional<z.ZodString>;
|
|
86
|
+
payload: z.ZodOptional<z.ZodUnknown>;
|
|
87
|
+
}, "strip", z.ZodTypeAny, {
|
|
88
|
+
name?: string;
|
|
89
|
+
type?: string;
|
|
90
|
+
context?: Record<string, unknown>;
|
|
91
|
+
payload?: unknown;
|
|
92
|
+
}, {
|
|
93
|
+
name?: string;
|
|
94
|
+
type?: string;
|
|
95
|
+
context?: Record<string, unknown>;
|
|
96
|
+
payload?: unknown;
|
|
97
|
+
}>, {
|
|
98
|
+
name?: string;
|
|
99
|
+
type?: string;
|
|
100
|
+
context?: Record<string, unknown>;
|
|
101
|
+
payload?: unknown;
|
|
102
|
+
}, {
|
|
103
|
+
name?: string;
|
|
104
|
+
type?: string;
|
|
105
|
+
context?: Record<string, unknown>;
|
|
106
|
+
payload?: unknown;
|
|
107
|
+
}>;
|
|
108
|
+
export interface A2UIAction {
|
|
109
|
+
/** A2UI v0.9 标准字段 */
|
|
110
|
+
name?: string;
|
|
111
|
+
context?: Record<string, unknown>;
|
|
112
|
+
/** 向后兼容字段 */
|
|
113
|
+
type?: string;
|
|
114
|
+
payload?: unknown;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* 用户行为消息 - 发送给服务端
|
|
118
|
+
*/
|
|
119
|
+
export interface UserActionMessage {
|
|
120
|
+
userAction: {
|
|
121
|
+
name: string;
|
|
122
|
+
surfaceId: string;
|
|
123
|
+
sourceComponentId: string;
|
|
124
|
+
timestamp: string;
|
|
125
|
+
context: Record<string, unknown>;
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Action 处理上下文
|
|
130
|
+
*/
|
|
131
|
+
export interface ActionContext {
|
|
132
|
+
surfaceId: string;
|
|
133
|
+
componentId?: string;
|
|
134
|
+
updateData: (path: string, value: unknown) => void;
|
|
135
|
+
getData: (path?: string) => unknown;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Action 处理回调
|
|
139
|
+
*/
|
|
140
|
+
export type ActionHandler = (action: A2UIAction, context?: ActionContext) => void | Promise<void>;
|
|
141
|
+
/**
|
|
142
|
+
* 组件通用属性
|
|
143
|
+
*/
|
|
144
|
+
export declare const componentCommonSchema: z.ZodObject<{
|
|
145
|
+
id: z.ZodString;
|
|
146
|
+
component: z.ZodString;
|
|
147
|
+
}, "strip", z.ZodTypeAny, {
|
|
148
|
+
id?: string;
|
|
149
|
+
component?: string;
|
|
150
|
+
}, {
|
|
151
|
+
id?: string;
|
|
152
|
+
component?: string;
|
|
153
|
+
}>;
|
|
154
|
+
/**
|
|
155
|
+
* children 属性定义 (A2UI v0.9 规范)
|
|
156
|
+
* 支持两种模式:
|
|
157
|
+
* 1. 直接引用: ["comp1", "comp2"]
|
|
158
|
+
* 2. Template 模式: { componentId: "comp1", path: "/items" }
|
|
159
|
+
*/
|
|
160
|
+
export declare const childrenPropertySchema: z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodObject<{
|
|
161
|
+
componentId: z.ZodString;
|
|
162
|
+
path: z.ZodString;
|
|
163
|
+
}, "strip", z.ZodTypeAny, {
|
|
164
|
+
path?: string;
|
|
165
|
+
componentId?: string;
|
|
166
|
+
}, {
|
|
167
|
+
path?: string;
|
|
168
|
+
componentId?: string;
|
|
169
|
+
}>]>;
|
|
170
|
+
export type ChildrenProperty = z.infer<typeof childrenPropertySchema>;
|
|
171
|
+
/**
|
|
172
|
+
* A2UI 组件基础结构
|
|
173
|
+
*/
|
|
174
|
+
export interface A2UIComponentBase {
|
|
175
|
+
id: string;
|
|
176
|
+
component: string;
|
|
177
|
+
[key: string]: unknown;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Text 组件
|
|
181
|
+
*/
|
|
182
|
+
export interface A2UITextComponent extends A2UIComponentBase {
|
|
183
|
+
component: 'Text';
|
|
184
|
+
text: Bindable<string>;
|
|
185
|
+
usageHint?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'caption' | 'body';
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Image 组件
|
|
189
|
+
*/
|
|
190
|
+
export interface A2UIImageComponent extends A2UIComponentBase {
|
|
191
|
+
component: 'Image';
|
|
192
|
+
url: Bindable<string>;
|
|
193
|
+
fit?: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
|
|
194
|
+
usageHint?: 'icon' | 'avatar' | 'smallFeature' | 'mediumFeature' | 'largeFeature' | 'header';
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Icon 组件
|
|
198
|
+
*/
|
|
199
|
+
export interface A2UIIconComponent extends A2UIComponentBase {
|
|
200
|
+
component: 'Icon';
|
|
201
|
+
name: string | PathBinding;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Row 布局组件
|
|
205
|
+
*/
|
|
206
|
+
export interface A2UIRowComponent extends A2UIComponentBase {
|
|
207
|
+
component: 'Row';
|
|
208
|
+
children?: ChildrenProperty;
|
|
209
|
+
distribution?: 'center' | 'end' | 'spaceAround' | 'spaceBetween' | 'spaceEvenly' | 'start' | 'stretch';
|
|
210
|
+
alignment?: 'start' | 'center' | 'end' | 'stretch';
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Column 布局组件
|
|
214
|
+
*/
|
|
215
|
+
export interface A2UIColumnComponent extends A2UIComponentBase {
|
|
216
|
+
component: 'Column';
|
|
217
|
+
children?: ChildrenProperty;
|
|
218
|
+
distribution?: 'start' | 'center' | 'end' | 'spaceBetween' | 'spaceAround' | 'spaceEvenly' | 'stretch';
|
|
219
|
+
alignment?: 'center' | 'end' | 'start' | 'stretch';
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* List 组件
|
|
223
|
+
*/
|
|
224
|
+
export interface A2UIListComponent extends A2UIComponentBase {
|
|
225
|
+
component: 'List';
|
|
226
|
+
children?: ChildrenProperty;
|
|
227
|
+
direction?: 'vertical' | 'horizontal';
|
|
228
|
+
alignment?: 'start' | 'center' | 'end' | 'stretch';
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Card 组件 (A2UI v0.9 规范: child 是单个组件 ID)
|
|
232
|
+
*/
|
|
233
|
+
export interface A2UICardComponent extends A2UIComponentBase {
|
|
234
|
+
component: 'Card';
|
|
235
|
+
child: string;
|
|
236
|
+
title?: Bindable<string>;
|
|
237
|
+
bordered?: boolean;
|
|
238
|
+
shadow?: boolean;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Tabs 组件
|
|
242
|
+
*/
|
|
243
|
+
export interface A2UITabItem {
|
|
244
|
+
title: Bindable<string>;
|
|
245
|
+
child: string;
|
|
246
|
+
}
|
|
247
|
+
export interface A2UITabsComponent extends A2UIComponentBase {
|
|
248
|
+
component: 'Tabs';
|
|
249
|
+
tabItems: A2UITabItem[];
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Divider 组件
|
|
253
|
+
*/
|
|
254
|
+
export interface A2UIDividerComponent extends A2UIComponentBase {
|
|
255
|
+
component: 'Divider';
|
|
256
|
+
axis?: 'horizontal' | 'vertical';
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Button 组件 (A2UI v0.9: child 是内容组件 ID)
|
|
260
|
+
*/
|
|
261
|
+
export interface A2UIButtonComponent extends A2UIComponentBase {
|
|
262
|
+
component: 'Button';
|
|
263
|
+
child: string;
|
|
264
|
+
primary?: boolean;
|
|
265
|
+
action?: A2UIAction;
|
|
266
|
+
disabled?: Bindable<boolean>;
|
|
267
|
+
loading?: Bindable<boolean>;
|
|
268
|
+
theme?: 'default' | 'primary' | 'danger' | 'warning' | 'success';
|
|
269
|
+
variant?: 'base' | 'outline' | 'dashed' | 'text';
|
|
270
|
+
size?: 'small' | 'medium' | 'large';
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* CheckBox 组件
|
|
274
|
+
*/
|
|
275
|
+
export interface A2UICheckBoxComponent extends A2UIComponentBase {
|
|
276
|
+
component: 'CheckBox';
|
|
277
|
+
label: Bindable<string>;
|
|
278
|
+
value: Bindable<boolean>;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* TextField 组件 (A2UI v0.9 规范)
|
|
282
|
+
*/
|
|
283
|
+
export interface A2UITextFieldComponent extends A2UIComponentBase {
|
|
284
|
+
component: 'TextField';
|
|
285
|
+
label: Bindable<string>;
|
|
286
|
+
text?: Bindable<string>;
|
|
287
|
+
usageHint?: 'longText' | 'number' | 'shortText' | 'obscured';
|
|
288
|
+
validationRegexp?: string;
|
|
289
|
+
placeholder?: string;
|
|
290
|
+
disabled?: Bindable<boolean>;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* DateTimeInput 组件
|
|
294
|
+
*/
|
|
295
|
+
export interface A2UIDateTimeInputComponent extends A2UIComponentBase {
|
|
296
|
+
component: 'DateTimeInput';
|
|
297
|
+
value: Bindable<string>;
|
|
298
|
+
enableDate?: boolean;
|
|
299
|
+
enableTime?: boolean;
|
|
300
|
+
outputFormat?: string;
|
|
301
|
+
label?: Bindable<string>;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* ChoicePicker 选项
|
|
305
|
+
*/
|
|
306
|
+
export interface A2UIChoiceOption {
|
|
307
|
+
label: Bindable<string>;
|
|
308
|
+
value: string;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* ChoicePicker 组件 (单选/多选)
|
|
312
|
+
*/
|
|
313
|
+
export interface A2UIChoicePickerComponent extends A2UIComponentBase {
|
|
314
|
+
component: 'ChoicePicker';
|
|
315
|
+
label: Bindable<string>;
|
|
316
|
+
usageHint: 'multipleSelection' | 'mutuallyExclusive';
|
|
317
|
+
options: A2UIChoiceOption[];
|
|
318
|
+
value: Bindable<string[]>;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Slider 组件
|
|
322
|
+
*/
|
|
323
|
+
export interface A2UISliderComponent extends A2UIComponentBase {
|
|
324
|
+
component: 'Slider';
|
|
325
|
+
label?: Bindable<string>;
|
|
326
|
+
min?: number;
|
|
327
|
+
max?: number;
|
|
328
|
+
value: Bindable<number>;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Input 组件 (TDesign 扩展,简化版 TextField)
|
|
332
|
+
*/
|
|
333
|
+
export interface A2UIInputComponent extends A2UIComponentBase {
|
|
334
|
+
component: 'Input';
|
|
335
|
+
value?: Bindable<string>;
|
|
336
|
+
placeholder?: string;
|
|
337
|
+
disabled?: Bindable<boolean>;
|
|
338
|
+
label?: string;
|
|
339
|
+
type?: 'text' | 'password' | 'number';
|
|
340
|
+
clearable?: boolean;
|
|
341
|
+
status?: 'default' | 'success' | 'warning' | 'error';
|
|
342
|
+
tips?: string;
|
|
343
|
+
size?: 'small' | 'medium' | 'large';
|
|
344
|
+
maxlength?: number;
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* RadioGroup 组件 (TDesign 扩展)
|
|
348
|
+
*/
|
|
349
|
+
export interface A2UIRadioOption {
|
|
350
|
+
label: Bindable<string>;
|
|
351
|
+
value: string | number | boolean;
|
|
352
|
+
disabled?: boolean;
|
|
353
|
+
}
|
|
354
|
+
export interface A2UIRadioGroupComponent extends A2UIComponentBase {
|
|
355
|
+
component: 'RadioGroup';
|
|
356
|
+
value?: Bindable<string | number | boolean>;
|
|
357
|
+
options: A2UIRadioOption[];
|
|
358
|
+
disabled?: Bindable<boolean>;
|
|
359
|
+
theme?: 'radio' | 'button';
|
|
360
|
+
variant?: 'outline' | 'primary-filled' | 'default-filled';
|
|
361
|
+
size?: 'small' | 'medium' | 'large';
|
|
362
|
+
allowUncheck?: boolean;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* CheckboxGroup 组件 (TDesign 扩展)
|
|
366
|
+
*/
|
|
367
|
+
export interface A2UICheckboxGroupComponent extends A2UIComponentBase {
|
|
368
|
+
component: 'CheckboxGroup';
|
|
369
|
+
value?: Bindable<(string | number)[]>;
|
|
370
|
+
options: A2UIRadioOption[];
|
|
371
|
+
disabled?: Bindable<boolean>;
|
|
372
|
+
}
|
|
373
|
+
export type A2UIComponent = A2UITextComponent | A2UIImageComponent | A2UIIconComponent | A2UIRowComponent | A2UIColumnComponent | A2UIListComponent | A2UICardComponent | A2UITabsComponent | A2UIDividerComponent | A2UIButtonComponent | A2UICheckBoxComponent | A2UITextFieldComponent | A2UIDateTimeInputComponent | A2UIChoicePickerComponent | A2UISliderComponent | A2UIInputComponent | A2UIRadioGroupComponent | A2UICheckboxGroupComponent;
|
|
374
|
+
/**
|
|
375
|
+
* 组件类型枚举
|
|
376
|
+
*/
|
|
377
|
+
export declare const A2UIComponentType: {
|
|
378
|
+
readonly Text: "Text";
|
|
379
|
+
readonly Image: "Image";
|
|
380
|
+
readonly Icon: "Icon";
|
|
381
|
+
readonly Row: "Row";
|
|
382
|
+
readonly Column: "Column";
|
|
383
|
+
readonly List: "List";
|
|
384
|
+
readonly Card: "Card";
|
|
385
|
+
readonly Tabs: "Tabs";
|
|
386
|
+
readonly Divider: "Divider";
|
|
387
|
+
readonly Button: "Button";
|
|
388
|
+
readonly CheckBox: "CheckBox";
|
|
389
|
+
readonly TextField: "TextField";
|
|
390
|
+
readonly DateTimeInput: "DateTimeInput";
|
|
391
|
+
readonly ChoicePicker: "ChoicePicker";
|
|
392
|
+
readonly Slider: "Slider";
|
|
393
|
+
readonly Input: "Input";
|
|
394
|
+
readonly RadioGroup: "RadioGroup";
|
|
395
|
+
readonly CheckboxGroup: "CheckboxGroup";
|
|
396
|
+
};
|
|
397
|
+
/**
|
|
398
|
+
* createSurface 消息
|
|
399
|
+
*/
|
|
400
|
+
export interface CreateSurfaceMessage {
|
|
401
|
+
createSurface: {
|
|
402
|
+
surfaceId: string;
|
|
403
|
+
catalogId: string;
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* updateComponents 消息
|
|
408
|
+
*/
|
|
409
|
+
export interface UpdateComponentsMessage {
|
|
410
|
+
updateComponents: {
|
|
411
|
+
surfaceId: string;
|
|
412
|
+
components: A2UIComponentBase[];
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* updateDataModel 消息
|
|
417
|
+
*/
|
|
418
|
+
export interface UpdateDataModelMessage {
|
|
419
|
+
updateDataModel: {
|
|
420
|
+
surfaceId: string;
|
|
421
|
+
path?: string;
|
|
422
|
+
op?: 'add' | 'replace' | 'remove';
|
|
423
|
+
value?: unknown;
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* deleteSurface 消息
|
|
428
|
+
*/
|
|
429
|
+
export interface DeleteSurfaceMessage {
|
|
430
|
+
deleteSurface: {
|
|
431
|
+
surfaceId: string;
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* 服务端消息联合类型
|
|
436
|
+
*/
|
|
437
|
+
export type A2UIServerMessage = CreateSurfaceMessage | UpdateComponentsMessage | UpdateDataModelMessage | DeleteSurfaceMessage;
|
|
438
|
+
/**
|
|
439
|
+
* Surface 状态
|
|
440
|
+
*/
|
|
441
|
+
export type SurfaceState = 'active' | 'closed' | 'pending';
|
|
442
|
+
/**
|
|
443
|
+
* Skeleton 布局提示
|
|
444
|
+
*/
|
|
445
|
+
export type SkeletonLayoutHint = 'form' | 'card' | 'list' | 'simple' | 'wizard';
|
|
446
|
+
/**
|
|
447
|
+
* Skeleton 配置
|
|
448
|
+
*/
|
|
449
|
+
export interface SkeletonHint {
|
|
450
|
+
layout?: SkeletonLayoutHint;
|
|
451
|
+
rowCount?: number;
|
|
452
|
+
animation?: 'gradient' | 'flashed' | 'none';
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* 解析后的组件节点(带 children 引用)
|
|
456
|
+
*/
|
|
457
|
+
export interface ResolvedComponent extends A2UIComponentBase {
|
|
458
|
+
resolvedChildren?: ResolvedComponent[];
|
|
459
|
+
dataContextPath?: string;
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* A2UI Surface - UI 表面抽象
|
|
463
|
+
*/
|
|
464
|
+
export interface A2UISurface {
|
|
465
|
+
id: string;
|
|
466
|
+
catalogId?: string;
|
|
467
|
+
state: SurfaceState;
|
|
468
|
+
/** 组件平铺注册表 */
|
|
469
|
+
components: Map<string, A2UIComponentBase>;
|
|
470
|
+
/** 解析后的组件树根节点 */
|
|
471
|
+
root: ResolvedComponent | null;
|
|
472
|
+
/** 数据模型 */
|
|
473
|
+
data: Record<string, unknown>;
|
|
474
|
+
/** 骨架屏提示 */
|
|
475
|
+
skeletonHint?: SkeletonHint;
|
|
476
|
+
updatedAt?: number;
|
|
477
|
+
}
|
|
478
|
+
export type A2UIOperationType = 'create' | 'update' | 'patch' | 'delete' | 'action';
|
|
479
|
+
export interface A2UIOperation {
|
|
480
|
+
type: A2UIOperationType;
|
|
481
|
+
surfaceId: string;
|
|
482
|
+
componentId?: string;
|
|
483
|
+
payload?: A2UIComponent | Partial<A2UIComponent> | A2UIAction | Record<string, unknown>;
|
|
484
|
+
}
|
|
485
|
+
export interface A2UIMessage {
|
|
486
|
+
surfaceId: string;
|
|
487
|
+
operations: A2UIOperation[];
|
|
488
|
+
data?: Record<string, unknown>;
|
|
489
|
+
}
|
|
490
|
+
export declare const A2UIComponentBaseSchema: z.ZodObject<{
|
|
491
|
+
id: z.ZodString;
|
|
492
|
+
component: z.ZodString;
|
|
493
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
494
|
+
id: z.ZodString;
|
|
495
|
+
component: z.ZodString;
|
|
496
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
497
|
+
id: z.ZodString;
|
|
498
|
+
component: z.ZodString;
|
|
499
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
500
|
+
export declare const createSurfaceMessageSchema: z.ZodObject<{
|
|
501
|
+
createSurface: z.ZodObject<{
|
|
502
|
+
surfaceId: z.ZodString;
|
|
503
|
+
catalogId: z.ZodString;
|
|
504
|
+
}, "strip", z.ZodTypeAny, {
|
|
505
|
+
surfaceId?: string;
|
|
506
|
+
catalogId?: string;
|
|
507
|
+
}, {
|
|
508
|
+
surfaceId?: string;
|
|
509
|
+
catalogId?: string;
|
|
510
|
+
}>;
|
|
511
|
+
}, "strip", z.ZodTypeAny, {
|
|
512
|
+
createSurface?: {
|
|
513
|
+
surfaceId?: string;
|
|
514
|
+
catalogId?: string;
|
|
515
|
+
};
|
|
516
|
+
}, {
|
|
517
|
+
createSurface?: {
|
|
518
|
+
surfaceId?: string;
|
|
519
|
+
catalogId?: string;
|
|
520
|
+
};
|
|
521
|
+
}>;
|
|
522
|
+
export declare const updateComponentsMessageSchema: z.ZodObject<{
|
|
523
|
+
updateComponents: z.ZodObject<{
|
|
524
|
+
surfaceId: z.ZodString;
|
|
525
|
+
components: z.ZodArray<z.ZodObject<{
|
|
526
|
+
id: z.ZodString;
|
|
527
|
+
component: z.ZodString;
|
|
528
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
529
|
+
id: z.ZodString;
|
|
530
|
+
component: z.ZodString;
|
|
531
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
532
|
+
id: z.ZodString;
|
|
533
|
+
component: z.ZodString;
|
|
534
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
535
|
+
}, "strip", z.ZodTypeAny, {
|
|
536
|
+
surfaceId?: string;
|
|
537
|
+
components?: z.objectOutputType<{
|
|
538
|
+
id: z.ZodString;
|
|
539
|
+
component: z.ZodString;
|
|
540
|
+
}, z.ZodTypeAny, "passthrough">[];
|
|
541
|
+
}, {
|
|
542
|
+
surfaceId?: string;
|
|
543
|
+
components?: z.objectInputType<{
|
|
544
|
+
id: z.ZodString;
|
|
545
|
+
component: z.ZodString;
|
|
546
|
+
}, z.ZodTypeAny, "passthrough">[];
|
|
547
|
+
}>;
|
|
548
|
+
}, "strip", z.ZodTypeAny, {
|
|
549
|
+
updateComponents?: {
|
|
550
|
+
surfaceId?: string;
|
|
551
|
+
components?: z.objectOutputType<{
|
|
552
|
+
id: z.ZodString;
|
|
553
|
+
component: z.ZodString;
|
|
554
|
+
}, z.ZodTypeAny, "passthrough">[];
|
|
555
|
+
};
|
|
556
|
+
}, {
|
|
557
|
+
updateComponents?: {
|
|
558
|
+
surfaceId?: string;
|
|
559
|
+
components?: z.objectInputType<{
|
|
560
|
+
id: z.ZodString;
|
|
561
|
+
component: z.ZodString;
|
|
562
|
+
}, z.ZodTypeAny, "passthrough">[];
|
|
563
|
+
};
|
|
564
|
+
}>;
|
|
565
|
+
export declare const updateDataModelMessageSchema: z.ZodObject<{
|
|
566
|
+
updateDataModel: z.ZodObject<{
|
|
567
|
+
surfaceId: z.ZodString;
|
|
568
|
+
path: z.ZodOptional<z.ZodString>;
|
|
569
|
+
op: z.ZodOptional<z.ZodEnum<["add", "replace", "remove"]>>;
|
|
570
|
+
value: z.ZodOptional<z.ZodAny>;
|
|
571
|
+
}, "strip", z.ZodTypeAny, {
|
|
572
|
+
path?: string;
|
|
573
|
+
value?: any;
|
|
574
|
+
surfaceId?: string;
|
|
575
|
+
op?: "replace" | "add" | "remove";
|
|
576
|
+
}, {
|
|
577
|
+
path?: string;
|
|
578
|
+
value?: any;
|
|
579
|
+
surfaceId?: string;
|
|
580
|
+
op?: "replace" | "add" | "remove";
|
|
581
|
+
}>;
|
|
582
|
+
}, "strip", z.ZodTypeAny, {
|
|
583
|
+
updateDataModel?: {
|
|
584
|
+
path?: string;
|
|
585
|
+
value?: any;
|
|
586
|
+
surfaceId?: string;
|
|
587
|
+
op?: "replace" | "add" | "remove";
|
|
588
|
+
};
|
|
589
|
+
}, {
|
|
590
|
+
updateDataModel?: {
|
|
591
|
+
path?: string;
|
|
592
|
+
value?: any;
|
|
593
|
+
surfaceId?: string;
|
|
594
|
+
op?: "replace" | "add" | "remove";
|
|
595
|
+
};
|
|
596
|
+
}>;
|
|
597
|
+
export declare const deleteSurfaceMessageSchema: z.ZodObject<{
|
|
598
|
+
deleteSurface: z.ZodObject<{
|
|
599
|
+
surfaceId: z.ZodString;
|
|
600
|
+
}, "strip", z.ZodTypeAny, {
|
|
601
|
+
surfaceId?: string;
|
|
602
|
+
}, {
|
|
603
|
+
surfaceId?: string;
|
|
604
|
+
}>;
|
|
605
|
+
}, "strip", z.ZodTypeAny, {
|
|
606
|
+
deleteSurface?: {
|
|
607
|
+
surfaceId?: string;
|
|
608
|
+
};
|
|
609
|
+
}, {
|
|
610
|
+
deleteSurface?: {
|
|
611
|
+
surfaceId?: string;
|
|
612
|
+
};
|
|
613
|
+
}>;
|
|
614
|
+
export declare const serverMessageSchema: z.ZodUnion<[z.ZodObject<{
|
|
615
|
+
createSurface: z.ZodObject<{
|
|
616
|
+
surfaceId: z.ZodString;
|
|
617
|
+
catalogId: z.ZodString;
|
|
618
|
+
}, "strip", z.ZodTypeAny, {
|
|
619
|
+
surfaceId?: string;
|
|
620
|
+
catalogId?: string;
|
|
621
|
+
}, {
|
|
622
|
+
surfaceId?: string;
|
|
623
|
+
catalogId?: string;
|
|
624
|
+
}>;
|
|
625
|
+
}, "strip", z.ZodTypeAny, {
|
|
626
|
+
createSurface?: {
|
|
627
|
+
surfaceId?: string;
|
|
628
|
+
catalogId?: string;
|
|
629
|
+
};
|
|
630
|
+
}, {
|
|
631
|
+
createSurface?: {
|
|
632
|
+
surfaceId?: string;
|
|
633
|
+
catalogId?: string;
|
|
634
|
+
};
|
|
635
|
+
}>, z.ZodObject<{
|
|
636
|
+
updateComponents: z.ZodObject<{
|
|
637
|
+
surfaceId: z.ZodString;
|
|
638
|
+
components: z.ZodArray<z.ZodObject<{
|
|
639
|
+
id: z.ZodString;
|
|
640
|
+
component: z.ZodString;
|
|
641
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
642
|
+
id: z.ZodString;
|
|
643
|
+
component: z.ZodString;
|
|
644
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
645
|
+
id: z.ZodString;
|
|
646
|
+
component: z.ZodString;
|
|
647
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
648
|
+
}, "strip", z.ZodTypeAny, {
|
|
649
|
+
surfaceId?: string;
|
|
650
|
+
components?: z.objectOutputType<{
|
|
651
|
+
id: z.ZodString;
|
|
652
|
+
component: z.ZodString;
|
|
653
|
+
}, z.ZodTypeAny, "passthrough">[];
|
|
654
|
+
}, {
|
|
655
|
+
surfaceId?: string;
|
|
656
|
+
components?: z.objectInputType<{
|
|
657
|
+
id: z.ZodString;
|
|
658
|
+
component: z.ZodString;
|
|
659
|
+
}, z.ZodTypeAny, "passthrough">[];
|
|
660
|
+
}>;
|
|
661
|
+
}, "strip", z.ZodTypeAny, {
|
|
662
|
+
updateComponents?: {
|
|
663
|
+
surfaceId?: string;
|
|
664
|
+
components?: z.objectOutputType<{
|
|
665
|
+
id: z.ZodString;
|
|
666
|
+
component: z.ZodString;
|
|
667
|
+
}, z.ZodTypeAny, "passthrough">[];
|
|
668
|
+
};
|
|
669
|
+
}, {
|
|
670
|
+
updateComponents?: {
|
|
671
|
+
surfaceId?: string;
|
|
672
|
+
components?: z.objectInputType<{
|
|
673
|
+
id: z.ZodString;
|
|
674
|
+
component: z.ZodString;
|
|
675
|
+
}, z.ZodTypeAny, "passthrough">[];
|
|
676
|
+
};
|
|
677
|
+
}>, z.ZodObject<{
|
|
678
|
+
updateDataModel: z.ZodObject<{
|
|
679
|
+
surfaceId: z.ZodString;
|
|
680
|
+
path: z.ZodOptional<z.ZodString>;
|
|
681
|
+
op: z.ZodOptional<z.ZodEnum<["add", "replace", "remove"]>>;
|
|
682
|
+
value: z.ZodOptional<z.ZodAny>;
|
|
683
|
+
}, "strip", z.ZodTypeAny, {
|
|
684
|
+
path?: string;
|
|
685
|
+
value?: any;
|
|
686
|
+
surfaceId?: string;
|
|
687
|
+
op?: "replace" | "add" | "remove";
|
|
688
|
+
}, {
|
|
689
|
+
path?: string;
|
|
690
|
+
value?: any;
|
|
691
|
+
surfaceId?: string;
|
|
692
|
+
op?: "replace" | "add" | "remove";
|
|
693
|
+
}>;
|
|
694
|
+
}, "strip", z.ZodTypeAny, {
|
|
695
|
+
updateDataModel?: {
|
|
696
|
+
path?: string;
|
|
697
|
+
value?: any;
|
|
698
|
+
surfaceId?: string;
|
|
699
|
+
op?: "replace" | "add" | "remove";
|
|
700
|
+
};
|
|
701
|
+
}, {
|
|
702
|
+
updateDataModel?: {
|
|
703
|
+
path?: string;
|
|
704
|
+
value?: any;
|
|
705
|
+
surfaceId?: string;
|
|
706
|
+
op?: "replace" | "add" | "remove";
|
|
707
|
+
};
|
|
708
|
+
}>, z.ZodObject<{
|
|
709
|
+
deleteSurface: z.ZodObject<{
|
|
710
|
+
surfaceId: z.ZodString;
|
|
711
|
+
}, "strip", z.ZodTypeAny, {
|
|
712
|
+
surfaceId?: string;
|
|
713
|
+
}, {
|
|
714
|
+
surfaceId?: string;
|
|
715
|
+
}>;
|
|
716
|
+
}, "strip", z.ZodTypeAny, {
|
|
717
|
+
deleteSurface?: {
|
|
718
|
+
surfaceId?: string;
|
|
719
|
+
};
|
|
720
|
+
}, {
|
|
721
|
+
deleteSurface?: {
|
|
722
|
+
surfaceId?: string;
|
|
723
|
+
};
|
|
724
|
+
}>]>;
|
|
725
|
+
export declare const A2UISurfaceSchema: z.ZodObject<{
|
|
726
|
+
id: z.ZodString;
|
|
727
|
+
catalogId: z.ZodOptional<z.ZodString>;
|
|
728
|
+
state: z.ZodEnum<["active", "closed", "pending"]>;
|
|
729
|
+
root: z.ZodNullable<z.ZodAny>;
|
|
730
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
731
|
+
skeletonHint: z.ZodOptional<z.ZodObject<{
|
|
732
|
+
layout: z.ZodOptional<z.ZodEnum<["form", "card", "list", "simple", "wizard"]>>;
|
|
733
|
+
rowCount: z.ZodOptional<z.ZodNumber>;
|
|
734
|
+
animation: z.ZodOptional<z.ZodEnum<["gradient", "flashed", "none"]>>;
|
|
735
|
+
}, "strip", z.ZodTypeAny, {
|
|
736
|
+
layout?: "form" | "list" | "card" | "simple" | "wizard";
|
|
737
|
+
animation?: "gradient" | "none" | "flashed";
|
|
738
|
+
rowCount?: number;
|
|
739
|
+
}, {
|
|
740
|
+
layout?: "form" | "list" | "card" | "simple" | "wizard";
|
|
741
|
+
animation?: "gradient" | "none" | "flashed";
|
|
742
|
+
rowCount?: number;
|
|
743
|
+
}>>;
|
|
744
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
745
|
+
}, "strip", z.ZodTypeAny, {
|
|
746
|
+
data?: Record<string, unknown>;
|
|
747
|
+
id?: string;
|
|
748
|
+
state?: "pending" | "closed" | "active";
|
|
749
|
+
catalogId?: string;
|
|
750
|
+
root?: any;
|
|
751
|
+
skeletonHint?: {
|
|
752
|
+
layout?: "form" | "list" | "card" | "simple" | "wizard";
|
|
753
|
+
animation?: "gradient" | "none" | "flashed";
|
|
754
|
+
rowCount?: number;
|
|
755
|
+
};
|
|
756
|
+
updatedAt?: number;
|
|
757
|
+
}, {
|
|
758
|
+
data?: Record<string, unknown>;
|
|
759
|
+
id?: string;
|
|
760
|
+
state?: "pending" | "closed" | "active";
|
|
761
|
+
catalogId?: string;
|
|
762
|
+
root?: any;
|
|
763
|
+
skeletonHint?: {
|
|
764
|
+
layout?: "form" | "list" | "card" | "simple" | "wizard";
|
|
765
|
+
animation?: "gradient" | "none" | "flashed";
|
|
766
|
+
rowCount?: number;
|
|
767
|
+
};
|
|
768
|
+
updatedAt?: number;
|
|
769
|
+
}>;
|