@farris/x-ui 0.0.6 → 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/chat-preview/index.d.ts +17 -0
- package/chat-preview/src/chat-preview.component.d.ts +34 -0
- package/chat-preview/src/chat-preview.props.d.ts +19 -0
- package/chat-preview/src/invoke-agent-workbench-sdk.d.ts +5 -0
- package/chat-preview/src/preview-bridge-host.d.ts +15 -0
- package/chat-preview/src/preview-bridge-protocol.d.ts +22 -0
- package/chat-preview/src/preview-chrome-sdk.d.ts +28 -0
- package/chat-preview/src/preview-iframe-sdk.d.ts +7 -0
- package/components.d.ts +2 -0
- package/dynamic-component/index.d.ts +1 -1
- package/dynamic-component/src/composition/dynamic-component-registry.d.ts +13 -0
- package/dynamic-component/src/composition/types.d.ts +5 -3
- package/enterprise-cloud/src/types.d.ts +15 -0
- package/farris.x-ui.esm.js +9476 -8715
- package/farris.x-ui.umd.cjs +131 -80
- 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;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Plugin } from '../../vue';
|
|
2
|
+
import { default as FXChatPreview } from '../../src/chat-preview.component';
|
|
3
|
+
|
|
4
|
+
export * from '../../src/chat-preview.props';
|
|
5
|
+
export * from '../../src/preview-bridge-protocol';
|
|
6
|
+
export { postAssistantToPreviewIframe, subscribeAssistantInPreviewIframe, type PreviewAssistantBridgeSubscribeOptions, } from '../../src/preview-bridge-host';
|
|
7
|
+
/** 按方法名调用宿主 `window.AgentWorkbenchSDK`(由 `@farris/x-workbench` 注入) */
|
|
8
|
+
export { invokeAgentWorkbenchSdkApi } from '../../src/invoke-agent-workbench-sdk';
|
|
9
|
+
/** @deprecated 请使用 {@link subscribeAssistantInPreviewIframe};宿主侧见 `@farris/x-workbench` */
|
|
10
|
+
export { createPreviewIframeSdk } from '../../src/preview-iframe-sdk';
|
|
11
|
+
/** @deprecated */
|
|
12
|
+
export type { CreatePreviewIframeSdkOptions } from '../../src/preview-iframe-sdk';
|
|
13
|
+
/** 会话分屏预览:由 FXConversation 注册,供 AgentWorkbenchSDK 等聚合调用 */
|
|
14
|
+
export { registerPreviewChromeSdk, previewLayoutBridge, type PreviewChromeSdkHandlers, } from '../../src/preview-chrome-sdk';
|
|
15
|
+
export { FXChatPreview };
|
|
16
|
+
declare const _default: typeof FXChatPreview & Plugin;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { PreviewConfig } from '../../../../../app-preview';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('../../../vue').DefineComponent<import('../../../vue').ExtractPropTypes<{
|
|
4
|
+
previewConfig: {
|
|
5
|
+
type: import('../../../vue').PropType<PreviewConfig>;
|
|
6
|
+
default: () => {};
|
|
7
|
+
};
|
|
8
|
+
onClose: {
|
|
9
|
+
type: import('../../../vue').PropType<() => void>;
|
|
10
|
+
default: () => void;
|
|
11
|
+
};
|
|
12
|
+
onIframeLoad: {
|
|
13
|
+
type: import('../../../vue').PropType<() => void>;
|
|
14
|
+
default: () => void;
|
|
15
|
+
};
|
|
16
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('../../../vue').ComponentOptionsMixin, import('../../../vue').ComponentOptionsMixin, {}, string, import('../../../vue').PublicProps, Readonly<import('../../../vue').ExtractPropTypes<{
|
|
17
|
+
previewConfig: {
|
|
18
|
+
type: import('../../../vue').PropType<PreviewConfig>;
|
|
19
|
+
default: () => {};
|
|
20
|
+
};
|
|
21
|
+
onClose: {
|
|
22
|
+
type: import('../../../vue').PropType<() => void>;
|
|
23
|
+
default: () => void;
|
|
24
|
+
};
|
|
25
|
+
onIframeLoad: {
|
|
26
|
+
type: import('../../../vue').PropType<() => void>;
|
|
27
|
+
default: () => void;
|
|
28
|
+
};
|
|
29
|
+
}>> & Readonly<{}>, {
|
|
30
|
+
previewConfig: PreviewConfig;
|
|
31
|
+
onClose: () => void;
|
|
32
|
+
onIframeLoad: () => void;
|
|
33
|
+
}, {}, {}, {}, string, import('../../../vue').ComponentProvideOptions, true, {}, any>;
|
|
34
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ExtractPropTypes, PropType } from '../../../vue';
|
|
2
|
+
import { PreviewConfig } from '../../../../../app-preview';
|
|
3
|
+
|
|
4
|
+
export declare const chatPreviewProps: {
|
|
5
|
+
previewConfig: {
|
|
6
|
+
type: PropType<PreviewConfig>;
|
|
7
|
+
default: () => {};
|
|
8
|
+
};
|
|
9
|
+
onClose: {
|
|
10
|
+
type: PropType<() => void>;
|
|
11
|
+
default: () => void;
|
|
12
|
+
};
|
|
13
|
+
/** iframe 文档 load 后回调(用于父页在子页监听器就绪后再 postMessage) */
|
|
14
|
+
onIframeLoad: {
|
|
15
|
+
type: PropType<() => void>;
|
|
16
|
+
default: () => void;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export type ChatPreviewProps = ExtractPropTypes<typeof chatPreviewProps>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 按方法名调用宿主挂载的 {@link AgentWorkbenchSDK}(由 `@farris/x-workbench` 在 `window.AgentWorkbenchSDK` 注入)。
|
|
3
|
+
* 供网关 `InputRecommend` 等配置 `api` + `params`;无宿主 SDK 时会告警并返回 `undefined`。
|
|
4
|
+
*/
|
|
5
|
+
export declare function invokeAgentWorkbenchSdkApi(api: string, params?: unknown[]): unknown;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PreviewBridgeAssistantPayload } from '../../../preview-bridge-protocol';
|
|
2
|
+
|
|
3
|
+
export interface PreviewAssistantBridgeSubscribeOptions {
|
|
4
|
+
/** 允许的父页面 origin;不传则只做结构校验,不校验 origin */
|
|
5
|
+
allowedParentOrigins?: string[];
|
|
6
|
+
/**
|
|
7
|
+
* 为 true(默认)时接受 `window.parent` 或 `window.top` 作为发送方。
|
|
8
|
+
*/
|
|
9
|
+
allowTopAsSource?: boolean;
|
|
10
|
+
onAssistantMessage?: (payload: PreviewBridgeAssistantPayload) => void;
|
|
11
|
+
}
|
|
12
|
+
/** 向预览 iframe 的 `contentWindow` 投递助手消息(与 {@link subscribeAssistantInPreviewIframe} 协议一致) */
|
|
13
|
+
export declare function postAssistantToPreviewIframe(targetWindow: Window, targetOrigin: string, payload: PreviewBridgeAssistantPayload): boolean;
|
|
14
|
+
/** 预览页内:订阅父页 / top 推送的助手消息 */
|
|
15
|
+
export declare function subscribeAssistantInPreviewIframe(options: PreviewAssistantBridgeSubscribeOptions): () => void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** 父页 → iframe 的 postMessage 协议(与 iframe 侧 SDK 对齐) */
|
|
2
|
+
export declare const PREVIEW_BRIDGE_SOURCE: "farris-x-preview-bridge";
|
|
3
|
+
export declare const PREVIEW_BRIDGE_VERSION: 1;
|
|
4
|
+
export declare const PREVIEW_BRIDGE_MESSAGE_TYPE_ASSISTANT: "assistant.message";
|
|
5
|
+
export interface PreviewBridgeAssistantPayload {
|
|
6
|
+
messageId: string;
|
|
7
|
+
role: 'user' | 'assistant';
|
|
8
|
+
/** 助手消息的完整 content(与会话内结构一致,由 structured clone / 序列化承载) */
|
|
9
|
+
content: unknown;
|
|
10
|
+
}
|
|
11
|
+
export interface PreviewBridgeMessageEnvelope {
|
|
12
|
+
source: typeof PREVIEW_BRIDGE_SOURCE;
|
|
13
|
+
v: typeof PREVIEW_BRIDGE_VERSION;
|
|
14
|
+
type: typeof PREVIEW_BRIDGE_MESSAGE_TYPE_ASSISTANT;
|
|
15
|
+
payload: PreviewBridgeAssistantPayload;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* postMessage 走 structured clone,Vue reactive/Proxy 可能无法克隆导致静默失败;
|
|
19
|
+
* 先 JSON 往返成纯对象再投递。
|
|
20
|
+
*/
|
|
21
|
+
export declare function clonePreviewPayloadForPostMessage(payload: PreviewBridgeAssistantPayload): PreviewBridgeAssistantPayload;
|
|
22
|
+
export declare function isPreviewBridgeAssistantMessage(data: unknown): data is PreviewBridgeMessageEnvelope;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { PreviewConfig } from '../../../../../app-preview/src/types';
|
|
2
|
+
|
|
3
|
+
/** 由 FXConversation 注入,供 window 侧 imperative 调用(分屏 / 双栏预览) */
|
|
4
|
+
export interface PreviewChromeSdkHandlers {
|
|
5
|
+
showPreview?: (config: PreviewConfig) => void;
|
|
6
|
+
closePreviewPane?: () => void;
|
|
7
|
+
closeRightPreview?: () => void;
|
|
8
|
+
showFullScreenPreview?: (config: PreviewConfig) => void;
|
|
9
|
+
closeFullScreenPreview?: () => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 会话组件挂载时注册;卸载时执行返回函数。多实例时后进先出,避免前一个页面卸载清空后一个的句柄。
|
|
13
|
+
*/
|
|
14
|
+
export declare function registerPreviewChromeSdk(handlers: PreviewChromeSdkHandlers): () => void;
|
|
15
|
+
/** 实现细节:对外由 `@farris/x-workbench` 的 `agent-workbench-sdk.ts` 聚合为 `window.AgentWorkbenchSDK`。 */
|
|
16
|
+
export declare const previewLayoutBridge: {
|
|
17
|
+
/**
|
|
18
|
+
* 打开或更新预览:右侧空 → 单栏右侧;仅右侧已有 → 双栏(旧右→左,新→右);**左右已有 → 只替换右侧 iframe**。
|
|
19
|
+
*/
|
|
20
|
+
readonly showPreview: (config: PreviewConfig) => void;
|
|
21
|
+
/** 与 {@link previewLayoutBridge.showPreview} 相同,强调在双栏时只换右侧。 */
|
|
22
|
+
readonly replaceRightPreview: (config: PreviewConfig) => void;
|
|
23
|
+
readonly closePreviewPane: () => void;
|
|
24
|
+
readonly closeRightPreview: () => void;
|
|
25
|
+
readonly showFullScreenPreview: (config: PreviewConfig) => void;
|
|
26
|
+
readonly closeFullScreenPreview: () => void;
|
|
27
|
+
readonly isPreviewLayoutActive: () => boolean;
|
|
28
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PreviewAssistantBridgeSubscribeOptions } from '../../../preview-bridge-host';
|
|
2
|
+
|
|
3
|
+
export type CreatePreviewIframeSdkOptions = PreviewAssistantBridgeSubscribeOptions;
|
|
4
|
+
/** @deprecated 请使用 {@link subscribeAssistantInPreviewIframe} */
|
|
5
|
+
export declare function createPreviewIframeSdk(options: CreatePreviewIframeSdkOptions): () => void;
|
|
6
|
+
/** @deprecated 请使用 {@link postAssistantToPreviewIframe} */
|
|
7
|
+
export { postAssistantToPreviewIframe as postAssistantViaAgentWorkbenchSDK } from '../../../preview-bridge-host';
|
package/components.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ export { default as FXBubble, FXBubbleAction } from '../bubble';
|
|
|
4
4
|
export * from '../bubble';
|
|
5
5
|
export { default as FXCarousel, FXCarouselItem } from '../carousel';
|
|
6
6
|
export * from '../carousel';
|
|
7
|
+
export { default as FXChatPreview } from '../chat-preview';
|
|
8
|
+
export * from '../chat-preview';
|
|
7
9
|
export { default as FXConfirmDialog } from '../confirm-dialog';
|
|
8
10
|
export * from '../confirm-dialog';
|
|
9
11
|
export { default as FXCoding } from '../coding';
|
|
@@ -2,6 +2,6 @@ import { Plugin } from '../../vue';
|
|
|
2
2
|
import { default as FXDynamicComponent } from '../../src/dynamic-component.component';
|
|
3
3
|
export { default as FXDynamicComponent } from '../../src/dynamic-component.component';
|
|
4
4
|
export * from '../../src/composition/types';
|
|
5
|
-
export { loadDynamicComponent, unloadDynamicComponent, postDynamicComponentAssistantMessage } from '../../src/composition/dynamic-component-registry';
|
|
5
|
+
export { loadDynamicComponent, unloadDynamicComponent, postDynamicComponentAssistantMessage, peekDynamicComponentRegisterBootstrapId, normalizeDynamicComponentRegisterClaim, getDynamicComponentRegistryDebugSnapshot } from '../../src/composition/dynamic-component-registry';
|
|
6
6
|
declare const _default: typeof FXDynamicComponent & Plugin;
|
|
7
7
|
export default _default;
|
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
import { DynamicComponentConfig, DynamicComponentAPI, DynamicComponentAssistantMessagePayload } from '../../../../types';
|
|
2
2
|
|
|
3
|
+
/** 与对话 mock 「口令规范化」同源:隐蔽字符会导致 pending key 肉眼一致却 get 失败 */
|
|
4
|
+
export declare function normalizeDynamicComponentRegisterClaim(raw: unknown): string;
|
|
5
|
+
/** 供调试:`import { peekDynamicComponentRegisterBootstrapId } from '@farris/x-ui'` */
|
|
6
|
+
export declare function peekDynamicComponentRegisterBootstrapId(): string | undefined;
|
|
7
|
+
/** 控制台联调快照 */
|
|
8
|
+
export declare function getDynamicComponentRegistryDebugSnapshot(): {
|
|
9
|
+
pendingKeys: string[];
|
|
10
|
+
bootstrapQueue: string[];
|
|
11
|
+
activeKeys: string[];
|
|
12
|
+
windowBootstrapPeek?: string;
|
|
13
|
+
};
|
|
3
14
|
export declare function loadDynamicComponent(config: DynamicComponentConfig): Promise<DynamicComponentAPI>;
|
|
4
15
|
export declare function unloadDynamicComponent(id: string): void;
|
|
5
16
|
export declare function postDynamicComponentAssistantMessage(id: string, payload: DynamicComponentAssistantMessagePayload): boolean;
|
|
6
17
|
declare global {
|
|
7
18
|
interface Window {
|
|
8
19
|
__fluens_dynamic_component_register: (id: string, api: DynamicComponentAPI) => void;
|
|
20
|
+
__fluens_dynamic_component_bootstrap_instance_id?: string;
|
|
21
|
+
__fluens_get_dynamic_component_registry_debug_snapshot?: typeof getDynamicComponentRegistryDebugSnapshot;
|
|
9
22
|
}
|
|
10
23
|
}
|
|
@@ -12,18 +12,20 @@ export interface DynamicComponentConfig {
|
|
|
12
12
|
isFullscreen?: boolean;
|
|
13
13
|
autoOpen?: boolean;
|
|
14
14
|
fileRe?: string;
|
|
15
|
+
/** 打开后落位目标面板,默认 'preview' */
|
|
16
|
+
target?: 'preview' | 'previewExtra';
|
|
15
17
|
}
|
|
16
18
|
export interface DynamicComponentAssistantMessagePayload {
|
|
17
19
|
messageId: string;
|
|
18
|
-
role: 'assistant';
|
|
19
|
-
/**
|
|
20
|
+
role: 'user' | 'assistant';
|
|
21
|
+
/** 会话内消息的完整 content;含 dynamic-component 围栏、markdown、复合块等(与 UI 气泡一致)。 */
|
|
20
22
|
content: unknown;
|
|
21
23
|
}
|
|
22
24
|
export interface DynamicComponentAPI {
|
|
23
25
|
mount(container: HTMLElement, config: DynamicComponentConfig): void;
|
|
24
26
|
unmount(): void;
|
|
25
27
|
/**
|
|
26
|
-
*
|
|
28
|
+
* 可选:接收同会话内用户/助手消息(与右侧 iframe 预览桥一致),用于侧栏/预览区与流式同步。
|
|
27
29
|
*/
|
|
28
30
|
onAssistantMessage?: (payload: DynamicComponentAssistantMessagePayload) => void;
|
|
29
31
|
}
|
|
@@ -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;
|