@nocobase/plugin-ai 2.1.0-beta.29 → 2.1.0-beta.30
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/ai/docs/nocobase/api/cli/api/dynamic.md +7 -0
- package/dist/ai/docs/nocobase/api/cli/api/resource/index.md +3 -0
- package/dist/ai/docs/nocobase/api/cli/app/down.md +7 -3
- package/dist/ai/docs/nocobase/api/cli/app/index.md +1 -1
- package/dist/ai/docs/nocobase/api/cli/app/logs.md +3 -0
- package/dist/ai/docs/nocobase/api/cli/app/restart.md +4 -0
- package/dist/ai/docs/nocobase/api/cli/app/start.md +4 -0
- package/dist/ai/docs/nocobase/api/cli/app/stop.md +3 -0
- package/dist/ai/docs/nocobase/api/cli/app/upgrade.md +5 -0
- package/dist/ai/docs/nocobase/api/cli/env/add.md +11 -3
- package/dist/ai/docs/nocobase/api/cli/env/auth.md +1 -1
- package/dist/ai/docs/nocobase/api/cli/env/current.md +29 -0
- package/dist/ai/docs/nocobase/api/cli/env/index.md +22 -4
- package/dist/ai/docs/nocobase/api/cli/env/info.md +1 -5
- package/dist/ai/docs/nocobase/api/cli/env/list.md +11 -6
- package/dist/ai/docs/nocobase/api/cli/env/remove.md +4 -1
- package/dist/ai/docs/nocobase/api/cli/env/status.md +52 -0
- package/dist/ai/docs/nocobase/api/cli/env/update.md +1 -1
- package/dist/ai/docs/nocobase/api/cli/env/use.md +11 -1
- package/dist/ai/docs/nocobase/api/cli/index.md +13 -1
- package/dist/ai/docs/nocobase/api/cli/license/activate.md +4 -1
- package/dist/ai/docs/nocobase/api/cli/license/id.md +4 -0
- package/dist/ai/docs/nocobase/api/cli/license/plugins/clean.md +5 -1
- package/dist/ai/docs/nocobase/api/cli/license/plugins/list.md +4 -0
- package/dist/ai/docs/nocobase/api/cli/license/plugins/sync.md +5 -1
- package/dist/ai/docs/nocobase/api/cli/license/status.md +4 -0
- package/dist/ai/docs/nocobase/api/cli/plugin/disable.md +4 -0
- package/dist/ai/docs/nocobase/api/cli/plugin/enable.md +4 -0
- package/dist/ai/docs/nocobase/api/cli/plugin/list.md +4 -0
- package/dist/ai/docs/nocobase/api/cli/session/id.md +28 -0
- package/dist/ai/docs/nocobase/api/cli/session/index.md +41 -0
- package/dist/ai/docs/nocobase/api/cli/session/remove.md +35 -0
- package/dist/ai/docs/nocobase/api/cli/session/setup.md +47 -0
- package/dist/client/119.c6bf8c6433167d81.js +10 -0
- package/dist/client/228.b4b709f93b86b6b9.js +10 -0
- package/dist/client/{486.afbed6b132b3c0dd.js → 486.dcac8f3fcec19c33.js} +1 -1
- package/dist/client/597.b0d64948d74cf6cb.js +10 -0
- package/dist/client/646.5860101cb28c8272.js +10 -0
- package/dist/client/711.92cd94681fde7e05.js +10 -0
- package/dist/client/768.5177bff46ae71a5b.js +10 -0
- package/dist/client/792.abb57765453bcbcc.js +10 -0
- package/dist/client/820.f72ef2462b61d812.js +10 -0
- package/dist/client/927.ac9ee9a8c1cb4f1d.js +10 -0
- package/dist/client/ai-employees/chatbox/conversations/ConversationsList.d.ts +1 -15
- package/dist/client/ai-employees/chatbox/conversations/WorkflowTasksList.d.ts +1 -21
- package/dist/client/ai-employees/chatbox/hooks/useChat.d.ts +125 -0
- package/dist/client/ai-employees/chatbox/hooks/useChatBoxActions.d.ts +1 -1
- package/dist/client/ai-employees/chatbox/hooks/useChatConversationActions.d.ts +13 -1
- package/dist/client/ai-employees/chatbox/hooks/useChatMessageActions.d.ts +8 -8
- package/dist/client/ai-employees/chatbox/stores/chat-conversations.d.ts +4 -0
- package/dist/client/ai-employees/chatbox/stores/chat-messages.d.ts +77 -50
- package/dist/client/ai-employees/chatbox/stores/chat-tool-call.d.ts +24 -16
- package/dist/client/ai-employees/types.d.ts +1 -0
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.js +4 -4
- package/dist/externalVersion.js +16 -15
- package/dist/locale/en-US.json +1 -0
- package/dist/locale/zh-CN.json +1 -0
- package/dist/node_modules/@langchain/xai/package.json +1 -1
- package/dist/node_modules/fs-extra/package.json +1 -1
- package/dist/node_modules/jsonrepair/package.json +1 -1
- package/dist/node_modules/just-bash/package.json +1 -1
- package/dist/node_modules/nodejs-snowflake/package.json +1 -1
- package/dist/node_modules/openai/package.json +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/server/ai-employees/ai-conversations.d.ts +3 -1
- package/dist/server/ai-employees/ai-conversations.js +40 -3
- package/dist/server/ai-employees/ai-employee.d.ts +16 -14
- package/dist/server/ai-employees/ai-employee.js +65 -43
- package/dist/server/ai-employees/middleware/conversation.js +11 -9
- package/dist/server/collections/ai-conversations.js +6 -0
- package/dist/server/manager/llm-stream-manager.d.ts +37 -0
- package/dist/server/manager/llm-stream-manager.js +142 -0
- package/dist/server/plugin.d.ts +2 -0
- package/dist/server/plugin.js +3 -0
- package/dist/server/resource/aiConversations.d.ts +8 -0
- package/dist/server/resource/aiConversations.js +129 -2
- package/package.json +2 -2
- package/dist/client/119.78774f3ad953af49.js +0 -10
- package/dist/client/228.a3df2921c8beb766.js +0 -10
- package/dist/client/597.aa363881a325b5c0.js +0 -10
- package/dist/client/646.217a40387efbd163.js +0 -10
- package/dist/client/711.266b8f1c520d467a.js +0 -10
- package/dist/client/768.973ce32e15099a48.js +0 -10
- package/dist/client/792.2e48eab4767d662a.js +0 -10
- package/dist/client/820.6a26239ea96c075a.js +0 -10
- package/dist/client/927.ff5cd05b14901ae6.js +0 -10
|
@@ -8,6 +8,18 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { Conversation } from '../../types';
|
|
10
10
|
export declare const useChatConversationActions: () => {
|
|
11
|
-
conversationsService: import("@nocobase/client").UseRequestResult<
|
|
11
|
+
conversationsService: import("@nocobase/client").UseRequestResult<{
|
|
12
|
+
data: Conversation[];
|
|
13
|
+
meta: {
|
|
14
|
+
count: number;
|
|
15
|
+
page: number;
|
|
16
|
+
pageSize: number;
|
|
17
|
+
totalPage: number;
|
|
18
|
+
};
|
|
19
|
+
}>;
|
|
20
|
+
loadUnreadCounts: () => Promise<void>;
|
|
12
21
|
lastConversationRef: (node: HTMLElement) => void;
|
|
22
|
+
runSearch: (keyword?: string) => void;
|
|
23
|
+
refresh: () => void;
|
|
24
|
+
unreadCount: number;
|
|
13
25
|
};
|
|
@@ -6,21 +6,21 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
-
import { AIEmployee,
|
|
9
|
+
import { AIEmployee, ResendOptions, SendOptions } from '../../types';
|
|
10
10
|
import { ContextItem } from '../../types';
|
|
11
11
|
export declare const useChatMessageActions: () => {
|
|
12
12
|
syncContextAttachments: (items: ContextItem | ContextItem[]) => void;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
meta: {
|
|
16
|
-
cursor?: string;
|
|
17
|
-
hasMore?: boolean;
|
|
18
|
-
};
|
|
19
|
-
}>;
|
|
13
|
+
loadMessages: (sessionId?: string, cursor?: string) => Promise<void>;
|
|
14
|
+
loadMoreMessages: () => Promise<void>;
|
|
20
15
|
sendMessages: ({ sessionId, aiEmployee, systemMessage, messages: sendMsgs, attachments, workContext, editingMessageId, onConversationCreate, skillSettings, webSearch, model: inputModel, }: SendOptions & {
|
|
21
16
|
onConversationCreate?: (sessionId: string) => void;
|
|
22
17
|
}) => Promise<void>;
|
|
23
18
|
resendMessages: ({ sessionId, messageId, aiEmployee, important }: ResendOptions) => Promise<void>;
|
|
19
|
+
resumeStream: ({ sessionId, aiEmployee }: {
|
|
20
|
+
sessionId: string;
|
|
21
|
+
aiEmployee: AIEmployee;
|
|
22
|
+
}) => Promise<void>;
|
|
23
|
+
getConversationLLMActiveState: (sessionId: string) => Promise<string | undefined>;
|
|
24
24
|
cancelRequest: () => Promise<void>;
|
|
25
25
|
resumeToolCall: ({ sessionId, messageId, aiEmployee, toolCallIds, toolCallResults, }: {
|
|
26
26
|
sessionId: string;
|
|
@@ -13,6 +13,7 @@ interface ChatConversationsState {
|
|
|
13
13
|
keyword: string;
|
|
14
14
|
webSearch: boolean;
|
|
15
15
|
conversationSegmented: string;
|
|
16
|
+
unreadCount: number;
|
|
16
17
|
}
|
|
17
18
|
interface ChatConversationsActions {
|
|
18
19
|
setCurrentConversation: (id: string | undefined) => void;
|
|
@@ -20,6 +21,7 @@ interface ChatConversationsActions {
|
|
|
20
21
|
setConversations: (conversations: Conversation[] | ((prev: Conversation[]) => Conversation[])) => void;
|
|
21
22
|
setWebSearch: (webSearch: boolean) => void;
|
|
22
23
|
setConversationSegmented: (conversationSegmented: string) => void;
|
|
24
|
+
setUnreadCount: (unreadCount: number | ((prev: number) => number)) => void;
|
|
23
25
|
}
|
|
24
26
|
export declare const useChatConversationsStore: {
|
|
25
27
|
(): ChatConversationsState & ChatConversationsActions;
|
|
@@ -31,11 +33,13 @@ export declare const useChatConversationsStore: {
|
|
|
31
33
|
keyword: () => string;
|
|
32
34
|
webSearch: () => boolean;
|
|
33
35
|
conversationSegmented: () => string;
|
|
36
|
+
unreadCount: () => number;
|
|
34
37
|
setCurrentConversation: () => (id: string | undefined) => void;
|
|
35
38
|
setKeyword: () => (keyword: string) => void;
|
|
36
39
|
setConversations: () => (conversations: Conversation[] | ((prev: Conversation[]) => Conversation[])) => void;
|
|
37
40
|
setWebSearch: () => (webSearch: boolean) => void;
|
|
38
41
|
setConversationSegmented: () => (conversationSegmented: string) => void;
|
|
42
|
+
setUnreadCount: () => (unreadCount: number | ((prev: number) => number)) => void;
|
|
39
43
|
};
|
|
40
44
|
};
|
|
41
45
|
export {};
|
|
@@ -8,83 +8,110 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { Message, Attachment, ContextItem, SkillSettings, WebSearching } from '../../types';
|
|
10
10
|
import { EditorRef } from '@nocobase/client';
|
|
11
|
-
|
|
11
|
+
export declare const CHAT_DEFAULT_SESSION_KEY = "__draft__";
|
|
12
|
+
export declare const getChatSessionKey: (sessionId?: string) => string;
|
|
13
|
+
export type ChatSessionState = {
|
|
12
14
|
messages: Message[];
|
|
15
|
+
messagesLoading: boolean;
|
|
16
|
+
messagesError?: any;
|
|
17
|
+
messagesMeta: {
|
|
18
|
+
cursor?: string;
|
|
19
|
+
hasMore?: boolean;
|
|
20
|
+
};
|
|
13
21
|
attachments: Attachment[];
|
|
14
22
|
contextItems: ContextItem[];
|
|
15
23
|
systemMessage: string;
|
|
16
24
|
responseLoading: boolean;
|
|
17
25
|
abortController?: AbortController;
|
|
18
26
|
skillSettings?: SkillSettings;
|
|
27
|
+
webSearching?: WebSearching;
|
|
28
|
+
backgroundWorking: boolean;
|
|
29
|
+
resumeStreamFailed: boolean;
|
|
30
|
+
};
|
|
31
|
+
export declare const CHAT_EMPTY_SESSION_STATE: ChatSessionState;
|
|
32
|
+
type ChatMessagesState = {
|
|
33
|
+
sessions: Record<string, ChatSessionState>;
|
|
19
34
|
editorRef?: Record<string, EditorRef>;
|
|
20
35
|
currentEditorRefUid?: string;
|
|
21
|
-
webSearching?: WebSearching;
|
|
22
36
|
flowContext?: any;
|
|
23
37
|
};
|
|
38
|
+
type SessionStateUpdater<T> = T | ((prev: T) => T);
|
|
24
39
|
export interface ChatMessagesActions {
|
|
25
|
-
setMessages: (messages: Message[] | ((prev: Message[]) => Message[])) => void;
|
|
26
|
-
setAttachments: (attachments: Attachment[] | ((prev: Attachment[]) => Attachment[])) => void;
|
|
27
|
-
setContextItems: (items: ContextItem[] | ((prev: ContextItem[]) => ContextItem[])) => void;
|
|
28
|
-
setSystemMessage: (msg: string | ((prev: string) => string)) => void;
|
|
29
|
-
setResponseLoading: (loading: boolean) => void;
|
|
30
|
-
addMessage: (msg: Message) => void;
|
|
31
|
-
addMessages: (msgs: Message[]) => void;
|
|
32
|
-
updateLastMessage: (updater: (msg: Message) => Message) => void;
|
|
33
|
-
removeMessage: (key: string) => void;
|
|
34
|
-
addAttachments: (attachments: Attachment | Attachment[]) => void;
|
|
35
|
-
removeAttachment: (filename: string) => void;
|
|
36
|
-
addContextItems: (items: ContextItem | ContextItem[]) => void;
|
|
37
|
-
removeContextItem: (type: string, uid: string) => void;
|
|
38
|
-
setAbortController: (controller: AbortController | undefined) => void;
|
|
39
|
-
setSkillSettings: (settings: SkillSettings | undefined) => void;
|
|
40
40
|
setEditorRef: (uid: string, editorRef: EditorRef) => void;
|
|
41
41
|
setCurrentEditorRefUid: (uid: string) => void;
|
|
42
|
-
setWebSearching: (webSearching: WebSearching) => void;
|
|
43
42
|
setFlowContext: (ctx: any) => void;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
getSessionState: (sessionId?: string) => ChatSessionState;
|
|
44
|
+
resetSessionState: (sessionId?: string, patch?: Partial<ChatSessionState>) => void;
|
|
45
|
+
migrateSessionState: (fromSessionId: string | undefined, toSessionId: string) => void;
|
|
46
|
+
setSessionMessages: (sessionId: string | undefined, messages: SessionStateUpdater<Message[]>) => void;
|
|
47
|
+
setSessionMessagesLoading: (sessionId: string | undefined, loading: boolean) => void;
|
|
48
|
+
setSessionMessagesError: (sessionId: string | undefined, error: any) => void;
|
|
49
|
+
setSessionMessagesMeta: (sessionId: string | undefined, meta: ChatSessionState['messagesMeta'] | ((prev: ChatSessionState['messagesMeta']) => ChatSessionState['messagesMeta'])) => void;
|
|
50
|
+
setSessionAttachments: (sessionId: string | undefined, attachments: SessionStateUpdater<Attachment[]>) => void;
|
|
51
|
+
setSessionContextItems: (sessionId: string | undefined, items: SessionStateUpdater<ContextItem[]>) => void;
|
|
52
|
+
setSessionSystemMessage: (sessionId: string | undefined, msg: string | ((prev: string) => string)) => void;
|
|
53
|
+
setSessionResponseLoading: (sessionId: string | undefined, loading: boolean) => void;
|
|
54
|
+
setSessionBackgroundWorking: (sessionId: string | undefined, backgroundWorking: boolean) => void;
|
|
55
|
+
setSessionResumeStreamFailed: (sessionId: string | undefined, resumeStreamFailed: boolean) => void;
|
|
56
|
+
addSessionMessage: (sessionId: string | undefined, msg: Message) => void;
|
|
57
|
+
addSessionMessages: (sessionId: string | undefined, msgs: Message[]) => void;
|
|
58
|
+
updateSessionLastMessage: (sessionId: string | undefined, updater: (msg: Message) => Message) => void;
|
|
59
|
+
removeSessionMessage: (sessionId: string | undefined, key: string) => void;
|
|
60
|
+
addSessionAttachments: (sessionId: string | undefined, attachments: Attachment | Attachment[]) => void;
|
|
61
|
+
removeSessionAttachment: (sessionId: string | undefined, filename: string) => void;
|
|
62
|
+
addSessionContextItems: (sessionId: string | undefined, items: ContextItem | ContextItem[]) => void;
|
|
63
|
+
removeSessionContextItem: (sessionId: string | undefined, type: string, uid: string) => void;
|
|
64
|
+
setSessionAbortController: (sessionId: string | undefined, controller: AbortController | undefined) => void;
|
|
65
|
+
setSessionSkillSettings: (sessionId: string | undefined, settings: SkillSettings | undefined) => void;
|
|
66
|
+
setSessionWebSearching: (sessionId: string | undefined, webSearching: WebSearching) => void;
|
|
67
|
+
addSessionSubAgentMessage: (sessionId: string | undefined, subSessionId: string, msg: Message) => void;
|
|
68
|
+
addSessionSubAgentMessages: (sessionId: string | undefined, subSessionId: string, msgs: Message[]) => void;
|
|
69
|
+
updateSessionLastSubAgentMessage: (sessionId: string | undefined, subSessionId: string, username: string, updater: (msg: Message) => Message) => void;
|
|
70
|
+
updateSessionSubAgentConversationStatus: (sessionId: string | undefined, subSessionId: string, status: 'pending' | 'completed') => void;
|
|
48
71
|
}
|
|
49
72
|
export declare const useChatMessagesStore: {
|
|
50
73
|
(): ChatMessagesState & ChatMessagesActions;
|
|
51
74
|
<U>(selector: (state: ChatMessagesState & ChatMessagesActions) => U): U;
|
|
52
75
|
} & import("zustand").StoreApi<ChatMessagesState & ChatMessagesActions> & {
|
|
53
76
|
use: {
|
|
54
|
-
|
|
55
|
-
attachments: () => any[];
|
|
56
|
-
contextItems: () => ContextItem[];
|
|
57
|
-
systemMessage: () => string;
|
|
58
|
-
responseLoading: () => boolean;
|
|
59
|
-
abortController?: () => AbortController;
|
|
60
|
-
skillSettings?: () => SkillSettings;
|
|
77
|
+
sessions: () => Record<string, ChatSessionState>;
|
|
61
78
|
editorRef?: () => Record<string, EditorRef>;
|
|
62
79
|
currentEditorRefUid?: () => string;
|
|
63
|
-
webSearching?: () => WebSearching;
|
|
64
80
|
flowContext?: () => any;
|
|
65
|
-
setMessages: () => (messages: Message[] | ((prev: Message[]) => Message[])) => void;
|
|
66
|
-
setAttachments: () => (attachments: any[] | ((prev: Attachment[]) => Attachment[])) => void;
|
|
67
|
-
setContextItems: () => (items: ContextItem[] | ((prev: ContextItem[]) => ContextItem[])) => void;
|
|
68
|
-
setSystemMessage: () => (msg: string | ((prev: string) => string)) => void;
|
|
69
|
-
setResponseLoading: () => (loading: boolean) => void;
|
|
70
|
-
addMessage: () => (msg: Message) => void;
|
|
71
|
-
addMessages: () => (msgs: Message[]) => void;
|
|
72
|
-
updateLastMessage: () => (updater: (msg: Message) => Message) => void;
|
|
73
|
-
removeMessage: () => (key: string) => void;
|
|
74
|
-
addAttachments: () => (attachments: Attachment | Attachment[]) => void;
|
|
75
|
-
removeAttachment: () => (filename: string) => void;
|
|
76
|
-
addContextItems: () => (items: ContextItem | ContextItem[]) => void;
|
|
77
|
-
removeContextItem: () => (type: string, uid: string) => void;
|
|
78
|
-
setAbortController: () => (controller: AbortController | undefined) => void;
|
|
79
|
-
setSkillSettings: () => (settings: SkillSettings | undefined) => void;
|
|
80
81
|
setEditorRef: () => (uid: string, editorRef: EditorRef) => void;
|
|
81
82
|
setCurrentEditorRefUid: () => (uid: string) => void;
|
|
82
|
-
setWebSearching: () => (webSearching: WebSearching) => void;
|
|
83
83
|
setFlowContext: () => (ctx: any) => void;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
getSessionState: () => (sessionId?: string) => ChatSessionState;
|
|
85
|
+
resetSessionState: () => (sessionId?: string, patch?: Partial<ChatSessionState>) => void;
|
|
86
|
+
migrateSessionState: () => (fromSessionId: string | undefined, toSessionId: string) => void;
|
|
87
|
+
setSessionMessages: () => (sessionId: string | undefined, messages: SessionStateUpdater<Message[]>) => void;
|
|
88
|
+
setSessionMessagesLoading: () => (sessionId: string | undefined, loading: boolean) => void;
|
|
89
|
+
setSessionMessagesError: () => (sessionId: string | undefined, error: any) => void;
|
|
90
|
+
setSessionMessagesMeta: () => (sessionId: string | undefined, meta: {
|
|
91
|
+
cursor?: string;
|
|
92
|
+
hasMore?: boolean;
|
|
93
|
+
} | ((prev: ChatSessionState['messagesMeta']) => ChatSessionState['messagesMeta'])) => void;
|
|
94
|
+
setSessionAttachments: () => (sessionId: string | undefined, attachments: SessionStateUpdater<Attachment[]>) => void;
|
|
95
|
+
setSessionContextItems: () => (sessionId: string | undefined, items: SessionStateUpdater<ContextItem[]>) => void;
|
|
96
|
+
setSessionSystemMessage: () => (sessionId: string | undefined, msg: string | ((prev: string) => string)) => void;
|
|
97
|
+
setSessionResponseLoading: () => (sessionId: string | undefined, loading: boolean) => void;
|
|
98
|
+
setSessionBackgroundWorking: () => (sessionId: string | undefined, backgroundWorking: boolean) => void;
|
|
99
|
+
setSessionResumeStreamFailed: () => (sessionId: string | undefined, resumeStreamFailed: boolean) => void;
|
|
100
|
+
addSessionMessage: () => (sessionId: string | undefined, msg: Message) => void;
|
|
101
|
+
addSessionMessages: () => (sessionId: string | undefined, msgs: Message[]) => void;
|
|
102
|
+
updateSessionLastMessage: () => (sessionId: string | undefined, updater: (msg: Message) => Message) => void;
|
|
103
|
+
removeSessionMessage: () => (sessionId: string | undefined, key: string) => void;
|
|
104
|
+
addSessionAttachments: () => (sessionId: string | undefined, attachments: Attachment | Attachment[]) => void;
|
|
105
|
+
removeSessionAttachment: () => (sessionId: string | undefined, filename: string) => void;
|
|
106
|
+
addSessionContextItems: () => (sessionId: string | undefined, items: ContextItem | ContextItem[]) => void;
|
|
107
|
+
removeSessionContextItem: () => (sessionId: string | undefined, type: string, uid: string) => void;
|
|
108
|
+
setSessionAbortController: () => (sessionId: string | undefined, controller: AbortController | undefined) => void;
|
|
109
|
+
setSessionSkillSettings: () => (sessionId: string | undefined, settings: SkillSettings | undefined) => void;
|
|
110
|
+
setSessionWebSearching: () => (sessionId: string | undefined, webSearching: WebSearching) => void;
|
|
111
|
+
addSessionSubAgentMessage: () => (sessionId: string | undefined, subSessionId: string, msg: Message) => void;
|
|
112
|
+
addSessionSubAgentMessages: () => (sessionId: string | undefined, subSessionId: string, msgs: Message[]) => void;
|
|
113
|
+
updateSessionLastSubAgentMessage: () => (sessionId: string | undefined, subSessionId: string, username: string, updater: (msg: Message) => Message) => void;
|
|
114
|
+
updateSessionSubAgentConversationStatus: () => (sessionId: string | undefined, subSessionId: string, status: 'pending' | 'completed') => void;
|
|
88
115
|
};
|
|
89
116
|
};
|
|
90
117
|
export {};
|
|
@@ -6,31 +6,39 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
+
type ToolCallInvokeState = {
|
|
10
|
+
id: string;
|
|
11
|
+
invokeStatus: string;
|
|
12
|
+
};
|
|
13
|
+
export type ChatToolCallSessionState = {
|
|
14
|
+
toolCalls: Record<string, ToolCallInvokeState[]>;
|
|
15
|
+
};
|
|
16
|
+
export declare const CHAT_EMPTY_TOOL_CALL_SESSION_STATE: ChatToolCallSessionState;
|
|
9
17
|
type ChatToolCallState = {
|
|
10
|
-
|
|
11
|
-
id: string;
|
|
12
|
-
invokeStatus: string;
|
|
13
|
-
}[]>;
|
|
18
|
+
sessions: Record<string, ChatToolCallSessionState>;
|
|
14
19
|
};
|
|
15
20
|
export interface ChatToolCallActions {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
getSessionState: (sessionId: string) => ChatToolCallSessionState;
|
|
22
|
+
resetSessionState: (sessionId: string) => void;
|
|
23
|
+
migrateSessionState: (fromSessionId: string, toSessionId: string) => void;
|
|
24
|
+
updateToolCallInvokeStatus: (sessionId: string, messageId: string, toolCallId: string, invokeStatus: string) => void;
|
|
25
|
+
isAllWaiting: (sessionId: string, messageId: string) => boolean;
|
|
26
|
+
isInterrupted: (sessionId: string, messageId: string, toolCallId: string) => boolean;
|
|
27
|
+
getInvokeStatus: (sessionId: string, messageId: string, toolCallId: string) => string | undefined;
|
|
20
28
|
}
|
|
21
29
|
export declare const useChatToolCallStore: {
|
|
22
30
|
(): ChatToolCallState & ChatToolCallActions;
|
|
23
31
|
<U>(selector: (state: ChatToolCallState & ChatToolCallActions) => U): U;
|
|
24
32
|
} & import("zustand").StoreApi<ChatToolCallState & ChatToolCallActions> & {
|
|
25
33
|
use: {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
updateToolCallInvokeStatus: () => (messageId: string, toolCallId: string, invokeStatus: string) => void;
|
|
31
|
-
isAllWaiting: () => (messageId: string) => boolean;
|
|
32
|
-
isInterrupted: () => (messageId: string, toolCallId: string) => boolean;
|
|
33
|
-
getInvokeStatus: () => (messageId: string, toolCallId: string) => string;
|
|
34
|
+
sessions: () => Record<string, ChatToolCallSessionState>;
|
|
35
|
+
getSessionState: () => (sessionId: string) => ChatToolCallSessionState;
|
|
36
|
+
resetSessionState: () => (sessionId: string) => void;
|
|
37
|
+
migrateSessionState: () => (fromSessionId: string, toSessionId: string) => void;
|
|
38
|
+
updateToolCallInvokeStatus: () => (sessionId: string, messageId: string, toolCallId: string, invokeStatus: string) => void;
|
|
39
|
+
isAllWaiting: () => (sessionId: string, messageId: string) => boolean;
|
|
40
|
+
isInterrupted: () => (sessionId: string, messageId: string, toolCallId: string) => boolean;
|
|
41
|
+
getInvokeStatus: () => (sessionId: string, messageId: string, toolCallId: string) => string | undefined;
|
|
34
42
|
};
|
|
35
43
|
};
|
|
36
44
|
export {};
|
package/dist/client/index.d.ts
CHANGED
|
@@ -30,8 +30,10 @@ export type { AIEmployee, ToolCall } from './ai-employees/types';
|
|
|
30
30
|
export * from './features';
|
|
31
31
|
export { AIEmployeeActionModel } from './ai-employees/flow/models/AIEmployeeActionModel';
|
|
32
32
|
export { useChatMessagesStore } from './ai-employees/chatbox/stores/chat-messages';
|
|
33
|
+
export { useChat } from './ai-employees/chatbox/hooks/useChat';
|
|
33
34
|
export { useChatBoxStore } from './ai-employees/chatbox/stores/chat-box';
|
|
34
35
|
export { useChatBoxActions } from './ai-employees/chatbox/hooks/useChatBoxActions';
|
|
36
|
+
export { useChatConversationsStore } from './ai-employees/chatbox/stores/chat-conversations';
|
|
35
37
|
export { useAIConfigRepository } from './repositories/hooks/useAIConfigRepository';
|
|
36
38
|
export { ProfileCard } from './ai-employees/ProfileCard';
|
|
37
39
|
export { avatars } from './ai-employees/avatars';
|