@zhama/a2ui-core 0.1.0 → 0.2.0
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 +95 -22
- package/dist/builders/index.cjs +3 -496
- package/dist/builders/index.d.cts +8 -13
- package/dist/builders/index.d.ts +8 -13
- package/dist/builders/index.js +3 -445
- package/dist/index.cjs +3 -869
- package/dist/index.d.cts +3 -41
- package/dist/index.d.ts +3 -41
- package/dist/index.js +3 -802
- package/dist/primitives-nmkVz-tB.d.cts +80 -0
- package/dist/primitives-nmkVz-tB.d.ts +80 -0
- package/dist/types/index.cjs +2 -22
- package/dist/types/index.d.cts +3 -79
- package/dist/types/index.d.ts +3 -79
- package/dist/types/index.js +2 -15
- package/dist/utils/index.cjs +1 -0
- package/dist/utils/index.d.cts +40 -0
- package/dist/utils/index.d.ts +40 -0
- package/dist/utils/index.js +1 -0
- package/dist/validators/index.cjs +1 -313
- package/dist/validators/index.d.cts +1 -0
- package/dist/validators/index.d.ts +1 -0
- package/dist/validators/index.js +1 -308
- package/package.json +80 -53
- package/dist/builders/index.cjs.map +0 -1
- package/dist/builders/index.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/types/index.cjs.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/validators/index.cjs.map +0 -1
- package/dist/validators/index.js.map +0 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A2UI Primitive Types
|
|
3
|
+
*
|
|
4
|
+
* 基础值类型定义,支持字面值和数据绑定路径
|
|
5
|
+
* These types represent values that can be either literal values or data bindings
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* 字符串值 - 可以是字面值或数据路径绑定
|
|
9
|
+
* @example
|
|
10
|
+
* // Literal value
|
|
11
|
+
* { literalString: "Hello World" }
|
|
12
|
+
* // or simply a string (v0.9 format)
|
|
13
|
+
* "Hello World"
|
|
14
|
+
*
|
|
15
|
+
* // Data binding
|
|
16
|
+
* { path: "/user/name" }
|
|
17
|
+
*/
|
|
18
|
+
type StringOrPath = string | {
|
|
19
|
+
path: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* 数值 - 可以是字面值或数据路径绑定
|
|
23
|
+
*/
|
|
24
|
+
type NumberOrPath = number | {
|
|
25
|
+
path: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* 布尔值 - 可以是字面值或数据路径绑定
|
|
29
|
+
*/
|
|
30
|
+
type BooleanOrPath = boolean | {
|
|
31
|
+
path: string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* 字符串数组 - 可以是字面值或数据路径绑定
|
|
35
|
+
*/
|
|
36
|
+
type StringArrayOrPath = string[] | {
|
|
37
|
+
path: string;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* v0.8 格式的字符串值(带有 literalString/path 区分)
|
|
41
|
+
*/
|
|
42
|
+
interface StringValue {
|
|
43
|
+
path?: string;
|
|
44
|
+
literalString?: string;
|
|
45
|
+
/** @deprecated 使用 literalString */
|
|
46
|
+
literal?: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* v0.8 格式的数值(带有 literalNumber/path 区分)
|
|
50
|
+
*/
|
|
51
|
+
interface NumberValue {
|
|
52
|
+
path?: string;
|
|
53
|
+
literalNumber?: number;
|
|
54
|
+
/** @deprecated 使用 literalNumber */
|
|
55
|
+
literal?: number;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* v0.8 格式的布尔值(带有 literalBoolean/path 区分)
|
|
59
|
+
*/
|
|
60
|
+
interface BooleanValue {
|
|
61
|
+
path?: string;
|
|
62
|
+
literalBoolean?: boolean;
|
|
63
|
+
/** @deprecated 使用 literalBoolean */
|
|
64
|
+
literal?: boolean;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* v0.8 格式的字符串数组值
|
|
68
|
+
*/
|
|
69
|
+
interface StringArrayValue {
|
|
70
|
+
path?: string;
|
|
71
|
+
literalArray?: string[];
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Context value - 用于 Action context 中的值
|
|
75
|
+
*/
|
|
76
|
+
type ContextValue = string | number | boolean | {
|
|
77
|
+
path: string;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export type { BooleanOrPath as B, ContextValue as C, NumberOrPath as N, StringOrPath as S, StringArrayOrPath as a, StringValue as b, NumberValue as c, BooleanValue as d, StringArrayValue as e };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A2UI Primitive Types
|
|
3
|
+
*
|
|
4
|
+
* 基础值类型定义,支持字面值和数据绑定路径
|
|
5
|
+
* These types represent values that can be either literal values or data bindings
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* 字符串值 - 可以是字面值或数据路径绑定
|
|
9
|
+
* @example
|
|
10
|
+
* // Literal value
|
|
11
|
+
* { literalString: "Hello World" }
|
|
12
|
+
* // or simply a string (v0.9 format)
|
|
13
|
+
* "Hello World"
|
|
14
|
+
*
|
|
15
|
+
* // Data binding
|
|
16
|
+
* { path: "/user/name" }
|
|
17
|
+
*/
|
|
18
|
+
type StringOrPath = string | {
|
|
19
|
+
path: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* 数值 - 可以是字面值或数据路径绑定
|
|
23
|
+
*/
|
|
24
|
+
type NumberOrPath = number | {
|
|
25
|
+
path: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* 布尔值 - 可以是字面值或数据路径绑定
|
|
29
|
+
*/
|
|
30
|
+
type BooleanOrPath = boolean | {
|
|
31
|
+
path: string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* 字符串数组 - 可以是字面值或数据路径绑定
|
|
35
|
+
*/
|
|
36
|
+
type StringArrayOrPath = string[] | {
|
|
37
|
+
path: string;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* v0.8 格式的字符串值(带有 literalString/path 区分)
|
|
41
|
+
*/
|
|
42
|
+
interface StringValue {
|
|
43
|
+
path?: string;
|
|
44
|
+
literalString?: string;
|
|
45
|
+
/** @deprecated 使用 literalString */
|
|
46
|
+
literal?: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* v0.8 格式的数值(带有 literalNumber/path 区分)
|
|
50
|
+
*/
|
|
51
|
+
interface NumberValue {
|
|
52
|
+
path?: string;
|
|
53
|
+
literalNumber?: number;
|
|
54
|
+
/** @deprecated 使用 literalNumber */
|
|
55
|
+
literal?: number;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* v0.8 格式的布尔值(带有 literalBoolean/path 区分)
|
|
59
|
+
*/
|
|
60
|
+
interface BooleanValue {
|
|
61
|
+
path?: string;
|
|
62
|
+
literalBoolean?: boolean;
|
|
63
|
+
/** @deprecated 使用 literalBoolean */
|
|
64
|
+
literal?: boolean;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* v0.8 格式的字符串数组值
|
|
68
|
+
*/
|
|
69
|
+
interface StringArrayValue {
|
|
70
|
+
path?: string;
|
|
71
|
+
literalArray?: string[];
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Context value - 用于 Action context 中的值
|
|
75
|
+
*/
|
|
76
|
+
type ContextValue = string | number | boolean | {
|
|
77
|
+
path: string;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export type { BooleanOrPath as B, ContextValue as C, NumberOrPath as N, StringOrPath as S, StringArrayOrPath as a, StringValue as b, NumberValue as c, BooleanValue as d, StringArrayValue as e };
|
package/dist/types/index.cjs
CHANGED
|
@@ -1,22 +1,2 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// src/types/messages.ts
|
|
4
|
-
function isV09Message(message) {
|
|
5
|
-
return "createSurface" in message || "updateComponents" in message || "updateDataModel" in message;
|
|
6
|
-
}
|
|
7
|
-
function isV08Message(message) {
|
|
8
|
-
return "beginRendering" in message || "surfaceUpdate" in message || "dataModelUpdate" in message;
|
|
9
|
-
}
|
|
10
|
-
var STANDARD_CATALOG_ID = "https://a2ui.dev/specification/0.9/standard_catalog_definition.json";
|
|
11
|
-
var A2UI_EXTENSION_URI_V08 = "https://a2ui.org/a2a-extension/a2ui/v0.8";
|
|
12
|
-
var A2UI_EXTENSION_URI = "https://a2ui.dev/specification/0.9";
|
|
13
|
-
var A2UI_MIME_TYPE = "application/json+a2ui";
|
|
14
|
-
|
|
15
|
-
exports.A2UI_EXTENSION_URI = A2UI_EXTENSION_URI;
|
|
16
|
-
exports.A2UI_EXTENSION_URI_V08 = A2UI_EXTENSION_URI_V08;
|
|
17
|
-
exports.A2UI_MIME_TYPE = A2UI_MIME_TYPE;
|
|
18
|
-
exports.STANDARD_CATALOG_ID = STANDARD_CATALOG_ID;
|
|
19
|
-
exports.isV08Message = isV08Message;
|
|
20
|
-
exports.isV09Message = isV09Message;
|
|
21
|
-
//# sourceMappingURL=index.cjs.map
|
|
22
|
-
//# sourceMappingURL=index.cjs.map
|
|
1
|
+
'use strict';function t(e){return "createSurface"in e||"updateComponents"in e||"updateDataModel"in e}function n(e){return "beginRendering"in e||"surfaceUpdate"in e||"dataModelUpdate"in e}var a="https://a2ui.dev/specification/0.9/standard_catalog_definition.json",o="https://a2ui.org/a2a-extension/a2ui/v0.8",r="https://a2ui.dev/specification/0.9",s="application/json+a2ui";
|
|
2
|
+
exports.A2UI_EXTENSION_URI=r;exports.A2UI_EXTENSION_URI_V08=o;exports.A2UI_MIME_TYPE=s;exports.STANDARD_CATALOG_ID=a;exports.isV08Message=n;exports.isV09Message=t;
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,81 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* 基础值类型定义,支持字面值和数据绑定路径
|
|
5
|
-
* These types represent values that can be either literal values or data bindings
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* 字符串值 - 可以是字面值或数据路径绑定
|
|
9
|
-
* @example
|
|
10
|
-
* // Literal value
|
|
11
|
-
* { literalString: "Hello World" }
|
|
12
|
-
* // or simply a string (v0.9 format)
|
|
13
|
-
* "Hello World"
|
|
14
|
-
*
|
|
15
|
-
* // Data binding
|
|
16
|
-
* { path: "/user/name" }
|
|
17
|
-
*/
|
|
18
|
-
type StringOrPath = string | {
|
|
19
|
-
path: string;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* 数值 - 可以是字面值或数据路径绑定
|
|
23
|
-
*/
|
|
24
|
-
type NumberOrPath = number | {
|
|
25
|
-
path: string;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* 布尔值 - 可以是字面值或数据路径绑定
|
|
29
|
-
*/
|
|
30
|
-
type BooleanOrPath = boolean | {
|
|
31
|
-
path: string;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* 字符串数组 - 可以是字面值或数据路径绑定
|
|
35
|
-
*/
|
|
36
|
-
type StringArrayOrPath = string[] | {
|
|
37
|
-
path: string;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* v0.8 格式的字符串值(带有 literalString/path 区分)
|
|
41
|
-
*/
|
|
42
|
-
interface StringValue {
|
|
43
|
-
path?: string;
|
|
44
|
-
literalString?: string;
|
|
45
|
-
/** @deprecated 使用 literalString */
|
|
46
|
-
literal?: string;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* v0.8 格式的数值(带有 literalNumber/path 区分)
|
|
50
|
-
*/
|
|
51
|
-
interface NumberValue {
|
|
52
|
-
path?: string;
|
|
53
|
-
literalNumber?: number;
|
|
54
|
-
/** @deprecated 使用 literalNumber */
|
|
55
|
-
literal?: number;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* v0.8 格式的布尔值(带有 literalBoolean/path 区分)
|
|
59
|
-
*/
|
|
60
|
-
interface BooleanValue {
|
|
61
|
-
path?: string;
|
|
62
|
-
literalBoolean?: boolean;
|
|
63
|
-
/** @deprecated 使用 literalBoolean */
|
|
64
|
-
literal?: boolean;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* v0.8 格式的字符串数组值
|
|
68
|
-
*/
|
|
69
|
-
interface StringArrayValue {
|
|
70
|
-
path?: string;
|
|
71
|
-
literalArray?: string[];
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Context value - 用于 Action context 中的值
|
|
75
|
-
*/
|
|
76
|
-
type ContextValue = string | number | boolean | {
|
|
77
|
-
path: string;
|
|
78
|
-
};
|
|
1
|
+
import { S as StringOrPath, N as NumberOrPath, B as BooleanOrPath, a as StringArrayOrPath } from '../primitives-nmkVz-tB.cjs';
|
|
2
|
+
export { d as BooleanValue, C as ContextValue, c as NumberValue, e as StringArrayValue, b as StringValue } from '../primitives-nmkVz-tB.cjs';
|
|
79
3
|
|
|
80
4
|
/**
|
|
81
5
|
* A2UI Component Types
|
|
@@ -708,4 +632,4 @@ declare const A2UI_EXTENSION_URI = "https://a2ui.dev/specification/0.9";
|
|
|
708
632
|
*/
|
|
709
633
|
declare const A2UI_MIME_TYPE = "application/json+a2ui";
|
|
710
634
|
|
|
711
|
-
export { A2UI_EXTENSION_URI, A2UI_EXTENSION_URI_V08, A2UI_MIME_TYPE, type Action, type ActionContextItem, type ActionV08, type AnyComponent, type AudioPlayerComponent, type BeginRenderingMessage,
|
|
635
|
+
export { A2UI_EXTENSION_URI, A2UI_EXTENSION_URI_V08, A2UI_MIME_TYPE, type Action, type ActionContextItem, type ActionV08, type AnyComponent, type AudioPlayerComponent, type BeginRenderingMessage, BooleanOrPath, type ButtonComponent, type CardComponent, type CheckBoxComponent, type ChildrenProperty, type ChoicePickerComponent, type ClientToServerMessage, type ColumnComponent, type ComponentCommon, type ComponentInstance, type ComponentInstanceV08, type ComponentType, type CreateSurfaceMessage, type DataArray, type DataChangeEvent, type DataModelUpdateMessage, type DataObject, type DataValue, type DateTimeInputComponent, type DeleteSurfaceMessage, type DeleteSurfaceMessageV08, type DividerComponent, type IconComponent, type ImageComponent, type ListComponent, type ModalComponent, NumberOrPath, type RowComponent, STANDARD_CATALOG_ID, type ServerToClientMessage, type ServerToClientMessageV08, type ServerToClientMessageV09, type SliderComponent, type StandardIconName, StringArrayOrPath, StringOrPath, type SurfaceUpdateMessage, type TabsComponent, type TextComponent, type TextFieldComponent, type Theme, type UpdateComponentsMessage, type UpdateDataModelMessage, type UserActionEvent, type ValueMap, type VideoComponent, isV08Message, isV09Message };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,81 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* 基础值类型定义,支持字面值和数据绑定路径
|
|
5
|
-
* These types represent values that can be either literal values or data bindings
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* 字符串值 - 可以是字面值或数据路径绑定
|
|
9
|
-
* @example
|
|
10
|
-
* // Literal value
|
|
11
|
-
* { literalString: "Hello World" }
|
|
12
|
-
* // or simply a string (v0.9 format)
|
|
13
|
-
* "Hello World"
|
|
14
|
-
*
|
|
15
|
-
* // Data binding
|
|
16
|
-
* { path: "/user/name" }
|
|
17
|
-
*/
|
|
18
|
-
type StringOrPath = string | {
|
|
19
|
-
path: string;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* 数值 - 可以是字面值或数据路径绑定
|
|
23
|
-
*/
|
|
24
|
-
type NumberOrPath = number | {
|
|
25
|
-
path: string;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* 布尔值 - 可以是字面值或数据路径绑定
|
|
29
|
-
*/
|
|
30
|
-
type BooleanOrPath = boolean | {
|
|
31
|
-
path: string;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* 字符串数组 - 可以是字面值或数据路径绑定
|
|
35
|
-
*/
|
|
36
|
-
type StringArrayOrPath = string[] | {
|
|
37
|
-
path: string;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* v0.8 格式的字符串值(带有 literalString/path 区分)
|
|
41
|
-
*/
|
|
42
|
-
interface StringValue {
|
|
43
|
-
path?: string;
|
|
44
|
-
literalString?: string;
|
|
45
|
-
/** @deprecated 使用 literalString */
|
|
46
|
-
literal?: string;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* v0.8 格式的数值(带有 literalNumber/path 区分)
|
|
50
|
-
*/
|
|
51
|
-
interface NumberValue {
|
|
52
|
-
path?: string;
|
|
53
|
-
literalNumber?: number;
|
|
54
|
-
/** @deprecated 使用 literalNumber */
|
|
55
|
-
literal?: number;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* v0.8 格式的布尔值(带有 literalBoolean/path 区分)
|
|
59
|
-
*/
|
|
60
|
-
interface BooleanValue {
|
|
61
|
-
path?: string;
|
|
62
|
-
literalBoolean?: boolean;
|
|
63
|
-
/** @deprecated 使用 literalBoolean */
|
|
64
|
-
literal?: boolean;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* v0.8 格式的字符串数组值
|
|
68
|
-
*/
|
|
69
|
-
interface StringArrayValue {
|
|
70
|
-
path?: string;
|
|
71
|
-
literalArray?: string[];
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Context value - 用于 Action context 中的值
|
|
75
|
-
*/
|
|
76
|
-
type ContextValue = string | number | boolean | {
|
|
77
|
-
path: string;
|
|
78
|
-
};
|
|
1
|
+
import { S as StringOrPath, N as NumberOrPath, B as BooleanOrPath, a as StringArrayOrPath } from '../primitives-nmkVz-tB.js';
|
|
2
|
+
export { d as BooleanValue, C as ContextValue, c as NumberValue, e as StringArrayValue, b as StringValue } from '../primitives-nmkVz-tB.js';
|
|
79
3
|
|
|
80
4
|
/**
|
|
81
5
|
* A2UI Component Types
|
|
@@ -708,4 +632,4 @@ declare const A2UI_EXTENSION_URI = "https://a2ui.dev/specification/0.9";
|
|
|
708
632
|
*/
|
|
709
633
|
declare const A2UI_MIME_TYPE = "application/json+a2ui";
|
|
710
634
|
|
|
711
|
-
export { A2UI_EXTENSION_URI, A2UI_EXTENSION_URI_V08, A2UI_MIME_TYPE, type Action, type ActionContextItem, type ActionV08, type AnyComponent, type AudioPlayerComponent, type BeginRenderingMessage,
|
|
635
|
+
export { A2UI_EXTENSION_URI, A2UI_EXTENSION_URI_V08, A2UI_MIME_TYPE, type Action, type ActionContextItem, type ActionV08, type AnyComponent, type AudioPlayerComponent, type BeginRenderingMessage, BooleanOrPath, type ButtonComponent, type CardComponent, type CheckBoxComponent, type ChildrenProperty, type ChoicePickerComponent, type ClientToServerMessage, type ColumnComponent, type ComponentCommon, type ComponentInstance, type ComponentInstanceV08, type ComponentType, type CreateSurfaceMessage, type DataArray, type DataChangeEvent, type DataModelUpdateMessage, type DataObject, type DataValue, type DateTimeInputComponent, type DeleteSurfaceMessage, type DeleteSurfaceMessageV08, type DividerComponent, type IconComponent, type ImageComponent, type ListComponent, type ModalComponent, NumberOrPath, type RowComponent, STANDARD_CATALOG_ID, type ServerToClientMessage, type ServerToClientMessageV08, type ServerToClientMessageV09, type SliderComponent, type StandardIconName, StringArrayOrPath, StringOrPath, type SurfaceUpdateMessage, type TabsComponent, type TextComponent, type TextFieldComponent, type Theme, type UpdateComponentsMessage, type UpdateDataModelMessage, type UserActionEvent, type ValueMap, type VideoComponent, isV08Message, isV09Message };
|
package/dist/types/index.js
CHANGED
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return "createSurface" in message || "updateComponents" in message || "updateDataModel" in message;
|
|
4
|
-
}
|
|
5
|
-
function isV08Message(message) {
|
|
6
|
-
return "beginRendering" in message || "surfaceUpdate" in message || "dataModelUpdate" in message;
|
|
7
|
-
}
|
|
8
|
-
var STANDARD_CATALOG_ID = "https://a2ui.dev/specification/0.9/standard_catalog_definition.json";
|
|
9
|
-
var A2UI_EXTENSION_URI_V08 = "https://a2ui.org/a2a-extension/a2ui/v0.8";
|
|
10
|
-
var A2UI_EXTENSION_URI = "https://a2ui.dev/specification/0.9";
|
|
11
|
-
var A2UI_MIME_TYPE = "application/json+a2ui";
|
|
12
|
-
|
|
13
|
-
export { A2UI_EXTENSION_URI, A2UI_EXTENSION_URI_V08, A2UI_MIME_TYPE, STANDARD_CATALOG_ID, isV08Message, isV09Message };
|
|
14
|
-
//# sourceMappingURL=index.js.map
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
function t(e){return "createSurface"in e||"updateComponents"in e||"updateDataModel"in e}function n(e){return "beginRendering"in e||"surfaceUpdate"in e||"dataModelUpdate"in e}var a="https://a2ui.dev/specification/0.9/standard_catalog_definition.json",o="https://a2ui.org/a2a-extension/a2ui/v0.8",r="https://a2ui.dev/specification/0.9",s="application/json+a2ui";
|
|
2
|
+
export{r as A2UI_EXTENSION_URI,o as A2UI_EXTENSION_URI_V08,s as A2UI_MIME_TYPE,a as STANDARD_CATALOG_ID,n as isV08Message,t as isV09Message};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';function a(t){return typeof t=="object"&&t!==null&&"path"in t}function u(t){if(!a(t))return t}function s(t){if(a(t))return t.path}function f(t){return {path:t}}function i(t,r){let e={...t};for(let o of Object.keys(r)){let n=r[o],x=e[o];n!==void 0&&typeof n=="object"&&n!==null&&!Array.isArray(n)&&typeof x=="object"&&x!==null&&!Array.isArray(x)?e[o]=i(x,n):n!==void 0&&(e[o]=n);}return e}function d(){return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let r=Math.random()*16|0;return (t==="x"?r:r&3|8).toString(16)})}exports.deepMerge=i;exports.getLiteralValue=u;exports.getPathValue=s;exports.isPathBinding=a;exports.path=f;exports.uuid=d;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { S as StringOrPath, N as NumberOrPath, B as BooleanOrPath } from '../primitives-nmkVz-tB.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A2UI Utilities
|
|
5
|
+
*
|
|
6
|
+
* 通用工具函数
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 判断值是否为数据路径绑定
|
|
11
|
+
*/
|
|
12
|
+
declare function isPathBinding(value: StringOrPath | NumberOrPath | BooleanOrPath): value is {
|
|
13
|
+
path: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* 从值中获取字面量(如果是绑定则返回 undefined)
|
|
17
|
+
*/
|
|
18
|
+
declare function getLiteralValue<T extends string | number | boolean>(value: T | {
|
|
19
|
+
path: string;
|
|
20
|
+
}): T | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* 从值中获取路径(如果是字面量则返回 undefined)
|
|
23
|
+
*/
|
|
24
|
+
declare function getPathValue(value: StringOrPath | NumberOrPath | BooleanOrPath): string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* 创建数据路径绑定
|
|
27
|
+
*/
|
|
28
|
+
declare function path(dataPath: string): {
|
|
29
|
+
path: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* 深度合并对象
|
|
33
|
+
*/
|
|
34
|
+
declare function deepMerge<T extends Record<string, unknown>>(target: T, source: Partial<T>): T;
|
|
35
|
+
/**
|
|
36
|
+
* 生成 UUID v4
|
|
37
|
+
*/
|
|
38
|
+
declare function uuid(): string;
|
|
39
|
+
|
|
40
|
+
export { deepMerge, getLiteralValue, getPathValue, isPathBinding, path, uuid };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { S as StringOrPath, N as NumberOrPath, B as BooleanOrPath } from '../primitives-nmkVz-tB.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A2UI Utilities
|
|
5
|
+
*
|
|
6
|
+
* 通用工具函数
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 判断值是否为数据路径绑定
|
|
11
|
+
*/
|
|
12
|
+
declare function isPathBinding(value: StringOrPath | NumberOrPath | BooleanOrPath): value is {
|
|
13
|
+
path: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* 从值中获取字面量(如果是绑定则返回 undefined)
|
|
17
|
+
*/
|
|
18
|
+
declare function getLiteralValue<T extends string | number | boolean>(value: T | {
|
|
19
|
+
path: string;
|
|
20
|
+
}): T | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* 从值中获取路径(如果是字面量则返回 undefined)
|
|
23
|
+
*/
|
|
24
|
+
declare function getPathValue(value: StringOrPath | NumberOrPath | BooleanOrPath): string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* 创建数据路径绑定
|
|
27
|
+
*/
|
|
28
|
+
declare function path(dataPath: string): {
|
|
29
|
+
path: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* 深度合并对象
|
|
33
|
+
*/
|
|
34
|
+
declare function deepMerge<T extends Record<string, unknown>>(target: T, source: Partial<T>): T;
|
|
35
|
+
/**
|
|
36
|
+
* 生成 UUID v4
|
|
37
|
+
*/
|
|
38
|
+
declare function uuid(): string;
|
|
39
|
+
|
|
40
|
+
export { deepMerge, getLiteralValue, getPathValue, isPathBinding, path, uuid };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a(t){return typeof t=="object"&&t!==null&&"path"in t}function u(t){if(!a(t))return t}function s(t){if(a(t))return t.path}function f(t){return {path:t}}function i(t,r){let e={...t};for(let o of Object.keys(r)){let n=r[o],x=e[o];n!==void 0&&typeof n=="object"&&n!==null&&!Array.isArray(n)&&typeof x=="object"&&x!==null&&!Array.isArray(x)?e[o]=i(x,n):n!==void 0&&(e[o]=n);}return e}function d(){return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let r=Math.random()*16|0;return (t==="x"?r:r&3|8).toString(16)})}export{i as deepMerge,u as getLiteralValue,s as getPathValue,a as isPathBinding,f as path,d as uuid};
|