plugin-agent-orchestrator 1.0.13 → 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 +6 -0
- 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-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 +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 +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/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 +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-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 +9 -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 +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 +297 -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,104 @@
|
|
|
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 ExecutionSpanService_exports = {};
|
|
28
|
+
__export(ExecutionSpanService_exports, {
|
|
29
|
+
ExecutionSpanService: () => ExecutionSpanService,
|
|
30
|
+
ORCHESTRATOR_TRACE_CONTEXT_KEY: () => ORCHESTRATOR_TRACE_CONTEXT_KEY,
|
|
31
|
+
getOrchestratorTraceContext: () => getOrchestratorTraceContext,
|
|
32
|
+
setOrchestratorTraceContext: () => setOrchestratorTraceContext
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(ExecutionSpanService_exports);
|
|
35
|
+
const ORCHESTRATOR_TRACE_CONTEXT_KEY = "__orchestratorTraceContext";
|
|
36
|
+
function toPlain(record) {
|
|
37
|
+
var _a;
|
|
38
|
+
return ((_a = record == null ? void 0 : record.toJSON) == null ? void 0 : _a.call(record)) || record;
|
|
39
|
+
}
|
|
40
|
+
class ExecutionSpanService {
|
|
41
|
+
constructor(plugin) {
|
|
42
|
+
this.plugin = plugin;
|
|
43
|
+
}
|
|
44
|
+
async create(values) {
|
|
45
|
+
var _a, _b;
|
|
46
|
+
try {
|
|
47
|
+
const repo = this.plugin.db.getRepository("agentExecutionSpans");
|
|
48
|
+
if (!repo) return null;
|
|
49
|
+
const record = await repo.create({
|
|
50
|
+
values: {
|
|
51
|
+
...values,
|
|
52
|
+
startedAt: values.startedAt || /* @__PURE__ */ new Date(),
|
|
53
|
+
createdAt: /* @__PURE__ */ new Date()
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
return toPlain(record);
|
|
57
|
+
} catch (error) {
|
|
58
|
+
(_b = (_a = this.plugin.app.log) == null ? void 0 : _a.warn) == null ? void 0 : _b.call(_a, "[AgentOrchestrator] Failed to create execution span", error);
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
async update(spanId, values) {
|
|
63
|
+
var _a, _b;
|
|
64
|
+
if (!spanId) return null;
|
|
65
|
+
try {
|
|
66
|
+
const repo = this.plugin.db.getRepository("agentExecutionSpans");
|
|
67
|
+
if (!repo) return null;
|
|
68
|
+
await repo.update({
|
|
69
|
+
filterByTk: spanId,
|
|
70
|
+
values: {
|
|
71
|
+
...values,
|
|
72
|
+
updatedAt: /* @__PURE__ */ new Date()
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
return { id: spanId };
|
|
76
|
+
} catch (error) {
|
|
77
|
+
(_b = (_a = this.plugin.app.log) == null ? void 0 : _a.warn) == null ? void 0 : _b.call(_a, `[AgentOrchestrator] Failed to update execution span ${spanId}`, error);
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
async finish(spanId, status, startedAt, values = {}) {
|
|
82
|
+
return this.update(spanId, {
|
|
83
|
+
...values,
|
|
84
|
+
status,
|
|
85
|
+
endedAt: /* @__PURE__ */ new Date(),
|
|
86
|
+
durationMs: Date.now() - startedAt
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function getOrchestratorTraceContext(ctx) {
|
|
91
|
+
var _a, _b, _c;
|
|
92
|
+
return (ctx == null ? void 0 : ctx[ORCHESTRATOR_TRACE_CONTEXT_KEY]) || ((_a = ctx == null ? void 0 : ctx.state) == null ? void 0 : _a.orchestratorTraceContext) || ((_c = (_b = ctx == null ? void 0 : ctx.runtime) == null ? void 0 : _b.context) == null ? void 0 : _c.orchestratorTraceContext) || null;
|
|
93
|
+
}
|
|
94
|
+
function setOrchestratorTraceContext(ctx, traceContext) {
|
|
95
|
+
ctx[ORCHESTRATOR_TRACE_CONTEXT_KEY] = traceContext;
|
|
96
|
+
return ctx;
|
|
97
|
+
}
|
|
98
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
99
|
+
0 && (module.exports = {
|
|
100
|
+
ExecutionSpanService,
|
|
101
|
+
ORCHESTRATOR_TRACE_CONTEXT_KEY,
|
|
102
|
+
getOrchestratorTraceContext,
|
|
103
|
+
setOrchestratorTraceContext
|
|
104
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface OutputFileInfo {
|
|
2
|
+
name: string;
|
|
3
|
+
size: number;
|
|
4
|
+
mimeType: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class FileManager {
|
|
7
|
+
private storagePath;
|
|
8
|
+
private executionsDir;
|
|
9
|
+
constructor(storagePath: string);
|
|
10
|
+
createExecDir(execId: string): string;
|
|
11
|
+
getExecDir(execId: string): string;
|
|
12
|
+
getOutputDir(execId: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Returns absolute path to an output file, or null if invalid/not found.
|
|
15
|
+
* Includes path traversal protection.
|
|
16
|
+
*/
|
|
17
|
+
getOutputFilePath(execId: string, filename: string): string | null;
|
|
18
|
+
listOutputFiles(execId: string): OutputFileInfo[];
|
|
19
|
+
getTotalOutputSize(execId: string): number;
|
|
20
|
+
/**
|
|
21
|
+
* Remove a specific execution directory by execId.
|
|
22
|
+
*/
|
|
23
|
+
removeExecDir(execId: string): void;
|
|
24
|
+
/**
|
|
25
|
+
* Remove execution directories older than maxAgeMs.
|
|
26
|
+
*/
|
|
27
|
+
cleanupOlderThan(maxAgeMs: number): number;
|
|
28
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
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 FileManager_exports = {};
|
|
28
|
+
__export(FileManager_exports, {
|
|
29
|
+
FileManager: () => FileManager
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(FileManager_exports);
|
|
32
|
+
var import_fs = require("fs");
|
|
33
|
+
var import_path = require("path");
|
|
34
|
+
const MIME_MAP = {
|
|
35
|
+
".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
36
|
+
".xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
37
|
+
".pdf": "application/pdf",
|
|
38
|
+
".csv": "text/csv",
|
|
39
|
+
".json": "application/json",
|
|
40
|
+
".txt": "text/plain",
|
|
41
|
+
".png": "image/png",
|
|
42
|
+
".jpg": "image/jpeg",
|
|
43
|
+
".jpeg": "image/jpeg",
|
|
44
|
+
".svg": "image/svg+xml",
|
|
45
|
+
".pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
46
|
+
".zip": "application/zip",
|
|
47
|
+
".html": "text/html",
|
|
48
|
+
".xml": "application/xml"
|
|
49
|
+
};
|
|
50
|
+
function getMimeType(filename) {
|
|
51
|
+
const ext = filename.substring(filename.lastIndexOf(".")).toLowerCase();
|
|
52
|
+
return MIME_MAP[ext] || "application/octet-stream";
|
|
53
|
+
}
|
|
54
|
+
class FileManager {
|
|
55
|
+
constructor(storagePath) {
|
|
56
|
+
this.storagePath = storagePath;
|
|
57
|
+
this.executionsDir = (0, import_path.resolve)(storagePath, "executions");
|
|
58
|
+
(0, import_fs.mkdirSync)(this.executionsDir, { recursive: true });
|
|
59
|
+
}
|
|
60
|
+
executionsDir;
|
|
61
|
+
createExecDir(execId) {
|
|
62
|
+
const dir = (0, import_path.resolve)(this.executionsDir, execId);
|
|
63
|
+
(0, import_fs.mkdirSync)(dir, { recursive: true });
|
|
64
|
+
(0, import_fs.mkdirSync)((0, import_path.resolve)(dir, "output"), { recursive: true });
|
|
65
|
+
return dir;
|
|
66
|
+
}
|
|
67
|
+
getExecDir(execId) {
|
|
68
|
+
return (0, import_path.resolve)(this.executionsDir, execId);
|
|
69
|
+
}
|
|
70
|
+
getOutputDir(execId) {
|
|
71
|
+
return (0, import_path.resolve)(this.executionsDir, execId, "output");
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Returns absolute path to an output file, or null if invalid/not found.
|
|
75
|
+
* Includes path traversal protection.
|
|
76
|
+
*/
|
|
77
|
+
getOutputFilePath(execId, filename) {
|
|
78
|
+
const safeBase = (0, import_path.resolve)(this.executionsDir, execId, "output");
|
|
79
|
+
const filePath = (0, import_path.resolve)(safeBase, filename);
|
|
80
|
+
if (!filePath.startsWith(safeBase)) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
if (!(0, import_fs.existsSync)(filePath)) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
return filePath;
|
|
87
|
+
}
|
|
88
|
+
listOutputFiles(execId) {
|
|
89
|
+
const outputDir = this.getOutputDir(execId);
|
|
90
|
+
if (!(0, import_fs.existsSync)(outputDir)) return [];
|
|
91
|
+
try {
|
|
92
|
+
return (0, import_fs.readdirSync)(outputDir).filter((name) => {
|
|
93
|
+
const filePath = (0, import_path.join)(outputDir, name);
|
|
94
|
+
return (0, import_fs.statSync)(filePath).isFile();
|
|
95
|
+
}).map((name) => {
|
|
96
|
+
const filePath = (0, import_path.join)(outputDir, name);
|
|
97
|
+
const stat = (0, import_fs.statSync)(filePath);
|
|
98
|
+
return {
|
|
99
|
+
name,
|
|
100
|
+
size: stat.size,
|
|
101
|
+
mimeType: getMimeType(name)
|
|
102
|
+
};
|
|
103
|
+
});
|
|
104
|
+
} catch {
|
|
105
|
+
return [];
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
getTotalOutputSize(execId) {
|
|
109
|
+
const files = this.listOutputFiles(execId);
|
|
110
|
+
return files.reduce((sum, f) => sum + f.size, 0);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Remove a specific execution directory by execId.
|
|
114
|
+
*/
|
|
115
|
+
removeExecDir(execId) {
|
|
116
|
+
const dirPath = (0, import_path.resolve)(this.executionsDir, execId);
|
|
117
|
+
if ((0, import_fs.existsSync)(dirPath)) {
|
|
118
|
+
try {
|
|
119
|
+
(0, import_fs.rmSync)(dirPath, { recursive: true, force: true });
|
|
120
|
+
} catch {
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Remove execution directories older than maxAgeMs.
|
|
126
|
+
*/
|
|
127
|
+
cleanupOlderThan(maxAgeMs) {
|
|
128
|
+
if (!(0, import_fs.existsSync)(this.executionsDir)) return 0;
|
|
129
|
+
let cleaned = 0;
|
|
130
|
+
const now = Date.now();
|
|
131
|
+
try {
|
|
132
|
+
for (const dir of (0, import_fs.readdirSync)(this.executionsDir)) {
|
|
133
|
+
const dirPath = (0, import_path.resolve)(this.executionsDir, dir);
|
|
134
|
+
try {
|
|
135
|
+
const stat = (0, import_fs.statSync)(dirPath);
|
|
136
|
+
if (stat.isDirectory() && now - stat.mtimeMs > maxAgeMs) {
|
|
137
|
+
(0, import_fs.rmSync)(dirPath, { recursive: true, force: true });
|
|
138
|
+
cleaned++;
|
|
139
|
+
}
|
|
140
|
+
} catch {
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
} catch {
|
|
144
|
+
}
|
|
145
|
+
return cleaned;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
149
|
+
0 && (module.exports = {
|
|
150
|
+
FileManager
|
|
151
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { FileManager, OutputFileInfo } from './FileManager';
|
|
2
|
+
export interface ExecuteOptions {
|
|
3
|
+
language: 'node' | 'python';
|
|
4
|
+
code: string;
|
|
5
|
+
execId: string;
|
|
6
|
+
timeoutSeconds?: number;
|
|
7
|
+
maxOutputSizeMb?: number;
|
|
8
|
+
onProgress?: (progress: ProgressUpdate) => void;
|
|
9
|
+
/** AbortSignal — when aborted, the child process is killed */
|
|
10
|
+
signal?: {
|
|
11
|
+
addEventListener(event: string, listener: () => void): void;
|
|
12
|
+
};
|
|
13
|
+
/** Package whitelist for import validation (from skillWorkerConfigs) */
|
|
14
|
+
packageWhitelist?: string[];
|
|
15
|
+
/** Optional installed/copied skill package root exposed to the runtime as SKILL_DIR. */
|
|
16
|
+
skillDir?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ProgressUpdate {
|
|
19
|
+
percent: number;
|
|
20
|
+
log: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ExecutionResult {
|
|
23
|
+
success: boolean;
|
|
24
|
+
stdout: string;
|
|
25
|
+
stderr: string;
|
|
26
|
+
files: OutputFileInfo[];
|
|
27
|
+
durationMs: number;
|
|
28
|
+
/** true if execution was canceled by user */
|
|
29
|
+
canceled?: boolean;
|
|
30
|
+
/** true if execution timed out */
|
|
31
|
+
timedOut?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export declare class SandboxRunner {
|
|
34
|
+
private fileManager;
|
|
35
|
+
private logger;
|
|
36
|
+
private storagePath;
|
|
37
|
+
private validator;
|
|
38
|
+
private sandboxWorkspace;
|
|
39
|
+
constructor(fileManager: FileManager, logger: any, storagePath: string);
|
|
40
|
+
execute(options: ExecuteOptions): Promise<ExecutionResult>;
|
|
41
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
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 SandboxRunner_exports = {};
|
|
28
|
+
__export(SandboxRunner_exports, {
|
|
29
|
+
SandboxRunner: () => SandboxRunner
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(SandboxRunner_exports);
|
|
32
|
+
var import_child_process = require("child_process");
|
|
33
|
+
var import_fs = require("fs");
|
|
34
|
+
var import_path = require("path");
|
|
35
|
+
var import_CodeValidator = require("./CodeValidator");
|
|
36
|
+
class SandboxRunner {
|
|
37
|
+
constructor(fileManager, logger, storagePath) {
|
|
38
|
+
this.fileManager = fileManager;
|
|
39
|
+
this.logger = logger;
|
|
40
|
+
this.storagePath = storagePath;
|
|
41
|
+
this.sandboxWorkspace = (0, import_path.resolve)(storagePath, "sandbox-workspace");
|
|
42
|
+
}
|
|
43
|
+
validator = new import_CodeValidator.CodeValidator();
|
|
44
|
+
sandboxWorkspace;
|
|
45
|
+
async execute(options) {
|
|
46
|
+
const {
|
|
47
|
+
language,
|
|
48
|
+
code,
|
|
49
|
+
execId,
|
|
50
|
+
timeoutSeconds = 60,
|
|
51
|
+
maxOutputSizeMb = 50,
|
|
52
|
+
onProgress,
|
|
53
|
+
signal,
|
|
54
|
+
packageWhitelist,
|
|
55
|
+
skillDir
|
|
56
|
+
} = options;
|
|
57
|
+
this.validator.validate(code, language);
|
|
58
|
+
if (packageWhitelist == null ? void 0 : packageWhitelist.length) {
|
|
59
|
+
this.validator.validateImports(code, language, packageWhitelist);
|
|
60
|
+
}
|
|
61
|
+
const workDir = this.fileManager.createExecDir(execId);
|
|
62
|
+
const outputDir = this.fileManager.getOutputDir(execId);
|
|
63
|
+
const filename = language === "node" ? "script.js" : "script.py";
|
|
64
|
+
const scriptPath = (0, import_path.resolve)(workDir, filename);
|
|
65
|
+
(0, import_fs.writeFileSync)(scriptPath, code, "utf-8");
|
|
66
|
+
onProgress == null ? void 0 : onProgress({ percent: 20, log: "Code validated, executing..." });
|
|
67
|
+
const cmd = language === "node" ? `node "${scriptPath}"` : `python3 "${scriptPath}"`;
|
|
68
|
+
const path = require("path");
|
|
69
|
+
const nodePath = path.resolve(this.sandboxWorkspace, "node_modules");
|
|
70
|
+
const finalNodePath = process.env.NODE_PATH ? `${nodePath}${path.delimiter}${process.env.NODE_PATH}` : nodePath;
|
|
71
|
+
const startTime = Date.now();
|
|
72
|
+
let childProc = null;
|
|
73
|
+
let wasCanceled = false;
|
|
74
|
+
const processResult = await new Promise((resolveResult) => {
|
|
75
|
+
childProc = (0, import_child_process.exec)(
|
|
76
|
+
cmd,
|
|
77
|
+
{
|
|
78
|
+
timeout: timeoutSeconds * 1e3,
|
|
79
|
+
maxBuffer: 10 * 1024 * 1024,
|
|
80
|
+
// 10MB stdout/stderr buffer
|
|
81
|
+
cwd: workDir,
|
|
82
|
+
env: {
|
|
83
|
+
// Sanitized environment — only expose what's necessary
|
|
84
|
+
PATH: process.env.PATH,
|
|
85
|
+
HOME: "/tmp",
|
|
86
|
+
TMPDIR: "/tmp",
|
|
87
|
+
OUTPUT_DIR: outputDir,
|
|
88
|
+
LANG: "en_US.UTF-8",
|
|
89
|
+
// Node.js
|
|
90
|
+
NODE_PATH: finalNodePath,
|
|
91
|
+
// Python — include bundled packages (svg_to_pptx etc.)
|
|
92
|
+
PYTHONPATH: [
|
|
93
|
+
skillDir ? path.resolve(skillDir, "scripts") : "",
|
|
94
|
+
path.resolve(this.sandboxWorkspace, "python_packages"),
|
|
95
|
+
process.env.PYTHONPATH || ""
|
|
96
|
+
].filter(Boolean).join(path.delimiter),
|
|
97
|
+
PYTHONIOENCODING: "utf-8",
|
|
98
|
+
SKILL_DIR: skillDir || ""
|
|
99
|
+
// DO NOT pass: DB credentials, API keys, APP_KEY, etc.
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
(error, stdout, stderr) => {
|
|
103
|
+
let exitCode = 0;
|
|
104
|
+
if (error) {
|
|
105
|
+
if (error.killed) {
|
|
106
|
+
exitCode = -1;
|
|
107
|
+
} else {
|
|
108
|
+
exitCode = error.code || 1;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
resolveResult({
|
|
112
|
+
exitCode,
|
|
113
|
+
stdout: (stdout || "").slice(0, 5e3),
|
|
114
|
+
stderr: (stderr || "").slice(0, 2e3)
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
if (signal) {
|
|
119
|
+
signal.addEventListener("abort", () => {
|
|
120
|
+
wasCanceled = true;
|
|
121
|
+
if (childProc && !childProc.killed) {
|
|
122
|
+
this.logger.info(`[skill-hub] Killing child process for exec ${execId} (user abort)`);
|
|
123
|
+
childProc.kill("SIGTERM");
|
|
124
|
+
setTimeout(() => {
|
|
125
|
+
if (childProc && !childProc.killed) {
|
|
126
|
+
childProc.kill("SIGKILL");
|
|
127
|
+
}
|
|
128
|
+
}, 3e3);
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
const durationMs = Date.now() - startTime;
|
|
134
|
+
onProgress == null ? void 0 : onProgress({ percent: 80, log: wasCanceled ? "Canceled" : "Execution completed, collecting files..." });
|
|
135
|
+
const files = this.fileManager.listOutputFiles(execId);
|
|
136
|
+
const totalSizeBytes = this.fileManager.getTotalOutputSize(execId);
|
|
137
|
+
const maxBytes = maxOutputSizeMb * 1024 * 1024;
|
|
138
|
+
if (totalSizeBytes > maxBytes) {
|
|
139
|
+
this.logger.warn(
|
|
140
|
+
`[skill-hub] Execution ${execId}: output size ${totalSizeBytes} bytes exceeds limit ${maxBytes}`
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
onProgress == null ? void 0 : onProgress({ percent: 100, log: "Done" });
|
|
144
|
+
const timedOut = !wasCanceled && processResult.exitCode === -1;
|
|
145
|
+
if (timedOut) {
|
|
146
|
+
processResult.stderr = `Execution timed out after ${timeoutSeconds}s
|
|
147
|
+
${processResult.stderr}`;
|
|
148
|
+
}
|
|
149
|
+
if (wasCanceled) {
|
|
150
|
+
processResult.stderr = `Execution canceled by user
|
|
151
|
+
${processResult.stderr}`;
|
|
152
|
+
}
|
|
153
|
+
return {
|
|
154
|
+
success: !wasCanceled && !timedOut && processResult.exitCode === 0,
|
|
155
|
+
stdout: processResult.stdout,
|
|
156
|
+
stderr: processResult.stderr,
|
|
157
|
+
files,
|
|
158
|
+
durationMs,
|
|
159
|
+
canceled: wasCanceled,
|
|
160
|
+
timedOut
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
165
|
+
0 && (module.exports = {
|
|
166
|
+
SandboxRunner
|
|
167
|
+
});
|