@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
@@ -2,7 +2,7 @@ import { defaultWaitComplete } from "../../akuma/akuma-observe.js";
2
2
  import { renderDiffstat, toolContent, toolRepr } from "./akuma-tool.js";
3
3
  import { dispositionText } from "./debt.js";
4
4
  import { debtDispositionMark } from "./marks.js";
5
- import { DEFAULT_CLI_COLUMNS, diagnosticLines, displayColumns, padToDisplay, renderBoundedPayload, renderBoundedTextBlock, safeText, takeDisplayColumns, takeDisplayColumnsFromEnd, truncateDisplayText, truncateMiddleDisplayText, } from "./terminal.js";
5
+ import { ageText, DEFAULT_CLI_COLUMNS, diagnosticLines, displayColumns, padToDisplay, renderBoundedPayload, renderBoundedTextBlock, safeText, takeDisplayColumns, takeDisplayColumnsFromEnd, truncateDisplayText, truncateMiddleDisplayText, } from "./terminal.js";
6
6
  export const DEFAULT_CONTEXT = { columns: DEFAULT_CLI_COLUMNS, color: false };
7
7
  /** The action family's fixed 3-cell state margin and minimum verb cell. */
8
8
  const ACTION_MARGIN = " ";
@@ -81,7 +81,8 @@ function rowText(row, tool) {
81
81
  row.kind === "thought" ||
82
82
  row.kind === "note" ||
83
83
  row.kind === "call" ||
84
- row.kind === "tell") {
84
+ row.kind === "tell" ||
85
+ row.kind === "pending-tell") {
85
86
  return {
86
87
  text: row.text,
87
88
  lines: row.kind === "said" || row.kind === "thought" ? 2 : row.kind === "tell" || row.kind === "call" ? 1 : 2,
@@ -130,7 +131,7 @@ function rowPrefix(row, tool, columns, view) {
130
131
  };
131
132
  if (row.kind === "said")
132
133
  return { first: TOP_SPEAK, continuation: TOP_SPEAK };
133
- if (row.kind === "tell" && row.state === "pending")
134
+ if (row.kind === "pending-tell" || (row.kind === "tell" && "state" in row && row.state === "pending"))
134
135
  return { first: TOP_PENDING, continuation: TOP_CONTINUATION };
135
136
  return { first: TOP_INPUT, continuation: TOP_CONTINUATION };
136
137
  }
@@ -234,7 +235,7 @@ function renderRow(row, context, view = {}) {
234
235
  if (view.tailAnswer === true && row.kind === "outcome" && row.outcome.kind === "answered")
235
236
  return tailAnswerPreview(first, value.text, context.columns);
236
237
  const available = context.columns - displayColumns(first) - displayColumns(value.suffix ?? "");
237
- const singleLine = compact || row.kind === "call" || row.kind === "tell" || row.kind === "turn";
238
+ const singleLine = compact || row.kind === "call" || row.kind === "tell" || row.kind === "pending-tell" || row.kind === "turn";
238
239
  return renderBoundedPayload({
239
240
  text: rowBody(row, value.text, available),
240
241
  first,
@@ -246,6 +247,12 @@ function renderRow(row, context, view = {}) {
246
247
  ...(singleLine || row.kind === "tool" ? {} : { preserveLines: true }),
247
248
  });
248
249
  }
250
+ /** One native activity row through the shared row grammar. */
251
+ export function activityRowLines(row, context, view = {}) {
252
+ return renderRow(row.kind === "answered" || row.kind === "failed" || row.kind === "canceled"
253
+ ? { kind: "outcome", outcome: row }
254
+ : row, context, view);
255
+ }
249
256
  function groupedEntries(entries, context, view = {}) {
250
257
  const lines = [];
251
258
  for (const entry of entries) {
@@ -287,7 +294,7 @@ function currentTurnBoundary(activity) {
287
294
  // The projector selects a typed opening: its call or delivered launch Tell.
288
295
  if (row.kind !== "call" && !(row.kind === "tell" && row.state === "told"))
289
296
  return undefined;
290
- return { row, turnSequence: snapshot.turn.turnSequence };
297
+ return { row, turnSequence: snapshot.turn.sequence };
291
298
  }
292
299
  /** Open status hides internal thought narration without selecting a second activity window. */
293
300
  function visibleOpenSnapshotEntries(snapshot) {
@@ -521,6 +528,17 @@ export function activityStream(context) {
521
528
  flush: () => render(flush()),
522
529
  });
523
530
  }
531
+ function lifeConclusion(life, pending) {
532
+ if (life === "running")
533
+ return { mark: "●", verb: "running" };
534
+ if (life === "asleep")
535
+ return pending ? { mark: "⧗", verb: "pending tell" } : { mark: "✓", verb: "completed" };
536
+ if (life === "killed")
537
+ return { mark: "×", verb: "killed" };
538
+ if (life === "hung")
539
+ return { mark: "?", verb: "hung" };
540
+ return { mark: "!", verb: life };
541
+ }
524
542
  function conclusionMarkVerb(status, outcome) {
525
543
  if (outcome === "failed" || (status !== undefined && failedOutcomeDiagnostic(status) !== undefined))
526
544
  return { mark: "!", verb: "failed" };
@@ -530,20 +548,7 @@ function conclusionMarkVerb(status, outcome) {
530
548
  return { mark: "○", verb: "unanswered" };
531
549
  if (status === undefined)
532
550
  return { mark: "⧗", verb: "pending tell" };
533
- if (status.life === "running")
534
- return { mark: "●", verb: "running" };
535
- if (!defaultWaitComplete(status)) {
536
- return { mark: "⧗", verb: "pending tell" };
537
- }
538
- if (status.life === "asleep")
539
- return { mark: "✓", verb: "completed" };
540
- if (status.life === "killed")
541
- return { mark: "×", verb: "killed" };
542
- if (status.life === "hung")
543
- return { mark: "?", verb: "hung" };
544
- if (status.life === "untidy")
545
- return { mark: "!", verb: "untidy" };
546
- return { mark: "!", verb: "stranded" };
551
+ return lifeConclusion(status.life, !defaultWaitComplete(status));
547
552
  }
548
553
  function durationText(durationMs) {
549
554
  const seconds = Math.max(0, Math.round(durationMs / 1000));
@@ -561,19 +566,21 @@ function waitConclusionRow(input) {
561
566
  ? input.at !== undefined && input.at >= input.startedAt
562
567
  ? ` — ${durationText(Math.max(0, input.at - input.startedAt))}`
563
568
  : ""
564
- : ` — waited ${durationText(Math.max(0, input.end - input.startedAt))}`;
569
+ : input.end === undefined || !Number.isFinite(input.startedAt)
570
+ ? ""
571
+ : ` — waited ${durationText(Math.max(0, input.end - input.startedAt))}`;
565
572
  return `${input.mark} ${input.verb}${duration}`;
566
573
  }
567
574
  export function inputWaitConclusion(observation, input) {
568
- const end = input.now ?? Date.now();
569
- const complete = observation.reason !== "deadline";
575
+ const end = input.now;
576
+ const complete = observation.kind !== "deadline";
570
577
  const pinned = input.completedAt == null ? Number.NaN : Date.parse(input.completedAt);
571
578
  const at = complete ? (Number.isFinite(pinned) ? pinned : undefined) : end;
572
- const conclusion = conclusionMarkVerb(input.status, observation.reason === "answered"
579
+ const conclusion = conclusionMarkVerb(input.status, observation.kind === "answered"
573
580
  ? "answered"
574
- : observation.reason === "failed" || observation.reason === "invalid-output"
581
+ : observation.kind === "failed" || observation.kind === "invalid-output"
575
582
  ? "failed"
576
- : observation.reason === "unanswered"
583
+ : observation.kind === "unanswered"
577
584
  ? "unanswered"
578
585
  : "life");
579
586
  return [
@@ -581,10 +588,10 @@ export function inputWaitConclusion(observation, input) {
581
588
  ...(at === undefined ? {} : { at }),
582
589
  startedAt: input.startedAt,
583
590
  complete,
584
- end,
591
+ ...(end === undefined ? {} : { end }),
585
592
  ...conclusion,
586
593
  }),
587
- ...(observation.reason === "failed" || observation.reason === "invalid-output"
594
+ ...(observation.kind === "failed" || observation.kind === "invalid-output"
588
595
  ? [`! ${safeText(observation.diagnostic)}`]
589
596
  : []),
590
597
  ];
@@ -611,7 +618,7 @@ export function inputWaitStream(context, head, options) {
611
618
  if (admitted)
612
619
  throw new Error("input wait admitted more than once");
613
620
  const pinned = input.at === undefined ? Number.NaN : Date.parse(input.at);
614
- startedAt = Number.isFinite(pinned) ? pinned : now();
621
+ startedAt = Number.isFinite(pinned) ? pinned : (now() ?? Number.NaN);
615
622
  admittedSequence = input.sequence;
616
623
  admitted = true;
617
624
  if (input.rows.length === 0)
@@ -654,13 +661,15 @@ export function inputWaitStream(context, head, options) {
654
661
  lines.push(...activity.flush());
655
662
  if (result.kind === "failed")
656
663
  lines.push(`! ${safeText(result.diagnostic)}`);
657
- else
664
+ else {
665
+ const currentTime = now();
658
666
  lines.push(...inputWaitConclusion(result.observation, {
659
667
  startedAt,
660
668
  ...(result.completedAt === undefined ? {} : { completedAt: result.completedAt }),
661
- now: now(),
669
+ ...(currentTime === undefined ? {} : { now: currentTime }),
662
670
  ...(lastStatus === undefined ? {} : { status: lastStatus }),
663
671
  }));
672
+ }
664
673
  lines.push(...subordinateLines(head().facts));
665
674
  return `${lines.join("\n")}${options.answerSeparator === true ? "\n\n" : ""}`;
666
675
  };
@@ -680,37 +689,34 @@ export function callObservationStream(context, head, options = {}) {
680
689
  observe: (observation) => {
681
690
  for (const row of observation.rows)
682
691
  if (row.kind === "tell" && row.state === "told")
683
- settledTells.add(row.sequence);
692
+ settledTells.add(row.tellId);
684
693
  return stream.observe(observation);
685
694
  },
686
- conclude: (observation) => {
687
- if (observation.kind === "failed") {
688
- const tell = observation.tell;
689
- const evidence = tell === undefined || settledTells.has(tell.row.sequence) ? [] : [tellAdmissionRow(tell, context)];
695
+ conclude: (result) => {
696
+ if (result.failure !== undefined) {
697
+ const evidence = result.tellId === undefined || settledTells.has(result.tellId) || options.prompt === undefined
698
+ ? []
699
+ : [tellAdmissionRow(options.prompt, context, result.wake)];
690
700
  return stream.conclude({
691
701
  kind: "failed",
692
- diagnostic: observation.failure.diagnostic,
702
+ diagnostic: result.failure.diagnostic,
693
703
  ...(evidence.length === 0 ? {} : { evidence }),
694
704
  });
695
705
  }
696
- if (observation.kind !== "observed")
697
- return "";
698
- return stream.conclude({
699
- kind: "observed",
700
- observation: observation.observation,
701
- ...(observation.completedAt === undefined ? {} : { completedAt: observation.completedAt }),
702
- });
706
+ return result.input === undefined ? "" : stream.conclude({ kind: "observed", observation: result.input });
703
707
  },
704
708
  };
705
709
  }
706
- function renderReportedChangeLines(snapshot) {
707
- if (snapshot.reportedChanges.length === 0 && snapshot.reportedChangesOmitted === 0)
710
+ function renderReportedChangeLines(view) {
711
+ const changes = view.changes ?? [];
712
+ if (changes.length === 0 && view.moreChanges !== true && view.outsideChanges === undefined)
708
713
  return [];
709
- const width = snapshot.reportedChanges.reduce((max, change) => Math.max(max, renderDiffstat(change.diffstat).length), 0);
714
+ const width = changes.reduce((max, change) => Math.max(max, renderDiffstat(change.diffstat).length), 0);
710
715
  return [
711
- `changes ${snapshot.reportedChanges.length + snapshot.reportedChangesOmitted}`,
712
- ...snapshot.reportedChanges.map((change) => ` ${renderDiffstat(change.diffstat).padEnd(width)} ${safeText(change.path)}`),
713
- ...(snapshot.reportedChangesOmitted > 0 ? [` ${OMISSION} ${snapshot.reportedChangesOmitted} more files`] : []),
716
+ "changes",
717
+ ...changes.map((change) => ` ${renderDiffstat(change.diffstat).padEnd(width)} ${safeText(change.path)}`),
718
+ ...(view.moreChanges === true ? [` ${OMISSION} more files`] : []),
719
+ ...(view.outsideChanges === undefined ? [] : [` ${view.outsideChanges} outside worktree`]),
714
720
  ];
715
721
  }
716
722
  function renderDebtRow(row, columns) {
@@ -729,76 +735,67 @@ function renderDebtRow(row, columns) {
729
735
  function renderDebtContextLines(created, columns) {
730
736
  if (created === undefined)
731
737
  return [];
732
- if (created.kind === "failed")
738
+ if ("kind" in created)
733
739
  return diagnosticLines("created debts", created.diagnostic, columns);
734
- if (created.rows.length === 0)
735
- return [];
736
- return [`debts ${created.rows.length}`, ...created.rows.flatMap((row) => renderDebtRow(row, columns))];
740
+ return [`debts ${created.length}`, ...created.flatMap((row) => renderDebtRow(row, columns))];
737
741
  }
738
742
  function selectedStatusActivity(snapshot, context) {
739
- const entries = coalesceAdjacentGaps(snapshot.kind === "open" ? visibleOpenSnapshotEntries(snapshot) : orderedSnapshotEntries(snapshot));
740
- const rendered = entries.map((entry) => {
741
- if (entry.kind === "gap")
742
- return { exempt: true, lines: [omissionMarker(`${entry.count} omitted`, context.columns)] };
743
- const row = entry.row;
744
- const exempt = row.kind === "outcome" ||
745
- (row.kind === "tell" && row.state === "pending") ||
746
- (row.kind === "tool" && (row.state === "active" || row.state === "unsettled" || row.state.status === "error"));
747
- return { exempt, lines: renderRow(row, context) };
748
- });
749
- const kept = rendered.map(({ lines }) => lines);
750
- // Allocate the budget backwards without changing the order of the resulting lines.
751
- let remaining = 3;
752
- for (let i = rendered.length - 1; i >= 0; i -= 1) {
753
- const item = rendered[i];
754
- if (item.exempt)
755
- continue;
756
- const take = Math.min(remaining, item.lines.length);
757
- remaining -= take;
758
- kept[i] = take === 0 ? [] : item.lines.slice(-take);
759
- }
743
+ let omitted = false;
760
744
  let marked = false;
761
- return rendered.flatMap((item, index) => {
762
- const lines = kept[index];
763
- if (!item.exempt && lines.length < item.lines.length && !marked) {
764
- marked = true;
765
- return [omissionMarker("earlier activity omitted", context.columns), ...lines];
745
+ return (snapshot.entries ?? []).flatMap((entry) => {
746
+ if (entry.kind === "gap") {
747
+ omitted = true;
748
+ return [];
766
749
  }
767
- return lines;
750
+ const row = entry.kind === "answered" || entry.kind === "failed" || entry.kind === "canceled"
751
+ ? { kind: "outcome", outcome: entry }
752
+ : entry;
753
+ const lines = renderRow(row, context);
754
+ if (lines.length === 0)
755
+ return [];
756
+ const marker = omitted && !marked ? [omissionMarker("earlier activity in history", context.columns)] : [];
757
+ if (omitted)
758
+ marked = true;
759
+ return [...marker, ...lines];
768
760
  });
769
761
  }
770
762
  function snapshotCore(view, context, options) {
771
- const activity = selectedStatusActivity(view.status.timeline, context);
772
- // Static coordinates belong above the content boundary; a dynamic diagnostic stays below it.
773
- const contextFacts = [...(view.status.cwd === undefined ? [] : [safeText(view.status.cwd)])];
763
+ const activity = selectedStatusActivity(view.timeline, context);
764
+ const contextFacts = [
765
+ safeText(view.cwd),
766
+ ...(view.lastActivityAt === undefined
767
+ ? []
768
+ : [
769
+ `${view.life} · last activity ${ageText(view.lastActivityAt, new Date(context.now ?? Date.now()).toISOString())} ago`,
770
+ ]),
771
+ ];
774
772
  const facts = [
775
- ...contractFacts(view.contract, context.columns - SUBORDINATE_INDENT.length),
773
+ ...contractFacts(view.contract ?? { kind: "none" }, context.columns - SUBORDINATE_INDENT.length),
776
774
  ...(options.facts ?? []),
777
775
  ];
778
776
  return {
779
777
  activity,
780
- head: panelHead(view.status.id, options.alias, view.contract, contextFacts),
778
+ head: panelHead(view.id, options.alias, view.contract, contextFacts),
781
779
  facts,
782
780
  };
783
781
  }
784
782
  function snapshotConclusion(status) {
785
- const timeline = status.timeline;
786
- // The outcome row (`✓` / `!`) is already the ending; a closer would be a second mark carrying no
787
- // new information, so it is absent exactly then.
788
- if (timeline.kind === "idle" && timeline.outcome !== undefined)
783
+ const entries = status.timeline.entries ?? [];
784
+ if (status.timeline.kind === "idle" &&
785
+ entries.some((entry) => entry.kind === "answered" || entry.kind === "failed" || entry.kind === "canceled"))
789
786
  return "";
790
- const { mark, verb } = conclusionMarkVerb(status, "life");
791
- return `${mark} ${verb}`;
787
+ const conclusion = lifeConclusion(status.life, entries.some((entry) => entry.kind === "pending-tell"));
788
+ return `${conclusion.mark} ${conclusion.verb}${status.strandedReason === undefined ? "" : ` · ${status.strandedReason}`}`;
792
789
  }
793
790
  export function snapshotText(view, context, options = {}) {
794
791
  const core = snapshotCore(view, context, options);
795
- const conclusion = snapshotConclusion(view.status);
792
+ const conclusion = snapshotConclusion(view);
796
793
  const content = [...core.activity, ...(conclusion.length === 0 ? [] : [conclusion])];
797
794
  return [
798
795
  ...core.head,
799
796
  ...(content.length === 0 ? [] : [frameRule(core.head, context.columns), ...content]),
800
797
  ...subordinateLines([
801
- ...renderReportedChangeLines(view.status.timeline),
798
+ ...renderReportedChangeLines(view),
802
799
  ...renderDebtContextLines(view.createdDebts, context.columns - SUBORDINATE_INDENT.length),
803
800
  ...core.facts,
804
801
  ]),
@@ -827,24 +824,24 @@ function answerBytes(answer, structured) {
827
824
  return !structured && typeof answer === "string" ? answer : JSON.stringify(answer);
828
825
  }
829
826
  export function askRawAnswer(result, structured) {
830
- if (result.observation.reason !== "answered")
827
+ if (result.kind !== "answered")
831
828
  return "";
832
- return answerBytes(result.observation.answer, structured === true);
829
+ return result.answerUndefined === true ? "undefined" : answerBytes(result.answer, structured === true);
833
830
  }
834
- export function callRawAnswer(result, streamed) {
835
- const observation = result.observation;
836
- if (observation.kind !== "observed" || observation.observation.reason !== "answered")
831
+ export function callRawAnswer(result, structured, streamed) {
832
+ const input = result.input;
833
+ if (input?.kind !== "answered")
837
834
  return streamed ? "" : undefined;
838
- return answerBytes(observation.observation.answer, result.structured === true);
835
+ return "answerUndefined" in input ? "undefined" : answerBytes(input.answer, structured);
839
836
  }
840
837
  export function historyRawAnswer(result, historyId) {
841
838
  if (historyId === undefined)
842
839
  return undefined;
843
- if (result.kind === "exact-report")
844
- return result.report.text;
845
- if (result.kind !== "exact")
840
+ if (result.kind === "akuma-report")
841
+ return result.text;
842
+ if (result.kind !== "akuma-exact")
846
843
  return undefined;
847
- const outcome = result.outcome.outcome;
844
+ const outcome = result.outcome;
848
845
  return outcome.kind === "answered" ? outcome.answer : outcome.kind === "canceled" ? "canceled" : outcome.diagnostic;
849
846
  }
850
847
  /** One compact wait result line: an observed life mark, the complete identity, a bounded summary. */
@@ -876,10 +873,11 @@ function waitLine(mark, subject, summary, columns) {
876
873
  * pending input shows its current answered preview or failed diagnostic, else completion. The
877
874
  * mark reports the observed life, never continuing liveness.
878
875
  */
879
- function waitSummary(status) {
880
- const pending = status.timeline.entries.some((entry) => entry.kind === "row" && entry.row.kind === "tell" && entry.row.state === "pending");
881
- const outcome = status.timeline.kind === "idle" ? status.timeline.outcome?.outcome : undefined;
882
- const observed = WAIT_LIFE[status.life] ??
876
+ function waitSummary(member) {
877
+ const pending = member.pending !== undefined;
878
+ const outcome = member.outcome;
879
+ const life = WAIT_LIFE[member.life];
880
+ const observed = life ??
883
881
  (pending
884
882
  ? { mark: "⧗", state: "pending tell" }
885
883
  : outcome === undefined
@@ -893,8 +891,9 @@ function waitSummary(status) {
893
891
  ...observed,
894
892
  summary: [
895
893
  observed.state,
896
- ...(pending && status.life !== "asleep" ? ["pending tell"] : []),
897
- ...(status.strandedReason === undefined ? [] : [status.strandedReason]),
894
+ ...(pending && life !== undefined ? ["pending tell"] : []),
895
+ ...(outcome?.kind === "failed" && (life !== undefined || pending) ? [preview(outcome.diagnostic, "failed")] : []),
896
+ ...(member.strandedReason === undefined ? [] : [member.strandedReason]),
898
897
  ].join(FACT_SEPARATOR),
899
898
  };
900
899
  }
@@ -904,36 +903,38 @@ function waitSummary(status) {
904
903
  * visible only as the snapshot's own bounded summary.
905
904
  */
906
905
  export function waitText(result, presentation, context) {
907
- const alias = result.observations.length === 1 && result.unobserved.length === 0 ? presentation.alias : undefined;
908
- return [
909
- ...result.observations.map((observation) => {
910
- const { mark, summary } = waitSummary(observation.status);
911
- return waitLine(mark, identity(observation.status.id, alias), summary, context.columns);
912
- }),
913
- ...result.unobserved.map((member) => waitLine("!", safeText(member.id), `observation failed${FACT_SEPARATOR}${member.diagnostic}`, context.columns)),
914
- ].join("\n");
906
+ const alias = result.results.length === 1 ? presentation.alias : undefined;
907
+ return result.results
908
+ .map((member) => {
909
+ if (member.kind === "missing")
910
+ return waitLine("!", identity(member.id, alias), "Akuma not found", context.columns);
911
+ if (member.kind === "unobserved")
912
+ return waitLine("!", identity(member.id, alias), `observation failed${FACT_SEPARATOR}${member.diagnostic}`, context.columns);
913
+ const { mark, summary } = waitSummary(member);
914
+ return waitLine(mark, identity(member.id, alias), summary, context.columns);
915
+ })
916
+ .join("\n");
915
917
  }
916
918
  export function historyText(result, presentation, context) {
917
919
  if (presentation.id !== undefined) {
918
- return (historyRawAnswer(result, presentation.id) ??
919
- `${result.kind === "unknown-history" ? result.historyId : "unknown"} has no matching retained history`);
920
+ return historyRawAnswer(result, presentation.id) ?? `${presentation.id} has no matching retained history`;
920
921
  }
921
922
  if (presentation.last === true)
922
- return result.kind === "last" ? result.answer : "no answer retained";
923
- if (result.kind !== "history")
923
+ return result.kind === "akuma-last" ? result.answer : "no answer retained";
924
+ if (result.kind !== "akuma")
924
925
  throw new Error("history result lacks page");
925
- const rows = groupedRows(result.history.rows, context, { history: true });
926
- const paging = result.history.omitted > 0
927
- ? [
928
- omissionMarker(result.history.hasLater
929
- ? `${result.history.omitted} later events · showing first ${result.history.rows.length}`
930
- : `${result.history.omitted} earlier events · showing last ${result.history.rows.length}`, context.columns),
931
- ]
932
- : [];
926
+ const rows = groupedRows(result.events, context, { history: true });
927
+ const paging = result.omitted === undefined
928
+ ? []
929
+ : [
930
+ omissionMarker(presentation.since !== undefined
931
+ ? `${result.omitted} later events · showing first ${result.events.length}`
932
+ : `${result.omitted} earlier events · showing last ${result.events.length}`, context.columns),
933
+ ];
933
934
  // History is an immutable timeline, so it takes the shared heading and content boundary and
934
935
  // never gains a fabricated current-state conclusion or a live mark.
935
936
  const content = [...paging, ...rows];
936
- const head = panelHead(result.id, presentation.alias, result.contract);
937
+ const head = panelHead(result.akumaId, presentation.alias, undefined);
937
938
  return [...head, ...(content.length === 0 ? [] : [frameRule(head, context.columns), ...content])].join("\n");
938
939
  }
939
940
  /** One bounded, quoted preview of a Tell an outer receipt already admitted, indented beneath it. */
@@ -949,10 +950,10 @@ export function tellPayloadLines(text, context) {
949
950
  });
950
951
  }
951
952
  /** One admitted Tell as a timeline input row inside a shared panel; the panel owns the identity. */
952
- export function tellAdmissionRow(tell, context) {
953
- const lead = tell.wake.kind === "failed" ? TOP_FAILURE : tell.wake.kind === "held" ? TOP_PENDING : TOP_INPUT;
953
+ export function tellAdmissionRow(text, context, wake) {
954
+ const lead = wake?.kind === "failed" ? TOP_FAILURE : wake?.kind === "held" || wake?.kind === "pending" ? TOP_PENDING : TOP_INPUT;
954
955
  return renderBoundedPayload({
955
- text: tell.row.text,
956
+ text,
956
957
  first: lead,
957
958
  continuation: TOP_CONTINUATION,
958
959
  columns: context.columns,
@@ -961,36 +962,43 @@ export function tellAdmissionRow(tell, context) {
961
962
  truncated: false,
962
963
  })[0];
963
964
  }
965
+ export function tellControlLines(result, context) {
966
+ const lines = [];
967
+ const wake = result.wake;
968
+ if (wake?.kind === "failed") {
969
+ lines.push(...diagnosticLines("tell delivery", wake.diagnostic, context.columns - SUBORDINATE_INDENT.length, {
970
+ state: "failed",
971
+ suffix: wake.logPath === undefined ? "" : ` · log ${wake.logPath}`,
972
+ }));
973
+ }
974
+ else if (wake?.kind === "pending")
975
+ lines.push("wake pending");
976
+ const interrupt = result.interrupt;
977
+ if (interrupt !== undefined)
978
+ lines.push(`interrupt ${interrupt.kind} · body/${interrupt.bodySequence}${interrupt.kind === "unavailable" ? ` · ${interrupt.evidence}` : ""}`);
979
+ return lines;
980
+ }
964
981
  /**
965
982
  * One Tell action receipt: the delivery verdict and complete subject stand whole on the first line
966
983
  * with the submitted payload folded onto that same line, bounded so only its preview truncates. A
967
984
  * held Tell keeps neutral vocabulary; a failed delivery keeps its concrete diagnosis and native log
968
985
  * coordinates as separate supporting facts.
969
986
  */
970
- export function tellText(result, alias, context) {
971
- const wake = result.tell.wake;
972
- const mark = wake.kind === "failed" ? "!" : wake.kind === "held" ? "⧗" : "✓";
973
- const verb = wake.kind === "failed" || wake.kind === "held" ? "tell" : "told";
987
+ export function tellText(result, prompt, alias, context) {
988
+ const wake = result.wake;
989
+ const mark = wake?.kind === "failed" ? "!" : wake?.kind === "pending" ? "⧗" : "✓";
990
+ const verb = wake?.kind === "failed" || wake?.kind === "pending" ? "tell" : "told";
974
991
  const head = actionReceipt({
975
992
  mark,
976
993
  verb,
977
- id: result.akuma,
994
+ id: result.akumaId,
978
995
  ...(alias === undefined ? {} : { alias }),
979
996
  })[0];
980
- const preview = safeText(result.tell.row.text).replace(/\s+/gu, " ").trim();
997
+ const preview = safeText(prompt).replace(/\s+/gu, " ").trim();
981
998
  const prefix = `${head} — `;
982
999
  // The verdict and identity never truncate, so an over-wide identity still keeps one visible
983
1000
  // ellipsis for the input it could not show.
984
1001
  const room = Math.max(1, context.columns - displayColumns(prefix));
985
1002
  const verdict = preview.length === 0 ? head : `${prefix}${truncateDisplayText(preview, room)}`;
986
- if (wake.kind !== "failed")
987
- return verdict;
988
- const child = "child" in wake ? wake.child : undefined;
989
- return [
990
- verdict,
991
- ...subordinateLines(diagnosticLines("tell delivery", wake.diagnostic, context.columns - SUBORDINATE_INDENT.length, {
992
- state: "failed",
993
- suffix: child === undefined ? "" : ` · log ${child.log.path} ${child.log.from}..${child.log.to}`,
994
- })),
995
- ].join("\n");
1003
+ return [verdict, ...subordinateLines(tellControlLines(result, context))].join("\n");
996
1004
  }
@@ -1,9 +1,6 @@
1
- import type { ActivityRow, SnapshotRow } from "../../akuma/projection.js";
2
- import type { AkumaObservation } from "../../index.js";
3
- type StatusTimelineRow = Extract<AkumaObservation["status"]["timeline"]["entries"][number], {
4
- kind: "row";
5
- }>["row"];
6
- type ToolRow = Extract<ActivityRow | SnapshotRow | StatusTimelineRow, {
1
+ import type { ActivityRow } from "../../akuma/projection.js";
2
+ import type { StatusPreview } from "../../akuma/status-projection.js";
3
+ type ToolRow = Extract<ActivityRow | StatusPreview, {
7
4
  kind: "tool";
8
5
  }>;
9
6
  /** The bounded body of a generic tool row, including its terminal diagnostic. */
@@ -1,8 +1,15 @@
1
1
  import { normalizeToolCommand } from "./akuma-tool-command.js";
2
2
  import { displayColumns, truncateDisplayText } from "./terminal.js";
3
+ function toolInput(row) {
4
+ const input = row.call.kind === "other" ? row.call.input : undefined;
5
+ return typeof input === "string" ? { json: input } : input;
6
+ }
7
+ function toolName(row) {
8
+ return "name" in row ? row.name : row.call.kind;
9
+ }
3
10
  /** The bounded body of a generic tool row, including its terminal diagnostic. */
4
11
  export function toolContent(row, columns) {
5
- const input = row.call.kind === "other" ? row.call.input : undefined;
12
+ const input = toolInput(row);
6
13
  const diagnostic = toolDiagnostic(row);
7
14
  const width = Math.max(0, columns - displayColumns(diagnostic));
8
15
  let text;
@@ -79,13 +86,11 @@ function duration(milliseconds) {
79
86
  function result(row) {
80
87
  if (row.state === "active" || row.state === "unsettled")
81
88
  return undefined;
82
- const disposition = row.state.exitCode !== undefined
83
- ? row.state.exitCode === 0
84
- ? "ok"
85
- : `exit ${row.state.exitCode}`
86
- : row.state.status;
89
+ const exitCode = "exitCode" in row.state ? row.state.exitCode : undefined;
90
+ const durationMs = "durationMs" in row ? row.durationMs : undefined;
91
+ const disposition = exitCode !== undefined ? (exitCode === 0 ? "ok" : `exit ${exitCode}`) : row.state.status;
87
92
  const parts = [
88
- ...(row.call.kind === "run" && row.durationMs !== undefined ? [duration(row.durationMs)] : []),
93
+ ...(row.call.kind === "run" && durationMs !== undefined ? [duration(durationMs)] : []),
89
94
  ...(disposition === "ok" ? [] : [disposition]),
90
95
  ...(row.state.message === undefined ? [] : [oneLine(row.state.message)]),
91
96
  ];
@@ -117,9 +122,10 @@ function searchText(call) {
117
122
  ].join(" · ");
118
123
  }
119
124
  function inputObject(row) {
120
- if (row.call.kind !== "other" || row.call.input?.truncated === true)
125
+ const input = toolInput(row);
126
+ if (row.call.kind !== "other" || input?.truncated === true)
121
127
  return undefined;
122
- return jsonObject(row.call.input?.json ?? "");
128
+ return jsonObject(input?.json ?? "");
123
129
  }
124
130
  function suppliedSlice(value) {
125
131
  const offset = typeof value.offset_chars === "number" ? `from ${value.offset_chars}` : "";
@@ -130,22 +136,22 @@ function commonOtherText(row) {
130
136
  const input = inputObject(row);
131
137
  if (input === undefined)
132
138
  return undefined;
133
- if (row.name === "get_context_remaining")
139
+ if (toolName(row) === "get_context_remaining")
134
140
  return undefined;
135
- if (row.name === "notes_read") {
141
+ if (toolName(row) === "notes_read") {
136
142
  const address = typeof input.address === "string" ? input.address : typeof input.path === "string" ? input.path : undefined;
137
143
  return [address, suppliedSlice(input)]
138
144
  .filter((value) => value !== undefined && value !== "")
139
145
  .join(" · ");
140
146
  }
141
- if (row.name === "history_read") {
147
+ if (toolName(row) === "history_read") {
142
148
  const item = typeof input.item_id === "string" ? input.item_id : undefined;
143
149
  const window = typeof input.window_id === "string" ? input.window_id : undefined;
144
150
  return [item, window, suppliedSlice(input)]
145
151
  .filter((value) => value !== undefined && value !== "")
146
152
  .join(" · ");
147
153
  }
148
- if (row.name === "history_list") {
154
+ if (toolName(row) === "history_list") {
149
155
  const role = typeof input.role === "string" ? `role ${input.role}` : undefined;
150
156
  const order = input.recent_first === true ? "newest first" : input.recent_first === false ? "oldest first" : undefined;
151
157
  const limit = typeof input.limit === "number" ? `${input.limit} rows` : undefined;
@@ -194,7 +200,7 @@ function toolCore(row) {
194
200
  case "fileChange":
195
201
  return fileChange(row.call, row.state);
196
202
  case "other":
197
- return { label: row.name, text: "" };
203
+ return { label: toolName(row), text: "" };
198
204
  }
199
205
  }
200
206
  /** Pure provider-neutral tool presentation; it performs no activity selection. */