@astrosheep/keiyaku 4.6.29 → 4.6.31

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 (400) hide show
  1. package/README.md +5 -5
  2. package/build/plugins/claude/.claude-plugin/plugin.json +1 -1
  3. package/build/plugins/claude/skills/keiyaku/SKILL.md +24 -24
  4. package/build/plugins/claude/skills/keiyaku-akuma/SKILL.md +44 -168
  5. package/build/plugins/claude/skills/keiyaku-akuma/references/automation.md +61 -231
  6. package/build/plugins/claude/skills/keiyaku-babysit/SKILL.md +47 -58
  7. package/build/plugins/claude/skills/keiyaku-bind/SKILL.md +44 -185
  8. package/build/plugins/claude/skills/keiyaku-debt/SKILL.md +40 -89
  9. package/build/plugins/claude/skills/keiyaku-workflow/SKILL.md +56 -116
  10. package/build/plugins/codex/.codex-plugin/plugin.json +1 -1
  11. package/build/plugins/codex/skills/keiyaku/SKILL.md +24 -24
  12. package/build/plugins/codex/skills/keiyaku-akuma/SKILL.md +44 -168
  13. package/build/plugins/codex/skills/keiyaku-akuma/references/automation.md +61 -231
  14. package/build/plugins/codex/skills/keiyaku-babysit/SKILL.md +47 -58
  15. package/build/plugins/codex/skills/keiyaku-bind/SKILL.md +44 -185
  16. package/build/plugins/codex/skills/keiyaku-debt/SKILL.md +40 -89
  17. package/build/plugins/codex/skills/keiyaku-workflow/SKILL.md +56 -116
  18. package/build/plugins/opencode/package.json +1 -1
  19. package/build/plugins/opencode/skills/keiyaku/SKILL.md +24 -24
  20. package/build/plugins/opencode/skills/keiyaku-akuma/SKILL.md +44 -168
  21. package/build/plugins/opencode/skills/keiyaku-akuma/references/automation.md +61 -231
  22. package/build/plugins/opencode/skills/keiyaku-babysit/SKILL.md +47 -58
  23. package/build/plugins/opencode/skills/keiyaku-bind/SKILL.md +44 -185
  24. package/build/plugins/opencode/skills/keiyaku-debt/SKILL.md +40 -89
  25. package/build/plugins/opencode/skills/keiyaku-workflow/SKILL.md +56 -116
  26. package/build/plugins/pi/README.md +5 -5
  27. package/build/plugins/pi/akuma-tools.ts +17 -23
  28. package/build/skills/keiyaku/SKILL.md +24 -24
  29. package/build/skills/keiyaku-akuma/SKILL.md +44 -168
  30. package/build/skills/keiyaku-akuma/references/automation.md +61 -231
  31. package/build/skills/keiyaku-babysit/SKILL.md +47 -58
  32. package/build/skills/keiyaku-bind/SKILL.md +44 -185
  33. package/build/skills/keiyaku-debt/SKILL.md +40 -89
  34. package/build/skills/keiyaku-workflow/SKILL.md +56 -116
  35. package/build/src/akuma/akuma-call.d.ts +1 -1
  36. package/build/src/akuma/akuma-call.js +9 -9
  37. package/build/src/akuma/akuma-errors.d.ts +5 -5
  38. package/build/src/akuma/akuma-instance.d.ts +355 -12
  39. package/build/src/akuma/akuma-instance.js +20 -20
  40. package/build/src/akuma/akuma-observe.d.ts +11 -12
  41. package/build/src/akuma/akuma-observe.js +34 -26
  42. package/build/src/akuma/akuma-owner.d.ts +32 -11
  43. package/build/src/akuma/akuma-owner.js +35 -16
  44. package/build/src/akuma/akuma-probe.d.ts +3 -3
  45. package/build/src/akuma/akuma-probe.js +2 -2
  46. package/build/src/akuma/akuma-selection-execution.d.ts +985 -1
  47. package/build/src/akuma/akuma-selection-execution.js +42 -18
  48. package/build/src/akuma/akuma-stream.d.ts +2 -2
  49. package/build/src/akuma/akuma-stream.js +1 -1
  50. package/build/src/akuma/akuma-wait.d.ts +5 -5
  51. package/build/src/akuma/akuma-wait.js +52 -14
  52. package/build/src/akuma/akuma.d.ts +245 -271
  53. package/build/src/akuma/akuma.js +98 -46
  54. package/build/src/akuma/archetype.d.ts +19 -6
  55. package/build/src/akuma/archetype.js +25 -9
  56. package/build/src/akuma/body-launch.d.ts +2 -2
  57. package/build/src/akuma/body.js +4 -4
  58. package/build/src/akuma/call-initial-tell.d.ts +60 -44
  59. package/build/src/akuma/call-initial-tell.js +41 -2
  60. package/build/src/akuma/caller.d.ts +26 -17
  61. package/build/src/akuma/caller.js +22 -9
  62. package/build/src/akuma/coordinate.d.ts +9 -0
  63. package/build/src/akuma/coordinate.js +13 -0
  64. package/build/src/akuma/detached-body.js +2 -2
  65. package/build/src/akuma/dispatch-association.d.ts +4 -4
  66. package/build/src/akuma/dispatch-association.js +12 -3
  67. package/build/src/akuma/execution-instructions.js +2 -2
  68. package/build/src/akuma/heart/facts.d.ts +29 -7
  69. package/build/src/akuma/heart/facts.js +13 -0
  70. package/build/src/akuma/heart/index.d.ts +0 -3
  71. package/build/src/akuma/heart/index.js +3 -6
  72. package/build/src/akuma/heart/rows.js +2 -2
  73. package/build/src/akuma/heart/soul.js +5 -5
  74. package/build/src/akuma/identity.d.ts +17 -16
  75. package/build/src/akuma/identity.js +20 -19
  76. package/build/src/akuma/index.d.ts +1 -2
  77. package/build/src/akuma/lineage-cache.d.ts +4 -4
  78. package/build/src/akuma/lineage-cache.js +10 -10
  79. package/build/src/akuma/projection-read.d.ts +2 -5
  80. package/build/src/akuma/projection-read.js +34 -47
  81. package/build/src/akuma/projection.d.ts +659 -569
  82. package/build/src/akuma/projection.js +203 -94
  83. package/build/src/akuma/providers/acp/index.js +1 -1
  84. package/build/src/akuma/providers/execution-environment.d.ts +1 -3
  85. package/build/src/akuma/providers/execution-environment.js +0 -4
  86. package/build/src/akuma/publication.d.ts +2 -2
  87. package/build/src/akuma/publication.js +3 -3
  88. package/build/src/akuma/retention.js +2 -2
  89. package/build/src/akuma/selection-observation.d.ts +507 -43
  90. package/build/src/akuma/selection-observation.js +153 -1
  91. package/build/src/akuma/status-projection.d.ts +288 -0
  92. package/build/src/akuma/status-projection.js +154 -0
  93. package/build/src/akuma/turn-drive.js +0 -3
  94. package/build/src/alias/index.d.ts +9 -4
  95. package/build/src/alias/index.js +11 -9
  96. package/build/src/bounded-list.d.ts +8 -0
  97. package/build/src/bounded-list.js +9 -0
  98. package/build/src/cli/commands/akuma-grammar.d.ts +2 -2
  99. package/build/src/cli/commands/akuma-grammar.js +21 -21
  100. package/build/src/cli/commands/akuma.d.ts +1 -2
  101. package/build/src/cli/commands/akuma.js +115 -251
  102. package/build/src/cli/commands/contract-grammar.d.ts +4 -3
  103. package/build/src/cli/commands/contract-grammar.js +39 -22
  104. package/build/src/cli/commands/contract-help.d.ts +3 -1
  105. package/build/src/cli/commands/contract-help.js +4 -3
  106. package/build/src/cli/commands/contract.d.ts +6 -3
  107. package/build/src/cli/commands/contract.js +203 -434
  108. package/build/src/cli/commands/debt.d.ts +2 -3
  109. package/build/src/cli/commands/debt.js +101 -317
  110. package/build/src/cli/commands/report.js +11 -28
  111. package/build/src/cli/commands/whoami.d.ts +3 -43
  112. package/build/src/cli/commands/whoami.js +8 -121
  113. package/build/src/cli/coordinates.d.ts +4 -35
  114. package/build/src/cli/coordinates.js +13 -129
  115. package/build/src/cli/parse.d.ts +0 -6
  116. package/build/src/cli/parse.js +5 -48
  117. package/build/src/cli/render/akuma-activity.d.ts +31 -16
  118. package/build/src/cli/render/akuma-activity.js +162 -122
  119. package/build/src/cli/render/akuma-tool.d.ts +3 -6
  120. package/build/src/cli/render/akuma-tool.js +20 -14
  121. package/build/src/cli/render/akuma.d.ts +25 -26
  122. package/build/src/cli/render/akuma.js +100 -129
  123. package/build/src/cli/render/catalog.d.ts +4 -7
  124. package/build/src/cli/render/catalog.js +52 -99
  125. package/build/src/cli/render/contract-history.d.ts +3 -1
  126. package/build/src/cli/render/contract-history.js +140 -215
  127. package/build/src/cli/render/contract-observation.d.ts +43 -30
  128. package/build/src/cli/render/contract-observation.js +64 -31
  129. package/build/src/cli/render/contract-wait.js +6 -6
  130. package/build/src/cli/render/contract.d.ts +41 -6
  131. package/build/src/cli/render/contract.js +274 -370
  132. package/build/src/cli/render/debt.d.ts +9 -19
  133. package/build/src/cli/render/debt.js +120 -185
  134. package/build/src/cli/render/delivery-preview.d.ts +4 -3
  135. package/build/src/cli/render/delivery-preview.js +68 -96
  136. package/build/src/cli/render/kanshi-akuma.d.ts +5 -4
  137. package/build/src/cli/render/kanshi-akuma.js +70 -59
  138. package/build/src/cli/render/kanshi.d.ts +4 -4
  139. package/build/src/cli/render/kanshi.js +205 -207
  140. package/build/src/cli/render/marks.d.ts +11 -2
  141. package/build/src/cli/render/marks.js +13 -3
  142. package/build/src/cli/render/nuke.d.ts +3 -3
  143. package/build/src/cli/render/nuke.js +13 -16
  144. package/build/src/cli/render/receipt.d.ts +37 -43
  145. package/build/src/cli/render/receipt.js +313 -236
  146. package/build/src/cli/render/reconcile.d.ts +6 -4
  147. package/build/src/cli/render/reconcile.js +53 -137
  148. package/build/src/cli/render/refusal.d.ts +3 -2
  149. package/build/src/cli/render/refusal.js +73 -54
  150. package/build/src/cli/render/region.d.ts +11 -2
  151. package/build/src/cli/render/region.js +17 -23
  152. package/build/src/cli/render/settings.d.ts +0 -1
  153. package/build/src/cli/render/settings.js +8 -17
  154. package/build/src/cli/render/terminal.d.ts +2 -0
  155. package/build/src/cli/render/verbs.d.ts +4 -0
  156. package/build/src/cli/render/verbs.js +312 -0
  157. package/build/src/cli/render/whoami.d.ts +1 -1
  158. package/build/src/cli/render/whoami.js +24 -31
  159. package/build/src/cli/runtime.d.ts +3 -11
  160. package/build/src/cli/runtime.js +96 -79
  161. package/build/src/cli/scan.d.ts +1 -1
  162. package/build/src/cli/streams.js +1 -0
  163. package/build/src/contract-guidance.js +2 -2
  164. package/build/src/contract-worktree.d.ts +2 -15
  165. package/build/src/contract-worktree.js +35 -36
  166. package/build/src/core/facts/observation.d.ts +4 -5
  167. package/build/src/core/facts/observation.js +7 -9
  168. package/build/src/core/verbs/amend.d.ts +0 -1
  169. package/build/src/core/verbs/amend.js +3 -3
  170. package/build/src/core/verbs/bind.d.ts +0 -1
  171. package/build/src/core/verbs/bind.js +5 -5
  172. package/build/src/core/verbs/deliver.d.ts +3 -2
  173. package/build/src/core/verbs/deliver.js +2 -2
  174. package/build/src/core/verbs/placement.d.ts +0 -5
  175. package/build/src/core/verbs/placement.js +4 -6
  176. package/build/src/core/verbs/reintegrate.d.ts +0 -1
  177. package/build/src/core/verbs/reintegrate.js +2 -2
  178. package/build/src/debt/board.d.ts +132 -116
  179. package/build/src/debt/board.js +138 -94
  180. package/build/src/debt/catalog.d.ts +4 -4
  181. package/build/src/debt/catalog.js +2 -18
  182. package/build/src/debt/context.d.ts +15 -3
  183. package/build/src/debt/context.js +12 -1
  184. package/build/src/debt/created-observation.d.ts +5 -17
  185. package/build/src/debt/created-observation.js +14 -6
  186. package/build/src/debt/document.d.ts +20 -15
  187. package/build/src/debt/document.js +18 -1
  188. package/build/src/debt/index.d.ts +346 -23
  189. package/build/src/debt/index.js +68 -22
  190. package/build/src/debt/input.d.ts +2 -1
  191. package/build/src/debt/input.js +14 -0
  192. package/build/src/debt/lifecycle-operations.d.ts +2 -2
  193. package/build/src/debt/lifecycle-operations.js +14 -22
  194. package/build/src/debt/operation-types.d.ts +188 -66
  195. package/build/src/debt/operation-types.js +113 -1
  196. package/build/src/debt/operations.d.ts +11 -10
  197. package/build/src/debt/operations.js +46 -71
  198. package/build/src/debt/query.d.ts +14 -10
  199. package/build/src/debt/query.js +3 -12
  200. package/build/src/debt/store.d.ts +4 -2
  201. package/build/src/debt/store.js +8 -8
  202. package/build/src/debt/view.d.ts +0 -3
  203. package/build/src/debt/view.js +0 -4
  204. package/build/src/dispatch/index.d.ts +22 -5
  205. package/build/src/dispatch/index.js +46 -37
  206. package/build/src/git/admission.d.ts +2 -2
  207. package/build/src/git/admission.js +2 -1
  208. package/build/src/git/hooks.d.ts +14 -35
  209. package/build/src/git/hooks.js +45 -25
  210. package/build/src/git/integration.d.ts +6 -24
  211. package/build/src/git/integration.js +10 -16
  212. package/build/src/git/observe.d.ts +2 -1
  213. package/build/src/git/observe.js +29 -20
  214. package/build/src/git/private-state-seat.d.ts +2 -2
  215. package/build/src/git/private-state-seat.js +2 -1
  216. package/build/src/git/reconcile.d.ts +17 -79
  217. package/build/src/git/reconcile.js +37 -52
  218. package/build/src/git/scratch.d.ts +3 -3
  219. package/build/src/git/scratch.js +4 -1
  220. package/build/src/git/target-placement.d.ts +23 -31
  221. package/build/src/git/target-placement.js +42 -27
  222. package/build/src/git/target.d.ts +2 -2
  223. package/build/src/git/target.js +2 -1
  224. package/build/src/git/tender.d.ts +7 -39
  225. package/build/src/git/tender.js +21 -54
  226. package/build/src/git/terminal-reconcile.js +15 -18
  227. package/build/src/git/terminal-seal.d.ts +2 -4
  228. package/build/src/git/terminal-seal.js +7 -33
  229. package/build/src/git/workspace.d.ts +65 -41
  230. package/build/src/git/workspace.js +45 -14
  231. package/build/src/identity/selector.d.ts +2 -0
  232. package/build/src/identity/selector.js +13 -3
  233. package/build/src/index.d.ts +48 -54
  234. package/build/src/index.js +31 -43
  235. package/build/src/kanshi/counts.d.ts +42 -8
  236. package/build/src/kanshi/counts.js +13 -2
  237. package/build/src/kanshi/index.d.ts +5 -5
  238. package/build/src/kanshi/index.js +4 -3
  239. package/build/src/kanshi/read.d.ts +489 -6
  240. package/build/src/kanshi/read.js +334 -483
  241. package/build/src/kanshi/report.d.ts +2504 -103
  242. package/build/src/kanshi/report.js +165 -1
  243. package/build/src/kanshi/select.d.ts +0 -8
  244. package/build/src/kanshi/select.js +20 -59
  245. package/build/src/library/address.d.ts +8 -8
  246. package/build/src/library/address.js +7 -7
  247. package/build/src/library/akuma-creation.d.ts +690 -84
  248. package/build/src/library/akuma-creation.js +202 -142
  249. package/build/src/library/akuma-retention.d.ts +2 -2
  250. package/build/src/library/akuma-retention.js +2 -2
  251. package/build/src/library/akumas.d.ts +10 -6
  252. package/build/src/library/akumas.js +24 -7
  253. package/build/src/library/bind.d.ts +28 -54
  254. package/build/src/library/bind.js +6 -4
  255. package/build/src/library/continuation.d.ts +197 -479
  256. package/build/src/library/continuation.js +40 -23
  257. package/build/src/library/contract-address.d.ts +6 -5
  258. package/build/src/library/contract-address.js +5 -7
  259. package/build/src/library/contract-composition.d.ts +18 -12
  260. package/build/src/library/contract-composition.js +55 -47
  261. package/build/src/library/contract-creation.d.ts +3 -2
  262. package/build/src/library/contract-creation.js +38 -32
  263. package/build/src/library/contract-execution.js +77 -38
  264. package/build/src/library/contract-outcomes.d.ts +1877 -27
  265. package/build/src/library/contract-outcomes.js +93 -10
  266. package/build/src/library/contract-settings.d.ts +2 -2
  267. package/build/src/library/contract-settings.js +18 -14
  268. package/build/src/library/contract-types.d.ts +238 -61
  269. package/build/src/library/contract-types.js +131 -1
  270. package/build/src/library/contract-wait.d.ts +38 -17
  271. package/build/src/library/contract-wait.js +40 -10
  272. package/build/src/library/delivery.d.ts +588 -36
  273. package/build/src/library/delivery.js +35 -27
  274. package/build/src/library/input.d.ts +1 -1
  275. package/build/src/library/input.js +1 -2
  276. package/build/src/library/invocation.d.ts +11 -7
  277. package/build/src/library/invocation.js +42 -51
  278. package/build/src/library/kei.d.ts +48 -0
  279. package/build/src/library/kei.js +256 -0
  280. package/build/src/library/keiyaku-attribution.d.ts +11 -0
  281. package/build/src/{cli/delivery-identity.js → library/keiyaku-attribution.js} +12 -1
  282. package/build/src/library/keiyaku-classify.d.ts +11 -0
  283. package/build/src/library/keiyaku-classify.js +146 -0
  284. package/build/src/library/keiyaku-coordinates.d.ts +31 -0
  285. package/build/src/library/keiyaku-coordinates.js +103 -0
  286. package/build/src/library/keiyaku-debt.d.ts +142 -0
  287. package/build/src/library/keiyaku-debt.js +188 -0
  288. package/build/src/library/keiyaku-identity.d.ts +58 -0
  289. package/build/src/library/keiyaku-identity.js +176 -0
  290. package/build/src/library/keiyaku-policy.d.ts +27 -0
  291. package/build/src/library/keiyaku-policy.js +44 -0
  292. package/build/src/library/keiyaku-status.d.ts +1487 -0
  293. package/build/src/library/keiyaku-status.js +92 -0
  294. package/build/src/library/keiyaku-verbs.d.ts +6774 -0
  295. package/build/src/library/keiyaku-verbs.js +458 -0
  296. package/build/src/library/keiyaku.d.ts +871 -38
  297. package/build/src/library/keiyaku.js +677 -127
  298. package/build/src/library/nuke.d.ts +22 -0
  299. package/build/src/library/nuke.js +4 -1
  300. package/build/src/library/outcome.d.ts +706 -692
  301. package/build/src/library/outcome.js +582 -167
  302. package/build/src/library/reconcile.d.ts +464 -116
  303. package/build/src/library/reconcile.js +174 -102
  304. package/build/src/library/refusal.d.ts +113 -577
  305. package/build/src/library/refusal.js +64 -51
  306. package/build/src/library/region.d.ts +5 -24
  307. package/build/src/library/region.js +6 -21
  308. package/build/src/library/selection.d.ts +181 -32
  309. package/build/src/library/selection.js +99 -64
  310. package/build/src/mcp/adapter.d.ts +11 -0
  311. package/build/src/mcp/adapter.js +106 -0
  312. package/build/src/mcp/help.d.ts +1 -0
  313. package/build/src/mcp/help.js +26 -0
  314. package/build/src/mcp/index.d.ts +2 -0
  315. package/build/src/mcp/index.js +37 -0
  316. package/build/src/plugin/public.d.ts +1 -1
  317. package/build/src/plugin/runtime.js +17 -14
  318. package/build/src/protocol/arc.d.ts +4 -1
  319. package/build/src/protocol/arc.js +7 -1
  320. package/build/src/protocol/attempt.d.ts +2 -3
  321. package/build/src/protocol/attempt.js +1 -10
  322. package/build/src/protocol/bind.d.ts +6 -7
  323. package/build/src/protocol/bind.js +9 -5
  324. package/build/src/protocol/completion.d.ts +448 -12
  325. package/build/src/protocol/completion.js +164 -26
  326. package/build/src/protocol/deliver.d.ts +26 -24
  327. package/build/src/protocol/deliver.js +24 -52
  328. package/build/src/protocol/delivery-preview.d.ts +97 -247
  329. package/build/src/protocol/delivery-preview.js +132 -128
  330. package/build/src/protocol/execution-observation.d.ts +146 -123
  331. package/build/src/protocol/execution-observation.js +9 -6
  332. package/build/src/protocol/intent.d.ts +9 -48
  333. package/build/src/protocol/intent.js +32 -46
  334. package/build/src/protocol/operations.d.ts +207 -505
  335. package/build/src/protocol/operations.js +81 -134
  336. package/build/src/protocol/placement.d.ts +0 -1
  337. package/build/src/protocol/placement.js +5 -2
  338. package/build/src/protocol/progress.d.ts +7 -97
  339. package/build/src/protocol/progress.js +7 -55
  340. package/build/src/protocol/read/observation.d.ts +13 -6
  341. package/build/src/protocol/read/observation.js +10 -9
  342. package/build/src/protocol/read/status.d.ts +466 -95
  343. package/build/src/protocol/read/status.js +380 -91
  344. package/build/src/protocol/reconcile.d.ts +2 -0
  345. package/build/src/protocol/reconcile.js +12 -11
  346. package/build/src/protocol/reintegrate.d.ts +0 -1
  347. package/build/src/protocol/reintegrate.js +4 -4
  348. package/build/src/protocol/result-leaves.d.ts +528 -0
  349. package/build/src/protocol/result-leaves.js +195 -0
  350. package/build/src/protocol/result-reasons.d.ts +129 -0
  351. package/build/src/protocol/result-reasons.js +87 -0
  352. package/build/src/protocol/review.d.ts +14 -11
  353. package/build/src/protocol/review.js +30 -14
  354. package/build/src/protocol/run.d.ts +4 -4
  355. package/build/src/protocol/run.js +4 -1
  356. package/build/src/protocol/verify.d.ts +359 -30
  357. package/build/src/protocol/verify.js +118 -28
  358. package/build/src/region.d.ts +26 -0
  359. package/build/src/region.js +28 -0
  360. package/build/src/runtime/proc/diagnostic.d.ts +11 -0
  361. package/build/src/runtime/proc/diagnostic.js +20 -0
  362. package/build/src/runtime/proc/windows-launch.exe +0 -0
  363. package/build/src/settings.d.ts +126 -32
  364. package/build/src/settings.js +107 -34
  365. package/build/src/settlement/settle.d.ts +29 -12
  366. package/build/src/settlement/settle.js +22 -15
  367. package/build/src/verification/declaration.d.ts +1 -3
  368. package/build/src/verification/declaration.js +2 -5
  369. package/build/src/verification/execution.d.ts +7 -19
  370. package/build/src/verification/execution.js +37 -16
  371. package/build/src/verification/observation.d.ts +13 -13
  372. package/build/src/verification/observation.js +9 -7
  373. package/build/src/world.d.ts +8 -0
  374. package/build/src/world.js +7 -0
  375. package/package.json +6 -5
  376. package/plugins/paseo/plugin/server/keiyaku.ts +13 -46
  377. package/plugins/paseo/plugin/server/message.ts +8 -30
  378. package/plugins/paseo/plugin/server/mirror.ts +16 -20
  379. package/plugins/paseo/plugin/server/provider.ts +1 -1
  380. package/plugins/paseo/plugin/server/sdk.ts +14 -6
  381. package/plugins/pi/README.md +5 -5
  382. package/plugins/pi/akuma-tools.ts +17 -23
  383. package/skills/keiyaku/SKILL.md +24 -24
  384. package/skills/keiyaku-akuma/SKILL.md +44 -168
  385. package/skills/keiyaku-akuma/references/automation.md +61 -231
  386. package/skills/keiyaku-babysit/SKILL.md +47 -58
  387. package/skills/keiyaku-bind/SKILL.md +44 -185
  388. package/skills/keiyaku-debt/SKILL.md +40 -89
  389. package/skills/keiyaku-workflow/SKILL.md +56 -116
  390. package/build/src/cli/actor.d.ts +0 -10
  391. package/build/src/cli/actor.js +0 -24
  392. package/build/src/cli/akuma-caller.d.ts +0 -3
  393. package/build/src/cli/akuma-caller.js +0 -31
  394. package/build/src/cli/delivery-identity.d.ts +0 -3
  395. package/build/src/cli/render/effects.d.ts +0 -26
  396. package/build/src/cli/render/effects.js +0 -41
  397. package/build/src/cli/selectors.d.ts +0 -10
  398. package/build/src/cli/selectors.js +0 -42
  399. package/build/src/markdown/diff.d.ts +0 -1
  400. package/build/src/markdown/diff.js +0 -4
@@ -1,641 +1,480 @@
1
1
  /** @architectureCompositionRoot */
2
2
  import { z } from "zod";
3
- import type { ContractHead, ContractId, JournalEntry } from "../core/facts/types.js";
4
- import type { CompletionEvidence } from "../protocol/completion.js";
3
+ import type { ContractId, SnapshotId } from "../core/facts/types.js";
4
+ import { reconcileEffectSchema } from "../git/reconcile.js";
5
+ import { placementSchema, type CompletionEvidence } from "../protocol/completion.js";
6
+ import { type VerifyValue } from "../protocol/verify.js";
5
7
  import type { IntegrationConflictMaterialized } from "../protocol/deliver.js";
6
8
  import type { ReviewAdmissionValue } from "../protocol/review.js";
7
- import type { WorldRoot } from "../world.js";
9
+ import { settlementActionSchema } from "../settlement/settle.js";
10
+ import { type WorldRoot } from "../world.js";
8
11
  import type { ContinuationReport } from "./continuation.js";
9
- import type { AmendValue, BindValue } from "./contract-outcomes.js";
10
- import type { DeliveryValue } from "./delivery.js";
11
- import type { DeliveryPreviewReport } from "../protocol/delivery-preview.js";
12
+ import type { SpawnResult } from "./akuma-creation.js";
12
13
  import type { InvocationSnapshot } from "./invocation.js";
13
- import { reconciliationLagSchema } from "./reconcile.js";
14
- import { nukeConfirmationRefusalSchema, nukeConfirmationRequiredRefusalSchema, type OperationRetries } from "./refusal.js";
15
- /** Contract operation tags, including preview, sharing the invocation envelope with World reset. */
14
+ import { type Retry } from "../protocol/result-reasons.js";
15
+ export { executionIssueSchema } from "../protocol/result-reasons.js";
16
+ import type { IntentRetry } from "../protocol/operations.js";
16
17
  export type ContractVerb = "bind" | "amend" | "deliver" | "verify" | "review" | "deliver-preview" | "arc" | "abandon";
17
- declare const reconciliationEffectSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
18
- kind: z.ZodLiteral<"worktree">;
18
+ export type ReconciliationEffect = z.output<typeof reconcileEffectSchema>;
19
+ export declare const reconciliationLagSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
20
+ kind: z.ZodLiteral<"worktree-retained">;
21
+ path: z.ZodString;
22
+ diagnostic: z.ZodExactOptional<z.ZodString>;
23
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
24
+ kind: z.ZodLiteral<"worktree-follow-retained">;
19
25
  path: z.ZodString;
20
- action: z.ZodEnum<{
21
- removed: "removed";
22
- unchanged: "unchanged";
23
- created: "created";
26
+ reason: z.ZodEnum<{
27
+ "head-moved": "head-moved";
28
+ "head-attached": "head-attached";
29
+ "operation-in-progress": "operation-in-progress";
24
30
  }>;
25
- before: z.ZodOptional<z.ZodUnknown>;
26
- after: z.ZodOptional<z.ZodUnknown>;
27
- }, z.core.$strict>, z.ZodTransform<{
28
- kind: "worktree";
29
- path: string;
30
- action: "removed" | "unchanged" | "created";
31
- }, {
32
- kind: "worktree";
33
- path: string;
34
- action: "removed" | "unchanged" | "created";
35
- before?: unknown;
36
- after?: unknown;
37
- }>>, z.ZodObject<{
38
- kind: z.ZodLiteral<"worktree">;
39
- path: z.ZodString;
40
- action: z.ZodLiteral<"followed">;
41
- before: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
42
- after: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
43
- }, z.core.$strict>, z.ZodObject<{
44
- kind: z.ZodLiteral<"recovery-snapshot">;
45
- action: z.ZodLiteral<"created">;
46
- snapshot: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
47
- retention: z.ZodLiteral<"ephemeral">;
48
- }, z.core.$strict>, z.ZodObject<{
49
- kind: z.ZodLiteral<"target-checkout">;
31
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
32
+ kind: z.ZodLiteral<"unsealed-bytes">;
33
+ path: z.ZodString;
34
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
35
+ kind: z.ZodLiteral<"target-checkout-retained">;
50
36
  path: z.ZodString;
51
37
  target: z.ZodString;
52
- action: z.ZodEnum<{
53
- followed: "followed";
54
- recovered: "recovered";
38
+ diagnostic: z.ZodString;
39
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
40
+ kind: z.ZodLiteral<"target-workspace-retained">;
41
+ targetContractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
42
+ reason: z.ZodEnum<{
43
+ missing: "missing";
44
+ replaced: "replaced";
45
+ unappointed: "unappointed";
46
+ association: "association";
47
+ attached: "attached";
48
+ uncommitted: "uncommitted";
49
+ operation: "operation";
55
50
  }>;
56
- }, z.core.$strict>, z.ZodObject<{
57
- kind: z.ZodLiteral<"ref">;
51
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
52
+ kind: z.ZodLiteral<"worktree-hook-failed">;
53
+ phase: z.ZodEnum<{
54
+ destroy: "destroy";
55
+ create: "create";
56
+ }>;
57
+ path: z.ZodString;
58
58
  name: z.ZodString;
59
- before: z.ZodNullable<z.ZodString>;
60
- after: z.ZodNullable<z.ZodString>;
61
- action: z.ZodEnum<{
62
- removed: "removed";
63
- unchanged: "unchanged";
64
- updated: "updated";
65
- created: "created";
59
+ diagnostic: z.ZodString;
60
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
61
+ kind: z.ZodLiteral<"reconcile-failed">;
62
+ diagnostic: z.ZodString;
63
+ }, z.core.$strict>>]>, z.ZodReadonly<z.ZodObject<{
64
+ kind: z.ZodLiteral<"contract-file-failed">;
65
+ path: z.ZodString;
66
+ diagnostic: z.ZodString;
67
+ }, z.core.$strict>>]>;
68
+ export type ReconciliationLag = z.output<typeof reconciliationLagSchema>;
69
+ export type ReconcileLagScope = "none" | "reconciliation" | "placement" | "continuation";
70
+ export declare function reconcileLagScope(lag: ReconciliationLag): ReconcileLagScope;
71
+ export declare function reconcileLagIsFailure(lag: ReconciliationLag): boolean;
72
+ export declare const reconcileIssueSchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
73
+ kind: z.ZodLiteral<"worktree-retained">;
74
+ path: z.ZodString;
75
+ diagnostic: z.ZodExactOptional<z.ZodString>;
76
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
77
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
78
+ kind: z.ZodLiteral<"worktree-follow-retained">;
79
+ path: z.ZodString;
80
+ reason: z.ZodEnum<{
81
+ "head-moved": "head-moved";
82
+ "head-attached": "head-attached";
83
+ "operation-in-progress": "operation-in-progress";
66
84
  }>;
67
- }, z.core.$strict>]>, z.ZodObject<{
68
- kind: z.ZodLiteral<"contract-file">;
69
- path: z.ZodString;
70
- action: z.ZodEnum<{
71
- removed: "removed";
72
- unchanged: "unchanged";
73
- updated: "updated";
74
- created: "created";
85
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
86
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
87
+ kind: z.ZodLiteral<"unsealed-bytes">;
88
+ path: z.ZodString;
89
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
90
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
91
+ kind: z.ZodLiteral<"target-checkout-retained">;
92
+ path: z.ZodString;
93
+ target: z.ZodString;
94
+ diagnostic: z.ZodString;
95
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
96
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
97
+ kind: z.ZodLiteral<"target-workspace-retained">;
98
+ targetContractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
99
+ reason: z.ZodEnum<{
100
+ missing: "missing";
101
+ replaced: "replaced";
102
+ unappointed: "unappointed";
103
+ association: "association";
104
+ attached: "attached";
105
+ uncommitted: "uncommitted";
106
+ operation: "operation";
75
107
  }>;
76
- }, z.core.$strict>]>;
77
- export type ReconciliationEffect = z.infer<typeof reconciliationEffectSchema>;
78
- export type ReconciliationLag = z.infer<typeof reconciliationLagSchema>;
79
- declare const resetOwnerSchema: z.ZodEnum<{
80
- world: "world";
81
- debt: "debt";
82
- akuma: "akuma";
83
- git: "git";
84
- }>;
85
- export type ResetOwner = z.infer<typeof resetOwnerSchema>;
86
- declare const resetEffectSchema: z.ZodUnion<readonly [z.ZodObject<{
87
- world: z.ZodString;
88
- owner: z.ZodEnum<{
89
- world: "world";
90
- debt: "debt";
91
- akuma: "akuma";
92
- git: "git";
108
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
109
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
110
+ kind: z.ZodLiteral<"worktree-hook-failed">;
111
+ phase: z.ZodEnum<{
112
+ destroy: "destroy";
113
+ create: "create";
93
114
  }>;
115
+ path: z.ZodString;
116
+ name: z.ZodString;
94
117
  diagnostic: z.ZodString;
95
- kind: z.ZodLiteral<"reset-owner-stopped">;
96
- }, z.core.$strict>, z.ZodObject<{
97
- world: z.ZodString;
98
- owner: z.ZodEnum<{
99
- world: "world";
100
- debt: "debt";
101
- akuma: "akuma";
102
- git: "git";
103
- }>;
118
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
119
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
120
+ kind: z.ZodLiteral<"reconcile-failed">;
104
121
  diagnostic: z.ZodString;
105
- kind: z.ZodLiteral<"reset-residue">;
106
- }, z.core.$strict>]>;
107
- type ResetEffect = z.infer<typeof resetEffectSchema>;
108
- declare const contractEffectSchema: z.ZodUnion<readonly [z.ZodObject<{
109
- kind: z.ZodLiteral<"reconciliation-effect">;
110
- contract: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
111
- effect: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
112
- kind: z.ZodLiteral<"worktree">;
113
- path: z.ZodString;
114
- action: z.ZodEnum<{
115
- removed: "removed";
116
- unchanged: "unchanged";
117
- created: "created";
118
- }>;
119
- before: z.ZodOptional<z.ZodUnknown>;
120
- after: z.ZodOptional<z.ZodUnknown>;
121
- }, z.core.$strict>, z.ZodTransform<{
122
- kind: "worktree";
123
- path: string;
124
- action: "removed" | "unchanged" | "created";
125
- }, {
126
- kind: "worktree";
127
- path: string;
128
- action: "removed" | "unchanged" | "created";
129
- before?: unknown;
130
- after?: unknown;
131
- }>>, z.ZodObject<{
132
- kind: z.ZodLiteral<"worktree">;
133
- path: z.ZodString;
134
- action: z.ZodLiteral<"followed">;
135
- before: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
136
- after: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
137
- }, z.core.$strict>, z.ZodObject<{
138
- kind: z.ZodLiteral<"recovery-snapshot">;
139
- action: z.ZodLiteral<"created">;
140
- snapshot: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
141
- retention: z.ZodLiteral<"ephemeral">;
142
- }, z.core.$strict>, z.ZodObject<{
143
- kind: z.ZodLiteral<"target-checkout">;
144
- path: z.ZodString;
145
- target: z.ZodString;
146
- action: z.ZodEnum<{
147
- followed: "followed";
148
- recovered: "recovered";
149
- }>;
150
- }, z.core.$strict>, z.ZodObject<{
151
- kind: z.ZodLiteral<"ref">;
152
- name: z.ZodString;
153
- before: z.ZodNullable<z.ZodString>;
154
- after: z.ZodNullable<z.ZodString>;
155
- action: z.ZodEnum<{
156
- removed: "removed";
157
- unchanged: "unchanged";
158
- updated: "updated";
159
- created: "created";
160
- }>;
161
- }, z.core.$strict>]>, z.ZodObject<{
162
- kind: z.ZodLiteral<"contract-file">;
163
- path: z.ZodString;
164
- action: z.ZodEnum<{
165
- removed: "removed";
166
- unchanged: "unchanged";
167
- updated: "updated";
168
- created: "created";
169
- }>;
170
- }, z.core.$strict>]>;
171
- }, z.core.$strict>, z.ZodObject<{
172
- kind: z.ZodLiteral<"reconciliation-lag">;
173
- contract: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
174
- affects: z.ZodEnum<{
175
- none: "none";
176
- placement: "placement";
177
- continuation: "continuation";
178
- reconciliation: "reconciliation";
122
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
123
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
124
+ kind: z.ZodLiteral<"contract-file-failed">;
125
+ path: z.ZodString;
126
+ diagnostic: z.ZodString;
127
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
128
+ }, z.core.$strict>>]>;
129
+ export declare const cleanupIssueSchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
130
+ kind: z.ZodLiteral<"decode-channel-retirement">;
131
+ diagnostic: z.ZodString;
132
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
133
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
134
+ name: z.ZodString;
135
+ diagnostic: z.ZodString;
136
+ snapshot: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<SnapshotId, string>>>;
137
+ requirement: z.ZodExactOptional<z.ZodString>;
138
+ index: z.ZodExactOptional<z.ZodNumber>;
139
+ kind: z.ZodLiteral<"verification-cleanup">;
140
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
141
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
142
+ path: z.ZodExactOptional<z.ZodString>;
143
+ diagnostic: z.ZodString;
144
+ snapshot: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<SnapshotId, string>>>;
145
+ requirement: z.ZodExactOptional<z.ZodString>;
146
+ index: z.ZodExactOptional<z.ZodNumber>;
147
+ kind: z.ZodLiteral<"worktree-leak">;
148
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
149
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
150
+ kind: z.ZodLiteral<"private-state-seat-close">;
151
+ diagnostic: z.ZodString;
152
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
153
+ }, z.core.$strict>>]>;
154
+ export declare const invocationIssueSchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
155
+ kind: z.ZodLiteral<"worktree-retained">;
156
+ path: z.ZodString;
157
+ diagnostic: z.ZodExactOptional<z.ZodString>;
158
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
159
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
160
+ kind: z.ZodLiteral<"worktree-follow-retained">;
161
+ path: z.ZodString;
162
+ reason: z.ZodEnum<{
163
+ "head-moved": "head-moved";
164
+ "head-attached": "head-attached";
165
+ "operation-in-progress": "operation-in-progress";
179
166
  }>;
180
- lag: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
181
- kind: z.ZodLiteral<"worktree-retained">;
182
- path: z.ZodString;
183
- diagnostic: z.ZodOptional<z.ZodString>;
184
- }, z.core.$strict>, z.ZodObject<{
185
- kind: z.ZodLiteral<"worktree-follow-retained">;
186
- path: z.ZodString;
187
- tender: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
188
- head: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
189
- reason: z.ZodEnum<{
190
- "head-moved": "head-moved";
191
- "head-attached": "head-attached";
192
- "operation-in-progress": "operation-in-progress";
193
- "unsupported-parent-shape": "unsupported-parent-shape";
194
- }>;
195
- paths: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
196
- }, z.core.$strict>, z.ZodObject<{
197
- kind: z.ZodLiteral<"unsealed-bytes">;
198
- path: z.ZodString;
199
- paths: z.ZodReadonly<z.ZodArray<z.ZodString>>;
200
- head: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>>;
201
- }, z.core.$strict>, z.ZodObject<{
202
- kind: z.ZodLiteral<"target-checkout-retained">;
203
- path: z.ZodString;
204
- target: z.ZodString;
205
- diagnostic: z.ZodString;
206
- }, z.core.$strict>, z.ZodObject<{
207
- kind: z.ZodLiteral<"target-workspace-retained">;
208
- contractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
209
- reason: z.ZodEnum<{
210
- missing: "missing";
211
- replaced: "replaced";
212
- unappointed: "unappointed";
213
- association: "association";
214
- attached: "attached";
215
- uncommitted: "uncommitted";
216
- operation: "operation";
217
- }>;
218
- }, z.core.$strict>, z.ZodObject<{
219
- kind: z.ZodLiteral<"worktree-hook-failed">;
220
- phase: z.ZodEnum<{
221
- destroy: "destroy";
222
- create: "create";
223
- }>;
224
- path: z.ZodString;
225
- command: z.ZodNumber;
226
- name: z.ZodString;
227
- failure: z.ZodUnion<readonly [z.ZodObject<{
228
- kind: z.ZodLiteral<"exit">;
229
- code: z.ZodNumber;
230
- stdout: z.ZodString;
231
- stderr: z.ZodString;
232
- truncated: z.ZodBoolean;
233
- }, z.core.$strict>, z.ZodObject<{
234
- stdout: z.ZodOptional<z.ZodString>;
235
- stderr: z.ZodOptional<z.ZodString>;
236
- truncated: z.ZodOptional<z.ZodBoolean>;
237
- kind: z.ZodLiteral<"timeout">;
238
- }, z.core.$strict>, z.ZodObject<{
239
- stdout: z.ZodOptional<z.ZodString>;
240
- stderr: z.ZodOptional<z.ZodString>;
241
- truncated: z.ZodOptional<z.ZodBoolean>;
242
- kind: z.ZodLiteral<"unknown-exit">;
243
- }, z.core.$strict>, z.ZodObject<{
244
- kind: z.ZodLiteral<"spawn-error">;
245
- diagnostic: z.ZodString;
246
- }, z.core.$strict>]>;
247
- }, z.core.$strict>, z.ZodObject<{
248
- kind: z.ZodLiteral<"reconcile-failed">;
249
- stage: z.ZodEnum<{
250
- observation: "observation";
251
- effect: "effect";
252
- }>;
253
- diagnostic: z.ZodString;
254
- }, z.core.$strict>]>, z.ZodObject<{
255
- kind: z.ZodLiteral<"contract-file-failed">;
256
- worktree: z.ZodString;
257
- path: z.ZodString;
258
- diagnostic: z.ZodString;
259
- }, z.core.$strict>]>;
260
- }, z.core.$strict>, z.ZodObject<{
261
- kind: z.ZodLiteral<"checkout-retained">;
262
- contract: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
167
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
168
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
169
+ kind: z.ZodLiteral<"unsealed-bytes">;
170
+ path: z.ZodString;
171
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
172
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
173
+ kind: z.ZodLiteral<"target-checkout-retained">;
263
174
  path: z.ZodString;
264
175
  target: z.ZodString;
265
176
  diagnostic: z.ZodString;
266
- }, z.core.$strict>, z.ZodObject<{
267
- kind: z.ZodLiteral<"settlement-action">;
268
- contract: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
269
- action: z.ZodObject<{
270
- kind: z.ZodLiteral<"debt">;
271
- debtId: z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>;
272
- action: z.ZodLiteral<"done">;
273
- }, z.core.$strict>;
274
- }, z.core.$strict>, z.ZodObject<{
275
- kind: z.ZodLiteral<"settlement-lag">;
276
- contract: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
277
- lag: z.ZodObject<{
278
- kind: z.ZodLiteral<"settlement-failed">;
279
- surface: z.ZodEnum<{
280
- debt: "debt";
281
- "debt-holder": "debt-holder";
282
- }>;
283
- contractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
284
- debtId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>>;
285
- path: z.ZodOptional<z.ZodString>;
286
- diagnostic: z.ZodString;
287
- }, z.core.$strict>;
288
- }, z.core.$strict>, z.ZodObject<{
289
- kind: z.ZodLiteral<"cleanup">;
290
- contract: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
291
- issue: z.ZodUnion<readonly [z.ZodObject<{
292
- kind: z.ZodLiteral<"decode-channel-retirement">;
293
- contractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
294
- diagnostic: z.ZodString;
295
- }, z.core.$strict>, z.ZodObject<{
296
- kind: z.ZodLiteral<"verification-cleanup">;
297
- contractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
298
- snapshot: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>>;
299
- requirement: z.ZodOptional<z.ZodString>;
300
- index: z.ZodOptional<z.ZodNumber>;
301
- failure: z.ZodObject<{
302
- phase: z.ZodLiteral<"destroy">;
303
- name: z.ZodString;
304
- detail: z.ZodUnion<readonly [z.ZodObject<{
305
- kind: z.ZodLiteral<"exit">;
306
- code: z.ZodNumber;
307
- stdout: z.ZodString;
308
- stderr: z.ZodString;
309
- truncated: z.ZodBoolean;
310
- }, z.core.$strict>, z.ZodObject<{
311
- stdout: z.ZodOptional<z.ZodString>;
312
- stderr: z.ZodOptional<z.ZodString>;
313
- truncated: z.ZodOptional<z.ZodBoolean>;
314
- kind: z.ZodLiteral<"timeout">;
315
- }, z.core.$strict>, z.ZodObject<{
316
- stdout: z.ZodOptional<z.ZodString>;
317
- stderr: z.ZodOptional<z.ZodString>;
318
- truncated: z.ZodOptional<z.ZodBoolean>;
319
- kind: z.ZodLiteral<"unknown-exit">;
320
- }, z.core.$strict>, z.ZodObject<{
321
- kind: z.ZodLiteral<"spawn-error">;
322
- diagnostic: z.ZodString;
323
- }, z.core.$strict>]>;
324
- }, z.core.$strict>;
325
- }, z.core.$strict>, z.ZodObject<{
326
- kind: z.ZodLiteral<"worktree-leak">;
327
- contractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
328
- snapshot: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>>;
329
- requirement: z.ZodOptional<z.ZodString>;
330
- index: z.ZodOptional<z.ZodNumber>;
331
- leak: z.ZodObject<{
332
- path: z.ZodOptional<z.ZodString>;
333
- diagnostic: z.ZodString;
334
- }, z.core.$strict>;
335
- }, z.core.$strict>, z.ZodObject<{
336
- kind: z.ZodLiteral<"private-state-seat-close">;
337
- contractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
338
- failure: z.ZodObject<{
339
- kind: z.ZodLiteral<"private-state-seat-close-failed">;
340
- diagnostic: z.ZodString;
341
- }, z.core.$strict>;
342
- }, z.core.$strict>]>;
343
- }, z.core.$strict>, z.ZodObject<{
344
- kind: z.ZodLiteral<"execution-stopped">;
345
- contract: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
346
- stage: z.ZodEnum<{
347
- admission: "admission";
348
- placement: "placement";
349
- verification: "verification";
350
- continuation: "continuation";
351
- reconciliation: "reconciliation";
352
- reintegration: "reintegration";
177
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
178
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
179
+ kind: z.ZodLiteral<"target-workspace-retained">;
180
+ targetContractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
181
+ reason: z.ZodEnum<{
182
+ missing: "missing";
183
+ replaced: "replaced";
184
+ unappointed: "unappointed";
185
+ association: "association";
186
+ attached: "attached";
187
+ uncommitted: "uncommitted";
188
+ operation: "operation";
353
189
  }>;
190
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
191
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
192
+ kind: z.ZodLiteral<"worktree-hook-failed">;
193
+ phase: z.ZodEnum<{
194
+ destroy: "destroy";
195
+ create: "create";
196
+ }>;
197
+ path: z.ZodString;
198
+ name: z.ZodString;
199
+ diagnostic: z.ZodString;
200
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
201
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
202
+ kind: z.ZodLiteral<"reconcile-failed">;
203
+ diagnostic: z.ZodString;
204
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
205
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
206
+ kind: z.ZodLiteral<"contract-file-failed">;
207
+ path: z.ZodString;
208
+ diagnostic: z.ZodString;
209
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
210
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
211
+ kind: z.ZodLiteral<"decode-channel-retirement">;
212
+ diagnostic: z.ZodString;
213
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
214
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
215
+ name: z.ZodString;
216
+ diagnostic: z.ZodString;
217
+ snapshot: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<SnapshotId, string>>>;
218
+ requirement: z.ZodExactOptional<z.ZodString>;
219
+ index: z.ZodExactOptional<z.ZodNumber>;
220
+ kind: z.ZodLiteral<"verification-cleanup">;
221
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
222
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
223
+ path: z.ZodExactOptional<z.ZodString>;
224
+ diagnostic: z.ZodString;
225
+ snapshot: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<SnapshotId, string>>>;
226
+ requirement: z.ZodExactOptional<z.ZodString>;
227
+ index: z.ZodExactOptional<z.ZodNumber>;
228
+ kind: z.ZodLiteral<"worktree-leak">;
229
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
230
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
231
+ kind: z.ZodLiteral<"private-state-seat-close">;
232
+ diagnostic: z.ZodString;
233
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
234
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
235
+ kind: z.ZodLiteral<"execution-stopped">;
354
236
  reason: z.ZodEnum<{
355
237
  failed: "failed";
356
238
  cancelled: "cancelled";
357
239
  }>;
358
240
  diagnostic: z.ZodString;
359
- }, z.core.$strict>, z.ZodObject<{
360
- kind: z.ZodLiteral<"worktree-retired">;
361
- contract: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
241
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
242
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
243
+ kind: z.ZodLiteral<"settlement-failed">;
244
+ debtId: z.ZodExactOptional<z.ZodString>;
245
+ diagnostic: z.ZodString;
246
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
247
+ }, z.core.$strict>>]>;
248
+ export type InvocationIssue = z.output<typeof invocationIssueSchema>;
249
+ export type Issue = InvocationIssue;
250
+ export declare const localIssueSchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
251
+ kind: z.ZodLiteral<"worktree-retained">;
252
+ path: z.ZodString;
253
+ diagnostic: z.ZodExactOptional<z.ZodString>;
254
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
255
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
256
+ kind: z.ZodLiteral<"unsealed-bytes">;
257
+ path: z.ZodString;
258
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
259
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
260
+ kind: z.ZodLiteral<"target-checkout-retained">;
261
+ path: z.ZodString;
262
+ target: z.ZodString;
263
+ diagnostic: z.ZodString;
264
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
265
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
266
+ kind: z.ZodLiteral<"target-workspace-retained">;
267
+ targetContractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
268
+ reason: z.ZodEnum<{
269
+ missing: "missing";
270
+ replaced: "replaced";
271
+ unappointed: "unappointed";
272
+ association: "association";
273
+ attached: "attached";
274
+ uncommitted: "uncommitted";
275
+ operation: "operation";
276
+ }>;
277
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
278
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
279
+ kind: z.ZodLiteral<"worktree-hook-failed">;
280
+ phase: z.ZodEnum<{
281
+ destroy: "destroy";
282
+ create: "create";
283
+ }>;
284
+ path: z.ZodString;
362
285
  name: z.ZodString;
363
- }, z.core.$strict>, z.ZodObject<{
286
+ diagnostic: z.ZodString;
287
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
288
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
289
+ kind: z.ZodLiteral<"reconcile-failed">;
290
+ diagnostic: z.ZodString;
291
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
292
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
293
+ kind: z.ZodLiteral<"contract-file-failed">;
294
+ path: z.ZodString;
295
+ diagnostic: z.ZodString;
296
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
297
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
298
+ kind: z.ZodLiteral<"decode-channel-retirement">;
299
+ diagnostic: z.ZodString;
300
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
301
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
302
+ kind: z.ZodLiteral<"private-state-seat-close">;
303
+ diagnostic: z.ZodString;
304
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
305
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
306
+ kind: z.ZodLiteral<"execution-stopped">;
307
+ reason: z.ZodEnum<{
308
+ failed: "failed";
309
+ cancelled: "cancelled";
310
+ }>;
311
+ diagnostic: z.ZodString;
312
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
313
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
314
+ kind: z.ZodLiteral<"settlement-failed">;
315
+ debtId: z.ZodExactOptional<z.ZodString>;
316
+ diagnostic: z.ZodString;
317
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
318
+ }, z.core.$strict>>]>;
319
+ export declare const completionIssueSchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
364
320
  kind: z.ZodLiteral<"worktree-retained">;
365
- contract: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
366
- path: z.ZodString;
367
- }, z.core.$strict>]>;
368
- declare const invocationEffectSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
369
- kind: z.ZodLiteral<"reconciliation-effect">;
370
- contract: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
371
- effect: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
372
- kind: z.ZodLiteral<"worktree">;
373
- path: z.ZodString;
374
- action: z.ZodEnum<{
375
- removed: "removed";
376
- unchanged: "unchanged";
377
- created: "created";
378
- }>;
379
- before: z.ZodOptional<z.ZodUnknown>;
380
- after: z.ZodOptional<z.ZodUnknown>;
381
- }, z.core.$strict>, z.ZodTransform<{
382
- kind: "worktree";
383
- path: string;
384
- action: "removed" | "unchanged" | "created";
385
- }, {
386
- kind: "worktree";
387
- path: string;
388
- action: "removed" | "unchanged" | "created";
389
- before?: unknown;
390
- after?: unknown;
391
- }>>, z.ZodObject<{
392
- kind: z.ZodLiteral<"worktree">;
393
- path: z.ZodString;
394
- action: z.ZodLiteral<"followed">;
395
- before: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
396
- after: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
397
- }, z.core.$strict>, z.ZodObject<{
398
- kind: z.ZodLiteral<"recovery-snapshot">;
399
- action: z.ZodLiteral<"created">;
400
- snapshot: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
401
- retention: z.ZodLiteral<"ephemeral">;
402
- }, z.core.$strict>, z.ZodObject<{
403
- kind: z.ZodLiteral<"target-checkout">;
404
- path: z.ZodString;
405
- target: z.ZodString;
406
- action: z.ZodEnum<{
407
- followed: "followed";
408
- recovered: "recovered";
409
- }>;
410
- }, z.core.$strict>, z.ZodObject<{
411
- kind: z.ZodLiteral<"ref">;
412
- name: z.ZodString;
413
- before: z.ZodNullable<z.ZodString>;
414
- after: z.ZodNullable<z.ZodString>;
415
- action: z.ZodEnum<{
416
- removed: "removed";
417
- unchanged: "unchanged";
418
- updated: "updated";
419
- created: "created";
420
- }>;
421
- }, z.core.$strict>]>, z.ZodObject<{
422
- kind: z.ZodLiteral<"contract-file">;
423
- path: z.ZodString;
424
- action: z.ZodEnum<{
425
- removed: "removed";
426
- unchanged: "unchanged";
427
- updated: "updated";
428
- created: "created";
429
- }>;
430
- }, z.core.$strict>]>;
431
- }, z.core.$strict>, z.ZodObject<{
432
- kind: z.ZodLiteral<"reconciliation-lag">;
433
- contract: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
434
- affects: z.ZodEnum<{
435
- none: "none";
436
- placement: "placement";
437
- continuation: "continuation";
438
- reconciliation: "reconciliation";
321
+ path: z.ZodString;
322
+ diagnostic: z.ZodExactOptional<z.ZodString>;
323
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
324
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
325
+ kind: z.ZodLiteral<"worktree-follow-retained">;
326
+ path: z.ZodString;
327
+ reason: z.ZodEnum<{
328
+ "head-moved": "head-moved";
329
+ "head-attached": "head-attached";
330
+ "operation-in-progress": "operation-in-progress";
439
331
  }>;
440
- lag: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
441
- kind: z.ZodLiteral<"worktree-retained">;
442
- path: z.ZodString;
443
- diagnostic: z.ZodOptional<z.ZodString>;
444
- }, z.core.$strict>, z.ZodObject<{
445
- kind: z.ZodLiteral<"worktree-follow-retained">;
446
- path: z.ZodString;
447
- tender: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
448
- head: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
449
- reason: z.ZodEnum<{
450
- "head-moved": "head-moved";
451
- "head-attached": "head-attached";
452
- "operation-in-progress": "operation-in-progress";
453
- "unsupported-parent-shape": "unsupported-parent-shape";
454
- }>;
455
- paths: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
456
- }, z.core.$strict>, z.ZodObject<{
457
- kind: z.ZodLiteral<"unsealed-bytes">;
458
- path: z.ZodString;
459
- paths: z.ZodReadonly<z.ZodArray<z.ZodString>>;
460
- head: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>>;
461
- }, z.core.$strict>, z.ZodObject<{
462
- kind: z.ZodLiteral<"target-checkout-retained">;
463
- path: z.ZodString;
464
- target: z.ZodString;
465
- diagnostic: z.ZodString;
466
- }, z.core.$strict>, z.ZodObject<{
467
- kind: z.ZodLiteral<"target-workspace-retained">;
468
- contractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
469
- reason: z.ZodEnum<{
470
- missing: "missing";
471
- replaced: "replaced";
472
- unappointed: "unappointed";
473
- association: "association";
474
- attached: "attached";
475
- uncommitted: "uncommitted";
476
- operation: "operation";
477
- }>;
478
- }, z.core.$strict>, z.ZodObject<{
479
- kind: z.ZodLiteral<"worktree-hook-failed">;
480
- phase: z.ZodEnum<{
481
- destroy: "destroy";
482
- create: "create";
483
- }>;
484
- path: z.ZodString;
485
- command: z.ZodNumber;
486
- name: z.ZodString;
487
- failure: z.ZodUnion<readonly [z.ZodObject<{
488
- kind: z.ZodLiteral<"exit">;
489
- code: z.ZodNumber;
490
- stdout: z.ZodString;
491
- stderr: z.ZodString;
492
- truncated: z.ZodBoolean;
493
- }, z.core.$strict>, z.ZodObject<{
494
- stdout: z.ZodOptional<z.ZodString>;
495
- stderr: z.ZodOptional<z.ZodString>;
496
- truncated: z.ZodOptional<z.ZodBoolean>;
497
- kind: z.ZodLiteral<"timeout">;
498
- }, z.core.$strict>, z.ZodObject<{
499
- stdout: z.ZodOptional<z.ZodString>;
500
- stderr: z.ZodOptional<z.ZodString>;
501
- truncated: z.ZodOptional<z.ZodBoolean>;
502
- kind: z.ZodLiteral<"unknown-exit">;
503
- }, z.core.$strict>, z.ZodObject<{
504
- kind: z.ZodLiteral<"spawn-error">;
505
- diagnostic: z.ZodString;
506
- }, z.core.$strict>]>;
507
- }, z.core.$strict>, z.ZodObject<{
508
- kind: z.ZodLiteral<"reconcile-failed">;
509
- stage: z.ZodEnum<{
510
- observation: "observation";
511
- effect: "effect";
512
- }>;
513
- diagnostic: z.ZodString;
514
- }, z.core.$strict>]>, z.ZodObject<{
515
- kind: z.ZodLiteral<"contract-file-failed">;
516
- worktree: z.ZodString;
517
- path: z.ZodString;
518
- diagnostic: z.ZodString;
519
- }, z.core.$strict>]>;
520
- }, z.core.$strict>, z.ZodObject<{
521
- kind: z.ZodLiteral<"checkout-retained">;
522
- contract: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
332
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
333
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
334
+ kind: z.ZodLiteral<"unsealed-bytes">;
335
+ path: z.ZodString;
336
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
337
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
338
+ kind: z.ZodLiteral<"target-checkout-retained">;
523
339
  path: z.ZodString;
524
340
  target: z.ZodString;
525
341
  diagnostic: z.ZodString;
526
- }, z.core.$strict>, z.ZodObject<{
527
- kind: z.ZodLiteral<"settlement-action">;
528
- contract: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
529
- action: z.ZodObject<{
530
- kind: z.ZodLiteral<"debt">;
531
- debtId: z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>;
532
- action: z.ZodLiteral<"done">;
533
- }, z.core.$strict>;
534
- }, z.core.$strict>, z.ZodObject<{
535
- kind: z.ZodLiteral<"settlement-lag">;
536
- contract: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
537
- lag: z.ZodObject<{
538
- kind: z.ZodLiteral<"settlement-failed">;
539
- surface: z.ZodEnum<{
540
- debt: "debt";
541
- "debt-holder": "debt-holder";
542
- }>;
543
- contractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
544
- debtId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>>;
545
- path: z.ZodOptional<z.ZodString>;
546
- diagnostic: z.ZodString;
547
- }, z.core.$strict>;
548
- }, z.core.$strict>, z.ZodObject<{
549
- kind: z.ZodLiteral<"cleanup">;
550
- contract: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
551
- issue: z.ZodUnion<readonly [z.ZodObject<{
552
- kind: z.ZodLiteral<"decode-channel-retirement">;
553
- contractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
554
- diagnostic: z.ZodString;
555
- }, z.core.$strict>, z.ZodObject<{
556
- kind: z.ZodLiteral<"verification-cleanup">;
557
- contractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
558
- snapshot: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>>;
559
- requirement: z.ZodOptional<z.ZodString>;
560
- index: z.ZodOptional<z.ZodNumber>;
561
- failure: z.ZodObject<{
562
- phase: z.ZodLiteral<"destroy">;
563
- name: z.ZodString;
564
- detail: z.ZodUnion<readonly [z.ZodObject<{
565
- kind: z.ZodLiteral<"exit">;
566
- code: z.ZodNumber;
567
- stdout: z.ZodString;
568
- stderr: z.ZodString;
569
- truncated: z.ZodBoolean;
570
- }, z.core.$strict>, z.ZodObject<{
571
- stdout: z.ZodOptional<z.ZodString>;
572
- stderr: z.ZodOptional<z.ZodString>;
573
- truncated: z.ZodOptional<z.ZodBoolean>;
574
- kind: z.ZodLiteral<"timeout">;
575
- }, z.core.$strict>, z.ZodObject<{
576
- stdout: z.ZodOptional<z.ZodString>;
577
- stderr: z.ZodOptional<z.ZodString>;
578
- truncated: z.ZodOptional<z.ZodBoolean>;
579
- kind: z.ZodLiteral<"unknown-exit">;
580
- }, z.core.$strict>, z.ZodObject<{
581
- kind: z.ZodLiteral<"spawn-error">;
582
- diagnostic: z.ZodString;
583
- }, z.core.$strict>]>;
584
- }, z.core.$strict>;
585
- }, z.core.$strict>, z.ZodObject<{
586
- kind: z.ZodLiteral<"worktree-leak">;
587
- contractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
588
- snapshot: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>>;
589
- requirement: z.ZodOptional<z.ZodString>;
590
- index: z.ZodOptional<z.ZodNumber>;
591
- leak: z.ZodObject<{
592
- path: z.ZodOptional<z.ZodString>;
593
- diagnostic: z.ZodString;
594
- }, z.core.$strict>;
595
- }, z.core.$strict>, z.ZodObject<{
596
- kind: z.ZodLiteral<"private-state-seat-close">;
597
- contractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
598
- failure: z.ZodObject<{
599
- kind: z.ZodLiteral<"private-state-seat-close-failed">;
600
- diagnostic: z.ZodString;
601
- }, z.core.$strict>;
602
- }, z.core.$strict>]>;
603
- }, z.core.$strict>, z.ZodObject<{
604
- kind: z.ZodLiteral<"execution-stopped">;
605
- contract: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
606
- stage: z.ZodEnum<{
607
- admission: "admission";
608
- placement: "placement";
609
- verification: "verification";
610
- continuation: "continuation";
611
- reconciliation: "reconciliation";
612
- reintegration: "reintegration";
342
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
343
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
344
+ kind: z.ZodLiteral<"target-workspace-retained">;
345
+ targetContractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
346
+ reason: z.ZodEnum<{
347
+ missing: "missing";
348
+ replaced: "replaced";
349
+ unappointed: "unappointed";
350
+ association: "association";
351
+ attached: "attached";
352
+ uncommitted: "uncommitted";
353
+ operation: "operation";
354
+ }>;
355
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
356
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
357
+ kind: z.ZodLiteral<"worktree-hook-failed">;
358
+ phase: z.ZodEnum<{
359
+ destroy: "destroy";
360
+ create: "create";
613
361
  }>;
362
+ path: z.ZodString;
363
+ name: z.ZodString;
364
+ diagnostic: z.ZodString;
365
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
366
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
367
+ kind: z.ZodLiteral<"reconcile-failed">;
368
+ diagnostic: z.ZodString;
369
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
370
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
371
+ kind: z.ZodLiteral<"contract-file-failed">;
372
+ path: z.ZodString;
373
+ diagnostic: z.ZodString;
374
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
375
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
376
+ kind: z.ZodLiteral<"decode-channel-retirement">;
377
+ diagnostic: z.ZodString;
378
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
379
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
380
+ kind: z.ZodLiteral<"private-state-seat-close">;
381
+ diagnostic: z.ZodString;
382
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
383
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
384
+ kind: z.ZodLiteral<"execution-stopped">;
614
385
  reason: z.ZodEnum<{
615
386
  failed: "failed";
616
387
  cancelled: "cancelled";
617
388
  }>;
618
389
  diagnostic: z.ZodString;
619
- }, z.core.$strict>, z.ZodObject<{
620
- kind: z.ZodLiteral<"worktree-retired">;
621
- contract: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
622
- name: z.ZodString;
623
- }, z.core.$strict>, z.ZodObject<{
390
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
391
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
392
+ kind: z.ZodLiteral<"settlement-failed">;
393
+ debtId: z.ZodExactOptional<z.ZodString>;
394
+ diagnostic: z.ZodString;
395
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
396
+ }, z.core.$strict>>]>;
397
+ export declare const previewIssueSchema: z.ZodReadonly<z.ZodObject<{
398
+ kind: z.ZodLiteral<"decode-channel-retirement">;
399
+ diagnostic: z.ZodString;
400
+ }, z.core.$strict>>;
401
+ export declare const reconcilePublicIssueSchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
624
402
  kind: z.ZodLiteral<"worktree-retained">;
625
- contract: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
626
403
  path: z.ZodString;
627
- }, z.core.$strict>]>, z.ZodUnion<readonly [z.ZodObject<{
628
- world: z.ZodString;
629
- owner: z.ZodEnum<{
630
- world: "world";
631
- debt: "debt";
632
- akuma: "akuma";
633
- git: "git";
404
+ diagnostic: z.ZodExactOptional<z.ZodString>;
405
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
406
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
407
+ kind: z.ZodLiteral<"unsealed-bytes">;
408
+ path: z.ZodString;
409
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
410
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
411
+ kind: z.ZodLiteral<"target-checkout-retained">;
412
+ path: z.ZodString;
413
+ target: z.ZodString;
414
+ diagnostic: z.ZodString;
415
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
416
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
417
+ kind: z.ZodLiteral<"target-workspace-retained">;
418
+ targetContractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
419
+ reason: z.ZodEnum<{
420
+ missing: "missing";
421
+ replaced: "replaced";
422
+ unappointed: "unappointed";
423
+ association: "association";
424
+ attached: "attached";
425
+ uncommitted: "uncommitted";
426
+ operation: "operation";
427
+ }>;
428
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
429
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
430
+ kind: z.ZodLiteral<"worktree-hook-failed">;
431
+ phase: z.ZodEnum<{
432
+ destroy: "destroy";
433
+ create: "create";
634
434
  }>;
435
+ path: z.ZodString;
436
+ name: z.ZodString;
437
+ diagnostic: z.ZodString;
438
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
439
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
440
+ kind: z.ZodLiteral<"reconcile-failed">;
441
+ diagnostic: z.ZodString;
442
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
443
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
444
+ kind: z.ZodLiteral<"contract-file-failed">;
445
+ path: z.ZodString;
635
446
  diagnostic: z.ZodString;
447
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
448
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
449
+ kind: z.ZodLiteral<"private-state-seat-close">;
450
+ diagnostic: z.ZodString;
451
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
452
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
453
+ kind: z.ZodLiteral<"settlement-failed">;
454
+ debtId: z.ZodExactOptional<z.ZodString>;
455
+ diagnostic: z.ZodString;
456
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
457
+ }, z.core.$strict>>]>;
458
+ /** An issue before its containing receipt supplies the owning Contract. */
459
+ type LocalInvocationIssue = InvocationIssue;
460
+ export declare function invocationIssueIsFailure(issue: InvocationIssue): boolean;
461
+ /** Invocation classification consumes owner conclusions, never a fresh authority read. */
462
+ export declare function contractOutcomeDisposition(result: Readonly<{
463
+ kind: string;
464
+ issues?: readonly InvocationIssue[];
465
+ placement?: import("../protocol/completion.js").Placement | Omit<import("../protocol/completion.js").Placed, "integration">;
466
+ checks?: readonly import("../protocol/verify.js").VerificationCheck[];
467
+ continuation?: ContinuationReport;
468
+ }>): "accepted" | "refused" | "retryable" | "failed";
469
+ declare const resetOwnerSchema: z.ZodEnum<{
470
+ world: "world";
471
+ debt: "debt";
472
+ akuma: "akuma";
473
+ git: "git";
474
+ }>;
475
+ export type ResetOwner = z.output<typeof resetOwnerSchema>;
476
+ export declare const resetIssueSchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
636
477
  kind: z.ZodLiteral<"reset-owner-stopped">;
637
- }, z.core.$strict>, z.ZodObject<{
638
- world: z.ZodString;
639
478
  owner: z.ZodEnum<{
640
479
  world: "world";
641
480
  debt: "debt";
@@ -643,76 +482,242 @@ declare const invocationEffectSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [
643
482
  git: "git";
644
483
  }>;
645
484
  diagnostic: z.ZodString;
485
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
646
486
  kind: z.ZodLiteral<"reset-residue">;
647
- }, z.core.$strict>]>]>;
648
- export type InvocationEffect = z.infer<typeof invocationEffectSchema>;
649
- declare const pendingSurfaceSchema: z.ZodObject<{
650
- surface: z.ZodEnum<{
651
- execution: "execution";
652
- placement: "placement";
653
- cleanup: "cleanup";
654
- verification: "verification";
655
- continuation: "continuation";
656
- reconciliation: "reconciliation";
657
- settlement: "settlement";
658
- reset: "reset";
659
- }>;
660
- required: z.ZodBoolean;
661
- }, z.core.$strict>;
662
- export type PendingSurface = z.infer<typeof pendingSurfaceSchema>;
663
- type EnvelopeFields = Readonly<{
664
- operation: ContractVerb;
665
- contract?: ContractId;
666
- facts: readonly JournalEntry[];
667
- effects: readonly z.infer<typeof contractEffectSchema>[];
668
- pending: readonly PendingSurface[];
487
+ diagnostic: z.ZodString;
488
+ }, z.core.$strict>>]>;
489
+ export type ResetIssue = z.output<typeof resetIssueSchema>;
490
+ export declare function resetIssueIsRequired(issue: ResetIssue): boolean;
491
+ type ResetEffect = (Readonly<{
492
+ kind: "reset-owner-stopped";
493
+ }> | Readonly<{
494
+ kind: "reset-residue";
495
+ }>) & Readonly<{
496
+ owner: ResetOwner;
497
+ diagnostic: string;
498
+ world: string;
669
499
  }>;
670
- type AcceptedOutcome<Operation extends ContractVerb, Value> = EnvelopeFields & Readonly<{
671
- operation: Operation;
672
- kind: "accepted";
500
+ /** Internal accumulator carrier, not a published operation answer. */
501
+ export type InvocationEffect = Readonly<{
502
+ kind: "issue";
673
503
  contract: ContractId;
674
- head: ContractHead;
675
- value: Value;
504
+ issue: LocalInvocationIssue;
505
+ }> | ResetEffect | Readonly<{
506
+ kind: "movement";
507
+ contract: ContractId;
508
+ effect: MovementEffect;
509
+ }> | Readonly<{
510
+ kind: "settlement-action";
511
+ contract: ContractId;
512
+ action: z.output<typeof settlementActionSchema>;
676
513
  }>;
677
- type RefusedOutcome<Operation extends ContractVerb, Refusal> = EnvelopeFields & Readonly<{
678
- operation: Operation;
679
- kind: "refused";
680
- refusal: Refusal;
514
+ export declare const admittedEvidenceSchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
515
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
516
+ kind: z.ZodEnum<{
517
+ bind: "bind";
518
+ amend: "amend";
519
+ claimed: "claimed";
520
+ abandoned: "abandoned";
521
+ }>;
522
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
523
+ candidate: z.ZodPipe<z.ZodString, z.ZodTransform<SnapshotId, string>>;
524
+ integration: z.ZodPipe<z.ZodString, z.ZodTransform<SnapshotId, string>>;
525
+ contentId: z.ZodString;
526
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
527
+ kind: z.ZodLiteral<"deliver">;
528
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
529
+ integration: z.ZodPipe<z.ZodString, z.ZodTransform<SnapshotId, string>>;
530
+ predecessor: z.ZodPipe<z.ZodString, z.ZodTransform<SnapshotId, string>>;
531
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
532
+ kind: z.ZodLiteral<"reintegrated">;
533
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
534
+ requirement: z.ZodExactOptional<z.ZodString>;
535
+ verdict: z.ZodExactOptional<z.ZodEnum<{
536
+ satisfied: "satisfied";
537
+ unsatisfied: "unsatisfied";
538
+ }>>;
539
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
540
+ kind: z.ZodLiteral<"attestation">;
541
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
542
+ chapter: z.ZodNumber;
543
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
544
+ kind: z.ZodLiteral<"arc">;
545
+ }, z.core.$strict>>]>;
546
+ export declare const meaningfulEffectSchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
547
+ kind: z.ZodEnum<{
548
+ "worktree-created": "worktree-created";
549
+ "worktree-removed": "worktree-removed";
550
+ }>;
551
+ path: z.ZodString;
552
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
553
+ kind: z.ZodLiteral<"worktree-followed">;
554
+ path: z.ZodString;
555
+ before: z.ZodPipe<z.ZodString, z.ZodTransform<SnapshotId, string>>;
556
+ after: z.ZodPipe<z.ZodString, z.ZodTransform<SnapshotId, string>>;
557
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
558
+ kind: z.ZodLiteral<"recovery-snapshot">;
559
+ snapshot: z.ZodPipe<z.ZodString, z.ZodTransform<SnapshotId, string>>;
560
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
561
+ kind: z.ZodLiteral<"target-checkout">;
562
+ path: z.ZodString;
563
+ target: z.ZodString;
564
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
565
+ kind: z.ZodLiteral<"ref">;
566
+ name: z.ZodString;
567
+ before: z.ZodNullable<z.ZodString>;
568
+ after: z.ZodNullable<z.ZodString>;
569
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
570
+ kind: z.ZodLiteral<"debt-settled">;
571
+ debtId: z.ZodString;
572
+ }, z.core.$strict>>]>;
573
+ export type MovementEffect = Exclude<z.output<typeof meaningfulEffectSchema>, {
574
+ kind: "debt-settled";
681
575
  }>;
682
- type RetryOutcome<Operation extends ContractVerb> = EnvelopeFields & Readonly<{
683
- operation: Operation;
684
- kind: "retry";
685
- reason: OperationRetries[Operation];
576
+ export declare function compactEffect(effect: ReconciliationEffect): MovementEffect | undefined;
577
+ export declare const recoverySnapshotSchema: z.ZodReadonly<z.ZodObject<{
578
+ snapshot: z.ZodPipe<z.ZodString, z.ZodTransform<SnapshotId, string>>;
579
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
580
+ }, z.core.$strict>>;
581
+ declare const exceptionalEffectSchema: z.ZodUnion<readonly [...(z.ZodReadonly<z.ZodObject<{
582
+ kind: z.ZodLiteral<"ref">;
583
+ name: z.ZodString;
584
+ before: z.ZodNullable<z.ZodString>;
585
+ after: z.ZodNullable<z.ZodString>;
586
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
587
+ }, z.core.$strict>> | z.ZodReadonly<z.ZodObject<{
588
+ kind: z.ZodLiteral<"debt-settled">;
589
+ debtId: z.ZodString;
590
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
591
+ }, z.core.$strict>> | z.ZodReadonly<z.ZodObject<{
592
+ kind: z.ZodLiteral<"target-checkout">;
593
+ path: z.ZodString;
594
+ target: z.ZodString;
595
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
596
+ }, z.core.$strict>> | z.ZodReadonly<z.ZodObject<{
597
+ kind: z.ZodLiteral<"recovery-snapshot">;
598
+ snapshot: z.ZodPipe<z.ZodString, z.ZodTransform<SnapshotId, string>>;
599
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
600
+ }, z.core.$strict>> | z.ZodReadonly<z.ZodObject<{
601
+ kind: z.ZodLiteral<"worktree-followed">;
602
+ path: z.ZodString;
603
+ before: z.ZodPipe<z.ZodString, z.ZodTransform<SnapshotId, string>>;
604
+ after: z.ZodPipe<z.ZodString, z.ZodTransform<SnapshotId, string>>;
605
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
606
+ }, z.core.$strict>> | z.ZodReadonly<z.ZodObject<{
607
+ kind: z.ZodEnum<{
608
+ "worktree-created": "worktree-created";
609
+ "worktree-removed": "worktree-removed";
610
+ }>;
611
+ path: z.ZodString;
612
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
613
+ }, z.core.$strict>>)[], z.ZodReadonly<z.ZodObject<{
614
+ kind: z.ZodLiteral<"placed">;
615
+ integration: z.ZodPipe<z.ZodString, z.ZodTransform<SnapshotId, string>>;
616
+ target: z.ZodExactOptional<z.ZodString>;
617
+ predecessor: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<SnapshotId, string>>>;
618
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
619
+ }, z.core.$strict>>]>;
620
+ type PartialEvidence = Readonly<{
621
+ admitted?: readonly z.output<typeof admittedEvidenceSchema>[];
622
+ placement?: z.output<typeof placementSchema>;
623
+ effects?: readonly z.output<typeof exceptionalEffectSchema>[];
686
624
  }>;
687
- export type HandoffOutcome = EnvelopeFields & Readonly<{
688
- operation: "deliver";
689
- kind: "handoff";
690
- contract: ContractId;
691
- value: IntegrationConflictMaterialized;
625
+ type ReceiptFields = Readonly<{
626
+ contractId?: ContractId;
627
+ issues?: readonly InvocationIssue[];
692
628
  }>;
693
- export type OperationOutcome<Operation extends ContractVerb, Value, Refusal> = AcceptedOutcome<Operation, Value> | RefusedOutcome<Operation, Refusal> | RetryOutcome<Operation>;
694
- export type ProjectedOutcome<Operation extends ContractVerb, Value, Refusal> = OperationOutcome<Operation, Value, Refusal> | (Operation extends "deliver" ? HandoffOutcome : never);
629
+ export type StopOutcome<Refusal> = Readonly<{
630
+ kind: "refused";
631
+ contractId: ContractId;
632
+ reason: Refusal;
633
+ }> | (Readonly<{
634
+ contractId: ContractId;
635
+ }> & Retry);
636
+ type OperationIssue<Operation extends ContractVerb> = Operation extends "bind" | "amend" | "arc" | "abandon" ? z.output<typeof localIssueSchema> : Operation extends "deliver" | "review" ? z.output<typeof completionIssueSchema> : InvocationIssue;
637
+ type OperationRecovery<Operation extends ContractVerb> = Operation extends "bind" | "amend" | "arc" | "abandon" ? SnapshotId : z.output<typeof recoverySnapshotSchema>;
638
+ export type OperationOutcome<Operation extends ContractVerb, Value, Refusal> = (Readonly<{
639
+ kind: "accepted";
640
+ contractId: ContractId;
641
+ issues?: readonly OperationIssue<Operation>[];
642
+ recoverySnapshots?: readonly OperationRecovery<Operation>[];
643
+ }> & Value) | (Operation extends "bind" ? Readonly<{
644
+ kind: "refused";
645
+ reason: Refusal;
646
+ }> | Retry : Operation extends "verify" | "deliver-preview" ? Readonly<{
647
+ kind: "refused";
648
+ contractId: ContractId;
649
+ reason: Refusal;
650
+ }> : StopOutcome<Refusal>);
651
+ export declare function operationOutcomeSchema<Fields extends z.ZodRawShape, Refusal extends z.ZodType, Issues extends z.ZodType>(fields: Fields, refusal: Refusal, issues: Issues): z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
652
+ kind: z.ZodLiteral<"accepted">;
653
+ contractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
654
+ issues: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<Issues>>>;
655
+ recoverySnapshots: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
656
+ snapshot: z.ZodPipe<z.ZodString, z.ZodTransform<SnapshotId, string>>;
657
+ contractId: z.ZodExactOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>;
658
+ }, z.core.$strict>>>>>;
659
+ } & Fields extends infer T ? { -readonly [P in keyof T]: T[P]; } : never, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
660
+ kind: z.ZodLiteral<"refused">;
661
+ contractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
662
+ reason: Refusal;
663
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
664
+ kind: z.ZodLiteral<"retry">;
665
+ reason: z.ZodEnum<{
666
+ exhausted: "exhausted";
667
+ collision: "collision";
668
+ }>;
669
+ contractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
670
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
671
+ kind: z.ZodLiteral<"retry">;
672
+ reason: z.ZodLiteral<"publication-failed">;
673
+ diagnostic: z.ZodString;
674
+ contractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
675
+ }, z.core.$strict>>]>;
676
+ export declare const handoffOutcomeSchema: z.ZodReadonly<z.ZodObject<{
677
+ kind: z.ZodLiteral<"handoff">;
678
+ contractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
679
+ worktreePath: z.ZodString;
680
+ targetHead: z.ZodPipe<z.ZodString, z.ZodTransform<SnapshotId, string>>;
681
+ conflictPaths: z.ZodReadonly<z.ZodArray<z.ZodString>>;
682
+ handoffBase: z.ZodPipe<z.ZodString, z.ZodTransform<SnapshotId, string>>;
683
+ }, z.core.$strict>>;
684
+ export type HandoffOutcome = z.output<typeof handoffOutcomeSchema>;
685
+ export type ProjectedOutcome<Operation extends ContractVerb, Value, Refusal> = Operation extends "deliver-preview" ? (Value & Readonly<{
686
+ issues?: readonly z.output<typeof previewIssueSchema>[];
687
+ }>) | Readonly<{
688
+ kind: "refused";
689
+ contractId: ContractId;
690
+ reason: Refusal;
691
+ }> : OperationOutcome<Operation, Value, Refusal> | (Operation extends "deliver" ? HandoffOutcome : never);
695
692
  export type ResetCounts = Readonly<{
696
693
  refs: number;
697
694
  worktrees: number;
698
695
  debts: number;
699
696
  }>;
700
- export type ResetRefusal = z.infer<typeof nukeConfirmationRefusalSchema> | z.infer<typeof nukeConfirmationRequiredRefusalSchema>;
701
- type ResetEnvelope = Readonly<{
702
- operation: "nuke";
703
- world: WorldRoot;
704
- effects: readonly ResetEffect[];
705
- pending: readonly PendingSurface[];
706
- }>;
707
- export type ResetOutcome = ResetEnvelope & (Readonly<{
708
- kind: "accepted";
709
- value: {
710
- removed: ResetCounts;
711
- };
712
- }> | Readonly<{
713
- kind: "refused";
714
- refusal: ResetRefusal;
715
- }>);
697
+ export type ResetRefusal = import("./refusal.js").NukeConfirmationRefusal | import("./refusal.js").NukeConfirmationRequiredRefusal;
698
+ export declare const resetOutcomeSchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
699
+ kind: z.ZodLiteral<"accepted">;
700
+ refsRemoved: z.ZodExactOptional<z.ZodNumber>;
701
+ worktreesRemoved: z.ZodExactOptional<z.ZodNumber>;
702
+ debtsRemoved: z.ZodExactOptional<z.ZodNumber>;
703
+ issues: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
704
+ kind: z.ZodLiteral<"reset-owner-stopped">;
705
+ owner: z.ZodEnum<{
706
+ world: "world";
707
+ debt: "debt";
708
+ akuma: "akuma";
709
+ git: "git";
710
+ }>;
711
+ diagnostic: z.ZodString;
712
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
713
+ kind: z.ZodLiteral<"reset-residue">;
714
+ diagnostic: z.ZodString;
715
+ }, z.core.$strict>>]>>>>;
716
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
717
+ kind: z.ZodLiteral<"refused">;
718
+ world: z.ZodPipe<z.ZodString, z.ZodTransform<WorldRoot, string>>;
719
+ }, z.core.$strict>>]>;
720
+ export type ResetOutcome = z.output<typeof resetOutcomeSchema>;
716
721
  type ResetProjection = Readonly<{
717
722
  world: WorldRoot;
718
723
  }> & (Readonly<{
@@ -724,33 +729,49 @@ type ResetProjection = Readonly<{
724
729
  kind: "failed";
725
730
  error: unknown;
726
731
  }>);
727
- type PartialValues = {
728
- bind: Partial<BindValue>;
729
- amend: Partial<AmendValue>;
730
- deliver: Partial<DeliveryValue>;
731
- verify: Partial<Verify>;
732
- review: Review;
733
- "deliver-preview": Partial<DeliveryPreviewReport>;
734
- arc: Record<string, never>;
735
- abandon: Record<string, never>;
736
- };
737
- type PartialContractEnvelope = {
738
- [Operation in ContractVerb]: EnvelopeFields & Readonly<{
739
- operation: Operation;
740
- head?: ContractHead;
741
- value?: PartialValues[Operation];
732
+ export type Verify = VerifyValue & Readonly<{
733
+ continuation?: ContinuationReport;
734
+ }>;
735
+ export type Review = Readonly<{
736
+ placement?: z.output<typeof placementSchema>;
737
+ worktreeChanges?: Readonly<{
738
+ staged?: readonly string[];
739
+ unstaged?: readonly string[];
740
+ untracked?: readonly string[];
741
+ unmergedPaths?: readonly string[];
742
742
  }>;
743
- }[ContractVerb];
744
- export type PartialOutcomeEnvelope = PartialContractEnvelope | (ResetEnvelope & Readonly<{
745
- value?: {
746
- removed: ResetCounts;
747
- };
748
- }>);
749
- /** What the invocation reached when its owned work stopped. */
743
+ continuation?: ContinuationReport;
744
+ }>;
745
+ type PartialContractEnvelope = ReceiptFields & PartialEvidence & Readonly<{
746
+ kind: "contract";
747
+ worktreePath?: string;
748
+ target?: string;
749
+ changedSections?: readonly string[];
750
+ gatesChanged?: true;
751
+ afterChanged?: true;
752
+ candidate?: string;
753
+ integration?: string;
754
+ contentId?: string;
755
+ admission?: "reused";
756
+ previousContentId?: string;
757
+ snapshot?: string;
758
+ checks?: readonly import("../protocol/verify.js").VerificationCheck[];
759
+ worktreeChanges?: Review["worktreeChanges"];
760
+ continuation?: ContinuationReport;
761
+ chapter?: number;
762
+ preview?: Partial<import("../protocol/delivery-preview.js").DeliveryPreviewReport>;
763
+ }>;
764
+ export type PartialOutcomeEnvelope = PartialContractEnvelope | Readonly<{
765
+ kind: "world";
766
+ world?: WorldRoot;
767
+ removed?: Partial<ResetCounts>;
768
+ issues?: readonly ResetIssue[];
769
+ contracts?: readonly import("./reconcile.js").RepoContractReconcileReport[];
770
+ }>;
771
+ /** Internal execution conclusion before the final, independently awaited resource retirement. */
750
772
  export type OutcomeProjection<Operation extends ContractVerb, Value, Refusal> = Readonly<{
751
773
  kind: "accepted";
752
774
  contract: ContractId;
753
- head: ContractHead;
754
775
  value: Value;
755
776
  }> | Readonly<{
756
777
  kind: "refused";
@@ -759,7 +780,7 @@ export type OutcomeProjection<Operation extends ContractVerb, Value, Refusal> =
759
780
  }> | Readonly<{
760
781
  kind: "retry";
761
782
  contract?: ContractId;
762
- reason: OperationRetries[Operation];
783
+ reason: IntentRetry;
763
784
  }> | Readonly<{
764
785
  kind: "failed";
765
786
  contract?: ContractId;
@@ -776,11 +797,10 @@ export type Projected<Operation extends ContractVerb, Value, Refusal> = Readonly
776
797
  kind: "failed";
777
798
  error: KeiyakuError;
778
799
  }>;
779
- /**
780
- * The single final projector. It reads one immutable accumulator snapshot after owned teardown and
781
- * produces the shared envelope for a complete answer or, on the failure path, the same envelope as
782
- * the exceptional receipt. There is no independently assembled partial result.
783
- */
800
+ export declare function invocationIssues(effects: readonly InvocationEffect[], primary?: ContractId, snapshot?: string): readonly InvocationIssue[];
801
+ export declare function compactReview(value: CompletionEvidence & ReviewAdmissionValue & Readonly<{
802
+ continuation?: ContinuationReport;
803
+ }>): Review;
784
804
  export declare function project(operation: "nuke", snapshot: InvocationSnapshot, projection: ResetProjection): Readonly<{
785
805
  kind: "returned";
786
806
  outcome: ResetOutcome;
@@ -794,25 +814,19 @@ type KeiyakuErrorOptions = Readonly<{
794
814
  cause?: unknown;
795
815
  outcome?: PartialOutcomeEnvelope;
796
816
  }>;
797
- /** The one exceptional failure: a category, the native original cause, and an optional same-envelope receipt. */
798
817
  export declare class KeiyakuError extends Error {
799
818
  readonly category: KeiyakuErrorCategory;
800
- readonly outcome?: PartialOutcomeEnvelope;
819
+ get outcome(): PartialOutcomeEnvelope | undefined;
801
820
  constructor(category: KeiyakuErrorCategory, message: string, options?: KeiyakuErrorOptions);
802
821
  }
803
- /** One explicit caller-validation phase; its failures are invalid input with a native TypeError cause. */
804
822
  export declare function validated<Value>(phase: () => Value): Value;
805
823
  export declare function errorCategory(error: unknown): KeiyakuErrorCategory;
806
824
  export declare function readContractValue<Value>(operation: () => Promise<Value>): Promise<Value>;
807
- /** Attach this invocation's partial envelope without changing the error's own identity or category. */
808
825
  export declare function withOutcomeReceipt(error: unknown, outcome: PartialOutcomeEnvelope): KeiyakuError;
809
- export type Verify = import("../protocol/verify.js").VerifyValue & Readonly<{
810
- continuation?: ContinuationReport | undefined;
811
- }>;
812
- export type Review = CompletionEvidence & ReviewAdmissionValue & Readonly<{
813
- continuation?: ContinuationReport | undefined;
814
- }>;
815
- /** Native diagnostic projection for JSON callers; process custody stays on the original error. */
826
+ /** Native creation evidence cannot be supplied by an arbitrary error property. */
827
+ export declare function spawnFailureReceipt(error: unknown): SpawnResult | undefined;
828
+ /** Retain the native error, including frozen failures, without losing confirmed birth. */
829
+ export declare function withSpawnFailureReceipt(reason: unknown, result: SpawnResult): Error;
816
830
  export type FailureProjection = Readonly<{
817
831
  kind: "failed";
818
832
  category: KeiyakuErrorCategory;
@@ -820,6 +834,6 @@ export type FailureProjection = Readonly<{
820
834
  causeClass?: string;
821
835
  causeDiagnostic?: string;
822
836
  outcome?: PartialOutcomeEnvelope;
837
+ spawn?: SpawnResult;
823
838
  }>;
824
839
  export declare function projectFailure(error: unknown): FailureProjection;
825
- export {};