@exaudeus/workrail 0.8.5 → 0.9.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 (424) hide show
  1. package/README.md +157 -403
  2. package/dist/application/services/enhanced-loop-validator.d.ts +2 -2
  3. package/dist/application/services/enhanced-loop-validator.js +12 -2
  4. package/dist/application/services/validation-engine.d.ts +8 -29
  5. package/dist/application/services/validation-engine.js +38 -21
  6. package/dist/application/services/workflow-compiler.d.ts +18 -0
  7. package/dist/application/services/workflow-compiler.js +79 -0
  8. package/dist/application/services/workflow-interpreter.d.ts +31 -0
  9. package/dist/application/services/workflow-interpreter.js +280 -0
  10. package/dist/application/services/workflow-service.d.ts +34 -32
  11. package/dist/application/services/workflow-service.js +93 -425
  12. package/dist/application/use-cases/get-next-step.d.ts +6 -10
  13. package/dist/application/use-cases/get-next-step.js +2 -6
  14. package/dist/application/use-cases/get-workflow.d.ts +8 -6
  15. package/dist/application/use-cases/get-workflow.js +42 -33
  16. package/dist/application/use-cases/list-workflows.d.ts +3 -3
  17. package/dist/application/use-cases/validate-step-output.d.ts +4 -4
  18. package/dist/application/use-cases/validate-workflow-file.d.ts +46 -0
  19. package/dist/application/use-cases/validate-workflow-file.js +57 -0
  20. package/dist/cli/commands/cleanup.d.ts +8 -0
  21. package/dist/cli/commands/cleanup.js +20 -0
  22. package/dist/cli/commands/index.d.ts +7 -0
  23. package/dist/cli/commands/index.js +21 -0
  24. package/dist/cli/commands/init.d.ts +11 -0
  25. package/dist/cli/commands/init.js +49 -0
  26. package/dist/cli/commands/list.d.ts +9 -0
  27. package/dist/cli/commands/list.js +34 -0
  28. package/dist/cli/commands/migrate.d.ts +78 -0
  29. package/dist/cli/commands/migrate.js +248 -0
  30. package/dist/cli/commands/sources.d.ts +21 -0
  31. package/dist/cli/commands/sources.js +87 -0
  32. package/dist/cli/commands/start.d.ts +8 -0
  33. package/dist/cli/commands/start.js +16 -0
  34. package/dist/cli/commands/validate.d.ts +6 -0
  35. package/dist/cli/commands/validate.js +55 -0
  36. package/dist/cli/interpret-result.d.ts +4 -0
  37. package/dist/cli/interpret-result.js +24 -0
  38. package/dist/cli/output-formatter.d.ts +10 -0
  39. package/dist/cli/output-formatter.js +97 -0
  40. package/dist/cli/types/cli-result.d.ts +23 -0
  41. package/dist/cli/types/cli-result.js +30 -0
  42. package/dist/cli/types/exit-code.d.ts +13 -0
  43. package/dist/cli/types/exit-code.js +23 -0
  44. package/dist/cli/types/index.d.ts +4 -0
  45. package/dist/cli/types/index.js +11 -0
  46. package/dist/cli.js +84 -278
  47. package/dist/config/app-config.d.ts +40 -0
  48. package/dist/config/app-config.js +58 -0
  49. package/dist/config/feature-flags.d.ts +10 -2
  50. package/dist/config/feature-flags.js +74 -12
  51. package/dist/core/error-handler.d.ts +18 -27
  52. package/dist/core/error-handler.js +24 -218
  53. package/dist/di/container.d.ts +12 -0
  54. package/dist/di/container.js +244 -0
  55. package/dist/di/tokens.d.ts +40 -0
  56. package/dist/di/tokens.js +42 -0
  57. package/dist/domain/execution/error.d.ts +32 -0
  58. package/dist/domain/execution/error.js +24 -0
  59. package/dist/domain/execution/event.d.ts +7 -0
  60. package/dist/domain/execution/event.js +11 -0
  61. package/dist/domain/execution/ids.d.ts +9 -0
  62. package/dist/domain/execution/ids.js +9 -0
  63. package/dist/domain/execution/result.d.ts +3 -0
  64. package/dist/domain/execution/result.js +10 -0
  65. package/dist/domain/execution/state.d.ts +57 -0
  66. package/dist/domain/execution/state.js +28 -0
  67. package/dist/errors/app-error.d.ts +23 -0
  68. package/dist/errors/factories.d.ts +6 -0
  69. package/dist/errors/factories.js +21 -0
  70. package/dist/errors/formatter.d.ts +2 -0
  71. package/dist/errors/formatter.js +32 -0
  72. package/dist/errors/index.d.ts +3 -0
  73. package/dist/errors/index.js +7 -0
  74. package/dist/index.d.ts +6 -1
  75. package/dist/index.js +10 -25
  76. package/dist/infrastructure/index.d.ts +0 -1
  77. package/dist/infrastructure/index.js +0 -1
  78. package/dist/infrastructure/session/DashboardHeartbeat.d.ts +8 -0
  79. package/dist/infrastructure/session/DashboardHeartbeat.js +39 -0
  80. package/dist/infrastructure/session/DashboardLockRelease.d.ts +2 -0
  81. package/dist/infrastructure/session/DashboardLockRelease.js +29 -0
  82. package/dist/infrastructure/session/HttpServer.d.ts +25 -6
  83. package/dist/infrastructure/session/HttpServer.js +245 -90
  84. package/dist/infrastructure/session/SessionDataNormalizer.js +12 -2
  85. package/dist/infrastructure/session/SessionDataValidator.js +12 -2
  86. package/dist/infrastructure/session/SessionManager.d.ts +5 -3
  87. package/dist/infrastructure/session/SessionManager.js +52 -6
  88. package/dist/infrastructure/storage/caching-workflow-storage.d.ts +30 -6
  89. package/dist/infrastructure/storage/caching-workflow-storage.js +105 -23
  90. package/dist/infrastructure/storage/enhanced-multi-source-workflow-storage.d.ts +13 -9
  91. package/dist/infrastructure/storage/enhanced-multi-source-workflow-storage.js +80 -54
  92. package/dist/infrastructure/storage/file-workflow-storage.d.ts +10 -8
  93. package/dist/infrastructure/storage/file-workflow-storage.js +48 -56
  94. package/dist/infrastructure/storage/git-workflow-storage.d.ts +7 -22
  95. package/dist/infrastructure/storage/git-workflow-storage.js +48 -103
  96. package/dist/infrastructure/storage/in-memory-storage.d.ts +10 -6
  97. package/dist/infrastructure/storage/in-memory-storage.js +18 -13
  98. package/dist/infrastructure/storage/plugin-workflow-storage.d.ts +6 -18
  99. package/dist/infrastructure/storage/plugin-workflow-storage.js +29 -51
  100. package/dist/infrastructure/storage/remote-workflow-storage.d.ts +8 -17
  101. package/dist/infrastructure/storage/remote-workflow-storage.js +33 -156
  102. package/dist/infrastructure/storage/schema-validating-workflow-storage.d.ts +21 -13
  103. package/dist/infrastructure/storage/schema-validating-workflow-storage.js +86 -24
  104. package/dist/infrastructure/storage/storage.d.ts +7 -5
  105. package/dist/infrastructure/storage/storage.js +7 -6
  106. package/dist/manifest.json +1093 -0
  107. package/dist/mcp/error-mapper.d.ts +9 -0
  108. package/dist/mcp/error-mapper.js +66 -0
  109. package/dist/mcp/handlers/session.d.ts +34 -0
  110. package/dist/mcp/handlers/session.js +135 -0
  111. package/dist/mcp/handlers/v2-workflow.d.ts +4 -0
  112. package/dist/mcp/handlers/v2-workflow.js +112 -0
  113. package/dist/mcp/handlers/workflow.d.ts +45 -0
  114. package/dist/mcp/handlers/workflow.js +167 -0
  115. package/dist/mcp/index.d.ts +16 -0
  116. package/dist/mcp/index.js +51 -0
  117. package/dist/mcp/output-schemas.d.ts +317 -0
  118. package/dist/mcp/output-schemas.js +91 -0
  119. package/dist/mcp/server.d.ts +3 -0
  120. package/dist/mcp/server.js +258 -0
  121. package/dist/mcp/tool-description-provider.d.ts +16 -0
  122. package/dist/mcp/tool-description-provider.js +43 -0
  123. package/dist/mcp/tool-descriptions.d.ts +2 -0
  124. package/dist/mcp/tool-descriptions.js +109 -0
  125. package/dist/mcp/tool-factory.d.ts +23 -0
  126. package/dist/mcp/tool-factory.js +14 -0
  127. package/dist/mcp/tools.d.ts +156 -0
  128. package/dist/mcp/tools.js +196 -0
  129. package/dist/mcp/types/tool-description-types.d.ts +8 -0
  130. package/dist/mcp/types/tool-description-types.js +24 -0
  131. package/dist/mcp/types.d.ts +25 -0
  132. package/dist/mcp/types.js +15 -0
  133. package/dist/mcp/v2/tool-registry.d.ts +11 -0
  134. package/dist/mcp/v2/tool-registry.js +26 -0
  135. package/dist/mcp/v2/tools.d.ts +20 -0
  136. package/dist/mcp/v2/tools.js +17 -0
  137. package/dist/mcp/validation/bounded-json.d.ts +3 -0
  138. package/dist/mcp/validation/bounded-json.js +22 -0
  139. package/dist/mcp/validation/workflow-next-prevalidate.d.ts +9 -0
  140. package/dist/mcp/validation/workflow-next-prevalidate.js +83 -0
  141. package/dist/mcp/zod-to-json-schema.d.ts +17 -0
  142. package/dist/mcp/zod-to-json-schema.js +134 -0
  143. package/dist/mcp-server.d.ts +1 -1
  144. package/dist/mcp-server.js +6 -424
  145. package/dist/runtime/adapters/in-memory-shutdown-events.d.ts +6 -0
  146. package/dist/runtime/adapters/in-memory-shutdown-events.js +20 -0
  147. package/dist/runtime/adapters/node-process-signals.d.ts +4 -0
  148. package/dist/runtime/adapters/node-process-signals.js +11 -0
  149. package/dist/runtime/adapters/node-process-terminator.d.ts +4 -0
  150. package/dist/runtime/adapters/node-process-terminator.js +17 -0
  151. package/dist/runtime/adapters/noop-process-signals.d.ts +4 -0
  152. package/dist/runtime/adapters/noop-process-signals.js +8 -0
  153. package/dist/runtime/adapters/throwing-process-terminator.d.ts +4 -0
  154. package/dist/runtime/adapters/throwing-process-terminator.js +9 -0
  155. package/dist/runtime/assert-never.d.ts +1 -0
  156. package/dist/runtime/assert-never.js +6 -0
  157. package/dist/runtime/brand.d.ts +5 -0
  158. package/dist/runtime/ports/process-signals.d.ts +4 -0
  159. package/dist/runtime/ports/process-signals.js +2 -0
  160. package/dist/runtime/ports/process-terminator.d.ts +8 -0
  161. package/dist/runtime/ports/process-terminator.js +2 -0
  162. package/dist/runtime/ports/shutdown-events.d.ts +11 -0
  163. package/dist/runtime/ports/shutdown-events.js +2 -0
  164. package/dist/runtime/process-lifecycle-policy.d.ts +5 -0
  165. package/dist/runtime/process-lifecycle-policy.js +2 -0
  166. package/dist/runtime/result.d.ts +17 -0
  167. package/dist/runtime/result.js +31 -0
  168. package/dist/runtime/runtime-mode.d.ts +9 -0
  169. package/dist/runtime/runtime-mode.js +2 -0
  170. package/dist/types/storage.d.ts +16 -5
  171. package/dist/types/storage.js +8 -0
  172. package/dist/types/validation.d.ts +27 -0
  173. package/dist/types/validation.js +10 -0
  174. package/dist/types/workflow-definition.d.ts +63 -0
  175. package/dist/types/workflow-definition.js +33 -0
  176. package/dist/types/workflow-source.d.ts +51 -0
  177. package/dist/types/workflow-source.js +128 -0
  178. package/dist/types/workflow.d.ts +28 -0
  179. package/dist/types/workflow.js +96 -0
  180. package/dist/utils/workflow-init.d.ts +1 -0
  181. package/dist/utils/workflow-init.js +38 -0
  182. package/dist/v2/durable-core/canonical/hashing.d.ts +11 -0
  183. package/dist/v2/durable-core/canonical/hashing.js +13 -0
  184. package/dist/v2/durable-core/canonical/jcs.d.ts +11 -0
  185. package/dist/v2/durable-core/canonical/jcs.js +65 -0
  186. package/dist/v2/durable-core/canonical/json-types.d.ts +6 -0
  187. package/dist/v2/durable-core/canonical/json-types.js +2 -0
  188. package/dist/v2/durable-core/canonical/json-zod.d.ts +2 -0
  189. package/dist/v2/durable-core/canonical/json-zod.js +7 -0
  190. package/dist/v2/durable-core/canonical/jsonl.d.ts +4 -0
  191. package/dist/v2/durable-core/canonical/jsonl.js +13 -0
  192. package/dist/v2/durable-core/ids/index.d.ts +23 -0
  193. package/dist/v2/durable-core/ids/index.js +46 -0
  194. package/dist/v2/durable-core/schemas/compiled-workflow/index.d.ts +47 -0
  195. package/dist/v2/durable-core/schemas/compiled-workflow/index.js +17 -0
  196. package/dist/v2/durable-core/schemas/session/events.d.ts +1812 -0
  197. package/dist/v2/durable-core/schemas/session/events.js +328 -0
  198. package/dist/v2/durable-core/schemas/session/index.d.ts +2 -0
  199. package/dist/v2/durable-core/schemas/session/index.js +8 -0
  200. package/dist/v2/durable-core/schemas/session/manifest.d.ts +57 -0
  201. package/dist/v2/durable-core/schemas/session/manifest.js +30 -0
  202. package/dist/v2/infra/local/crypto/index.d.ts +5 -0
  203. package/dist/v2/infra/local/crypto/index.js +12 -0
  204. package/dist/v2/infra/local/data-dir/index.d.ts +13 -0
  205. package/dist/v2/infra/local/data-dir/index.js +69 -0
  206. package/dist/v2/infra/local/fs/index.d.ts +26 -0
  207. package/dist/v2/infra/local/fs/index.js +156 -0
  208. package/dist/v2/infra/local/pinned-workflow-store/index.d.ts +11 -0
  209. package/dist/v2/infra/local/pinned-workflow-store/index.js +85 -0
  210. package/dist/v2/infra/local/session-lock/index.d.ts +12 -0
  211. package/dist/v2/infra/local/session-lock/index.js +44 -0
  212. package/dist/v2/infra/local/session-store/index.d.ts +22 -0
  213. package/dist/v2/infra/local/session-store/index.js +358 -0
  214. package/dist/v2/infra/local/sha256/index.d.ts +5 -0
  215. package/dist/v2/infra/local/sha256/index.js +12 -0
  216. package/dist/v2/ports/data-dir.port.d.ts +9 -0
  217. package/dist/v2/ports/data-dir.port.js +2 -0
  218. package/dist/v2/ports/fs.port.d.ts +41 -0
  219. package/dist/v2/ports/fs.port.js +2 -0
  220. package/dist/v2/ports/pinned-workflow-store.port.d.ts +11 -0
  221. package/dist/v2/ports/pinned-workflow-store.port.js +2 -0
  222. package/dist/v2/ports/session-event-log-store.port.d.ts +37 -0
  223. package/dist/v2/ports/session-event-log-store.port.js +2 -0
  224. package/dist/v2/ports/session-lock.port.d.ts +23 -0
  225. package/dist/v2/ports/session-lock.port.js +2 -0
  226. package/dist/v2/ports/sha256.port.d.ts +4 -0
  227. package/dist/v2/ports/sha256.port.js +2 -0
  228. package/dist/v2/projections/advance-outcomes.d.ts +23 -0
  229. package/dist/v2/projections/advance-outcomes.js +23 -0
  230. package/dist/v2/projections/capabilities.d.ts +27 -0
  231. package/dist/v2/projections/capabilities.js +33 -0
  232. package/dist/v2/projections/gaps.d.ts +29 -0
  233. package/dist/v2/projections/gaps.js +49 -0
  234. package/dist/v2/projections/node-outputs.d.ts +34 -0
  235. package/dist/v2/projections/node-outputs.js +73 -0
  236. package/dist/v2/projections/preferences.d.ts +28 -0
  237. package/dist/v2/projections/preferences.js +50 -0
  238. package/dist/v2/projections/run-dag.d.ts +42 -0
  239. package/dist/v2/projections/run-dag.js +186 -0
  240. package/dist/v2/projections/run-status-signals.d.ts +26 -0
  241. package/dist/v2/projections/run-status-signals.js +49 -0
  242. package/dist/v2/projections/session-health.d.ts +18 -0
  243. package/dist/v2/projections/session-health.js +15 -0
  244. package/dist/v2/read-only/v1-to-v2-shim.d.ts +3 -0
  245. package/dist/v2/read-only/v1-to-v2-shim.js +38 -0
  246. package/package.json +35 -10
  247. package/spec/mcp-api-v1.0.md +5 -5
  248. package/web/assets/services/data-normalizer.js +17 -2
  249. package/web/assets/services/pattern-recognizer.js +3 -1
  250. package/web/assets/services/session-data.js +13 -8
  251. package/web/assets/utils/formatters.js +34 -23
  252. package/workflows/CHANGELOG-bug-investigation.md +4 -4
  253. package/workflows/bug-investigation.agentic.json +156 -56
  254. package/workflows/coding-task-workflow-agentic.json +262 -0
  255. package/workflows/design-thinking-workflow-autonomous.agentic.json +215 -0
  256. package/workflows/design-thinking-workflow.json +198 -0
  257. package/workflows/mr-review-workflow.agentic.json +538 -0
  258. package/workflows/routines/context-gathering.json +0 -4
  259. package/workflows/routines/ideation.json +73 -0
  260. package/dist/application/app.d.ts +0 -29
  261. package/dist/application/app.d.ts.map +0 -1
  262. package/dist/application/app.js +0 -114
  263. package/dist/application/app.js.map +0 -1
  264. package/dist/application/decorators/simple-output-decorator.d.ts +0 -8
  265. package/dist/application/decorators/simple-output-decorator.js +0 -89
  266. package/dist/application/services/classification-engine.d.ts +0 -33
  267. package/dist/application/services/classification-engine.js +0 -258
  268. package/dist/application/services/compression-service.d.ts +0 -20
  269. package/dist/application/services/compression-service.js +0 -312
  270. package/dist/application/services/context-management-service.d.ts +0 -38
  271. package/dist/application/services/context-management-service.js +0 -301
  272. package/dist/application/services/context-optimizer.d.ts +0 -11
  273. package/dist/application/services/context-optimizer.js +0 -62
  274. package/dist/application/services/context-persistence-service.d.ts +0 -45
  275. package/dist/application/services/context-persistence-service.js +0 -273
  276. package/dist/application/services/documentation-service.d.ts +0 -20
  277. package/dist/application/services/documentation-service.js +0 -155
  278. package/dist/application/services/enhanced-error-service.d.ts.map +0 -1
  279. package/dist/application/services/enhanced-error-service.js.map +0 -1
  280. package/dist/application/services/loop-context-optimizer.d.ts +0 -8
  281. package/dist/application/services/loop-context-optimizer.js +0 -114
  282. package/dist/application/services/loop-execution-context.d.ts +0 -23
  283. package/dist/application/services/loop-execution-context.js +0 -188
  284. package/dist/application/services/loop-step-resolver.d.ts +0 -11
  285. package/dist/application/services/loop-step-resolver.js +0 -70
  286. package/dist/application/services/validation-engine.d.ts.map +0 -1
  287. package/dist/application/services/validation-engine.js.map +0 -1
  288. package/dist/application/services/workflow-service.d.ts.map +0 -1
  289. package/dist/application/services/workflow-service.js.map +0 -1
  290. package/dist/application/use-cases/get-next-step.d.ts.map +0 -1
  291. package/dist/application/use-cases/get-next-step.js.map +0 -1
  292. package/dist/application/use-cases/get-workflow-docs.d.ts +0 -4
  293. package/dist/application/use-cases/get-workflow-docs.js +0 -12
  294. package/dist/application/use-cases/get-workflow.d.ts.map +0 -1
  295. package/dist/application/use-cases/get-workflow.js.map +0 -1
  296. package/dist/application/use-cases/get-workrail-help.d.ts +0 -4
  297. package/dist/application/use-cases/get-workrail-help.js +0 -12
  298. package/dist/application/use-cases/list-workflows.d.ts.map +0 -1
  299. package/dist/application/use-cases/list-workflows.js.map +0 -1
  300. package/dist/application/use-cases/validate-step-output.d.ts.map +0 -1
  301. package/dist/application/use-cases/validate-step-output.js.map +0 -1
  302. package/dist/application/use-cases/validate-workflow-json.d.ts.map +0 -1
  303. package/dist/application/use-cases/validate-workflow-json.js.map +0 -1
  304. package/dist/application/validation.d.ts.map +0 -1
  305. package/dist/application/validation.js.map +0 -1
  306. package/dist/cli/migrate-workflow.d.ts +0 -22
  307. package/dist/cli/migrate-workflow.js +0 -196
  308. package/dist/cli.d.ts.map +0 -1
  309. package/dist/cli.js.map +0 -1
  310. package/dist/container.d.ts +0 -15
  311. package/dist/container.d.ts.map +0 -1
  312. package/dist/container.js +0 -25
  313. package/dist/container.js.map +0 -1
  314. package/dist/core/error-handler.d.ts.map +0 -1
  315. package/dist/core/error-handler.js.map +0 -1
  316. package/dist/domain/index.d.ts +0 -2
  317. package/dist/domain/index.d.ts.map +0 -1
  318. package/dist/domain/index.js +0 -18
  319. package/dist/domain/index.js.map +0 -1
  320. package/dist/index.d.ts.map +0 -1
  321. package/dist/index.js.map +0 -1
  322. package/dist/infrastructure/index.d.ts.map +0 -1
  323. package/dist/infrastructure/index.js.map +0 -1
  324. package/dist/infrastructure/rpc/handler.d.ts +0 -17
  325. package/dist/infrastructure/rpc/handler.d.ts.map +0 -1
  326. package/dist/infrastructure/rpc/handler.js +0 -78
  327. package/dist/infrastructure/rpc/handler.js.map +0 -1
  328. package/dist/infrastructure/rpc/index.d.ts +0 -1
  329. package/dist/infrastructure/rpc/index.d.ts.map +0 -1
  330. package/dist/infrastructure/rpc/index.js +0 -17
  331. package/dist/infrastructure/rpc/index.js.map +0 -1
  332. package/dist/infrastructure/rpc/server.d.ts +0 -3
  333. package/dist/infrastructure/rpc/server.d.ts.map +0 -1
  334. package/dist/infrastructure/rpc/server.js +0 -37
  335. package/dist/infrastructure/rpc/server.js.map +0 -1
  336. package/dist/infrastructure/storage/caching-workflow-storage.d.ts.map +0 -1
  337. package/dist/infrastructure/storage/caching-workflow-storage.js.map +0 -1
  338. package/dist/infrastructure/storage/context-storage.d.ts +0 -150
  339. package/dist/infrastructure/storage/context-storage.js +0 -40
  340. package/dist/infrastructure/storage/file-workflow-storage.d.ts.map +0 -1
  341. package/dist/infrastructure/storage/file-workflow-storage.js.map +0 -1
  342. package/dist/infrastructure/storage/filesystem-blob-storage.d.ts +0 -27
  343. package/dist/infrastructure/storage/filesystem-blob-storage.js +0 -363
  344. package/dist/infrastructure/storage/git-workflow-storage.d.ts.map +0 -1
  345. package/dist/infrastructure/storage/git-workflow-storage.js.map +0 -1
  346. package/dist/infrastructure/storage/hybrid-context-storage.d.ts +0 -29
  347. package/dist/infrastructure/storage/hybrid-context-storage.js +0 -400
  348. package/dist/infrastructure/storage/in-memory-storage.d.ts.map +0 -1
  349. package/dist/infrastructure/storage/in-memory-storage.js.map +0 -1
  350. package/dist/infrastructure/storage/index.d.ts.map +0 -1
  351. package/dist/infrastructure/storage/index.js.map +0 -1
  352. package/dist/infrastructure/storage/migrations/001_initial_schema.sql +0 -38
  353. package/dist/infrastructure/storage/migrations/002_context_concurrency_enhancements.sql +0 -234
  354. package/dist/infrastructure/storage/migrations/003_classification_overrides.sql +0 -20
  355. package/dist/infrastructure/storage/multi-directory-workflow-storage.d.ts +0 -32
  356. package/dist/infrastructure/storage/multi-directory-workflow-storage.d.ts.map +0 -1
  357. package/dist/infrastructure/storage/multi-directory-workflow-storage.js +0 -184
  358. package/dist/infrastructure/storage/multi-directory-workflow-storage.js.map +0 -1
  359. package/dist/infrastructure/storage/plugin-workflow-storage.d.ts.map +0 -1
  360. package/dist/infrastructure/storage/plugin-workflow-storage.js.map +0 -1
  361. package/dist/infrastructure/storage/remote-workflow-storage.d.ts.map +0 -1
  362. package/dist/infrastructure/storage/remote-workflow-storage.js.map +0 -1
  363. package/dist/infrastructure/storage/schema-validating-workflow-storage.d.ts.map +0 -1
  364. package/dist/infrastructure/storage/schema-validating-workflow-storage.js.map +0 -1
  365. package/dist/infrastructure/storage/sqlite-metadata-storage.d.ts +0 -35
  366. package/dist/infrastructure/storage/sqlite-metadata-storage.js +0 -410
  367. package/dist/infrastructure/storage/sqlite-migrator.d.ts +0 -46
  368. package/dist/infrastructure/storage/sqlite-migrator.js +0 -293
  369. package/dist/infrastructure/storage/storage.d.ts.map +0 -1
  370. package/dist/infrastructure/storage/storage.js.map +0 -1
  371. package/dist/mcp-server.d.ts.map +0 -1
  372. package/dist/mcp-server.js.map +0 -1
  373. package/dist/tools/mcp_initialize.d.ts +0 -2
  374. package/dist/tools/mcp_initialize.d.ts.map +0 -1
  375. package/dist/tools/mcp_initialize.js +0 -45
  376. package/dist/tools/mcp_initialize.js.map +0 -1
  377. package/dist/tools/mcp_shutdown.d.ts +0 -2
  378. package/dist/tools/mcp_shutdown.d.ts.map +0 -1
  379. package/dist/tools/mcp_shutdown.js +0 -10
  380. package/dist/tools/mcp_shutdown.js.map +0 -1
  381. package/dist/tools/mcp_tools_list.d.ts +0 -2
  382. package/dist/tools/mcp_tools_list.d.ts.map +0 -1
  383. package/dist/tools/mcp_tools_list.js +0 -60
  384. package/dist/tools/mcp_tools_list.js.map +0 -1
  385. package/dist/tools/session-tools.d.ts +0 -5
  386. package/dist/tools/session-tools.js +0 -270
  387. package/dist/types/context-types.d.ts +0 -236
  388. package/dist/types/context-types.js +0 -10
  389. package/dist/types/documentation-types.d.ts +0 -37
  390. package/dist/types/loop-context-optimizer.d.ts +0 -7
  391. package/dist/types/mcp-types.d.ts +0 -273
  392. package/dist/types/mcp-types.d.ts.map +0 -1
  393. package/dist/types/mcp-types.js +0 -19
  394. package/dist/types/mcp-types.js.map +0 -1
  395. package/dist/types/server.d.ts.map +0 -1
  396. package/dist/types/server.js.map +0 -1
  397. package/dist/types/storage.d.ts.map +0 -1
  398. package/dist/types/storage.js.map +0 -1
  399. package/dist/types/workflow-types.d.ts +0 -336
  400. package/dist/types/workflow-types.d.ts.map +0 -1
  401. package/dist/types/workflow-types.js +0 -20
  402. package/dist/types/workflow-types.js.map +0 -1
  403. package/dist/utils/condition-evaluator.d.ts.map +0 -1
  404. package/dist/utils/condition-evaluator.js.map +0 -1
  405. package/dist/utils/config.d.ts +0 -149
  406. package/dist/utils/config.d.ts.map +0 -1
  407. package/dist/utils/config.js +0 -251
  408. package/dist/utils/config.js.map +0 -1
  409. package/dist/utils/storage-security.d.ts.map +0 -1
  410. package/dist/utils/storage-security.js.map +0 -1
  411. package/dist/validation/request-validator.d.ts +0 -8
  412. package/dist/validation/request-validator.d.ts.map +0 -1
  413. package/dist/validation/request-validator.js +0 -32
  414. package/dist/validation/request-validator.js.map +0 -1
  415. package/dist/validation/response-validator.d.ts +0 -8
  416. package/dist/validation/response-validator.d.ts.map +0 -1
  417. package/dist/validation/response-validator.js +0 -110
  418. package/dist/validation/response-validator.js.map +0 -1
  419. package/dist/validation/schemas.d.ts +0 -1
  420. package/dist/validation/schemas.d.ts.map +0 -1
  421. package/dist/validation/schemas.js +0 -53
  422. package/dist/validation/schemas.js.map +0 -1
  423. /package/dist/{types/documentation-types.js → errors/app-error.js} +0 -0
  424. /package/dist/{types/loop-context-optimizer.js → runtime/brand.js} +0 -0
@@ -0,0 +1,1812 @@
1
+ import { z } from 'zod';
2
+ export declare const DomainEventEnvelopeV1Schema: z.ZodObject<{
3
+ v: z.ZodLiteral<1>;
4
+ eventId: z.ZodString;
5
+ eventIndex: z.ZodNumber;
6
+ sessionId: z.ZodString;
7
+ kind: z.ZodString;
8
+ dedupeKey: z.ZodString;
9
+ scope: z.ZodOptional<z.ZodObject<{
10
+ runId: z.ZodOptional<z.ZodString>;
11
+ nodeId: z.ZodOptional<z.ZodString>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ runId?: string | undefined;
14
+ nodeId?: string | undefined;
15
+ }, {
16
+ runId?: string | undefined;
17
+ nodeId?: string | undefined;
18
+ }>>;
19
+ data: z.ZodType<unknown, z.ZodTypeDef, unknown>;
20
+ }, "strip", z.ZodTypeAny, {
21
+ kind: string;
22
+ sessionId: string;
23
+ v: 1;
24
+ eventId: string;
25
+ eventIndex: number;
26
+ dedupeKey: string;
27
+ data?: unknown;
28
+ scope?: {
29
+ runId?: string | undefined;
30
+ nodeId?: string | undefined;
31
+ } | undefined;
32
+ }, {
33
+ kind: string;
34
+ sessionId: string;
35
+ v: 1;
36
+ eventId: string;
37
+ eventIndex: number;
38
+ dedupeKey: string;
39
+ data?: unknown;
40
+ scope?: {
41
+ runId?: string | undefined;
42
+ nodeId?: string | undefined;
43
+ } | undefined;
44
+ }>;
45
+ export declare const DomainEventV1Schema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
46
+ v: z.ZodLiteral<1>;
47
+ eventId: z.ZodString;
48
+ eventIndex: z.ZodNumber;
49
+ sessionId: z.ZodString;
50
+ dedupeKey: z.ZodString;
51
+ scope: z.ZodOptional<z.ZodObject<{
52
+ runId: z.ZodOptional<z.ZodString>;
53
+ nodeId: z.ZodOptional<z.ZodString>;
54
+ }, "strip", z.ZodTypeAny, {
55
+ runId?: string | undefined;
56
+ nodeId?: string | undefined;
57
+ }, {
58
+ runId?: string | undefined;
59
+ nodeId?: string | undefined;
60
+ }>>;
61
+ } & {
62
+ kind: z.ZodLiteral<"session_created">;
63
+ data: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
64
+ }, "strip", z.ZodTypeAny, {
65
+ kind: "session_created";
66
+ sessionId: string;
67
+ data: {};
68
+ v: 1;
69
+ eventId: string;
70
+ eventIndex: number;
71
+ dedupeKey: string;
72
+ scope?: {
73
+ runId?: string | undefined;
74
+ nodeId?: string | undefined;
75
+ } | undefined;
76
+ }, {
77
+ kind: "session_created";
78
+ sessionId: string;
79
+ data: {};
80
+ v: 1;
81
+ eventId: string;
82
+ eventIndex: number;
83
+ dedupeKey: string;
84
+ scope?: {
85
+ runId?: string | undefined;
86
+ nodeId?: string | undefined;
87
+ } | undefined;
88
+ }>, z.ZodObject<{
89
+ v: z.ZodLiteral<1>;
90
+ eventId: z.ZodString;
91
+ eventIndex: z.ZodNumber;
92
+ sessionId: z.ZodString;
93
+ dedupeKey: z.ZodString;
94
+ } & {
95
+ kind: z.ZodLiteral<"observation_recorded">;
96
+ scope: z.ZodUndefined;
97
+ data: z.ZodObject<{
98
+ key: z.ZodEnum<["git_branch", "git_head_sha", "repo_root_hash"]>;
99
+ value: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
100
+ type: z.ZodLiteral<"short_string">;
101
+ value: z.ZodString;
102
+ }, "strip", z.ZodTypeAny, {
103
+ value: string;
104
+ type: "short_string";
105
+ }, {
106
+ value: string;
107
+ type: "short_string";
108
+ }>, z.ZodObject<{
109
+ type: z.ZodLiteral<"git_sha1">;
110
+ value: z.ZodString;
111
+ }, "strip", z.ZodTypeAny, {
112
+ value: string;
113
+ type: "git_sha1";
114
+ }, {
115
+ value: string;
116
+ type: "git_sha1";
117
+ }>, z.ZodObject<{
118
+ type: z.ZodLiteral<"sha256">;
119
+ value: z.ZodString;
120
+ }, "strip", z.ZodTypeAny, {
121
+ value: string;
122
+ type: "sha256";
123
+ }, {
124
+ value: string;
125
+ type: "sha256";
126
+ }>]>;
127
+ confidence: z.ZodEnum<["low", "med", "high"]>;
128
+ }, "strip", z.ZodTypeAny, {
129
+ value: {
130
+ value: string;
131
+ type: "short_string";
132
+ } | {
133
+ value: string;
134
+ type: "git_sha1";
135
+ } | {
136
+ value: string;
137
+ type: "sha256";
138
+ };
139
+ key: "git_branch" | "git_head_sha" | "repo_root_hash";
140
+ confidence: "high" | "low" | "med";
141
+ }, {
142
+ value: {
143
+ value: string;
144
+ type: "short_string";
145
+ } | {
146
+ value: string;
147
+ type: "git_sha1";
148
+ } | {
149
+ value: string;
150
+ type: "sha256";
151
+ };
152
+ key: "git_branch" | "git_head_sha" | "repo_root_hash";
153
+ confidence: "high" | "low" | "med";
154
+ }>;
155
+ }, "strip", z.ZodTypeAny, {
156
+ kind: "observation_recorded";
157
+ sessionId: string;
158
+ data: {
159
+ value: {
160
+ value: string;
161
+ type: "short_string";
162
+ } | {
163
+ value: string;
164
+ type: "git_sha1";
165
+ } | {
166
+ value: string;
167
+ type: "sha256";
168
+ };
169
+ key: "git_branch" | "git_head_sha" | "repo_root_hash";
170
+ confidence: "high" | "low" | "med";
171
+ };
172
+ v: 1;
173
+ eventId: string;
174
+ eventIndex: number;
175
+ dedupeKey: string;
176
+ scope?: undefined;
177
+ }, {
178
+ kind: "observation_recorded";
179
+ sessionId: string;
180
+ data: {
181
+ value: {
182
+ value: string;
183
+ type: "short_string";
184
+ } | {
185
+ value: string;
186
+ type: "git_sha1";
187
+ } | {
188
+ value: string;
189
+ type: "sha256";
190
+ };
191
+ key: "git_branch" | "git_head_sha" | "repo_root_hash";
192
+ confidence: "high" | "low" | "med";
193
+ };
194
+ v: 1;
195
+ eventId: string;
196
+ eventIndex: number;
197
+ dedupeKey: string;
198
+ scope?: undefined;
199
+ }>, z.ZodObject<{
200
+ v: z.ZodLiteral<1>;
201
+ eventId: z.ZodString;
202
+ eventIndex: z.ZodNumber;
203
+ sessionId: z.ZodString;
204
+ dedupeKey: z.ZodString;
205
+ } & {
206
+ kind: z.ZodLiteral<"run_started">;
207
+ scope: z.ZodObject<{
208
+ runId: z.ZodString;
209
+ }, "strip", z.ZodTypeAny, {
210
+ runId: string;
211
+ }, {
212
+ runId: string;
213
+ }>;
214
+ data: z.ZodObject<{
215
+ workflowId: z.ZodString;
216
+ workflowHash: z.ZodString;
217
+ workflowSourceKind: z.ZodEnum<["bundled", "user", "project", "remote", "plugin"]>;
218
+ workflowSourceRef: z.ZodString;
219
+ }, "strip", z.ZodTypeAny, {
220
+ workflowId: string;
221
+ workflowHash: string;
222
+ workflowSourceKind: "bundled" | "user" | "project" | "remote" | "plugin";
223
+ workflowSourceRef: string;
224
+ }, {
225
+ workflowId: string;
226
+ workflowHash: string;
227
+ workflowSourceKind: "bundled" | "user" | "project" | "remote" | "plugin";
228
+ workflowSourceRef: string;
229
+ }>;
230
+ }, "strip", z.ZodTypeAny, {
231
+ kind: "run_started";
232
+ sessionId: string;
233
+ data: {
234
+ workflowId: string;
235
+ workflowHash: string;
236
+ workflowSourceKind: "bundled" | "user" | "project" | "remote" | "plugin";
237
+ workflowSourceRef: string;
238
+ };
239
+ v: 1;
240
+ eventId: string;
241
+ eventIndex: number;
242
+ dedupeKey: string;
243
+ scope: {
244
+ runId: string;
245
+ };
246
+ }, {
247
+ kind: "run_started";
248
+ sessionId: string;
249
+ data: {
250
+ workflowId: string;
251
+ workflowHash: string;
252
+ workflowSourceKind: "bundled" | "user" | "project" | "remote" | "plugin";
253
+ workflowSourceRef: string;
254
+ };
255
+ v: 1;
256
+ eventId: string;
257
+ eventIndex: number;
258
+ dedupeKey: string;
259
+ scope: {
260
+ runId: string;
261
+ };
262
+ }>, z.ZodObject<{
263
+ v: z.ZodLiteral<1>;
264
+ eventId: z.ZodString;
265
+ eventIndex: z.ZodNumber;
266
+ sessionId: z.ZodString;
267
+ dedupeKey: z.ZodString;
268
+ } & {
269
+ kind: z.ZodLiteral<"node_created">;
270
+ scope: z.ZodObject<{
271
+ runId: z.ZodString;
272
+ nodeId: z.ZodString;
273
+ }, "strip", z.ZodTypeAny, {
274
+ runId: string;
275
+ nodeId: string;
276
+ }, {
277
+ runId: string;
278
+ nodeId: string;
279
+ }>;
280
+ data: z.ZodObject<{
281
+ nodeKind: z.ZodEnum<["step", "checkpoint"]>;
282
+ parentNodeId: z.ZodNullable<z.ZodString>;
283
+ workflowHash: z.ZodString;
284
+ snapshotRef: z.ZodString;
285
+ }, "strip", z.ZodTypeAny, {
286
+ workflowHash: string;
287
+ nodeKind: "step" | "checkpoint";
288
+ parentNodeId: string | null;
289
+ snapshotRef: string;
290
+ }, {
291
+ workflowHash: string;
292
+ nodeKind: "step" | "checkpoint";
293
+ parentNodeId: string | null;
294
+ snapshotRef: string;
295
+ }>;
296
+ }, "strip", z.ZodTypeAny, {
297
+ kind: "node_created";
298
+ sessionId: string;
299
+ data: {
300
+ workflowHash: string;
301
+ nodeKind: "step" | "checkpoint";
302
+ parentNodeId: string | null;
303
+ snapshotRef: string;
304
+ };
305
+ v: 1;
306
+ eventId: string;
307
+ eventIndex: number;
308
+ dedupeKey: string;
309
+ scope: {
310
+ runId: string;
311
+ nodeId: string;
312
+ };
313
+ }, {
314
+ kind: "node_created";
315
+ sessionId: string;
316
+ data: {
317
+ workflowHash: string;
318
+ nodeKind: "step" | "checkpoint";
319
+ parentNodeId: string | null;
320
+ snapshotRef: string;
321
+ };
322
+ v: 1;
323
+ eventId: string;
324
+ eventIndex: number;
325
+ dedupeKey: string;
326
+ scope: {
327
+ runId: string;
328
+ nodeId: string;
329
+ };
330
+ }>, z.ZodObject<{
331
+ v: z.ZodLiteral<1>;
332
+ eventId: z.ZodString;
333
+ eventIndex: z.ZodNumber;
334
+ sessionId: z.ZodString;
335
+ dedupeKey: z.ZodString;
336
+ } & {
337
+ kind: z.ZodLiteral<"edge_created">;
338
+ scope: z.ZodObject<{
339
+ runId: z.ZodString;
340
+ }, "strip", z.ZodTypeAny, {
341
+ runId: string;
342
+ }, {
343
+ runId: string;
344
+ }>;
345
+ data: z.ZodEffects<z.ZodObject<{
346
+ edgeKind: z.ZodEnum<["acked_step", "checkpoint"]>;
347
+ fromNodeId: z.ZodString;
348
+ toNodeId: z.ZodString;
349
+ cause: z.ZodObject<{
350
+ kind: z.ZodEnum<["idempotent_replay", "intentional_fork", "non_tip_advance", "checkpoint_created"]>;
351
+ eventId: z.ZodString;
352
+ }, "strip", z.ZodTypeAny, {
353
+ kind: "idempotent_replay" | "intentional_fork" | "non_tip_advance" | "checkpoint_created";
354
+ eventId: string;
355
+ }, {
356
+ kind: "idempotent_replay" | "intentional_fork" | "non_tip_advance" | "checkpoint_created";
357
+ eventId: string;
358
+ }>;
359
+ }, "strip", z.ZodTypeAny, {
360
+ cause: {
361
+ kind: "idempotent_replay" | "intentional_fork" | "non_tip_advance" | "checkpoint_created";
362
+ eventId: string;
363
+ };
364
+ edgeKind: "checkpoint" | "acked_step";
365
+ fromNodeId: string;
366
+ toNodeId: string;
367
+ }, {
368
+ cause: {
369
+ kind: "idempotent_replay" | "intentional_fork" | "non_tip_advance" | "checkpoint_created";
370
+ eventId: string;
371
+ };
372
+ edgeKind: "checkpoint" | "acked_step";
373
+ fromNodeId: string;
374
+ toNodeId: string;
375
+ }>, {
376
+ cause: {
377
+ kind: "idempotent_replay" | "intentional_fork" | "non_tip_advance" | "checkpoint_created";
378
+ eventId: string;
379
+ };
380
+ edgeKind: "checkpoint" | "acked_step";
381
+ fromNodeId: string;
382
+ toNodeId: string;
383
+ }, {
384
+ cause: {
385
+ kind: "idempotent_replay" | "intentional_fork" | "non_tip_advance" | "checkpoint_created";
386
+ eventId: string;
387
+ };
388
+ edgeKind: "checkpoint" | "acked_step";
389
+ fromNodeId: string;
390
+ toNodeId: string;
391
+ }>;
392
+ }, "strip", z.ZodTypeAny, {
393
+ kind: "edge_created";
394
+ sessionId: string;
395
+ data: {
396
+ cause: {
397
+ kind: "idempotent_replay" | "intentional_fork" | "non_tip_advance" | "checkpoint_created";
398
+ eventId: string;
399
+ };
400
+ edgeKind: "checkpoint" | "acked_step";
401
+ fromNodeId: string;
402
+ toNodeId: string;
403
+ };
404
+ v: 1;
405
+ eventId: string;
406
+ eventIndex: number;
407
+ dedupeKey: string;
408
+ scope: {
409
+ runId: string;
410
+ };
411
+ }, {
412
+ kind: "edge_created";
413
+ sessionId: string;
414
+ data: {
415
+ cause: {
416
+ kind: "idempotent_replay" | "intentional_fork" | "non_tip_advance" | "checkpoint_created";
417
+ eventId: string;
418
+ };
419
+ edgeKind: "checkpoint" | "acked_step";
420
+ fromNodeId: string;
421
+ toNodeId: string;
422
+ };
423
+ v: 1;
424
+ eventId: string;
425
+ eventIndex: number;
426
+ dedupeKey: string;
427
+ scope: {
428
+ runId: string;
429
+ };
430
+ }>, z.ZodObject<{
431
+ v: z.ZodLiteral<1>;
432
+ eventId: z.ZodString;
433
+ eventIndex: z.ZodNumber;
434
+ sessionId: z.ZodString;
435
+ dedupeKey: z.ZodString;
436
+ } & {
437
+ kind: z.ZodLiteral<"advance_recorded">;
438
+ scope: z.ZodObject<{
439
+ runId: z.ZodString;
440
+ nodeId: z.ZodString;
441
+ }, "strip", z.ZodTypeAny, {
442
+ runId: string;
443
+ nodeId: string;
444
+ }, {
445
+ runId: string;
446
+ nodeId: string;
447
+ }>;
448
+ data: z.ZodObject<{
449
+ attemptId: z.ZodString;
450
+ intent: z.ZodLiteral<"ack_pending">;
451
+ outcome: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
452
+ kind: z.ZodLiteral<"blocked">;
453
+ blockers: z.ZodEffects<z.ZodObject<{
454
+ blockers: z.ZodArray<z.ZodObject<{
455
+ code: z.ZodEnum<["USER_ONLY_DEPENDENCY", "MISSING_REQUIRED_OUTPUT", "INVALID_REQUIRED_OUTPUT", "REQUIRED_CAPABILITY_UNKNOWN", "REQUIRED_CAPABILITY_UNAVAILABLE", "INVARIANT_VIOLATION", "STORAGE_CORRUPTION_DETECTED"]>;
456
+ pointer: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
457
+ kind: z.ZodLiteral<"context_key">;
458
+ key: z.ZodString;
459
+ }, "strip", z.ZodTypeAny, {
460
+ key: string;
461
+ kind: "context_key";
462
+ }, {
463
+ key: string;
464
+ kind: "context_key";
465
+ }>, z.ZodObject<{
466
+ kind: z.ZodLiteral<"output_contract">;
467
+ contractRef: z.ZodString;
468
+ }, "strip", z.ZodTypeAny, {
469
+ kind: "output_contract";
470
+ contractRef: string;
471
+ }, {
472
+ kind: "output_contract";
473
+ contractRef: string;
474
+ }>, z.ZodObject<{
475
+ kind: z.ZodLiteral<"capability">;
476
+ capability: z.ZodEnum<["delegation", "web_browsing"]>;
477
+ }, "strip", z.ZodTypeAny, {
478
+ kind: "capability";
479
+ capability: "delegation" | "web_browsing";
480
+ }, {
481
+ kind: "capability";
482
+ capability: "delegation" | "web_browsing";
483
+ }>, z.ZodObject<{
484
+ kind: z.ZodLiteral<"workflow_step">;
485
+ stepId: z.ZodString;
486
+ }, "strip", z.ZodTypeAny, {
487
+ kind: "workflow_step";
488
+ stepId: string;
489
+ }, {
490
+ kind: "workflow_step";
491
+ stepId: string;
492
+ }>]>;
493
+ message: z.ZodString;
494
+ suggestedFix: z.ZodOptional<z.ZodString>;
495
+ }, "strip", z.ZodTypeAny, {
496
+ message: string;
497
+ code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
498
+ pointer: {
499
+ key: string;
500
+ kind: "context_key";
501
+ } | {
502
+ kind: "output_contract";
503
+ contractRef: string;
504
+ } | {
505
+ kind: "capability";
506
+ capability: "delegation" | "web_browsing";
507
+ } | {
508
+ kind: "workflow_step";
509
+ stepId: string;
510
+ };
511
+ suggestedFix?: string | undefined;
512
+ }, {
513
+ message: string;
514
+ code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
515
+ pointer: {
516
+ key: string;
517
+ kind: "context_key";
518
+ } | {
519
+ kind: "output_contract";
520
+ contractRef: string;
521
+ } | {
522
+ kind: "capability";
523
+ capability: "delegation" | "web_browsing";
524
+ } | {
525
+ kind: "workflow_step";
526
+ stepId: string;
527
+ };
528
+ suggestedFix?: string | undefined;
529
+ }>, "many">;
530
+ }, "strip", z.ZodTypeAny, {
531
+ blockers: {
532
+ message: string;
533
+ code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
534
+ pointer: {
535
+ key: string;
536
+ kind: "context_key";
537
+ } | {
538
+ kind: "output_contract";
539
+ contractRef: string;
540
+ } | {
541
+ kind: "capability";
542
+ capability: "delegation" | "web_browsing";
543
+ } | {
544
+ kind: "workflow_step";
545
+ stepId: string;
546
+ };
547
+ suggestedFix?: string | undefined;
548
+ }[];
549
+ }, {
550
+ blockers: {
551
+ message: string;
552
+ code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
553
+ pointer: {
554
+ key: string;
555
+ kind: "context_key";
556
+ } | {
557
+ kind: "output_contract";
558
+ contractRef: string;
559
+ } | {
560
+ kind: "capability";
561
+ capability: "delegation" | "web_browsing";
562
+ } | {
563
+ kind: "workflow_step";
564
+ stepId: string;
565
+ };
566
+ suggestedFix?: string | undefined;
567
+ }[];
568
+ }>, {
569
+ blockers: {
570
+ message: string;
571
+ code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
572
+ pointer: {
573
+ key: string;
574
+ kind: "context_key";
575
+ } | {
576
+ kind: "output_contract";
577
+ contractRef: string;
578
+ } | {
579
+ kind: "capability";
580
+ capability: "delegation" | "web_browsing";
581
+ } | {
582
+ kind: "workflow_step";
583
+ stepId: string;
584
+ };
585
+ suggestedFix?: string | undefined;
586
+ }[];
587
+ }, {
588
+ blockers: {
589
+ message: string;
590
+ code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
591
+ pointer: {
592
+ key: string;
593
+ kind: "context_key";
594
+ } | {
595
+ kind: "output_contract";
596
+ contractRef: string;
597
+ } | {
598
+ kind: "capability";
599
+ capability: "delegation" | "web_browsing";
600
+ } | {
601
+ kind: "workflow_step";
602
+ stepId: string;
603
+ };
604
+ suggestedFix?: string | undefined;
605
+ }[];
606
+ }>;
607
+ }, "strip", z.ZodTypeAny, {
608
+ kind: "blocked";
609
+ blockers: {
610
+ blockers: {
611
+ message: string;
612
+ code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
613
+ pointer: {
614
+ key: string;
615
+ kind: "context_key";
616
+ } | {
617
+ kind: "output_contract";
618
+ contractRef: string;
619
+ } | {
620
+ kind: "capability";
621
+ capability: "delegation" | "web_browsing";
622
+ } | {
623
+ kind: "workflow_step";
624
+ stepId: string;
625
+ };
626
+ suggestedFix?: string | undefined;
627
+ }[];
628
+ };
629
+ }, {
630
+ kind: "blocked";
631
+ blockers: {
632
+ blockers: {
633
+ message: string;
634
+ code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
635
+ pointer: {
636
+ key: string;
637
+ kind: "context_key";
638
+ } | {
639
+ kind: "output_contract";
640
+ contractRef: string;
641
+ } | {
642
+ kind: "capability";
643
+ capability: "delegation" | "web_browsing";
644
+ } | {
645
+ kind: "workflow_step";
646
+ stepId: string;
647
+ };
648
+ suggestedFix?: string | undefined;
649
+ }[];
650
+ };
651
+ }>, z.ZodObject<{
652
+ kind: z.ZodLiteral<"advanced">;
653
+ toNodeId: z.ZodString;
654
+ }, "strip", z.ZodTypeAny, {
655
+ kind: "advanced";
656
+ toNodeId: string;
657
+ }, {
658
+ kind: "advanced";
659
+ toNodeId: string;
660
+ }>]>;
661
+ }, "strip", z.ZodTypeAny, {
662
+ attemptId: string;
663
+ intent: "ack_pending";
664
+ outcome: {
665
+ kind: "blocked";
666
+ blockers: {
667
+ blockers: {
668
+ message: string;
669
+ code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
670
+ pointer: {
671
+ key: string;
672
+ kind: "context_key";
673
+ } | {
674
+ kind: "output_contract";
675
+ contractRef: string;
676
+ } | {
677
+ kind: "capability";
678
+ capability: "delegation" | "web_browsing";
679
+ } | {
680
+ kind: "workflow_step";
681
+ stepId: string;
682
+ };
683
+ suggestedFix?: string | undefined;
684
+ }[];
685
+ };
686
+ } | {
687
+ kind: "advanced";
688
+ toNodeId: string;
689
+ };
690
+ }, {
691
+ attemptId: string;
692
+ intent: "ack_pending";
693
+ outcome: {
694
+ kind: "blocked";
695
+ blockers: {
696
+ blockers: {
697
+ message: string;
698
+ code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
699
+ pointer: {
700
+ key: string;
701
+ kind: "context_key";
702
+ } | {
703
+ kind: "output_contract";
704
+ contractRef: string;
705
+ } | {
706
+ kind: "capability";
707
+ capability: "delegation" | "web_browsing";
708
+ } | {
709
+ kind: "workflow_step";
710
+ stepId: string;
711
+ };
712
+ suggestedFix?: string | undefined;
713
+ }[];
714
+ };
715
+ } | {
716
+ kind: "advanced";
717
+ toNodeId: string;
718
+ };
719
+ }>;
720
+ }, "strip", z.ZodTypeAny, {
721
+ kind: "advance_recorded";
722
+ sessionId: string;
723
+ data: {
724
+ attemptId: string;
725
+ intent: "ack_pending";
726
+ outcome: {
727
+ kind: "blocked";
728
+ blockers: {
729
+ blockers: {
730
+ message: string;
731
+ code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
732
+ pointer: {
733
+ key: string;
734
+ kind: "context_key";
735
+ } | {
736
+ kind: "output_contract";
737
+ contractRef: string;
738
+ } | {
739
+ kind: "capability";
740
+ capability: "delegation" | "web_browsing";
741
+ } | {
742
+ kind: "workflow_step";
743
+ stepId: string;
744
+ };
745
+ suggestedFix?: string | undefined;
746
+ }[];
747
+ };
748
+ } | {
749
+ kind: "advanced";
750
+ toNodeId: string;
751
+ };
752
+ };
753
+ v: 1;
754
+ eventId: string;
755
+ eventIndex: number;
756
+ dedupeKey: string;
757
+ scope: {
758
+ runId: string;
759
+ nodeId: string;
760
+ };
761
+ }, {
762
+ kind: "advance_recorded";
763
+ sessionId: string;
764
+ data: {
765
+ attemptId: string;
766
+ intent: "ack_pending";
767
+ outcome: {
768
+ kind: "blocked";
769
+ blockers: {
770
+ blockers: {
771
+ message: string;
772
+ code: "USER_ONLY_DEPENDENCY" | "MISSING_REQUIRED_OUTPUT" | "INVALID_REQUIRED_OUTPUT" | "REQUIRED_CAPABILITY_UNKNOWN" | "REQUIRED_CAPABILITY_UNAVAILABLE" | "INVARIANT_VIOLATION" | "STORAGE_CORRUPTION_DETECTED";
773
+ pointer: {
774
+ key: string;
775
+ kind: "context_key";
776
+ } | {
777
+ kind: "output_contract";
778
+ contractRef: string;
779
+ } | {
780
+ kind: "capability";
781
+ capability: "delegation" | "web_browsing";
782
+ } | {
783
+ kind: "workflow_step";
784
+ stepId: string;
785
+ };
786
+ suggestedFix?: string | undefined;
787
+ }[];
788
+ };
789
+ } | {
790
+ kind: "advanced";
791
+ toNodeId: string;
792
+ };
793
+ };
794
+ v: 1;
795
+ eventId: string;
796
+ eventIndex: number;
797
+ dedupeKey: string;
798
+ scope: {
799
+ runId: string;
800
+ nodeId: string;
801
+ };
802
+ }>, z.ZodObject<{
803
+ v: z.ZodLiteral<1>;
804
+ eventId: z.ZodString;
805
+ eventIndex: z.ZodNumber;
806
+ sessionId: z.ZodString;
807
+ dedupeKey: z.ZodString;
808
+ } & {
809
+ kind: z.ZodLiteral<"node_output_appended">;
810
+ scope: z.ZodObject<{
811
+ runId: z.ZodString;
812
+ nodeId: z.ZodString;
813
+ }, "strip", z.ZodTypeAny, {
814
+ runId: string;
815
+ nodeId: string;
816
+ }, {
817
+ runId: string;
818
+ nodeId: string;
819
+ }>;
820
+ data: z.ZodEffects<z.ZodObject<{
821
+ outputId: z.ZodString;
822
+ supersedesOutputId: z.ZodOptional<z.ZodString>;
823
+ outputChannel: z.ZodEnum<["recap", "artifact"]>;
824
+ payload: z.ZodDiscriminatedUnion<"payloadKind", [z.ZodObject<{
825
+ payloadKind: z.ZodLiteral<"notes">;
826
+ notesMarkdown: z.ZodString;
827
+ }, "strip", z.ZodTypeAny, {
828
+ payloadKind: "notes";
829
+ notesMarkdown: string;
830
+ }, {
831
+ payloadKind: "notes";
832
+ notesMarkdown: string;
833
+ }>, z.ZodObject<{
834
+ payloadKind: z.ZodLiteral<"artifact_ref">;
835
+ sha256: z.ZodString;
836
+ contentType: z.ZodString;
837
+ byteLength: z.ZodNumber;
838
+ }, "strip", z.ZodTypeAny, {
839
+ sha256: string;
840
+ payloadKind: "artifact_ref";
841
+ contentType: string;
842
+ byteLength: number;
843
+ }, {
844
+ sha256: string;
845
+ payloadKind: "artifact_ref";
846
+ contentType: string;
847
+ byteLength: number;
848
+ }>]>;
849
+ }, "strip", z.ZodTypeAny, {
850
+ outputId: string;
851
+ outputChannel: "recap" | "artifact";
852
+ payload: {
853
+ payloadKind: "notes";
854
+ notesMarkdown: string;
855
+ } | {
856
+ sha256: string;
857
+ payloadKind: "artifact_ref";
858
+ contentType: string;
859
+ byteLength: number;
860
+ };
861
+ supersedesOutputId?: string | undefined;
862
+ }, {
863
+ outputId: string;
864
+ outputChannel: "recap" | "artifact";
865
+ payload: {
866
+ payloadKind: "notes";
867
+ notesMarkdown: string;
868
+ } | {
869
+ sha256: string;
870
+ payloadKind: "artifact_ref";
871
+ contentType: string;
872
+ byteLength: number;
873
+ };
874
+ supersedesOutputId?: string | undefined;
875
+ }>, {
876
+ outputId: string;
877
+ outputChannel: "recap" | "artifact";
878
+ payload: {
879
+ payloadKind: "notes";
880
+ notesMarkdown: string;
881
+ } | {
882
+ sha256: string;
883
+ payloadKind: "artifact_ref";
884
+ contentType: string;
885
+ byteLength: number;
886
+ };
887
+ supersedesOutputId?: string | undefined;
888
+ }, {
889
+ outputId: string;
890
+ outputChannel: "recap" | "artifact";
891
+ payload: {
892
+ payloadKind: "notes";
893
+ notesMarkdown: string;
894
+ } | {
895
+ sha256: string;
896
+ payloadKind: "artifact_ref";
897
+ contentType: string;
898
+ byteLength: number;
899
+ };
900
+ supersedesOutputId?: string | undefined;
901
+ }>;
902
+ }, "strip", z.ZodTypeAny, {
903
+ kind: "node_output_appended";
904
+ sessionId: string;
905
+ data: {
906
+ outputId: string;
907
+ outputChannel: "recap" | "artifact";
908
+ payload: {
909
+ payloadKind: "notes";
910
+ notesMarkdown: string;
911
+ } | {
912
+ sha256: string;
913
+ payloadKind: "artifact_ref";
914
+ contentType: string;
915
+ byteLength: number;
916
+ };
917
+ supersedesOutputId?: string | undefined;
918
+ };
919
+ v: 1;
920
+ eventId: string;
921
+ eventIndex: number;
922
+ dedupeKey: string;
923
+ scope: {
924
+ runId: string;
925
+ nodeId: string;
926
+ };
927
+ }, {
928
+ kind: "node_output_appended";
929
+ sessionId: string;
930
+ data: {
931
+ outputId: string;
932
+ outputChannel: "recap" | "artifact";
933
+ payload: {
934
+ payloadKind: "notes";
935
+ notesMarkdown: string;
936
+ } | {
937
+ sha256: string;
938
+ payloadKind: "artifact_ref";
939
+ contentType: string;
940
+ byteLength: number;
941
+ };
942
+ supersedesOutputId?: string | undefined;
943
+ };
944
+ v: 1;
945
+ eventId: string;
946
+ eventIndex: number;
947
+ dedupeKey: string;
948
+ scope: {
949
+ runId: string;
950
+ nodeId: string;
951
+ };
952
+ }>, z.ZodObject<{
953
+ v: z.ZodLiteral<1>;
954
+ eventId: z.ZodString;
955
+ eventIndex: z.ZodNumber;
956
+ sessionId: z.ZodString;
957
+ dedupeKey: z.ZodString;
958
+ } & {
959
+ kind: z.ZodLiteral<"preferences_changed">;
960
+ scope: z.ZodObject<{
961
+ runId: z.ZodString;
962
+ nodeId: z.ZodString;
963
+ }, "strip", z.ZodTypeAny, {
964
+ runId: string;
965
+ nodeId: string;
966
+ }, {
967
+ runId: string;
968
+ nodeId: string;
969
+ }>;
970
+ data: z.ZodEffects<z.ZodObject<{
971
+ changeId: z.ZodString;
972
+ source: z.ZodEnum<["user", "workflow_recommendation", "system"]>;
973
+ delta: z.ZodArray<z.ZodDiscriminatedUnion<"key", [z.ZodObject<{
974
+ key: z.ZodLiteral<"autonomy">;
975
+ value: z.ZodEnum<["guided", "full_auto_stop_on_user_deps", "full_auto_never_stop"]>;
976
+ }, "strip", z.ZodTypeAny, {
977
+ value: "guided" | "full_auto_stop_on_user_deps" | "full_auto_never_stop";
978
+ key: "autonomy";
979
+ }, {
980
+ value: "guided" | "full_auto_stop_on_user_deps" | "full_auto_never_stop";
981
+ key: "autonomy";
982
+ }>, z.ZodObject<{
983
+ key: z.ZodLiteral<"riskPolicy">;
984
+ value: z.ZodEnum<["conservative", "balanced", "aggressive"]>;
985
+ }, "strip", z.ZodTypeAny, {
986
+ value: "conservative" | "balanced" | "aggressive";
987
+ key: "riskPolicy";
988
+ }, {
989
+ value: "conservative" | "balanced" | "aggressive";
990
+ key: "riskPolicy";
991
+ }>]>, "many">;
992
+ effective: z.ZodObject<{
993
+ autonomy: z.ZodEnum<["guided", "full_auto_stop_on_user_deps", "full_auto_never_stop"]>;
994
+ riskPolicy: z.ZodEnum<["conservative", "balanced", "aggressive"]>;
995
+ }, "strip", z.ZodTypeAny, {
996
+ autonomy: "guided" | "full_auto_stop_on_user_deps" | "full_auto_never_stop";
997
+ riskPolicy: "conservative" | "balanced" | "aggressive";
998
+ }, {
999
+ autonomy: "guided" | "full_auto_stop_on_user_deps" | "full_auto_never_stop";
1000
+ riskPolicy: "conservative" | "balanced" | "aggressive";
1001
+ }>;
1002
+ }, "strip", z.ZodTypeAny, {
1003
+ source: "user" | "workflow_recommendation" | "system";
1004
+ changeId: string;
1005
+ delta: ({
1006
+ value: "guided" | "full_auto_stop_on_user_deps" | "full_auto_never_stop";
1007
+ key: "autonomy";
1008
+ } | {
1009
+ value: "conservative" | "balanced" | "aggressive";
1010
+ key: "riskPolicy";
1011
+ })[];
1012
+ effective: {
1013
+ autonomy: "guided" | "full_auto_stop_on_user_deps" | "full_auto_never_stop";
1014
+ riskPolicy: "conservative" | "balanced" | "aggressive";
1015
+ };
1016
+ }, {
1017
+ source: "user" | "workflow_recommendation" | "system";
1018
+ changeId: string;
1019
+ delta: ({
1020
+ value: "guided" | "full_auto_stop_on_user_deps" | "full_auto_never_stop";
1021
+ key: "autonomy";
1022
+ } | {
1023
+ value: "conservative" | "balanced" | "aggressive";
1024
+ key: "riskPolicy";
1025
+ })[];
1026
+ effective: {
1027
+ autonomy: "guided" | "full_auto_stop_on_user_deps" | "full_auto_never_stop";
1028
+ riskPolicy: "conservative" | "balanced" | "aggressive";
1029
+ };
1030
+ }>, {
1031
+ source: "user" | "workflow_recommendation" | "system";
1032
+ changeId: string;
1033
+ delta: ({
1034
+ value: "guided" | "full_auto_stop_on_user_deps" | "full_auto_never_stop";
1035
+ key: "autonomy";
1036
+ } | {
1037
+ value: "conservative" | "balanced" | "aggressive";
1038
+ key: "riskPolicy";
1039
+ })[];
1040
+ effective: {
1041
+ autonomy: "guided" | "full_auto_stop_on_user_deps" | "full_auto_never_stop";
1042
+ riskPolicy: "conservative" | "balanced" | "aggressive";
1043
+ };
1044
+ }, {
1045
+ source: "user" | "workflow_recommendation" | "system";
1046
+ changeId: string;
1047
+ delta: ({
1048
+ value: "guided" | "full_auto_stop_on_user_deps" | "full_auto_never_stop";
1049
+ key: "autonomy";
1050
+ } | {
1051
+ value: "conservative" | "balanced" | "aggressive";
1052
+ key: "riskPolicy";
1053
+ })[];
1054
+ effective: {
1055
+ autonomy: "guided" | "full_auto_stop_on_user_deps" | "full_auto_never_stop";
1056
+ riskPolicy: "conservative" | "balanced" | "aggressive";
1057
+ };
1058
+ }>;
1059
+ }, "strip", z.ZodTypeAny, {
1060
+ kind: "preferences_changed";
1061
+ sessionId: string;
1062
+ data: {
1063
+ source: "user" | "workflow_recommendation" | "system";
1064
+ changeId: string;
1065
+ delta: ({
1066
+ value: "guided" | "full_auto_stop_on_user_deps" | "full_auto_never_stop";
1067
+ key: "autonomy";
1068
+ } | {
1069
+ value: "conservative" | "balanced" | "aggressive";
1070
+ key: "riskPolicy";
1071
+ })[];
1072
+ effective: {
1073
+ autonomy: "guided" | "full_auto_stop_on_user_deps" | "full_auto_never_stop";
1074
+ riskPolicy: "conservative" | "balanced" | "aggressive";
1075
+ };
1076
+ };
1077
+ v: 1;
1078
+ eventId: string;
1079
+ eventIndex: number;
1080
+ dedupeKey: string;
1081
+ scope: {
1082
+ runId: string;
1083
+ nodeId: string;
1084
+ };
1085
+ }, {
1086
+ kind: "preferences_changed";
1087
+ sessionId: string;
1088
+ data: {
1089
+ source: "user" | "workflow_recommendation" | "system";
1090
+ changeId: string;
1091
+ delta: ({
1092
+ value: "guided" | "full_auto_stop_on_user_deps" | "full_auto_never_stop";
1093
+ key: "autonomy";
1094
+ } | {
1095
+ value: "conservative" | "balanced" | "aggressive";
1096
+ key: "riskPolicy";
1097
+ })[];
1098
+ effective: {
1099
+ autonomy: "guided" | "full_auto_stop_on_user_deps" | "full_auto_never_stop";
1100
+ riskPolicy: "conservative" | "balanced" | "aggressive";
1101
+ };
1102
+ };
1103
+ v: 1;
1104
+ eventId: string;
1105
+ eventIndex: number;
1106
+ dedupeKey: string;
1107
+ scope: {
1108
+ runId: string;
1109
+ nodeId: string;
1110
+ };
1111
+ }>, z.ZodObject<{
1112
+ v: z.ZodLiteral<1>;
1113
+ eventId: z.ZodString;
1114
+ eventIndex: z.ZodNumber;
1115
+ sessionId: z.ZodString;
1116
+ dedupeKey: z.ZodString;
1117
+ } & {
1118
+ kind: z.ZodLiteral<"capability_observed">;
1119
+ scope: z.ZodObject<{
1120
+ runId: z.ZodString;
1121
+ nodeId: z.ZodString;
1122
+ }, "strip", z.ZodTypeAny, {
1123
+ runId: string;
1124
+ nodeId: string;
1125
+ }, {
1126
+ runId: string;
1127
+ nodeId: string;
1128
+ }>;
1129
+ data: z.ZodEffects<z.ZodObject<{
1130
+ capObsId: z.ZodString;
1131
+ capability: z.ZodEnum<["delegation", "web_browsing"]>;
1132
+ status: z.ZodEnum<["unknown", "available", "unavailable"]>;
1133
+ provenance: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1134
+ kind: z.ZodLiteral<"probe_step">;
1135
+ enforcementGrade: z.ZodLiteral<"strong">;
1136
+ detail: z.ZodObject<{
1137
+ probeTemplateId: z.ZodString;
1138
+ probeStepId: z.ZodString;
1139
+ result: z.ZodEnum<["success", "failure"]>;
1140
+ }, "strip", z.ZodTypeAny, {
1141
+ result: "success" | "failure";
1142
+ probeTemplateId: string;
1143
+ probeStepId: string;
1144
+ }, {
1145
+ result: "success" | "failure";
1146
+ probeTemplateId: string;
1147
+ probeStepId: string;
1148
+ }>;
1149
+ }, "strip", z.ZodTypeAny, {
1150
+ kind: "probe_step";
1151
+ detail: {
1152
+ result: "success" | "failure";
1153
+ probeTemplateId: string;
1154
+ probeStepId: string;
1155
+ };
1156
+ enforcementGrade: "strong";
1157
+ }, {
1158
+ kind: "probe_step";
1159
+ detail: {
1160
+ result: "success" | "failure";
1161
+ probeTemplateId: string;
1162
+ probeStepId: string;
1163
+ };
1164
+ enforcementGrade: "strong";
1165
+ }>, z.ZodObject<{
1166
+ kind: z.ZodLiteral<"attempted_use">;
1167
+ enforcementGrade: z.ZodLiteral<"strong">;
1168
+ detail: z.ZodObject<{
1169
+ attemptContext: z.ZodEnum<["workflow_step", "system_probe"]>;
1170
+ result: z.ZodEnum<["success", "failure"]>;
1171
+ failureCode: z.ZodOptional<z.ZodEnum<["tool_missing", "tool_error", "policy_blocked", "unknown"]>>;
1172
+ }, "strip", z.ZodTypeAny, {
1173
+ result: "success" | "failure";
1174
+ attemptContext: "workflow_step" | "system_probe";
1175
+ failureCode?: "unknown" | "tool_missing" | "tool_error" | "policy_blocked" | undefined;
1176
+ }, {
1177
+ result: "success" | "failure";
1178
+ attemptContext: "workflow_step" | "system_probe";
1179
+ failureCode?: "unknown" | "tool_missing" | "tool_error" | "policy_blocked" | undefined;
1180
+ }>;
1181
+ }, "strip", z.ZodTypeAny, {
1182
+ kind: "attempted_use";
1183
+ detail: {
1184
+ result: "success" | "failure";
1185
+ attemptContext: "workflow_step" | "system_probe";
1186
+ failureCode?: "unknown" | "tool_missing" | "tool_error" | "policy_blocked" | undefined;
1187
+ };
1188
+ enforcementGrade: "strong";
1189
+ }, {
1190
+ kind: "attempted_use";
1191
+ detail: {
1192
+ result: "success" | "failure";
1193
+ attemptContext: "workflow_step" | "system_probe";
1194
+ failureCode?: "unknown" | "tool_missing" | "tool_error" | "policy_blocked" | undefined;
1195
+ };
1196
+ enforcementGrade: "strong";
1197
+ }>, z.ZodObject<{
1198
+ kind: z.ZodLiteral<"manual_claim">;
1199
+ enforcementGrade: z.ZodLiteral<"weak">;
1200
+ detail: z.ZodObject<{
1201
+ claimedBy: z.ZodEnum<["agent", "user"]>;
1202
+ claim: z.ZodEnum<["available", "unavailable"]>;
1203
+ }, "strip", z.ZodTypeAny, {
1204
+ claimedBy: "user" | "agent";
1205
+ claim: "available" | "unavailable";
1206
+ }, {
1207
+ claimedBy: "user" | "agent";
1208
+ claim: "available" | "unavailable";
1209
+ }>;
1210
+ }, "strip", z.ZodTypeAny, {
1211
+ kind: "manual_claim";
1212
+ detail: {
1213
+ claimedBy: "user" | "agent";
1214
+ claim: "available" | "unavailable";
1215
+ };
1216
+ enforcementGrade: "weak";
1217
+ }, {
1218
+ kind: "manual_claim";
1219
+ detail: {
1220
+ claimedBy: "user" | "agent";
1221
+ claim: "available" | "unavailable";
1222
+ };
1223
+ enforcementGrade: "weak";
1224
+ }>]>;
1225
+ }, "strip", z.ZodTypeAny, {
1226
+ status: "unknown" | "available" | "unavailable";
1227
+ capability: "delegation" | "web_browsing";
1228
+ capObsId: string;
1229
+ provenance: {
1230
+ kind: "probe_step";
1231
+ detail: {
1232
+ result: "success" | "failure";
1233
+ probeTemplateId: string;
1234
+ probeStepId: string;
1235
+ };
1236
+ enforcementGrade: "strong";
1237
+ } | {
1238
+ kind: "attempted_use";
1239
+ detail: {
1240
+ result: "success" | "failure";
1241
+ attemptContext: "workflow_step" | "system_probe";
1242
+ failureCode?: "unknown" | "tool_missing" | "tool_error" | "policy_blocked" | undefined;
1243
+ };
1244
+ enforcementGrade: "strong";
1245
+ } | {
1246
+ kind: "manual_claim";
1247
+ detail: {
1248
+ claimedBy: "user" | "agent";
1249
+ claim: "available" | "unavailable";
1250
+ };
1251
+ enforcementGrade: "weak";
1252
+ };
1253
+ }, {
1254
+ status: "unknown" | "available" | "unavailable";
1255
+ capability: "delegation" | "web_browsing";
1256
+ capObsId: string;
1257
+ provenance: {
1258
+ kind: "probe_step";
1259
+ detail: {
1260
+ result: "success" | "failure";
1261
+ probeTemplateId: string;
1262
+ probeStepId: string;
1263
+ };
1264
+ enforcementGrade: "strong";
1265
+ } | {
1266
+ kind: "attempted_use";
1267
+ detail: {
1268
+ result: "success" | "failure";
1269
+ attemptContext: "workflow_step" | "system_probe";
1270
+ failureCode?: "unknown" | "tool_missing" | "tool_error" | "policy_blocked" | undefined;
1271
+ };
1272
+ enforcementGrade: "strong";
1273
+ } | {
1274
+ kind: "manual_claim";
1275
+ detail: {
1276
+ claimedBy: "user" | "agent";
1277
+ claim: "available" | "unavailable";
1278
+ };
1279
+ enforcementGrade: "weak";
1280
+ };
1281
+ }>, {
1282
+ status: "unknown" | "available" | "unavailable";
1283
+ capability: "delegation" | "web_browsing";
1284
+ capObsId: string;
1285
+ provenance: {
1286
+ kind: "probe_step";
1287
+ detail: {
1288
+ result: "success" | "failure";
1289
+ probeTemplateId: string;
1290
+ probeStepId: string;
1291
+ };
1292
+ enforcementGrade: "strong";
1293
+ } | {
1294
+ kind: "attempted_use";
1295
+ detail: {
1296
+ result: "success" | "failure";
1297
+ attemptContext: "workflow_step" | "system_probe";
1298
+ failureCode?: "unknown" | "tool_missing" | "tool_error" | "policy_blocked" | undefined;
1299
+ };
1300
+ enforcementGrade: "strong";
1301
+ } | {
1302
+ kind: "manual_claim";
1303
+ detail: {
1304
+ claimedBy: "user" | "agent";
1305
+ claim: "available" | "unavailable";
1306
+ };
1307
+ enforcementGrade: "weak";
1308
+ };
1309
+ }, {
1310
+ status: "unknown" | "available" | "unavailable";
1311
+ capability: "delegation" | "web_browsing";
1312
+ capObsId: string;
1313
+ provenance: {
1314
+ kind: "probe_step";
1315
+ detail: {
1316
+ result: "success" | "failure";
1317
+ probeTemplateId: string;
1318
+ probeStepId: string;
1319
+ };
1320
+ enforcementGrade: "strong";
1321
+ } | {
1322
+ kind: "attempted_use";
1323
+ detail: {
1324
+ result: "success" | "failure";
1325
+ attemptContext: "workflow_step" | "system_probe";
1326
+ failureCode?: "unknown" | "tool_missing" | "tool_error" | "policy_blocked" | undefined;
1327
+ };
1328
+ enforcementGrade: "strong";
1329
+ } | {
1330
+ kind: "manual_claim";
1331
+ detail: {
1332
+ claimedBy: "user" | "agent";
1333
+ claim: "available" | "unavailable";
1334
+ };
1335
+ enforcementGrade: "weak";
1336
+ };
1337
+ }>;
1338
+ }, "strip", z.ZodTypeAny, {
1339
+ kind: "capability_observed";
1340
+ sessionId: string;
1341
+ data: {
1342
+ status: "unknown" | "available" | "unavailable";
1343
+ capability: "delegation" | "web_browsing";
1344
+ capObsId: string;
1345
+ provenance: {
1346
+ kind: "probe_step";
1347
+ detail: {
1348
+ result: "success" | "failure";
1349
+ probeTemplateId: string;
1350
+ probeStepId: string;
1351
+ };
1352
+ enforcementGrade: "strong";
1353
+ } | {
1354
+ kind: "attempted_use";
1355
+ detail: {
1356
+ result: "success" | "failure";
1357
+ attemptContext: "workflow_step" | "system_probe";
1358
+ failureCode?: "unknown" | "tool_missing" | "tool_error" | "policy_blocked" | undefined;
1359
+ };
1360
+ enforcementGrade: "strong";
1361
+ } | {
1362
+ kind: "manual_claim";
1363
+ detail: {
1364
+ claimedBy: "user" | "agent";
1365
+ claim: "available" | "unavailable";
1366
+ };
1367
+ enforcementGrade: "weak";
1368
+ };
1369
+ };
1370
+ v: 1;
1371
+ eventId: string;
1372
+ eventIndex: number;
1373
+ dedupeKey: string;
1374
+ scope: {
1375
+ runId: string;
1376
+ nodeId: string;
1377
+ };
1378
+ }, {
1379
+ kind: "capability_observed";
1380
+ sessionId: string;
1381
+ data: {
1382
+ status: "unknown" | "available" | "unavailable";
1383
+ capability: "delegation" | "web_browsing";
1384
+ capObsId: string;
1385
+ provenance: {
1386
+ kind: "probe_step";
1387
+ detail: {
1388
+ result: "success" | "failure";
1389
+ probeTemplateId: string;
1390
+ probeStepId: string;
1391
+ };
1392
+ enforcementGrade: "strong";
1393
+ } | {
1394
+ kind: "attempted_use";
1395
+ detail: {
1396
+ result: "success" | "failure";
1397
+ attemptContext: "workflow_step" | "system_probe";
1398
+ failureCode?: "unknown" | "tool_missing" | "tool_error" | "policy_blocked" | undefined;
1399
+ };
1400
+ enforcementGrade: "strong";
1401
+ } | {
1402
+ kind: "manual_claim";
1403
+ detail: {
1404
+ claimedBy: "user" | "agent";
1405
+ claim: "available" | "unavailable";
1406
+ };
1407
+ enforcementGrade: "weak";
1408
+ };
1409
+ };
1410
+ v: 1;
1411
+ eventId: string;
1412
+ eventIndex: number;
1413
+ dedupeKey: string;
1414
+ scope: {
1415
+ runId: string;
1416
+ nodeId: string;
1417
+ };
1418
+ }>, z.ZodObject<{
1419
+ v: z.ZodLiteral<1>;
1420
+ eventId: z.ZodString;
1421
+ eventIndex: z.ZodNumber;
1422
+ sessionId: z.ZodString;
1423
+ dedupeKey: z.ZodString;
1424
+ } & {
1425
+ kind: z.ZodLiteral<"gap_recorded">;
1426
+ scope: z.ZodObject<{
1427
+ runId: z.ZodString;
1428
+ nodeId: z.ZodString;
1429
+ }, "strip", z.ZodTypeAny, {
1430
+ runId: string;
1431
+ nodeId: string;
1432
+ }, {
1433
+ runId: string;
1434
+ nodeId: string;
1435
+ }>;
1436
+ data: z.ZodObject<{
1437
+ gapId: z.ZodString;
1438
+ severity: z.ZodEnum<["info", "warning", "critical"]>;
1439
+ reason: z.ZodDiscriminatedUnion<"category", [z.ZodObject<{
1440
+ category: z.ZodLiteral<"user_only_dependency">;
1441
+ detail: z.ZodEnum<["needs_user_secret_or_token", "needs_user_account_access", "needs_user_artifact", "needs_user_choice", "needs_user_approval", "needs_user_environment_action"]>;
1442
+ }, "strip", z.ZodTypeAny, {
1443
+ category: "user_only_dependency";
1444
+ detail: "needs_user_secret_or_token" | "needs_user_account_access" | "needs_user_artifact" | "needs_user_choice" | "needs_user_approval" | "needs_user_environment_action";
1445
+ }, {
1446
+ category: "user_only_dependency";
1447
+ detail: "needs_user_secret_or_token" | "needs_user_account_access" | "needs_user_artifact" | "needs_user_choice" | "needs_user_approval" | "needs_user_environment_action";
1448
+ }>, z.ZodObject<{
1449
+ category: z.ZodLiteral<"contract_violation">;
1450
+ detail: z.ZodEnum<["missing_required_output", "invalid_required_output"]>;
1451
+ }, "strip", z.ZodTypeAny, {
1452
+ category: "contract_violation";
1453
+ detail: "missing_required_output" | "invalid_required_output";
1454
+ }, {
1455
+ category: "contract_violation";
1456
+ detail: "missing_required_output" | "invalid_required_output";
1457
+ }>, z.ZodObject<{
1458
+ category: z.ZodLiteral<"capability_missing">;
1459
+ detail: z.ZodEnum<["required_capability_unavailable", "required_capability_unknown"]>;
1460
+ }, "strip", z.ZodTypeAny, {
1461
+ category: "capability_missing";
1462
+ detail: "required_capability_unavailable" | "required_capability_unknown";
1463
+ }, {
1464
+ category: "capability_missing";
1465
+ detail: "required_capability_unavailable" | "required_capability_unknown";
1466
+ }>, z.ZodObject<{
1467
+ category: z.ZodLiteral<"unexpected">;
1468
+ detail: z.ZodEnum<["invariant_violation", "storage_corruption_detected"]>;
1469
+ }, "strip", z.ZodTypeAny, {
1470
+ category: "unexpected";
1471
+ detail: "invariant_violation" | "storage_corruption_detected";
1472
+ }, {
1473
+ category: "unexpected";
1474
+ detail: "invariant_violation" | "storage_corruption_detected";
1475
+ }>]>;
1476
+ summary: z.ZodString;
1477
+ resolution: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1478
+ kind: z.ZodLiteral<"unresolved">;
1479
+ }, "strip", z.ZodTypeAny, {
1480
+ kind: "unresolved";
1481
+ }, {
1482
+ kind: "unresolved";
1483
+ }>, z.ZodObject<{
1484
+ kind: z.ZodLiteral<"resolves">;
1485
+ resolvesGapId: z.ZodString;
1486
+ }, "strip", z.ZodTypeAny, {
1487
+ kind: "resolves";
1488
+ resolvesGapId: string;
1489
+ }, {
1490
+ kind: "resolves";
1491
+ resolvesGapId: string;
1492
+ }>]>;
1493
+ evidenceRefs: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1494
+ kind: z.ZodLiteral<"event">;
1495
+ eventId: z.ZodString;
1496
+ }, "strip", z.ZodTypeAny, {
1497
+ kind: "event";
1498
+ eventId: string;
1499
+ }, {
1500
+ kind: "event";
1501
+ eventId: string;
1502
+ }>, z.ZodObject<{
1503
+ kind: z.ZodLiteral<"output">;
1504
+ outputId: z.ZodString;
1505
+ }, "strip", z.ZodTypeAny, {
1506
+ kind: "output";
1507
+ outputId: string;
1508
+ }, {
1509
+ kind: "output";
1510
+ outputId: string;
1511
+ }>]>, "many">>;
1512
+ }, "strip", z.ZodTypeAny, {
1513
+ reason: {
1514
+ category: "user_only_dependency";
1515
+ detail: "needs_user_secret_or_token" | "needs_user_account_access" | "needs_user_artifact" | "needs_user_choice" | "needs_user_approval" | "needs_user_environment_action";
1516
+ } | {
1517
+ category: "contract_violation";
1518
+ detail: "missing_required_output" | "invalid_required_output";
1519
+ } | {
1520
+ category: "capability_missing";
1521
+ detail: "required_capability_unavailable" | "required_capability_unknown";
1522
+ } | {
1523
+ category: "unexpected";
1524
+ detail: "invariant_violation" | "storage_corruption_detected";
1525
+ };
1526
+ severity: "warning" | "info" | "critical";
1527
+ summary: string;
1528
+ gapId: string;
1529
+ resolution: {
1530
+ kind: "unresolved";
1531
+ } | {
1532
+ kind: "resolves";
1533
+ resolvesGapId: string;
1534
+ };
1535
+ evidenceRefs?: ({
1536
+ kind: "event";
1537
+ eventId: string;
1538
+ } | {
1539
+ kind: "output";
1540
+ outputId: string;
1541
+ })[] | undefined;
1542
+ }, {
1543
+ reason: {
1544
+ category: "user_only_dependency";
1545
+ detail: "needs_user_secret_or_token" | "needs_user_account_access" | "needs_user_artifact" | "needs_user_choice" | "needs_user_approval" | "needs_user_environment_action";
1546
+ } | {
1547
+ category: "contract_violation";
1548
+ detail: "missing_required_output" | "invalid_required_output";
1549
+ } | {
1550
+ category: "capability_missing";
1551
+ detail: "required_capability_unavailable" | "required_capability_unknown";
1552
+ } | {
1553
+ category: "unexpected";
1554
+ detail: "invariant_violation" | "storage_corruption_detected";
1555
+ };
1556
+ severity: "warning" | "info" | "critical";
1557
+ summary: string;
1558
+ gapId: string;
1559
+ resolution: {
1560
+ kind: "unresolved";
1561
+ } | {
1562
+ kind: "resolves";
1563
+ resolvesGapId: string;
1564
+ };
1565
+ evidenceRefs?: ({
1566
+ kind: "event";
1567
+ eventId: string;
1568
+ } | {
1569
+ kind: "output";
1570
+ outputId: string;
1571
+ })[] | undefined;
1572
+ }>;
1573
+ }, "strip", z.ZodTypeAny, {
1574
+ kind: "gap_recorded";
1575
+ sessionId: string;
1576
+ data: {
1577
+ reason: {
1578
+ category: "user_only_dependency";
1579
+ detail: "needs_user_secret_or_token" | "needs_user_account_access" | "needs_user_artifact" | "needs_user_choice" | "needs_user_approval" | "needs_user_environment_action";
1580
+ } | {
1581
+ category: "contract_violation";
1582
+ detail: "missing_required_output" | "invalid_required_output";
1583
+ } | {
1584
+ category: "capability_missing";
1585
+ detail: "required_capability_unavailable" | "required_capability_unknown";
1586
+ } | {
1587
+ category: "unexpected";
1588
+ detail: "invariant_violation" | "storage_corruption_detected";
1589
+ };
1590
+ severity: "warning" | "info" | "critical";
1591
+ summary: string;
1592
+ gapId: string;
1593
+ resolution: {
1594
+ kind: "unresolved";
1595
+ } | {
1596
+ kind: "resolves";
1597
+ resolvesGapId: string;
1598
+ };
1599
+ evidenceRefs?: ({
1600
+ kind: "event";
1601
+ eventId: string;
1602
+ } | {
1603
+ kind: "output";
1604
+ outputId: string;
1605
+ })[] | undefined;
1606
+ };
1607
+ v: 1;
1608
+ eventId: string;
1609
+ eventIndex: number;
1610
+ dedupeKey: string;
1611
+ scope: {
1612
+ runId: string;
1613
+ nodeId: string;
1614
+ };
1615
+ }, {
1616
+ kind: "gap_recorded";
1617
+ sessionId: string;
1618
+ data: {
1619
+ reason: {
1620
+ category: "user_only_dependency";
1621
+ detail: "needs_user_secret_or_token" | "needs_user_account_access" | "needs_user_artifact" | "needs_user_choice" | "needs_user_approval" | "needs_user_environment_action";
1622
+ } | {
1623
+ category: "contract_violation";
1624
+ detail: "missing_required_output" | "invalid_required_output";
1625
+ } | {
1626
+ category: "capability_missing";
1627
+ detail: "required_capability_unavailable" | "required_capability_unknown";
1628
+ } | {
1629
+ category: "unexpected";
1630
+ detail: "invariant_violation" | "storage_corruption_detected";
1631
+ };
1632
+ severity: "warning" | "info" | "critical";
1633
+ summary: string;
1634
+ gapId: string;
1635
+ resolution: {
1636
+ kind: "unresolved";
1637
+ } | {
1638
+ kind: "resolves";
1639
+ resolvesGapId: string;
1640
+ };
1641
+ evidenceRefs?: ({
1642
+ kind: "event";
1643
+ eventId: string;
1644
+ } | {
1645
+ kind: "output";
1646
+ outputId: string;
1647
+ })[] | undefined;
1648
+ };
1649
+ v: 1;
1650
+ eventId: string;
1651
+ eventIndex: number;
1652
+ dedupeKey: string;
1653
+ scope: {
1654
+ runId: string;
1655
+ nodeId: string;
1656
+ };
1657
+ }>, z.ZodObject<{
1658
+ v: z.ZodLiteral<1>;
1659
+ eventId: z.ZodString;
1660
+ eventIndex: z.ZodNumber;
1661
+ sessionId: z.ZodString;
1662
+ dedupeKey: z.ZodString;
1663
+ } & {
1664
+ kind: z.ZodLiteral<"divergence_recorded">;
1665
+ scope: z.ZodObject<{
1666
+ runId: z.ZodString;
1667
+ nodeId: z.ZodString;
1668
+ }, "strip", z.ZodTypeAny, {
1669
+ runId: string;
1670
+ nodeId: string;
1671
+ }, {
1672
+ runId: string;
1673
+ nodeId: string;
1674
+ }>;
1675
+ data: z.ZodObject<{
1676
+ divergenceId: z.ZodString;
1677
+ reason: z.ZodEnum<["missing_user_context", "capability_unavailable", "efficiency_skip", "safety_stop", "policy_constraint"]>;
1678
+ summary: z.ZodString;
1679
+ relatedStepId: z.ZodOptional<z.ZodString>;
1680
+ }, "strip", z.ZodTypeAny, {
1681
+ reason: "missing_user_context" | "capability_unavailable" | "efficiency_skip" | "safety_stop" | "policy_constraint";
1682
+ summary: string;
1683
+ divergenceId: string;
1684
+ relatedStepId?: string | undefined;
1685
+ }, {
1686
+ reason: "missing_user_context" | "capability_unavailable" | "efficiency_skip" | "safety_stop" | "policy_constraint";
1687
+ summary: string;
1688
+ divergenceId: string;
1689
+ relatedStepId?: string | undefined;
1690
+ }>;
1691
+ }, "strip", z.ZodTypeAny, {
1692
+ kind: "divergence_recorded";
1693
+ sessionId: string;
1694
+ data: {
1695
+ reason: "missing_user_context" | "capability_unavailable" | "efficiency_skip" | "safety_stop" | "policy_constraint";
1696
+ summary: string;
1697
+ divergenceId: string;
1698
+ relatedStepId?: string | undefined;
1699
+ };
1700
+ v: 1;
1701
+ eventId: string;
1702
+ eventIndex: number;
1703
+ dedupeKey: string;
1704
+ scope: {
1705
+ runId: string;
1706
+ nodeId: string;
1707
+ };
1708
+ }, {
1709
+ kind: "divergence_recorded";
1710
+ sessionId: string;
1711
+ data: {
1712
+ reason: "missing_user_context" | "capability_unavailable" | "efficiency_skip" | "safety_stop" | "policy_constraint";
1713
+ summary: string;
1714
+ divergenceId: string;
1715
+ relatedStepId?: string | undefined;
1716
+ };
1717
+ v: 1;
1718
+ eventId: string;
1719
+ eventIndex: number;
1720
+ dedupeKey: string;
1721
+ scope: {
1722
+ runId: string;
1723
+ nodeId: string;
1724
+ };
1725
+ }>, z.ZodObject<{
1726
+ v: z.ZodLiteral<1>;
1727
+ eventId: z.ZodString;
1728
+ eventIndex: z.ZodNumber;
1729
+ sessionId: z.ZodString;
1730
+ dedupeKey: z.ZodString;
1731
+ } & {
1732
+ kind: z.ZodLiteral<"decision_trace_appended">;
1733
+ scope: z.ZodObject<{
1734
+ runId: z.ZodString;
1735
+ nodeId: z.ZodString;
1736
+ }, "strip", z.ZodTypeAny, {
1737
+ runId: string;
1738
+ nodeId: string;
1739
+ }, {
1740
+ runId: string;
1741
+ nodeId: string;
1742
+ }>;
1743
+ data: z.ZodObject<{
1744
+ traceId: z.ZodString;
1745
+ entries: z.ZodArray<z.ZodObject<{
1746
+ kind: z.ZodEnum<["selected_next_step", "evaluated_condition", "entered_loop", "exited_loop", "detected_non_tip_advance"]>;
1747
+ summary: z.ZodString;
1748
+ refs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1749
+ }, "strip", z.ZodTypeAny, {
1750
+ kind: "selected_next_step" | "evaluated_condition" | "entered_loop" | "exited_loop" | "detected_non_tip_advance";
1751
+ summary: string;
1752
+ refs?: Record<string, unknown> | undefined;
1753
+ }, {
1754
+ kind: "selected_next_step" | "evaluated_condition" | "entered_loop" | "exited_loop" | "detected_non_tip_advance";
1755
+ summary: string;
1756
+ refs?: Record<string, unknown> | undefined;
1757
+ }>, "many">;
1758
+ }, "strip", z.ZodTypeAny, {
1759
+ entries: {
1760
+ kind: "selected_next_step" | "evaluated_condition" | "entered_loop" | "exited_loop" | "detected_non_tip_advance";
1761
+ summary: string;
1762
+ refs?: Record<string, unknown> | undefined;
1763
+ }[];
1764
+ traceId: string;
1765
+ }, {
1766
+ entries: {
1767
+ kind: "selected_next_step" | "evaluated_condition" | "entered_loop" | "exited_loop" | "detected_non_tip_advance";
1768
+ summary: string;
1769
+ refs?: Record<string, unknown> | undefined;
1770
+ }[];
1771
+ traceId: string;
1772
+ }>;
1773
+ }, "strip", z.ZodTypeAny, {
1774
+ kind: "decision_trace_appended";
1775
+ sessionId: string;
1776
+ data: {
1777
+ entries: {
1778
+ kind: "selected_next_step" | "evaluated_condition" | "entered_loop" | "exited_loop" | "detected_non_tip_advance";
1779
+ summary: string;
1780
+ refs?: Record<string, unknown> | undefined;
1781
+ }[];
1782
+ traceId: string;
1783
+ };
1784
+ v: 1;
1785
+ eventId: string;
1786
+ eventIndex: number;
1787
+ dedupeKey: string;
1788
+ scope: {
1789
+ runId: string;
1790
+ nodeId: string;
1791
+ };
1792
+ }, {
1793
+ kind: "decision_trace_appended";
1794
+ sessionId: string;
1795
+ data: {
1796
+ entries: {
1797
+ kind: "selected_next_step" | "evaluated_condition" | "entered_loop" | "exited_loop" | "detected_non_tip_advance";
1798
+ summary: string;
1799
+ refs?: Record<string, unknown> | undefined;
1800
+ }[];
1801
+ traceId: string;
1802
+ };
1803
+ v: 1;
1804
+ eventId: string;
1805
+ eventIndex: number;
1806
+ dedupeKey: string;
1807
+ scope: {
1808
+ runId: string;
1809
+ nodeId: string;
1810
+ };
1811
+ }>]>;
1812
+ export type DomainEventV1 = z.infer<typeof DomainEventV1Schema>;