@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
|
@@ -0,0 +1,33 @@
|
|
|
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 type { SelectProps } from 'antd';
|
|
11
|
+
import type { LLMServiceItem } from '../repositories/AIConfigRepository';
|
|
12
|
+
export type LLMModelSelectOptionGroup = {
|
|
13
|
+
label: string;
|
|
14
|
+
options: Array<{
|
|
15
|
+
label: string;
|
|
16
|
+
value: string;
|
|
17
|
+
}>;
|
|
18
|
+
};
|
|
19
|
+
export declare const getLLMModelValue: (model: {
|
|
20
|
+
llmService?: string;
|
|
21
|
+
model?: string;
|
|
22
|
+
}) => string;
|
|
23
|
+
export declare const parseLLMModelValue: (value: string) => {
|
|
24
|
+
llmService: string;
|
|
25
|
+
model: string;
|
|
26
|
+
};
|
|
27
|
+
export declare const getLLMModelSelectOptions: (services: LLMServiceItem[]) => LLMModelSelectOptionGroup[];
|
|
28
|
+
export declare const getLLMModelSelectLabelMap: (options: LLMModelSelectOptionGroup[]) => Map<string, string>;
|
|
29
|
+
export declare const createLLMModelTagRender: (labelMap: Map<string, string>) => NonNullable<SelectProps<string[]>['tagRender']>;
|
|
30
|
+
export type LLMModelMultiSelectProps = Omit<SelectProps<string[]>, 'mode' | 'options' | 'tagRender'> & {
|
|
31
|
+
services: LLMServiceItem[];
|
|
32
|
+
};
|
|
33
|
+
export declare const LLMModelMultiSelect: React.FC<LLMModelMultiSelectProps>;
|
|
@@ -10,4 +10,5 @@ export type LLMServiceOptions = Record<string, unknown>;
|
|
|
10
10
|
export declare const normalizeLLMServiceOptions: <T extends LLMServiceOptions>(options: T) => T;
|
|
11
11
|
export declare const normalizeLLMServiceFormValues: <T extends {
|
|
12
12
|
options?: LLMServiceOptions | null;
|
|
13
|
+
enabledModels?: unknown;
|
|
13
14
|
}>(values: T) => T;
|
|
@@ -6,14 +6,18 @@
|
|
|
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 type { ToolsOptions, ToolModalProps } from '@nocobase/client-v2';
|
|
9
|
+
import type { APIClient, ToolsOptions, ToolModalProps } from '@nocobase/client-v2';
|
|
10
10
|
import type { ComponentType } from 'react';
|
|
11
|
-
import type { RunJSAIEmployeeTriggerTaskOptions } from '../ai-employees/chatbox/utils
|
|
11
|
+
import type { RunJSAIEmployeeTriggerTaskOptions } from '../ai-employees/chatbox/utils';
|
|
12
|
+
import type { Attachment, UploadAIFileOptions } from '../ai-employees/types';
|
|
12
13
|
import type { WorkContextOptions } from '../ai-employees/types';
|
|
13
14
|
import { FrontendToolRegistry } from './frontend-tool-registry';
|
|
14
15
|
export declare const AI_EMPLOYEE_TRIGGER_TASK_EVENT = "ai:employee:trigger-task";
|
|
15
|
-
export type TriggerModelTaskOptions = Omit<RunJSAIEmployeeTriggerTaskOptions, 'aiEmployee' | 'tasks'
|
|
16
|
+
export type TriggerModelTaskOptions = Omit<RunJSAIEmployeeTriggerTaskOptions, 'aiEmployee' | 'tasks' | 'chatBoxUid'> & {
|
|
17
|
+
attachments?: Attachment[];
|
|
18
|
+
};
|
|
16
19
|
type AIManagerApp = {
|
|
20
|
+
apiClient: Pick<APIClient, 'request'>;
|
|
17
21
|
eventBus: {
|
|
18
22
|
dispatchEvent: (event: Event) => boolean;
|
|
19
23
|
};
|
|
@@ -50,6 +54,7 @@ export declare class AIManager {
|
|
|
50
54
|
registerWorkContext(name: string, options: WorkContextOptions): void;
|
|
51
55
|
getWorkContext(name: string): WorkContextOptions | null;
|
|
52
56
|
triggerTask(options: RunJSAIEmployeeTriggerTaskOptions): void;
|
|
57
|
+
uploadFile(file: File, options?: UploadAIFileOptions): Promise<Attachment>;
|
|
53
58
|
triggerModelTask(uid: string, taskIndex: number, options?: TriggerModelTaskOptions): void;
|
|
54
59
|
onChatBoxMounted(): void;
|
|
55
60
|
onChatBoxUnmounted(): void;
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import { ActionModel } from '@nocobase/client-v2';
|
|
11
11
|
import { type FlowModelContext } from '@nocobase/flow-engine';
|
|
12
|
+
import type { Task } from '../../ai-employees/types';
|
|
12
13
|
export declare class AIEmployeeActionModel extends ActionModel {
|
|
13
14
|
static scene: import("@nocobase/client-v2").ActionSceneType;
|
|
14
15
|
static defineChildren(ctx: FlowModelContext): Promise<{
|
|
@@ -17,6 +18,9 @@ export declare class AIEmployeeActionModel extends ActionModel {
|
|
|
17
18
|
createModelOptions: {
|
|
18
19
|
use: string;
|
|
19
20
|
props: {
|
|
21
|
+
auto: boolean;
|
|
22
|
+
defaultTaskChatBoxUid?: string;
|
|
23
|
+
tasks?: Task[];
|
|
20
24
|
aiEmployee: {
|
|
21
25
|
username: string;
|
|
22
26
|
};
|
|
@@ -26,7 +30,6 @@ export declare class AIEmployeeActionModel extends ActionModel {
|
|
|
26
30
|
uid: string;
|
|
27
31
|
}[];
|
|
28
32
|
};
|
|
29
|
-
auto: boolean;
|
|
30
33
|
};
|
|
31
34
|
};
|
|
32
35
|
}[]>;
|
|
@@ -16,6 +16,7 @@ type ShortcutStyle = {
|
|
|
16
16
|
export type AIEmployeeShortcutModelProps = {
|
|
17
17
|
aiEmployee: Pick<AIEmployee, 'username'> & Partial<AIEmployee>;
|
|
18
18
|
tasks?: Task[];
|
|
19
|
+
defaultTaskChatBoxUid?: string;
|
|
19
20
|
showNotice?: boolean;
|
|
20
21
|
builtIn?: boolean;
|
|
21
22
|
style?: ShortcutStyle;
|
|
@@ -41,4 +42,8 @@ export declare const normalizeShortcutTasksSkillSettings: (tasks: ShortcutTask[]
|
|
|
41
42
|
dropEmptyLegacyArrays?: boolean;
|
|
42
43
|
onlyExistingSettings?: boolean;
|
|
43
44
|
}) => void;
|
|
45
|
+
export declare const WorkContext: React.FC<{
|
|
46
|
+
value?: ContextItem[];
|
|
47
|
+
onChange?: (value: ContextItem[]) => void;
|
|
48
|
+
}>;
|
|
44
49
|
export {};
|
|
@@ -45,6 +45,7 @@ type EmployeeFormValues = SettingsAIEmployee & {
|
|
|
45
45
|
_aboutMode?: 'system' | 'custom';
|
|
46
46
|
};
|
|
47
47
|
export declare const EMPLOYEE_PROMPT_VARIABLE_NAMESPACES: string[];
|
|
48
|
+
export declare const isAIEmployeeUsernameConflictError: (error: unknown) => boolean;
|
|
48
49
|
export declare function listAIEmployees(apiClient: APIClientLike, params: {
|
|
49
50
|
category: EmployeeCategory;
|
|
50
51
|
page?: number;
|
|
@@ -0,0 +1,15 @@
|
|
|
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_EMPLOYEE_USERNAME_MAX_LENGTH = 64;
|
|
10
|
+
export declare const AI_EMPLOYEE_NICKNAME_MAX_LENGTH = 64;
|
|
11
|
+
export declare const AI_EMPLOYEE_USERNAME_PATTERN: RegExp;
|
|
12
|
+
export declare const AI_EMPLOYEE_NICKNAME_PATTERN: RegExp;
|
|
13
|
+
export declare const normalizeAIEmployeeName: (value: string) => string;
|
|
14
|
+
export declare const isValidAIEmployeeUsername: (value: string) => boolean;
|
|
15
|
+
export declare const isValidAIEmployeeNickname: (value: string) => boolean;
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var ai_employee_validation_exports = {};
|
|
28
|
+
__export(ai_employee_validation_exports, {
|
|
29
|
+
AI_EMPLOYEE_NICKNAME_MAX_LENGTH: () => AI_EMPLOYEE_NICKNAME_MAX_LENGTH,
|
|
30
|
+
AI_EMPLOYEE_NICKNAME_PATTERN: () => AI_EMPLOYEE_NICKNAME_PATTERN,
|
|
31
|
+
AI_EMPLOYEE_USERNAME_MAX_LENGTH: () => AI_EMPLOYEE_USERNAME_MAX_LENGTH,
|
|
32
|
+
AI_EMPLOYEE_USERNAME_PATTERN: () => AI_EMPLOYEE_USERNAME_PATTERN,
|
|
33
|
+
isValidAIEmployeeNickname: () => isValidAIEmployeeNickname,
|
|
34
|
+
isValidAIEmployeeUsername: () => isValidAIEmployeeUsername,
|
|
35
|
+
normalizeAIEmployeeName: () => normalizeAIEmployeeName
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(ai_employee_validation_exports);
|
|
38
|
+
const AI_EMPLOYEE_USERNAME_MAX_LENGTH = 64;
|
|
39
|
+
const AI_EMPLOYEE_NICKNAME_MAX_LENGTH = 64;
|
|
40
|
+
const AI_EMPLOYEE_USERNAME_PATTERN = /^[a-zA-Z0-9_-]+$/;
|
|
41
|
+
const AI_EMPLOYEE_NICKNAME_PATTERN = /^[\p{L}\p{M}\p{N} ._'’()&·-]+$/u;
|
|
42
|
+
const normalizeAIEmployeeName = (value) => value.trim();
|
|
43
|
+
const isWithinLength = (value, maxLength) => value.length > 0 && Array.from(value).length <= maxLength;
|
|
44
|
+
const isValidAIEmployeeUsername = (value) => {
|
|
45
|
+
const normalizedValue = normalizeAIEmployeeName(value);
|
|
46
|
+
return isWithinLength(normalizedValue, AI_EMPLOYEE_USERNAME_MAX_LENGTH) && AI_EMPLOYEE_USERNAME_PATTERN.test(normalizedValue);
|
|
47
|
+
};
|
|
48
|
+
const isValidAIEmployeeNickname = (value) => {
|
|
49
|
+
const normalizedValue = normalizeAIEmployeeName(value);
|
|
50
|
+
return isWithinLength(normalizedValue, AI_EMPLOYEE_NICKNAME_MAX_LENGTH) && AI_EMPLOYEE_NICKNAME_PATTERN.test(normalizedValue) && /[\p{L}\p{N}]/u.test(normalizedValue);
|
|
51
|
+
};
|
|
52
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
+
0 && (module.exports = {
|
|
54
|
+
AI_EMPLOYEE_NICKNAME_MAX_LENGTH,
|
|
55
|
+
AI_EMPLOYEE_NICKNAME_PATTERN,
|
|
56
|
+
AI_EMPLOYEE_USERNAME_MAX_LENGTH,
|
|
57
|
+
AI_EMPLOYEE_USERNAME_PATTERN,
|
|
58
|
+
isValidAIEmployeeNickname,
|
|
59
|
+
isValidAIEmployeeUsername,
|
|
60
|
+
normalizeAIEmployeeName
|
|
61
|
+
});
|
|
@@ -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
|
+
export declare const AI_EMPLOYEE_USERNAME_CONFLICT = "AI_EMPLOYEE_USERNAME_CONFLICT";
|
|
10
|
+
export declare const AI_EMPLOYEE_USERNAME_INVALID = "AI_EMPLOYEE_USERNAME_INVALID";
|
|
11
|
+
export declare const AI_EMPLOYEE_NICKNAME_INVALID = "AI_EMPLOYEE_NICKNAME_INVALID";
|
|
12
|
+
export declare const LLM_SERVICE_MODEL_ID_REQUIRED = "LLM_SERVICE_MODEL_ID_REQUIRED";
|
|
13
|
+
export declare const LLM_SERVICE_MODEL_ID_DUPLICATE = "LLM_SERVICE_MODEL_ID_DUPLICATE";
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var error_codes_exports = {};
|
|
28
|
+
__export(error_codes_exports, {
|
|
29
|
+
AI_EMPLOYEE_NICKNAME_INVALID: () => AI_EMPLOYEE_NICKNAME_INVALID,
|
|
30
|
+
AI_EMPLOYEE_USERNAME_CONFLICT: () => AI_EMPLOYEE_USERNAME_CONFLICT,
|
|
31
|
+
AI_EMPLOYEE_USERNAME_INVALID: () => AI_EMPLOYEE_USERNAME_INVALID,
|
|
32
|
+
LLM_SERVICE_MODEL_ID_DUPLICATE: () => LLM_SERVICE_MODEL_ID_DUPLICATE,
|
|
33
|
+
LLM_SERVICE_MODEL_ID_REQUIRED: () => LLM_SERVICE_MODEL_ID_REQUIRED
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(error_codes_exports);
|
|
36
|
+
const AI_EMPLOYEE_USERNAME_CONFLICT = "AI_EMPLOYEE_USERNAME_CONFLICT";
|
|
37
|
+
const AI_EMPLOYEE_USERNAME_INVALID = "AI_EMPLOYEE_USERNAME_INVALID";
|
|
38
|
+
const AI_EMPLOYEE_NICKNAME_INVALID = "AI_EMPLOYEE_NICKNAME_INVALID";
|
|
39
|
+
const LLM_SERVICE_MODEL_ID_REQUIRED = "LLM_SERVICE_MODEL_ID_REQUIRED";
|
|
40
|
+
const LLM_SERVICE_MODEL_ID_DUPLICATE = "LLM_SERVICE_MODEL_ID_DUPLICATE";
|
|
41
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
+
0 && (module.exports = {
|
|
43
|
+
AI_EMPLOYEE_NICKNAME_INVALID,
|
|
44
|
+
AI_EMPLOYEE_USERNAME_CONFLICT,
|
|
45
|
+
AI_EMPLOYEE_USERNAME_INVALID,
|
|
46
|
+
LLM_SERVICE_MODEL_ID_DUPLICATE,
|
|
47
|
+
LLM_SERVICE_MODEL_ID_REQUIRED
|
|
48
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
type ModelIdIssueType = 'required' | 'duplicate';
|
|
10
|
+
export type ModelIdIssue = {
|
|
11
|
+
index: number;
|
|
12
|
+
type: ModelIdIssueType;
|
|
13
|
+
};
|
|
14
|
+
export declare const normalizeCustomModelIds: (enabledModels: unknown) => unknown;
|
|
15
|
+
export declare const getCustomModelIdIssues: (enabledModels: unknown) => ModelIdIssue[];
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
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
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var llm_service_models_exports = {};
|
|
28
|
+
__export(llm_service_models_exports, {
|
|
29
|
+
getCustomModelIdIssues: () => getCustomModelIdIssues,
|
|
30
|
+
normalizeCustomModelIds: () => normalizeCustomModelIds
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(llm_service_models_exports);
|
|
33
|
+
const isRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
34
|
+
const getCustomModels = (enabledModels) => {
|
|
35
|
+
if (!isRecord(enabledModels) || enabledModels.mode !== "custom" || !Array.isArray(enabledModels.models)) {
|
|
36
|
+
return void 0;
|
|
37
|
+
}
|
|
38
|
+
return enabledModels.models;
|
|
39
|
+
};
|
|
40
|
+
const normalizeCustomModelIds = (enabledModels) => {
|
|
41
|
+
const models = getCustomModels(enabledModels);
|
|
42
|
+
if (!models || !isRecord(enabledModels)) {
|
|
43
|
+
return enabledModels;
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
...enabledModels,
|
|
47
|
+
models: models.map((model) => {
|
|
48
|
+
if (!isRecord(model)) {
|
|
49
|
+
return model;
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
...model,
|
|
53
|
+
label: typeof model.label === "string" ? model.label.trim() : model.label,
|
|
54
|
+
value: typeof model.value === "string" ? model.value.trim() : model.value
|
|
55
|
+
};
|
|
56
|
+
})
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
const getCustomModelIdIssues = (enabledModels) => {
|
|
60
|
+
const models = getCustomModels(enabledModels);
|
|
61
|
+
if (!models) {
|
|
62
|
+
return [];
|
|
63
|
+
}
|
|
64
|
+
const seenModelIds = /* @__PURE__ */ new Set();
|
|
65
|
+
const issues = [];
|
|
66
|
+
models.forEach((model, index) => {
|
|
67
|
+
const modelId = isRecord(model) && typeof model.value === "string" ? model.value.trim() : "";
|
|
68
|
+
if (!modelId) {
|
|
69
|
+
issues.push({ index, type: "required" });
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (seenModelIds.has(modelId)) {
|
|
73
|
+
issues.push({ index, type: "duplicate" });
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
seenModelIds.add(modelId);
|
|
77
|
+
});
|
|
78
|
+
return issues;
|
|
79
|
+
};
|
|
80
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
81
|
+
0 && (module.exports = {
|
|
82
|
+
getCustomModelIdIssues,
|
|
83
|
+
normalizeCustomModelIds
|
|
84
|
+
});
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,17 +8,17 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/plugin-acl": "2.2.0-alpha.
|
|
12
|
-
"@nocobase/plugin-workflow": "2.2.0-alpha.
|
|
13
|
-
"@nocobase/client": "2.2.0-alpha.
|
|
14
|
-
"@nocobase/utils": "2.2.0-alpha.
|
|
15
|
-
"@nocobase/flow-engine": "2.2.0-alpha.
|
|
16
|
-
"@nocobase/client-v2": "2.2.0-alpha.
|
|
17
|
-
"@nocobase/database": "2.2.0-alpha.
|
|
18
|
-
"@nocobase/actions": "2.2.0-alpha.
|
|
19
|
-
"@nocobase/plugin-file-manager": "2.2.0-alpha.
|
|
20
|
-
"@nocobase/server": "2.2.0-alpha.
|
|
21
|
-
"@nocobase/ai": "2.2.0-alpha.
|
|
11
|
+
"@nocobase/plugin-acl": "2.2.0-alpha.12",
|
|
12
|
+
"@nocobase/plugin-workflow": "2.2.0-alpha.12",
|
|
13
|
+
"@nocobase/client": "2.2.0-alpha.12",
|
|
14
|
+
"@nocobase/utils": "2.2.0-alpha.12",
|
|
15
|
+
"@nocobase/flow-engine": "2.2.0-alpha.12",
|
|
16
|
+
"@nocobase/client-v2": "2.2.0-alpha.12",
|
|
17
|
+
"@nocobase/database": "2.2.0-alpha.12",
|
|
18
|
+
"@nocobase/actions": "2.2.0-alpha.12",
|
|
19
|
+
"@nocobase/plugin-file-manager": "2.2.0-alpha.12",
|
|
20
|
+
"@nocobase/server": "2.2.0-alpha.12",
|
|
21
|
+
"@nocobase/ai": "2.2.0-alpha.12",
|
|
22
22
|
"langchain": "1.2.39",
|
|
23
23
|
"react": "18.2.0",
|
|
24
24
|
"antd": "5.24.2",
|
|
@@ -30,15 +30,15 @@ module.exports = {
|
|
|
30
30
|
"react-router-dom": "6.30.1",
|
|
31
31
|
"@langchain/core": "1.1.49",
|
|
32
32
|
"@langchain/langgraph": "1.4.4",
|
|
33
|
-
"@nocobase/cache": "2.2.0-alpha.
|
|
33
|
+
"@nocobase/cache": "2.2.0-alpha.12",
|
|
34
34
|
"@langchain/anthropic": "1.3.17",
|
|
35
35
|
"@langchain/openai": "1.4.7",
|
|
36
36
|
"@langchain/deepseek": "1.0.27",
|
|
37
37
|
"@langchain/google-genai": "2.1.18",
|
|
38
38
|
"@langchain/ollama": "1.2.7",
|
|
39
|
-
"@nocobase/acl": "2.2.0-alpha.
|
|
40
|
-
"@nocobase/data-source-manager": "2.2.0-alpha.
|
|
41
|
-
"@nocobase/resourcer": "2.2.0-alpha.
|
|
39
|
+
"@nocobase/acl": "2.2.0-alpha.12",
|
|
40
|
+
"@nocobase/data-source-manager": "2.2.0-alpha.12",
|
|
41
|
+
"@nocobase/resourcer": "2.2.0-alpha.12",
|
|
42
42
|
"dayjs": "1.11.13",
|
|
43
43
|
"react-dom": "18.2.0",
|
|
44
44
|
"@langchain/langgraph-checkpoint": "1.1.2",
|
package/dist/locale/en-US.json
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"AI employee": "AI employee",
|
|
9
9
|
"AI employee event": "AI employee event",
|
|
10
10
|
"AI employee permissions": "AI employee permissions",
|
|
11
|
+
"AI chat box not found": "AI chat box {{uid}} was not found",
|
|
11
12
|
"AI employees": "AI employees",
|
|
12
13
|
"AI integration": "AI integration",
|
|
13
14
|
"AI is searching": "{{ nickname }} is searching...",
|
|
@@ -81,6 +82,8 @@
|
|
|
81
82
|
"Chart generator": "Chart generator",
|
|
82
83
|
"Charts": "Charts",
|
|
83
84
|
"Chat error warning": "Failed to send message. Please contact the administrator or try again later.",
|
|
85
|
+
"Chat box uid": "Chat box uid",
|
|
86
|
+
"Leave empty to open the global chat box. Enter an AI chat box block uid to run this task in that block.": "Leave empty to open the global chat box. Enter an AI chat box block uid to run this task in that block.",
|
|
84
87
|
"Cite {{count}} pieces of information as references": "Cite {{count}} pieces of information as references",
|
|
85
88
|
"Code history": "Code history",
|
|
86
89
|
"Code review": "Code review",
|
|
@@ -116,6 +119,7 @@
|
|
|
116
119
|
"{{ nickname }} has completed the work": "{{ nickname }} has completed the work",
|
|
117
120
|
"Displays the AI employee’s assigned tasks on the profile when hovering over the button.": "Displays the AI employee’s assigned tasks on the profile when hovering over the button.",
|
|
118
121
|
"Down": "Down",
|
|
122
|
+
"Edit": "Edit",
|
|
119
123
|
"Edit AI employee": "Edit AI employee",
|
|
120
124
|
"Edit datasource": "Edit data source",
|
|
121
125
|
"Edit personalized prompt": "Edit personalized prompt",
|
|
@@ -177,6 +181,8 @@
|
|
|
177
181
|
"Messages": "Messages",
|
|
178
182
|
"Mistral models": "Mistral models",
|
|
179
183
|
"Model": "Model",
|
|
184
|
+
"Model ID already exists": "Model ID already exists",
|
|
185
|
+
"Model ID is required": "Model ID is required",
|
|
180
186
|
"Model settings": "Model settings",
|
|
181
187
|
"Missing knowledge base configuration for keys: {{keys}}. Create knowledge bases with the same keys to enable this employee normally.": "Missing knowledge base configuration for keys: {{keys}}. Create knowledge bases with the same keys to enable this employee normally.",
|
|
182
188
|
"Display name": "Display name",
|
|
@@ -207,6 +213,9 @@
|
|
|
207
213
|
"Please choose an AI employee": "Please choose an AI employee",
|
|
208
214
|
"Please select file objects.": "Please select file objects.",
|
|
209
215
|
"Popup blocked. Please allow popups and try again.": "Popup blocked. Please allow popups and try again.",
|
|
216
|
+
"Username already exists": "Username already exists",
|
|
217
|
+
"Use 1-64 letters, numbers, underscores, or hyphens.": "Use 1-64 letters, numbers, underscores, or hyphens.",
|
|
218
|
+
"Use 1-64 letters, numbers, spaces, or . _ - ' ( ) & ·.": "Use 1-64 letters, numbers, spaces, or . _ - ' ( ) & ·.",
|
|
210
219
|
"Position": "Position",
|
|
211
220
|
"Position description": "A short label indicating the AI employee’s responsibility.",
|
|
212
221
|
"Position placeholder": "e.g. Translator, etc.",
|
|
@@ -267,6 +276,8 @@
|
|
|
267
276
|
"UID": "UID",
|
|
268
277
|
"Up": "Up",
|
|
269
278
|
"Upload files": "Upload files",
|
|
279
|
+
"You can upload up to {{count}} attachments.": "You can upload up to {{count}} attachments.",
|
|
280
|
+
"The total size of attachments cannot exceed {{size}}.": "The total size of attachments cannot exceed {{size}}.",
|
|
270
281
|
"Use skill": "Use skill",
|
|
271
282
|
"Use skills": "Use skills",
|
|
272
283
|
"Use workflow as a tool": "Use workflow as a tool",
|
|
@@ -478,7 +489,14 @@
|
|
|
478
489
|
"Invalid attachment": "Invalid attachment",
|
|
479
490
|
"Attachment not found": "Attachment not found",
|
|
480
491
|
"AI chat": "AI chat",
|
|
492
|
+
"AI chat box": "AI chat box",
|
|
493
|
+
"AI chat box core": "AI chat box core",
|
|
494
|
+
"AI chat box settings": "AI chat box settings",
|
|
495
|
+
"AI chat window": "AI chat window",
|
|
496
|
+
"AI chat window settings": "AI chat window settings",
|
|
497
|
+
"Appearance": "Appearance",
|
|
481
498
|
"Open AI chat": "Open AI chat",
|
|
499
|
+
"Open": "Open",
|
|
482
500
|
"Request failed": "Request failed",
|
|
483
501
|
"Saved successfully": "Saved successfully",
|
|
484
502
|
"Unsaved changes": "Unsaved changes",
|
|
@@ -495,12 +513,56 @@
|
|
|
495
513
|
"No conversations yet": "No conversations yet",
|
|
496
514
|
"No workflow tasks yet": "No workflow tasks yet",
|
|
497
515
|
"No messages yet": "No messages yet",
|
|
516
|
+
"No chat blocks": "No chat blocks",
|
|
498
517
|
"Tool calls": "Tool calls",
|
|
499
518
|
"Reasoning": "Reasoning",
|
|
500
519
|
"References": "References",
|
|
520
|
+
"Context": "Context",
|
|
521
|
+
"Actions area": "Actions area",
|
|
522
|
+
"Allowed AI employees": "Allowed AI employees",
|
|
523
|
+
"Controls which chat boxes share conversations. The default value isolates this chat box.": "Controls which chat boxes share conversations. The default value isolates this chat box.",
|
|
524
|
+
"Scope can only contain letters, numbers, underscores, and hyphens.": "Scope can only contain letters, numbers, underscores, and hyphens.",
|
|
525
|
+
"Basic settings": "Basic settings",
|
|
526
|
+
"Card settings": "Card settings",
|
|
527
|
+
"Chat content block": "Chat content block",
|
|
528
|
+
"Messages and sender block": "Messages and sender block",
|
|
529
|
+
"Conversation list block": "Conversation list block",
|
|
530
|
+
"Edit chat box": "Edit chat box",
|
|
531
|
+
"Customer follow-up": "Customer follow-up",
|
|
501
532
|
"ECharts": "ECharts",
|
|
533
|
+
"Enable add context": "Enable add context",
|
|
534
|
+
"Enable employee select": "Enable employee select",
|
|
535
|
+
"Enable model select": "Enable model select",
|
|
536
|
+
"Enable upload files": "Enable upload files",
|
|
537
|
+
"Enable web search": "Enable web search",
|
|
538
|
+
"Height": "Height",
|
|
502
539
|
"Invalid chart options": "Invalid chart options",
|
|
540
|
+
"JS action": "JS action",
|
|
541
|
+
"Message list block": "Message list block",
|
|
542
|
+
"Message sender block": "Message sender block",
|
|
543
|
+
"Mock message sent": "Mock message sent",
|
|
544
|
+
"Mock model": "Mock model",
|
|
545
|
+
"Mock new conversation created": "Mock new conversation created",
|
|
546
|
+
"Proposal outline": "Proposal outline",
|
|
547
|
+
"Sales report draft": "Sales report draft",
|
|
548
|
+
"Save": "Save",
|
|
503
549
|
"Save as image": "Save as image",
|
|
550
|
+
"Prefill the sender input when the chat box starts a new conversation.": "Prefill the sender input when the chat box starts a new conversation.",
|
|
551
|
+
"Scope": "Scope",
|
|
552
|
+
"Select blocks": "Select blocks",
|
|
553
|
+
"Select blocks or data sources that are sent as default work context.": "Select blocks or data sources that are sent as default work context.",
|
|
554
|
+
"Restrict this chat box to selected AI employees. Leave empty to allow all business AI employees.": "Restrict this chat box to selected AI employees. Leave empty to allow all business AI employees.",
|
|
555
|
+
"Restrict this chat box to selected models. Leave empty to allow all available models.": "Restrict this chat box to selected models. Leave empty to allow all available models.",
|
|
556
|
+
"Sender placeholder": "Sender placeholder",
|
|
557
|
+
"Sender settings": "Sender settings",
|
|
558
|
+
"Show block selector": "Show block selector",
|
|
559
|
+
"Show disclaimer": "Show disclaimer",
|
|
560
|
+
"Show messages": "Show messages",
|
|
561
|
+
"Show new conversation action": "Show new conversation action",
|
|
562
|
+
"Show upload files": "Show upload files",
|
|
563
|
+
"Show web search": "Show web search",
|
|
564
|
+
"System prompt": "System prompt",
|
|
565
|
+
"Title & description": "Title & description",
|
|
504
566
|
"You": "You",
|
|
505
567
|
"init": "Not started",
|
|
506
568
|
"interrupted": "Waiting for confirmation",
|