@astrosheep/keiyaku 4.6.29 → 4.6.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (400) hide show
  1. package/README.md +5 -5
  2. package/build/plugins/claude/.claude-plugin/plugin.json +1 -1
  3. package/build/plugins/claude/skills/keiyaku/SKILL.md +24 -24
  4. package/build/plugins/claude/skills/keiyaku-akuma/SKILL.md +44 -168
  5. package/build/plugins/claude/skills/keiyaku-akuma/references/automation.md +61 -231
  6. package/build/plugins/claude/skills/keiyaku-babysit/SKILL.md +47 -58
  7. package/build/plugins/claude/skills/keiyaku-bind/SKILL.md +44 -185
  8. package/build/plugins/claude/skills/keiyaku-debt/SKILL.md +40 -89
  9. package/build/plugins/claude/skills/keiyaku-workflow/SKILL.md +56 -116
  10. package/build/plugins/codex/.codex-plugin/plugin.json +1 -1
  11. package/build/plugins/codex/skills/keiyaku/SKILL.md +24 -24
  12. package/build/plugins/codex/skills/keiyaku-akuma/SKILL.md +44 -168
  13. package/build/plugins/codex/skills/keiyaku-akuma/references/automation.md +61 -231
  14. package/build/plugins/codex/skills/keiyaku-babysit/SKILL.md +47 -58
  15. package/build/plugins/codex/skills/keiyaku-bind/SKILL.md +44 -185
  16. package/build/plugins/codex/skills/keiyaku-debt/SKILL.md +40 -89
  17. package/build/plugins/codex/skills/keiyaku-workflow/SKILL.md +56 -116
  18. package/build/plugins/opencode/package.json +1 -1
  19. package/build/plugins/opencode/skills/keiyaku/SKILL.md +24 -24
  20. package/build/plugins/opencode/skills/keiyaku-akuma/SKILL.md +44 -168
  21. package/build/plugins/opencode/skills/keiyaku-akuma/references/automation.md +61 -231
  22. package/build/plugins/opencode/skills/keiyaku-babysit/SKILL.md +47 -58
  23. package/build/plugins/opencode/skills/keiyaku-bind/SKILL.md +44 -185
  24. package/build/plugins/opencode/skills/keiyaku-debt/SKILL.md +40 -89
  25. package/build/plugins/opencode/skills/keiyaku-workflow/SKILL.md +56 -116
  26. package/build/plugins/pi/README.md +5 -5
  27. package/build/plugins/pi/akuma-tools.ts +17 -23
  28. package/build/skills/keiyaku/SKILL.md +24 -24
  29. package/build/skills/keiyaku-akuma/SKILL.md +44 -168
  30. package/build/skills/keiyaku-akuma/references/automation.md +61 -231
  31. package/build/skills/keiyaku-babysit/SKILL.md +47 -58
  32. package/build/skills/keiyaku-bind/SKILL.md +44 -185
  33. package/build/skills/keiyaku-debt/SKILL.md +40 -89
  34. package/build/skills/keiyaku-workflow/SKILL.md +56 -116
  35. package/build/src/akuma/akuma-call.d.ts +1 -1
  36. package/build/src/akuma/akuma-call.js +9 -9
  37. package/build/src/akuma/akuma-errors.d.ts +5 -5
  38. package/build/src/akuma/akuma-instance.d.ts +355 -12
  39. package/build/src/akuma/akuma-instance.js +20 -20
  40. package/build/src/akuma/akuma-observe.d.ts +11 -12
  41. package/build/src/akuma/akuma-observe.js +34 -26
  42. package/build/src/akuma/akuma-owner.d.ts +32 -11
  43. package/build/src/akuma/akuma-owner.js +35 -16
  44. package/build/src/akuma/akuma-probe.d.ts +3 -3
  45. package/build/src/akuma/akuma-probe.js +2 -2
  46. package/build/src/akuma/akuma-selection-execution.d.ts +985 -1
  47. package/build/src/akuma/akuma-selection-execution.js +42 -18
  48. package/build/src/akuma/akuma-stream.d.ts +2 -2
  49. package/build/src/akuma/akuma-stream.js +1 -1
  50. package/build/src/akuma/akuma-wait.d.ts +5 -5
  51. package/build/src/akuma/akuma-wait.js +52 -14
  52. package/build/src/akuma/akuma.d.ts +245 -271
  53. package/build/src/akuma/akuma.js +98 -46
  54. package/build/src/akuma/archetype.d.ts +19 -6
  55. package/build/src/akuma/archetype.js +25 -9
  56. package/build/src/akuma/body-launch.d.ts +2 -2
  57. package/build/src/akuma/body.js +4 -4
  58. package/build/src/akuma/call-initial-tell.d.ts +60 -44
  59. package/build/src/akuma/call-initial-tell.js +41 -2
  60. package/build/src/akuma/caller.d.ts +26 -17
  61. package/build/src/akuma/caller.js +22 -9
  62. package/build/src/akuma/coordinate.d.ts +9 -0
  63. package/build/src/akuma/coordinate.js +13 -0
  64. package/build/src/akuma/detached-body.js +2 -2
  65. package/build/src/akuma/dispatch-association.d.ts +4 -4
  66. package/build/src/akuma/dispatch-association.js +12 -3
  67. package/build/src/akuma/execution-instructions.js +2 -2
  68. package/build/src/akuma/heart/facts.d.ts +29 -7
  69. package/build/src/akuma/heart/facts.js +13 -0
  70. package/build/src/akuma/heart/index.d.ts +0 -3
  71. package/build/src/akuma/heart/index.js +3 -6
  72. package/build/src/akuma/heart/rows.js +2 -2
  73. package/build/src/akuma/heart/soul.js +5 -5
  74. package/build/src/akuma/identity.d.ts +17 -16
  75. package/build/src/akuma/identity.js +20 -19
  76. package/build/src/akuma/index.d.ts +1 -2
  77. package/build/src/akuma/lineage-cache.d.ts +4 -4
  78. package/build/src/akuma/lineage-cache.js +10 -10
  79. package/build/src/akuma/projection-read.d.ts +2 -5
  80. package/build/src/akuma/projection-read.js +34 -47
  81. package/build/src/akuma/projection.d.ts +659 -569
  82. package/build/src/akuma/projection.js +203 -94
  83. package/build/src/akuma/providers/acp/index.js +1 -1
  84. package/build/src/akuma/providers/execution-environment.d.ts +1 -3
  85. package/build/src/akuma/providers/execution-environment.js +0 -4
  86. package/build/src/akuma/publication.d.ts +2 -2
  87. package/build/src/akuma/publication.js +3 -3
  88. package/build/src/akuma/retention.js +2 -2
  89. package/build/src/akuma/selection-observation.d.ts +507 -43
  90. package/build/src/akuma/selection-observation.js +153 -1
  91. package/build/src/akuma/status-projection.d.ts +288 -0
  92. package/build/src/akuma/status-projection.js +154 -0
  93. package/build/src/akuma/turn-drive.js +0 -3
  94. package/build/src/alias/index.d.ts +9 -4
  95. package/build/src/alias/index.js +11 -9
  96. package/build/src/bounded-list.d.ts +8 -0
  97. package/build/src/bounded-list.js +9 -0
  98. package/build/src/cli/commands/akuma-grammar.d.ts +2 -2
  99. package/build/src/cli/commands/akuma-grammar.js +21 -21
  100. package/build/src/cli/commands/akuma.d.ts +1 -2
  101. package/build/src/cli/commands/akuma.js +115 -251
  102. package/build/src/cli/commands/contract-grammar.d.ts +4 -3
  103. package/build/src/cli/commands/contract-grammar.js +39 -22
  104. package/build/src/cli/commands/contract-help.d.ts +3 -1
  105. package/build/src/cli/commands/contract-help.js +4 -3
  106. package/build/src/cli/commands/contract.d.ts +6 -3
  107. package/build/src/cli/commands/contract.js +203 -434
  108. package/build/src/cli/commands/debt.d.ts +2 -3
  109. package/build/src/cli/commands/debt.js +101 -317
  110. package/build/src/cli/commands/report.js +11 -28
  111. package/build/src/cli/commands/whoami.d.ts +3 -43
  112. package/build/src/cli/commands/whoami.js +8 -121
  113. package/build/src/cli/coordinates.d.ts +4 -35
  114. package/build/src/cli/coordinates.js +13 -129
  115. package/build/src/cli/parse.d.ts +0 -6
  116. package/build/src/cli/parse.js +5 -48
  117. package/build/src/cli/render/akuma-activity.d.ts +31 -16
  118. package/build/src/cli/render/akuma-activity.js +162 -122
  119. package/build/src/cli/render/akuma-tool.d.ts +3 -6
  120. package/build/src/cli/render/akuma-tool.js +20 -14
  121. package/build/src/cli/render/akuma.d.ts +25 -26
  122. package/build/src/cli/render/akuma.js +100 -129
  123. package/build/src/cli/render/catalog.d.ts +4 -7
  124. package/build/src/cli/render/catalog.js +52 -99
  125. package/build/src/cli/render/contract-history.d.ts +3 -1
  126. package/build/src/cli/render/contract-history.js +140 -215
  127. package/build/src/cli/render/contract-observation.d.ts +43 -30
  128. package/build/src/cli/render/contract-observation.js +64 -31
  129. package/build/src/cli/render/contract-wait.js +6 -6
  130. package/build/src/cli/render/contract.d.ts +41 -6
  131. package/build/src/cli/render/contract.js +274 -370
  132. package/build/src/cli/render/debt.d.ts +9 -19
  133. package/build/src/cli/render/debt.js +120 -185
  134. package/build/src/cli/render/delivery-preview.d.ts +4 -3
  135. package/build/src/cli/render/delivery-preview.js +68 -96
  136. package/build/src/cli/render/kanshi-akuma.d.ts +5 -4
  137. package/build/src/cli/render/kanshi-akuma.js +70 -59
  138. package/build/src/cli/render/kanshi.d.ts +4 -4
  139. package/build/src/cli/render/kanshi.js +205 -207
  140. package/build/src/cli/render/marks.d.ts +11 -2
  141. package/build/src/cli/render/marks.js +13 -3
  142. package/build/src/cli/render/nuke.d.ts +3 -3
  143. package/build/src/cli/render/nuke.js +13 -16
  144. package/build/src/cli/render/receipt.d.ts +37 -43
  145. package/build/src/cli/render/receipt.js +313 -236
  146. package/build/src/cli/render/reconcile.d.ts +6 -4
  147. package/build/src/cli/render/reconcile.js +53 -137
  148. package/build/src/cli/render/refusal.d.ts +3 -2
  149. package/build/src/cli/render/refusal.js +73 -54
  150. package/build/src/cli/render/region.d.ts +11 -2
  151. package/build/src/cli/render/region.js +17 -23
  152. package/build/src/cli/render/settings.d.ts +0 -1
  153. package/build/src/cli/render/settings.js +8 -17
  154. package/build/src/cli/render/terminal.d.ts +2 -0
  155. package/build/src/cli/render/verbs.d.ts +4 -0
  156. package/build/src/cli/render/verbs.js +312 -0
  157. package/build/src/cli/render/whoami.d.ts +1 -1
  158. package/build/src/cli/render/whoami.js +24 -31
  159. package/build/src/cli/runtime.d.ts +3 -11
  160. package/build/src/cli/runtime.js +96 -79
  161. package/build/src/cli/scan.d.ts +1 -1
  162. package/build/src/cli/streams.js +1 -0
  163. package/build/src/contract-guidance.js +2 -2
  164. package/build/src/contract-worktree.d.ts +2 -15
  165. package/build/src/contract-worktree.js +35 -36
  166. package/build/src/core/facts/observation.d.ts +4 -5
  167. package/build/src/core/facts/observation.js +7 -9
  168. package/build/src/core/verbs/amend.d.ts +0 -1
  169. package/build/src/core/verbs/amend.js +3 -3
  170. package/build/src/core/verbs/bind.d.ts +0 -1
  171. package/build/src/core/verbs/bind.js +5 -5
  172. package/build/src/core/verbs/deliver.d.ts +3 -2
  173. package/build/src/core/verbs/deliver.js +2 -2
  174. package/build/src/core/verbs/placement.d.ts +0 -5
  175. package/build/src/core/verbs/placement.js +4 -6
  176. package/build/src/core/verbs/reintegrate.d.ts +0 -1
  177. package/build/src/core/verbs/reintegrate.js +2 -2
  178. package/build/src/debt/board.d.ts +132 -116
  179. package/build/src/debt/board.js +138 -94
  180. package/build/src/debt/catalog.d.ts +4 -4
  181. package/build/src/debt/catalog.js +2 -18
  182. package/build/src/debt/context.d.ts +15 -3
  183. package/build/src/debt/context.js +12 -1
  184. package/build/src/debt/created-observation.d.ts +5 -17
  185. package/build/src/debt/created-observation.js +14 -6
  186. package/build/src/debt/document.d.ts +20 -15
  187. package/build/src/debt/document.js +18 -1
  188. package/build/src/debt/index.d.ts +346 -23
  189. package/build/src/debt/index.js +68 -22
  190. package/build/src/debt/input.d.ts +2 -1
  191. package/build/src/debt/input.js +14 -0
  192. package/build/src/debt/lifecycle-operations.d.ts +2 -2
  193. package/build/src/debt/lifecycle-operations.js +14 -22
  194. package/build/src/debt/operation-types.d.ts +188 -66
  195. package/build/src/debt/operation-types.js +113 -1
  196. package/build/src/debt/operations.d.ts +11 -10
  197. package/build/src/debt/operations.js +46 -71
  198. package/build/src/debt/query.d.ts +14 -10
  199. package/build/src/debt/query.js +3 -12
  200. package/build/src/debt/store.d.ts +4 -2
  201. package/build/src/debt/store.js +8 -8
  202. package/build/src/debt/view.d.ts +0 -3
  203. package/build/src/debt/view.js +0 -4
  204. package/build/src/dispatch/index.d.ts +22 -5
  205. package/build/src/dispatch/index.js +46 -37
  206. package/build/src/git/admission.d.ts +2 -2
  207. package/build/src/git/admission.js +2 -1
  208. package/build/src/git/hooks.d.ts +14 -35
  209. package/build/src/git/hooks.js +45 -25
  210. package/build/src/git/integration.d.ts +6 -24
  211. package/build/src/git/integration.js +10 -16
  212. package/build/src/git/observe.d.ts +2 -1
  213. package/build/src/git/observe.js +29 -20
  214. package/build/src/git/private-state-seat.d.ts +2 -2
  215. package/build/src/git/private-state-seat.js +2 -1
  216. package/build/src/git/reconcile.d.ts +17 -79
  217. package/build/src/git/reconcile.js +37 -52
  218. package/build/src/git/scratch.d.ts +3 -3
  219. package/build/src/git/scratch.js +4 -1
  220. package/build/src/git/target-placement.d.ts +23 -31
  221. package/build/src/git/target-placement.js +42 -27
  222. package/build/src/git/target.d.ts +2 -2
  223. package/build/src/git/target.js +2 -1
  224. package/build/src/git/tender.d.ts +7 -39
  225. package/build/src/git/tender.js +21 -54
  226. package/build/src/git/terminal-reconcile.js +15 -18
  227. package/build/src/git/terminal-seal.d.ts +2 -4
  228. package/build/src/git/terminal-seal.js +7 -33
  229. package/build/src/git/workspace.d.ts +65 -41
  230. package/build/src/git/workspace.js +45 -14
  231. package/build/src/identity/selector.d.ts +2 -0
  232. package/build/src/identity/selector.js +13 -3
  233. package/build/src/index.d.ts +48 -54
  234. package/build/src/index.js +31 -43
  235. package/build/src/kanshi/counts.d.ts +42 -8
  236. package/build/src/kanshi/counts.js +13 -2
  237. package/build/src/kanshi/index.d.ts +5 -5
  238. package/build/src/kanshi/index.js +4 -3
  239. package/build/src/kanshi/read.d.ts +489 -6
  240. package/build/src/kanshi/read.js +334 -483
  241. package/build/src/kanshi/report.d.ts +2504 -103
  242. package/build/src/kanshi/report.js +165 -1
  243. package/build/src/kanshi/select.d.ts +0 -8
  244. package/build/src/kanshi/select.js +20 -59
  245. package/build/src/library/address.d.ts +8 -8
  246. package/build/src/library/address.js +7 -7
  247. package/build/src/library/akuma-creation.d.ts +690 -84
  248. package/build/src/library/akuma-creation.js +202 -142
  249. package/build/src/library/akuma-retention.d.ts +2 -2
  250. package/build/src/library/akuma-retention.js +2 -2
  251. package/build/src/library/akumas.d.ts +10 -6
  252. package/build/src/library/akumas.js +24 -7
  253. package/build/src/library/bind.d.ts +28 -54
  254. package/build/src/library/bind.js +6 -4
  255. package/build/src/library/continuation.d.ts +197 -479
  256. package/build/src/library/continuation.js +40 -23
  257. package/build/src/library/contract-address.d.ts +6 -5
  258. package/build/src/library/contract-address.js +5 -7
  259. package/build/src/library/contract-composition.d.ts +18 -12
  260. package/build/src/library/contract-composition.js +55 -47
  261. package/build/src/library/contract-creation.d.ts +3 -2
  262. package/build/src/library/contract-creation.js +38 -32
  263. package/build/src/library/contract-execution.js +77 -38
  264. package/build/src/library/contract-outcomes.d.ts +1877 -27
  265. package/build/src/library/contract-outcomes.js +93 -10
  266. package/build/src/library/contract-settings.d.ts +2 -2
  267. package/build/src/library/contract-settings.js +18 -14
  268. package/build/src/library/contract-types.d.ts +238 -61
  269. package/build/src/library/contract-types.js +131 -1
  270. package/build/src/library/contract-wait.d.ts +38 -17
  271. package/build/src/library/contract-wait.js +40 -10
  272. package/build/src/library/delivery.d.ts +588 -36
  273. package/build/src/library/delivery.js +35 -27
  274. package/build/src/library/input.d.ts +1 -1
  275. package/build/src/library/input.js +1 -2
  276. package/build/src/library/invocation.d.ts +11 -7
  277. package/build/src/library/invocation.js +42 -51
  278. package/build/src/library/kei.d.ts +48 -0
  279. package/build/src/library/kei.js +256 -0
  280. package/build/src/library/keiyaku-attribution.d.ts +11 -0
  281. package/build/src/{cli/delivery-identity.js → library/keiyaku-attribution.js} +12 -1
  282. package/build/src/library/keiyaku-classify.d.ts +11 -0
  283. package/build/src/library/keiyaku-classify.js +146 -0
  284. package/build/src/library/keiyaku-coordinates.d.ts +31 -0
  285. package/build/src/library/keiyaku-coordinates.js +103 -0
  286. package/build/src/library/keiyaku-debt.d.ts +142 -0
  287. package/build/src/library/keiyaku-debt.js +188 -0
  288. package/build/src/library/keiyaku-identity.d.ts +58 -0
  289. package/build/src/library/keiyaku-identity.js +176 -0
  290. package/build/src/library/keiyaku-policy.d.ts +27 -0
  291. package/build/src/library/keiyaku-policy.js +44 -0
  292. package/build/src/library/keiyaku-status.d.ts +1487 -0
  293. package/build/src/library/keiyaku-status.js +92 -0
  294. package/build/src/library/keiyaku-verbs.d.ts +6774 -0
  295. package/build/src/library/keiyaku-verbs.js +458 -0
  296. package/build/src/library/keiyaku.d.ts +871 -38
  297. package/build/src/library/keiyaku.js +677 -127
  298. package/build/src/library/nuke.d.ts +22 -0
  299. package/build/src/library/nuke.js +4 -1
  300. package/build/src/library/outcome.d.ts +706 -692
  301. package/build/src/library/outcome.js +582 -167
  302. package/build/src/library/reconcile.d.ts +464 -116
  303. package/build/src/library/reconcile.js +174 -102
  304. package/build/src/library/refusal.d.ts +113 -577
  305. package/build/src/library/refusal.js +64 -51
  306. package/build/src/library/region.d.ts +5 -24
  307. package/build/src/library/region.js +6 -21
  308. package/build/src/library/selection.d.ts +181 -32
  309. package/build/src/library/selection.js +99 -64
  310. package/build/src/mcp/adapter.d.ts +11 -0
  311. package/build/src/mcp/adapter.js +106 -0
  312. package/build/src/mcp/help.d.ts +1 -0
  313. package/build/src/mcp/help.js +26 -0
  314. package/build/src/mcp/index.d.ts +2 -0
  315. package/build/src/mcp/index.js +37 -0
  316. package/build/src/plugin/public.d.ts +1 -1
  317. package/build/src/plugin/runtime.js +17 -14
  318. package/build/src/protocol/arc.d.ts +4 -1
  319. package/build/src/protocol/arc.js +7 -1
  320. package/build/src/protocol/attempt.d.ts +2 -3
  321. package/build/src/protocol/attempt.js +1 -10
  322. package/build/src/protocol/bind.d.ts +6 -7
  323. package/build/src/protocol/bind.js +9 -5
  324. package/build/src/protocol/completion.d.ts +448 -12
  325. package/build/src/protocol/completion.js +164 -26
  326. package/build/src/protocol/deliver.d.ts +26 -24
  327. package/build/src/protocol/deliver.js +24 -52
  328. package/build/src/protocol/delivery-preview.d.ts +97 -247
  329. package/build/src/protocol/delivery-preview.js +132 -128
  330. package/build/src/protocol/execution-observation.d.ts +146 -123
  331. package/build/src/protocol/execution-observation.js +9 -6
  332. package/build/src/protocol/intent.d.ts +9 -48
  333. package/build/src/protocol/intent.js +32 -46
  334. package/build/src/protocol/operations.d.ts +207 -505
  335. package/build/src/protocol/operations.js +81 -134
  336. package/build/src/protocol/placement.d.ts +0 -1
  337. package/build/src/protocol/placement.js +5 -2
  338. package/build/src/protocol/progress.d.ts +7 -97
  339. package/build/src/protocol/progress.js +7 -55
  340. package/build/src/protocol/read/observation.d.ts +13 -6
  341. package/build/src/protocol/read/observation.js +10 -9
  342. package/build/src/protocol/read/status.d.ts +466 -95
  343. package/build/src/protocol/read/status.js +380 -91
  344. package/build/src/protocol/reconcile.d.ts +2 -0
  345. package/build/src/protocol/reconcile.js +12 -11
  346. package/build/src/protocol/reintegrate.d.ts +0 -1
  347. package/build/src/protocol/reintegrate.js +4 -4
  348. package/build/src/protocol/result-leaves.d.ts +528 -0
  349. package/build/src/protocol/result-leaves.js +195 -0
  350. package/build/src/protocol/result-reasons.d.ts +129 -0
  351. package/build/src/protocol/result-reasons.js +87 -0
  352. package/build/src/protocol/review.d.ts +14 -11
  353. package/build/src/protocol/review.js +30 -14
  354. package/build/src/protocol/run.d.ts +4 -4
  355. package/build/src/protocol/run.js +4 -1
  356. package/build/src/protocol/verify.d.ts +359 -30
  357. package/build/src/protocol/verify.js +118 -28
  358. package/build/src/region.d.ts +26 -0
  359. package/build/src/region.js +28 -0
  360. package/build/src/runtime/proc/diagnostic.d.ts +11 -0
  361. package/build/src/runtime/proc/diagnostic.js +20 -0
  362. package/build/src/runtime/proc/windows-launch.exe +0 -0
  363. package/build/src/settings.d.ts +126 -32
  364. package/build/src/settings.js +107 -34
  365. package/build/src/settlement/settle.d.ts +29 -12
  366. package/build/src/settlement/settle.js +22 -15
  367. package/build/src/verification/declaration.d.ts +1 -3
  368. package/build/src/verification/declaration.js +2 -5
  369. package/build/src/verification/execution.d.ts +7 -19
  370. package/build/src/verification/execution.js +37 -16
  371. package/build/src/verification/observation.d.ts +13 -13
  372. package/build/src/verification/observation.js +9 -7
  373. package/build/src/world.d.ts +8 -0
  374. package/build/src/world.js +7 -0
  375. package/package.json +6 -5
  376. package/plugins/paseo/plugin/server/keiyaku.ts +13 -46
  377. package/plugins/paseo/plugin/server/message.ts +8 -30
  378. package/plugins/paseo/plugin/server/mirror.ts +16 -20
  379. package/plugins/paseo/plugin/server/provider.ts +1 -1
  380. package/plugins/paseo/plugin/server/sdk.ts +14 -6
  381. package/plugins/pi/README.md +5 -5
  382. package/plugins/pi/akuma-tools.ts +17 -23
  383. package/skills/keiyaku/SKILL.md +24 -24
  384. package/skills/keiyaku-akuma/SKILL.md +44 -168
  385. package/skills/keiyaku-akuma/references/automation.md +61 -231
  386. package/skills/keiyaku-babysit/SKILL.md +47 -58
  387. package/skills/keiyaku-bind/SKILL.md +44 -185
  388. package/skills/keiyaku-debt/SKILL.md +40 -89
  389. package/skills/keiyaku-workflow/SKILL.md +56 -116
  390. package/build/src/cli/actor.d.ts +0 -10
  391. package/build/src/cli/actor.js +0 -24
  392. package/build/src/cli/akuma-caller.d.ts +0 -3
  393. package/build/src/cli/akuma-caller.js +0 -31
  394. package/build/src/cli/delivery-identity.d.ts +0 -3
  395. package/build/src/cli/render/effects.d.ts +0 -26
  396. package/build/src/cli/render/effects.js +0 -41
  397. package/build/src/cli/selectors.d.ts +0 -10
  398. package/build/src/cli/selectors.js +0 -42
  399. package/build/src/markdown/diff.d.ts +0 -1
  400. package/build/src/markdown/diff.js +0 -4
@@ -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,44 +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))];
741
+ }
742
+ function selectedStatusActivity(snapshot, context) {
743
+ let omitted = false;
744
+ let marked = false;
745
+ return (snapshot.entries ?? []).flatMap((entry) => {
746
+ if (entry.kind === "gap") {
747
+ omitted = true;
748
+ return [];
749
+ }
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];
760
+ });
737
761
  }
738
762
  function snapshotCore(view, context, options) {
739
- const activity = snapshotActivityLines(view.status.timeline, context);
740
- // Static coordinates belong above the content boundary; a dynamic diagnostic stays below it.
741
- 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
+ ];
742
772
  const facts = [
743
- ...contractFacts(view.contract, context.columns - SUBORDINATE_INDENT.length),
773
+ ...contractFacts(view.contract ?? { kind: "none" }, context.columns - SUBORDINATE_INDENT.length),
744
774
  ...(options.facts ?? []),
745
775
  ];
746
776
  return {
747
777
  activity,
748
- head: panelHead(view.status.id, options.alias, view.contract, contextFacts),
778
+ head: panelHead(view.id, options.alias, view.contract, contextFacts),
749
779
  facts,
750
780
  };
751
781
  }
752
782
  function snapshotConclusion(status) {
753
- const timeline = status.timeline;
754
- // The outcome row (`✓` / `!`) is already the ending; a closer would be a second mark carrying no
755
- // new information, so it is absent exactly then.
756
- 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"))
757
786
  return "";
758
- const { mark, verb } = conclusionMarkVerb(status, "life");
759
- 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}`}`;
760
789
  }
761
790
  export function snapshotText(view, context, options = {}) {
762
791
  const core = snapshotCore(view, context, options);
763
- const conclusion = snapshotConclusion(view.status);
792
+ const conclusion = snapshotConclusion(view);
764
793
  const content = [...core.activity, ...(conclusion.length === 0 ? [] : [conclusion])];
765
794
  return [
766
795
  ...core.head,
767
796
  ...(content.length === 0 ? [] : [frameRule(core.head, context.columns), ...content]),
768
797
  ...subordinateLines([
769
- ...renderReportedChangeLines(view.status.timeline),
798
+ ...renderReportedChangeLines(view),
770
799
  ...renderDebtContextLines(view.createdDebts, context.columns - SUBORDINATE_INDENT.length),
771
800
  ...core.facts,
772
801
  ]),
@@ -795,24 +824,24 @@ function answerBytes(answer, structured) {
795
824
  return !structured && typeof answer === "string" ? answer : JSON.stringify(answer);
796
825
  }
797
826
  export function askRawAnswer(result, structured) {
798
- if (result.observation.reason !== "answered")
827
+ if (result.kind !== "answered")
799
828
  return "";
800
- return answerBytes(result.observation.answer, structured === true);
829
+ return result.answerUndefined === true ? "undefined" : answerBytes(result.answer, structured === true);
801
830
  }
802
- export function callRawAnswer(result, streamed) {
803
- const observation = result.observation;
804
- 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")
805
834
  return streamed ? "" : undefined;
806
- return answerBytes(observation.observation.answer, result.structured === true);
835
+ return "answerUndefined" in input ? "undefined" : answerBytes(input.answer, structured);
807
836
  }
808
837
  export function historyRawAnswer(result, historyId) {
809
838
  if (historyId === undefined)
810
839
  return undefined;
811
- if (result.kind === "exact-report")
812
- return result.report.text;
813
- if (result.kind !== "exact")
840
+ if (result.kind === "akuma-report")
841
+ return result.text;
842
+ if (result.kind !== "akuma-exact")
814
843
  return undefined;
815
- const outcome = result.outcome.outcome;
844
+ const outcome = result.outcome;
816
845
  return outcome.kind === "answered" ? outcome.answer : outcome.kind === "canceled" ? "canceled" : outcome.diagnostic;
817
846
  }
818
847
  /** One compact wait result line: an observed life mark, the complete identity, a bounded summary. */
@@ -844,10 +873,11 @@ function waitLine(mark, subject, summary, columns) {
844
873
  * pending input shows its current answered preview or failed diagnostic, else completion. The
845
874
  * mark reports the observed life, never continuing liveness.
846
875
  */
847
- function waitSummary(status) {
848
- const pending = status.timeline.entries.some((entry) => entry.kind === "row" && entry.row.kind === "tell" && entry.row.state === "pending");
849
- const outcome = status.timeline.kind === "idle" ? status.timeline.outcome?.outcome : undefined;
850
- 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 ??
851
881
  (pending
852
882
  ? { mark: "⧗", state: "pending tell" }
853
883
  : outcome === undefined
@@ -861,8 +891,9 @@ function waitSummary(status) {
861
891
  ...observed,
862
892
  summary: [
863
893
  observed.state,
864
- ...(pending && status.life !== "asleep" ? ["pending tell"] : []),
865
- ...(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]),
866
897
  ].join(FACT_SEPARATOR),
867
898
  };
868
899
  }
@@ -872,36 +903,38 @@ function waitSummary(status) {
872
903
  * visible only as the snapshot's own bounded summary.
873
904
  */
874
905
  export function waitText(result, presentation, context) {
875
- const alias = result.observations.length === 1 && result.unobserved.length === 0 ? presentation.alias : undefined;
876
- return [
877
- ...result.observations.map((observation) => {
878
- const { mark, summary } = waitSummary(observation.status);
879
- return waitLine(mark, identity(observation.status.id, alias), summary, context.columns);
880
- }),
881
- ...result.unobserved.map((member) => waitLine("!", safeText(member.id), `observation failed${FACT_SEPARATOR}${member.diagnostic}`, context.columns)),
882
- ].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");
883
917
  }
884
918
  export function historyText(result, presentation, context) {
885
919
  if (presentation.id !== undefined) {
886
- return (historyRawAnswer(result, presentation.id) ??
887
- `${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`;
888
921
  }
889
922
  if (presentation.last === true)
890
- return result.kind === "last" ? result.answer : "no answer retained";
891
- if (result.kind !== "history")
923
+ return result.kind === "akuma-last" ? result.answer : "no answer retained";
924
+ if (result.kind !== "akuma")
892
925
  throw new Error("history result lacks page");
893
- const rows = groupedRows(result.history.rows, context, { history: true });
894
- const paging = result.history.omitted > 0
895
- ? [
896
- omissionMarker(result.history.hasLater
897
- ? `${result.history.omitted} later events · showing first ${result.history.rows.length}`
898
- : `${result.history.omitted} earlier events · showing last ${result.history.rows.length}`, context.columns),
899
- ]
900
- : [];
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
+ ];
901
934
  // History is an immutable timeline, so it takes the shared heading and content boundary and
902
935
  // never gains a fabricated current-state conclusion or a live mark.
903
936
  const content = [...paging, ...rows];
904
- const head = panelHead(result.id, presentation.alias, result.contract);
937
+ const head = panelHead(result.akumaId, presentation.alias, undefined);
905
938
  return [...head, ...(content.length === 0 ? [] : [frameRule(head, context.columns), ...content])].join("\n");
906
939
  }
907
940
  /** One bounded, quoted preview of a Tell an outer receipt already admitted, indented beneath it. */
@@ -917,10 +950,10 @@ export function tellPayloadLines(text, context) {
917
950
  });
918
951
  }
919
952
  /** One admitted Tell as a timeline input row inside a shared panel; the panel owns the identity. */
920
- export function tellAdmissionRow(tell, context) {
921
- 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;
922
955
  return renderBoundedPayload({
923
- text: tell.row.text,
956
+ text,
924
957
  first: lead,
925
958
  continuation: TOP_CONTINUATION,
926
959
  columns: context.columns,
@@ -929,36 +962,43 @@ export function tellAdmissionRow(tell, context) {
929
962
  truncated: false,
930
963
  })[0];
931
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
+ }
932
981
  /**
933
982
  * One Tell action receipt: the delivery verdict and complete subject stand whole on the first line
934
983
  * with the submitted payload folded onto that same line, bounded so only its preview truncates. A
935
984
  * held Tell keeps neutral vocabulary; a failed delivery keeps its concrete diagnosis and native log
936
985
  * coordinates as separate supporting facts.
937
986
  */
938
- export function tellText(result, alias, context) {
939
- const wake = result.tell.wake;
940
- const mark = wake.kind === "failed" ? "!" : wake.kind === "held" ? "⧗" : "✓";
941
- 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";
942
991
  const head = actionReceipt({
943
992
  mark,
944
993
  verb,
945
- id: result.akuma,
994
+ id: result.akumaId,
946
995
  ...(alias === undefined ? {} : { alias }),
947
996
  })[0];
948
- const preview = safeText(result.tell.row.text).replace(/\s+/gu, " ").trim();
997
+ const preview = safeText(prompt).replace(/\s+/gu, " ").trim();
949
998
  const prefix = `${head} — `;
950
999
  // The verdict and identity never truncate, so an over-wide identity still keeps one visible
951
1000
  // ellipsis for the input it could not show.
952
1001
  const room = Math.max(1, context.columns - displayColumns(prefix));
953
1002
  const verdict = preview.length === 0 ? head : `${prefix}${truncateDisplayText(preview, room)}`;
954
- if (wake.kind !== "failed")
955
- return verdict;
956
- const child = "child" in wake ? wake.child : undefined;
957
- return [
958
- verdict,
959
- ...subordinateLines(diagnosticLines("tell delivery", wake.diagnostic, context.columns - SUBORDINATE_INDENT.length, {
960
- state: "failed",
961
- suffix: child === undefined ? "" : ` · log ${child.log.path} ${child.log.from}..${child.log.to}`,
962
- })),
963
- ].join("\n");
1003
+ return [verdict, ...subordinateLines(tellControlLines(result, context))].join("\n");
964
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. */