@nocobase/plugin-ai 2.1.0-beta.15 → 2.1.0-beta.16
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/ai-employees/atlas/index.d.ts +10 -0
- package/dist/{server/ai-employees/built-in/ai-coding/prompt.js → ai/ai-employees/atlas/index.js} +29 -20
- package/dist/ai/ai-employees/atlas/prompt.md +84 -0
- package/dist/ai/ai-employees/dara.d.ts +10 -0
- package/dist/{server/ai-employees/built-in/data-visualization/prompt.js → ai/ai-employees/dara.js} +21 -13
- package/dist/ai/ai-employees/dex.d.ts +10 -0
- package/dist/{server/ai-employees/built-in/data-organizer/prompt.js → ai/ai-employees/dex.js} +15 -7
- package/dist/ai/ai-employees/ellis.d.ts +10 -0
- package/dist/{server/ai-employees/built-in/email-assistant/prompt.js → ai/ai-employees/ellis.js} +19 -11
- package/dist/ai/ai-employees/lexi.d.ts +10 -0
- package/dist/{server/ai-employees/built-in/translator/prompt.js → ai/ai-employees/lexi.js} +15 -7
- package/dist/ai/ai-employees/vera.d.ts +10 -0
- package/dist/{server/ai-employees/built-in/research-analyst/prompt.js → ai/ai-employees/vera.js} +16 -8
- package/dist/ai/ai-employees/viz.d.ts +10 -0
- package/dist/{server/ai-employees/built-in/insights-analyst/prompt.js → ai/ai-employees/viz.js} +15 -7
- package/dist/ai/skills/business-analysis-report/SKILLS.md +88 -0
- package/dist/{server/ai-employees/built-in/ai-coding/prompt.d.ts → ai/skills/business-analysis-report/tools/businessReportGenerator.d.ts} +1 -3
- package/dist/ai/skills/business-analysis-report/tools/businessReportGenerator.js +98 -0
- package/dist/ai/skills/document-search/SKILLS.md +69 -0
- package/dist/ai/tools/chartGenerator.js +15 -3
- package/dist/ai/tools/formFiller.js +13 -2
- package/dist/{server/ai-employees/built-in/data-modeling/prompt.d.ts → ai/tools/getSkill.d.ts} +1 -3
- package/dist/{server/ai-employees/built-in/data-modeling/index.js → ai/tools/getSkill.js} +39 -32
- package/dist/{server/ai-employees/built-in/data-organizer/prompt.d.ts → ai/tools/knowledge-base-retrieve.d.ts} +1 -3
- package/dist/ai/tools/knowledge-base-retrieve.js +94 -0
- package/dist/{server/ai-employees/built-in/data-visualization/prompt.d.ts → ai/tools/sub-agents/dispatch-sub-agent-task.d.ts} +1 -3
- package/dist/ai/tools/sub-agents/dispatch-sub-agent-task.js +108 -0
- package/dist/ai/tools/sub-agents/get-ai-employee.d.ts +10 -0
- package/dist/{server/ai-employees/built-in/translator/profile.js → ai/tools/sub-agents/get-ai-employee.js} +28 -21
- package/dist/ai/tools/sub-agents/list-ai-employees.d.ts +10 -0
- package/dist/{server/ai-employees/built-in/email-assistant/profile.js → ai/tools/sub-agents/list-ai-employees.js} +25 -21
- package/dist/ai/tools/sub-agents/shared.d.ts +33 -0
- package/dist/ai/tools/sub-agents/shared.js +169 -0
- package/dist/ai/tools/suggestions.js +15 -4
- package/dist/client/170.d98eacdc00d9d527.js +10 -0
- package/dist/client/228.b18148eb1009d2fb.js +10 -0
- package/dist/client/280.029428b83d62155f.js +10 -0
- package/dist/client/290.0888139e33c9b7cb.js +10 -0
- package/dist/client/{524.954f96ec4fc2fd7a.js → 331.d547c95410476a69.js} +1 -1
- package/dist/client/343.83f7d96664e4e038.js +10 -0
- package/dist/client/406.15c09d98faa2ccf1.js +10 -0
- package/dist/client/428.e9f38da3b0d8b498.js +10 -0
- package/dist/client/486.77c26e2e7f8daf28.js +10 -0
- package/dist/client/502.2b4a51e0a8122e52.js +10 -0
- package/dist/client/525.33a9c8ec28be4ec4.js +10 -0
- package/dist/client/559.133d286a0a0a1d93.js +10 -0
- package/dist/client/{91.90e7098b7fbd5d00.js → 561.776886c5308e3c26.js} +1 -1
- package/dist/client/580.e75f97fb883ad042.js +10 -0
- package/dist/client/597.aa363881a325b5c0.js +10 -0
- package/dist/client/604.de96f3ec4d471afd.js +10 -0
- package/dist/client/614.aa766080f6b99aab.js +10 -0
- package/dist/client/646.ef9d7c2ea8641044.js +10 -0
- package/dist/client/687.224e569a99cae4bb.js +10 -0
- package/dist/client/699.57c0a1acb723202a.js +10 -0
- package/dist/client/711.266b8f1c520d467a.js +10 -0
- package/dist/client/758.a9741e81911e53c3.js +10 -0
- package/dist/client/768.973ce32e15099a48.js +10 -0
- package/dist/client/792.ae8ad1fcae9fd974.js +10 -0
- package/dist/client/820.6a26239ea96c075a.js +10 -0
- package/dist/client/832.0cf69e3f43c320b2.js +10 -0
- package/dist/client/927.ff5cd05b14901ae6.js +10 -0
- package/dist/client/ai-employees/admin/SkillSettings.d.ts +7 -5
- package/dist/client/ai-employees/admin/ToolsSettings.d.ts +17 -0
- package/dist/client/ai-employees/admin/mcp/MCPSettings.d.ts +10 -0
- package/dist/client/ai-employees/admin/mcp/MCPToolsList.d.ts +19 -0
- package/dist/client/ai-employees/admin/mcp/context.d.ts +15 -0
- package/dist/client/ai-employees/admin/mcp/schemas.d.ts +1286 -0
- package/dist/client/ai-employees/built-in/utils.d.ts +1 -0
- package/dist/client/ai-employees/business-report/tools/index.d.ts +10 -0
- package/dist/client/ai-employees/business-report/ui/BusinessReportCard.d.ts +12 -0
- package/dist/client/ai-employees/business-report/ui/BusinessReportModal.d.ts +17 -0
- package/dist/client/ai-employees/business-report/ui/report-utils.d.ts +38 -0
- package/dist/client/ai-employees/chatbox/AIEmployeeSwitch.d.ts +3 -2
- package/dist/client/ai-employees/chatbox/HintMessageHeader.d.ts +10 -0
- package/dist/client/ai-employees/chatbox/ModelSwitcher.d.ts +3 -1
- package/dist/client/ai-employees/chatbox/SearchSwitch.d.ts +3 -1
- package/dist/client/ai-employees/chatbox/Upload.d.ts +3 -1
- package/dist/client/ai-employees/chatbox/conversations/ConversationsList.d.ts +27 -0
- package/dist/client/ai-employees/chatbox/conversations/WorkflowTasksList.d.ts +31 -0
- package/dist/client/ai-employees/chatbox/conversations/common.d.ts +43 -0
- package/dist/client/ai-employees/chatbox/conversations/index.d.ts +9 -0
- package/dist/client/ai-employees/chatbox/hooks/useChatBoxActions.d.ts +5 -3
- package/dist/client/ai-employees/chatbox/hooks/useWorkflowTasks.d.ts +24 -0
- package/dist/client/ai-employees/chatbox/markdown/ECharts.d.ts +1 -2
- package/dist/client/ai-employees/chatbox/markdown/Markdown.d.ts +1 -1
- package/dist/client/ai-employees/chatbox/roles.d.ts +1 -0
- package/dist/client/ai-employees/chatbox/stores/chat-box.d.ts +8 -0
- package/dist/client/ai-employees/chatbox/stores/chat-conversations.d.ts +4 -0
- package/dist/client/ai-employees/chatbox/stores/chat-messages.d.ts +8 -0
- package/dist/client/ai-employees/chatbox/stores/workflow-tasks.d.ts +41 -0
- package/dist/client/ai-employees/chatbox/utils.d.ts +17 -7
- package/dist/client/ai-employees/sub-agents/tools/index.d.ts +10 -0
- package/dist/client/ai-employees/sub-agents/ui/SubAgentDispatchCard.d.ts +21 -0
- package/dist/client/ai-employees/types.d.ts +24 -4
- package/dist/{server/ai-employees/built-in/ai-coding/document/example/js-filter → client/ai-employees/workflow-tasks/tools}/index.d.ts +2 -7
- package/dist/client/ai-employees/workflow-tasks/ui/WorkflowTaskOutputCard.d.ts +11 -0
- package/dist/client/components/ListCollapse.d.ts +28 -0
- package/dist/client/index.js +7 -7
- package/dist/client/manager/ai-manager.d.ts +4 -23
- package/dist/client/repositories/AIConfigRepository.d.ts +11 -3
- package/dist/client/workflow/nodes/employee/components/AIEmployeeSelect.d.ts +10 -0
- package/dist/client/workflow/nodes/employee/components/assigness.d.ts +11 -0
- package/dist/client/workflow/nodes/employee/components/file-inputs.d.ts +10 -0
- package/dist/client/workflow/nodes/employee/components/message-inputs.d.ts +12 -0
- package/dist/client/workflow/nodes/employee/components/model-options.d.ts +10 -0
- package/dist/client/workflow/nodes/employee/components/skill-settings.d.ts +10 -0
- package/dist/client/workflow/nodes/employee/components/structured-output.d.ts +10 -0
- package/dist/client/workflow/nodes/employee/components/users-select.d.ts +15 -0
- package/dist/client/workflow/nodes/employee/components/web-search-options.d.ts +10 -0
- package/dist/client/workflow/nodes/employee/configuration.d.ts +12 -0
- package/dist/client/workflow/nodes/employee/flow-models/feedback.d.ts +13 -0
- package/dist/client/workflow/nodes/employee/flow-models/task.d.ts +13 -0
- package/dist/client/workflow/nodes/employee/index.d.ts +7 -31
- package/dist/collections/ai-employees.js +2 -1
- package/dist/collections/ai-mcp-clients.d.ts +51 -0
- package/dist/collections/ai-mcp-clients.js +111 -0
- package/dist/externalVersion.js +17 -15
- package/dist/locale/en-US.json +136 -8
- package/dist/locale/zh-CN.json +138 -9
- package/dist/node_modules/fast-glob/out/index.js +8 -8
- package/dist/node_modules/fast-glob/package.json +1 -1
- package/dist/node_modules/flexsearch/dist/flexsearch.bundle.min.js +2 -2
- package/dist/node_modules/flexsearch/package.json +1 -1
- package/dist/node_modules/fs-extra/lib/index.js +1 -1
- package/dist/node_modules/fs-extra/package.json +1 -1
- package/dist/node_modules/nodejs-snowflake/nodejs_snowflake.js +1 -1
- package/dist/node_modules/nodejs-snowflake/package.json +1 -1
- package/dist/node_modules/openai/index.js +1 -1
- package/dist/node_modules/openai/package.json +1 -1
- package/dist/node_modules/zod/index.cjs +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/server/ai-employees/ai-conversations.d.ts +70 -0
- package/dist/server/ai-employees/ai-conversations.js +325 -0
- package/dist/server/ai-employees/ai-employee.d.ts +100 -19
- package/dist/server/ai-employees/ai-employee.js +484 -261
- package/dist/server/ai-employees/ai-knowledge-base.d.ts +28 -0
- package/dist/server/ai-employees/ai-knowledge-base.js +167 -0
- package/dist/server/ai-employees/middleware/conversation.d.ts +2 -0
- package/dist/server/ai-employees/middleware/conversation.js +38 -5
- package/dist/server/ai-employees/middleware/index.d.ts +2 -0
- package/dist/server/ai-employees/middleware/index.js +5 -1
- package/dist/server/ai-employees/middleware/skill-tools.d.ts +12 -0
- package/dist/server/ai-employees/middleware/skill-tools.js +88 -0
- package/dist/server/ai-employees/middleware/tools.js +37 -10
- package/dist/server/ai-employees/middleware/workflow-history.d.ts +22 -0
- package/dist/server/ai-employees/middleware/workflow-history.js +173 -0
- package/dist/server/ai-employees/prompts.d.ts +16 -1
- package/dist/server/ai-employees/prompts.js +37 -1
- package/dist/server/ai-employees/sub-agents/dispatcher.d.ts +36 -0
- package/dist/server/ai-employees/sub-agents/dispatcher.js +225 -0
- package/dist/server/ai-employees/sub-agents/index.d.ts +9 -0
- package/dist/server/{migrations/20250923221107-setup-build-in.js → ai-employees/sub-agents/index.js} +9 -13
- package/dist/server/ai-employees/templates/form-assistant.d.ts +2 -2
- package/dist/server/ai-employees/templates/form-assistant.js +2 -2
- package/dist/server/ai-employees/utils.js +2 -2
- package/dist/server/collections/ai-conversations.js +18 -0
- package/dist/server/{ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_contacts_en.d.ts → collections/ai-mcp-clients.d.ts} +1 -4
- package/dist/server/{ai-employees/built-in/nocobase-assistant/index.js → collections/ai-mcp-clients.js} +12 -13
- package/dist/server/{ai-employees/built-in/ai-coding/document/basic/flow-resource.d.ts → collections/ai-skills.d.ts} +1 -4
- package/dist/server/{ai-employees/built-in/email-assistant/index.js → collections/ai-skills.js} +46 -23
- package/dist/server/{ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_opportunities_en.d.ts → collections/ai-workflow-tasks.d.ts} +1 -4
- package/dist/server/collections/ai-workflow-tasks.js +112 -0
- package/dist/server/{ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_accounts_en.d.ts → collections/users-ai-workflow-tasks.d.ts} +1 -4
- package/dist/server/collections/users-ai-workflow-tasks.js +44 -0
- package/dist/server/llm-providers/anthropic.d.ts +1 -0
- package/dist/server/llm-providers/anthropic.js +2 -1
- package/dist/server/llm-providers/dashscope.d.ts +1 -0
- package/dist/server/llm-providers/deepseek.d.ts +1 -0
- package/dist/server/llm-providers/google-genai.d.ts +1 -0
- package/dist/server/llm-providers/google-genai.js +2 -1
- package/dist/server/llm-providers/kimi/provider.d.ts +1 -0
- package/dist/server/llm-providers/openai/responses.d.ts +1 -0
- package/dist/server/llm-providers/openai/responses.js +2 -1
- package/dist/server/llm-providers/provider.d.ts +1 -10
- package/dist/server/llm-providers/provider.js +3 -34
- package/dist/server/manager/ai-coding-manager.d.ts +1 -2
- package/dist/server/manager/ai-coding-manager.js +0 -41
- package/dist/server/manager/ai-context-datasource-manager.js +30 -1
- package/dist/server/manager/built-in-manager.d.ts +2 -4
- package/dist/server/manager/built-in-manager.js +8 -117
- package/dist/server/migrations/20260306000001-migrate-skill-settings-tools.js +68 -0
- package/dist/server/migrations/20260319000000-add-ai-conversations-from.d.ts +14 -0
- package/dist/server/migrations/20260319000000-add-ai-conversations-from.js +63 -0
- package/dist/server/plugin.d.ts +6 -1
- package/dist/server/plugin.js +31 -8
- package/dist/server/resource/aiConversations.js +112 -188
- package/dist/server/resource/aiEmployees.js +5 -7
- package/dist/server/resource/aiMcpClients.d.ts +11 -0
- package/dist/server/resource/aiMcpClients.js +78 -0
- package/dist/server/{ai-employees/built-in/ai-coding/document/example/js-column/index.d.ts → resource/aiSkills.d.ts} +3 -7
- package/dist/server/resource/aiSkills.js +71 -0
- package/dist/server/resource/aiTools.js +4 -6
- package/dist/server/resource/aiWorkflowTasks.d.ts +12 -0
- package/dist/server/resource/aiWorkflowTasks.js +290 -0
- package/dist/server/tools/docs.js +4 -3
- package/dist/server/tools/workflow-caller.js +1 -0
- package/dist/server/types/ai-chat-conversation.type.d.ts +8 -2
- package/dist/server/types/ai-message.type.d.ts +7 -0
- package/dist/server/utils.d.ts +3 -0
- package/dist/server/utils.js +28 -3
- package/dist/server/workflow/nodes/employee/files.d.ts +16 -0
- package/dist/server/workflow/nodes/employee/files.js +125 -0
- package/dist/server/workflow/nodes/employee/handler.d.ts +11 -0
- package/dist/server/workflow/nodes/employee/handler.js +107 -0
- package/dist/server/workflow/nodes/employee/index.d.ts +17 -0
- package/dist/server/workflow/nodes/employee/index.js +391 -0
- package/dist/server/workflow/nodes/employee/tools.d.ts +12 -0
- package/dist/server/workflow/nodes/employee/tools.js +133 -0
- package/dist/server/workflow/nodes/employee/types.d.ts +35 -0
- package/dist/server/workflow/nodes/employee/types.js +24 -0
- package/dist/server/workflow/utils.d.ts +14 -0
- package/dist/server/workflow/utils.js +111 -0
- package/package.json +4 -2
- package/dist/client/107.64d9efa24d6b9143.js +0 -10
- package/dist/client/124.768c8aa5d6e6b461.js +0 -10
- package/dist/client/159.d52107c7a34ce2da.js +0 -10
- package/dist/client/192.0419770b69678994.js +0 -10
- package/dist/client/204.91be8cfc54d91a59.js +0 -10
- package/dist/client/238.9f784a7cdb751999.js +0 -10
- package/dist/client/263.6e1dfb1cbb1964f5.js +0 -10
- package/dist/client/35.5ee7503d9c09daa8.js +0 -10
- package/dist/client/47.6bd245f2140efd24.js +0 -10
- package/dist/client/481.03b3d2306d409933.js +0 -10
- package/dist/client/586.6a1510cabaa84f23.js +0 -10
- package/dist/client/650.8871a07b31c307ea.js +0 -10
- package/dist/client/755.e295bbd2b2a1cc21.js +0 -10
- package/dist/client/772.d51f683c55e18dd4.js +0 -10
- package/dist/client/870.84187dcb8c89b4dc.js +0 -10
- package/dist/client/933.baab3aa75f30e020.js +0 -10
- package/dist/client/987.3aee964e7f406939.js +0 -10
- package/dist/server/ai-employees/built-in/ai-coding/document/basic/flow-resource.js +0 -256
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-column/index.js +0 -48
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_accounts_en.js +0 -452
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_contacts_en.js +0 -363
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_opportunities_en.js +0 -270
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_quotations_en.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_quotations_en.js +0 -219
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_tickets_en.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_tickets_en.js +0 -409
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/accounts_filter_ant_style.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/accounts_filter_ant_style.js +0 -324
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/contacts_filter_ant_style.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/contacts_filter_ant_style.js +0 -309
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/index.js +0 -50
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/leads_filter_ant_style.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/leads_filter_ant_style.js +0 -345
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/opportunities_filter_ant_style.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/opportunities_filter_ant_style.js +0 -381
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/product_categories_ant_style.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/product_categories_ant_style.js +0 -545
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/tickets_filter_ant_style.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/tickets_filter_ant_style.js +0 -346
- package/dist/server/ai-employees/built-in/ai-coding/document/js-action.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/js-action.js +0 -102
- package/dist/server/ai-employees/built-in/ai-coding/document/js-block.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/js-block.js +0 -314
- package/dist/server/ai-employees/built-in/ai-coding/document/js-column.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/js-column.js +0 -113
- package/dist/server/ai-employees/built-in/ai-coding/document/js-field.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/js-field.js +0 -498
- package/dist/server/ai-employees/built-in/ai-coding/document/js-item.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/js-item.js +0 -184
- package/dist/server/ai-employees/built-in/ai-coding/index.d.ts +0 -37
- package/dist/server/ai-employees/built-in/ai-coding/index.js +0 -99
- package/dist/server/ai-employees/built-in/ai-coding/profile.d.ts +0 -27
- package/dist/server/ai-employees/built-in/ai-coding/profile.js +0 -60
- package/dist/server/ai-employees/built-in/ai-coding/prompt_en.md +0 -110
- package/dist/server/ai-employees/built-in/data-modeling/index.d.ts +0 -37
- package/dist/server/ai-employees/built-in/data-modeling/profile.d.ts +0 -27
- package/dist/server/ai-employees/built-in/data-modeling/profile.js +0 -60
- package/dist/server/ai-employees/built-in/data-modeling/prompt.js +0 -283
- package/dist/server/ai-employees/built-in/data-organizer/index.d.ts +0 -37
- package/dist/server/ai-employees/built-in/data-organizer/index.js +0 -63
- package/dist/server/ai-employees/built-in/data-organizer/profile.d.ts +0 -27
- package/dist/server/ai-employees/built-in/data-organizer/profile.js +0 -60
- package/dist/server/ai-employees/built-in/data-visualization/index.d.ts +0 -37
- package/dist/server/ai-employees/built-in/data-visualization/index.js +0 -58
- package/dist/server/ai-employees/built-in/data-visualization/profile.d.ts +0 -27
- package/dist/server/ai-employees/built-in/data-visualization/profile.js +0 -60
- package/dist/server/ai-employees/built-in/email-assistant/index.d.ts +0 -34
- package/dist/server/ai-employees/built-in/email-assistant/profile.d.ts +0 -27
- package/dist/server/ai-employees/built-in/email-assistant/prompt.d.ts +0 -12
- package/dist/server/ai-employees/built-in/insights-analyst/index.d.ts +0 -37
- package/dist/server/ai-employees/built-in/insights-analyst/index.js +0 -63
- package/dist/server/ai-employees/built-in/insights-analyst/profile.d.ts +0 -27
- package/dist/server/ai-employees/built-in/insights-analyst/profile.js +0 -60
- package/dist/server/ai-employees/built-in/insights-analyst/prompt.d.ts +0 -12
- package/dist/server/ai-employees/built-in/nocobase-assistant/index.d.ts +0 -34
- package/dist/server/ai-employees/built-in/nocobase-assistant/profile.d.ts +0 -27
- package/dist/server/ai-employees/built-in/nocobase-assistant/profile.js +0 -60
- package/dist/server/ai-employees/built-in/nocobase-assistant/prompt.d.ts +0 -12
- package/dist/server/ai-employees/built-in/nocobase-assistant/prompt.js +0 -52
- package/dist/server/ai-employees/built-in/research-analyst/index.d.ts +0 -37
- package/dist/server/ai-employees/built-in/research-analyst/index.js +0 -63
- package/dist/server/ai-employees/built-in/research-analyst/profile.d.ts +0 -27
- package/dist/server/ai-employees/built-in/research-analyst/profile.js +0 -60
- package/dist/server/ai-employees/built-in/research-analyst/prompt.d.ts +0 -12
- package/dist/server/ai-employees/built-in/translator/index.d.ts +0 -37
- package/dist/server/ai-employees/built-in/translator/index.js +0 -67
- package/dist/server/ai-employees/built-in/translator/profile.d.ts +0 -27
- package/dist/server/ai-employees/built-in/translator/prompt.d.ts +0 -12
- /package/dist/client/ai-employees/chatbox/{Conversations.d.ts → conversations/Conversations.d.ts} +0 -0
- /package/dist/server/migrations/{20250923221107-setup-build-in.d.ts → 20260306000001-migrate-skill-settings-tools.d.ts} +0 -0
|
@@ -0,0 +1,98 @@
|
|
|
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 __create = Object.create;
|
|
11
|
+
var __defProp = Object.defineProperty;
|
|
12
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
+
var __export = (target, all) => {
|
|
17
|
+
for (var name in all)
|
|
18
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
+
};
|
|
20
|
+
var __copyProps = (to, from, except, desc) => {
|
|
21
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
+
for (let key of __getOwnPropNames(from))
|
|
23
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
+
}
|
|
26
|
+
return to;
|
|
27
|
+
};
|
|
28
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
+
mod
|
|
35
|
+
));
|
|
36
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
+
var businessReportGenerator_exports = {};
|
|
38
|
+
__export(businessReportGenerator_exports, {
|
|
39
|
+
default: () => businessReportGenerator_default
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(businessReportGenerator_exports);
|
|
42
|
+
var import_ai = require("@nocobase/ai");
|
|
43
|
+
var import_zod = require("zod");
|
|
44
|
+
var import_package = __toESM(require("../../../../../package.json"));
|
|
45
|
+
function normalizeChartsInput(value) {
|
|
46
|
+
if (typeof value !== "string") {
|
|
47
|
+
return value;
|
|
48
|
+
}
|
|
49
|
+
const raw = value.trim();
|
|
50
|
+
if (!raw) {
|
|
51
|
+
return void 0;
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
const parsed = JSON.parse(raw);
|
|
55
|
+
return Array.isArray(parsed) ? parsed : void 0;
|
|
56
|
+
} catch (error) {
|
|
57
|
+
return void 0;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const chartSchema = import_zod.z.object({
|
|
61
|
+
title: import_zod.z.string().optional().describe("Chart title shown in the report."),
|
|
62
|
+
summary: import_zod.z.string().optional().describe("Short explanation of what this chart shows."),
|
|
63
|
+
options: import_zod.z.object({}).catchall(import_zod.z.any()).describe("Valid ECharts options object.")
|
|
64
|
+
});
|
|
65
|
+
var businessReportGenerator_default = (0, import_ai.defineTools)({
|
|
66
|
+
scope: "SPECIFIED",
|
|
67
|
+
defaultPermission: "ALLOW",
|
|
68
|
+
introduction: {
|
|
69
|
+
title: `{{t("ai.tools.businessReportGenerator.title", { ns: "${import_package.default.name}" })}}`,
|
|
70
|
+
about: `{{t("ai.tools.businessReportGenerator.about", { ns: "${import_package.default.name}" })}}`
|
|
71
|
+
},
|
|
72
|
+
definition: {
|
|
73
|
+
name: "businessReportGenerator",
|
|
74
|
+
description: "Generate a complete business analysis report with markdown content and embedded ECharts charts in a single tool call. Call this tool once per report and stop after it succeeds.",
|
|
75
|
+
schema: import_zod.z.object({
|
|
76
|
+
title: import_zod.z.string().describe("Report title."),
|
|
77
|
+
summary: import_zod.z.string().optional().describe("Short executive summary shown in the report header."),
|
|
78
|
+
markdown: import_zod.z.string().describe(
|
|
79
|
+
"Main report body in markdown. Use sections for findings, risks, and recommendations. To place a chart inline at a specific position, insert placeholders like {{chart:1}}, {{chart:2}}. Do not include any generated-at footer because the platform renders that automatically."
|
|
80
|
+
),
|
|
81
|
+
charts: import_zod.z.union([import_zod.z.array(chartSchema), import_zod.z.string()]).optional().describe(
|
|
82
|
+
"Charts included in the report. Put full ECharts options here directly instead of generating charts in a separate step. If chart data is unavailable, omit this field instead of retrying the tool."
|
|
83
|
+
),
|
|
84
|
+
fileName: import_zod.z.string().optional().describe("Optional export file name without extension.")
|
|
85
|
+
})
|
|
86
|
+
},
|
|
87
|
+
invoke: async (_ctx, args) => {
|
|
88
|
+
const charts = normalizeChartsInput(args.charts);
|
|
89
|
+
return {
|
|
90
|
+
status: "success",
|
|
91
|
+
content: JSON.stringify({
|
|
92
|
+
title: args.title,
|
|
93
|
+
chartCount: Array.isArray(charts) ? charts.length : 0,
|
|
94
|
+
fileName: args.fileName ?? null
|
|
95
|
+
})
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
scope: GENERAL
|
|
3
|
+
name: document-search
|
|
4
|
+
description: helps users search and read documentation using keyword-based indexing and file browsing capabilities.
|
|
5
|
+
introduction:
|
|
6
|
+
title: '{{t("ai.skills.documentSearch.title", { ns: "@nocobase/plugin-ai" })}}'
|
|
7
|
+
about: '{{t("ai.skills.documentSearch.about", { ns: "@nocobase/plugin-ai" })}}'
|
|
8
|
+
tools: ['searchDocs', 'readDocEntry']
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
You are a professional documentation assistant for NocoBase.
|
|
12
|
+
|
|
13
|
+
You help users find relevant documentation by searching indexed content and reading specific files or directories.
|
|
14
|
+
|
|
15
|
+
# Primary Workflows
|
|
16
|
+
|
|
17
|
+
## Search Documentation
|
|
18
|
+
|
|
19
|
+
To find documentation on a specific topic:
|
|
20
|
+
|
|
21
|
+
1. **Identify Search Keywords**
|
|
22
|
+
- Extract key terms, API names, or module identifiers from the user's query.
|
|
23
|
+
- Focus on specific identifiers rather than full sentences.
|
|
24
|
+
|
|
25
|
+
2. **Search Using Keywords**
|
|
26
|
+
- Use the `searchDocs` tool to find matching documents.
|
|
27
|
+
- Provide a module key (e.g., `runjs`, `workflow`) and relevant keywords.
|
|
28
|
+
- Review the returned matches to identify relevant content.
|
|
29
|
+
|
|
30
|
+
3. **Read Matching Documents**
|
|
31
|
+
- Use the `readDocEntry` tool to read the content of matching files.
|
|
32
|
+
- Browse directories to explore the documentation structure if needed.
|
|
33
|
+
|
|
34
|
+
## Browse Documentation Structure
|
|
35
|
+
|
|
36
|
+
To explore available documentation:
|
|
37
|
+
|
|
38
|
+
1. **List Available Modules**
|
|
39
|
+
- Call `searchDocs` with any module key to see which modules are available.
|
|
40
|
+
- The response will include `availableModules` listing all indexed documentation.
|
|
41
|
+
|
|
42
|
+
2. **Explore Directory Contents**
|
|
43
|
+
- Use `readDocEntry` with a module path (e.g., `runjs` or `runjs/context`) to list directory contents.
|
|
44
|
+
- Navigate through the hierarchy by reading subdirectories.
|
|
45
|
+
|
|
46
|
+
# Available Tools
|
|
47
|
+
|
|
48
|
+
- `searchDocs`: Search indexed documentation using FlexSearch-based keyword indexing. Provide a module key and keywords to find matching documents. Returns file paths that can be read with `readDocEntry`.
|
|
49
|
+
- `readDocEntry`: Read files or list directories inside the documentation storage. Supports reading up to 3 paths per call. Returns file content or directory listings.
|
|
50
|
+
|
|
51
|
+
# Path Format
|
|
52
|
+
|
|
53
|
+
- Use canonical module-based paths: `moduleName/path/to/file.md`
|
|
54
|
+
- Examples: `runjs/context/router/index.md`, `workflow/triggers/manual.md`
|
|
55
|
+
- Leading slashes are optional: `/runjs/context` is equivalent to `runjs/context`
|
|
56
|
+
- Relative segments (`..`) and wildcards are not allowed for security reasons.
|
|
57
|
+
|
|
58
|
+
# Best Practices
|
|
59
|
+
|
|
60
|
+
- Use specific keywords (API names, function names, module terms) rather than natural language queries.
|
|
61
|
+
- Start with a narrow search and broaden if needed.
|
|
62
|
+
- After finding relevant files, read them to provide detailed answers.
|
|
63
|
+
- Use directory browsing to explore the documentation structure when the exact file is unknown.
|
|
64
|
+
|
|
65
|
+
# Notes
|
|
66
|
+
|
|
67
|
+
- Document indexes must be created first using the `ai:create-docs-index` command.
|
|
68
|
+
- If no indexes are available, inform the user to run the indexing command.
|
|
69
|
+
- Search results include a relevance score based on keyword matching.
|
|
@@ -7,9 +7,11 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
var __create = Object.create;
|
|
10
11
|
var __defProp = Object.defineProperty;
|
|
11
12
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
13
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
13
15
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
16
|
var __export = (target, all) => {
|
|
15
17
|
for (var name in all)
|
|
@@ -23,6 +25,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
23
25
|
}
|
|
24
26
|
return to;
|
|
25
27
|
};
|
|
28
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
+
mod
|
|
35
|
+
));
|
|
26
36
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
37
|
var chartGenerator_exports = {};
|
|
28
38
|
__export(chartGenerator_exports, {
|
|
@@ -31,11 +41,13 @@ __export(chartGenerator_exports, {
|
|
|
31
41
|
module.exports = __toCommonJS(chartGenerator_exports);
|
|
32
42
|
var import_ai = require("@nocobase/ai");
|
|
33
43
|
var import_zod = require("zod");
|
|
44
|
+
var import_package = __toESM(require("../../../package.json"));
|
|
34
45
|
var chartGenerator_default = (0, import_ai.defineTools)({
|
|
35
|
-
scope: "
|
|
46
|
+
scope: "GENERAL",
|
|
47
|
+
defaultPermission: "ALLOW",
|
|
36
48
|
introduction: {
|
|
37
|
-
title:
|
|
38
|
-
about:
|
|
49
|
+
title: `{{t("Chart generator", { ns: "${import_package.default.name}" })}}`,
|
|
50
|
+
about: `{{t("Generates ECharts options (JSON) based on user input or data context.", { ns: "${import_package.default.name}" })}}`
|
|
39
51
|
},
|
|
40
52
|
definition: {
|
|
41
53
|
name: "chartGenerator",
|
|
@@ -7,9 +7,11 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
var __create = Object.create;
|
|
10
11
|
var __defProp = Object.defineProperty;
|
|
11
12
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
13
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
13
15
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
16
|
var __export = (target, all) => {
|
|
15
17
|
for (var name in all)
|
|
@@ -23,6 +25,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
23
25
|
}
|
|
24
26
|
return to;
|
|
25
27
|
};
|
|
28
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
+
mod
|
|
35
|
+
));
|
|
26
36
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
37
|
var formFiller_exports = {};
|
|
28
38
|
__export(formFiller_exports, {
|
|
@@ -31,13 +41,14 @@ __export(formFiller_exports, {
|
|
|
31
41
|
module.exports = __toCommonJS(formFiller_exports);
|
|
32
42
|
var import_ai = require("@nocobase/ai");
|
|
33
43
|
var import_zod = require("zod");
|
|
44
|
+
var import_package = __toESM(require("../../../package.json"));
|
|
34
45
|
var formFiller_default = (0, import_ai.defineTools)({
|
|
35
46
|
scope: "GENERAL",
|
|
36
47
|
defaultPermission: "ALLOW",
|
|
37
48
|
execution: "frontend",
|
|
38
49
|
introduction: {
|
|
39
|
-
title:
|
|
40
|
-
about:
|
|
50
|
+
title: `{{t("Form filler", { ns: "${import_package.default.name}" })}}`,
|
|
51
|
+
about: `{{t("Fill the form with the given content", { ns: "${import_package.default.name}" })}}`
|
|
41
52
|
},
|
|
42
53
|
definition: {
|
|
43
54
|
name: "formFiller",
|
package/dist/{server/ai-employees/built-in/data-modeling/prompt.d.ts → ai/tools/getSkill.d.ts}
RENAMED
|
@@ -6,7 +6,5 @@
|
|
|
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
|
-
declare const _default:
|
|
10
|
-
'en-US': string;
|
|
11
|
-
};
|
|
9
|
+
declare const _default: import("@nocobase/ai").ToolsOptions;
|
|
12
10
|
export default _default;
|
|
@@ -34,38 +34,45 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
34
34
|
mod
|
|
35
35
|
));
|
|
36
36
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
-
var
|
|
38
|
-
__export(
|
|
39
|
-
default: () =>
|
|
37
|
+
var getSkill_exports = {};
|
|
38
|
+
__export(getSkill_exports, {
|
|
39
|
+
default: () => getSkill_default
|
|
40
40
|
});
|
|
41
|
-
module.exports = __toCommonJS(
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
41
|
+
module.exports = __toCommonJS(getSkill_exports);
|
|
42
|
+
var import_ai = require("@nocobase/ai");
|
|
43
|
+
var import_zod = require("zod");
|
|
44
|
+
var import_package = __toESM(require("../../../package.json"));
|
|
45
|
+
var getSkill_default = (0, import_ai.defineTools)({
|
|
46
|
+
scope: "GENERAL",
|
|
47
|
+
defaultPermission: "ALLOW",
|
|
48
|
+
introduction: {
|
|
49
|
+
title: `{{t("Load specific SKILLS", { ns: "${import_package.default.name}" })}}`,
|
|
50
|
+
about: `{{t("Loading content of the specific SKILLS", { ns: "${import_package.default.name}" })}}`
|
|
51
|
+
},
|
|
52
|
+
definition: {
|
|
53
|
+
name: "getSkill",
|
|
54
|
+
description: "Get the content and related tools for a specified skill.",
|
|
55
|
+
schema: import_zod.z.object({
|
|
56
|
+
skillName: import_zod.z.string().describe("Name of skill to load")
|
|
57
|
+
})
|
|
58
|
+
},
|
|
59
|
+
invoke: async (ctx, args) => {
|
|
60
|
+
const target = await ctx.app.aiManager.skillsManager.getSkills(args.skillName);
|
|
61
|
+
if (!target) {
|
|
62
|
+
return {
|
|
63
|
+
status: "error",
|
|
64
|
+
content: {
|
|
65
|
+
message: "Skill not found"
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
status: "success",
|
|
71
|
+
content: {
|
|
72
|
+
skillName: target.name,
|
|
73
|
+
skillContent: target.content,
|
|
74
|
+
activatedTools: target.tools
|
|
68
75
|
}
|
|
69
|
-
|
|
76
|
+
};
|
|
70
77
|
}
|
|
71
|
-
};
|
|
78
|
+
});
|
|
@@ -6,7 +6,5 @@
|
|
|
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
|
-
declare const _default:
|
|
10
|
-
'en-US': string;
|
|
11
|
-
};
|
|
9
|
+
declare const _default: import("@nocobase/ai").ToolsOptions;
|
|
12
10
|
export default _default;
|
|
@@ -0,0 +1,94 @@
|
|
|
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 __create = Object.create;
|
|
11
|
+
var __defProp = Object.defineProperty;
|
|
12
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
+
var __export = (target, all) => {
|
|
17
|
+
for (var name in all)
|
|
18
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
+
};
|
|
20
|
+
var __copyProps = (to, from, except, desc) => {
|
|
21
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
+
for (let key of __getOwnPropNames(from))
|
|
23
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
+
}
|
|
26
|
+
return to;
|
|
27
|
+
};
|
|
28
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
+
mod
|
|
35
|
+
));
|
|
36
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
+
var knowledge_base_retrieve_exports = {};
|
|
38
|
+
__export(knowledge_base_retrieve_exports, {
|
|
39
|
+
default: () => knowledge_base_retrieve_default
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(knowledge_base_retrieve_exports);
|
|
42
|
+
var import_ai = require("@nocobase/ai");
|
|
43
|
+
var import_zod = require("zod");
|
|
44
|
+
var import_shared = require("./sub-agents/shared");
|
|
45
|
+
var import_package = __toESM(require("../../../package.json"));
|
|
46
|
+
var knowledge_base_retrieve_default = (0, import_ai.defineTools)({
|
|
47
|
+
scope: "SPECIFIED",
|
|
48
|
+
defaultPermission: "ALLOW",
|
|
49
|
+
introduction: {
|
|
50
|
+
title: `{{t("Knowledge base retrieval", { ns: "${import_package.default.name}" })}}`,
|
|
51
|
+
about: `{{t("Retrieve relevant content from the knowledge base.", { ns: "${import_package.default.name}" })}}`
|
|
52
|
+
},
|
|
53
|
+
definition: {
|
|
54
|
+
name: "knowledge-base-retrieve",
|
|
55
|
+
description: "Search the knowledge base when you need to extract retrieval queries from the conversation, verify data returned by other tools against the knowledge base, or look up information derived from user-uploaded files.",
|
|
56
|
+
schema: import_zod.z.object({
|
|
57
|
+
query: import_zod.z.string().describe(
|
|
58
|
+
"A concise retrieval query distilled from the conversation, tool outputs, or user-uploaded file content to search the knowledge base."
|
|
59
|
+
)
|
|
60
|
+
})
|
|
61
|
+
},
|
|
62
|
+
async invoke(ctx, { query }, runtime) {
|
|
63
|
+
const toolCallId = runtime == null ? void 0 : runtime.toolCallId;
|
|
64
|
+
if (!toolCallId) {
|
|
65
|
+
throw new Error("Missing tool call context");
|
|
66
|
+
}
|
|
67
|
+
const aiToolMessage = await ctx.db.getRepository("aiToolMessages").findOne({
|
|
68
|
+
filter: {
|
|
69
|
+
toolCallId
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
if (!(aiToolMessage == null ? void 0 : aiToolMessage.sessionId)) {
|
|
73
|
+
throw new Error(`AI tool message not found for tool call "${toolCallId}"`);
|
|
74
|
+
}
|
|
75
|
+
const aiConversation = await ctx.db.getRepository("aiConversations").findOne({
|
|
76
|
+
filter: {
|
|
77
|
+
sessionId: aiToolMessage.sessionId
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
const username = aiConversation == null ? void 0 : aiConversation.aiEmployeeUsername;
|
|
81
|
+
if (!username) {
|
|
82
|
+
throw new Error(`AI conversation not found for session "${aiToolMessage.sessionId}"`);
|
|
83
|
+
}
|
|
84
|
+
const plugin = (0, import_shared.getAIPlugin)(ctx);
|
|
85
|
+
const content = await plugin.knowledgeBaseManager.retrievePrompt({
|
|
86
|
+
username,
|
|
87
|
+
query
|
|
88
|
+
});
|
|
89
|
+
return {
|
|
90
|
+
status: "success",
|
|
91
|
+
content
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
});
|
|
@@ -6,7 +6,5 @@
|
|
|
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
|
-
declare const _default:
|
|
10
|
-
'en-US': string;
|
|
11
|
-
};
|
|
9
|
+
declare const _default: import("@nocobase/ai").ToolsOptions;
|
|
12
10
|
export default _default;
|
|
@@ -0,0 +1,108 @@
|
|
|
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 __create = Object.create;
|
|
11
|
+
var __defProp = Object.defineProperty;
|
|
12
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
+
var __export = (target, all) => {
|
|
17
|
+
for (var name in all)
|
|
18
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
+
};
|
|
20
|
+
var __copyProps = (to, from, except, desc) => {
|
|
21
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
+
for (let key of __getOwnPropNames(from))
|
|
23
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
+
}
|
|
26
|
+
return to;
|
|
27
|
+
};
|
|
28
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
+
mod
|
|
35
|
+
));
|
|
36
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
+
var dispatch_sub_agent_task_exports = {};
|
|
38
|
+
__export(dispatch_sub_agent_task_exports, {
|
|
39
|
+
default: () => dispatch_sub_agent_task_default
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(dispatch_sub_agent_task_exports);
|
|
42
|
+
var import_ai = require("@nocobase/ai");
|
|
43
|
+
var import_zod = require("zod");
|
|
44
|
+
var import_shared = require("./shared");
|
|
45
|
+
var import_package = __toESM(require("../../../../package.json"));
|
|
46
|
+
var dispatch_sub_agent_task_default = (0, import_ai.defineTools)({
|
|
47
|
+
scope: "SPECIFIED",
|
|
48
|
+
defaultPermission: "ALLOW",
|
|
49
|
+
introduction: {
|
|
50
|
+
title: `{{t("AI employee task dispatching", { ns: "${import_package.default.name}" })}}`,
|
|
51
|
+
about: `{{t("Awaken and assign specific tasks to ai employees", { ns: "${import_package.default.name}" })}}`
|
|
52
|
+
},
|
|
53
|
+
definition: {
|
|
54
|
+
name: "dispatch-sub-agent-task",
|
|
55
|
+
description: "Dispatch a question to a target AI employee and return the sub-session result.",
|
|
56
|
+
schema: import_zod.z.object({
|
|
57
|
+
username: import_zod.z.string().describe("The username of the target AI employee."),
|
|
58
|
+
question: import_zod.z.string().describe("The question or task that should be executed by the target AI employee.")
|
|
59
|
+
})
|
|
60
|
+
},
|
|
61
|
+
async invoke(ctx, { username, question }, { toolCallId, writer }) {
|
|
62
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
63
|
+
const sessionId = (_c = (_b = (_a = ctx.action) == null ? void 0 : _a.params) == null ? void 0 : _b.values) == null ? void 0 : _c.sessionId;
|
|
64
|
+
const userId = (_e = (_d = ctx.auth) == null ? void 0 : _d.user) == null ? void 0 : _e.id;
|
|
65
|
+
if (!userId) {
|
|
66
|
+
throw new Error("User not authenticated");
|
|
67
|
+
}
|
|
68
|
+
const plugin = (0, import_shared.getAIPlugin)(ctx);
|
|
69
|
+
const employee = await (0, import_shared.getAccessibleAIEmployee)(ctx, username);
|
|
70
|
+
if (!employee) {
|
|
71
|
+
throw new Error(`AI employee "${username}" not found`);
|
|
72
|
+
}
|
|
73
|
+
let subSessionId;
|
|
74
|
+
const skillSettings = await (0, import_shared.getSkillSettingsFromMain)(ctx);
|
|
75
|
+
const existedConversation = await plugin.aiConversationsManager.resolveSubAgentConversation(sessionId, toolCallId);
|
|
76
|
+
if (existedConversation) {
|
|
77
|
+
subSessionId = existedConversation.sessionId;
|
|
78
|
+
} else {
|
|
79
|
+
const newConversation = await plugin.aiConversationsManager.create({
|
|
80
|
+
userId,
|
|
81
|
+
aiEmployee: {
|
|
82
|
+
username: employee.get("username")
|
|
83
|
+
},
|
|
84
|
+
title: question.slice(0, 30),
|
|
85
|
+
from: "sub-agent",
|
|
86
|
+
options: {
|
|
87
|
+
skillSettings
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
subSessionId = newConversation.sessionId;
|
|
91
|
+
}
|
|
92
|
+
await (0, import_shared.updateMessageMetadata)(ctx, toolCallId, subSessionId, "pending");
|
|
93
|
+
const answer = await plugin.subAgentsDispatcher.run({
|
|
94
|
+
ctx,
|
|
95
|
+
sessionId: subSessionId,
|
|
96
|
+
employee,
|
|
97
|
+
model: ((_h = (_g = (_f = ctx.action) == null ? void 0 : _f.params) == null ? void 0 : _g.values) == null ? void 0 : _h.model) ?? employee.get("modelSettings"),
|
|
98
|
+
question,
|
|
99
|
+
skillSettings,
|
|
100
|
+
writer
|
|
101
|
+
});
|
|
102
|
+
await (0, import_shared.updateMessageMetadata)(ctx, toolCallId, subSessionId, "completed");
|
|
103
|
+
return {
|
|
104
|
+
sessionId: subSessionId,
|
|
105
|
+
answer
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
});
|
|
@@ -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
|
+
declare const _default: import("@nocobase/ai").ToolsOptions;
|
|
10
|
+
export default _default;
|
|
@@ -34,27 +34,34 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
34
34
|
mod
|
|
35
35
|
));
|
|
36
36
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
-
var
|
|
38
|
-
__export(
|
|
39
|
-
default: () =>
|
|
37
|
+
var get_ai_employee_exports = {};
|
|
38
|
+
__export(get_ai_employee_exports, {
|
|
39
|
+
default: () => get_ai_employee_default
|
|
40
40
|
});
|
|
41
|
-
module.exports = __toCommonJS(
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
41
|
+
module.exports = __toCommonJS(get_ai_employee_exports);
|
|
42
|
+
var import_ai = require("@nocobase/ai");
|
|
43
|
+
var import_zod = require("zod");
|
|
44
|
+
var import_shared = require("./shared");
|
|
45
|
+
var import_package = __toESM(require("../../../../package.json"));
|
|
46
|
+
var get_ai_employee_default = (0, import_ai.defineTools)({
|
|
47
|
+
scope: "SPECIFIED",
|
|
48
|
+
defaultPermission: "ALLOW",
|
|
49
|
+
introduction: {
|
|
50
|
+
title: `{{t("Get AI employee", { ns: "${import_package.default.name}" })}}`,
|
|
51
|
+
about: `{{t("Get the detailed definition of AI employee", { ns: "${import_package.default.name}" })}}`
|
|
51
52
|
},
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
definition: {
|
|
54
|
+
name: "get-ai-employee",
|
|
55
|
+
description: "Get the detailed profile of one accessible AI employee by username.",
|
|
56
|
+
schema: import_zod.z.object({
|
|
57
|
+
username: import_zod.z.string().describe("The username of the AI employee.")
|
|
58
|
+
})
|
|
59
|
+
},
|
|
60
|
+
async invoke(ctx, args) {
|
|
61
|
+
const employee = await (0, import_shared.getAccessibleAIEmployee)(ctx, args.username);
|
|
62
|
+
if (!employee) {
|
|
63
|
+
throw new Error(`AI employee "${args.username}" not found`);
|
|
64
|
+
}
|
|
65
|
+
return (0, import_shared.serializeEmployeeDetail)(ctx, employee);
|
|
59
66
|
}
|
|
60
|
-
};
|
|
67
|
+
});
|
|
@@ -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
|
+
declare const _default: import("@nocobase/ai").ToolsOptions;
|
|
10
|
+
export default _default;
|