@blueking/chat-x 0.0.48-beta.1 → 0.0.49-beta.10
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 +13 -0
- package/dist/ag-ui/types/index.d.ts +1 -0
- package/dist/ag-ui/types/messages.d.ts +4 -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 +12 -0
- package/dist/components/chat-message/assistant-message/message-artifacts/artifact-preview/artifact-preview-host.vue.d.ts +11 -0
- package/dist/components/chat-message/assistant-message/message-artifacts/artifact-preview/preview-strategy.d.ts +8 -0
- 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/html-preview.vue.d.ts +6 -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/renderers/markdown-preview.vue.d.ts +6 -0
- package/dist/components/chat-message/assistant-message/message-artifacts/artifact-preview/renderers/txt-preview.vue.d.ts +6 -0
- package/dist/components/chat-message/assistant-message/message-artifacts/artifact-preview/renderers/url-iframe-preview.vue.d.ts +6 -0
- package/dist/components/chat-message/assistant-message/message-artifacts/artifact-preview/use-artifact-preview-loader.d.ts +22 -0
- package/dist/components/chat-message/assistant-message/message-artifacts/file-artifact-panel.vue.d.ts +13 -0
- package/dist/components/chat-message/assistant-message/message-artifacts/message-artifacts.vue.d.ts +9 -0
- 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/index.d.ts +1 -0
- package/dist/composables/use-artifact-preview.d.ts +49 -0
- 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 +505 -0
- package/dist/icons/file-icons.d.ts +4 -0
- package/dist/icons/file.d.ts +6 -0
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/tools.d.ts +3 -0
- package/dist/index.css +1 -1
- package/dist/index.js +3203 -2368
- package/dist/index.js.map +1 -1
- package/dist/lang/lang.d.ts +9 -1
- package/dist/mcp/generated/docs/activity-message.md +122 -97
- package/dist/mcp/generated/docs/assistant-message.md +146 -75
- package/dist/mcp/generated/docs/chat-container.md +121 -38
- 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 +293 -0
- package/dist/mcp/generated/docs/file-icon.md +111 -0
- package/dist/mcp/generated/docs/info-message.md +29 -12
- package/dist/mcp/generated/docs/interrupt.md +1 -0
- package/dist/mcp/generated/docs/loading-message.md +36 -17
- package/dist/mcp/generated/docs/message-container.md +27 -23
- package/dist/mcp/generated/docs/message-render.md +47 -59
- 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 +17 -20
- package/dist/mcp/generated/docs/tool-message.md +61 -45
- package/dist/mcp/generated/docs/toolcall-render.md +18 -10
- package/dist/mcp/generated/docs/use-artifact-preview.md +234 -0
- 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 +37 -5
- package/dist/mcp/generated/docs/user-message.md +191 -121
- package/dist/mcp/generated/docs/user-question-card.md +6 -3
- package/dist/mcp/generated/index.json +144 -18
- package/dist/mcp/index.js +0 -0
- package/dist/utils/file-type.d.ts +14 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +20 -21
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type AIFileInfo = {
|
|
2
|
+
name: string;
|
|
3
|
+
outputId: string;
|
|
4
|
+
size: number;
|
|
5
|
+
type: string;
|
|
6
|
+
};
|
|
7
|
+
/** 点击文件产物后异步获取的下载 / 预览地址(snake_case) */
|
|
8
|
+
export type ArtifactUrlResult = {
|
|
9
|
+
download_url?: string;
|
|
10
|
+
preview_url?: string;
|
|
11
|
+
};
|
|
12
|
+
/** 异步获取文件产物下载 / 预览链接 */
|
|
13
|
+
export type OnArtifactClick = (file: AIFileInfo) => Promise<ArtifactUrlResult>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { OldShortcut, Shortcut } from '../../types';
|
|
2
2
|
import type { MessageContentType, MessageRole, MessageStatus } from './constants';
|
|
3
3
|
import type { ContentMap, InputContent } from './contents';
|
|
4
|
+
import type { AIFileInfo } from './file';
|
|
4
5
|
import type { InterruptMessage } from './interrupt';
|
|
5
6
|
export interface ActivityMessage extends BaseMessage<MessageRole.Activity, ContentMap[MessageContentType.FlowAgent] | ContentMap[MessageContentType.KnowledgeRag] | ContentMap[MessageContentType.ReferenceDocument]> {
|
|
6
7
|
activityType: MessageContentType.FlowAgent | MessageContentType.KnowledgeRag | MessageContentType.ReferenceDocument | string;
|
|
@@ -14,6 +15,8 @@ declare global {
|
|
|
14
15
|
}
|
|
15
16
|
export interface BaseMessage<T extends MessageType, C = string> {
|
|
16
17
|
content: C;
|
|
18
|
+
/** 消息创建时间,ISO 字符串或毫秒时间戳,由消息层(chat-helper)写入 */
|
|
19
|
+
createdAt?: number | string;
|
|
17
20
|
id: number | string;
|
|
18
21
|
messageId: number | string;
|
|
19
22
|
name?: string;
|
|
@@ -21,6 +24,7 @@ export interface BaseMessage<T extends MessageType, C = string> {
|
|
|
21
24
|
status: MessageStatus;
|
|
22
25
|
uid?: string;
|
|
23
26
|
property?: {
|
|
27
|
+
artifacts?: AIFileInfo[];
|
|
24
28
|
extra?: {
|
|
25
29
|
cite: {
|
|
26
30
|
data: {
|
|
@@ -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;
|
package/dist/components/chat-message/assistant-message/message-artifacts/artifact-file-card.vue.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AIFileInfo } from '../../../../ag-ui/types/file';
|
|
2
|
+
import 'tippy.js/dist/tippy.css';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
active?: boolean;
|
|
5
|
+
file: AIFileInfo;
|
|
6
|
+
onDownload?: (file: AIFileInfo) => void;
|
|
7
|
+
onPreview?: (file: AIFileInfo) => void;
|
|
8
|
+
variant?: 'card' | 'list';
|
|
9
|
+
};
|
|
10
|
+
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>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AIFileInfo } from '../../../../../ag-ui/types/file';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
file?: AIFileInfo;
|
|
4
|
+
};
|
|
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>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type ArtifactPreviewLoadStrategy = 'preview_url' | 'text_from_download';
|
|
2
|
+
export type ArtifactPreviewRendererKind = 'code' | 'html' | 'image' | 'markdown' | 'txt' | 'urlIframe';
|
|
3
|
+
export type ArtifactPreviewStrategy = {
|
|
4
|
+
load: ArtifactPreviewLoadStrategy;
|
|
5
|
+
renderer: ArtifactPreviewRendererKind;
|
|
6
|
+
};
|
|
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,6 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
content: string;
|
|
3
|
+
};
|
|
4
|
+
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>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
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;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
content: string;
|
|
3
|
+
};
|
|
4
|
+
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>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
content: string;
|
|
3
|
+
};
|
|
4
|
+
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>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
url: string;
|
|
3
|
+
};
|
|
4
|
+
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>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { AIFileInfo, ArtifactUrlResult } from '../../../../../ag-ui/types/file';
|
|
2
|
+
import type { ArtifactPreviewRendererKind } from './preview-strategy';
|
|
3
|
+
export type ArtifactPreviewPayload = {
|
|
4
|
+
content: string;
|
|
5
|
+
previewUrl: string;
|
|
6
|
+
renderer: ArtifactPreviewRendererKind;
|
|
7
|
+
status: ArtifactPreviewStatus;
|
|
8
|
+
};
|
|
9
|
+
export type ArtifactPreviewStatus = 'empty' | 'error' | 'idle' | 'loading' | 'ready';
|
|
10
|
+
export declare const useArtifactPreviewLoader: (options: {
|
|
11
|
+
canResolve: () => boolean;
|
|
12
|
+
getFile: () => AIFileInfo | undefined;
|
|
13
|
+
resolveUrls: (file: AIFileInfo) => Promise<ArtifactUrlResult>;
|
|
14
|
+
}) => {
|
|
15
|
+
content: import("vue").ShallowRef<string, string>;
|
|
16
|
+
dispose: () => void;
|
|
17
|
+
downloadUrl: import("vue").ShallowRef<string, string>;
|
|
18
|
+
load: () => Promise<void>;
|
|
19
|
+
previewUrl: import("vue").ShallowRef<string, string>;
|
|
20
|
+
renderer: import("vue").ShallowRef<ArtifactPreviewRendererKind, ArtifactPreviewRendererKind>;
|
|
21
|
+
status: import("vue").ShallowRef<ArtifactPreviewStatus, ArtifactPreviewStatus>;
|
|
22
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SessionArtifact } from '../../../../composables/use-artifact-preview';
|
|
2
|
+
import 'tippy.js/dist/tippy.css';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
activeId: string;
|
|
5
|
+
artifacts: SessionArtifact[];
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
8
|
+
select: (id: string) => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
|
+
onSelect?: ((id: string) => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
package/dist/components/chat-message/assistant-message/message-artifacts/message-artifacts.vue.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AIFileInfo } from '../../../../ag-ui/types/file';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
artifacts: AIFileInfo[];
|
|
4
|
+
onDownload?: (file: AIFileInfo) => void;
|
|
5
|
+
onPreview?: (file: AIFileInfo) => void;
|
|
6
|
+
};
|
|
7
|
+
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>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type ComputedRef, type Ref } from 'vue';
|
|
2
|
+
import type { AIFileInfo, ArtifactUrlResult, OnArtifactClick } from '../ag-ui/types/file';
|
|
3
|
+
/** 文件产物预览 Provider/Consumer 通信 token */
|
|
4
|
+
export declare const ARTIFACT_PREVIEW_TOKEN: unique symbol;
|
|
5
|
+
/** 文件产物侧栏 Tab 的保留唯一标识(固定 Tab,不可关闭) */
|
|
6
|
+
export declare const FILE_ARTIFACT_TAB_NAME = "file-artifact";
|
|
7
|
+
export type OpenArtifactPreviewPayload = {
|
|
8
|
+
/** 被点击的文件 */
|
|
9
|
+
file: AIFileInfo;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* 会话级文件产物:以 outputId 为会话内唯一键(同 outputId 视为同一文件)。
|
|
13
|
+
* 拍平去重后即为 AIFileInfo,此处用别名标明语义。
|
|
14
|
+
*/
|
|
15
|
+
export type SessionArtifact = AIFileInfo;
|
|
16
|
+
type ArtifactPreviewContext = {
|
|
17
|
+
/** 当前命中的文件 outputId */
|
|
18
|
+
activeArtifactId: Ref<string>;
|
|
19
|
+
/** 是否具备异步取链能力(有 onArtifactClick 时下载按钮可见) */
|
|
20
|
+
canResolveArtifactUrl: ComputedRef<boolean>;
|
|
21
|
+
/** 由文件卡片触发:命中文件并弹出/切换到文件产物侧栏 */
|
|
22
|
+
openPreview: (payload: OpenArtifactPreviewPayload) => void;
|
|
23
|
+
/** 解析 download_url / preview_url:每次重新取链;同文件并发去重 */
|
|
24
|
+
resolveArtifactUrls: (file: AIFileInfo) => Promise<ArtifactUrlResult>;
|
|
25
|
+
/** 直接设置命中文件 outputId(侧栏列表内切换用) */
|
|
26
|
+
setActiveArtifactId: (id: string) => void;
|
|
27
|
+
};
|
|
28
|
+
/** 通过临时 <a> 触发浏览器下载 */
|
|
29
|
+
export declare const triggerArtifactDownload: (url: string, fileName: string) => void;
|
|
30
|
+
/**
|
|
31
|
+
* 文件产物预览 Provider(在 ChatContainer 内使用)。
|
|
32
|
+
* 维护「命中文件」状态,并封装 onArtifactClick 取链(每次重新获取 + 并发去重);
|
|
33
|
+
* 打开侧栏 Tab 的副作用由外部 onOpen 注入。
|
|
34
|
+
*/
|
|
35
|
+
export declare const useArtifactPreviewProvider: (options: {
|
|
36
|
+
/** 读取业务侧异步取链回调(用 getter 保持对 props 变更敏感) */
|
|
37
|
+
getOnArtifactClick?: () => OnArtifactClick | undefined;
|
|
38
|
+
/** 命中文件后触发:由容器负责 addCustomTab + 展开侧栏 + 选中 Tab */
|
|
39
|
+
onOpen: (outputId: string) => void;
|
|
40
|
+
}) => {
|
|
41
|
+
activeArtifactId: import("vue").ShallowRef<string, string>;
|
|
42
|
+
canResolveArtifactUrl: ComputedRef<boolean>;
|
|
43
|
+
openPreview: (payload: OpenArtifactPreviewPayload) => void;
|
|
44
|
+
resolveArtifactUrls: (file: AIFileInfo) => Promise<ArtifactUrlResult>;
|
|
45
|
+
setActiveArtifactId: (id: string) => void;
|
|
46
|
+
};
|
|
47
|
+
/** 文件产物预览 Consumer(在深层文件卡片中使用),无 Provider 时返回 undefined 兜底 */
|
|
48
|
+
export declare const useArtifactPreviewConsumer: () => ArtifactPreviewContext | undefined;
|
|
49
|
+
export {};
|
|
@@ -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;
|