@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,104 +0,0 @@
1
- ---
2
- name: keiyaku-task
3
- description: >-
4
- Must read when using Tasks for durable work planning, decomposition, or
5
- dependencies.
6
- ---
7
-
8
- # Keiyaku Task
9
-
10
- A Task is durable planning memory. It records work, decomposition, and
11
- relationships that must remain after the current conversation. Task is an
12
- independent product; it is not a Contract, Arc, Akuma, permission, acceptance
13
- boundary, or fulfillment lifecycle.
14
-
15
- ## 1. When To Use A Task
16
-
17
- Use a Task when the plan or dependency must outlive the current conversation.
18
- Skip it when the work is small and no durable planning memory is needed.
19
-
20
- - Use a `kei` for one independently acceptable outcome.
21
- - Use an Arc for a chapter inside one `kei`.
22
- - Use a Task for decomposition or dependency memory.
23
- - Do not create a Task just to mirror a `kei`.
24
-
25
- A Task may exist without a Contract. Associating a Task with a `kei` does not
26
- transfer the Contract's holder, acceptance, or lifecycle to the Task.
27
-
28
- ## 2. Relationships And Parallel Work
29
-
30
- Independent Tasks may start and progress in parallel when their dependencies
31
- allow it.
32
-
33
- Use the relationships for their actual meanings:
34
-
35
- - `needs` means this Task must wait for another Task to become terminal.
36
- - `parent` groups decomposition; it does not create a dependency.
37
- - `supersedes` points to work replaced by this Task.
38
- - `relates` records a connection without affecting readiness.
39
-
40
- Only `needs` orders work. Do not add it because Tasks touch the same Region or
41
- because one Task is related to another. A terminal Task releases its dependents.
42
- An `on_hold` Task is deliberately paused; it is neither ready nor blocked.
43
-
44
- ## 3. Task Commands
45
-
46
- Create and inspect Tasks:
47
-
48
- ```bash
49
- keiyaku task add "<title>"
50
- keiyaku task add "<title>" --priority 1 --needs <task-id>
51
- keiyaku task show <task-id>
52
- keiyaku task ls
53
- keiyaku task ready
54
- keiyaku task blocked
55
- keiyaku task tree <task-id>
56
- keiyaku task doctor
57
- ```
58
-
59
- Use complete Task IDs for targeted commands. `ls`, `ready`, and `blocked` use
60
- the current namespace; use `--world` to inspect the complete Task world.
61
-
62
- Change lifecycle state:
63
-
64
- ```bash
65
- keiyaku task start <task-id>...
66
- keiyaku task stop <task-id>
67
- keiyaku task hold <task-id>...
68
- keiyaku task resume <task-id>
69
- keiyaku task done <task-id>...
70
- keiyaku task drop <task-id>... --note "<reason>"
71
- ```
72
-
73
- Use `done` when the Task is complete. Use `drop` when it will not be done.
74
- Both terminal states release dependent Tasks. Use `hold` for a deliberate pause,
75
- not for an unresolved dependency; unresolved `needs` appear in `blocked`.
76
-
77
- Update a Task without changing its lifecycle:
78
-
79
- ```bash
80
- keiyaku task update <task-id> --title "<title>"
81
- keiyaku task update <task-id> --body "<body>"
82
- keiyaku task update <task-id> --needs <task-id>
83
- ```
84
-
85
- Use `task compose -` when several Tasks and their relationships should be
86
- planned or admitted together. Use `--plan` to inspect the composition without
87
- writing it.
88
-
89
- ## 4. After Creating A Task
90
-
91
- Read the returned Task identity. Then:
92
-
93
- 1. Start ready work.
94
- 2. Run independent Tasks in parallel.
95
- 3. Add or remove relationships when the plan changes.
96
- 4. Hold work that is deliberately paused.
97
- 5. Mark completed work `done`, or mark abandoned work `drop` with a reason.
98
- 6. Use `ready`, `blocked`, `tree`, or `doctor` to rebuild the current view.
99
-
100
- Task records planning memory. It does not perform the work, claim acceptance,
101
- assign a holder, or decide what a Contract may accept.
102
-
103
- Read `keiyaku-bind` for Contract authoring and `keiyaku-workflow` for Contract
104
- lifecycle.
@@ -1,104 +0,0 @@
1
- ---
2
- name: keiyaku-task
3
- description: >-
4
- Must read when using Tasks for durable work planning, decomposition, or
5
- dependencies.
6
- ---
7
-
8
- # Keiyaku Task
9
-
10
- A Task is durable planning memory. It records work, decomposition, and
11
- relationships that must remain after the current conversation. Task is an
12
- independent product; it is not a Contract, Arc, Akuma, permission, acceptance
13
- boundary, or fulfillment lifecycle.
14
-
15
- ## 1. When To Use A Task
16
-
17
- Use a Task when the plan or dependency must outlive the current conversation.
18
- Skip it when the work is small and no durable planning memory is needed.
19
-
20
- - Use a `kei` for one independently acceptable outcome.
21
- - Use an Arc for a chapter inside one `kei`.
22
- - Use a Task for decomposition or dependency memory.
23
- - Do not create a Task just to mirror a `kei`.
24
-
25
- A Task may exist without a Contract. Associating a Task with a `kei` does not
26
- transfer the Contract's holder, acceptance, or lifecycle to the Task.
27
-
28
- ## 2. Relationships And Parallel Work
29
-
30
- Independent Tasks may start and progress in parallel when their dependencies
31
- allow it.
32
-
33
- Use the relationships for their actual meanings:
34
-
35
- - `needs` means this Task must wait for another Task to become terminal.
36
- - `parent` groups decomposition; it does not create a dependency.
37
- - `supersedes` points to work replaced by this Task.
38
- - `relates` records a connection without affecting readiness.
39
-
40
- Only `needs` orders work. Do not add it because Tasks touch the same Region or
41
- because one Task is related to another. A terminal Task releases its dependents.
42
- An `on_hold` Task is deliberately paused; it is neither ready nor blocked.
43
-
44
- ## 3. Task Commands
45
-
46
- Create and inspect Tasks:
47
-
48
- ```bash
49
- keiyaku task add "<title>"
50
- keiyaku task add "<title>" --priority 1 --needs <task-id>
51
- keiyaku task show <task-id>
52
- keiyaku task ls
53
- keiyaku task ready
54
- keiyaku task blocked
55
- keiyaku task tree <task-id>
56
- keiyaku task doctor
57
- ```
58
-
59
- Use complete Task IDs for targeted commands. `ls`, `ready`, and `blocked` use
60
- the current namespace; use `--world` to inspect the complete Task world.
61
-
62
- Change lifecycle state:
63
-
64
- ```bash
65
- keiyaku task start <task-id>...
66
- keiyaku task stop <task-id>
67
- keiyaku task hold <task-id>...
68
- keiyaku task resume <task-id>
69
- keiyaku task done <task-id>...
70
- keiyaku task drop <task-id>... --note "<reason>"
71
- ```
72
-
73
- Use `done` when the Task is complete. Use `drop` when it will not be done.
74
- Both terminal states release dependent Tasks. Use `hold` for a deliberate pause,
75
- not for an unresolved dependency; unresolved `needs` appear in `blocked`.
76
-
77
- Update a Task without changing its lifecycle:
78
-
79
- ```bash
80
- keiyaku task update <task-id> --title "<title>"
81
- keiyaku task update <task-id> --body "<body>"
82
- keiyaku task update <task-id> --needs <task-id>
83
- ```
84
-
85
- Use `task compose -` when several Tasks and their relationships should be
86
- planned or admitted together. Use `--plan` to inspect the composition without
87
- writing it.
88
-
89
- ## 4. After Creating A Task
90
-
91
- Read the returned Task identity. Then:
92
-
93
- 1. Start ready work.
94
- 2. Run independent Tasks in parallel.
95
- 3. Add or remove relationships when the plan changes.
96
- 4. Hold work that is deliberately paused.
97
- 5. Mark completed work `done`, or mark abandoned work `drop` with a reason.
98
- 6. Use `ready`, `blocked`, `tree`, or `doctor` to rebuild the current view.
99
-
100
- Task records planning memory. It does not perform the work, claim acceptance,
101
- assign a holder, or decide what a Contract may accept.
102
-
103
- Read `keiyaku-bind` for Contract authoring and `keiyaku-workflow` for Contract
104
- lifecycle.
@@ -1,12 +0,0 @@
1
- import { type ActorId, type Keiyaku, type Repo } from "../../index.js";
2
- import type { ParsedAmend } from "./contract-grammar.js";
3
- type AmendCommandInput = Readonly<{
4
- command: ParsedAmend;
5
- repo: Repo;
6
- contract: Keiyaku;
7
- markdown?: string;
8
- gates?: readonly string[];
9
- actor?: ActorId;
10
- }>;
11
- export declare function amendFromCommand({ command, repo, contract, markdown, gates, actor, }: AmendCommandInput): ReturnType<Keiyaku["amend"]>;
12
- export {};
@@ -1,10 +0,0 @@
1
- import { contractFromInput } from "../selectors.js";
2
- export function amendFromCommand({ command, repo, contract, markdown, gates, actor, }) {
3
- const after = command.clearAfter === true ? [] : command.after?.map((id) => contractFromInput(repo, id).id);
4
- return contract.amend({
5
- ...(markdown === undefined ? {} : { markdown }),
6
- ...(actor === undefined ? {} : { actor }),
7
- ...(after === undefined ? {} : { after }),
8
- ...(gates === undefined ? {} : { gates }),
9
- });
10
- }
@@ -1,11 +0,0 @@
1
- import { type ActorId, type BindResult, type KeiyakuLibrary, type Repo } from "../../index.js";
2
- import type { ParsedBind } from "./contract-grammar.js";
3
- type BindCommandInput = Readonly<{
4
- command: ParsedBind;
5
- repo: Repo;
6
- library: KeiyakuLibrary;
7
- markdown?: string;
8
- actor?: ActorId;
9
- }>;
10
- export declare function bindFromCommand({ command, repo, library, markdown, actor, }: BindCommandInput): Promise<BindResult>;
11
- export {};
@@ -1,23 +0,0 @@
1
- import { contractFromInput } from "../selectors.js";
2
- export async function bindFromCommand({ command, repo, library, markdown, actor, }) {
3
- if (command.forkOf !== undefined) {
4
- return library.bind({
5
- repo,
6
- forkOf: contractFromInput(repo, command.forkOf).id,
7
- ...(command.target === undefined ? {} : { target: command.target }),
8
- ...(actor === undefined ? {} : { actor }),
9
- });
10
- }
11
- const after = command.after?.map((id) => contractFromInput(repo, id).id);
12
- if (markdown === undefined)
13
- throw new Error("Markdown bind command is missing stdin terms");
14
- return library.bind({
15
- repo,
16
- markdown,
17
- ...(command.task === undefined ? {} : { task: command.task }),
18
- ...(command.target === undefined ? {} : { target: command.target }),
19
- ...(actor === undefined ? {} : { actor }),
20
- ...(after === undefined ? {} : { after }),
21
- ...(command.gates === undefined ? {} : { gates: command.gates }),
22
- });
23
- }
@@ -1,19 +0,0 @@
1
- import { type CliUsageGuide } from "../usage.js";
2
- import { type TaskQueryExpression } from "./task-query.js";
3
- export type TaskAction = "add" | "show" | "ls" | "ready" | "blocked" | "tree" | "doctor" | "update" | "query" | "start" | "stop" | "hold" | "resume" | "done" | "drop" | "context" | "compose";
4
- type TaskFlagValue = string | true | readonly string[];
5
- type TaskStdin = "document" | "body" | "append" | "note" | "compose";
6
- export type ParsedTaskCommand = Readonly<{
7
- command: "task";
8
- action: TaskAction;
9
- output: "text" | "json";
10
- positionals: readonly string[];
11
- flags: Readonly<Record<string, TaskFlagValue>>;
12
- stdin?: TaskStdin;
13
- where?: TaskQueryExpression;
14
- }>;
15
- export declare function isTaskAction(value: string | undefined): value is TaskAction;
16
- export declare function renderTaskHelp(action?: TaskAction): string;
17
- export declare function taskUsageGuide(action: TaskAction): CliUsageGuide;
18
- export declare function parseTaskCommand(argv: readonly string[]): ParsedTaskCommand;
19
- export {};
@@ -1,384 +0,0 @@
1
- import { CliUsageError, TASK_FAMILY_USAGE_GUIDE, unknownCommandGuide } from "../usage.js";
2
- import { scanArgs } from "../scan.js";
3
- import { parseTaskNamespaceSelector } from "../../task/catalog.js";
4
- import { parseTaskId } from "../../task/identity.js";
5
- import { parseTaskQueryExpression, validateTaskLimit, validateTaskParent, } from "./task-query.js";
6
- const COMMON = { json: "boolean" };
7
- const TASK_COMMAND_SPECS = {
8
- add: {
9
- arity: [0, 1],
10
- stdin: "document",
11
- flags: {
12
- ...COMMON,
13
- namespace: "value",
14
- state: "value",
15
- priority: "value",
16
- needs: "repeat",
17
- parent: "value",
18
- supersedes: "repeat",
19
- relates: "repeat",
20
- body: "value",
21
- note: "value",
22
- actor: "value",
23
- },
24
- usage: `task add <TITLE> [--namespace <ns>] [--priority 0..3]
25
- [--state open|in_progress|on_hold|done|drop]
26
- [--note <text>] [--actor <actor>]
27
- [--needs <TaskId>]... [--parent <TaskId>]
28
- [--supersedes <TaskId>]... [--relates <TaskId>]...
29
- [--body <text>]
30
- task add [--namespace <ns>] [--actor <actor>] -`,
31
- purpose: "Create a Task from flags or a Task document on stdin.",
32
- details: "The stdin document is YAML front matter (title, state, priority, needs, parent, supersedes, relates, note) followed by a Markdown body.",
33
- },
34
- show: {
35
- arity: [1, Number.POSITIVE_INFINITY],
36
- flags: COMMON,
37
- usage: "task show <TaskId>...",
38
- purpose: "Read one or more Tasks and their relationships.",
39
- },
40
- ls: {
41
- arity: [0, 1],
42
- flags: { ...COMMON, closed: "boolean", all: "boolean", world: "boolean", limit: "value" },
43
- usage: "task ls [<namespace-selector>] [--closed | --all] [--world] [--limit <n>]",
44
- purpose: "List Tasks in the selected namespace.",
45
- details: [
46
- "With no selector, lists the current directory Task context.",
47
- "task/ selects the root namespace; --world lists every namespace in the current Task world.",
48
- ].join("\n"),
49
- },
50
- ready: {
51
- arity: [0, 0],
52
- flags: { ...COMMON, world: "boolean", parent: "value", limit: "value" },
53
- usage: "task ready [--world] [--parent <TaskId>] [--limit <n>]",
54
- purpose: "List open Tasks whose every dependency is complete or dropped.",
55
- details: "--world lists every namespace in the current Task world.",
56
- },
57
- blocked: {
58
- arity: [0, 0],
59
- flags: { ...COMMON, world: "boolean", parent: "value", limit: "value" },
60
- usage: "task blocked [--world] [--parent <TaskId>] [--limit <n>]",
61
- purpose: "List Tasks with unmet dependencies.",
62
- details: "--world lists every namespace in the current Task world.",
63
- },
64
- query: {
65
- arity: [0, 0],
66
- flags: {
67
- ...COMMON,
68
- where: "value",
69
- world: "boolean",
70
- closed: "boolean",
71
- all: "boolean",
72
- sort: "value",
73
- limit: "value",
74
- },
75
- usage: `task query [--where <expression>] [--closed | --all] [--world]
76
- [--sort priority|created|updated|id] [--limit <n>]`,
77
- purpose: "Filter and sort Tasks with a boolean expression.",
78
- details: [
79
- "fields: state priority title id parent under needs blocks ready blocked created updated",
80
- "operators: = != < > <= >= ~ and or not ( )",
81
- "sort: priority and created ascend; updated descends; id is lexical. Default: priority.",
82
- "--world lists every namespace in the current Task world.",
83
- "By default only active Tasks match; --closed selects terminal Tasks, --all includes both.",
84
- "examples:",
85
- " keiyaku task query --where 'priority <= 1 and ready' --world",
86
- " keiyaku task query --where 'updated < 2026-08-06T00:00:00.000Z' --world",
87
- ].join("\n"),
88
- },
89
- tree: {
90
- arity: [1, 1],
91
- flags: COMMON,
92
- usage: "task tree <TaskId>",
93
- purpose: "Show a Task and its parent/child breakdown.",
94
- },
95
- doctor: {
96
- arity: [0, 0],
97
- flags: COMMON,
98
- usage: "task doctor",
99
- purpose: "Check Tasks for inconsistencies without changing them.",
100
- },
101
- update: {
102
- arity: [1, 1],
103
- flags: {
104
- ...COMMON,
105
- title: "value",
106
- body: "value",
107
- append: "value",
108
- note: "value",
109
- priority: "value",
110
- needs: "repeat",
111
- "drop-needs": "repeat",
112
- parent: "value",
113
- "no-parent": "boolean",
114
- supersedes: "repeat",
115
- "drop-supersedes": "repeat",
116
- relates: "repeat",
117
- "drop-relates": "repeat",
118
- },
119
- usage: `task update <TaskId> [--title <text>] [--body <text>|- | --append <text>]
120
- [--note <text>]
121
- [--priority 0..3] [--needs <TaskId>]... [--drop-needs <TaskId>]...
122
- [--parent <TaskId> | --no-parent]
123
- [--supersedes <TaskId>]... [--drop-supersedes <TaskId>]...
124
- [--relates <TaskId>]... [--drop-relates <TaskId>]...`,
125
- purpose: "Change a Task's fields and relationships.",
126
- details: [
127
- "--body replaces the body; --append adds text after it, separated by a newline when needed.",
128
- "--body - reads replacement body text from stdin.",
129
- ].join("\n"),
130
- },
131
- start: {
132
- arity: [1, Number.POSITIVE_INFINITY],
133
- flags: COMMON,
134
- usage: "task start <TaskId>...",
135
- purpose: "Move one or more open Tasks into progress.",
136
- },
137
- stop: {
138
- arity: [1, Number.POSITIVE_INFINITY],
139
- flags: COMMON,
140
- usage: "task stop <TaskId>...",
141
- purpose: "Return one or more in-progress Tasks to open.",
142
- },
143
- hold: {
144
- arity: [1, Number.POSITIVE_INFINITY],
145
- flags: COMMON,
146
- usage: "task hold <TaskId>...",
147
- purpose: "Put one or more Tasks on hold.",
148
- },
149
- resume: {
150
- arity: [1, Number.POSITIVE_INFINITY],
151
- flags: COMMON,
152
- usage: "task resume <TaskId>...",
153
- purpose: "Return one or more held Tasks to open.",
154
- },
155
- done: {
156
- arity: [1, Number.POSITIVE_INFINITY],
157
- flags: { ...COMMON, note: "value" },
158
- usage: "task done <TaskId>... [--note <text>]",
159
- purpose: "Mark one or more Tasks done.",
160
- },
161
- drop: {
162
- arity: [1, Number.POSITIVE_INFINITY],
163
- flags: { ...COMMON, note: "value" },
164
- usage: "task drop <TaskId>... [--note <text>]",
165
- purpose: "Mark one or more Tasks as no longer needed.",
166
- },
167
- context: {
168
- arity: [0, 1],
169
- flags: COMMON,
170
- usage: "task context [<namespace>]",
171
- purpose: "Set or read the default Task namespace for this directory.",
172
- details: "Omit <namespace> to read the current context; use / to reset it to the root namespace.",
173
- },
174
- compose: {
175
- arity: [0, 0],
176
- stdin: "compose",
177
- flags: { ...COMMON, actor: "value", plan: "boolean" },
178
- usage: "task compose [--actor <actor>] [--plan] -",
179
- purpose: "Create or update several Tasks from one document, with an optional preview.",
180
- details: [
181
- "nodes: + <Title> creates; @task/<id> modifies a pre-existing Task",
182
- "properties: as = <alias>; state = open|in_progress|on_hold|done|drop; pri = 0..3; parent = <ref>|empty",
183
- "relations: needs|supersedes|relates with =, +=, or -=",
184
- "references: @task/... is pre-existing; ^alias is new in this document",
185
- "body: body = clears; body <<TOKEN reads exact content to TOKEN",
186
- "TOKEN: [A-Z][A-Z0-9_]* with length 3..32",
187
- "example:",
188
- " ns=feature",
189
- " + Parent",
190
- " as = parent",
191
- " pri = 1",
192
- " body <<BODY",
193
- " Exact body bytes.",
194
- " BODY",
195
- " + Child",
196
- " parent = ^parent",
197
- ].join("\n"),
198
- },
199
- };
200
- export function isTaskAction(value) {
201
- return value !== undefined && Object.hasOwn(TASK_COMMAND_SPECS, value);
202
- }
203
- export function renderTaskHelp(action) {
204
- if (action !== undefined) {
205
- const spec = TASK_COMMAND_SPECS[action];
206
- return `${spec.purpose}\n\n${renderTaskUsage(action)}${spec.details === undefined ? "" : `\n\n${spec.details}`}`;
207
- }
208
- const nameWidth = Math.max(...Object.keys(TASK_COMMAND_SPECS).map((name) => name.length));
209
- return [
210
- "usage keiyaku task <command> ...",
211
- " keiyaku task <command> --help shows that command's complete usage",
212
- "",
213
- ...Object.entries(TASK_COMMAND_SPECS).map(([name, spec]) => ` ${name.padEnd(nameWidth)} ${spec.purpose}`),
214
- ].join("\n");
215
- }
216
- function renderTaskUsage(action) {
217
- return TASK_COMMAND_SPECS[action].usage
218
- .split("\n")
219
- .map((line, index) => {
220
- if (index === 0 || line.trimStart().startsWith("task ")) {
221
- const command = line.trimStart().startsWith("task ") ? `keiyaku ${line.trim()}` : `keiyaku ${line}`;
222
- return `${index === 0 ? "usage " : " "}${command}`;
223
- }
224
- return ` ${line.trim()}`;
225
- })
226
- .join("\n");
227
- }
228
- function taskUsage(action) {
229
- const lines = TASK_COMMAND_SPECS[action].usage.split("\n");
230
- return lines
231
- .map((line, index) => {
232
- if (index === 0 || line.trimStart().startsWith("task "))
233
- return `keiyaku ${line.trim()}`;
234
- return ` ${line.trim()}`;
235
- })
236
- .join("\n");
237
- }
238
- export function taskUsageGuide(action) {
239
- return {
240
- scope: `keiyaku task ${action}`,
241
- accepts: taskUsage(action),
242
- help: `keiyaku task ${action} --help`,
243
- };
244
- }
245
- /** One scan spec per Task action: `-` reads the document, or `--body -` replaces an update body. */
246
- function scanSpec(action, spec) {
247
- return {
248
- subject: `task ${action}`,
249
- flags: spec.flags,
250
- ...(spec.stdin === undefined ? {} : { stdin: spec.stdin }),
251
- stdinRefusal: "stdin marker '-' is not valid here",
252
- ...(action === "update" ? { stdinValue: "body" } : {}),
253
- };
254
- }
255
- function validateUpdate(scanned, fail) {
256
- const flags = scanned.flags;
257
- if (flags.body !== undefined && flags.append !== undefined)
258
- fail("--body and --append are mutually exclusive");
259
- if (flags.parent !== undefined && flags["no-parent"] === true)
260
- fail("--parent and --no-parent are mutually exclusive");
261
- if (Object.keys(flags).every((name) => name === "json"))
262
- fail("task update requires at least one patch option");
263
- }
264
- function validateTaskReadFlags(action, flags, fail) {
265
- if ((action === "ls" || action === "query") && flags.closed === true && flags.all === true)
266
- fail("--closed and --all are mutually exclusive");
267
- if (action === "ls" && flags.world === true) {
268
- // An explicit selector is checked below, after positional shape is known.
269
- }
270
- if (typeof flags.limit === "string") {
271
- try {
272
- validateTaskLimit(flags.limit);
273
- }
274
- catch (error) {
275
- fail(error instanceof Error ? error.message : String(error));
276
- }
277
- }
278
- if (typeof flags.sort === "string" &&
279
- flags.sort !== "priority" &&
280
- flags.sort !== "created" &&
281
- flags.sort !== "updated" &&
282
- flags.sort !== "id") {
283
- fail("--sort must be priority, created, updated, or id");
284
- }
285
- if ((action === "ready" || action === "blocked") && typeof flags.parent === "string") {
286
- try {
287
- validateTaskParent(flags.parent);
288
- }
289
- catch (error) {
290
- fail(error instanceof Error ? error.message : String(error));
291
- }
292
- }
293
- }
294
- /** Actions whose positionals are all addressed TaskIds validated by the native owner. */
295
- const TASK_ID_ACTIONS = new Set([
296
- "show",
297
- "tree",
298
- "update",
299
- "start",
300
- "stop",
301
- "hold",
302
- "resume",
303
- "done",
304
- "drop",
305
- ]);
306
- /** Validate every addressed TaskId positional through the native owner before any read or write. */
307
- function validateTaskIdPositionals(positionals, fail) {
308
- for (const taskId of positionals) {
309
- try {
310
- parseTaskId(taskId);
311
- }
312
- catch (error) {
313
- fail(error instanceof Error ? error.message : String(error));
314
- }
315
- }
316
- }
317
- /** Validate an explicit `task ls` namespace selector through the native owner. */
318
- function validateListSelector(selector, fail) {
319
- if (selector !== "task/" && (!selector.startsWith("task/") || !selector.endsWith("/")))
320
- fail(`invalid Task namespace selector: ${selector}`);
321
- if (selector === "task/")
322
- return;
323
- try {
324
- parseTaskNamespaceSelector(selector);
325
- }
326
- catch (error) {
327
- fail(error instanceof Error ? error.message : String(error));
328
- }
329
- }
330
- function validateTaskScan(action, scanned, fail) {
331
- const spec = TASK_COMMAND_SPECS[action], { positionals, flags, stdin } = scanned;
332
- if (positionals.length < spec.arity[0])
333
- fail(spec.arity[1] === 1 ? `task ${action} requires a TaskId` : `task ${action} requires at least one TaskId`);
334
- if (positionals.length > spec.arity[1])
335
- fail(spec.arity[1] === 0
336
- ? `task ${action} accepts no positional arguments`
337
- : `task ${action} accepts at most ${spec.arity[1]} positional argument${spec.arity[1] === 1 ? "" : "s"}`);
338
- if (action === "add" && (stdin === "document") === (positionals.length === 1))
339
- fail("task add requires either TITLE or '-' input");
340
- if (action === "add" &&
341
- stdin === "document" &&
342
- Object.keys(flags).some((name) => name !== "json" && name !== "namespace" && name !== "actor"))
343
- fail("task add document input owns its creation fields");
344
- if (action === "compose" && stdin !== "compose")
345
- fail("task compose requires '-' input");
346
- if (TASK_ID_ACTIONS.has(action))
347
- validateTaskIdPositionals(positionals, fail);
348
- if (action === "ls" && positionals.length === 1) {
349
- validateListSelector(positionals[0], fail);
350
- if (flags.world === true)
351
- fail("--world cannot be combined with an explicit Task namespace selector");
352
- }
353
- validateTaskReadFlags(action, flags, fail);
354
- if (action === "update")
355
- validateUpdate(scanned, fail);
356
- }
357
- export function parseTaskCommand(argv) {
358
- const candidate = argv[0];
359
- if (!isTaskAction(candidate)) {
360
- throw new CliUsageError(`unknown task command: ${candidate ?? ""}`, unknownCommandGuide(TASK_FAMILY_USAGE_GUIDE, candidate ?? ""));
361
- }
362
- const action = candidate;
363
- const fail = (message) => {
364
- throw new CliUsageError(message, taskUsageGuide(action));
365
- };
366
- const scanned = scanArgs(argv, scanSpec(action, TASK_COMMAND_SPECS[action]), fail);
367
- validateTaskScan(action, scanned, fail);
368
- let where;
369
- if (action === "query" && typeof scanned.flags.where === "string") {
370
- try {
371
- where = parseTaskQueryExpression(scanned.flags.where);
372
- }
373
- catch (error) {
374
- fail(error instanceof Error ? error.message : String(error));
375
- }
376
- }
377
- return {
378
- command: "task",
379
- action,
380
- output: scanned.flags.json === true ? "json" : "text",
381
- ...scanned,
382
- ...(where === undefined ? {} : { where }),
383
- };
384
- }
@@ -1,5 +0,0 @@
1
- import { type TaskQueryExpression } from "../../task/query.js";
2
- export type { TaskQueryExpression } from "../../task/query.js";
3
- export declare function parseTaskQueryExpression(source: string): TaskQueryExpression;
4
- export declare function validateTaskLimit(source: string): void;
5
- export declare function validateTaskParent(source: string): void;