@n8n/instance-ai 1.4.1 → 1.6.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 (266) 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 -73
  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-debriefing.d.ts +2 -2
  13. package/dist/agent/sub-agent-factory.d.ts +1 -0
  14. package/dist/agent/sub-agent-factory.js +1 -0
  15. package/dist/agent/sub-agent-factory.js.map +1 -1
  16. package/dist/agent/system-prompt.d.ts +1 -1
  17. package/dist/agent/system-prompt.js +46 -104
  18. package/dist/agent/system-prompt.js.map +1 -1
  19. package/dist/build.tsbuildinfo +1 -1
  20. package/dist/constants/model-settings.d.ts +3 -0
  21. package/dist/constants/model-settings.js +7 -0
  22. package/dist/constants/model-settings.js.map +1 -0
  23. package/dist/domain-access/domain-access-tracker.d.ts +3 -0
  24. package/dist/domain-access/domain-access-tracker.js +16 -0
  25. package/dist/domain-access/domain-access-tracker.js.map +1 -1
  26. package/dist/domain-access/domain-gating.d.ts +35 -6
  27. package/dist/domain-access/domain-gating.js +47 -1
  28. package/dist/domain-access/domain-gating.js.map +1 -1
  29. package/dist/domain-access/index.d.ts +1 -1
  30. package/dist/domain-access/index.js +3 -1
  31. package/dist/domain-access/index.js.map +1 -1
  32. package/dist/index.d.ts +14 -6
  33. package/dist/index.js +19 -2
  34. package/dist/index.js.map +1 -1
  35. package/dist/logger.d.ts +6 -0
  36. package/dist/mcp/mcp-client-manager.d.ts +18 -2
  37. package/dist/mcp/mcp-client-manager.js +124 -20
  38. package/dist/mcp/mcp-client-manager.js.map +1 -1
  39. package/dist/parsers/docx-parser.d.ts +6 -0
  40. package/dist/parsers/docx-parser.js +65 -0
  41. package/dist/parsers/docx-parser.js.map +1 -0
  42. package/dist/parsers/html-parser.d.ts +7 -0
  43. package/dist/parsers/html-parser.js +67 -0
  44. package/dist/parsers/html-parser.js.map +1 -0
  45. package/dist/parsers/index.d.ts +4 -0
  46. package/dist/parsers/index.js +16 -0
  47. package/dist/parsers/index.js.map +1 -0
  48. package/dist/parsers/pdf-parser.d.ts +7 -0
  49. package/dist/parsers/pdf-parser.js +72 -0
  50. package/dist/parsers/pdf-parser.js.map +1 -0
  51. package/dist/parsers/structured-file-parser.d.ts +8 -3
  52. package/dist/parsers/structured-file-parser.js +36 -4
  53. package/dist/parsers/structured-file-parser.js.map +1 -1
  54. package/dist/parsers/validate-attachments.d.ts +14 -0
  55. package/dist/parsers/validate-attachments.js +61 -0
  56. package/dist/parsers/validate-attachments.js.map +1 -0
  57. package/dist/parsers/xlsx-parser.d.ts +2 -0
  58. package/dist/parsers/xlsx-parser.js +75 -0
  59. package/dist/parsers/xlsx-parser.js.map +1 -0
  60. package/dist/planned-tasks/planned-task-permissions.d.ts +2 -0
  61. package/dist/planned-tasks/planned-task-permissions.js +8 -2
  62. package/dist/planned-tasks/planned-task-permissions.js.map +1 -1
  63. package/dist/planned-tasks/planned-task-service.d.ts +14 -1
  64. package/dist/planned-tasks/planned-task-service.js +138 -2
  65. package/dist/planned-tasks/planned-task-service.js.map +1 -1
  66. package/dist/runtime/background-task-manager.d.ts +32 -1
  67. package/dist/runtime/background-task-manager.js +134 -4
  68. package/dist/runtime/background-task-manager.js.map +1 -1
  69. package/dist/runtime/builder-sandbox-session-registry.d.ts +45 -0
  70. package/dist/runtime/builder-sandbox-session-registry.js +159 -0
  71. package/dist/runtime/builder-sandbox-session-registry.js.map +1 -0
  72. package/dist/runtime/liveness-policy.d.ts +40 -0
  73. package/dist/runtime/liveness-policy.js +74 -0
  74. package/dist/runtime/liveness-policy.js.map +1 -0
  75. package/dist/runtime/resumable-stream-executor.d.ts +1 -0
  76. package/dist/runtime/resumable-stream-executor.js +1 -0
  77. package/dist/runtime/resumable-stream-executor.js.map +1 -1
  78. package/dist/runtime/run-state-registry.d.ts +21 -5
  79. package/dist/runtime/run-state-registry.js +109 -7
  80. package/dist/runtime/run-state-registry.js.map +1 -1
  81. package/dist/runtime/stream-runner.d.ts +3 -0
  82. package/dist/runtime/stream-runner.js +3 -0
  83. package/dist/runtime/stream-runner.js.map +1 -1
  84. package/dist/runtime/terminal-response-guard.d.ts +30 -0
  85. package/dist/runtime/terminal-response-guard.js +149 -0
  86. package/dist/runtime/terminal-response-guard.js.map +1 -0
  87. package/dist/storage/agent-tree-snapshot.d.ts +2 -0
  88. package/dist/storage/index.d.ts +2 -0
  89. package/dist/storage/index.js +3 -1
  90. package/dist/storage/index.js.map +1 -1
  91. package/dist/storage/planned-task-storage.js +2 -1
  92. package/dist/storage/planned-task-storage.js.map +1 -1
  93. package/dist/storage/terminal-outcome-storage.d.ts +48 -0
  94. package/dist/storage/terminal-outcome-storage.js +84 -0
  95. package/dist/storage/terminal-outcome-storage.js.map +1 -0
  96. package/dist/storage/workflow-loop-storage.d.ts +442 -16
  97. package/dist/stream/consume-with-hitl.d.ts +2 -0
  98. package/dist/stream/consume-with-hitl.js +2 -0
  99. package/dist/stream/consume-with-hitl.js.map +1 -1
  100. package/dist/stream/map-chunk.js +6 -0
  101. package/dist/stream/map-chunk.js.map +1 -1
  102. package/dist/tools/attachments/parse-file.tool.d.ts +46 -34
  103. package/dist/tools/attachments/parse-file.tool.js +115 -56
  104. package/dist/tools/attachments/parse-file.tool.js.map +1 -1
  105. package/dist/tools/credentials.tool.d.ts +120 -1
  106. package/dist/tools/credentials.tool.js +65 -12
  107. package/dist/tools/credentials.tool.js.map +1 -1
  108. package/dist/tools/data-tables.tool.d.ts +1 -0
  109. package/dist/tools/data-tables.tool.js +64 -24
  110. package/dist/tools/data-tables.tool.js.map +1 -1
  111. package/dist/tools/executions.tool.js +4 -1
  112. package/dist/tools/executions.tool.js.map +1 -1
  113. package/dist/tools/filesystem/create-tools-from-mcp-server.d.ts +2 -1
  114. package/dist/tools/filesystem/create-tools-from-mcp-server.js +74 -5
  115. package/dist/tools/filesystem/create-tools-from-mcp-server.js.map +1 -1
  116. package/dist/tools/index.d.ts +4 -24
  117. package/dist/tools/index.js +23 -7
  118. package/dist/tools/index.js.map +1 -1
  119. package/dist/tools/nodes.tool.js +15 -15
  120. package/dist/tools/nodes.tool.js.map +1 -1
  121. package/dist/tools/orchestration/add-plan-item.tool.js +3 -1
  122. package/dist/tools/orchestration/add-plan-item.tool.js.map +1 -1
  123. package/dist/tools/orchestration/blueprint-accumulator.d.ts +4 -1
  124. package/dist/tools/orchestration/blueprint-accumulator.js +28 -0
  125. package/dist/tools/orchestration/blueprint-accumulator.js.map +1 -1
  126. package/dist/tools/orchestration/blueprint.schema.d.ts +61 -16
  127. package/dist/tools/orchestration/blueprint.schema.js +15 -1
  128. package/dist/tools/orchestration/blueprint.schema.js.map +1 -1
  129. package/dist/tools/orchestration/browser-credential-setup.nudge.d.ts +5 -0
  130. package/dist/tools/orchestration/browser-credential-setup.nudge.js +11 -0
  131. package/dist/tools/orchestration/browser-credential-setup.nudge.js.map +1 -0
  132. package/dist/tools/orchestration/browser-credential-setup.prompt.js +2 -1
  133. package/dist/tools/orchestration/browser-credential-setup.prompt.js.map +1 -1
  134. package/dist/tools/orchestration/browser-credential-setup.tool.js +55 -7
  135. package/dist/tools/orchestration/browser-credential-setup.tool.js.map +1 -1
  136. package/dist/tools/orchestration/build-workflow-agent.prompt.js +86 -60
  137. package/dist/tools/orchestration/build-workflow-agent.prompt.js.map +1 -1
  138. package/dist/tools/orchestration/build-workflow-agent.tool.d.ts +56 -3
  139. package/dist/tools/orchestration/build-workflow-agent.tool.js +1020 -300
  140. package/dist/tools/orchestration/build-workflow-agent.tool.js.map +1 -1
  141. package/dist/tools/orchestration/builder-memory-compaction.d.ts +38 -0
  142. package/dist/tools/orchestration/builder-memory-compaction.js +146 -0
  143. package/dist/tools/orchestration/builder-memory-compaction.js.map +1 -0
  144. package/dist/tools/orchestration/complete-checkpoint.tool.d.ts +2 -0
  145. package/dist/tools/orchestration/complete-checkpoint.tool.js +76 -0
  146. package/dist/tools/orchestration/complete-checkpoint.tool.js.map +1 -0
  147. package/dist/tools/orchestration/data-table-agent.tool.js +34 -17
  148. package/dist/tools/orchestration/data-table-agent.tool.js.map +1 -1
  149. package/dist/tools/orchestration/delegate.tool.js +34 -16
  150. package/dist/tools/orchestration/delegate.tool.js.map +1 -1
  151. package/dist/tools/orchestration/plan-agent-prompt.d.ts +1 -1
  152. package/dist/tools/orchestration/plan-agent-prompt.js +7 -0
  153. package/dist/tools/orchestration/plan-agent-prompt.js.map +1 -1
  154. package/dist/tools/orchestration/plan-with-agent.tool.d.ts +23 -0
  155. package/dist/tools/orchestration/plan-with-agent.tool.js +314 -13
  156. package/dist/tools/orchestration/plan-with-agent.tool.js.map +1 -1
  157. package/dist/tools/orchestration/plan.tool.js +17 -1
  158. package/dist/tools/orchestration/plan.tool.js.map +1 -1
  159. package/dist/tools/orchestration/report-verification-verdict.tool.d.ts +40 -2
  160. package/dist/tools/orchestration/report-verification-verdict.tool.js +85 -6
  161. package/dist/tools/orchestration/report-verification-verdict.tool.js.map +1 -1
  162. package/dist/tools/orchestration/research-with-agent.tool.js +33 -16
  163. package/dist/tools/orchestration/research-with-agent.tool.js.map +1 -1
  164. package/dist/tools/orchestration/tracing-utils.js +8 -0
  165. package/dist/tools/orchestration/tracing-utils.js.map +1 -1
  166. package/dist/tools/orchestration/verify-built-workflow.tool.d.ts +8 -2
  167. package/dist/tools/orchestration/verify-built-workflow.tool.js +476 -6
  168. package/dist/tools/orchestration/verify-built-workflow.tool.js.map +1 -1
  169. package/dist/tools/research.tool.js +56 -10
  170. package/dist/tools/research.tool.js.map +1 -1
  171. package/dist/tools/shared/ask-user.tool.d.ts +1 -0
  172. package/dist/tools/shared/ask-user.tool.js +3 -2
  173. package/dist/tools/shared/ask-user.tool.js.map +1 -1
  174. package/dist/tools/templates.tool.js +5 -90
  175. package/dist/tools/templates.tool.js.map +1 -1
  176. package/dist/tools/web-research/sanitize-web-content.d.ts +0 -1
  177. package/dist/tools/web-research/sanitize-web-content.js +0 -9
  178. package/dist/tools/web-research/sanitize-web-content.js.map +1 -1
  179. package/dist/tools/workflows/apply-workflow-credentials.tool.d.ts +2 -2
  180. package/dist/tools/workflows/build-workflow.tool.d.ts +2 -2
  181. package/dist/tools/workflows/build-workflow.tool.js +6 -4
  182. package/dist/tools/workflows/build-workflow.tool.js.map +1 -1
  183. package/dist/tools/workflows/materialize-node-type.tool.d.ts +8 -8
  184. package/dist/tools/workflows/resolve-credentials.d.ts +9 -4
  185. package/dist/tools/workflows/resolve-credentials.js +59 -27
  186. package/dist/tools/workflows/resolve-credentials.js.map +1 -1
  187. package/dist/tools/workflows/setup-workflow.schema.d.ts +40 -0
  188. package/dist/tools/workflows/setup-workflow.service.d.ts +5 -1
  189. package/dist/tools/workflows/setup-workflow.service.js +71 -5
  190. package/dist/tools/workflows/setup-workflow.service.js.map +1 -1
  191. package/dist/tools/workflows/submit-workflow-identity.d.ts +25 -3
  192. package/dist/tools/workflows/submit-workflow-identity.js +92 -5
  193. package/dist/tools/workflows/submit-workflow-identity.js.map +1 -1
  194. package/dist/tools/workflows/submit-workflow.tool.d.ts +60 -6
  195. package/dist/tools/workflows/submit-workflow.tool.js +102 -19
  196. package/dist/tools/workflows/submit-workflow.tool.js.map +1 -1
  197. package/dist/tools/workflows/workflow-json-utils.d.ts +4 -0
  198. package/dist/tools/workflows/workflow-json-utils.js +54 -0
  199. package/dist/tools/workflows/workflow-json-utils.js.map +1 -0
  200. package/dist/tools/workflows.tool.d.ts +7 -1
  201. package/dist/tools/workflows.tool.js +283 -54
  202. package/dist/tools/workflows.tool.js.map +1 -1
  203. package/dist/tracing/langsmith-tracing.d.ts +2 -0
  204. package/dist/tracing/langsmith-tracing.js +12 -3
  205. package/dist/tracing/langsmith-tracing.js.map +1 -1
  206. package/dist/tracing/trace-replay.d.ts +3 -0
  207. package/dist/tracing/trace-replay.js +65 -0
  208. package/dist/tracing/trace-replay.js.map +1 -1
  209. package/dist/types.d.ts +92 -16
  210. package/dist/workflow-builder/parse-validate.d.ts +5 -1
  211. package/dist/workflow-builder/parse-validate.js +5 -4
  212. package/dist/workflow-builder/parse-validate.js.map +1 -1
  213. package/dist/workflow-loop/guidance.js +8 -2
  214. package/dist/workflow-loop/guidance.js.map +1 -1
  215. package/dist/workflow-loop/index.d.ts +3 -2
  216. package/dist/workflow-loop/index.js +11 -1
  217. package/dist/workflow-loop/index.js.map +1 -1
  218. package/dist/workflow-loop/remediation.d.ts +13 -0
  219. package/dist/workflow-loop/remediation.js +36 -0
  220. package/dist/workflow-loop/remediation.js.map +1 -0
  221. package/dist/workflow-loop/runtime.js +7 -0
  222. package/dist/workflow-loop/runtime.js.map +1 -1
  223. package/dist/workflow-loop/workflow-loop-controller.d.ts +1 -1
  224. package/dist/workflow-loop/workflow-loop-controller.js +196 -29
  225. package/dist/workflow-loop/workflow-loop-controller.js.map +1 -1
  226. package/dist/workflow-loop/workflow-loop-state.d.ts +500 -10
  227. package/dist/workflow-loop/workflow-loop-state.js +74 -1
  228. package/dist/workflow-loop/workflow-loop-state.js.map +1 -1
  229. package/dist/workflow-loop/workflow-task-service.d.ts +2 -1
  230. package/dist/workflow-loop/workflow-task-service.js +4 -0
  231. package/dist/workflow-loop/workflow-task-service.js.map +1 -1
  232. package/dist/workspace/builder-sandbox-factory.d.ts +3 -4
  233. package/dist/workspace/builder-sandbox-factory.js +74 -35
  234. package/dist/workspace/builder-sandbox-factory.js.map +1 -1
  235. package/dist/workspace/create-workspace.d.ts +2 -0
  236. package/dist/workspace/create-workspace.js.map +1 -1
  237. package/dist/workspace/n8n-sandbox-filesystem.js +2 -2
  238. package/dist/workspace/n8n-sandbox-filesystem.js.map +1 -1
  239. package/dist/workspace/n8n-sandbox-sandbox.d.ts +2 -3
  240. package/dist/workspace/n8n-sandbox-sandbox.js +3 -7
  241. package/dist/workspace/n8n-sandbox-sandbox.js.map +1 -1
  242. package/dist/workspace/sandbox-setup.d.ts +1 -1
  243. package/dist/workspace/sandbox-setup.js +41 -16
  244. package/dist/workspace/sandbox-setup.js.map +1 -1
  245. package/dist/workspace/snapshot-manager.d.ts +14 -2
  246. package/dist/workspace/snapshot-manager.js +57 -1
  247. package/dist/workspace/snapshot-manager.js.map +1 -1
  248. package/package.json +35 -10
  249. package/dist/tools/templates/template-api.d.ts +0 -21
  250. package/dist/tools/templates/template-api.js +0 -104
  251. package/dist/tools/templates/template-api.js.map +0 -1
  252. package/dist/tools/templates/types.d.ts +0 -52
  253. package/dist/tools/templates/types.js +0 -37
  254. package/dist/tools/templates/types.js.map +0 -1
  255. package/dist/tools/utils/mermaid.utils.d.ts +0 -15
  256. package/dist/tools/utils/mermaid.utils.js +0 -622
  257. package/dist/tools/utils/mermaid.utils.js.map +0 -1
  258. package/dist/tools/utils/node-configuration.utils.d.ts +0 -6
  259. package/dist/tools/utils/node-configuration.utils.js +0 -77
  260. package/dist/tools/utils/node-configuration.utils.js.map +0 -1
  261. package/dist/workspace/n8n-sandbox-client.d.ts +0 -105
  262. package/dist/workspace/n8n-sandbox-client.js +0 -335
  263. package/dist/workspace/n8n-sandbox-client.js.map +0 -1
  264. package/dist/workspace/n8n-sandbox-image-manager.d.ts +0 -5
  265. package/dist/workspace/n8n-sandbox-image-manager.js +0 -25
  266. package/dist/workspace/n8n-sandbox-image-manager.js.map +0 -1
@@ -2,9 +2,35 @@ import { z } from 'zod';
2
2
  export declare const workflowLoopPhaseSchema: z.ZodEnum<["building", "verifying", "repairing", "done", "blocked"]>;
3
3
  export declare const workflowLoopStatusSchema: z.ZodEnum<["active", "completed", "blocked"]>;
4
4
  export declare const workflowLoopSourceSchema: z.ZodEnum<["create", "modify"]>;
5
+ export declare const remediationCategorySchema: z.ZodEnum<["code_fixable", "needs_setup", "blocked"]>;
6
+ export declare const remediationMetadataSchema: z.ZodObject<{
7
+ category: z.ZodEnum<["code_fixable", "needs_setup", "blocked"]>;
8
+ shouldEdit: z.ZodBoolean;
9
+ guidance: z.ZodString;
10
+ reason: z.ZodOptional<z.ZodString>;
11
+ remainingSubmitFixes: z.ZodOptional<z.ZodNumber>;
12
+ attemptCount: z.ZodOptional<z.ZodNumber>;
13
+ }, "strip", z.ZodTypeAny, {
14
+ category: "blocked" | "code_fixable" | "needs_setup";
15
+ shouldEdit: boolean;
16
+ guidance: string;
17
+ reason?: string | undefined;
18
+ remainingSubmitFixes?: number | undefined;
19
+ attemptCount?: number | undefined;
20
+ }, {
21
+ category: "blocked" | "code_fixable" | "needs_setup";
22
+ shouldEdit: boolean;
23
+ guidance: string;
24
+ reason?: string | undefined;
25
+ remainingSubmitFixes?: number | undefined;
26
+ attemptCount?: number | undefined;
27
+ }>;
28
+ export type RemediationCategory = z.infer<typeof remediationCategorySchema>;
29
+ export type RemediationMetadata = z.infer<typeof remediationMetadataSchema>;
5
30
  export declare const workflowLoopStateSchema: z.ZodObject<{
6
31
  workItemId: z.ZodString;
7
32
  threadId: z.ZodString;
33
+ runId: z.ZodOptional<z.ZodString>;
8
34
  workflowId: z.ZodOptional<z.ZodString>;
9
35
  phase: z.ZodEnum<["building", "verifying", "repairing", "done", "blocked"]>;
10
36
  status: z.ZodEnum<["active", "completed", "blocked"]>;
@@ -15,32 +41,81 @@ export declare const workflowLoopStateSchema: z.ZodObject<{
15
41
  rebuildAttempts: z.ZodNumber;
16
42
  mockedCredentialTypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
17
43
  hasUnresolvedPlaceholders: z.ZodOptional<z.ZodBoolean>;
44
+ successfulSubmitSeen: z.ZodOptional<z.ZodBoolean>;
45
+ preSaveSubmitFailures: z.ZodOptional<z.ZodNumber>;
46
+ postSubmitRemediationSubmitsUsed: z.ZodOptional<z.ZodNumber>;
47
+ lastRemediation: z.ZodOptional<z.ZodObject<{
48
+ category: z.ZodEnum<["code_fixable", "needs_setup", "blocked"]>;
49
+ shouldEdit: z.ZodBoolean;
50
+ guidance: z.ZodString;
51
+ reason: z.ZodOptional<z.ZodString>;
52
+ remainingSubmitFixes: z.ZodOptional<z.ZodNumber>;
53
+ attemptCount: z.ZodOptional<z.ZodNumber>;
54
+ }, "strip", z.ZodTypeAny, {
55
+ category: "blocked" | "code_fixable" | "needs_setup";
56
+ shouldEdit: boolean;
57
+ guidance: string;
58
+ reason?: string | undefined;
59
+ remainingSubmitFixes?: number | undefined;
60
+ attemptCount?: number | undefined;
61
+ }, {
62
+ category: "blocked" | "code_fixable" | "needs_setup";
63
+ shouldEdit: boolean;
64
+ guidance: string;
65
+ reason?: string | undefined;
66
+ remainingSubmitFixes?: number | undefined;
67
+ attemptCount?: number | undefined;
68
+ }>>;
18
69
  }, "strip", z.ZodTypeAny, {
19
70
  status: "blocked" | "active" | "completed";
71
+ source: "create" | "modify";
20
72
  workItemId: string;
21
73
  threadId: string;
22
74
  phase: "building" | "verifying" | "repairing" | "done" | "blocked";
23
- source: "create" | "modify";
24
75
  rebuildAttempts: number;
25
76
  workflowId?: string | undefined;
77
+ runId?: string | undefined;
26
78
  lastTaskId?: string | undefined;
27
79
  lastExecutionId?: string | undefined;
28
80
  lastFailureSignature?: string | undefined;
29
81
  mockedCredentialTypes?: string[] | undefined;
30
82
  hasUnresolvedPlaceholders?: boolean | undefined;
83
+ successfulSubmitSeen?: boolean | undefined;
84
+ preSaveSubmitFailures?: number | undefined;
85
+ postSubmitRemediationSubmitsUsed?: number | undefined;
86
+ lastRemediation?: {
87
+ category: "blocked" | "code_fixable" | "needs_setup";
88
+ shouldEdit: boolean;
89
+ guidance: string;
90
+ reason?: string | undefined;
91
+ remainingSubmitFixes?: number | undefined;
92
+ attemptCount?: number | undefined;
93
+ } | undefined;
31
94
  }, {
32
95
  status: "blocked" | "active" | "completed";
96
+ source: "create" | "modify";
33
97
  workItemId: string;
34
98
  threadId: string;
35
99
  phase: "building" | "verifying" | "repairing" | "done" | "blocked";
36
- source: "create" | "modify";
37
100
  rebuildAttempts: number;
38
101
  workflowId?: string | undefined;
102
+ runId?: string | undefined;
39
103
  lastTaskId?: string | undefined;
40
104
  lastExecutionId?: string | undefined;
41
105
  lastFailureSignature?: string | undefined;
42
106
  mockedCredentialTypes?: string[] | undefined;
43
107
  hasUnresolvedPlaceholders?: boolean | undefined;
108
+ successfulSubmitSeen?: boolean | undefined;
109
+ preSaveSubmitFailures?: number | undefined;
110
+ postSubmitRemediationSubmitsUsed?: number | undefined;
111
+ lastRemediation?: {
112
+ category: "blocked" | "code_fixable" | "needs_setup";
113
+ shouldEdit: boolean;
114
+ guidance: string;
115
+ reason?: string | undefined;
116
+ remainingSubmitFixes?: number | undefined;
117
+ attemptCount?: number | undefined;
118
+ } | undefined;
44
119
  }>;
45
120
  export type WorkflowLoopPhase = z.infer<typeof workflowLoopPhaseSchema>;
46
121
  export type WorkflowLoopStatus = z.infer<typeof workflowLoopStatusSchema>;
@@ -59,42 +134,182 @@ export declare const attemptRecordSchema: z.ZodObject<{
59
134
  failureSignature: z.ZodOptional<z.ZodString>;
60
135
  diagnosis: z.ZodOptional<z.ZodString>;
61
136
  fixApplied: z.ZodOptional<z.ZodString>;
137
+ remediationCategory: z.ZodOptional<z.ZodEnum<["code_fixable", "needs_setup", "blocked"]>>;
138
+ remediationShouldEdit: z.ZodOptional<z.ZodBoolean>;
139
+ remediationGuidance: z.ZodOptional<z.ZodString>;
62
140
  createdAt: z.ZodString;
63
141
  }, "strip", z.ZodTypeAny, {
142
+ createdAt: string;
64
143
  attempt: number;
65
144
  action: "build" | "verify" | "rebuild" | "patch";
66
- result: "blocked" | "success" | "failure";
145
+ result: "success" | "blocked" | "failure";
67
146
  workItemId: string;
68
147
  phase: "building" | "verifying" | "repairing" | "done" | "blocked";
69
- createdAt: string;
148
+ workflowId?: string | undefined;
70
149
  diagnosis?: string | undefined;
71
150
  fixApplied?: string | undefined;
72
- workflowId?: string | undefined;
73
151
  executionId?: string | undefined;
74
152
  failureSignature?: string | undefined;
153
+ remediationCategory?: "blocked" | "code_fixable" | "needs_setup" | undefined;
154
+ remediationShouldEdit?: boolean | undefined;
155
+ remediationGuidance?: string | undefined;
75
156
  }, {
157
+ createdAt: string;
76
158
  attempt: number;
77
159
  action: "build" | "verify" | "rebuild" | "patch";
78
- result: "blocked" | "success" | "failure";
160
+ result: "success" | "blocked" | "failure";
79
161
  workItemId: string;
80
162
  phase: "building" | "verifying" | "repairing" | "done" | "blocked";
81
- createdAt: string;
163
+ workflowId?: string | undefined;
82
164
  diagnosis?: string | undefined;
83
165
  fixApplied?: string | undefined;
84
- workflowId?: string | undefined;
85
166
  executionId?: string | undefined;
86
167
  failureSignature?: string | undefined;
168
+ remediationCategory?: "blocked" | "code_fixable" | "needs_setup" | undefined;
169
+ remediationShouldEdit?: boolean | undefined;
170
+ remediationGuidance?: string | undefined;
87
171
  }>;
88
172
  export type AttemptAction = z.infer<typeof attemptActionSchema>;
89
173
  export type AttemptResult = z.infer<typeof attemptResultSchema>;
90
174
  export type AttemptRecord = z.infer<typeof attemptRecordSchema>;
91
175
  export declare const triggerTypeSchema: z.ZodEnum<["manual_or_testable", "trigger_only"]>;
176
+ export declare const workflowVerificationEvidenceSchema: z.ZodObject<{
177
+ attempted: z.ZodBoolean;
178
+ success: z.ZodBoolean;
179
+ executionId: z.ZodOptional<z.ZodString>;
180
+ status: z.ZodOptional<z.ZodEnum<["success", "error", "waiting", "running", "unknown"]>>;
181
+ failureSignature: z.ZodOptional<z.ZodString>;
182
+ evidence: z.ZodOptional<z.ZodObject<{
183
+ nodesExecuted: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
184
+ producedOutputRows: z.ZodOptional<z.ZodNumber>;
185
+ errorNodeName: z.ZodOptional<z.ZodString>;
186
+ errorMessage: z.ZodOptional<z.ZodString>;
187
+ }, "strip", z.ZodTypeAny, {
188
+ nodesExecuted?: string[] | undefined;
189
+ producedOutputRows?: number | undefined;
190
+ errorNodeName?: string | undefined;
191
+ errorMessage?: string | undefined;
192
+ }, {
193
+ nodesExecuted?: string[] | undefined;
194
+ producedOutputRows?: number | undefined;
195
+ errorNodeName?: string | undefined;
196
+ errorMessage?: string | undefined;
197
+ }>>;
198
+ verifiedAt: z.ZodOptional<z.ZodString>;
199
+ }, "strip", z.ZodTypeAny, {
200
+ success: boolean;
201
+ attempted: boolean;
202
+ status?: "unknown" | "running" | "error" | "success" | "waiting" | undefined;
203
+ executionId?: string | undefined;
204
+ failureSignature?: string | undefined;
205
+ evidence?: {
206
+ nodesExecuted?: string[] | undefined;
207
+ producedOutputRows?: number | undefined;
208
+ errorNodeName?: string | undefined;
209
+ errorMessage?: string | undefined;
210
+ } | undefined;
211
+ verifiedAt?: string | undefined;
212
+ }, {
213
+ success: boolean;
214
+ attempted: boolean;
215
+ status?: "unknown" | "running" | "error" | "success" | "waiting" | undefined;
216
+ executionId?: string | undefined;
217
+ failureSignature?: string | undefined;
218
+ evidence?: {
219
+ nodesExecuted?: string[] | undefined;
220
+ producedOutputRows?: number | undefined;
221
+ errorNodeName?: string | undefined;
222
+ errorMessage?: string | undefined;
223
+ } | undefined;
224
+ verifiedAt?: string | undefined;
225
+ }>;
226
+ export type WorkflowVerificationEvidence = z.infer<typeof workflowVerificationEvidenceSchema>;
227
+ export declare const workflowVerificationReadinessSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
228
+ status: z.ZodLiteral<"ready">;
229
+ }, "strip", z.ZodTypeAny, {
230
+ status: "ready";
231
+ }, {
232
+ status: "ready";
233
+ }>, z.ZodObject<{
234
+ status: z.ZodLiteral<"already_verified">;
235
+ }, "strip", z.ZodTypeAny, {
236
+ status: "already_verified";
237
+ }, {
238
+ status: "already_verified";
239
+ }>, z.ZodObject<{
240
+ status: z.ZodLiteral<"needs_setup">;
241
+ reason: z.ZodEnum<["unresolved-placeholders", "missing-mocked-credential-pin-data", "workflow-needs-setup"]>;
242
+ guidance: z.ZodString;
243
+ }, "strip", z.ZodTypeAny, {
244
+ status: "needs_setup";
245
+ reason: "unresolved-placeholders" | "missing-mocked-credential-pin-data" | "workflow-needs-setup";
246
+ guidance: string;
247
+ }, {
248
+ status: "needs_setup";
249
+ reason: "unresolved-placeholders" | "missing-mocked-credential-pin-data" | "workflow-needs-setup";
250
+ guidance: string;
251
+ }>, z.ZodObject<{
252
+ status: z.ZodLiteral<"not_verifiable">;
253
+ reason: z.ZodEnum<["not-submitted", "missing-workflow-id", "non-mockable-trigger"]>;
254
+ guidance: z.ZodString;
255
+ }, "strip", z.ZodTypeAny, {
256
+ status: "not_verifiable";
257
+ reason: "not-submitted" | "missing-workflow-id" | "non-mockable-trigger";
258
+ guidance: string;
259
+ }, {
260
+ status: "not_verifiable";
261
+ reason: "not-submitted" | "missing-workflow-id" | "non-mockable-trigger";
262
+ guidance: string;
263
+ }>]>;
264
+ export type WorkflowVerificationReadiness = z.infer<typeof workflowVerificationReadinessSchema>;
265
+ export declare const workflowSetupRequirementSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
266
+ status: z.ZodLiteral<"not_required">;
267
+ }, "strip", z.ZodTypeAny, {
268
+ status: "not_required";
269
+ }, {
270
+ status: "not_required";
271
+ }>, z.ZodObject<{
272
+ status: z.ZodLiteral<"required">;
273
+ reason: z.ZodEnum<["mocked-credentials", "unresolved-placeholders", "workflow-needs-setup"]>;
274
+ guidance: z.ZodString;
275
+ }, "strip", z.ZodTypeAny, {
276
+ status: "required";
277
+ reason: "unresolved-placeholders" | "workflow-needs-setup" | "mocked-credentials";
278
+ guidance: string;
279
+ }, {
280
+ status: "required";
281
+ reason: "unresolved-placeholders" | "workflow-needs-setup" | "mocked-credentials";
282
+ guidance: string;
283
+ }>]>;
284
+ export type WorkflowSetupRequirement = z.infer<typeof workflowSetupRequirementSchema>;
285
+ export declare const triggerNodeDescriptorSchema: z.ZodObject<{
286
+ nodeName: z.ZodString;
287
+ nodeType: z.ZodString;
288
+ }, "strip", z.ZodTypeAny, {
289
+ nodeName: string;
290
+ nodeType: string;
291
+ }, {
292
+ nodeName: string;
293
+ nodeType: string;
294
+ }>;
295
+ export type TriggerNodeDescriptor = z.infer<typeof triggerNodeDescriptorSchema>;
92
296
  export declare const workflowBuildOutcomeSchema: z.ZodObject<{
93
297
  workItemId: z.ZodString;
298
+ runId: z.ZodOptional<z.ZodString>;
94
299
  taskId: z.ZodString;
95
300
  workflowId: z.ZodOptional<z.ZodString>;
96
301
  submitted: z.ZodBoolean;
97
302
  triggerType: z.ZodEnum<["manual_or_testable", "trigger_only"]>;
303
+ triggerNodes: z.ZodOptional<z.ZodArray<z.ZodObject<{
304
+ nodeName: z.ZodString;
305
+ nodeType: z.ZodString;
306
+ }, "strip", z.ZodTypeAny, {
307
+ nodeName: string;
308
+ nodeType: string;
309
+ }, {
310
+ nodeName: string;
311
+ nodeType: string;
312
+ }>, "many">>;
98
313
  needsUserInput: z.ZodBoolean;
99
314
  blockingReason: z.ZodOptional<z.ZodString>;
100
315
  failureSignature: z.ZodOptional<z.ZodString>;
@@ -102,7 +317,137 @@ export declare const workflowBuildOutcomeSchema: z.ZodObject<{
102
317
  mockedCredentialTypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
103
318
  mockedCredentialsByNode: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
104
319
  verificationPinData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>>;
320
+ usesWorkflowPinDataForVerification: z.ZodOptional<z.ZodBoolean>;
321
+ supportingWorkflowIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
105
322
  hasUnresolvedPlaceholders: z.ZodOptional<z.ZodBoolean>;
323
+ verificationReadiness: z.ZodOptional<z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
324
+ status: z.ZodLiteral<"ready">;
325
+ }, "strip", z.ZodTypeAny, {
326
+ status: "ready";
327
+ }, {
328
+ status: "ready";
329
+ }>, z.ZodObject<{
330
+ status: z.ZodLiteral<"already_verified">;
331
+ }, "strip", z.ZodTypeAny, {
332
+ status: "already_verified";
333
+ }, {
334
+ status: "already_verified";
335
+ }>, z.ZodObject<{
336
+ status: z.ZodLiteral<"needs_setup">;
337
+ reason: z.ZodEnum<["unresolved-placeholders", "missing-mocked-credential-pin-data", "workflow-needs-setup"]>;
338
+ guidance: z.ZodString;
339
+ }, "strip", z.ZodTypeAny, {
340
+ status: "needs_setup";
341
+ reason: "unresolved-placeholders" | "missing-mocked-credential-pin-data" | "workflow-needs-setup";
342
+ guidance: string;
343
+ }, {
344
+ status: "needs_setup";
345
+ reason: "unresolved-placeholders" | "missing-mocked-credential-pin-data" | "workflow-needs-setup";
346
+ guidance: string;
347
+ }>, z.ZodObject<{
348
+ status: z.ZodLiteral<"not_verifiable">;
349
+ reason: z.ZodEnum<["not-submitted", "missing-workflow-id", "non-mockable-trigger"]>;
350
+ guidance: z.ZodString;
351
+ }, "strip", z.ZodTypeAny, {
352
+ status: "not_verifiable";
353
+ reason: "not-submitted" | "missing-workflow-id" | "non-mockable-trigger";
354
+ guidance: string;
355
+ }, {
356
+ status: "not_verifiable";
357
+ reason: "not-submitted" | "missing-workflow-id" | "non-mockable-trigger";
358
+ guidance: string;
359
+ }>]>>;
360
+ setupRequirement: z.ZodOptional<z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
361
+ status: z.ZodLiteral<"not_required">;
362
+ }, "strip", z.ZodTypeAny, {
363
+ status: "not_required";
364
+ }, {
365
+ status: "not_required";
366
+ }>, z.ZodObject<{
367
+ status: z.ZodLiteral<"required">;
368
+ reason: z.ZodEnum<["mocked-credentials", "unresolved-placeholders", "workflow-needs-setup"]>;
369
+ guidance: z.ZodString;
370
+ }, "strip", z.ZodTypeAny, {
371
+ status: "required";
372
+ reason: "unresolved-placeholders" | "workflow-needs-setup" | "mocked-credentials";
373
+ guidance: string;
374
+ }, {
375
+ status: "required";
376
+ reason: "unresolved-placeholders" | "workflow-needs-setup" | "mocked-credentials";
377
+ guidance: string;
378
+ }>]>>;
379
+ remediation: z.ZodOptional<z.ZodObject<{
380
+ category: z.ZodEnum<["code_fixable", "needs_setup", "blocked"]>;
381
+ shouldEdit: z.ZodBoolean;
382
+ guidance: z.ZodString;
383
+ reason: z.ZodOptional<z.ZodString>;
384
+ remainingSubmitFixes: z.ZodOptional<z.ZodNumber>;
385
+ attemptCount: z.ZodOptional<z.ZodNumber>;
386
+ }, "strip", z.ZodTypeAny, {
387
+ category: "blocked" | "code_fixable" | "needs_setup";
388
+ shouldEdit: boolean;
389
+ guidance: string;
390
+ reason?: string | undefined;
391
+ remainingSubmitFixes?: number | undefined;
392
+ attemptCount?: number | undefined;
393
+ }, {
394
+ category: "blocked" | "code_fixable" | "needs_setup";
395
+ shouldEdit: boolean;
396
+ guidance: string;
397
+ reason?: string | undefined;
398
+ remainingSubmitFixes?: number | undefined;
399
+ attemptCount?: number | undefined;
400
+ }>>;
401
+ verification: z.ZodOptional<z.ZodObject<{
402
+ attempted: z.ZodBoolean;
403
+ success: z.ZodBoolean;
404
+ executionId: z.ZodOptional<z.ZodString>;
405
+ status: z.ZodOptional<z.ZodEnum<["success", "error", "waiting", "running", "unknown"]>>;
406
+ failureSignature: z.ZodOptional<z.ZodString>;
407
+ evidence: z.ZodOptional<z.ZodObject<{
408
+ nodesExecuted: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
409
+ producedOutputRows: z.ZodOptional<z.ZodNumber>;
410
+ errorNodeName: z.ZodOptional<z.ZodString>;
411
+ errorMessage: z.ZodOptional<z.ZodString>;
412
+ }, "strip", z.ZodTypeAny, {
413
+ nodesExecuted?: string[] | undefined;
414
+ producedOutputRows?: number | undefined;
415
+ errorNodeName?: string | undefined;
416
+ errorMessage?: string | undefined;
417
+ }, {
418
+ nodesExecuted?: string[] | undefined;
419
+ producedOutputRows?: number | undefined;
420
+ errorNodeName?: string | undefined;
421
+ errorMessage?: string | undefined;
422
+ }>>;
423
+ verifiedAt: z.ZodOptional<z.ZodString>;
424
+ }, "strip", z.ZodTypeAny, {
425
+ success: boolean;
426
+ attempted: boolean;
427
+ status?: "unknown" | "running" | "error" | "success" | "waiting" | undefined;
428
+ executionId?: string | undefined;
429
+ failureSignature?: string | undefined;
430
+ evidence?: {
431
+ nodesExecuted?: string[] | undefined;
432
+ producedOutputRows?: number | undefined;
433
+ errorNodeName?: string | undefined;
434
+ errorMessage?: string | undefined;
435
+ } | undefined;
436
+ verifiedAt?: string | undefined;
437
+ }, {
438
+ success: boolean;
439
+ attempted: boolean;
440
+ status?: "unknown" | "running" | "error" | "success" | "waiting" | undefined;
441
+ executionId?: string | undefined;
442
+ failureSignature?: string | undefined;
443
+ evidence?: {
444
+ nodesExecuted?: string[] | undefined;
445
+ producedOutputRows?: number | undefined;
446
+ errorNodeName?: string | undefined;
447
+ errorMessage?: string | undefined;
448
+ } | undefined;
449
+ verifiedAt?: string | undefined;
450
+ }>>;
106
451
  summary: z.ZodString;
107
452
  }, "strip", z.ZodTypeAny, {
108
453
  workItemId: string;
@@ -112,13 +457,62 @@ export declare const workflowBuildOutcomeSchema: z.ZodObject<{
112
457
  needsUserInput: boolean;
113
458
  summary: string;
114
459
  workflowId?: string | undefined;
460
+ runId?: string | undefined;
115
461
  mockedCredentialTypes?: string[] | undefined;
116
462
  hasUnresolvedPlaceholders?: boolean | undefined;
117
463
  failureSignature?: string | undefined;
464
+ triggerNodes?: {
465
+ nodeName: string;
466
+ nodeType: string;
467
+ }[] | undefined;
118
468
  blockingReason?: string | undefined;
119
469
  mockedNodeNames?: string[] | undefined;
120
470
  mockedCredentialsByNode?: Record<string, string[]> | undefined;
121
471
  verificationPinData?: Record<string, Record<string, unknown>[]> | undefined;
472
+ usesWorkflowPinDataForVerification?: boolean | undefined;
473
+ supportingWorkflowIds?: string[] | undefined;
474
+ verificationReadiness?: {
475
+ status: "ready";
476
+ } | {
477
+ status: "already_verified";
478
+ } | {
479
+ status: "needs_setup";
480
+ reason: "unresolved-placeholders" | "missing-mocked-credential-pin-data" | "workflow-needs-setup";
481
+ guidance: string;
482
+ } | {
483
+ status: "not_verifiable";
484
+ reason: "not-submitted" | "missing-workflow-id" | "non-mockable-trigger";
485
+ guidance: string;
486
+ } | undefined;
487
+ setupRequirement?: {
488
+ status: "not_required";
489
+ } | {
490
+ status: "required";
491
+ reason: "unresolved-placeholders" | "workflow-needs-setup" | "mocked-credentials";
492
+ guidance: string;
493
+ } | undefined;
494
+ remediation?: {
495
+ category: "blocked" | "code_fixable" | "needs_setup";
496
+ shouldEdit: boolean;
497
+ guidance: string;
498
+ reason?: string | undefined;
499
+ remainingSubmitFixes?: number | undefined;
500
+ attemptCount?: number | undefined;
501
+ } | undefined;
502
+ verification?: {
503
+ success: boolean;
504
+ attempted: boolean;
505
+ status?: "unknown" | "running" | "error" | "success" | "waiting" | undefined;
506
+ executionId?: string | undefined;
507
+ failureSignature?: string | undefined;
508
+ evidence?: {
509
+ nodesExecuted?: string[] | undefined;
510
+ producedOutputRows?: number | undefined;
511
+ errorNodeName?: string | undefined;
512
+ errorMessage?: string | undefined;
513
+ } | undefined;
514
+ verifiedAt?: string | undefined;
515
+ } | undefined;
122
516
  }, {
123
517
  workItemId: string;
124
518
  taskId: string;
@@ -127,19 +521,69 @@ export declare const workflowBuildOutcomeSchema: z.ZodObject<{
127
521
  needsUserInput: boolean;
128
522
  summary: string;
129
523
  workflowId?: string | undefined;
524
+ runId?: string | undefined;
130
525
  mockedCredentialTypes?: string[] | undefined;
131
526
  hasUnresolvedPlaceholders?: boolean | undefined;
132
527
  failureSignature?: string | undefined;
528
+ triggerNodes?: {
529
+ nodeName: string;
530
+ nodeType: string;
531
+ }[] | undefined;
133
532
  blockingReason?: string | undefined;
134
533
  mockedNodeNames?: string[] | undefined;
135
534
  mockedCredentialsByNode?: Record<string, string[]> | undefined;
136
535
  verificationPinData?: Record<string, Record<string, unknown>[]> | undefined;
536
+ usesWorkflowPinDataForVerification?: boolean | undefined;
537
+ supportingWorkflowIds?: string[] | undefined;
538
+ verificationReadiness?: {
539
+ status: "ready";
540
+ } | {
541
+ status: "already_verified";
542
+ } | {
543
+ status: "needs_setup";
544
+ reason: "unresolved-placeholders" | "missing-mocked-credential-pin-data" | "workflow-needs-setup";
545
+ guidance: string;
546
+ } | {
547
+ status: "not_verifiable";
548
+ reason: "not-submitted" | "missing-workflow-id" | "non-mockable-trigger";
549
+ guidance: string;
550
+ } | undefined;
551
+ setupRequirement?: {
552
+ status: "not_required";
553
+ } | {
554
+ status: "required";
555
+ reason: "unresolved-placeholders" | "workflow-needs-setup" | "mocked-credentials";
556
+ guidance: string;
557
+ } | undefined;
558
+ remediation?: {
559
+ category: "blocked" | "code_fixable" | "needs_setup";
560
+ shouldEdit: boolean;
561
+ guidance: string;
562
+ reason?: string | undefined;
563
+ remainingSubmitFixes?: number | undefined;
564
+ attemptCount?: number | undefined;
565
+ } | undefined;
566
+ verification?: {
567
+ success: boolean;
568
+ attempted: boolean;
569
+ status?: "unknown" | "running" | "error" | "success" | "waiting" | undefined;
570
+ executionId?: string | undefined;
571
+ failureSignature?: string | undefined;
572
+ evidence?: {
573
+ nodesExecuted?: string[] | undefined;
574
+ producedOutputRows?: number | undefined;
575
+ errorNodeName?: string | undefined;
576
+ errorMessage?: string | undefined;
577
+ } | undefined;
578
+ verifiedAt?: string | undefined;
579
+ } | undefined;
137
580
  }>;
138
581
  export type TriggerType = z.infer<typeof triggerTypeSchema>;
139
582
  export type WorkflowBuildOutcome = z.infer<typeof workflowBuildOutcomeSchema>;
140
583
  export declare const verificationVerdictSchema: z.ZodEnum<["verified", "needs_patch", "needs_rebuild", "trigger_only", "needs_user_input", "failed_terminal"]>;
141
584
  export declare const verificationResultSchema: z.ZodObject<{
142
585
  workItemId: z.ZodString;
586
+ runId: z.ZodOptional<z.ZodString>;
143
587
  workflowId: z.ZodString;
144
588
  executionId: z.ZodOptional<z.ZodString>;
145
589
  verdict: z.ZodEnum<["verified", "needs_patch", "needs_rebuild", "trigger_only", "needs_user_input", "failed_terminal"]>;
@@ -147,31 +591,77 @@ export declare const verificationResultSchema: z.ZodObject<{
147
591
  failedNodeName: z.ZodOptional<z.ZodString>;
148
592
  diagnosis: z.ZodOptional<z.ZodString>;
149
593
  patch: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
594
+ remediation: z.ZodOptional<z.ZodObject<{
595
+ category: z.ZodEnum<["code_fixable", "needs_setup", "blocked"]>;
596
+ shouldEdit: z.ZodBoolean;
597
+ guidance: z.ZodString;
598
+ reason: z.ZodOptional<z.ZodString>;
599
+ remainingSubmitFixes: z.ZodOptional<z.ZodNumber>;
600
+ attemptCount: z.ZodOptional<z.ZodNumber>;
601
+ }, "strip", z.ZodTypeAny, {
602
+ category: "blocked" | "code_fixable" | "needs_setup";
603
+ shouldEdit: boolean;
604
+ guidance: string;
605
+ reason?: string | undefined;
606
+ remainingSubmitFixes?: number | undefined;
607
+ attemptCount?: number | undefined;
608
+ }, {
609
+ category: "blocked" | "code_fixable" | "needs_setup";
610
+ shouldEdit: boolean;
611
+ guidance: string;
612
+ reason?: string | undefined;
613
+ remainingSubmitFixes?: number | undefined;
614
+ attemptCount?: number | undefined;
615
+ }>>;
150
616
  summary: z.ZodString;
151
617
  }, "strip", z.ZodTypeAny, {
152
- workItemId: string;
153
618
  workflowId: string;
619
+ workItemId: string;
154
620
  summary: string;
155
621
  verdict: "trigger_only" | "verified" | "needs_patch" | "needs_rebuild" | "needs_user_input" | "failed_terminal";
156
622
  diagnosis?: string | undefined;
623
+ runId?: string | undefined;
157
624
  patch?: Record<string, unknown> | undefined;
158
625
  executionId?: string | undefined;
159
626
  failureSignature?: string | undefined;
627
+ remediation?: {
628
+ category: "blocked" | "code_fixable" | "needs_setup";
629
+ shouldEdit: boolean;
630
+ guidance: string;
631
+ reason?: string | undefined;
632
+ remainingSubmitFixes?: number | undefined;
633
+ attemptCount?: number | undefined;
634
+ } | undefined;
160
635
  failedNodeName?: string | undefined;
161
636
  }, {
162
- workItemId: string;
163
637
  workflowId: string;
638
+ workItemId: string;
164
639
  summary: string;
165
640
  verdict: "trigger_only" | "verified" | "needs_patch" | "needs_rebuild" | "needs_user_input" | "failed_terminal";
166
641
  diagnosis?: string | undefined;
642
+ runId?: string | undefined;
167
643
  patch?: Record<string, unknown> | undefined;
168
644
  executionId?: string | undefined;
169
645
  failureSignature?: string | undefined;
646
+ remediation?: {
647
+ category: "blocked" | "code_fixable" | "needs_setup";
648
+ shouldEdit: boolean;
649
+ guidance: string;
650
+ reason?: string | undefined;
651
+ remainingSubmitFixes?: number | undefined;
652
+ attemptCount?: number | undefined;
653
+ } | undefined;
170
654
  failedNodeName?: string | undefined;
171
655
  }>;
172
656
  export type VerificationVerdict = z.infer<typeof verificationVerdictSchema>;
173
657
  export type VerificationResult = z.infer<typeof verificationResultSchema>;
174
658
  export type WorkflowLoopAction = {
659
+ type: 'ignored';
660
+ reason: string;
661
+ } | {
662
+ type: 'continue_building';
663
+ reason: string;
664
+ } | {
175
665
  type: 'verify';
176
666
  workflowId: string;
177
667
  } | {