@huyooo/ai-chat-frontend-vue 0.1.4 → 0.1.7
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/README.md +367 -0
- package/dist/adapter.d.ts +7 -7
- package/dist/adapter.d.ts.map +1 -1
- package/dist/components/ChatPanel.vue.d.ts +120 -9
- package/dist/components/ChatPanel.vue.d.ts.map +1 -1
- package/dist/components/common/ConfirmDialog.vue.d.ts +30 -0
- package/dist/components/common/ConfirmDialog.vue.d.ts.map +1 -0
- package/dist/components/common/CopyButton.vue.d.ts +18 -0
- package/dist/components/common/CopyButton.vue.d.ts.map +1 -0
- package/dist/components/common/IndexingSettings.vue.d.ts +3 -0
- package/dist/components/common/IndexingSettings.vue.d.ts.map +1 -0
- package/dist/components/common/SettingsPanel.vue.d.ts +16 -0
- package/dist/components/common/SettingsPanel.vue.d.ts.map +1 -0
- package/dist/components/common/Toast.vue.d.ts +18 -0
- package/dist/components/common/Toast.vue.d.ts.map +1 -0
- package/dist/components/common/ToggleSwitch.vue.d.ts +10 -0
- package/dist/components/common/ToggleSwitch.vue.d.ts.map +1 -0
- package/dist/components/{chat/ui → header}/ChatHeader.vue.d.ts +5 -3
- package/dist/components/header/ChatHeader.vue.d.ts.map +1 -0
- package/dist/components/input/AtFilePicker.vue.d.ts +21 -0
- package/dist/components/input/AtFilePicker.vue.d.ts.map +1 -0
- package/dist/components/{ChatInput.vue.d.ts → input/ChatInput.vue.d.ts} +16 -14
- package/dist/components/input/ChatInput.vue.d.ts.map +1 -0
- package/dist/components/input/DropdownSelector.vue.d.ts +42 -0
- package/dist/components/input/DropdownSelector.vue.d.ts.map +1 -0
- package/dist/components/input/ImagePreviewModal.vue.d.ts +17 -0
- package/dist/components/input/ImagePreviewModal.vue.d.ts.map +1 -0
- package/dist/components/input/at-views/AtBranchView.vue.d.ts +18 -0
- package/dist/components/input/at-views/AtBranchView.vue.d.ts.map +1 -0
- package/dist/components/input/at-views/AtBrowserView.vue.d.ts +18 -0
- package/dist/components/input/at-views/AtBrowserView.vue.d.ts.map +1 -0
- package/dist/components/input/at-views/AtChatsView.vue.d.ts +18 -0
- package/dist/components/input/at-views/AtChatsView.vue.d.ts.map +1 -0
- package/dist/components/input/at-views/AtDocsView.vue.d.ts +18 -0
- package/dist/components/input/at-views/AtDocsView.vue.d.ts.map +1 -0
- package/dist/components/input/at-views/AtFilesView.vue.d.ts +23 -0
- package/dist/components/input/at-views/AtFilesView.vue.d.ts.map +1 -0
- package/dist/components/input/at-views/AtTerminalsView.vue.d.ts +18 -0
- package/dist/components/input/at-views/AtTerminalsView.vue.d.ts.map +1 -0
- package/dist/components/message/MessageBubble.vue.d.ts +45 -0
- package/dist/components/message/MessageBubble.vue.d.ts.map +1 -0
- package/dist/components/message/PartsRenderer.vue.d.ts +15 -0
- package/dist/components/message/PartsRenderer.vue.d.ts.map +1 -0
- package/dist/components/message/WelcomeMessage.vue.d.ts +14 -0
- package/dist/components/message/WelcomeMessage.vue.d.ts.map +1 -0
- package/dist/components/message/blocks/CodeBlock.vue.d.ts +11 -0
- package/dist/components/message/blocks/CodeBlock.vue.d.ts.map +1 -0
- package/dist/components/{chat/SearchResultBlock.vue.d.ts → message/blocks/TextBlock.vue.d.ts} +3 -4
- package/dist/components/message/blocks/TextBlock.vue.d.ts.map +1 -0
- package/dist/components/message/blocks/index.d.ts +6 -0
- package/dist/components/message/blocks/index.d.ts.map +1 -0
- package/dist/components/message/parts/CollapsibleCard.vue.d.ts +45 -0
- package/dist/components/message/parts/CollapsibleCard.vue.d.ts.map +1 -0
- package/dist/components/{chat/ToolCallBlock.vue.d.ts → message/parts/ErrorPart.vue.d.ts} +4 -5
- package/dist/components/message/parts/ErrorPart.vue.d.ts.map +1 -0
- package/dist/components/{chat/ThinkingBlock.vue.d.ts → message/parts/ImagePart.vue.d.ts} +3 -3
- package/dist/components/message/parts/ImagePart.vue.d.ts.map +1 -0
- package/dist/components/message/parts/SearchPart.vue.d.ts +12 -0
- package/dist/components/message/parts/SearchPart.vue.d.ts.map +1 -0
- package/dist/components/{chat/messages/ExecutionSteps.vue.d.ts → message/parts/TextPart.vue.d.ts} +2 -9
- package/dist/components/message/parts/TextPart.vue.d.ts.map +1 -0
- package/dist/components/message/parts/ThinkingPart.vue.d.ts +12 -0
- package/dist/components/message/parts/ThinkingPart.vue.d.ts.map +1 -0
- package/dist/components/message/parts/ToolCallPart.vue.d.ts +19 -0
- package/dist/components/message/parts/ToolCallPart.vue.d.ts.map +1 -0
- package/dist/components/message/parts/ToolResultPart.vue.d.ts +14 -0
- package/dist/components/message/parts/ToolResultPart.vue.d.ts.map +1 -0
- package/dist/components/message/parts/index.d.ts +12 -0
- package/dist/components/message/parts/index.d.ts.map +1 -0
- package/dist/components/message/tool-results/DefaultToolResult.vue.d.ts +4 -0
- package/dist/components/message/tool-results/DefaultToolResult.vue.d.ts.map +1 -0
- package/dist/components/message/tool-results/SearchResults.vue.d.ts +4 -0
- package/dist/components/message/tool-results/SearchResults.vue.d.ts.map +1 -0
- package/dist/components/message/tool-results/WeatherCard.vue.d.ts +4 -0
- package/dist/components/message/tool-results/WeatherCard.vue.d.ts.map +1 -0
- package/dist/components/message/tool-results/index.d.ts +7 -0
- package/dist/components/message/tool-results/index.d.ts.map +1 -0
- package/dist/components/message/welcome-types.d.ts +28 -0
- package/dist/components/message/welcome-types.d.ts.map +1 -0
- package/dist/composables/useChat.d.ts +99 -44
- package/dist/composables/useChat.d.ts.map +1 -1
- package/dist/composables/useImageUpload.d.ts +55 -0
- package/dist/composables/useImageUpload.d.ts.map +1 -0
- package/dist/index.d.ts +28 -28
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +55889 -1359
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +113 -53
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/fileIcon.d.ts +13 -0
- package/dist/utils/fileIcon.d.ts.map +1 -0
- package/package.json +12 -6
- package/src/adapter.ts +12 -70
- package/src/components/ChatPanel.vue +329 -110
- package/src/components/common/ConfirmDialog.vue +208 -0
- package/src/components/common/CopyButton.vue +71 -0
- package/src/components/common/IndexingSettings.vue +580 -0
- package/src/components/common/SettingsPanel.vue +293 -0
- package/src/components/common/Toast.vue +90 -0
- package/src/components/common/ToggleSwitch.vue +75 -0
- package/src/components/{chat/ui → header}/ChatHeader.vue +170 -93
- package/src/components/input/AtFilePicker.vue +657 -0
- package/src/components/input/ChatInput.vue +653 -0
- package/src/components/input/DropdownSelector.vue +322 -0
- package/src/components/input/ImagePreviewModal.vue +238 -0
- package/src/components/input/at-views/AtBranchView.vue +63 -0
- package/src/components/input/at-views/AtBrowserView.vue +63 -0
- package/src/components/input/at-views/AtChatsView.vue +63 -0
- package/src/components/input/at-views/AtDocsView.vue +63 -0
- package/src/components/input/at-views/AtFilesView.vue +255 -0
- package/src/components/input/at-views/AtTerminalsView.vue +63 -0
- package/src/components/message/ContentRenderer.vue +61 -0
- package/src/components/message/MessageBubble.vue +411 -0
- package/src/components/message/PartsRenderer.vue +101 -0
- package/src/components/message/ToolResultRenderer.vue +27 -0
- package/src/components/message/WelcomeMessage.vue +308 -0
- package/src/components/message/blocks/CodeBlock.vue +113 -0
- package/src/components/message/blocks/TextBlock.vue +21 -0
- package/src/components/message/blocks/index.ts +6 -0
- package/src/components/message/parts/CollapsibleCard.vue +135 -0
- package/src/components/message/parts/ErrorPart.vue +51 -0
- package/src/components/message/parts/ImagePart.vue +98 -0
- package/src/components/message/parts/SearchPart.vue +101 -0
- package/src/components/message/parts/TextPart.vue +28 -0
- package/src/components/message/parts/ThinkingPart.vue +54 -0
- package/src/components/message/parts/ToolCallPart.vue +460 -0
- package/src/components/message/parts/ToolResultPart.vue +78 -0
- package/src/components/message/parts/index.ts +13 -0
- package/src/components/message/tool-results/DefaultToolResult.vue +43 -0
- package/src/components/message/tool-results/SearchResults.vue +133 -0
- package/src/components/message/tool-results/WeatherCard.vue +139 -0
- package/src/components/message/tool-results/index.ts +7 -0
- package/src/components/message/welcome-types.ts +47 -0
- package/src/composables/useChat.ts +807 -155
- package/src/composables/useImageUpload.ts +228 -0
- package/src/index.ts +96 -49
- package/src/styles.css +47 -0
- package/src/types/index.ts +146 -98
- package/src/utils/fileIcon.ts +49 -0
- package/dist/components/ChatInput.vue.d.ts.map +0 -1
- package/dist/components/chat/SearchResultBlock.vue.d.ts.map +0 -1
- package/dist/components/chat/ThinkingBlock.vue.d.ts.map +0 -1
- package/dist/components/chat/ToolCallBlock.vue.d.ts.map +0 -1
- package/dist/components/chat/messages/ExecutionSteps.vue.d.ts.map +0 -1
- package/dist/components/chat/messages/MessageBubble.vue.d.ts +0 -28
- package/dist/components/chat/messages/MessageBubble.vue.d.ts.map +0 -1
- package/dist/components/chat/ui/ChatHeader.vue.d.ts.map +0 -1
- package/dist/components/chat/ui/WelcomeMessage.vue.d.ts +0 -7
- package/dist/components/chat/ui/WelcomeMessage.vue.d.ts.map +0 -1
- package/dist/preload/preload.d.ts +0 -6
- package/dist/preload/preload.d.ts.map +0 -1
- package/src/components/ChatInput.vue +0 -649
- package/src/components/chat/SearchResultBlock.vue +0 -155
- package/src/components/chat/ThinkingBlock.vue +0 -109
- package/src/components/chat/ToolCallBlock.vue +0 -213
- package/src/components/chat/messages/ExecutionSteps.vue +0 -281
- package/src/components/chat/messages/MessageBubble.vue +0 -272
- package/src/components/chat/ui/WelcomeMessage.vue +0 -135
- package/src/preload/preload.ts +0 -79
package/dist/components/{chat/messages/ExecutionSteps.vue.d.ts → message/parts/TextPart.vue.d.ts}
RENAMED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import { ToolCall, SearchResult } from '../../../types';
|
|
2
1
|
type __VLS_Props = {
|
|
3
|
-
|
|
4
|
-
hasContent?: boolean;
|
|
5
|
-
thinking?: string;
|
|
6
|
-
thinkingComplete?: boolean;
|
|
7
|
-
searching?: boolean;
|
|
8
|
-
searchResults?: SearchResult[];
|
|
9
|
-
toolCalls?: ToolCall[];
|
|
2
|
+
text: string;
|
|
10
3
|
};
|
|
11
4
|
declare const _default: 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>;
|
|
12
5
|
export default _default;
|
|
13
|
-
//# sourceMappingURL=
|
|
6
|
+
//# sourceMappingURL=TextPart.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextPart.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/message/parts/TextPart.vue"],"names":[],"mappings":"AAOA;AAiCA,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAA;CACb,CAAC;;AAiDF,wBAMG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StepsExpandedType } from '../../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
text: string;
|
|
4
|
+
status: 'running' | 'done';
|
|
5
|
+
duration?: number;
|
|
6
|
+
expandedType?: StepsExpandedType;
|
|
7
|
+
};
|
|
8
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
9
|
+
expandedType: StepsExpandedType;
|
|
10
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
11
|
+
export default _default;
|
|
12
|
+
//# sourceMappingURL=ThinkingPart.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThinkingPart.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/message/parts/ThinkingPart.vue"],"names":[],"mappings":"AAWA;AA0DA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAEvD,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,SAAS,GAAG,MAAM,CAAA;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,iBAAiB,CAAA;CACjC,CAAC;;kBADe,iBAAiB;;AAyFlC,wBAQG"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ChatAdapter } from '../../../adapter';
|
|
2
|
+
import { AutoRunConfig } from '@huyooo/ai-chat-bridge-electron/renderer';
|
|
3
|
+
import { StepsExpandedType } from '../../../types';
|
|
4
|
+
interface Props {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
args?: Record<string, unknown>;
|
|
8
|
+
status: 'pending' | 'running' | 'done' | 'error' | 'cancelled' | 'skipped';
|
|
9
|
+
result: unknown | null;
|
|
10
|
+
expandedType?: StepsExpandedType;
|
|
11
|
+
adapter?: ChatAdapter;
|
|
12
|
+
autoRunConfig?: AutoRunConfig;
|
|
13
|
+
onSaveConfig?: (config: AutoRunConfig) => Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
16
|
+
expandedType: StepsExpandedType;
|
|
17
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
18
|
+
export default _default;
|
|
19
|
+
//# sourceMappingURL=ToolCallPart.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolCallPart.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/message/parts/ToolCallPart.vue"],"names":[],"mappings":"AAwEA;AAmdA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,EAAE,aAAa,EAAe,MAAM,0CAA0C,CAAA;AAC1F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAEvD,UAAU,KAAK;IACb,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9B,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,WAAW,GAAG,SAAS,CAAA;IAC1E,MAAM,EAAE,OAAO,GAAG,IAAI,CAAA;IACtB,YAAY,CAAC,EAAE,iBAAiB,CAAA;IAEhC,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACxD;;kBALgB,iBAAiB;;AAqclC,wBAQG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StepsExpandedType } from '../../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
args?: Record<string, unknown>;
|
|
6
|
+
result: unknown;
|
|
7
|
+
status: 'done' | 'error' | 'cancelled' | 'skipped';
|
|
8
|
+
expandedType?: StepsExpandedType;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
11
|
+
expandedType: StepsExpandedType;
|
|
12
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
13
|
+
export default _default;
|
|
14
|
+
//# sourceMappingURL=ToolResultPart.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolResultPart.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/message/parts/ToolResultPart.vue"],"names":[],"mappings":"AAwBA;AAkFA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAEvD,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9B,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,WAAW,GAAG,SAAS,CAAA;IAClD,YAAY,CAAC,EAAE,iBAAiB,CAAA;CACjC,CAAC;;kBADe,iBAAiB;;AAsHlC,wBAQG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Part 渲染组件导出
|
|
3
|
+
*/
|
|
4
|
+
export { default as TextPart } from './TextPart.vue';
|
|
5
|
+
export { default as ThinkingPart } from './ThinkingPart.vue';
|
|
6
|
+
export { default as SearchPart } from './SearchPart.vue';
|
|
7
|
+
export { default as ToolCallPart } from './ToolCallPart.vue';
|
|
8
|
+
export { default as ToolResultPart } from './ToolResultPart.vue';
|
|
9
|
+
export { default as ImagePart } from './ImagePart.vue';
|
|
10
|
+
export { default as ErrorPart } from './ErrorPart.vue';
|
|
11
|
+
export { default as CollapsibleCard } from './CollapsibleCard.vue';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/message/parts/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAGtD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ToolRendererProps } from '@huyooo/ai-chat-shared';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<ToolRendererProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ToolRendererProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
3
|
+
export default _default;
|
|
4
|
+
//# sourceMappingURL=DefaultToolResult.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultToolResult.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/message/tool-results/DefaultToolResult.vue"],"names":[],"mappings":"AA8CA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;;AA8D/D,wBAOG"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ToolRendererProps } from '@huyooo/ai-chat-shared';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<ToolRendererProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ToolRendererProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
3
|
+
export default _default;
|
|
4
|
+
//# sourceMappingURL=SearchResults.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchResults.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/message/tool-results/SearchResults.vue"],"names":[],"mappings":"AAyIA,OAAO,KAAK,EAAE,iBAAiB,EAAoB,MAAM,wBAAwB,CAAA;;AAwIjF,wBAOG"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ToolRendererProps } from '@huyooo/ai-chat-shared';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<ToolRendererProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ToolRendererProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
3
|
+
export default _default;
|
|
4
|
+
//# sourceMappingURL=WeatherCard.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WeatherCard.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/message/tool-results/WeatherCard.vue"],"names":[],"mappings":"AA+IA,OAAO,KAAK,EAAE,iBAAiB,EAAe,MAAM,wBAAwB,CAAA;;AA2K5E,wBAOG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/message/tool-results/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** 功能项 */
|
|
2
|
+
export interface WelcomeFeature {
|
|
3
|
+
name: string;
|
|
4
|
+
icon: string;
|
|
5
|
+
}
|
|
6
|
+
/** 快捷任务 */
|
|
7
|
+
export interface WelcomeTask {
|
|
8
|
+
name: string;
|
|
9
|
+
desc: string;
|
|
10
|
+
prompt: string;
|
|
11
|
+
icon: string;
|
|
12
|
+
}
|
|
13
|
+
/** 欢迎页配置 */
|
|
14
|
+
export interface WelcomeConfig {
|
|
15
|
+
/** 标题 */
|
|
16
|
+
title: string;
|
|
17
|
+
/** 副标题 */
|
|
18
|
+
subtitle: string;
|
|
19
|
+
/** 图标 */
|
|
20
|
+
icon: string;
|
|
21
|
+
/** 功能列表 */
|
|
22
|
+
features: WelcomeFeature[];
|
|
23
|
+
/** 快捷任务 */
|
|
24
|
+
tasks: WelcomeTask[];
|
|
25
|
+
}
|
|
26
|
+
/** 默认配置 */
|
|
27
|
+
export declare const defaultWelcomeConfig: WelcomeConfig;
|
|
28
|
+
//# sourceMappingURL=welcome-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"welcome-types.d.ts","sourceRoot":"","sources":["../../../src/components/message/welcome-types.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,WAAW;AACX,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,YAAY;AACZ,MAAM,WAAW,aAAa;IAC5B,SAAS;IACT,KAAK,EAAE,MAAM,CAAC;IACd,UAAU;IACV,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS;IACT,IAAI,EAAE,MAAM,CAAC;IACb,WAAW;IACX,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,WAAW;IACX,KAAK,EAAE,WAAW,EAAE,CAAC;CACtB;AAED,WAAW;AACX,eAAO,MAAM,oBAAoB,EAAE,aAgBlC,CAAC"}
|
|
@@ -1,17 +1,38 @@
|
|
|
1
|
-
import { ChatAdapter, ChatMode, SessionRecord } from '@huyooo/ai-chat-bridge-electron/renderer';
|
|
2
|
-
|
|
1
|
+
import { ChatAdapter, ChatMode, SessionRecord, AutoRunConfig } from '@huyooo/ai-chat-bridge-electron/renderer';
|
|
2
|
+
/** 副作用定义 */
|
|
3
|
+
export interface SideEffect {
|
|
4
|
+
type: string;
|
|
5
|
+
success: boolean;
|
|
6
|
+
data?: unknown;
|
|
7
|
+
message?: string;
|
|
8
|
+
}
|
|
9
|
+
/** 工具完成事件数据 */
|
|
10
|
+
export interface ToolCompleteEvent {
|
|
11
|
+
name: string;
|
|
12
|
+
result: unknown;
|
|
13
|
+
/**
|
|
14
|
+
* 工具声明的副作用列表
|
|
15
|
+
* 前端可根据此字段处理通知、刷新文件列表等
|
|
16
|
+
*/
|
|
17
|
+
sideEffects?: SideEffect[];
|
|
18
|
+
}
|
|
3
19
|
export interface UseChatOptions {
|
|
4
|
-
|
|
5
|
-
adapter?: ChatAdapter;
|
|
6
|
-
/** 默认模型 */
|
|
20
|
+
adapter: ChatAdapter;
|
|
7
21
|
defaultModel?: string;
|
|
8
|
-
/** 默认模式 */
|
|
9
22
|
defaultMode?: ChatMode;
|
|
23
|
+
onToolComplete?: (event: ToolCompleteEvent) => void;
|
|
24
|
+
autoRunConfig?: AutoRunConfig;
|
|
10
25
|
}
|
|
11
26
|
/**
|
|
12
27
|
* 聊天状态管理 Composable
|
|
28
|
+
*
|
|
29
|
+
* 核心架构:
|
|
30
|
+
* - sessionStates: Map<sessionId, SessionState> 存储每个会话的独立状态
|
|
31
|
+
* - 多会话可同时进行请求,互不干扰
|
|
32
|
+
* - 切换 tab 不会停止任何正在进行的请求
|
|
33
|
+
* - 通过 computed 属性暴露当前会话的状态
|
|
13
34
|
*/
|
|
14
|
-
export declare function useChat(options
|
|
35
|
+
export declare function useChat(options: UseChatOptions): {
|
|
15
36
|
sessions: import('vue').Ref<{
|
|
16
37
|
id: string;
|
|
17
38
|
appId: string | null;
|
|
@@ -19,6 +40,9 @@ export declare function useChat(options?: UseChatOptions): {
|
|
|
19
40
|
title: string;
|
|
20
41
|
model: string;
|
|
21
42
|
mode: ChatMode;
|
|
43
|
+
webSearchEnabled: boolean;
|
|
44
|
+
thinkingEnabled: boolean;
|
|
45
|
+
hidden: boolean;
|
|
22
46
|
createdAt: Date;
|
|
23
47
|
updatedAt: Date;
|
|
24
48
|
}[], SessionRecord[] | {
|
|
@@ -28,56 +52,75 @@ export declare function useChat(options?: UseChatOptions): {
|
|
|
28
52
|
title: string;
|
|
29
53
|
model: string;
|
|
30
54
|
mode: ChatMode;
|
|
55
|
+
webSearchEnabled: boolean;
|
|
56
|
+
thinkingEnabled: boolean;
|
|
57
|
+
hidden: boolean;
|
|
31
58
|
createdAt: Date;
|
|
32
59
|
updatedAt: Date;
|
|
33
60
|
}[]>;
|
|
34
61
|
currentSessionId: import('vue').Ref<string | null, string | null>;
|
|
35
|
-
messages: import('vue').
|
|
62
|
+
messages: import('vue').ComputedRef<{
|
|
36
63
|
id: string;
|
|
37
64
|
role: "user" | "assistant";
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
65
|
+
parts: ({
|
|
66
|
+
type: "text";
|
|
67
|
+
text: string;
|
|
68
|
+
} | {
|
|
69
|
+
type: "thinking";
|
|
70
|
+
text: string;
|
|
71
|
+
status: "running" | "done";
|
|
72
|
+
duration?: number | undefined;
|
|
73
|
+
} | {
|
|
74
|
+
type: "search";
|
|
75
|
+
query?: string | undefined;
|
|
76
|
+
results?: {
|
|
77
|
+
title: string;
|
|
78
|
+
url: string;
|
|
79
|
+
snippet: string;
|
|
80
|
+
}[] | undefined;
|
|
81
|
+
status: "running" | "done";
|
|
82
|
+
} | {
|
|
83
|
+
type: "tool_call";
|
|
84
|
+
id: string;
|
|
49
85
|
name: string;
|
|
50
86
|
args?: Record<string, unknown> | undefined;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
timestamp?: Date | undefined;
|
|
57
|
-
}[], ChatMessage[] | {
|
|
58
|
-
id: string;
|
|
59
|
-
role: "user" | "assistant";
|
|
60
|
-
content: string;
|
|
61
|
-
images?: string[] | undefined;
|
|
62
|
-
thinking?: string | undefined;
|
|
63
|
-
thinkingComplete?: boolean | undefined;
|
|
64
|
-
searchResults?: {
|
|
65
|
-
title: string;
|
|
66
|
-
url: string;
|
|
67
|
-
snippet: string;
|
|
68
|
-
}[] | undefined;
|
|
69
|
-
searching?: boolean | undefined;
|
|
70
|
-
toolCalls?: {
|
|
87
|
+
status: "pending" | "running" | "done" | "error" | "cancelled" | "skipped";
|
|
88
|
+
result: unknown | null;
|
|
89
|
+
} | {
|
|
90
|
+
type: "tool_result";
|
|
91
|
+
id: string;
|
|
71
92
|
name: string;
|
|
72
93
|
args?: Record<string, unknown> | undefined;
|
|
73
|
-
result
|
|
74
|
-
status: "
|
|
75
|
-
}
|
|
76
|
-
|
|
94
|
+
result: unknown;
|
|
95
|
+
status: "done" | "error" | "cancelled" | "skipped";
|
|
96
|
+
} | {
|
|
97
|
+
type: "image";
|
|
98
|
+
url: string;
|
|
99
|
+
} | {
|
|
100
|
+
type: "error";
|
|
101
|
+
message: string;
|
|
102
|
+
category?: string | undefined;
|
|
103
|
+
retryable?: boolean | undefined;
|
|
104
|
+
})[];
|
|
105
|
+
model?: string | undefined;
|
|
106
|
+
mode?: string | undefined;
|
|
107
|
+
webSearchEnabled?: boolean | undefined;
|
|
108
|
+
thinkingEnabled?: boolean | undefined;
|
|
109
|
+
images?: string[] | undefined;
|
|
77
110
|
loading?: boolean | undefined;
|
|
111
|
+
copied?: boolean | undefined;
|
|
78
112
|
timestamp?: Date | undefined;
|
|
113
|
+
error?: {
|
|
114
|
+
category?: string | undefined;
|
|
115
|
+
message: string;
|
|
116
|
+
code?: string | undefined;
|
|
117
|
+
statusCode?: number | undefined;
|
|
118
|
+
retryable?: boolean | undefined;
|
|
119
|
+
retryAfter?: number | undefined;
|
|
120
|
+
} | undefined;
|
|
121
|
+
aborted?: boolean | undefined;
|
|
79
122
|
}[]>;
|
|
80
|
-
isLoading: import('vue').
|
|
123
|
+
isLoading: import('vue').ComputedRef<boolean>;
|
|
81
124
|
mode: import('vue').Ref<ChatMode, ChatMode>;
|
|
82
125
|
model: import('vue').Ref<string, string>;
|
|
83
126
|
webSearch: import('vue').Ref<boolean, boolean>;
|
|
@@ -87,14 +130,26 @@ export declare function useChat(options?: UseChatOptions): {
|
|
|
87
130
|
createNewSession: () => Promise<void>;
|
|
88
131
|
deleteSession: (sessionId: string) => Promise<void>;
|
|
89
132
|
deleteCurrentSession: () => Promise<void>;
|
|
133
|
+
hideSession: (sessionId: string, hidden: boolean) => Promise<void>;
|
|
134
|
+
clearAllSessions: () => Promise<void>;
|
|
135
|
+
hideOtherSessions: () => Promise<void>;
|
|
136
|
+
exportCurrentSession: () => string | null;
|
|
90
137
|
sendMessage: (text: string, images?: string[]) => Promise<void>;
|
|
91
138
|
cancelRequest: () => void;
|
|
92
139
|
copyMessage: (messageId: string) => Promise<void>;
|
|
93
140
|
regenerateMessage: (messageIndex: number) => void;
|
|
141
|
+
resendFromIndex: (index: number, text: string) => void;
|
|
94
142
|
setMode: (value: ChatMode) => void;
|
|
95
143
|
setModel: (value: string) => void;
|
|
96
144
|
setWebSearch: (value: boolean) => void;
|
|
97
145
|
setThinking: (value: boolean) => void;
|
|
98
146
|
setWorkingDirectory: (dir: string) => void;
|
|
147
|
+
autoRunConfig: import('vue').Ref<{
|
|
148
|
+
mode?: import('@huyooo/ai-chat-bridge-electron/renderer').AutoRunMode | undefined;
|
|
149
|
+
}, AutoRunConfig | {
|
|
150
|
+
mode?: import('@huyooo/ai-chat-bridge-electron/renderer').AutoRunMode | undefined;
|
|
151
|
+
}>;
|
|
152
|
+
loadAutoRunConfig: () => Promise<void>;
|
|
153
|
+
saveAutoRunConfig: (config: AutoRunConfig) => Promise<void>;
|
|
99
154
|
};
|
|
100
155
|
//# sourceMappingURL=useChat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChat.d.ts","sourceRoot":"","sources":["../../src/composables/useChat.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"useChat.d.ts","sourceRoot":"","sources":["../../src/composables/useChat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EACV,WAAW,EAEX,QAAQ,EACR,aAAa,EAEb,aAAa,EACd,MAAM,0CAA0C,CAAA;AAyHjD,YAAY;AACZ,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,eAAe;AACf,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,OAAO,CAAA;IACf;;;OAGG;IACH,WAAW,CAAC,EAAE,UAAU,EAAE,CAAA;CAC3B;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,WAAW,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,QAAQ,CAAA;IACtB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAA;IACnD,aAAa,CAAC,EAAE,aAAa,CAAA;CAC9B;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BA4GL,MAAM;;+BAwDN,MAAM;;6BAyBR,MAAM,UAAU,OAAO;;;gCAgD5B,MAAM,GAAG,IAAI;wBAyTb,MAAM,WAAW,MAAM,EAAE;;6BAwNpB,MAAM;sCA4BH,MAAM;6BAcf,MAAM,QAAQ,MAAM;qBAgDjC,QAAQ;sBAQP,MAAM;0BAQF,OAAO;yBAQR,OAAO;+BA7DI,MAAM;;;;;;;gCA3vBC,aAAa;EAy0BvD"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 图片上传 composable
|
|
3
|
+
* 处理图片选择、粘贴、拖拽、预览等功能
|
|
4
|
+
*/
|
|
5
|
+
/** 内部图片数据结构(包含预览用的 dataUrl) */
|
|
6
|
+
export interface ImageItem {
|
|
7
|
+
dataUrl: string;
|
|
8
|
+
base64: string;
|
|
9
|
+
mimeType: string;
|
|
10
|
+
}
|
|
11
|
+
/** 导出给外部使用的图片数据格式 */
|
|
12
|
+
export interface ImageData {
|
|
13
|
+
base64: string;
|
|
14
|
+
mimeType: string;
|
|
15
|
+
}
|
|
16
|
+
/** useImageUpload 配置项 */
|
|
17
|
+
interface UseImageUploadOptions {
|
|
18
|
+
/** 最大图片数量,默认 5 */
|
|
19
|
+
maxImages?: number;
|
|
20
|
+
/** 单张图片最大大小(字节),默认 10MB */
|
|
21
|
+
maxSize?: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 图片上传 composable
|
|
25
|
+
* @param options 配置项
|
|
26
|
+
*/
|
|
27
|
+
export declare function useImageUpload(options?: UseImageUploadOptions): {
|
|
28
|
+
images: import('vue').Ref<{
|
|
29
|
+
dataUrl: string;
|
|
30
|
+
base64: string;
|
|
31
|
+
mimeType: string;
|
|
32
|
+
}[], ImageItem[] | {
|
|
33
|
+
dataUrl: string;
|
|
34
|
+
base64: string;
|
|
35
|
+
mimeType: string;
|
|
36
|
+
}[]>;
|
|
37
|
+
isDragOver: import('vue').Ref<boolean, boolean>;
|
|
38
|
+
previewVisible: import('vue').Ref<boolean, boolean>;
|
|
39
|
+
previewIndex: import('vue').Ref<number, number>;
|
|
40
|
+
imageUrls: import('vue').ComputedRef<string[]>;
|
|
41
|
+
imageData: import('vue').ComputedRef<ImageData[]>;
|
|
42
|
+
hasImages: import('vue').ComputedRef<boolean>;
|
|
43
|
+
handleImageSelect: (event: Event) => void;
|
|
44
|
+
handlePaste: (event: ClipboardEvent) => void;
|
|
45
|
+
handleDragOver: (event: DragEvent) => void;
|
|
46
|
+
handleDragLeave: () => void;
|
|
47
|
+
handleDrop: (event: DragEvent) => void;
|
|
48
|
+
openPreview: (index: number) => void;
|
|
49
|
+
closePreview: () => void;
|
|
50
|
+
removeImage: (index: number) => void;
|
|
51
|
+
clearImages: () => void;
|
|
52
|
+
addImages: (files: File[]) => void;
|
|
53
|
+
};
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=useImageUpload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useImageUpload.d.ts","sourceRoot":"","sources":["../../src/composables/useImageUpload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,+BAA+B;AAC/B,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,qBAAqB;AACrB,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,yBAAyB;AACzB,UAAU,qBAAqB;IAC7B,kBAAkB;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2BAA2B;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,GAAE,qBAA0B;;iBAvBvD,MAAM;gBACP,MAAM;kBACJ,MAAM;;iBAFP,MAAM;gBACP,MAAM;kBACJ,MAAM;;;;;;;;+BA6FkB,KAAK;yBAaX,cAAc;4BAqBX,SAAS;;wBAgBb,SAAS;yBAYR,MAAM;;yBAeN,MAAM;;uBAcR,IAAI,EAAE;EAgCjC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
* @huyooo/ai-chat-frontend-vue
|
|
3
|
-
*
|
|
4
|
-
* AI Chat 前端组件库 - Vue 版本
|
|
5
|
-
*
|
|
6
|
-
* 使用 adapter 模式,与后端通信方式解耦
|
|
7
|
-
*/
|
|
8
|
-
export type { ChatAdapter, ChatProgress, ChatProgressType, ChatOptions, ChatMode, ModelConfig, ModelProvider, ThinkingMode, SessionRecord, MessageRecord, } from '@huyooo/ai-chat-bridge-electron/renderer';
|
|
9
|
-
export { createElectronAdapter } from '@huyooo/ai-chat-bridge-electron/renderer';
|
|
1
|
+
export type { ChatAdapter, ChatEvent, ChatEventType, ChatOptions, ChatMode, ThinkingMode, SessionRecord, MessageRecord, ModelOption, ProviderType, } from '@huyooo/ai-chat-bridge-electron/renderer';
|
|
10
2
|
export type { ThinkingData, ToolCallData, ToolResultData, ImageData, SendMessageOptions, CreateSessionOptions, UpdateSessionOptions, SaveMessageOptions, } from './adapter';
|
|
11
|
-
export {
|
|
3
|
+
export type { ChatMessage, ContentPart, ContentPartType, TextPart, ThinkingPart, SearchPart, ToolCallPart, ToolResultPart, ImagePart, ErrorPart, SearchResult, ErrorDetails, ChatInputOptions, } from './types';
|
|
4
|
+
export { getMessageText } from './types';
|
|
12
5
|
export { useChat } from './composables/useChat';
|
|
13
|
-
export type { UseChatOptions } from './composables/useChat';
|
|
6
|
+
export type { UseChatOptions, ToolCompleteEvent, SideEffect } from './composables/useChat';
|
|
14
7
|
export { default as ChatPanel } from './components/ChatPanel.vue';
|
|
15
|
-
export { default as
|
|
16
|
-
export { default as
|
|
17
|
-
export {
|
|
18
|
-
export { default as
|
|
19
|
-
export { default as
|
|
20
|
-
export { default as
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export
|
|
24
|
-
export {
|
|
8
|
+
export { default as MessageBubble } from './components/message/MessageBubble.vue';
|
|
9
|
+
export { default as PartsRenderer } from './components/message/PartsRenderer.vue';
|
|
10
|
+
export { TextPart as TextPartComponent, ThinkingPart as ThinkingPartComponent, SearchPart as SearchPartComponent, ToolCallPart as ToolCallPartComponent, ToolResultPart as ToolResultPartComponent, ErrorPart as ErrorPartComponent, } from './components/message/parts';
|
|
11
|
+
export { default as ChatInput } from './components/input/ChatInput.vue';
|
|
12
|
+
export { default as ChatHeader } from './components/header/ChatHeader.vue';
|
|
13
|
+
export { default as WelcomeMessage } from './components/message/WelcomeMessage.vue';
|
|
14
|
+
export type { WelcomeConfig, WelcomeFeature, WelcomeTask } from './components/message/welcome-types';
|
|
15
|
+
export { defaultWelcomeConfig } from './components/message/welcome-types';
|
|
16
|
+
export { default as ConfirmDialog } from './components/common/ConfirmDialog.vue';
|
|
17
|
+
export { default as Toast } from './components/common/Toast.vue';
|
|
18
|
+
export type { ToolRendererProps, WeatherData, SearchResultItem, } from '@huyooo/ai-chat-shared';
|
|
25
19
|
/**
|
|
26
20
|
* 使用说明:
|
|
27
21
|
*
|
|
28
22
|
* 1. 导入样式:
|
|
29
23
|
* import '@huyooo/ai-chat-frontend-vue/style.css'
|
|
30
24
|
*
|
|
31
|
-
* 2.
|
|
32
|
-
* import { ChatPanel
|
|
25
|
+
* 2. 基本使用:
|
|
26
|
+
* import { ChatPanel } from '@huyooo/ai-chat-frontend-vue'
|
|
27
|
+
* import { createElectronAdapter } from '@huyooo/ai-chat-bridge-electron/renderer'
|
|
33
28
|
* const adapter = createElectronAdapter()
|
|
34
|
-
* <ChatPanel :adapter="adapter" />
|
|
29
|
+
* <ChatPanel :adapter="adapter" :working-dir="'/path/to/dir'" />
|
|
35
30
|
*
|
|
36
|
-
* 3.
|
|
37
|
-
* import {
|
|
38
|
-
*
|
|
39
|
-
* const
|
|
31
|
+
* 3. 自定义工具渲染器:
|
|
32
|
+
* import { markRaw } from 'vue'
|
|
33
|
+
* import CustomWeatherCard from './CustomWeatherCard.vue'
|
|
34
|
+
* const toolRenderers = { get_weather: markRaw(CustomWeatherCard) }
|
|
35
|
+
* <ChatPanel :adapter="adapter" :tool-renderers="toolRenderers" />
|
|
36
|
+
*
|
|
37
|
+
* 4. 使用 useChat 自定义 UI:
|
|
38
|
+
* import { useChat } from '@huyooo/ai-chat-frontend-vue'
|
|
39
|
+
* const { messages, sendMessage, ... } = useChat({ adapter })
|
|
40
40
|
*/
|
|
41
41
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,cAAc,CAAA;AAKrB,YAAY,EACV,WAAW,EACX,SAAS,EACT,aAAa,EACb,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,aAAa,EACb,WAAW,EACX,YAAY,GACb,MAAM,0CAA0C,CAAA;AAGjD,YAAY,EACV,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,WAAW,CAAA;AAGlB,YAAY,EAEV,WAAW,EAEX,WAAW,EACX,eAAe,EACf,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,cAAc,EACd,SAAS,EACT,SAAS,EAET,YAAY,EAEZ,YAAY,EAEZ,gBAAgB,GACjB,MAAM,SAAS,CAAA;AAGhB,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAIxC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAI1F,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAIjE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wCAAwC,CAAA;AACjF,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wCAAwC,CAAA;AAGjF,OAAO,EACL,QAAQ,IAAI,iBAAiB,EAC7B,YAAY,IAAI,qBAAqB,EACrC,UAAU,IAAI,mBAAmB,EACjC,YAAY,IAAI,qBAAqB,EACrC,cAAc,IAAI,uBAAuB,EACzC,SAAS,IAAI,kBAAkB,GAChC,MAAM,4BAA4B,CAAA;AAKnC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,kCAAkC,CAAA;AAGvE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,oCAAoC,CAAA;AAG1E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,yCAAyC,CAAA;AACnF,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAA;AACpG,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAA;AAGzE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,uCAAuC,CAAA;AAChF,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,+BAA+B,CAAA;AAKhE,YAAY,EACV,iBAAiB,EACjB,WAAW,EACX,gBAAgB,GACjB,MAAM,wBAAwB,CAAA;AAE/B;;;;;;;;;;;;;;;;;;;;;GAqBG"}
|