@n8n/instance-ai 1.7.2 → 1.8.1
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 +467 -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 +64 -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 +12 -15
- 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
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type
|
|
1
|
+
import { type PlannedTaskGraph } from '../types';
|
|
2
|
+
import { type PatchableThreadMemory } from './thread-patch';
|
|
3
3
|
export declare class PlannedTaskStorage {
|
|
4
4
|
private readonly memory;
|
|
5
|
-
constructor(memory:
|
|
5
|
+
constructor(memory: PatchableThreadMemory);
|
|
6
6
|
get(threadId: string): Promise<PlannedTaskGraph | null>;
|
|
7
7
|
save(threadId: string, graph: PlannedTaskGraph): Promise<void>;
|
|
8
8
|
update(threadId: string, updater: (graph: PlannedTaskGraph) => PlannedTaskGraph | null): Promise<PlannedTaskGraph | null>;
|
|
@@ -2,15 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PlannedTaskStorage = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const types_1 = require("../types");
|
|
5
6
|
const thread_patch_1 = require("./thread-patch");
|
|
6
7
|
const METADATA_KEY = 'instanceAiPlannedTasks';
|
|
7
|
-
const plannedTaskKindSchema = zod_1.z.enum(
|
|
8
|
-
'delegate',
|
|
9
|
-
'build-workflow',
|
|
10
|
-
'manage-data-tables',
|
|
11
|
-
'research',
|
|
12
|
-
'checkpoint',
|
|
13
|
-
]);
|
|
8
|
+
const plannedTaskKindSchema = zod_1.z.enum(types_1.STORED_PLANNED_TASK_KINDS);
|
|
14
9
|
const plannedTaskStatusSchema = zod_1.z.enum(['planned', 'running', 'succeeded', 'failed', 'cancelled']);
|
|
15
10
|
const plannedTaskRecordSchema = zod_1.z.object({
|
|
16
11
|
id: zod_1.z.string(),
|
|
@@ -45,7 +40,7 @@ class PlannedTaskStorage {
|
|
|
45
40
|
this.memory = memory;
|
|
46
41
|
}
|
|
47
42
|
async get(threadId) {
|
|
48
|
-
const thread = await this.memory
|
|
43
|
+
const thread = await (0, thread_patch_1.getThread)(this.memory, threadId);
|
|
49
44
|
if (!thread?.metadata?.[METADATA_KEY])
|
|
50
45
|
return null;
|
|
51
46
|
return parseGraph(thread.metadata[METADATA_KEY]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planned-task-storage.js","sourceRoot":"","sources":["../../src/storage/planned-task-storage.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"planned-task-storage.js","sourceRoot":"","sources":["../../src/storage/planned-task-storage.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,oCAA4E;AAC5E,iDAAoF;AAEpF,MAAM,YAAY,GAAG,wBAAwB,CAAC;AAE9C,MAAM,qBAAqB,GAAG,OAAC,CAAC,IAAI,CAAC,iCAAyB,CAAC,CAAC;AAEhE,MAAM,uBAAuB,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;AAEnG,MAAM,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IACxC,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;IACjB,IAAI,EAAE,qBAAqB;IAC3B,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;IACzB,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACrC,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,MAAM,EAAE,uBAAuB;IAC/B,OAAO,EAAE,OAAC,CAAC,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AE;YAC9B,QAAQ;YACR,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;gBACxB,MAAM,YAAY,GAAG,EAAE,GAAG,QAAQ,EAAE,CAAC;gBACrC,OAAO,YAAY,CAAC,YAAY,CAAC,CAAC;gBAClC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC;YACnC,CAAC;SACD,CAAC,CAAC;IACJ,CAAC;CACD;AA/DD,gDA+DC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Memory } from '@mastra/memory';
|
|
2
1
|
import { z } from 'zod';
|
|
2
|
+
import { type PatchableThreadMemory } from './thread-patch';
|
|
3
3
|
declare const terminalOutcomeSchema: z.ZodObject<{
|
|
4
4
|
id: z.ZodString;
|
|
5
5
|
threadId: z.ZodString;
|
|
@@ -14,10 +14,10 @@ declare const terminalOutcomeSchema: z.ZodObject<{
|
|
|
14
14
|
deliveredAt: z.ZodOptional<z.ZodString>;
|
|
15
15
|
}, "strip", z.ZodTypeAny, {
|
|
16
16
|
status: "completed" | "failed" | "cancelled";
|
|
17
|
-
createdAt: string;
|
|
18
17
|
id: string;
|
|
19
18
|
threadId: string;
|
|
20
19
|
runId: string;
|
|
20
|
+
createdAt: string;
|
|
21
21
|
taskId: string;
|
|
22
22
|
agentId: string;
|
|
23
23
|
userFacingMessage: string;
|
|
@@ -26,10 +26,10 @@ declare const terminalOutcomeSchema: z.ZodObject<{
|
|
|
26
26
|
deliveredAt?: string | undefined;
|
|
27
27
|
}, {
|
|
28
28
|
status: "completed" | "failed" | "cancelled";
|
|
29
|
-
createdAt: string;
|
|
30
29
|
id: string;
|
|
31
30
|
threadId: string;
|
|
32
31
|
runId: string;
|
|
32
|
+
createdAt: string;
|
|
33
33
|
taskId: string;
|
|
34
34
|
agentId: string;
|
|
35
35
|
userFacingMessage: string;
|
|
@@ -40,7 +40,7 @@ declare const terminalOutcomeSchema: z.ZodObject<{
|
|
|
40
40
|
export type TerminalOutcome = z.infer<typeof terminalOutcomeSchema>;
|
|
41
41
|
export declare class TerminalOutcomeStorage {
|
|
42
42
|
private readonly memory;
|
|
43
|
-
constructor(memory:
|
|
43
|
+
constructor(memory: PatchableThreadMemory);
|
|
44
44
|
upsert(threadId: string, outcome: TerminalOutcome): Promise<void>;
|
|
45
45
|
markDelivered(threadId: string, outcomeId: string, deliveredAt: string): Promise<void>;
|
|
46
46
|
getUndelivered(threadId: string): Promise<TerminalOutcome[]>;
|
|
@@ -64,7 +64,7 @@ class TerminalOutcomeStorage {
|
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
async getUndelivered(threadId) {
|
|
67
|
-
const thread = await this.memory
|
|
67
|
+
const thread = await (0, thread_patch_1.getThread)(this.memory, threadId);
|
|
68
68
|
const outcomes = parseOutcomes(thread?.metadata?.[METADATA_KEY]);
|
|
69
69
|
return Object.values(outcomes).filter((outcome) => !outcome.deliveredAt);
|
|
70
70
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal-outcome-storage.js","sourceRoot":"","sources":["../../src/storage/terminal-outcome-storage.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"terminal-outcome-storage.js","sourceRoot":"","sources":["../../src/storage/terminal-outcome-storage.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,iDAAoF;AAEpF,MAAM,YAAY,GAAG,4BAA4B,CAAC;AAElD,MAAM,2BAA2B,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;AAEjF,MAAM,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IACtC,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;IACpB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;IACjB,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,aAAa,EAAE,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'@mastra/memory';
|
|
2
1
|
import type { IterationEntry, IterationLog } from './iteration-log';
|
|
3
|
-
|
|
2
|
+
import { type PatchableThreadMemory } from './thread-patch';
|
|
3
|
+
export declare class ThreadIterationLogStorage implements IterationLog {
|
|
4
4
|
private readonly memory;
|
|
5
|
-
constructor(memory:
|
|
5
|
+
constructor(memory: PatchableThreadMemory);
|
|
6
6
|
append(threadId: string, taskKey: string, entry: IterationEntry): Promise<void>;
|
|
7
7
|
getForTask(threadId: string, taskKey: string): Promise<IterationEntry[]>;
|
|
8
8
|
clear(threadId: string): Promise<void>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ThreadIterationLogStorage = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const iteration_log_1 = require("./iteration-log");
|
|
6
6
|
const thread_patch_1 = require("./thread-patch");
|
|
7
7
|
const METADATA_KEY = 'instanceAiIterationLog';
|
|
8
8
|
const logRecordSchema = zod_1.z.record(zod_1.z.string(), zod_1.z.array(iteration_log_1.iterationEntrySchema));
|
|
9
|
-
class
|
|
9
|
+
class ThreadIterationLogStorage {
|
|
10
10
|
memory;
|
|
11
11
|
constructor(memory) {
|
|
12
12
|
this.memory = memory;
|
|
@@ -32,7 +32,7 @@ class MastraIterationLogStorage {
|
|
|
32
32
|
throw new Error(`Thread ${threadId} not found`);
|
|
33
33
|
}
|
|
34
34
|
async getForTask(threadId, taskKey) {
|
|
35
|
-
const thread = await this.memory
|
|
35
|
+
const thread = await (0, thread_patch_1.getThread)(this.memory, threadId);
|
|
36
36
|
if (!thread?.metadata?.[METADATA_KEY])
|
|
37
37
|
return [];
|
|
38
38
|
const existing = this.parseLog(thread.metadata[METADATA_KEY]);
|
|
@@ -53,5 +53,5 @@ class MastraIterationLogStorage {
|
|
|
53
53
|
return result.success ? result.data : {};
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
exports.
|
|
57
|
-
//# sourceMappingURL=
|
|
56
|
+
exports.ThreadIterationLogStorage = ThreadIterationLogStorage;
|
|
57
|
+
//# sourceMappingURL=thread-iteration-log-storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thread-iteration-log-storage.js","sourceRoot":"","sources":["../../src/storage/thread-iteration-log-storage.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,mDAAuD;AAEvD,iDAAoF;AAEpF,MAAM,YAAY,GAAG,wBAAwB,CAAC;AAE9C,MAAM,eAAe,GAAG,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,KAAK,CAAC,oCAAoB,CAAC,CAAC,CAAC;AAE5E,MAAa,yBAAyB;IACR;IAA7B,YAA6B,MAA6B;QAA7B,WAAM,GAAN,MAAM,CAAuB;IAAG,CAAC;IAE9D,KAAK,CAAC,MAAM,CAAC,QAAgB,EAAE,OAAe,EAAE,KAAqB;QACpE,MAAM,OAAO,GAAG,MAAM,IAAA,0BAAW,EAAC,IAAI,CAAC,MAAM,EAAE;YAC9C,QAAQ;YACR,MAAM,EAAE,CAAC,EAAE,QAAQ,GAAG,EAAE,EAAE,EAAE,EAAE;gBAC7B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC;gBACvD,MAAM,OAAO,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;gBACtD,OAAO;oBACN,QAAQ,EAAE;wBACT,GAAG,QAAQ;wBACX,CAAC,YAAY,CAAC,EAAE;4BACf,GAAG,QAAQ;4BACX,CAAC,OAAO,CAAC,EAAE,OAAO;yBAClB;qBACD;iBACD,CAAC;YACH,CAAC;SACD,CAAC,CAAC;QACH,IAAI,CAAC,OAAO;YAAE,MAAM,IAAI,KAAK,CAAC,U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
updatedAt: Date;
|
|
8
|
+
}
|
|
3
9
|
export interface ThreadPatch {
|
|
4
10
|
title?: string;
|
|
5
11
|
metadata?: Record<string, unknown>;
|
|
6
12
|
}
|
|
7
|
-
export interface PatchableThreadMemory
|
|
8
|
-
patchThread?:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}) => Promise<StorageThreadType | null>;
|
|
13
|
+
export interface PatchableThreadMemory {
|
|
14
|
+
patchThread?: unknown;
|
|
15
|
+
getThread?: unknown;
|
|
16
|
+
saveThread?: unknown;
|
|
12
17
|
}
|
|
13
|
-
export declare function
|
|
18
|
+
export declare function getThread(memory: PatchableThreadMemory, threadId: string): Promise<ThreadRecord | null>;
|
|
19
|
+
export declare function patchThread(memory: PatchableThreadMemory, args: {
|
|
14
20
|
threadId: string;
|
|
15
|
-
update: (current:
|
|
16
|
-
}): Promise<
|
|
21
|
+
update: (current: ThreadRecord) => ThreadPatch | null | undefined;
|
|
22
|
+
}): Promise<ThreadRecord | null>;
|
|
@@ -1,50 +1,51 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getThread = getThread;
|
|
3
4
|
exports.patchThread = patchThread;
|
|
4
5
|
function isPatchableThreadMemory(memory) {
|
|
5
|
-
return typeof memory === '
|
|
6
|
+
return typeof memory.patchThread === 'function';
|
|
6
7
|
}
|
|
7
|
-
function
|
|
8
|
-
return
|
|
9
|
-
store !== null &&
|
|
10
|
-
'patchThread' in store &&
|
|
11
|
-
typeof Reflect.get(store, 'patchThread') === 'function');
|
|
8
|
+
function hasNativeThreadMethods(memory) {
|
|
9
|
+
return typeof memory.getThread === 'function' && typeof memory.saveThread === 'function';
|
|
12
10
|
}
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
function cloneThreadForUpdate(thread) {
|
|
12
|
+
return {
|
|
13
|
+
...thread,
|
|
14
|
+
metadata: { ...(thread.metadata ?? {}) },
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function applyPatch(threadId, thread, patch) {
|
|
18
|
+
return {
|
|
19
|
+
...thread,
|
|
20
|
+
id: thread.id || threadId,
|
|
21
|
+
title: patch.title ?? thread.title ?? threadId,
|
|
22
|
+
metadata: patch.metadata ?? thread.metadata ?? {},
|
|
20
23
|
};
|
|
21
24
|
}
|
|
25
|
+
async function getThread(memory, threadId) {
|
|
26
|
+
if (hasGetThread(memory)) {
|
|
27
|
+
return await memory.getThread(threadId);
|
|
28
|
+
}
|
|
29
|
+
throw new Error('Memory does not support reading threads');
|
|
30
|
+
}
|
|
22
31
|
async function patchThread(memory, args) {
|
|
23
|
-
if (isPatchableThreadMemory(memory)
|
|
32
|
+
if (isPatchableThreadMemory(memory)) {
|
|
24
33
|
return await memory.patchThread(args);
|
|
25
34
|
}
|
|
26
|
-
if (
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
if (hasNativeThreadMethods(memory)) {
|
|
36
|
+
const thread = await memory.getThread(args.threadId);
|
|
37
|
+
if (!thread)
|
|
38
|
+
return null;
|
|
39
|
+
const patch = args.update(cloneThreadForUpdate(thread));
|
|
40
|
+
if (!patch)
|
|
41
|
+
return thread;
|
|
42
|
+
const updated = applyPatch(args.threadId, thread, patch);
|
|
43
|
+
await memory.saveThread(updated);
|
|
44
|
+
return updated;
|
|
34
45
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
...thread,
|
|
40
|
-
metadata: { ...(thread.metadata ?? {}) },
|
|
41
|
-
});
|
|
42
|
-
if (!patch)
|
|
43
|
-
return thread;
|
|
44
|
-
return await memory.updateThread({
|
|
45
|
-
id: args.threadId,
|
|
46
|
-
title: patch.title ?? thread.title ?? args.threadId,
|
|
47
|
-
metadata: patch.metadata ?? thread.metadata ?? {},
|
|
48
|
-
});
|
|
46
|
+
throw new Error('Memory does not support patching threads');
|
|
47
|
+
}
|
|
48
|
+
function hasGetThread(memory) {
|
|
49
|
+
return typeof memory.getThread === 'function';
|
|
49
50
|
}
|
|
50
51
|
//# sourceMappingURL=thread-patch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thread-patch.js","sourceRoot":"","sources":["../../src/storage/thread-patch.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"thread-patch.js","sourceRoot":"","sources":["../../src/storage/thread-patch.ts"],"names":[],"mappings":";;AAoDA,8BASC;AAED,kCAwBC;AAnED,SAAS,uBAAuB,CAAC,MAA6B;IAM7D,OAAO,OAAO,MAAM,CAAC,WAAW,KAAK,UAAU,CAAC;AACjD,CAAC;AAED,SAAS,sBAAsB,CAAC,MAA6B;IAI5D,OAAO,OAAO,MAAM,CAAC,SAAS,KAAK,UAAU,IAAI,OAAO,MAAM,CAAC,UAAU,KAAK,UAAU,CAAC;AAC1F,CAAC;AAED,SAAS,oBAAoB,CAAC,MAAoB;IACjD,OAAO;QACN,GAAG,MAAM;QACT,QAAQ,EAAE,EAAE,GAAG,CAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE;KACxC,CAAC;AACH,CAAC;AAED,SAAS,UAAU,CAAC,QAAgB,EAAE,MAAoB,EAAE,KAAkB;IAC7E,OAAO;QACN,GAAG,MAAM;QACT,EAAE,EAAE,MAAM,CAAC,EAAE,IAAI,QAAQ;QACzB,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,IAAI,QAAQ;QAC9C,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,IAAI,EAAE;KACjD,CAAC;AACH,CAAC;AAEM,KAAK,UAAU,SAAS,CAC9B,MAA6B,EAC7B,QAAgB;IAEhB,IAAI,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,OAAO,MAAM,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;AAC5D,CAAC;AAEM,KAAK,UAAU,WAAW,CAChC,MAA6B,EAC7B,IAGC;IAED,IAAI,uBAAuB,CAAC,MAAM,CAAC,EAAE,CAAC;QACrC,OAAO,MAAM,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAED,IAAI,sBAAsB,CAAC,MAAM,CAAC,EAAE,CAAC;QACpC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrD,IAAI,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC;QAEzB,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC;QACxD,IAAI,CAAC,KAAK;YAAE,OAAO,MAAM,CAAC;QAE1B,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;QACzD,MAAM,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACjC,OAAO,OAAO,CAAC;IAChB,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,YAAY,CAAC,MAA6B;IAGlD,OAAO,OAAO,MAAM,CAAC,SAAS,KAAK,UAAU,CAAC;AAC/C,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Memory } from '@mastra/memory';
|
|
2
1
|
import type { TaskList } from '@n8n/api-types';
|
|
3
2
|
import type { TaskStorage } from '../types';
|
|
4
|
-
|
|
3
|
+
import { type PatchableThreadMemory } from './thread-patch';
|
|
4
|
+
export declare class ThreadTaskStorage implements TaskStorage {
|
|
5
5
|
private readonly memory;
|
|
6
|
-
constructor(memory:
|
|
6
|
+
constructor(memory: PatchableThreadMemory);
|
|
7
7
|
get(threadId: string): Promise<TaskList | null>;
|
|
8
8
|
save(threadId: string, tasks: TaskList): Promise<void>;
|
|
9
9
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ThreadTaskStorage = void 0;
|
|
4
4
|
const api_types_1 = require("@n8n/api-types");
|
|
5
5
|
const thread_patch_1 = require("./thread-patch");
|
|
6
6
|
const TASKS_METADATA_KEY = 'instanceAiTasks';
|
|
7
|
-
class
|
|
7
|
+
class ThreadTaskStorage {
|
|
8
8
|
memory;
|
|
9
9
|
constructor(memory) {
|
|
10
10
|
this.memory = memory;
|
|
11
11
|
}
|
|
12
12
|
async get(threadId) {
|
|
13
|
-
const thread = await this.memory
|
|
13
|
+
const thread = await (0, thread_patch_1.getThread)(this.memory, threadId);
|
|
14
14
|
if (!thread?.metadata?.[TASKS_METADATA_KEY])
|
|
15
15
|
return null;
|
|
16
16
|
const result = api_types_1.taskListSchema.safeParse(thread.metadata[TASKS_METADATA_KEY]);
|
|
@@ -31,5 +31,5 @@ class MastraTaskStorage {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
exports.
|
|
35
|
-
//# sourceMappingURL=
|
|
34
|
+
exports.ThreadTaskStorage = ThreadTaskStorage;
|
|
35
|
+
//# sourceMappingURL=thread-task-storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thread-task-storage.js","sourceRoot":"","sources":["../../src/storage/thread-task-storage.ts"],"names":[],"mappings":";;;AAAA,8CAAgD;AAIhD,iDAAoF;AAEpF,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AAE7C,MAAa,iBAAiB;IACA;IAA7B,YAA6B,MAA6B;QAA7B,WAAM,GAAN,MAAM,CAAuB;IAAG,CAAC;IAE9D,KAAK,CAAC,GAAG,CAAC,QAAgB;QACzB,MAAM,MAAM,GAAG,MAAM,IAAA,wBAAS,EAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACtD,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,kBAAkB,CAAC;YAAE,OAAO,IAAI,CAAC;QACzD,MAAM,MAAM,GAAG,0BAAc,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC;QAC7E,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,QAAgB,EAAE,KAAe;QAC3C,MAAM,OAAO,GAAG,MAAM,IAAA,0BAAW,EAAC,IAAI,CAAC,MAAM,EAAE;YAC9C,QAAQ;YACR,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;gBAC1B,QAAQ,EAAE;oBACT,GAAG,QAAQ;oBACX,CAAC,kBAAkB,CAAC,EAAE,KAAK;iBAC3B;aACD,CAAC;SACF,CAAC,CAAC;QACH,IAAI,CAAC,OAAO,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,UAAU,QAAQ,YAAY,CAAC,CAAC;QACjD,CAAC;IACF,CAAC;CACD;AAxBD,8CAwBC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Memory } from '@mastra/memory';
|
|
2
1
|
import { z } from 'zod';
|
|
2
|
+
import { type PatchableThreadMemory } from './thread-patch';
|
|
3
3
|
import type { AttemptRecord, WorkflowBuildOutcome, WorkflowLoopState } from '../workflow-loop/workflow-loop-state';
|
|
4
4
|
declare const workItemRecordSchema: z.ZodObject<{
|
|
5
5
|
state: z.ZodObject<{
|
|
@@ -48,8 +48,8 @@ declare const workItemRecordSchema: z.ZodObject<{
|
|
|
48
48
|
threadId: string;
|
|
49
49
|
phase: "building" | "verifying" | "repairing" | "done" | "blocked";
|
|
50
50
|
rebuildAttempts: number;
|
|
51
|
-
workflowId?: string | undefined;
|
|
52
51
|
runId?: string | undefined;
|
|
52
|
+
workflowId?: string | undefined;
|
|
53
53
|
lastTaskId?: string | undefined;
|
|
54
54
|
lastExecutionId?: string | undefined;
|
|
55
55
|
lastFailureSignature?: string | undefined;
|
|
@@ -73,8 +73,8 @@ declare const workItemRecordSchema: z.ZodObject<{
|
|
|
73
73
|
threadId: string;
|
|
74
74
|
phase: "building" | "verifying" | "repairing" | "done" | "blocked";
|
|
75
75
|
rebuildAttempts: number;
|
|
76
|
-
workflowId?: string | undefined;
|
|
77
76
|
runId?: string | undefined;
|
|
77
|
+
workflowId?: string | undefined;
|
|
78
78
|
lastTaskId?: string | undefined;
|
|
79
79
|
lastExecutionId?: string | undefined;
|
|
80
80
|
lastFailureSignature?: string | undefined;
|
|
@@ -108,30 +108,30 @@ declare const workItemRecordSchema: z.ZodObject<{
|
|
|
108
108
|
remediationGuidance: z.ZodOptional<z.ZodString>;
|
|
109
109
|
createdAt: z.ZodString;
|
|
110
110
|
}, "strip", z.ZodTypeAny, {
|
|
111
|
-
createdAt: string;
|
|
112
111
|
attempt: number;
|
|
113
112
|
action: "build" | "verify" | "rebuild" | "patch";
|
|
114
|
-
result: "
|
|
113
|
+
result: "blocked" | "success" | "failure";
|
|
115
114
|
workItemId: string;
|
|
116
115
|
phase: "building" | "verifying" | "repairing" | "done" | "blocked";
|
|
117
|
-
|
|
116
|
+
createdAt: string;
|
|
118
117
|
diagnosis?: string | undefined;
|
|
119
118
|
fixApplied?: string | undefined;
|
|
119
|
+
workflowId?: string | undefined;
|
|
120
120
|
executionId?: string | undefined;
|
|
121
121
|
failureSignature?: string | undefined;
|
|
122
122
|
remediationCategory?: "blocked" | "code_fixable" | "needs_setup" | undefined;
|
|
123
123
|
remediationShouldEdit?: boolean | undefined;
|
|
124
124
|
remediationGuidance?: string | undefined;
|
|
125
125
|
}, {
|
|
126
|
-
createdAt: string;
|
|
127
126
|
attempt: number;
|
|
128
127
|
action: "build" | "verify" | "rebuild" | "patch";
|
|
129
|
-
result: "
|
|
128
|
+
result: "blocked" | "success" | "failure";
|
|
130
129
|
workItemId: string;
|
|
131
130
|
phase: "building" | "verifying" | "repairing" | "done" | "blocked";
|
|
132
|
-
|
|
131
|
+
createdAt: string;
|
|
133
132
|
diagnosis?: string | undefined;
|
|
134
133
|
fixApplied?: string | undefined;
|
|
134
|
+
workflowId?: string | undefined;
|
|
135
135
|
executionId?: string | undefined;
|
|
136
136
|
failureSignature?: string | undefined;
|
|
137
137
|
remediationCategory?: "blocked" | "code_fixable" | "needs_setup" | undefined;
|
|
@@ -269,7 +269,7 @@ declare const workItemRecordSchema: z.ZodObject<{
|
|
|
269
269
|
}, "strip", z.ZodTypeAny, {
|
|
270
270
|
success: boolean;
|
|
271
271
|
attempted: boolean;
|
|
272
|
-
status?: "unknown" | "
|
|
272
|
+
status?: "unknown" | "error" | "success" | "waiting" | "running" | undefined;
|
|
273
273
|
executionId?: string | undefined;
|
|
274
274
|
failureSignature?: string | undefined;
|
|
275
275
|
evidence?: {
|
|
@@ -282,7 +282,7 @@ declare const workItemRecordSchema: z.ZodObject<{
|
|
|
282
282
|
}, {
|
|
283
283
|
success: boolean;
|
|
284
284
|
attempted: boolean;
|
|
285
|
-
status?: "unknown" | "
|
|
285
|
+
status?: "unknown" | "error" | "success" | "waiting" | "running" | undefined;
|
|
286
286
|
executionId?: string | undefined;
|
|
287
287
|
failureSignature?: string | undefined;
|
|
288
288
|
evidence?: {
|
|
@@ -301,8 +301,8 @@ declare const workItemRecordSchema: z.ZodObject<{
|
|
|
301
301
|
triggerType: "manual_or_testable" | "trigger_only";
|
|
302
302
|
needsUserInput: boolean;
|
|
303
303
|
summary: string;
|
|
304
|
-
workflowId?: string | undefined;
|
|
305
304
|
runId?: string | undefined;
|
|
305
|
+
workflowId?: string | undefined;
|
|
306
306
|
mockedCredentialTypes?: string[] | undefined;
|
|
307
307
|
hasUnresolvedPlaceholders?: boolean | undefined;
|
|
308
308
|
failureSignature?: string | undefined;
|
|
@@ -347,7 +347,7 @@ declare const workItemRecordSchema: z.ZodObject<{
|
|
|
347
347
|
verification?: {
|
|
348
348
|
success: boolean;
|
|
349
349
|
attempted: boolean;
|
|
350
|
-
status?: "unknown" | "
|
|
350
|
+
status?: "unknown" | "error" | "success" | "waiting" | "running" | undefined;
|
|
351
351
|
executionId?: string | undefined;
|
|
352
352
|
failureSignature?: string | undefined;
|
|
353
353
|
evidence?: {
|
|
@@ -365,8 +365,8 @@ declare const workItemRecordSchema: z.ZodObject<{
|
|
|
365
365
|
triggerType: "manual_or_testable" | "trigger_only";
|
|
366
366
|
needsUserInput: boolean;
|
|
367
367
|
summary: string;
|
|
368
|
-
workflowId?: string | undefined;
|
|
369
368
|
runId?: string | undefined;
|
|
369
|
+
workflowId?: string | undefined;
|
|
370
370
|
mockedCredentialTypes?: string[] | undefined;
|
|
371
371
|
hasUnresolvedPlaceholders?: boolean | undefined;
|
|
372
372
|
failureSignature?: string | undefined;
|
|
@@ -411,7 +411,7 @@ declare const workItemRecordSchema: z.ZodObject<{
|
|
|
411
411
|
verification?: {
|
|
412
412
|
success: boolean;
|
|
413
413
|
attempted: boolean;
|
|
414
|
-
status?: "unknown" | "
|
|
414
|
+
status?: "unknown" | "error" | "success" | "waiting" | "running" | undefined;
|
|
415
415
|
executionId?: string | undefined;
|
|
416
416
|
failureSignature?: string | undefined;
|
|
417
417
|
evidence?: {
|
|
@@ -431,8 +431,8 @@ declare const workItemRecordSchema: z.ZodObject<{
|
|
|
431
431
|
threadId: string;
|
|
432
432
|
phase: "building" | "verifying" | "repairing" | "done" | "blocked";
|
|
433
433
|
rebuildAttempts: number;
|
|
434
|
-
workflowId?: string | undefined;
|
|
435
434
|
runId?: string | undefined;
|
|
435
|
+
workflowId?: string | undefined;
|
|
436
436
|
lastTaskId?: string | undefined;
|
|
437
437
|
lastExecutionId?: string | undefined;
|
|
438
438
|
lastFailureSignature?: string | undefined;
|
|
@@ -451,15 +451,15 @@ declare const workItemRecordSchema: z.ZodObject<{
|
|
|
451
451
|
} | undefined;
|
|
452
452
|
};
|
|
453
453
|
attempts: {
|
|
454
|
-
createdAt: string;
|
|
455
454
|
attempt: number;
|
|
456
455
|
action: "build" | "verify" | "rebuild" | "patch";
|
|
457
|
-
result: "
|
|
456
|
+
result: "blocked" | "success" | "failure";
|
|
458
457
|
workItemId: string;
|
|
459
458
|
phase: "building" | "verifying" | "repairing" | "done" | "blocked";
|
|
460
|
-
|
|
459
|
+
createdAt: string;
|
|
461
460
|
diagnosis?: string | undefined;
|
|
462
461
|
fixApplied?: string | undefined;
|
|
462
|
+
workflowId?: string | undefined;
|
|
463
463
|
executionId?: string | undefined;
|
|
464
464
|
failureSignature?: string | undefined;
|
|
465
465
|
remediationCategory?: "blocked" | "code_fixable" | "needs_setup" | undefined;
|
|
@@ -473,8 +473,8 @@ declare const workItemRecordSchema: z.ZodObject<{
|
|
|
473
473
|
triggerType: "manual_or_testable" | "trigger_only";
|
|
474
474
|
needsUserInput: boolean;
|
|
475
475
|
summary: string;
|
|
476
|
-
workflowId?: string | undefined;
|
|
477
476
|
runId?: string | undefined;
|
|
477
|
+
workflowId?: string | undefined;
|
|
478
478
|
mockedCredentialTypes?: string[] | undefined;
|
|
479
479
|
hasUnresolvedPlaceholders?: boolean | undefined;
|
|
480
480
|
failureSignature?: string | undefined;
|
|
@@ -519,7 +519,7 @@ declare const workItemRecordSchema: z.ZodObject<{
|
|
|
519
519
|
verification?: {
|
|
520
520
|
success: boolean;
|
|
521
521
|
attempted: boolean;
|
|
522
|
-
status?: "unknown" | "
|
|
522
|
+
status?: "unknown" | "error" | "success" | "waiting" | "running" | undefined;
|
|
523
523
|
executionId?: string | undefined;
|
|
524
524
|
failureSignature?: string | undefined;
|
|
525
525
|
evidence?: {
|
|
@@ -539,8 +539,8 @@ declare const workItemRecordSchema: z.ZodObject<{
|
|
|
539
539
|
threadId: string;
|
|
540
540
|
phase: "building" | "verifying" | "repairing" | "done" | "blocked";
|
|
541
541
|
rebuildAttempts: number;
|
|
542
|
-
workflowId?: string | undefined;
|
|
543
542
|
runId?: string | undefined;
|
|
543
|
+
workflowId?: string | undefined;
|
|
544
544
|
lastTaskId?: string | undefined;
|
|
545
545
|
lastExecutionId?: string | undefined;
|
|
546
546
|
lastFailureSignature?: string | undefined;
|
|
@@ -559,15 +559,15 @@ declare const workItemRecordSchema: z.ZodObject<{
|
|
|
559
559
|
} | undefined;
|
|
560
560
|
};
|
|
561
561
|
attempts: {
|
|
562
|
-
createdAt: string;
|
|
563
562
|
attempt: number;
|
|
564
563
|
action: "build" | "verify" | "rebuild" | "patch";
|
|
565
|
-
result: "
|
|
564
|
+
result: "blocked" | "success" | "failure";
|
|
566
565
|
workItemId: string;
|
|
567
566
|
phase: "building" | "verifying" | "repairing" | "done" | "blocked";
|
|
568
|
-
|
|
567
|
+
createdAt: string;
|
|
569
568
|
diagnosis?: string | undefined;
|
|
570
569
|
fixApplied?: string | undefined;
|
|
570
|
+
workflowId?: string | undefined;
|
|
571
571
|
executionId?: string | undefined;
|
|
572
572
|
failureSignature?: string | undefined;
|
|
573
573
|
remediationCategory?: "blocked" | "code_fixable" | "needs_setup" | undefined;
|
|
@@ -581,8 +581,8 @@ declare const workItemRecordSchema: z.ZodObject<{
|
|
|
581
581
|
triggerType: "manual_or_testable" | "trigger_only";
|
|
582
582
|
needsUserInput: boolean;
|
|
583
583
|
summary: string;
|
|
584
|
-
workflowId?: string | undefined;
|
|
585
584
|
runId?: string | undefined;
|
|
585
|
+
workflowId?: string | undefined;
|
|
586
586
|
mockedCredentialTypes?: string[] | undefined;
|
|
587
587
|
hasUnresolvedPlaceholders?: boolean | undefined;
|
|
588
588
|
failureSignature?: string | undefined;
|
|
@@ -627,7 +627,7 @@ declare const workItemRecordSchema: z.ZodObject<{
|
|
|
627
627
|
verification?: {
|
|
628
628
|
success: boolean;
|
|
629
629
|
attempted: boolean;
|
|
630
|
-
status?: "unknown" | "
|
|
630
|
+
status?: "unknown" | "error" | "success" | "waiting" | "running" | undefined;
|
|
631
631
|
executionId?: string | undefined;
|
|
632
632
|
failureSignature?: string | undefined;
|
|
633
633
|
evidence?: {
|
|
@@ -643,7 +643,7 @@ declare const workItemRecordSchema: z.ZodObject<{
|
|
|
643
643
|
export type WorkflowLoopWorkItemRecord = z.infer<typeof workItemRecordSchema>;
|
|
644
644
|
export declare class WorkflowLoopStorage {
|
|
645
645
|
private readonly memory;
|
|
646
|
-
constructor(memory:
|
|
646
|
+
constructor(memory: PatchableThreadMemory);
|
|
647
647
|
getWorkItem(threadId: string, workItemId: string): Promise<WorkflowLoopWorkItemRecord | null>;
|
|
648
648
|
saveWorkItem(threadId: string, state: WorkflowLoopState, attempts: AttemptRecord[], lastBuildOutcome?: WorkflowBuildOutcome): Promise<void>;
|
|
649
649
|
getActiveWorkItem(threadId: string): Promise<WorkflowLoopWorkItemRecord | null>;
|
|
@@ -45,7 +45,7 @@ class WorkflowLoopStorage {
|
|
|
45
45
|
return null;
|
|
46
46
|
}
|
|
47
47
|
async loadAll(threadId) {
|
|
48
|
-
const thread = await this.memory
|
|
48
|
+
const thread = await (0, thread_patch_1.getThread)(this.memory, threadId);
|
|
49
49
|
if (!thread?.metadata?.[METADATA_KEY])
|
|
50
50
|
return {};
|
|
51
51
|
return this.parse(thread.metadata[METADATA_KEY]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-loop-storage.js","sourceRoot":"","sources":["../../src/storage/workflow-loop-storage.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"workflow-loop-storage.js","sourceRoot":"","sources":["../../src/storage/workflow-loop-storage.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,iDAAoF;AAMpF,8EAI8C;AAE9C,MAAM,YAAY,GAAG,wBAAwB,CAAC;AAE9C,MAAM,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IACrC,KAAK,EAAE,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