@blueking/chat-x 0.0.49-beta.7 → 0.0.49-beta.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.
- 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/message-artifacts/artifact-preview/artifact-preview-host.vue.d.ts +5 -1
- 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/user-message/user-message.vue.d.ts +1 -0
- 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-global-config.d.ts +3 -0
- package/dist/composables/use-message-group.d.ts +144 -72
- 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/index.css +1 -1
- package/dist/index.js +2239 -1982
- package/dist/index.js.map +1 -1
- package/dist/lang/lang.d.ts +2 -1
- package/dist/mcp/generated/docs/assistant-message.md +12 -8
- package/dist/mcp/generated/docs/chat-container.md +3 -1
- package/dist/mcp/generated/docs/file-artifact-panel.md +27 -11
- package/dist/mcp/generated/docs/file-icon.md +111 -0
- package/dist/mcp/generated/docs/message-container.md +2 -0
- 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 +4 -0
- package/dist/mcp/generated/docs/use-global-config.md +15 -5
- package/dist/mcp/generated/docs/user-message.md +6 -0
- package/dist/mcp/generated/index.json +61 -5
- 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 = "markdown",
|
|
6
|
-
/** 后台扩展名别名,与 Markdown 等价 */
|
|
7
|
-
Md = "md",
|
|
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;
|
|
@@ -2,6 +2,10 @@ import type { AIFileInfo } from '../../../../../ag-ui/types/file';
|
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
file?: AIFileInfo;
|
|
4
4
|
};
|
|
5
|
-
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>;
|
|
6
10
|
declare const _default: typeof __VLS_export;
|
|
7
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,6 +9,7 @@ export type UserMessageActionsProps = {
|
|
|
9
9
|
};
|
|
10
10
|
interface UserMessageProps extends UserMessageActionsProps {
|
|
11
11
|
content?: InputContent[] | string;
|
|
12
|
+
createdAt?: UserMessage['createdAt'];
|
|
12
13
|
id?: UserMessage['id'];
|
|
13
14
|
messageId?: UserMessage['messageId'];
|
|
14
15
|
name?: UserMessage['name'];
|
|
@@ -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
|
+
};
|
|
@@ -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;
|