@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
@@ -1,12 +1,11 @@
1
1
  import { CliUsageError, isBlankInput } from "../usage.js";
2
- import { parseTaskNamespaceSelector } from "../../task/catalog.js";
3
- import { tasksWithExecution, taskRowViewLimit, } from "../../task/index.js";
4
- import { taskCompositionNamespaceHeader } from "../../task/compose-language.js";
5
- import { installNamespaceContext, resolveTaskNamespaceContext } from "../../task/context.js";
6
- import { displayContext, emit, writeJson, writeStderr, writeStdout } from "../streams.js";
7
- import { renderDoctor, renderTaskCompose, renderTaskContext, renderTaskFailure, renderTaskIncompleteDiagnostic, renderTaskLifecycle, renderTaskList, renderTaskMutation, renderTaskShow, renderTaskTree, renderTaskUpdate, taskExitCode, } from "../render/task.js";
2
+ import { parseDebtNamespaceSelector } from "../../debt/catalog.js";
3
+ import { debtsWithExecution, debtRowViewLimit, } from "../../debt/index.js";
4
+ import { installNamespaceContext, resolveDebtNamespaceContext } from "../../debt/context.js";
5
+ import { displayContext, emit, writeJson } from "../streams.js";
6
+ import { renderDoctor, renderDebtContext, renderDebtLifecycle, renderDebtList, renderDebtMutation, renderDebtShow, renderDebtTree, renderDebtUpdate, debtExitCode, } from "../render/debt.js";
8
7
  import { actorFromEdge } from "../actor.js";
9
- import { taskQuerySelection } from "../../task/query.js";
8
+ import { debtQuerySelection } from "../../debt/query.js";
10
9
  function value(command, name) {
11
10
  const item = command.flags[name];
12
11
  return typeof item === "string" ? item : undefined;
@@ -30,40 +29,38 @@ function limit(command) {
30
29
  const raw = value(command, "limit");
31
30
  return raw === undefined ? undefined : Number(raw);
32
31
  }
33
- function validateTaskRowView(command) {
32
+ function validateDebtRowView(command) {
34
33
  if (command.action === "ls" ||
35
34
  command.action === "ready" ||
36
35
  command.action === "blocked" ||
37
36
  command.action === "query")
38
- taskRowViewLimit(limit(command));
37
+ debtRowViewLimit(limit(command));
39
38
  }
40
39
  function explicitListNamespace(command) {
41
40
  return command.action === "ls" && command.positionals.length === 1
42
- ? parseTaskNamespaceSelector(command.positionals[0])
41
+ ? parseDebtNamespaceSelector(command.positionals[0])
43
42
  : undefined;
44
43
  }
45
- function taskStdinDiagnostic(command) {
44
+ function debtStdinDiagnostic(command) {
46
45
  switch (command.stdin) {
47
46
  case "document":
48
- return "task add requires a nonblank stdin document";
49
- case "compose":
50
- return "task compose requires a nonblank stdin document";
47
+ return "debt add requires a nonblank stdin document";
51
48
  case "body":
52
- return "task update --body requires a nonblank value";
49
+ return "debt update --body requires a nonblank value";
53
50
  case "append":
54
- return "task update --append requires a nonblank value";
51
+ return "debt update --append requires a nonblank value";
55
52
  case "note":
56
- return "task update --note requires a nonblank value";
53
+ return "debt update --note requires a nonblank value";
57
54
  default:
58
55
  return undefined;
59
56
  }
60
57
  }
61
58
  async function invokeAdd(input) {
62
- const { tasks, command, current = [] } = input;
59
+ const { debts, command, current = [] } = input;
63
60
  const selectedNamespace = namespace(value(command, "namespace")) ?? current;
64
61
  const actor = input.actor;
65
62
  if (command.stdin === "document") {
66
- return tasks.addDocument({
63
+ return debts.addDocument({
67
64
  markdown: input.stdin,
68
65
  ...(selectedNamespace === undefined ? {} : { namespace: selectedNamespace }),
69
66
  ...(actor === undefined ? {} : { actor }),
@@ -72,7 +69,7 @@ async function invokeAdd(input) {
72
69
  const body = value(command, "body"), note = value(command, "note"), initialState = value(command, "state"), selectedPriority = priority(value(command, "priority"));
73
70
  const needs = ids(values(command, "needs")), parent = value(command, "parent");
74
71
  const supersedes = ids(values(command, "supersedes")), relates = ids(values(command, "relates"));
75
- return tasks.add({
72
+ return debts.add({
76
73
  title: command.positionals[0],
77
74
  ...(selectedNamespace === undefined ? {} : { namespace: selectedNamespace }),
78
75
  ...(body === undefined ? {} : { body }),
@@ -87,7 +84,7 @@ async function invokeAdd(input) {
87
84
  });
88
85
  }
89
86
  function invokeUpdate(input) {
90
- const { tasks, command, stdin } = input;
87
+ const { debts, command, stdin } = input;
91
88
  const body = command.stdin === "body" ? stdin : value(command, "body"), appendBody = command.stdin === "append" ? stdin : value(command, "append");
92
89
  const note = command.stdin === "note" ? stdin : value(command, "note");
93
90
  const title = value(command, "title"), selectedPriority = priority(value(command, "priority"));
@@ -95,7 +92,7 @@ function invokeUpdate(input) {
95
92
  const parent = value(command, "parent"), addSupersedes = ids(values(command, "supersedes"));
96
93
  const dropSupersedes = ids(values(command, "drop-supersedes")), addRelates = ids(values(command, "relates"));
97
94
  const dropRelates = ids(values(command, "drop-relates"));
98
- return tasks.task({ id: command.positionals[0] }).update({
95
+ return debts.debt({ id: command.positionals[0] }).update({
99
96
  ...(title === undefined ? {} : { title }),
100
97
  ...(body === undefined ? {} : { body }),
101
98
  ...(appendBody === undefined ? {} : { appendBody }),
@@ -118,21 +115,21 @@ function readScope(command, current) {
118
115
  return command.flags.world === true ? { scope: "world" } : { namespace: current ?? [] };
119
116
  }
120
117
  /** One addressed read per caller-supplied id, in caller order; the native null survives to JSON. */
121
- async function runShow(command, tasks) {
122
- const handles = command.positionals.map((taskId) => tasks.task({ id: taskId }).id);
118
+ async function runShow(command, debts) {
119
+ const handles = command.positionals.map((debtId) => debts.debt({ id: debtId }).id);
123
120
  const details = [];
124
121
  for (const id of handles)
125
- details.push(await tasks.task({ id }).read());
122
+ details.push(await debts.debt({ id }).read());
126
123
  const missing = details.findIndex((detail) => detail === null);
127
124
  const code = missing >= 0 ? 1 : 0;
128
125
  const projected = handles.length === 1 ? details[0] : details;
129
126
  if (missing >= 0) {
130
- const refusal = { kind: "refused", refusal: { kind: "task-missing", taskId: handles[missing] } };
131
- return emit(command.output, projected, () => renderTaskShow(refusal, displayContext()), code);
127
+ const refusal = { kind: "refused", refusal: { kind: "debt-missing", debtId: handles[missing] } };
128
+ return emit(command.output, projected, () => renderDebtShow(refusal, displayContext()), code);
132
129
  }
133
130
  const found = details.filter((detail) => detail !== null);
134
131
  const result = found.length === 1 ? found[0] : found;
135
- return emit(command.output, projected, () => renderTaskShow(result, displayContext()), code);
132
+ return emit(command.output, projected, () => renderDebtShow(result, displayContext()), code);
136
133
  }
137
134
  /** Presentation-only list scope the leaf acquired, never part of the native answer. */
138
135
  function listPresentation(command) {
@@ -142,55 +139,49 @@ function listPresentation(command) {
142
139
  return command.action === "ls" && first !== undefined ? { namespace: first } : "current";
143
140
  }
144
141
  async function runRead(input) {
145
- const { tasks, command, current } = input;
142
+ const { debts, command, current } = input;
146
143
  const id = command.positionals[0];
147
144
  const scope = listPresentation(command);
148
145
  switch (command.action) {
149
146
  case "ls": {
150
- const result = await tasks.list({
147
+ const result = await debts.list({
151
148
  selection: command.flags.all === true ? "all" : command.flags.closed === true ? "closed" : "active",
152
149
  ...(explicitListNamespace(command) === undefined
153
150
  ? readScope(command, current)
154
151
  : { namespace: explicitListNamespace(command) }),
155
152
  ...(limit(command) === undefined ? {} : { limit: limit(command) }),
156
153
  });
157
- return emit(command.output, result, () => renderTaskList("ls", scope, result, displayContext()), taskExitCode(result));
158
- }
159
- case "ready": {
160
- const result = await tasks.ready({
161
- ...readScope(command, current),
162
- ...(value(command, "parent") === undefined ? {} : { parent: value(command, "parent") }),
163
- ...(limit(command) === undefined ? {} : { limit: limit(command) }),
164
- });
165
- return emit(command.output, result, () => renderTaskList("ready", scope, result, displayContext()), taskExitCode(result));
154
+ return emit(command.output, result, () => renderDebtList("ls", scope, result, displayContext()), debtExitCode(result));
166
155
  }
156
+ case "ready":
167
157
  case "blocked": {
168
- const result = await tasks.blocked({
158
+ const action = command.action;
159
+ const result = await debts[action]({
169
160
  ...readScope(command, current),
170
161
  ...(value(command, "parent") === undefined ? {} : { parent: value(command, "parent") }),
171
162
  ...(limit(command) === undefined ? {} : { limit: limit(command) }),
172
163
  });
173
- return emit(command.output, result, () => renderTaskList("blocked", scope, result, displayContext()), taskExitCode(result));
164
+ return emit(command.output, result, () => renderDebtList(action, scope, result, displayContext()), debtExitCode(result));
174
165
  }
175
166
  case "query": {
176
- const result = await tasks.query({
177
- where: taskQuerySelection(command.flags.all === true ? "all" : command.flags.closed === true ? "closed" : "active", command.where),
167
+ const result = await debts.query({
168
+ where: debtQuerySelection(command.flags.all === true ? "all" : command.flags.closed === true ? "closed" : "active", command.where),
178
169
  ...readScope(command, current),
179
170
  ...(value(command, "sort") === undefined ? {} : { sort: value(command, "sort") }),
180
171
  ...(limit(command) === undefined ? {} : { limit: limit(command) }),
181
172
  });
182
- return emit(command.output, result, () => renderTaskList("query", scope, result, displayContext()), taskExitCode(result));
173
+ return emit(command.output, result, () => renderDebtList("query", scope, result, displayContext()), debtExitCode(result));
183
174
  }
184
175
  case "tree": {
185
- const result = await tasks.task({ id }).tree();
186
- return emit(command.output, result, () => renderTaskTree(result, displayContext()), taskExitCode(result));
176
+ const result = await debts.debt({ id }).tree();
177
+ return emit(command.output, result, () => renderDebtTree(result, displayContext()), debtExitCode(result));
187
178
  }
188
179
  case "doctor": {
189
- const result = await tasks.doctor();
190
- return emit(command.output, result, () => renderDoctor(result), taskExitCode(result));
180
+ const result = await debts.doctor();
181
+ return emit(command.output, result, () => renderDoctor(result), debtExitCode(result));
191
182
  }
192
183
  default:
193
- throw new Error(`task action is not a read: ${command.action}`);
184
+ throw new Error(`debt action is not a read: ${command.action}`);
194
185
  }
195
186
  }
196
187
  function isWorldObservationAction(command) {
@@ -200,11 +191,11 @@ function isWorldObservationAction(command) {
200
191
  command.action === "query" ||
201
192
  command.action === "doctor");
202
193
  }
203
- function missingTask(id) {
204
- return { kind: "refused", refusal: { kind: "task-missing", taskId: id } };
194
+ function missingDebt(id) {
195
+ return { kind: "refused", refusal: { kind: "debt-missing", debtId: id } };
205
196
  }
206
197
  /**
207
- * The one CLI edge mapping a Task action with no World to its native refusal answer, then through
198
+ * The one CLI edge mapping a Debt action with no World to its native refusal answer, then through
208
199
  * the matching action renderer and the native exit classifier.
209
200
  */
210
201
  function missingWorld(command) {
@@ -215,135 +206,81 @@ function missingWorld(command) {
215
206
  writeJson(command.positionals.length === 1 ? null : command.positionals.map(() => null));
216
207
  return 1;
217
208
  }
218
- const refusal = missingTask(command.positionals[0]);
219
- return emit(output, refusal, () => renderTaskShow(refusal, displayContext()), 1);
209
+ const refusal = missingDebt(command.positionals[0]);
210
+ return emit(output, refusal, () => renderDebtShow(refusal, displayContext()), 1);
220
211
  }
221
- if (isWorldObservationAction(command) || (command.action === "compose" && command.flags.plan === true)) {
222
- return emit(output, { kind: "absent" }, () => "task world absent", 1);
212
+ if (isWorldObservationAction(command)) {
213
+ return emit(output, { kind: "absent" }, () => "debt world absent", 1);
223
214
  }
224
215
  if (command.action === "context") {
225
216
  const result = { kind: "accepted", value: { namespace: [], source: "default-root" } };
226
- return emit(output, result, () => renderTaskContext(result, displayContext()), taskExitCode(result));
217
+ return emit(output, result, () => renderDebtContext(result, displayContext()), debtExitCode(result));
227
218
  }
228
219
  if (command.action === "tree") {
229
- const result = missingTask(command.positionals[0]);
230
- return emit(output, result, () => renderTaskTree(result, displayContext()), taskExitCode(result));
220
+ const result = missingDebt(command.positionals[0]);
221
+ return emit(output, result, () => renderDebtTree(result, displayContext()), debtExitCode(result));
231
222
  }
232
223
  if (command.action === "update") {
233
- const result = missingTask(command.positionals[0]);
234
- return emit(output, result, () => renderTaskUpdate(result, displayContext()), taskExitCode(result));
235
- }
236
- if (command.action === "start" ||
237
- command.action === "stop" ||
238
- command.action === "hold" ||
239
- command.action === "resume") {
240
- if (command.positionals.length === 1) {
241
- const result = missingTask(command.positionals[0]);
242
- return emit(output, result, () => renderTaskMutation(command.action, result, displayContext()), taskExitCode(result));
243
- }
244
- const result = {
245
- items: command.positionals.map((id) => ({ id: id, outcome: missingTask(id) })),
246
- };
247
- return emit(output, result, () => renderTaskLifecycle(command.action, result, displayContext()), taskExitCode(result));
248
- }
249
- if (command.action === "done" || command.action === "drop") {
250
- const result = {
251
- items: command.positionals.map((id) => ({ id: id, outcome: missingTask(id) })),
252
- };
253
- return emit(output, result, () => renderTaskLifecycle(command.action, result, displayContext()), taskExitCode(result));
224
+ const result = missingDebt(command.positionals[0]);
225
+ return emit(output, result, () => renderDebtUpdate(result, displayContext()), debtExitCode(result));
254
226
  }
255
- throw new Error(`task action has no missing-world answer: ${command.action}`);
227
+ if (command.action !== "done" && command.action !== "drop")
228
+ throw new Error(`debt action has no missing-world answer: ${command.action}`);
229
+ const result = {
230
+ items: command.positionals.map((id) => ({ id: id, outcome: missingDebt(id) })),
231
+ };
232
+ return emit(output, result, () => renderDebtLifecycle(command.action, result, displayContext()), debtExitCode(result));
256
233
  }
257
- /**
258
- * One compose execution outcome: JSON keeps the untouched native value, while an incomplete text
259
- * answer recovers its draft and puts the diagnostic on stderr.
260
- */
261
- function emitCompose(output, result) {
262
- if (output === "json") {
263
- writeJson(result);
264
- return taskExitCode(result);
265
- }
266
- if (result.kind === "incomplete") {
267
- const diagnostic = renderTaskIncompleteDiagnostic(result);
268
- if (diagnostic.length > 0)
269
- writeStderr(diagnostic);
270
- process.stdout.write(result.draft);
271
- return taskExitCode(result);
272
- }
273
- writeStdout(renderTaskCompose(result, displayContext()));
274
- return taskExitCode(result);
275
- }
276
- /** One plural Task lifecycle answer: every verb shares the same batch shape and renderer. */
277
- async function runBatchLifecycle(tasks, command, verb) {
234
+ /** One plural Debt lifecycle answer: every verb shares the same batch shape and renderer. */
235
+ async function runBatchLifecycle(debts, command, verb) {
278
236
  const note = value(command, "note");
279
- const result = await tasks.batch({
237
+ const result = await debts.batch({
280
238
  verb,
281
239
  ids: command.positionals,
282
240
  ...(note === undefined ? {} : { note }),
283
241
  });
284
- return emit(command.output, result, () => renderTaskLifecycle(verb, result, displayContext()), taskExitCode(result));
242
+ return emit(command.output, result, () => renderDebtLifecycle(verb, result, displayContext()), debtExitCode(result));
285
243
  }
286
244
  async function runMutation(input) {
287
- const { tasks, command, current, stdin, composeMarkdown, composeNamespace } = input;
245
+ const { debts, command, current } = input;
288
246
  if (isWorldObservationAction(command) || command.action === "tree")
289
247
  return await runRead(input);
290
248
  switch (command.action) {
291
249
  case "add": {
292
250
  const result = await invokeAdd(input);
293
- return emit(command.output, result, () => renderTaskMutation("add", result, displayContext()), taskExitCode(result));
251
+ return emit(command.output, result, () => renderDebtMutation("add", result, displayContext()), debtExitCode(result));
294
252
  }
295
253
  case "update": {
296
254
  const result = await invokeUpdate(input);
297
- return emit(command.output, result, () => renderTaskUpdate(result, displayContext()), taskExitCode(result));
255
+ return emit(command.output, result, () => renderDebtUpdate(result, displayContext()), debtExitCode(result));
298
256
  }
299
- case "start":
300
- case "stop":
301
- case "resume": {
302
- const result = await invokeLifecycle(tasks, command.positionals, command.positionals[0], command.action);
303
- return emit(command.output, result, () => renderTaskLifecycle(command.action, result, displayContext()), taskExitCode(result));
304
- }
305
- case "hold":
306
257
  case "done":
307
258
  case "drop":
308
- return await runBatchLifecycle(tasks, command, command.action);
259
+ return await runBatchLifecycle(debts, command, command.action);
309
260
  case "context": {
310
261
  const selected = namespace(command.positionals[0]);
311
262
  if (selected !== undefined) {
312
263
  await installNamespaceContext(input.context.writeRoot ?? input.context.directory, selected);
313
- const resolved = await resolveTaskNamespaceContext(input.context);
264
+ const resolved = await resolveDebtNamespaceContext(input.context);
314
265
  if (typeof resolved === "object" && "kind" in resolved) {
315
266
  const result = { kind: "refused", refusal: resolved };
316
- return emit(command.output, result, () => renderTaskContext(result, displayContext()), taskExitCode(result));
267
+ return emit(command.output, result, () => renderDebtContext(result, displayContext()), debtExitCode(result));
317
268
  }
318
269
  const result = { kind: "accepted", value: resolved };
319
- return emit(command.output, result, () => renderTaskContext(result, displayContext()), taskExitCode(result));
270
+ return emit(command.output, result, () => renderDebtContext(result, displayContext()), debtExitCode(result));
320
271
  }
321
272
  const result = {
322
273
  kind: "accepted",
323
274
  value: { namespace: current ?? [], source: "default-root" },
324
275
  };
325
- return emit(command.output, result, () => renderTaskContext(result, displayContext()), taskExitCode(result));
326
- }
327
- case "compose": {
328
- const result = await tasks.compose({
329
- markdown: composeMarkdown ?? stdin ?? "",
330
- namespace: composeNamespace ?? current ?? [],
331
- ...(input.actor === undefined ? {} : { actor: input.actor }),
332
- ...(command.flags.plan === true ? { plan: true } : {}),
333
- });
334
- return emitCompose(command.output, result);
276
+ return emit(command.output, result, () => renderDebtContext(result, displayContext()), debtExitCode(result));
335
277
  }
336
278
  default:
337
- throw new Error(`task action has no invocation: ${command.action}`);
279
+ throw new Error(`debt action has no invocation: ${command.action}`);
338
280
  }
339
281
  }
340
- function invokeLifecycle(tasks, taskIds, firstId, verb) {
341
- return taskIds.length === 1 ? tasks.task({ id: firstId })[verb]() : tasks.batch({ verb, ids: taskIds });
342
- }
343
282
  function establishesWorld(command) {
344
- return (command.action === "add" ||
345
- (command.action === "compose" && command.flags.plan !== true) ||
346
- (command.action === "context" && command.positionals.length > 0));
283
+ return command.action === "add" || (command.action === "context" && command.positionals.length > 0);
347
284
  }
348
285
  /**
349
286
  * One CLI edge turning a namespace-context refusal into the addressed action's native refusal
@@ -357,42 +294,31 @@ function refuseNamespace(command, refusal) {
357
294
  case "blocked":
358
295
  case "query": {
359
296
  const action = command.action;
360
- return emit(command.output, result, () => renderTaskList(action, listPresentation(command), result, displayContext()), taskExitCode(result));
297
+ return emit(command.output, result, () => renderDebtList(action, listPresentation(command), result, displayContext()), debtExitCode(result));
361
298
  }
362
299
  case "add":
363
- return emit(command.output, result, () => renderTaskMutation("add", result, displayContext()), taskExitCode(result));
300
+ return emit(command.output, result, () => renderDebtMutation("add", result, displayContext()), debtExitCode(result));
364
301
  case "context":
365
- return emit(command.output, result, () => renderTaskContext(result, displayContext()), taskExitCode(result));
366
- case "compose":
367
- return emit(command.output, result, () => renderTaskFailure("compose", result, displayContext()), taskExitCode(result));
302
+ return emit(command.output, result, () => renderDebtContext(result, displayContext()), debtExitCode(result));
368
303
  default:
369
- throw new Error(`task action has no namespace refusal: ${command.action}`);
304
+ throw new Error(`debt action has no namespace refusal: ${command.action}`);
370
305
  }
371
306
  }
372
307
  // eslint-disable-next-line complexity -- this is the single CLI edge ordering world, context, forwarding, and local execution.
373
- export async function runTaskCommand(command, coordinates, runtime) {
374
- validateTaskRowView(command);
375
- const stdinDiagnostic = taskStdinDiagnostic(command);
308
+ export async function runDebtCommand(command, coordinates, runtime) {
309
+ validateDebtRowView(command);
310
+ const stdinDiagnostic = debtStdinDiagnostic(command);
376
311
  const stdin = stdinDiagnostic === undefined ? undefined : await runtime.readStdin();
377
312
  if (stdinDiagnostic !== undefined && isBlankInput(stdin ?? ""))
378
313
  throw new CliUsageError(stdinDiagnostic);
379
- const planOnly = command.action === "compose" && command.flags.plan === true;
380
- const composeMarkdown = command.action === "compose" ? stdin : undefined;
381
- const composition = composeMarkdown === undefined ? undefined : taskCompositionNamespaceHeader(composeMarkdown);
382
- const explicitNamespace = command.action === "add"
383
- ? namespace(value(command, "namespace"))
384
- : command.action === "compose" && composition?.specified
385
- ? composition.namespace
386
- : undefined;
314
+ const explicitNamespace = command.action === "add" ? namespace(value(command, "namespace")) : undefined;
387
315
  const actor = actorFromEdge(typeof command.flags.actor === "string" ? command.flags.actor : undefined, runtime.environment);
388
- const world = coordinates.world ??
389
- (planOnly ? coordinates.candidateWorld : establishesWorld(command) ? await coordinates.establishWorld() : null);
316
+ const world = coordinates.world ?? (establishesWorld(command) ? await coordinates.establishWorld() : null);
390
317
  if (world === null)
391
318
  return missingWorld(command);
392
- const tasks = tasksWithExecution(world, runtime.execution);
319
+ const debts = debtsWithExecution(world, runtime.execution);
393
320
  const contextSensitive = command.action === "context" ||
394
321
  (command.action === "add" && explicitNamespace === undefined) ||
395
- (command.action === "compose" && composition?.specified !== true) ||
396
322
  (((command.action === "ls" && explicitListNamespace(command) === undefined) ||
397
323
  command.action === "ready" ||
398
324
  command.action === "blocked" ||
@@ -400,26 +326,23 @@ export async function runTaskCommand(command, coordinates, runtime) {
400
326
  command.flags.world !== true);
401
327
  let current;
402
328
  if (contextSensitive) {
403
- const resolved = await resolveTaskNamespaceContext(coordinates.taskContext);
329
+ const resolved = await resolveDebtNamespaceContext(coordinates.debtContext);
404
330
  if (typeof resolved === "object" && "kind" in resolved)
405
331
  return refuseNamespace(command, resolved);
406
332
  current = resolved.namespace;
407
333
  if (command.action === "context" && command.positionals.length === 0) {
408
334
  const result = { kind: "accepted", value: resolved };
409
- return emit(command.output, result, () => renderTaskContext(result, displayContext()), taskExitCode(result));
335
+ return emit(command.output, result, () => renderDebtContext(result, displayContext()), debtExitCode(result));
410
336
  }
411
337
  }
412
338
  if (command.action === "show")
413
- return await runShow(command, tasks);
339
+ return await runShow(command, debts);
414
340
  return await runMutation({
415
- tasks,
341
+ debts,
416
342
  command,
417
- runtime,
418
- context: coordinates.taskContext,
343
+ context: coordinates.debtContext,
419
344
  ...(actor === undefined ? {} : { actor }),
420
345
  ...(current === undefined ? {} : { current }),
421
346
  ...(stdin === undefined ? {} : { stdin }),
422
- ...(composeMarkdown === undefined ? {} : { composeMarkdown }),
423
- ...(explicitNamespace === undefined ? {} : { composeNamespace: explicitNamespace }),
424
347
  });
425
348
  }
@@ -7,7 +7,7 @@ export type CliCoordinates = Readonly<{
7
7
  repo?: Repo;
8
8
  world: WorldRoot | null;
9
9
  candidateWorld: WorldRoot | null;
10
- taskContext: Readonly<{
10
+ debtContext: Readonly<{
11
11
  directory: string;
12
12
  boundary: string;
13
13
  writeRoot: string;
@@ -69,7 +69,7 @@ export const cliCoordinateDiscovery = {
69
69
  ...(repo === undefined ? {} : { repo }),
70
70
  world: world.root,
71
71
  candidateWorld: world.candidate,
72
- taskContext: {
72
+ debtContext: {
73
73
  directory: cwd,
74
74
  boundary,
75
75
  writeRoot: worldRepo === undefined ? boundary : cwd,
@@ -1,7 +1,7 @@
1
- import { type ParsedTaskCommand, type TaskAction } from "./commands/task-grammar.js";
1
+ import { type ParsedDebtCommand, type DebtAction } from "./commands/debt-grammar.js";
2
2
  import { type AkumaAction, type ParsedAkumaCommand } from "./commands/akuma-grammar.js";
3
3
  import { type ParsedInstallCommand } from "./commands/install.js";
4
- import { type ParsedAbandon, type ParsedAmend, type ParsedArc, type ParsedAudit, type ParsedBind, type ParsedDeliver, type ParsedLs, type ParsedNuke, type ParsedReconcile, type ParsedRegion, type ParsedReview, type ParsedSettings, type ParsedStatus } from "./commands/contract-grammar.js";
4
+ import { type ParsedContractCommand } from "./commands/contract-grammar.js";
5
5
  import { type ContractCommand as Command } from "./commands/contract-help.js";
6
6
  import { type CliUsageGuide } from "./usage.js";
7
7
  export { CliUsageError } from "./usage.js";
@@ -10,15 +10,15 @@ export type { Command };
10
10
  export declare function renderRootHelp(columns?: number): string;
11
11
  export declare function usageGuideForCommand(command: ParsedCommand): CliUsageGuide;
12
12
  export declare function renderHelp(coordinate: CliHelpCoordinate, columns?: number): string;
13
- export type ParsedCommand = ParsedBind | ParsedAmend | ParsedDeliver | ParsedReview | ParsedArc | ParsedAbandon | ParsedStatus | ParsedLs | ParsedAudit | ParsedReconcile | ParsedNuke | ParsedSettings | ParsedRegion | ParsedInstallCommand | ParsedAkumaCommand | ParsedTaskCommand;
13
+ export type ParsedCommand = ParsedContractCommand | ParsedInstallCommand | ParsedAkumaCommand | ParsedDebtCommand;
14
14
  type CliHelpCoordinate = Readonly<{
15
15
  kind: "root";
16
16
  }> | Readonly<{
17
17
  kind: "contract";
18
18
  command: Command;
19
19
  }> | Readonly<{
20
- kind: "task";
21
- action?: TaskAction;
20
+ kind: "debt";
21
+ action?: DebtAction;
22
22
  }> | Readonly<{
23
23
  kind: "install";
24
24
  }> | Readonly<{
@@ -1,4 +1,4 @@
1
- import { isTaskAction, parseTaskCommand, renderTaskHelp, taskUsageGuide, } from "./commands/task-grammar.js";
1
+ import { isDebtAction, parseDebtCommand, renderDebtHelp, debtUsageGuide, } from "./commands/debt-grammar.js";
2
2
  import { akumaUsageGuide, isAkumaAction, parseAkumaCommand, renderAkumaHelp, renderAkumaRootRows, } from "./commands/akuma-grammar.js";
3
3
  import { INSTALL_ROOT_PURPOSE, INSTALL_USAGE, parseInstallCommand, renderInstallHelp, } from "./commands/install.js";
4
4
  import { parseContractCommand, } from "./commands/contract-grammar.js";
@@ -14,7 +14,7 @@ const ROOT_USAGE = [
14
14
  const INVOCATION_PATH_OPTIONS = new Set(["-C", "--cwd", "--repo", "--workdir"]);
15
15
  export function renderRootHelp(columns) {
16
16
  return renderHelpText([
17
- "keiyaku — Contract, Task, and Akuma control for one repository",
17
+ "keiyaku — Contract, Debt, and Akuma control for one repository",
18
18
  "",
19
19
  ROOT_USAGE,
20
20
  "",
@@ -23,8 +23,8 @@ export function renderRootHelp(columns) {
23
23
  .filter(([command]) => command !== "settings")
24
24
  .map(([command, spec]) => ` ${command.padEnd(10)} ${spec.purpose}`),
25
25
  "",
26
- "Task — plan memory",
27
- " task Task coordination; see `keiyaku task --help`.",
26
+ "Debt — unresolved-work ledger",
27
+ " debt Debt coordination; see `keiyaku debt --help`.",
28
28
  "",
29
29
  "Akuma — contracted demons",
30
30
  ...renderAkumaRootRows(),
@@ -64,8 +64,8 @@ function renderHelpText(help, columns) {
64
64
  export function usageGuideForCommand(command) {
65
65
  if (command.command === "install")
66
66
  return commandGuide("install", INSTALL_USAGE);
67
- if (command.command === "task")
68
- return taskUsageGuide(command.action);
67
+ if (command.command === "debt")
68
+ return debtUsageGuide(command.action);
69
69
  if (isAkumaAction(command.command))
70
70
  return akumaUsageGuide(command.command);
71
71
  return commandGuide(command.command, CONTRACT_COMMAND_SPECS[command.command].usage);
@@ -77,8 +77,8 @@ export function renderHelp(coordinate, columns) {
77
77
  return renderRootHelp();
78
78
  case "contract":
79
79
  return renderContractHelpForOwner(coordinate.command);
80
- case "task":
81
- return renderTaskHelp(coordinate.action);
80
+ case "debt":
81
+ return renderDebtHelp(coordinate.action);
82
82
  case "install":
83
83
  return renderInstallHelp();
84
84
  case "akuma":
@@ -98,6 +98,7 @@ export function commandRepoPolicy(command) {
98
98
  case "audit":
99
99
  case "reconcile":
100
100
  case "region":
101
+ case "show":
101
102
  return { use: "required", acceptsExplicit: true };
102
103
  case "ls":
103
104
  return { use: command.query.kind === "contracts" ? "required" : "none", acceptsExplicit: false };
@@ -123,7 +124,7 @@ export function commandRepoPolicy(command) {
123
124
  };
124
125
  case "settings":
125
126
  case "nuke":
126
- case "task":
127
+ case "debt":
127
128
  case "install":
128
129
  return { use: "none", acceptsExplicit: false };
129
130
  }
@@ -234,9 +235,9 @@ function helpCoordinate(argv) {
234
235
  return null;
235
236
  const words = argv.slice(0, help);
236
237
  const root = words[0];
237
- if (root === "task") {
238
- const action = isTaskAction(words[1]) ? words[1] : undefined;
239
- return { kind: "task", ...(action === undefined ? {} : { action }) };
238
+ if (root === "debt") {
239
+ const action = isDebtAction(words[1]) ? words[1] : undefined;
240
+ return { kind: "debt", ...(action === undefined ? {} : { action }) };
240
241
  }
241
242
  if (root === "install")
242
243
  return { kind: "install" };
@@ -255,14 +256,14 @@ export function parseArgv(argv) {
255
256
  // A bare invocation asks for orientation: the root help index, not a refusal.
256
257
  if (invocation.commandArgv.length === 0)
257
258
  return { help: { kind: "root" } };
258
- if (invocation.commandArgv.length === 1 && invocation.commandArgv[0] === "task")
259
- return { help: { kind: "task" } };
259
+ if (invocation.commandArgv.length === 1 && invocation.commandArgv[0] === "debt")
260
+ return { help: { kind: "debt" } };
260
261
  if (invocation.commandArgv.length === 1 && invocation.commandArgv[0] === "--version")
261
262
  return { version: true };
262
- const task = invocation.commandArgv[0] === "task" ? parseTaskCommand(invocation.commandArgv.slice(1)) : undefined;
263
+ const debt = invocation.commandArgv[0] === "debt" ? parseDebtCommand(invocation.commandArgv.slice(1)) : undefined;
263
264
  const install = invocation.commandArgv[0] === "install" ? parseInstallCommand(invocation.commandArgv.slice(1)) : undefined;
264
265
  const akuma = isAkumaAction(invocation.commandArgv[0]) ? parseAkumaCommand(invocation.commandArgv) : undefined;
265
- const command = task ?? akuma ?? install ?? parseContractCommand(scanArgv(invocation.commandArgv));
266
+ const command = debt ?? akuma ?? install ?? parseContractCommand(scanArgv(invocation.commandArgv));
266
267
  if (invocation.workdir !== undefined && command.command !== "call") {
267
268
  throw new CliUsageError(`option --workdir is not valid for ${command.command}`, usageGuideForCommand(command));
268
269
  }