@n8n/instance-ai 1.5.0 → 1.6.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.
Files changed (185) hide show
  1. package/dist/agent/computer-use-prompt.d.ts +5 -0
  2. package/dist/agent/computer-use-prompt.js +97 -0
  3. package/dist/agent/computer-use-prompt.js.map +1 -0
  4. package/dist/agent/instance-agent.js +48 -72
  5. package/dist/agent/instance-agent.js.map +1 -1
  6. package/dist/agent/mcp-tool-name-validation.d.ts +15 -0
  7. package/dist/agent/mcp-tool-name-validation.js +67 -0
  8. package/dist/agent/mcp-tool-name-validation.js.map +1 -0
  9. package/dist/agent/sanitize-mcp-schemas.d.ts +56 -2
  10. package/dist/agent/sanitize-mcp-schemas.js +226 -19
  11. package/dist/agent/sanitize-mcp-schemas.js.map +1 -1
  12. package/dist/agent/sub-agent-factory.d.ts +1 -0
  13. package/dist/agent/sub-agent-factory.js +1 -0
  14. package/dist/agent/sub-agent-factory.js.map +1 -1
  15. package/dist/agent/system-prompt.d.ts +1 -1
  16. package/dist/agent/system-prompt.js +19 -99
  17. package/dist/agent/system-prompt.js.map +1 -1
  18. package/dist/build.tsbuildinfo +1 -1
  19. package/dist/domain-access/domain-access-tracker.d.ts +3 -0
  20. package/dist/domain-access/domain-access-tracker.js +16 -0
  21. package/dist/domain-access/domain-access-tracker.js.map +1 -1
  22. package/dist/domain-access/domain-gating.d.ts +35 -6
  23. package/dist/domain-access/domain-gating.js +47 -1
  24. package/dist/domain-access/domain-gating.js.map +1 -1
  25. package/dist/domain-access/index.d.ts +1 -1
  26. package/dist/domain-access/index.js +3 -1
  27. package/dist/domain-access/index.js.map +1 -1
  28. package/dist/index.d.ts +10 -4
  29. package/dist/index.js +16 -2
  30. package/dist/index.js.map +1 -1
  31. package/dist/mcp/mcp-client-manager.d.ts +18 -2
  32. package/dist/mcp/mcp-client-manager.js +124 -20
  33. package/dist/mcp/mcp-client-manager.js.map +1 -1
  34. package/dist/parsers/docx-parser.d.ts +6 -0
  35. package/dist/parsers/docx-parser.js +65 -0
  36. package/dist/parsers/docx-parser.js.map +1 -0
  37. package/dist/parsers/html-parser.d.ts +7 -0
  38. package/dist/parsers/html-parser.js +67 -0
  39. package/dist/parsers/html-parser.js.map +1 -0
  40. package/dist/parsers/index.d.ts +4 -0
  41. package/dist/parsers/index.js +16 -0
  42. package/dist/parsers/index.js.map +1 -0
  43. package/dist/parsers/pdf-parser.d.ts +7 -0
  44. package/dist/parsers/pdf-parser.js +72 -0
  45. package/dist/parsers/pdf-parser.js.map +1 -0
  46. package/dist/parsers/structured-file-parser.d.ts +8 -3
  47. package/dist/parsers/structured-file-parser.js +36 -4
  48. package/dist/parsers/structured-file-parser.js.map +1 -1
  49. package/dist/parsers/validate-attachments.d.ts +14 -0
  50. package/dist/parsers/validate-attachments.js +61 -0
  51. package/dist/parsers/validate-attachments.js.map +1 -0
  52. package/dist/parsers/xlsx-parser.d.ts +2 -0
  53. package/dist/parsers/xlsx-parser.js +75 -0
  54. package/dist/parsers/xlsx-parser.js.map +1 -0
  55. package/dist/runtime/background-task-manager.d.ts +7 -0
  56. package/dist/runtime/background-task-manager.js +68 -2
  57. package/dist/runtime/background-task-manager.js.map +1 -1
  58. package/dist/runtime/liveness-policy.d.ts +40 -0
  59. package/dist/runtime/liveness-policy.js +74 -0
  60. package/dist/runtime/liveness-policy.js.map +1 -0
  61. package/dist/runtime/resumable-stream-executor.d.ts +1 -0
  62. package/dist/runtime/resumable-stream-executor.js +1 -0
  63. package/dist/runtime/resumable-stream-executor.js.map +1 -1
  64. package/dist/runtime/run-state-registry.d.ts +14 -1
  65. package/dist/runtime/run-state-registry.js +100 -7
  66. package/dist/runtime/run-state-registry.js.map +1 -1
  67. package/dist/runtime/stream-runner.d.ts +3 -0
  68. package/dist/runtime/stream-runner.js +3 -0
  69. package/dist/runtime/stream-runner.js.map +1 -1
  70. package/dist/runtime/terminal-response-guard.d.ts +30 -0
  71. package/dist/runtime/terminal-response-guard.js +149 -0
  72. package/dist/runtime/terminal-response-guard.js.map +1 -0
  73. package/dist/storage/agent-tree-snapshot.d.ts +2 -0
  74. package/dist/storage/index.d.ts +2 -0
  75. package/dist/storage/index.js +3 -1
  76. package/dist/storage/index.js.map +1 -1
  77. package/dist/storage/terminal-outcome-storage.d.ts +48 -0
  78. package/dist/storage/terminal-outcome-storage.js +84 -0
  79. package/dist/storage/terminal-outcome-storage.js.map +1 -0
  80. package/dist/storage/workflow-loop-storage.d.ts +156 -10
  81. package/dist/stream/consume-with-hitl.d.ts +1 -0
  82. package/dist/stream/consume-with-hitl.js +1 -0
  83. package/dist/stream/consume-with-hitl.js.map +1 -1
  84. package/dist/stream/map-chunk.js +6 -0
  85. package/dist/stream/map-chunk.js.map +1 -1
  86. package/dist/tools/attachments/parse-file.tool.d.ts +46 -34
  87. package/dist/tools/attachments/parse-file.tool.js +115 -56
  88. package/dist/tools/attachments/parse-file.tool.js.map +1 -1
  89. package/dist/tools/credentials.tool.d.ts +120 -1
  90. package/dist/tools/credentials.tool.js +65 -12
  91. package/dist/tools/credentials.tool.js.map +1 -1
  92. package/dist/tools/data-tables.tool.d.ts +1 -0
  93. package/dist/tools/data-tables.tool.js +4 -2
  94. package/dist/tools/data-tables.tool.js.map +1 -1
  95. package/dist/tools/filesystem/create-tools-from-mcp-server.d.ts +2 -1
  96. package/dist/tools/filesystem/create-tools-from-mcp-server.js +74 -5
  97. package/dist/tools/filesystem/create-tools-from-mcp-server.js.map +1 -1
  98. package/dist/tools/index.d.ts +3 -22
  99. package/dist/tools/index.js +21 -4
  100. package/dist/tools/index.js.map +1 -1
  101. package/dist/tools/nodes.tool.js +15 -15
  102. package/dist/tools/nodes.tool.js.map +1 -1
  103. package/dist/tools/orchestration/blueprint.schema.d.ts +1 -1
  104. package/dist/tools/orchestration/browser-credential-setup.nudge.d.ts +5 -0
  105. package/dist/tools/orchestration/browser-credential-setup.nudge.js +11 -0
  106. package/dist/tools/orchestration/browser-credential-setup.nudge.js.map +1 -0
  107. package/dist/tools/orchestration/browser-credential-setup.prompt.js +2 -1
  108. package/dist/tools/orchestration/browser-credential-setup.prompt.js.map +1 -1
  109. package/dist/tools/orchestration/browser-credential-setup.tool.js +55 -7
  110. package/dist/tools/orchestration/browser-credential-setup.tool.js.map +1 -1
  111. package/dist/tools/orchestration/build-workflow-agent.prompt.js +45 -48
  112. package/dist/tools/orchestration/build-workflow-agent.prompt.js.map +1 -1
  113. package/dist/tools/orchestration/build-workflow-agent.tool.d.ts +8 -3
  114. package/dist/tools/orchestration/build-workflow-agent.tool.js +202 -47
  115. package/dist/tools/orchestration/build-workflow-agent.tool.js.map +1 -1
  116. package/dist/tools/orchestration/data-table-agent.tool.js +1 -0
  117. package/dist/tools/orchestration/data-table-agent.tool.js.map +1 -1
  118. package/dist/tools/orchestration/delegate.tool.js +2 -0
  119. package/dist/tools/orchestration/delegate.tool.js.map +1 -1
  120. package/dist/tools/orchestration/plan-agent-prompt.d.ts +1 -1
  121. package/dist/tools/orchestration/plan-agent-prompt.js +1 -0
  122. package/dist/tools/orchestration/plan-agent-prompt.js.map +1 -1
  123. package/dist/tools/orchestration/plan-with-agent.tool.d.ts +17 -2
  124. package/dist/tools/orchestration/plan-with-agent.tool.js +274 -4
  125. package/dist/tools/orchestration/plan-with-agent.tool.js.map +1 -1
  126. package/dist/tools/orchestration/research-with-agent.tool.js +1 -0
  127. package/dist/tools/orchestration/research-with-agent.tool.js.map +1 -1
  128. package/dist/tools/orchestration/tracing-utils.js +8 -0
  129. package/dist/tools/orchestration/tracing-utils.js.map +1 -1
  130. package/dist/tools/research.tool.js +54 -8
  131. package/dist/tools/research.tool.js.map +1 -1
  132. package/dist/tools/shared/ask-user.tool.d.ts +1 -0
  133. package/dist/tools/shared/ask-user.tool.js +3 -2
  134. package/dist/tools/shared/ask-user.tool.js.map +1 -1
  135. package/dist/tools/workflows/build-workflow.tool.js +3 -3
  136. package/dist/tools/workflows/build-workflow.tool.js.map +1 -1
  137. package/dist/tools/workflows/resolve-credentials.d.ts +9 -4
  138. package/dist/tools/workflows/resolve-credentials.js +59 -27
  139. package/dist/tools/workflows/resolve-credentials.js.map +1 -1
  140. package/dist/tools/workflows/setup-workflow.schema.d.ts +40 -0
  141. package/dist/tools/workflows/setup-workflow.service.d.ts +5 -1
  142. package/dist/tools/workflows/setup-workflow.service.js +71 -5
  143. package/dist/tools/workflows/setup-workflow.service.js.map +1 -1
  144. package/dist/tools/workflows/submit-workflow-identity.d.ts +2 -2
  145. package/dist/tools/workflows/submit-workflow-identity.js +2 -2
  146. package/dist/tools/workflows/submit-workflow-identity.js.map +1 -1
  147. package/dist/tools/workflows/submit-workflow.tool.d.ts +13 -4
  148. package/dist/tools/workflows/submit-workflow.tool.js +37 -24
  149. package/dist/tools/workflows/submit-workflow.tool.js.map +1 -1
  150. package/dist/tools/workflows/workflow-json-utils.d.ts +4 -0
  151. package/dist/tools/workflows/workflow-json-utils.js +54 -0
  152. package/dist/tools/workflows/workflow-json-utils.js.map +1 -0
  153. package/dist/tools/workflows.tool.d.ts +7 -1
  154. package/dist/tools/workflows.tool.js +283 -54
  155. package/dist/tools/workflows.tool.js.map +1 -1
  156. package/dist/tracing/langsmith-tracing.d.ts +2 -0
  157. package/dist/tracing/langsmith-tracing.js +4 -0
  158. package/dist/tracing/langsmith-tracing.js.map +1 -1
  159. package/dist/types.d.ts +13 -4
  160. package/dist/workflow-builder/parse-validate.js +1 -1
  161. package/dist/workflow-builder/parse-validate.js.map +1 -1
  162. package/dist/workflow-loop/index.d.ts +2 -2
  163. package/dist/workflow-loop/index.js +3 -1
  164. package/dist/workflow-loop/index.js.map +1 -1
  165. package/dist/workflow-loop/workflow-loop-state.d.ts +168 -8
  166. package/dist/workflow-loop/workflow-loop-state.js +31 -1
  167. package/dist/workflow-loop/workflow-loop-state.js.map +1 -1
  168. package/dist/workspace/builder-sandbox-factory.d.ts +0 -2
  169. package/dist/workspace/builder-sandbox-factory.js +0 -8
  170. package/dist/workspace/builder-sandbox-factory.js.map +1 -1
  171. package/dist/workspace/n8n-sandbox-filesystem.js +2 -2
  172. package/dist/workspace/n8n-sandbox-filesystem.js.map +1 -1
  173. package/dist/workspace/n8n-sandbox-sandbox.d.ts +2 -3
  174. package/dist/workspace/n8n-sandbox-sandbox.js +3 -7
  175. package/dist/workspace/n8n-sandbox-sandbox.js.map +1 -1
  176. package/dist/workspace/sandbox-setup.d.ts +1 -1
  177. package/dist/workspace/sandbox-setup.js +5 -8
  178. package/dist/workspace/sandbox-setup.js.map +1 -1
  179. package/package.json +28 -9
  180. package/dist/workspace/n8n-sandbox-client.d.ts +0 -105
  181. package/dist/workspace/n8n-sandbox-client.js +0 -335
  182. package/dist/workspace/n8n-sandbox-client.js.map +0 -1
  183. package/dist/workspace/n8n-sandbox-image-manager.d.ts +0 -5
  184. package/dist/workspace/n8n-sandbox-image-manager.js +0 -25
  185. package/dist/workspace/n8n-sandbox-image-manager.js.map +0 -1
@@ -7,6 +7,7 @@ const tools_1 = require("@mastra/core/tools");
7
7
  const api_types_1 = require("@n8n/api-types");
8
8
  const nanoid_1 = require("nanoid");
9
9
  const zod_1 = require("zod");
10
+ const browser_credential_setup_nudge_1 = require("./browser-credential-setup.nudge");
10
11
  const browser_credential_setup_prompt_1 = require("./browser-credential-setup.prompt");
11
12
  const tracing_utils_1 = require("./tracing-utils");
12
13
  const register_with_mastra_1 = require("../../agent/register-with-mastra");
@@ -18,6 +19,42 @@ const research_tool_1 = require("../research.tool");
18
19
  const ask_user_tool_1 = require("../shared/ask-user.tool");
19
20
  var browser_credential_setup_prompt_2 = require("./browser-credential-setup.prompt");
20
21
  Object.defineProperty(exports, "buildBrowserAgentPrompt", { enumerable: true, get: function () { return browser_credential_setup_prompt_2.buildBrowserAgentPrompt; } });
22
+ const PERMANENT_DENIAL_MARKER = 'User permanently denied access to';
23
+ const BROWSER_DENIED_RESULT = 'Browser access was denied by the user. Provide manual setup guidance in chat — do not try the browser flow again in this turn.';
24
+ const browserToolErrorResultSchema = zod_1.z.object({
25
+ isError: zod_1.z.literal(true),
26
+ structuredContent: zod_1.z.object({ error: zod_1.z.string().optional() }).optional(),
27
+ content: zod_1.z.array(zod_1.z.object({ text: zod_1.z.string() }).passthrough()).optional(),
28
+ });
29
+ function isPermanentDenialResult(result) {
30
+ const parsed = browserToolErrorResultSchema.safeParse(result);
31
+ if (!parsed.success)
32
+ return false;
33
+ const messages = [
34
+ parsed.data.structuredContent?.error ?? '',
35
+ ...(parsed.data.content?.map((c) => c.text) ?? []),
36
+ ];
37
+ return messages.some((m) => m.includes(PERMANENT_DENIAL_MARKER));
38
+ }
39
+ function wrapToolForDenialDetection(tool, onDenied) {
40
+ const originalExecute = tool.execute;
41
+ if (!originalExecute)
42
+ return tool;
43
+ const observingExecute = async (input, ctx) => {
44
+ const result = await originalExecute(input, ctx);
45
+ if (isPermanentDenialResult(result))
46
+ onDenied();
47
+ return result;
48
+ };
49
+ return { ...tool, execute: observingExecute };
50
+ }
51
+ function wrapBrowserToolsForDenialDetection(tools, onDenied) {
52
+ const wrapped = {};
53
+ for (const [name, tool] of Object.entries(tools)) {
54
+ wrapped[name] = name.startsWith('browser_') ? wrapToolForDenialDetection(tool, onDenied) : tool;
55
+ }
56
+ return wrapped;
57
+ }
21
58
  function createPauseForUserTool() {
22
59
  return (0, tools_1.createTool)({
23
60
  id: 'pause-for-user',
@@ -31,6 +68,7 @@ function createPauseForUserTool() {
31
68
  requestId: zod_1.z.string(),
32
69
  message: zod_1.z.string(),
33
70
  severity: api_types_1.instanceAiConfirmationSeveritySchema,
71
+ inputType: zod_1.z.literal('continue'),
34
72
  }),
35
73
  resumeSchema: exports.browserCredentialSetupResumeSchema,
36
74
  execute: async (input, ctx) => {
@@ -41,6 +79,7 @@ function createPauseForUserTool() {
41
79
  requestId: (0, nanoid_1.nanoid)(),
42
80
  message: input.message,
43
81
  severity: 'info',
82
+ inputType: 'continue',
44
83
  });
45
84
  return { continued: false };
46
85
  }
@@ -84,7 +123,7 @@ function createBrowserCredentialSetupTool(context) {
84
123
  const gatewayBrowserTools = context.localMcpServer?.getToolsByCategory('browser') ?? [];
85
124
  if (gatewayBrowserTools.length > 0 && context.localMcpServer) {
86
125
  const gatewayBrowserNames = new Set(gatewayBrowserTools.map((t) => t.name));
87
- const allGatewayTools = (0, create_tools_from_mcp_server_1.createToolsFromLocalMcpServer)(context.localMcpServer);
126
+ const allGatewayTools = (0, create_tools_from_mcp_server_1.createToolsFromLocalMcpServer)(context.localMcpServer, context.logger);
88
127
  for (const [name, tool] of Object.entries(allGatewayTools)) {
89
128
  if (gatewayBrowserNames.has(name)) {
90
129
  browserTools[name] = tool;
@@ -111,10 +150,14 @@ function createBrowserCredentialSetupTool(context) {
111
150
  : 'No browser MCP tools available. Chrome DevTools MCP may not be connected.',
112
151
  };
113
152
  }
114
- browserTools['pause-for-user'] = createPauseForUserTool();
115
- browserTools['ask-user'] = (0, ask_user_tool_1.createAskUserTool)();
153
+ let browserPermanentlyDenied = false;
154
+ const browserToolsWithDenialDetection = wrapBrowserToolsForDenialDetection(browserTools, () => {
155
+ browserPermanentlyDenied = true;
156
+ });
157
+ browserToolsWithDenialDetection['pause-for-user'] = createPauseForUserTool();
158
+ browserToolsWithDenialDetection['ask-user'] = (0, ask_user_tool_1.createAskUserTool)();
116
159
  if (context.domainContext) {
117
- browserTools.research = (0, research_tool_1.createResearchTool)(context.domainContext);
160
+ browserToolsWithDenialDetection.research = (0, research_tool_1.createResearchTool)(context.domainContext);
118
161
  }
119
162
  const subAgentId = `agent-browser-${(0, nanoid_1.nanoid)(6)}`;
120
163
  context.eventBus.publish(context.threadId, {
@@ -124,7 +167,7 @@ function createBrowserCredentialSetupTool(context) {
124
167
  payload: {
125
168
  parentId: context.orchestratorAgentId,
126
169
  role: 'credential-setup-browser-agent',
127
- tools: Object.keys(browserTools),
170
+ tools: Object.keys(browserToolsWithDenialDetection),
128
171
  },
129
172
  });
130
173
  let traceRun;
@@ -143,7 +186,7 @@ function createBrowserCredentialSetupTool(context) {
143
186
  })),
144
187
  },
145
188
  });
146
- const tracedBrowserTools = (0, tracing_utils_1.traceSubAgentTools)(context, browserTools, 'credential-setup-browser-agent');
189
+ const tracedBrowserTools = (0, tracing_utils_1.traceSubAgentTools)(context, browserToolsWithDenialDetection, 'credential-setup-browser-agent');
147
190
  const browserPrompt = (0, browser_credential_setup_prompt_1.buildBrowserAgentPrompt)(toolSource);
148
191
  const resultText = await (0, tracing_utils_1.withTraceRun)(context, traceRun, async () => {
149
192
  const subAgent = new agent_1.Agent({
@@ -237,9 +280,14 @@ function createBrowserCredentialSetupTool(context) {
237
280
  if (result.status === 'cancelled') {
238
281
  throw new Error('Run cancelled while waiting for confirmation');
239
282
  }
283
+ if (browserPermanentlyDenied) {
284
+ return BROWSER_DENIED_RESULT;
285
+ }
240
286
  if (lastSuspendedToolName !== 'pause-for-user' && nudgeCount < MAX_NUDGES) {
241
287
  nudgeCount++;
242
- const nudge = await subAgent.stream('You stopped without confirming with the user. Call pause-for-user NOW to tell the user where the credential values live and to enter them privately in the n8n credential form.', {
288
+ const priorMessages = activeStream.messageList.get.all.aiV5.model();
289
+ const nudgeInput = (0, browser_credential_setup_nudge_1.buildNudgeStreamInput)(priorMessages);
290
+ const nudge = await subAgent.stream(nudgeInput, {
243
291
  maxSteps: max_steps_1.MAX_STEPS.BROWSER,
244
292
  abortSignal: context.abortSignal,
245
293
  providerOptions: {
@@ -1 +1 @@
1
- {"version":3,"file":"browser-credential-setup.tool.js","sourceRoot":"","sources":["../../../src/tools/orchestration/browser-credential-setup.tool.ts"],"names":[],"mappings":";;;AA+FA,4EAoSC;AAnYD,8CAA2C;AAE3C,8CAAgD;AAChD,8CAAsE;AACtE,mCAAgC;AAChC,6BAAwB;AAExB,uFAAoG;AACpG,mDAMyB;AACzB,2EAAsE;AACtE,yDAAsD;AACtD,uFAGiD;AACjD,uEAKyC;AAEzC,6FAA2F;AAC3F,oDAAsD;AACtD,2DAA4D;AAE5D,qFAAoG;AAA3F,0IAAA,uBAAuB,OAAA;AA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AK,EAAE,CAAC;gBAChB,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBAC5E,MAAM,IAAA,4BAAY,EAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE;oBAC5C,QAAQ,EAAE,UAAU;oBACpB,UAAU,EAAE,gCAAgC;iBAC5C,CAAC,CAAC;gBAEH,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE;oBAC1C,IAAI,EAAE,iBAAiB;oBACvB,KAAK,EAAE,OAAO,CAAC,KAAK;oBACpB,OAAO,EAAE,UAAU;oBACnB,OAAO,EAAE;wBACR,IAAI,EAAE,gCAAgC;wBACtC,MAAM,EAAE,EAAE;wBACV,KAAK,EAAE,YAAY;qBACnB;iBACD,CAAC,CAAC;gBAEH,OAAO,EAAE,MAAM,EAAE,wBAAwB,YAAY,EAAE,EAAE,CAAC;YAC3D,CAAC;QACF,CAAC;KACD,CAAC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"browser-credential-setup.tool.js","sourceRoot":"","sources":["../../../src/tools/orchestration/browser-credential-setup.tool.ts"],"names":[],"mappings":";;;AA8IA,4EAuTC;AArcD,8CAA2C;AAE3C,8CAAgD;AAChD,8CAAsE;AACtE,mCAAgC;AAChC,6BAAwB;AAExB,qFAAyE;AACzE,uFAAoG;AACpG,mDAMyB;AACzB,2EAAsE;AACtE,yDAAsD;AACtD,uFAGiD;AACjD,uEAKyC;AAEzC,6FAA2F;AAC3F,oDAAsD;AACtD,2DAA4D;AAE5D,qFAAoG;AAA3F,0IAAA,uBAAuB,OAAA;AAEhC,MAAM,uBAAuB,GAAG,mCAAmC,CAAC;AACpE,MAAM,qBAAqB,GAC1B,gIAAgI,CAAC;AAElI,MAAM,4BAA4B,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,OAAO,EAAE,OAAC,C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,KAAK,EAAE;oBAC5C,QAAQ,EAAE,UAAU;oBACpB,UAAU,EAAE,gCAAgC;iBAC5C,CAAC,CAAC;gBAEH,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE;oBAC1C,IAAI,EAAE,iBAAiB;oBACvB,KAAK,EAAE,OAAO,CAAC,KAAK;oBACpB,OAAO,EAAE,UAAU;oBACnB,OAAO,EAAE;wBACR,IAAI,EAAE,gCAAgC;wBACtC,MAAM,EAAE,EAAE;wBACV,KAAK,EAAE,YAAY;qBACnB;iBACD,CAAC,CAAC;gBAEH,OAAO,EAAE,MAAM,EAAE,wBAAwB,YAAY,EAAE,EAAE,CAAC;YAC3D,CAAC;QACF,CAAC;KACD,CAAC,CAAC;AACJ,CAAC"}
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BUILDER_AGENT_PROMPT = void 0;
4
4
  exports.createSandboxBuilderAgentPrompt = createSandboxBuilderAgentPrompt;
5
- const parameter_guides_1 = require("@n8n/workflow-sdk/prompts/node-guidance/parameter-guides");
6
5
  const node_selection_1 = require("@n8n/workflow-sdk/prompts/node-selection");
7
6
  const sdk_reference_1 = require("@n8n/workflow-sdk/prompts/sdk-reference");
8
7
  const shared_prompts_1 = require("../../agent/shared-prompts");
@@ -33,11 +32,14 @@ const SDK_CODE_RULES = `## SDK Code Rules
33
32
  - Use \`expr('{{ $json.field }}')\` for n8n expressions. Variables MUST be inside \`{{ }}\`.
34
33
  - Do NOT use \`as const\` assertions — the workflow parser only supports JavaScript syntax, not TypeScript-only features. Just use plain string literals.
35
34
  - Use string values directly for discriminator fields like \`resource\` and \`operation\` (e.g., \`resource: 'message'\` not \`resource: 'message' as const\`).
36
- - When editing a pre-loaded workflow, **remove \`position\` arrays** from node configs — they are auto-calculated.
37
- - **No em-dash (\`—\`) or other special Unicode characters in node names or string values.** Use plain hyphen (\`-\`) instead. The SDK parser cannot handle em-dashes.
38
- - **IF node combinator** must be \`'and'\` or \`'or'\` (not \`'any'\` or \`'all'\`).`;
39
- function buildBuilderSpecificPatterns(mode) {
40
- const openAiCredExample = mode === 'sandbox' ? "{ id: 'credId', name: 'OpenAI account' }" : "newCredential('OpenAI')";
35
+ - When editing a pre-loaded workflow, **remove \`position\` arrays** from node configs — they are auto-calculated.`;
36
+ const NODE_CONFIGURATION_SAFETY_RULES = `## Node Configuration Safety Rules
37
+
38
+ - Fetch \`nodes(action="type-definition")\` before configuring nodes. Generated definitions and \`@builderHint\` annotations are the source of truth.
39
+ - Use live \`nodes(action="explore-resources")\` for resource locator, list, and model fields when credentials are available.
40
+ - If a configuration is unclear after reading the definition, ask for clarification or use placeholders — do not guess.`;
41
+ function buildBuilderSpecificPatterns() {
42
+ const openAiCredExample = "newCredential('OpenAI')";
41
43
  return `## Critical Patterns (Common Mistakes)
42
44
 
43
45
  **Pay attention to @builderHint annotations in search results and type definitions** — these provide critical guidance on how to correctly configure node parameters. Write them out as notes when reviewing — they prevent common configuration mistakes.
@@ -244,14 +246,14 @@ ${node_selection_1.CONNECTION_CHANGING_PARAMETERS}
244
246
  ### Baseline Flow Control Nodes
245
247
  ${node_selection_1.BASELINE_FLOW_CONTROL}`;
246
248
  }
247
- const BUILDER_SPECIFIC_PATTERNS_TOOL = buildBuilderSpecificPatterns('tool');
248
- const BUILDER_SPECIFIC_PATTERNS_SANDBOX = buildBuilderSpecificPatterns('sandbox');
249
+ const BUILDER_SPECIFIC_PATTERNS = buildBuilderSpecificPatterns();
249
250
  const SANDBOX_WORKFLOW_RULES = `Follow these rules strictly when generating workflows:
250
251
 
251
- 1. **Always use raw credential objects from \`credentials(action="list")\`**
252
- - Wire credentials as \`{ id, name }\` objects returned by \`credentials(action="list")\`
253
- - NEVER use placeholder strings, fake API keys, or hardcoded auth values
254
- - Example: \`credentials: { slackApi: { id: 'yXYBqho73obh58ZS', name: 'Slack Bot' } }\`
252
+ 1. **Use \`newCredential()\` for authentication**
253
+ - If the user selected a specific credential or an existing workflow already has one, wire it as \`newCredential('Credential Name', 'credential-id')\` using the exact ID from \`credentials(action="list")\` or the pre-loaded workflow
254
+ - If no exact credential was selected, more than one credential matches, or the service needs a new credential, wire \`newCredential('Suggested Credential Name')\`; \`submit-workflow\` will mock it for verification and the orchestrator will route setup after the build
255
+ - NEVER invent credential IDs, placeholder strings, fake API keys, or hardcoded auth values
256
+ - Example: \`credentials: { slackApi: newCredential('Slack Bot') }\`
255
257
  - The key (e.g. \`slackApi\`) is the credential **type** from the node type definition
256
258
 
257
259
  2. **Trust empty item lists — don't synthesize fake items**
@@ -273,28 +275,14 @@ const SANDBOX_WORKFLOW_RULES = `Follow these rules strictly when generating work
273
275
  - **Many mutually exclusive paths keyed off a value** → \`switch\` (\`onCase\`).
274
276
  - Nested control flow is supported: \`ifNode.onTrue(loopBuilder)\`, \`switchNode.onCase(0, loopBuilder)\`, and \`splitInBatches(sib).onEachBatch(ifElseBuilder)\` all compile and wire correctly. Use them when the semantics genuinely call for it, not as a workaround for empty-list handling.`;
275
277
  function composeSdkRulesAndPatterns(mode) {
276
- const sandboxOverride = mode === 'sandbox'
277
- ? "> **Sandbox credential override**: The SDK pattern examples below use `newCredential('X')`. " +
278
- "In sandbox mode, replace every `newCredential('X')` with the raw `{ id, name }` object from " +
279
- '`credentials(action="list")`. `newCredential()` serializes to `undefined` in sandbox and will ' +
280
- 'silently drop credentials from the saved workflow.'
281
- : null;
282
278
  return [
283
279
  SDK_CODE_RULES,
284
280
  mode === 'sandbox' ? SANDBOX_WORKFLOW_RULES : sdk_reference_1.WORKFLOW_RULES,
285
- ...(sandboxOverride ? [sandboxOverride] : []),
286
281
  '## SDK Patterns Reference\n\n' + sdk_reference_1.WORKFLOW_SDK_PATTERNS,
287
282
  '## Expression Reference\n\n' + sdk_reference_1.EXPRESSION_REFERENCE,
288
283
  '## Additional Functions\n\n' + sdk_reference_1.ADDITIONAL_FUNCTIONS,
289
- '## Node-Specific Configuration Guides',
290
- parameter_guides_1.IF_NODE_GUIDE.content,
291
- parameter_guides_1.SWITCH_NODE_GUIDE.content,
292
- parameter_guides_1.SET_NODE_GUIDE.content,
293
- parameter_guides_1.HTTP_REQUEST_GUIDE.content,
294
- parameter_guides_1.TOOL_NODES_GUIDE.content,
295
- parameter_guides_1.EMBEDDING_NODES_GUIDE.content,
296
- parameter_guides_1.RESOURCE_LOCATOR_GUIDE.content,
297
- mode === 'sandbox' ? BUILDER_SPECIFIC_PATTERNS_SANDBOX : BUILDER_SPECIFIC_PATTERNS_TOOL,
284
+ NODE_CONFIGURATION_SAFETY_RULES,
285
+ BUILDER_SPECIFIC_PATTERNS,
298
286
  ].join('\n\n');
299
287
  }
300
288
  const SDK_RULES_AND_PATTERNS_TOOL = composeSdkRulesAndPatterns('tool');
@@ -321,10 +309,11 @@ ${shared_prompts_1.PLACEHOLDERS_RULE}
321
309
  Do NOT produce visible output until step 5. All reasoning happens internally.
322
310
 
323
311
  ## Credential Rules (tool mode)
324
- - Always use \`newCredential('Credential Name')\` for credentials, never fake keys or placeholders.
325
- - NEVER use raw credential objects like \`{ id: '...', name: '...' }\` that form is for sandbox mode only.
312
+ - Use \`newCredential('Credential Name', 'credential-id')\` only when the user selected a specific existing credential or the workflow already has one.
313
+ - If no exact credential was selected, more than one credential matches, or the service needs a new credential, use \`newCredential('Suggested Credential Name')\`; the build tools mock unresolved credentials for verification.
314
+ - NEVER use raw credential objects like \`{ id: '...', name: '...' }\` in tool mode.
326
315
  - When editing a pre-loaded workflow, the roundtripped code may have credentials as raw objects — replace them with \`newCredential()\` calls.
327
- - Unresolved credentials (where the user chose mock data or no credential is available) will be automatically mocked via pinned data at submit time. Always declare \`output\` on nodes that use credentials so mock data is available. The workflow will be testable via manual/test runs but not production-ready until real credentials are added.
316
+ - Unresolved credentials (where the user chose mock data, no credential is available, or no explicit selection was made) will be automatically mocked via pinned data at submit time. Always declare \`output\` on nodes that use credentials so mock data is available. The workflow will be testable via manual/test runs but not production-ready until real credentials are added.
328
317
 
329
318
  ${SDK_RULES_AND_PATTERNS_TOOL}
330
319
  `;
@@ -435,7 +424,7 @@ Supported input types: \`string\`, \`number\`, \`boolean\`, \`array\`, \`object\
435
424
  ### Step 2: Submit and test the chunk
436
425
 
437
426
  1. Write the chunk file, then submit it: \`submit-workflow\` with the chunk file path.
438
- - Sub-workflows with \`executeWorkflowTrigger\` can be tested immediately via \`executions(action="run")\` without publishing. However, they must be **published** via \`workflows(action="publish")\` before the parent workflow can call them in production (trigger-based) executions.
427
+ - Sub-workflows with \`executeWorkflowTrigger\` can be tested immediately via \`executions(action="run")\`.
439
428
  2. Run the chunk: \`executions(action="run")\` with \`inputData\` matching the trigger schema.
440
429
  - **Webhook workflows**: \`inputData\` IS the request body — do NOT wrap it in \`{ body: ... }\`. The system automatically places \`inputData\` into \`{ headers, query, body: inputData }\`. So to test a webhook expecting \`{ title: "Hello" }\`, pass \`inputData: { title: "Hello" }\`. Inside the workflow, the data arrives at \`$json.body.title\`.
441
430
  - **Event-based triggers** (e.g. Linear Trigger, GitHub Trigger, Slack Trigger): pass \`inputData\` matching what the trigger would normally emit. The system injects it as the trigger node's output — e.g. \`inputData: { action: "create", data: { id: "123", title: "Test issue" } }\` for a Linear Trigger. No need to rebuild the workflow with a Manual Trigger.
@@ -488,14 +477,13 @@ Replace \`CHUNK_WORKFLOW_ID\` with the actual ID returned by \`submit-workflow\`
488
477
 
489
478
  ${shared_prompts_1.PLACEHOLDERS_RULE}
490
479
 
491
- ## Setup Workflows (Create Missing Resources)
480
+ ## Missing Resources
492
481
 
493
482
  When \`nodes(action="explore-resources")\` returns no results for a required resource:
494
483
 
495
- 1. Use \`nodes(action="search")\` and \`nodes(action="type-definition")\` to find the "create" operation for that resource type
496
- 2. Build a one-shot setup workflow in \`chunks/setup-<resource>.ts\` using a manual trigger + the create node
497
- 3. Submit and run it extract the created resource ID from the execution result
498
- 4. Use that real resource ID in the main workflow
484
+ 1. If the resource can be represented as a user choice, use \`placeholder('Select <resource>')\` and let the setup flow collect it after the build
485
+ 2. If the user explicitly asked you to create the resource and the node type definition has a safe create operation, build and verify that resource-creation workflow as part of the requested work
486
+ 3. Otherwise, leave the main workflow as a saved draft and mention the missing resource in the one-line completion summary
499
487
 
500
488
  **For resources that can't be created via n8n** (e.g., Slack channels, external API resources), explain clearly in your summary what the user needs to create manually and what ID to put where.
501
489
 
@@ -513,7 +501,7 @@ ${shared_prompts_1.ASK_USER_FALLBACK}
513
501
  - You CANNOT find or use n8n API keys — they do not exist in the sandbox environment
514
502
  - Do NOT spend time searching for API keys, config files, environment variables, or process info — none of it is accessible
515
503
 
516
- **All interaction with n8n is through the provided tools:** \`submit-workflow\`, \`executions(action="run" | "debug" | "get")\`, \`credentials(action="list" | "test")\`, \`nodes(action="explore-resources")\`, \`workflows(action="publish" | "unpublish")\`, \`data-tables(action="list" | "create" | "schema")\`, etc. These tools communicate with n8n internally — no HTTP required.
504
+ **All interaction with n8n is through the provided tools:** \`submit-workflow\`, \`executions(action="run" | "debug" | "get")\`, \`credentials(action="list" | "get" | "search-types" | "test")\`, \`nodes(action="explore-resources")\`, \`workflows(action="list" | "get" | "get-as-code")\`, \`data-tables(action="list" | "create" | "schema")\`, etc. These tools communicate with n8n internally — no HTTP required.
517
505
 
518
506
  ## Sandbox-Specific Rules
519
507
 
@@ -523,15 +511,25 @@ ${shared_prompts_1.ASK_USER_FALLBACK}
523
511
 
524
512
  ## Credentials (sandbox mode)
525
513
 
526
- Sandbox mode uses **raw credential objects** (not \`newCredential()\`). Call \`credentials(action="list")\` early. Each credential has an \`id\`, \`name\`, and \`type\`. Wire them into nodes like this:
514
+ Sandbox mode uses \`newCredential()\` for authentication. Call \`credentials(action="list")\` early. Each credential has an \`id\`, \`name\`, and \`type\`. Wire selected existing credentials into nodes like this:
527
515
 
528
516
  \`\`\`typescript
529
517
  credentials: {
530
- openWeatherMapApi: { id: 'yXYBqho73obh58ZS', name: 'OpenWeatherMap account' }
518
+ openWeatherMapApi: newCredential('OpenWeatherMap account', 'yXYBqho73obh58ZS')
531
519
  }
532
520
  \`\`\`
533
521
 
534
- The key (\`openWeatherMapApi\`) is the credential **type** from the node type definition. The \`id\` and \`name\` come from \`credentials(action="list")\`.
522
+ For credentials that are not selected yet, keep the credential type key and omit the ID:
523
+
524
+ \`\`\`typescript
525
+ credentials: {
526
+ openWeatherMapApi: newCredential('OpenWeatherMap account')
527
+ }
528
+ \`\`\`
529
+
530
+ The key (\`openWeatherMapApi\`) is the credential **type** from the node type definition. Exact IDs and names come from \`credentials(action="list")\`.
531
+
532
+ Use the two-argument form only when the user selected the credential, there is exactly one matching credential, or you are preserving a credential already present on an existing workflow. If no exact credential was selected, more than one credential matches, or the service needs a new credential, use \`newCredential('Suggested Credential Name')\`; \`submit-workflow\` mocks it for verification and the orchestrator handles setup after the build.
535
533
 
536
534
  If the required credential type is not in \`credentials(action="list")\` results, call \`credentials(action="search-types")\` with the service name (e.g. "linear", "notion") to discover available dedicated credential types. Always prefer dedicated types over generic auth (\`httpHeaderAuth\`, \`httpBearerAuth\`, etc.). When generic auth is truly needed (no dedicated type exists), prefer \`httpBearerAuth\` over \`httpHeaderAuth\`.
537
535
 
@@ -547,13 +545,12 @@ n8n normalizes column names to snake_case (e.g., \`dayName\` → \`day_name\`).
547
545
  - **Complex workflows (5+ nodes, 2+ integrations) MUST use the Compositional Workflow Pattern.** Decompose into sub-workflows, test each independently, then compose. Do NOT write everything in a single workflow.
548
546
  - **If you edit code after submitting, you MUST call \`submit-workflow\` again before doing anything else (verify, run, or finish).** The system tracks file hashes — if the file changed since the last submit, your work is discarded. The sequence is always: edit → submit → then verify/run/finish.
549
547
  - **Follow the runtime verification instructions in your briefing.** If the briefing says verification is required, do not stop after a successful submit.
550
- - **Do NOT call \`workflows(action="publish")\`.** Publishing is the user's decision after they have tested the workflow. Your job ends at a successful submit.
551
548
 
552
549
  ## Mandatory Process
553
550
 
554
551
  ### For simple workflows (< 5 nodes, single integration):
555
552
 
556
- 1. **Discover credentials**: Call \`credentials(action="list")\`. Note each credential's \`id\`, \`name\`, and \`type\`. You'll wire these into nodes as \`credentials: { credType: { id, name } }\`. If a required credential doesn't exist, mention it in your summary.
553
+ 1. **Discover credentials**: Call \`credentials(action="list")\`. Note each credential's \`id\`, \`name\`, and \`type\`. Use \`newCredential('Name', 'id')\` only for an explicitly selected, exactly matched, or existing workflow credential. For unresolved credentials, use \`newCredential('Suggested Name')\`; \`submit-workflow\` records the mocked credential and the orchestrator routes to setup after verification.
557
554
 
558
555
  2. **Discover nodes**:
559
556
  a. If the workflow fits a known category (notification, data_persistence, chatbot, scheduling, data_transformation, data_extraction, document_processing, form_input, content_generation, triage, scraping_and_research), call \`nodes(action="suggested")\` first — it returns curated node recommendations with pattern hints and configuration notes. **Pay attention to the notes** — they prevent common configuration mistakes.
@@ -569,11 +566,11 @@ n8n normalizes column names to snake_case (e.g., \`dayName\` → \`day_name\`).
569
566
  3. **Get node schemas**: Call \`nodes(action="type-definition")\` with ALL the node IDs you need in a single call (up to 5). For nodes with discriminators (from search results), include the \`resource\` and \`operation\` fields. **Read the definitions carefully** — they contain exact parameter names, types, required fields, valid enum values, credential types, displayOptions conditions, and \`@builderHint\` annotations with critical configuration guidance.
570
567
  **Important**: Only call \`nodes(action="type-definition")\` for nodes you will actually use in the workflow. Do not speculatively fetch definitions "just in case". If a definition returns empty or an error, do not retry — proceed with the information from \`nodes(action="search")\` results instead.
571
568
 
572
- 4. **Resolve real resource IDs**: Check the node schemas from step 3 for parameters with \`searchListMethod\` or \`loadOptionsMethod\`. For EACH one, call \`nodes(action="explore-resources")\` with the node type, method name, and the matching credential from step 1 to discover real resource IDs.
569
+ 4. **Resolve real resource IDs**: Check the node schemas from step 3 for parameters with \`searchListMethod\` or \`loadOptionsMethod\`. For EACH one, call \`nodes(action="explore-resources")\` with the node type, method name, and the matching explicit credential from step 1 to discover real resource IDs.
573
570
  - **This is mandatory for: calendars, spreadsheets, channels, folders, models, databases, and any other list-based parameter.** Do NOT assume values like "primary", "default", or "General" — always look up the real ID.
574
571
  - **LLM models in particular** (OpenAI, Anthropic, Groq, etc.): always call \`explore-resources\` with the node's \`@searchListMethod\` when a credential for that provider is attached. The live list reflects what the credential can actually access — free/cheap tiers are often limited (e.g. an OpenAI free-tier key may only return \`gpt-5-mini\`). Picking a model ID that the credential can't access produces a broken workflow. The list is sorted newest-first; use the \`@builderHint\` as selection guidance (e.g. "prefer the GPT-5.4 family") over the live results, not as a hard-coded pick.
575
572
  - Example: Google Calendar's \`calendar\` parameter uses \`searchListMethod: getCalendars\`. Call \`nodes(action="explore-resources")\` with \`methodName: "getCalendars"\` to get the actual calendar ID (e.g., "user@example.com"), not "primary".
576
- - **Never use \`placeholder()\` or fake IDs for discoverable resources.** Create them via a setup workflow instead (see "Setup Workflows" section). For user-provided values, follow the placeholder rules in "SDK Code Rules".
573
+ - **Never use fake IDs for discoverable resources.** Use \`placeholder()\` when the user needs to choose or create the resource after the build. For user-provided values, follow the placeholder rules in "SDK Code Rules".
577
574
  - **If \`explore-resources\` returns more than one match and the user did not name a specific one, use \`placeholder('Select <resource>')\` for that parameter** (e.g. \`placeholder('Select a calendar')\`, \`placeholder('Select a Slack channel')\`). Picking one silently is a guess; the setup wizard surfaces placeholders so the user can choose after the build. Only pick a single match without prompting.
578
575
  - If the resource can't be created via n8n (e.g., Slack channels), explain clearly in your summary what the user needs to set up.
579
576
 
@@ -598,16 +595,16 @@ Follow the **Compositional Workflow Pattern** above. The process becomes:
598
595
 
599
596
  1. **Discover credentials** (same as above).
600
597
  2. **Discover nodes and get schemas** (same as above).
601
- 3. **Resolve real resource IDs** (same as above — call \`nodes(action="explore-resources")\` for EVERY parameter with \`searchListMethod\` or \`loadOptionsMethod\`). Never assume IDs like "primary" or "default". If a resource doesn't exist, build a setup workflow to create it.
598
+ 3. **Resolve real resource IDs** (same as above — call \`nodes(action="explore-resources")\` for EVERY parameter with \`searchListMethod\` or \`loadOptionsMethod\`). Never assume IDs like "primary" or "default". If a resource doesn't exist, use a placeholder unless the user explicitly asked you to create that resource.
602
599
  4. **Decompose** the workflow into logical chunks. Each chunk is a standalone sub-workflow with 2-4 nodes covering one capability (e.g., "fetch and format weather data", "generate AI recommendation", "store to data table").
603
600
  5. **For each chunk**:
604
601
  a. Write the chunk to \`${workspaceRoot}/chunks/<name>.ts\` with an \`executeWorkflowTrigger\` and explicit input schema.
605
602
  b. Run tsc.
606
- c. Submit the chunk: \`submit-workflow\` with \`filePath\` pointing to the chunk file. Test via \`executions(action="run")\` (no publish needed for manual runs).
603
+ c. Submit the chunk: \`submit-workflow\` with \`filePath\` pointing to the chunk file. Test via \`executions(action="run")\`.
607
604
  d. Fix if needed (max 2 submission fix attempts per chunk).
608
605
  6. **Write the main workflow** in \`${workspaceRoot}/src/workflow.ts\` that composes chunks via \`executeWorkflow\` nodes, referencing each chunk's workflow ID.
609
606
  7. **Submit** the main workflow.
610
- 8. **Done**: Output ONE sentence summarizing what was built, including the workflow ID and any known issues. Do NOT publish — the user will decide when to publish after testing.
607
+ 8. **Done**: Output ONE sentence summarizing what was built, including the workflow ID and any known issues.
611
608
 
612
609
  Do NOT produce visible output until the final step. All reasoning happens internally.
613
610
 
@@ -1 +1 @@
1
- {"version":3,"file":"build-workflow-agent.prompt.js","sourceRoot":"","sources":["../../../src/tools/orchestration/build-workflow-agent.prompt.ts"],"names":[],"mappings":";;;AAgYA,0EA4SC;AApqBD,+FAQkE;AAClE,6EAIkD;AAClD,2EAKiD;AAEjD,+DAAkF;AAIlF,MAAM,yBAAyB,GAAG;;;;;;;;;;;;;;;;;;0GAkBwE,CAAC;AAI3G,MAAM,cAAc,GAAG;;;;;;;;;;qFAU8D,CAAC;AAKtF,SAAS,4BAA4B,CAAC,IAAwB;IAC7D,MAAM,iBAAiB,GACtB,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,0CAA0C,CAAC,CAAC,CAAC,yBAAyB,CAAC;IAC7F,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCA+BwB,iBAAiB;;;;;;;;;;;;;;;;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,aAAa;;;;;;;;;;;;;;;;;;;;;KAqBb,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAsDb,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwChB,kCAAiB;;;;;;;;;;;;;;;;EAgBjB,kCAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sCAqEmB,aAAa;;;;;;;;;;;;;;kCAcjB,aAAa;;;;;;;;;;;;;;;;;;;;;;;;6BAwBlB,aAAa;;;;sCAIJ,aAAa;;;;;;;yFAOsC,aAAa;;;;;;;;;;;;;;EAcpG,8BAA8B;CAC/B,CAAC;AACF,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import type { OrchestrationContext } from '../../types';
3
- import { type WorkflowBuildOutcome, type WorkflowLoopState } from '../../workflow-loop';
3
+ import { type WorkflowBuildOutcome, type WorkflowSetupRequirement, type WorkflowVerificationReadiness, type WorkflowLoopState } from '../../workflow-loop';
4
4
  import { type SubmitWorkflowAttempt, type SubmitWorkflowOutput } from '../workflows/submit-workflow.tool';
5
5
  export declare function buildWarmBuilderFollowUp(input: {
6
6
  task: string;
@@ -9,6 +9,9 @@ export declare function buildWarmBuilderFollowUp(input: {
9
9
  workItemId: string;
10
10
  }): string;
11
11
  export declare function recordSuccessfulWorkflowBuilds(tool: unknown, onWorkflowId: (workflowId: string) => void): void;
12
+ export type OutcomeForVerificationReadiness = Pick<WorkflowBuildOutcome, 'submitted' | 'workflowId' | 'triggerNodes' | 'mockedCredentialTypes' | 'mockedCredentialsByNode' | 'verificationPinData' | 'usesWorkflowPinDataForVerification' | 'hasUnresolvedPlaceholders' | 'verification' | 'remediation'>;
13
+ export declare function determineVerificationReadiness(outcome: OutcomeForVerificationReadiness): WorkflowVerificationReadiness;
14
+ export declare function determineSetupRequirement(outcome: OutcomeForVerificationReadiness): WorkflowSetupRequirement;
12
15
  export declare function mergeLatestVerificationIntoOutcome(outcome: WorkflowBuildOutcome, latestOutcome: WorkflowBuildOutcome | undefined): WorkflowBuildOutcome;
13
16
  export declare function withTerminalLoopState(outcome: WorkflowBuildOutcome, state: WorkflowLoopState | undefined): WorkflowBuildOutcome;
14
17
  export declare function finalizeBuildResult(context: OrchestrationContext, workItemId: string, result: {
@@ -18,6 +21,8 @@ export declare function finalizeBuildResult(context: OrchestrationContext, workI
18
21
  text: string;
19
22
  outcome: WorkflowBuildOutcome;
20
23
  }>;
24
+ export declare const DETACHED_BUILDER_REQUIREMENTS = "## Detached Task Contract\n\nYou are running as a detached background task. Do not stop after a successful submit \u2014 verify the workflow works.\n\n### Completion criteria\n\nYour job is done when ONE of these is true:\n- the workflow is verified (ran successfully)\n- you are blocked after one repair attempt per unique failure\n\nDo NOT stop after a successful submit without verifying. Every trigger type is testable:\nmanual / schedule via `executions(action=\"run\")`; event-based triggers (form, webhook,\nchat, mcp, linear, github, slack, etc.) via `verify-built-workflow` with an `inputData`\npayload. The pin-data adapter injects it as the trigger node's output.\n\n### Submit discipline\n\n**Every file edit MUST be followed by submit-workflow before you do anything else.**\nThe system tracks file hashes. If you edit the code and then call `executions(action=\"run\")` or finish without re-submitting, your work is discarded. The sequence is always: edit \u2192 submit \u2192 then verify/run.\n\n### Verification\n\n- If submit-workflow returned mocked credentials, call `verify-built-workflow` with the workItemId.\n- Otherwise pick based on trigger type:\n - **Manual / Schedule** \u2014 `executions(action=\"run\")`.\n - **Form Trigger** \u2014 `verify-built-workflow` with `inputData` as a flat field map, e.g. `{name: \"Alice\", email: \"a@b.c\"}`. Do NOT wrap in `formFields` \u2014 production Form Trigger emits fields directly on `$json`, and the adapter rejects wrapped payloads.\n - **Webhook** \u2014 `verify-built-workflow` with `inputData` as the body payload, e.g. `{event: \"signup\", userId: \"...\"}`. Adapter wraps it under `body`; downstream expressions use `$json.body.<field>`.\n - **Chat Trigger** \u2014 `verify-built-workflow` with `{chatInput: \"user message\"}`.\n - **Other event triggers (Linear, GitHub, Slack, MCP, etc.)** \u2014 `verify-built-workflow` with `inputData` matching the trigger's expected payload shape.\n- If verify-built-workflow returns remediation with `shouldEdit: false`, stop editing and follow its guidance.\n- If verification fails with `shouldEdit: true`, make one batched code repair and re-submit. Never exceed the remaining repair budget in the remediation metadata.\n- If verification fails otherwise, call `executions(action=\"debug\")`, fix the code, re-submit, and retry once.\n- If the same failure signature repeats, stop and explain the block.\n\n### Resource discovery\n\nBefore writing code that uses external services, **resolve real resource IDs**:\n- Call `nodes(action=\"explore-resources\")` for any parameter with searchListMethod when a matching explicit credential is attached (calendars, spreadsheets, channels, models, etc.)\n- Do NOT use \"primary\", \"default\", or any assumed identifier \u2014 look up the actual value\n- Call `nodes(action=\"suggested\")` early if the workflow fits a known category (web_app, form_input, data_persistence, etc.) \u2014 the pattern hints prevent common mistakes\n- Check @builderHint annotations in node type definitions for critical configuration guidance\n";
25
+ export declare function supportingWorkflowIdsFromSubmitAttempts(submitAttempts: SubmitWorkflowAttempt[], mainWorkflowPath: string, mainWorkflowId: string | undefined, referencedWorkflowIds?: string[]): string[];
21
26
  export declare function resultFromPostStreamError(input: {
22
27
  error: unknown;
23
28
  submitAttempts: SubmitWorkflowAttempt[];
@@ -71,15 +76,15 @@ export declare const buildWorkflowAgentInputSchema: z.ZodObject<{
71
76
  reason: z.ZodOptional<z.ZodString>;
72
77
  }, "strip", z.ZodTypeAny, {
73
78
  task: string;
74
- workflowId?: string | undefined;
75
79
  reason?: string | undefined;
80
+ workflowId?: string | undefined;
76
81
  workItemId?: string | undefined;
77
82
  conversationContext?: string | undefined;
78
83
  bypassPlan?: boolean | undefined;
79
84
  }, {
80
85
  task: string;
81
- workflowId?: string | undefined;
82
86
  reason?: string | undefined;
87
+ workflowId?: string | undefined;
83
88
  workItemId?: string | undefined;
84
89
  conversationContext?: string | undefined;
85
90
  bypassPlan?: boolean | undefined;