@blueking/chat-x 0.0.49-beta.1 → 0.0.49-beta.11
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/dist/ag-ui/types/constants.d.ts +1 -0
- package/dist/ag-ui/types/file.d.ts +1 -11
- package/dist/ag-ui/types/messages.d.ts +2 -0
- package/dist/components/chat-message/assistant-message/assistant-message.vue.d.ts +12 -1
- package/dist/components/chat-message/assistant-message/message-artifacts/artifact-file-card.vue.d.ts +0 -2
- package/dist/components/chat-message/assistant-message/message-artifacts/artifact-preview/artifact-preview-host.vue.d.ts +6 -3
- package/dist/components/chat-message/assistant-message/message-artifacts/artifact-preview/preview-strategy.d.ts +4 -5
- package/dist/components/chat-message/assistant-message/message-artifacts/artifact-preview/renderers/code-preview.vue.d.ts +8 -0
- package/dist/components/chat-message/assistant-message/message-artifacts/artifact-preview/renderers/image-preview.vue.d.ts +7 -0
- package/dist/components/chat-message/assistant-message/message-artifacts/artifact-preview/use-artifact-preview-loader.d.ts +1 -0
- package/dist/components/chat-message/assistant-message/message-artifacts/file-artifact-panel.vue.d.ts +1 -0
- package/dist/components/chat-message/assistant-message/message-artifacts/message-artifacts.vue.d.ts +0 -1
- package/dist/components/chat-message/interrupt-message/user-question/use-user-question.d.ts +7 -2
- package/dist/components/chat-message/user-message/user-message.vue.d.ts +15 -2
- package/dist/components/file-icon/file-icon.vue.d.ts +7 -0
- package/dist/components/index.d.ts +3 -1
- package/dist/components/message-tools/message-time/format-message-time.d.ts +8 -0
- package/dist/components/message-tools/message-time/message-time.vue.d.ts +8 -0
- package/dist/components/message-tools/message-tools.vue.d.ts +11 -1
- package/dist/composables/use-artifact-preview.d.ts +8 -18
- package/dist/composables/use-container-scroll.d.ts +9 -2
- package/dist/composables/use-custom-tab.d.ts +7 -3
- package/dist/composables/use-global-config.d.ts +3 -0
- package/dist/composables/use-message-group.d.ts +145 -74
- package/dist/icons/file-icons.d.ts +4 -0
- package/dist/icons/file.d.ts +0 -18
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/tools.d.ts +3 -0
- package/dist/index.css +1 -1
- package/dist/index.js +2881 -2525
- package/dist/index.js.map +1 -1
- package/dist/lang/lang.d.ts +4 -1
- package/dist/mcp/generated/docs/assistant-message.md +28 -20
- package/dist/mcp/generated/docs/chat-container.md +36 -31
- package/dist/mcp/generated/docs/chat-input.md +2 -10
- package/dist/mcp/generated/docs/constants.md +3 -1
- package/dist/mcp/generated/docs/content-render.md +2 -10
- package/dist/mcp/generated/docs/execution-summary.md +3 -3
- package/dist/mcp/generated/docs/file-artifact-panel.md +60 -46
- package/dist/mcp/generated/docs/file-icon.md +111 -0
- package/dist/mcp/generated/docs/info-message.md +6 -5
- package/dist/mcp/generated/docs/interrupt.md +1 -0
- package/dist/mcp/generated/docs/message-container.md +27 -23
- package/dist/mcp/generated/docs/message-render.md +4 -27
- package/dist/mcp/generated/docs/message-time.md +180 -0
- package/dist/mcp/generated/docs/message-tools.md +47 -12
- package/dist/mcp/generated/docs/messages.md +9 -0
- package/dist/mcp/generated/docs/reasoning-message.md +2 -9
- package/dist/mcp/generated/docs/toolcall-render.md +18 -10
- package/dist/mcp/generated/docs/use-artifact-preview.md +52 -55
- package/dist/mcp/generated/docs/use-container-scroll.md +6 -2
- package/dist/mcp/generated/docs/use-custom-tab.md +25 -8
- package/dist/mcp/generated/docs/use-global-config.md +15 -5
- package/dist/mcp/generated/docs/use-message-group.md +21 -13
- package/dist/mcp/generated/docs/user-message.md +6 -0
- package/dist/mcp/generated/docs/user-question-card.md +6 -3
- package/dist/mcp/generated/index.json +68 -12
- package/dist/utils/file-type.d.ts +14 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +2 -2
- package/dist/components/chat-message/assistant-message/message-artifacts/file-icon.d.ts +0 -29
|
@@ -1,18 +1,8 @@
|
|
|
1
|
-
export declare enum AIFileType {
|
|
2
|
-
Html = "html",
|
|
3
|
-
Jpg = "jpg",
|
|
4
|
-
Json = "json",
|
|
5
|
-
/** 后台扩展名别名,与 Markdown 等价 */
|
|
6
|
-
Md = "md",
|
|
7
|
-
Markdown = "markdown",
|
|
8
|
-
Pdf = "pdf",
|
|
9
|
-
Txt = "txt"
|
|
10
|
-
}
|
|
11
1
|
export type AIFileInfo = {
|
|
12
2
|
name: string;
|
|
13
3
|
outputId: string;
|
|
14
4
|
size: number;
|
|
15
|
-
type:
|
|
5
|
+
type: string;
|
|
16
6
|
};
|
|
17
7
|
/** 点击文件产物后异步获取的下载 / 预览地址(snake_case) */
|
|
18
8
|
export type ArtifactUrlResult = {
|
|
@@ -15,6 +15,8 @@ declare global {
|
|
|
15
15
|
}
|
|
16
16
|
export interface BaseMessage<T extends MessageType, C = string> {
|
|
17
17
|
content: C;
|
|
18
|
+
/** 消息创建时间,ISO 字符串或毫秒时间戳,由消息层(chat-helper)写入 */
|
|
19
|
+
createdAt?: number | string;
|
|
18
20
|
id: number | string;
|
|
19
21
|
messageId: number | string;
|
|
20
22
|
name?: string;
|
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
import type { AssistantMessage } from '../../../ag-ui/types/messages';
|
|
2
|
+
interface AssistantMessageProps {
|
|
3
|
+
content?: string;
|
|
4
|
+
id?: AssistantMessage['id'];
|
|
5
|
+
messageId?: AssistantMessage['messageId'];
|
|
6
|
+
name?: AssistantMessage['name'];
|
|
7
|
+
property?: AssistantMessage['property'];
|
|
8
|
+
role?: AssistantMessage['role'];
|
|
9
|
+
status?: AssistantMessage['status'];
|
|
10
|
+
toolCalls?: AssistantMessage['toolCalls'];
|
|
11
|
+
uid?: AssistantMessage['uid'];
|
|
12
|
+
}
|
|
2
13
|
declare var __VLS_1: {
|
|
3
14
|
content: string;
|
|
4
15
|
};
|
|
5
16
|
type __VLS_Slots = {} & {
|
|
6
17
|
default?: (props: typeof __VLS_1) => any;
|
|
7
18
|
};
|
|
8
|
-
declare const __VLS_base: import("vue").DefineComponent<
|
|
19
|
+
declare const __VLS_base: import("vue").DefineComponent<AssistantMessageProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<AssistantMessageProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
20
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
10
21
|
declare const _default: typeof __VLS_export;
|
|
11
22
|
export default _default;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { AIFileInfo } from '../../../../../ag-ui/types/file';
|
|
2
|
-
import type { SessionArtifact } from '../../../../../composables/use-artifact-preview';
|
|
3
2
|
type __VLS_Props = {
|
|
4
|
-
file?: AIFileInfo
|
|
3
|
+
file?: AIFileInfo;
|
|
5
4
|
};
|
|
6
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
6
|
+
content: import("vue").ShallowRef<string, string>;
|
|
7
|
+
renderer: import("vue").ShallowRef<import("./preview-strategy.ts").ArtifactPreviewRendererKind, import("./preview-strategy.ts").ArtifactPreviewRendererKind>;
|
|
8
|
+
status: import("vue").ShallowRef<import("./use-artifact-preview-loader").ArtifactPreviewStatus, import("./use-artifact-preview-loader").ArtifactPreviewStatus>;
|
|
9
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
10
|
declare const _default: typeof __VLS_export;
|
|
8
11
|
export default _default;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
export type
|
|
3
|
-
export type ArtifactPreviewRendererKind = 'html' | 'markdown' | 'txt' | 'urlIframe';
|
|
1
|
+
export type ArtifactPreviewLoadStrategy = 'preview_url' | 'text_from_download';
|
|
2
|
+
export type ArtifactPreviewRendererKind = 'code' | 'html' | 'image' | 'markdown' | 'txt' | 'urlIframe';
|
|
4
3
|
export type ArtifactPreviewStrategy = {
|
|
5
4
|
load: ArtifactPreviewLoadStrategy;
|
|
6
5
|
renderer: ArtifactPreviewRendererKind;
|
|
7
6
|
};
|
|
8
|
-
/**
|
|
9
|
-
export declare const getArtifactPreviewStrategy: (type
|
|
7
|
+
/** 按文件类型解析预览加载策略与渲染器;未登记的类型默认 preview_url iframe */
|
|
8
|
+
export declare const getArtifactPreviewStrategy: (type?: string, name?: string) => ArtifactPreviewStrategy;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import 'highlight.js/styles/github-dark.css';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
content: string;
|
|
4
|
+
extension: string;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
name?: string;
|
|
3
|
+
url: string;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -14,6 +14,7 @@ export declare const useArtifactPreviewLoader: (options: {
|
|
|
14
14
|
}) => {
|
|
15
15
|
content: import("vue").ShallowRef<string, string>;
|
|
16
16
|
dispose: () => void;
|
|
17
|
+
downloadUrl: import("vue").ShallowRef<string, string>;
|
|
17
18
|
load: () => Promise<void>;
|
|
18
19
|
previewUrl: import("vue").ShallowRef<string, string>;
|
|
19
20
|
renderer: import("vue").ShallowRef<ArtifactPreviewRendererKind, ArtifactPreviewRendererKind>;
|
|
@@ -9,9 +9,9 @@ export type NormalizedUserQuestionOption = UserQuestionOptionItem & {
|
|
|
9
9
|
letter: string;
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
|
-
* 用户回答问题(human-in-the-loop
|
|
12
|
+
* 用户回答问题(human-in-the-loop)的答案聚合、题目分页与 resume payload 构建。
|
|
13
13
|
*
|
|
14
|
-
* 设计目标:composable 只负责「收集每题答案 + 完成态计算 + payload 组装」,
|
|
14
|
+
* 设计目标:composable 只负责「收集每题答案 + 完成态计算 + 分页定位 + payload 组装」,
|
|
15
15
|
* 对「回答形态」(单选/多选/表单/任意自定义)零感知;
|
|
16
16
|
* 各题如何作答与如何校验,全部下沉到对应的渲染组件(默认为选择题),
|
|
17
17
|
* 渲染组件作答有效时回传已组装的 {@link UserQuestionAnswerItem},无效时回传 undefined。
|
|
@@ -23,6 +23,11 @@ export declare const useUserQuestion: (getInterrupt: () => undefined | UserQuest
|
|
|
23
23
|
answeredCount: import("vue").ComputedRef<number>;
|
|
24
24
|
totalCount: import("vue").ComputedRef<number>;
|
|
25
25
|
completed: import("vue").ComputedRef<boolean>;
|
|
26
|
+
currentIndex: import("vue").ShallowRef<number, number>;
|
|
27
|
+
canGoPrev: import("vue").ComputedRef<boolean>;
|
|
28
|
+
canGoNext: import("vue").ComputedRef<boolean>;
|
|
29
|
+
goPrev: () => void;
|
|
30
|
+
goNext: () => void;
|
|
26
31
|
getAnswer: (questionIndex: number) => undefined | UserQuestionAnswerItem;
|
|
27
32
|
setAnswer: (questionIndex: number, answer: undefined | UserQuestionAnswerItem) => void;
|
|
28
33
|
buildResolvePayload: () => UserQuestionResume;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type InputContent } from '../../../ag-ui/types';
|
|
1
2
|
import { type TagSchema, MessageToolsStatus } from '../../../types';
|
|
2
3
|
import { type MessageToolsProps } from '../../message-tools/message-tools.vue';
|
|
3
4
|
import type { UserMessage } from '../../../ag-ui/types/messages';
|
|
@@ -6,7 +7,19 @@ export type UserMessageActionsProps = {
|
|
|
6
7
|
onInputConfirm?: (content: UserMessage['content'], docSchema: TagSchema) => Promise<void>;
|
|
7
8
|
onShortcutConfirm?: (formModel: Record<string, unknown>) => Promise<void>;
|
|
8
9
|
};
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
interface UserMessageProps extends UserMessageActionsProps {
|
|
11
|
+
content?: InputContent[] | string;
|
|
12
|
+
createdAt?: UserMessage['createdAt'];
|
|
13
|
+
id?: UserMessage['id'];
|
|
14
|
+
messageId?: UserMessage['messageId'];
|
|
15
|
+
name?: UserMessage['name'];
|
|
16
|
+
onAction?: MessageToolsProps['onAction'];
|
|
17
|
+
property?: UserMessage['property'];
|
|
18
|
+
role?: UserMessage['role'];
|
|
19
|
+
status?: UserMessage['status'];
|
|
20
|
+
tippyOptions?: MessageToolsProps['tippyOptions'];
|
|
21
|
+
uid?: UserMessage['uid'];
|
|
22
|
+
}
|
|
23
|
+
declare const __VLS_export: import("vue").DefineComponent<UserMessageProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<UserMessageProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
24
|
declare const _default: typeof __VLS_export;
|
|
12
25
|
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
fileName?: string;
|
|
3
|
+
fileType?: string;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -14,15 +14,17 @@ export type { IModelCapability, IModelOption, IModelProperty, ModelCapabilityThe
|
|
|
14
14
|
import MessageContainer from './chat-message/message-container/message-container.vue';
|
|
15
15
|
import MessageRender from './chat-message/message-render/message-render.vue';
|
|
16
16
|
import ExecutionSummary from './execution-summary/execution-summary.vue';
|
|
17
|
+
import FileIcon from './file-icon/file-icon.vue';
|
|
17
18
|
import HighlightKeyword from './highlight-keyword/highlight-keyword';
|
|
18
19
|
import ImagePreviewGroup from './image-preview/image-preview-group.vue';
|
|
19
20
|
import ImagePreview from './image-preview/image-preview.vue';
|
|
20
21
|
import AiImage from './image-preview/image.vue';
|
|
21
22
|
import MessageLoading from './message-loading/message-loading.vue';
|
|
23
|
+
import MessageTime from './message-tools/message-time/message-time.vue';
|
|
22
24
|
import MessageTools from './message-tools/message-tools.vue';
|
|
23
25
|
import MessageUserFeedback from './message-tools/user-feedback/user-feedback.vue';
|
|
24
26
|
import SelectionFooter from './selection-footer/selection-footer.vue';
|
|
25
27
|
import ToolCallRender from './tool-call/toolcall-render/toolcall-render.vue';
|
|
26
28
|
export * from './chat-message/interrupt-message';
|
|
27
29
|
export * from './markdown-token';
|
|
28
|
-
export { AiImage, AiLoading, AiSelection, ChatContainer, ChatInput, commonErrorContent, ContentRender, ExecutionSummary, HighlightKeyword, ImagePreview, ImagePreviewGroup, MessageContainer, MessageLoading, MessageRender, MessageTools, MessageUserFeedback, ModelSelector, ScrollBtn, SelectionFooter, ShortcutBtn, ShortcutBtns, ShortcutRender, ToolCallRender, };
|
|
30
|
+
export { AiImage, AiLoading, AiSelection, ChatContainer, ChatInput, commonErrorContent, ContentRender, ExecutionSummary, FileIcon, HighlightKeyword, ImagePreview, ImagePreviewGroup, MessageContainer, MessageLoading, MessageRender, MessageTime, MessageTools, MessageUserFeedback, ModelSelector, ScrollBtn, SelectionFooter, ShortcutBtn, ShortcutBtns, ShortcutRender, ToolCallRender, };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 格式化消息时间,四档规则来自设计稿标注
|
|
3
|
+
* 今天 `12:00`;昨天 `昨天 12:00`;今年内更早 `3-12 12:00`;非今年 `2026-3-12 12:00`
|
|
4
|
+
* @param createdAt 消息创建时间,ISO 字符串或毫秒时间戳
|
|
5
|
+
* @param timezone IANA 时区名;不传则按浏览器时区展示
|
|
6
|
+
* @returns 无值或非法时间时返回空字符串,由调用方决定是否渲染
|
|
7
|
+
*/
|
|
8
|
+
export declare const formatMessageTime: (createdAt?: number | string, timezone?: string) => string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type MessageTimeProps = {
|
|
2
|
+
createdAt?: number | string;
|
|
3
|
+
/** IANA 时区名;优先于全局配置,两者都未配置时按浏览器时区展示 */
|
|
4
|
+
timezone?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<MessageTimeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MessageTimeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -9,7 +9,11 @@ export type MessageToolsProps = {
|
|
|
9
9
|
tippyOptions?: AITippyProps;
|
|
10
10
|
updateTools?: IToolBtn[];
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
type __VLS_Slots = {
|
|
13
|
+
append?: () => unknown;
|
|
14
|
+
prepend?: () => unknown;
|
|
15
|
+
};
|
|
16
|
+
declare const __VLS_base: import("vue").DefineComponent<MessageToolsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
13
17
|
feedback: (tool: IToolBtn, reasonList: string[], otherReason: string) => any;
|
|
14
18
|
}, string, import("vue").PublicProps, Readonly<MessageToolsProps> & Readonly<{
|
|
15
19
|
onFeedback?: ((tool: IToolBtn, reasonList: string[], otherReason: string) => any) | undefined;
|
|
@@ -17,5 +21,11 @@ declare const __VLS_export: import("vue").DefineComponent<MessageToolsProps, {},
|
|
|
17
21
|
messageTools: IToolBtn[];
|
|
18
22
|
updateTools: IToolBtn[];
|
|
19
23
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
20
25
|
declare const _default: typeof __VLS_export;
|
|
21
26
|
export default _default;
|
|
27
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
28
|
+
new (): {
|
|
29
|
+
$slots: S;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -7,46 +7,36 @@ export declare const FILE_ARTIFACT_TAB_NAME = "file-artifact";
|
|
|
7
7
|
export type OpenArtifactPreviewPayload = {
|
|
8
8
|
/** 被点击的文件 */
|
|
9
9
|
file: AIFileInfo;
|
|
10
|
-
/** 文件在所属消息 artifacts 中的下标 */
|
|
11
|
-
index: number;
|
|
12
|
-
/** 所属 AssistantMessage 的 uid */
|
|
13
|
-
messageUid: string;
|
|
14
10
|
};
|
|
15
11
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* 统一用 messageUid + 消息内下标 + outputId 组合出全局唯一 id。
|
|
12
|
+
* 会话级文件产物:以 outputId 为会话内唯一键(同 outputId 视为同一文件)。
|
|
13
|
+
* 拍平去重后即为 AIFileInfo,此处用别名标明语义。
|
|
19
14
|
*/
|
|
20
|
-
export type SessionArtifact = AIFileInfo
|
|
21
|
-
artifactId: string;
|
|
22
|
-
messageUid: string;
|
|
23
|
-
};
|
|
15
|
+
export type SessionArtifact = AIFileInfo;
|
|
24
16
|
type ArtifactPreviewContext = {
|
|
25
|
-
/** 当前命中的文件
|
|
17
|
+
/** 当前命中的文件 outputId */
|
|
26
18
|
activeArtifactId: Ref<string>;
|
|
27
19
|
/** 是否具备异步取链能力(有 onArtifactClick 时下载按钮可见) */
|
|
28
20
|
canResolveArtifactUrl: ComputedRef<boolean>;
|
|
29
21
|
/** 由文件卡片触发:命中文件并弹出/切换到文件产物侧栏 */
|
|
30
22
|
openPreview: (payload: OpenArtifactPreviewPayload) => void;
|
|
31
|
-
/**
|
|
23
|
+
/** 解析 download_url / preview_url:每次重新取链;同文件并发去重 */
|
|
32
24
|
resolveArtifactUrls: (file: AIFileInfo) => Promise<ArtifactUrlResult>;
|
|
33
|
-
/** 直接设置命中文件
|
|
25
|
+
/** 直接设置命中文件 outputId(侧栏列表内切换用) */
|
|
34
26
|
setActiveArtifactId: (id: string) => void;
|
|
35
27
|
};
|
|
36
|
-
/** 统一的文件产物唯一 id 生成规则,Provider 与文件卡片两侧必须一致 */
|
|
37
|
-
export declare const buildArtifactId: (messageUid: string, index: number, outputId: string) => string;
|
|
38
28
|
/** 通过临时 <a> 触发浏览器下载 */
|
|
39
29
|
export declare const triggerArtifactDownload: (url: string, fileName: string) => void;
|
|
40
30
|
/**
|
|
41
31
|
* 文件产物预览 Provider(在 ChatContainer 内使用)。
|
|
42
|
-
* 维护「命中文件」状态,并封装 onArtifactClick
|
|
32
|
+
* 维护「命中文件」状态,并封装 onArtifactClick 取链(每次重新获取 + 并发去重);
|
|
43
33
|
* 打开侧栏 Tab 的副作用由外部 onOpen 注入。
|
|
44
34
|
*/
|
|
45
35
|
export declare const useArtifactPreviewProvider: (options: {
|
|
46
36
|
/** 读取业务侧异步取链回调(用 getter 保持对 props 变更敏感) */
|
|
47
37
|
getOnArtifactClick?: () => OnArtifactClick | undefined;
|
|
48
38
|
/** 命中文件后触发:由容器负责 addCustomTab + 展开侧栏 + 选中 Tab */
|
|
49
|
-
onOpen: (
|
|
39
|
+
onOpen: (outputId: string) => void;
|
|
50
40
|
}) => {
|
|
51
41
|
activeArtifactId: import("vue").ShallowRef<string, string>;
|
|
52
42
|
canResolveArtifactUrl: ComputedRef<boolean>;
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
import { type ComputedRef, type MaybeRef } from 'vue';
|
|
2
2
|
export declare const CONTAINER_SCROLL_TOKEN: unique symbol;
|
|
3
3
|
export declare const SHOW_SCROLL_BOTTOM_BTN_DISTANCE = 100;
|
|
4
|
+
/**
|
|
5
|
+
* 距底部超过该距离时视为大跨度定位(首屏渲染、切换会话、异步内容撑高),
|
|
6
|
+
* 此时直接瞬时贴底;平滑滚动只用于流式输出过程中的小幅跟随。
|
|
7
|
+
*/
|
|
8
|
+
export declare const INSTANT_SCROLL_DISTANCE = 600;
|
|
4
9
|
export type ContainerScrollData = {
|
|
5
10
|
autoScrollEnabled: boolean;
|
|
6
11
|
isScrollBottom: boolean;
|
|
12
|
+
jumpToBottom: () => void;
|
|
7
13
|
scrollBottomHeight: number;
|
|
8
|
-
toScrollBottom: () => void;
|
|
14
|
+
toScrollBottom: (behavior?: ScrollBehavior) => void;
|
|
9
15
|
toScrollTop: () => void;
|
|
10
16
|
};
|
|
11
17
|
export declare const useContainerScrollProvider: (containerRef: MaybeRef<HTMLElement | null>, bottomRef: MaybeRef<HTMLElement | null>) => {
|
|
12
18
|
autoScrollEnabled: import("vue").ShallowRef<boolean, boolean>;
|
|
13
19
|
isScrollBottom: import("vue").ShallowRef<boolean, boolean>;
|
|
14
20
|
scrollBottomHeight: import("vue").ShallowRef<number, number>;
|
|
15
|
-
|
|
21
|
+
jumpToBottom: () => void;
|
|
22
|
+
toScrollBottom: (behavior?: ScrollBehavior) => void;
|
|
16
23
|
toScrollTop: () => void;
|
|
17
24
|
debouncedShowScrollBottomBtn: import("vue").Ref<boolean, boolean>;
|
|
18
25
|
};
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { type ComputedRef, type ShallowRef } from 'vue';
|
|
1
|
+
import { type ComputedRef, type Ref, type ShallowRef } from 'vue';
|
|
2
2
|
import type { CustomTab } from '../types';
|
|
3
3
|
export declare const CUSTOM_TAB_TOKEN: unique symbol;
|
|
4
4
|
export declare const EXECUTION_TAB_NAME = "execution";
|
|
5
5
|
/** 自定义 Tab 默认排序权重;执行情况固定为 0,业务自定义 Tab 缺省回退到此值 */
|
|
6
6
|
export declare const DEFAULT_TAB_ORDER = 100;
|
|
7
7
|
export declare function useCustomTabProvider<T extends Record<string, unknown>>(options: {
|
|
8
|
+
/** 侧栏折叠态;由容器传入受控 ref(如 ChatContainer 的 v-model:asideCollapsed),缺省内部自持 */
|
|
9
|
+
collapsed?: Ref<boolean>;
|
|
8
10
|
/** 执行情况 Tab 是否展示,缺省 true;传 getter 以保持响应式 */
|
|
9
11
|
executionTabVisible?: () => boolean | undefined;
|
|
10
12
|
onTabChange?: (tab: CustomTab<T>) => void;
|
|
11
13
|
}): {
|
|
12
14
|
tabs: ShallowRef<CustomTab<T>[], CustomTab<T>[]>;
|
|
13
15
|
displayTabs: ComputedRef<CustomTab<T>[]>;
|
|
14
|
-
selectedTab:
|
|
16
|
+
selectedTab: Ref<{
|
|
15
17
|
closable?: boolean | undefined;
|
|
16
18
|
data?: import("vue").UnwrapRef<T & {
|
|
17
19
|
messageUid?: string;
|
|
@@ -32,8 +34,9 @@ export declare function useCustomTabProvider<T extends Record<string, unknown>>(
|
|
|
32
34
|
order?: number | undefined;
|
|
33
35
|
visible?: boolean | undefined;
|
|
34
36
|
}>;
|
|
35
|
-
isCollapse:
|
|
37
|
+
isCollapse: Ref<boolean, boolean>;
|
|
36
38
|
addCustomTab: (tab: CustomTab<T>) => void;
|
|
39
|
+
ensureCustomTab: (tab: CustomTab<T>) => void;
|
|
37
40
|
removeCustomTab: (tabName: CustomTab<T>["name"]) => void;
|
|
38
41
|
selectCustomTab: (tab: CustomTab<T>) => void;
|
|
39
42
|
resetCustomTab: () => void;
|
|
@@ -41,6 +44,7 @@ export declare function useCustomTabProvider<T extends Record<string, unknown>>(
|
|
|
41
44
|
export declare const useCustomTabConsumer: <T extends Record<string, unknown>>() => {
|
|
42
45
|
addCustomTab: (tab: CustomTab<T>) => void;
|
|
43
46
|
displayTabs: ComputedRef<CustomTab<T>[]>;
|
|
47
|
+
ensureCustomTab: (tab: CustomTab<T>) => void;
|
|
44
48
|
removeCustomTab: (tabName: CustomTab<T>["name"]) => void;
|
|
45
49
|
selectCustomTab: (tab: CustomTab<T>) => void;
|
|
46
50
|
selectedTab: ShallowRef<CustomTab<T> | null>;
|
|
@@ -4,9 +4,12 @@ export type AiSizeMode = 'normal' | 'small';
|
|
|
4
4
|
export type GlobalConfig = {
|
|
5
5
|
size?: ComputedRef<AiSizeMode>;
|
|
6
6
|
supportUpload: ComputedRef<boolean>;
|
|
7
|
+
/** IANA 时区名,用于消息时间展示;未配置时按浏览器时区展示 */
|
|
8
|
+
timezone?: ComputedRef<string | undefined>;
|
|
7
9
|
};
|
|
8
10
|
export declare const useGlobalConfig: (options: GlobalConfig) => {
|
|
9
11
|
size: ComputedRef<AiSizeMode> | undefined;
|
|
10
12
|
supportUpload: ComputedRef<boolean>;
|
|
13
|
+
timezone: ComputedRef<string | undefined> | undefined;
|
|
11
14
|
};
|
|
12
15
|
export declare const injectGlobalConfig: () => GlobalConfig | undefined;
|