@astrosheep/keiyaku 4.6.30 → 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 (398) 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 +12 -12
  4. package/build/plugins/claude/skills/keiyaku-akuma/SKILL.md +16 -16
  5. package/build/plugins/claude/skills/keiyaku-akuma/references/automation.md +14 -14
  6. package/build/plugins/claude/skills/keiyaku-babysit/SKILL.md +10 -10
  7. package/build/plugins/claude/skills/keiyaku-bind/SKILL.md +15 -15
  8. package/build/plugins/claude/skills/keiyaku-debt/SKILL.md +16 -16
  9. package/build/plugins/claude/skills/keiyaku-workflow/SKILL.md +21 -21
  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 +16 -16
  13. package/build/plugins/codex/skills/keiyaku-akuma/references/automation.md +14 -14
  14. package/build/plugins/codex/skills/keiyaku-babysit/SKILL.md +10 -10
  15. package/build/plugins/codex/skills/keiyaku-bind/SKILL.md +15 -15
  16. package/build/plugins/codex/skills/keiyaku-debt/SKILL.md +16 -16
  17. package/build/plugins/codex/skills/keiyaku-workflow/SKILL.md +21 -21
  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 +16 -16
  21. package/build/plugins/opencode/skills/keiyaku-akuma/references/automation.md +14 -14
  22. package/build/plugins/opencode/skills/keiyaku-babysit/SKILL.md +10 -10
  23. package/build/plugins/opencode/skills/keiyaku-bind/SKILL.md +15 -15
  24. package/build/plugins/opencode/skills/keiyaku-debt/SKILL.md +16 -16
  25. package/build/plugins/opencode/skills/keiyaku-workflow/SKILL.md +21 -21
  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 +12 -12
  29. package/build/skills/keiyaku-akuma/SKILL.md +16 -16
  30. package/build/skills/keiyaku-akuma/references/automation.md +14 -14
  31. package/build/skills/keiyaku-babysit/SKILL.md +10 -10
  32. package/build/skills/keiyaku-bind/SKILL.md +15 -15
  33. package/build/skills/keiyaku-debt/SKILL.md +16 -16
  34. package/build/skills/keiyaku-workflow/SKILL.md +21 -21
  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 +157 -149
  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 +4 -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 -221
  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 +19 -35
  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/private-state-seat.d.ts +2 -2
  213. package/build/src/git/private-state-seat.js +2 -1
  214. package/build/src/git/reconcile.d.ts +17 -79
  215. package/build/src/git/reconcile.js +37 -52
  216. package/build/src/git/scratch.d.ts +3 -3
  217. package/build/src/git/scratch.js +4 -1
  218. package/build/src/git/target-placement.d.ts +23 -31
  219. package/build/src/git/target-placement.js +42 -27
  220. package/build/src/git/target.d.ts +2 -2
  221. package/build/src/git/target.js +2 -1
  222. package/build/src/git/tender.d.ts +7 -39
  223. package/build/src/git/tender.js +21 -54
  224. package/build/src/git/terminal-reconcile.js +15 -18
  225. package/build/src/git/terminal-seal.d.ts +2 -4
  226. package/build/src/git/terminal-seal.js +7 -33
  227. package/build/src/git/workspace.d.ts +65 -41
  228. package/build/src/git/workspace.js +45 -14
  229. package/build/src/identity/selector.d.ts +2 -0
  230. package/build/src/identity/selector.js +13 -3
  231. package/build/src/index.d.ts +48 -54
  232. package/build/src/index.js +31 -43
  233. package/build/src/kanshi/counts.d.ts +42 -8
  234. package/build/src/kanshi/counts.js +13 -2
  235. package/build/src/kanshi/index.d.ts +5 -5
  236. package/build/src/kanshi/index.js +4 -3
  237. package/build/src/kanshi/read.d.ts +489 -6
  238. package/build/src/kanshi/read.js +334 -483
  239. package/build/src/kanshi/report.d.ts +2504 -103
  240. package/build/src/kanshi/report.js +165 -1
  241. package/build/src/kanshi/select.d.ts +0 -8
  242. package/build/src/kanshi/select.js +20 -59
  243. package/build/src/library/address.d.ts +8 -8
  244. package/build/src/library/address.js +7 -7
  245. package/build/src/library/akuma-creation.d.ts +690 -84
  246. package/build/src/library/akuma-creation.js +202 -142
  247. package/build/src/library/akuma-retention.d.ts +2 -2
  248. package/build/src/library/akuma-retention.js +2 -2
  249. package/build/src/library/akumas.d.ts +10 -6
  250. package/build/src/library/akumas.js +24 -7
  251. package/build/src/library/bind.d.ts +28 -54
  252. package/build/src/library/bind.js +6 -4
  253. package/build/src/library/continuation.d.ts +197 -479
  254. package/build/src/library/continuation.js +40 -23
  255. package/build/src/library/contract-address.d.ts +6 -5
  256. package/build/src/library/contract-address.js +5 -7
  257. package/build/src/library/contract-composition.d.ts +18 -12
  258. package/build/src/library/contract-composition.js +55 -47
  259. package/build/src/library/contract-creation.d.ts +3 -2
  260. package/build/src/library/contract-creation.js +38 -32
  261. package/build/src/library/contract-execution.js +77 -38
  262. package/build/src/library/contract-outcomes.d.ts +1877 -27
  263. package/build/src/library/contract-outcomes.js +93 -10
  264. package/build/src/library/contract-settings.d.ts +2 -2
  265. package/build/src/library/contract-settings.js +18 -14
  266. package/build/src/library/contract-types.d.ts +238 -61
  267. package/build/src/library/contract-types.js +131 -1
  268. package/build/src/library/contract-wait.d.ts +38 -17
  269. package/build/src/library/contract-wait.js +40 -10
  270. package/build/src/library/delivery.d.ts +588 -36
  271. package/build/src/library/delivery.js +35 -27
  272. package/build/src/library/input.d.ts +1 -1
  273. package/build/src/library/input.js +1 -2
  274. package/build/src/library/invocation.d.ts +11 -7
  275. package/build/src/library/invocation.js +42 -51
  276. package/build/src/library/kei.d.ts +48 -0
  277. package/build/src/library/kei.js +256 -0
  278. package/build/src/library/keiyaku-attribution.d.ts +11 -0
  279. package/build/src/{cli/delivery-identity.js → library/keiyaku-attribution.js} +12 -1
  280. package/build/src/library/keiyaku-classify.d.ts +11 -0
  281. package/build/src/library/keiyaku-classify.js +146 -0
  282. package/build/src/library/keiyaku-coordinates.d.ts +31 -0
  283. package/build/src/library/keiyaku-coordinates.js +103 -0
  284. package/build/src/library/keiyaku-debt.d.ts +142 -0
  285. package/build/src/library/keiyaku-debt.js +188 -0
  286. package/build/src/library/keiyaku-identity.d.ts +58 -0
  287. package/build/src/library/keiyaku-identity.js +176 -0
  288. package/build/src/library/keiyaku-policy.d.ts +27 -0
  289. package/build/src/library/keiyaku-policy.js +44 -0
  290. package/build/src/library/keiyaku-status.d.ts +1487 -0
  291. package/build/src/library/keiyaku-status.js +92 -0
  292. package/build/src/library/keiyaku-verbs.d.ts +6774 -0
  293. package/build/src/library/keiyaku-verbs.js +458 -0
  294. package/build/src/library/keiyaku.d.ts +871 -38
  295. package/build/src/library/keiyaku.js +677 -127
  296. package/build/src/library/nuke.d.ts +22 -0
  297. package/build/src/library/nuke.js +4 -1
  298. package/build/src/library/outcome.d.ts +706 -692
  299. package/build/src/library/outcome.js +582 -167
  300. package/build/src/library/reconcile.d.ts +464 -116
  301. package/build/src/library/reconcile.js +174 -102
  302. package/build/src/library/refusal.d.ts +113 -577
  303. package/build/src/library/refusal.js +64 -51
  304. package/build/src/library/region.d.ts +5 -24
  305. package/build/src/library/region.js +6 -21
  306. package/build/src/library/selection.d.ts +181 -32
  307. package/build/src/library/selection.js +99 -64
  308. package/build/src/mcp/adapter.d.ts +11 -0
  309. package/build/src/mcp/adapter.js +106 -0
  310. package/build/src/mcp/help.d.ts +1 -0
  311. package/build/src/mcp/help.js +26 -0
  312. package/build/src/mcp/index.d.ts +2 -0
  313. package/build/src/mcp/index.js +37 -0
  314. package/build/src/plugin/public.d.ts +1 -1
  315. package/build/src/plugin/runtime.js +17 -14
  316. package/build/src/protocol/arc.d.ts +4 -1
  317. package/build/src/protocol/arc.js +7 -1
  318. package/build/src/protocol/attempt.d.ts +2 -3
  319. package/build/src/protocol/attempt.js +1 -10
  320. package/build/src/protocol/bind.d.ts +6 -7
  321. package/build/src/protocol/bind.js +9 -5
  322. package/build/src/protocol/completion.d.ts +448 -12
  323. package/build/src/protocol/completion.js +164 -26
  324. package/build/src/protocol/deliver.d.ts +26 -24
  325. package/build/src/protocol/deliver.js +24 -52
  326. package/build/src/protocol/delivery-preview.d.ts +97 -247
  327. package/build/src/protocol/delivery-preview.js +132 -128
  328. package/build/src/protocol/execution-observation.d.ts +146 -123
  329. package/build/src/protocol/execution-observation.js +9 -6
  330. package/build/src/protocol/intent.d.ts +9 -48
  331. package/build/src/protocol/intent.js +32 -46
  332. package/build/src/protocol/operations.d.ts +207 -505
  333. package/build/src/protocol/operations.js +81 -134
  334. package/build/src/protocol/placement.d.ts +0 -1
  335. package/build/src/protocol/placement.js +5 -2
  336. package/build/src/protocol/progress.d.ts +7 -97
  337. package/build/src/protocol/progress.js +7 -55
  338. package/build/src/protocol/read/observation.d.ts +13 -6
  339. package/build/src/protocol/read/observation.js +10 -9
  340. package/build/src/protocol/read/status.d.ts +464 -93
  341. package/build/src/protocol/read/status.js +372 -85
  342. package/build/src/protocol/reconcile.d.ts +2 -0
  343. package/build/src/protocol/reconcile.js +12 -11
  344. package/build/src/protocol/reintegrate.d.ts +0 -1
  345. package/build/src/protocol/reintegrate.js +4 -4
  346. package/build/src/protocol/result-leaves.d.ts +528 -0
  347. package/build/src/protocol/result-leaves.js +195 -0
  348. package/build/src/protocol/result-reasons.d.ts +129 -0
  349. package/build/src/protocol/result-reasons.js +87 -0
  350. package/build/src/protocol/review.d.ts +14 -11
  351. package/build/src/protocol/review.js +30 -14
  352. package/build/src/protocol/run.d.ts +4 -4
  353. package/build/src/protocol/run.js +4 -1
  354. package/build/src/protocol/verify.d.ts +359 -30
  355. package/build/src/protocol/verify.js +118 -28
  356. package/build/src/region.d.ts +26 -0
  357. package/build/src/region.js +28 -0
  358. package/build/src/runtime/proc/diagnostic.d.ts +11 -0
  359. package/build/src/runtime/proc/diagnostic.js +20 -0
  360. package/build/src/runtime/proc/windows-launch.exe +0 -0
  361. package/build/src/settings.d.ts +126 -32
  362. package/build/src/settings.js +107 -34
  363. package/build/src/settlement/settle.d.ts +29 -12
  364. package/build/src/settlement/settle.js +22 -15
  365. package/build/src/verification/declaration.d.ts +1 -3
  366. package/build/src/verification/declaration.js +2 -5
  367. package/build/src/verification/execution.d.ts +7 -19
  368. package/build/src/verification/execution.js +37 -16
  369. package/build/src/verification/observation.d.ts +13 -13
  370. package/build/src/verification/observation.js +9 -7
  371. package/build/src/world.d.ts +8 -0
  372. package/build/src/world.js +7 -0
  373. package/package.json +6 -5
  374. package/plugins/paseo/plugin/server/keiyaku.ts +13 -46
  375. package/plugins/paseo/plugin/server/message.ts +8 -30
  376. package/plugins/paseo/plugin/server/mirror.ts +16 -20
  377. package/plugins/paseo/plugin/server/provider.ts +1 -1
  378. package/plugins/paseo/plugin/server/sdk.ts +14 -6
  379. package/plugins/pi/README.md +5 -5
  380. package/plugins/pi/akuma-tools.ts +17 -23
  381. package/skills/keiyaku/SKILL.md +12 -12
  382. package/skills/keiyaku-akuma/SKILL.md +16 -16
  383. package/skills/keiyaku-akuma/references/automation.md +14 -14
  384. package/skills/keiyaku-babysit/SKILL.md +10 -10
  385. package/skills/keiyaku-bind/SKILL.md +15 -15
  386. package/skills/keiyaku-debt/SKILL.md +16 -16
  387. package/skills/keiyaku-workflow/SKILL.md +21 -21
  388. package/build/src/cli/actor.d.ts +0 -10
  389. package/build/src/cli/actor.js +0 -24
  390. package/build/src/cli/akuma-caller.d.ts +0 -3
  391. package/build/src/cli/akuma-caller.js +0 -31
  392. package/build/src/cli/delivery-identity.d.ts +0 -3
  393. package/build/src/cli/render/effects.d.ts +0 -26
  394. package/build/src/cli/render/effects.js +0 -41
  395. package/build/src/cli/selectors.d.ts +0 -10
  396. package/build/src/cli/selectors.js +0 -42
  397. package/build/src/markdown/diff.d.ts +0 -1
  398. package/build/src/markdown/diff.js +0 -4
@@ -1,3 +1,4 @@
1
+ import { z } from "zod";
1
2
  import type { AkumaCaller } from "./caller.js";
2
3
  import type { Settings } from "../settings.js";
3
4
  import type { WorldRoot } from "../world.js";
@@ -5,14 +6,359 @@ import type { AkumaStreamSnapshot } from "./akuma-stream.js";
5
6
  import { type InterruptReceipt } from "./akuma-owner.js";
6
7
  import { type AkumaStatus } from "./akuma.js";
7
8
  import { type KillEvidence } from "./heart/index.js";
8
- import type { ReportFact } from "./heart/facts.js";
9
9
  import { type AkumaHostOptions } from "../body-host.js";
10
10
  export type { AkumaHostOptions } from "../body-host.js";
11
11
  import type { BodyLauncher } from "./body-launch.js";
12
- import { type AkuId } from "./identity.js";
12
+ import { type AkumaId } from "./identity.js";
13
13
  import type { ActivityHistory } from "./projection.js";
14
14
  import { type Schema, type StandardSchemaV1 } from "./schema.js";
15
15
  import { type AkumaAskResult, type AkumaTellResult } from "./selection-observation.js";
16
+ export declare const akumaIdleResultSchema: z.ZodReadonly<z.ZodObject<{
17
+ reason: z.ZodEnum<{
18
+ completed: "completed";
19
+ deadline: "deadline";
20
+ }>;
21
+ status: z.ZodReadonly<z.ZodObject<{
22
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<AkumaId, string>>;
23
+ birth: z.ZodReadonly<z.ZodObject<{
24
+ origin: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
25
+ kind: z.ZodLiteral<"direct">;
26
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
27
+ kind: z.ZodLiteral<"fork">;
28
+ parent: z.ZodPipe<z.ZodString, z.ZodTransform<AkumaId, string>>;
29
+ at: z.ZodString;
30
+ }, z.core.$strict>>]>;
31
+ caller: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
32
+ kind: z.ZodLiteral<"akuma">;
33
+ world: z.ZodPipe<z.ZodString, z.ZodCustom<WorldRoot, WorldRoot>>;
34
+ akumaId: z.ZodPipe<z.ZodString, z.ZodTransform<AkumaId, string>>;
35
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
36
+ kind: z.ZodLiteral<"external">;
37
+ integration: z.ZodString;
38
+ id: z.ZodString;
39
+ }, z.core.$strict>>]>, z.ZodReadonly<z.ZodObject<{
40
+ kind: z.ZodLiteral<"unknown">;
41
+ }, z.core.$strict>>]>;
42
+ }, z.core.$strict>>;
43
+ life: z.ZodEnum<{
44
+ killed: "killed";
45
+ hung: "hung";
46
+ untidy: "untidy";
47
+ running: "running";
48
+ asleep: "asleep";
49
+ stranded: "stranded";
50
+ }>;
51
+ cwd: z.ZodExactOptional<z.ZodString>;
52
+ provider: z.ZodExactOptional<z.ZodString>;
53
+ model: z.ZodExactOptional<z.ZodString>;
54
+ lastActivityAt: z.ZodExactOptional<z.ZodString>;
55
+ timeline: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
56
+ reportedChanges: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
57
+ path: z.ZodString;
58
+ diffstat: z.ZodExactOptional<z.ZodReadonly<z.ZodObject<{
59
+ added: z.ZodNumber;
60
+ removed: z.ZodNumber;
61
+ }, z.core.$strict>>>;
62
+ }, z.core.$strict>>>>;
63
+ reportedChangesOmitted: z.ZodNumber;
64
+ reportedChangesOutside: z.ZodExactOptional<z.ZodNumber>;
65
+ kind: z.ZodLiteral<"unborn">;
66
+ entries: z.ZodReadonly<z.ZodTuple<[], null>>;
67
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
68
+ reportedChanges: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
69
+ path: z.ZodString;
70
+ diffstat: z.ZodExactOptional<z.ZodReadonly<z.ZodObject<{
71
+ added: z.ZodNumber;
72
+ removed: z.ZodNumber;
73
+ }, z.core.$strict>>>;
74
+ }, z.core.$strict>>>>;
75
+ reportedChangesOmitted: z.ZodNumber;
76
+ reportedChangesOutside: z.ZodExactOptional<z.ZodNumber>;
77
+ kind: z.ZodLiteral<"open">;
78
+ turn: z.ZodReadonly<z.ZodObject<{
79
+ kind: z.ZodLiteral<"turn">;
80
+ sequence: z.ZodNumber;
81
+ bodySequence: z.ZodNumber;
82
+ at: z.ZodString;
83
+ }, z.core.$strict>>;
84
+ entries: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
85
+ kind: z.ZodLiteral<"gap">;
86
+ count: z.ZodNumber;
87
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
88
+ kind: z.ZodLiteral<"row">;
89
+ row: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
90
+ kind: z.ZodLiteral<"report">;
91
+ sequence: z.ZodNumber;
92
+ bodySequence: z.ZodNumber;
93
+ turnSequence: z.ZodNumber;
94
+ text: z.ZodString;
95
+ at: z.ZodString;
96
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
97
+ kind: z.ZodLiteral<"call">;
98
+ sequence: z.ZodNumber;
99
+ turnSequence: z.ZodNumber;
100
+ at: z.ZodString;
101
+ text: z.ZodString;
102
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
103
+ kind: z.ZodLiteral<"thought" | "note" | "said">;
104
+ sequence: z.ZodNumber;
105
+ turnSequence: z.ZodNumber;
106
+ at: z.ZodString;
107
+ text: z.ZodString;
108
+ truncated: z.ZodExactOptional<z.ZodLiteral<true>>;
109
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
110
+ kind: z.ZodLiteral<"thought" | "note" | "said">;
111
+ sequence: z.ZodNumber;
112
+ turnSequence: z.ZodNumber;
113
+ at: z.ZodString;
114
+ text: z.ZodString;
115
+ truncated: z.ZodExactOptional<z.ZodLiteral<true>>;
116
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
117
+ kind: z.ZodLiteral<"thought" | "note" | "said">;
118
+ sequence: z.ZodNumber;
119
+ turnSequence: z.ZodNumber;
120
+ at: z.ZodString;
121
+ text: z.ZodString;
122
+ truncated: z.ZodExactOptional<z.ZodLiteral<true>>;
123
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
124
+ kind: z.ZodLiteral<"tell">;
125
+ sequence: z.ZodNumber;
126
+ at: z.ZodString;
127
+ tellId: z.ZodString;
128
+ text: z.ZodString;
129
+ state: z.ZodEnum<{
130
+ pending: "pending";
131
+ told: "told";
132
+ }>;
133
+ deliveries: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
134
+ deliveredAt: z.ZodString;
135
+ route: z.ZodEnum<{
136
+ launch: "launch";
137
+ live: "live";
138
+ }>;
139
+ turnSequence: z.ZodNumber;
140
+ }, z.core.$strict>>>>;
141
+ }, z.core.$strict>>]>, z.ZodReadonly<z.ZodObject<{
142
+ kind: z.ZodLiteral<"tool">;
143
+ sequence: z.ZodNumber;
144
+ turnSequence: z.ZodNumber;
145
+ at: z.ZodString;
146
+ durationMs: z.ZodExactOptional<z.ZodNumber>;
147
+ name: z.ZodString;
148
+ call: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
149
+ kind: z.ZodLiteral<"run">;
150
+ command: z.ZodString;
151
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
152
+ kind: z.ZodLiteral<"read">;
153
+ path: z.ZodString;
154
+ offset: z.ZodExactOptional<z.ZodNumber>;
155
+ limit: z.ZodExactOptional<z.ZodNumber>;
156
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
157
+ kind: z.ZodLiteral<"search">;
158
+ query: z.ZodString;
159
+ scope: z.ZodExactOptional<z.ZodEnum<{
160
+ content: "content";
161
+ files: "files";
162
+ web: "web";
163
+ }>>;
164
+ path: z.ZodExactOptional<z.ZodString>;
165
+ glob: z.ZodExactOptional<z.ZodString>;
166
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
167
+ kind: z.ZodLiteral<"fileChange">;
168
+ changes: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
169
+ op: z.ZodEnum<{
170
+ add: "add";
171
+ update: "update";
172
+ delete: "delete";
173
+ unspecified: "unspecified";
174
+ }>;
175
+ path: z.ZodString;
176
+ diffstat: z.ZodExactOptional<z.ZodReadonly<z.ZodObject<{
177
+ added: z.ZodNumber;
178
+ removed: z.ZodNumber;
179
+ }, z.core.$strict>>>;
180
+ patch: z.ZodExactOptional<z.ZodString>;
181
+ }, z.core.$strict>>>>;
182
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
183
+ kind: z.ZodLiteral<"other">;
184
+ input: z.ZodExactOptional<z.ZodReadonly<z.ZodObject<{
185
+ json: z.ZodString;
186
+ truncated: z.ZodExactOptional<z.ZodLiteral<true>>;
187
+ }, z.core.$strict>>>;
188
+ }, z.core.$strict>>]>;
189
+ toolId: z.ZodString;
190
+ truncated: z.ZodExactOptional<z.ZodLiteral<true>>;
191
+ state: z.ZodUnion<readonly [z.ZodLiteral<"active">, z.ZodReadonly<z.ZodObject<{
192
+ status: z.ZodEnum<{
193
+ error: "error";
194
+ ok: "ok";
195
+ }>;
196
+ message: z.ZodExactOptional<z.ZodString>;
197
+ output: z.ZodExactOptional<z.ZodString>;
198
+ exitCode: z.ZodExactOptional<z.ZodNumber>;
199
+ }, z.core.$strict>>]>;
200
+ }, z.core.$strict>>]>;
201
+ }, z.core.$strict>>]>>>;
202
+ openingSequence: z.ZodExactOptional<z.ZodNumber>;
203
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
204
+ reportedChanges: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
205
+ path: z.ZodString;
206
+ diffstat: z.ZodExactOptional<z.ZodReadonly<z.ZodObject<{
207
+ added: z.ZodNumber;
208
+ removed: z.ZodNumber;
209
+ }, z.core.$strict>>>;
210
+ }, z.core.$strict>>>>;
211
+ reportedChangesOmitted: z.ZodNumber;
212
+ reportedChangesOutside: z.ZodExactOptional<z.ZodNumber>;
213
+ kind: z.ZodLiteral<"idle">;
214
+ outcome: z.ZodExactOptional<z.ZodReadonly<z.ZodObject<{
215
+ kind: z.ZodLiteral<"outcome">;
216
+ sequence: z.ZodNumber;
217
+ turnSequence: z.ZodNumber;
218
+ at: z.ZodString;
219
+ outcome: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
220
+ kind: z.ZodLiteral<"answered">;
221
+ answer: z.ZodString;
222
+ foldedSaidSequence: z.ZodExactOptional<z.ZodNumber>;
223
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
224
+ kind: z.ZodLiteral<"failed">;
225
+ diagnostic: z.ZodString;
226
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
227
+ kind: z.ZodLiteral<"canceled">;
228
+ }, z.core.$strict>>]>;
229
+ }, z.core.$strict>>>;
230
+ entries: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
231
+ kind: z.ZodLiteral<"gap">;
232
+ count: z.ZodNumber;
233
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
234
+ kind: z.ZodLiteral<"row">;
235
+ row: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
236
+ kind: z.ZodLiteral<"report">;
237
+ sequence: z.ZodNumber;
238
+ bodySequence: z.ZodNumber;
239
+ turnSequence: z.ZodNumber;
240
+ text: z.ZodString;
241
+ at: z.ZodString;
242
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
243
+ kind: z.ZodLiteral<"call">;
244
+ sequence: z.ZodNumber;
245
+ turnSequence: z.ZodNumber;
246
+ at: z.ZodString;
247
+ text: z.ZodString;
248
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
249
+ kind: z.ZodLiteral<"thought" | "note" | "said">;
250
+ sequence: z.ZodNumber;
251
+ turnSequence: z.ZodNumber;
252
+ at: z.ZodString;
253
+ text: z.ZodString;
254
+ truncated: z.ZodExactOptional<z.ZodLiteral<true>>;
255
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
256
+ kind: z.ZodLiteral<"thought" | "note" | "said">;
257
+ sequence: z.ZodNumber;
258
+ turnSequence: z.ZodNumber;
259
+ at: z.ZodString;
260
+ text: z.ZodString;
261
+ truncated: z.ZodExactOptional<z.ZodLiteral<true>>;
262
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
263
+ kind: z.ZodLiteral<"thought" | "note" | "said">;
264
+ sequence: z.ZodNumber;
265
+ turnSequence: z.ZodNumber;
266
+ at: z.ZodString;
267
+ text: z.ZodString;
268
+ truncated: z.ZodExactOptional<z.ZodLiteral<true>>;
269
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
270
+ kind: z.ZodLiteral<"tell">;
271
+ sequence: z.ZodNumber;
272
+ at: z.ZodString;
273
+ tellId: z.ZodString;
274
+ text: z.ZodString;
275
+ state: z.ZodEnum<{
276
+ pending: "pending";
277
+ told: "told";
278
+ }>;
279
+ deliveries: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
280
+ deliveredAt: z.ZodString;
281
+ route: z.ZodEnum<{
282
+ launch: "launch";
283
+ live: "live";
284
+ }>;
285
+ turnSequence: z.ZodNumber;
286
+ }, z.core.$strict>>>>;
287
+ }, z.core.$strict>>]>, z.ZodReadonly<z.ZodObject<{
288
+ kind: z.ZodLiteral<"tool">;
289
+ sequence: z.ZodNumber;
290
+ turnSequence: z.ZodNumber;
291
+ at: z.ZodString;
292
+ durationMs: z.ZodExactOptional<z.ZodNumber>;
293
+ name: z.ZodString;
294
+ call: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
295
+ kind: z.ZodLiteral<"run">;
296
+ command: z.ZodString;
297
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
298
+ kind: z.ZodLiteral<"read">;
299
+ path: z.ZodString;
300
+ offset: z.ZodExactOptional<z.ZodNumber>;
301
+ limit: z.ZodExactOptional<z.ZodNumber>;
302
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
303
+ kind: z.ZodLiteral<"search">;
304
+ query: z.ZodString;
305
+ scope: z.ZodExactOptional<z.ZodEnum<{
306
+ content: "content";
307
+ files: "files";
308
+ web: "web";
309
+ }>>;
310
+ path: z.ZodExactOptional<z.ZodString>;
311
+ glob: z.ZodExactOptional<z.ZodString>;
312
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
313
+ kind: z.ZodLiteral<"fileChange">;
314
+ changes: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
315
+ op: z.ZodEnum<{
316
+ add: "add";
317
+ update: "update";
318
+ delete: "delete";
319
+ unspecified: "unspecified";
320
+ }>;
321
+ path: z.ZodString;
322
+ diffstat: z.ZodExactOptional<z.ZodReadonly<z.ZodObject<{
323
+ added: z.ZodNumber;
324
+ removed: z.ZodNumber;
325
+ }, z.core.$strict>>>;
326
+ patch: z.ZodExactOptional<z.ZodString>;
327
+ }, z.core.$strict>>>>;
328
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
329
+ kind: z.ZodLiteral<"other">;
330
+ input: z.ZodExactOptional<z.ZodReadonly<z.ZodObject<{
331
+ json: z.ZodString;
332
+ truncated: z.ZodExactOptional<z.ZodLiteral<true>>;
333
+ }, z.core.$strict>>>;
334
+ }, z.core.$strict>>]>;
335
+ state: z.ZodReadonly<z.ZodObject<{
336
+ status: z.ZodEnum<{
337
+ error: "error";
338
+ ok: "ok";
339
+ }>;
340
+ message: z.ZodExactOptional<z.ZodString>;
341
+ output: z.ZodExactOptional<z.ZodString>;
342
+ exitCode: z.ZodExactOptional<z.ZodNumber>;
343
+ }, z.core.$strict>>;
344
+ toolId: z.ZodString;
345
+ truncated: z.ZodExactOptional<z.ZodLiteral<true>>;
346
+ }, z.core.$strict>>]>;
347
+ }, z.core.$strict>>]>>>;
348
+ }, z.core.$strict>>]>;
349
+ strandedReason: z.ZodExactOptional<z.ZodLiteral<"resume-unsupported">>;
350
+ }, z.core.$strict>>;
351
+ }, z.core.$strict>>;
352
+ export declare const akumaReportResultSchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
353
+ kind: z.ZodLiteral<"recorded">;
354
+ reportId: z.ZodString;
355
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
356
+ kind: z.ZodLiteral<"refused">;
357
+ reason: z.ZodEnum<{
358
+ "not-born": "not-born";
359
+ "not-executing": "not-executing";
360
+ }>;
361
+ }, z.core.$strict>>]>;
16
362
  export type AkumaIdleOptions = Readonly<{
17
363
  timeoutMs?: number;
18
364
  signal?: AbortSignal;
@@ -42,16 +388,13 @@ export type AkumaBirthInput = Readonly<{
42
388
  initiator?: string;
43
389
  host?: AkumaHostOptions;
44
390
  }>;
45
- export type AkumaReportOptions = AkumaSignalOptions & Readonly<{
46
- bodySequence: number;
47
- turnSequence: number;
48
- }>;
391
+ export type AkumaReportOptions = AkumaSignalOptions;
49
392
  export type AkumaReportResult = Readonly<{
50
393
  kind: "recorded";
51
- report: ReportFact;
394
+ reportId: string;
52
395
  }> | Readonly<{
53
396
  kind: "refused";
54
- reason: "not-born" | "not-current-execution";
397
+ reason: "not-born" | "not-executing";
55
398
  }>;
56
399
  export type AkumaTellOptions = AkumaSignalOptions & Readonly<{
57
400
  interrupt?: boolean;
@@ -63,18 +406,18 @@ export type AkumaAskOptions<T> = AkumaTellOptions & Readonly<{
63
406
  }>;
64
407
  export type { AkumaAskResult, AkumaTellResult, InterruptReceipt, KillEvidence };
65
408
  declare class AkumaHandle {
66
- readonly id: AkuId;
409
+ readonly id: AkumaId;
67
410
  private readonly root;
68
411
  private readonly reportDiagnostic;
69
412
  private readonly spawn;
70
- constructor(id: AkuId, root: WorldRoot, reportDiagnostic: (message: string) => void, spawn: BodyLauncher);
413
+ constructor(id: AkumaId, root: WorldRoot, reportDiagnostic: (message: string) => void, spawn: BodyLauncher);
71
414
  private owner;
72
415
  tell(text: string, options?: AkumaTellOptions): Promise<AkumaTellResult>;
73
416
  ask(text: string, options?: AkumaAskOptions<string>): Promise<AkumaAskResult<string>>;
74
417
  ask<T>(text: string, options: AkumaAskOptions<T> & Readonly<{
75
418
  schema: Schema<T> | StandardSchemaV1<T>;
76
419
  }>): Promise<AkumaAskResult<T>>;
77
- report(text: string, options: AkumaReportOptions): Promise<AkumaReportResult>;
420
+ report(text: string, options?: AkumaReportOptions): Promise<AkumaReportResult>;
78
421
  status(): Promise<AkumaStatus>;
79
422
  idle(options?: AkumaIdleOptions): Promise<AkumaIdleResult>;
80
423
  history(options?: AkumaHistoryOptions): Promise<ActivityHistory>;
@@ -83,7 +426,7 @@ declare class AkumaHandle {
83
426
  }
84
427
  export declare class Akuma extends AkumaHandle {
85
428
  private constructor();
86
- static birth(archetype: string, input: AkumaBirthInput): Promise<Akuma>;
429
+ static birth(akumaName: string, input: AkumaBirthInput): Promise<Akuma>;
87
430
  static select(root: WorldRoot, selector: string, host?: AkumaHostOptions): Akuma;
88
431
  }
89
432
  /** Internal product composition; hosting is captured independently of public operation inputs. */
@@ -1,3 +1,5 @@
1
+ import { z } from "zod";
2
+ import { akumaStatusSchema } from "./akuma.js";
1
3
  import { emitPluginSignal, outcomePluginObserver, stderrPluginDiagnostic, withAkumaWaitDeferrals, } from "../plugin/akuma-signals.js";
2
4
  import { abortable } from "./abort.js";
3
5
  import { admitAkumaCall } from "./akuma-call.js";
@@ -5,8 +7,15 @@ import { defaultWaitComplete } from "./akuma-observe.js";
5
7
  import { AkumaOwner } from "./akuma-owner.js";
6
8
  import { decodeAskObservation, executeAskAkuma, executeTellAkuma } from "./akuma-selection-execution.js";
7
9
  import { captureAkumaHost } from "../body-host.js";
8
- import { parseAkuId } from "./identity.js";
10
+ import { parseAkumaId } from "./identity.js";
9
11
  import { schemaFromStandard, schemaJsonText } from "./schema.js";
12
+ export const akumaIdleResultSchema = z
13
+ .strictObject({ reason: z.enum(["completed", "deadline"]), status: akumaStatusSchema })
14
+ .readonly();
15
+ export const akumaReportResultSchema = z.union([
16
+ z.strictObject({ kind: z.literal("recorded"), reportId: z.string().regex(/^report\/[1-9][0-9]*$/u) }).readonly(),
17
+ z.strictObject({ kind: z.literal("refused"), reason: z.enum(["not-born", "not-executing"]) }).readonly(),
18
+ ]);
10
19
  /** Capture the observer capability, not the caller's mutable options object. */
11
20
  export function captureAkumaHostDiagnostic(host) {
12
21
  return captureAkumaHost(host).reportDiagnostic;
@@ -82,28 +91,19 @@ class AkumaHandle {
82
91
  ...(options.initiator === undefined ? {} : { initiator: options.initiator }),
83
92
  ...(signal === undefined ? {} : { signal }),
84
93
  });
85
- return (schema === undefined ? result : { ...result, observation: decodeAskObservation(result.observation, schema) });
94
+ return (schema === undefined ? result : decodeAskObservation(result, schema));
86
95
  });
87
96
  }
88
- async report(text, options) {
97
+ async report(text, options = {}) {
89
98
  if (typeof text !== "string" || text.trim() === "")
90
99
  throw new TypeError("Akuma report text must be nonblank");
91
100
  if (typeof options !== "object" || options === null || Array.isArray(options))
92
- throw new TypeError("Akuma report requires exact execution options");
93
- const unknown = Object.keys(options).find((key) => !["bodySequence", "turnSequence", "signal"].includes(key));
101
+ throw new TypeError("Akuma report options must be an object");
102
+ const unknown = Object.keys(options).find((key) => !["signal"].includes(key));
94
103
  if (unknown !== undefined)
95
104
  throw new TypeError(`Akuma report options has unknown field: ${unknown}`);
96
- for (const key of ["bodySequence", "turnSequence"]) {
97
- if (!Number.isSafeInteger(options[key]) || options[key] <= 0)
98
- throw new TypeError(`Akuma report ${key} must be a positive safe integer`);
99
- }
100
105
  const signal = signalOption(options.signal);
101
- const result = await this.owner().report({
102
- bodySequence: options.bodySequence,
103
- turnSequence: options.turnSequence,
104
- text,
105
- at: new Date().toISOString(),
106
- }, signal);
106
+ const result = await this.owner().report({ text, at: new Date().toISOString() }, signal);
107
107
  if (result.kind !== "recorded")
108
108
  return result;
109
109
  const { report, initiator } = result;
@@ -117,7 +117,7 @@ class AkumaHandle {
117
117
  at: report.at,
118
118
  ...(initiator === undefined ? {} : { initiator }),
119
119
  });
120
- return { kind: "recorded", report };
120
+ return { kind: "recorded", reportId: `report/${report.sequence}` };
121
121
  }
122
122
  async status() {
123
123
  return await this.owner(true).status();
@@ -180,7 +180,7 @@ export class Akuma extends AkumaHandle {
180
180
  constructor(id, root, reportDiagnostic, spawn) {
181
181
  super(id, root, reportDiagnostic, spawn);
182
182
  }
183
- static async birth(archetype, input) {
183
+ static async birth(akumaName, input) {
184
184
  if (typeof input !== "object" || input === null || Array.isArray(input)) {
185
185
  throw new TypeError("Akuma birth input must be an object");
186
186
  }
@@ -194,7 +194,7 @@ export class Akuma extends AkumaHandle {
194
194
  ...(input.home === undefined ? {} : { home: input.home }),
195
195
  ...(input.settings === undefined ? {} : { settings: input.settings }),
196
196
  }, {
197
- archetype,
197
+ akumaName,
198
198
  ...(input.cwd === undefined ? {} : { cwd: input.cwd }),
199
199
  ...(input.writableDirectories === undefined ? {} : { writableDirectories: input.writableDirectories }),
200
200
  ...(input.bare === undefined ? {} : { bare: input.bare }),
@@ -209,7 +209,7 @@ export class Akuma extends AkumaHandle {
209
209
  if (typeof root !== "string")
210
210
  throw new TypeError("Akuma.select root must be a WorldRoot");
211
211
  const { spawn, reportDiagnostic = stderrPluginDiagnostic } = captureAkumaHost(host);
212
- return new Akuma(parseAkuId(selector).id, root, reportDiagnostic, spawn);
212
+ return new Akuma(parseAkumaId(selector).id, root, reportDiagnostic, spawn);
213
213
  }
214
214
  }
215
215
  /** Internal product composition; hosting is captured independently of public operation inputs. */
@@ -217,5 +217,5 @@ export function akumaWithLauncher(root, selector, spawn, host) {
217
217
  if (typeof root !== "string")
218
218
  throw new TypeError("Akuma.select root must be a WorldRoot");
219
219
  const reportDiagnostic = captureAkumaHostDiagnostic(host) ?? stderrPluginDiagnostic;
220
- return new AkumaHandle(parseAkuId(selector).id, root, reportDiagnostic, spawn);
220
+ return new AkumaHandle(parseAkumaId(selector).id, root, reportDiagnostic, spawn);
221
221
  }
@@ -1,12 +1,11 @@
1
- import { type AkuId, type AkumaPaths } from "./identity.js";
1
+ import { type AkumaId, type AkumaPaths } from "./identity.js";
2
2
  import { selectHistory, type ActivityHistory, type ActivityRow, type ActivitySnapshot } from "./projection.js";
3
3
  import type { WorldRoot } from "../world.js";
4
- import type { AkumaAlias } from "../identity/selector.js";
5
- import type { AkumaListRow, AkumaStatus, UnbornAkumaListRow } from "./akuma.js";
6
- export declare function rosterListRow(paths: AkumaPaths, expected: AkuId, aliases?: readonly AkumaAlias[]): Promise<AkumaListRow | UnbornAkumaListRow>;
4
+ import type { AkumaRosterRow, AkumaStatus } from "./akuma.js";
5
+ export declare function rosterListRow(paths: AkumaPaths, expected: AkumaId): Promise<AkumaRosterRow>;
7
6
  /** Optional semantic seam; the observer composition owns delivery and deduplication. */
8
- export type OutcomeObserver = (akumaId: AkuId, historyIds: readonly string[]) => Promise<void>;
9
- export declare function observeOutcomeRows(id: AkuId, rows: readonly ActivityRow[], observer?: OutcomeObserver): Promise<void>;
7
+ export type OutcomeObserver = (akumaId: AkumaId, historyIds: readonly string[]) => Promise<void>;
8
+ export declare function observeOutcomeRows(id: AkumaId, rows: readonly ActivityRow[], observer?: OutcomeObserver): Promise<void>;
10
9
  export declare function observeStatusOutcome(status: AkumaStatus, observer?: OutcomeObserver): Promise<void>;
11
10
  type BudgetedStatusObservation = Readonly<{
12
11
  status: AkumaStatus;
@@ -26,7 +25,7 @@ type StatusObservationInput = Readonly<{
26
25
  admittedTellId?: string;
27
26
  }>;
28
27
  /** Private to a live wait: retain only this member's current frontier and last selection. */
29
- export declare function createLiveStatusReader(paths: AkumaPaths, expected: AkuId): {
28
+ export declare function createLiveStatusReader(paths: AkumaPaths, expected: AkumaId): {
30
29
  clear: () => void;
31
30
  execution(signal?: AbortSignal): Promise<import("./heart/facts.js").AkumaLife>;
32
31
  tellOutcome: (id: string, signal?: AbortSignal) => Promise<{
@@ -54,15 +53,15 @@ export declare function createLiveStatusReader(paths: AkumaPaths, expected: AkuI
54
53
  read(input: StatusObservationInput, signal?: AbortSignal): Promise<LiveStatusObservation>;
55
54
  };
56
55
  /** One-shot observations use the same reader and always release it. */
57
- export declare function bornLiveStatus(paths: AkumaPaths, expected: AkuId, input: StatusObservationInput, signal?: AbortSignal): Promise<LiveStatusObservation>;
58
- export declare function bornStatus(paths: AkumaPaths, expected: AkuId, input: StatusObservationInput): Promise<BudgetedStatusObservation>;
59
- export declare function readLiveStatus(worldPath: WorldRoot, id: AkuId, input: StatusObservationInput, signal?: AbortSignal): Promise<LiveStatusObservation>;
56
+ export declare function bornLiveStatus(paths: AkumaPaths, expected: AkumaId, input: StatusObservationInput, signal?: AbortSignal): Promise<LiveStatusObservation>;
57
+ export declare function bornStatus(paths: AkumaPaths, expected: AkumaId, input: StatusObservationInput): Promise<BudgetedStatusObservation>;
58
+ export declare function readLiveStatus(worldPath: WorldRoot, id: AkumaId, input: StatusObservationInput, signal?: AbortSignal): Promise<LiveStatusObservation>;
60
59
  export type ExecutionProgress = "settled" | "advancing" | "stopped";
61
60
  /** Pending input is not execution. An owned launch can bridge the admission gap. */
62
61
  export declare function executionProgress(life: AkumaStatus["life"], pending: boolean, wake?: "launching" | "settled" | "failed"): ExecutionProgress;
63
62
  export declare function defaultWaitComplete(status: AkumaStatus): boolean;
64
63
  /** Probe completion only; returned statuses still come from a full observation. */
65
- export declare function readWaitComplete(worldPath: WorldRoot, ids: readonly AkuId[], completion: "any" | "all", signal?: AbortSignal, probe?: (id: AkuId) => Promise<boolean>): Promise<boolean>;
64
+ export declare function readWaitComplete(worldPath: WorldRoot, ids: readonly AkumaId[], completion: "any" | "all", signal?: AbortSignal, probe?: (id: AkumaId) => Promise<boolean>): Promise<boolean>;
66
65
  export type WaitReason = "completed" | "deadline";
67
66
  /** The one observation cadence public waiting and timeline streaming share. */
68
67
  export declare const OBSERVATION_POLL_MS = 100;
@@ -83,5 +82,5 @@ export declare function waitForObservation<T>(input: Readonly<{
83
82
  reason: WaitReason;
84
83
  value: T;
85
84
  }>>;
86
- export declare function readAkumaBirthCwd(worldPath: WorldRoot, id: AkuId): Promise<string>;
85
+ export declare function readAkumaBirthCwd(worldPath: WorldRoot, id: AkumaId): Promise<string>;
87
86
  export { selectHistory, type ActivityHistory, type ActivitySnapshot };