@n8n/instance-ai 1.12.2 → 1.13.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/apply-agent-thinking.d.ts +2 -0
- package/dist/agent/apply-agent-thinking.js +41 -0
- package/dist/agent/apply-agent-thinking.js.map +1 -0
- package/dist/agent/instance-agent.js +10 -2
- package/dist/agent/instance-agent.js.map +1 -1
- package/dist/agent/sanitize-mcp-schemas.js +133 -125
- package/dist/agent/sanitize-mcp-schemas.js.map +1 -1
- package/dist/agent/shared-prompts.d.ts +0 -1
- package/dist/agent/shared-prompts.js +4 -11
- package/dist/agent/shared-prompts.js.map +1 -1
- package/dist/agent/sub-agent-debriefing.d.ts +4 -4
- package/dist/agent/system-prompt.js +3 -10
- package/dist/agent/system-prompt.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/debug/run-debug-buffer.d.ts +63 -0
- package/dist/debug/run-debug-buffer.js +177 -0
- package/dist/debug/run-debug-buffer.js.map +1 -0
- package/dist/debug/sanitize-debug-snapshot.d.ts +2 -0
- package/dist/debug/sanitize-debug-snapshot.js +88 -0
- package/dist/debug/sanitize-debug-snapshot.js.map +1 -0
- package/dist/error-formatting.js +3 -5
- package/dist/error-formatting.js.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/dist/knowledge-base/build-templates-index.d.ts +1 -0
- package/dist/knowledge-base/build-templates-index.js +18 -2
- package/dist/knowledge-base/build-templates-index.js.map +1 -1
- package/dist/knowledge-base/materialize-knowledge-base.d.ts +2 -3
- package/dist/knowledge-base/materialize-knowledge-base.js +10 -7
- package/dist/knowledge-base/materialize-knowledge-base.js.map +1 -1
- package/dist/mcp/mcp-client-manager.d.ts +1 -1
- package/dist/mcp/mcp-client-manager.js +13 -9
- package/dist/mcp/mcp-client-manager.js.map +1 -1
- package/dist/runtime/memory-task-registry.d.ts +8 -0
- package/dist/runtime/memory-task-registry.js +42 -0
- package/dist/runtime/memory-task-registry.js.map +1 -0
- package/dist/runtime/resumable-stream-executor.d.ts +3 -0
- package/dist/runtime/resumable-stream-executor.js +171 -90
- package/dist/runtime/resumable-stream-executor.js.map +1 -1
- package/dist/runtime/run-state-registry.d.ts +2 -0
- package/dist/runtime/run-state-registry.js +3 -0
- package/dist/runtime/run-state-registry.js.map +1 -1
- package/dist/runtime/stream-runner.d.ts +3 -0
- package/dist/runtime/stream-runner.js +3 -0
- package/dist/runtime/stream-runner.js.map +1 -1
- package/dist/skills/materialize-runtime-skills.d.ts +3 -3
- package/dist/skills/materialize-runtime-skills.js +1 -1
- package/dist/skills/materialize-runtime-skills.js.map +1 -1
- package/dist/source-map-filter.js +0 -1
- package/dist/source-map-filter.js.map +1 -1
- package/dist/storage/terminal-outcome-storage.d.ts +2 -2
- package/dist/storage/workflow-loop-storage.d.ts +75 -4
- package/dist/stream/map-chunk.js +198 -237
- package/dist/stream/map-chunk.js.map +1 -1
- package/dist/stream/output-redaction.js +2 -2
- package/dist/stream/output-redaction.js.map +1 -1
- package/dist/stream/usage-accumulator.d.ts +90 -0
- package/dist/stream/usage-accumulator.js +89 -0
- package/dist/stream/usage-accumulator.js.map +1 -0
- package/dist/stream/work-summary-accumulator.d.ts +6 -6
- package/dist/tools/attachments/parse-file.tool.js +1 -1
- package/dist/tools/attachments/parse-file.tool.js.map +1 -1
- package/dist/tools/credentials.tool.js +4 -1
- package/dist/tools/credentials.tool.js.map +1 -1
- package/dist/tools/data-tables.tool.js +5 -2
- package/dist/tools/data-tables.tool.js.map +1 -1
- package/dist/tools/evals/column-ref-utils.d.ts +1 -2
- package/dist/tools/evals/column-ref-utils.js +19 -18
- package/dist/tools/evals/column-ref-utils.js.map +1 -1
- package/dist/tools/evals/describe-metric-for-workflow.service.js +7 -25
- package/dist/tools/evals/describe-metric-for-workflow.service.js.map +1 -1
- package/dist/tools/evals/detect-tool-refs.service.js +2 -1
- package/dist/tools/evals/detect-tool-refs.service.js.map +1 -1
- package/dist/tools/evals/eval-data-requirements.service.js +10 -9
- package/dist/tools/evals/eval-data-requirements.service.js.map +1 -1
- package/dist/tools/evals/evals.tool.js +2 -2
- package/dist/tools/evals/evals.tool.js.map +1 -1
- package/dist/tools/evals/extract-rows-from-history.service.js +8 -8
- package/dist/tools/evals/extract-rows-from-history.service.js.map +1 -1
- package/dist/tools/evals/generate-sample-rows.service.d.ts +2 -2
- package/dist/tools/evals/generate-sample-rows.service.js +30 -49
- package/dist/tools/evals/generate-sample-rows.service.js.map +1 -1
- package/dist/tools/evals/generate-tool-ref-pin-data.service.js +10 -23
- package/dist/tools/evals/generate-tool-ref-pin-data.service.js.map +1 -1
- package/dist/tools/evals/metric-catalog.js +3 -3
- package/dist/tools/evals/metric-catalog.js.map +1 -1
- package/dist/tools/executions.tool.js +10 -2
- package/dist/tools/executions.tool.js.map +1 -1
- package/dist/tools/filesystem/create-tools-from-mcp-server.d.ts +1 -1
- package/dist/tools/filesystem/create-tools-from-mcp-server.js +8 -10
- package/dist/tools/filesystem/create-tools-from-mcp-server.js.map +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/nodes/node-search-engine.js +21 -42
- package/dist/tools/nodes/node-search-engine.js.map +1 -1
- package/dist/tools/nodes/node-search-engine.types.d.ts +2 -0
- package/dist/tools/nodes/preferred-chat-model.d.ts +1 -0
- package/dist/tools/nodes/preferred-chat-model.js +19 -0
- package/dist/tools/nodes/preferred-chat-model.js.map +1 -0
- package/dist/tools/nodes/suggested-nodes-data.js +13 -3
- package/dist/tools/nodes/suggested-nodes-data.js.map +1 -1
- package/dist/tools/nodes.tool.js +32 -7
- package/dist/tools/nodes.tool.js.map +1 -1
- package/dist/tools/orchestration/complete-checkpoint.tool.js +3 -5
- package/dist/tools/orchestration/complete-checkpoint.tool.js.map +1 -1
- package/dist/tools/orchestration/eval-data-agent.tool.js +2 -1
- package/dist/tools/orchestration/eval-data-agent.tool.js.map +1 -1
- package/dist/tools/orchestration/eval-setup-agent.prompt.d.ts +1 -1
- package/dist/tools/orchestration/eval-setup-agent.prompt.js +3 -3
- package/dist/tools/orchestration/report-verification-verdict.tool.d.ts +2 -2
- package/dist/tools/orchestration/report-verification-verdict.tool.js +1 -1
- package/dist/tools/orchestration/report-verification-verdict.tool.js.map +1 -1
- package/dist/tools/orchestration/verify-built-workflow.tool.js +320 -307
- package/dist/tools/orchestration/verify-built-workflow.tool.js.map +1 -1
- package/dist/tools/research.tool.js +1 -1
- package/dist/tools/research.tool.js.map +1 -1
- package/dist/tools/shared/ask-user.tool.d.ts +4 -4
- package/dist/tools/shared/ask-user.tool.js +6 -1
- package/dist/tools/shared/ask-user.tool.js.map +1 -1
- package/dist/tools/tool-ids.d.ts +0 -1
- package/dist/tools/tool-ids.js +0 -1
- package/dist/tools/tool-ids.js.map +1 -1
- package/dist/tools/workflows/build-workflow.tool.d.ts +4 -22
- package/dist/tools/workflows/build-workflow.tool.js +373 -317
- package/dist/tools/workflows/build-workflow.tool.js.map +1 -1
- package/dist/tools/workflows/classify-node-destructiveness.service.d.ts +7 -0
- package/dist/tools/workflows/classify-node-destructiveness.service.js +307 -0
- package/dist/tools/workflows/classify-node-destructiveness.service.js.map +1 -0
- package/dist/tools/workflows/generate-simulation-fixtures.service.d.ts +8 -0
- package/dist/tools/workflows/generate-simulation-fixtures.service.js +95 -0
- package/dist/tools/workflows/generate-simulation-fixtures.service.js.map +1 -0
- package/dist/tools/workflows/plan-verification-simulation.d.ts +15 -0
- package/dist/tools/workflows/plan-verification-simulation.js +32 -0
- package/dist/tools/workflows/plan-verification-simulation.js.map +1 -0
- package/dist/tools/workflows/resolve-credentials.d.ts +0 -2
- package/dist/tools/workflows/resolve-credentials.js +0 -13
- package/dist/tools/workflows/resolve-credentials.js.map +1 -1
- package/dist/tools/workflows/setup-workflow.service.js +259 -215
- package/dist/tools/workflows/setup-workflow.service.js.map +1 -1
- package/dist/tools/workflows/validate-workflow.service.js +81 -66
- package/dist/tools/workflows/validate-workflow.service.js.map +1 -1
- package/dist/tools/workflows/workflow-build-context.d.ts +33 -0
- package/dist/tools/workflows/workflow-build-context.js +80 -0
- package/dist/tools/workflows/workflow-build-context.js.map +1 -0
- package/dist/tools/workflows/workflow-build-remediation.d.ts +11 -0
- package/dist/tools/workflows/workflow-build-remediation.js +89 -0
- package/dist/tools/workflows/workflow-build-remediation.js.map +1 -0
- package/dist/tools/workflows/workflow-build-reporting.d.ts +19 -0
- package/dist/tools/workflows/workflow-build-reporting.js +78 -0
- package/dist/tools/workflows/workflow-build-reporting.js.map +1 -0
- package/dist/tools/workflows/workflow-build-routing.d.ts +2 -0
- package/dist/tools/workflows/workflow-build-routing.js +83 -0
- package/dist/tools/workflows/workflow-build-routing.js.map +1 -0
- package/dist/tools/workflows/workflow-build-telemetry.d.ts +18 -0
- package/dist/tools/workflows/workflow-build-telemetry.js +33 -0
- package/dist/tools/workflows/workflow-build-telemetry.js.map +1 -0
- package/dist/tools/workflows/workflow-file-bindings.d.ts +28 -0
- package/dist/tools/workflows/workflow-file-bindings.js +104 -0
- package/dist/tools/workflows/workflow-file-bindings.js.map +1 -0
- package/dist/tools/workflows/workflow-json-utils.d.ts +3 -0
- package/dist/tools/workflows/workflow-json-utils.js +54 -5
- package/dist/tools/workflows/workflow-json-utils.js.map +1 -1
- package/dist/tools/workflows/workflow-source-compiler.d.ts +19 -0
- package/dist/tools/workflows/workflow-source-compiler.js +217 -0
- package/dist/tools/workflows/workflow-source-compiler.js.map +1 -0
- package/dist/tools/workflows/workflow-validation-warnings.d.ts +14 -0
- package/dist/tools/workflows/workflow-validation-warnings.js +28 -0
- package/dist/tools/workflows/workflow-validation-warnings.js.map +1 -0
- package/dist/tools/workflows.tool.js +107 -99
- package/dist/tools/workflows.tool.js.map +1 -1
- package/dist/tracing/langsmith-tracing.js +7 -7
- package/dist/tracing/langsmith-tracing.js.map +1 -1
- package/dist/tracing/trace-payloads.d.ts +2 -1
- package/dist/tracing/trace-payloads.js +152 -114
- package/dist/tracing/trace-payloads.js.map +1 -1
- package/dist/types.d.ts +24 -4
- package/dist/types.js.map +1 -1
- package/dist/utils/eval-agents.d.ts +0 -3
- package/dist/utils/eval-agents.js +3 -11
- package/dist/utils/eval-agents.js.map +1 -1
- package/dist/utils/generate-validated-json.d.ts +16 -0
- package/dist/utils/generate-validated-json.js +38 -0
- package/dist/utils/generate-validated-json.js.map +1 -0
- package/dist/utils/stream-helpers.d.ts +0 -1
- package/dist/utils/stream-helpers.js +5 -8
- package/dist/utils/stream-helpers.js.map +1 -1
- package/dist/workflow-builder/build-failure-tracker.js +25 -1
- package/dist/workflow-builder/build-failure-tracker.js.map +1 -1
- package/dist/workflow-builder/index.d.ts +0 -4
- package/dist/workflow-builder/index.js +1 -11
- package/dist/workflow-builder/index.js.map +1 -1
- package/dist/workflow-loop/guidance.js +14 -15
- package/dist/workflow-loop/guidance.js.map +1 -1
- package/dist/workflow-loop/runtime.js +1 -0
- package/dist/workflow-loop/runtime.js.map +1 -1
- package/dist/workflow-loop/verification-obligation.js +8 -1
- package/dist/workflow-loop/verification-obligation.js.map +1 -1
- package/dist/workflow-loop/workflow-loop-controller.js +17 -1
- package/dist/workflow-loop/workflow-loop-controller.js.map +1 -1
- package/dist/workflow-loop/workflow-loop-state.d.ts +90 -6
- package/dist/workflow-loop/workflow-loop-state.js +13 -1
- package/dist/workflow-loop/workflow-loop-state.js.map +1 -1
- package/dist/workspace/builder-templates-service.d.ts +5 -5
- package/dist/workspace/builder-templates-service.js +17 -14
- package/dist/workspace/builder-templates-service.js.map +1 -1
- package/dist/workspace/create-workspace.js +8 -1
- package/dist/workspace/create-workspace.js.map +1 -1
- package/dist/workspace/prebaked-workspace-bundle.d.ts +2 -2
- package/dist/workspace/prebaked-workspace-bundle.js +5 -5
- package/dist/workspace/prebaked-workspace-bundle.js.map +1 -1
- package/dist/workspace/sandbox-setup.d.ts +1 -1
- package/dist/workspace/sandbox-setup.js +10 -37
- package/dist/workspace/sandbox-setup.js.map +1 -1
- package/dist/workspace/snapshot-manager.d.ts +1 -1
- package/dist/workspace/template-telemetry.js +2 -5
- package/dist/workspace/template-telemetry.js.map +1 -1
- package/dist/workspace/workspace-files.d.ts +1 -1
- package/dist/workspace/workspace-files.js +3 -3
- package/dist/workspace/workspace-files.js.map +1 -1
- package/dist/workspace/workspace-manifest.js +2 -2
- package/dist/workspace/workspace-manifest.js.map +1 -1
- package/dist/workspace/workspace-paths.d.ts +4 -0
- package/dist/workspace/workspace-paths.js +25 -0
- package/dist/workspace/workspace-paths.js.map +1 -0
- package/knowledge-base/reference/open-ai-output-shape.md +79 -0
- package/knowledge-base/reference/workflow-builder-guardrails.md +15 -0
- package/package.json +13 -12
- package/skills/planned-task-runtime/SKILL.md +3 -2
- package/skills/planning/SKILL.md +5 -0
- package/skills/post-build-flow/SKILL.md +25 -9
- package/skills/workflow-builder/SKILL.md +89 -134
- package/dist/tools/workflows/submit-workflow-identity.d.ts +0 -39
- package/dist/tools/workflows/submit-workflow-identity.js +0 -181
- package/dist/tools/workflows/submit-workflow-identity.js.map +0 -1
- package/dist/tools/workflows/submit-workflow.tool.d.ts +0 -223
- package/dist/tools/workflows/submit-workflow.tool.js +0 -491
- package/dist/tools/workflows/submit-workflow.tool.js.map +0 -1
- package/dist/workflow-builder/extract-code.d.ts +0 -5
- package/dist/workflow-builder/extract-code.js +0 -105
- package/dist/workflow-builder/extract-code.js.map +0 -1
- package/dist/workflow-builder/parse-validate.d.ts +0 -10
- package/dist/workflow-builder/parse-validate.js +0 -50
- package/dist/workflow-builder/parse-validate.js.map +0 -1
- package/dist/workflow-builder/patch-code.d.ts +0 -14
- package/dist/workflow-builder/patch-code.js +0 -117
- package/dist/workflow-builder/patch-code.js.map +0 -1
- package/dist/workflow-builder/types.d.ts +0 -11
- package/dist/workflow-builder/types.js +0 -3
- package/dist/workflow-builder/types.js.map +0 -1
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
name: workflow-builder
|
|
3
3
|
description: >-
|
|
4
4
|
Default path for all single-workflow work: new one-off workflows, existing-
|
|
5
|
-
workflow edits, verification repairs, and workflow-local data tables.
|
|
6
|
-
|
|
7
|
-
planning
|
|
8
|
-
|
|
5
|
+
workflow edits, verification repairs, and workflow-local data tables. Write
|
|
6
|
+
or edit a workspace source file, then call build-workflow with filePath. Do
|
|
7
|
+
not load planning or create-tasks first. Load planning only when multiple
|
|
8
|
+
coordinated workflows or shared cross-task data tables require a
|
|
9
|
+
dependency-aware task graph.
|
|
9
10
|
recommended_tools:
|
|
11
|
+
- read_file
|
|
12
|
+
- write_file
|
|
13
|
+
- edit_file
|
|
10
14
|
- build-workflow
|
|
11
15
|
- workflows
|
|
12
16
|
- nodes
|
|
@@ -19,103 +23,50 @@ recommended_tools:
|
|
|
19
23
|
# Workflow Builder
|
|
20
24
|
|
|
21
25
|
You are an expert n8n workflow builder. You generate complete, valid
|
|
22
|
-
TypeScript code using `@n8n/workflow-sdk
|
|
26
|
+
TypeScript code using `@n8n/workflow-sdk` for new workflows and for existing
|
|
27
|
+
saved workflow changes.
|
|
23
28
|
|
|
24
29
|
This skill runs inside the orchestrator. It does not introduce a separate
|
|
25
|
-
builder agent, delegated handoff,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
complete the build.
|
|
29
|
-
|
|
30
|
-
For
|
|
31
|
-
build directly with `build-workflow
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
- Your text output is visible to the user. Be concise and natural.
|
|
44
|
-
- Only output text for errors that need attention, or a brief natural completion
|
|
45
|
-
message.
|
|
46
|
-
- No emojis, no filler phrases, no markdown headers in your text output.
|
|
47
|
-
- When conversation context is provided, use it to continue naturally. Do not
|
|
48
|
-
repeat information the user already knows.
|
|
49
|
-
|
|
50
|
-
### No Narration
|
|
51
|
-
|
|
52
|
-
Do not announce what you are about to do. The user already sees tool calls in
|
|
53
|
-
real time. Stay silent while working; speak only on completion or when blocked.
|
|
54
|
-
|
|
55
|
-
Bad:
|
|
56
|
-
|
|
57
|
-
- "I'll build this workflow. Let me start by discovering credentials..."
|
|
58
|
-
- "I'll start by reading the current workflow code..."
|
|
59
|
-
- "I don't see any pinData, so let me check..."
|
|
60
|
-
|
|
61
|
-
Good:
|
|
62
|
-
|
|
63
|
-
- "Workflow ready: Telegram messages are summarized and added to your table."
|
|
64
|
-
- "Workflow updated: removed the stale pinData from the weather check node."
|
|
65
|
-
- "Blocked: the Linear API credential is missing; setup is required before I can
|
|
66
|
-
continue."
|
|
67
|
-
|
|
68
|
-
## Tool Surface
|
|
69
|
-
|
|
70
|
-
Tool names are part of the compatibility contract. Keep using the same tool
|
|
71
|
-
names the old builder used:
|
|
72
|
-
|
|
73
|
-
- `build-workflow` to save TypeScript SDK code or apply targeted patches.
|
|
74
|
-
- `workflows(action="get-as-code")` before precise patches to an existing
|
|
75
|
-
workflow when you need the current code.
|
|
76
|
-
- `workflows(action="get")`, `workflows(action="list")`, and
|
|
77
|
-
`workflows(action="setup")` when inspection or setup routing is needed.
|
|
78
|
-
- `credentials(action="list" | "get" | "search-types" | "test")` for credential
|
|
79
|
-
metadata and connection checks.
|
|
80
|
-
- `nodes(action="suggested")` for known workflow categories.
|
|
81
|
-
- `nodes(action="search")` for service-specific node discovery.
|
|
82
|
-
- `nodes(action="type-definition")` for exact parameter names, enum values,
|
|
83
|
-
credential types, display conditions, and `@builderHint` annotations.
|
|
84
|
-
- `nodes(action="explore-resources")` for live credential-backed resource lists.
|
|
85
|
-
- `data-tables(action="list" | "create" | "schema")` for Data Table work.
|
|
86
|
-
- `parse-file` for parseable user attachments.
|
|
87
|
-
- `research` for external documentation when node definitions are insufficient.
|
|
88
|
-
- `ask-user` only when a human choice is needed.
|
|
89
|
-
- `executions` and `verify-built-workflow` for verification when the current
|
|
90
|
-
turn is responsible for verification.
|
|
91
|
-
- `complete-checkpoint` and `report-verification-verdict` only in checkpoint
|
|
92
|
-
follow-up turns.
|
|
30
|
+
builder agent, delegated handoff, or separate tool allowlist. Use the
|
|
31
|
+
orchestrator tools and runtime workspace file tools already available in the
|
|
32
|
+
current turn. If a relevant agent tool or MCP tool is available through tool
|
|
33
|
+
search, use it when it helps complete the build. Do not call `delegate` to build, patch, fix, verify, or update workflows.
|
|
34
|
+
|
|
35
|
+
For clear new single-workflow requests, write or edit a TypeScript SDK source
|
|
36
|
+
file in the workspace, then build directly with `build-workflow({ filePath })`.
|
|
37
|
+
For existing saved workflow edits, call
|
|
38
|
+
`workflows(action="get-as-code", workflowId)`, write the returned code to a
|
|
39
|
+
`.workflow.ts` workspace file, make the requested edit there, then call
|
|
40
|
+
`build-workflow({ filePath, workflowId })` the first time. Do not load
|
|
41
|
+
`planning` or call `create-tasks` first. Only load `planning` when the
|
|
42
|
+
orchestrator routing rules require coordinated multi-artifact work. Use this
|
|
43
|
+
skill during an approved `<planned-task-follow-up type="build-workflow">` turn,
|
|
44
|
+
or for direct single-workflow builds and edits.
|
|
45
|
+
|
|
46
|
+
Existing edits must go through a workspace source file and `build-workflow`.
|
|
93
47
|
|
|
94
48
|
## Repair Strategy
|
|
95
49
|
|
|
96
50
|
When called with failure details for an existing workflow, start from the
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
51
|
+
workspace source file if one is available in the conversation or tool output. If
|
|
52
|
+
you only have a saved n8n workflow ID, use `workflows(action="get-as-code")`,
|
|
53
|
+
write the returned code to a stable `src/workflows/<name>.workflow.ts` file, make
|
|
54
|
+
the smallest requested edit in that file, then call `build-workflow` with both
|
|
55
|
+
`filePath` and `workflowId` once. Later repairs should reuse the same
|
|
56
|
+
`filePath`; `build-workflow` remembers the bound workflow ID.
|
|
100
57
|
|
|
101
|
-
For
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
{
|
|
105
|
-
"workflowId": "existing-id",
|
|
106
|
-
"patches": [{ "old_str": "exact old code", "new_str": "replacement code" }]
|
|
107
|
-
}
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
Patches apply to the last submitted code, or the tool fetches the saved workflow
|
|
111
|
-
when `workflowId` is provided. Use full code for larger rewrites.
|
|
58
|
+
For repairs, edit the workspace file directly and call `build-workflow` again
|
|
59
|
+
with the same `filePath`. Do not send inline workflow code or string patches to
|
|
60
|
+
`build-workflow`.
|
|
112
61
|
|
|
113
62
|
## Escalation
|
|
114
63
|
|
|
115
64
|
If you are stuck or need information only a human can provide, use `ask-user`.
|
|
116
|
-
Do not retry the same failing approach more than twice. Never
|
|
117
|
-
|
|
118
|
-
|
|
65
|
+
Do not retry the same failing approach more than twice. Never re-ask a question
|
|
66
|
+
the user has already answered, deferred, or skipped — treat a skip as permission
|
|
67
|
+
to assume a sensible default or leave the detail for setup, and move on. Never
|
|
68
|
+
solicit API keys, tokens, passwords, or other secrets through `ask-user`; route
|
|
69
|
+
credential collection through workflow setup or credential setup surfaces.
|
|
119
70
|
|
|
120
71
|
## Placeholders
|
|
121
72
|
|
|
@@ -146,6 +97,11 @@ digests or reports, non-trivial branching, or Code nodes, read
|
|
|
146
97
|
Use it as the build checklist for source preservation, fan-out/fan-in,
|
|
147
98
|
effect-specific gating, list itemization, and Code-node safety.
|
|
148
99
|
|
|
100
|
+
When mapping downstream fields from an OpenAI node, read
|
|
101
|
+
`knowledge-base/reference/open-ai-output-shape.md` (v2+ text/response uses
|
|
102
|
+
`$json.output[0].content[0].text`; v1 text/message uses `$json.message.content`
|
|
103
|
+
— not `$json.text`).
|
|
104
|
+
|
|
149
105
|
## Mandatory Process
|
|
150
106
|
|
|
151
107
|
1. Research. If the workflow fits a known category, call
|
|
@@ -169,22 +125,34 @@ effect-specific gating, list itemization, and Code-node safety.
|
|
|
169
125
|
method name, method type, credential type, and credential ID. This is
|
|
170
126
|
mandatory for calendars, spreadsheets, channels, folders, databases, models,
|
|
171
127
|
and any other list-backed parameter when a credential is available.
|
|
172
|
-
6.
|
|
128
|
+
6. Pick a stable workspace `filePath` for the source file, typically
|
|
129
|
+
`src/workflows/main.workflow.ts` for a one-off new workflow, or a clearly
|
|
130
|
+
named `.workflow.ts` file when multiple source files are useful. For an
|
|
131
|
+
existing workflow with no source file in context, call
|
|
132
|
+
`workflows(action="get-as-code", workflowId)`, write the returned code to the
|
|
133
|
+
chosen `.workflow.ts` file, and pass the n8n `workflowId` only on the first
|
|
134
|
+
`build-workflow` call.
|
|
135
|
+
7. Write complete TypeScript SDK code to the workspace `filePath`, or read and
|
|
136
|
+
selectively edit the existing `.workflow.ts` file for workflow changes. Do
|
|
137
|
+
not put secrets in the source file.
|
|
138
|
+
8. Call `build-workflow` with `filePath`.
|
|
173
139
|
For planned build follow-ups where `buildTask.isSupportingWorkflow === true`,
|
|
174
140
|
pass `isSupportingWorkflow: true`; that saved supporting workflow is the
|
|
175
141
|
task's final deliverable.
|
|
176
|
-
|
|
142
|
+
9. Trace wiring before declaring done. For IF, Switch, Merge, AI-agent, loop, or
|
|
177
143
|
multi-workflow wiring, trace each branch from source to target. Confirm IF
|
|
178
144
|
outputs use `.onTrue()` and `.onFalse()`, Switch outputs use zero-based
|
|
179
145
|
`.onCase(index, target)`, Merge modes match the data shape, and sub-nodes are
|
|
180
146
|
attached to the correct parent.
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
147
|
+
10. Fix errors by editing the same workspace source file and calling
|
|
148
|
+
`build-workflow` again with the same `filePath`. Save again before any
|
|
149
|
+
verification step.
|
|
150
|
+
11. Modify existing workflows by editing the workspace `.workflow.ts` source
|
|
151
|
+
file. If the file was created from `workflows(action="get-as-code")`, pass
|
|
152
|
+
the real n8n `workflowId` on the first `build-workflow` call so the file is
|
|
153
|
+
bound to the saved workflow. Never pass local SDK workflow IDs as n8n
|
|
154
|
+
workflow IDs.
|
|
155
|
+
12. Finish with a concise completion message only when the build, required
|
|
188
156
|
setup routing, or required verification path is complete.
|
|
189
157
|
|
|
190
158
|
Do not produce visible output until the final step, unless blocked.
|
|
@@ -203,13 +171,13 @@ Use the current turn's higher-priority instructions to decide who verifies:
|
|
|
203
171
|
|
|
204
172
|
Build/save success is not workflow-quality evidence. When this turn is
|
|
205
173
|
responsible for verification or repair, inspect the persisted workflow with
|
|
206
|
-
`workflows(action="get-
|
|
207
|
-
|
|
208
|
-
current build/checkpoint goal, not
|
|
209
|
-
checklist.
|
|
174
|
+
`workflows(action="get-as-code", workflowId)` or read the bound workspace
|
|
175
|
+
source file after saving or before reporting a verdict. Judge the saved graph
|
|
176
|
+
against the user's requested outcome and the current build/checkpoint goal, not
|
|
177
|
+
a hidden service-specific or topology checklist.
|
|
210
178
|
If the saved workflow is only a draft, misses the intended outcome, or has weak
|
|
211
|
-
evidence,
|
|
212
|
-
again.
|
|
179
|
+
evidence, edit the same workflow source file and call `build-workflow` with the
|
|
180
|
+
same `filePath`, then inspect and verify again.
|
|
213
181
|
|
|
214
182
|
When this turn is responsible for verification, do not stop after a successful
|
|
215
183
|
save. The job is done when one of these is true:
|
|
@@ -233,8 +201,9 @@ Trigger input shapes:
|
|
|
233
201
|
|
|
234
202
|
If verification returns remediation with `shouldEdit: false`, stop editing and
|
|
235
203
|
follow its guidance. If verification fails with `shouldEdit: true`, make one
|
|
236
|
-
batched
|
|
237
|
-
budget. If a failure repeats, stop and
|
|
204
|
+
batched source-file repair, call `build-workflow` again with the same
|
|
205
|
+
`filePath`, and retry within the repair budget. If a failure repeats, stop and
|
|
206
|
+
explain the blocker.
|
|
238
207
|
|
|
239
208
|
Do not publish the main workflow automatically. Publishing is the user's
|
|
240
209
|
decision after testing.
|
|
@@ -291,14 +260,15 @@ a main workflow. This is part of an approved build task, not a reason to call
|
|
|
291
260
|
Use this pattern when a workflow is large, has reusable chunks, or benefits from
|
|
292
261
|
independent testing. Simple workflows should stay in one workflow.
|
|
293
262
|
|
|
294
|
-
1.
|
|
295
|
-
`isSupportingWorkflow: true`.
|
|
263
|
+
1. Write a source file for each supporting workflow, then build it with
|
|
264
|
+
`build-workflow` and `isSupportingWorkflow: true`.
|
|
296
265
|
2. Give each supporting workflow an `executeWorkflowTrigger` (version 1.1) with
|
|
297
266
|
an explicit input schema.
|
|
298
267
|
3. Use the returned supporting `workflowId` in the main workflow's
|
|
299
268
|
`executeWorkflow` node with `source: 'database'`.
|
|
300
|
-
4.
|
|
301
|
-
`isSupportingWorkflow`; this is the build task's
|
|
269
|
+
4. Create or edit the main workflow source file last, then save it with
|
|
270
|
+
`build-workflow` and without `isSupportingWorkflow`; this is the build task's
|
|
271
|
+
final deliverable outcome.
|
|
302
272
|
5. Do not publish the main workflow automatically. Supporting workflows may be
|
|
303
273
|
published when the parent workflow needs them active for verification or
|
|
304
274
|
runtime references, but only after their setup requirements are resolved.
|
|
@@ -442,12 +412,9 @@ Follow these rules strictly when generating workflows:
|
|
|
442
412
|
1. Always use `newCredential()` for authentication. Never use placeholder
|
|
443
413
|
strings, fake API keys, hardcoded auth values, invented credential IDs, or
|
|
444
414
|
raw `mock-*` IDs.
|
|
445
|
-
2.
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
add an IF gate before a loop only to check whether items exist. To make an
|
|
449
|
-
outcome happen even with zero items, wire it via the control-flow rule
|
|
450
|
-
below.
|
|
415
|
+
2. Zero items end the branch — downstream nodes do not run. Trust this default;
|
|
416
|
+
do not add `alwaysOutputData: true` or empty-check IF gates unless rule 4's
|
|
417
|
+
mandatory-outcome case applies.
|
|
451
418
|
3. Use `executeOnce: true` for a node that receives many items but should run
|
|
452
419
|
once, such as a summary notification, report generation, shared-context
|
|
453
420
|
fetch, or API call that does not vary per input item. Duplicate
|
|
@@ -461,16 +428,11 @@ Follow these rules strictly when generating workflows:
|
|
|
461
428
|
and `.onFalse()`.
|
|
462
429
|
- Many mutually exclusive paths keyed off a value: Switch with
|
|
463
430
|
`.onCase(index, target)`.
|
|
464
|
-
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
empty (the fetch or the filter) makes it emit one empty-marker item
|
|
470
|
-
(empty `$json`) instead of ending the branch; an IF then separates that
|
|
471
|
-
marker from real items. Putting the flag on the node you want to run
|
|
472
|
-
does nothing. Example:
|
|
473
|
-
`node({ type: 'n8n-nodes-base.httpRequest', config: { alwaysOutputData: true, name: 'Fetch Posts', parameters: { /* ... */ } } })`
|
|
431
|
+
- Mandatory outcome when upstream can be empty (digest/alert must still send):
|
|
432
|
+
set `alwaysOutputData: true` on every node that can emit zero items before
|
|
433
|
+
the effect — often both the HTTP fetch (empty `[]`) and the filter (all rows
|
|
434
|
+
dropped). Not on the formatter or notifier; consumers that receive zero
|
|
435
|
+
items never run.
|
|
474
436
|
- A Filter or IF only selects items; it does not perform the requested side
|
|
475
437
|
effect. If the user asks to archive, update, delete, send, or create only
|
|
476
438
|
matching items, wire the corresponding action node on the matching path.
|
|
@@ -496,13 +458,6 @@ Follow these rules strictly when generating workflows:
|
|
|
496
458
|
definitions and `@builderHint` annotations are the source of truth.
|
|
497
459
|
- Use live `nodes(action="explore-resources")` for resource locator, list, and
|
|
498
460
|
model fields when credentials are available.
|
|
499
|
-
- Resource-locator `list` and `id` modes hold opaque IDs picked from real data —
|
|
500
|
-
never put a human-readable name in their `value` (a sheet/board/folder title
|
|
501
|
-
in `list` mode can never resolve, in production or in tests). When you only
|
|
502
|
-
know the resource by name and the locator offers a `name` (or `url`) mode,
|
|
503
|
-
use that mode with the known name. Fall back to id mode with an empty value
|
|
504
|
-
and a `cachedResultName` only when no name mode exists and no credential is
|
|
505
|
-
available to resolve a real ID.
|
|
506
461
|
- If a configuration is unclear after reading the definition, ask for
|
|
507
462
|
clarification or use placeholders. Do not guess.
|
|
508
463
|
- Pay attention to `@builderHint` annotations in search results and type
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { CredentialMap } from './resolve-credentials';
|
|
2
|
-
import { type SubmitWorkflowAttempt, type SubmitWorkflowInput, type SubmitWorkflowOutput } from './submit-workflow.tool';
|
|
3
|
-
import type { InstanceAiContext } from '../../types';
|
|
4
|
-
import type { RemediationMetadata, WorkflowLoopState } from '../../workflow-loop/workflow-loop-state';
|
|
5
|
-
import type { SandboxWorkspace } from '../../workspace/sandbox-fs';
|
|
6
|
-
export type SubmitExecute = (input: SubmitWorkflowInput) => Promise<SubmitWorkflowOutput>;
|
|
7
|
-
interface SubmitGuardOptions {
|
|
8
|
-
getWorkflowLoopState?: () => Promise<WorkflowLoopState | undefined>;
|
|
9
|
-
getTerminalRemediation?: () => RemediationMetadata | undefined;
|
|
10
|
-
currentRunId?: string;
|
|
11
|
-
onGuardFired?: (event: {
|
|
12
|
-
workflowId?: string;
|
|
13
|
-
category: RemediationMetadata['category'];
|
|
14
|
-
attemptCount?: number;
|
|
15
|
-
reason?: string;
|
|
16
|
-
}) => void;
|
|
17
|
-
onTerminalRemediation?: (remediation: RemediationMetadata) => void;
|
|
18
|
-
}
|
|
19
|
-
interface SubmitBudgetTracker {
|
|
20
|
-
recordAttempt(attempt: SubmitWorkflowAttempt): SubmitWorkflowAttempt;
|
|
21
|
-
applyToOutput(path: string, output: SubmitWorkflowOutput): SubmitWorkflowOutput;
|
|
22
|
-
}
|
|
23
|
-
export declare function createPreSaveBudgetTracker(): SubmitBudgetTracker;
|
|
24
|
-
export declare function wrapSubmitExecuteWithIdentity(underlying: SubmitExecute, resolvePath: (rawFilePath: string | undefined) => string, options?: SubmitGuardOptions & {
|
|
25
|
-
budgetTracker?: SubmitBudgetTracker;
|
|
26
|
-
}): SubmitExecute;
|
|
27
|
-
export declare function withDefaultWorkflowFilePath(input: SubmitWorkflowInput, defaultFilePath: string | undefined): SubmitWorkflowInput;
|
|
28
|
-
export declare function createIdentityEnforcedSubmitWorkflowTool(args: {
|
|
29
|
-
context: InstanceAiContext;
|
|
30
|
-
workspace: SandboxWorkspace;
|
|
31
|
-
credentialMap?: CredentialMap;
|
|
32
|
-
onAttempt: (attempt: SubmitWorkflowAttempt) => Promise<void> | void;
|
|
33
|
-
root: string;
|
|
34
|
-
defaultFilePath?: string;
|
|
35
|
-
currentRunId?: string;
|
|
36
|
-
getWorkflowLoopState?: () => Promise<WorkflowLoopState | undefined>;
|
|
37
|
-
onGuardFired?: SubmitGuardOptions['onGuardFired'];
|
|
38
|
-
}): import("@n8n/agents").BuiltTool;
|
|
39
|
-
export {};
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createPreSaveBudgetTracker = createPreSaveBudgetTracker;
|
|
4
|
-
exports.wrapSubmitExecuteWithIdentity = wrapSubmitExecuteWithIdentity;
|
|
5
|
-
exports.withDefaultWorkflowFilePath = withDefaultWorkflowFilePath;
|
|
6
|
-
exports.createIdentityEnforcedSubmitWorkflowTool = createIdentityEnforcedSubmitWorkflowTool;
|
|
7
|
-
const agents_1 = require("@n8n/agents");
|
|
8
|
-
const submit_workflow_tool_1 = require("./submit-workflow.tool");
|
|
9
|
-
const remediation_1 = require("../../workflow-loop/remediation");
|
|
10
|
-
function createPreSaveBudgetTracker() {
|
|
11
|
-
const failuresByPath = new Map();
|
|
12
|
-
function blockRemediation(attemptCount) {
|
|
13
|
-
return (0, remediation_1.createRemediation)({
|
|
14
|
-
category: 'blocked',
|
|
15
|
-
shouldEdit: false,
|
|
16
|
-
reason: 'pre_save_submit_budget_exhausted',
|
|
17
|
-
attemptCount,
|
|
18
|
-
remainingSubmitFixes: 0,
|
|
19
|
-
guidance: 'The workflow could not be saved after three submit attempts. Stop editing and explain the blocker to the user.',
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
return {
|
|
23
|
-
recordAttempt(attempt) {
|
|
24
|
-
if (attempt.success) {
|
|
25
|
-
failuresByPath.delete(attempt.filePath);
|
|
26
|
-
return attempt;
|
|
27
|
-
}
|
|
28
|
-
const attemptCount = (failuresByPath.get(attempt.filePath) ?? 0) + 1;
|
|
29
|
-
failuresByPath.set(attempt.filePath, attemptCount);
|
|
30
|
-
if (attemptCount < remediation_1.MAX_PRE_SAVE_SUBMIT_FAILURES)
|
|
31
|
-
return attempt;
|
|
32
|
-
return {
|
|
33
|
-
...attempt,
|
|
34
|
-
remediation: blockRemediation(attemptCount),
|
|
35
|
-
errors: [
|
|
36
|
-
...(attempt.errors ?? []),
|
|
37
|
-
'Submit remediation budget exhausted for this workflow file.',
|
|
38
|
-
],
|
|
39
|
-
};
|
|
40
|
-
},
|
|
41
|
-
applyToOutput(path, output) {
|
|
42
|
-
if (output.success)
|
|
43
|
-
return output;
|
|
44
|
-
const attemptCount = failuresByPath.get(path) ?? 0;
|
|
45
|
-
if (attemptCount < remediation_1.MAX_PRE_SAVE_SUBMIT_FAILURES)
|
|
46
|
-
return output;
|
|
47
|
-
return {
|
|
48
|
-
...output,
|
|
49
|
-
remediation: blockRemediation(attemptCount),
|
|
50
|
-
errors: [
|
|
51
|
-
...(output.errors ?? []),
|
|
52
|
-
'Submit remediation budget exhausted for this workflow file.',
|
|
53
|
-
],
|
|
54
|
-
};
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
function wrapSubmitExecuteWithIdentity(underlying, resolvePath, options = {}) {
|
|
59
|
-
const pending = new Map();
|
|
60
|
-
function recordTerminalRemediation(workflowId, remediation) {
|
|
61
|
-
if (!remediation || remediation.shouldEdit)
|
|
62
|
-
return;
|
|
63
|
-
options.onTerminalRemediation?.(remediation);
|
|
64
|
-
options.onGuardFired?.({
|
|
65
|
-
workflowId,
|
|
66
|
-
category: remediation.category,
|
|
67
|
-
attemptCount: remediation.attemptCount,
|
|
68
|
-
reason: remediation.reason,
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
function applyOutputGuards(path, output, fallbackWorkflowId) {
|
|
72
|
-
const guarded = options.budgetTracker?.applyToOutput(path, output) ?? output;
|
|
73
|
-
recordTerminalRemediation(guarded.workflowId ?? fallbackWorkflowId, guarded.remediation);
|
|
74
|
-
return guarded;
|
|
75
|
-
}
|
|
76
|
-
async function blockedByTerminalRemediation(workflowId) {
|
|
77
|
-
const terminalRemediation = options.getTerminalRemediation?.() ??
|
|
78
|
-
(0, remediation_1.terminalRemediationFromState)(await options.getWorkflowLoopState?.(), options.currentRunId);
|
|
79
|
-
if (!terminalRemediation)
|
|
80
|
-
return undefined;
|
|
81
|
-
options.onTerminalRemediation?.(terminalRemediation);
|
|
82
|
-
options.onGuardFired?.({
|
|
83
|
-
workflowId,
|
|
84
|
-
category: terminalRemediation.category,
|
|
85
|
-
attemptCount: terminalRemediation.attemptCount,
|
|
86
|
-
reason: terminalRemediation.reason,
|
|
87
|
-
});
|
|
88
|
-
return {
|
|
89
|
-
success: false,
|
|
90
|
-
errors: [terminalRemediation.guidance],
|
|
91
|
-
remediation: terminalRemediation,
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
return async (input) => {
|
|
95
|
-
const resolvedPath = resolvePath(input.filePath);
|
|
96
|
-
const terminalResult = await blockedByTerminalRemediation(input.workflowId);
|
|
97
|
-
if (terminalResult)
|
|
98
|
-
return terminalResult;
|
|
99
|
-
const existing = pending.get(resolvedPath);
|
|
100
|
-
if (existing) {
|
|
101
|
-
let boundId;
|
|
102
|
-
try {
|
|
103
|
-
boundId = await existing;
|
|
104
|
-
}
|
|
105
|
-
catch (error) {
|
|
106
|
-
const terminalAfterFailure = await blockedByTerminalRemediation(input.workflowId);
|
|
107
|
-
if (terminalAfterFailure)
|
|
108
|
-
return terminalAfterFailure;
|
|
109
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
110
|
-
return {
|
|
111
|
-
success: false,
|
|
112
|
-
errors: [`Previous submit-workflow for this file failed: ${message}`],
|
|
113
|
-
remediation: (0, remediation_1.createRemediation)({
|
|
114
|
-
category: 'code_fixable',
|
|
115
|
-
shouldEdit: true,
|
|
116
|
-
reason: 'previous_submit_failed',
|
|
117
|
-
guidance: 'The previous submit-workflow call for this file failed. Fix the workflow code and submit again.',
|
|
118
|
-
}),
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
const terminalAfterWait = await blockedByTerminalRemediation(boundId);
|
|
122
|
-
if (terminalAfterWait)
|
|
123
|
-
return terminalAfterWait;
|
|
124
|
-
const result = await underlying({ ...input, workflowId: boundId });
|
|
125
|
-
return applyOutputGuards(resolvedPath, result, boundId);
|
|
126
|
-
}
|
|
127
|
-
let resolveFn;
|
|
128
|
-
let rejectFn;
|
|
129
|
-
const promise = new Promise((res, rej) => {
|
|
130
|
-
resolveFn = res;
|
|
131
|
-
rejectFn = rej;
|
|
132
|
-
});
|
|
133
|
-
promise.catch(() => { });
|
|
134
|
-
pending.set(resolvedPath, promise);
|
|
135
|
-
try {
|
|
136
|
-
const result = await underlying(input);
|
|
137
|
-
const guarded = applyOutputGuards(resolvedPath, result, input.workflowId);
|
|
138
|
-
if (guarded.success && typeof guarded.workflowId === 'string') {
|
|
139
|
-
resolveFn?.(guarded.workflowId);
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
rejectFn?.(new Error(guarded.errors?.join(' ') ?? 'submit-workflow failed'));
|
|
143
|
-
pending.delete(resolvedPath);
|
|
144
|
-
}
|
|
145
|
-
return guarded;
|
|
146
|
-
}
|
|
147
|
-
catch (error) {
|
|
148
|
-
rejectFn?.(error);
|
|
149
|
-
pending.delete(resolvedPath);
|
|
150
|
-
throw error;
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
function withDefaultWorkflowFilePath(input, defaultFilePath) {
|
|
155
|
-
return defaultFilePath && !input.filePath ? { ...input, filePath: defaultFilePath } : input;
|
|
156
|
-
}
|
|
157
|
-
function createIdentityEnforcedSubmitWorkflowTool(args) {
|
|
158
|
-
const budgetTracker = createPreSaveBudgetTracker();
|
|
159
|
-
const underlying = (0, submit_workflow_tool_1.createSubmitWorkflowTool)(args.context, args.workspace, args.credentialMap, async (attempt) => {
|
|
160
|
-
await args.onAttempt(budgetTracker.recordAttempt(attempt));
|
|
161
|
-
}, { root: args.root, defaultFilePath: args.defaultFilePath });
|
|
162
|
-
const underlyingExecute = underlying.handler;
|
|
163
|
-
if (!underlyingExecute) {
|
|
164
|
-
throw new Error('createSubmitWorkflowTool returned a tool without a handler');
|
|
165
|
-
}
|
|
166
|
-
const wrappedExecute = wrapSubmitExecuteWithIdentity(underlyingExecute, (rawFilePath) => rawFilePath
|
|
167
|
-
? (0, submit_workflow_tool_1.resolveSandboxWorkflowFilePath)(rawFilePath, args.root)
|
|
168
|
-
: (args.defaultFilePath ?? (0, submit_workflow_tool_1.resolveSandboxWorkflowFilePath)(rawFilePath, args.root)), {
|
|
169
|
-
budgetTracker,
|
|
170
|
-
currentRunId: args.currentRunId,
|
|
171
|
-
getWorkflowLoopState: args.getWorkflowLoopState,
|
|
172
|
-
onGuardFired: args.onGuardFired,
|
|
173
|
-
});
|
|
174
|
-
return new agents_1.Tool('submit-workflow')
|
|
175
|
-
.description(underlying.description)
|
|
176
|
-
.input(submit_workflow_tool_1.submitWorkflowInputSchema)
|
|
177
|
-
.output(submit_workflow_tool_1.submitWorkflowOutputSchema)
|
|
178
|
-
.handler(async (input) => await wrappedExecute(withDefaultWorkflowFilePath(input, args.defaultFilePath)))
|
|
179
|
-
.build();
|
|
180
|
-
}
|
|
181
|
-
//# sourceMappingURL=submit-workflow-identity.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"submit-workflow-identity.js","sourceRoot":"","sources":["../../../src/tools/workflows/submit-workflow-identity.ts"],"names":[],"mappings":";;AA4DA,gEAkDC;AAYD,sEAoHC;AAED,kEAKC;AAMD,4FAkDC;AA7RD,wCAAmC;AAGnC,iEAQgC;AAEhC,iEAIyC;AA2BzC,SAAgB,0BAA0B;IACzC,MAAM,cAAc,GAAG,IAAI,GAAG,EAAkB,CAAC;IAEjD,SAAS,gBAAgB,CAAC,YAAoB;QAC7C,OAAO,IAAA,+BAAiB,EAAC;YACxB,QAAQ,EAAE,SAAS;YACnB,UAAU,EAAE,KAAK;YACjB,MAAM,E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