@astrosheep/keiyaku 4.6.7 → 4.6.9

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 (336) hide show
  1. package/README.md +46 -16
  2. package/build/plugins/claude/.claude-plugin/plugin.json +1 -1
  3. package/build/plugins/claude/skills/keiyaku/SKILL.md +5 -6
  4. package/build/plugins/claude/skills/keiyaku-akuma/SKILL.md +1 -1
  5. package/build/plugins/claude/skills/keiyaku-akuma/references/automation.md +8 -8
  6. package/build/plugins/claude/skills/keiyaku-babysit/SKILL.md +1 -1
  7. package/build/plugins/claude/skills/keiyaku-bind/SKILL.md +9 -9
  8. package/build/plugins/claude/skills/keiyaku-debt/SKILL.md +91 -0
  9. package/build/plugins/claude/skills/keiyaku-workflow/SKILL.md +2 -2
  10. package/build/plugins/codex/.codex-plugin/plugin.json +1 -1
  11. package/build/plugins/codex/skills/keiyaku/SKILL.md +5 -6
  12. package/build/plugins/codex/skills/keiyaku-akuma/SKILL.md +1 -1
  13. package/build/plugins/codex/skills/keiyaku-akuma/references/automation.md +8 -8
  14. package/build/plugins/codex/skills/keiyaku-babysit/SKILL.md +1 -1
  15. package/build/plugins/codex/skills/keiyaku-bind/SKILL.md +9 -9
  16. package/build/plugins/codex/skills/keiyaku-debt/SKILL.md +91 -0
  17. package/build/plugins/codex/skills/keiyaku-workflow/SKILL.md +2 -2
  18. package/build/plugins/opencode/index.js +1 -1
  19. package/build/plugins/opencode/skills/keiyaku/SKILL.md +5 -6
  20. package/build/plugins/opencode/skills/keiyaku-akuma/SKILL.md +1 -1
  21. package/build/plugins/opencode/skills/keiyaku-akuma/references/automation.md +8 -8
  22. package/build/plugins/opencode/skills/keiyaku-babysit/SKILL.md +1 -1
  23. package/build/plugins/opencode/skills/keiyaku-bind/SKILL.md +9 -9
  24. package/build/plugins/opencode/skills/keiyaku-debt/SKILL.md +91 -0
  25. package/build/plugins/opencode/skills/keiyaku-workflow/SKILL.md +2 -2
  26. package/build/plugins/pi/keiyaku.ts +0 -5
  27. package/build/skills/keiyaku/SKILL.md +5 -6
  28. package/build/skills/keiyaku-akuma/SKILL.md +1 -1
  29. package/build/skills/keiyaku-akuma/references/automation.md +8 -8
  30. package/build/skills/keiyaku-babysit/SKILL.md +1 -1
  31. package/build/skills/keiyaku-bind/SKILL.md +9 -9
  32. package/build/skills/keiyaku-debt/SKILL.md +91 -0
  33. package/build/skills/keiyaku-workflow/SKILL.md +2 -2
  34. package/build/src/akuma/akuma-call.d.ts +2 -0
  35. package/build/src/akuma/akuma-call.js +8 -2
  36. package/build/src/akuma/akuma-instance.d.ts +14 -1
  37. package/build/src/akuma/akuma-instance.js +37 -7
  38. package/build/src/akuma/akuma-observe.d.ts +33 -8
  39. package/build/src/akuma/akuma-observe.js +89 -63
  40. package/build/src/akuma/akuma-owner.d.ts +14 -2
  41. package/build/src/akuma/akuma-owner.js +49 -35
  42. package/build/src/akuma/akuma-selection-execution.js +9 -1
  43. package/build/src/akuma/akuma-stream.d.ts +22 -0
  44. package/build/src/akuma/akuma-stream.js +116 -0
  45. package/build/src/akuma/akuma-wait.d.ts +1 -40
  46. package/build/src/akuma/akuma-wait.js +23 -84
  47. package/build/src/akuma/akuma.d.ts +52 -16
  48. package/build/src/akuma/akuma.js +10 -10
  49. package/build/src/akuma/allowed.d.ts +7 -12
  50. package/build/src/akuma/allowed.js +13 -4
  51. package/build/src/akuma/archetype.d.ts +7 -15
  52. package/build/src/akuma/archetype.js +36 -35
  53. package/build/src/akuma/body-supervisor.d.ts +5 -5
  54. package/build/src/akuma/body-supervisor.js +22 -20
  55. package/build/src/akuma/body.d.ts +5 -3
  56. package/build/src/akuma/body.js +57 -8
  57. package/build/src/akuma/call-request.d.ts +30 -32
  58. package/build/src/akuma/call-request.js +10 -3
  59. package/build/src/akuma/caller.d.ts +39 -0
  60. package/build/src/akuma/caller.js +36 -0
  61. package/build/src/akuma/dispatch-association.d.ts +0 -1
  62. package/build/src/akuma/dispatch-association.js +0 -3
  63. package/build/src/akuma/heart/activity-schema.d.ts +12 -0
  64. package/build/src/akuma/heart/activity-schema.js +6 -0
  65. package/build/src/akuma/heart/facts.d.ts +16 -12
  66. package/build/src/akuma/heart/facts.js +8 -0
  67. package/build/src/akuma/heart/index.d.ts +61 -9
  68. package/build/src/akuma/heart/index.js +89 -24
  69. package/build/src/akuma/heart/rows.d.ts +3 -3
  70. package/build/src/akuma/heart/rows.js +5 -3
  71. package/build/src/akuma/heart/soul.d.ts +10 -1
  72. package/build/src/akuma/heart/soul.js +34 -24
  73. package/build/src/akuma/heart/storage.d.ts +20 -0
  74. package/build/src/akuma/heart/storage.js +62 -3
  75. package/build/src/akuma/heart/timeline.d.ts +7 -0
  76. package/build/src/akuma/heart/timeline.js +10 -0
  77. package/build/src/akuma/identity.d.ts +0 -1
  78. package/build/src/akuma/identity.js +2 -5
  79. package/build/src/akuma/index.d.ts +6 -2
  80. package/build/src/akuma/index.js +1 -0
  81. package/build/src/akuma/nuke.js +6 -28
  82. package/build/src/akuma/projection.d.ts +25 -11
  83. package/build/src/akuma/projection.js +24 -7
  84. package/build/src/akuma/provider-recipe.d.ts +18 -6
  85. package/build/src/akuma/provider-recipe.js +24 -1
  86. package/build/src/akuma/provider.d.ts +31 -10
  87. package/build/src/akuma/provider.js +105 -14
  88. package/build/src/akuma/providers/acp/events.js +29 -19
  89. package/build/src/akuma/providers/acp/index.js +2 -3
  90. package/build/src/akuma/providers/claude/events.js +110 -69
  91. package/build/src/akuma/providers/claude/index.d.ts +2 -2
  92. package/build/src/akuma/providers/claude/index.js +4 -8
  93. package/build/src/akuma/providers/codex-app-server/events.js +17 -2
  94. package/build/src/akuma/providers/codex-app-server/index.js +17 -11
  95. package/build/src/akuma/providers/decode.d.ts +33 -0
  96. package/build/src/akuma/providers/decode.js +65 -0
  97. package/build/src/akuma/providers/execution-environment.d.ts +2 -1
  98. package/build/src/akuma/providers/execution-environment.js +3 -0
  99. package/build/src/akuma/providers/grok-build/index.js +16 -48
  100. package/build/src/akuma/providers/index.js +2 -0
  101. package/build/src/akuma/providers/lifecycle.d.ts +9 -0
  102. package/build/src/akuma/providers/lifecycle.js +10 -0
  103. package/build/src/akuma/providers/opencode-sdk/event-stream.d.ts +3 -3
  104. package/build/src/akuma/providers/opencode-sdk/event-stream.js +2 -25
  105. package/build/src/akuma/providers/opencode-sdk/events.d.ts +7 -43
  106. package/build/src/akuma/providers/opencode-sdk/events.js +146 -296
  107. package/build/src/akuma/providers/opencode-sdk/index.js +270 -431
  108. package/build/src/akuma/providers/opencode-sdk/native-http.d.ts +9 -0
  109. package/build/src/akuma/providers/opencode-sdk/native-http.js +69 -0
  110. package/build/src/akuma/providers/opencode-sdk/session.d.ts +42 -36
  111. package/build/src/akuma/providers/opencode-sdk/session.js +75 -84
  112. package/build/src/akuma/providers/paseo/events.d.ts +33 -0
  113. package/build/src/akuma/providers/paseo/events.js +204 -0
  114. package/build/src/akuma/providers/paseo/index.d.ts +9 -0
  115. package/build/src/akuma/providers/paseo/index.js +357 -0
  116. package/build/src/akuma/providers/pi/events.d.ts +2 -0
  117. package/build/src/akuma/providers/pi/events.js +36 -38
  118. package/build/src/akuma/providers/pi/index.js +21 -35
  119. package/build/src/akuma/publication.d.ts +2 -0
  120. package/build/src/akuma/publication.js +5 -0
  121. package/build/src/akuma/request-lifecycle.d.ts +4 -2
  122. package/build/src/akuma/request-lifecycle.js +27 -12
  123. package/build/src/akuma/request-rendezvous.js +38 -55
  124. package/build/src/akuma/request-serve.d.ts +1 -1
  125. package/build/src/akuma/request-serve.js +77 -113
  126. package/build/src/akuma/requests.d.ts +3 -1
  127. package/build/src/akuma/requests.js +32 -0
  128. package/build/src/akuma/selection-observation.d.ts +129 -53
  129. package/build/src/akuma/selection-observation.js +3 -9
  130. package/build/src/akuma/turn-drive.d.ts +3 -0
  131. package/build/src/akuma/turn-drive.js +28 -10
  132. package/build/src/akuma-body.js +12 -22
  133. package/build/src/cli/akuma-caller.d.ts +3 -0
  134. package/build/src/cli/akuma-caller.js +31 -0
  135. package/build/src/cli/commands/akuma-grammar.js +10 -16
  136. package/build/src/cli/commands/akuma.js +25 -55
  137. package/build/src/cli/commands/contract-grammar.d.ts +9 -7
  138. package/build/src/cli/commands/contract-grammar.js +40 -47
  139. package/build/src/cli/commands/contract-help.d.ts +17 -7
  140. package/build/src/cli/commands/contract-help.js +50 -11
  141. package/build/src/cli/commands/contract.js +34 -63
  142. package/build/src/cli/commands/debt-grammar.d.ts +19 -0
  143. package/build/src/cli/commands/debt-grammar.js +323 -0
  144. package/build/src/cli/commands/debt-query.d.ts +5 -0
  145. package/build/src/cli/commands/{task-query.js → debt-query.js} +9 -9
  146. package/build/src/cli/commands/{task.d.ts → debt.d.ts} +2 -2
  147. package/build/src/cli/commands/{task.js → debt.js} +87 -164
  148. package/build/src/cli/coordinates.d.ts +1 -1
  149. package/build/src/cli/coordinates.js +1 -1
  150. package/build/src/cli/parse.d.ts +5 -5
  151. package/build/src/cli/parse.js +17 -16
  152. package/build/src/cli/render/akuma-activity.d.ts +11 -83
  153. package/build/src/cli/render/akuma-activity.js +20 -382
  154. package/build/src/cli/render/catalog.d.ts +4 -7
  155. package/build/src/cli/render/catalog.js +5 -5
  156. package/build/src/cli/render/contract-history.js +3 -6
  157. package/build/src/cli/render/contract.js +17 -52
  158. package/build/src/cli/render/debt.d.ts +28 -0
  159. package/build/src/cli/render/{task.js → debt.js} +55 -133
  160. package/build/src/cli/render/kanshi.js +28 -28
  161. package/build/src/cli/render/marks.d.ts +5 -5
  162. package/build/src/cli/render/marks.js +4 -10
  163. package/build/src/cli/render/nuke.js +1 -1
  164. package/build/src/cli/render/receipt.js +3 -10
  165. package/build/src/cli/runtime.d.ts +1 -1
  166. package/build/src/cli/runtime.js +14 -20
  167. package/build/src/cli/scan.d.ts +1 -1
  168. package/build/src/cli/selectors.d.ts +3 -6
  169. package/build/src/cli/selectors.js +22 -53
  170. package/build/src/cli/usage.d.ts +1 -1
  171. package/build/src/cli/usage.js +4 -4
  172. package/build/src/contract-worktree.js +3 -3
  173. package/build/src/debt/board.d.ts +160 -0
  174. package/build/src/{task → debt}/board.js +89 -89
  175. package/build/src/debt/catalog.d.ts +11 -0
  176. package/build/src/debt/catalog.js +59 -0
  177. package/build/src/{task → debt}/context.d.ts +1 -1
  178. package/build/src/{task → debt}/context.js +1 -1
  179. package/build/src/{task → debt}/created-observation.d.ts +6 -10
  180. package/build/src/{task → debt}/created-observation.js +7 -7
  181. package/build/src/debt/document.d.ts +37 -0
  182. package/build/src/{task → debt}/document.js +37 -37
  183. package/build/src/debt/identity.d.ts +21 -0
  184. package/build/src/{task → debt}/identity.js +35 -35
  185. package/build/src/debt/index.d.ts +111 -0
  186. package/build/src/debt/index.js +203 -0
  187. package/build/src/{task → debt}/input.d.ts +8 -8
  188. package/build/src/{task → debt}/input.js +21 -21
  189. package/build/src/debt/lifecycle-operations.d.ts +6 -0
  190. package/build/src/{task → debt}/lifecycle-operations.js +27 -31
  191. package/build/src/debt/mutation-result.d.ts +981 -0
  192. package/build/src/debt/mutation-result.js +109 -0
  193. package/build/src/debt/mutation.d.ts +424 -0
  194. package/build/src/debt/mutation.js +223 -0
  195. package/build/src/debt/operation-types.d.ts +71 -0
  196. package/build/src/debt/operations.d.ts +28 -0
  197. package/build/src/{task → debt}/operations.js +59 -60
  198. package/build/src/debt/query.d.ts +76 -0
  199. package/build/src/{task → debt}/query.js +55 -55
  200. package/build/src/{task → debt}/store.d.ts +13 -13
  201. package/build/src/{task → debt}/store.js +58 -49
  202. package/build/src/debt/view.d.ts +4 -0
  203. package/build/src/debt/view.js +7 -0
  204. package/build/src/dispatch/index.d.ts +3 -3
  205. package/build/src/dispatch/index.js +1 -2
  206. package/build/src/git/observe.d.ts +6 -2
  207. package/build/src/git/observe.js +6 -2
  208. package/build/src/identity/coordinates.d.ts +1 -1
  209. package/build/src/index.d.ts +17 -17
  210. package/build/src/index.js +11 -11
  211. package/build/src/kanshi/index.d.ts +2 -2
  212. package/build/src/kanshi/read.js +54 -39
  213. package/build/src/kanshi/report.d.ts +7 -7
  214. package/build/src/kanshi/select.js +4 -4
  215. package/build/src/library/address.js +2 -4
  216. package/build/src/library/akuma-creation.d.ts +5 -1
  217. package/build/src/library/akuma-creation.js +27 -47
  218. package/build/src/library/akumas.d.ts +7 -7
  219. package/build/src/library/akumas.js +13 -9
  220. package/build/src/library/bind.d.ts +17 -17
  221. package/build/src/library/bind.js +16 -12
  222. package/build/src/library/contract-address.d.ts +9 -0
  223. package/build/src/library/contract-address.js +71 -0
  224. package/build/src/library/contract-composition.d.ts +4 -7
  225. package/build/src/library/contract-composition.js +6 -18
  226. package/build/src/library/contract-creation.d.ts +3 -5
  227. package/build/src/library/contract-creation.js +24 -22
  228. package/build/src/library/contract-execution.js +21 -26
  229. package/build/src/library/contract-outcomes.d.ts +2 -14
  230. package/build/src/library/contract-outcomes.js +2 -13
  231. package/build/src/library/contract-types.d.ts +38 -4
  232. package/build/src/library/delivery.d.ts +0 -2
  233. package/build/src/library/delivery.js +2 -5
  234. package/build/src/library/input.d.ts +2 -2
  235. package/build/src/library/input.js +5 -5
  236. package/build/src/library/invocation.js +2 -2
  237. package/build/src/library/keiyaku.d.ts +0 -5
  238. package/build/src/library/keiyaku.js +6 -12
  239. package/build/src/library/nuke.js +3 -3
  240. package/build/src/library/outcome.d.ts +626 -625
  241. package/build/src/library/outcome.js +13 -3
  242. package/build/src/library/reconcile.js +8 -16
  243. package/build/src/library/refusal.d.ts +2 -2
  244. package/build/src/library/repo.d.ts +3 -2
  245. package/build/src/library/repo.js +10 -5
  246. package/build/src/library/selection.d.ts +5 -8
  247. package/build/src/library/selection.js +22 -73
  248. package/build/src/plugin/akuma-signals.d.ts +2 -0
  249. package/build/src/plugin/akuma-signals.js +4 -0
  250. package/build/src/plugin/public.d.ts +32 -2
  251. package/build/src/plugin/runtime.js +5 -3
  252. package/build/src/protocol/amend.js +3 -2
  253. package/build/src/protocol/attempt.js +3 -8
  254. package/build/src/protocol/bind.d.ts +2 -2
  255. package/build/src/protocol/bind.js +1 -1
  256. package/build/src/protocol/deliver.js +3 -3
  257. package/build/src/protocol/operations.d.ts +1 -3
  258. package/build/src/protocol/operations.js +0 -8
  259. package/build/src/protocol/outcome.d.ts +1 -2
  260. package/build/src/protocol/outcome.js +1 -13
  261. package/build/src/protocol/placement.js +3 -10
  262. package/build/src/protocol/read/status.js +31 -70
  263. package/build/src/protocol/reintegrate.js +3 -10
  264. package/build/src/protocol/review.js +3 -3
  265. package/build/src/protocol/run.d.ts +5 -1
  266. package/build/src/protocol/run.js +3 -3
  267. package/build/src/runtime/proc/windows-launch.exe +0 -0
  268. package/build/src/settlement/fence.d.ts +3 -3
  269. package/build/src/settlement/fence.js +4 -4
  270. package/build/src/settlement/holder.d.ts +16 -16
  271. package/build/src/settlement/holder.js +69 -63
  272. package/build/src/settlement/settle.d.ts +5 -5
  273. package/build/src/settlement/settle.js +53 -53
  274. package/package.json +19 -9
  275. package/plugins/paseo/plugin/index.server.ts +17 -0
  276. package/plugins/paseo/plugin/paseo-plugin.json +4 -0
  277. package/plugins/paseo/plugin/server/attach.ts +52 -0
  278. package/plugins/paseo/plugin/server/keiyaku.ts +44 -0
  279. package/plugins/paseo/plugin/server/message.ts +60 -0
  280. package/plugins/paseo/plugin/server/mirror.ts +193 -0
  281. package/plugins/paseo/plugin/server/model.ts +14 -0
  282. package/plugins/paseo/plugin/server/provider.ts +276 -0
  283. package/plugins/paseo/plugin/server/sdk-worker.ts +237 -0
  284. package/plugins/paseo/plugin/server/sdk.ts +289 -0
  285. package/plugins/paseo/plugin/server/stop.ts +26 -0
  286. package/plugins/paseo/plugin/server/transport.ts +35 -0
  287. package/plugins/paseo/plugin/shared/attach-rpc.ts +10 -0
  288. package/plugins/paseo/plugin/shared/refresh-rpc.ts +6 -0
  289. package/plugins/paseo/plugin/tsconfig.json +6 -0
  290. package/plugins/pi/keiyaku.ts +57 -0
  291. package/skills/keiyaku/SKILL.md +43 -0
  292. package/skills/keiyaku-akuma/SKILL.md +130 -0
  293. package/skills/keiyaku-akuma/references/automation.md +269 -0
  294. package/skills/keiyaku-babysit/SKILL.md +65 -0
  295. package/skills/keiyaku-bind/SKILL.md +216 -0
  296. package/skills/keiyaku-bind/agents/openai.yaml +4 -0
  297. package/skills/keiyaku-debt/SKILL.md +91 -0
  298. package/skills/keiyaku-workflow/SKILL.md +129 -0
  299. package/build/plugins/claude/skills/keiyaku-task/SKILL.md +0 -104
  300. package/build/plugins/codex/skills/keiyaku-task/SKILL.md +0 -104
  301. package/build/plugins/opencode/skills/keiyaku-task/SKILL.md +0 -104
  302. package/build/skills/keiyaku-task/SKILL.md +0 -104
  303. package/build/src/cli/commands/amend.d.ts +0 -12
  304. package/build/src/cli/commands/amend.js +0 -10
  305. package/build/src/cli/commands/bind.d.ts +0 -11
  306. package/build/src/cli/commands/bind.js +0 -23
  307. package/build/src/cli/commands/task-grammar.d.ts +0 -19
  308. package/build/src/cli/commands/task-grammar.js +0 -384
  309. package/build/src/cli/commands/task-query.d.ts +0 -5
  310. package/build/src/cli/render/task.d.ts +0 -41
  311. package/build/src/dispatch/association.d.ts +0 -1
  312. package/build/src/dispatch/association.js +0 -1
  313. package/build/src/task/board.d.ts +0 -168
  314. package/build/src/task/catalog.d.ts +0 -11
  315. package/build/src/task/catalog.js +0 -59
  316. package/build/src/task/compose-language.d.ts +0 -57
  317. package/build/src/task/compose-language.js +0 -364
  318. package/build/src/task/compose-parser.d.ts +0 -32
  319. package/build/src/task/compose-parser.js +0 -180
  320. package/build/src/task/compose.d.ts +0 -16
  321. package/build/src/task/compose.js +0 -189
  322. package/build/src/task/document.d.ts +0 -39
  323. package/build/src/task/identity.d.ts +0 -21
  324. package/build/src/task/index.d.ts +0 -138
  325. package/build/src/task/index.js +0 -269
  326. package/build/src/task/lifecycle-operations.d.ts +0 -6
  327. package/build/src/task/mutation-result.d.ts +0 -1726
  328. package/build/src/task/mutation-result.js +0 -198
  329. package/build/src/task/mutation.d.ts +0 -590
  330. package/build/src/task/mutation.js +0 -262
  331. package/build/src/task/operation-types.d.ts +0 -71
  332. package/build/src/task/operations.d.ts +0 -28
  333. package/build/src/task/query.d.ts +0 -76
  334. package/build/src/task/view.d.ts +0 -4
  335. package/build/src/task/view.js +0 -7
  336. /package/build/src/{task → debt}/operation-types.js +0 -0
@@ -11,8 +11,8 @@ import { contractRequestCommands } from "./library/contract-operations.js";
11
11
  import { createKeiyakuHandle } from "./library/keiyaku.js";
12
12
  import { Repo } from "./library/repo.js";
13
13
  import { settings } from "./settings.js";
14
- import { Tasks } from "./task/index.js";
15
- import { taskMutationRequestCommands } from "./task/mutation.js";
14
+ import { Debts } from "./debt/index.js";
15
+ import { debtMutationRequestCommands } from "./debt/mutation.js";
16
16
  import { World } from "./world.js";
17
17
  async function contractDependencies(repoRoot, processConfiguration) {
18
18
  const repo = await Repo.at({
@@ -68,35 +68,25 @@ function contractUpstream(processConfiguration) {
68
68
  },
69
69
  };
70
70
  }
71
- const TASK_LIFECYCLE = {
72
- start: async (handle, input) => await handle.start(input),
73
- stop: async (handle, input) => await handle.stop(input),
74
- hold: async (handle, input) => await handle.hold(input),
75
- resume: async (handle, input) => await handle.resume(input),
71
+ const DEBT_LIFECYCLE = {
76
72
  done: async (handle, input) => await handle.done(input),
77
73
  drop: async (handle, input) => await handle.drop(input),
78
74
  };
79
75
  /**
80
- * The upper Body edge composes the forced-local Tasks SDK the descriptor
76
+ * The upper Body edge composes the forced-local Debts SDK the descriptor
81
77
  * execution entries consume. Each ability is one ordinary local product
82
- * operation; no generic task(request) dispatcher is introduced here.
78
+ * operation; no generic debt(request) dispatcher is introduced here.
83
79
  */
84
- function taskMutationRequestPort() {
80
+ function debtMutationRequestPort() {
85
81
  return {
86
- add: async ({ world, options }) => await Tasks.of(world).add(options),
87
- addDocument: async ({ world, document }) => await Tasks.of(world).addDocument(document),
88
- compose: async ({ world, markdown, defaultNamespace, actor, signal }) => await Tasks.of(world).compose({
89
- markdown,
90
- namespace: defaultNamespace,
91
- actor,
92
- ...(signal === undefined ? {} : { signal }),
93
- }),
94
- update: async ({ world, id, options }) => await Tasks.of(world).task({ id }).update(options),
95
- lifecycle: async ({ world, verb, id, note, signal }) => await TASK_LIFECYCLE[verb](Tasks.of(world).task({ id }), {
82
+ add: async ({ world, options }) => await Debts.of(world).add(options),
83
+ addDocument: async ({ world, document }) => await Debts.of(world).addDocument(document),
84
+ update: async ({ world, id, options }) => await Debts.of(world).debt({ id }).update(options),
85
+ lifecycle: async ({ world, verb, id, note, signal }) => await DEBT_LIFECYCLE[verb](Debts.of(world).debt({ id }), {
96
86
  ...(note === undefined ? {} : { note }),
97
87
  ...(signal === undefined ? {} : { signal }),
98
88
  }),
99
- batch: async ({ world, verb, ids, note, signal }) => await Tasks.of(world).batch({
89
+ batch: async ({ world, verb, ids, note, signal }) => await Debts.of(world).batch({
100
90
  verb,
101
91
  ids,
102
92
  ...(note === undefined ? {} : { note }),
@@ -110,7 +100,7 @@ export async function externalRequestCommandsFor(launch, processConfiguration) {
110
100
  world,
111
101
  commands: composeRequestCommands(selectionRequestCommands(selectionRequestPort(world, (message) => {
112
102
  void recordPluginDiagnostic(launch.paths, "outcome observation", message);
113
- })), contractRequestCommands(contractUpstream(processConfiguration)), taskMutationRequestCommands(taskMutationRequestPort())),
103
+ })), contractRequestCommands(contractUpstream(processConfiguration)), debtMutationRequestCommands(debtMutationRequestPort())),
114
104
  };
115
105
  }
116
106
  function bodyProcessConfiguration() {
@@ -0,0 +1,3 @@
1
+ import { type AkumaCaller } from "../akuma/caller.js";
2
+ /** Environment attribution belongs to the process edge, never SDK admission. */
3
+ export declare function akumaCallerFromEnvironment(environment: NodeJS.ProcessEnv): Promise<AkumaCaller | undefined>;
@@ -0,0 +1,31 @@
1
+ import { decodeAkumaCaller } from "../akuma/caller.js";
2
+ import { World } from "../world.js";
3
+ /** Environment attribution belongs to the process edge, never SDK admission. */
4
+ export async function akumaCallerFromEnvironment(environment) {
5
+ const id = environment.KEIYAKU_ACTOR_ID;
6
+ const world = environment.KEIYAKU_ACTOR_WORLD;
7
+ if ((id === undefined) !== (world === undefined)) {
8
+ throw new TypeError("Akuma caller requires both KEIYAKU_ACTOR_ID and KEIYAKU_ACTOR_WORLD");
9
+ }
10
+ if (id !== undefined && world !== undefined) {
11
+ const resolved = await World.resolve({ cwd: world, repositoryRoot: world });
12
+ return decodeAkumaCaller({ kind: "akuma", akuId: id, world: resolved.candidate });
13
+ }
14
+ const hosts = [
15
+ { integration: "codex", id: environment.CODEX_THREAD_ID },
16
+ { integration: "pi", id: environment.PI_SESSION_ID },
17
+ { integration: "claude", id: environment.CLAUDE_CODE_SESSION_ID },
18
+ ].filter(({ id }) => id !== undefined && id !== "");
19
+ if (hosts.length > 1) {
20
+ throw new TypeError(`Ambiguous native host caller: ${hosts.map(({ integration }) => integration).join(", ")}`);
21
+ }
22
+ if (hosts[0])
23
+ return decodeAkumaCaller({ kind: "external", ...hosts[0] });
24
+ const external = environment.KEIYAKU_EXTERNAL_CALLER;
25
+ if (external === undefined)
26
+ return undefined;
27
+ const colon = external.indexOf(":");
28
+ if (colon < 0)
29
+ throw new TypeError("KEIYAKU_EXTERNAL_CALLER must be <integration>:<id>");
30
+ return decodeAkumaCaller({ kind: "external", integration: external.slice(0, colon), id: external.slice(colon + 1) });
31
+ }
@@ -48,10 +48,9 @@ const AKUMA_COMMAND_SPECS = {
48
48
  details: [
49
49
  "The default mode is any; --all waits until every selected Akuma completes.",
50
50
  "An already completed member counts immediately, so repeating a selection can return at once.",
51
- "Akuma names, completed activity, and the final result stream on stderr.",
52
- "A streamed plural wait leaves stdout empty, and so does a single wait with no answer.",
53
- "Only a single selected Akuma that answered writes to stdout, exactly its answer.",
54
- "With --json nothing streams and stdout carries the result document.",
51
+ "Text prints each selected Akuma's status snapshot, then one failure fact for any Akuma it could not read.",
52
+ "An answer is part of that snapshot; wait writes no separate copy of it to stdout.",
53
+ "With --json stdout carries the result document.",
55
54
  ].join("\n"),
56
55
  },
57
56
  tell: {
@@ -175,11 +174,6 @@ function positiveIndex(raw, option, fail) {
175
174
  fail(`${option} exceeds the safe integer range`);
176
175
  return value;
177
176
  }
178
- function validateDirect(value, _fail) {
179
- // Address validation belongs to the operation boundary so callers receive
180
- // the compact Akuma refusal instead of a generic usage page.
181
- return value;
182
- }
183
177
  function validateSet(value, fail) {
184
178
  if (value.startsWith("kei/"))
185
179
  return value;
@@ -192,7 +186,7 @@ function validateSet(value, fail) {
192
186
  }
193
187
  return value;
194
188
  }
195
- return validateDirect(value, fail);
189
+ return value;
196
190
  }
197
191
  function parseWait(rawSelectors, flags, output, fail) {
198
192
  if (flags.any === true && flags.all === true)
@@ -236,7 +230,7 @@ function parseAkumaHistory(selector, flags, output, fail) {
236
230
  fail("history --id requires turn/<positive safe integer>");
237
231
  return {
238
232
  command: "history",
239
- akuma: validateDirect(selector, fail),
233
+ akuma: selector,
240
234
  ...(id === undefined ? {} : { id }),
241
235
  last: flags.last === true,
242
236
  ...(flags.before === undefined ? {} : { before: positiveIndex(flags.before, "--before", fail) }),
@@ -256,7 +250,7 @@ function parseAddressed(action, rawSelectors, flags, output, fail) {
256
250
  fail("history accepts one complete aku/..., @alias, or kei/... selector");
257
251
  return parseHistory(selector, flags, output, fail);
258
252
  }
259
- const akuma = validateDirect(rawSelectors[0], fail);
253
+ const akuma = rawSelectors[0];
260
254
  const at = stringFlag(flags.at, "fork requires --at <historyId>", fail);
261
255
  return { command: action, akuma, at, output };
262
256
  }
@@ -279,10 +273,10 @@ function parsePrompted(action, positionals, stdin, fail) {
279
273
  : { prompt: { kind: "argument", value: argument } }),
280
274
  };
281
275
  }
282
- function parseTell(flags, subject, prompt, output, fail) {
276
+ function parseTell(flags, subject, prompt, output) {
283
277
  return {
284
278
  command: "tell",
285
- akuma: validateDirect(subject, fail),
279
+ akuma: subject,
286
280
  interrupt: flags.interrupt === true,
287
281
  prompt,
288
282
  output,
@@ -292,7 +286,7 @@ function parseAsk(flags, subject, prompt, output, fail) {
292
286
  const schema = flags.schema === undefined ? undefined : stringFlag(flags.schema, "ask --schema requires a file", fail);
293
287
  return {
294
288
  command: "ask",
295
- akuma: validateDirect(subject, fail),
289
+ akuma: subject,
296
290
  interrupt: flags.interrupt === true,
297
291
  ...(schema === undefined ? {} : { schema }),
298
292
  ...(flags.wait === undefined ? {} : { timeoutMs: parseDuration(flags.wait, "--wait", fail) }),
@@ -361,7 +355,7 @@ export function parseAkumaCommand(argv) {
361
355
  return action === "call"
362
356
  ? parseCall(flags, parsed.subject, parsed.prompt, output, fail)
363
357
  : action === "tell"
364
- ? parseTell(flags, parsed.subject, parsed.prompt, output, fail)
358
+ ? parseTell(flags, parsed.subject, parsed.prompt, output)
365
359
  : parseAsk(flags, parsed.subject, parsed.prompt, output, fail);
366
360
  }
367
361
  if (spec.arity === "one-or-more" ? positionals.length === 0 : positionals.length !== spec.arity) {
@@ -1,3 +1,4 @@
1
+ import { akumaCallerFromEnvironment } from "../akuma-caller.js";
1
2
  import { CliUsageError, isBlankInput } from "../usage.js";
2
3
  import { readFile } from "node:fs/promises";
3
4
  import { resolve } from "node:path";
@@ -13,8 +14,8 @@ import { World } from "../../world.js";
13
14
  import { contractFromInput } from "../selectors.js";
14
15
  import { ActivityDriver } from "../activity.js";
15
16
  import { displayContext, emit, resultContext, writeJson, writeStderr, writeStdout } from "../streams.js";
16
- import { callObservationStream, inputWaitStream, waitObservationStream, } from "../render/akuma-activity.js";
17
- import { askRawAnswer, callRawAnswer, historyRawAnswer, historyText, tellText, waitRawAnswer, waitText, } from "../render/akuma-activity.js";
17
+ import { callObservationStream, inputWaitStream } from "../render/akuma-activity.js";
18
+ import { askRawAnswer, callRawAnswer, historyRawAnswer, historyText, tellText, waitText, } from "../render/akuma-activity.js";
18
19
  import { askExitCode, askProgressStream, callExitCode, callObservationHead, forkExitCode, historyExitCode, killExitCode, renderCallText, renderForkText, renderKillText, tellExitCode, waitedTellProgress, } from "../render/akuma.js";
19
20
  export { isParsedAkumaCommand, renderAkumaHelp } from "./akuma-grammar.js";
20
21
  // ---------------------------------------------------------------------------
@@ -27,7 +28,7 @@ async function settingsAt(root, home) {
27
28
  });
28
29
  }
29
30
  function akumas(input) {
30
- return akumasWithExecution(input.path, input.execution);
31
+ return akumasWithExecution(input.path, input.execution, { reportDiagnostic: writeStderr });
31
32
  }
32
33
  async function schemaFromFile(path) {
33
34
  try {
@@ -49,17 +50,6 @@ async function promptBody(action, command, input) {
49
50
  throw new CliUsageError(`${action} requires a nonblank prompt`);
50
51
  return bytes;
51
52
  }
52
- function waitObserver(stream, driver, onSelected) {
53
- return {
54
- selected: (selected) => {
55
- onSelected?.(selected);
56
- stream.select(selected);
57
- },
58
- observe: (observed) => {
59
- driver.settle(stream.observe(observed), stream.frame());
60
- },
61
- };
62
- }
63
53
  async function inputInitiator(input) {
64
54
  let initiator;
65
55
  try {
@@ -68,9 +58,7 @@ async function inputInitiator(input) {
68
58
  catch { }
69
59
  if (initiator === undefined)
70
60
  return {};
71
- // Plugins coordinate within an established World; a `call` may run where the
72
- // marker does not exist yet, and activating there would only fail noisily.
73
- // The initiator still travels with the request either way.
61
+ // Identity preparation needs established plugin custody, not just a candidate.
74
62
  if (!(await World.established(input.path)))
75
63
  return { initiator };
76
64
  await emitPluginSignal({
@@ -90,9 +78,15 @@ function emitAnswer(body, exact) {
90
78
  async function runCall(command, input) {
91
79
  const body = command.prompt === undefined ? undefined : await promptBody("call", { prompt: command.prompt }, input);
92
80
  const schema = command.schema === undefined ? undefined : await schemaFromFile(command.schema);
81
+ const declaredCaller = executionChannel(input.execution).kind === "body-request"
82
+ ? undefined
83
+ : await akumaCallerFromEnvironment(input.environment);
84
+ // Establish the selected World before preparing the submitting Square route.
85
+ await World.at(input.path);
93
86
  const caller = akumas(input);
94
87
  const request = {
95
88
  ...(await inputInitiator(input)),
89
+ ...(declaredCaller === undefined ? {} : { caller: declaredCaller }),
96
90
  archetype: command.archetype,
97
91
  ...(body === undefined ? {} : { body }),
98
92
  ...(input.home === undefined ? {} : { home: input.home }),
@@ -157,46 +151,19 @@ async function runCall(command, input) {
157
151
  }
158
152
  async function runWait(command, input) {
159
153
  const alias = command.akuma.length === 1 ? inputAlias(command.akuma[0]) : undefined;
160
- const stream = command.output === "text" ? waitObservationStream(resultContext()) : undefined;
161
- const driver = new ActivityDriver(process.stderr);
162
- const startedAt = Date.now();
163
- let selection;
164
- const observer = stream === undefined
165
- ? undefined
166
- : waitObserver(stream, driver, (selected) => {
167
- selection = selected;
168
- });
169
- try {
170
- const result = await akumas(input).wait({
171
- akuma: command.akuma,
172
- ...(input.repo === undefined ? {} : { repo: input.repo }),
173
- ...(command.completion === undefined ? {} : { completion: command.completion }),
174
- ...(command.timeoutMs === undefined ? {} : { timeoutMs: command.timeoutMs }),
175
- ...(input.signal === undefined ? {} : { signal: input.signal }),
176
- ...(observer === undefined ? {} : { observe: observer }),
177
- });
178
- const streamed = stream !== undefined && stream.streamed();
179
- if (stream !== undefined && streamed)
180
- driver.conclude(stream.conclude(result));
181
- const presentation = {
182
- ...(alias === undefined ? {} : { alias }),
183
- ...(selection === undefined ? {} : { selection }),
184
- startedAt,
185
- };
186
- if (command.output === "json") {
187
- writeJson(result);
188
- return 0;
189
- }
190
- const raw = waitRawAnswer(result, streamed);
191
- if (raw === undefined)
192
- emitAnswer(waitText(result, presentation, displayContext()), false);
193
- else
194
- emitAnswer(raw, true);
154
+ const result = await akumas(input).wait({
155
+ akuma: command.akuma,
156
+ ...(input.repo === undefined ? {} : { repo: input.repo }),
157
+ ...(command.completion === undefined ? {} : { completion: command.completion }),
158
+ ...(command.timeoutMs === undefined ? {} : { timeoutMs: command.timeoutMs }),
159
+ ...(input.signal === undefined ? {} : { signal: input.signal }),
160
+ });
161
+ if (command.output === "json") {
162
+ writeJson(result);
195
163
  return 0;
196
164
  }
197
- finally {
198
- driver.close(stream?.flush() ?? []);
199
- }
165
+ emitAnswer(waitText(result, { ...(alias === undefined ? {} : { alias }) }, displayContext()), false);
166
+ return 0;
200
167
  }
201
168
  async function runTell(command, input) {
202
169
  const body = await promptBody("tell", command, input);
@@ -287,7 +254,10 @@ async function runHistory(command, input) {
287
254
  return historyExitCode(result, command.id);
288
255
  }
289
256
  async function runFork(command, input) {
257
+ const caller = await akumaCallerFromEnvironment(input.environment);
290
258
  const receipt = await akumas(input).fork({
259
+ ...(await inputInitiator(input)),
260
+ ...(caller === undefined ? {} : { caller }),
291
261
  akuma: command.akuma,
292
262
  at: command.at,
293
263
  ...(input.repo === undefined ? {} : { repo: input.repo }),
@@ -1,6 +1,6 @@
1
1
  import { type ContractCommand } from "./contract-help.js";
2
2
  type CatalogQuery = Readonly<{
3
- kind: "tasks";
3
+ kind: "debts";
4
4
  namespace?: readonly string[];
5
5
  limit?: number;
6
6
  }> | Readonly<{
@@ -23,8 +23,9 @@ type Actor = Readonly<{
23
23
  export type ParsedBind = Output & Actor & Readonly<{
24
24
  command: "bind";
25
25
  forkOf?: string;
26
- task?: string;
27
- target?: string;
26
+ debt?: string;
27
+ /** A literal target branch, or `null` for a deliberately targetless bind. */
28
+ target?: string | null;
28
29
  after?: readonly string[];
29
30
  gates?: readonly string[];
30
31
  }>;
@@ -60,19 +61,21 @@ export type ParsedAbandon = Output & Actor & Readonly<{
60
61
  contract?: string;
61
62
  note?: string;
62
63
  }>;
64
+ export type ParsedShow = Output & Readonly<{
65
+ command: "show";
66
+ contract?: string;
67
+ }>;
63
68
  export type ParsedStatus = Output & (Readonly<{
64
69
  command: "status";
65
70
  contract?: string;
66
71
  selectors?: readonly string[];
67
72
  akuma?: never;
68
- guidance?: true;
69
73
  category?: never;
70
74
  limit?: never;
71
75
  }> | Readonly<{
72
76
  command: "status";
73
77
  contract: string;
74
78
  akuma: true;
75
- guidance?: never;
76
79
  category?: never;
77
80
  limit?: never;
78
81
  }> | Readonly<{
@@ -82,7 +85,6 @@ export type ParsedStatus = Output & (Readonly<{
82
85
  contract?: never;
83
86
  selectors?: never;
84
87
  akuma?: never;
85
- guidance?: never;
86
88
  }>);
87
89
  export type ParsedLs = Output & Readonly<{
88
90
  command: "ls";
@@ -119,7 +121,7 @@ export type ParsedContractParts = Readonly<{
119
121
  output: "text" | "json";
120
122
  actor?: string;
121
123
  }>;
122
- export type ParsedContractCommand = ParsedBind | ParsedAmend | ParsedDeliver | ParsedReview | ParsedArc | ParsedAbandon | ParsedStatus | ParsedLs | ParsedAudit | ParsedReconcile | ParsedNuke | ParsedSettings | ParsedRegion;
124
+ export type ParsedContractCommand = ParsedBind | ParsedAmend | ParsedDeliver | ParsedReview | ParsedArc | ParsedAbandon | ParsedShow | ParsedStatus | ParsedLs | ParsedAudit | ParsedReconcile | ParsedNuke | ParsedSettings | ParsedRegion;
123
125
  export type StatusCategory = "akuma" | "contract";
124
126
  export declare function parseContractCommand(parts: ParsedContractParts): ParsedContractCommand;
125
127
  export {};
@@ -1,5 +1,5 @@
1
- import { archetypeName } from "../../akuma/identity.js";
2
- import { parseTaskNamespaceSelector } from "../../task/catalog.js";
1
+ import { validateAkumaName } from "../../identity/normalize.js";
2
+ import { parseDebtNamespaceSelector } from "../../debt/catalog.js";
3
3
  import { CliUsageError, commandGuide } from "../usage.js";
4
4
  import { CONTRACT_COMMAND_SPECS } from "./contract-help.js";
5
5
  function parseAkumaCatalogPath(value) {
@@ -9,11 +9,11 @@ function parseAkumaCatalogPath(value) {
9
9
  return { kind: "akuma" };
10
10
  const scopedGlob = /^aku\/([^/]+)\/\*$/u.exec(value);
11
11
  if (scopedGlob !== null)
12
- return { kind: "akuma", archetype: archetypeName(scopedGlob[1]) };
12
+ return { kind: "akuma", archetype: validateAkumaName(scopedGlob[1]) };
13
13
  const match = /^aku\/([^/]+)\/?$/u.exec(value);
14
14
  if (match === null)
15
15
  return null;
16
- return { kind: "akuma", archetype: archetypeName(match[1]) };
16
+ return { kind: "akuma", archetype: validateAkumaName(match[1]) };
17
17
  }
18
18
  function optionalFlag(flags, name) {
19
19
  const value = flags[name];
@@ -41,16 +41,23 @@ function parseGateNames(parts, command) {
41
41
  }
42
42
  return names;
43
43
  }
44
+ function parseBindTarget(parts) {
45
+ const target = optionalFlag(parts.flags, "target");
46
+ const noTarget = parts.flags["no-target"] === true;
47
+ if (target !== undefined && noTarget)
48
+ refuse("bind", "--target and --no-target are mutually exclusive");
49
+ return noTarget ? null : target;
50
+ }
44
51
  function parseBind(parts) {
45
52
  const forkOf = optionalFlag(parts.flags, "fork-of");
46
53
  if (forkOf !== undefined) {
47
54
  if (parts.stdin)
48
55
  refuse("bind", "fork bind reads no stdin");
49
- for (const option of ["task", "after", "gates"]) {
56
+ for (const option of ["debt", "after", "gates"]) {
50
57
  if (parts.flags[option] !== undefined)
51
58
  refuse("bind", `--${option} is not valid with --fork-of`);
52
59
  }
53
- const target = optionalFlag(parts.flags, "target");
60
+ const target = parseBindTarget(parts);
54
61
  return {
55
62
  command: "bind",
56
63
  forkOf,
@@ -61,13 +68,13 @@ function parseBind(parts) {
61
68
  }
62
69
  if (!parts.stdin)
63
70
  refuse("bind", "bind requires stdin");
64
- const task = optionalFlag(parts.flags, "task");
65
- const target = optionalFlag(parts.flags, "target");
71
+ const debt = optionalFlag(parts.flags, "debt");
72
+ const target = parseBindTarget(parts);
66
73
  const after = parts.flags.after === undefined ? [] : Array.isArray(parts.flags.after) ? parts.flags.after : [parts.flags.after];
67
74
  const gates = parseGateNames(parts, "bind");
68
75
  return {
69
76
  command: "bind",
70
- ...(task === undefined ? {} : { task }),
77
+ ...(debt === undefined ? {} : { debt }),
71
78
  ...(target === undefined ? {} : { target }),
72
79
  ...(parts.flags.after === undefined ? {} : { after }),
73
80
  ...(gates === undefined ? {} : { gates }),
@@ -142,29 +149,20 @@ function rejectStatusGlobs(positionals) {
142
149
  refuse("status", `unsupported status glob: ${selector}`);
143
150
  }
144
151
  }
145
- function parseStatusGuidance(parts, limit) {
146
- if (limit !== undefined)
147
- refuse("status", "--limit is not valid with --guidance");
152
+ function showSelector(parts) {
148
153
  const selected = parts.positionals[0];
149
154
  if (selected !== undefined && STATUS_CATEGORY_SELECTORS.has(selected))
150
- refuse("status", "--guidance cannot select a category");
155
+ refuse("show", "show cannot select a category");
151
156
  if (parts.positionals.length > 1)
152
- refuse("status", "--guidance accepts at most one Contract selector");
157
+ refuse("show", "show accepts at most one Contract selector");
153
158
  if (selected?.startsWith("aku/") === true)
154
- refuse("status", "--guidance cannot select an Akuma");
159
+ refuse("show", "show cannot select an Akuma");
155
160
  if (selected !== undefined && !selected.startsWith("@") && /[*?\[\]]/u.test(selected))
156
- refuse("status", `unsupported status glob: ${selected}`);
157
- return {
158
- command: "status",
159
- ...(selected === undefined ? {} : { contract: selected }),
160
- guidance: true,
161
- output: parts.output,
162
- };
161
+ refuse("show", `unsupported show glob: ${selected}`);
162
+ return selected;
163
163
  }
164
164
  function parseStatus(parts) {
165
165
  const limit = listLimit(parts, "status");
166
- if (parts.flags.guidance === true)
167
- return parseStatusGuidance(parts, limit);
168
166
  rejectStatusGlobs(parts.positionals);
169
167
  if (parts.positionals.length > 1) {
170
168
  if (limit !== undefined)
@@ -196,38 +194,29 @@ function parseRegion(parts) {
196
194
  output: parts.output,
197
195
  };
198
196
  }
199
- function akumaCatalogQuery(query, parts) {
200
- const limit = optionalFlag(parts.flags, "limit");
201
- if (limit !== undefined && (!/^[1-9][0-9]*$/u.test(limit) || !Number.isSafeInteger(Number(limit))))
202
- refuse("ls", "--limit requires a positive safe integer");
203
- return {
204
- ...query,
205
- ...(limit === undefined ? {} : { limit: Number(limit) }),
206
- };
207
- }
208
197
  function listLimit(parts, command = "ls") {
209
198
  const limit = optionalFlag(parts.flags, "limit");
210
199
  if (limit !== undefined && (!/^[1-9][0-9]*$/u.test(limit) || !Number.isSafeInteger(Number(limit))))
211
200
  refuse(command, "--limit requires a positive safe integer");
212
201
  return limit === undefined ? undefined : Number(limit);
213
202
  }
214
- function taskCatalogQuery(path, limit) {
215
- if (path === "task" || path === "task/") {
216
- return { kind: "tasks", namespace: [], ...(limit === undefined ? {} : { limit }) };
203
+ function debtCatalogQuery(path, limit) {
204
+ if (path === "debt" || path === "debt/") {
205
+ return { kind: "debts", namespace: [], ...(limit === undefined ? {} : { limit }) };
217
206
  }
218
- if (!path.startsWith("task/"))
207
+ if (!path.startsWith("debt/"))
219
208
  return null;
220
209
  if (!path.endsWith("/"))
221
- refuse("ls", `invalid Task namespace selector: ${path}`);
222
- const body = path.slice("task/".length, -1);
210
+ refuse("ls", `invalid Debt namespace selector: ${path}`);
211
+ const body = path.slice("debt/".length, -1);
223
212
  if (body.length === 0 || body.split("/").some((segment) => segment.length === 0))
224
- refuse("ls", `invalid Task namespace selector: ${path}`);
213
+ refuse("ls", `invalid Debt namespace selector: ${path}`);
225
214
  try {
226
- const namespace = parseTaskNamespaceSelector(path);
227
- return { kind: "tasks", namespace, ...(limit === undefined ? {} : { limit }) };
215
+ const namespace = parseDebtNamespaceSelector(path);
216
+ return { kind: "debts", namespace, ...(limit === undefined ? {} : { limit }) };
228
217
  }
229
218
  catch (error) {
230
- refuse("ls", error instanceof Error ? error.message : `invalid Task namespace selector: ${path}`);
219
+ refuse("ls", error instanceof Error ? error.message : `invalid Debt namespace selector: ${path}`);
231
220
  }
232
221
  }
233
222
  function parseLs(parts) {
@@ -235,9 +224,9 @@ function parseLs(parts) {
235
224
  if (path === undefined)
236
225
  refuse("ls", "ls requires a selector");
237
226
  const limit = listLimit(parts);
238
- const taskQuery = taskCatalogQuery(path, limit);
239
- if (taskQuery !== null)
240
- return { command: "ls", query: taskQuery, output: parts.output };
227
+ const debtQuery = debtCatalogQuery(path, limit);
228
+ if (debtQuery !== null)
229
+ return { command: "ls", query: debtQuery, output: parts.output };
241
230
  if (path === "kei" || path === "kei/") {
242
231
  return {
243
232
  command: "ls",
@@ -249,7 +238,7 @@ function parseLs(parts) {
249
238
  const query = parseAkumaCatalogPath(path);
250
239
  if (query === null)
251
240
  refuse("ls", "ls requires a supported identity directory selector");
252
- return { command: "ls", query: akumaCatalogQuery(query, parts), output: parts.output };
241
+ return { command: "ls", query: { ...query, ...(limit === undefined ? {} : { limit }) }, output: parts.output };
253
242
  }
254
243
  catch (error) {
255
244
  if (error instanceof CliUsageError)
@@ -287,6 +276,10 @@ export function parseContractCommand(parts) {
287
276
  output: parts.output,
288
277
  };
289
278
  }
279
+ case "show": {
280
+ const contract = showSelector(parts);
281
+ return { command: "show", ...(contract === undefined ? {} : { contract }), output: parts.output };
282
+ }
290
283
  case "status":
291
284
  return parseStatus(parts);
292
285
  case "ls":
@@ -13,14 +13,15 @@ export declare const CONTRACT_COMMAND_SPECS: {
13
13
  readonly stdin: "optional";
14
14
  readonly flags: {
15
15
  readonly actor: "value";
16
- readonly task: "value";
16
+ readonly debt: "value";
17
17
  readonly target: "value";
18
+ readonly "no-target": "boolean";
18
19
  readonly after: "repeat";
19
20
  readonly gates: "raw-value";
20
21
  readonly "fork-of": "value";
21
22
  readonly json: "boolean";
22
23
  };
23
- readonly usage: "bind [--task <task/...>] [--target <ref>] [--after <kei/...> ...] [--gates <name,...>] [--actor <actor>] - | bind --fork-of <kei/...> [--target <ref>] [--actor <actor>]";
24
+ readonly usage: "bind [--debt <debt/...>] [--target <ref> | --no-target] [--after <kei/...> ...] [--gates <name,...>] [--actor <actor>] - | bind --fork-of <kei/...> [--target <ref> | --no-target] [--actor <actor>]";
24
25
  readonly purpose: "Create a Contract from stdin Markdown or copy an existing Contract as a starting point.";
25
26
  readonly details: string;
26
27
  };
@@ -88,15 +89,24 @@ export declare const CONTRACT_COMMAND_SPECS: {
88
89
  readonly usage: "abandon [<contract>|@<contract>] [--note <text>] [--actor <actor>]";
89
90
  readonly purpose: "End work on a Contract without delivering it; optionally record why.";
90
91
  };
92
+ readonly show: {
93
+ readonly positional: "optional";
94
+ readonly stdin: "none";
95
+ readonly flags: {
96
+ readonly json: "boolean";
97
+ };
98
+ readonly usage: "show [<contract>|@<contract>]";
99
+ readonly purpose: "Read one Contract's guidance.";
100
+ readonly details: string;
101
+ };
91
102
  readonly status: {
92
103
  readonly positional: "optional";
93
104
  readonly stdin: "none";
94
105
  readonly flags: {
95
- readonly guidance: "boolean";
96
106
  readonly limit: "value";
97
107
  readonly json: "boolean";
98
108
  };
99
- readonly usage: "status [<contract>|@name|<aku/...>]...\nstatus (aku|aku/|aku/*) [--limit <count>]\nstatus (kei|kei/|kei/*) [--limit <count>]\nstatus --guidance [<contract>|@<contract>]";
109
+ readonly usage: "status [<contract>|@name|<aku/...>]...\nstatus (aku|aku/|aku/*) [--limit <count>]\nstatus (kei|kei/|kei/*) [--limit <count>]";
100
110
  readonly purpose: "Show the world overview or selected Contract and Akuma status.";
101
111
  readonly details: string;
102
112
  };
@@ -107,8 +117,8 @@ export declare const CONTRACT_COMMAND_SPECS: {
107
117
  readonly limit: "value";
108
118
  readonly json: "boolean";
109
119
  };
110
- readonly usage: "ls task[/] [--limit <count>]\nls kei[/] [--limit <count>]\nls aku[/] [--limit <count>]\nls aku/<name>[/] [--limit <count>]\nls \"aku/<name>/*\" [--limit <count>]\nls \"aku/*/*\" [--limit <count>]";
111
- readonly purpose: "List tasks (ls task), contracts (ls kei), or akumas (ls aku).";
120
+ readonly usage: "ls debt[/] [--limit <count>]\nls kei[/] [--limit <count>]\nls aku[/] [--limit <count>]\nls aku/<name>[/] [--limit <count>]\nls \"aku/<name>/*\" [--limit <count>]\nls \"aku/*/*\" [--limit <count>]";
121
+ readonly purpose: "List debts (ls debt), contracts (ls kei), or akumas (ls aku).";
112
122
  readonly details: string;
113
123
  };
114
124
  readonly audit: {
@@ -143,7 +153,7 @@ export declare const CONTRACT_COMMAND_SPECS: {
143
153
  };
144
154
  readonly usage: "nuke [--confirm <world-directory>]";
145
155
  readonly purpose: "Remove Keiyaku-owned data from this World.";
146
- readonly details: "Stops Akumas and removes this World's Tasks and Keiyaku-created worktrees and Git references. --confirm must exactly match this World's directory; source files are not deleted.";
156
+ readonly details: "Stops Akumas and removes this World's Debts and Keiyaku-created worktrees and Git references. --confirm must exactly match this World's directory; source files are not deleted.";
147
157
  };
148
158
  readonly settings: {
149
159
  readonly positional: "none";