@farris/x-ui 0.0.7 → 0.0.8
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/bubble/src/bubble.component.d.ts +6 -0
- package/bubble/src/bubble.props.d.ts +13 -0
- package/bubble/src/components/attachment/bubble-attachment.component.d.ts +3 -0
- package/bubble/src/components/attachment/bubble-attachment.props.d.ts +5 -0
- package/bubble/src/components/bubble-think/bubble-think.props.d.ts +1 -1
- package/bubble/src/components/text-content/composition/block-type.d.ts +7 -5
- package/bubble/src/components/text-content/utils/block-renderer.d.ts +1 -1
- package/bubble/src/composition/types.d.ts +2 -1
- package/bubble/src/composition/use-widget-content.d.ts +1 -2
- package/enterprise-cloud/src/types.d.ts +15 -0
- package/farris.x-ui.esm.js +5355 -5220
- package/farris.x-ui.umd.cjs +75 -75
- package/index.css +1 -1
- package/package.json +1 -1
- package/prompts/src/components/prompt.component.d.ts +1 -1
- package/prompts/src/prompts.component.d.ts +3 -3
- package/tool-use/src/tool-use.component.d.ts +1 -1
- package/bubble/src/components/text-content/renderers/a2ui-renderer.d.ts +0 -3
- package/bubble/src/components/text-content/utils/widget-to-messages.d.ts +0 -44
|
@@ -10,6 +10,8 @@ declare const _default: import('../../../vue').DefineComponent<{
|
|
|
10
10
|
showAvatar: boolean;
|
|
11
11
|
styles: Record<import('../../../..').AppearanceType, import('../../../vue').CSSProperties>;
|
|
12
12
|
attachments: Attachment[];
|
|
13
|
+
attachmentRowClickOpensPreview: boolean;
|
|
14
|
+
attachmentShowDownload: boolean;
|
|
13
15
|
content?: import('../../../..').BubbleContent | undefined;
|
|
14
16
|
onPreview?: ((config: import('../../../../..').PreviewConfig) => void) | undefined;
|
|
15
17
|
onUserAuthConfirm?: ((optionId: string, name: string, message?: string) => void) | undefined;
|
|
@@ -26,6 +28,8 @@ declare const _default: import('../../../vue').DefineComponent<{
|
|
|
26
28
|
showAvatar: boolean;
|
|
27
29
|
styles: Record<import('../../../..').AppearanceType, import('../../../vue').CSSProperties>;
|
|
28
30
|
attachments: Attachment[];
|
|
31
|
+
attachmentRowClickOpensPreview: boolean;
|
|
32
|
+
attachmentShowDownload: boolean;
|
|
29
33
|
content?: import('../../../..').BubbleContent | undefined;
|
|
30
34
|
onPreview?: ((config: import('../../../../..').PreviewConfig) => void) | undefined;
|
|
31
35
|
onUserAuthConfirm?: ((optionId: string, name: string, message?: string) => void) | undefined;
|
|
@@ -47,6 +51,8 @@ declare const _default: import('../../../vue').DefineComponent<{
|
|
|
47
51
|
compositeTailRender: () => import('../../../vue').VNode | null | undefined;
|
|
48
52
|
onDynamicComponentsDetected: (configs: import('../../../../..').DynamicComponentConfig[]) => void;
|
|
49
53
|
onShowDynamicComponent: (config: import('../../../../..').DynamicComponentConfig) => void;
|
|
54
|
+
attachmentRowClickOpensPreview: boolean;
|
|
55
|
+
attachmentShowDownload: boolean;
|
|
50
56
|
}, {}, {
|
|
51
57
|
'fx-user-auth-inline': import('../../../vue').DefineComponent<import('../../../vue').ExtractPropTypes<{
|
|
52
58
|
content: {
|
|
@@ -80,5 +80,18 @@ export declare const bubbleProps: {
|
|
|
80
80
|
type: PropType<(config: DynamicComponentConfig) => void>;
|
|
81
81
|
default: undefined;
|
|
82
82
|
};
|
|
83
|
+
/**
|
|
84
|
+
* 为 false 时附件主行点击不触发 `onPreview`(仍可用下载按钮下载)。
|
|
85
|
+
* 主会话助手带 `bubbleAttachments` 时宜为 false,避免与「仅下载」预期冲突。
|
|
86
|
+
*/
|
|
87
|
+
attachmentRowClickOpensPreview: {
|
|
88
|
+
type: BooleanConstructor;
|
|
89
|
+
default: boolean;
|
|
90
|
+
};
|
|
91
|
+
/** 为 false 时隐藏附件下载按钮(如分栏镜像区仅保留预览)。 */
|
|
92
|
+
attachmentShowDownload: {
|
|
93
|
+
type: BooleanConstructor;
|
|
94
|
+
default: boolean;
|
|
95
|
+
};
|
|
83
96
|
};
|
|
84
97
|
export type BubbleProps = ExtractPropTypes<typeof bubbleProps>;
|
|
@@ -4,12 +4,14 @@ declare const _default: import('../../../../../vue').DefineComponent<{
|
|
|
4
4
|
attachments: Attachment[];
|
|
5
5
|
enableBatchPreview: boolean;
|
|
6
6
|
enableFixedWidth: boolean;
|
|
7
|
+
showDownloadButton: boolean;
|
|
7
8
|
onPreview?: ((attachment: Attachment) => void) | undefined;
|
|
8
9
|
onBatchPreview?: ((attachments: Attachment[]) => void) | undefined;
|
|
9
10
|
}, () => import("vue/jsx-runtime").JSX.Element | null, {}, {}, {}, import('../../../../../vue').ComponentOptionsMixin, import('../../../../../vue').ComponentOptionsMixin, {}, string, import('../../../../../vue').PublicProps, Readonly<{
|
|
10
11
|
attachments: Attachment[];
|
|
11
12
|
enableBatchPreview: boolean;
|
|
12
13
|
enableFixedWidth: boolean;
|
|
14
|
+
showDownloadButton: boolean;
|
|
13
15
|
onPreview?: ((attachment: Attachment) => void) | undefined;
|
|
14
16
|
onBatchPreview?: ((attachments: Attachment[]) => void) | undefined;
|
|
15
17
|
}> & Readonly<{}>, {
|
|
@@ -17,6 +19,7 @@ declare const _default: import('../../../../../vue').DefineComponent<{
|
|
|
17
19
|
onPreview: (attachment: Attachment) => void;
|
|
18
20
|
enableBatchPreview: boolean;
|
|
19
21
|
enableFixedWidth: boolean;
|
|
22
|
+
showDownloadButton: boolean;
|
|
20
23
|
onBatchPreview: (attachments: Attachment[]) => void;
|
|
21
24
|
}, {}, {}, {}, string, import('../../../../../vue').ComponentProvideOptions, true, {}, any>;
|
|
22
25
|
export default _default;
|
|
@@ -14,6 +14,11 @@ export declare const bubbleAttachmentProps: {
|
|
|
14
14
|
type: BooleanConstructor;
|
|
15
15
|
default: boolean;
|
|
16
16
|
};
|
|
17
|
+
/** 为 false 时不展示下载按钮(行点击预览仍由 onPreview 控制) */
|
|
18
|
+
showDownloadButton: {
|
|
19
|
+
type: BooleanConstructor;
|
|
20
|
+
default: boolean;
|
|
21
|
+
};
|
|
17
22
|
/** 预览附件时触发 */
|
|
18
23
|
onPreview: {
|
|
19
24
|
type: PropType<(attachment: Attachment) => void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExtractPropTypes, PropType } from '../../../../../vue';
|
|
2
2
|
import { ThinkContent } from '../../../../../../../composition/types';
|
|
3
|
-
import { OutputMode } from '
|
|
3
|
+
import { OutputMode } from '../../../../../../../../../common';
|
|
4
4
|
|
|
5
5
|
export declare const bubbleThinkProps: {
|
|
6
6
|
/** 思考内容 */
|
|
@@ -2,7 +2,8 @@ import { DynamicComponentConfig } from '../../../../../../../../../../../dynamic
|
|
|
2
2
|
|
|
3
3
|
export declare enum BlockType {
|
|
4
4
|
Text = "text",
|
|
5
|
-
|
|
5
|
+
/** @deprecated FlowUI 渲染逻辑已迁移至 Venus/x-conversation 层,此类型不再使用 */
|
|
6
|
+
FlowUIComplete = "flowui-complete",
|
|
6
7
|
AssistantWidgetComplete = "assistant-widget-complete",
|
|
7
8
|
AssistantWidgetPending = "assistant-widget-pending",
|
|
8
9
|
DynamicComponentComplete = "dynamic-component-complete",
|
|
@@ -12,10 +13,11 @@ export interface TextBlock {
|
|
|
12
13
|
type: BlockType.Text;
|
|
13
14
|
raw: string;
|
|
14
15
|
}
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
/** @deprecated FlowUI 渲染逻辑已迁移至 Venus/x-conversation 层,此类型不再使用 */
|
|
17
|
+
export interface FlowUICompleteBlock {
|
|
18
|
+
type: BlockType.FlowUIComplete;
|
|
17
19
|
raw: string;
|
|
18
|
-
|
|
20
|
+
flowUiData: Record<string, unknown>;
|
|
19
21
|
}
|
|
20
22
|
export interface AssistantWidgetCompleteBlock {
|
|
21
23
|
type: BlockType.AssistantWidgetComplete;
|
|
@@ -38,4 +40,4 @@ export interface DynamicComponentPendingBlock {
|
|
|
38
40
|
raw: string;
|
|
39
41
|
position: 'inline' | 'right' | null;
|
|
40
42
|
}
|
|
41
|
-
export type ParsedBlock = TextBlock |
|
|
43
|
+
export type ParsedBlock = TextBlock | FlowUICompleteBlock | AssistantWidgetCompleteBlock | AssistantWidgetPendingBlock | DynamicComponentCompleteBlock | DynamicComponentPendingBlock;
|
|
@@ -9,5 +9,5 @@ export interface RenderContext {
|
|
|
9
9
|
renderFileEmbeddedContent: (content: EmbeddedContent, ctx: EmbeddedContentRenderContext) => VNode;
|
|
10
10
|
}
|
|
11
11
|
export type BlockRenderer = (block: ParsedBlock, index: number, ctx: RenderContext) => VNode | VNode[] | null;
|
|
12
|
-
export type RendererRegistry = Record<BlockType, BlockRenderer
|
|
12
|
+
export type RendererRegistry = Partial<Record<BlockType, BlockRenderer>>;
|
|
13
13
|
export declare function createRendererRegistry(): RendererRegistry;
|
|
@@ -16,7 +16,8 @@ export type BubbleCompositeInlineBlock = {
|
|
|
16
16
|
/** 文本类型消息内容 */
|
|
17
17
|
export interface BubbleContent {
|
|
18
18
|
type?: 'text';
|
|
19
|
-
|
|
19
|
+
/** 正文文本,或者预渲染好的 VNode */
|
|
20
|
+
text: string | VNode;
|
|
20
21
|
textFormat?: BubbleTextFormatType;
|
|
21
22
|
/** 正文与 footer 之间按序渲染的网关块(如 request-run 按钮、app-preview) */
|
|
22
23
|
compositeInlineBlocks?: BubbleCompositeInlineBlock[];
|
|
@@ -38,11 +38,10 @@
|
|
|
38
38
|
*/
|
|
39
39
|
export declare function isWidgetBlock(text: string): boolean;
|
|
40
40
|
/**
|
|
41
|
-
* 解析 displayText,将包含 assistant-widget
|
|
41
|
+
* 解析 displayText,将包含 assistant-widget 代码块的内容分割成多个部分
|
|
42
42
|
* 支持完整和不完整的 widget 结构
|
|
43
43
|
* 支持 ``` 后紧跟换行符 + 空格 + widget类型 的格式
|
|
44
44
|
*/
|
|
45
45
|
export declare function formatDisplayText(displayText: string): string[];
|
|
46
46
|
export declare function parseAssistantWidget(input: string): any;
|
|
47
|
-
export declare function parseA2UIWidget(input: string): any;
|
|
48
47
|
export declare function getWidgetImplOptions(input: string): any;
|
|
@@ -118,6 +118,10 @@ export interface MessageContentToolUse {
|
|
|
118
118
|
* 仅以 `trim(result).length` 判断「完成」时,空 stdout 会一直显示「调用中」。
|
|
119
119
|
*/
|
|
120
120
|
toolResultApplied?: boolean;
|
|
121
|
+
/** 工具调用整体是否成功;缺省/`true` 走原成功视觉,仅 `false` 走 `is-error` 视觉 */
|
|
122
|
+
success?: boolean;
|
|
123
|
+
/** 失败时的错误描述;优先级高于 result,仅在 `success === false` 时下发 */
|
|
124
|
+
errorMessage?: string;
|
|
121
125
|
sessionId?: string;
|
|
122
126
|
}
|
|
123
127
|
/** HITL 单题:`agent/hitl-question.content.questions[]`(见《HITL 前端对接》) */
|
|
@@ -127,12 +131,23 @@ export interface HitlQuestionOption {
|
|
|
127
131
|
description?: string;
|
|
128
132
|
preview?: string;
|
|
129
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
|
+
}
|
|
130
144
|
export interface HitlQuestionItem {
|
|
131
145
|
id: string;
|
|
132
146
|
question: string;
|
|
133
147
|
header?: string;
|
|
134
148
|
ui_type?: HitlUiType;
|
|
135
149
|
options?: HitlQuestionOption[];
|
|
150
|
+
fields?: HitlQuestionField[];
|
|
136
151
|
allow_other?: boolean;
|
|
137
152
|
placeholder?: string;
|
|
138
153
|
default_value?: string;
|