plugin-agent-orchestrator 1.0.6 → 1.0.14
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/README.md +16 -291
- package/dist/client/AIEmployeesContext.d.ts +7 -0
- package/dist/client/OrchestratorSettings.d.ts +2 -1
- package/dist/client/index.js +1 -1
- package/dist/client/plugin.d.ts +1 -0
- package/dist/client/skill-hub/components/ExecutionHistory.d.ts +2 -0
- package/dist/client/skill-hub/components/ExecutionProgress.d.ts +20 -0
- package/dist/client/skill-hub/components/GitSkillImport.d.ts +7 -0
- package/dist/client/skill-hub/components/SkillEditor.d.ts +7 -0
- package/dist/client/skill-hub/components/SkillManager.d.ts +2 -0
- package/dist/client/skill-hub/components/SkillMetrics.d.ts +2 -0
- package/dist/client/skill-hub/components/SkillTestPanel.d.ts +7 -0
- package/dist/client/skill-hub/index.d.ts +10 -0
- package/dist/client/skill-hub/locale.d.ts +3 -0
- package/dist/client/skill-hub/tools/InteractionSchemasProvider.d.ts +19 -0
- package/dist/client/skill-hub/tools/SkillHubCard.d.ts +3 -0
- package/dist/client/skill-hub/utils/jsonFields.d.ts +3 -0
- package/dist/externalVersion.js +6 -6
- package/dist/node_modules/adm-zip/LICENSE +21 -0
- package/dist/node_modules/adm-zip/adm-zip.js +1 -0
- package/dist/node_modules/adm-zip/headers/entryHeader.js +377 -0
- package/dist/node_modules/adm-zip/headers/index.js +2 -0
- package/dist/node_modules/adm-zip/headers/mainHeader.js +130 -0
- package/dist/node_modules/adm-zip/methods/deflater.js +33 -0
- package/dist/node_modules/adm-zip/methods/index.js +3 -0
- package/dist/node_modules/adm-zip/methods/inflater.js +34 -0
- package/dist/node_modules/adm-zip/methods/zipcrypto.js +175 -0
- package/dist/node_modules/adm-zip/package.json +1 -0
- package/dist/node_modules/adm-zip/util/constants.js +142 -0
- package/dist/node_modules/adm-zip/util/decoder.js +5 -0
- package/dist/node_modules/adm-zip/util/errors.js +63 -0
- package/dist/node_modules/adm-zip/util/fattr.js +76 -0
- package/dist/node_modules/adm-zip/util/index.js +5 -0
- package/dist/node_modules/adm-zip/util/utils.js +339 -0
- package/dist/node_modules/adm-zip/zipEntry.js +405 -0
- package/dist/node_modules/adm-zip/zipFile.js +446 -0
- package/dist/node_modules/simple-git/dist/cjs/index.js +7399 -0
- package/dist/node_modules/simple-git/dist/esm/index.js +4745 -0
- package/dist/node_modules/simple-git/dist/esm/package.json +3 -0
- package/dist/node_modules/simple-git/dist/src/lib/api.d.ts +13 -0
- package/dist/node_modules/simple-git/dist/src/lib/args/log-format.d.ts +9 -0
- package/dist/node_modules/simple-git/dist/src/lib/errors/git-construct-error.d.ts +15 -0
- package/dist/node_modules/simple-git/dist/src/lib/errors/git-error.d.ts +30 -0
- package/dist/node_modules/simple-git/dist/src/lib/errors/git-plugin-error.d.ts +7 -0
- package/dist/node_modules/simple-git/dist/src/lib/errors/git-response-error.d.ts +32 -0
- package/dist/node_modules/simple-git/dist/src/lib/errors/task-configuration-error.d.ts +12 -0
- package/dist/node_modules/simple-git/dist/src/lib/git-factory.d.ts +15 -0
- package/dist/node_modules/simple-git/dist/src/lib/git-logger.d.ts +21 -0
- package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-branch-delete.d.ts +5 -0
- package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-branch.d.ts +2 -0
- package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-commit.d.ts +2 -0
- package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-diff-summary.d.ts +3 -0
- package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-fetch.d.ts +2 -0
- package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-list-log-summary.d.ts +6 -0
- package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-merge.d.ts +11 -0
- package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-move.d.ts +2 -0
- package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-pull.d.ts +6 -0
- package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-push.d.ts +4 -0
- package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-remote-messages.d.ts +5 -0
- package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-remote-objects.d.ts +3 -0
- package/dist/node_modules/simple-git/dist/src/lib/plugins/abort-plugin.d.ts +3 -0
- package/dist/node_modules/simple-git/dist/src/lib/plugins/block-unsafe-operations-plugin.d.ts +3 -0
- package/dist/node_modules/simple-git/dist/src/lib/plugins/command-config-prefixing-plugin.d.ts +2 -0
- package/dist/node_modules/simple-git/dist/src/lib/plugins/completion-detection.plugin.d.ts +3 -0
- package/dist/node_modules/simple-git/dist/src/lib/plugins/custom-binary.plugin.d.ts +3 -0
- package/dist/node_modules/simple-git/dist/src/lib/plugins/error-detection.plugin.d.ts +7 -0
- package/dist/node_modules/simple-git/dist/src/lib/plugins/index.d.ts +11 -0
- package/dist/node_modules/simple-git/dist/src/lib/plugins/plugin-store.d.ts +11 -0
- package/dist/node_modules/simple-git/dist/src/lib/plugins/progress-monitor-plugin.d.ts +3 -0
- package/dist/node_modules/simple-git/dist/src/lib/plugins/simple-git-plugin.d.ts +48 -0
- package/dist/node_modules/simple-git/dist/src/lib/plugins/spawn-options-plugin.d.ts +3 -0
- package/dist/node_modules/simple-git/dist/src/lib/plugins/suffix-paths.plugin.d.ts +2 -0
- package/dist/node_modules/simple-git/dist/src/lib/plugins/timout-plugin.d.ts +3 -0
- package/dist/node_modules/simple-git/dist/src/lib/responses/BranchDeleteSummary.d.ts +12 -0
- package/dist/node_modules/simple-git/dist/src/lib/responses/BranchSummary.d.ts +14 -0
- package/dist/node_modules/simple-git/dist/src/lib/responses/CheckIgnore.d.ts +4 -0
- package/dist/node_modules/simple-git/dist/src/lib/responses/CleanSummary.d.ts +9 -0
- package/dist/node_modules/simple-git/dist/src/lib/responses/ConfigList.d.ts +13 -0
- package/dist/node_modules/simple-git/dist/src/lib/responses/DiffSummary.d.ts +10 -0
- package/dist/node_modules/simple-git/dist/src/lib/responses/FileStatusSummary.d.ts +9 -0
- package/dist/node_modules/simple-git/dist/src/lib/responses/GetRemoteSummary.d.ts +11 -0
- package/dist/node_modules/simple-git/dist/src/lib/responses/InitSummary.d.ts +9 -0
- package/dist/node_modules/simple-git/dist/src/lib/responses/MergeSummary.d.ts +16 -0
- package/dist/node_modules/simple-git/dist/src/lib/responses/PullSummary.d.ts +25 -0
- package/dist/node_modules/simple-git/dist/src/lib/responses/StatusSummary.d.ts +19 -0
- package/dist/node_modules/simple-git/dist/src/lib/responses/TagList.d.ts +7 -0
- package/dist/node_modules/simple-git/dist/src/lib/runners/git-executor-chain.d.ts +25 -0
- package/dist/node_modules/simple-git/dist/src/lib/runners/git-executor.d.ts +14 -0
- package/dist/node_modules/simple-git/dist/src/lib/runners/promise-wrapped.d.ts +2 -0
- package/dist/node_modules/simple-git/dist/src/lib/runners/scheduler.d.ts +11 -0
- package/dist/node_modules/simple-git/dist/src/lib/runners/tasks-pending-queue.d.ts +23 -0
- package/dist/node_modules/simple-git/dist/src/lib/simple-git-api.d.ts +20 -0
- package/dist/node_modules/simple-git/dist/src/lib/task-callback.d.ts +2 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/apply-patch.d.ts +3 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/branch.d.ts +7 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/change-working-directory.d.ts +2 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/check-ignore.d.ts +2 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/check-is-repo.d.ts +9 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/checkout.d.ts +2 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/clean.d.ts +25 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/clone.d.ts +9 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/commit.d.ts +4 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/config.d.ts +8 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/count-objects.d.ts +12 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/diff-name-status.d.ts +12 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/diff.d.ts +5 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/fetch.d.ts +4 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/first-commit.d.ts +2 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/grep.d.ts +12 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/hash-object.d.ts +5 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/init.d.ts +3 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/log.d.ts +32 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/merge.d.ts +4 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/move.d.ts +3 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/pull.d.ts +3 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/push.d.ts +9 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/remote.d.ts +8 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/reset.d.ts +11 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/show.d.ts +2 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/stash-list.d.ts +4 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/status.d.ts +3 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/sub-module.d.ts +5 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/tag.d.ts +18 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/task.d.ts +14 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/version.d.ts +9 -0
- package/dist/node_modules/simple-git/dist/src/lib/types/handlers.d.ts +21 -0
- package/dist/node_modules/simple-git/dist/src/lib/types/index.d.ts +136 -0
- package/dist/node_modules/simple-git/dist/src/lib/types/tasks.d.ts +19 -0
- package/dist/node_modules/simple-git/dist/src/lib/utils/argument-filters.d.ts +14 -0
- package/dist/node_modules/simple-git/dist/src/lib/utils/exit-codes.d.ts +10 -0
- package/dist/node_modules/simple-git/dist/src/lib/utils/git-output-streams.d.ts +7 -0
- package/dist/node_modules/simple-git/dist/src/lib/utils/index.d.ts +8 -0
- package/dist/node_modules/simple-git/dist/src/lib/utils/line-parser.d.ts +15 -0
- package/dist/node_modules/simple-git/dist/src/lib/utils/simple-git-options.d.ts +2 -0
- package/dist/node_modules/simple-git/dist/src/lib/utils/task-options.d.ts +13 -0
- package/dist/node_modules/simple-git/dist/src/lib/utils/task-parser.d.ts +5 -0
- package/dist/node_modules/simple-git/dist/src/lib/utils/util.d.ts +47 -0
- package/dist/node_modules/simple-git/dist/typings/errors.d.ts +5 -0
- package/dist/node_modules/simple-git/dist/typings/index.d.ts +14 -0
- package/dist/node_modules/simple-git/dist/typings/response.d.ts +556 -0
- package/dist/node_modules/simple-git/dist/typings/simple-git.d.ts +1033 -0
- package/dist/node_modules/simple-git/dist/typings/types.d.ts +22 -0
- package/dist/node_modules/simple-git/node_modules/debug/package.json +64 -0
- package/dist/node_modules/simple-git/node_modules/debug/src/browser.js +272 -0
- package/dist/node_modules/simple-git/node_modules/debug/src/common.js +292 -0
- package/dist/node_modules/simple-git/node_modules/debug/src/index.js +10 -0
- package/dist/node_modules/simple-git/node_modules/debug/src/node.js +263 -0
- package/dist/node_modules/simple-git/package.json +1 -0
- package/dist/node_modules/simple-git/promise.js +17 -0
- package/dist/server/collections/agent-execution-spans.d.ts +9 -0
- package/dist/server/collections/agent-execution-spans.js +152 -0
- package/dist/server/collections/orchestrator-config.js +16 -0
- package/dist/server/collections/orchestrator-logs.js +19 -2
- package/dist/server/collections/skill-definitions.d.ts +3 -0
- package/dist/server/collections/skill-definitions.js +158 -0
- package/dist/server/collections/skill-executions.d.ts +3 -0
- package/dist/server/collections/skill-executions.js +123 -0
- package/dist/server/collections/skill-worker-configs.d.ts +3 -0
- package/dist/server/collections/skill-worker-configs.js +115 -0
- package/dist/server/migrations/20260423000000-add-progress-fields.d.ts +4 -0
- package/dist/server/migrations/20260423000000-add-progress-fields.js +69 -0
- package/dist/server/migrations/20260425000000-add-interaction-schema.d.ts +4 -0
- package/dist/server/migrations/20260425000000-add-interaction-schema.js +61 -0
- package/dist/server/migrations/20260427000000-add-tracing-detail-fields.d.ts +7 -0
- package/dist/server/migrations/20260427000000-add-tracing-detail-fields.js +62 -0
- package/dist/server/migrations/20260427000000-change-packages-to-text.d.ts +4 -0
- package/dist/server/migrations/20260427000000-change-packages-to-text.js +70 -0
- package/dist/server/migrations/20260427000001-change-other-json-to-text.d.ts +4 -0
- package/dist/server/migrations/20260427000001-change-other-json-to-text.js +80 -0
- package/dist/server/migrations/20260429000000-add-llm-fields.d.ts +7 -0
- package/dist/server/migrations/20260429000000-add-llm-fields.js +68 -0
- package/dist/server/migrations/20260429000000-fix-inputargs-json-to-text.d.ts +16 -0
- package/dist/server/migrations/20260429000000-fix-inputargs-json-to-text.js +51 -0
- package/dist/server/migrations/20260503000000-add-orchestrator-trace-fields.d.ts +7 -0
- package/dist/server/migrations/20260503000000-add-orchestrator-trace-fields.js +57 -0
- package/dist/server/plugin.d.ts +3 -0
- package/dist/server/plugin.js +37 -1
- package/dist/server/resources/tracing.js +160 -12
- package/dist/server/services/CodeValidator.d.ts +32 -0
- package/dist/server/services/CodeValidator.js +205 -0
- package/dist/server/services/ExecutionSpanService.d.ts +44 -0
- package/dist/server/services/ExecutionSpanService.js +104 -0
- package/dist/server/services/FileManager.d.ts +28 -0
- package/dist/server/services/FileManager.js +151 -0
- package/dist/server/services/SandboxRunner.d.ts +41 -0
- package/dist/server/services/SandboxRunner.js +167 -0
- package/dist/server/services/SkillManager.d.ts +6 -0
- package/dist/server/services/SkillManager.js +640 -0
- package/dist/server/services/SkillRepositoryService.d.ts +22 -0
- package/dist/server/services/SkillRepositoryService.js +157 -0
- package/dist/server/services/WorkerEnvManager.d.ts +26 -0
- package/dist/server/services/WorkerEnvManager.js +120 -0
- package/dist/server/skill-hub/actions/git-import.d.ts +21 -0
- package/dist/server/skill-hub/actions/git-import.js +413 -0
- package/dist/server/skill-hub/mcp/McpController.d.ts +15 -0
- package/dist/server/skill-hub/mcp/McpController.js +111 -0
- package/dist/server/skill-hub/plugin.d.ts +58 -0
- package/dist/server/skill-hub/plugin.js +694 -0
- package/dist/server/skill-hub/sandbox-config.json +6 -0
- package/dist/server/skill-hub/tasks/SkillExecutionTask.d.ts +14 -0
- package/dist/server/skill-hub/tasks/SkillExecutionTask.js +267 -0
- package/dist/server/skill-hub/utils/json-fields.d.ts +7 -0
- package/dist/server/skill-hub/utils/json-fields.js +88 -0
- package/dist/server/tools/delegate-task.d.ts +4 -0
- package/dist/server/tools/delegate-task.js +832 -119
- package/dist/server/tools/skill-execute.d.ts +36 -0
- package/dist/server/tools/skill-execute.js +167 -0
- package/package.json +3 -1
- package/src/client/AIEmployeeSelect.tsx +1 -3
- package/src/client/AIEmployeesContext.tsx +28 -13
- package/src/client/OrchestratorSettings.tsx +43 -5
- package/src/client/RulesTab.tsx +368 -21
- package/src/client/TracingTab.tsx +316 -102
- package/src/client/plugin.tsx +39 -0
- package/src/client/skill-hub/components/ExecutionHistory.tsx +201 -0
- package/src/client/skill-hub/components/ExecutionProgress.tsx +55 -0
- package/src/client/skill-hub/components/GitSkillImport.tsx +555 -0
- package/src/client/skill-hub/components/SkillEditor.tsx +456 -0
- package/src/client/skill-hub/components/SkillManager.tsx +181 -0
- package/src/client/skill-hub/components/SkillMetrics.tsx +124 -0
- package/src/client/skill-hub/components/SkillTestPanel.tsx +144 -0
- package/src/client/skill-hub/index.tsx +75 -0
- package/src/client/skill-hub/locale.ts +16 -0
- package/src/client/skill-hub/tools/InteractionSchemasProvider.tsx +59 -0
- package/src/client/skill-hub/tools/SkillHubCard.tsx +78 -0
- package/src/client/skill-hub/utils/jsonFields.ts +37 -0
- package/src/server/collections/agent-execution-spans.ts +129 -0
- package/src/server/collections/orchestrator-config.ts +17 -0
- package/src/server/collections/orchestrator-logs.ts +19 -2
- package/src/server/collections/skill-definitions.ts +128 -0
- package/src/server/collections/skill-executions.ts +94 -0
- package/src/server/collections/skill-worker-configs.ts +86 -0
- package/src/server/migrations/20260423000000-add-progress-fields.ts +50 -0
- package/src/server/migrations/20260425000000-add-interaction-schema.ts +35 -0
- package/src/server/migrations/20260427000000-add-tracing-detail-fields.ts +41 -0
- package/src/server/migrations/20260427000000-change-packages-to-text.ts +47 -0
- package/src/server/migrations/20260427000001-change-other-json-to-text.ts +57 -0
- package/src/server/migrations/20260429000000-add-llm-fields.ts +46 -0
- package/src/server/migrations/20260429000000-fix-inputargs-json-to-text.ts +38 -0
- package/src/server/migrations/20260503000000-add-orchestrator-trace-fields.ts +32 -0
- package/src/server/plugin.ts +51 -3
- package/src/server/resources/tracing.ts +187 -16
- package/src/server/services/CodeValidator.ts +159 -0
- package/src/server/services/ExecutionSpanService.ts +106 -0
- package/src/server/services/FileManager.ts +144 -0
- package/src/server/services/SandboxRunner.ts +205 -0
- package/src/server/services/SkillManager.ts +623 -0
- package/src/server/services/SkillRepositoryService.ts +142 -0
- package/src/server/services/WorkerEnvManager.ts +113 -0
- package/src/server/skill-hub/actions/git-import.ts +486 -0
- package/src/server/skill-hub/mcp/McpController.ts +86 -0
- package/src/server/skill-hub/plugin.ts +771 -0
- package/src/server/skill-hub/sandbox-config.json +6 -0
- package/src/server/skill-hub/tasks/SkillExecutionTask.ts +297 -0
- package/src/server/skill-hub/utils/json-fields.ts +57 -0
- package/src/server/tools/delegate-task.ts +1085 -147
- package/src/server/tools/skill-execute.ts +157 -0
|
@@ -0,0 +1,123 @@
|
|
|
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 skill_executions_exports = {};
|
|
28
|
+
__export(skill_executions_exports, {
|
|
29
|
+
default: () => skill_executions_default
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(skill_executions_exports);
|
|
32
|
+
var skill_executions_default = {
|
|
33
|
+
name: "skillExecutions",
|
|
34
|
+
title: "Skill Executions",
|
|
35
|
+
fields: [
|
|
36
|
+
{
|
|
37
|
+
name: "id",
|
|
38
|
+
type: "bigInt",
|
|
39
|
+
autoIncrement: true,
|
|
40
|
+
primaryKey: true
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "skill",
|
|
44
|
+
type: "belongsTo",
|
|
45
|
+
target: "skillDefinitions",
|
|
46
|
+
foreignKey: "skillId"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
// 'pending' | 'running' | 'succeeded' | 'failed' | 'canceled' | 'timeout'
|
|
50
|
+
name: "status",
|
|
51
|
+
type: "string",
|
|
52
|
+
length: 20,
|
|
53
|
+
defaultValue: "pending"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "inputArgs",
|
|
57
|
+
type: "text"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
// Final code after template rendering
|
|
61
|
+
name: "executedCode",
|
|
62
|
+
type: "text"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: "stdout",
|
|
66
|
+
type: "text"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "stderr",
|
|
70
|
+
type: "text"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
// [{ name, size, mimeType }]
|
|
74
|
+
name: "outputFiles",
|
|
75
|
+
type: "text",
|
|
76
|
+
defaultValue: null
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "durationMs",
|
|
80
|
+
type: "integer"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "sessionId",
|
|
84
|
+
type: "string",
|
|
85
|
+
length: 100,
|
|
86
|
+
allowNull: true
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: "orchestratorRootRunId",
|
|
90
|
+
type: "string",
|
|
91
|
+
length: 100,
|
|
92
|
+
allowNull: true
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: "orchestratorSpanId",
|
|
96
|
+
type: "string",
|
|
97
|
+
length: 100,
|
|
98
|
+
allowNull: true
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: "orchestratorParentSpanId",
|
|
102
|
+
type: "string",
|
|
103
|
+
length: 100,
|
|
104
|
+
allowNull: true
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: "orchestratorToolCallId",
|
|
108
|
+
type: "string",
|
|
109
|
+
length: 100,
|
|
110
|
+
allowNull: true
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: "triggeredBy",
|
|
114
|
+
type: "belongsTo",
|
|
115
|
+
target: "users",
|
|
116
|
+
foreignKey: "triggeredById"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
name: "createdAt",
|
|
120
|
+
type: "date"
|
|
121
|
+
}
|
|
122
|
+
]
|
|
123
|
+
};
|
|
@@ -0,0 +1,115 @@
|
|
|
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 skill_worker_configs_exports = {};
|
|
28
|
+
__export(skill_worker_configs_exports, {
|
|
29
|
+
default: () => skill_worker_configs_default
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(skill_worker_configs_exports);
|
|
32
|
+
var skill_worker_configs_default = {
|
|
33
|
+
name: "skillWorkerConfigs",
|
|
34
|
+
title: "Skill Worker Configs",
|
|
35
|
+
fields: [
|
|
36
|
+
{
|
|
37
|
+
name: "id",
|
|
38
|
+
type: "bigInt",
|
|
39
|
+
autoIncrement: true,
|
|
40
|
+
primaryKey: true
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "retentionHours",
|
|
44
|
+
type: "integer",
|
|
45
|
+
defaultValue: 24
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: "packageWhitelist",
|
|
49
|
+
type: "text",
|
|
50
|
+
defaultValue: null
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "customPackages",
|
|
54
|
+
type: "text",
|
|
55
|
+
defaultValue: null
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "npmRegistryUrl",
|
|
59
|
+
type: "string",
|
|
60
|
+
length: 500
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: "npmAuthToken",
|
|
64
|
+
type: "string",
|
|
65
|
+
length: 1e3
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: "pypiIndexUrl",
|
|
69
|
+
type: "string",
|
|
70
|
+
length: 500
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: "pypiTrustedHost",
|
|
74
|
+
type: "string",
|
|
75
|
+
length: 255
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: "aptMirrorUrl",
|
|
79
|
+
type: "string",
|
|
80
|
+
length: 500
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "aptGpgKeyUrl",
|
|
84
|
+
type: "string",
|
|
85
|
+
length: 500
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: "initStatus",
|
|
89
|
+
type: "string",
|
|
90
|
+
length: 20,
|
|
91
|
+
defaultValue: "idle"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: "lastInitLog",
|
|
95
|
+
type: "text"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: "initProgressPercent",
|
|
99
|
+
type: "integer",
|
|
100
|
+
defaultValue: 0
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: "initProgressLog",
|
|
104
|
+
type: "text"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: "createdAt",
|
|
108
|
+
type: "date"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: "updatedAt",
|
|
112
|
+
type: "date"
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
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 add_progress_fields_exports = {};
|
|
28
|
+
__export(add_progress_fields_exports, {
|
|
29
|
+
default: () => AddProgressFieldsMigration
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(add_progress_fields_exports);
|
|
32
|
+
var import_server = require("@nocobase/server");
|
|
33
|
+
class AddProgressFieldsMigration extends import_server.Migration {
|
|
34
|
+
async up() {
|
|
35
|
+
const queryInterface = this.db.sequelize.getQueryInterface();
|
|
36
|
+
const tablePrefix = this.db.options.tablePrefix || "";
|
|
37
|
+
const tableName = `${tablePrefix}skillWorkerConfigs`;
|
|
38
|
+
try {
|
|
39
|
+
const tableExists = await queryInterface.tableExists(tableName);
|
|
40
|
+
if (!tableExists) return;
|
|
41
|
+
const tableDesc = await queryInterface.describeTable(tableName);
|
|
42
|
+
const fieldRepo = this.db.getRepository("fields");
|
|
43
|
+
const collectionName = "skillWorkerConfigs";
|
|
44
|
+
const fieldsToSync = [
|
|
45
|
+
{ name: "initProgressPercent", type: "integer", defaultValue: 0 },
|
|
46
|
+
{ name: "initProgressLog", type: "text" }
|
|
47
|
+
];
|
|
48
|
+
for (const f of fieldsToSync) {
|
|
49
|
+
const fieldMeta = await fieldRepo.findOne({
|
|
50
|
+
filter: { name: f.name, collectionName }
|
|
51
|
+
});
|
|
52
|
+
if (!fieldMeta && tableDesc[f.name]) {
|
|
53
|
+
await fieldRepo.create({
|
|
54
|
+
values: {
|
|
55
|
+
name: f.name,
|
|
56
|
+
type: f.type,
|
|
57
|
+
collectionName,
|
|
58
|
+
// Avoid trying to physically add it because it already exists
|
|
59
|
+
interface: f.type
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
this.app.logger.info(`[skill-hub] Restored NocoBase metadata for preexisting column ${f.name}`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
} catch (error) {
|
|
66
|
+
this.app.logger.error(`[skill-hub] Failed to check progress fields: ${error.message}`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -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 add_interaction_schema_exports = {};
|
|
28
|
+
__export(add_interaction_schema_exports, {
|
|
29
|
+
default: () => AddInteractionSchemaMigration
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(add_interaction_schema_exports);
|
|
32
|
+
var import_server = require("@nocobase/server");
|
|
33
|
+
class AddInteractionSchemaMigration extends import_server.Migration {
|
|
34
|
+
async up() {
|
|
35
|
+
const queryInterface = this.db.sequelize.getQueryInterface();
|
|
36
|
+
const tableName = `${this.db.options.tablePrefix || ""}skillDefinitions`;
|
|
37
|
+
try {
|
|
38
|
+
const tableExists = await queryInterface.tableExists(tableName);
|
|
39
|
+
if (!tableExists) return;
|
|
40
|
+
const tableDesc = await queryInterface.describeTable(tableName);
|
|
41
|
+
const fieldRepo = this.db.getRepository("fields");
|
|
42
|
+
const collectionName = "skillDefinitions";
|
|
43
|
+
const fieldMeta = await fieldRepo.findOne({
|
|
44
|
+
filter: { name: "interactionSchema", collectionName }
|
|
45
|
+
});
|
|
46
|
+
if (!fieldMeta && tableDesc.interactionSchema) {
|
|
47
|
+
await fieldRepo.create({
|
|
48
|
+
values: {
|
|
49
|
+
name: "interactionSchema",
|
|
50
|
+
type: "text",
|
|
51
|
+
collectionName,
|
|
52
|
+
interface: "textarea"
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
this.app.logger.info("[skill-hub] Restored NocoBase metadata for preexisting column interactionSchema");
|
|
56
|
+
}
|
|
57
|
+
} catch (error) {
|
|
58
|
+
this.app.logger.error(`[skill-hub] Failed to check interactionSchema field: ${error.message}`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
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 add_tracing_detail_fields_exports = {};
|
|
28
|
+
__export(add_tracing_detail_fields_exports, {
|
|
29
|
+
default: () => AddTracingDetailFieldsMigration
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(add_tracing_detail_fields_exports);
|
|
32
|
+
var import_server = require("@nocobase/server");
|
|
33
|
+
class AddTracingDetailFieldsMigration extends import_server.Migration {
|
|
34
|
+
on = "afterLoad";
|
|
35
|
+
appVersion = "<=2.x";
|
|
36
|
+
async up() {
|
|
37
|
+
const queryInterface = this.db.sequelize.getQueryInterface();
|
|
38
|
+
const DataTypes = this.db.sequelize.constructor["DataTypes"];
|
|
39
|
+
const tableName = `${this.db.options.tablePrefix || ""}orchestratorLogs`;
|
|
40
|
+
const tableExists = await queryInterface.describeTable(tableName).then(() => true).catch(() => false);
|
|
41
|
+
if (!tableExists) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const columns = await queryInterface.describeTable(tableName);
|
|
45
|
+
const addIfMissing = async (name, definition) => {
|
|
46
|
+
if (!columns[name]) {
|
|
47
|
+
await queryInterface.addColumn(tableName, name, definition);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
await addIfMissing("context", { type: DataTypes.TEXT, allowNull: true });
|
|
51
|
+
await addIfMissing("trace", { type: DataTypes.JSON, allowNull: true, defaultValue: [] });
|
|
52
|
+
await addIfMissing("messages", { type: DataTypes.JSON, allowNull: true, defaultValue: [] });
|
|
53
|
+
}
|
|
54
|
+
async down() {
|
|
55
|
+
const queryInterface = this.db.sequelize.getQueryInterface();
|
|
56
|
+
const tableName = `${this.db.options.tablePrefix || ""}orchestratorLogs`;
|
|
57
|
+
for (const column of ["context", "trace", "messages"]) {
|
|
58
|
+
await queryInterface.removeColumn(tableName, column).catch(() => {
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
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 change_packages_to_text_exports = {};
|
|
28
|
+
__export(change_packages_to_text_exports, {
|
|
29
|
+
default: () => ChangePackagesToTextMigration
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(change_packages_to_text_exports);
|
|
32
|
+
var import_server = require("@nocobase/server");
|
|
33
|
+
class ChangePackagesToTextMigration extends import_server.Migration {
|
|
34
|
+
async up() {
|
|
35
|
+
const queryInterface = this.db.sequelize.getQueryInterface();
|
|
36
|
+
const tableName = `${this.db.options.tablePrefix || ""}skillDefinitions`;
|
|
37
|
+
try {
|
|
38
|
+
const tableExists = await queryInterface.tableExists(tableName);
|
|
39
|
+
if (!tableExists) return;
|
|
40
|
+
const tableDesc = await queryInterface.describeTable(tableName);
|
|
41
|
+
const columnsToChange = ["packages", "inputSchema", "interactionSchema"];
|
|
42
|
+
const fieldRepo = this.db.getRepository("fields");
|
|
43
|
+
const collectionName = "skillDefinitions";
|
|
44
|
+
for (const col of columnsToChange) {
|
|
45
|
+
if (tableDesc[col]) {
|
|
46
|
+
const dialect = this.db.sequelize.getDialect();
|
|
47
|
+
if (dialect === "postgres") {
|
|
48
|
+
await this.db.sequelize.query(`ALTER TABLE "${tableName}" ALTER COLUMN "${col}" TYPE text USING "${col}"::text;`);
|
|
49
|
+
} else {
|
|
50
|
+
await queryInterface.changeColumn(tableName, col, {
|
|
51
|
+
type: "TEXT"
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
const fieldMeta = await fieldRepo.findOne({
|
|
55
|
+
filter: { name: col, collectionName }
|
|
56
|
+
});
|
|
57
|
+
if (fieldMeta) {
|
|
58
|
+
await fieldRepo.update({
|
|
59
|
+
filterByTk: fieldMeta.get("id"),
|
|
60
|
+
values: { type: "text" }
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
this.app.logger.info(`[skill-hub] Changed ${col} column type to text to support markdown`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
} catch (error) {
|
|
67
|
+
this.app.logger.error(`[skill-hub] Failed to change packages field type: ${error.message}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
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 change_other_json_to_text_exports = {};
|
|
28
|
+
__export(change_other_json_to_text_exports, {
|
|
29
|
+
default: () => ChangeOtherJsonToTextMigration
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(change_other_json_to_text_exports);
|
|
32
|
+
var import_server = require("@nocobase/server");
|
|
33
|
+
class ChangeOtherJsonToTextMigration extends import_server.Migration {
|
|
34
|
+
async up() {
|
|
35
|
+
const queryInterface = this.db.sequelize.getQueryInterface();
|
|
36
|
+
const dialect = this.db.sequelize.getDialect();
|
|
37
|
+
const fieldRepo = this.db.getRepository("fields");
|
|
38
|
+
const tablePrefix = this.db.options.tablePrefix || "";
|
|
39
|
+
const workerTableName = `${tablePrefix}skillWorkerConfigs`;
|
|
40
|
+
try {
|
|
41
|
+
if (await queryInterface.tableExists(workerTableName)) {
|
|
42
|
+
const tableDesc = await queryInterface.describeTable(workerTableName);
|
|
43
|
+
const columns = ["packageWhitelist", "customPackages"];
|
|
44
|
+
for (const col of columns) {
|
|
45
|
+
if (tableDesc[col]) {
|
|
46
|
+
if (dialect === "postgres") {
|
|
47
|
+
await this.db.sequelize.query(`ALTER TABLE "${workerTableName}" ALTER COLUMN "${col}" TYPE text USING "${col}"::text;`);
|
|
48
|
+
} else {
|
|
49
|
+
await queryInterface.changeColumn(workerTableName, col, { type: "TEXT" });
|
|
50
|
+
}
|
|
51
|
+
const fieldMeta = await fieldRepo.findOne({ filter: { name: col, collectionName: "skillWorkerConfigs" } });
|
|
52
|
+
if (fieldMeta) await fieldRepo.update({ filterByTk: fieldMeta.get("id"), values: { type: "text" } });
|
|
53
|
+
this.app.logger.info(`[skill-hub] Changed ${col} in skillWorkerConfigs to text`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
} catch (e) {
|
|
58
|
+
this.app.logger.warn(`[skill-hub] Failed to migrate skillWorkerConfigs: ${e.message}`);
|
|
59
|
+
}
|
|
60
|
+
const execTableName = `${tablePrefix}skillExecutions`;
|
|
61
|
+
try {
|
|
62
|
+
if (await queryInterface.tableExists(execTableName)) {
|
|
63
|
+
const tableDesc = await queryInterface.describeTable(execTableName);
|
|
64
|
+
const col = "outputFiles";
|
|
65
|
+
if (tableDesc[col]) {
|
|
66
|
+
if (dialect === "postgres") {
|
|
67
|
+
await this.db.sequelize.query(`ALTER TABLE "${execTableName}" ALTER COLUMN "${col}" TYPE text USING "${col}"::text;`);
|
|
68
|
+
} else {
|
|
69
|
+
await queryInterface.changeColumn(execTableName, col, { type: "TEXT" });
|
|
70
|
+
}
|
|
71
|
+
const fieldMeta = await fieldRepo.findOne({ filter: { name: col, collectionName: "skillExecutions" } });
|
|
72
|
+
if (fieldMeta) await fieldRepo.update({ filterByTk: fieldMeta.get("id"), values: { type: "text" } });
|
|
73
|
+
this.app.logger.info(`[skill-hub] Changed ${col} in skillExecutions to text`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
} catch (e) {
|
|
77
|
+
this.app.logger.warn(`[skill-hub] Failed to migrate skillExecutions: ${e.message}`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|