@nocobase/plugin-ai 2.3.0-alpha.1 → 3.0.0-alpha.1
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/api/app/env.md +3 -1
- package/dist/ai/docs/nocobase/api/cli/index.md +14 -2
- package/dist/ai/docs/nocobase/api/cli/portal/config.md +44 -0
- package/dist/ai/docs/nocobase/api/cli/portal/create.md +48 -0
- package/dist/ai/docs/nocobase/api/cli/portal/deploy.md +39 -0
- package/dist/ai/docs/nocobase/api/cli/portal/destroy.md +41 -0
- package/dist/ai/docs/nocobase/api/cli/portal/dev.md +39 -0
- package/dist/ai/docs/nocobase/api/cli/portal/index.md +136 -0
- package/dist/ai/docs/nocobase/api/cli/portal/info.md +41 -0
- package/dist/ai/docs/nocobase/api/cli/portal/list.md +40 -0
- package/dist/ai/docs/nocobase/api/cli/portal/pull.md +43 -0
- package/dist/ai/docs/nocobase/api/cli/portal/push.md +41 -0
- package/dist/ai/docs/nocobase/building-tips/ai-fill-js-block-form.md +1092 -0
- package/dist/ai/docs/nocobase/data-sources/calendar/calendar-collection.md +100 -3
- package/dist/ai/docs/nocobase/data-sources/collection-comment/index.md +92 -39
- package/dist/ai/docs/nocobase/data-sources/collection-sql/index.md +150 -29
- package/dist/ai/docs/nocobase/data-sources/collection-tree/index.md +93 -5
- package/dist/ai/docs/nocobase/data-sources/collection-view/index.md +226 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/advanced/china-region.md +122 -5
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/advanced/collection-select.md +105 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/advanced/json.md +102 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/advanced/nano-id.md +104 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/advanced/snowflake-id.md +108 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/advanced/sort.md +3 -19
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/advanced/uuid.md +104 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/associations/index.md +44 -8
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/color.md +102 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/email.md +104 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/icon.md +102 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/input.md +112 -8
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/integer.md +103 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/number.md +103 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/password.md +102 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/percent.md +104 -5
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/phone.md +104 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/textarea.md +99 -8
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/url.md +103 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/choices/checkbox-group.md +105 -3
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/choices/checkbox.md +102 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/choices/china-region.md +108 -5
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/choices/multiple-select.md +103 -5
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/choices/radio-group.md +106 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/choices/select.md +103 -5
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/datetime/date.md +102 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/datetime/datetime-without-tz.md +103 -5
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/datetime/datetime.md +103 -5
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/datetime/index.md +53 -47
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/datetime/time.md +102 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/datetime/unix-timestamp.md +103 -5
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/geometric/circle.md +102 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/geometric/line.md +103 -5
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/geometric/point.md +102 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/geometric/polygon.md +102 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/index.md +62 -16
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/media/markdown.md +104 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/media/rich-text.md +105 -5
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/system-info/created-at.md +105 -5
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/system-info/created-by.md +103 -5
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/system-info/space.md +100 -6
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/system-info/table-oid.md +102 -4
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/system-info/updated-at.md +104 -5
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/system-info/updated-by.md +104 -6
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/validation.md +68 -58
- package/dist/ai/docs/nocobase/data-sources/data-modeling/collection.md +32 -13
- package/dist/ai/docs/nocobase/data-sources/data-modeling/index.md +41 -33
- package/dist/ai/docs/nocobase/data-sources/data-source-external-mariadb/index.md +114 -6
- package/dist/ai/docs/nocobase/data-sources/data-source-external-mssql/index.md +117 -6
- package/dist/ai/docs/nocobase/data-sources/data-source-external-mysql/index.md +103 -6
- package/dist/ai/docs/nocobase/data-sources/data-source-external-nocobase/index.md +75 -73
- package/dist/ai/docs/nocobase/data-sources/data-source-external-oracle/index.md +129 -11
- package/dist/ai/docs/nocobase/data-sources/data-source-external-postgres/index.md +110 -6
- package/dist/ai/docs/nocobase/data-sources/data-source-kingbase/index.md +75 -49
- package/dist/ai/docs/nocobase/data-sources/data-source-main/general-collection.md +116 -15
- package/dist/ai/docs/nocobase/data-sources/data-source-main/index.md +92 -62
- package/dist/ai/docs/nocobase/data-sources/data-source-main/inheritance-collection.md +97 -10
- package/dist/ai/docs/nocobase/data-sources/data-source-manager/external-database.md +97 -58
- package/dist/ai/docs/nocobase/data-sources/data-source-manager/index.md +32 -24
- package/dist/ai/docs/nocobase/data-sources/data-source-rest-api/index.md +115 -153
- package/dist/ai/docs/nocobase/data-sources/external/clickhouse.md +124 -0
- package/dist/ai/docs/nocobase/data-sources/external/doris.md +130 -0
- package/dist/ai/docs/nocobase/data-sources/external/index.md +140 -0
- package/dist/ai/docs/nocobase/data-sources/external/kingbase.md +129 -0
- package/dist/ai/docs/nocobase/data-sources/external/mariadb.md +126 -0
- package/dist/ai/docs/nocobase/data-sources/external/mssql.md +129 -0
- package/dist/ai/docs/nocobase/data-sources/external/mysql.md +115 -0
- package/dist/ai/docs/nocobase/data-sources/external/nocobase.md +159 -0
- package/dist/ai/docs/nocobase/data-sources/external/oceanbase.md +126 -0
- package/dist/ai/docs/nocobase/data-sources/external/oracle.md +158 -0
- package/dist/ai/docs/nocobase/data-sources/external/postgresql.md +122 -0
- package/dist/ai/docs/nocobase/data-sources/external/rest-api.md +245 -0
- package/dist/ai/docs/nocobase/data-sources/field-attachment-url/index.md +100 -12
- package/dist/ai/docs/nocobase/data-sources/field-encryption/index.md +48 -47
- package/dist/ai/docs/nocobase/data-sources/field-formula/index.md +99 -5
- package/dist/ai/docs/nocobase/data-sources/field-markdown-vditor/index.md +105 -5
- package/dist/ai/docs/nocobase/data-sources/field-sequence/index.md +102 -5
- package/dist/ai/docs/nocobase/data-sources/field-signature/index.md +18 -16
- package/dist/ai/docs/nocobase/data-sources/field-sort/index.md +76 -73
- package/dist/ai/docs/nocobase/data-sources/file-manager/field-attachment.md +101 -7
- package/dist/ai/docs/nocobase/data-sources/file-manager/file-collection.md +101 -14
- package/dist/ai/docs/nocobase/data-sources/index.md +49 -33
- package/dist/ai/docs/nocobase/data-sources/main/index.md +130 -0
- package/dist/ai/docs/nocobase/data-sources/main/kingbase.md +147 -0
- package/dist/ai/docs/nocobase/data-sources/main/mariadb.md +59 -0
- package/dist/ai/docs/nocobase/data-sources/main/mysql.md +59 -0
- package/dist/ai/docs/nocobase/data-sources/main/oceanbase.md +62 -0
- package/dist/ai/docs/nocobase/data-sources/main/postgresql.md +61 -0
- package/dist/ai/docs/nocobase/file-manager/storage/index.md +66 -26
- package/dist/ai/docs/nocobase/file-manager/storage/s3-pro.md +58 -7
- package/dist/ai/docs/nocobase/get-started/installation/env.md +2 -2
- 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/executeFrontendTool.d.ts +10 -0
- package/dist/ai/tools/executeFrontendTool.js +86 -0
- package/dist/ai/tools/getSkill.js +1 -1
- package/dist/ai/tools/loadFrontendTool.d.ts +10 -0
- package/dist/ai/tools/loadFrontendTool.js +99 -0
- package/dist/client/244.8631eb5cf3f05e21.js +10 -0
- package/dist/client/{525.203778500aca5d05.js → 525.94dd4136c1361477.js} +1 -1
- package/dist/client/681.6ffbc9329b9ac242.js +10 -0
- package/dist/{client-v2/705.1d10027ff8cfdf79.js → client/705.19b642db34de438a.js} +1 -1
- 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/705.8dc34d43f02f322c.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/frontend-tools.d.ts +11 -0
- 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 +30 -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 +10 -3
- package/dist/client-v2/manager/frontend-tool-registry.d.ts +30 -0
- 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 +2 -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/frontend-tools.d.ts +26 -0
- package/dist/common/frontend-tools.js +57 -0
- package/dist/common/llm-service-models.d.ts +16 -0
- package/dist/common/llm-service-models.js +84 -0
- package/dist/externalVersion.js +16 -16
- package/dist/locale/en-US.json +67 -0
- package/dist/locale/zh-CN.json +67 -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 +4 -1
- package/dist/server/ai-employees/ai-conversations.js +2 -0
- package/dist/server/ai-employees/ai-employee.d.ts +2 -1
- package/dist/server/ai-employees/ai-employee.js +26 -7
- 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 +1 -1
- package/dist/server/frontend-tools.d.ts +25 -0
- package/dist/server/frontend-tools.js +171 -0
- package/dist/server/manager/work-context-handler.js +10 -3
- package/dist/server/plugin.d.ts +1 -0
- package/dist/server/plugin.js +25 -0
- package/dist/server/resource/aiConversations.d.ts +2 -0
- package/dist/server/resource/aiConversations.js +33 -3
- 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/ai/docs/nocobase/data-sources/development/index.md +0 -6
- package/dist/client/372.40eb52905e3f3049.js +0 -10
- package/dist/client/681.399948c18d753667.js +0 -10
- package/dist/client/705.380279da896021fb.js +0 -10
- package/dist/client-v2/372.8cc3fde09c9bec77.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,13 +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';
|
|
14
|
+
import { FrontendToolRegistry } from './frontend-tool-registry';
|
|
13
15
|
export declare const AI_EMPLOYEE_TRIGGER_TASK_EVENT = "ai:employee:trigger-task";
|
|
14
|
-
export type TriggerModelTaskOptions = Omit<RunJSAIEmployeeTriggerTaskOptions, 'aiEmployee' | 'tasks'
|
|
16
|
+
export type TriggerModelTaskOptions = Omit<RunJSAIEmployeeTriggerTaskOptions, 'aiEmployee' | 'tasks' | 'chatBoxUid'> & {
|
|
17
|
+
attachments?: Attachment[];
|
|
18
|
+
};
|
|
15
19
|
type AIManagerApp = {
|
|
20
|
+
apiClient: Pick<APIClient, 'request'>;
|
|
16
21
|
eventBus: {
|
|
17
22
|
dispatchEvent: (event: Event) => boolean;
|
|
18
23
|
};
|
|
@@ -36,6 +41,7 @@ export declare class AIManager {
|
|
|
36
41
|
private readonly app?;
|
|
37
42
|
constructor(app?: AIManagerApp);
|
|
38
43
|
llmProviders: any;
|
|
44
|
+
frontendTools: FrontendToolRegistry;
|
|
39
45
|
chatSettings: Map<string, {
|
|
40
46
|
title: string;
|
|
41
47
|
Component: ComponentType;
|
|
@@ -48,6 +54,7 @@ export declare class AIManager {
|
|
|
48
54
|
registerWorkContext(name: string, options: WorkContextOptions): void;
|
|
49
55
|
getWorkContext(name: string): WorkContextOptions | null;
|
|
50
56
|
triggerTask(options: RunJSAIEmployeeTriggerTaskOptions): void;
|
|
57
|
+
uploadFile(file: File, options?: UploadAIFileOptions): Promise<Attachment>;
|
|
51
58
|
triggerModelTask(uid: string, taskIndex: number, options?: TriggerModelTaskOptions): void;
|
|
52
59
|
onChatBoxMounted(): void;
|
|
53
60
|
onChatBoxUnmounted(): void;
|
|
@@ -0,0 +1,30 @@
|
|
|
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 { FrontendToolManifest, FrontendToolPermission } from '../../common/frontend-tools';
|
|
10
|
+
export type FrontendToolRegistration = {
|
|
11
|
+
name: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
description: string;
|
|
14
|
+
permission?: FrontendToolPermission;
|
|
15
|
+
inputSchema?: Record<string, unknown>;
|
|
16
|
+
execute: (args: unknown) => unknown | Promise<unknown>;
|
|
17
|
+
};
|
|
18
|
+
export declare class FrontendToolRegistry {
|
|
19
|
+
private readonly tools;
|
|
20
|
+
register(blockUid: string, registration: FrontendToolRegistration): FrontendToolManifest;
|
|
21
|
+
clear(blockUid: string): void;
|
|
22
|
+
list(blockUid: string): FrontendToolManifest[];
|
|
23
|
+
getManifest(toolId: string): FrontendToolManifest;
|
|
24
|
+
execute(toolId: string, args: unknown): Promise<unknown>;
|
|
25
|
+
}
|
|
26
|
+
export declare const getFrontendToolRegistry: (app?: {
|
|
27
|
+
pm?: {
|
|
28
|
+
get?: (name: string) => unknown;
|
|
29
|
+
};
|
|
30
|
+
}) => FrontendToolRegistry | undefined;
|
|
@@ -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;
|
|
@@ -58,5 +59,6 @@ export declare function updateAIEmployeeEnabled(apiClient: APIClientLike, userna
|
|
|
58
59
|
export declare function isKnowledgeBaseEnabled(apiClient: APIClientLike): Promise<boolean>;
|
|
59
60
|
export declare function listKnowledgeBases(apiClient: APIClientLike): Promise<KnowledgeBaseOption[]>;
|
|
60
61
|
export declare const normalizeSkillSettings: (value: unknown) => EmployeeSkillSettings;
|
|
62
|
+
export declare const buildEmployeeSubmitValues: (values: EmployeeFormValues, allValues: EmployeeFormValues) => EmployeeFormValues;
|
|
61
63
|
export declare const EmployeesPage: React.FC;
|
|
62
64
|
export default EmployeesPage;
|
|
@@ -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,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
|
+
export declare const LOAD_FRONTEND_TOOL_NAME = "loadFrontendTool";
|
|
10
|
+
export declare const EXECUTE_FRONTEND_TOOL_NAME = "executeFrontendTool";
|
|
11
|
+
export type FrontendToolPermission = 'ASK' | 'ALLOW';
|
|
12
|
+
export type FrontendToolManifest = {
|
|
13
|
+
id: string;
|
|
14
|
+
blockUid: string;
|
|
15
|
+
name: string;
|
|
16
|
+
title?: string;
|
|
17
|
+
description: string;
|
|
18
|
+
permission: FrontendToolPermission;
|
|
19
|
+
inputSchema: Record<string, unknown>;
|
|
20
|
+
};
|
|
21
|
+
export type FrontendToolInvokeResult = {
|
|
22
|
+
status: 'success' | 'error';
|
|
23
|
+
content: unknown;
|
|
24
|
+
};
|
|
25
|
+
export declare const isFrontendToolInvokeResult: (value: unknown) => value is FrontendToolInvokeResult;
|
|
26
|
+
export declare const isFrontendToolManifest: (value: unknown) => value is FrontendToolManifest;
|
|
@@ -0,0 +1,57 @@
|
|
|
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 frontend_tools_exports = {};
|
|
28
|
+
__export(frontend_tools_exports, {
|
|
29
|
+
EXECUTE_FRONTEND_TOOL_NAME: () => EXECUTE_FRONTEND_TOOL_NAME,
|
|
30
|
+
LOAD_FRONTEND_TOOL_NAME: () => LOAD_FRONTEND_TOOL_NAME,
|
|
31
|
+
isFrontendToolInvokeResult: () => isFrontendToolInvokeResult,
|
|
32
|
+
isFrontendToolManifest: () => isFrontendToolManifest
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(frontend_tools_exports);
|
|
35
|
+
const LOAD_FRONTEND_TOOL_NAME = "loadFrontendTool";
|
|
36
|
+
const EXECUTE_FRONTEND_TOOL_NAME = "executeFrontendTool";
|
|
37
|
+
const isFrontendToolInvokeResult = (value) => {
|
|
38
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
const result = value;
|
|
42
|
+
return (result.status === "success" || result.status === "error") && "content" in result;
|
|
43
|
+
};
|
|
44
|
+
const isFrontendToolManifest = (value) => {
|
|
45
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
const manifest = value;
|
|
49
|
+
return typeof manifest.id === "string" && !!manifest.id && typeof manifest.blockUid === "string" && !!manifest.blockUid && typeof manifest.name === "string" && !!manifest.name && typeof manifest.description === "string" && !!manifest.description && (manifest.permission === "ASK" || manifest.permission === "ALLOW") && !!manifest.inputSchema && typeof manifest.inputSchema === "object" && !Array.isArray(manifest.inputSchema);
|
|
50
|
+
};
|
|
51
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
52
|
+
0 && (module.exports = {
|
|
53
|
+
EXECUTE_FRONTEND_TOOL_NAME,
|
|
54
|
+
LOAD_FRONTEND_TOOL_NAME,
|
|
55
|
+
isFrontendToolInvokeResult,
|
|
56
|
+
isFrontendToolManifest
|
|
57
|
+
});
|
|
@@ -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,37 +8,37 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/plugin-acl": "
|
|
12
|
-
"@nocobase/plugin-workflow": "
|
|
13
|
-
"@nocobase/client": "
|
|
14
|
-
"@nocobase/utils": "
|
|
15
|
-
"@nocobase/flow-engine": "
|
|
16
|
-
"@nocobase/client-v2": "
|
|
17
|
-
"@nocobase/database": "
|
|
18
|
-
"@nocobase/actions": "
|
|
19
|
-
"@nocobase/plugin-file-manager": "
|
|
20
|
-
"@nocobase/server": "
|
|
21
|
-
"@nocobase/ai": "
|
|
11
|
+
"@nocobase/plugin-acl": "3.0.0-alpha.1",
|
|
12
|
+
"@nocobase/plugin-workflow": "3.0.0-alpha.1",
|
|
13
|
+
"@nocobase/client": "3.0.0-alpha.1",
|
|
14
|
+
"@nocobase/utils": "3.0.0-alpha.1",
|
|
15
|
+
"@nocobase/flow-engine": "3.0.0-alpha.1",
|
|
16
|
+
"@nocobase/client-v2": "3.0.0-alpha.1",
|
|
17
|
+
"@nocobase/database": "3.0.0-alpha.1",
|
|
18
|
+
"@nocobase/actions": "3.0.0-alpha.1",
|
|
19
|
+
"@nocobase/plugin-file-manager": "3.0.0-alpha.1",
|
|
20
|
+
"@nocobase/server": "3.0.0-alpha.1",
|
|
21
|
+
"@nocobase/ai": "3.0.0-alpha.1",
|
|
22
22
|
"langchain": "1.2.39",
|
|
23
23
|
"react": "18.2.0",
|
|
24
24
|
"antd": "5.24.2",
|
|
25
25
|
"@ant-design/icons": "5.6.1",
|
|
26
26
|
"ahooks": "3.7.8",
|
|
27
|
+
"lodash": "4.18.1",
|
|
27
28
|
"@dnd-kit/sortable": "7.0.2",
|
|
28
29
|
"@emotion/css": "11.13.0",
|
|
29
30
|
"react-router-dom": "6.30.1",
|
|
30
|
-
"lodash": "4.18.1",
|
|
31
31
|
"@langchain/core": "1.1.49",
|
|
32
32
|
"@langchain/langgraph": "1.4.4",
|
|
33
|
-
"@nocobase/cache": "
|
|
33
|
+
"@nocobase/cache": "3.0.0-alpha.1",
|
|
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": "
|
|
40
|
-
"@nocobase/data-source-manager": "
|
|
41
|
-
"@nocobase/resourcer": "
|
|
39
|
+
"@nocobase/acl": "3.0.0-alpha.1",
|
|
40
|
+
"@nocobase/data-source-manager": "3.0.0-alpha.1",
|
|
41
|
+
"@nocobase/resourcer": "3.0.0-alpha.1",
|
|
42
42
|
"dayjs": "1.11.13",
|
|
43
43
|
"react-dom": "18.2.0",
|
|
44
44
|
"@langchain/langgraph-checkpoint": "1.1.2",
|