wi-chat 0.6.1 → 0.7.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/core/index.cjs +1 -1
- package/dist/core/index.d.ts +12 -0
- package/dist/core/index.js +737 -322
- package/dist/core/useAnswerActions.d.ts +61 -0
- package/dist/core/useChat.d.ts +90 -15
- package/dist/core/useChatAuth.d.ts +96 -0
- package/dist/core/useChatRooms.d.ts +66 -0
- package/dist/core/useKeepAlive.d.ts +41 -0
- package/dist/core/useLlm.d.ts +73 -0
- package/dist/core/useRunningGroups.d.ts +58 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +119 -108
- package/dist/mobile-ui/chat/ChatContainer.vue.d.ts +8 -8
- package/dist/mobile-ui/chat/ChatMessagesView.vue.d.ts +6 -6
- package/dist/mobile-ui/index.cjs +1 -1
- package/dist/mobile-ui/index.js +104 -104
- package/dist/mobile-ui/inputbox/Inputbox.vue.d.ts +6 -6
- package/dist/page-context/index.js +2 -4
- package/dist/parser/answerCom/actionExecute/actionProtocol.d.ts +1 -7
- package/dist/parser/answerCom/actionExecute/clarification.d.ts +15 -3
- package/dist/parser/answerCom/actionExecute/constants.d.ts +10 -0
- package/dist/parser/answerCom/actionExecute/parseCollectClarifications.d.ts +3 -2
- package/dist/parser/answerCom/actionExecute/parseHostAction.d.ts +3 -2
- package/dist/parser/answerCom/actionExecute/types.d.ts +3 -3
- package/dist/parser/answerCom/generic/parseGeneric.d.ts +52 -0
- package/dist/parser/answerCom/generic/types.d.ts +75 -0
- package/dist/parser/answerCom/outputFile/parseOutputFile.d.ts +7 -6
- package/dist/parser/answerCom/outputFile/types.d.ts +15 -5
- package/dist/parser/answerCom/presentFiles/parsePresentFiles.d.ts +58 -0
- package/dist/parser/answerCom/presentFiles/types.d.ts +27 -0
- package/dist/parser/answerMeta.d.ts +71 -0
- package/dist/parser/deepThinking/parseDeepThinking.d.ts +8 -0
- package/dist/parser/history/history.d.ts +9 -0
- package/dist/parser/history/index.d.ts +1 -1
- package/dist/parser/index.cjs +6 -2
- package/dist/parser/index.d.ts +13 -4
- package/dist/parser/index.js +640 -457
- package/dist/parser/message.d.ts +9 -0
- package/dist/parser/registry.d.ts +1 -1
- package/dist/parser/runTime.d.ts +29 -0
- package/dist/renderers/TextAnswer-BgKGvG_o.cjs +2 -0
- package/dist/renderers/TextAnswer-PQwV3K7v.js +5 -0
- package/dist/renderers/aiAnswer/AiAnswerBubble.vue.d.ts +4 -4
- package/dist/renderers/answerCard/AnswerCard.vue.d.ts +65 -0
- package/dist/renderers/answerCard/AnswerToolbar.vue.d.ts +42 -0
- package/dist/renderers/answerConfig.d.ts +33 -0
- package/dist/renderers/clarification/ClarificationCard.vue.d.ts +3 -3
- package/dist/renderers/deepThinking/DeepThinkingSteps.vue.d.ts +4 -4
- package/dist/renderers/deviceLastValue/DeviceLastValue.vue.d.ts +37 -0
- package/dist/renderers/hostAction/HostActionStatus.vue.d.ts +3 -3
- package/dist/renderers/iframePage/IframePage.vue.d.ts +3 -3
- package/dist/renderers/index.cjs +6 -1
- package/dist/renderers/index.d.ts +14 -0
- package/dist/renderers/index.js +1504 -607
- package/dist/renderers/knowledgeStream/KnowledgeStreamResult.vue.d.ts +3 -3
- package/dist/renderers/media/MediaAnswer.vue.d.ts +19 -0
- package/dist/renderers/outputFile/OutputFile.vue.d.ts +3 -3
- package/dist/renderers/outputFile/OutputFileLink.vue.d.ts +19 -0
- package/dist/renderers/outputFile/localFile.d.ts +46 -0
- package/dist/renderers/outputFile/useOutputFile.d.ts +32 -3
- package/dist/renderers/presentFiles/PresentFiles.vue.d.ts +19 -0
- package/dist/renderers/recordset/RecordsetView.vue.d.ts +19 -0
- package/dist/renderers/sqlQuery/SqlQuery.vue.d.ts +19 -0
- package/dist/renderers/style.css +1 -1
- package/dist/renderers/text/TextAnswer.vue.d.ts +19 -0
- package/dist/request/api.d.ts +121 -1
- package/dist/request/client.d.ts +6 -0
- package/dist/request/index.cjs +4 -2
- package/dist/request/index.d.ts +4 -2
- package/dist/request/index.js +754 -181
- package/dist/request/ws.d.ts +11 -86
- package/dist/request/wsCore.d.ts +104 -0
- package/dist/request/wsSession.d.ts +353 -0
- package/dist/right-panel/RightPanel.vue.d.ts +6 -6
- package/dist/right-panel/RightPanelIcon.vue.d.ts +4 -4
- package/dist/right-panel/RightPanelTabs.vue.d.ts +9 -5
- package/dist/right-panel/index.cjs +1 -1
- package/dist/right-panel/index.d.ts +1 -1
- package/dist/right-panel/index.js +617 -537
- package/dist/right-panel/panels/newtab/NewTabPanel.vue.d.ts +4 -4
- package/dist/right-panel/panels/web/WebPanel.vue.d.ts +3 -3
- package/dist/right-panel/shared/BrowserToolbar.vue.d.ts +3 -3
- package/dist/right-panel/shared/RightPanelToolList.vue.d.ts +5 -5
- package/dist/right-panel/style.css +1 -1
- package/dist/right-panel/types.d.ts +10 -0
- package/dist/theme/index.js +2 -4
- package/dist/tools/index.cjs +5 -5
- package/dist/tools/index.d.ts +2 -2
- package/dist/tools/index.js +323 -217
- package/dist/tools/markdown/MarkdownContent.vue.d.ts +5 -5
- package/dist/tools/markdown/index.d.ts +2 -0
- package/dist/tools/markdown/interactions.d.ts +39 -0
- package/dist/tools/markdown/sanitize.d.ts +6 -0
- package/dist/tools/style.css +1 -1
- package/dist/tools/useAutoScroll.d.ts +3 -3
- package/dist/web-ui/attach/AttachmentCard.vue.d.ts +6 -6
- package/dist/web-ui/attach/AttachmentList.vue.d.ts +6 -6
- package/dist/web-ui/chat/ChatContainer.vue.d.ts +10 -10
- package/dist/web-ui/chat/ChatMessagesView.vue.d.ts +6 -6
- package/dist/web-ui/envswitch/EnvSwitch.vue.d.ts +6 -6
- package/dist/web-ui/index.cjs +1 -1
- package/dist/web-ui/index.js +630 -635
- package/dist/web-ui/inputbox/Inputbox.vue.d.ts +11 -11
- package/dist/web-ui/recordset/RecordsetTable.vue.d.ts +4 -4
- package/dist/web-ui/style.css +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -1,114 +1,125 @@
|
|
|
1
1
|
import "wi-chat/style.css";
|
|
2
|
-
import { AuthExpiredError as a, buildChatWsUrl as o,
|
|
3
|
-
import { CHAT_TITLE_MAX_LENGTH as
|
|
4
|
-
import { AGENT_TABLE_STATE_ROW_LIMIT as
|
|
5
|
-
import { DEFAULT_PRIMARY as
|
|
6
|
-
import { useAgent as
|
|
7
|
-
import { closeImagePreview as
|
|
2
|
+
import { AuthExpiredError as a, buildChatWsUrl as o, buildConnectFrame as i, chatWsRegistry as n, createChatApi as s, createChatWsFallback as l, createChatWsRegistry as c, createChunkSender as p, createRequest as C, defaultBuildHistoryAnswerPayload as m, defaultHasHistoryAnswerContent as A, fileToBase64 as u, formDataToJson as h, isCancelError as E, login as d, openChatWebSocketStream as T, openChatWsSessionStream as R, pickChatTaskList as S, pickHistoryId as g, pwdEncrypt as P, resolveMessageData as y, sendPayloadInChunks as _, startChatWsSession as f } from "wi-chat/request";
|
|
3
|
+
import { CHAT_TITLE_MAX_LENGTH as k, COLLECT_CLARIFICATIONS_ANSWER_TYPE as x, HOST_ACTION_ANSWER_TYPE as H, IFRAME_RESIZER_CHILD_SCRIPT as w, IMAGE_EXTENSIONS as F, OUTPUT_FILE_ANSWER_TYPE as L, RECORDSET_ANSWER_TYPE as O, RoleEnum as z, applyAnswerChunk as N, applyCollectClarificationsChunk as G, applyDeepThinkingChunk as W, applyHostActionChunk as M, applyIframePageChunk as D, applyKnowledgeStreamChunk as v, applyOutputFileChunk as U, applyRecordsetChunk as b, buildChatTitle as Y, cancelClarification as X, clearPendingClarifications as B, collectClarificationsParser as K, collectDeepThinkingSteps as q, collectThinkingSteps as V, consumeStream as j, createEmptyAnswerValues as J, createFailureResult as Z, createHistoryGroup as Q, createLineSplitter as $, deepThinkingParser as ee, deleteHistoryGroup as te, expirePendingClarificationsForReply as re, extractAttachmentsFromHistory as ae, extractHistoryAttachments as oe, formatFileSize as ie, getHistoryGroups as ne, hasPendingClarification as se, hostActionParser as le, iframePageParser as ce, injectIframeResizerScript as pe, isImageAttachment as Ce, knowledgeStreamParser as me, loadGroupMessages as Ae, loadGroupMessagesByStep as ue, nextClarificationRequestId as he, nextLocalMessageId as Ee, normalizeActionResult as de, normalizeAnswer as Te, normalizeAnswerReport as Re, normalizeAttachment as Se, normalizeCollectClarificationsReport as ge, normalizeHostActionReport as Pe, normalizeIframePageReport as ye, normalizeKnowledgeStreamReport as _e, normalizeOutputFileReport as fe, normalizeRecordsetReport as Ie, outputFileParser as ke, parseActionExecuteCommand as xe, parseClarificationArguments as He, parseHistoryAttachment as we, parseRealtimeAttachment as Fe, parseSseLine as Le, readFrontReplyAction as Oe, readOutputFilePayload as ze, readRecordsetPayload as Ne, recordsetParser as Ge, registerClarification as We, resolveAttachDownloadUrl as Me, resolveAttachPreviewUrl as De, resolveRemoteFileUrl as ve, setHistoryGroupTitle as Ue, submitClarification as be, wrapActionFrame as Ye } from "wi-chat/parser";
|
|
4
|
+
import { AGENT_TABLE_STATE_ROW_LIMIT as Be, PAGE_CONTEXT_EXT_ARGS_KEY as Ke, PAGE_CONTEXT_SCHEMA_VERSION as qe, createPageContext as Ve, isAgentPageContext as je, normalizeAgentPageState as Je, parsePageContextExtArgs as Ze, toPageContextExtArgs as Qe } from "wi-chat/page-context";
|
|
5
|
+
import { DEFAULT_PRIMARY as et, applyTheme as tt, createChatTheme as rt } from "wi-chat/theme";
|
|
6
|
+
import { useAgent as ot, useChat as it, useChatSession as nt, useHistory as st } from "wi-chat/core";
|
|
7
|
+
import { closeImagePreview as ct, createStyleScope as pt, downloadAttachment as Ct, openImagePreview as mt, renderMarkdown as At, useAutoScroll as ut } from "wi-chat/tools";
|
|
8
8
|
export {
|
|
9
|
-
|
|
9
|
+
Be as AGENT_TABLE_STATE_ROW_LIMIT,
|
|
10
10
|
a as AuthExpiredError,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
11
|
+
k as CHAT_TITLE_MAX_LENGTH,
|
|
12
|
+
x as COLLECT_CLARIFICATIONS_ANSWER_TYPE,
|
|
13
|
+
et as DEFAULT_PRIMARY,
|
|
14
|
+
H as HOST_ACTION_ANSWER_TYPE,
|
|
15
|
+
w as IFRAME_RESIZER_CHILD_SCRIPT,
|
|
16
|
+
F as IMAGE_EXTENSIONS,
|
|
17
|
+
L as OUTPUT_FILE_ANSWER_TYPE,
|
|
18
|
+
Ke as PAGE_CONTEXT_EXT_ARGS_KEY,
|
|
19
|
+
qe as PAGE_CONTEXT_SCHEMA_VERSION,
|
|
20
|
+
O as RECORDSET_ANSWER_TYPE,
|
|
21
|
+
z as RoleEnum,
|
|
22
|
+
N as applyAnswerChunk,
|
|
23
|
+
G as applyCollectClarificationsChunk,
|
|
24
|
+
W as applyDeepThinkingChunk,
|
|
25
|
+
M as applyHostActionChunk,
|
|
26
|
+
D as applyIframePageChunk,
|
|
27
|
+
v as applyKnowledgeStreamChunk,
|
|
28
|
+
U as applyOutputFileChunk,
|
|
29
|
+
b as applyRecordsetChunk,
|
|
30
|
+
tt as applyTheme,
|
|
31
|
+
Y as buildChatTitle,
|
|
32
32
|
o as buildChatWsUrl,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
33
|
+
i as buildConnectFrame,
|
|
34
|
+
X as cancelClarification,
|
|
35
|
+
n as chatWsRegistry,
|
|
36
|
+
B as clearPendingClarifications,
|
|
37
|
+
ct as closeImagePreview,
|
|
38
|
+
K as collectClarificationsParser,
|
|
39
|
+
q as collectDeepThinkingSteps,
|
|
40
|
+
V as collectThinkingSteps,
|
|
41
|
+
j as consumeStream,
|
|
42
|
+
s as createChatApi,
|
|
43
|
+
rt as createChatTheme,
|
|
44
|
+
l as createChatWsFallback,
|
|
45
|
+
c as createChatWsRegistry,
|
|
46
|
+
p as createChunkSender,
|
|
47
|
+
J as createEmptyAnswerValues,
|
|
48
|
+
Z as createFailureResult,
|
|
49
|
+
Q as createHistoryGroup,
|
|
50
|
+
$ as createLineSplitter,
|
|
51
|
+
Ve as createPageContext,
|
|
52
|
+
C as createRequest,
|
|
53
|
+
pt as createStyleScope,
|
|
54
|
+
ee as deepThinkingParser,
|
|
55
|
+
m as defaultBuildHistoryAnswerPayload,
|
|
56
|
+
A as defaultHasHistoryAnswerContent,
|
|
57
|
+
te as deleteHistoryGroup,
|
|
58
|
+
Ct as downloadAttachment,
|
|
59
|
+
re as expirePendingClarificationsForReply,
|
|
60
|
+
ae as extractAttachmentsFromHistory,
|
|
61
|
+
oe as extractHistoryAttachments,
|
|
62
|
+
u as fileToBase64,
|
|
63
|
+
h as formDataToJson,
|
|
64
|
+
ie as formatFileSize,
|
|
65
|
+
ne as getHistoryGroups,
|
|
66
|
+
se as hasPendingClarification,
|
|
67
|
+
le as hostActionParser,
|
|
68
|
+
ce as iframePageParser,
|
|
69
|
+
pe as injectIframeResizerScript,
|
|
70
|
+
je as isAgentPageContext,
|
|
71
|
+
E as isCancelError,
|
|
72
|
+
Ce as isImageAttachment,
|
|
73
|
+
me as knowledgeStreamParser,
|
|
74
|
+
Ae as loadGroupMessages,
|
|
75
|
+
ue as loadGroupMessagesByStep,
|
|
76
|
+
d as login,
|
|
77
|
+
he as nextClarificationRequestId,
|
|
78
|
+
Ee as nextLocalMessageId,
|
|
79
|
+
de as normalizeActionResult,
|
|
80
|
+
Je as normalizeAgentPageState,
|
|
81
|
+
Te as normalizeAnswer,
|
|
82
|
+
Re as normalizeAnswerReport,
|
|
83
|
+
Se as normalizeAttachment,
|
|
84
|
+
ge as normalizeCollectClarificationsReport,
|
|
85
|
+
Pe as normalizeHostActionReport,
|
|
86
|
+
ye as normalizeIframePageReport,
|
|
87
|
+
_e as normalizeKnowledgeStreamReport,
|
|
88
|
+
fe as normalizeOutputFileReport,
|
|
89
|
+
Ie as normalizeRecordsetReport,
|
|
90
|
+
T as openChatWebSocketStream,
|
|
91
|
+
R as openChatWsSessionStream,
|
|
92
|
+
mt as openImagePreview,
|
|
93
|
+
ke as outputFileParser,
|
|
94
|
+
xe as parseActionExecuteCommand,
|
|
95
|
+
He as parseClarificationArguments,
|
|
96
|
+
we as parseHistoryAttachment,
|
|
97
|
+
Ze as parsePageContextExtArgs,
|
|
98
|
+
Fe as parseRealtimeAttachment,
|
|
99
|
+
Le as parseSseLine,
|
|
100
|
+
S as pickChatTaskList,
|
|
101
|
+
g as pickHistoryId,
|
|
102
|
+
P as pwdEncrypt,
|
|
103
|
+
Oe as readFrontReplyAction,
|
|
104
|
+
ze as readOutputFilePayload,
|
|
105
|
+
Ne as readRecordsetPayload,
|
|
106
|
+
Ge as recordsetParser,
|
|
107
|
+
We as registerClarification,
|
|
108
|
+
At as renderMarkdown,
|
|
109
|
+
Me as resolveAttachDownloadUrl,
|
|
110
|
+
De as resolveAttachPreviewUrl,
|
|
111
|
+
y as resolveMessageData,
|
|
112
|
+
ve as resolveRemoteFileUrl,
|
|
113
|
+
_ as sendPayloadInChunks,
|
|
114
|
+
Ue as setHistoryGroupTitle,
|
|
115
|
+
f as startChatWsSession,
|
|
116
|
+
be as submitClarification,
|
|
117
|
+
Qe as toPageContextExtArgs,
|
|
118
|
+
ot as useAgent,
|
|
119
|
+
ut as useAutoScroll,
|
|
120
|
+
it as useChat,
|
|
121
|
+
nt as useChatSession,
|
|
122
|
+
st as useHistory,
|
|
123
|
+
Ye as wrapActionFrame
|
|
113
124
|
};
|
|
114
125
|
//# sourceMappingURL=index.js.map
|
|
@@ -2,7 +2,7 @@ import { AnswerParser, AssistantMessage, Message } from 'wi-chat/parser';
|
|
|
2
2
|
import { OutputFileConfig } from 'wi-chat/renderers';
|
|
3
3
|
import { ChatSubmitPayload } from './types';
|
|
4
4
|
|
|
5
|
-
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
5
|
+
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
6
6
|
/** 当前分组消息列表 */
|
|
7
7
|
messages: Message[];
|
|
8
8
|
/** 自定义回答类型 parser */
|
|
@@ -39,7 +39,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__
|
|
|
39
39
|
emptyTitle: string;
|
|
40
40
|
emptyDescription: string;
|
|
41
41
|
disabled: boolean;
|
|
42
|
-
}
|
|
42
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
43
43
|
"update:question": (value: string) => void;
|
|
44
44
|
submit: (payload: ChatSubmitPayload) => void;
|
|
45
45
|
stop: () => void;
|
|
@@ -82,25 +82,25 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__
|
|
|
82
82
|
emptyTitle: string;
|
|
83
83
|
emptyDescription: string;
|
|
84
84
|
disabled: boolean;
|
|
85
|
-
}>>> & {
|
|
85
|
+
}>>> & Readonly<{
|
|
86
86
|
onSubmit?: (payload: ChatSubmitPayload) => any;
|
|
87
|
+
onStop?: () => any;
|
|
87
88
|
onLoadOlder?: () => any;
|
|
88
89
|
onUpdateThinkingExpanded?: (message: AssistantMessage, expanded: boolean) => any;
|
|
89
|
-
onStop?: () => any;
|
|
90
90
|
"onUpdate:question"?: (value: string) => any;
|
|
91
|
-
}
|
|
91
|
+
}>, {
|
|
92
92
|
placeholder: string;
|
|
93
93
|
question: string;
|
|
94
94
|
parsers: AnswerParser<any>[];
|
|
95
95
|
loading: boolean;
|
|
96
96
|
disabled: boolean;
|
|
97
97
|
messages: Message[];
|
|
98
|
-
emptyTitle: string;
|
|
99
|
-
emptyDescription: string;
|
|
100
98
|
talking: boolean;
|
|
101
99
|
session: string;
|
|
102
100
|
hasMore: boolean;
|
|
103
|
-
|
|
101
|
+
emptyTitle: string;
|
|
102
|
+
emptyDescription: string;
|
|
103
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, {
|
|
104
104
|
messages?(_: {}): any;
|
|
105
105
|
"above-input"?(_: {}): any;
|
|
106
106
|
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AnswerParser, AssistantMessage, Message } from 'wi-chat/parser';
|
|
2
2
|
import { OutputFileConfig } from 'wi-chat/renderers';
|
|
3
3
|
|
|
4
|
-
declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
4
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
5
5
|
/** 当前分组消息列表 */
|
|
6
6
|
messages: Message[];
|
|
7
7
|
/** 自定义回答类型 parser(component 字段会注册进共享 contentMap) */
|
|
@@ -20,12 +20,12 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
20
20
|
loading: boolean;
|
|
21
21
|
emptyTitle: string;
|
|
22
22
|
emptyDescription: string;
|
|
23
|
-
}
|
|
23
|
+
}>>, {
|
|
24
24
|
/** 强制滚动到底部 */
|
|
25
25
|
forceScrollToBottom: () => Promise<void>;
|
|
26
26
|
/** 自动滚动开启时请求滚动到底部 */
|
|
27
27
|
requestScrollToBottom: () => Promise<void>;
|
|
28
|
-
},
|
|
28
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
29
29
|
loadOlder: () => void;
|
|
30
30
|
updateThinkingExpanded: (message: AssistantMessage, expanded: boolean) => void;
|
|
31
31
|
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
@@ -47,16 +47,16 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
47
47
|
loading: boolean;
|
|
48
48
|
emptyTitle: string;
|
|
49
49
|
emptyDescription: string;
|
|
50
|
-
}>>> & {
|
|
50
|
+
}>>> & Readonly<{
|
|
51
51
|
onLoadOlder?: () => any;
|
|
52
52
|
onUpdateThinkingExpanded?: (message: AssistantMessage, expanded: boolean) => any;
|
|
53
|
-
}
|
|
53
|
+
}>, {
|
|
54
54
|
parsers: AnswerParser[];
|
|
55
55
|
loading: boolean;
|
|
56
56
|
messages: Message[];
|
|
57
57
|
emptyTitle: string;
|
|
58
58
|
emptyDescription: string;
|
|
59
|
-
}, {}>;
|
|
59
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
60
60
|
export default _default;
|
|
61
61
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
62
62
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
package/dist/mobile-ui/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("wi-chat/renderers"),e=require("vue"),C=require("vant"),O=require("wi-chat/tools"),T={class:"wi-mobile-inputbox"},V=e.defineComponent({__name:"Inputbox",props:{modelValue:{default:""},placeholder:{default:"请输入问题(Enter 发送)"},disabled:{type:Boolean,default:!1},disabledSend:{type:Boolean,default:!1},enterExact:{type:Boolean,default:!0},submitText:{default:"发送"},stopText:{default:"停止"},talking:{type:Boolean,default:!1},buttonType:{default:"primary"}},emits:["update:modelValue","submit","stop"],setup(t,{emit:c}){const s=t,n=c,i=()=>{if(s.talking){n("stop");return}s.disabled||s.disabledSend||n("submit")},p=r=>{r.isComposing||r.keyCode===229||!s.enterExact||s.talking||(r.preventDefault(),i())};return(r,l)=>(e.openBlock(),e.createElementBlock("div",T,[e.createVNode(e.unref(C.Field),{"model-value":t.modelValue,type:"textarea",rows:"2",autosize:"",placeholder:t.placeholder,disabled:t.disabled,"onUpdate:modelValue":l[0]||(l[0]=d=>n("update:modelValue",String(d??""))),onKeydown:e.withKeys(e.withModifiers(p,["exact"]),["enter"])},null,8,["model-value","placeholder","disabled","onKeydown"]),e.createVNode(e.unref(C.Button),{class:"wi-mobile-inputbox__btn",type:t.talking?"danger":t.buttonType,size:"small",disabled:t.disabled,onClick:i},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.talking?t.stopText:t.submitText),1)]),_:1},8,["type","disabled"])]))}}),y=(t,c)=>{const s=t.__vccOpts||t;for(const[n,i]of c)s[n]=i;return s},v=y(V,[["__scopeId","data-v-02f9c6a0"]]),I={key:0,class:"wi-mobile-chat-messages__loading"},P={key:1,class:"wi-mobile-chat-messages__empty"},j={class:"wi-mobile-chat-messages__empty-title"},N={class:"wi-mobile-chat-messages__empty-description"},A={key:0,class:"wi-mobile-chat-messages__user"},F={class:"wi-mobile-chat-messages__user-wrapper"},D={key:0,class:"wi-mobile-chat-messages__attachments"},_={class:"wi-mobile-chat-messages__user-bubble"},q={key:1,class:"wi-mobile-chat-messages__assistant"},M=e.defineComponent({__name:"ChatMessagesView",props:{messages:{default:()=>[]},parsers:{default:()=>[]},outputFileConfig:{},loading:{type:Boolean,default:!1},emptyTitle:{default:"输入问题,开始与 AI 对话"},emptyDescription:{default:"回答内容由共享渲染层统一分发"}},emits:["loadOlder","updateThinkingExpanded"],setup(t,{expose:c,emit:s}){var w,B;const n=t,i=s;o.provideOutputFileConfig(n.outputFileConfig??{});const p=e.ref(),{showScrollToBottom:r,forceScrollToBottom:l,requestScrollToBottom:d,resetScrollState:b,onReachTop:E}=O.useAutoScroll(p),S=e.computed(()=>o.createAnswerContentMap(n.parsers));e.watch(()=>n.messages.length===0,f=>{f&&b()});let h=((w=n.messages[0])==null?void 0:w.id)??"",k=((B=n.messages[n.messages.length-1])==null?void 0:B.id)??"";return e.watch(()=>n.messages,()=>{var g,m;const f=((g=n.messages[0])==null?void 0:g.id)??"",u=((m=n.messages[n.messages.length-1])==null?void 0:m.id)??"",a=f!==h&&u===k;h=f,k=u,!a&&d()},{deep:!0}),E(()=>i("loadOlder")),c({forceScrollToBottom:l,requestScrollToBottom:d}),(f,u)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"scrollEl",ref:p,class:"wi-mobile-chat-messages"},[t.loading?(e.openBlock(),e.createElementBlock("div",I,"历史加载中...")):t.messages.length===0?(e.openBlock(),e.createElementBlock("div",P,[u[1]||(u[1]=e.createElementVNode("div",{class:"wi-mobile-chat-messages__empty-logo"},"WI",-1)),e.createElementVNode("div",j,e.toDisplayString(t.emptyTitle),1),e.createElementVNode("div",N,e.toDisplayString(t.emptyDescription),1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.messages,a=>{var g;return e.openBlock(),e.createElementBlock(e.Fragment,{key:a.id},[a.role==="user"?(e.openBlock(),e.createElementBlock("div",A,[e.createElementVNode("div",F,[(g=a.attachments)!=null&&g.length?(e.openBlock(),e.createElementBlock("div",D,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.attachments,m=>(e.openBlock(),e.createElementBlock("span",{key:m.name,class:"wi-mobile-chat-messages__attachment"},e.toDisplayString(m.name),1))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",_,e.toDisplayString(a.content),1)])])):(e.openBlock(),e.createElementBlock("div",q,[e.createVNode(e.unref(o.DeepThinkingSteps),{steps:a.thinking.steps,expanded:a.thinking.expanded,"onUpdate:expanded":m=>i("updateThinkingExpanded",a,m)},null,8,["steps","expanded","onUpdate:expanded"]),e.createVNode(e.unref(o.AiAnswerBubble),{answer:a.answer,error:a.error,stopped:a.stopped,"content-map":S.value},null,8,["answer","error","stopped","content-map"])]))],64)}),128)),e.createVNode(e.Transition,{name:"wi-mobile-chat-messages-fade"},{default:e.withCtx(()=>[e.unref(r)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"wi-mobile-chat-messages__bottom",onClick:u[0]||(u[0]=(...a)=>e.unref(l)&&e.unref(l)(...a))}," 回到底部 ")):e.createCommentVNode("",!0)]),_:1})],512))}}),x=y(M,[["__scopeId","data-v-04e966f6"]]),$={class:"wi-mobile-chat-container"},K=e.defineComponent({__name:"ChatContainer",props:{messages:{default:()=>[]},parsers:{default:()=>[]},outputFileConfig:{},loading:{type:Boolean,default:!1},talking:{type:Boolean,default:!1},session:{default:""},question:{default:""},placeholder:{default:"请输入问题,按 Enter 发送"},hasMore:{type:Boolean,default:!0},emptyTitle:{default:"输入问题,开始与 AI 对话"},emptyDescription:{default:"回答内容由共享渲染层统一分发"},disabled:{type:Boolean,default:!1}},emits:["update:question","submit","stop","loadOlder","updateThinkingExpanded"],setup(t,{emit:c}){const s=t,n=c,i=()=>{s.hasMore&&n("loadOlder")},p=()=>{n("submit",{text:s.question})};return(r,l)=>(e.openBlock(),e.createElementBlock("section",$,[e.renderSlot(r.$slots,"messages",{},()=>[e.createVNode(x,{messages:t.messages,parsers:t.parsers,"output-file-config":t.outputFileConfig,loading:t.loading,"empty-title":t.emptyTitle,"empty-description":t.emptyDescription,onLoadOlder:i,onUpdateThinkingExpanded:l[0]||(l[0]=(d,b)=>n("updateThinkingExpanded",d,b))},null,8,["messages","parsers","output-file-config","loading","empty-title","empty-description"])],!0),e.renderSlot(r.$slots,"above-input",{},void 0,!0),e.createVNode(v,{"model-value":t.question,placeholder:t.placeholder,disabled:t.disabled||!t.session,"disabled-send":!t.question.trim(),talking:t.talking,"onUpdate:modelValue":l[1]||(l[1]=d=>n("update:question",d)),onSubmit:p,onStop:l[2]||(l[2]=d=>n("stop"))},null,8,["model-value","placeholder","disabled","disabled-send","talking"])]))}}),R=y(K,[["__scopeId","data-v-9bd22d00"]]);Object.defineProperty(exports,"AiAnswerBubble",{enumerable:!0,get:()=>o.AiAnswerBubble});Object.defineProperty(exports,"ClarificationCard",{enumerable:!0,get:()=>o.ClarificationCard});Object.defineProperty(exports,"DeepThinkingSteps",{enumerable:!0,get:()=>o.DeepThinkingSteps});Object.defineProperty(exports,"HostActionStatus",{enumerable:!0,get:()=>o.HostActionStatus});Object.defineProperty(exports,"IframePage",{enumerable:!0,get:()=>o.IframePage});Object.defineProperty(exports,"KnowledgeStreamResult",{enumerable:!0,get:()=>o.KnowledgeStreamResult});Object.defineProperty(exports,"OutputFile",{enumerable:!0,get:()=>o.OutputFile});Object.defineProperty(exports,"createAnswerContentMap",{enumerable:!0,get:()=>o.createAnswerContentMap});Object.defineProperty(exports,"injectIframeResizerChild",{enumerable:!0,get:()=>o.injectIframeResizerChild});Object.defineProperty(exports,"provideIframePageConfig",{enumerable:!0,get:()=>o.provideIframePageConfig});Object.defineProperty(exports,"provideOutputFileConfig",{enumerable:!0,get:()=>o.provideOutputFileConfig});Object.defineProperty(exports,"resolveIframePlaceholders",{enumerable:!0,get:()=>o.resolveIframePlaceholders});Object.defineProperty(exports,"useIframePage",{enumerable:!0,get:()=>o.useIframePage});exports.ChatContainer=R;exports.ChatMessagesView=x;exports.Inputbox=v;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|