plugin-agent-orchestrator 1.0.13 → 1.0.15
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.d.ts +1 -1
- package/dist/server/collections/orchestrator-config.js +6 -0
- package/dist/server/collections/orchestrator-logs.d.ts +1 -1
- package/dist/server/collections/skill-definitions.d.ts +2 -0
- package/dist/server/collections/skill-definitions.js +158 -0
- package/dist/server/collections/skill-executions.d.ts +2 -0
- package/dist/server/collections/skill-executions.js +123 -0
- package/dist/server/collections/skill-worker-configs.d.ts +2 -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-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.js +8 -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 +154 -11
- package/dist/server/services/CodeValidator.d.ts +32 -0
- package/dist/server/services/CodeValidator.js +206 -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 +16 -0
- package/dist/server/skill-hub/tasks/SkillExecutionTask.js +389 -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 +606 -104
- 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 +253 -32
- package/src/client/TracingTab.tsx +277 -213
- package/src/client/index.tsx +1 -1
- package/src/client/plugin.tsx +54 -15
- 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 +7 -0
- 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 +5 -5
- 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 +11 -2
- 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 +94 -46
- package/src/server/resources/tracing.ts +182 -15
- 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 +443 -0
- package/src/server/skill-hub/utils/json-fields.ts +57 -0
- package/src/server/tools/delegate-task.ts +803 -127
- package/src/server/tools/skill-execute.ts +157 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { CollectionOptions } from '@nocobase/database';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
name: 'skillDefinitions',
|
|
5
|
+
title: 'Skill Definitions',
|
|
6
|
+
fields: [
|
|
7
|
+
{
|
|
8
|
+
name: 'id',
|
|
9
|
+
type: 'bigInt',
|
|
10
|
+
autoIncrement: true,
|
|
11
|
+
primaryKey: true,
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: 'name',
|
|
15
|
+
type: 'string',
|
|
16
|
+
length: 100,
|
|
17
|
+
unique: true,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: 'title',
|
|
21
|
+
type: 'string',
|
|
22
|
+
length: 200,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'description',
|
|
26
|
+
type: 'text',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'instructions',
|
|
30
|
+
type: 'text',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
// 'node' | 'python'
|
|
34
|
+
name: 'language',
|
|
35
|
+
type: 'string',
|
|
36
|
+
length: 20,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
// Code template with {{placeholder}} support
|
|
40
|
+
name: 'codeTemplate',
|
|
41
|
+
type: 'text',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
// JSON Schema for input parameters (used by AI tool)
|
|
45
|
+
name: 'inputSchema',
|
|
46
|
+
type: 'text',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
// Optional UI schema for human-in-the-loop interaction.
|
|
50
|
+
// Shape: { type: 'form'|'select'|'confirm', prompt: string,
|
|
51
|
+
// options?: {label,value}[], fields?: Record<string, {type,title,required,enum}> }
|
|
52
|
+
name: 'interactionSchema',
|
|
53
|
+
type: 'text',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
// Pre-installed packages reference (informational)
|
|
57
|
+
name: 'packages',
|
|
58
|
+
type: 'text',
|
|
59
|
+
defaultValue: null,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: 'timeoutSeconds',
|
|
63
|
+
type: 'integer',
|
|
64
|
+
defaultValue: 60,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'maxOutputSizeMb',
|
|
68
|
+
type: 'integer',
|
|
69
|
+
defaultValue: 50,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'enabled',
|
|
73
|
+
type: 'boolean',
|
|
74
|
+
defaultValue: true,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
// 'CUSTOM' | 'GENERAL' | 'SPECIFIED'
|
|
78
|
+
name: 'toolScope',
|
|
79
|
+
type: 'string',
|
|
80
|
+
length: 20,
|
|
81
|
+
defaultValue: 'CUSTOM',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: 'autoCall',
|
|
85
|
+
type: 'boolean',
|
|
86
|
+
defaultValue: false,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
// Which plugin registered this skill. null = built-in / user-created.
|
|
90
|
+
// Format: plugin package name, e.g. 'plugin-skill-pptx-advanced'
|
|
91
|
+
name: 'pluginSource',
|
|
92
|
+
type: 'string',
|
|
93
|
+
length: 200,
|
|
94
|
+
defaultValue: null,
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: 'storageType',
|
|
98
|
+
type: 'string',
|
|
99
|
+
length: 20,
|
|
100
|
+
defaultValue: 'database', // 'database', 'local', 's3', 'plugin'
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: 'storageUrl',
|
|
104
|
+
type: 'string',
|
|
105
|
+
length: 1000,
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: 'file',
|
|
109
|
+
type: 'belongsTo',
|
|
110
|
+
target: 'attachments',
|
|
111
|
+
foreignKey: 'fileId',
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: 'createdAt',
|
|
115
|
+
type: 'date',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: 'updatedAt',
|
|
119
|
+
type: 'date',
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: 'createdBy',
|
|
123
|
+
type: 'belongsTo',
|
|
124
|
+
target: 'users',
|
|
125
|
+
foreignKey: 'createdById',
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
} as CollectionOptions;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { CollectionOptions } from '@nocobase/database';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
name: 'skillExecutions',
|
|
5
|
+
title: 'Skill Executions',
|
|
6
|
+
fields: [
|
|
7
|
+
{
|
|
8
|
+
name: 'id',
|
|
9
|
+
type: 'bigInt',
|
|
10
|
+
autoIncrement: true,
|
|
11
|
+
primaryKey: true,
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: 'skill',
|
|
15
|
+
type: 'belongsTo',
|
|
16
|
+
target: 'skillDefinitions',
|
|
17
|
+
foreignKey: 'skillId',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
// 'pending' | 'running' | 'succeeded' | 'failed' | 'canceled' | 'timeout'
|
|
21
|
+
name: 'status',
|
|
22
|
+
type: 'string',
|
|
23
|
+
length: 20,
|
|
24
|
+
defaultValue: 'pending',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'inputArgs',
|
|
28
|
+
type: 'text',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
// Final code after template rendering
|
|
32
|
+
name: 'executedCode',
|
|
33
|
+
type: 'text',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'stdout',
|
|
37
|
+
type: 'text',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'stderr',
|
|
41
|
+
type: 'text',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
// [{ name, size, mimeType }]
|
|
45
|
+
name: 'outputFiles',
|
|
46
|
+
type: 'text',
|
|
47
|
+
defaultValue: null,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'durationMs',
|
|
51
|
+
type: 'integer',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'sessionId',
|
|
55
|
+
type: 'string',
|
|
56
|
+
length: 100,
|
|
57
|
+
allowNull: true,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'orchestratorRootRunId',
|
|
61
|
+
type: 'string',
|
|
62
|
+
length: 100,
|
|
63
|
+
allowNull: true,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'orchestratorSpanId',
|
|
67
|
+
type: 'string',
|
|
68
|
+
length: 100,
|
|
69
|
+
allowNull: true,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'orchestratorParentSpanId',
|
|
73
|
+
type: 'string',
|
|
74
|
+
length: 100,
|
|
75
|
+
allowNull: true,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'orchestratorToolCallId',
|
|
79
|
+
type: 'string',
|
|
80
|
+
length: 100,
|
|
81
|
+
allowNull: true,
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: 'triggeredBy',
|
|
85
|
+
type: 'belongsTo',
|
|
86
|
+
target: 'users',
|
|
87
|
+
foreignKey: 'triggeredById',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: 'createdAt',
|
|
91
|
+
type: 'date',
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
} as CollectionOptions;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { CollectionOptions } from '@nocobase/database';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
name: 'skillWorkerConfigs',
|
|
5
|
+
title: 'Skill Worker Configs',
|
|
6
|
+
fields: [
|
|
7
|
+
{
|
|
8
|
+
name: 'id',
|
|
9
|
+
type: 'bigInt',
|
|
10
|
+
autoIncrement: true,
|
|
11
|
+
primaryKey: true,
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: 'retentionHours',
|
|
15
|
+
type: 'integer',
|
|
16
|
+
defaultValue: 24,
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: 'packageWhitelist',
|
|
20
|
+
type: 'text',
|
|
21
|
+
defaultValue: null,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'customPackages',
|
|
25
|
+
type: 'text',
|
|
26
|
+
defaultValue: null,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'npmRegistryUrl',
|
|
30
|
+
type: 'string',
|
|
31
|
+
length: 500,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'npmAuthToken',
|
|
35
|
+
type: 'string',
|
|
36
|
+
length: 1000,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'pypiIndexUrl',
|
|
40
|
+
type: 'string',
|
|
41
|
+
length: 500,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'pypiTrustedHost',
|
|
45
|
+
type: 'string',
|
|
46
|
+
length: 255,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'aptMirrorUrl',
|
|
50
|
+
type: 'string',
|
|
51
|
+
length: 500,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'aptGpgKeyUrl',
|
|
55
|
+
type: 'string',
|
|
56
|
+
length: 500,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'initStatus',
|
|
60
|
+
type: 'string',
|
|
61
|
+
length: 20,
|
|
62
|
+
defaultValue: 'idle',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: 'lastInitLog',
|
|
66
|
+
type: 'text',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'initProgressPercent',
|
|
70
|
+
type: 'integer',
|
|
71
|
+
defaultValue: 0,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: 'initProgressLog',
|
|
75
|
+
type: 'text',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'createdAt',
|
|
79
|
+
type: 'date',
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: 'updatedAt',
|
|
83
|
+
type: 'date',
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
} as CollectionOptions;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Migration } from '@nocobase/server';
|
|
2
|
+
|
|
3
|
+
export default class AddProgressFieldsMigration extends Migration {
|
|
4
|
+
async up() {
|
|
5
|
+
const queryInterface = (this as any).db.sequelize.getQueryInterface();
|
|
6
|
+
const tablePrefix = (this as any).db.options.tablePrefix || '';
|
|
7
|
+
const tableName = `${tablePrefix}skillWorkerConfigs`;
|
|
8
|
+
|
|
9
|
+
try {
|
|
10
|
+
const tableExists = await queryInterface.tableExists(tableName);
|
|
11
|
+
if (!tableExists) return;
|
|
12
|
+
|
|
13
|
+
const tableDesc = await queryInterface.describeTable(tableName);
|
|
14
|
+
|
|
15
|
+
// Force NocoBase fields metadata to recognize the physical columns exists
|
|
16
|
+
// so it won't crash trying to ADD COLUMN during db.sync()
|
|
17
|
+
const fieldRepo = (this as any).db.getRepository('fields');
|
|
18
|
+
const collectionName = 'skillWorkerConfigs';
|
|
19
|
+
|
|
20
|
+
const fieldsToSync = [
|
|
21
|
+
{ name: 'initProgressPercent', type: 'integer', defaultValue: 0 },
|
|
22
|
+
{ name: 'initProgressLog', type: 'text' }
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
for (const f of fieldsToSync) {
|
|
26
|
+
const fieldMeta = await fieldRepo.findOne({
|
|
27
|
+
filter: { name: f.name, collectionName },
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
if (!fieldMeta && tableDesc[f.name]) {
|
|
31
|
+
// The physical column exists, but NocoBase metadata is missing it!
|
|
32
|
+
// Let's create the metadata right now BEFORE NocoBase's collection.sync()
|
|
33
|
+
// runs and crashes on addColumn.
|
|
34
|
+
await fieldRepo.create({
|
|
35
|
+
values: {
|
|
36
|
+
name: f.name,
|
|
37
|
+
type: f.type,
|
|
38
|
+
collectionName,
|
|
39
|
+
// Avoid trying to physically add it because it already exists
|
|
40
|
+
interface: f.type,
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
(this as any).app.logger.info(`[skill-hub] Restored NocoBase metadata for preexisting column ${f.name}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
} catch (error) {
|
|
47
|
+
(this as any).app.logger.error(`[skill-hub] Failed to check progress fields: ${error.message}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Migration } from '@nocobase/server';
|
|
2
|
+
|
|
3
|
+
export default class AddInteractionSchemaMigration extends Migration {
|
|
4
|
+
async up() {
|
|
5
|
+
const queryInterface = (this as any).db.sequelize.getQueryInterface();
|
|
6
|
+
const tableName = `${(this as any).db.options.tablePrefix || ''}skillDefinitions`;
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
const tableExists = await queryInterface.tableExists(tableName);
|
|
10
|
+
if (!tableExists) return;
|
|
11
|
+
|
|
12
|
+
const tableDesc = await queryInterface.describeTable(tableName);
|
|
13
|
+
const fieldRepo = (this as any).db.getRepository('fields');
|
|
14
|
+
const collectionName = 'skillDefinitions';
|
|
15
|
+
|
|
16
|
+
const fieldMeta = await fieldRepo.findOne({
|
|
17
|
+
filter: { name: 'interactionSchema', collectionName },
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
if (!fieldMeta && tableDesc.interactionSchema) {
|
|
21
|
+
await fieldRepo.create({
|
|
22
|
+
values: {
|
|
23
|
+
name: 'interactionSchema',
|
|
24
|
+
type: 'text',
|
|
25
|
+
collectionName,
|
|
26
|
+
interface: 'textarea',
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
(this as any).app.logger.info('[skill-hub] Restored NocoBase metadata for preexisting column interactionSchema');
|
|
30
|
+
}
|
|
31
|
+
} catch (error) {
|
|
32
|
+
(this as any).app.logger.error(`[skill-hub] Failed to check interactionSchema field: ${error.message}`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -5,9 +5,9 @@ export default class AddTracingDetailFieldsMigration extends Migration {
|
|
|
5
5
|
appVersion = '<=2.x';
|
|
6
6
|
|
|
7
7
|
async up() {
|
|
8
|
-
const queryInterface = this.db.sequelize.getQueryInterface();
|
|
9
|
-
const DataTypes = this.db.sequelize.constructor['DataTypes'];
|
|
10
|
-
const tableName = `${this.db.options.tablePrefix || ''}orchestratorLogs`;
|
|
8
|
+
const queryInterface = (this as any).db.sequelize.getQueryInterface();
|
|
9
|
+
const DataTypes = (this as any).db.sequelize.constructor['DataTypes'];
|
|
10
|
+
const tableName = `${(this as any).db.options.tablePrefix || ''}orchestratorLogs`;
|
|
11
11
|
|
|
12
12
|
const tableExists = await queryInterface
|
|
13
13
|
.describeTable(tableName)
|
|
@@ -31,8 +31,8 @@ export default class AddTracingDetailFieldsMigration extends Migration {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
async down() {
|
|
34
|
-
const queryInterface = this.db.sequelize.getQueryInterface();
|
|
35
|
-
const tableName = `${this.db.options.tablePrefix || ''}orchestratorLogs`;
|
|
34
|
+
const queryInterface = (this as any).db.sequelize.getQueryInterface();
|
|
35
|
+
const tableName = `${(this as any).db.options.tablePrefix || ''}orchestratorLogs`;
|
|
36
36
|
|
|
37
37
|
for (const column of ['context', 'trace', 'messages']) {
|
|
38
38
|
await queryInterface.removeColumn(tableName, column).catch(() => {});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Migration } from '@nocobase/server';
|
|
2
|
+
|
|
3
|
+
export default class ChangePackagesToTextMigration extends Migration {
|
|
4
|
+
async up() {
|
|
5
|
+
const queryInterface = (this as any).db.sequelize.getQueryInterface();
|
|
6
|
+
const tableName = `${(this as any).db.options.tablePrefix || ''}skillDefinitions`;
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
const tableExists = await queryInterface.tableExists(tableName);
|
|
10
|
+
if (!tableExists) return;
|
|
11
|
+
|
|
12
|
+
const tableDesc = await queryInterface.describeTable(tableName);
|
|
13
|
+
const columnsToChange = ['packages', 'inputSchema', 'interactionSchema'];
|
|
14
|
+
const fieldRepo = (this as any).db.getRepository('fields');
|
|
15
|
+
const collectionName = 'skillDefinitions';
|
|
16
|
+
|
|
17
|
+
for (const col of columnsToChange) {
|
|
18
|
+
if (tableDesc[col]) {
|
|
19
|
+
// Change physical column type in Postgres if needed
|
|
20
|
+
const dialect = (this as any).db.sequelize.getDialect();
|
|
21
|
+
if (dialect === 'postgres') {
|
|
22
|
+
await (this as any).db.sequelize.query(`ALTER TABLE "${tableName}" ALTER COLUMN "${col}" TYPE text USING "${col}"::text;`);
|
|
23
|
+
} else {
|
|
24
|
+
await queryInterface.changeColumn(tableName, col, {
|
|
25
|
+
type: 'TEXT',
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Also update NocoBase metadata
|
|
30
|
+
const fieldMeta = await fieldRepo.findOne({
|
|
31
|
+
filter: { name: col, collectionName },
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
if (fieldMeta) {
|
|
35
|
+
await fieldRepo.update({
|
|
36
|
+
filterByTk: fieldMeta.get('id'),
|
|
37
|
+
values: { type: 'text' },
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
(this as any).app.logger.info(`[skill-hub] Changed ${col} column type to text to support markdown`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
} catch (error) {
|
|
44
|
+
(this as any).app.logger.error(`[skill-hub] Failed to change packages field type: ${error.message}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Migration } from '@nocobase/server';
|
|
2
|
+
|
|
3
|
+
export default class ChangeOtherJsonToTextMigration extends Migration {
|
|
4
|
+
async up() {
|
|
5
|
+
const queryInterface = (this as any).db.sequelize.getQueryInterface();
|
|
6
|
+
const dialect = (this as any).db.sequelize.getDialect();
|
|
7
|
+
const fieldRepo = (this as any).db.getRepository('fields');
|
|
8
|
+
|
|
9
|
+
const tablePrefix = (this as any).db.options.tablePrefix || '';
|
|
10
|
+
|
|
11
|
+
// 1. skillWorkerConfigs
|
|
12
|
+
const workerTableName = `${tablePrefix}skillWorkerConfigs`;
|
|
13
|
+
try {
|
|
14
|
+
if (await queryInterface.tableExists(workerTableName)) {
|
|
15
|
+
const tableDesc = await queryInterface.describeTable(workerTableName);
|
|
16
|
+
const columns = ['packageWhitelist', 'customPackages'];
|
|
17
|
+
|
|
18
|
+
for (const col of columns) {
|
|
19
|
+
if (tableDesc[col]) {
|
|
20
|
+
if (dialect === 'postgres') {
|
|
21
|
+
await (this as any).db.sequelize.query(`ALTER TABLE "${workerTableName}" ALTER COLUMN "${col}" TYPE text USING "${col}"::text;`);
|
|
22
|
+
} else {
|
|
23
|
+
await queryInterface.changeColumn(workerTableName, col, { type: 'TEXT' });
|
|
24
|
+
}
|
|
25
|
+
const fieldMeta = await fieldRepo.findOne({ filter: { name: col, collectionName: 'skillWorkerConfigs' } });
|
|
26
|
+
if (fieldMeta) await fieldRepo.update({ filterByTk: fieldMeta.get('id'), values: { type: 'text' } });
|
|
27
|
+
(this as any).app.logger.info(`[skill-hub] Changed ${col} in skillWorkerConfigs to text`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
} catch (e) {
|
|
32
|
+
(this as any).app.logger.warn(`[skill-hub] Failed to migrate skillWorkerConfigs: ${e.message}`);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// 2. skillExecutions
|
|
36
|
+
const execTableName = `${tablePrefix}skillExecutions`;
|
|
37
|
+
try {
|
|
38
|
+
if (await queryInterface.tableExists(execTableName)) {
|
|
39
|
+
const tableDesc = await queryInterface.describeTable(execTableName);
|
|
40
|
+
const col = 'outputFiles';
|
|
41
|
+
|
|
42
|
+
if (tableDesc[col]) {
|
|
43
|
+
if (dialect === 'postgres') {
|
|
44
|
+
await (this as any).db.sequelize.query(`ALTER TABLE "${execTableName}" ALTER COLUMN "${col}" TYPE text USING "${col}"::text;`);
|
|
45
|
+
} else {
|
|
46
|
+
await queryInterface.changeColumn(execTableName, col, { type: 'TEXT' });
|
|
47
|
+
}
|
|
48
|
+
const fieldMeta = await fieldRepo.findOne({ filter: { name: col, collectionName: 'skillExecutions' } });
|
|
49
|
+
if (fieldMeta) await fieldRepo.update({ filterByTk: fieldMeta.get('id'), values: { type: 'text' } });
|
|
50
|
+
(this as any).app.logger.info(`[skill-hub] Changed ${col} in skillExecutions to text`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
} catch (e) {
|
|
54
|
+
(this as any).app.logger.warn(`[skill-hub] Failed to migrate skillExecutions: ${e.message}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -5,8 +5,8 @@ export default class AddLlmFieldsToOrchestratorConfig extends Migration {
|
|
|
5
5
|
appVersion = '>=0.1.0';
|
|
6
6
|
|
|
7
7
|
async up() {
|
|
8
|
-
const queryInterface = this.db.sequelize.getQueryInterface();
|
|
9
|
-
const tablePrefix = this.db.options.tablePrefix || '';
|
|
8
|
+
const queryInterface = (this as any).db.sequelize.getQueryInterface();
|
|
9
|
+
const tablePrefix = (this as any).db.options.tablePrefix || '';
|
|
10
10
|
const tableName = `${tablePrefix}orchestratorConfig`;
|
|
11
11
|
|
|
12
12
|
const tableExists = await queryInterface.tableExists(tableName);
|
|
@@ -29,6 +29,15 @@ export default class AddLlmFieldsToOrchestratorConfig extends Migration {
|
|
|
29
29
|
});
|
|
30
30
|
console.log(`[AgentOrchestrator] Added model column to ${tableName}`);
|
|
31
31
|
}
|
|
32
|
+
|
|
33
|
+
if (!tableDesc['recursionLimit']) {
|
|
34
|
+
await queryInterface.addColumn(tableName, 'recursionLimit', {
|
|
35
|
+
type: 'INTEGER',
|
|
36
|
+
allowNull: true,
|
|
37
|
+
defaultValue: 50,
|
|
38
|
+
});
|
|
39
|
+
console.log(`[AgentOrchestrator] Added recursionLimit column to ${tableName}`);
|
|
40
|
+
}
|
|
32
41
|
}
|
|
33
42
|
|
|
34
43
|
async down() {
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Migration } from '@nocobase/server';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Fix: inputArgs column in skillExecutions was json type but should be text.
|
|
5
|
+
*
|
|
6
|
+
* Root cause: The column was created as `json` from an older schema version,
|
|
7
|
+
* but the collection defines it as `text`. The `stringifyJsonText()` utility
|
|
8
|
+
* wraps values in markdown code fences (```json\n...\n```) which PostgreSQL
|
|
9
|
+
* rejects as invalid JSON syntax, causing SequelizeDatabaseError on every
|
|
10
|
+
* skill execution attempt.
|
|
11
|
+
*/
|
|
12
|
+
export default class FixInputArgsJsonToText extends Migration {
|
|
13
|
+
on = 'afterLoad';
|
|
14
|
+
appVersion = '>=0.1.0';
|
|
15
|
+
|
|
16
|
+
async up() {
|
|
17
|
+
const queryInterface = (this as any).db.sequelize.getQueryInterface();
|
|
18
|
+
|
|
19
|
+
// Check current column type
|
|
20
|
+
const tableDesc = await queryInterface.describeTable('skillExecutions').catch(() => null);
|
|
21
|
+
if (!tableDesc) return;
|
|
22
|
+
|
|
23
|
+
const col = tableDesc['inputArgs'];
|
|
24
|
+
if (!col) return;
|
|
25
|
+
|
|
26
|
+
// Only migrate if still json type
|
|
27
|
+
if (col.type && col.type.toLowerCase().includes('json')) {
|
|
28
|
+
await (this as any).db.sequelize.query(
|
|
29
|
+
`ALTER TABLE "skillExecutions" ALTER COLUMN "inputArgs" TYPE text USING "inputArgs"::text`,
|
|
30
|
+
);
|
|
31
|
+
console.log('[skill-hub] Migration: converted skillExecutions.inputArgs from json to text');
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async down() {
|
|
36
|
+
// No rollback — keeping as text is safe; json is more restrictive
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Migration } from '@nocobase/server';
|
|
2
|
+
|
|
3
|
+
export default class AddOrchestratorTraceFieldsToSkillExecutions extends Migration {
|
|
4
|
+
on = 'afterLoad';
|
|
5
|
+
appVersion = '>=0.1.0';
|
|
6
|
+
|
|
7
|
+
async up() {
|
|
8
|
+
const queryInterface = (this as any).db.sequelize.getQueryInterface();
|
|
9
|
+
const tablePrefix = (this as any).db.options.tablePrefix || '';
|
|
10
|
+
const tableName = `${tablePrefix}skillExecutions`;
|
|
11
|
+
const tableExists = await queryInterface.tableExists(tableName).catch(() => false);
|
|
12
|
+
if (!tableExists) return;
|
|
13
|
+
|
|
14
|
+
const tableDesc = await queryInterface.describeTable(tableName);
|
|
15
|
+
const addIfMissing = async (name: string) => {
|
|
16
|
+
if (tableDesc[name]) return;
|
|
17
|
+
await queryInterface.addColumn(tableName, name, {
|
|
18
|
+
type: 'VARCHAR(100)',
|
|
19
|
+
allowNull: true,
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
await addIfMissing('orchestratorRootRunId');
|
|
24
|
+
await addIfMissing('orchestratorSpanId');
|
|
25
|
+
await addIfMissing('orchestratorParentSpanId');
|
|
26
|
+
await addIfMissing('orchestratorToolCallId');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async down() {
|
|
30
|
+
// No rollback: keeping nullable trace-link columns is safe.
|
|
31
|
+
}
|
|
32
|
+
}
|