@n8n/instance-ai 1.7.1 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/instance-agent.d.ts +1 -1
- package/dist/agent/instance-agent.js +88 -75
- package/dist/agent/instance-agent.js.map +1 -1
- package/dist/agent/mcp-tool-name-validation.d.ts +4 -2
- package/dist/agent/mcp-tool-name-validation.js +2 -2
- package/dist/agent/mcp-tool-name-validation.js.map +1 -1
- package/dist/agent/runtime-workspace.d.ts +6 -0
- package/dist/agent/runtime-workspace.js +14 -0
- package/dist/agent/runtime-workspace.js.map +1 -0
- package/dist/agent/sanitize-mcp-schemas.d.ts +4 -3
- package/dist/agent/sanitize-mcp-schemas.js +53 -24
- package/dist/agent/sanitize-mcp-schemas.js.map +1 -1
- package/dist/agent/sub-agent-debriefing.d.ts +2 -2
- package/dist/agent/sub-agent-factory.d.ts +7 -4
- package/dist/agent/sub-agent-factory.js +24 -13
- package/dist/agent/sub-agent-factory.js.map +1 -1
- package/dist/agent/system-prompt.js +18 -15
- package/dist/agent/system-prompt.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/constants/max-steps.d.ts +1 -1
- package/dist/constants/max-steps.js +1 -1
- package/dist/constants/max-steps.js.map +1 -1
- package/dist/domain-access/domain-gating.d.ts +2 -2
- package/dist/error-formatting.d.ts +1 -0
- package/dist/error-formatting.js +159 -0
- package/dist/error-formatting.js.map +1 -0
- package/dist/index.d.ts +65 -24
- package/dist/index.js +96 -52
- package/dist/index.js.map +1 -1
- package/dist/mcp/mcp-client-manager.d.ts +5 -4
- package/dist/mcp/mcp-client-manager.js +42 -17
- package/dist/mcp/mcp-client-manager.js.map +1 -1
- package/dist/memory/title-utils.d.ts +4 -1
- package/dist/memory/title-utils.js +10 -2
- package/dist/memory/title-utils.js.map +1 -1
- package/dist/parsers/structured-file-parser.d.ts +5 -2
- package/dist/parsers/structured-file-parser.js +9 -2
- package/dist/parsers/structured-file-parser.js.map +1 -1
- package/dist/planned-tasks/planned-task-permissions.js +3 -5
- package/dist/planned-tasks/planned-task-permissions.js.map +1 -1
- package/dist/planned-tasks/planned-task-service.d.ts +1 -0
- package/dist/planned-tasks/planned-task-service.js +8 -0
- package/dist/planned-tasks/planned-task-service.js.map +1 -1
- package/dist/runtime/background-task-manager.d.ts +9 -2
- package/dist/runtime/background-task-manager.js +7 -2
- package/dist/runtime/background-task-manager.js.map +1 -1
- package/dist/runtime/liveness-policy.js +4 -3
- package/dist/runtime/liveness-policy.js.map +1 -1
- package/dist/runtime/resumable-stream-executor.d.ts +4 -24
- package/dist/runtime/resumable-stream-executor.js +103 -1318
- package/dist/runtime/resumable-stream-executor.js.map +1 -1
- package/dist/runtime/run-state-registry.d.ts +8 -2
- package/dist/runtime/run-state-registry.js +19 -1
- package/dist/runtime/run-state-registry.js.map +1 -1
- package/dist/runtime/stream-runner.d.ts +4 -4
- package/dist/runtime/stream-runner.js +11 -25
- package/dist/runtime/stream-runner.js.map +1 -1
- package/dist/skills/materialize-runtime-skills.d.ts +62 -0
- package/dist/skills/materialize-runtime-skills.js +465 -0
- package/dist/skills/materialize-runtime-skills.js.map +1 -0
- package/dist/skills/runtime-skills.d.ts +4 -0
- package/dist/skills/runtime-skills.js +17 -0
- package/dist/skills/runtime-skills.js.map +1 -0
- package/dist/source-map-filter.d.ts +17 -0
- package/dist/source-map-filter.js +39 -0
- package/dist/source-map-filter.js.map +1 -0
- package/dist/storage/agent-tree-snapshot.d.ts +2 -0
- package/dist/storage/index.d.ts +3 -3
- package/dist/storage/index.js +8 -7
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/planned-task-storage.d.ts +3 -3
- package/dist/storage/planned-task-storage.js +3 -8
- package/dist/storage/planned-task-storage.js.map +1 -1
- package/dist/storage/terminal-outcome-storage.d.ts +4 -4
- package/dist/storage/terminal-outcome-storage.js +1 -1
- package/dist/storage/terminal-outcome-storage.js.map +1 -1
- package/dist/storage/{mastra-iteration-log-storage.d.ts → thread-iteration-log-storage.d.ts} +3 -3
- package/dist/storage/{mastra-iteration-log-storage.js → thread-iteration-log-storage.js} +5 -5
- package/dist/storage/thread-iteration-log-storage.js.map +1 -0
- package/dist/storage/thread-patch.d.ts +16 -10
- package/dist/storage/thread-patch.js +37 -36
- package/dist/storage/thread-patch.js.map +1 -1
- package/dist/storage/{mastra-task-storage.d.ts → thread-task-storage.d.ts} +3 -3
- package/dist/storage/{mastra-task-storage.js → thread-task-storage.js} +5 -5
- package/dist/storage/thread-task-storage.js.map +1 -0
- package/dist/storage/workflow-loop-storage.d.ts +28 -28
- package/dist/storage/workflow-loop-storage.js +1 -1
- package/dist/storage/workflow-loop-storage.js.map +1 -1
- package/dist/stream/consume-with-hitl.d.ts +11 -11
- package/dist/stream/consume-with-hitl.js +27 -15
- package/dist/stream/consume-with-hitl.js.map +1 -1
- package/dist/stream/map-chunk.d.ts +1 -1
- package/dist/stream/map-chunk.js +153 -36
- package/dist/stream/map-chunk.js.map +1 -1
- package/dist/tool-registry.d.ts +8 -0
- package/dist/tool-registry.js +45 -0
- package/dist/tool-registry.js.map +1 -0
- package/dist/tools/attachments/parse-file.tool.d.ts +42 -45
- package/dist/tools/attachments/parse-file.tool.js +140 -97
- package/dist/tools/attachments/parse-file.tool.js.map +1 -1
- package/dist/tools/credentials.tool.d.ts +5 -5
- package/dist/tools/credentials.tool.js +31 -34
- package/dist/tools/credentials.tool.js.map +1 -1
- package/dist/tools/data-tables.tool.d.ts +3 -2
- package/dist/tools/data-tables.tool.js +99 -100
- package/dist/tools/data-tables.tool.js.map +1 -1
- package/dist/tools/evals/apply-pin-data.service.d.ts +3 -0
- package/dist/tools/evals/apply-pin-data.service.js +19 -0
- package/dist/tools/evals/apply-pin-data.service.js.map +1 -0
- package/dist/tools/evals/column-ref-utils.d.ts +3 -0
- package/dist/tools/evals/column-ref-utils.js +205 -48
- package/dist/tools/evals/column-ref-utils.js.map +1 -1
- package/dist/tools/evals/detect-agent-named-refs.service.js +20 -4
- package/dist/tools/evals/detect-agent-named-refs.service.js.map +1 -1
- package/dist/tools/evals/ensure-eval-data-table.service.d.ts +15 -0
- package/dist/tools/evals/ensure-eval-data-table.service.js +83 -0
- package/dist/tools/evals/ensure-eval-data-table.service.js.map +1 -0
- package/dist/tools/evals/eval-data-requirements.service.d.ts +1 -0
- package/dist/tools/evals/eval-data-requirements.service.js +23 -4
- package/dist/tools/evals/eval-data-requirements.service.js.map +1 -1
- package/dist/tools/evals/evals.tool.d.ts +2 -0
- package/dist/tools/evals/evals.tool.js +452 -0
- package/dist/tools/evals/evals.tool.js.map +1 -0
- package/dist/tools/evals/extract-rows-from-history.service.d.ts +17 -0
- package/dist/tools/evals/extract-rows-from-history.service.js +103 -0
- package/dist/tools/evals/extract-rows-from-history.service.js.map +1 -0
- package/dist/tools/evals/format-eval-setup-task.d.ts +16 -0
- package/dist/tools/evals/format-eval-setup-task.js +167 -0
- package/dist/tools/evals/format-eval-setup-task.js.map +1 -0
- package/dist/tools/evals/generate-sample-rows.service.d.ts +35 -0
- package/dist/tools/evals/generate-sample-rows.service.js +278 -0
- package/dist/tools/evals/generate-sample-rows.service.js.map +1 -0
- package/dist/tools/evals/generate-tool-ref-pin-data.service.d.ts +11 -0
- package/dist/tools/evals/generate-tool-ref-pin-data.service.js +125 -0
- package/dist/tools/evals/generate-tool-ref-pin-data.service.js.map +1 -0
- package/dist/tools/evals/metric-catalog.d.ts +10 -4
- package/dist/tools/evals/metric-catalog.js.map +1 -1
- package/dist/tools/executions.tool.d.ts +1 -1
- package/dist/tools/executions.tool.js +25 -34
- package/dist/tools/executions.tool.js.map +1 -1
- package/dist/tools/filesystem/create-tools-from-mcp-server.d.ts +2 -3
- package/dist/tools/filesystem/create-tools-from-mcp-server.js +129 -67
- package/dist/tools/filesystem/create-tools-from-mcp-server.js.map +1 -1
- package/dist/tools/index.d.ts +4 -16
- package/dist/tools/index.js +102 -92
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/nodes.tool.d.ts +1 -1
- package/dist/tools/nodes.tool.js +31 -33
- package/dist/tools/nodes.tool.js.map +1 -1
- package/dist/tools/orchestration/add-plan-item.tool.d.ts +2 -2
- package/dist/tools/orchestration/add-plan-item.tool.js +45 -49
- package/dist/tools/orchestration/add-plan-item.tool.js.map +1 -1
- package/dist/tools/orchestration/agent-persistence.d.ts +14 -0
- package/dist/tools/orchestration/agent-persistence.js +43 -0
- package/dist/tools/orchestration/agent-persistence.js.map +1 -0
- package/dist/tools/orchestration/blueprint-accumulator.d.ts +4 -8
- package/dist/tools/orchestration/blueprint-accumulator.js +11 -78
- package/dist/tools/orchestration/blueprint-accumulator.js.map +1 -1
- package/dist/tools/orchestration/blueprint.schema.d.ts +13 -147
- package/dist/tools/orchestration/blueprint.schema.js +4 -23
- package/dist/tools/orchestration/blueprint.schema.js.map +1 -1
- package/dist/tools/orchestration/browser-credential-setup.nudge.d.ts +2 -4
- package/dist/tools/orchestration/browser-credential-setup.nudge.js +1 -1
- package/dist/tools/orchestration/browser-credential-setup.nudge.js.map +1 -1
- package/dist/tools/orchestration/browser-credential-setup.tool.d.ts +10 -2
- package/dist/tools/orchestration/browser-credential-setup.tool.js +299 -270
- package/dist/tools/orchestration/browser-credential-setup.tool.js.map +1 -1
- package/dist/tools/orchestration/build-workflow-agent.prompt.d.ts +7 -1
- package/dist/tools/orchestration/build-workflow-agent.prompt.js +46 -20
- package/dist/tools/orchestration/build-workflow-agent.prompt.js.map +1 -1
- package/dist/tools/orchestration/build-workflow-agent.tool.d.ts +50 -5
- package/dist/tools/orchestration/build-workflow-agent.tool.js +748 -605
- package/dist/tools/orchestration/build-workflow-agent.tool.js.map +1 -1
- package/dist/tools/orchestration/builder-memory-compaction.d.ts +6 -2
- package/dist/tools/orchestration/builder-memory-compaction.js +32 -46
- package/dist/tools/orchestration/builder-memory-compaction.js.map +1 -1
- package/dist/tools/orchestration/complete-checkpoint.tool.d.ts +1 -1
- package/dist/tools/orchestration/complete-checkpoint.tool.js +46 -47
- package/dist/tools/orchestration/complete-checkpoint.tool.js.map +1 -1
- package/dist/tools/orchestration/delegate.tool.d.ts +1 -1
- package/dist/tools/orchestration/delegate.tool.js +170 -166
- package/dist/tools/orchestration/delegate.tool.js.map +1 -1
- package/dist/tools/orchestration/eval-data-agent.tool.d.ts +2 -0
- package/dist/tools/orchestration/eval-data-agent.tool.js +183 -0
- package/dist/tools/orchestration/eval-data-agent.tool.js.map +1 -0
- package/dist/tools/orchestration/eval-setup-agent.prompt.d.ts +1 -0
- package/dist/tools/orchestration/eval-setup-agent.prompt.js +238 -0
- package/dist/tools/orchestration/eval-setup-agent.prompt.js.map +1 -0
- package/dist/tools/orchestration/eval-setup-agent.tool.d.ts +31 -0
- package/dist/tools/orchestration/eval-setup-agent.tool.js +204 -0
- package/dist/tools/orchestration/eval-setup-agent.tool.js.map +1 -0
- package/dist/tools/orchestration/plan-agent-prompt.d.ts +1 -1
- package/dist/tools/orchestration/plan-agent-prompt.js +9 -9
- package/dist/tools/orchestration/plan-with-agent.tool.d.ts +1 -1
- package/dist/tools/orchestration/plan-with-agent.tool.js +210 -179
- package/dist/tools/orchestration/plan-with-agent.tool.js.map +1 -1
- package/dist/tools/orchestration/plan.tool.d.ts +5 -2
- package/dist/tools/orchestration/plan.tool.js +125 -105
- package/dist/tools/orchestration/plan.tool.js.map +1 -1
- package/dist/tools/orchestration/report-verification-verdict.tool.d.ts +3 -3
- package/dist/tools/orchestration/report-verification-verdict.tool.js +65 -66
- package/dist/tools/orchestration/report-verification-verdict.tool.js.map +1 -1
- package/dist/tools/orchestration/submit-plan.tool.d.ts +1 -1
- package/dist/tools/orchestration/submit-plan.tool.js +83 -66
- package/dist/tools/orchestration/submit-plan.tool.js.map +1 -1
- package/dist/tools/orchestration/tracing-utils.d.ts +3 -2
- package/dist/tools/orchestration/tracing-utils.js +58 -39
- package/dist/tools/orchestration/tracing-utils.js.map +1 -1
- package/dist/tools/orchestration/verify-built-workflow.tool.d.ts +5 -5
- package/dist/tools/orchestration/verify-built-workflow.tool.js +166 -166
- package/dist/tools/orchestration/verify-built-workflow.tool.js.map +1 -1
- package/dist/tools/research.tool.d.ts +1 -1
- package/dist/tools/research.tool.js +59 -27
- package/dist/tools/research.tool.js.map +1 -1
- package/dist/tools/shared/ask-user.tool.d.ts +3 -2
- package/dist/tools/shared/ask-user.tool.js +61 -63
- package/dist/tools/shared/ask-user.tool.js.map +1 -1
- package/dist/tools/task-control.tool.d.ts +1 -1
- package/dist/tools/task-control.tool.js +15 -16
- package/dist/tools/task-control.tool.js.map +1 -1
- package/dist/tools/templates.tool.d.ts +1 -1
- package/dist/tools/templates.tool.js +6 -7
- package/dist/tools/templates.tool.js.map +1 -1
- package/dist/tools/tool-ids.d.ts +40 -0
- package/dist/tools/tool-ids.js +62 -0
- package/dist/tools/tool-ids.js.map +1 -0
- package/dist/tools/workflows/apply-workflow-credentials.tool.d.ts +3 -3
- package/dist/tools/workflows/apply-workflow-credentials.tool.js +72 -73
- package/dist/tools/workflows/apply-workflow-credentials.tool.js.map +1 -1
- package/dist/tools/workflows/build-workflow.tool.d.ts +3 -3
- package/dist/tools/workflows/build-workflow.tool.js +113 -114
- package/dist/tools/workflows/build-workflow.tool.js.map +1 -1
- package/dist/tools/workflows/materialize-node-type.tool.d.ts +6 -6
- package/dist/tools/workflows/materialize-node-type.tool.js +64 -65
- package/dist/tools/workflows/materialize-node-type.tool.js.map +1 -1
- package/dist/tools/workflows/resolve-credentials.d.ts +3 -5
- package/dist/tools/workflows/resolve-credentials.js +15 -6
- package/dist/tools/workflows/resolve-credentials.js.map +1 -1
- package/dist/tools/workflows/setup-workflow.schema.d.ts +2 -2
- package/dist/tools/workflows/submit-workflow-identity.d.ts +8 -9
- package/dist/tools/workflows/submit-workflow-identity.js +41 -27
- package/dist/tools/workflows/submit-workflow-identity.js.map +1 -1
- package/dist/tools/workflows/submit-workflow.tool.d.ts +10 -7
- package/dist/tools/workflows/submit-workflow.tool.js +224 -191
- package/dist/tools/workflows/submit-workflow.tool.js.map +1 -1
- package/dist/tools/workflows/validate-workflow.service.d.ts +15 -0
- package/dist/tools/workflows/validate-workflow.service.js +289 -0
- package/dist/tools/workflows/validate-workflow.service.js.map +1 -0
- package/dist/tools/workflows/write-sandbox-file.tool.d.ts +2 -2
- package/dist/tools/workflows/write-sandbox-file.tool.js +29 -30
- package/dist/tools/workflows/write-sandbox-file.tool.js.map +1 -1
- package/dist/tools/workflows.tool.d.ts +5 -2
- package/dist/tools/workflows.tool.js +184 -85
- package/dist/tools/workflows.tool.js.map +1 -1
- package/dist/tools/workspace.tool.d.ts +1 -1
- package/dist/tools/workspace.tool.js +49 -65
- package/dist/tools/workspace.tool.js.map +1 -1
- package/dist/tracing/langsmith-tracing.d.ts +17 -18
- package/dist/tracing/langsmith-tracing.js +941 -677
- package/dist/tracing/langsmith-tracing.js.map +1 -1
- package/dist/tracing/trace-labels.d.ts +5 -0
- package/dist/tracing/trace-labels.js +36 -0
- package/dist/tracing/trace-labels.js.map +1 -0
- package/dist/tracing/trace-payloads.d.ts +23 -0
- package/dist/tracing/trace-payloads.js +1008 -0
- package/dist/tracing/trace-payloads.js.map +1 -0
- package/dist/types.d.ts +57 -25
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -1
- package/dist/utils/eval-agents.js +1 -1
- package/dist/utils/eval-agents.js.map +1 -1
- package/dist/utils/scrub-secrets.js +1 -1
- package/dist/utils/scrub-secrets.js.map +1 -1
- package/dist/utils/stream-helpers.d.ts +2 -5
- package/dist/utils/stream-helpers.js +12 -1
- package/dist/utils/stream-helpers.js.map +1 -1
- package/dist/workflow-loop/workflow-loop-state.d.ts +18 -18
- package/dist/workspace/builder-templates-service.d.ts +54 -0
- package/dist/workspace/builder-templates-service.js +442 -0
- package/dist/workspace/builder-templates-service.js.map +1 -0
- package/dist/workspace/create-workspace.d.ts +16 -3
- package/dist/workspace/create-workspace.js +45 -21
- package/dist/workspace/create-workspace.js.map +1 -1
- package/dist/workspace/daytona-auth-manager.d.ts +26 -0
- package/dist/workspace/daytona-auth-manager.js +90 -0
- package/dist/workspace/daytona-auth-manager.js.map +1 -0
- package/dist/workspace/daytona-filesystem.d.ts +5 -4
- package/dist/workspace/daytona-filesystem.js +25 -15
- package/dist/workspace/daytona-filesystem.js.map +1 -1
- package/dist/workspace/daytona-sandbox.d.ts +65 -0
- package/dist/workspace/daytona-sandbox.js +314 -0
- package/dist/workspace/daytona-sandbox.js.map +1 -0
- package/dist/workspace/lazy-daytona.d.ts +2 -0
- package/dist/workspace/lazy-daytona.js +12 -0
- package/dist/workspace/lazy-daytona.js.map +1 -0
- package/dist/workspace/lazy-runtime-workspace.d.ts +8 -0
- package/dist/workspace/lazy-runtime-workspace.js +246 -0
- package/dist/workspace/lazy-runtime-workspace.js.map +1 -0
- package/dist/workspace/local-filesystem.d.ts +48 -0
- package/dist/workspace/local-filesystem.js +250 -0
- package/dist/workspace/local-filesystem.js.map +1 -0
- package/dist/workspace/local-sandbox.d.ts +28 -0
- package/dist/workspace/local-sandbox.js +121 -0
- package/dist/workspace/local-sandbox.js.map +1 -0
- package/dist/workspace/n8n-sandbox-filesystem.d.ts +3 -3
- package/dist/workspace/n8n-sandbox-filesystem.js +3 -3
- package/dist/workspace/n8n-sandbox-filesystem.js.map +1 -1
- package/dist/workspace/n8n-sandbox-sandbox.d.ts +12 -3
- package/dist/workspace/n8n-sandbox-sandbox.js +54 -10
- package/dist/workspace/n8n-sandbox-sandbox.js.map +1 -1
- package/dist/workspace/sandbox-fs.d.ts +35 -4
- package/dist/workspace/sandbox-fs.js +1 -1
- package/dist/workspace/sandbox-fs.js.map +1 -1
- package/dist/workspace/sandbox-setup.d.ts +13 -4
- package/dist/workspace/sandbox-setup.js +250 -36
- package/dist/workspace/sandbox-setup.js.map +1 -1
- package/dist/workspace/scoped-workspace.d.ts +2 -0
- package/dist/workspace/scoped-workspace.js +141 -0
- package/dist/workspace/scoped-workspace.js.map +1 -0
- package/dist/workspace/snapshot-manager.d.ts +11 -5
- package/dist/workspace/snapshot-manager.js +74 -17
- package/dist/workspace/snapshot-manager.js.map +1 -1
- package/dist/workspace/template-telemetry.d.ts +4 -4
- package/dist/workspace/template-telemetry.js +18 -6
- package/dist/workspace/template-telemetry.js.map +1 -1
- package/package.json +13 -16
- package/skills/data-table-manager/SKILL.md +119 -0
- package/skills/data-table-manager/references/data-table-playbook.md +212 -0
- package/dist/agent/register-with-mastra.d.ts +0 -3
- package/dist/agent/register-with-mastra.js +0 -15
- package/dist/agent/register-with-mastra.js.map +0 -1
- package/dist/compaction/compaction-helper.d.ts +0 -9
- package/dist/compaction/compaction-helper.js +0 -58
- package/dist/compaction/compaction-helper.js.map +0 -1
- package/dist/compaction/index.d.ts +0 -2
- package/dist/compaction/index.js +0 -6
- package/dist/compaction/index.js.map +0 -1
- package/dist/memory/memory-config.d.ts +0 -3
- package/dist/memory/memory-config.js +0 -27
- package/dist/memory/memory-config.js.map +0 -1
- package/dist/runtime/builder-sandbox-session-registry.d.ts +0 -47
- package/dist/runtime/builder-sandbox-session-registry.js +0 -166
- package/dist/runtime/builder-sandbox-session-registry.js.map +0 -1
- package/dist/storage/mastra-iteration-log-storage.js.map +0 -1
- package/dist/storage/mastra-task-storage.js.map +0 -1
- package/dist/tools/orchestration/data-table-agent.prompt.d.ts +0 -1
- package/dist/tools/orchestration/data-table-agent.prompt.js +0 -47
- package/dist/tools/orchestration/data-table-agent.prompt.js.map +0 -1
- package/dist/tools/orchestration/data-table-agent.tool.d.ts +0 -26
- package/dist/tools/orchestration/data-table-agent.tool.js +0 -174
- package/dist/tools/orchestration/data-table-agent.tool.js.map +0 -1
- package/dist/tools/orchestration/research-agent-prompt.d.ts +0 -1
- package/dist/tools/orchestration/research-agent-prompt.js +0 -26
- package/dist/tools/orchestration/research-agent-prompt.js.map +0 -1
- package/dist/tools/orchestration/research-with-agent.tool.d.ts +0 -30
- package/dist/tools/orchestration/research-with-agent.tool.js +0 -179
- package/dist/tools/orchestration/research-with-agent.tool.js.map +0 -1
- package/dist/workspace/builder-sandbox-factory.d.ts +0 -30
- package/dist/workspace/builder-sandbox-factory.js +0 -289
- package/dist/workspace/builder-sandbox-factory.js.map +0 -1
- package/dist/workspace/guarded-filesystem.d.ts +0 -10
- package/dist/workspace/guarded-filesystem.js +0 -136
- package/dist/workspace/guarded-filesystem.js.map +0 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DaytonaAuthManager = void 0;
|
|
4
|
+
const utils_1 = require("@n8n/utils");
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
const lazy_daytona_1 = require("./lazy-daytona");
|
|
7
|
+
const DEFAULT_REFRESH_SKEW_MS = 5 * 60 * 1000;
|
|
8
|
+
const DECODE_FALLBACK_TTL_MS = 30 * 60 * 1000;
|
|
9
|
+
class DaytonaAuthManager {
|
|
10
|
+
options;
|
|
11
|
+
now;
|
|
12
|
+
refreshSkewMs;
|
|
13
|
+
client;
|
|
14
|
+
expiresAt = 0;
|
|
15
|
+
pendingRefresh;
|
|
16
|
+
generation = 0;
|
|
17
|
+
constructor(options) {
|
|
18
|
+
const hasStatic = options.staticApiKey !== undefined;
|
|
19
|
+
const hasCallback = options.getAuthToken !== undefined;
|
|
20
|
+
if (hasStatic === hasCallback) {
|
|
21
|
+
throw new n8n_workflow_1.UnexpectedError('DaytonaAuthManager requires exactly one of staticApiKey or getAuthToken');
|
|
22
|
+
}
|
|
23
|
+
this.options = options;
|
|
24
|
+
this.now = options.now ?? Date.now;
|
|
25
|
+
this.refreshSkewMs =
|
|
26
|
+
options.refreshSkewMs !== undefined && options.refreshSkewMs > 0
|
|
27
|
+
? options.refreshSkewMs
|
|
28
|
+
: DEFAULT_REFRESH_SKEW_MS;
|
|
29
|
+
if (hasStatic) {
|
|
30
|
+
this.expiresAt = Number.POSITIVE_INFINITY;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
async getClient() {
|
|
34
|
+
if (this.client && this.now() + this.refreshSkewMs < this.expiresAt) {
|
|
35
|
+
return this.client;
|
|
36
|
+
}
|
|
37
|
+
await this.refresh();
|
|
38
|
+
if (!this.client) {
|
|
39
|
+
throw new n8n_workflow_1.UnexpectedError('DaytonaAuthManager.refresh did not set a client');
|
|
40
|
+
}
|
|
41
|
+
return this.client;
|
|
42
|
+
}
|
|
43
|
+
getGeneration() {
|
|
44
|
+
return this.generation;
|
|
45
|
+
}
|
|
46
|
+
async refresh() {
|
|
47
|
+
if (this.pendingRefresh) {
|
|
48
|
+
await this.pendingRefresh;
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
this.pendingRefresh = this.doRefresh().finally(() => {
|
|
52
|
+
this.pendingRefresh = undefined;
|
|
53
|
+
});
|
|
54
|
+
await this.pendingRefresh;
|
|
55
|
+
}
|
|
56
|
+
async doRefresh() {
|
|
57
|
+
const { Daytona } = (0, lazy_daytona_1.loadDaytona)();
|
|
58
|
+
const apiKey = this.options.getAuthToken
|
|
59
|
+
? await this.options.getAuthToken()
|
|
60
|
+
: this.options.staticApiKey;
|
|
61
|
+
const connection = { apiKey };
|
|
62
|
+
if (this.options.apiUrl !== undefined)
|
|
63
|
+
connection.apiUrl = this.options.apiUrl;
|
|
64
|
+
if (this.options.target !== undefined)
|
|
65
|
+
connection.target = this.options.target;
|
|
66
|
+
let decodedFromJwt = false;
|
|
67
|
+
if (this.options.getAuthToken && apiKey) {
|
|
68
|
+
const expSeconds = (0, utils_1.getJwtExpiry)(apiKey);
|
|
69
|
+
decodedFromJwt = expSeconds !== undefined;
|
|
70
|
+
this.expiresAt =
|
|
71
|
+
expSeconds !== undefined ? expSeconds * 1000 : this.now() + DECODE_FALLBACK_TTL_MS;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
this.expiresAt = Number.POSITIVE_INFINITY;
|
|
75
|
+
}
|
|
76
|
+
this.client = new Daytona(connection);
|
|
77
|
+
this.generation += 1;
|
|
78
|
+
if (this.options.getAuthToken) {
|
|
79
|
+
const ttlMs = this.expiresAt - this.now();
|
|
80
|
+
this.options.logger?.debug('Daytona auth token refreshed', {
|
|
81
|
+
sandboxName: this.options.sandboxName,
|
|
82
|
+
generation: this.generation,
|
|
83
|
+
expiresInMs: ttlMs,
|
|
84
|
+
expirySource: decodedFromJwt ? 'jwt-exp' : 'fallback',
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.DaytonaAuthManager = DaytonaAuthManager;
|
|
90
|
+
//# sourceMappingURL=daytona-auth-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daytona-auth-manager.js","sourceRoot":"","sources":["../../src/workspace/daytona-auth-manager.ts"],"names":[],"mappings":";;;AACA,sCAA0C;AAC1C,+CAA+C;AAE/C,iDAA6C;AAG7C,MAAM,uBAAuB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAC9C,MAAM,sBAAsB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAqC9C,MAAa,kBAAkB;IACb,OAAO,CAA4B;IACnC,GAAG,CAAe;IAClB,aAAa,CAAS;IAC/B,MAAM,CAAW;IACjB,SAAS,GAAG,CAAC,CAAC;IACd,cAAc,CAAiB;IAC/B,UAAU,GAAG,CAAC,CAAC;IAEvB,YAAY,OAAkC;QAC7C,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,KAAK,SAAS,CAAC;QACrD,MAAM,WAAW,GAAG,OAAO,CAAC,YAAY,KAAK,SAAS,CAAC;QACvD,IAAI,SAAS,KAAK,WAAW,EAAE,CAAC;YAC/B,MAAM,IAAI,8BAAe,CACxB,yEAAyE,CACzE,CAAC;QACH,CAAC;QACD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC;QACnC,IAAI,CAAC,aAAa;YACjB,OAA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,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU;aACrD,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;CACD;AAtFD,gDAsFC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import type { DaytonaSandbox } from '
|
|
4
|
-
export declare class DaytonaFilesystem extends
|
|
1
|
+
import type { FileContent, FileStat, FileEntry, ReadOptions, WriteOptions, ListOptions, RemoveOptions, CopyOptions, ProviderStatus } from '@n8n/agents';
|
|
2
|
+
import { BaseFilesystem } from '@n8n/agents';
|
|
3
|
+
import type { DaytonaSandbox } from './daytona-sandbox';
|
|
4
|
+
export declare class DaytonaFilesystem extends BaseFilesystem {
|
|
5
5
|
private readonly sandbox;
|
|
6
6
|
readonly id: string;
|
|
7
7
|
readonly name = "DaytonaFilesystem";
|
|
@@ -9,6 +9,7 @@ export declare class DaytonaFilesystem extends MastraFilesystem {
|
|
|
9
9
|
status: ProviderStatus;
|
|
10
10
|
constructor(sandbox: DaytonaSandbox);
|
|
11
11
|
private get fs();
|
|
12
|
+
private prepare;
|
|
12
13
|
readFile(path: string, options?: ReadOptions): Promise<string | Buffer>;
|
|
13
14
|
writeFile(path: string, content: FileContent, options?: WriteOptions): Promise<void>;
|
|
14
15
|
appendFile(path: string, content: FileContent): Promise<void>;
|
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DaytonaFilesystem = void 0;
|
|
4
|
-
const
|
|
5
|
-
class DaytonaFilesystem extends
|
|
4
|
+
const agents_1 = require("@n8n/agents");
|
|
5
|
+
class DaytonaFilesystem extends agents_1.BaseFilesystem {
|
|
6
6
|
sandbox;
|
|
7
7
|
id;
|
|
8
8
|
name = 'DaytonaFilesystem';
|
|
9
9
|
provider = 'daytona';
|
|
10
10
|
status = 'pending';
|
|
11
11
|
constructor(sandbox) {
|
|
12
|
-
super(
|
|
12
|
+
super();
|
|
13
13
|
this.sandbox = sandbox;
|
|
14
14
|
this.id = `daytona-fs-${sandbox.id}`;
|
|
15
15
|
}
|
|
16
16
|
get fs() {
|
|
17
17
|
return this.sandbox.instance.fs;
|
|
18
18
|
}
|
|
19
|
-
async
|
|
19
|
+
async prepare() {
|
|
20
20
|
await this.ensureReady();
|
|
21
|
+
await this.sandbox.ensureAuthFresh();
|
|
22
|
+
}
|
|
23
|
+
async readFile(path, options) {
|
|
24
|
+
await this.prepare();
|
|
21
25
|
const buffer = await this.fs.downloadFile(path);
|
|
22
26
|
if (options?.encoding) {
|
|
23
27
|
return buffer.toString(options.encoding);
|
|
@@ -25,7 +29,7 @@ class DaytonaFilesystem extends workspace_1.MastraFilesystem {
|
|
|
25
29
|
return buffer;
|
|
26
30
|
}
|
|
27
31
|
async writeFile(path, content, options) {
|
|
28
|
-
await this.
|
|
32
|
+
await this.prepare();
|
|
29
33
|
if (options?.recursive) {
|
|
30
34
|
const dir = path.substring(0, path.lastIndexOf('/'));
|
|
31
35
|
if (dir) {
|
|
@@ -36,7 +40,7 @@ class DaytonaFilesystem extends workspace_1.MastraFilesystem {
|
|
|
36
40
|
await this.fs.uploadFile(buffer, path);
|
|
37
41
|
}
|
|
38
42
|
async appendFile(path, content) {
|
|
39
|
-
await this.
|
|
43
|
+
await this.prepare();
|
|
40
44
|
let existing;
|
|
41
45
|
try {
|
|
42
46
|
existing = await this.fs.downloadFile(path);
|
|
@@ -48,20 +52,20 @@ class DaytonaFilesystem extends workspace_1.MastraFilesystem {
|
|
|
48
52
|
await this.fs.uploadFile(Buffer.concat([existing, append]), path);
|
|
49
53
|
}
|
|
50
54
|
async deleteFile(path, options) {
|
|
51
|
-
await this.
|
|
55
|
+
await this.prepare();
|
|
52
56
|
await this.fs.deleteFile(path, options?.recursive);
|
|
53
57
|
}
|
|
54
58
|
async copyFile(src, dest, _options) {
|
|
55
|
-
await this.
|
|
59
|
+
await this.prepare();
|
|
56
60
|
const content = await this.fs.downloadFile(src);
|
|
57
61
|
await this.fs.uploadFile(content, dest);
|
|
58
62
|
}
|
|
59
63
|
async moveFile(src, dest, _options) {
|
|
60
|
-
await this.
|
|
64
|
+
await this.prepare();
|
|
61
65
|
await this.fs.moveFiles(src, dest);
|
|
62
66
|
}
|
|
63
67
|
async mkdir(path, options) {
|
|
64
|
-
await this.
|
|
68
|
+
await this.prepare();
|
|
65
69
|
if (options?.recursive) {
|
|
66
70
|
await this.fs.createFolder(path, '755');
|
|
67
71
|
}
|
|
@@ -70,11 +74,11 @@ class DaytonaFilesystem extends workspace_1.MastraFilesystem {
|
|
|
70
74
|
}
|
|
71
75
|
}
|
|
72
76
|
async rmdir(path, options) {
|
|
73
|
-
await this.
|
|
77
|
+
await this.prepare();
|
|
74
78
|
await this.fs.deleteFile(path, options?.recursive ?? false);
|
|
75
79
|
}
|
|
76
80
|
async readdir(path, _options) {
|
|
77
|
-
await this.
|
|
81
|
+
await this.prepare();
|
|
78
82
|
const files = await this.fs.listFiles(path);
|
|
79
83
|
return files.map((f) => ({
|
|
80
84
|
name: f.name ?? '',
|
|
@@ -83,7 +87,7 @@ class DaytonaFilesystem extends workspace_1.MastraFilesystem {
|
|
|
83
87
|
}));
|
|
84
88
|
}
|
|
85
89
|
async exists(path) {
|
|
86
|
-
await this.
|
|
90
|
+
await this.prepare();
|
|
87
91
|
try {
|
|
88
92
|
await this.fs.getFileDetails(path);
|
|
89
93
|
return true;
|
|
@@ -93,14 +97,14 @@ class DaytonaFilesystem extends workspace_1.MastraFilesystem {
|
|
|
93
97
|
}
|
|
94
98
|
}
|
|
95
99
|
async stat(path) {
|
|
96
|
-
await this.
|
|
100
|
+
await this.prepare();
|
|
97
101
|
let info;
|
|
98
102
|
try {
|
|
99
103
|
info = await this.fs.getFileDetails(path);
|
|
100
104
|
}
|
|
101
105
|
catch (error) {
|
|
102
106
|
if (isDaytona404(error)) {
|
|
103
|
-
throw new
|
|
107
|
+
throw new DaytonaFileNotFoundError(path);
|
|
104
108
|
}
|
|
105
109
|
throw error;
|
|
106
110
|
}
|
|
@@ -115,6 +119,12 @@ class DaytonaFilesystem extends workspace_1.MastraFilesystem {
|
|
|
115
119
|
}
|
|
116
120
|
}
|
|
117
121
|
exports.DaytonaFilesystem = DaytonaFilesystem;
|
|
122
|
+
class DaytonaFileNotFoundError extends Error {
|
|
123
|
+
constructor(path) {
|
|
124
|
+
super(`File not found: ${path}`);
|
|
125
|
+
this.name = 'DaytonaFileNotFoundError';
|
|
126
|
+
}
|
|
127
|
+
}
|
|
118
128
|
function isDaytona404(error) {
|
|
119
129
|
return (error instanceof Error &&
|
|
120
130
|
'statusCode' in error &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daytona-filesystem.js","sourceRoot":"","sources":["../../src/workspace/daytona-filesystem.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"daytona-filesystem.js","sourceRoot":"","sources":["../../src/workspace/daytona-filesystem.ts"],"names":[],"mappings":";;;AAqBA,wCAA6C;AAQ7C,MAAa,iBAAkB,SAAQ,uBAAc;IAMvB;IALpB,EAAE,CAAS;IACX,IAAI,GAAG,mBAAmB,CAAC;IAC3B,QAAQ,GAAG,SAAS,CAAC;IAC9B,MAAM,GAAmB,SAAS,CAAC;IAEnC,YAA6B,OAAuB;QACnD,KAAK,EAAE,CAAC;QADoB,YAAO,GAAP,OAAO,CAAgB;QAEnD,IAAI,CAAC,EAAE,GAAG,cAAc,OAAO,CAAC,EAAE,EAAE,CAAC;IACtC,CAAC;IAED,IAAY,EAAE;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;IACjC,CAAC;IAEO,KAAK,CAAC,OAAO;QAIpB,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QACzB,MAAM,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,IAAY,EAAE,OAAqB;QACjD,MAA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,OAAO,KAAc,EAAE,CAAC;YACzB,IAAI,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;gBACzB,MAAM,IAAI,wBAAwB,CAAC,IAAI,CAAC,CAAC;YAC1C,CAAC;YACD,MAAM,KAAK,CAAC;QACb,CAAC;QACD,OAAO;YACN,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE;YAC9C,IAAI;YACJ,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM;YACvC,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC;YACpB,SAAS,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC;YACtC,UAAU,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC;SACvC,CAAC;IACH,CAAC;CACD;AAjID,8CAiIC;AAED,MAAM,wBAAyB,SAAQ,KAAK;IAC3C,YAAY,IAAY;QACvB,KAAK,CAAC,mBAAmB,IAAI,EAAE,CAAC,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;IACxC,CAAC;CACD;AAED,SAAS,YAAY,CAAC,KAAc;IACnC,OAAO,CACN,KAAK,YAAY,KAAK;QACtB,YAAY,IAAI,KAAK;QACpB,KAAiC,CAAC,UAAU,KAAK,GAAG,CACrD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { CreateSandboxFromImageParams, Resources, Sandbox, VolumeMount } from '@daytonaio/sdk';
|
|
2
|
+
import { BaseSandbox, type CommandResult, type ExecuteCommandOptions, type ProviderStatus, type SandboxInfo } from '@n8n/agents';
|
|
3
|
+
import type { ErrorReporter, Logger } from '../logger';
|
|
4
|
+
export interface DaytonaSandboxOptions {
|
|
5
|
+
id?: string;
|
|
6
|
+
apiKey?: string;
|
|
7
|
+
getAuthToken?: () => Promise<string>;
|
|
8
|
+
refreshSkewMs?: number;
|
|
9
|
+
logger?: Logger;
|
|
10
|
+
apiUrl?: string;
|
|
11
|
+
target?: string;
|
|
12
|
+
timeout?: number;
|
|
13
|
+
createTimeoutSeconds?: number;
|
|
14
|
+
language?: 'typescript' | 'javascript' | 'python';
|
|
15
|
+
resources?: Resources;
|
|
16
|
+
env?: Record<string, string>;
|
|
17
|
+
labels?: Record<string, string>;
|
|
18
|
+
snapshot?: string;
|
|
19
|
+
image?: CreateSandboxFromImageParams['image'];
|
|
20
|
+
ephemeral?: boolean;
|
|
21
|
+
autoStopInterval?: number;
|
|
22
|
+
autoArchiveInterval?: number;
|
|
23
|
+
autoDeleteInterval?: number;
|
|
24
|
+
volumes?: VolumeMount[];
|
|
25
|
+
name?: string;
|
|
26
|
+
user?: string;
|
|
27
|
+
public?: boolean;
|
|
28
|
+
networkBlockAll?: boolean;
|
|
29
|
+
networkAllowList?: string;
|
|
30
|
+
errorReporter?: ErrorReporter;
|
|
31
|
+
createStrategyMode?: 'direct' | 'proxy';
|
|
32
|
+
}
|
|
33
|
+
export declare class DaytonaSandbox extends BaseSandbox {
|
|
34
|
+
private readonly options;
|
|
35
|
+
private static readonly DEAD_STATES;
|
|
36
|
+
readonly id: string;
|
|
37
|
+
readonly name = "DaytonaSandbox";
|
|
38
|
+
readonly provider = "daytona";
|
|
39
|
+
status: ProviderStatus;
|
|
40
|
+
private readonly timeout;
|
|
41
|
+
private readonly language;
|
|
42
|
+
private readonly createdAt;
|
|
43
|
+
private readonly auth;
|
|
44
|
+
private readonly sandboxName;
|
|
45
|
+
private lastClientGeneration;
|
|
46
|
+
private sandbox?;
|
|
47
|
+
private workingDirectory?;
|
|
48
|
+
constructor(options?: DaytonaSandboxOptions);
|
|
49
|
+
get instance(): Sandbox;
|
|
50
|
+
start(): Promise<void>;
|
|
51
|
+
stop(): Promise<void>;
|
|
52
|
+
destroy(): Promise<void>;
|
|
53
|
+
executeCommand(command: string, args?: string[], options?: ExecuteCommandOptions): Promise<CommandResult>;
|
|
54
|
+
ensureAuthFresh(): Promise<void>;
|
|
55
|
+
getInfo(): SandboxInfo;
|
|
56
|
+
getInstructions(): string;
|
|
57
|
+
private getDaytona;
|
|
58
|
+
private findExistingSandbox;
|
|
59
|
+
private createSandbox;
|
|
60
|
+
private createSandboxParams;
|
|
61
|
+
private reportCreateError;
|
|
62
|
+
private detectWorkingDirectory;
|
|
63
|
+
private isDeadState;
|
|
64
|
+
private compactEnv;
|
|
65
|
+
}
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DaytonaSandbox = void 0;
|
|
4
|
+
const agents_1 = require("@n8n/agents");
|
|
5
|
+
const node_crypto_1 = require("node:crypto");
|
|
6
|
+
const daytona_auth_manager_1 = require("./daytona-auth-manager");
|
|
7
|
+
const lazy_daytona_1 = require("./lazy-daytona");
|
|
8
|
+
const SANDBOX_STATE_STARTED = 'started';
|
|
9
|
+
const SANDBOX_STATE_DESTROYED = 'destroyed';
|
|
10
|
+
const SANDBOX_STATE_DESTROYING = 'destroying';
|
|
11
|
+
const SANDBOX_STATE_ERROR = 'error';
|
|
12
|
+
const SANDBOX_STATE_BUILD_FAILED = 'build_failed';
|
|
13
|
+
function shellEscape(value) {
|
|
14
|
+
return /^[A-Za-z0-9_./:=@+-]+$/.test(value) ? value : `'${value.replace(/'/g, "'\\''")}'`;
|
|
15
|
+
}
|
|
16
|
+
function toShellCommand(command, args) {
|
|
17
|
+
if (args.length === 0)
|
|
18
|
+
return command;
|
|
19
|
+
return [command, ...args.map((arg) => shellEscape(arg))].join(' ');
|
|
20
|
+
}
|
|
21
|
+
function isDaytonaAuthError(error) {
|
|
22
|
+
const { DaytonaError } = (0, lazy_daytona_1.loadDaytona)();
|
|
23
|
+
return error instanceof DaytonaError && (error.statusCode === 401 || error.statusCode === 403);
|
|
24
|
+
}
|
|
25
|
+
function isSandboxGone(error) {
|
|
26
|
+
const { DaytonaNotFoundError } = (0, lazy_daytona_1.loadDaytona)();
|
|
27
|
+
return error instanceof DaytonaNotFoundError;
|
|
28
|
+
}
|
|
29
|
+
class DaytonaSandbox extends agents_1.BaseSandbox {
|
|
30
|
+
options;
|
|
31
|
+
static DEAD_STATES = new Set([
|
|
32
|
+
SANDBOX_STATE_DESTROYED,
|
|
33
|
+
SANDBOX_STATE_DESTROYING,
|
|
34
|
+
SANDBOX_STATE_ERROR,
|
|
35
|
+
SANDBOX_STATE_BUILD_FAILED,
|
|
36
|
+
]);
|
|
37
|
+
id;
|
|
38
|
+
name = 'DaytonaSandbox';
|
|
39
|
+
provider = 'daytona';
|
|
40
|
+
status = 'pending';
|
|
41
|
+
timeout;
|
|
42
|
+
language;
|
|
43
|
+
createdAt = new Date();
|
|
44
|
+
auth;
|
|
45
|
+
sandboxName;
|
|
46
|
+
lastClientGeneration = -1;
|
|
47
|
+
sandbox;
|
|
48
|
+
workingDirectory;
|
|
49
|
+
constructor(options = {}) {
|
|
50
|
+
super();
|
|
51
|
+
this.options = options;
|
|
52
|
+
this.id = options.id ?? `daytona-sandbox-${(0, node_crypto_1.randomUUID)()}`;
|
|
53
|
+
this.timeout = options.timeout ?? 300_000;
|
|
54
|
+
this.language = options.language ?? 'typescript';
|
|
55
|
+
this.sandboxName = options.name ?? this.id;
|
|
56
|
+
this.auth = new daytona_auth_manager_1.DaytonaAuthManager({
|
|
57
|
+
apiUrl: options.apiUrl,
|
|
58
|
+
target: options.target,
|
|
59
|
+
staticApiKey: options.apiKey,
|
|
60
|
+
getAuthToken: options.getAuthToken,
|
|
61
|
+
refreshSkewMs: options.refreshSkewMs,
|
|
62
|
+
logger: options.logger,
|
|
63
|
+
sandboxName: this.sandboxName,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
get instance() {
|
|
67
|
+
if (!this.sandbox) {
|
|
68
|
+
throw new Error(`Daytona sandbox "${this.id}" is not running`);
|
|
69
|
+
}
|
|
70
|
+
return this.sandbox;
|
|
71
|
+
}
|
|
72
|
+
async start() {
|
|
73
|
+
if (this.sandbox)
|
|
74
|
+
return;
|
|
75
|
+
const client = await this.getDaytona();
|
|
76
|
+
const existing = await this.findExistingSandbox(client);
|
|
77
|
+
if (existing) {
|
|
78
|
+
this.sandbox = existing;
|
|
79
|
+
await this.detectWorkingDirectory();
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
this.sandbox = await this.createSandbox(client);
|
|
83
|
+
await this.detectWorkingDirectory();
|
|
84
|
+
}
|
|
85
|
+
async stop() {
|
|
86
|
+
if (!this.sandbox)
|
|
87
|
+
return;
|
|
88
|
+
try {
|
|
89
|
+
await this.ensureAuthFresh();
|
|
90
|
+
await this.sandbox.stop(Math.ceil(this.timeout / 1000));
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
if (!isSandboxGone(error))
|
|
94
|
+
throw error;
|
|
95
|
+
}
|
|
96
|
+
this.sandbox = undefined;
|
|
97
|
+
}
|
|
98
|
+
async destroy() {
|
|
99
|
+
try {
|
|
100
|
+
if (this.sandbox) {
|
|
101
|
+
await this.ensureAuthFresh();
|
|
102
|
+
await this.sandbox.delete(Math.ceil(this.timeout / 1000));
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
const client = await this.getDaytona();
|
|
106
|
+
const existing = await client.get(this.sandboxName);
|
|
107
|
+
await existing.delete(Math.ceil(this.timeout / 1000));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
if (!isSandboxGone(error))
|
|
112
|
+
throw error;
|
|
113
|
+
}
|
|
114
|
+
this.sandbox = undefined;
|
|
115
|
+
}
|
|
116
|
+
async executeCommand(command, args = [], options) {
|
|
117
|
+
await this.ensureRunning();
|
|
118
|
+
await this.ensureAuthFresh();
|
|
119
|
+
const startedAt = Date.now();
|
|
120
|
+
const fullCommand = toShellCommand(command, args);
|
|
121
|
+
const result = await this.instance.process.executeCommand(fullCommand, options?.cwd, this.compactEnv(options?.env), Math.ceil((options?.timeout ?? this.timeout) / 1000));
|
|
122
|
+
const stdout = result.artifacts?.stdout ?? result.result ?? '';
|
|
123
|
+
if (stdout)
|
|
124
|
+
options?.onStdout?.(stdout);
|
|
125
|
+
return {
|
|
126
|
+
command,
|
|
127
|
+
args,
|
|
128
|
+
success: result.exitCode === 0,
|
|
129
|
+
exitCode: result.exitCode,
|
|
130
|
+
stdout,
|
|
131
|
+
stderr: '',
|
|
132
|
+
executionTimeMs: Date.now() - startedAt,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
async ensureAuthFresh() {
|
|
136
|
+
await this.getDaytona();
|
|
137
|
+
}
|
|
138
|
+
getInfo() {
|
|
139
|
+
return {
|
|
140
|
+
id: this.id,
|
|
141
|
+
name: this.name,
|
|
142
|
+
provider: this.provider,
|
|
143
|
+
status: this.status,
|
|
144
|
+
createdAt: this.createdAt,
|
|
145
|
+
resources: this.sandbox
|
|
146
|
+
? {
|
|
147
|
+
cpuCores: this.sandbox.cpu,
|
|
148
|
+
memoryMB: this.sandbox.memory * 1024,
|
|
149
|
+
}
|
|
150
|
+
: undefined,
|
|
151
|
+
metadata: {
|
|
152
|
+
language: this.language,
|
|
153
|
+
workingDirectory: this.workingDirectory,
|
|
154
|
+
target: this.sandbox?.target,
|
|
155
|
+
remoteSandboxId: this.sandbox?.id,
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
getInstructions() {
|
|
160
|
+
const parts = [`Cloud sandbox with isolated execution (${this.language} runtime).`];
|
|
161
|
+
if (this.workingDirectory) {
|
|
162
|
+
parts.push(`Default working directory: ${this.workingDirectory}.`);
|
|
163
|
+
}
|
|
164
|
+
parts.push(`Command timeout: ${Math.ceil(this.timeout / 1000)}s.`);
|
|
165
|
+
return parts.join(' ');
|
|
166
|
+
}
|
|
167
|
+
async getDaytona() {
|
|
168
|
+
const client = await this.auth.getClient();
|
|
169
|
+
const generation = this.auth.getGeneration();
|
|
170
|
+
if (this.sandbox && generation !== this.lastClientGeneration) {
|
|
171
|
+
this.sandbox = await client.get(this.sandboxName);
|
|
172
|
+
}
|
|
173
|
+
this.lastClientGeneration = generation;
|
|
174
|
+
return client;
|
|
175
|
+
}
|
|
176
|
+
async findExistingSandbox(client) {
|
|
177
|
+
try {
|
|
178
|
+
const sandbox = await client.get(this.sandboxName);
|
|
179
|
+
if (sandbox.state && this.isDeadState(sandbox.state)) {
|
|
180
|
+
await sandbox.delete(Math.ceil(this.timeout / 1000));
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
if (sandbox.state !== SANDBOX_STATE_STARTED) {
|
|
184
|
+
await sandbox.start(Math.ceil(this.timeout / 1000));
|
|
185
|
+
}
|
|
186
|
+
return sandbox;
|
|
187
|
+
}
|
|
188
|
+
catch (error) {
|
|
189
|
+
const { DaytonaNotFoundError } = (0, lazy_daytona_1.loadDaytona)();
|
|
190
|
+
if (error instanceof DaytonaNotFoundError)
|
|
191
|
+
return null;
|
|
192
|
+
if (isDaytonaAuthError(error))
|
|
193
|
+
throw error;
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
async createSandbox(client) {
|
|
198
|
+
const candidates = this.createSandboxParams();
|
|
199
|
+
let lastError;
|
|
200
|
+
for (const candidate of candidates) {
|
|
201
|
+
try {
|
|
202
|
+
return this.options.createTimeoutSeconds
|
|
203
|
+
? await client.create(candidate.params, { timeout: this.options.createTimeoutSeconds })
|
|
204
|
+
: await client.create(candidate.params);
|
|
205
|
+
}
|
|
206
|
+
catch (error) {
|
|
207
|
+
lastError = error;
|
|
208
|
+
this.reportCreateError(error, candidate.strategy);
|
|
209
|
+
if (candidate.strategy === 'snapshot' &&
|
|
210
|
+
candidates.some(({ strategy }) => strategy === 'image')) {
|
|
211
|
+
this.options.logger?.warn('Sandbox create from snapshot failed; falling back to image', {
|
|
212
|
+
snapshotName: this.options.snapshot,
|
|
213
|
+
mode: this.options.createStrategyMode,
|
|
214
|
+
error: error instanceof Error ? error.message : String(error),
|
|
215
|
+
});
|
|
216
|
+
continue;
|
|
217
|
+
}
|
|
218
|
+
throw error;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
throw lastError instanceof Error ? lastError : new Error('Failed to create Daytona sandbox');
|
|
222
|
+
}
|
|
223
|
+
createSandboxParams() {
|
|
224
|
+
const base = {
|
|
225
|
+
language: this.language,
|
|
226
|
+
labels: {
|
|
227
|
+
...this.options.labels,
|
|
228
|
+
'n8n-instance-ai-sandbox-id': this.id,
|
|
229
|
+
},
|
|
230
|
+
autoStopInterval: this.options.autoStopInterval ?? 15,
|
|
231
|
+
name: this.sandboxName,
|
|
232
|
+
};
|
|
233
|
+
if (this.options.ephemeral !== undefined)
|
|
234
|
+
base.ephemeral = this.options.ephemeral;
|
|
235
|
+
if (this.options.autoArchiveInterval !== undefined) {
|
|
236
|
+
base.autoArchiveInterval = this.options.autoArchiveInterval;
|
|
237
|
+
}
|
|
238
|
+
if (this.options.autoDeleteInterval !== undefined) {
|
|
239
|
+
base.autoDeleteInterval = this.options.autoDeleteInterval;
|
|
240
|
+
}
|
|
241
|
+
if (this.options.volumes !== undefined)
|
|
242
|
+
base.volumes = this.options.volumes;
|
|
243
|
+
if (this.options.user !== undefined)
|
|
244
|
+
base.user = this.options.user;
|
|
245
|
+
if (this.options.public !== undefined)
|
|
246
|
+
base.public = this.options.public;
|
|
247
|
+
if (this.options.networkBlockAll !== undefined) {
|
|
248
|
+
base.networkBlockAll = this.options.networkBlockAll;
|
|
249
|
+
}
|
|
250
|
+
if (this.options.networkAllowList !== undefined) {
|
|
251
|
+
base.networkAllowList = this.options.networkAllowList;
|
|
252
|
+
}
|
|
253
|
+
if (this.options.env !== undefined)
|
|
254
|
+
base.envVars = this.options.env;
|
|
255
|
+
const candidates = [];
|
|
256
|
+
if (this.options.snapshot) {
|
|
257
|
+
candidates.push({
|
|
258
|
+
strategy: 'snapshot',
|
|
259
|
+
params: {
|
|
260
|
+
...base,
|
|
261
|
+
snapshot: this.options.snapshot,
|
|
262
|
+
},
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
if (this.options.image) {
|
|
266
|
+
candidates.push({
|
|
267
|
+
strategy: 'image',
|
|
268
|
+
params: {
|
|
269
|
+
...base,
|
|
270
|
+
image: this.options.image,
|
|
271
|
+
resources: this.options.resources,
|
|
272
|
+
},
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
if (candidates.length > 0)
|
|
276
|
+
return candidates;
|
|
277
|
+
return [{ strategy: 'snapshot', params: { ...base, snapshot: this.options.snapshot } }];
|
|
278
|
+
}
|
|
279
|
+
reportCreateError(error, strategy) {
|
|
280
|
+
this.options.errorReporter?.error(error, {
|
|
281
|
+
tags: {
|
|
282
|
+
component: 'builder-sandbox-factory',
|
|
283
|
+
strategy,
|
|
284
|
+
...(this.options.createStrategyMode ? { mode: this.options.createStrategyMode } : {}),
|
|
285
|
+
},
|
|
286
|
+
extra: {
|
|
287
|
+
sandboxId: this.id,
|
|
288
|
+
sandboxName: this.sandboxName,
|
|
289
|
+
snapshotName: this.options.snapshot,
|
|
290
|
+
},
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
async detectWorkingDirectory() {
|
|
294
|
+
try {
|
|
295
|
+
this.workingDirectory = await this.instance.getWorkDir();
|
|
296
|
+
}
|
|
297
|
+
catch {
|
|
298
|
+
this.workingDirectory = undefined;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
isDeadState(state) {
|
|
302
|
+
return DaytonaSandbox.DEAD_STATES.has(state);
|
|
303
|
+
}
|
|
304
|
+
compactEnv(env) {
|
|
305
|
+
const merged = {
|
|
306
|
+
...this.options.env,
|
|
307
|
+
...env,
|
|
308
|
+
};
|
|
309
|
+
const entries = Object.entries(merged).filter((entry) => typeof entry[1] === 'string');
|
|
310
|
+
return entries.length > 0 ? Object.fromEntries(entries) : undefined;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
exports.DaytonaSandbox = DaytonaSandbox;
|
|
314
|
+
//# sourceMappingURL=daytona-sandbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daytona-sandbox.js","sourceRoot":"","sources":["../../src/workspace/daytona-sandbox.ts"],"names":[],"mappings":";;;AAUA,wCAMqB;AACrB,6CAAyC;AAEzC,iEAA4D;AAC5D,iDAA6C;AAG7C,MAAM,qBAAqB,GAAG,SAAS,CAAC;AACxC,MAAM,uBAAuB,GAAG,WAAW,CAAC;AAC5C,MAAM,wBAAwB,GAAG,YAAY,CAAC;AAC9C,MAAM,mBAAmB,GAAG,OAAO,CAAC;AACpC,MAAM,0BAA0B,GAAG,cAAc,CAAC;AA2ClD,SAAS,WAAW,CAAC,KAAa;IACjC,OAAO,wBAAwB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC;AAC3F,CAAC;AAED,SAAS,cAAc,CAAC,OAAe,EAAE,IAAc;IACtD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,OAAO,CAAC;IACtC,OAAO,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACpE,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAc;IACzC,MAAM,EAAE,YAAY,EAAE,GAAG,IAAA,0BAAW,GAAE,CAAC;IACvC,OAAO,KAAK,YAAY,YAAY,IAAI,CAAC,KAAK,CAAC,UAAU,KAAK,GAAG,IAAI,KAAK,CAAC,UAAU,KAAK,GAAG,CAAC,CAAC;AAChG,CAAC;AAED,SAAS,aAAa,CAAC,KAAc;IACpC,MAAM,EAAE,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