@astrosheep/keiyaku 4.6.30 → 4.6.32

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 (464) hide show
  1. package/README.md +39 -22
  2. package/build/plugins/claude/.claude-plugin/plugin.json +1 -1
  3. package/build/plugins/claude/skills/keiyaku/SKILL.md +12 -12
  4. package/build/plugins/claude/skills/keiyaku-akuma/SKILL.md +27 -22
  5. package/build/plugins/claude/skills/keiyaku-akuma/references/automation.md +14 -14
  6. package/build/plugins/claude/skills/keiyaku-babysit/SKILL.md +15 -13
  7. package/build/plugins/claude/skills/keiyaku-bind/SKILL.md +18 -17
  8. package/build/plugins/claude/skills/keiyaku-debt/SKILL.md +30 -30
  9. package/build/plugins/claude/skills/keiyaku-workflow/SKILL.md +24 -23
  10. package/build/plugins/codex/.codex-plugin/plugin.json +1 -1
  11. package/build/plugins/codex/skills/keiyaku/SKILL.md +12 -12
  12. package/build/plugins/codex/skills/keiyaku-akuma/SKILL.md +27 -22
  13. package/build/plugins/codex/skills/keiyaku-akuma/references/automation.md +14 -14
  14. package/build/plugins/codex/skills/keiyaku-babysit/SKILL.md +15 -13
  15. package/build/plugins/codex/skills/keiyaku-bind/SKILL.md +18 -17
  16. package/build/plugins/codex/skills/keiyaku-debt/SKILL.md +30 -30
  17. package/build/plugins/codex/skills/keiyaku-workflow/SKILL.md +24 -23
  18. package/build/plugins/opencode/package.json +1 -1
  19. package/build/plugins/opencode/skills/keiyaku/SKILL.md +12 -12
  20. package/build/plugins/opencode/skills/keiyaku-akuma/SKILL.md +27 -22
  21. package/build/plugins/opencode/skills/keiyaku-akuma/references/automation.md +14 -14
  22. package/build/plugins/opencode/skills/keiyaku-babysit/SKILL.md +15 -13
  23. package/build/plugins/opencode/skills/keiyaku-bind/SKILL.md +18 -17
  24. package/build/plugins/opencode/skills/keiyaku-debt/SKILL.md +30 -30
  25. package/build/plugins/opencode/skills/keiyaku-workflow/SKILL.md +24 -23
  26. package/build/plugins/pi/README.md +20 -22
  27. package/build/plugins/pi/akuma-tools.ts +43 -56
  28. package/build/plugins/pi/keiyaku.ts +15 -4
  29. package/build/skills/keiyaku/SKILL.md +12 -12
  30. package/build/skills/keiyaku-akuma/SKILL.md +27 -22
  31. package/build/skills/keiyaku-akuma/references/automation.md +14 -14
  32. package/build/skills/keiyaku-babysit/SKILL.md +15 -13
  33. package/build/skills/keiyaku-bind/SKILL.md +18 -17
  34. package/build/skills/keiyaku-debt/SKILL.md +30 -30
  35. package/build/skills/keiyaku-workflow/SKILL.md +24 -23
  36. package/build/src/akuma/akuma-call.d.ts +4 -6
  37. package/build/src/akuma/akuma-call.js +12 -15
  38. package/build/src/akuma/akuma-errors.d.ts +12 -9
  39. package/build/src/akuma/akuma-errors.js +16 -12
  40. package/build/src/akuma/akuma-instance.d.ts +102 -23
  41. package/build/src/akuma/akuma-instance.js +66 -66
  42. package/build/src/akuma/akuma-observe.d.ts +15 -15
  43. package/build/src/akuma/akuma-observe.js +34 -32
  44. package/build/src/akuma/akuma-owner.d.ts +46 -17
  45. package/build/src/akuma/akuma-owner.js +68 -43
  46. package/build/src/akuma/akuma-probe.d.ts +3 -3
  47. package/build/src/akuma/akuma-probe.js +2 -2
  48. package/build/src/akuma/akuma-selection-execution.d.ts +992 -5
  49. package/build/src/akuma/akuma-selection-execution.js +96 -125
  50. package/build/src/akuma/akuma-stream.d.ts +2 -2
  51. package/build/src/akuma/akuma-stream.js +1 -1
  52. package/build/src/akuma/akuma-wait.d.ts +7 -7
  53. package/build/src/akuma/akuma-wait.js +52 -14
  54. package/build/src/akuma/akuma.d.ts +88 -451
  55. package/build/src/akuma/akuma.js +58 -56
  56. package/build/src/akuma/archetype.d.ts +31 -21
  57. package/build/src/akuma/archetype.js +67 -52
  58. package/build/src/akuma/body-launch.d.ts +2 -2
  59. package/build/src/akuma/body.js +35 -30
  60. package/build/src/akuma/call-initial-tell.d.ts +63 -44
  61. package/build/src/akuma/call-initial-tell.js +50 -3
  62. package/build/src/akuma/call-input.d.ts +8 -1
  63. package/build/src/akuma/call-input.js +27 -18
  64. package/build/src/akuma/caller.d.ts +26 -17
  65. package/build/src/akuma/caller.js +24 -10
  66. package/build/src/akuma/coordinate.d.ts +9 -0
  67. package/build/src/akuma/coordinate.js +13 -0
  68. package/build/src/akuma/detached-body.js +3 -3
  69. package/build/src/akuma/dispatch-association.d.ts +4 -4
  70. package/build/src/akuma/dispatch-association.js +12 -3
  71. package/build/src/akuma/execution-instructions.js +2 -2
  72. package/build/src/akuma/heart/facts.d.ts +32 -9
  73. package/build/src/akuma/heart/facts.js +18 -5
  74. package/build/src/akuma/heart/index.d.ts +0 -3
  75. package/build/src/akuma/heart/index.js +3 -6
  76. package/build/src/akuma/heart/rows.js +2 -2
  77. package/build/src/akuma/heart/soul.js +25 -9
  78. package/build/src/akuma/identity.d.ts +18 -17
  79. package/build/src/akuma/identity.js +29 -23
  80. package/build/src/akuma/index.d.ts +7 -9
  81. package/build/src/akuma/index.js +2 -3
  82. package/build/src/akuma/lineage-cache.d.ts +4 -4
  83. package/build/src/akuma/lineage-cache.js +10 -10
  84. package/build/src/akuma/projection-read.d.ts +2 -5
  85. package/build/src/akuma/projection-read.js +34 -47
  86. package/build/src/akuma/projection.d.ts +662 -569
  87. package/build/src/akuma/projection.js +203 -94
  88. package/build/src/akuma/provider-recipe.js +3 -2
  89. package/build/src/akuma/providers/acp/config.js +11 -10
  90. package/build/src/akuma/providers/acp/index.js +3 -2
  91. package/build/src/akuma/providers/codex-app-server/index.js +7 -1
  92. package/build/src/akuma/providers/execution-environment.d.ts +1 -3
  93. package/build/src/akuma/providers/execution-environment.js +0 -4
  94. package/build/src/akuma/providers/grok-build/index.js +2 -1
  95. package/build/src/akuma/providers/index.d.ts +0 -1
  96. package/build/src/akuma/providers/index.js +0 -8
  97. package/build/src/akuma/providers/paseo/index.js +7 -4
  98. package/build/src/akuma/providers/pi/index.js +4 -3
  99. package/build/src/akuma/publication.d.ts +3 -4
  100. package/build/src/akuma/publication.js +19 -17
  101. package/build/src/akuma/retention.js +2 -2
  102. package/build/src/akuma/schema.d.ts +3 -49
  103. package/build/src/akuma/schema.js +6 -147
  104. package/build/src/akuma/selection-observation.d.ts +559 -54
  105. package/build/src/akuma/selection-observation.js +207 -1
  106. package/build/src/akuma/status-projection.d.ts +52 -0
  107. package/build/src/akuma/status-projection.js +194 -0
  108. package/build/src/akuma/turn-drive.js +0 -3
  109. package/build/src/alias/index.d.ts +9 -4
  110. package/build/src/alias/index.js +11 -9
  111. package/build/src/body/amend.js +2 -1
  112. package/build/src/body/arc.js +3 -2
  113. package/build/src/body/criteria.js +4 -3
  114. package/build/src/body/decode.js +2 -1
  115. package/build/src/body/envelope.js +2 -1
  116. package/build/src/body/region.d.ts +1 -3
  117. package/build/src/body/region.js +3 -8
  118. package/build/src/body-host.d.ts +4 -11
  119. package/build/src/body-host.js +5 -4
  120. package/build/src/bounded-list.d.ts +8 -0
  121. package/build/src/bounded-list.js +11 -1
  122. package/build/src/cli/commands/akuma-grammar.d.ts +109 -66
  123. package/build/src/cli/commands/akuma-grammar.js +90 -110
  124. package/build/src/cli/commands/akuma.d.ts +8 -4
  125. package/build/src/cli/commands/akuma.js +92 -287
  126. package/build/src/cli/commands/contract-grammar.d.ts +3 -134
  127. package/build/src/cli/commands/contract-grammar.js +127 -203
  128. package/build/src/cli/commands/contract-help.d.ts +26 -21
  129. package/build/src/cli/commands/contract-help.js +45 -36
  130. package/build/src/cli/commands/contract.d.ts +6 -15
  131. package/build/src/cli/commands/contract.js +80 -518
  132. package/build/src/cli/commands/debt-grammar.d.ts +2 -4
  133. package/build/src/cli/commands/debt-grammar.js +22 -190
  134. package/build/src/cli/commands/debt.d.ts +2 -3
  135. package/build/src/cli/commands/debt.js +41 -334
  136. package/build/src/cli/commands/report.d.ts +2 -4
  137. package/build/src/cli/commands/report.js +11 -28
  138. package/build/src/cli/commands/whoami.d.ts +3 -43
  139. package/build/src/cli/commands/whoami.js +8 -121
  140. package/build/src/cli/coordinates.d.ts +3 -34
  141. package/build/src/cli/coordinates.js +13 -129
  142. package/build/src/cli/main.js +9 -3
  143. package/build/src/cli/parse.d.ts +78 -7
  144. package/build/src/cli/parse.js +49 -32
  145. package/build/src/cli/render/akuma-activity.d.ts +41 -31
  146. package/build/src/cli/render/akuma-activity.js +262 -349
  147. package/build/src/cli/render/akuma.d.ts +26 -27
  148. package/build/src/cli/render/akuma.js +99 -135
  149. package/build/src/cli/render/catalog.d.ts +3 -9
  150. package/build/src/cli/render/catalog.js +27 -105
  151. package/build/src/cli/render/contract-history.d.ts +3 -1
  152. package/build/src/cli/render/contract-history.js +139 -215
  153. package/build/src/cli/render/contract-observation.d.ts +36 -30
  154. package/build/src/cli/render/contract-observation.js +64 -34
  155. package/build/src/cli/render/contract-wait.js +6 -6
  156. package/build/src/cli/render/contract.d.ts +39 -6
  157. package/build/src/cli/render/contract.js +249 -374
  158. package/build/src/cli/render/debt.d.ts +7 -25
  159. package/build/src/cli/render/debt.js +74 -210
  160. package/build/src/cli/render/delivery-preview.d.ts +4 -3
  161. package/build/src/cli/render/delivery-preview.js +68 -96
  162. package/build/src/cli/render/kanshi-akuma.d.ts +8 -6
  163. package/build/src/cli/render/kanshi-akuma.js +77 -62
  164. package/build/src/cli/render/kanshi.d.ts +2 -4
  165. package/build/src/cli/render/kanshi.js +184 -223
  166. package/build/src/cli/render/marks.d.ts +11 -2
  167. package/build/src/cli/render/marks.js +13 -3
  168. package/build/src/cli/render/nuke.d.ts +3 -3
  169. package/build/src/cli/render/nuke.js +13 -16
  170. package/build/src/cli/render/receipt.d.ts +46 -43
  171. package/build/src/cli/render/receipt.js +318 -236
  172. package/build/src/cli/render/reconcile.d.ts +6 -4
  173. package/build/src/cli/render/reconcile.js +53 -137
  174. package/build/src/cli/render/refusal.d.ts +6 -4
  175. package/build/src/cli/render/refusal.js +82 -65
  176. package/build/src/cli/render/region.d.ts +11 -2
  177. package/build/src/cli/render/region.js +17 -23
  178. package/build/src/cli/render/settings.d.ts +1 -2
  179. package/build/src/cli/render/settings.js +8 -17
  180. package/build/src/cli/render/terminal.d.ts +11 -8
  181. package/build/src/cli/render/terminal.js +48 -32
  182. package/build/src/cli/render/verbs.d.ts +6 -0
  183. package/build/src/cli/render/verbs.js +270 -0
  184. package/build/src/cli/render/whoami.d.ts +1 -1
  185. package/build/src/cli/render/whoami.js +24 -31
  186. package/build/src/cli/runtime.d.ts +3 -11
  187. package/build/src/cli/runtime.js +119 -101
  188. package/build/src/cli/scan.d.ts +1 -1
  189. package/build/src/cli/streams.d.ts +2 -9
  190. package/build/src/cli/streams.js +9 -1
  191. package/build/src/cli/usage.d.ts +2 -1
  192. package/build/src/cli/usage.js +3 -2
  193. package/build/src/contract-guidance.js +2 -2
  194. package/build/src/contract-worktree.d.ts +2 -15
  195. package/build/src/contract-worktree.js +20 -44
  196. package/build/src/core/facts/codec.js +9 -23
  197. package/build/src/core/facts/errors.d.ts +2 -1
  198. package/build/src/core/facts/errors.js +3 -3
  199. package/build/src/core/facts/observation.d.ts +4 -5
  200. package/build/src/core/facts/observation.js +7 -9
  201. package/build/src/core/facts/types.d.ts +2 -13
  202. package/build/src/core/facts/types.js +1 -6
  203. package/build/src/core/verbs/abandon.d.ts +1 -2
  204. package/build/src/core/verbs/amend.d.ts +1 -3
  205. package/build/src/core/verbs/amend.js +3 -3
  206. package/build/src/core/verbs/arc.d.ts +1 -2
  207. package/build/src/core/verbs/attestation.d.ts +1 -2
  208. package/build/src/core/verbs/bind.d.ts +1 -3
  209. package/build/src/core/verbs/bind.js +5 -5
  210. package/build/src/core/verbs/deliver.d.ts +4 -4
  211. package/build/src/core/verbs/deliver.js +2 -2
  212. package/build/src/core/verbs/placement.d.ts +1 -7
  213. package/build/src/core/verbs/placement.js +4 -6
  214. package/build/src/core/verbs/reintegrate.d.ts +1 -3
  215. package/build/src/core/verbs/reintegrate.js +2 -2
  216. package/build/src/debt/board.d.ts +70 -134
  217. package/build/src/debt/board.js +99 -190
  218. package/build/src/debt/catalog.d.ts +4 -6
  219. package/build/src/debt/catalog.js +3 -40
  220. package/build/src/debt/document.d.ts +23 -21
  221. package/build/src/debt/document.js +32 -58
  222. package/build/src/debt/identity.d.ts +2 -14
  223. package/build/src/debt/identity.js +19 -49
  224. package/build/src/debt/index.d.ts +239 -54
  225. package/build/src/debt/index.js +85 -88
  226. package/build/src/debt/input.d.ts +21 -6
  227. package/build/src/debt/input.js +57 -169
  228. package/build/src/debt/lifecycle-operations.d.ts +1 -3
  229. package/build/src/debt/lifecycle-operations.js +6 -86
  230. package/build/src/debt/operation-types.d.ts +97 -79
  231. package/build/src/debt/operation-types.js +57 -1
  232. package/build/src/debt/operations.d.ts +11 -19
  233. package/build/src/debt/operations.js +70 -191
  234. package/build/src/debt/store.d.ts +4 -4
  235. package/build/src/debt/store.js +40 -95
  236. package/build/src/debt/view.d.ts +0 -3
  237. package/build/src/debt/view.js +0 -4
  238. package/build/src/dispatch/index.d.ts +22 -5
  239. package/build/src/dispatch/index.js +46 -37
  240. package/build/src/errors.d.ts +28 -0
  241. package/build/src/errors.js +26 -0
  242. package/build/src/git/admission.d.ts +2 -2
  243. package/build/src/git/admission.js +2 -1
  244. package/build/src/git/hooks.d.ts +15 -36
  245. package/build/src/git/hooks.js +45 -25
  246. package/build/src/git/integration.d.ts +6 -24
  247. package/build/src/git/integration.js +10 -16
  248. package/build/src/git/observe.d.ts +3 -0
  249. package/build/src/git/observe.js +19 -5
  250. package/build/src/git/private-state-seat.d.ts +2 -2
  251. package/build/src/git/private-state-seat.js +2 -1
  252. package/build/src/git/reconcile.d.ts +20 -95
  253. package/build/src/git/reconcile.js +37 -70
  254. package/build/src/git/repository.d.ts +2 -1
  255. package/build/src/git/repository.js +3 -3
  256. package/build/src/git/scratch.d.ts +3 -3
  257. package/build/src/git/scratch.js +4 -1
  258. package/build/src/git/target-placement.d.ts +27 -35
  259. package/build/src/git/target-placement.js +42 -27
  260. package/build/src/git/target.d.ts +4 -4
  261. package/build/src/git/target.js +2 -1
  262. package/build/src/git/tender.d.ts +8 -41
  263. package/build/src/git/tender.js +26 -66
  264. package/build/src/git/terminal-reconcile.js +15 -18
  265. package/build/src/git/terminal-seal.d.ts +2 -4
  266. package/build/src/git/terminal-seal.js +7 -33
  267. package/build/src/git/workspace.d.ts +65 -41
  268. package/build/src/git/workspace.js +45 -14
  269. package/build/src/identity/coordinates.d.ts +1 -1
  270. package/build/src/identity/coordinates.js +3 -2
  271. package/build/src/identity/normalize.js +2 -1
  272. package/build/src/identity/selector.d.ts +2 -0
  273. package/build/src/identity/selector.js +17 -6
  274. package/build/src/index.d.ts +37 -66
  275. package/build/src/index.js +10 -47
  276. package/build/src/kanshi/counts.d.ts +44 -15
  277. package/build/src/kanshi/counts.js +18 -15
  278. package/build/src/kanshi/index.d.ts +22 -7
  279. package/build/src/kanshi/index.js +30 -3
  280. package/build/src/kanshi/read.d.ts +309 -15
  281. package/build/src/kanshi/read.js +226 -535
  282. package/build/src/kanshi/report.d.ts +1225 -103
  283. package/build/src/kanshi/report.js +153 -1
  284. package/build/src/kanshi/select.d.ts +0 -8
  285. package/build/src/kanshi/select.js +20 -59
  286. package/build/src/library/address.d.ts +17 -17
  287. package/build/src/library/address.js +41 -34
  288. package/build/src/library/akuma-creation.d.ts +828 -91
  289. package/build/src/library/akuma-creation.js +292 -273
  290. package/build/src/library/akuma-retention.d.ts +2 -2
  291. package/build/src/library/akuma-retention.js +2 -2
  292. package/build/src/library/akumas.d.ts +33 -10
  293. package/build/src/library/akumas.js +109 -25
  294. package/build/src/library/bind.d.ts +32 -61
  295. package/build/src/library/bind.js +8 -12
  296. package/build/src/library/continuation.d.ts +133 -505
  297. package/build/src/library/continuation.js +37 -29
  298. package/build/src/library/contract-address.d.ts +8 -10
  299. package/build/src/library/contract-address.js +16 -23
  300. package/build/src/library/contract-composition.d.ts +18 -13
  301. package/build/src/library/contract-composition.js +62 -61
  302. package/build/src/library/contract-creation.d.ts +3 -2
  303. package/build/src/library/contract-creation.js +54 -49
  304. package/build/src/library/contract-outcomes.d.ts +2365 -43
  305. package/build/src/library/contract-outcomes.js +73 -16
  306. package/build/src/library/contract-settings.d.ts +3 -4
  307. package/build/src/library/contract-settings.js +21 -19
  308. package/build/src/library/contract-types.d.ts +227 -75
  309. package/build/src/library/contract-types.js +90 -1
  310. package/build/src/library/contract-wait.d.ts +75 -17
  311. package/build/src/library/contract-wait.js +61 -24
  312. package/build/src/library/delivery.d.ts +566 -37
  313. package/build/src/library/delivery.js +16 -28
  314. package/build/src/library/input.d.ts +31 -5
  315. package/build/src/library/input.js +40 -41
  316. package/build/src/library/invocation.d.ts +18 -12
  317. package/build/src/library/invocation.js +98 -96
  318. package/build/src/library/kei.d.ts +56 -0
  319. package/build/src/library/kei.js +696 -0
  320. package/build/src/{cli/delivery-identity.js → library/keiyaku-attribution.js} +1 -1
  321. package/build/src/library/keiyaku-classify.d.ts +11 -0
  322. package/build/src/library/keiyaku-classify.js +127 -0
  323. package/build/src/library/keiyaku-coordinates.d.ts +26 -0
  324. package/build/src/library/keiyaku-coordinates.js +83 -0
  325. package/build/src/library/keiyaku-debt.d.ts +70 -0
  326. package/build/src/library/keiyaku-debt.js +39 -0
  327. package/build/src/library/keiyaku-identity.d.ts +58 -0
  328. package/build/src/library/keiyaku-identity.js +177 -0
  329. package/build/src/library/keiyaku-verbs.d.ts +6893 -0
  330. package/build/src/library/keiyaku-verbs.js +496 -0
  331. package/build/src/library/keiyaku.d.ts +41 -38
  332. package/build/src/library/keiyaku.js +590 -127
  333. package/build/src/library/nuke.d.ts +25 -1
  334. package/build/src/library/nuke.js +9 -2
  335. package/build/src/library/outcome.d.ts +867 -736
  336. package/build/src/library/outcome.js +431 -211
  337. package/build/src/library/reconcile.d.ts +652 -116
  338. package/build/src/library/reconcile.js +146 -108
  339. package/build/src/library/refusal.d.ts +118 -590
  340. package/build/src/library/refusal.js +54 -51
  341. package/build/src/library/region.d.ts +5 -24
  342. package/build/src/library/region.js +6 -21
  343. package/build/src/library/repo.js +4 -3
  344. package/build/src/library/selection.d.ts +205 -45
  345. package/build/src/library/selection.js +139 -128
  346. package/build/src/mcp/adapter.d.ts +17 -0
  347. package/build/src/mcp/adapter.js +241 -0
  348. package/build/src/mcp/help.d.ts +1 -0
  349. package/build/src/mcp/help.js +31 -0
  350. package/build/src/mcp/index.d.ts +2 -0
  351. package/build/src/mcp/index.js +37 -0
  352. package/build/src/mcp/output.d.ts +385 -0
  353. package/build/src/mcp/output.js +193 -0
  354. package/build/src/plugin/public.d.ts +5 -1
  355. package/build/src/plugin/runtime.d.ts +1 -1
  356. package/build/src/plugin/runtime.js +19 -16
  357. package/build/src/protocol/amend.d.ts +1 -1
  358. package/build/src/protocol/amend.js +2 -2
  359. package/build/src/protocol/arc.d.ts +4 -1
  360. package/build/src/protocol/arc.js +7 -1
  361. package/build/src/protocol/attempt.d.ts +2 -3
  362. package/build/src/protocol/attempt.js +1 -10
  363. package/build/src/protocol/bind.d.ts +10 -13
  364. package/build/src/protocol/bind.js +12 -8
  365. package/build/src/protocol/completion.d.ts +412 -13
  366. package/build/src/protocol/completion.js +202 -28
  367. package/build/src/protocol/deliver.d.ts +35 -28
  368. package/build/src/protocol/deliver.js +52 -80
  369. package/build/src/protocol/delivery-preview.d.ts +102 -250
  370. package/build/src/protocol/delivery-preview.js +134 -130
  371. package/build/src/protocol/execution-observation.d.ts +136 -121
  372. package/build/src/protocol/execution-observation.js +9 -6
  373. package/build/src/protocol/intent.d.ts +14 -56
  374. package/build/src/protocol/intent.js +46 -73
  375. package/build/src/protocol/operations.d.ts +240 -543
  376. package/build/src/protocol/operations.js +89 -151
  377. package/build/src/protocol/outcome.d.ts +3 -1
  378. package/build/src/protocol/placement.d.ts +1 -3
  379. package/build/src/protocol/placement.js +6 -3
  380. package/build/src/protocol/progress.d.ts +8 -97
  381. package/build/src/protocol/progress.js +7 -55
  382. package/build/src/protocol/read/observation.d.ts +13 -6
  383. package/build/src/protocol/read/observation.js +10 -9
  384. package/build/src/protocol/read/status.d.ts +386 -98
  385. package/build/src/protocol/read/status.js +400 -139
  386. package/build/src/protocol/reconcile.d.ts +2 -0
  387. package/build/src/protocol/reconcile.js +12 -11
  388. package/build/src/protocol/reintegrate.d.ts +1 -3
  389. package/build/src/protocol/reintegrate.js +4 -5
  390. package/build/src/protocol/result-leaves.d.ts +507 -0
  391. package/build/src/protocol/result-leaves.js +156 -0
  392. package/build/src/protocol/result-reasons.d.ts +129 -0
  393. package/build/src/protocol/result-reasons.js +87 -0
  394. package/build/src/protocol/review.d.ts +14 -11
  395. package/build/src/protocol/review.js +30 -15
  396. package/build/src/protocol/run.d.ts +4 -4
  397. package/build/src/protocol/run.js +4 -1
  398. package/build/src/protocol/verify.d.ts +406 -31
  399. package/build/src/protocol/verify.js +137 -34
  400. package/build/src/region.d.ts +26 -0
  401. package/build/src/region.js +28 -0
  402. package/build/src/runtime/proc/diagnostic.d.ts +11 -0
  403. package/build/src/runtime/proc/diagnostic.js +20 -0
  404. package/build/src/runtime/proc/windows-launch.exe +0 -0
  405. package/build/src/settings.d.ts +133 -40
  406. package/build/src/settings.js +122 -46
  407. package/build/src/settlement/holder.js +2 -2
  408. package/build/src/settlement/settle.d.ts +29 -18
  409. package/build/src/settlement/settle.js +22 -19
  410. package/build/src/verification/declaration.d.ts +4 -9
  411. package/build/src/verification/declaration.js +5 -10
  412. package/build/src/verification/execution.d.ts +7 -19
  413. package/build/src/verification/execution.js +37 -16
  414. package/build/src/verification/observation.d.ts +11 -11
  415. package/build/src/verification/observation.js +9 -7
  416. package/build/src/world.d.ts +11 -2
  417. package/build/src/world.js +12 -6
  418. package/package.json +6 -5
  419. package/plugins/paseo/plugin/index.server.ts +1 -1
  420. package/plugins/paseo/plugin/server/attach.ts +74 -67
  421. package/plugins/paseo/plugin/server/keiyaku.ts +73 -40
  422. package/plugins/paseo/plugin/server/message.ts +9 -30
  423. package/plugins/paseo/plugin/server/mirror-identity.ts +6 -4
  424. package/plugins/paseo/plugin/server/mirror.ts +16 -20
  425. package/plugins/paseo/plugin/server/provider.ts +1 -1
  426. package/plugins/paseo/plugin/server/sdk.ts +12 -6
  427. package/plugins/paseo/plugin/server/transport.ts +24 -1
  428. package/plugins/pi/README.md +20 -22
  429. package/plugins/pi/akuma-tools.ts +43 -56
  430. package/plugins/pi/keiyaku.ts +15 -4
  431. package/skills/keiyaku/SKILL.md +12 -12
  432. package/skills/keiyaku-akuma/SKILL.md +27 -22
  433. package/skills/keiyaku-akuma/references/automation.md +14 -14
  434. package/skills/keiyaku-babysit/SKILL.md +15 -13
  435. package/skills/keiyaku-bind/SKILL.md +18 -17
  436. package/skills/keiyaku-debt/SKILL.md +30 -30
  437. package/skills/keiyaku-workflow/SKILL.md +24 -23
  438. package/build/src/akuma/providers/codex-app-server/configuration.d.ts +0 -5
  439. package/build/src/akuma/providers/codex-app-server/configuration.js +0 -72
  440. package/build/src/cli/actor.d.ts +0 -10
  441. package/build/src/cli/actor.js +0 -24
  442. package/build/src/cli/akuma-caller.d.ts +0 -3
  443. package/build/src/cli/akuma-caller.js +0 -31
  444. package/build/src/cli/commands/debt-query.d.ts +0 -5
  445. package/build/src/cli/commands/debt-query.js +0 -194
  446. package/build/src/cli/render/akuma-tool-command.d.ts +0 -6
  447. package/build/src/cli/render/akuma-tool-command.js +0 -143
  448. package/build/src/cli/render/akuma-tool.d.ts +0 -32
  449. package/build/src/cli/render/akuma-tool.js +0 -219
  450. package/build/src/cli/render/effects.d.ts +0 -26
  451. package/build/src/cli/render/effects.js +0 -41
  452. package/build/src/cli/selectors.d.ts +0 -10
  453. package/build/src/cli/selectors.js +0 -42
  454. package/build/src/debt/context.d.ts +0 -16
  455. package/build/src/debt/context.js +0 -91
  456. package/build/src/debt/created-observation.d.ts +0 -38
  457. package/build/src/debt/created-observation.js +0 -30
  458. package/build/src/debt/query.d.ts +0 -76
  459. package/build/src/debt/query.js +0 -292
  460. package/build/src/library/contract-execution.d.ts +0 -28
  461. package/build/src/library/contract-execution.js +0 -467
  462. package/build/src/markdown/diff.d.ts +0 -1
  463. package/build/src/markdown/diff.js +0 -4
  464. /package/build/src/{cli/delivery-identity.d.ts → library/keiyaku-attribution.d.ts} +0 -0
@@ -1,29 +1,11 @@
1
- import type { CliOutcome } from "../streams.js";
2
- import type { BlockedDebtList, DebtBatchResult, DebtContextResult, DebtDecompositionTree, DebtDetail, DebtDoctorReport, DebtList, DebtMutationResult, DebtQueryResult, DebtUpdateResult } from "../../debt/index.js";
1
+ import type { DebtAbsent, DebtCatalogue, DebtDoctorReport, DebtMutationResult, DebtShowResult, DebtUpdateResult } from "../../debt/index.js";
3
2
  import { type TextRenderContext } from "./terminal.js";
4
3
  export { debtMark } from "./marks.js";
5
- type DebtListOutcome = DebtList | BlockedDebtList | DebtQueryResult;
6
- /** One addressed show selection: native details, or a refusal naming a missing addressed read. */
7
- export type DebtShowResult = DebtDetail | DebtDetail[] | Extract<DebtMutationResult, {
8
- kind: "refused";
9
- }>;
10
- /** Presentation-only list scope the leaf acquired; never part of a product value. */
11
- export type DebtListScope = "world" | "current" | Readonly<{
12
- namespace: string;
13
- }>;
14
- /** The union of native Debt SDK answers one leaf renders directly; the CLI adds no result envelope. */
15
- type DebtNativeResult = DebtMutationResult | DebtUpdateResult | DebtBatchResult | DebtShowResult | DebtList | BlockedDebtList | DebtQueryResult | DebtDecompositionTree | DebtDoctorReport | DebtContextResult;
16
- /** Debt dispositions and relation states are snake_case facts; people read them as words. */
17
4
  export declare function dispositionText(word: string): string;
18
- export declare function debtFrameHead(view: string, scope: string): string;
19
- export declare function renderDebtList(action: "ls" | "ready" | "blocked" | "query", scope: DebtListScope, result: DebtListOutcome, context?: TextRenderContext): string;
20
- export declare function renderDebtShow(result: DebtShowResult, context?: TextRenderContext): string;
21
- export declare function renderDoctor(report: DebtDoctorReport): string;
22
- export declare function renderDebtUpdate(result: DebtUpdateResult, context?: TextRenderContext): string;
23
- export declare function renderDebtTree(result: DebtDecompositionTree, context?: TextRenderContext): string;
24
- export declare function renderDebtContext(result: DebtContextResult, context?: TextRenderContext): string;
25
- /** One single-Debt mutation answer; `verb` is the literal action the leaf invoked. */
5
+ export declare function renderDebtList(result: DebtCatalogue, context?: TextRenderContext): string;
6
+ /** Each item corresponds to the same invocation position, including missing targets. */
7
+ export declare function renderDebtShow(result: DebtShowResult | DebtAbsent, context?: TextRenderContext): string;
8
+ export declare function renderDoctor(report: DebtDoctorReport | DebtAbsent): string;
9
+ export declare function renderDebtUpdate(id: string | undefined, result: DebtUpdateResult, context?: TextRenderContext): string;
10
+ /** Creation retains its minted identity in the native answer. */
26
11
  export declare function renderDebtMutation(verb: string, result: DebtMutationResult, context?: TextRenderContext): string;
27
- /** One lifecycle answer: a single mutation or a plural batch, both native shapes. */
28
- export declare function renderDebtLifecycle(verb: string, result: DebtMutationResult | DebtBatchResult, context?: TextRenderContext): string;
29
- export declare function debtOutcome(result: DebtNativeResult): CliOutcome;
@@ -1,175 +1,85 @@
1
1
  import { debtMark } from "./marks.js";
2
- import { outcomeLines, receiptPayload, receiptRow, refusalLines } from "./receipt.js";
3
- import { DEFAULT_CLI_COLUMNS, displayColumns, emptyCatalogue, renderTextBlock, safeText, } from "./terminal.js";
2
+ import { outcomeLines, receiptRow, refusalLines } from "./receipt.js";
3
+ import { DEFAULT_CLI_COLUMNS, displayColumns, emptyCatalogue, renderOpaqueBlock, renderTextBlock, safeText, } from "./terminal.js";
4
4
  export { debtMark } from "./marks.js";
5
5
  const DEFAULT_CONTEXT = { columns: DEFAULT_CLI_COLUMNS, color: false };
6
- /** Debt dispositions and relation states are snake_case facts; people read them as words. */
7
6
  export function dispositionText(word) {
8
7
  return word === "drop" ? "dropped" : word.replaceAll("_", " ");
9
8
  }
10
- function priorityText(priority) {
11
- return priority === null ? "P?" : `P${priority}`;
12
- }
13
- function scanUnit(id, priority, word) {
14
- return word === undefined
15
- ? `${debtMark("ready")} ${id} · ${priorityText(priority)}`
16
- : `${debtMark(word)} ${id} · ${dispositionText(word)} · ${priorityText(priority)}`;
17
- }
18
9
  function entityLines(entity, columns, indent = "") {
19
- const scan = `${indent}${scanUnit(entity.id, entity.priority, entity.word)}${entity.facts === undefined ? "" : ` · ${entity.facts}`}`;
20
- if (entity.title === null || entity.title.length === 0)
21
- return [scan];
10
+ const parts = [
11
+ `${entity.mark} ${entity.id}`,
12
+ ...(entity.word === undefined ? [] : [dispositionText(entity.word)]),
13
+ `P${entity.priority}`,
14
+ ];
15
+ const scan = `${indent}${parts.join(" · ")}`;
22
16
  const title = safeText(entity.title);
23
17
  const inline = `${scan} — ${title}`;
24
18
  if (displayColumns(inline) <= columns)
25
19
  return [inline];
26
20
  return [scan, ...renderTextBlock(title, `${indent} `, columns, "—")];
27
21
  }
28
- function stateEntity(debt) {
29
- return {
30
- id: debt.id,
31
- priority: "priority" in debt && debt.priority !== undefined ? debt.priority : null,
32
- word: debt.state,
33
- title: debt.title,
34
- };
35
- }
36
22
  function projectRefusal(refusal) {
37
- const diagnostic = refusal.kind.replaceAll("-", " ");
38
- if (refusal.kind === "debt-missing")
39
- return { diagnostic, facts: [`debt ${refusal.debtId}`] };
40
- if (refusal.kind === "invalid-lifecycle-transition") {
41
- return { diagnostic, facts: [`debt ${refusal.debtId}`, `state ${refusal.state} · verb ${refusal.verb}`] };
42
- }
43
- if (refusal.kind === "invalid-namespace-context")
44
- return { diagnostic, facts: [`path ${refusal.path}`] };
45
- if (refusal.kind === "relation-owned-by-other") {
46
- return {
47
- diagnostic,
48
- facts: [
49
- `debt ${refusal.debtId}`,
50
- `related debt ${refusal.related}`,
51
- `declaring debt ${refusal.declaringDebt}`,
52
- ],
53
- };
54
- }
55
- return refusal.diagnostic === undefined ? { diagnostic } : { diagnostic, facts: [`detail ${refusal.diagnostic}`] };
56
- }
57
- function renderFailure(verb, result, columns) {
58
- if (result.kind === "retry") {
59
- return [...outcomeLines("?", verb, "retry", undefined, columns), result.reason].join("\n");
60
- }
61
- const facts = projectRefusal(result.refusal);
62
- return refusalLines(verb, [`reason ${facts.diagnostic}`, ...(facts.facts ?? [])], columns).join("\n");
63
- }
64
- function edge(label, ref, mark) {
65
- const prefix = mark === undefined ? ` ${label}` : ` ${mark} ${label}`;
66
- return `${prefix} ${ref.id} · ${dispositionText(ref.state)}`;
67
- }
68
- export function debtFrameHead(view, scope) {
69
- return `${view.toUpperCase()} // ${scope}`;
70
- }
71
- function updatedAge(updatedAt) {
72
- const elapsed = Math.max(0, performance.timeOrigin + performance.now() - Date.parse(updatedAt));
73
- const minutes = Math.floor(elapsed / 60_000);
74
- if (minutes < 60)
75
- return `${minutes}m`;
76
- const hours = Math.floor(minutes / 60);
77
- if (hours < 24)
78
- return `${hours}h`;
79
- return `${Math.floor(hours / 24)}d`;
80
- }
81
- function compactFacts(item) {
82
- return [
83
- `updated ${updatedAge(item.updatedAt)}`,
84
- ...(item.children === undefined ? [] : [`children ${item.children.live} live · ${item.children.total} total`]),
85
- ].join(" · ");
86
- }
87
- function listEntity(item, omitDisposition) {
88
- return {
89
- id: item.id,
90
- priority: item.priority,
91
- ...(omitDisposition ? {} : { word: item.disposition }),
92
- facts: compactFacts(item),
93
- title: item.title,
94
- };
95
- }
96
- function renderListRow(item, columns, omitDisposition) {
97
- const lines = [...entityLines(listEntity(item, omitDisposition), columns)];
98
- if ("blockers" in item) {
99
- for (const blocker of item.blockers)
100
- lines.push(` needs ${blocker.id} · ${dispositionText(blocker.state)}`);
101
- }
102
- return lines;
103
- }
104
- export function renderDebtList(action, scope, result, context = DEFAULT_CONTEXT) {
23
+ const diagnostic = refusal.reason.replaceAll("-", " ");
24
+ if (refusal.reason === "debt-missing")
25
+ return { diagnostic };
26
+ return { diagnostic, facts: [`detail ${refusal.diagnostic}`] };
27
+ }
28
+ function renderFailure(verb, result, columns, id) {
29
+ if (result.kind === "retry")
30
+ return [...outcomeLines("?", verb, "retry", id, columns), result.reason].join("\n");
31
+ const facts = projectRefusal(result);
32
+ return refusalLines(verb, [...(id === undefined ? [] : [`debt ${id}`]), `reason ${facts.diagnostic}`, ...(facts.facts ?? [])], columns).join("\n");
33
+ }
34
+ /** A cleanup problem cannot reverse the confirmed write. */
35
+ function warningLines(warning, columns) {
36
+ return [" ! warning", ...renderOpaqueBlock(warning, " ", columns)];
37
+ }
38
+ function edge(label, ref) {
39
+ return ` ${label} ${ref.id} · ${dispositionText(ref.state)}`;
40
+ }
41
+ export function renderDebtList(result, context = DEFAULT_CONTEXT) {
42
+ const page = result;
105
43
  const columns = context.columns;
106
- if (result.kind !== "accepted")
107
- return renderFailure(action, result, columns);
108
- const view = action === "ls" ? "debts" : action;
109
- const footer = result.value.hasMore ? ["…"] : [];
110
- const scopeText = scope === "world"
111
- ? "world"
112
- : scope === "current"
113
- ? "current namespace"
114
- : `namespace ${scope.namespace.replace(/^debt\//u, "").replace(/\/$/u, "") || "root"}`;
115
- const heading = debtFrameHead(view, scopeText);
116
- if (result.value.rows.length === 0)
44
+ if ("absent" in page)
45
+ return "debt world absent";
46
+ const rows = page.rows ?? [];
47
+ const view = "debts";
48
+ if (rows.length === 0)
117
49
  return emptyCatalogue(view);
118
50
  return [
119
- heading,
120
- ...result.value.rows.flatMap((item) => renderListRow(item, columns, action === "ready")),
121
- ...footer,
51
+ "DEBTS // world",
52
+ ...rows.flatMap((row) => entityLines({ ...row, mark: debtMark(row.disposition), word: row.disposition }, columns)),
53
+ ...(page.more === true ? ["…"] : []),
122
54
  ].join("\n");
123
55
  }
124
56
  function textTimestamp(timestamp) {
125
57
  return timestamp.replace(/\.\d+(?=Z$)/u, "");
126
58
  }
127
- function renderShowDetail(result, columns) {
128
- const debt = result.debt;
59
+ function renderShowDetail(id, debt, columns) {
129
60
  const lines = [
130
- ...entityLines(stateEntity(debt), columns),
61
+ ...entityLines({ id, priority: debt.priority, mark: debtMark(debt.state), word: debt.state, title: debt.title }, columns),
131
62
  ` created ${textTimestamp(debt.createdAt)}`,
132
63
  ` updated ${textTimestamp(debt.updatedAt)}`,
133
- ...(debt.createdBy === undefined ? [] : [` created by ${debt.createdBy}`]),
134
64
  ];
135
- for (const need of result.needs.filter((item) => !item.released))
136
- lines.push(edge("needs", need, "!"));
137
- for (const need of result.needs.filter((item) => item.released))
138
- lines.push(edge("needs", need, "✓"));
139
- for (const item of result.blocks)
140
- lines.push(edge("blocks", item));
141
- if (result.parent !== null)
142
- lines.push(edge("parent", result.parent));
143
- for (const item of result.children)
144
- lines.push(edge("child", item));
145
- for (const item of result.supersedes)
146
- lines.push(edge("supersedes", item));
147
- for (const item of result.supersededBy)
148
- lines.push(edge("superseded-by", item));
149
- for (const item of result.related)
150
- lines.push(edge("related", item));
151
- if (debt.note.length > 0)
152
- receiptPayload(lines, "note", debt.note);
153
- if (debt.body.length > 0)
154
- receiptPayload(lines, "body", debt.body);
65
+ for (const need of debt.needs ?? [])
66
+ lines.push(edge("needs", need));
67
+ for (const label of ["note", "body"]) {
68
+ const payload = debt[label];
69
+ if (payload !== undefined)
70
+ lines.push(` ${label}`, ...payload.split("\n").map((line) => ` ${safeText(line)}`), "");
71
+ }
155
72
  return lines.join("\n");
156
73
  }
74
+ /** Each item corresponds to the same invocation position, including missing targets. */
157
75
  export function renderDebtShow(result, context = DEFAULT_CONTEXT) {
158
- const columns = context.columns;
159
- if (Array.isArray(result))
160
- return result.map((detail) => renderShowDetail(detail, columns)).join("\n\n");
161
- if ("kind" in result)
162
- return renderFailure("show", result, columns);
163
- return renderShowDetail(result, columns);
164
- }
165
- function treeLines(node, columns, depth = 0) {
166
- const indent = " ".repeat(depth);
167
- if (node.cycle === true)
168
- return [`${indent}! ${node.debt.id} · cycle`];
169
- return [
170
- ...entityLines(stateEntity(node.debt), columns, indent),
171
- ...node.children.flatMap((child) => treeLines(child, columns, depth + 1)),
172
- ];
76
+ if (result.kind === "absent")
77
+ return "debt world absent";
78
+ return result.items
79
+ .map((item) => item.kind === "found"
80
+ ? renderShowDetail(item.id, item, context.columns)
81
+ : refusalLines("show", ["reason debt missing", `debt ${item.id}`], context.columns).join("\n"))
82
+ .join("\n\n");
173
83
  }
174
84
  function doctorIssue(issue) {
175
85
  if (issue.kind === "missing-target")
@@ -179,79 +89,33 @@ function doctorIssue(issue) {
179
89
  return `! cycle ${issue.relation} ${issue.debts.join(" ")}`;
180
90
  }
181
91
  export function renderDoctor(report) {
182
- if (report.issues.length === 0)
92
+ if (report.kind === "absent")
93
+ return "debt world absent";
94
+ if (report.issues === undefined)
183
95
  return "✓ doctor healthy";
184
96
  const noun = report.issues.length === 1 ? "issue" : "issues";
185
97
  return [`! doctor ${report.issues.length} ${noun}`, ...report.issues.map(doctorIssue)].join("\n");
186
98
  }
187
- const PAST_VERBS = {
188
- add: "added",
189
- done: "done",
190
- drop: "dropped",
191
- update: "updated",
192
- };
193
- function renderAcceptedMutation(verb, debt, columns, changes = []) {
194
- const lines = [];
195
- receiptRow(lines, "✓", PAST_VERBS[verb] ?? verb, [{ text: debt.id, opaque: true }], columns);
196
- lines.push(...entityLines(stateEntity(debt), columns));
197
- for (const change of changes)
198
- lines.push(` ${change.field} ${change.action}`);
199
- return lines.join("\n");
200
- }
201
- function renderMutation(action, result, columns) {
202
- if (result.kind !== "accepted")
203
- return renderFailure(action, result, columns);
204
- return renderAcceptedMutation(action, result.value, columns);
205
- }
206
- export function renderDebtUpdate(result, context = DEFAULT_CONTEXT) {
99
+ const PAST_VERBS = { add: "added", update: "updated" };
100
+ export function renderDebtUpdate(id, result, context = DEFAULT_CONTEXT) {
207
101
  const columns = context.columns;
208
102
  if (result.kind !== "accepted")
209
- return renderFailure("update", result, columns);
210
- return renderAcceptedMutation("update", result.value.debt, columns, result.value.changedFields);
211
- }
212
- function renderBatchItem(verb, item, columns) {
213
- if (item.outcome.kind === "accepted")
214
- return `✓ ${PAST_VERBS[verb] ?? verb} ${item.id}`;
215
- if (item.outcome.kind === "retry")
216
- return `? ${verb} ${item.id} ${item.outcome.reason}`;
217
- const facts = projectRefusal(item.outcome.refusal);
218
- const rest = (facts.facts ?? []).filter((fact) => fact !== `debt ${item.id}`);
219
- return refusalLines(verb, [`debt ${item.id}`, `reason ${facts.diagnostic}`, ...rest], columns).join("\n");
220
- }
221
- function renderBatch(verb, batch, columns) {
222
- return batch.items.map((item) => renderBatchItem(verb, item, columns)).join("\n");
223
- }
224
- export function renderDebtTree(result, context = DEFAULT_CONTEXT) {
225
- return result.kind === "accepted"
226
- ? treeLines(result.value, context.columns).join("\n")
227
- : renderFailure("tree", result, context.columns);
228
- }
229
- export function renderDebtContext(result, context = DEFAULT_CONTEXT) {
230
- if (result.kind !== "accepted")
231
- return renderFailure("context", result, context.columns);
232
- const value = result.value.namespace.length === 0 ? "root" : result.value.namespace.join("/");
233
- return `context ${value} · ${result.value.source}`;
103
+ return renderFailure("update", result, columns, id);
104
+ const lines = [];
105
+ receiptRow(lines, "✓", PAST_VERBS.update, id === undefined ? [] : [{ text: id, opaque: true }], columns);
106
+ for (const field of result.changes ?? [])
107
+ lines.push(` ${field} changed`);
108
+ if (result.warning !== undefined)
109
+ lines.push(...warningLines(result.warning, columns));
110
+ return lines.join("\n");
234
111
  }
235
- /** One single-Debt mutation answer; `verb` is the literal action the leaf invoked. */
112
+ /** Creation retains its minted identity in the native answer. */
236
113
  export function renderDebtMutation(verb, result, context = DEFAULT_CONTEXT) {
237
- return renderMutation(verb, result, context.columns);
238
- }
239
- /** One lifecycle answer: a single mutation or a plural batch, both native shapes. */
240
- export function renderDebtLifecycle(verb, result, context = DEFAULT_CONTEXT) {
241
- return "items" in result ? renderBatch(verb, result, context.columns) : renderMutation(verb, result, context.columns);
242
- }
243
- export function debtOutcome(result) {
244
- if ("issues" in result)
245
- return result.issues.length === 0 ? "accepted" : "failed";
246
- if ("items" in result) {
247
- const kinds = result.items.map((item) => item.outcome.kind);
248
- return kinds.includes("retry") ? "retryable" : kinds.includes("refused") ? "refused" : "accepted";
249
- }
250
- if ("kind" in result) {
251
- if (result.kind === "retry")
252
- return "retryable";
253
- if (result.kind === "refused")
254
- return "refused";
255
- }
256
- return "accepted";
114
+ if (result.kind !== "accepted")
115
+ return renderFailure(verb, result, context.columns);
116
+ const lines = [];
117
+ receiptRow(lines, "✓", PAST_VERBS[verb] ?? verb, [{ text: result.id, opaque: true }], context.columns);
118
+ if (result.warning !== undefined)
119
+ lines.push(...warningLines(result.warning, context.columns));
120
+ return lines.join("\n");
257
121
  }
@@ -1,7 +1,8 @@
1
1
  import type { DeliveryPreviewOutcome } from "../../index.js";
2
2
  import { type TextRenderContext } from "./terminal.js";
3
- type AcceptedDeliveryPreview = Extract<DeliveryPreviewOutcome, {
4
- kind: "accepted";
3
+ type Preview = Extract<DeliveryPreviewOutcome, {
4
+ kind: "ready" | "blocked";
5
5
  }>;
6
- export declare function renderDeliveryPreview(result: AcceptedDeliveryPreview, context?: TextRenderContext): string;
6
+ /** A preview is an observation, not a successful mutation or a prediction of placement. */
7
+ export declare function renderDeliveryPreview(report: Preview, context?: TextRenderContext): string;
7
8
  export {};
@@ -1,129 +1,101 @@
1
- import { effectCleanup, effectExecutionStops } from "./effects.js";
2
- import { executionCleanupLines, executionStopLines, standingGateLines, receiptPayload, receiptRow, titleLines, } from "./receipt.js";
1
+ import { unmetRequirementLines, receiptPayload, receiptRow, titleLines } from "./receipt.js";
3
2
  import { renderRefusalFacts } from "./refusal.js";
4
3
  import { abbreviateGitIds, displayGitId } from "./contract-observation.js";
5
- import { DEFAULT_CLI_COLUMNS, gitShortStat, renderTextBlock, safeText } from "./terminal.js";
6
- const CHILD = " ";
7
- function workspaceEvidence(workspace) {
8
- return [`${CHILD}worktree ${safeText(workspace.path)}`];
9
- }
10
- function candidateLines(report, columns, addressed, abbreviations) {
11
- const candidate = report.candidate;
12
- const lines = [];
13
- if (candidate.kind === "blocked") {
14
- receiptRow(lines, "!", "candidate", [{ text: "blocked" }], columns);
15
- lines.push(...renderRefusalFacts(candidate.refusal, CHILD, columns, addressed));
16
- return lines;
17
- }
18
- const identity = candidate.identity;
19
- receiptRow(lines, " ", "candidate", [{ text: "prepared" }, { text: displayGitId(identity.tenderSnapshot, abbreviations), opaque: true }], columns);
20
- lines.push(`${CHILD}integration result ${displayGitId(identity.integration.snapshot, abbreviations)}`);
21
- if (!/^0{40}$/u.test(identity.integration.changeId))
22
- lines.push(`${CHILD}content identity ${displayGitId(identity.integration.changeId, abbreviations)}`);
23
- lines.push(...workspaceEvidence(candidate.workspace));
24
- lines.push(...standingGateLines(candidate.requirements.gates.filter((report) => report.gate !== "verified"), columns));
25
- for (const prerequisite of candidate.requirements.unmetPrerequisites) {
26
- receiptRow(lines, "!", "prerequisite", [{ text: prerequisite.contractId }, { text: prerequisite.state }], columns);
27
- }
28
- lines.push(...renderTextBlock(gitShortStat(candidate.scope), CHILD, columns));
29
- if (candidate.scope.paths !== undefined) {
30
- for (const path of candidate.scope.paths) {
31
- lines.push(`${CHILD}${safeText(path)}`);
32
- }
33
- }
34
- if (candidate.diff !== undefined)
35
- receiptPayload(lines, "diff", candidate.diff);
36
- return lines;
37
- }
38
- function verificationLines(verification, columns) {
39
- if (verification.kind === "requirements")
40
- return standingGateLines([{ gate: "verified", requirements: verification.requirements }], columns);
41
- const lines = [];
42
- receiptRow(lines, " ", "verification", [{ text: verification.kind === "undeclared" ? "none declared" : "not run" }], columns);
43
- return lines;
44
- }
45
- function admittedCandidateLines(report, columns) {
46
- if (report.delivery === undefined)
47
- return [];
48
- const lines = [];
49
- receiptRow(lines, " ", "admitted candidate", [
50
- { text: report.delivery.relation },
51
- {
52
- text: `· content identity ${displayGitId(report.delivery.changeId, abbreviateGitIds([report.delivery.changeId]))}`,
53
- },
54
- ], columns);
55
- return lines;
56
- }
57
- function targetLines(report, columns, addressed, abbreviations) {
4
+ import { DEFAULT_CLI_COLUMNS, gitShortStat, safeText } from "./terminal.js";
5
+ import { contractIssueLines } from "./contract.js";
6
+ function targetLines(report, columns, ids, surface) {
58
7
  const target = report.target;
59
8
  const lines = [];
60
- if (target.kind === "not-observed") {
61
- receiptRow(lines, " ", "target", [{ text: "none" }], columns);
9
+ if (target === undefined)
62
10
  return lines;
63
- }
64
11
  if (target.kind === "placeable") {
12
+ const lag = target.behind === undefined ? "" : ` · behind ${target.behind === "unknown" ? "unknown" : String(target.behind)}`;
65
13
  receiptRow(lines, " ", "target", [
66
14
  { text: "placeable" },
67
15
  {
68
- text: `${target.ref.replace(/^refs\/heads\//u, "")} @ ${displayGitId(target.head, abbreviations)}${report.targetLag?.kind === "counted" && report.targetLag.behind > 0 ? ` · behind ${report.targetLag.behind}` : report.targetLag?.kind === "unknown" ? " · behind unknown" : ""}`,
16
+ text: `${target.ref.replace(/^refs\/heads\//u, "")} @ ${displayGitId(target.head, ids)}${lag}`,
69
17
  opaque: true,
70
18
  },
71
19
  ], columns);
72
- for (const checkout of target.checkouts) {
73
- if (checkout.kind === "followable")
74
- continue;
20
+ for (const checkout of target.checkouts ?? []) {
75
21
  receiptRow(lines, "!", "checkout cannot follow", [{ text: checkout.path, opaque: true }], columns);
76
22
  receiptPayload(lines, "reason", checkout.diagnostic);
77
23
  }
78
- return lines;
79
24
  }
80
- if (target.kind === "moved") {
25
+ else if (target.kind === "moved") {
81
26
  receiptRow(lines, "!", "target", [
82
27
  { text: "moved" },
83
28
  { text: target.ref, opaque: true },
84
29
  {
85
- text: `${displayGitId(target.expected, abbreviations)} -> ${target.observed === null ? "absent" : displayGitId(target.observed, abbreviations)}`,
30
+ text: `${displayGitId(target.expected, ids)} -> ${target.observed === null ? "absent" : displayGitId(target.observed, ids)}`,
86
31
  opaque: true,
87
32
  },
88
33
  ], columns);
89
- return lines;
90
34
  }
91
- if (target.kind === "failed") {
35
+ else if (target.kind === "failed") {
92
36
  receiptRow(lines, "!", "target", [{ text: "failed" }], columns);
93
37
  receiptPayload(lines, "reason", target.diagnostic);
94
- return lines;
95
38
  }
96
- receiptRow(lines, "!", "target", [{ text: "refused" }], columns);
97
- lines.push(...renderRefusalFacts(target.refusal, CHILD, columns, addressed));
39
+ else {
40
+ receiptRow(lines, "!", "target", [{ text: "refused" }], columns);
41
+ lines.push(...renderRefusalFacts(target.reason, " ", columns, report.contractId, surface));
42
+ }
43
+ return lines;
44
+ }
45
+ function previewGitIds(report) {
46
+ const ids = [report.candidate, report.integration, report.contentId];
47
+ if (report.previousContentId !== undefined)
48
+ ids.push(report.previousContentId);
49
+ if (report.target?.kind === "placeable")
50
+ ids.push(report.target.head);
51
+ if (report.target?.kind === "moved")
52
+ ids.push(report.target.expected, report.target.observed ?? "");
53
+ return abbreviateGitIds(ids);
54
+ }
55
+ function unmetLines(report, columns) {
56
+ const lines = [];
57
+ lines.push(...unmetRequirementLines(report.unmetGates ?? [], columns));
58
+ for (const prerequisite of report.unmetPrerequisites ?? [])
59
+ receiptRow(lines, "!", "prerequisite", [{ text: prerequisite.contractId, opaque: true }, { text: prerequisite.state }], columns);
98
60
  return lines;
99
61
  }
100
- function obligationLines(result, columns) {
101
- return [
102
- ...executionCleanupLines(effectCleanup(result.effects), columns, result.contract),
103
- ...executionStopLines(effectExecutionStops(result.effects), columns),
62
+ function scopeLines(report) {
63
+ const lines = [
64
+ ` ${safeText(gitShortStat({
65
+ filesChanged: report.scope.filesChanged ?? 0,
66
+ insertions: report.scope.insertions ?? 0,
67
+ deletions: report.scope.deletions ?? 0,
68
+ }))}`,
104
69
  ];
70
+ for (const path of report.scope.paths ?? [])
71
+ lines.push(` ${safeText(path)}`);
72
+ return lines;
105
73
  }
106
- export function renderDeliveryPreview(result, context) {
107
- const report = result.value;
74
+ /** A preview is an observation, not a successful mutation or a prediction of placement. */
75
+ export function renderDeliveryPreview(report, context) {
108
76
  const columns = context?.columns ?? DEFAULT_CLI_COLUMNS;
109
- const ids = report.candidate.kind === "ready"
110
- ? [
111
- report.candidate.identity.tenderSnapshot,
112
- report.candidate.identity.integration.snapshot,
113
- report.candidate.identity.integration.changeId,
114
- ]
115
- : [];
116
- if (report.target.kind === "placeable")
117
- ids.push(report.target.head);
118
- if (report.target.kind === "moved")
119
- ids.push(report.target.expected, report.target.observed ?? "");
120
- const abbreviations = abbreviateGitIds(ids);
121
- return [
122
- ...titleLines("✓", "deliver --dry-run", result.contract, columns),
123
- ...candidateLines(report, columns, result.contract, abbreviations),
124
- ...admittedCandidateLines(report, columns),
125
- ...verificationLines(report.verification, columns),
126
- ...targetLines(report, columns, result.contract, abbreviations),
127
- ...obligationLines(result, columns),
128
- ].join("\n");
77
+ const lines = titleLines(report.kind === "ready" ? "✓" : "!", "deliver --dry-run", report.contractId, columns);
78
+ if (report.kind === "blocked") {
79
+ receiptRow(lines, "!", "candidate", [{ text: "blocked" }], columns);
80
+ lines.push(...renderRefusalFacts(report.reason, " ", columns, report.contractId, context?.surface), ...contractIssueLines(report, columns));
81
+ return lines.join("\n");
82
+ }
83
+ const ids = previewGitIds(report);
84
+ receiptRow(lines, " ", "candidate", [{ text: "prepared" }, { text: displayGitId(report.candidate, ids), opaque: true }], columns);
85
+ receiptRow(lines, " ", "integration result", [{ text: displayGitId(report.integration, ids), opaque: true }], columns);
86
+ if (!/^0{40}$/u.test(report.contentId))
87
+ receiptRow(lines, " ", "content identity", [{ text: displayGitId(report.contentId, ids), opaque: true }], columns);
88
+ lines.push(...unmetLines(report, columns), ...scopeLines(report));
89
+ if (report.diff?.kind === "present") {
90
+ if (report.diff.text.length === 0)
91
+ receiptRow(lines, " ", "diff", [{ text: "empty" }], columns);
92
+ else
93
+ receiptPayload(lines, "diff", report.diff.text);
94
+ }
95
+ else if (report.diff?.kind === "unavailable")
96
+ receiptRow(lines, "!", "diff", [{ text: "unavailable" }], columns);
97
+ if (report.previousContentId !== undefined)
98
+ receiptRow(lines, " ", "admitted candidate", [{ text: `previous content ${displayGitId(report.previousContentId, ids)}` }], columns);
99
+ lines.push(...targetLines(report, columns, ids, context?.surface), ...contractIssueLines(report, columns));
100
+ return lines.join("\n");
129
101
  }
@@ -1,16 +1,18 @@
1
- import type { AkumaKanshiRow, AkumaKanshiWorld, KanshiReport, Section } from "../../kanshi/index.js";
1
+ import type { AkumaKanshiRow, AkumaKanshiWorld, KanshiReport, BoardSection } from "../../kanshi/report.js";
2
2
  import { type TextRenderContext } from "./terminal.js";
3
3
  declare const NARROW_COLUMNS = 72;
4
4
  declare function akumaLabel(row: Pick<AkumaKanshiRow, "aliases">, aliasesUnavailable: boolean): string;
5
- declare function endpointFact(id: string, observed: string | undefined): string;
5
+ declare function associationFact(contract: NonNullable<AkumaKanshiRow["contract"]>): string;
6
6
  /**
7
7
  * One Akuma board section. The World board omits an empty section because its other
8
- * sections already say what the World holds; a category board states that emptiness
9
- * itself, since it is the whole answer. A failed Alias observation belongs to the
8
+ * sections already say what the World holds; a standalone catalogue states its
9
+ * own emptiness. A failed Alias observation belongs to the
10
10
  * section, so an empty roster still states its emptiness rather than dropping that
11
11
  * evidence.
12
12
  */
13
- declare function renderAkumaBoard(section: Section<AkumaKanshiWorld>, observedAt: string, context: TextRenderContext, emptyRows: readonly string[]): readonly string[];
13
+ declare function renderAkumaBoard(section: BoardSection<AkumaKanshiWorld>, observedAt: string, context: TextRenderContext & Readonly<{
14
+ caller?: string;
15
+ }>, emptyRows?: readonly string[]): readonly string[];
14
16
  declare function renderAkuma(report: KanshiReport, context: TextRenderContext): readonly string[];
15
17
  declare function formatAge(source: string | null | undefined, observedAt: string): string;
16
- export { akumaLabel, endpointFact, formatAge, NARROW_COLUMNS, renderAkuma, renderAkumaBoard };
18
+ export { akumaLabel, associationFact, formatAge, NARROW_COLUMNS, renderAkuma, renderAkumaBoard };