@deep-eye/core 0.6.0 → 0.9.0
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/CHANGELOG.md +22 -0
- package/README.md +91 -14
- package/dist/components/chat/AiConversation.vue.d.ts.map +1 -1
- package/dist/components/chat/ChatBot.vue.d.ts +48 -0
- package/dist/components/chat/ChatBot.vue.d.ts.map +1 -0
- package/dist/components/chat/components/AssistantTrace.vue.d.ts +27 -0
- package/dist/components/chat/components/AssistantTrace.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatActionbar.vue.d.ts +2 -0
- package/dist/components/chat/components/ChatActionbar.vue.d.ts.map +1 -1
- package/dist/components/chat/components/ChatMessage.vue.d.ts +32 -10
- package/dist/components/chat/components/ChatMessage.vue.d.ts.map +1 -1
- package/dist/components/chat/components/ChatSender.vue.d.ts +58 -0
- package/dist/components/chat/components/ChatSender.vue.d.ts.map +1 -0
- package/dist/components/chat/components/MessageBubble.vue.d.ts +32 -10
- package/dist/components/chat/components/MessageBubble.vue.d.ts.map +1 -1
- package/dist/components/chat/components/OpenGenUIToolRenderer.vue.d.ts.map +1 -1
- package/dist/components/chat/components/TextPartRenderer.vue.d.ts +6 -1
- package/dist/components/chat/components/TextPartRenderer.vue.d.ts.map +1 -1
- package/dist/components/chat/components/index.d.ts +1 -0
- package/dist/components/chat/components/index.d.ts.map +1 -1
- package/dist/components/chat/composables/useConversation.d.ts +1 -2
- package/dist/components/chat/composables/useConversation.d.ts.map +1 -1
- package/dist/components/chat/index.d.ts +4 -14
- package/dist/components/chat/index.d.ts.map +1 -1
- package/dist/components/chat/mdoc/ArtifactBlock.vue.d.ts +13 -0
- package/dist/components/chat/mdoc/ArtifactBlock.vue.d.ts.map +1 -0
- package/dist/components/chat/mdoc/AskUserForm.vue.d.ts +2 -2
- package/dist/components/chat/mdoc/ContentNodes.vue.d.ts +6 -1
- package/dist/components/chat/mdoc/ContentNodes.vue.d.ts.map +1 -1
- package/dist/components/chat/mdoc/artifactDownload.d.ts +31 -0
- package/dist/components/chat/mdoc/artifactDownload.d.ts.map +1 -0
- package/dist/components/chat/mdoc/builtInRegistry.d.ts +5 -0
- package/dist/components/chat/mdoc/builtInRegistry.d.ts.map +1 -1
- package/dist/components/chat/mdoc/index.d.ts +1 -1
- package/dist/components/chat/mdoc/index.d.ts.map +1 -1
- package/dist/components/chat/presentation.d.ts +27 -0
- package/dist/components/chat/presentation.d.ts.map +1 -0
- package/dist/components/chat/types.d.ts +57 -155
- package/dist/components/chat/types.d.ts.map +1 -1
- package/dist/index.cjs +67 -64
- package/dist/index.js +8199 -14957
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -12,15 +12,15 @@ type __VLS_Props = {
|
|
|
12
12
|
groupCanSubmit?: boolean;
|
|
13
13
|
};
|
|
14
14
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
|
+
action: (payload: ConversationUiAction) => any;
|
|
15
16
|
previous: () => any;
|
|
16
17
|
next: () => any;
|
|
17
|
-
action: (payload: ConversationUiAction) => any;
|
|
18
18
|
answerChange: (payload: AskFormDraft | null) => any;
|
|
19
19
|
submitGroup: () => any;
|
|
20
20
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
21
|
+
onAction?: ((payload: ConversationUiAction) => any) | undefined;
|
|
21
22
|
onPrevious?: (() => any) | undefined;
|
|
22
23
|
onNext?: (() => any) | undefined;
|
|
23
|
-
onAction?: ((payload: ConversationUiAction) => any) | undefined;
|
|
24
24
|
onAnswerChange?: ((payload: AskFormDraft | null) => any) | undefined;
|
|
25
25
|
onSubmitGroup?: (() => any) | undefined;
|
|
26
26
|
}>, {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ConversationUiAction } from '../types';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
content: string;
|
|
3
4
|
isStreaming?: boolean;
|
|
@@ -5,7 +6,11 @@ type __VLS_Props = {
|
|
|
5
6
|
/** compact:用于用户气泡,去掉段落外边距与过大行高 */
|
|
6
7
|
density?: 'default' | 'compact';
|
|
7
8
|
};
|
|
8
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
action: (payload: ConversationUiAction) => any;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
onAction?: ((payload: ConversationUiAction) => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
14
|
declare const _default: typeof __VLS_export;
|
|
10
15
|
export default _default;
|
|
11
16
|
//# sourceMappingURL=ContentNodes.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentNodes.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/mdoc/ContentNodes.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContentNodes.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/mdoc/ContentNodes.vue"],"names":[],"mappings":"AAuYA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAcpD,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,kCAAkC;IAClC,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;CAChC,CAAC;AAqUF,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** Text-type artifacts: content is inline (`slotText`), downloaded as a Blob. */
|
|
2
|
+
export declare const TEXT_ARTIFACT_TYPES: readonly ["html", "code", "markdown", "text"];
|
|
3
|
+
export type TextArtifactType = (typeof TEXT_ARTIFACT_TYPES)[number];
|
|
4
|
+
/** File-type artifacts: content lives at a host-provided `src` URL. */
|
|
5
|
+
export declare const FILE_ARTIFACT_TYPES: readonly ["pdf", "word", "excel", "ppt", "zip", "file"];
|
|
6
|
+
export type FileArtifactType = (typeof FILE_ARTIFACT_TYPES)[number];
|
|
7
|
+
export declare function isTextArtifactType(type: string): type is TextArtifactType;
|
|
8
|
+
/** Extension + MIME type for a text-type artifact, given its `type` (and `language` for `code`). */
|
|
9
|
+
export declare function textArtifactFileInfo(type: string, language?: string): {
|
|
10
|
+
extension: string;
|
|
11
|
+
mime: string;
|
|
12
|
+
};
|
|
13
|
+
/** Human-readable subtitle for a card, e.g. `Code · Python` or `PDF · 82KB`. */
|
|
14
|
+
export declare function artifactSubtitle(type: string, options?: {
|
|
15
|
+
language?: string;
|
|
16
|
+
size?: string;
|
|
17
|
+
}): string;
|
|
18
|
+
export interface DownloadArtifactInput {
|
|
19
|
+
title: string;
|
|
20
|
+
type: string;
|
|
21
|
+
language?: string;
|
|
22
|
+
content?: string;
|
|
23
|
+
src?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Downloads an artifact client-side: text-type artifacts are packaged as a Blob,
|
|
27
|
+
* file-type artifacts download directly from their `src` URL. No network requests
|
|
28
|
+
* are made beyond the browser following `src`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function downloadArtifact(input: DownloadArtifactInput): void;
|
|
31
|
+
//# sourceMappingURL=artifactDownload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifactDownload.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/mdoc/artifactDownload.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,eAAO,MAAM,mBAAmB,+CAAgD,CAAA;AAChF,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEnE,uEAAuE;AACvE,eAAO,MAAM,mBAAmB,yDAA0D,CAAA;AAC1F,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEnE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,gBAAgB,CAEzE;AAkCD,oGAAoG;AACpG,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,MAAM,GAChB;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAWrC;AAkBD,gFAAgF;AAChF,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GACjD,MAAM,CAQR;AAgBD,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,IAAI,CAiBnE"}
|
|
@@ -4,4 +4,9 @@ export declare const builtInRegistry: import("./registry").Registry;
|
|
|
4
4
|
* 宿主拼进 LLM system;后续其它交互标签会各自导出对应常量,再按需拼接。
|
|
5
5
|
*/
|
|
6
6
|
export declare const ASK_USER_FORM_SYSTEM_PROMPT: string;
|
|
7
|
+
/**
|
|
8
|
+
* ArtifactBlock 的 system prompt 片段。
|
|
9
|
+
* 宿主拼进 LLM system,与 ASK_USER_FORM_SYSTEM_PROMPT 一样共享同一 registry。
|
|
10
|
+
*/
|
|
11
|
+
export declare const ARTIFACT_BLOCK_SYSTEM_PROMPT: string;
|
|
7
12
|
//# sourceMappingURL=builtInRegistry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtInRegistry.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/mdoc/builtInRegistry.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,+
|
|
1
|
+
{"version":3,"file":"builtInRegistry.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/mdoc/builtInRegistry.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,+BA2B1B,CAAA;AAwBF;;;GAGG;AACH,eAAO,MAAM,2BAA2B,QAEtC,CAAA;AAuBF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,QAEvC,CAAA"}
|
|
@@ -4,5 +4,5 @@ export { StreamingParser } from './parser';
|
|
|
4
4
|
export type { MdocComponentNode, MdocNode, MdocTextNode, StreamingParserOptions } from './parser';
|
|
5
5
|
export { generatePrompt } from './prompt';
|
|
6
6
|
export type { GeneratePromptOptions } from './prompt';
|
|
7
|
-
export { builtInRegistry, ASK_USER_FORM_SYSTEM_PROMPT } from './builtInRegistry';
|
|
7
|
+
export { builtInRegistry, ARTIFACT_BLOCK_SYSTEM_PROMPT, ASK_USER_FORM_SYSTEM_PROMPT, } from './builtInRegistry';
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/mdoc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC1C,YAAY,EAAE,iBAAiB,EAAE,QAAQ,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AACjG,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AACzC,YAAY,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AACrD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/mdoc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC1C,YAAY,EAAE,iBAAiB,EAAE,QAAQ,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AACjG,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AACzC,YAAY,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AACrD,OAAO,EACL,eAAe,EACf,4BAA4B,EAC5B,2BAA2B,GAC5B,MAAM,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type AssistantTraceEntry = {
|
|
2
|
+
id: string;
|
|
3
|
+
type: 'turn';
|
|
4
|
+
turn: string;
|
|
5
|
+
} | {
|
|
6
|
+
id: string;
|
|
7
|
+
type: 'summary';
|
|
8
|
+
content: string;
|
|
9
|
+
complete: boolean;
|
|
10
|
+
} | {
|
|
11
|
+
id: string;
|
|
12
|
+
type: 'tool';
|
|
13
|
+
raw: string;
|
|
14
|
+
name: string;
|
|
15
|
+
argumentsText: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Produces the user-facing portion of mixed agent output without changing the
|
|
19
|
+
* OpenAI-compatible SSE payload or the stored message content.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getAssistantDisplayContent(content: string | undefined): string;
|
|
22
|
+
/**
|
|
23
|
+
* Extracts execution markers from mixed agent content for the optional trace
|
|
24
|
+
* view. It reads the original content and never changes the stored message.
|
|
25
|
+
*/
|
|
26
|
+
export declare function getAssistantTraceEntries(content: string | undefined): AssistantTraceEntry[];
|
|
27
|
+
//# sourceMappingURL=presentation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentation.d.ts","sourceRoot":"","sources":["../../../src/components/chat/presentation.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,mBAAmB,GAC3B;IACE,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb,GACD;IACE,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,SAAS,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,OAAO,CAAA;CAClB,GACD;IACE,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,CAAA;CACtB,CAAA;AAEL;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAQ9E;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,mBAAmB,EAAE,CAiD3F"}
|
|
@@ -1,141 +1,9 @@
|
|
|
1
1
|
import type { Component, Ref } from 'vue';
|
|
2
2
|
/** The three OpenAI chat roles rendered by AiConversation. */
|
|
3
3
|
export type ConversationRole = 'user' | 'assistant' | 'tool';
|
|
4
|
-
export type ToolCallStatus = 'pending' | 'running' | 'success' | 'error';
|
|
5
4
|
export type AutoScrollMode = 'always' | 'smart' | 'off';
|
|
6
5
|
export type ConversationStreamStatus = 'idle' | 'streaming' | 'completed' | 'aborted' | 'error';
|
|
7
|
-
|
|
8
|
-
export type OpenGenerativeUiRenderStatus = 'executing' | 'inProgress' | 'complete';
|
|
9
|
-
/**
|
|
10
|
-
* Complete activity payload emitted by OpenGenerativeUI's middleware.
|
|
11
|
-
*
|
|
12
|
-
* This mirrors the upstream `OpenGenUIContent` protocol without adopting its
|
|
13
|
-
* CopilotKit runtime or sandbox. AiConversation renders it as safe source
|
|
14
|
-
* progress; it never executes the generated HTML, CSS, or JavaScript.
|
|
15
|
-
*/
|
|
16
|
-
export interface OpenGenUIContent {
|
|
17
|
-
initialHeight?: number;
|
|
18
|
-
generating?: boolean;
|
|
19
|
-
css?: string;
|
|
20
|
-
cssComplete?: boolean;
|
|
21
|
-
html?: string[];
|
|
22
|
-
htmlComplete?: boolean;
|
|
23
|
-
jsFunctions?: string;
|
|
24
|
-
jsFunctionsComplete?: boolean;
|
|
25
|
-
jsExpressions?: string[];
|
|
26
|
-
jsExpressionsComplete?: boolean;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* The exportable subset of an OpenGenerativeUI activity payload.
|
|
30
|
-
* This exactly matches the upstream `StandaloneActivityContent` shape.
|
|
31
|
-
*/
|
|
32
|
-
export interface StandaloneActivityContent {
|
|
33
|
-
css?: string;
|
|
34
|
-
html?: string[];
|
|
35
|
-
jsFunctions?: string;
|
|
36
|
-
jsExpressions?: string[];
|
|
37
|
-
}
|
|
38
|
-
/** The shared output shape used by OpenGenerativeUI's bar and pie examples. */
|
|
39
|
-
export interface GenerativeChartOutput {
|
|
40
|
-
title: string;
|
|
41
|
-
description: string;
|
|
42
|
-
data: Array<{
|
|
43
|
-
label: string;
|
|
44
|
-
value: number;
|
|
45
|
-
}>;
|
|
46
|
-
}
|
|
47
|
-
/** Exact data point shape shared by OpenGenerativeUI's `barChart` and `pieChart`. */
|
|
48
|
-
export interface OpenGenerativeUiChartDatum {
|
|
49
|
-
label: string;
|
|
50
|
-
value: number;
|
|
51
|
-
}
|
|
52
|
-
/** Parameters for the upstream `barChart` component output. */
|
|
53
|
-
export interface OpenGenerativeUiBarChartOutput {
|
|
54
|
-
title: string;
|
|
55
|
-
description: string;
|
|
56
|
-
data: OpenGenerativeUiChartDatum[];
|
|
57
|
-
}
|
|
58
|
-
/** Parameters for the upstream `pieChart` component output. */
|
|
59
|
-
export interface OpenGenerativeUiPieChartOutput {
|
|
60
|
-
title: string;
|
|
61
|
-
description: string;
|
|
62
|
-
data: OpenGenerativeUiChartDatum[];
|
|
63
|
-
}
|
|
64
|
-
/** Output shape used by OpenGenerativeUI's plan visualization example. */
|
|
65
|
-
export interface PlanVisualizationOutput {
|
|
66
|
-
approach: string;
|
|
67
|
-
technology: string;
|
|
68
|
-
key_elements: string[];
|
|
69
|
-
}
|
|
70
|
-
/** Render props accepted by OpenGenerativeUI's `PlanCard`. */
|
|
71
|
-
export interface OpenGenerativeUiPlanCardOutput {
|
|
72
|
-
status: OpenGenerativeUiRenderStatus;
|
|
73
|
-
approach?: string;
|
|
74
|
-
technology?: string;
|
|
75
|
-
keyElements?: string[];
|
|
76
|
-
}
|
|
77
|
-
/** Output shape used by OpenGenerativeUI's human-in-the-loop scheduling example. */
|
|
78
|
-
export interface ScheduleTimeOutput {
|
|
79
|
-
reasonForScheduling: string;
|
|
80
|
-
meetingDuration: number;
|
|
81
|
-
}
|
|
82
|
-
/** A meeting option rendered by OpenGenerativeUI's `MeetingTimePicker`. */
|
|
83
|
-
export interface OpenGenerativeUiTimeSlot {
|
|
84
|
-
date: string;
|
|
85
|
-
time: string;
|
|
86
|
-
duration?: string;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Full serializable input accepted by the upstream `MeetingTimePicker`.
|
|
90
|
-
* `respond` is intentionally omitted because AiConversation is render-only.
|
|
91
|
-
*/
|
|
92
|
-
export interface OpenGenerativeUiMeetingTimePickerOutput {
|
|
93
|
-
status: OpenGenerativeUiRenderStatus;
|
|
94
|
-
reasonForScheduling?: string;
|
|
95
|
-
meetingDuration?: number;
|
|
96
|
-
title?: string;
|
|
97
|
-
timeSlots?: OpenGenerativeUiTimeSlot[];
|
|
98
|
-
}
|
|
99
|
-
/** Shape used by OpenGenerativeUI's catch-all `ToolReasoning` renderer. */
|
|
100
|
-
export interface OpenGenerativeUiToolReasoningOutput {
|
|
101
|
-
name: string;
|
|
102
|
-
args?: unknown;
|
|
103
|
-
status: OpenGenerativeUiRenderStatus;
|
|
104
|
-
}
|
|
105
|
-
/** The upstream `toggleTheme` frontend tool takes no parameters. */
|
|
106
|
-
export type OpenGenerativeUiToggleThemeInput = Record<string, never>;
|
|
107
|
-
/** Normalized discriminated form covering every OpenGenerativeUI app output. */
|
|
108
|
-
export type OpenGenerativeUiOutput = {
|
|
109
|
-
name: 'toggleTheme';
|
|
110
|
-
payload: OpenGenerativeUiToggleThemeInput;
|
|
111
|
-
} | {
|
|
112
|
-
name: 'pieChart';
|
|
113
|
-
payload: OpenGenerativeUiPieChartOutput;
|
|
114
|
-
} | {
|
|
115
|
-
name: 'barChart';
|
|
116
|
-
payload: OpenGenerativeUiBarChartOutput;
|
|
117
|
-
} | {
|
|
118
|
-
name: 'plan_visualization';
|
|
119
|
-
payload: PlanVisualizationOutput;
|
|
120
|
-
} | {
|
|
121
|
-
name: 'scheduleTime';
|
|
122
|
-
payload: ScheduleTimeOutput;
|
|
123
|
-
} | {
|
|
124
|
-
name: 'default-tool';
|
|
125
|
-
payload: OpenGenerativeUiToolReasoningOutput;
|
|
126
|
-
} | {
|
|
127
|
-
name: 'open-generative-ui';
|
|
128
|
-
payload: OpenGenUIContent;
|
|
129
|
-
};
|
|
130
|
-
export interface ConversationToolCall {
|
|
131
|
-
id: string;
|
|
132
|
-
type: 'function';
|
|
133
|
-
function: {
|
|
134
|
-
name: string;
|
|
135
|
-
/** A JSON string. Streaming deltas are concatenated without parsing it. */
|
|
136
|
-
arguments: string;
|
|
137
|
-
};
|
|
138
|
-
}
|
|
6
|
+
export type ToolCallStatus = 'pending' | 'running' | 'success' | 'error';
|
|
139
7
|
/**
|
|
140
8
|
* OpenAI-compatible message data accepted by AiConversation.
|
|
141
9
|
*
|
|
@@ -148,20 +16,31 @@ export interface ConversationMessage {
|
|
|
148
16
|
content?: string;
|
|
149
17
|
/** Visible reasoning text, rendered separately from the final answer. */
|
|
150
18
|
reasoning?: string;
|
|
19
|
+
isStreaming?: boolean;
|
|
151
20
|
tool_calls?: ConversationToolCall[];
|
|
152
|
-
tool_call_id?: string;
|
|
153
21
|
toolStatus?: ToolCallStatus;
|
|
154
22
|
toolResult?: unknown;
|
|
155
23
|
toolError?: string;
|
|
156
|
-
isStreaming?: boolean;
|
|
157
24
|
}
|
|
25
|
+
export interface ConversationToolCall {
|
|
26
|
+
id: string;
|
|
27
|
+
type: 'function';
|
|
28
|
+
function: {
|
|
29
|
+
name: string;
|
|
30
|
+
arguments: string;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export interface OpenGenUIContent {
|
|
34
|
+
type: string;
|
|
35
|
+
[key: string]: unknown;
|
|
36
|
+
}
|
|
37
|
+
export type ToolRenderer = Component;
|
|
158
38
|
export interface ChatActionbarCopyPayload {
|
|
159
39
|
message: ConversationMessage;
|
|
160
40
|
text: string;
|
|
161
41
|
}
|
|
162
42
|
export interface ChatMessageProps {
|
|
163
43
|
message: ConversationMessage;
|
|
164
|
-
toolMessagesById?: ReadonlyMap<string, ConversationMessage>;
|
|
165
44
|
theme?: ConversationTheme;
|
|
166
45
|
userAvatar?: string;
|
|
167
46
|
assistantAvatar?: string;
|
|
@@ -182,8 +61,7 @@ export interface ConversationToolCallDelta {
|
|
|
182
61
|
/**
|
|
183
62
|
* A frontend-friendly form of `choices[0].delta`.
|
|
184
63
|
*
|
|
185
|
-
* `id` is the local ConversationMessage id.
|
|
186
|
-
* the delta itself creates or updates a role='tool' result message.
|
|
64
|
+
* `id` is the local ConversationMessage id.
|
|
187
65
|
*/
|
|
188
66
|
export interface ConversationDelta {
|
|
189
67
|
id: string;
|
|
@@ -191,11 +69,6 @@ export interface ConversationDelta {
|
|
|
191
69
|
contentDelta?: string;
|
|
192
70
|
/** Incremental visible reasoning text. */
|
|
193
71
|
reasoningDelta?: string;
|
|
194
|
-
toolCallDelta?: ConversationToolCallDelta;
|
|
195
|
-
toolCallId?: string;
|
|
196
|
-
toolStatus?: ToolCallStatus;
|
|
197
|
-
toolResult?: unknown;
|
|
198
|
-
toolError?: string;
|
|
199
72
|
done?: boolean;
|
|
200
73
|
}
|
|
201
74
|
/** A function call delta in an OpenAI-compatible chat completion chunk. */
|
|
@@ -264,10 +137,10 @@ export interface ConversationAskFormAnswer {
|
|
|
264
137
|
/** True when an optional question was skipped. */
|
|
265
138
|
skipped?: boolean;
|
|
266
139
|
}
|
|
267
|
-
/** Bubbled from interactive content tags such as ask-form. */
|
|
140
|
+
/** Bubbled from interactive content tags such as ask-form or artifact. */
|
|
268
141
|
export interface ConversationUiAction {
|
|
269
|
-
type: 'submit';
|
|
270
|
-
value
|
|
142
|
+
type: 'submit' | 'open-artifact';
|
|
143
|
+
value?: string;
|
|
271
144
|
label?: string;
|
|
272
145
|
source?: string;
|
|
273
146
|
/** Stable form identifier from `ask-form id`; falls back to the parsed node id. */
|
|
@@ -276,6 +149,18 @@ export interface ConversationUiAction {
|
|
|
276
149
|
question?: string;
|
|
277
150
|
/** All answers from a multi-question ask-form submission, in display order. */
|
|
278
151
|
answers?: ConversationAskFormAnswer[];
|
|
152
|
+
/** `open-artifact` payload: stable id from `artifact id`, falls back to the parsed node id. */
|
|
153
|
+
artifactId?: string;
|
|
154
|
+
/** `open-artifact` payload: card title. */
|
|
155
|
+
title?: string;
|
|
156
|
+
/** `open-artifact` payload: html|code|markdown|text (text) or pdf|word|excel|ppt|zip|file (file). */
|
|
157
|
+
artifactType?: string;
|
|
158
|
+
/** `open-artifact` payload: language annotation when artifactType is `code`. */
|
|
159
|
+
language?: string;
|
|
160
|
+
/** `open-artifact` payload: inline content for text-type artifacts (from `slotText`). */
|
|
161
|
+
content?: string;
|
|
162
|
+
/** `open-artifact` payload: file URL for file-type artifacts. */
|
|
163
|
+
src?: string;
|
|
279
164
|
}
|
|
280
165
|
export interface AiConversationProps {
|
|
281
166
|
/** Accepts a static array or the messages Ref returned by conversation composables. */
|
|
@@ -284,7 +169,7 @@ export interface AiConversationProps {
|
|
|
284
169
|
autoScroll?: AutoScrollMode;
|
|
285
170
|
/** 用户头像 URL;未传且无 `#user-avatar` 插槽时不显示头像 */
|
|
286
171
|
userAvatar?: string;
|
|
287
|
-
/** 助手头像 URL
|
|
172
|
+
/** 助手头像 URL;未传时使用内置标识 */
|
|
288
173
|
assistantAvatar?: string;
|
|
289
174
|
}
|
|
290
175
|
export interface AiConversationExpose {
|
|
@@ -316,13 +201,30 @@ export interface UseConversationStreamReturn {
|
|
|
316
201
|
abort: () => void;
|
|
317
202
|
reset: () => void;
|
|
318
203
|
}
|
|
319
|
-
export interface
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
204
|
+
export interface ChatSenderTheme {
|
|
205
|
+
inputBg?: string;
|
|
206
|
+
inputBorder?: string;
|
|
207
|
+
inputFocusBorder?: string;
|
|
208
|
+
buttonPrimaryBg?: string;
|
|
209
|
+
buttonPrimaryColor?: string;
|
|
210
|
+
buttonSecondaryBg?: string;
|
|
211
|
+
buttonSecondaryColor?: string;
|
|
212
|
+
}
|
|
213
|
+
export interface ChatSenderProps {
|
|
214
|
+
placeholder?: string;
|
|
215
|
+
disabled?: boolean;
|
|
216
|
+
showAttachment?: boolean;
|
|
217
|
+
showToolbar?: boolean;
|
|
218
|
+
maxRows?: number;
|
|
219
|
+
modelValue?: string;
|
|
220
|
+
theme?: ChatSenderTheme;
|
|
221
|
+
}
|
|
222
|
+
export interface ChatBotProps {
|
|
223
|
+
messages: readonly ConversationMessage[] | Ref<readonly ConversationMessage[]>;
|
|
224
|
+
showSidebar?: boolean;
|
|
225
|
+
sidebarWidth?: string | number;
|
|
226
|
+
senderConfig?: Partial<ChatSenderProps>;
|
|
227
|
+
conversationConfig?: Partial<AiConversationProps>;
|
|
228
|
+
theme?: ConversationTheme;
|
|
326
229
|
}
|
|
327
|
-
export type ToolRenderer = Component;
|
|
328
230
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/chat/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEzC,8DAA8D;AAC9D,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAA;AAC5D,MAAM,MAAM,cAAc,GAAG,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/chat/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEzC,8DAA8D;AAC9D,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAA;AAC5D,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAA;AACvD,MAAM,MAAM,wBAAwB,GAAG,MAAM,GAAG,WAAW,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,CAAA;AAC/F,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAA;AACxE;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,gBAAgB,CAAA;IACtB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,UAAU,CAAC,EAAE,oBAAoB,EAAE,CAAA;IACnC,UAAU,CAAC,EAAE,cAAc,CAAA;IAC3B,UAAU,CAAC,EAAE,OAAO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