@probelabs/visor 0.1.106 → 0.1.107

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 (450) hide show
  1. package/README.md +65 -2
  2. package/action.yml +1 -1
  3. package/defaults/code-refiner.yaml +114 -0
  4. package/defaults/{.visor.yaml → code-review.yaml} +35 -226
  5. package/defaults/override.yaml +52 -0
  6. package/defaults/task-refinement.yaml +620 -0
  7. package/defaults/visor.tests.yaml +674 -0
  8. package/defaults/visor.yaml +482 -0
  9. package/dist/663.index.js +2 -3
  10. package/dist/80.index.js +2 -3
  11. package/dist/action-cli-bridge.d.ts +11 -82
  12. package/dist/action-cli-bridge.d.ts.map +1 -1
  13. package/dist/ai-review-service.d.ts +15 -0
  14. package/dist/ai-review-service.d.ts.map +1 -1
  15. package/dist/check-execution-engine.d.ts +19 -331
  16. package/dist/check-execution-engine.d.ts.map +1 -1
  17. package/dist/cli-main.d.ts.map +1 -1
  18. package/dist/cli.d.ts +0 -1
  19. package/dist/cli.d.ts.map +1 -1
  20. package/dist/config.d.ts +16 -0
  21. package/dist/config.d.ts.map +1 -1
  22. package/dist/cron-scheduler.d.ts +3 -3
  23. package/dist/cron-scheduler.d.ts.map +1 -1
  24. package/dist/debug-visualizer/ws-server.d.ts.map +1 -1
  25. package/dist/defaults/code-refiner.yaml +114 -0
  26. package/dist/defaults/{.visor.yaml → code-review.yaml} +35 -226
  27. package/dist/defaults/override.yaml +52 -0
  28. package/dist/defaults/task-refinement.yaml +620 -0
  29. package/dist/defaults/visor.tests.yaml +674 -0
  30. package/dist/defaults/visor.yaml +482 -0
  31. package/dist/docs/DEPLOYMENT.md +118 -0
  32. package/dist/docs/GITHUB_CHECKS.md +280 -0
  33. package/dist/docs/NPM_USAGE.md +208 -0
  34. package/dist/docs/action-reference.md +19 -0
  35. package/dist/docs/advanced-ai.md +178 -0
  36. package/dist/docs/ai-configuration.md +468 -0
  37. package/dist/docs/author-permissions.md +610 -0
  38. package/dist/docs/ci-cli-mode.md +34 -0
  39. package/dist/docs/claude-code.md +74 -0
  40. package/dist/docs/command-provider.md +559 -0
  41. package/dist/docs/commands.md +8 -0
  42. package/dist/docs/configuration.md +303 -0
  43. package/dist/docs/custom-tools.md +424 -0
  44. package/dist/docs/dashboards/README.md +23 -0
  45. package/dist/docs/dashboards/grafana-visor-diagrams.json +20 -0
  46. package/dist/docs/dashboards/grafana-visor-overview.json +33 -0
  47. package/dist/docs/debug-visualizer-progress.md +572 -0
  48. package/dist/docs/debug-visualizer-rfc.md +691 -0
  49. package/dist/docs/debug-visualizer.md +114 -0
  50. package/dist/docs/debugging.md +636 -0
  51. package/dist/docs/default-output-schema.md +28 -0
  52. package/dist/docs/dependencies.md +369 -0
  53. package/dist/docs/dev-playbook.md +9 -0
  54. package/dist/docs/engine-state-machine-plan.md +333 -0
  55. package/dist/docs/event-driven-github-integration-rfc.md +743 -0
  56. package/dist/docs/event-triggers.md +292 -0
  57. package/dist/docs/execution-statistics-rfc.md +290 -0
  58. package/dist/docs/fact-validator-gap-analysis.md +178 -0
  59. package/dist/docs/fact-validator-implementation-plan.md +1235 -0
  60. package/dist/docs/fail-if.md +95 -0
  61. package/dist/docs/failure-conditions-implementation.md +271 -0
  62. package/dist/docs/failure-conditions-schema.md +173 -0
  63. package/dist/docs/failure-routing-rfc.md +193 -0
  64. package/dist/docs/failure-routing.md +507 -0
  65. package/dist/docs/foreach-dependency-propagation.md +473 -0
  66. package/dist/docs/github-ops.md +89 -0
  67. package/dist/docs/goto-forward-run-plan.md +113 -0
  68. package/dist/docs/guides/criticality-modes.md +332 -0
  69. package/dist/docs/guides/fault-management-and-contracts.md +738 -0
  70. package/dist/docs/guides/workflow-style-guide.md +224 -0
  71. package/dist/docs/http.md +299 -0
  72. package/dist/docs/human-input-provider.md +372 -0
  73. package/dist/docs/limits.md +64 -0
  74. package/dist/docs/liquid-templates.md +347 -0
  75. package/dist/docs/loop-routing-refactor.md +89 -0
  76. package/dist/docs/mcp-provider.md +557 -0
  77. package/dist/docs/mcp.md +124 -0
  78. package/dist/docs/memory.md +903 -0
  79. package/dist/docs/observability.md +12 -0
  80. package/dist/docs/output-formats.md +20 -0
  81. package/dist/docs/output-formatting.md +29 -0
  82. package/dist/docs/output-history.md +383 -0
  83. package/dist/docs/performance.md +6 -0
  84. package/dist/docs/pluggable.md +124 -0
  85. package/dist/docs/proposals/snapshot-scope-execution.md +236 -0
  86. package/dist/docs/recipes.md +21 -0
  87. package/dist/docs/roadmap/criticality-implementation-tasks.md +92 -0
  88. package/dist/docs/schema-next-pr.md +10 -0
  89. package/dist/docs/schema-templates.md +68 -0
  90. package/dist/docs/script.md +34 -0
  91. package/dist/docs/sdk.md +222 -0
  92. package/dist/docs/security.md +7 -0
  93. package/dist/docs/suppressions.md +89 -0
  94. package/dist/docs/tag-filtering.md +258 -0
  95. package/dist/docs/telemetry-setup.md +119 -0
  96. package/dist/docs/telemetry-tracing-rfc.md +275 -0
  97. package/dist/docs/test-framework-rfc.md +680 -0
  98. package/dist/docs/testing/assertions.md +85 -0
  99. package/dist/docs/testing/ci.md +44 -0
  100. package/dist/docs/testing/cli.md +41 -0
  101. package/dist/docs/testing/cookbook.md +172 -0
  102. package/dist/docs/testing/dsl-reference.md +199 -0
  103. package/dist/docs/testing/fixtures-and-mocks.md +91 -0
  104. package/dist/docs/testing/flows.md +92 -0
  105. package/dist/docs/testing/getting-started.md +93 -0
  106. package/dist/docs/testing/troubleshooting.md +55 -0
  107. package/dist/docs/timeouts.md +50 -0
  108. package/dist/docs/troubleshooting.md +7 -0
  109. package/dist/docs/visor-sdk-rfc.md +186 -0
  110. package/dist/docs/workflows.md +569 -0
  111. package/dist/engine/on-finish/orchestrator.d.ts +19 -0
  112. package/dist/engine/on-finish/orchestrator.d.ts.map +1 -0
  113. package/dist/engine/on-finish/utils.d.ts +44 -0
  114. package/dist/engine/on-finish/utils.d.ts.map +1 -0
  115. package/dist/event-bus/event-bus.d.ts +13 -0
  116. package/dist/event-bus/event-bus.d.ts.map +1 -0
  117. package/dist/event-bus/types.d.ts +57 -0
  118. package/dist/event-bus/types.d.ts.map +1 -0
  119. package/dist/examples/.claude/agents/code-reviewer.md +69 -0
  120. package/dist/examples/.mcp.json +34 -0
  121. package/dist/examples/CALCULATOR-SDK.md +364 -0
  122. package/dist/examples/README.md +384 -0
  123. package/dist/examples/ai-retry-fallback-config.yaml +180 -0
  124. package/dist/examples/ai-with-bash.yaml +126 -0
  125. package/dist/examples/ai-with-mcp.yaml +82 -0
  126. package/dist/examples/basic-human-input.yaml +15 -0
  127. package/dist/examples/bedrock-config.yaml +77 -0
  128. package/dist/examples/calculator-config.yaml +133 -0
  129. package/dist/examples/calculator-json-output-guide.md +311 -0
  130. package/dist/examples/calculator-sdk-automated.ts +340 -0
  131. package/dist/examples/calculator-sdk-example.ts +275 -0
  132. package/dist/examples/calculator-sdk-json.ts +331 -0
  133. package/dist/examples/calculator-sdk-real.ts +374 -0
  134. package/dist/examples/calculator-sdk-test.ts +148 -0
  135. package/dist/examples/claude-code-config.yaml +191 -0
  136. package/dist/examples/cron-webhook-config.yaml +215 -0
  137. package/dist/examples/custom-template.liquid +57 -0
  138. package/dist/examples/custom-tools-example.yaml +281 -0
  139. package/dist/examples/enhanced-config.yaml +165 -0
  140. package/dist/examples/environments/visor.base.yaml +92 -0
  141. package/dist/examples/environments/visor.dev.yaml +33 -0
  142. package/dist/examples/environments/visor.prod.yaml +95 -0
  143. package/dist/examples/environments/visor.staging.yaml +46 -0
  144. package/dist/examples/fact-validator.yaml +361 -0
  145. package/dist/examples/fail-if-simple.yaml +90 -0
  146. package/dist/examples/failure-conditions-advanced.yaml +136 -0
  147. package/dist/examples/failure-conditions-basic.yaml +48 -0
  148. package/dist/examples/failure-conditions-github-style.yaml +119 -0
  149. package/dist/examples/failure-conditions-migration.yaml +74 -0
  150. package/dist/examples/for-loop-example.yaml +176 -0
  151. package/dist/examples/forEach-example.yaml +120 -0
  152. package/dist/examples/github-workflow-with-tags.yml +163 -0
  153. package/dist/examples/http-integration-config.yaml +240 -0
  154. package/dist/examples/https-server-config.yaml +209 -0
  155. package/dist/examples/human-input-example.yaml +63 -0
  156. package/dist/examples/if-conditions.yaml +173 -0
  157. package/dist/examples/jira-simple-example.yaml +56 -0
  158. package/dist/examples/jira-single-issue-workflow.yaml +166 -0
  159. package/dist/examples/jira-workflow-mcp.yaml +182 -0
  160. package/dist/examples/mcp/analyzer.py +119 -0
  161. package/dist/examples/mcp-provider-example.yaml +301 -0
  162. package/dist/examples/memory-counter.yaml +99 -0
  163. package/dist/examples/memory-error-collection.yaml +104 -0
  164. package/dist/examples/memory-exec-js.yaml +247 -0
  165. package/dist/examples/memory-namespace-isolation.yaml +184 -0
  166. package/dist/examples/memory-retry-counter.yaml +65 -0
  167. package/dist/examples/memory-state-machine.yaml +170 -0
  168. package/dist/examples/outputs-raw-basic.yaml +26 -0
  169. package/dist/examples/project-with-tools.yaml +174 -0
  170. package/dist/examples/prompts/architecture-analysis.liquid +116 -0
  171. package/dist/examples/prompts/security-comprehensive.liquid +107 -0
  172. package/dist/examples/quick-start-tags.yaml +53 -0
  173. package/dist/examples/routing-basic.yaml +35 -0
  174. package/dist/examples/routing-dynamic-js.yaml +46 -0
  175. package/dist/examples/routing-foreach.yaml +34 -0
  176. package/dist/examples/routing-goto-event.yaml +34 -0
  177. package/dist/examples/routing-on-success.yaml +25 -0
  178. package/dist/examples/run-calculator-demo.sh +71 -0
  179. package/dist/examples/sdk-basic.mjs +10 -0
  180. package/dist/examples/sdk-cjs.cjs +10 -0
  181. package/dist/examples/sdk-comprehensive.mjs +175 -0
  182. package/dist/examples/sdk-manual-config.mjs +65 -0
  183. package/dist/examples/sdk-typescript.js +81 -0
  184. package/dist/examples/sdk-typescript.ts +92 -0
  185. package/dist/examples/session-reuse-config.yaml +151 -0
  186. package/dist/examples/templates/security-report.liquid +137 -0
  187. package/dist/examples/tools-library.yaml +281 -0
  188. package/dist/examples/transform-example.yaml +199 -0
  189. package/dist/examples/visor-with-tags.yaml +198 -0
  190. package/dist/examples/webhook-pipeline-config.yaml +218 -0
  191. package/dist/examples/workflows/calculator-workflow.yaml +163 -0
  192. package/dist/examples/workflows/code-quality.yaml +222 -0
  193. package/dist/examples/workflows/quick-pr-check.yaml +90 -0
  194. package/dist/examples/workflows/workflow-composition-example.yaml +130 -0
  195. package/dist/failure-condition-evaluator.d.ts +1 -0
  196. package/dist/failure-condition-evaluator.d.ts.map +1 -1
  197. package/dist/frontends/github-frontend.d.ts +38 -0
  198. package/dist/frontends/github-frontend.d.ts.map +1 -0
  199. package/dist/frontends/host.d.ts +43 -0
  200. package/dist/frontends/host.d.ts.map +1 -0
  201. package/dist/frontends/ndjson-sink.d.ts +12 -0
  202. package/dist/frontends/ndjson-sink.d.ts.map +1 -0
  203. package/dist/generated/config-schema.d.ts +564 -22
  204. package/dist/generated/config-schema.d.ts.map +1 -1
  205. package/dist/generated/config-schema.json +612 -24
  206. package/dist/github-check-service.d.ts +4 -6
  207. package/dist/github-check-service.d.ts.map +1 -1
  208. package/dist/github-comments.d.ts +0 -4
  209. package/dist/github-comments.d.ts.map +1 -1
  210. package/dist/index.d.ts.map +1 -1
  211. package/dist/index.js +70335 -62514
  212. package/dist/liquid-extensions.d.ts.map +1 -1
  213. package/dist/logger.d.ts +1 -0
  214. package/dist/logger.d.ts.map +1 -1
  215. package/dist/memory-store.d.ts +6 -0
  216. package/dist/memory-store.d.ts.map +1 -1
  217. package/dist/output/assistant-json/template.liquid +0 -0
  218. package/dist/output/traces/run-2025-11-21T11-50-46-505Z.ndjson +138 -0
  219. package/dist/output/traces/run-2025-11-21T11-51-33-674Z.ndjson +839 -0
  220. package/dist/output-formatters.d.ts +1 -1
  221. package/dist/output-formatters.d.ts.map +1 -1
  222. package/dist/providers/ai-check-provider.d.ts.map +1 -1
  223. package/dist/providers/check-provider-registry.d.ts +6 -0
  224. package/dist/providers/check-provider-registry.d.ts.map +1 -1
  225. package/dist/providers/check-provider.interface.d.ts +34 -1
  226. package/dist/providers/check-provider.interface.d.ts.map +1 -1
  227. package/dist/providers/claude-code-check-provider.d.ts.map +1 -1
  228. package/dist/providers/command-check-provider.d.ts +1 -1
  229. package/dist/providers/command-check-provider.d.ts.map +1 -1
  230. package/dist/providers/custom-tool-executor.d.ts +61 -0
  231. package/dist/providers/custom-tool-executor.d.ts.map +1 -0
  232. package/dist/providers/github-ops-provider.d.ts.map +1 -1
  233. package/dist/providers/http-client-provider.d.ts +1 -4
  234. package/dist/providers/http-client-provider.d.ts.map +1 -1
  235. package/dist/providers/human-input-check-provider.d.ts +3 -0
  236. package/dist/providers/human-input-check-provider.d.ts.map +1 -1
  237. package/dist/providers/index.d.ts +1 -0
  238. package/dist/providers/index.d.ts.map +1 -1
  239. package/dist/providers/log-check-provider.d.ts +2 -5
  240. package/dist/providers/log-check-provider.d.ts.map +1 -1
  241. package/dist/providers/mcp-check-provider.d.ts +9 -3
  242. package/dist/providers/mcp-check-provider.d.ts.map +1 -1
  243. package/dist/providers/memory-check-provider.d.ts +2 -8
  244. package/dist/providers/memory-check-provider.d.ts.map +1 -1
  245. package/dist/providers/script-check-provider.d.ts +25 -0
  246. package/dist/providers/script-check-provider.d.ts.map +1 -0
  247. package/dist/providers/workflow-check-provider.d.ts +56 -0
  248. package/dist/providers/workflow-check-provider.d.ts.map +1 -0
  249. package/dist/reviewer.d.ts +2 -1
  250. package/dist/reviewer.d.ts.map +1 -1
  251. package/dist/sdk/chunk-37ZSCMFC.mjs +482 -0
  252. package/dist/sdk/chunk-37ZSCMFC.mjs.map +1 -0
  253. package/dist/sdk/chunk-6Y4YTKCF.mjs +197 -0
  254. package/dist/sdk/chunk-6Y4YTKCF.mjs.map +1 -0
  255. package/dist/sdk/chunk-CNX7V5JK.mjs +89 -0
  256. package/dist/sdk/chunk-CNX7V5JK.mjs.map +1 -0
  257. package/dist/sdk/chunk-IEO6CFLG.mjs +1215 -0
  258. package/dist/sdk/chunk-IEO6CFLG.mjs.map +1 -0
  259. package/dist/sdk/chunk-JEHPDJIF.mjs +223 -0
  260. package/dist/sdk/chunk-JEHPDJIF.mjs.map +1 -0
  261. package/dist/sdk/chunk-O5EZDNYL.mjs +274 -0
  262. package/dist/sdk/chunk-O5EZDNYL.mjs.map +1 -0
  263. package/dist/sdk/{chunk-TUTOLSFV.mjs → chunk-OOZITMRU.mjs} +1 -1
  264. package/dist/sdk/chunk-OOZITMRU.mjs.map +1 -0
  265. package/dist/sdk/chunk-OWUVOILT.mjs +557 -0
  266. package/dist/sdk/chunk-OWUVOILT.mjs.map +1 -0
  267. package/dist/sdk/chunk-OZJ263FM.mjs +986 -0
  268. package/dist/sdk/chunk-OZJ263FM.mjs.map +1 -0
  269. package/dist/sdk/chunk-PTL3K3PN.mjs +3128 -0
  270. package/dist/sdk/chunk-PTL3K3PN.mjs.map +1 -0
  271. package/dist/sdk/chunk-S2RUE2RG.mjs +145 -0
  272. package/dist/sdk/chunk-S2RUE2RG.mjs.map +1 -0
  273. package/dist/sdk/chunk-VMPLF6FT.mjs +127 -0
  274. package/dist/sdk/chunk-VMPLF6FT.mjs.map +1 -0
  275. package/dist/sdk/chunk-YSN4G6CI.mjs +146 -0
  276. package/dist/sdk/chunk-YSN4G6CI.mjs.map +1 -0
  277. package/dist/sdk/chunk-ZYAUYXSW.mjs +206 -0
  278. package/dist/sdk/chunk-ZYAUYXSW.mjs.map +1 -0
  279. package/dist/sdk/config-M4ZNO6NU.mjs +14 -0
  280. package/dist/sdk/config-merger-PX3WIT57.mjs +10 -0
  281. package/dist/sdk/event-bus-5BEVPQ6T.mjs +35 -0
  282. package/dist/sdk/event-bus-5BEVPQ6T.mjs.map +1 -0
  283. package/dist/sdk/failure-condition-evaluator-NBO5YRXW.mjs +16 -0
  284. package/dist/sdk/git-repository-analyzer-HJC4MYW4.mjs +458 -0
  285. package/dist/sdk/git-repository-analyzer-HJC4MYW4.mjs.map +1 -0
  286. package/dist/sdk/github-frontend-4AWRJT7D.mjs +1242 -0
  287. package/dist/sdk/github-frontend-4AWRJT7D.mjs.map +1 -0
  288. package/dist/sdk/host-7GBC3S7L.mjs +49 -0
  289. package/dist/sdk/host-7GBC3S7L.mjs.map +1 -0
  290. package/dist/sdk/{liquid-extensions-KVL4MKRH.mjs → liquid-extensions-C7EG3YKH.mjs} +7 -2
  291. package/dist/sdk/memory-store-GJACZC2A.mjs +11 -0
  292. package/dist/sdk/metrics-7PP3EJUH.mjs +29 -0
  293. package/dist/sdk/ndjson-sink-B4V4NTAQ.mjs +44 -0
  294. package/dist/sdk/ndjson-sink-B4V4NTAQ.mjs.map +1 -0
  295. package/dist/sdk/renderer-schema-6RF26VUS.mjs +50 -0
  296. package/dist/sdk/renderer-schema-6RF26VUS.mjs.map +1 -0
  297. package/dist/sdk/routing-RP56JTV2.mjs +23 -0
  298. package/dist/sdk/routing-RP56JTV2.mjs.map +1 -0
  299. package/dist/sdk/sdk.d.mts +326 -21
  300. package/dist/sdk/sdk.d.ts +326 -21
  301. package/dist/sdk/sdk.js +21403 -16366
  302. package/dist/sdk/sdk.js.map +1 -1
  303. package/dist/sdk/sdk.mjs +13510 -2096
  304. package/dist/sdk/sdk.mjs.map +1 -1
  305. package/dist/sdk/session-registry-N5FFYFTM.mjs +10 -0
  306. package/dist/sdk/session-registry-N5FFYFTM.mjs.map +1 -0
  307. package/dist/sdk/trace-helpers-VP6QYVBX.mjs +23 -0
  308. package/dist/sdk/trace-helpers-VP6QYVBX.mjs.map +1 -0
  309. package/dist/sdk/{tracer-init-WC75N5NW.mjs → tracer-init-WP4X46IF.mjs} +2 -2
  310. package/dist/sdk/tracer-init-WP4X46IF.mjs.map +1 -0
  311. package/dist/sdk/workflow-registry-2YIIXQCK.mjs +11 -0
  312. package/dist/sdk/workflow-registry-2YIIXQCK.mjs.map +1 -0
  313. package/dist/sdk.d.ts.map +1 -1
  314. package/dist/snapshot-store.d.ts +59 -0
  315. package/dist/snapshot-store.d.ts.map +1 -0
  316. package/dist/state-machine/context/build-engine-context.d.ts +9 -0
  317. package/dist/state-machine/context/build-engine-context.d.ts.map +1 -0
  318. package/dist/state-machine/dispatch/dependency-gating.d.ts +12 -0
  319. package/dist/state-machine/dispatch/dependency-gating.d.ts.map +1 -0
  320. package/dist/state-machine/dispatch/execution-invoker.d.ts +14 -0
  321. package/dist/state-machine/dispatch/execution-invoker.d.ts.map +1 -0
  322. package/dist/state-machine/dispatch/foreach-processor.d.ts +8 -0
  323. package/dist/state-machine/dispatch/foreach-processor.d.ts.map +1 -0
  324. package/dist/state-machine/dispatch/history-snapshot.d.ts +8 -0
  325. package/dist/state-machine/dispatch/history-snapshot.d.ts.map +1 -0
  326. package/dist/state-machine/dispatch/renderer-schema.d.ts +8 -0
  327. package/dist/state-machine/dispatch/renderer-schema.d.ts.map +1 -0
  328. package/dist/state-machine/dispatch/stats-manager.d.ts +15 -0
  329. package/dist/state-machine/dispatch/stats-manager.d.ts.map +1 -0
  330. package/dist/state-machine/dispatch/template-renderer.d.ts +7 -0
  331. package/dist/state-machine/dispatch/template-renderer.d.ts.map +1 -0
  332. package/dist/state-machine/execution/summary.d.ts +8 -0
  333. package/dist/state-machine/execution/summary.d.ts.map +1 -0
  334. package/dist/state-machine/runner.d.ts +73 -0
  335. package/dist/state-machine/runner.d.ts.map +1 -0
  336. package/dist/state-machine/states/check-running.d.ts +14 -0
  337. package/dist/state-machine/states/check-running.d.ts.map +1 -0
  338. package/dist/state-machine/states/completed.d.ts +12 -0
  339. package/dist/state-machine/states/completed.d.ts.map +1 -0
  340. package/dist/state-machine/states/error.d.ts +11 -0
  341. package/dist/state-machine/states/error.d.ts.map +1 -0
  342. package/dist/state-machine/states/init.d.ts +11 -0
  343. package/dist/state-machine/states/init.d.ts.map +1 -0
  344. package/dist/state-machine/states/level-dispatch.d.ts +17 -0
  345. package/dist/state-machine/states/level-dispatch.d.ts.map +1 -0
  346. package/dist/state-machine/states/plan-ready.d.ts +12 -0
  347. package/dist/state-machine/states/plan-ready.d.ts.map +1 -0
  348. package/dist/state-machine/states/routing.d.ts +52 -0
  349. package/dist/state-machine/states/routing.d.ts.map +1 -0
  350. package/dist/state-machine/states/wave-planning.d.ts +14 -0
  351. package/dist/state-machine/states/wave-planning.d.ts.map +1 -0
  352. package/dist/state-machine/workflow-projection.d.ts +47 -0
  353. package/dist/state-machine/workflow-projection.d.ts.map +1 -0
  354. package/dist/state-machine-execution-engine.d.ts +147 -0
  355. package/dist/state-machine-execution-engine.d.ts.map +1 -0
  356. package/dist/telemetry/opentelemetry.d.ts.map +1 -1
  357. package/dist/test-runner/assertions.d.ts +59 -0
  358. package/dist/test-runner/assertions.d.ts.map +1 -0
  359. package/dist/test-runner/core/environment.d.ts +8 -0
  360. package/dist/test-runner/core/environment.d.ts.map +1 -0
  361. package/dist/test-runner/core/fixture.d.ts +3 -0
  362. package/dist/test-runner/core/fixture.d.ts.map +1 -0
  363. package/dist/test-runner/core/flow-stage.d.ts +32 -0
  364. package/dist/test-runner/core/flow-stage.d.ts.map +1 -0
  365. package/dist/test-runner/core/mocks.d.ts +8 -0
  366. package/dist/test-runner/core/mocks.d.ts.map +1 -0
  367. package/dist/test-runner/core/test-execution-wrapper.d.ts +18 -0
  368. package/dist/test-runner/core/test-execution-wrapper.d.ts.map +1 -0
  369. package/dist/test-runner/evaluators.d.ts +12 -0
  370. package/dist/test-runner/evaluators.d.ts.map +1 -0
  371. package/dist/test-runner/fixture-loader.d.ts +30 -0
  372. package/dist/test-runner/fixture-loader.d.ts.map +1 -0
  373. package/dist/test-runner/index.d.ts +120 -0
  374. package/dist/test-runner/index.d.ts.map +1 -0
  375. package/dist/test-runner/recorders/github-recorder.d.ts +23 -0
  376. package/dist/test-runner/recorders/github-recorder.d.ts.map +1 -0
  377. package/dist/test-runner/recorders/global-recorder.d.ts +4 -0
  378. package/dist/test-runner/recorders/global-recorder.d.ts.map +1 -0
  379. package/dist/test-runner/utils/selectors.d.ts +2 -0
  380. package/dist/test-runner/utils/selectors.d.ts.map +1 -0
  381. package/dist/test-runner/validator.d.ts +8 -0
  382. package/dist/test-runner/validator.d.ts.map +1 -0
  383. package/dist/traces/run-2025-11-21T11-50-46-505Z.ndjson +138 -0
  384. package/dist/traces/run-2025-11-21T11-51-33-674Z.ndjson +839 -0
  385. package/dist/types/cli.d.ts +4 -1
  386. package/dist/types/cli.d.ts.map +1 -1
  387. package/dist/types/config.d.ts +278 -5
  388. package/dist/types/config.d.ts.map +1 -1
  389. package/dist/types/engine.d.ts +172 -0
  390. package/dist/types/engine.d.ts.map +1 -0
  391. package/dist/types/execution.d.ts +73 -0
  392. package/dist/types/execution.d.ts.map +1 -0
  393. package/dist/types/github.d.ts +51 -0
  394. package/dist/types/github.d.ts.map +1 -0
  395. package/dist/types/workflow.d.ts +237 -0
  396. package/dist/types/workflow.d.ts.map +1 -0
  397. package/dist/utils/command-executor.d.ts +43 -0
  398. package/dist/utils/command-executor.d.ts.map +1 -0
  399. package/dist/utils/comment-metadata.d.ts +21 -0
  400. package/dist/utils/comment-metadata.d.ts.map +1 -0
  401. package/dist/utils/config-loader.d.ts.map +1 -1
  402. package/dist/utils/config-merger.d.ts.map +1 -1
  403. package/dist/utils/env-exposure.d.ts +3 -0
  404. package/dist/utils/env-exposure.d.ts.map +1 -0
  405. package/dist/utils/file-exclusion.d.ts.map +1 -1
  406. package/dist/utils/interactive-prompt.d.ts +1 -1
  407. package/dist/utils/interactive-prompt.d.ts.map +1 -1
  408. package/dist/utils/sandbox.d.ts.map +1 -1
  409. package/dist/utils/script-memory-ops.d.ts +21 -0
  410. package/dist/utils/script-memory-ops.d.ts.map +1 -0
  411. package/dist/utils/template-context.d.ts +7 -0
  412. package/dist/utils/template-context.d.ts.map +1 -0
  413. package/dist/webhook-server.d.ts +3 -3
  414. package/dist/webhook-server.d.ts.map +1 -1
  415. package/dist/workflow-executor.d.ts +81 -0
  416. package/dist/workflow-executor.d.ts.map +1 -0
  417. package/dist/workflow-registry.d.ts +79 -0
  418. package/dist/workflow-registry.d.ts.map +1 -0
  419. package/package.json +10 -5
  420. package/dist/output/traces/run-2025-10-22T18-22-56-873Z.ndjson +0 -218
  421. package/dist/sdk/check-execution-engine-2YYKUUSH.mjs +0 -11
  422. package/dist/sdk/check-execution-engine-6QJXYYON.mjs +0 -11
  423. package/dist/sdk/check-execution-engine-PJZ4ZOKG.mjs +0 -11
  424. package/dist/sdk/chunk-33QVZ2D4.mjs +0 -316
  425. package/dist/sdk/chunk-33QVZ2D4.mjs.map +0 -1
  426. package/dist/sdk/chunk-B5QBV2QJ.mjs +0 -752
  427. package/dist/sdk/chunk-B5QBV2QJ.mjs.map +0 -1
  428. package/dist/sdk/chunk-BVFNRCHT.mjs +0 -14129
  429. package/dist/sdk/chunk-BVFNRCHT.mjs.map +0 -1
  430. package/dist/sdk/chunk-KWZW23FG.mjs +0 -14129
  431. package/dist/sdk/chunk-KWZW23FG.mjs.map +0 -1
  432. package/dist/sdk/chunk-O4RP4BRH.mjs +0 -14092
  433. package/dist/sdk/chunk-O4RP4BRH.mjs.map +0 -1
  434. package/dist/sdk/chunk-TUTOLSFV.mjs.map +0 -1
  435. package/dist/sdk/chunk-U5D2LY66.mjs +0 -245
  436. package/dist/sdk/chunk-U5D2LY66.mjs.map +0 -1
  437. package/dist/sdk/chunk-U7X54EMV.mjs +0 -331
  438. package/dist/sdk/chunk-U7X54EMV.mjs.map +0 -1
  439. package/dist/sdk/config-merger-TWUBWFC2.mjs +0 -8
  440. package/dist/sdk/mermaid-telemetry-SN6A2TKW.mjs +0 -61
  441. package/dist/sdk/mermaid-telemetry-SN6A2TKW.mjs.map +0 -1
  442. package/dist/sdk/mermaid-telemetry-YCTIG76M.mjs +0 -61
  443. package/dist/sdk/mermaid-telemetry-YCTIG76M.mjs.map +0 -1
  444. package/dist/traces/run-2025-10-22T18-22-56-873Z.ndjson +0 -218
  445. /package/dist/sdk/{check-execution-engine-2YYKUUSH.mjs.map → config-M4ZNO6NU.mjs.map} +0 -0
  446. /package/dist/sdk/{check-execution-engine-6QJXYYON.mjs.map → config-merger-PX3WIT57.mjs.map} +0 -0
  447. /package/dist/sdk/{check-execution-engine-PJZ4ZOKG.mjs.map → failure-condition-evaluator-NBO5YRXW.mjs.map} +0 -0
  448. /package/dist/sdk/{config-merger-TWUBWFC2.mjs.map → liquid-extensions-C7EG3YKH.mjs.map} +0 -0
  449. /package/dist/sdk/{liquid-extensions-KVL4MKRH.mjs.map → memory-store-GJACZC2A.mjs.map} +0 -0
  450. /package/dist/sdk/{tracer-init-WC75N5NW.mjs.map → metrics-7PP3EJUH.mjs.map} +0 -0
@@ -0,0 +1,620 @@
1
+ version: "1.0"
2
+
3
+ # Simple agent: task-refinement
4
+ # - Collects user input, refines it with AI (skip code context), and loops until refined.
5
+ # - Returns final refined text via the `finish` step output.
6
+
7
+ steps:
8
+ ask:
9
+ type: human-input
10
+ group: task-refinement
11
+ # Allow multiple turns in the refinement loop; do not guard with an `if`
12
+ # No explicit event trigger; run in CLI by default but guard via if
13
+ prompt: |
14
+ {% assign last_refine = outputs_history.refine | last %}
15
+ {% if last_refine and last_refine.refined == false %}
16
+ {{ last_refine.text }}
17
+ {% else %}
18
+ Provide the task you want to accomplish. Be specific about constraints
19
+ (inputs, outputs, environment, success criteria).
20
+ {% endif %}
21
+ multiline: false
22
+ allow_empty: false
23
+ # No on_success.goto required — refine depends_on ask
24
+
25
+ refine:
26
+ type: ai
27
+ group: task-refinement
28
+ # Run only after 'ask' — dependency drives ordering
29
+ depends_on: [ask]
30
+ # Allow re-execution in loop turns (no if guard)
31
+ ai:
32
+ skip_code_context: true
33
+ disableTools: true
34
+ system_prompt: |
35
+ You are a helpful, precise task refinement assistant (role: requirements-analyst).
36
+ Your goal is to get to an agreed, testable task definition and clear acceptance criteria.
37
+ - Refine the user's task into an unambiguous, executable description with minimal assumptions.
38
+ - Define how correctness will be validated (objective success criteria and measurables).
39
+ - If information is missing, set refined=false and ask_user=true and put a single, specific
40
+ clarification question in the "text" field (one question at a time).
41
+ - If everything is sufficient, set refined=true and put the final refined wording in "text".
42
+ - Be succinct and concrete. Prefer measurable outcomes over vague phrasing.
43
+ - You can't mark plan as refined until explicit user confirmation/agreement is implied.
44
+ # Schema ensures the agent either finalizes or asks to clarify
45
+ schema:
46
+ type: object
47
+ additionalProperties: false
48
+ properties:
49
+ refined: { type: boolean, description: "true if the task is fully specified and accepted" }
50
+ text: { type: string, description: "final refined task or question to user" }
51
+ required: [refined, text]
52
+ prompt: |
53
+ <history>
54
+ {% assign umsgs = outputs_history.ask | default: [] %}
55
+ {% assign amsgs = outputs_history.refine | default: [] %}
56
+ {% assign merged = umsgs | concat: amsgs | sort: 'ts' %}
57
+ {% for m in merged %}
58
+ {% if m.refined != nil %}
59
+ <assistant>{{ m.text }}</assistant>
60
+ {% else %}
61
+ <user>{{ m.text }}</user>
62
+ {% endif %}
63
+ {% endfor %}
64
+ </history>
65
+
66
+ <input>
67
+ {{ outputs['ask'].text }}
68
+ </input>
69
+
70
+ # Loop control using fail_if + on_fail (no goto_js)
71
+ fail_if: "output['refined'] !== true"
72
+ on_fail:
73
+ goto: ask
74
+
75
+ plan-commands:
76
+ type: ai
77
+ group: task-refinement
78
+ depends_on: [refine]
79
+ reuse_ai_session: refine
80
+ session_mode: append
81
+ ai:
82
+ # Allow tools so the model can inspect the repo context if needed
83
+ disableTools: false
84
+ skip_code_context: true
85
+ system_prompt: |
86
+ You are a Task Validation Planner.
87
+ Produce a deterministic, minimal list of shell commands that, when executed in order,
88
+ validate that the refined task is complete for THIS repository/local env.
89
+ Constraints:
90
+ - Commands must be safe and non-destructive. Do not delete files or push to remotes.
91
+ - Prefer read-only checks and standard project commands (build, lint, test) when present.
92
+ - Each item is a single shell line; you may use && or || inside a line if necessary.
93
+ - Favor idempotent commands. Avoid interactive prompts.
94
+ - Detect package manager/tooling pragmatically (npm/pnpm/yarn/bun, eslint/biome, jest/vitest, etc.).
95
+ Return JSON with an array of strings under "commands" and optional "notes".
96
+ schema:
97
+ type: object
98
+ additionalProperties: false
99
+ properties:
100
+ commands:
101
+ type: array
102
+ minItems: 1
103
+ items: { type: string, minLength: 1 }
104
+ notes: { type: string }
105
+ required: [commands]
106
+ prompt: |
107
+ Refined task:
108
+ {{ outputs['refine'].text }}
109
+
110
+ If the repository has build/lint/test, include them. Otherwise propose basic checks that still
111
+ demonstrate completion (e.g., typecheck, compile, format verification, smoke run).
112
+
113
+ {% assign prev_conf_hist = outputs_history['confirm-interpret'] | default: [] %}
114
+ {% assign prev_run_hist = outputs_history['run-commands'] | default: [] %}
115
+ {% assign last_failed = nil %}
116
+ {% for r in prev_run_hist %}
117
+ {% if r.failed and r.failed > 0 %}
118
+ {% assign last_failed = r %}
119
+ {% endif %}
120
+ {% endfor %}
121
+ {% assign last_conf = prev_conf_hist | last %}
122
+ {% assign prev_run_count = prev_run_hist | size %}
123
+ {% assign last_run = prev_run_hist | last %}
124
+ {% if last_failed or prev_run_count > 0 %}
125
+ Previous attempt failed. Here are the details to learn from:
126
+ - Previous commands: {{ last_conf.commands | to_json }}
127
+ - Run results: {{ last_failed | default: last_run | to_json }}
128
+ Please revise the commands to address failures. Keep the list minimal and deterministic.
129
+ {% endif %}
130
+
131
+ Output strictly JSON per schema. No prose around it.
132
+ # No on_success routing needed; dependents naturally follow in the DAG
133
+
134
+ ask-confirm:
135
+ type: human-input
136
+ group: task-refinement
137
+ depends_on: [plan-commands]
138
+ prompt: |
139
+ Here is the proposed validation command list (to run sequentially):
140
+ {% for c in outputs['plan-commands'].commands %}
141
+ {{ forloop.index }}. {{ c }}
142
+ {% endfor %}
143
+
144
+ Confirm running these? Reply "yes" to accept, or provide edits:
145
+ - JSON array of commands, e.g. ["npm ci", "npm test"], or
146
+ - Plain text with one command per line.
147
+ placeholder: "yes | or paste modified list..."
148
+ multiline: true
149
+ allow_empty: true
150
+ default: "yes"
151
+
152
+ confirm-interpret:
153
+ type: ai
154
+ group: task-refinement
155
+ depends_on: [plan-commands, ask-confirm]
156
+ ai:
157
+ skip_code_context: true
158
+ disableTools: true
159
+ system_prompt: |
160
+ You are a confirmation interpreter. Given the planned command list and the user's reply,
161
+ decide whether to proceed to execution with a normalized list of shell commands, or
162
+ return for replanning.
163
+ - If the user says yes/approve, set proceed=true and provide commands as-is.
164
+ - If the user supplied edits (JSON array or one per line), parse, trim, dedupe, and set proceed=true with commands.
165
+ - If the reply indicates high-level changes (not runnable commands), set proceed=false and include a short reason.
166
+ Output strictly JSON per schema.
167
+ schema:
168
+ type: object
169
+ additionalProperties: false
170
+ properties:
171
+ proceed: { type: boolean }
172
+ commands:
173
+ type: array
174
+ items: { type: string, minLength: 1 }
175
+ reason: { type: string }
176
+ required: [proceed]
177
+ prompt: |
178
+ Planned commands:
179
+ {{ outputs['plan-commands'].commands | to_json }}
180
+
181
+ User reply:
182
+ {{ outputs['ask-confirm'].text }}
183
+
184
+ Return JSON per schema. If proceed=true, commands must be a non-empty array of shell lines.
185
+ fail_if: "output && output.proceed !== true"
186
+ on_fail:
187
+ goto: plan-commands
188
+
189
+ run-commands:
190
+ type: command
191
+ criticality: internal
192
+ group: task-refinement
193
+ depends_on: [confirm-interpret]
194
+ assume:
195
+ - "outputs['confirm-interpret']?.proceed === true"
196
+ - "(outputs['confirm-interpret']?.commands?.length ?? 0) > 0"
197
+ exec: |
198
+ node <<'NODE'
199
+ const { spawn } = require('child_process');
200
+ const cmds = {{ outputs['confirm-interpret'] | to_json }}.commands || [];
201
+ const results = [];
202
+ const runOne = (cmd) => new Promise((resolve) => {
203
+ const child = spawn('bash', ['-lc', cmd], { stdio: ['ignore', 'pipe', 'pipe'] });
204
+ let out = '', err = '';
205
+ const started = Date.now();
206
+ child.stdout.on('data', d => (out += d.toString()));
207
+ child.stderr.on('data', d => (err += d.toString()));
208
+ child.on('close', code => {
209
+ results.push({ cmd, code, stdout: out, stderr: err, durationMs: Date.now() - started });
210
+ resolve();
211
+ });
212
+ });
213
+ (async () => {
214
+ for (const c of cmds) { await runOne(c); }
215
+ const failed = results.filter(r => Number(r.code||0) !== 0).length;
216
+ process.stdout.write(JSON.stringify({ failed, results }));
217
+ })().catch(e => { process.stdout.write(JSON.stringify({ failed: 1, error: String(e) })); process.exit(0); });
218
+ NODE
219
+ output_format: json
220
+ schema:
221
+ type: object
222
+ additionalProperties: true
223
+ properties:
224
+ failed: { type: number }
225
+ results:
226
+ type: array
227
+ items:
228
+ type: object
229
+ additionalProperties: true
230
+ properties:
231
+ cmd: { type: string }
232
+ code: {}
233
+ stdout: { type: string }
234
+ stderr: { type: string }
235
+ durationMs: { type: number }
236
+ required: [cmd, code]
237
+ required: [failed]
238
+ fail_if: "output && Number(output.failed||0) > 0"
239
+ on_fail:
240
+ goto: plan-commands
241
+
242
+ finish:
243
+ type: log
244
+ group: task-refinement
245
+ depends_on: [run-commands]
246
+ if: "(outputs && outputs['run-commands'] && Number((outputs['run-commands'].failed||0)) === 0) && !(outputs && outputs['finish'])"
247
+ message: |
248
+ ✅ Refined Task:
249
+ {{ outputs['refine'].text }}
250
+
251
+ ✅ Validation commands (final):
252
+ {% for c in outputs['confirm-interpret'].commands %}
253
+ - {{ c }}
254
+ {% endfor %}
255
+ level: info
256
+ include_pr_context: false
257
+ include_dependencies: false
258
+ include_metadata: false
259
+
260
+ tests:
261
+ defaults:
262
+ strict: true
263
+ ai_provider: mock
264
+ cases:
265
+ - name: one-pass-refinement
266
+ description: Single turn; AI is happy and returns refined text.
267
+ event: manual
268
+ fixture: local.minimal
269
+ mocks:
270
+ ask: "Build a small Node CLI that prints \"hello\""
271
+ refine:
272
+ refined: true
273
+ text: "Create a Node.js CLI (using Node >=18) that prints 'hello' when run; include usage example and exit code 0."
274
+ plan-commands:
275
+ commands: ["echo hello-build", "echo hello-lint", "echo hello-test"]
276
+ ask-confirm: "yes"
277
+ confirm-interpret:
278
+ proceed: true
279
+ commands: ["echo hello-build","echo hello-lint","echo hello-test"]
280
+ run-commands:
281
+ stdout: '{"failed":0,"results":[{"cmd":"echo hello-build","code":0},{"cmd":"echo hello-lint","code":0},{"cmd":"echo hello-test","code":0}]}'
282
+ expect:
283
+ calls:
284
+ - step: plan-commands
285
+ exactly: 1
286
+ - step: ask-confirm
287
+ exactly: 1
288
+ - step: confirm-interpret
289
+ exactly: 1
290
+ - step: run-commands
291
+ exactly: 1
292
+ - step: ask
293
+ exactly: 1
294
+ - step: refine
295
+ exactly: 1
296
+ - step: finish
297
+ exactly: 1
298
+ outputs:
299
+ - step: run-commands
300
+ path: failed
301
+ equals: 0
302
+
303
+ - name: multi-turn-refinement-loop
304
+ description: Two clarifying turns followed by a final refinement; manual-only chat.
305
+ event: manual
306
+ fixture: local.minimal
307
+ mocks:
308
+ ask[]:
309
+ - "Create a CI job"
310
+ - "GitHub Actions; run on push to main"
311
+ - "Use Node 18 and npm ci + npm test"
312
+ refine[]:
313
+ - { refined: false, ask_user: true, text: "Which CI platform and trigger conditions?" }
314
+ - { refined: false, ask_user: true, text: "What Node version and commands should run?" }
315
+ - { refined: true, text: "Set up GitHub Actions workflow: on push to main, use Node 18.x, cache npm, run npm ci && npm test." }
316
+ plan-commands:
317
+ commands: ["echo build", "echo lint", "echo test"]
318
+ ask-confirm: "yes"
319
+ confirm-interpret:
320
+ proceed: true
321
+ commands: ["echo build","echo lint","echo test"]
322
+ run-commands:
323
+ stdout: '{"failed":0,"results":[{"cmd":"echo build","code":0},{"cmd":"echo lint","code":0},{"cmd":"echo test","code":0}]}'
324
+ expect:
325
+ calls:
326
+ - step: ask
327
+ exactly: 3
328
+ - step: refine
329
+ exactly: 3
330
+ - step: plan-commands
331
+ exactly: 1
332
+ - step: ask-confirm
333
+ exactly: 1
334
+ - step: confirm-interpret
335
+ exactly: 1
336
+ - step: run-commands
337
+ exactly: 1
338
+ - step: finish
339
+ exactly: 1
340
+ prompts:
341
+ # Ask prompt should surface the last refine clarification
342
+ - step: ask
343
+ index: 1
344
+ contains:
345
+ - "Which CI platform and trigger conditions?"
346
+ - step: ask
347
+ index: last
348
+ contains:
349
+ - "What Node version and commands should run?"
350
+ - step: refine
351
+ index: last
352
+ contains:
353
+ - "Which CI platform and trigger conditions?"
354
+ - "Use Node 18 and npm ci + npm test"
355
+ - "What Node version and commands should run?"
356
+ # Keep prompt assertions resilient to minor formatting changes by using 'contains'
357
+ # instead of a single large regex.
358
+ outputs:
359
+ # Ensure the final successful refinement carries a timestamp and expected text
360
+ - step: refine
361
+ where: { path: refined, equals: true }
362
+ path: ts
363
+ matches: "^\\d{10,}$"
364
+ - step: refine
365
+ where: { path: refined, equals: true }
366
+ path: text
367
+ matches: "(?is).*GitHub Actions.*Node 18.*npm ci.*npm test.*"
368
+ - step: run-commands
369
+ path: failed
370
+ equals: 0
371
+
372
+ - name: plan-and-run-success
373
+ description: Plans commands, user confirms, runs successfully, finishes.
374
+ event: manual
375
+ fixture: local.minimal
376
+ mocks:
377
+ ask: "Add CI to run build, lint, and tests"
378
+ refine:
379
+ refined: true
380
+ text: "Ensure project builds, lints, and tests pass via CI"
381
+ plan-commands:
382
+ commands: ["echo build", "echo lint", "echo test"]
383
+ ask-confirm: "yes"
384
+ confirm-interpret:
385
+ proceed: true
386
+ commands: ["echo build","echo lint","echo test"]
387
+ run-commands:
388
+ stdout: '{"failed":0,"results":[{"cmd":"echo build","code":0},{"cmd":"echo lint","code":0},{"cmd":"echo test","code":0}]}'
389
+ expect:
390
+ calls:
391
+ - step: ask
392
+ exactly: 1
393
+ - step: refine
394
+ exactly: 1
395
+ - step: plan-commands
396
+ exactly: 1
397
+ - step: ask-confirm
398
+ exactly: 1
399
+ - step: confirm-interpret
400
+ exactly: 1
401
+ - step: run-commands
402
+ exactly: 1
403
+ - step: finish
404
+ exactly: 1
405
+ outputs:
406
+ - step: run-commands
407
+ path: failed
408
+ equals: 0
409
+
410
+ - name: plan-run-fail-then-refine
411
+ description: First run fails, planner adjusts, second run passes, finish.
412
+ event: manual
413
+ fixture: local.minimal
414
+ mocks:
415
+ ask: "Verify app passes tests"
416
+ refine:
417
+ refined: true
418
+ text: "Run tests to verify app correctness"
419
+ plan-commands[]:
420
+ - { commands: ["node -e \"process.exit(1)\""] }
421
+ - { commands: ["node -e \"process.exit(0)\""] }
422
+ ask-confirm[]:
423
+ - "yes"
424
+ - "yes"
425
+ confirm-interpret:
426
+ proceed: true
427
+ commands: ["node -e \"process.exit(1)\""]
428
+ run-commands[]:
429
+ - { stdout: '{"failed":1,"results":[{"cmd":"node -e \\"process.exit(1)\\"","code":1,"stderr":"fail"}]}' , exit_code: 1 }
430
+ - { stdout: '{"failed":0,"results":[{"cmd":"node -e \\"process.exit(0)\\"","code":0}]}' }
431
+ expect:
432
+ calls:
433
+ - step: ask
434
+ exactly: 2
435
+ - step: refine
436
+ exactly: 2
437
+ - step: plan-commands
438
+ exactly: 2
439
+ - step: ask-confirm
440
+ exactly: 2
441
+ - step: confirm-interpret
442
+ exactly: 2
443
+ - step: run-commands
444
+ exactly: 2
445
+ - step: finish
446
+ exactly: 1
447
+ prompts:
448
+ - step: plan-commands
449
+ index: last
450
+ contains:
451
+ - "Previous attempt failed"
452
+ - "Run results"
453
+
454
+ - name: confirm-amend-json
455
+ description: User pastes JSON array of edited commands; interpreter parses and proceeds.
456
+ event: manual
457
+ fixture: local.minimal
458
+ mocks:
459
+ ask: "Make sure project installs deps and runs tests"
460
+ refine:
461
+ refined: true
462
+ text: "Install dependencies and run tests"
463
+ plan-commands:
464
+ commands: ["npm test"]
465
+ ask-confirm: '["npm ci","npm test"]'
466
+ confirm-interpret:
467
+ proceed: true
468
+ commands: ["npm ci","npm test"]
469
+ run-commands:
470
+ stdout: '{"failed":0,"results":[{"cmd":"npm ci","code":0},{"cmd":"npm test","code":0}]}'
471
+ expect:
472
+ calls:
473
+ - step: ask
474
+ exactly: 1
475
+ - step: refine
476
+ exactly: 1
477
+ - step: plan-commands
478
+ exactly: 1
479
+ - step: ask-confirm
480
+ exactly: 1
481
+ - step: confirm-interpret
482
+ exactly: 1
483
+ - step: run-commands
484
+ exactly: 1
485
+ - step: finish
486
+ exactly: 1
487
+ outputs:
488
+ - step: confirm-interpret
489
+ path: proceed
490
+ equals: true
491
+ - step: confirm-interpret
492
+ path: commands.length
493
+ equals: 2
494
+
495
+ - name: confirm-amend-lines
496
+ description: User pastes multi-line commands with duplicates; interpreter dedupes and proceeds.
497
+ event: manual
498
+ fixture: local.minimal
499
+ mocks:
500
+ ask: "Run lint and tests"
501
+ refine:
502
+ refined: true
503
+ text: "Run lint and tests"
504
+ plan-commands:
505
+ commands: ["npm run lint","npm test"]
506
+ ask-confirm: |
507
+ npm test\nnpm test\n npm run lint
508
+ confirm-interpret:
509
+ proceed: true
510
+ commands: ["npm test","npm run lint"]
511
+ run-commands:
512
+ stdout: '{"failed":0,"results":[{"cmd":"npm test","code":0},{"cmd":"npm run lint","code":0}]}'
513
+ expect:
514
+ calls:
515
+ - step: ask
516
+ exactly: 1
517
+ - step: refine
518
+ exactly: 1
519
+ - step: plan-commands
520
+ exactly: 1
521
+ - step: ask-confirm
522
+ exactly: 1
523
+ - step: confirm-interpret
524
+ exactly: 1
525
+ - step: run-commands
526
+ exactly: 1
527
+ - step: finish
528
+ exactly: 1
529
+ outputs:
530
+ - step: confirm-interpret
531
+ path: proceed
532
+ equals: true
533
+ - step: confirm-interpret
534
+ path: commands.length
535
+ equals: 2
536
+
537
+ - name: user-declines-replan-then-accept
538
+ description: User declines; interpreter routes to replan; user then accepts; run succeeds.
539
+ event: manual
540
+ fixture: local.minimal
541
+ mocks:
542
+ ask: "Set up lint and test checks"
543
+ refine:
544
+ refined: true
545
+ text: "Ensure lint and tests run"
546
+ plan-commands[]:
547
+ - { commands: ["npm test"] }
548
+ - { commands: ["npm run lint","npm test"] }
549
+ ask-confirm[]:
550
+ - "No, add lint too"
551
+ - "yes"
552
+ confirm-interpret[]:
553
+ - { proceed: false, reason: "needs lint" }
554
+ - { proceed: true, commands: ["npm run lint","npm test"] }
555
+ run-commands:
556
+ stdout: '{"failed":0,"results":[{"cmd":"npm run lint","code":0},{"cmd":"npm test","code":0}]}'
557
+ expect:
558
+ calls:
559
+ - step: ask
560
+ at_least: 1
561
+ - step: refine
562
+ at_least: 1
563
+ - step: plan-commands
564
+ exactly: 2
565
+ - step: ask-confirm
566
+ exactly: 2
567
+ - step: confirm-interpret
568
+ exactly: 2
569
+ - step: run-commands
570
+ exactly: 1
571
+ - step: finish
572
+ exactly: 1
573
+ outputs:
574
+ - step: confirm-interpret
575
+ index: last
576
+ path: proceed
577
+ equals: true
578
+
579
+ - name: run-fail-then-success-loop
580
+ description: First run fails; planner sees history; second run succeeds; prompt shows failure context.
581
+ event: manual
582
+ strict: false
583
+ fixture: local.minimal
584
+ mocks:
585
+ ask: "Verify app tests pass"
586
+ refine:
587
+ refined: true
588
+ text: "Run tests to verify app correctness"
589
+ plan-commands[]:
590
+ - { commands: ["node -e \"process.exit(1)\""] }
591
+ - { commands: ["echo ok"] }
592
+ ask-confirm[]:
593
+ - "yes"
594
+ - "yes"
595
+ confirm-interpret[]:
596
+ - { proceed: true, commands: ["node -e \"process.exit(1)\""] }
597
+ - { proceed: true, commands: ["echo ok"] }
598
+ run-commands[]:
599
+ - { stdout: '{"failed":1,"results":[{"cmd":"node -e \\"process.exit(1)\\"","code":1,"stderr":"fail"}]}' , exit_code: 1 }
600
+ - { stdout: '{"failed":0,"results":[{"cmd":"echo ok","code":0}]}' }
601
+ expect:
602
+ calls:
603
+ - step: ask
604
+ at_least: 1
605
+ - step: refine
606
+ at_least: 1
607
+ - step: plan-commands
608
+ exactly: 2
609
+ - step: ask-confirm
610
+ exactly: 2
611
+ - step: confirm-interpret
612
+ exactly: 2
613
+ - step: run-commands
614
+ exactly: 2
615
+ prompts:
616
+ - step: plan-commands
617
+ index: last
618
+ contains:
619
+ - "Previous attempt failed"
620
+ - "Run results"