@deep-eye/core 0.7.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/dist/components/chat/AiConversation.vue.d.ts +28 -0
- package/dist/components/chat/AiConversation.vue.d.ts.map +1 -0
- 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/builtInToolRenderers.d.ts +2 -0
- package/dist/components/chat/builtInToolRenderers.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/ChartToolRenderer.vue.d.ts +7 -0
- package/dist/components/chat/components/ChartToolRenderer.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatActionbar.vue.d.ts +26 -0
- package/dist/components/chat/components/ChatActionbar.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatMessage.vue.d.ts +64 -0
- package/dist/components/chat/components/ChatMessage.vue.d.ts.map +1 -0
- 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/CodeToolRenderer.vue.d.ts +9 -0
- package/dist/components/chat/components/CodeToolRenderer.vue.d.ts.map +1 -0
- package/dist/components/chat/components/EmptyState.vue.d.ts +11 -0
- package/dist/components/chat/components/EmptyState.vue.d.ts.map +1 -0
- package/dist/components/chat/components/MessageBubble.vue.d.ts +64 -0
- package/dist/components/chat/components/MessageBubble.vue.d.ts.map +1 -0
- package/dist/components/chat/components/MindMapToolRenderer.vue.d.ts +7 -0
- package/dist/components/chat/components/MindMapToolRenderer.vue.d.ts.map +1 -0
- package/dist/components/chat/components/OpenGenUIToolRenderer.vue.d.ts +7 -0
- package/dist/components/chat/components/OpenGenUIToolRenderer.vue.d.ts.map +1 -0
- package/dist/components/chat/components/OpenGenerativeUiChartRenderer.vue.d.ts +9 -0
- package/dist/components/chat/components/OpenGenerativeUiChartRenderer.vue.d.ts.map +1 -0
- package/dist/components/chat/components/OpenGenerativeUiPlanRenderer.vue.d.ts +9 -0
- package/dist/components/chat/components/OpenGenerativeUiPlanRenderer.vue.d.ts.map +1 -0
- package/dist/components/chat/components/OpenGenerativeUiScheduleRenderer.vue.d.ts +9 -0
- package/dist/components/chat/components/OpenGenerativeUiScheduleRenderer.vue.d.ts.map +1 -0
- package/dist/components/chat/components/OpenGenerativeUiThemeRenderer.vue.d.ts +7 -0
- package/dist/components/chat/components/OpenGenerativeUiThemeRenderer.vue.d.ts.map +1 -0
- package/dist/components/chat/components/SearchToolRenderer.vue.d.ts +7 -0
- package/dist/components/chat/components/SearchToolRenderer.vue.d.ts.map +1 -0
- package/dist/components/chat/components/TextPartRenderer.vue.d.ts +19 -0
- package/dist/components/chat/components/TextPartRenderer.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ToolCallPart.vue.d.ts +11 -0
- package/dist/components/chat/components/ToolCallPart.vue.d.ts.map +1 -0
- package/dist/components/chat/components/index.d.ts +17 -0
- package/dist/components/chat/components/index.d.ts.map +1 -0
- package/dist/components/chat/composables/index.d.ts +3 -0
- package/dist/components/chat/composables/index.d.ts.map +1 -0
- package/dist/components/chat/composables/useConversation.d.ts +7 -0
- package/dist/components/chat/composables/useConversation.d.ts.map +1 -0
- package/dist/components/chat/composables/useConversationStream.d.ts +3 -0
- package/dist/components/chat/composables/useConversationStream.d.ts.map +1 -0
- package/dist/components/chat/index.d.ts +9 -0
- package/dist/components/chat/index.d.ts.map +1 -0
- 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 +33 -0
- package/dist/components/chat/mdoc/AskUserForm.vue.d.ts.map +1 -0
- package/dist/components/chat/mdoc/ContentNodes.vue.d.ts +16 -0
- package/dist/components/chat/mdoc/ContentNodes.vue.d.ts.map +1 -0
- package/dist/components/chat/mdoc/MediaImageLightbox.vue.d.ts +20 -0
- package/dist/components/chat/mdoc/MediaImageLightbox.vue.d.ts.map +1 -0
- package/dist/components/chat/mdoc/MediaImageStack.vue.d.ts +12 -0
- package/dist/components/chat/mdoc/MediaImageStack.vue.d.ts.map +1 -0
- 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 +12 -0
- package/dist/components/chat/mdoc/builtInRegistry.d.ts.map +1 -0
- package/dist/components/chat/mdoc/extractAskForms.d.ts +6 -0
- package/dist/components/chat/mdoc/extractAskForms.d.ts.map +1 -0
- package/dist/components/chat/mdoc/index.d.ts +8 -0
- package/dist/components/chat/mdoc/index.d.ts.map +1 -0
- package/dist/components/chat/mdoc/parser.d.ts +41 -0
- package/dist/components/chat/mdoc/parser.d.ts.map +1 -0
- package/dist/components/chat/mdoc/prompt.d.ts +6 -0
- package/dist/components/chat/mdoc/prompt.d.ts.map +1 -0
- package/dist/components/chat/mdoc/registry.d.ts +15 -0
- package/dist/components/chat/mdoc/registry.d.ts.map +1 -0
- package/dist/components/chat/mdoc/sanitize.d.ts +2 -0
- package/dist/components/chat/mdoc/sanitize.d.ts.map +1 -0
- package/dist/components/chat/mdoc/textContent.d.ts +38 -0
- package/dist/components/chat/mdoc/textContent.d.ts.map +1 -0
- package/dist/components/chat/openGenerativeUi.d.ts +25 -0
- package/dist/components/chat/openGenerativeUi.d.ts.map +1 -0
- package/dist/components/chat/presentation.d.ts +27 -0
- package/dist/components/chat/presentation.d.ts.map +1 -0
- package/dist/components/chat/toolRenderers.d.ts +8 -0
- package/dist/components/chat/toolRenderers.d.ts.map +1 -0
- package/dist/components/chat/types.d.ts +230 -0
- package/dist/components/chat/types.d.ts.map +1 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/visualization/D3MindMap.vue.d.ts +83 -0
- package/dist/components/visualization/D3MindMap.vue.d.ts.map +1 -0
- package/dist/components/visualization/index.d.ts +5 -0
- package/dist/components/visualization/index.d.ts.map +1 -0
- package/dist/components/visualization/themes.d.ts +40 -0
- package/dist/components/visualization/themes.d.ts.map +1 -0
- package/dist/components/visualization/types.d.ts +291 -0
- package/dist/components/visualization/types.d.ts.map +1 -0
- package/dist/components/visualization/utils.d.ts +44 -0
- package/dist/components/visualization/utils.d.ts.map +1 -0
- package/dist/composables/index.d.ts +3 -0
- package/dist/composables/index.d.ts.map +1 -0
- package/dist/composables/useMindMapLayout.d.ts +16 -0
- package/dist/composables/useMindMapLayout.d.ts.map +1 -0
- package/dist/composables/useMindMapTheme.d.ts +43 -0
- package/dist/composables/useMindMapTheme.d.ts.map +1 -0
- package/dist/index.cjs +41 -22
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4089 -3834
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ConversationUiAction } from '../types';
|
|
2
|
+
import type { MdocComponentNode } from './parser';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
node: MdocComponentNode;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
action: (payload: ConversationUiAction) => any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
onAction?: ((payload: ConversationUiAction) => any) | undefined;
|
|
10
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
13
|
+
//# sourceMappingURL=ArtifactBlock.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArtifactBlock.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/mdoc/ArtifactBlock.vue"],"names":[],"mappings":"AAyTA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAEpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAIjD,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,iBAAiB,CAAA;CAAE,CAAC;AA2K/C,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ConversationUiAction } from '../types';
|
|
2
|
+
import type { MdocComponentNode } from './parser';
|
|
3
|
+
type AskFormDraft = {
|
|
4
|
+
value: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
skipped?: boolean;
|
|
7
|
+
};
|
|
8
|
+
type __VLS_Props = {
|
|
9
|
+
node: MdocComponentNode;
|
|
10
|
+
questionIndex?: number;
|
|
11
|
+
questionCount?: number;
|
|
12
|
+
groupCanSubmit?: boolean;
|
|
13
|
+
};
|
|
14
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
|
+
action: (payload: ConversationUiAction) => any;
|
|
16
|
+
previous: () => any;
|
|
17
|
+
next: () => any;
|
|
18
|
+
answerChange: (payload: AskFormDraft | null) => any;
|
|
19
|
+
submitGroup: () => any;
|
|
20
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
21
|
+
onAction?: ((payload: ConversationUiAction) => any) | undefined;
|
|
22
|
+
onPrevious?: (() => any) | undefined;
|
|
23
|
+
onNext?: (() => any) | undefined;
|
|
24
|
+
onAnswerChange?: ((payload: AskFormDraft | null) => any) | undefined;
|
|
25
|
+
onSubmitGroup?: (() => any) | undefined;
|
|
26
|
+
}>, {
|
|
27
|
+
questionIndex: number;
|
|
28
|
+
questionCount: number;
|
|
29
|
+
groupCanSubmit: boolean;
|
|
30
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
31
|
+
declare const _default: typeof __VLS_export;
|
|
32
|
+
export default _default;
|
|
33
|
+
//# sourceMappingURL=AskUserForm.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AskUserForm.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/mdoc/AskUserForm.vue"],"names":[],"mappings":"AA8uBA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAEjD,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAID,KAAK,WAAW,GAAG;IACf,IAAI,EAAE,iBAAiB,CAAA;IACvB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB,CAAC;AAslBJ,QAAA,MAAM,YAAY;;;;;;;;;;;;;mBAzlBE,MAAM;mBACN,MAAM;oBACL,OAAO;6EA2lB1B,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ConversationUiAction } from '../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
content: string;
|
|
4
|
+
isStreaming?: boolean;
|
|
5
|
+
highlightStreamTail?: boolean;
|
|
6
|
+
/** compact:用于用户气泡,去掉段落外边距与过大行高 */
|
|
7
|
+
density?: 'default' | 'compact';
|
|
8
|
+
};
|
|
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>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
//# sourceMappingURL=ContentNodes.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,20 @@
|
|
|
1
|
+
type LightboxImage = {
|
|
2
|
+
url: string;
|
|
3
|
+
alt?: string;
|
|
4
|
+
};
|
|
5
|
+
type __VLS_Props = {
|
|
6
|
+
images: LightboxImage[];
|
|
7
|
+
activeIndex: number;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
close: () => any;
|
|
11
|
+
previous: () => any;
|
|
12
|
+
next: () => any;
|
|
13
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
14
|
+
onClose?: (() => any) | undefined;
|
|
15
|
+
onPrevious?: (() => any) | undefined;
|
|
16
|
+
onNext?: (() => any) | undefined;
|
|
17
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const _default: typeof __VLS_export;
|
|
19
|
+
export default _default;
|
|
20
|
+
//# sourceMappingURL=MediaImageLightbox.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MediaImageLightbox.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/mdoc/MediaImageLightbox.vue"],"names":[],"mappings":"AAyNA,KAAK,aAAa,GAAG;IACnB,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAED,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,aAAa,EAAE,CAAA;IACvB,WAAW,EAAE,MAAM,CAAA;CACpB,CAAC;AAiNF,QAAA,MAAM,YAAY;;;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type MediaStackImage = {
|
|
2
|
+
id: string;
|
|
3
|
+
url: string;
|
|
4
|
+
alt?: string;
|
|
5
|
+
};
|
|
6
|
+
type __VLS_Props = {
|
|
7
|
+
images: MediaStackImage[];
|
|
8
|
+
};
|
|
9
|
+
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>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
12
|
+
//# sourceMappingURL=MediaImageStack.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MediaImageStack.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/mdoc/MediaImageStack.vue"],"names":[],"mappings":"AAuVA,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAQD,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,eAAe,EAAE,CAAA;CAC1B,CAAC;AA0VF,QAAA,MAAM,YAAY,kSAEhB,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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const builtInRegistry: import("./registry").Registry;
|
|
2
|
+
/**
|
|
3
|
+
* AskUserForm 的 system prompt 片段。
|
|
4
|
+
* 宿主拼进 LLM system;后续其它交互标签会各自导出对应常量,再按需拼接。
|
|
5
|
+
*/
|
|
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;
|
|
12
|
+
//# sourceMappingURL=builtInRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type MdocComponentNode } from './parser';
|
|
2
|
+
/** Parse message content and return complete ask-form nodes (for bottom dock). */
|
|
3
|
+
export declare function extractAskFormNodes(content: string | undefined, options?: {
|
|
4
|
+
isStreaming?: boolean;
|
|
5
|
+
}): MdocComponentNode[];
|
|
6
|
+
//# sourceMappingURL=extractAskForms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractAskForms.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/mdoc/extractAskForms.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAElE,kFAAkF;AAClF,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,OAAO,GAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAO,GACtC,iBAAiB,EAAE,CAWrB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { createRegistry } from './registry';
|
|
2
|
+
export type { PropTypeName, Registry, TagSchema } from './registry';
|
|
3
|
+
export { StreamingParser } from './parser';
|
|
4
|
+
export type { MdocComponentNode, MdocNode, MdocTextNode, StreamingParserOptions } from './parser';
|
|
5
|
+
export { generatePrompt } from './prompt';
|
|
6
|
+
export type { GeneratePromptOptions } from './prompt';
|
|
7
|
+
export { builtInRegistry, ARTIFACT_BLOCK_SYSTEM_PROMPT, ASK_USER_FORM_SYSTEM_PROMPT, } from './builtInRegistry';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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,EACL,eAAe,EACf,4BAA4B,EAC5B,2BAA2B,GAC5B,MAAM,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type Registry } from './registry';
|
|
2
|
+
export type MdocTextNode = {
|
|
3
|
+
id: string;
|
|
4
|
+
kind: 'text';
|
|
5
|
+
text: string;
|
|
6
|
+
};
|
|
7
|
+
export type MdocComponentNode = {
|
|
8
|
+
id: string;
|
|
9
|
+
kind: 'component';
|
|
10
|
+
tag: string;
|
|
11
|
+
props: Record<string, unknown>;
|
|
12
|
+
children: MdocNode[];
|
|
13
|
+
slotText: string;
|
|
14
|
+
complete: boolean;
|
|
15
|
+
};
|
|
16
|
+
export type MdocNode = MdocTextNode | MdocComponentNode;
|
|
17
|
+
export interface StreamingParserOptions {
|
|
18
|
+
registry: Registry;
|
|
19
|
+
}
|
|
20
|
+
export declare class StreamingParser {
|
|
21
|
+
private readonly registry;
|
|
22
|
+
private buffer;
|
|
23
|
+
private nodes;
|
|
24
|
+
private idSeq;
|
|
25
|
+
private finalized;
|
|
26
|
+
/** Open component frames that are not yet complete (held until close). */
|
|
27
|
+
private stack;
|
|
28
|
+
constructor(options: StreamingParserOptions);
|
|
29
|
+
push(chunk: string): void;
|
|
30
|
+
finalize(): void;
|
|
31
|
+
getNodes(): MdocNode[];
|
|
32
|
+
private nextId;
|
|
33
|
+
private cloneNode;
|
|
34
|
+
private appendText;
|
|
35
|
+
private emitComponent;
|
|
36
|
+
private consume;
|
|
37
|
+
private handleClose;
|
|
38
|
+
private handleUnknown;
|
|
39
|
+
private flushRemainderAsText;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/mdoc/parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,QAAQ,EAEd,MAAM,YAAY,CAAA;AAEnB,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,WAAW,CAAA;IACjB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9B,QAAQ,EAAE,QAAQ,EAAE,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,iBAAiB,CAAA;AAEvD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,QAAQ,CAAA;CACnB;AA2ED,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAU;IACnC,OAAO,CAAC,MAAM,CAAK;IACnB,OAAO,CAAC,KAAK,CAAiB;IAC9B,OAAO,CAAC,KAAK,CAAI;IACjB,OAAO,CAAC,SAAS,CAAQ;IAEzB,0EAA0E;IAC1E,OAAO,CAAC,KAAK,CAMN;gBAEK,OAAO,EAAE,sBAAsB;IAI3C,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAMzB,QAAQ,IAAI,IAAI;IAMhB,QAAQ,IAAI,QAAQ,EAAE;IAItB,OAAO,CAAC,MAAM;IAKd,OAAO,CAAC,SAAS;IASjB,OAAO,CAAC,UAAU;IAelB,OAAO,CAAC,aAAa;IAwBrB,OAAO,CAAC,OAAO;IAmGf,OAAO,CAAC,WAAW;IA0BnB,OAAO,CAAC,aAAa;IAcrB,OAAO,CAAC,oBAAoB;CAgC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/mdoc/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAG1C,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,GAAE,qBAA0B,GAAG,MAAM,CAoB9F"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type PropTypeName = 'string' | 'boolean' | 'number' | 'string?' | 'boolean?' | 'number?';
|
|
2
|
+
export interface TagSchema {
|
|
3
|
+
props: Record<string, PropTypeName>;
|
|
4
|
+
children?: string[];
|
|
5
|
+
}
|
|
6
|
+
export interface Registry {
|
|
7
|
+
readonly tags: Readonly<Record<string, TagSchema>>;
|
|
8
|
+
has(tag: string): boolean;
|
|
9
|
+
get(tag: string): TagSchema | undefined;
|
|
10
|
+
entries(): Array<[string, TagSchema]>;
|
|
11
|
+
}
|
|
12
|
+
export declare function createRegistry(defs: Record<string, TagSchema>): Registry;
|
|
13
|
+
export declare function isOptionalProp(type: PropTypeName): boolean;
|
|
14
|
+
export declare function basePropType(type: PropTypeName): 'string' | 'boolean' | 'number';
|
|
15
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/mdoc/registry.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAA;AAE/F,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IACnC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CACpB;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAA;IAClD,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;IACzB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAA;IACvC,OAAO,IAAI,KAAK,CAAC,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAA;CACtC;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAexE;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAE1D;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,YAAY,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAEhF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/mdoc/sanitize.ts"],"names":[],"mappings":"AAgEA,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
declare const sharedIsReady: import("vue").Ref<boolean, boolean>;
|
|
2
|
+
export declare function ensureMarkdownReady(): Promise<void>;
|
|
3
|
+
export declare function isMarkdownReady(): boolean;
|
|
4
|
+
export { sharedIsReady as markdownReady };
|
|
5
|
+
export type TextSegment = {
|
|
6
|
+
type: 'html';
|
|
7
|
+
id: string;
|
|
8
|
+
html: string;
|
|
9
|
+
} | {
|
|
10
|
+
type: 'image';
|
|
11
|
+
id: string;
|
|
12
|
+
url: string;
|
|
13
|
+
alt?: string;
|
|
14
|
+
} | {
|
|
15
|
+
type: 'image-stack';
|
|
16
|
+
id: string;
|
|
17
|
+
images: Array<{
|
|
18
|
+
id: string;
|
|
19
|
+
url: string;
|
|
20
|
+
alt?: string;
|
|
21
|
+
}>;
|
|
22
|
+
} | {
|
|
23
|
+
type: 'video';
|
|
24
|
+
id: string;
|
|
25
|
+
url: string;
|
|
26
|
+
poster?: string;
|
|
27
|
+
} | {
|
|
28
|
+
type: 'audio';
|
|
29
|
+
id: string;
|
|
30
|
+
url: string;
|
|
31
|
+
title?: string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Turn a markdown text blob into renderable segments (html + media).
|
|
35
|
+
* Code fences stay as plain <pre><code> from md4x (no Shiki).
|
|
36
|
+
*/
|
|
37
|
+
export declare function renderTextToSegments(markdown: string): TextSegment[];
|
|
38
|
+
//# sourceMappingURL=textContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textContent.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/mdoc/textContent.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,aAAa,qCAAa,CAAA;AAGhC,wBAAgB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAYnD;AAID,wBAAgB,eAAe,IAAI,OAAO,CAEzC;AAED,OAAO,EAAE,aAAa,IAAI,aAAa,EAAE,CAAA;AAEzC,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC1C;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GACxD;IACE,IAAI,EAAE,aAAa,CAAA;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzD,GACD;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAC3D;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AA8E9D;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,EAAE,CA0DpE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Matches OpenGenerativeUI's activity type without importing its runtime. */
|
|
2
|
+
export declare const OPEN_GENERATIVE_UI_ACTIVITY_TYPE: "open-generative-ui";
|
|
3
|
+
/** Tool and activity names registered by OpenGenerativeUI's `apps/app` demo. */
|
|
4
|
+
export declare const OPEN_GENERATIVE_UI_OUTPUT_NAMES: {
|
|
5
|
+
readonly toggleTheme: "toggleTheme";
|
|
6
|
+
readonly pieChart: "pieChart";
|
|
7
|
+
readonly barChart: "barChart";
|
|
8
|
+
readonly planVisualization: "plan_visualization";
|
|
9
|
+
readonly scheduleTime: "scheduleTime";
|
|
10
|
+
readonly defaultTool: "default-tool";
|
|
11
|
+
readonly activity: "open-generative-ui";
|
|
12
|
+
};
|
|
13
|
+
export type OpenGenerativeUiOutputName = (typeof OPEN_GENERATIVE_UI_OUTPUT_NAMES)[keyof typeof OPEN_GENERATIVE_UI_OUTPUT_NAMES];
|
|
14
|
+
export type OpenGenerativeUiOutputKind = 'frontend-tool' | 'component' | 'render-tool' | 'human-in-the-loop' | 'default-tool' | 'activity';
|
|
15
|
+
export interface OpenGenerativeUiOutputCatalogEntry {
|
|
16
|
+
name: OpenGenerativeUiOutputName;
|
|
17
|
+
kind: OpenGenerativeUiOutputKind;
|
|
18
|
+
renderer: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Complete output registry from OpenGenerativeUI's `useGenerativeUIExamples`
|
|
22
|
+
* plus its `renderActivityMessages` registration.
|
|
23
|
+
*/
|
|
24
|
+
export declare const OPEN_GENERATIVE_UI_OUTPUT_CATALOG: readonly OpenGenerativeUiOutputCatalogEntry[];
|
|
25
|
+
//# sourceMappingURL=openGenerativeUi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openGenerativeUi.d.ts","sourceRoot":"","sources":["../../../src/components/chat/openGenerativeUi.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,eAAO,MAAM,gCAAgC,EAAG,oBAA6B,CAAA;AAE7E,gFAAgF;AAChF,eAAO,MAAM,+BAA+B;;;;;;;;CAQlC,CAAA;AAEV,MAAM,MAAM,0BAA0B,GACpC,CAAC,OAAO,+BAA+B,CAAC,CAAC,MAAM,OAAO,+BAA+B,CAAC,CAAA;AAExF,MAAM,MAAM,0BAA0B,GAClC,eAAe,GACf,WAAW,GACX,aAAa,GACb,mBAAmB,GACnB,cAAc,GACd,UAAU,CAAA;AAEd,MAAM,WAAW,kCAAkC;IACjD,IAAI,EAAE,0BAA0B,CAAA;IAChC,IAAI,EAAE,0BAA0B,CAAA;IAChC,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED;;;GAGG;AACH,eAAO,MAAM,iCAAiC,EAAE,SAAS,kCAAkC,EA4B1F,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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ToolRenderer } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Registers a renderer for one function name. The returned disposer restores
|
|
4
|
+
* the renderer that was present before this registration.
|
|
5
|
+
*/
|
|
6
|
+
export declare function registerToolRenderer(toolName: string, renderer: ToolRenderer): () => void;
|
|
7
|
+
export declare function resolveToolRenderer(toolName: string): ToolRenderer | undefined;
|
|
8
|
+
//# sourceMappingURL=toolRenderers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolRenderers.d.ts","sourceRoot":"","sources":["../../../src/components/chat/toolRenderers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAI3C;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,GAAG,MAAM,IAAI,CASzF;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAE9E"}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import type { Component, Ref } from 'vue';
|
|
2
|
+
/** The three OpenAI chat roles rendered by AiConversation. */
|
|
3
|
+
export type ConversationRole = 'user' | 'assistant' | 'tool';
|
|
4
|
+
export type AutoScrollMode = 'always' | 'smart' | 'off';
|
|
5
|
+
export type ConversationStreamStatus = 'idle' | 'streaming' | 'completed' | 'aborted' | 'error';
|
|
6
|
+
export type ToolCallStatus = 'pending' | 'running' | 'success' | 'error';
|
|
7
|
+
/**
|
|
8
|
+
* OpenAI-compatible message data accepted by AiConversation.
|
|
9
|
+
*
|
|
10
|
+
* `isStreaming` is an optional rendering hint maintained by useConversation;
|
|
11
|
+
* callers passing static OpenAI messages never need to set it.
|
|
12
|
+
*/
|
|
13
|
+
export interface ConversationMessage {
|
|
14
|
+
id: string;
|
|
15
|
+
role: ConversationRole;
|
|
16
|
+
content?: string;
|
|
17
|
+
/** Visible reasoning text, rendered separately from the final answer. */
|
|
18
|
+
reasoning?: string;
|
|
19
|
+
isStreaming?: boolean;
|
|
20
|
+
tool_calls?: ConversationToolCall[];
|
|
21
|
+
toolStatus?: ToolCallStatus;
|
|
22
|
+
toolResult?: unknown;
|
|
23
|
+
toolError?: string;
|
|
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;
|
|
38
|
+
export interface ChatActionbarCopyPayload {
|
|
39
|
+
message: ConversationMessage;
|
|
40
|
+
text: string;
|
|
41
|
+
}
|
|
42
|
+
export interface ChatMessageProps {
|
|
43
|
+
message: ConversationMessage;
|
|
44
|
+
theme?: ConversationTheme;
|
|
45
|
+
userAvatar?: string;
|
|
46
|
+
assistantAvatar?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface ConversationToolCallDelta {
|
|
49
|
+
/** Index into the assistant message's tool_calls array. */
|
|
50
|
+
index: number;
|
|
51
|
+
id?: string;
|
|
52
|
+
function?: {
|
|
53
|
+
name?: string;
|
|
54
|
+
argumentsDelta?: string;
|
|
55
|
+
};
|
|
56
|
+
/** Required for unambiguous lifecycle updates when several tools are active. */
|
|
57
|
+
toolStatus?: ToolCallStatus;
|
|
58
|
+
toolResult?: unknown;
|
|
59
|
+
toolError?: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* A frontend-friendly form of `choices[0].delta`.
|
|
63
|
+
*
|
|
64
|
+
* `id` is the local ConversationMessage id.
|
|
65
|
+
*/
|
|
66
|
+
export interface ConversationDelta {
|
|
67
|
+
id: string;
|
|
68
|
+
role?: ConversationRole;
|
|
69
|
+
contentDelta?: string;
|
|
70
|
+
/** Incremental visible reasoning text. */
|
|
71
|
+
reasoningDelta?: string;
|
|
72
|
+
done?: boolean;
|
|
73
|
+
}
|
|
74
|
+
/** A function call delta in an OpenAI-compatible chat completion chunk. */
|
|
75
|
+
export interface OpenAiChatCompletionToolCallDelta {
|
|
76
|
+
index: number;
|
|
77
|
+
id?: string;
|
|
78
|
+
type?: 'function';
|
|
79
|
+
function?: {
|
|
80
|
+
name?: string;
|
|
81
|
+
arguments?: string;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
/** The `choices[].delta` payload in an OpenAI-compatible SSE chunk. */
|
|
85
|
+
export interface OpenAiChatCompletionDelta {
|
|
86
|
+
role?: 'assistant';
|
|
87
|
+
content?: string | null;
|
|
88
|
+
/** Used by reasoning-capable OpenAI-compatible providers. */
|
|
89
|
+
reasoning_content?: string | null;
|
|
90
|
+
/** Alternate field used by some OpenAI-compatible providers. */
|
|
91
|
+
reasoning?: string | null;
|
|
92
|
+
tool_calls?: OpenAiChatCompletionToolCallDelta[];
|
|
93
|
+
}
|
|
94
|
+
/** One choice in an OpenAI-compatible `chat.completion.chunk` response. */
|
|
95
|
+
export interface OpenAiChatCompletionChoice {
|
|
96
|
+
index: number;
|
|
97
|
+
delta: OpenAiChatCompletionDelta;
|
|
98
|
+
/** `null`, `"null"`, and `""` mean that streaming continues. */
|
|
99
|
+
finish_reason: string | null;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* OpenAI-compatible SSE payload accepted by `useConversation().appendDelta`.
|
|
103
|
+
* `session_id` is included for compatible backends.
|
|
104
|
+
*/
|
|
105
|
+
export interface OpenAiChatCompletionChunk {
|
|
106
|
+
id: string;
|
|
107
|
+
object: 'chat.completion.chunk';
|
|
108
|
+
created: number;
|
|
109
|
+
model: string;
|
|
110
|
+
session_id?: string;
|
|
111
|
+
choices: OpenAiChatCompletionChoice[];
|
|
112
|
+
}
|
|
113
|
+
/** Input accepted by `useConversation().appendDelta`. */
|
|
114
|
+
export type ConversationStreamInput = ConversationDelta | OpenAiChatCompletionChunk | string;
|
|
115
|
+
export interface ConversationTheme {
|
|
116
|
+
/** CSS custom-property references supplied by the consuming design system. */
|
|
117
|
+
userBubbleBg?: string;
|
|
118
|
+
userBubbleColor?: string;
|
|
119
|
+
userBubbleBorderColor?: string;
|
|
120
|
+
assistantBubbleBg?: string;
|
|
121
|
+
assistantBubbleColor?: string;
|
|
122
|
+
assistantBubbleBorderColor?: string;
|
|
123
|
+
toolCardBg?: string;
|
|
124
|
+
toolCardBorderColor?: string;
|
|
125
|
+
toolPendingColor?: string;
|
|
126
|
+
toolRunningColor?: string;
|
|
127
|
+
toolSuccessColor?: string;
|
|
128
|
+
toolErrorColor?: string;
|
|
129
|
+
borderRadius?: string;
|
|
130
|
+
spacing?: string;
|
|
131
|
+
}
|
|
132
|
+
export interface ConversationAskFormAnswer {
|
|
133
|
+
formId: string;
|
|
134
|
+
question: string;
|
|
135
|
+
value: string;
|
|
136
|
+
label?: string;
|
|
137
|
+
/** True when an optional question was skipped. */
|
|
138
|
+
skipped?: boolean;
|
|
139
|
+
}
|
|
140
|
+
/** Bubbled from interactive content tags such as ask-form or artifact. */
|
|
141
|
+
export interface ConversationUiAction {
|
|
142
|
+
type: 'submit' | 'open-artifact';
|
|
143
|
+
value?: string;
|
|
144
|
+
label?: string;
|
|
145
|
+
source?: string;
|
|
146
|
+
/** Stable form identifier from `ask-form id`; falls back to the parsed node id. */
|
|
147
|
+
formId?: string;
|
|
148
|
+
/** The ask-form question associated with this submission. */
|
|
149
|
+
question?: string;
|
|
150
|
+
/** All answers from a multi-question ask-form submission, in display order. */
|
|
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;
|
|
164
|
+
}
|
|
165
|
+
export interface AiConversationProps {
|
|
166
|
+
/** Accepts a static array or the messages Ref returned by conversation composables. */
|
|
167
|
+
messages: readonly ConversationMessage[] | Ref<readonly ConversationMessage[]>;
|
|
168
|
+
theme?: ConversationTheme;
|
|
169
|
+
autoScroll?: AutoScrollMode;
|
|
170
|
+
/** 用户头像 URL;未传且无 `#user-avatar` 插槽时不显示头像 */
|
|
171
|
+
userAvatar?: string;
|
|
172
|
+
/** 助手头像 URL;未传时使用内置标识 */
|
|
173
|
+
assistantAvatar?: string;
|
|
174
|
+
}
|
|
175
|
+
export interface AiConversationExpose {
|
|
176
|
+
scrollToBottom: () => void;
|
|
177
|
+
}
|
|
178
|
+
export interface UseConversationReturn {
|
|
179
|
+
messages: Ref<ConversationMessage[]>;
|
|
180
|
+
appendDelta: (delta: ConversationStreamInput) => void;
|
|
181
|
+
setMessages: (messages: ConversationMessage[]) => void;
|
|
182
|
+
reset: () => void;
|
|
183
|
+
}
|
|
184
|
+
export interface ConversationStreamConsumeOptions {
|
|
185
|
+
/** Continue the last assistant message and ignore already consumed event IDs. */
|
|
186
|
+
resume?: boolean;
|
|
187
|
+
signal?: AbortSignal;
|
|
188
|
+
}
|
|
189
|
+
export type ConversationStreamSource = Response | Promise<Response> | ReadableStream<Uint8Array>;
|
|
190
|
+
export interface UseConversationStreamReturn {
|
|
191
|
+
messages: Ref<ConversationMessage[]>;
|
|
192
|
+
status: Ref<ConversationStreamStatus>;
|
|
193
|
+
error: Ref<Error | null>;
|
|
194
|
+
/** `event: session` data used only by the runKeep resume request. */
|
|
195
|
+
runSessionId: Ref<string | null>;
|
|
196
|
+
/** Chunk `session_id` used by the next runKeep chat request. */
|
|
197
|
+
chatSessionId: Ref<string | null>;
|
|
198
|
+
/** Last successfully consumed numeric SSE id; `-1` before the first event. */
|
|
199
|
+
lastEventId: Ref<number>;
|
|
200
|
+
consume: (input: ConversationStreamSource, options?: ConversationStreamConsumeOptions) => Promise<void>;
|
|
201
|
+
abort: () => void;
|
|
202
|
+
reset: () => void;
|
|
203
|
+
}
|
|
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;
|
|
229
|
+
}
|
|
230
|
+
//# sourceMappingURL=types.d.ts.map
|