@nocobase/plugin-ai 2.2.0-alpha.11 → 2.2.0-alpha.12
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/ai-employees/block/ai-chat-box.md +133 -0
- package/dist/ai/docs/nocobase/ai-employees/knowledge-base/knowledge-base/documents.md +1 -1
- package/dist/ai/docs/nocobase/ai-employees/knowledge-base/knowledge-base/index.md +11 -7
- package/dist/ai/docs/nocobase/ai-employees/knowledge-base/knowledge-base/settings.md +12 -8
- package/dist/ai/docs/nocobase/ai-employees/knowledge-base/vector-database.md +3 -3
- package/dist/ai/docs/nocobase/ai-employees/workflow/nodes/knowledge/create-document.md +1 -1
- package/dist/ai/docs/nocobase/ops-management/migration-manager/built-in-tables.md +1 -2
- package/dist/ai/docs/nocobase/runjs/context/ai.md +194 -4
- package/dist/ai/tools/getSkill.js +1 -1
- package/dist/client/244.8631eb5cf3f05e21.js +10 -0
- package/dist/client/681.6ffbc9329b9ac242.js +10 -0
- package/dist/client/index.d.ts +1 -3
- package/dist/client/index.js +8 -8
- package/dist/client-v2/244.c428e645ecb94414.js +10 -0
- package/dist/client-v2/420.b2aedb1ff71fca0e.js +10 -0
- package/dist/client-v2/681.6890caa389564ff7.js +10 -0
- package/dist/client-v2/ai-employees/AIEmployeeShortcut.d.ts +2 -0
- package/dist/client-v2/ai-employees/AddContextButton.d.ts +2 -0
- package/dist/client-v2/ai-employees/chatbox/components/AIEmployeeSwitcher.d.ts +1 -0
- package/dist/client-v2/ai-employees/chatbox/components/ChatBoxUnreadBadge.d.ts +17 -0
- package/dist/client-v2/ai-employees/chatbox/components/Conversations.d.ts +9 -1
- package/dist/client-v2/ai-employees/chatbox/components/MessageRenderers.d.ts +1 -1
- package/dist/client-v2/ai-employees/chatbox/components/Messages.d.ts +5 -1
- package/dist/client-v2/ai-employees/chatbox/components/ModelSwitcher.d.ts +4 -0
- package/dist/client-v2/ai-employees/chatbox/components/Sender.d.ts +33 -1
- package/dist/client-v2/ai-employees/chatbox/components/index.d.ts +1 -0
- package/dist/client-v2/ai-employees/chatbox/hooks/useChat.d.ts +8 -5
- package/dist/client-v2/ai-employees/chatbox/hooks/useChatBoxActions.d.ts +3 -2
- package/dist/client-v2/ai-employees/chatbox/hooks/useChatBoxEffect.d.ts +2 -1
- package/dist/client-v2/ai-employees/chatbox/hooks/useChatConversationActions.d.ts +3 -2
- package/dist/client-v2/ai-employees/chatbox/hooks/useChatMessageActions.d.ts +4 -2
- package/dist/client-v2/ai-employees/chatbox/hooks/useToolCallActions.d.ts +3 -1
- package/dist/client-v2/ai-employees/chatbox/hooks/useUploadFiles.d.ts +13 -3
- package/dist/client-v2/ai-employees/chatbox/hooks/useWorkflowTasks.d.ts +3 -2
- package/dist/client-v2/ai-employees/chatbox/index.d.ts +17 -0
- package/dist/client-v2/ai-employees/chatbox/roles.d.ts +2 -153
- package/dist/client-v2/ai-employees/chatbox/stores/chat-box.d.ts +46 -31
- package/dist/client-v2/ai-employees/chatbox/stores/chat-conversations.d.ts +7 -7
- package/dist/client-v2/ai-employees/chatbox/stores/chat-messages.d.ts +23 -18
- package/dist/client-v2/ai-employees/chatbox/stores/chat-sender.d.ts +43 -0
- package/dist/client-v2/ai-employees/chatbox/stores/chat-tool-call.d.ts +6 -5
- package/dist/client-v2/ai-employees/chatbox/stores/chat-tools.d.ts +11 -5
- package/dist/client-v2/ai-employees/chatbox/stores/mounted-chat-boxes.d.ts +20 -0
- package/dist/client-v2/ai-employees/chatbox/stores/runtime.d.ts +43 -0
- package/dist/client-v2/ai-employees/chatbox/stores/workflow-tasks.d.ts +22 -10
- package/dist/client-v2/ai-employees/chatbox/upload.d.ts +19 -0
- package/dist/client-v2/ai-employees/chatbox/utils.d.ts +28 -4
- package/dist/client-v2/ai-employees/tools/SuggestionsOptionsCard.d.ts +1 -1
- package/dist/client-v2/ai-employees/tools/WorkflowTaskOutputCard.d.ts +1 -1
- package/dist/client-v2/ai-employees/types.d.ts +27 -0
- package/dist/client-v2/block/ai-chat-box/AIChatBoxBlockModel.d.ts +21 -0
- package/dist/client-v2/block/ai-chat-box/AIChatBoxCoreModel.d.ts +13 -0
- package/dist/client-v2/block/ai-chat-box/components/AIChatBoxCoreView.d.ts +10 -0
- package/dist/client-v2/block/ai-chat-box/components/AIChatBoxView.d.ts +12 -0
- package/dist/client-v2/block/ai-chat-box/index.d.ts +14 -0
- package/dist/client-v2/block/ai-chat-box/settings.d.ts +12 -0
- package/dist/client-v2/block/ai-chat-box/sub-models.d.ts +26 -0
- package/dist/client-v2/block/ai-chat-box/types.d.ts +38 -0
- package/dist/client-v2/block/ai-chat-box/utils.d.ts +26 -0
- package/dist/client-v2/index.d.ts +3 -5
- package/dist/client-v2/index.js +3 -3
- package/dist/client-v2/llm-services/model-select.d.ts +33 -0
- package/dist/client-v2/llm-services/utils.d.ts +1 -0
- package/dist/client-v2/manager/ai-manager.d.ts +8 -3
- package/dist/client-v2/models/ai-employees/AIEmployeeActionModel.d.ts +4 -1
- package/dist/client-v2/models/ai-employees/AIEmployeeShortcutModel.d.ts +5 -0
- package/dist/client-v2/pages/EmployeesPage.d.ts +1 -0
- package/dist/client-v2/runjs/registerAIEmployeeRunJSFacade.d.ts +1 -0
- package/dist/common/ai-employee-validation.d.ts +15 -0
- package/dist/common/ai-employee-validation.js +61 -0
- package/dist/common/error-codes.d.ts +13 -0
- package/dist/common/error-codes.js +48 -0
- package/dist/common/llm-service-models.d.ts +16 -0
- package/dist/common/llm-service-models.js +84 -0
- package/dist/externalVersion.js +15 -15
- package/dist/locale/en-US.json +62 -0
- package/dist/locale/zh-CN.json +62 -0
- package/dist/node_modules/@langchain/mistralai/package.json +1 -1
- 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 +2 -1
- package/dist/server/ai-employees/ai-conversations.js +2 -0
- package/dist/server/ai-employees/ai-employee.d.ts +1 -0
- package/dist/server/ai-employees/ai-employee.js +6 -0
- package/dist/server/ai-employees/middleware/conversation.js +9 -2
- package/dist/server/collections/ai-conversations.js +5 -0
- package/dist/server/document-loader/constants.js +0 -1
- package/dist/server/plugin.d.ts +1 -0
- package/dist/server/plugin.js +25 -0
- package/dist/server/resource/aiConversations.js +6 -2
- package/dist/server/resource/aiEmployees.d.ts +2 -0
- package/dist/server/resource/aiEmployees.js +62 -0
- package/dist/server/resource/aiWorkflowTasks.js +9 -1
- package/dist/server/resource/llmServices.d.ts +11 -0
- package/dist/server/resource/llmServices.js +85 -0
- package/dist/server/types/knowledge-base.type.d.ts +6 -2
- package/dist/swagger/common.d.ts +143 -0
- package/dist/swagger/common.js +144 -0
- package/dist/swagger/employees.d.ts +301 -0
- package/dist/swagger/employees.js +131 -0
- package/dist/swagger/index.d.ts +1588 -0
- package/dist/swagger/index.js +62 -0
- package/dist/swagger/llm.d.ts +555 -0
- package/dist/swagger/llm.js +247 -0
- package/dist/swagger/schemas.d.ts +736 -0
- package/dist/swagger/schemas.js +381 -0
- package/package.json +2 -2
- package/dist/ai/docs/nocobase/ai-employees/knowledge-base/vector-store.md +0 -24
- package/dist/client/372.49163fac65cef81c.js +0 -10
- package/dist/client/681.399948c18d753667.js +0 -10
- package/dist/client-v2/372.387161cdeb106987.js +0 -10
- package/dist/client-v2/406.341be51205c674e0.js +0 -10
- package/dist/client-v2/681.082f4f1c7b841983.js +0 -10
- package/dist/client-v2/ai-employees/chatbox/stores/create-selectors.d.ts +0 -46
- package/dist/client-v2/ai-employees/chatbox/utils/normalizeTriggerTaskOptions.d.ts +0 -19
|
@@ -6,12 +6,36 @@
|
|
|
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 {
|
|
10
|
-
|
|
9
|
+
import type { APIClient } from '@nocobase/client-v2';
|
|
10
|
+
import type { AIConfigRepository } from '../../repositories/AIConfigRepository';
|
|
11
|
+
import { ContextItem, SkillSettings, TaskMessage, Message, type AIEmployee, type Task, type TriggerTaskOptions } from '../types';
|
|
12
|
+
export type RunJSAIEmployeeTriggerTaskOptions = Omit<TriggerTaskOptions, 'aiEmployee'> & {
|
|
13
|
+
aiEmployee?: string | AIEmployee;
|
|
14
|
+
};
|
|
15
|
+
export type NormalizeTriggerTaskOptionsContext = {
|
|
16
|
+
aiConfigRepository?: Pick<AIConfigRepository, 'getAIEmployees'> | null;
|
|
17
|
+
apiClient?: Pick<APIClient, 'resource'> | null;
|
|
18
|
+
};
|
|
19
|
+
export declare const getTargetChatBoxUid: (tasks?: Task[]) => string;
|
|
20
|
+
export declare function normalizeTriggerTaskOptions(options: RunJSAIEmployeeTriggerTaskOptions, context?: NormalizeTriggerTaskOptionsContext): Promise<TriggerTaskOptions | null>;
|
|
21
|
+
export declare function normalizeAIFileUploadAttachment<T extends Record<string, unknown>>(fileData: T, status?: string): T & {
|
|
22
|
+
filename?: string;
|
|
11
23
|
source?: Record<string, unknown>;
|
|
12
|
-
status
|
|
24
|
+
status?: string;
|
|
25
|
+
};
|
|
26
|
+
export declare function normalizeAIFileUploadAttachment<T>(fileData: T, status?: string): T;
|
|
27
|
+
export declare const AI_EMPLOYEE_ATTACHMENT_COUNT_LIMIT = 10;
|
|
28
|
+
export declare const AI_EMPLOYEE_ATTACHMENT_SIZE_LIMIT_DEFAULT: number;
|
|
29
|
+
export type AttachmentLimitViolation = {
|
|
30
|
+
type: 'count';
|
|
31
|
+
limit: number;
|
|
32
|
+
} | {
|
|
33
|
+
type: 'size';
|
|
34
|
+
limit: number;
|
|
13
35
|
};
|
|
14
|
-
export declare function
|
|
36
|
+
export declare function resolveStorageSizeLimit(rules: unknown): number;
|
|
37
|
+
export declare function validateAIEmployeeAttachmentLimits(attachments: unknown[], sizeLimit: number): AttachmentLimitViolation | null;
|
|
38
|
+
export declare function formatAttachmentSizeLimit(size: number): string;
|
|
15
39
|
export declare function isCurrentLiveMessage(latestMessageId: string | undefined, messageId?: string, toolCallMessageId?: unknown): boolean;
|
|
16
40
|
export declare const parseTask: (task: {
|
|
17
41
|
message?: TaskMessage;
|
|
@@ -12,5 +12,5 @@ type SuggestionsArgs = {
|
|
|
12
12
|
options?: string[] | string;
|
|
13
13
|
[key: string]: unknown;
|
|
14
14
|
};
|
|
15
|
-
export declare const SuggestionsOptionsCard: React.
|
|
15
|
+
export declare const SuggestionsOptionsCard: React.MemoExoticComponent<import("@formily/reactive-react").ReactFC<ToolsUIProperties<SuggestionsArgs>>>;
|
|
16
16
|
export {};
|
|
@@ -12,5 +12,5 @@ type WorkflowTaskOutputArgs = {
|
|
|
12
12
|
result?: Record<string, unknown>;
|
|
13
13
|
[key: string]: unknown;
|
|
14
14
|
};
|
|
15
|
-
export declare const WorkflowTaskOutputCard: React.
|
|
15
|
+
export declare const WorkflowTaskOutputCard: React.MemoExoticComponent<import("@formily/reactive-react").ReactFC<ToolsUIProperties<WorkflowTaskOutputArgs>>>;
|
|
16
16
|
export {};
|
|
@@ -139,13 +139,36 @@ export type ToolCall<T = unknown> = {
|
|
|
139
139
|
[key: string]: unknown;
|
|
140
140
|
};
|
|
141
141
|
export type Attachment = {
|
|
142
|
+
id?: string | number;
|
|
143
|
+
uid?: string;
|
|
144
|
+
name?: string;
|
|
142
145
|
filename?: string;
|
|
146
|
+
url?: string;
|
|
147
|
+
preview?: string;
|
|
148
|
+
thumbUrl?: string;
|
|
149
|
+
size?: number;
|
|
150
|
+
mimetype?: string;
|
|
151
|
+
type?: string;
|
|
152
|
+
percent?: number;
|
|
143
153
|
status?: string;
|
|
154
|
+
source?: {
|
|
155
|
+
dataSourceKey?: string;
|
|
156
|
+
collectionName?: string;
|
|
157
|
+
field?: string;
|
|
158
|
+
};
|
|
159
|
+
meta?: {
|
|
160
|
+
source?: Attachment['source'];
|
|
161
|
+
[key: string]: unknown;
|
|
162
|
+
};
|
|
144
163
|
response?: {
|
|
145
164
|
data?: Attachment;
|
|
146
165
|
};
|
|
147
166
|
[key: string]: unknown;
|
|
148
167
|
};
|
|
168
|
+
export type UploadAIFileOptions = {
|
|
169
|
+
onProgress?: (percent: number) => void;
|
|
170
|
+
signal?: AbortSignal;
|
|
171
|
+
};
|
|
149
172
|
export type MessageType = 'text' | 'greeting';
|
|
150
173
|
export type Message = Omit<BubbleProps, 'content'> & {
|
|
151
174
|
key?: string | number;
|
|
@@ -195,6 +218,7 @@ export type TaskMessage = {
|
|
|
195
218
|
};
|
|
196
219
|
export type Task = {
|
|
197
220
|
title?: string;
|
|
221
|
+
chatBoxUid?: string;
|
|
198
222
|
message?: TaskMessage;
|
|
199
223
|
autoSend?: boolean;
|
|
200
224
|
skillSettings?: SkillSettings;
|
|
@@ -207,8 +231,10 @@ export type Task = {
|
|
|
207
231
|
export type TriggerTaskOptions = {
|
|
208
232
|
aiEmployee?: AIEmployee;
|
|
209
233
|
tasks?: Task[];
|
|
234
|
+
chatBoxUid?: string;
|
|
210
235
|
auto?: boolean;
|
|
211
236
|
open?: boolean;
|
|
237
|
+
onResponseLoadingChange?: (loading: boolean) => void;
|
|
212
238
|
};
|
|
213
239
|
export type SendOptions = {
|
|
214
240
|
sessionId?: string;
|
|
@@ -227,6 +253,7 @@ export type SendOptions = {
|
|
|
227
253
|
llmService: string;
|
|
228
254
|
model: string;
|
|
229
255
|
} | null;
|
|
256
|
+
onResponseLoadingChange?: (loading: boolean) => void;
|
|
230
257
|
};
|
|
231
258
|
export type ResendOptions = {
|
|
232
259
|
sessionId: string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { BlockModel } from '@nocobase/client-v2';
|
|
11
|
+
import { type ChatBoxRuntime } from '../../ai-employees/chatbox/stores/runtime';
|
|
12
|
+
import type { AIChatBoxBlockProps, AIChatBoxBlockStructure } from './types';
|
|
13
|
+
export declare class AIChatBoxBlockModel extends BlockModel<AIChatBoxBlockStructure> {
|
|
14
|
+
props: AIChatBoxBlockProps;
|
|
15
|
+
chatBoxRuntime?: ChatBoxRuntime;
|
|
16
|
+
afterAddAsSubModel(): Promise<void>;
|
|
17
|
+
renderComponent(): React.JSX.Element;
|
|
18
|
+
renderActions(): React.JSX.Element;
|
|
19
|
+
renderConfigureActions(): React.JSX.Element;
|
|
20
|
+
renderConfigureItems(): React.JSX.Element;
|
|
21
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { FlowModel } from '@nocobase/flow-engine';
|
|
11
|
+
export declare class AIChatBoxCoreModel extends FlowModel {
|
|
12
|
+
render(): React.JSX.Element;
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
export declare const AIChatBoxCoreView: React.FC;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
export declare const AI_CHAT_BOX_CORE_MIN_WIDTH = 400;
|
|
11
|
+
export declare const AI_CHAT_BOX_CORE_MIN_HEIGHT = 420;
|
|
12
|
+
export declare const AIChatBoxView: React.FC;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export { AIChatBoxBlockModel } from './AIChatBoxBlockModel';
|
|
10
|
+
export { AIChatBoxCoreModel } from './AIChatBoxCoreModel';
|
|
11
|
+
export { AIChatBoxActionGroupModel, AIChatBoxItemGroupModel } from './sub-models';
|
|
12
|
+
export { AI_CHAT_BOX_BLOCK_SETTINGS_FLOW_KEY } from './settings';
|
|
13
|
+
export { getAIChatBoxConversationScope, getAIChatBoxCreateScope, getAIChatBoxSettings, getAIChatBoxWorkContext, getDefaultAIChatBoxSettings, normalizeAIChatBoxScopeForSave, normalizeAIChatBoxWorkContext, } from './utils';
|
|
14
|
+
export type { AIChatBoxBlockProps, AIChatBoxBlockStructure, AIChatBoxSettings } from './types';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export declare const AI_CHAT_BOX_BLOCK_SETTINGS_FLOW_KEY = "aiChatBoxBlockSettings";
|
|
10
|
+
type AIChatBoxBlockModelConstructor = typeof import('./AIChatBoxBlockModel').AIChatBoxBlockModel;
|
|
11
|
+
export declare const registerAIChatBoxBlockSettings: (ModelClass: AIChatBoxBlockModelConstructor) => void;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { ActionGroupModel, ActionModel } from '@nocobase/client-v2';
|
|
11
|
+
import { FlowModel, type FlowModelContext, type SubModelItem } from '@nocobase/flow-engine';
|
|
12
|
+
import type { AIChatBoxBlockModel } from './AIChatBoxBlockModel';
|
|
13
|
+
export declare const AI_CHAT_BOX_ACTION_MODEL_NAMES: readonly ["JSActionModel", "AIEmployeeActionModel"];
|
|
14
|
+
export declare const AI_CHAT_BOX_ITEM_MODEL_NAMES: readonly ["JSBlockModel", "IframeBlockModel", "MarkdownBlockModel"];
|
|
15
|
+
export declare const isAIChatBoxCoreModel: (model: FlowModel) => boolean;
|
|
16
|
+
export declare class AIChatBoxItemGroupModel extends FlowModel {
|
|
17
|
+
static defineChildren(ctx: FlowModelContext): Promise<SubModelItem[]>;
|
|
18
|
+
}
|
|
19
|
+
export declare class AIChatBoxActionGroupModel extends ActionGroupModel {
|
|
20
|
+
static baseClass: typeof ActionModel;
|
|
21
|
+
static defineChildren(ctx: FlowModelContext): Promise<SubModelItem[]>;
|
|
22
|
+
}
|
|
23
|
+
export declare const moveAddedItemBeforeCore: (model: AIChatBoxBlockModel, addedModel: FlowModel) => Promise<void>;
|
|
24
|
+
export declare const renderAIChatBoxActions: (model: AIChatBoxBlockModel) => React.JSX.Element;
|
|
25
|
+
export declare const renderAIChatBoxConfigureActions: (model: AIChatBoxBlockModel) => React.JSX.Element;
|
|
26
|
+
export declare const renderAIChatBoxConfigureItems: (model: AIChatBoxBlockModel) => React.JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import type { ActionModel } from '@nocobase/client-v2';
|
|
10
|
+
import type { FlowModel } from '@nocobase/flow-engine';
|
|
11
|
+
import type { ContextItem } from '../../ai-employees/types';
|
|
12
|
+
export type AIChatBoxBlockStructure = {
|
|
13
|
+
subModels: {
|
|
14
|
+
items: FlowModel[];
|
|
15
|
+
actions: ActionModel[];
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export type AIChatBoxBlockProps = {
|
|
19
|
+
minWidth?: number;
|
|
20
|
+
height?: number;
|
|
21
|
+
showMessages?: boolean;
|
|
22
|
+
scope?: string;
|
|
23
|
+
systemPrompt?: string;
|
|
24
|
+
defaultUserMessage?: string;
|
|
25
|
+
workContext?: ContextItem[];
|
|
26
|
+
allowedAIEmployees?: string[];
|
|
27
|
+
allowedModels?: string[];
|
|
28
|
+
senderPlaceholder?: string;
|
|
29
|
+
showContextSelector?: boolean;
|
|
30
|
+
showUpload?: boolean;
|
|
31
|
+
showWebSearch?: boolean;
|
|
32
|
+
showEmployeeSelect?: boolean;
|
|
33
|
+
showModelSelect?: boolean;
|
|
34
|
+
showDisclaimer?: boolean;
|
|
35
|
+
};
|
|
36
|
+
export type AIChatBoxSettings = Required<Pick<AIChatBoxBlockProps, 'showMessages' | 'minWidth' | 'height' | 'systemPrompt' | 'defaultUserMessage' | 'workContext' | 'allowedAIEmployees' | 'allowedModels' | 'senderPlaceholder' | 'showContextSelector' | 'showUpload' | 'showWebSearch' | 'showEmployeeSelect' | 'showModelSelect' | 'showDisclaimer'>> & {
|
|
37
|
+
scope?: string;
|
|
38
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import type { ContextItem } from '../../ai-employees/types';
|
|
10
|
+
import type { AIChatBoxBlockModel } from './AIChatBoxBlockModel';
|
|
11
|
+
import type { AIChatBoxBlockProps, AIChatBoxSettings } from './types';
|
|
12
|
+
type AIChatBoxScopeRenderContext = {
|
|
13
|
+
resolveJsonTemplate?: (template: string) => unknown | Promise<unknown>;
|
|
14
|
+
};
|
|
15
|
+
export declare const DEFAULT_AI_CHAT_BOX_WIDTH = 400;
|
|
16
|
+
export declare const DEFAULT_AI_CHAT_BOX_HEIGHT = 650;
|
|
17
|
+
export declare const getDefaultAIChatBoxSettings: () => AIChatBoxSettings;
|
|
18
|
+
export declare const getAIChatBoxSettings: (props?: AIChatBoxBlockProps) => AIChatBoxSettings;
|
|
19
|
+
export declare const normalizeAIChatBoxHeight: (height: unknown) => number;
|
|
20
|
+
export declare const getAIChatBoxConversationScope: (model: AIChatBoxBlockModel) => string;
|
|
21
|
+
export declare const getAIChatBoxCreateScope: (model: AIChatBoxBlockModel) => string;
|
|
22
|
+
export declare const renderAIChatBoxScope: (scope: string | undefined, ctx?: AIChatBoxScopeRenderContext) => Promise<string>;
|
|
23
|
+
export declare const normalizeAIChatBoxScopeForSave: (scope: string | undefined) => string;
|
|
24
|
+
export declare const normalizeAIChatBoxWorkContext: (workContext: ContextItem[] | undefined) => ContextItem[];
|
|
25
|
+
export declare const getAIChatBoxWorkContext: (model: AIChatBoxBlockModel) => ContextItem[];
|
|
26
|
+
export {};
|
|
@@ -13,18 +13,16 @@ export { AddContextButton } from './ai-employees/AddContextButton';
|
|
|
13
13
|
export { AISelection } from './ai-employees/AISelection';
|
|
14
14
|
export { AISelectionControl } from './ai-employees/AISelectionControl';
|
|
15
15
|
export { avatars, avatarsMap } from './ai-employees/avatars';
|
|
16
|
-
export type { AIEmployee, Attachment, ChatEditorRef, ContextItem, Conversation, Message, SkillSettings, Task, TriggerTaskOptions, WebSearching, } from './ai-employees/types';
|
|
16
|
+
export type { AIEmployee, Attachment, ChatEditorRef, ContextItem, Conversation, Message, SkillSettings, Task, TriggerTaskOptions, UploadAIFileOptions, WebSearching, } from './ai-employees/types';
|
|
17
17
|
export { formatModelLabel } from './llm-services/model-label';
|
|
18
18
|
export { createModelSettingsForm, ModelSelect, OptionsFields, type OptionField } from './llm-providers/forms';
|
|
19
19
|
export { AIConfigRepository, type LLMServiceItem } from './repositories/AIConfigRepository';
|
|
20
20
|
export { AIPluginFeatureManagerImpl } from './manager/ai-feature-manager';
|
|
21
21
|
export { AIManager } from './manager/ai-manager';
|
|
22
|
-
export type { LLMProviderOptions, ToolModalProps, ToolOptions } from './manager/ai-manager';
|
|
22
|
+
export type { LLMProviderOptions, ToolModalProps, ToolOptions, TriggerModelTaskOptions } from './manager/ai-manager';
|
|
23
23
|
export * from './features';
|
|
24
24
|
export { defaultVectorStorePropForm } from './features/components';
|
|
25
25
|
export { useAIConfigRepository } from './repositories/hooks/useAIConfigRepository';
|
|
26
|
-
export { useChatMessagesStore } from './ai-employees/chatbox/stores/chat-messages';
|
|
27
|
-
export { useChatBoxStore } from './ai-employees/chatbox/stores/chat-box';
|
|
28
|
-
export { useChatConversationsStore } from './ai-employees/chatbox/stores/chat-conversations';
|
|
29
26
|
export { useChatBoxActions } from './ai-employees/chatbox/hooks/useChatBoxActions';
|
|
27
|
+
export { ChatBoxRuntimeProvider, getGlobalChatBoxRuntime, type ChatBoxRuntime, } from './ai-employees/chatbox/stores/runtime';
|
|
30
28
|
export { ChatBox, ChatBoxLayout, ChatButton, AIEmployeeSwitcher, ModelSwitcher, } from './ai-employees/chatbox/components';
|