@farris/x-ui 0.0.8 → 0.0.9

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.
Files changed (38) hide show
  1. package/agent-thinking/index.d.ts +7 -0
  2. package/agent-thinking/src/types.d.ts +7 -0
  3. package/attachment-file/index.d.ts +7 -0
  4. package/attachment-file/src/types.d.ts +10 -0
  5. package/bubble/src/composition/types.d.ts +2 -1
  6. package/components.d.ts +31 -2
  7. package/error-reminder/index.d.ts +7 -0
  8. package/error-reminder/src/types.d.ts +7 -0
  9. package/farris.x-ui.esm.js +1791 -1774
  10. package/farris.x-ui.umd.cjs +36 -36
  11. package/hitl-question/index.d.ts +7 -0
  12. package/hitl-question/src/types.d.ts +43 -0
  13. package/index.css +1 -1
  14. package/input-recommend/index.d.ts +7 -0
  15. package/input-recommend/src/types.d.ts +33 -0
  16. package/link-card/index.d.ts +7 -0
  17. package/link-card/src/types.d.ts +14 -0
  18. package/package.json +1 -1
  19. package/reference-sources/index.d.ts +7 -0
  20. package/reference-sources/src/types.d.ts +9 -0
  21. package/tool-use/index.d.ts +1 -0
  22. package/tool-use/src/tool-use.component.d.ts +1 -1
  23. package/tool-use/src/types.d.ts +22 -0
  24. package/unknown-enterprise/index.d.ts +7 -0
  25. package/unknown-enterprise/src/types.d.ts +7 -0
  26. package/user-auth/index.d.ts +7 -0
  27. package/user-auth/src/types.d.ts +13 -0
  28. package/enterprise-cloud/index.d.ts +0 -16
  29. package/enterprise-cloud/src/types.d.ts +0 -170
  30. /package/{enterprise-cloud → agent-thinking}/src/agent-thinking.component.d.ts +0 -0
  31. /package/{enterprise-cloud → attachment-file}/src/attachment-file.component.d.ts +0 -0
  32. /package/{enterprise-cloud → error-reminder}/src/error-reminder.component.d.ts +0 -0
  33. /package/{enterprise-cloud → hitl-question}/src/hitl-question.component.d.ts +0 -0
  34. /package/{enterprise-cloud → input-recommend}/src/input-recommend.component.d.ts +0 -0
  35. /package/{enterprise-cloud → link-card}/src/link-card.component.d.ts +0 -0
  36. /package/{enterprise-cloud → reference-sources}/src/reference-sources.component.d.ts +0 -0
  37. /package/{enterprise-cloud → unknown-enterprise}/src/unknown-enterprise.component.d.ts +0 -0
  38. /package/{enterprise-cloud → user-auth}/src/user-auth.component.d.ts +0 -0
@@ -0,0 +1,7 @@
1
+ import { Plugin } from '../../vue';
2
+ import { default as FXInputRecommend } from '../../src/input-recommend.component';
3
+
4
+ export * from '../../src/types';
5
+ export { FXInputRecommend };
6
+ declare const _default: typeof FXInputRecommend & Plugin;
7
+ export default _default;
@@ -0,0 +1,33 @@
1
+ /** 当前仅支持 Workbench 侧冻结的 {@link AgentWorkbenchSDK};后续可扩展其它 sdk 名 */
2
+ export type InputRecommendSdkName = 'AgentWorkbenchSDK';
3
+ /**
4
+ * 网关 `agent/input-recommend`(及兼容 `agent/suggestions`)可在 content 中携带:
5
+ * 点击某一推荐 chip 时调用的 SDK 方法及参数(见 `pickActionDefault` / `pickActions`)。
6
+ */
7
+ export interface InputRecommendPickAction {
8
+ sdk: InputRecommendSdkName;
9
+ /**
10
+ * `AgentWorkbenchSDK` 上的方法名,如 `sendChatMessage`、`showPreview`、`postAssistantMessage`。
11
+ * 运行时会通过 `invokeAgentWorkbenchSdkApi` 派发。
12
+ */
13
+ api: string;
14
+ /**
15
+ * 传给该方法的参数列表(按展开调用)。任意嵌套结构中的字符串若包含 `{{suggestionText}}` 会替换为当前 chip 文案。
16
+ */
17
+ params?: unknown[];
18
+ }
19
+ export interface MessageContentInputRecommend {
20
+ type: 'InputRecommend';
21
+ standardType?: 'agent/suggestions' | 'agent/input-recommend' | string;
22
+ title?: string;
23
+ suggestions: string[];
24
+ /**
25
+ * 与 `suggestions` 同序;某项为空则回退到 `pickActionDefault`。
26
+ * 若整卡均未配置,点击行为等价于 `sendChatMessage(该 chip 文案)`。
27
+ */
28
+ pickActions?: Array<InputRecommendPickAction | null | undefined>;
29
+ /**
30
+ * 整卡默认点击动作。网关也可只传 `pickAction`(与该项同义,由归一化层写入)。
31
+ */
32
+ pickActionDefault?: InputRecommendPickAction;
33
+ }
@@ -0,0 +1,7 @@
1
+ import { Plugin } from '../../vue';
2
+ import { default as FXLinkCard } from '../../src/link-card.component';
3
+
4
+ export * from '../../src/types';
5
+ export { FXLinkCard };
6
+ declare const _default: typeof FXLinkCard & Plugin;
7
+ export default _default;
@@ -0,0 +1,14 @@
1
+ export interface LinkRelatedItem {
2
+ title: string;
3
+ url: string;
4
+ poster?: string;
5
+ }
6
+ export interface MessageContentLinkCard {
7
+ type: 'LinkCard';
8
+ standardType?: 'card/url' | string;
9
+ poster?: string;
10
+ title: string;
11
+ subtitle?: string;
12
+ url: string;
13
+ relatedLinks?: LinkRelatedItem[];
14
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farris/x-ui",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "可复用的 AI 对话组件",
5
5
  "type": "module",
6
6
  "main": "./farris.x-ui.umd.cjs",
@@ -0,0 +1,7 @@
1
+ import { Plugin } from '../../vue';
2
+ import { default as FXReferenceSources } from '../../src/reference-sources.component';
3
+
4
+ export * from '../../src/types';
5
+ export { FXReferenceSources };
6
+ declare const _default: typeof FXReferenceSources & Plugin;
7
+ export default _default;
@@ -0,0 +1,9 @@
1
+ export interface ReferenceSourceItem {
2
+ title: string;
3
+ url: string;
4
+ }
5
+ export interface MessageContentReferenceSources {
6
+ type: 'ReferenceSources';
7
+ standardType?: 'agent/reference' | string;
8
+ items: ReferenceSourceItem[];
9
+ }
@@ -1,6 +1,7 @@
1
1
  import { Plugin } from '../../vue';
2
2
  import { default as FXToolUse } from '../../src/tool-use.component';
3
3
 
4
+ export * from '../../src/types';
4
5
  export { FXToolUse };
5
6
  declare const _default: typeof FXToolUse & Plugin;
6
7
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import { PropType } from '../../../vue';
2
- import { MessageContentToolUse } from '../../../../../enterprise-cloud/src/types';
2
+ import { MessageContentToolUse } from '../../../types';
3
3
 
4
4
  /**
5
5
  * 智能体工具调用条:标题栏展示工具名;默认收折;
@@ -0,0 +1,22 @@
1
+ /** 网关 `agent/tool-use`:一次工具调用(名称 / 调用描述或参数 / 执行结果) */
2
+ export interface MessageContentToolUse {
3
+ type: 'ToolUse';
4
+ standardType?: 'agent/tool-use' | string;
5
+ /** 与下行 `agent/tool-result.content.toolUseId` 关联;合泡块 id 优先以此为准 */
6
+ toolUseId?: string;
7
+ toolName: string;
8
+ /** 网关下发的调用描述或入参(多为可读字符串) */
9
+ toolDescription: string;
10
+ /** 工具输出(常为 JSON 字符串);可与 tool-use 分帧,由 applyGatewayEnvelope 合并写入 */
11
+ result: string;
12
+ /**
13
+ * 是否已收到 `agent/tool-result`(含 `result` 为空字符串的完成帧)。
14
+ * 仅以 `trim(result).length` 判断「完成」时,空 stdout 会一直显示「调用中」。
15
+ */
16
+ toolResultApplied?: boolean;
17
+ /** 工具调用整体是否成功;缺省/`true` 走原成功视觉,仅 `false` 走 `is-error` 视觉 */
18
+ success?: boolean;
19
+ /** 失败时的错误描述;优先级高于 result,仅在 `success === false` 时下发 */
20
+ errorMessage?: string;
21
+ sessionId?: string;
22
+ }
@@ -0,0 +1,7 @@
1
+ import { Plugin } from '../../vue';
2
+ import { default as FXUnknownEnterprise } from '../../src/unknown-enterprise.component';
3
+
4
+ export * from '../../src/types';
5
+ export { FXUnknownEnterprise };
6
+ declare const _default: typeof FXUnknownEnterprise & Plugin;
7
+ export default _default;
@@ -0,0 +1,7 @@
1
+ export interface MessageContentUnknownEnterprise {
2
+ type: 'UnknownEnterprise';
3
+ standardType?: 'unknown' | string;
4
+ /** Gateway body.type,阶段 C 登记、便于与标准对账 */
5
+ wireType?: string;
6
+ hint?: string;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { Plugin } from '../../vue';
2
+ import { default as FXUserAuth } from '../../src/user-auth.component';
3
+
4
+ export * from '../../src/types';
5
+ export { FXUserAuth };
6
+ declare const _default: typeof FXUserAuth & Plugin;
7
+ export default _default;
@@ -0,0 +1,13 @@
1
+ export interface UserAuthOption {
2
+ optionId: string;
3
+ name: string;
4
+ message?: string;
5
+ }
6
+ export interface MessageContentUserAuth {
7
+ type: 'UserAuth';
8
+ standardType?: 'agent/request-run' | string;
9
+ /** 《智能消息1.0》§5.3.3 content.requestId */
10
+ requestId?: string;
11
+ description: string;
12
+ options: UserAuthOption[];
13
+ }
@@ -1,16 +0,0 @@
1
- import { Plugin } from '../../vue';
2
- import { default as FXAgentThinking } from '../../src/agent-thinking.component';
3
- import { default as FXAttachmentFile } from '../../src/attachment-file.component';
4
- import { default as FXErrorReminder } from '../../src/error-reminder.component';
5
- import { default as FXInputRecommend } from '../../src/input-recommend.component';
6
- import { default as FXLinkCard } from '../../src/link-card.component';
7
- import { default as FXReferenceSources } from '../../src/reference-sources.component';
8
- import { default as FXToolUse } from '../../../tool-use';
9
- import { default as FXHitlQuestion } from '../../src/hitl-question.component';
10
- import { default as FXUnknownEnterprise } from '../../src/unknown-enterprise.component';
11
- import { default as FXUserAuth } from '../../src/user-auth.component';
12
-
13
- export { FXAgentThinking, FXAttachmentFile, FXErrorReminder, FXHitlQuestion, FXInputRecommend, FXLinkCard, FXReferenceSources, FXToolUse, FXUnknownEnterprise, FXUserAuth };
14
- export * from '../../src/types';
15
- declare const _default: typeof FXAgentThinking & Plugin;
16
- export default _default;
@@ -1,170 +0,0 @@
1
- /**
2
- * 企业云「智能消息标准」相关 content 变体(阶段 A)。
3
- * standardType:可选,便于与未来 wire 上的 type 枚举对账。
4
- */
5
- export interface MessageContentAgentThinking {
6
- type: 'AgentThinking';
7
- standardType?: 'agent/thinking';
8
- streamStatus?: 'start' | 'continue' | 'end';
9
- text: string;
10
- sources?: string[];
11
- }
12
- export interface ReferenceSourceItem {
13
- title: string;
14
- url: string;
15
- }
16
- export interface MessageContentReferenceSources {
17
- type: 'ReferenceSources';
18
- standardType?: 'agent/reference' | string;
19
- items: ReferenceSourceItem[];
20
- }
21
- /** 当前仅支持 Workbench 侧冻结的 {@link AgentWorkbenchSDK};后续可扩展其它 sdk 名 */
22
- export type InputRecommendSdkName = 'AgentWorkbenchSDK';
23
- /**
24
- * 网关 `agent/input-recommend`(及兼容 `agent/suggestions`)可在 content 中携带:
25
- * 点击某一推荐 chip 时调用的 SDK 方法及参数(见 `pickActionDefault` / `pickActions`)。
26
- */
27
- export interface InputRecommendPickAction {
28
- sdk: InputRecommendSdkName;
29
- /**
30
- * `AgentWorkbenchSDK` 上的方法名,如 `sendChatMessage`、`showPreview`、`postAssistantMessage`。
31
- * 运行时会通过 `invokeAgentWorkbenchSdkApi` 派发。
32
- */
33
- api: string;
34
- /**
35
- * 传给该方法的参数列表(按展开调用)。任意嵌套结构中的字符串若包含 `{{suggestionText}}` 会替换为当前 chip 文案。
36
- */
37
- params?: unknown[];
38
- }
39
- export interface MessageContentInputRecommend {
40
- type: 'InputRecommend';
41
- standardType?: 'agent/suggestions' | 'agent/input-recommend' | string;
42
- title?: string;
43
- suggestions: string[];
44
- /**
45
- * 与 `suggestions` 同序;某项为空则回退到 `pickActionDefault`。
46
- * 若整卡均未配置,点击行为等价于 `sendChatMessage(该 chip 文案)`。
47
- */
48
- pickActions?: Array<InputRecommendPickAction | null | undefined>;
49
- /**
50
- * 整卡默认点击动作。网关也可只传 `pickAction`(与该项同义,由归一化层写入)。
51
- */
52
- pickActionDefault?: InputRecommendPickAction;
53
- }
54
- export interface UserAuthOption {
55
- optionId: string;
56
- name: string;
57
- message?: string;
58
- }
59
- export interface MessageContentUserAuth {
60
- type: 'UserAuth';
61
- standardType?: 'agent/request-run' | string;
62
- /** 《智能消息1.0》§5.3.3 content.requestId */
63
- requestId?: string;
64
- description: string;
65
- options: UserAuthOption[];
66
- }
67
- export interface MessageContentErrorReminder {
68
- type: 'ErrorReminder';
69
- standardType?: 'agent/error' | string;
70
- errorLevel: 0 | 1 | 2;
71
- errorText: string;
72
- errorLink?: string;
73
- }
74
- export interface LinkRelatedItem {
75
- title: string;
76
- url: string;
77
- poster?: string;
78
- }
79
- export interface MessageContentLinkCard {
80
- type: 'LinkCard';
81
- standardType?: 'card/url' | string;
82
- poster?: string;
83
- title: string;
84
- subtitle?: string;
85
- url: string;
86
- relatedLinks?: LinkRelatedItem[];
87
- }
88
- export interface MessageContentUnknownEnterprise {
89
- type: 'UnknownEnterprise';
90
- standardType?: 'unknown' | string;
91
- /** Gateway body.type,阶段 C 登记、便于与标准对账 */
92
- wireType?: string;
93
- hint?: string;
94
- }
95
- /** 企业云「文件」类资源消息(附件):对应文档中 category/name/size/media */
96
- export interface MessageContentAttachmentFile {
97
- type: 'AttachmentFile';
98
- standardType?: 'resource/file' | string;
99
- category: string;
100
- name: string;
101
- size: number;
102
- /** 云盘或下载路径 id / URL,演示可写占位 */
103
- media: string;
104
- }
105
- /** 网关 `agent/tool-use`:一次工具调用(名称 / 调用描述或参数 / 执行结果) */
106
- export interface MessageContentToolUse {
107
- type: 'ToolUse';
108
- standardType?: 'agent/tool-use' | string;
109
- /** 与下行 `agent/tool-result.content.toolUseId` 关联;合泡块 id 优先以此为准 */
110
- toolUseId?: string;
111
- toolName: string;
112
- /** 网关下发的调用描述或入参(多为可读字符串) */
113
- toolDescription: string;
114
- /** 工具输出(常为 JSON 字符串);可与 tool-use 分帧,由 applyGatewayEnvelope 合并写入 */
115
- result: string;
116
- /**
117
- * 是否已收到 `agent/tool-result`(含 `result` 为空字符串的完成帧)。
118
- * 仅以 `trim(result).length` 判断「完成」时,空 stdout 会一直显示「调用中」。
119
- */
120
- toolResultApplied?: boolean;
121
- /** 工具调用整体是否成功;缺省/`true` 走原成功视觉,仅 `false` 走 `is-error` 视觉 */
122
- success?: boolean;
123
- /** 失败时的错误描述;优先级高于 result,仅在 `success === false` 时下发 */
124
- errorMessage?: string;
125
- sessionId?: string;
126
- }
127
- /** HITL 单题:`agent/hitl-question.content.questions[]`(见《HITL 前端对接》) */
128
- export type HitlUiType = 'text' | 'select' | 'multi_select' | 'confirm' | 'form' | 'date' | 'number';
129
- export interface HitlQuestionOption {
130
- label: string;
131
- description?: string;
132
- preview?: string;
133
- }
134
- export interface HitlQuestionField {
135
- name: string;
136
- label: string;
137
- type?: 'text' | 'select' | 'number' | 'date';
138
- required?: boolean;
139
- options?: string[];
140
- default_value?: string;
141
- min?: number;
142
- max?: number;
143
- }
144
- export interface HitlQuestionItem {
145
- id: string;
146
- question: string;
147
- header?: string;
148
- ui_type?: HitlUiType;
149
- options?: HitlQuestionOption[];
150
- fields?: HitlQuestionField[];
151
- allow_other?: boolean;
152
- placeholder?: string;
153
- default_value?: string;
154
- min?: number;
155
- max?: number;
156
- }
157
- /**
158
- * HITL 问题卡(下行 {@code body.type === 'agent/hitl-question'})。
159
- * headers 中与上行 `agent/hitl-answer` 对齐的字段可由归一化层从信封 headers 填入。
160
- */
161
- export interface MessageContentHitlQuestion {
162
- type: 'HitlQuestion';
163
- standardType?: 'agent/hitl-question';
164
- requestId: string;
165
- questions: HitlQuestionItem[];
166
- agentId?: string;
167
- agentSessionId?: string;
168
- userId?: string;
169
- }
170
- export type EnterpriseCloudMessageContent = MessageContentAgentThinking | MessageContentToolUse | MessageContentReferenceSources | MessageContentInputRecommend | MessageContentUserAuth | MessageContentErrorReminder | MessageContentLinkCard | MessageContentUnknownEnterprise | MessageContentAttachmentFile | MessageContentHitlQuestion;