@n8n/instance-ai 1.7.1 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (363) hide show
  1. package/dist/agent/instance-agent.d.ts +1 -1
  2. package/dist/agent/instance-agent.js +88 -75
  3. package/dist/agent/instance-agent.js.map +1 -1
  4. package/dist/agent/mcp-tool-name-validation.d.ts +4 -2
  5. package/dist/agent/mcp-tool-name-validation.js +2 -2
  6. package/dist/agent/mcp-tool-name-validation.js.map +1 -1
  7. package/dist/agent/runtime-workspace.d.ts +6 -0
  8. package/dist/agent/runtime-workspace.js +14 -0
  9. package/dist/agent/runtime-workspace.js.map +1 -0
  10. package/dist/agent/sanitize-mcp-schemas.d.ts +4 -3
  11. package/dist/agent/sanitize-mcp-schemas.js +53 -24
  12. package/dist/agent/sanitize-mcp-schemas.js.map +1 -1
  13. package/dist/agent/sub-agent-debriefing.d.ts +2 -2
  14. package/dist/agent/sub-agent-factory.d.ts +7 -4
  15. package/dist/agent/sub-agent-factory.js +24 -13
  16. package/dist/agent/sub-agent-factory.js.map +1 -1
  17. package/dist/agent/system-prompt.js +18 -15
  18. package/dist/agent/system-prompt.js.map +1 -1
  19. package/dist/build.tsbuildinfo +1 -1
  20. package/dist/constants/max-steps.d.ts +1 -1
  21. package/dist/constants/max-steps.js +1 -1
  22. package/dist/constants/max-steps.js.map +1 -1
  23. package/dist/domain-access/domain-gating.d.ts +2 -2
  24. package/dist/error-formatting.d.ts +1 -0
  25. package/dist/error-formatting.js +159 -0
  26. package/dist/error-formatting.js.map +1 -0
  27. package/dist/index.d.ts +65 -24
  28. package/dist/index.js +96 -52
  29. package/dist/index.js.map +1 -1
  30. package/dist/mcp/mcp-client-manager.d.ts +5 -4
  31. package/dist/mcp/mcp-client-manager.js +42 -17
  32. package/dist/mcp/mcp-client-manager.js.map +1 -1
  33. package/dist/memory/title-utils.d.ts +4 -1
  34. package/dist/memory/title-utils.js +10 -2
  35. package/dist/memory/title-utils.js.map +1 -1
  36. package/dist/parsers/structured-file-parser.d.ts +5 -2
  37. package/dist/parsers/structured-file-parser.js +9 -2
  38. package/dist/parsers/structured-file-parser.js.map +1 -1
  39. package/dist/planned-tasks/planned-task-permissions.js +3 -5
  40. package/dist/planned-tasks/planned-task-permissions.js.map +1 -1
  41. package/dist/planned-tasks/planned-task-service.d.ts +1 -0
  42. package/dist/planned-tasks/planned-task-service.js +8 -0
  43. package/dist/planned-tasks/planned-task-service.js.map +1 -1
  44. package/dist/runtime/background-task-manager.d.ts +9 -2
  45. package/dist/runtime/background-task-manager.js +7 -2
  46. package/dist/runtime/background-task-manager.js.map +1 -1
  47. package/dist/runtime/liveness-policy.js +4 -3
  48. package/dist/runtime/liveness-policy.js.map +1 -1
  49. package/dist/runtime/resumable-stream-executor.d.ts +4 -24
  50. package/dist/runtime/resumable-stream-executor.js +103 -1318
  51. package/dist/runtime/resumable-stream-executor.js.map +1 -1
  52. package/dist/runtime/run-state-registry.d.ts +8 -2
  53. package/dist/runtime/run-state-registry.js +19 -1
  54. package/dist/runtime/run-state-registry.js.map +1 -1
  55. package/dist/runtime/stream-runner.d.ts +4 -4
  56. package/dist/runtime/stream-runner.js +11 -25
  57. package/dist/runtime/stream-runner.js.map +1 -1
  58. package/dist/skills/materialize-runtime-skills.d.ts +62 -0
  59. package/dist/skills/materialize-runtime-skills.js +465 -0
  60. package/dist/skills/materialize-runtime-skills.js.map +1 -0
  61. package/dist/skills/runtime-skills.d.ts +4 -0
  62. package/dist/skills/runtime-skills.js +17 -0
  63. package/dist/skills/runtime-skills.js.map +1 -0
  64. package/dist/source-map-filter.d.ts +17 -0
  65. package/dist/source-map-filter.js +39 -0
  66. package/dist/source-map-filter.js.map +1 -0
  67. package/dist/storage/agent-tree-snapshot.d.ts +2 -0
  68. package/dist/storage/index.d.ts +3 -3
  69. package/dist/storage/index.js +8 -7
  70. package/dist/storage/index.js.map +1 -1
  71. package/dist/storage/planned-task-storage.d.ts +3 -3
  72. package/dist/storage/planned-task-storage.js +3 -8
  73. package/dist/storage/planned-task-storage.js.map +1 -1
  74. package/dist/storage/terminal-outcome-storage.d.ts +4 -4
  75. package/dist/storage/terminal-outcome-storage.js +1 -1
  76. package/dist/storage/terminal-outcome-storage.js.map +1 -1
  77. package/dist/storage/{mastra-iteration-log-storage.d.ts → thread-iteration-log-storage.d.ts} +3 -3
  78. package/dist/storage/{mastra-iteration-log-storage.js → thread-iteration-log-storage.js} +5 -5
  79. package/dist/storage/thread-iteration-log-storage.js.map +1 -0
  80. package/dist/storage/thread-patch.d.ts +16 -10
  81. package/dist/storage/thread-patch.js +37 -36
  82. package/dist/storage/thread-patch.js.map +1 -1
  83. package/dist/storage/{mastra-task-storage.d.ts → thread-task-storage.d.ts} +3 -3
  84. package/dist/storage/{mastra-task-storage.js → thread-task-storage.js} +5 -5
  85. package/dist/storage/thread-task-storage.js.map +1 -0
  86. package/dist/storage/workflow-loop-storage.d.ts +28 -28
  87. package/dist/storage/workflow-loop-storage.js +1 -1
  88. package/dist/storage/workflow-loop-storage.js.map +1 -1
  89. package/dist/stream/consume-with-hitl.d.ts +11 -11
  90. package/dist/stream/consume-with-hitl.js +27 -15
  91. package/dist/stream/consume-with-hitl.js.map +1 -1
  92. package/dist/stream/map-chunk.d.ts +1 -1
  93. package/dist/stream/map-chunk.js +153 -36
  94. package/dist/stream/map-chunk.js.map +1 -1
  95. package/dist/tool-registry.d.ts +8 -0
  96. package/dist/tool-registry.js +45 -0
  97. package/dist/tool-registry.js.map +1 -0
  98. package/dist/tools/attachments/parse-file.tool.d.ts +42 -45
  99. package/dist/tools/attachments/parse-file.tool.js +140 -97
  100. package/dist/tools/attachments/parse-file.tool.js.map +1 -1
  101. package/dist/tools/credentials.tool.d.ts +5 -5
  102. package/dist/tools/credentials.tool.js +31 -34
  103. package/dist/tools/credentials.tool.js.map +1 -1
  104. package/dist/tools/data-tables.tool.d.ts +3 -2
  105. package/dist/tools/data-tables.tool.js +99 -100
  106. package/dist/tools/data-tables.tool.js.map +1 -1
  107. package/dist/tools/evals/apply-pin-data.service.d.ts +3 -0
  108. package/dist/tools/evals/apply-pin-data.service.js +19 -0
  109. package/dist/tools/evals/apply-pin-data.service.js.map +1 -0
  110. package/dist/tools/evals/column-ref-utils.d.ts +3 -0
  111. package/dist/tools/evals/column-ref-utils.js +205 -48
  112. package/dist/tools/evals/column-ref-utils.js.map +1 -1
  113. package/dist/tools/evals/detect-agent-named-refs.service.js +20 -4
  114. package/dist/tools/evals/detect-agent-named-refs.service.js.map +1 -1
  115. package/dist/tools/evals/ensure-eval-data-table.service.d.ts +15 -0
  116. package/dist/tools/evals/ensure-eval-data-table.service.js +83 -0
  117. package/dist/tools/evals/ensure-eval-data-table.service.js.map +1 -0
  118. package/dist/tools/evals/eval-data-requirements.service.d.ts +1 -0
  119. package/dist/tools/evals/eval-data-requirements.service.js +23 -4
  120. package/dist/tools/evals/eval-data-requirements.service.js.map +1 -1
  121. package/dist/tools/evals/evals.tool.d.ts +2 -0
  122. package/dist/tools/evals/evals.tool.js +452 -0
  123. package/dist/tools/evals/evals.tool.js.map +1 -0
  124. package/dist/tools/evals/extract-rows-from-history.service.d.ts +17 -0
  125. package/dist/tools/evals/extract-rows-from-history.service.js +103 -0
  126. package/dist/tools/evals/extract-rows-from-history.service.js.map +1 -0
  127. package/dist/tools/evals/format-eval-setup-task.d.ts +16 -0
  128. package/dist/tools/evals/format-eval-setup-task.js +167 -0
  129. package/dist/tools/evals/format-eval-setup-task.js.map +1 -0
  130. package/dist/tools/evals/generate-sample-rows.service.d.ts +35 -0
  131. package/dist/tools/evals/generate-sample-rows.service.js +278 -0
  132. package/dist/tools/evals/generate-sample-rows.service.js.map +1 -0
  133. package/dist/tools/evals/generate-tool-ref-pin-data.service.d.ts +11 -0
  134. package/dist/tools/evals/generate-tool-ref-pin-data.service.js +125 -0
  135. package/dist/tools/evals/generate-tool-ref-pin-data.service.js.map +1 -0
  136. package/dist/tools/evals/metric-catalog.d.ts +10 -4
  137. package/dist/tools/evals/metric-catalog.js.map +1 -1
  138. package/dist/tools/executions.tool.d.ts +1 -1
  139. package/dist/tools/executions.tool.js +25 -34
  140. package/dist/tools/executions.tool.js.map +1 -1
  141. package/dist/tools/filesystem/create-tools-from-mcp-server.d.ts +2 -3
  142. package/dist/tools/filesystem/create-tools-from-mcp-server.js +129 -67
  143. package/dist/tools/filesystem/create-tools-from-mcp-server.js.map +1 -1
  144. package/dist/tools/index.d.ts +4 -16
  145. package/dist/tools/index.js +102 -92
  146. package/dist/tools/index.js.map +1 -1
  147. package/dist/tools/nodes.tool.d.ts +1 -1
  148. package/dist/tools/nodes.tool.js +31 -33
  149. package/dist/tools/nodes.tool.js.map +1 -1
  150. package/dist/tools/orchestration/add-plan-item.tool.d.ts +2 -2
  151. package/dist/tools/orchestration/add-plan-item.tool.js +45 -49
  152. package/dist/tools/orchestration/add-plan-item.tool.js.map +1 -1
  153. package/dist/tools/orchestration/agent-persistence.d.ts +14 -0
  154. package/dist/tools/orchestration/agent-persistence.js +43 -0
  155. package/dist/tools/orchestration/agent-persistence.js.map +1 -0
  156. package/dist/tools/orchestration/blueprint-accumulator.d.ts +4 -8
  157. package/dist/tools/orchestration/blueprint-accumulator.js +11 -78
  158. package/dist/tools/orchestration/blueprint-accumulator.js.map +1 -1
  159. package/dist/tools/orchestration/blueprint.schema.d.ts +13 -147
  160. package/dist/tools/orchestration/blueprint.schema.js +4 -23
  161. package/dist/tools/orchestration/blueprint.schema.js.map +1 -1
  162. package/dist/tools/orchestration/browser-credential-setup.nudge.d.ts +2 -4
  163. package/dist/tools/orchestration/browser-credential-setup.nudge.js +1 -1
  164. package/dist/tools/orchestration/browser-credential-setup.nudge.js.map +1 -1
  165. package/dist/tools/orchestration/browser-credential-setup.tool.d.ts +10 -2
  166. package/dist/tools/orchestration/browser-credential-setup.tool.js +299 -270
  167. package/dist/tools/orchestration/browser-credential-setup.tool.js.map +1 -1
  168. package/dist/tools/orchestration/build-workflow-agent.prompt.d.ts +7 -1
  169. package/dist/tools/orchestration/build-workflow-agent.prompt.js +46 -20
  170. package/dist/tools/orchestration/build-workflow-agent.prompt.js.map +1 -1
  171. package/dist/tools/orchestration/build-workflow-agent.tool.d.ts +50 -5
  172. package/dist/tools/orchestration/build-workflow-agent.tool.js +748 -605
  173. package/dist/tools/orchestration/build-workflow-agent.tool.js.map +1 -1
  174. package/dist/tools/orchestration/builder-memory-compaction.d.ts +6 -2
  175. package/dist/tools/orchestration/builder-memory-compaction.js +32 -46
  176. package/dist/tools/orchestration/builder-memory-compaction.js.map +1 -1
  177. package/dist/tools/orchestration/complete-checkpoint.tool.d.ts +1 -1
  178. package/dist/tools/orchestration/complete-checkpoint.tool.js +46 -47
  179. package/dist/tools/orchestration/complete-checkpoint.tool.js.map +1 -1
  180. package/dist/tools/orchestration/delegate.tool.d.ts +1 -1
  181. package/dist/tools/orchestration/delegate.tool.js +170 -166
  182. package/dist/tools/orchestration/delegate.tool.js.map +1 -1
  183. package/dist/tools/orchestration/eval-data-agent.tool.d.ts +2 -0
  184. package/dist/tools/orchestration/eval-data-agent.tool.js +183 -0
  185. package/dist/tools/orchestration/eval-data-agent.tool.js.map +1 -0
  186. package/dist/tools/orchestration/eval-setup-agent.prompt.d.ts +1 -0
  187. package/dist/tools/orchestration/eval-setup-agent.prompt.js +238 -0
  188. package/dist/tools/orchestration/eval-setup-agent.prompt.js.map +1 -0
  189. package/dist/tools/orchestration/eval-setup-agent.tool.d.ts +31 -0
  190. package/dist/tools/orchestration/eval-setup-agent.tool.js +204 -0
  191. package/dist/tools/orchestration/eval-setup-agent.tool.js.map +1 -0
  192. package/dist/tools/orchestration/plan-agent-prompt.d.ts +1 -1
  193. package/dist/tools/orchestration/plan-agent-prompt.js +9 -9
  194. package/dist/tools/orchestration/plan-with-agent.tool.d.ts +1 -1
  195. package/dist/tools/orchestration/plan-with-agent.tool.js +210 -179
  196. package/dist/tools/orchestration/plan-with-agent.tool.js.map +1 -1
  197. package/dist/tools/orchestration/plan.tool.d.ts +5 -2
  198. package/dist/tools/orchestration/plan.tool.js +125 -105
  199. package/dist/tools/orchestration/plan.tool.js.map +1 -1
  200. package/dist/tools/orchestration/report-verification-verdict.tool.d.ts +3 -3
  201. package/dist/tools/orchestration/report-verification-verdict.tool.js +65 -66
  202. package/dist/tools/orchestration/report-verification-verdict.tool.js.map +1 -1
  203. package/dist/tools/orchestration/submit-plan.tool.d.ts +1 -1
  204. package/dist/tools/orchestration/submit-plan.tool.js +83 -66
  205. package/dist/tools/orchestration/submit-plan.tool.js.map +1 -1
  206. package/dist/tools/orchestration/tracing-utils.d.ts +3 -2
  207. package/dist/tools/orchestration/tracing-utils.js +58 -39
  208. package/dist/tools/orchestration/tracing-utils.js.map +1 -1
  209. package/dist/tools/orchestration/verify-built-workflow.tool.d.ts +5 -5
  210. package/dist/tools/orchestration/verify-built-workflow.tool.js +166 -166
  211. package/dist/tools/orchestration/verify-built-workflow.tool.js.map +1 -1
  212. package/dist/tools/research.tool.d.ts +1 -1
  213. package/dist/tools/research.tool.js +59 -27
  214. package/dist/tools/research.tool.js.map +1 -1
  215. package/dist/tools/shared/ask-user.tool.d.ts +3 -2
  216. package/dist/tools/shared/ask-user.tool.js +61 -63
  217. package/dist/tools/shared/ask-user.tool.js.map +1 -1
  218. package/dist/tools/task-control.tool.d.ts +1 -1
  219. package/dist/tools/task-control.tool.js +15 -16
  220. package/dist/tools/task-control.tool.js.map +1 -1
  221. package/dist/tools/templates.tool.d.ts +1 -1
  222. package/dist/tools/templates.tool.js +6 -7
  223. package/dist/tools/templates.tool.js.map +1 -1
  224. package/dist/tools/tool-ids.d.ts +40 -0
  225. package/dist/tools/tool-ids.js +62 -0
  226. package/dist/tools/tool-ids.js.map +1 -0
  227. package/dist/tools/workflows/apply-workflow-credentials.tool.d.ts +3 -3
  228. package/dist/tools/workflows/apply-workflow-credentials.tool.js +72 -73
  229. package/dist/tools/workflows/apply-workflow-credentials.tool.js.map +1 -1
  230. package/dist/tools/workflows/build-workflow.tool.d.ts +3 -3
  231. package/dist/tools/workflows/build-workflow.tool.js +113 -114
  232. package/dist/tools/workflows/build-workflow.tool.js.map +1 -1
  233. package/dist/tools/workflows/materialize-node-type.tool.d.ts +6 -6
  234. package/dist/tools/workflows/materialize-node-type.tool.js +64 -65
  235. package/dist/tools/workflows/materialize-node-type.tool.js.map +1 -1
  236. package/dist/tools/workflows/resolve-credentials.d.ts +3 -5
  237. package/dist/tools/workflows/resolve-credentials.js +15 -6
  238. package/dist/tools/workflows/resolve-credentials.js.map +1 -1
  239. package/dist/tools/workflows/setup-workflow.schema.d.ts +2 -2
  240. package/dist/tools/workflows/submit-workflow-identity.d.ts +8 -9
  241. package/dist/tools/workflows/submit-workflow-identity.js +41 -27
  242. package/dist/tools/workflows/submit-workflow-identity.js.map +1 -1
  243. package/dist/tools/workflows/submit-workflow.tool.d.ts +10 -7
  244. package/dist/tools/workflows/submit-workflow.tool.js +224 -191
  245. package/dist/tools/workflows/submit-workflow.tool.js.map +1 -1
  246. package/dist/tools/workflows/validate-workflow.service.d.ts +15 -0
  247. package/dist/tools/workflows/validate-workflow.service.js +289 -0
  248. package/dist/tools/workflows/validate-workflow.service.js.map +1 -0
  249. package/dist/tools/workflows/write-sandbox-file.tool.d.ts +2 -2
  250. package/dist/tools/workflows/write-sandbox-file.tool.js +29 -30
  251. package/dist/tools/workflows/write-sandbox-file.tool.js.map +1 -1
  252. package/dist/tools/workflows.tool.d.ts +5 -2
  253. package/dist/tools/workflows.tool.js +184 -85
  254. package/dist/tools/workflows.tool.js.map +1 -1
  255. package/dist/tools/workspace.tool.d.ts +1 -1
  256. package/dist/tools/workspace.tool.js +49 -65
  257. package/dist/tools/workspace.tool.js.map +1 -1
  258. package/dist/tracing/langsmith-tracing.d.ts +17 -18
  259. package/dist/tracing/langsmith-tracing.js +941 -677
  260. package/dist/tracing/langsmith-tracing.js.map +1 -1
  261. package/dist/tracing/trace-labels.d.ts +5 -0
  262. package/dist/tracing/trace-labels.js +36 -0
  263. package/dist/tracing/trace-labels.js.map +1 -0
  264. package/dist/tracing/trace-payloads.d.ts +23 -0
  265. package/dist/tracing/trace-payloads.js +1008 -0
  266. package/dist/tracing/trace-payloads.js.map +1 -0
  267. package/dist/types.d.ts +57 -25
  268. package/dist/types.js +3 -0
  269. package/dist/types.js.map +1 -1
  270. package/dist/utils/eval-agents.js +1 -1
  271. package/dist/utils/eval-agents.js.map +1 -1
  272. package/dist/utils/scrub-secrets.js +1 -1
  273. package/dist/utils/scrub-secrets.js.map +1 -1
  274. package/dist/utils/stream-helpers.d.ts +2 -5
  275. package/dist/utils/stream-helpers.js +12 -1
  276. package/dist/utils/stream-helpers.js.map +1 -1
  277. package/dist/workflow-loop/workflow-loop-state.d.ts +18 -18
  278. package/dist/workspace/builder-templates-service.d.ts +54 -0
  279. package/dist/workspace/builder-templates-service.js +442 -0
  280. package/dist/workspace/builder-templates-service.js.map +1 -0
  281. package/dist/workspace/create-workspace.d.ts +16 -3
  282. package/dist/workspace/create-workspace.js +45 -21
  283. package/dist/workspace/create-workspace.js.map +1 -1
  284. package/dist/workspace/daytona-auth-manager.d.ts +26 -0
  285. package/dist/workspace/daytona-auth-manager.js +90 -0
  286. package/dist/workspace/daytona-auth-manager.js.map +1 -0
  287. package/dist/workspace/daytona-filesystem.d.ts +5 -4
  288. package/dist/workspace/daytona-filesystem.js +25 -15
  289. package/dist/workspace/daytona-filesystem.js.map +1 -1
  290. package/dist/workspace/daytona-sandbox.d.ts +65 -0
  291. package/dist/workspace/daytona-sandbox.js +314 -0
  292. package/dist/workspace/daytona-sandbox.js.map +1 -0
  293. package/dist/workspace/lazy-daytona.d.ts +2 -0
  294. package/dist/workspace/lazy-daytona.js +12 -0
  295. package/dist/workspace/lazy-daytona.js.map +1 -0
  296. package/dist/workspace/lazy-runtime-workspace.d.ts +8 -0
  297. package/dist/workspace/lazy-runtime-workspace.js +246 -0
  298. package/dist/workspace/lazy-runtime-workspace.js.map +1 -0
  299. package/dist/workspace/local-filesystem.d.ts +48 -0
  300. package/dist/workspace/local-filesystem.js +250 -0
  301. package/dist/workspace/local-filesystem.js.map +1 -0
  302. package/dist/workspace/local-sandbox.d.ts +28 -0
  303. package/dist/workspace/local-sandbox.js +121 -0
  304. package/dist/workspace/local-sandbox.js.map +1 -0
  305. package/dist/workspace/n8n-sandbox-filesystem.d.ts +3 -3
  306. package/dist/workspace/n8n-sandbox-filesystem.js +3 -3
  307. package/dist/workspace/n8n-sandbox-filesystem.js.map +1 -1
  308. package/dist/workspace/n8n-sandbox-sandbox.d.ts +12 -3
  309. package/dist/workspace/n8n-sandbox-sandbox.js +54 -10
  310. package/dist/workspace/n8n-sandbox-sandbox.js.map +1 -1
  311. package/dist/workspace/sandbox-fs.d.ts +35 -4
  312. package/dist/workspace/sandbox-fs.js +1 -1
  313. package/dist/workspace/sandbox-fs.js.map +1 -1
  314. package/dist/workspace/sandbox-setup.d.ts +13 -4
  315. package/dist/workspace/sandbox-setup.js +250 -36
  316. package/dist/workspace/sandbox-setup.js.map +1 -1
  317. package/dist/workspace/scoped-workspace.d.ts +2 -0
  318. package/dist/workspace/scoped-workspace.js +141 -0
  319. package/dist/workspace/scoped-workspace.js.map +1 -0
  320. package/dist/workspace/snapshot-manager.d.ts +11 -5
  321. package/dist/workspace/snapshot-manager.js +74 -17
  322. package/dist/workspace/snapshot-manager.js.map +1 -1
  323. package/dist/workspace/template-telemetry.d.ts +4 -4
  324. package/dist/workspace/template-telemetry.js +18 -6
  325. package/dist/workspace/template-telemetry.js.map +1 -1
  326. package/package.json +13 -16
  327. package/skills/data-table-manager/SKILL.md +119 -0
  328. package/skills/data-table-manager/references/data-table-playbook.md +212 -0
  329. package/dist/agent/register-with-mastra.d.ts +0 -3
  330. package/dist/agent/register-with-mastra.js +0 -15
  331. package/dist/agent/register-with-mastra.js.map +0 -1
  332. package/dist/compaction/compaction-helper.d.ts +0 -9
  333. package/dist/compaction/compaction-helper.js +0 -58
  334. package/dist/compaction/compaction-helper.js.map +0 -1
  335. package/dist/compaction/index.d.ts +0 -2
  336. package/dist/compaction/index.js +0 -6
  337. package/dist/compaction/index.js.map +0 -1
  338. package/dist/memory/memory-config.d.ts +0 -3
  339. package/dist/memory/memory-config.js +0 -27
  340. package/dist/memory/memory-config.js.map +0 -1
  341. package/dist/runtime/builder-sandbox-session-registry.d.ts +0 -47
  342. package/dist/runtime/builder-sandbox-session-registry.js +0 -166
  343. package/dist/runtime/builder-sandbox-session-registry.js.map +0 -1
  344. package/dist/storage/mastra-iteration-log-storage.js.map +0 -1
  345. package/dist/storage/mastra-task-storage.js.map +0 -1
  346. package/dist/tools/orchestration/data-table-agent.prompt.d.ts +0 -1
  347. package/dist/tools/orchestration/data-table-agent.prompt.js +0 -47
  348. package/dist/tools/orchestration/data-table-agent.prompt.js.map +0 -1
  349. package/dist/tools/orchestration/data-table-agent.tool.d.ts +0 -26
  350. package/dist/tools/orchestration/data-table-agent.tool.js +0 -174
  351. package/dist/tools/orchestration/data-table-agent.tool.js.map +0 -1
  352. package/dist/tools/orchestration/research-agent-prompt.d.ts +0 -1
  353. package/dist/tools/orchestration/research-agent-prompt.js +0 -26
  354. package/dist/tools/orchestration/research-agent-prompt.js.map +0 -1
  355. package/dist/tools/orchestration/research-with-agent.tool.d.ts +0 -30
  356. package/dist/tools/orchestration/research-with-agent.tool.js +0 -179
  357. package/dist/tools/orchestration/research-with-agent.tool.js.map +0 -1
  358. package/dist/workspace/builder-sandbox-factory.d.ts +0 -30
  359. package/dist/workspace/builder-sandbox-factory.js +0 -289
  360. package/dist/workspace/builder-sandbox-factory.js.map +0 -1
  361. package/dist/workspace/guarded-filesystem.d.ts +0 -10
  362. package/dist/workspace/guarded-filesystem.js +0 -136
  363. package/dist/workspace/guarded-filesystem.js.map +0 -1
@@ -0,0 +1,289 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateWorkflowConfig = validateWorkflowConfig;
4
+ const workflow_sdk_1 = require("@n8n/workflow-sdk");
5
+ const n8n_workflow_1 = require("n8n-workflow");
6
+ function createLookupCache() {
7
+ return { byType: new Map() };
8
+ }
9
+ async function listCredentialsByType(context, cache, credentialType) {
10
+ let promise = cache.byType.get(credentialType);
11
+ if (!promise) {
12
+ promise = context.credentialService
13
+ .list({ type: credentialType })
14
+ .then((creds) => creds.map((c) => ({ id: c.id, name: c.name })))
15
+ .catch(() => []);
16
+ cache.byType.set(credentialType, promise);
17
+ }
18
+ return await promise;
19
+ }
20
+ function selectedCredsAreUnusable(node, credentialType) {
21
+ return !node.credentials || !Object.keys(node.credentials).includes(credentialType);
22
+ }
23
+ function selectedCredsDoNotExist(node, credentialType, stored) {
24
+ const selected = node.credentials?.[credentialType];
25
+ if (!selected?.id)
26
+ return false;
27
+ return !stored.some((s) => s.id === selected.id);
28
+ }
29
+ function hasProxyAuth(node) {
30
+ const params = (node.parameters ?? {});
31
+ return Object.keys(params).includes('nodeCredentialType');
32
+ }
33
+ function notSetIssue(credentialType, nodeTypeDisplayName) {
34
+ return {
35
+ [credentialType]: [`Credentials for ${nodeTypeDisplayName} are not set.`],
36
+ };
37
+ }
38
+ function notIdentifiedIssue(credentialType, credentialName, credentialTypeDisplayName) {
39
+ return {
40
+ [credentialType]: [
41
+ `Credentials with name ${credentialName} exist for ${credentialTypeDisplayName}.`,
42
+ 'Credentials are not clearly identified. Please select the correct credentials.',
43
+ ],
44
+ };
45
+ }
46
+ function doNotExistIssue(credentialType, credentialName, credentialTypeDisplayName) {
47
+ return {
48
+ [credentialType]: [
49
+ `Credentials with name ${credentialName} do not exist for ${credentialTypeDisplayName}.`,
50
+ 'You can create credentials with the exact name and then they get auto-selected on refresh.',
51
+ ],
52
+ };
53
+ }
54
+ async function computeCredentialIssues(context, cache, node, nodeDesc, usedCredentialIds) {
55
+ if (node.disabled)
56
+ return null;
57
+ if (!nodeDesc.credentials || nodeDesc.credentials.length === 0)
58
+ return null;
59
+ const parameters = (node.parameters ?? {});
60
+ const typeVersion = node.typeVersion ?? 1;
61
+ const authentication = parameters.authentication;
62
+ const genericAuthType = parameters.genericAuthType;
63
+ const nodeCredentialType = parameters.nodeCredentialType;
64
+ if (authentication === 'genericCredentialType' &&
65
+ typeof genericAuthType === 'string' &&
66
+ genericAuthType !== '' &&
67
+ selectedCredsAreUnusable(node, genericAuthType)) {
68
+ return { credentials: notSetIssue(genericAuthType, nodeDesc.displayName) };
69
+ }
70
+ if (hasProxyAuth(node) &&
71
+ authentication === 'predefinedCredentialType' &&
72
+ typeof nodeCredentialType === 'string' &&
73
+ nodeCredentialType !== '' &&
74
+ node.credentials !== undefined) {
75
+ const stored = await listCredentialsByType(context, cache, nodeCredentialType);
76
+ const selectedId = node.credentials[nodeCredentialType]?.id;
77
+ const isCredentialUsedInWorkflow = typeof selectedId === 'string' && usedCredentialIds.has(selectedId);
78
+ if (selectedCredsDoNotExist(node, nodeCredentialType, stored) && !isCredentialUsedInWorkflow) {
79
+ return { credentials: notSetIssue(nodeCredentialType, nodeDesc.displayName) };
80
+ }
81
+ }
82
+ if (hasProxyAuth(node) &&
83
+ authentication === 'predefinedCredentialType' &&
84
+ typeof nodeCredentialType === 'string' &&
85
+ nodeCredentialType !== '' &&
86
+ selectedCredsAreUnusable(node, nodeCredentialType)) {
87
+ return { credentials: notSetIssue(nodeCredentialType, nodeDesc.displayName) };
88
+ }
89
+ const foundIssues = {};
90
+ for (const credentialTypeDescription of nodeDesc.credentials) {
91
+ if (credentialTypeDescription.displayOptions) {
92
+ const visible = (0, workflow_sdk_1.matchesDisplayOptions)({ parameters, nodeVersion: typeVersion }, credentialTypeDescription.displayOptions);
93
+ if (!visible)
94
+ continue;
95
+ }
96
+ const credName = credentialTypeDescription.name;
97
+ const credentialTypeDisplayName = credName;
98
+ const selected = node.credentials?.[credName];
99
+ if (!selected) {
100
+ if (credentialTypeDescription.required) {
101
+ Object.assign(foundIssues, notSetIssue(credName, nodeDesc.displayName));
102
+ }
103
+ continue;
104
+ }
105
+ if (typeof selected === 'object' &&
106
+ '__aiGatewayManaged' in selected &&
107
+ selected.__aiGatewayManaged === true) {
108
+ continue;
109
+ }
110
+ const selectedRef = typeof selected === 'string'
111
+ ? { id: null, name: selected }
112
+ : { id: selected.id ?? null, name: selected.name };
113
+ const userCredentials = await listCredentialsByType(context, cache, credName);
114
+ if (selectedRef.id) {
115
+ const idMatch = userCredentials.find((c) => c.id === selectedRef.id);
116
+ if (idMatch)
117
+ continue;
118
+ }
119
+ const nameMatches = userCredentials.filter((c) => c.name === selectedRef.name);
120
+ if (nameMatches.length > 1) {
121
+ Object.assign(foundIssues, notIdentifiedIssue(credName, selectedRef.name, credentialTypeDisplayName));
122
+ continue;
123
+ }
124
+ if (nameMatches.length === 0) {
125
+ const isUsedInWorkflow = typeof selectedRef.id === 'string' && usedCredentialIds.has(selectedRef.id);
126
+ if (!isUsedInWorkflow) {
127
+ Object.assign(foundIssues, doNotExistIssue(credName, selectedRef.name, credentialTypeDisplayName));
128
+ }
129
+ }
130
+ }
131
+ if (Object.keys(foundIssues).length === 0)
132
+ return null;
133
+ return { credentials: foundIssues };
134
+ }
135
+ async function computeInputIssues(context, workflowJson, connectionsByDestination, nodeName) {
136
+ if (!context.nodeService.getResolvedNodeInputs)
137
+ return null;
138
+ const inputs = await context.nodeService
139
+ .getResolvedNodeInputs(workflowJson, nodeName)
140
+ .catch(() => []);
141
+ const foundIssues = {};
142
+ for (const input of inputs) {
143
+ if (typeof input === 'string')
144
+ continue;
145
+ if (input.required !== true)
146
+ continue;
147
+ const parents = (0, n8n_workflow_1.getParentNodes)(connectionsByDestination, nodeName, input.type, 1);
148
+ if (parents.length === 0) {
149
+ foundIssues[input.type] = [
150
+ `No node connected to required input "${input.displayName ?? input.type}"`,
151
+ ];
152
+ }
153
+ }
154
+ if (Object.keys(foundIssues).length === 0)
155
+ return null;
156
+ return { input: foundIssues };
157
+ }
158
+ function getFirstExecutionError(taskData) {
159
+ if (!taskData)
160
+ return null;
161
+ for (const task of taskData) {
162
+ if (task.error !== undefined) {
163
+ return task.error.message ?? 'Unknown error';
164
+ }
165
+ }
166
+ return null;
167
+ }
168
+ async function computeNodeIssues(context, cache, workflowJson, connectionsByDestination, node, usedCredentialIds, latestRunData, executionErrors, allowSendingParameterValues, ignoreIssues) {
169
+ if (node.disabled)
170
+ return null;
171
+ if (!node.name)
172
+ return null;
173
+ const typeVersion = node.typeVersion ?? 1;
174
+ const parameters = (node.parameters ?? {});
175
+ const nodeDesc = await context.nodeService
176
+ .getDescription(node.type, typeVersion)
177
+ .catch(() => undefined);
178
+ if (!nodeDesc) {
179
+ if (ignoreIssues.has('typeUnknown'))
180
+ return null;
181
+ return { typeUnknown: true };
182
+ }
183
+ let issues = null;
184
+ if (!ignoreIssues.has('parameters') && context.nodeService.getParameterIssues) {
185
+ const parameterIssues = await context.nodeService
186
+ .getParameterIssues(node.type, typeVersion, parameters)
187
+ .catch(() => ({}));
188
+ if (Object.keys(parameterIssues).length > 0) {
189
+ issues = { parameters: parameterIssues };
190
+ }
191
+ }
192
+ if (!ignoreIssues.has('credentials')) {
193
+ const credentialIssues = await computeCredentialIssues(context, cache, node, nodeDesc, usedCredentialIds);
194
+ if (credentialIssues) {
195
+ if (issues === null) {
196
+ issues = credentialIssues;
197
+ }
198
+ else {
199
+ n8n_workflow_1.NodeHelpers.mergeIssues(issues, credentialIssues);
200
+ }
201
+ }
202
+ }
203
+ if (!ignoreIssues.has('input')) {
204
+ const inputIssues = await computeInputIssues(context, workflowJson, connectionsByDestination, node.name);
205
+ if (inputIssues?.input) {
206
+ issues = issues ?? {};
207
+ issues.input = inputIssues.input;
208
+ }
209
+ }
210
+ if (!ignoreIssues.has('execution') && latestRunData) {
211
+ const errorMessage = getFirstExecutionError(latestRunData[node.name]);
212
+ if (errorMessage !== null) {
213
+ issues = issues ?? {};
214
+ issues.execution = true;
215
+ if (allowSendingParameterValues) {
216
+ executionErrors[node.name] = errorMessage;
217
+ }
218
+ }
219
+ }
220
+ return issues;
221
+ }
222
+ function formatSummaryLines(nodeName, issues, executionErrors, pushTo) {
223
+ if (issues.typeUnknown) {
224
+ pushTo.push(`${nodeName}: typeUnknown: Unknown node type`);
225
+ }
226
+ for (const category of ['parameters', 'credentials', 'input']) {
227
+ const slice = issues[category];
228
+ if (!slice || typeof slice !== 'object')
229
+ continue;
230
+ for (const [key, messages] of Object.entries(slice)) {
231
+ if (!Array.isArray(messages))
232
+ continue;
233
+ for (const message of messages) {
234
+ if (typeof message !== 'string')
235
+ continue;
236
+ pushTo.push(`${nodeName}: ${category}.${key}: ${message}`);
237
+ }
238
+ }
239
+ }
240
+ if (issues.execution === true) {
241
+ const detail = executionErrors[nodeName];
242
+ pushTo.push(detail
243
+ ? `${nodeName}: execution: A previous execution of this node failed: ${detail}`
244
+ : `${nodeName}: execution: A previous execution of this node failed`);
245
+ }
246
+ }
247
+ async function validateWorkflowConfig(context, input) {
248
+ if (!input.workflowId && !input.workflow) {
249
+ throw new Error('validateWorkflowConfig requires either workflowId or workflow');
250
+ }
251
+ if (input.workflowId && input.workflow) {
252
+ throw new Error('validateWorkflowConfig accepts workflowId OR workflow, not both');
253
+ }
254
+ const workflowJson = input.workflow ?? (await context.workflowService.getAsWorkflowJSON(input.workflowId));
255
+ const ignoreIssues = new Set(input.ignoreIssues ?? []);
256
+ const cache = createLookupCache();
257
+ const usedCredentialIds = new Set();
258
+ const connectionsByDestination = (0, n8n_workflow_1.mapConnectionsByDestination)((workflowJson.connections ?? {}));
259
+ let latestRunData = null;
260
+ if (input.workflowId &&
261
+ !ignoreIssues.has('execution') &&
262
+ context.workflowService.getLatestRunData) {
263
+ latestRunData = await context.workflowService
264
+ .getLatestRunData(input.workflowId)
265
+ .catch(() => null);
266
+ }
267
+ const executionErrors = {};
268
+ const allowSendingParameterValues = context.allowSendingParameterValues !== false;
269
+ const issues = {};
270
+ const summary = [];
271
+ const nodes = workflowJson.nodes ?? [];
272
+ const perNode = await Promise.all(nodes.map(async (node) => {
273
+ const nodeIssues = await computeNodeIssues(context, cache, workflowJson, connectionsByDestination, node, usedCredentialIds, latestRunData, executionErrors, allowSendingParameterValues, ignoreIssues);
274
+ return { node, nodeIssues };
275
+ }));
276
+ for (const { node, nodeIssues } of perNode) {
277
+ if (!nodeIssues || !node.name)
278
+ continue;
279
+ issues[node.name] = nodeIssues;
280
+ formatSummaryLines(node.name, nodeIssues, executionErrors, summary);
281
+ }
282
+ return {
283
+ ...(input.workflowId ? { workflowId: input.workflowId } : {}),
284
+ issues,
285
+ summary,
286
+ valid: summary.length === 0,
287
+ };
288
+ }
289
+ //# sourceMappingURL=validate-workflow.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-workflow.service.js","sourceRoot":"","sources":["../../../src/tools/workflows/validate-workflow.service.ts"],"names":[],"mappings":";;AA8bA,wDAwFC;AA/gBD,oDAA0D;AAS1D,+CAAwF;AAwBxF,SAAS,iBAAiB;IACzB,OAAO,EAAE,MAAM,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;AAC9B,CAAC;AAED,KAAK,UAAU,qBAAqB,CACnC,OAA0B,EAC1B,KAA4B,EAC5B,cAAsB;IAEtB,IAAI,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAC/C,IAAI,CAAC,OAAO,EAAE,CAAC;QAId,OAAO,GAAG,OAAO,CAAC,iBAAiB;aACjC,IAAI,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;aAC9B,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;aAC/D,KAAK,CAAC,GAAG,EAAE,CAAC,EAAyC,CAAC,CAAC;QACzD,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC;IACD,OAAO,MAAM,OAAO,CAAC;A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
1
  import { z } from 'zod';
2
+ import { type SandboxWorkspace } from '../../workspace/sandbox-fs';
3
3
  export declare const writeSandboxFileInputSchema: z.ZodObject<{
4
4
  filePath: z.ZodString;
5
5
  content: z.ZodString;
@@ -10,4 +10,4 @@ export declare const writeSandboxFileInputSchema: z.ZodObject<{
10
10
  content: string;
11
11
  filePath: string;
12
12
  }>;
13
- export declare function createWriteSandboxFileTool(workspace: Workspace): import("@mastra/core/tools").Tool<InferPublicSchema<T>, InferPublicSchema<T>, InferPublicSchema<T>, InferPublicSchema<T>, import("@mastra/core/tools").ToolExecutionContext<InferPublicSchema<T>, InferPublicSchema<T>, unknown>, "write-file", unknown>;
13
+ export declare function createWriteSandboxFileTool(workspace: SandboxWorkspace): import("@n8n/agents").BuiltTool;
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.writeSandboxFileInputSchema = void 0;
7
7
  exports.createWriteSandboxFileTool = createWriteSandboxFileTool;
8
- const tools_1 = require("@mastra/core/tools");
8
+ const agents_1 = require("@n8n/agents");
9
9
  const node_path_1 = __importDefault(require("node:path"));
10
10
  const zod_1 = require("zod");
11
11
  const sandbox_fs_1 = require("../../workspace/sandbox-fs");
@@ -17,39 +17,38 @@ exports.writeSandboxFileInputSchema = zod_1.z.object({
17
17
  content: zod_1.z.string().describe('The file content to write'),
18
18
  });
19
19
  function createWriteSandboxFileTool(workspace) {
20
- return (0, tools_1.createTool)({
21
- id: 'write-file',
22
- description: 'Write content to a file in the sandbox workspace. Creates parent directories automatically. ' +
23
- 'Use this to write workflow code to ~/workspace/src/workflow.ts.',
24
- inputSchema: exports.writeSandboxFileInputSchema,
25
- outputSchema: zod_1.z.object({
26
- success: zod_1.z.boolean(),
27
- path: zod_1.z.string(),
28
- error: zod_1.z.string().optional(),
29
- }),
30
- execute: async ({ filePath, content }) => {
31
- try {
32
- const root = await (0, sandbox_setup_1.getWorkspaceRoot)(workspace);
33
- const absPath = filePath.startsWith('/') ? filePath : `${root}/${filePath}`;
34
- const normalized = node_path_1.default.posix.normalize(absPath);
35
- if (normalized !== root && !normalized.startsWith(root + '/')) {
36
- return {
37
- success: false,
38
- path: filePath,
39
- error: `Path must be within workspace root (${root})`,
40
- };
41
- }
42
- await (0, sandbox_fs_1.writeFileViaSandbox)(workspace, normalized, content);
43
- return { success: true, path: normalized };
44
- }
45
- catch (error) {
20
+ return new agents_1.Tool('write-file')
21
+ .description('Write content to a file in the sandbox workspace. Creates parent directories automatically. ' +
22
+ 'Use this to write workflow code to ~/workspace/src/workflow.ts.')
23
+ .input(exports.writeSandboxFileInputSchema)
24
+ .output(zod_1.z.object({
25
+ success: zod_1.z.boolean(),
26
+ path: zod_1.z.string(),
27
+ error: zod_1.z.string().optional(),
28
+ }))
29
+ .handler(async ({ filePath, content }) => {
30
+ try {
31
+ const root = await (0, sandbox_setup_1.getWorkspaceRoot)(workspace);
32
+ const absPath = filePath.startsWith('/') ? filePath : `${root}/${filePath}`;
33
+ const normalized = node_path_1.default.posix.normalize(absPath);
34
+ if (normalized !== root && !normalized.startsWith(root + '/')) {
46
35
  return {
47
36
  success: false,
48
37
  path: filePath,
49
- error: error instanceof Error ? error.message : 'Failed to write file',
38
+ error: `Path must be within workspace root (${root})`,
50
39
  };
51
40
  }
52
- },
53
- });
41
+ await (0, sandbox_fs_1.writeFileViaSandbox)(workspace, normalized, content);
42
+ return { success: true, path: normalized };
43
+ }
44
+ catch (error) {
45
+ return {
46
+ success: false,
47
+ path: filePath,
48
+ error: error instanceof Error ? error.message : 'Failed to write file',
49
+ };
50
+ }
51
+ })
52
+ .build();
54
53
  }
55
54
  //# sourceMappingURL=write-sandbox-file.tool.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"write-sandbox-file.tool.js","sourceRoot":"","sources":["../../../src/tools/workflows/write-sandbox-file.tool.ts"],"names":[],"mappings":";;;;;;AAuBA,gEAwCC;AAvDD,8CAAgD;AAEhD,0DAA6B;A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ACH,CAAC;gBAED,MAAM,IAAA,gCAAmB,EAAC,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;gBAC1D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;YAC5C,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,OAAO;oBACN,OAAO,EAAE,KAAK;oBACd,IAAI,EAAE,QAAQ;oBACd,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,sBAAsB;iBACtE,CAAC;YACH,CAAC;QACF,CAAC;KACD,CAAC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"write-sandbox-file.tool.js","sourceRoot":"","sources":["../../../src/tools/workflows/write-sandbox-file.tool.ts"],"names":[],"mappings":";;;;;;AAsBA,gEA0CC;AAxDD,wCAAmC;AACnC,0DAA6B;AAC7B,6BAAwB;AAExB,2DAAwF;AACxF,iEAAiE;AAEpD,QAAA,2BAA2B,GAAG,OAAC,CAAC,MAAM,CAAC;IACnD,QAAQ,EAAE,OAAC;SACT,MAAM,EAAE;SACR,QAAQ,CAAC,yEAAyE,CAAC;IACrF,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;CACzD,CAAC,CAAC;AAEH,SAAgB,0BAA0B,CAAC,SAA2B;IACrE,OAAO,IAAI,aAAI,CAAC,YAAY,CAAC;SAC3B,WAAW,CACX,8FAA8F;QAC7F,iEAAiE,CAClE;SACA,KAAK,CAAC,mCAA2B,CAAC;SAClC,MAAM,CACN,OAAC,CAAC,MAAM,CAAC;QACR,OAAO,EAAE,OAAC,CAAC,OAAO,EAAE;QACpB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;QAChB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC5B,CAAC,CACF;SACA,OAAO,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAA+C,EAAE,EAAE;QACrF,IAAI,CAAC;YACJ,MAAM,IAAI,GAAG,MAAM,IAAA,gCAAgB,EAAC,SAAS,CAAC,CAAC;YAG/C,MAAM,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,QAAQ,EAAE,CAAC;YAG5E,MAAM,UAAU,GAAG,mBAAI,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;YACjD,IAAI,UAAU,KAAK,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,GAAG,GAAG,CAAC,EAAE,CAAC;gBAC/D,OAAO;oBACN,OAAO,EAAE,KAAK;oBACd,IAAI,EAAE,QAAQ;oBACd,KAAK,EAAE,uCAAuC,IAAI,GAAG;iBACrD,CAAC;YACH,CAAC;YAED,MAAM,IAAA,gCAAmB,EAAC,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;YAC1D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;QAC5C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO;gBACN,OAAO,EAAE,KAAK;gBACd,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,sBAAsB;aACtE,CAAC;QACH,CAAC;IACF,CAAC,CAAC;SACD,KAAK,EAAE,CAAC;AACX,CAAC"}
@@ -1,8 +1,11 @@
1
1
  import type { InstanceAiContext } from '../types';
2
- export type WorkflowAction = 'list' | 'get' | 'get-as-code' | 'delete' | 'unarchive' | 'setup' | 'publish' | 'unpublish' | 'list-versions' | 'get-version' | 'restore-version' | 'update-version';
2
+ export type WorkflowAction = 'list' | 'get' | 'get-json' | 'get-as-code' | 'delete' | 'unarchive' | 'setup' | 'validate' | 'update' | 'publish' | 'unpublish' | 'list-versions' | 'get-version' | 'restore-version' | 'update-version';
3
3
  export interface WorkflowsToolOptions {
4
4
  allowedActions?: readonly WorkflowAction[];
5
5
  descriptionPrefix?: string;
6
6
  descriptionSuffix?: string;
7
+ surface?: 'full' | 'orchestrator';
7
8
  }
8
- export declare function createWorkflowsTool(context: InstanceAiContext, options?: WorkflowsToolOptions): import("@mastra/core/tools").Tool<any, InferPublicSchema<T>, InferPublicSchema<T>, InferPublicSchema<T>, import("@mastra/core/tools").ToolExecutionContext<InferPublicSchema<T>, InferPublicSchema<T>, unknown>, "workflows", unknown>;
9
+ type WorkflowsToolOptionsInput = WorkflowsToolOptions | 'full' | 'orchestrator';
10
+ export declare function createWorkflowsTool(context: InstanceAiContext, optionsInput?: WorkflowsToolOptionsInput): import("@n8n/agents").BuiltTool;
11
+ export {};