@astrosheep/keiyaku 4.6.32 → 4.6.34

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 (244) hide show
  1. package/README.md +18 -7
  2. package/build/plugins/claude/skills/keiyaku-akuma/SKILL.md +18 -11
  3. package/build/plugins/claude/skills/keiyaku-babysit/SKILL.md +8 -6
  4. package/build/plugins/claude/skills/keiyaku-debt/SKILL.md +2 -1
  5. package/build/plugins/claude/skills/keiyaku-workflow/SKILL.md +2 -1
  6. package/build/plugins/codex/skills/keiyaku-akuma/SKILL.md +18 -11
  7. package/build/plugins/codex/skills/keiyaku-babysit/SKILL.md +8 -6
  8. package/build/plugins/codex/skills/keiyaku-debt/SKILL.md +2 -1
  9. package/build/plugins/codex/skills/keiyaku-workflow/SKILL.md +2 -1
  10. package/build/plugins/opencode/skills/keiyaku-akuma/SKILL.md +18 -11
  11. package/build/plugins/opencode/skills/keiyaku-babysit/SKILL.md +8 -6
  12. package/build/plugins/opencode/skills/keiyaku-debt/SKILL.md +2 -1
  13. package/build/plugins/opencode/skills/keiyaku-workflow/SKILL.md +2 -1
  14. package/build/plugins/pi/README.md +55 -97
  15. package/build/plugins/pi/keiyaku.ts +1 -142
  16. package/build/skills/keiyaku-akuma/SKILL.md +18 -11
  17. package/build/skills/keiyaku-babysit/SKILL.md +8 -6
  18. package/build/skills/keiyaku-debt/SKILL.md +2 -1
  19. package/build/skills/keiyaku-workflow/SKILL.md +2 -1
  20. package/build/src/akuma/akuma-instance.d.ts +11 -0
  21. package/build/src/akuma/akuma-instance.js +1 -2
  22. package/build/src/akuma/akuma-observe.d.ts +8 -0
  23. package/build/src/akuma/akuma-observe.js +81 -14
  24. package/build/src/akuma/akuma-owner.d.ts +1 -0
  25. package/build/src/akuma/akuma-owner.js +3 -5
  26. package/build/src/akuma/akuma-selection-execution.d.ts +82 -7
  27. package/build/src/akuma/akuma-selection-execution.js +26 -27
  28. package/build/src/akuma/akuma-wait.d.ts +155 -1
  29. package/build/src/akuma/akuma-wait.js +94 -34
  30. package/build/src/akuma/akuma.d.ts +17 -1
  31. package/build/src/akuma/akuma.js +37 -18
  32. package/build/src/akuma/body.js +13 -18
  33. package/build/src/akuma/call-initial-tell.d.ts +0 -1
  34. package/build/src/akuma/call-initial-tell.js +0 -1
  35. package/build/src/akuma/heart/activity-schema.d.ts +16 -0
  36. package/build/src/akuma/heart/activity-schema.js +7 -0
  37. package/build/src/akuma/heart/facts.d.ts +1 -0
  38. package/build/src/akuma/heart/facts.js +14 -0
  39. package/build/src/akuma/heart/index.d.ts +7 -1
  40. package/build/src/akuma/heart/index.js +35 -9
  41. package/build/src/akuma/heart/rows.d.ts +1 -0
  42. package/build/src/akuma/heart/rows.js +4 -0
  43. package/build/src/akuma/heart/timeline.js +4 -4
  44. package/build/src/akuma/lineage-cache.d.ts +7 -2
  45. package/build/src/akuma/lineage-cache.js +48 -24
  46. package/build/src/akuma/projection-read.d.ts +4 -2
  47. package/build/src/akuma/projection-read.js +25 -23
  48. package/build/src/akuma/projection.d.ts +94 -2
  49. package/build/src/akuma/projection.js +47 -47
  50. package/build/src/akuma/provider.d.ts +2 -2
  51. package/build/src/akuma/provider.js +27 -20
  52. package/build/src/akuma/providers/acp/core.js +2 -5
  53. package/build/src/akuma/providers/opencode-sdk/events.d.ts +2 -1
  54. package/build/src/akuma/providers/opencode-sdk/events.js +31 -1
  55. package/build/src/akuma/publication.js +3 -2
  56. package/build/src/akuma/selection-observation.d.ts +645 -0
  57. package/build/src/akuma/selection-observation.js +22 -7
  58. package/build/src/akuma/status-projection.d.ts +14 -1
  59. package/build/src/akuma/status-projection.js +40 -2
  60. package/build/src/akuma/turn-drive.js +21 -15
  61. package/build/src/body/amend.js +5 -17
  62. package/build/src/body/decode.js +11 -1
  63. package/build/src/body/envelope.d.ts +5 -1
  64. package/build/src/body/envelope.js +4 -2
  65. package/build/src/body/render.js +4 -6
  66. package/build/src/bounded-list.d.ts +8 -0
  67. package/build/src/bounded-list.js +10 -0
  68. package/build/src/cli/commands/akuma-grammar.d.ts +5 -8
  69. package/build/src/cli/commands/akuma-grammar.js +52 -77
  70. package/build/src/cli/commands/akuma.d.ts +1 -2
  71. package/build/src/cli/commands/akuma.js +12 -61
  72. package/build/src/cli/commands/contract-grammar.d.ts +1 -0
  73. package/build/src/cli/commands/contract-grammar.js +39 -42
  74. package/build/src/cli/commands/contract-help.d.ts +6 -5
  75. package/build/src/cli/commands/contract-help.js +21 -13
  76. package/build/src/cli/commands/contract.d.ts +3 -3
  77. package/build/src/cli/commands/contract.js +13 -9
  78. package/build/src/cli/commands/debt-grammar.js +2 -4
  79. package/build/src/cli/parse.d.ts +4 -10
  80. package/build/src/cli/parse.js +2 -5
  81. package/build/src/cli/render/akuma-activity.d.ts +12 -34
  82. package/build/src/cli/render/akuma-activity.js +99 -180
  83. package/build/src/cli/render/akuma.d.ts +5 -11
  84. package/build/src/cli/render/akuma.js +22 -30
  85. package/build/src/cli/render/catalog.js +4 -6
  86. package/build/src/cli/render/contract-history.d.ts +1 -3
  87. package/build/src/cli/render/contract-history.js +70 -49
  88. package/build/src/cli/render/contract-observation.d.ts +2 -1
  89. package/build/src/cli/render/contract-observation.js +25 -1
  90. package/build/src/cli/render/contract-wait.d.ts +2 -2
  91. package/build/src/cli/render/contract-wait.js +21 -17
  92. package/build/src/cli/render/contract.js +12 -9
  93. package/build/src/cli/render/debt.js +1 -2
  94. package/build/src/cli/render/execution-progress.js +1 -3
  95. package/build/src/cli/render/kanshi-akuma.d.ts +4 -3
  96. package/build/src/cli/render/kanshi-akuma.js +27 -23
  97. package/build/src/cli/render/kanshi.js +45 -60
  98. package/build/src/cli/render/receipt.d.ts +1 -1
  99. package/build/src/cli/render/receipt.js +33 -28
  100. package/build/src/cli/render/reconcile.js +2 -5
  101. package/build/src/cli/render/refusal.js +3 -6
  102. package/build/src/cli/render/terminal.d.ts +2 -4
  103. package/build/src/cli/render/terminal.js +10 -17
  104. package/build/src/cli/render/verbs.d.ts +1 -0
  105. package/build/src/cli/render/verbs.js +39 -34
  106. package/build/src/cli/runtime.js +12 -32
  107. package/build/src/core/facts/codec.js +7 -2
  108. package/build/src/core/facts/eligibility.d.ts +4 -4
  109. package/build/src/core/facts/eligibility.js +11 -0
  110. package/build/src/core/facts/fold.js +9 -5
  111. package/build/src/core/facts/gate.d.ts +5 -1
  112. package/build/src/core/facts/gate.js +14 -10
  113. package/build/src/core/facts/types.d.ts +5 -1
  114. package/build/src/core/facts/types.js +7 -0
  115. package/build/src/core/subject.d.ts +4 -1
  116. package/build/src/core/subject.js +10 -2
  117. package/build/src/core/verbs/amend.d.ts +15 -4
  118. package/build/src/core/verbs/amend.js +19 -9
  119. package/build/src/debt/board.d.ts +2 -1
  120. package/build/src/debt/board.js +3 -3
  121. package/build/src/debt/catalog.js +2 -1
  122. package/build/src/debt/document.d.ts +1 -0
  123. package/build/src/debt/document.js +3 -0
  124. package/build/src/debt/index.d.ts +2 -2
  125. package/build/src/debt/index.js +9 -14
  126. package/build/src/debt/input.d.ts +2 -1
  127. package/build/src/debt/input.js +6 -4
  128. package/build/src/debt/operations.d.ts +2 -1
  129. package/build/src/dispatch/index.d.ts +0 -17
  130. package/build/src/dispatch/index.js +1 -10
  131. package/build/src/git/identity.js +16 -45
  132. package/build/src/git/nuke.js +13 -23
  133. package/build/src/git/observe.d.ts +7 -3
  134. package/build/src/git/observe.js +29 -26
  135. package/build/src/git/process.js +11 -18
  136. package/build/src/git/read-observation.d.ts +5 -4
  137. package/build/src/git/repository.d.ts +2 -0
  138. package/build/src/git/repository.js +13 -1
  139. package/build/src/git/scratch.js +2 -14
  140. package/build/src/git/terminal-reconcile.js +1 -13
  141. package/build/src/history.d.ts +26 -0
  142. package/build/src/history.js +43 -0
  143. package/build/src/index.d.ts +6 -3
  144. package/build/src/kanshi/counts.d.ts +15 -1
  145. package/build/src/kanshi/counts.js +14 -3
  146. package/build/src/kanshi/index.d.ts +3 -4
  147. package/build/src/kanshi/index.js +2 -3
  148. package/build/src/kanshi/read.d.ts +21 -0
  149. package/build/src/kanshi/read.js +7 -3
  150. package/build/src/kanshi/report.d.ts +94 -0
  151. package/build/src/library/address.d.ts +12 -5
  152. package/build/src/library/address.js +18 -32
  153. package/build/src/library/akuma-creation.d.ts +39 -0
  154. package/build/src/library/akuma-creation.js +3 -9
  155. package/build/src/library/akumas.d.ts +5 -1
  156. package/build/src/library/akumas.js +11 -5
  157. package/build/src/library/continuation.d.ts +10 -0
  158. package/build/src/library/contract-composition.js +10 -10
  159. package/build/src/library/contract-creation.js +12 -13
  160. package/build/src/library/contract-outcomes.d.ts +72 -1
  161. package/build/src/library/contract-outcomes.js +1 -0
  162. package/build/src/library/contract-types.d.ts +233 -25
  163. package/build/src/library/contract-types.js +32 -12
  164. package/build/src/library/contract-wait.d.ts +212 -0
  165. package/build/src/library/contract-wait.js +65 -49
  166. package/build/src/library/delivery.d.ts +25 -0
  167. package/build/src/library/input.d.ts +8 -26
  168. package/build/src/library/input.js +17 -12
  169. package/build/src/library/kei.js +167 -90
  170. package/build/src/library/keiyaku-attribution.d.ts +1 -1
  171. package/build/src/library/keiyaku-attribution.js +3 -1
  172. package/build/src/library/keiyaku-classify.js +8 -4
  173. package/build/src/library/keiyaku-debt.d.ts +8 -7
  174. package/build/src/library/keiyaku-debt.js +1 -2
  175. package/build/src/library/keiyaku-identity.d.ts +4 -3
  176. package/build/src/library/keiyaku-identity.js +35 -7
  177. package/build/src/library/keiyaku-verbs.d.ts +974 -1409
  178. package/build/src/library/keiyaku-verbs.js +154 -161
  179. package/build/src/library/keiyaku-wait.d.ts +753 -0
  180. package/build/src/library/keiyaku-wait.js +230 -0
  181. package/build/src/library/keiyaku.d.ts +3110 -29
  182. package/build/src/library/keiyaku.js +342 -438
  183. package/build/src/library/model-tools.d.ts +754 -0
  184. package/build/src/library/model-tools.js +362 -0
  185. package/build/src/library/outcome.js +5 -6
  186. package/build/src/library/refusal.d.ts +25 -1
  187. package/build/src/library/refusal.js +4 -5
  188. package/build/src/library/selection.d.ts +18 -5
  189. package/build/src/library/selection.js +11 -5
  190. package/build/src/mcp/adapter.d.ts +0 -6
  191. package/build/src/mcp/adapter.js +11 -160
  192. package/build/src/mcp/description.d.ts +2 -0
  193. package/build/src/mcp/description.js +2 -0
  194. package/build/src/mcp/help.d.ts +1 -1
  195. package/build/src/mcp/help.js +10 -7
  196. package/build/src/pi/index.d.ts +5 -0
  197. package/build/src/pi/index.js +99 -0
  198. package/build/src/pi/status.d.ts +12 -0
  199. package/build/src/pi/status.js +140 -0
  200. package/build/src/protocol/amend.d.ts +14 -3
  201. package/build/src/protocol/amend.js +113 -46
  202. package/build/src/protocol/bind.d.ts +1 -1
  203. package/build/src/protocol/bind.js +5 -16
  204. package/build/src/protocol/completion.d.ts +30 -0
  205. package/build/src/protocol/completion.js +8 -5
  206. package/build/src/protocol/deliver.js +7 -20
  207. package/build/src/protocol/delivery-preview.d.ts +5 -0
  208. package/build/src/protocol/execution-observation.d.ts +8 -0
  209. package/build/src/protocol/intent.d.ts +1 -0
  210. package/build/src/protocol/intent.js +4 -1
  211. package/build/src/protocol/operations.d.ts +56 -16
  212. package/build/src/protocol/operations.js +18 -32
  213. package/build/src/protocol/placement.js +7 -1
  214. package/build/src/protocol/progress.js +0 -6
  215. package/build/src/protocol/read/status.d.ts +52 -4
  216. package/build/src/protocol/read/status.js +26 -22
  217. package/build/src/protocol/reintegrate.js +2 -2
  218. package/build/src/protocol/result-leaves.d.ts +56 -8
  219. package/build/src/protocol/result-leaves.js +11 -2
  220. package/build/src/protocol/run.js +1 -4
  221. package/build/src/protocol/verify.d.ts +10 -0
  222. package/build/src/protocol/verify.js +1 -0
  223. package/build/src/runtime/proc/windows-launch.exe +0 -0
  224. package/build/src/settlement/settle.js +19 -68
  225. package/package.json +7 -3
  226. package/plugins/paseo/plugin/index.server.ts +6 -2
  227. package/plugins/paseo/plugin/server/attach.ts +68 -48
  228. package/plugins/paseo/plugin/server/directory.ts +259 -0
  229. package/plugins/paseo/plugin/server/mirror-identity.ts +3 -32
  230. package/plugins/paseo/plugin/server/reopen.ts +52 -38
  231. package/plugins/pi/README.md +55 -97
  232. package/plugins/pi/keiyaku.ts +1 -142
  233. package/skills/keiyaku-akuma/SKILL.md +18 -11
  234. package/skills/keiyaku-babysit/SKILL.md +8 -6
  235. package/skills/keiyaku-debt/SKILL.md +2 -1
  236. package/skills/keiyaku-workflow/SKILL.md +2 -1
  237. package/build/plugins/pi/akuma-tools.ts +0 -283
  238. package/build/src/body/keys.d.ts +0 -4
  239. package/build/src/body/keys.js +0 -11
  240. package/build/src/kanshi/roster.d.ts +0 -2
  241. package/build/src/kanshi/roster.js +0 -2
  242. package/build/src/mcp/output.d.ts +0 -385
  243. package/build/src/mcp/output.js +0 -193
  244. package/plugins/pi/akuma-tools.ts +0 -283
@@ -50,8 +50,7 @@ export const CONTRACT_COMMAND_SPECS = {
50
50
  "Region lists the narrowest writes this approach needs, not every file involved;",
51
51
  "avoid broad directories and redundant parent/child patterns. Put one repository-relative",
52
52
  "pattern per nonblank line: bare lines, list items, or fences (no info string, or",
53
- "txt) are combined. A trailing '/' means 'path/**'. Whitespace in a pattern",
54
- "binds with a warning.",
53
+ "txt) are combined. A trailing '/' means 'path/**'.",
55
54
  "",
56
55
  "Only explicit verify runs Verification; gate selection controls recording and placement.",
57
56
  "Verification uses one or more closed bash, zsh, or pwsh fences. Its fence",
@@ -62,15 +61,22 @@ export const CONTRACT_COMMAND_SPECS = {
62
61
  amend: {
63
62
  positional: "optional",
64
63
  stdin: "optional",
65
- flags: { after: "repeat", "clear-after": "boolean", gates: "raw-value", json: "boolean" },
66
- usage: "amend [<contract>|@name] [--after <kei/...> [--after <kei/...>]... | --clear-after] [--gates <name,...>] [--repo <path>] [-]",
67
- purpose: "Change a Contract's document, prerequisites, or acceptance gates.",
64
+ flags: { after: "repeat", "clear-after": "boolean", gates: "raw-value", target: "value", json: "boolean" },
65
+ usage: "amend [<contract>|@name] [--after <kei/...> [--after <kei/...>]... | --clear-after] [--gates <name,...>] [--target <branch|kei/...>] [--repo <path>] [-]",
66
+ purpose: "Change a Contract's document, target, prerequisites, or acceptance gates.",
68
67
  details: [
69
68
  "Gates are checked at integration: reviewed needs a satisfied review;",
70
69
  "verified needs satisfied evidence for every declaration. --gates <name,...> replaces them with",
71
70
  "reviewed, verified, or configured groups (see keiyaku settings).",
72
71
  'Omitting --gates keeps them; --gates "" clears them.',
73
72
  "",
73
+ "--target explicitly selects an existing local branch or active Contract destination.",
74
+ "Omission keeps the current target, even after its Contract is accepted or abandoned.",
75
+ "Self-targets and destination cycles refuse. Use refs/heads/kei/... for a branch named kei/....",
76
+ "Retargeting requires fresh verify; unchanged candidate content keeps its review.",
77
+ "",
78
+ "Naming no edit at all reports the active Contract unchanged and writes nothing.",
79
+ "",
74
80
  "stdin is an amendment; each heading is one edit:",
75
81
  " ## Context|Objective|Design|Region|Criteria|Verification|<extension> (replace, or add a new extension)",
76
82
  " ## Replace: Context|Objective|Design|Region|Criteria|Verification|<extension>",
@@ -192,11 +198,11 @@ export const CONTRACT_COMMAND_SPECS = {
192
198
  positional: "optional",
193
199
  stdin: "none",
194
200
  flags: { json: "boolean" },
195
- usage: "show [<contract>|@name] [--repo <path>]\nshow <debt/...>",
201
+ usage: "show <contract|@name> [--repo <path>]\nshow <debt/...>",
196
202
  purpose: "Read one Contract's guidance or one Debt and its prerequisites.",
197
203
  details: [
198
204
  "Accepts a complete Contract identity, exact @name short selector, or one complete Debt identity.",
199
- "Omitted selection uses the exact managed worktree's installed Contract context.",
205
+ "An explicit selector is required, including inside a Contract worktree.",
200
206
  "Akuma, category, glob, and plural selections are refused before reading.",
201
207
  "Debt reads use the invocation World and do not accept --repo.",
202
208
  "Text returns Contract guidance directly or renders the Debt owner's detail; --json serializes the same native value.",
@@ -218,7 +224,8 @@ export const CONTRACT_COMMAND_SPECS = {
218
224
  purpose: "Show one Contract or Akuma status.",
219
225
  details: [
220
226
  "Use kanshi for the selector-free World board.",
221
- "Addressed status accepts one complete identity or resolves one @name.",
227
+ "The selector accepts one complete identity or @name (Contract shorthand or World-local Akuma alias).",
228
+ "Names use the shared invocation resolver; a Contract/Akuma collision is refused. Results keep the full canonical id.",
222
229
  "Plural selectors, categories, globs and --limit are refused before reading.",
223
230
  "Akuma entries show the directory each Akuma was started in.",
224
231
  ].join("\n"),
@@ -226,16 +233,17 @@ export const CONTRACT_COMMAND_SPECS = {
226
233
  ls: {
227
234
  positional: "optional",
228
235
  stdin: "none",
229
- flags: { limit: "value", json: "boolean", mine: "boolean", closed: "boolean", all: "boolean" },
230
- usage: 'ls debt[/] [--closed | --all] [--limit <count>]\nls kei[/] [--limit <count>]\nls aku[/] [--limit <count>]\nls aku/<name>[/] [--limit <count>]\nls "aku/<name>/*" [--limit <count>]\nls "aku/*" [--limit <count>]\nls "aku/*/*" [--limit <count>]\nls [aku/<name>[/] | "aku/<name>/*" | "aku/*/*"] --mine [--limit <count>]',
236
+ flags: { limit: "value", json: "boolean", mine: "boolean", settled: "boolean", all: "boolean" },
237
+ usage: 'ls debt[/] [--settled | --all] [--limit <count>]\nls kei[/] [--settled | --all] [--limit <count>]\nls aku[/] [--limit <count>]\nls aku/<name>[/] [--settled | --all] [--limit <count>]\nls "aku/<name>/*" [--settled | --all] [--limit <count>]\nls "aku/*" [--settled | --all] [--limit <count>]\nls "aku/*/*" [--settled | --all] [--limit <count>]\nls [aku/<name>[/] | "aku/<name>/*" | "aku/*/*"] --mine [--settled | --all] [--limit <count>]',
231
238
  purpose: "List debts (ls debt), contracts (ls kei), or akumas (ls aku).",
232
239
  details: [
233
- "Debt lists open work by default; --closed selects terminal work and --all selects both.",
234
- "ls kei lists active Contracts; accepted and abandoned ones leave the list, and their record stays in history and Git.",
240
+ "Contract, Debt, and Akuma-instance lists select active work by default; --settled selects work at rest and --all selects both.",
241
+ "Contracts are active while bound; accepted and abandoned Contracts are settled. Open Debts are active; done and dropped Debts are settled.",
242
+ "Asleep, killed, and stillborn Akumas are settled; running, unborn, stranded, hung, and untidy Akumas remain active.",
235
243
  "ls aku/ lists the spawnable Akuma-name catalog; ls aku/<name> lists recent retained Akuma instances under one name.",
236
244
  'ls "aku/<name>/*" is the same roster in glob form; ls "aku/*/*" lists recent retained Akuma instances across names.',
237
245
  "--mine selects the caller identity of this process and lists that caller's direct and transitive descendants in this World.",
238
- "Caller scoping is World-local and refuses for Contract, Debt, or Akuma-name catalogues.",
246
+ "Caller scoping is World-local, composes with lifecycle selection, and refuses for Contract, Debt, or Akuma-name catalogues. Lifecycle selection also refuses for Akuma-name catalogues.",
239
247
  "Descendant rows name their immediate calling Akuma beside the row.",
240
248
  ].join("\n"),
241
249
  },
@@ -3,11 +3,11 @@ import type { PendingRequest, VerbRequest } from "../parse.js";
3
3
  import { type CliOutcome } from "../streams.js";
4
4
  /** Admit bind Markdown before coordinate resolution and retain a malformed draft. */
5
5
  export declare function admitBindMarkdown(input: Readonly<{
6
- markdown: string;
6
+ terms: string;
7
7
  processCwd?: string;
8
8
  cwd?: string;
9
9
  }>): Promise<void>;
10
10
  export declare function acquireContractRequest(request: Exclude<PendingRequest, {
11
- name: "spawn" | "tell" | "ask" | "status";
11
+ name: "spawn" | "tell" | "ask";
12
12
  }>, runtime: CliRuntime): Promise<VerbRequest>;
13
- export declare function runContractRequest(request: VerbRequest, runtime: CliRuntime, alias?: string): Promise<CliOutcome>;
13
+ export declare function runContractRequest(request: VerbRequest, runtime: CliRuntime): Promise<CliOutcome>;
@@ -15,17 +15,17 @@ function draftWarning(error) {
15
15
  }
16
16
  /** Admit bind Markdown before coordinate resolution and retain a malformed draft. */
17
17
  export async function admitBindMarkdown(input) {
18
- if (isBlankInput(input.markdown))
18
+ if (isBlankInput(input.terms))
19
19
  throw new CliUsageError("bind requires a nonblank stdin document");
20
20
  try {
21
- validateContractMarkdown(input.markdown);
21
+ validateContractMarkdown(input.terms);
22
22
  }
23
23
  catch (error) {
24
24
  if (error instanceof Error && "executionReceipt" in error)
25
25
  throw error;
26
26
  if (errorCategory(error) !== "invalid-input")
27
27
  throw error;
28
- throw new BindDraftError(error, await bindDraftReceipt(() => resolveInvocationCwd(input), input.markdown));
28
+ throw new BindDraftError(error, await bindDraftReceipt(() => resolveInvocationCwd(input), input.terms));
29
29
  }
30
30
  }
31
31
  async function bindDraftReceipt(world, markdown) {
@@ -47,13 +47,18 @@ export async function acquireContractRequest(request, runtime) {
47
47
  }
48
48
  if (request.name === "amend" && isBlankInput(bytes))
49
49
  throw new CliUsageError("amend requires a nonblank stdin document");
50
- return { name: request.name, input: { ...request.input, markdown: bytes }, output: request.output };
50
+ if (request.name === "bind")
51
+ return { name: request.name, input: { ...request.input, terms: bytes }, output: request.output };
52
+ if (request.name === "amend")
53
+ return { name: request.name, input: { ...request.input, edits: bytes }, output: request.output };
54
+ return { name: request.name, input: { ...request.input, body: bytes }, output: request.output };
51
55
  }
52
- async function invokeAndFinish(request, runtime, alias) {
56
+ async function invokeAndFinish(request, runtime) {
53
57
  const progressing = request.name === "deliver" || request.name === "verify" || request.name === "review";
54
58
  const driver = progressing && request.output === "text" ? await runtime.progress() : undefined;
55
59
  const cancellable = progressing ||
56
60
  request.name === "wait" ||
61
+ request.name === "spawn" ||
57
62
  request.name === "tell" ||
58
63
  request.name === "fork" ||
59
64
  request.name === "kill";
@@ -69,7 +74,6 @@ async function invokeAndFinish(request, runtime, alias) {
69
74
  const completion = { kind: "returned", value };
70
75
  return emit(request.output, value, () => renderVerb(request.name, request.input, completion, {
71
76
  ...displayContext(),
72
- ...(alias === undefined ? {} : { alias }),
73
77
  ...(request.name === "ls" &&
74
78
  "mine" in request.input &&
75
79
  request.input.mine === true &&
@@ -82,7 +86,7 @@ async function runBind(request, runtime) {
82
86
  const { input, output } = request;
83
87
  if ("forkOf" in input)
84
88
  return invokeAndFinish(request, runtime);
85
- const markdown = input.markdown;
89
+ const markdown = input.terms;
86
90
  try {
87
91
  const answer = await runtime.facet.run("bind", input);
88
92
  const completion = { kind: "returned", value: answer };
@@ -102,7 +106,7 @@ async function runBind(request, runtime) {
102
106
  throw new BindDraftError(error, await bindDraftReceipt(runtime.draftWorld, markdown));
103
107
  }
104
108
  }
105
- export async function runContractRequest(request, runtime, alias) {
109
+ export async function runContractRequest(request, runtime) {
106
110
  if (request.name === "bind")
107
111
  return runBind(request, runtime);
108
112
  if (request.name === "arc") {
@@ -119,5 +123,5 @@ export async function runContractRequest(request, runtime, alias) {
119
123
  }
120
124
  if (request.name === "review" && isBlankInput(request.input.summary))
121
125
  throw new CliUsageError("review requires a nonblank summary");
122
- return invokeAndFinish(request, runtime, alias);
126
+ return invokeAndFinish(request, runtime);
123
127
  }
@@ -98,8 +98,6 @@ function validateUpdate(scanned, fail) {
98
98
  if (Object.keys(flags).every((name) => name === "json"))
99
99
  fail("debt update requires at least one update option");
100
100
  }
101
- /** Actions whose positionals are all addressed DebtIds validated by the native owner. */
102
- const DEBT_ID_ACTIONS = new Set(["update"]);
103
101
  /** Validate every addressed DebtId positional through the native owner before any read or write. */
104
102
  function validateDebtIdPositionals(positionals, fail) {
105
103
  for (const debtId of positionals) {
@@ -123,10 +121,10 @@ function validateDebtScan(action, scanned, fail) {
123
121
  fail("debt add requires either TITLE or '-' input");
124
122
  if (action === "add" && stdin === "document" && Object.keys(flags).some((name) => name !== "json"))
125
123
  fail("debt add document input owns its creation fields");
126
- if (DEBT_ID_ACTIONS.has(action))
124
+ if (action === "update") {
127
125
  validateDebtIdPositionals(positionals, fail);
128
- if (action === "update")
129
126
  validateUpdate(scanned, fail);
127
+ }
130
128
  }
131
129
  export function parseDebtCommand(argv) {
132
130
  const candidate = argv[0];
@@ -21,23 +21,23 @@ export type VerbRequest<K extends CliVerb = CliVerb> = {
21
21
  }>;
22
22
  }[K];
23
23
  type DocumentBind = Extract<VerbInput<"bind">, {
24
- markdown: string;
24
+ terms: string;
25
25
  }>;
26
26
  type Acquisitions = {
27
27
  bind: {
28
- input: Omit<DocumentBind, "markdown">;
28
+ input: Omit<DocumentBind, "terms">;
29
29
  acquire: {
30
30
  markdown: true;
31
31
  };
32
32
  };
33
33
  amend: {
34
- input: Omit<VerbInput<"amend">, "markdown">;
34
+ input: Omit<VerbInput<"amend">, "edits">;
35
35
  acquire: {
36
36
  markdown: true;
37
37
  };
38
38
  };
39
39
  arc: {
40
- input: Omit<VerbInput<"arc">, "markdown">;
40
+ input: Omit<VerbInput<"arc">, "body">;
41
41
  acquire: {
42
42
  markdown: true;
43
43
  };
@@ -54,12 +54,6 @@ type Acquisitions = {
54
54
  prompt?: AkumaPromptSource;
55
55
  };
56
56
  };
57
- status: {
58
- input: Record<string, never>;
59
- acquire: {
60
- selector: string;
61
- };
62
- };
63
57
  tell: {
64
58
  input: Omit<VerbInput<"tell">, "prompt">;
65
59
  acquire: {
@@ -1,7 +1,7 @@
1
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
- import { parseContractCommand } from "./commands/contract-grammar.js";
4
+ import { parseContractCommand, refuse } from "./commands/contract-grammar.js";
5
5
  import { CONTRACT_COMMAND_SPECS, renderContractHelp as renderContractHelpForOwner, } from "./commands/contract-help.js";
6
6
  import { renderOpaqueBlock, renderTextBlock } from "./render/terminal.js";
7
7
  import { scanArgs } from "./scan.js";
@@ -113,7 +113,7 @@ export function commandRepoPolicy(command) {
113
113
  case "region":
114
114
  return { use: "required", acceptsExplicit: true };
115
115
  case "show": {
116
- const debt = command.input.id?.startsWith("debt/") === true;
116
+ const debt = command.input.selector.startsWith("debt/");
117
117
  return { use: debt ? "none" : "required", acceptsExplicit: !debt };
118
118
  }
119
119
  case "ls":
@@ -166,9 +166,6 @@ export function assertExplicitRepoUse(command, repo) {
166
166
  if (repo !== undefined && !commandRepoPolicy(command).acceptsExplicit)
167
167
  refuseUnusedRepo(command);
168
168
  }
169
- function refuse(command, message) {
170
- throw new CliUsageError(message, commandGuide(command, CONTRACT_COMMAND_SPECS[command].usage));
171
- }
172
169
  /** The contract surfaces' one scan spec: `-` carries the edge's own stdin input. */
173
170
  function contractScanSpec(command, spec) {
174
171
  return {
@@ -33,8 +33,10 @@ type DisplayAssociation = Readonly<{
33
33
  /** Indent already-decided supporting lines one level, for every caller of this family. */
34
34
  export declare function subordinateLines(lines: readonly string[]): readonly string[];
35
35
  /**
36
- * Identity and its static coordinates. The execution directory and any already-exposed effective
37
- * actions belong above the content boundary; an absent coordinate is an absent line.
36
+ * The one observation identity line: complete Akuma identity, optional alias as a parenthetical
37
+ * supplement, and a known associated Contract inline behind the shared separator.
38
+ * The execution directory and any already-exposed effective actions belong above the content
39
+ * boundary; an absent coordinate is an absent line.
38
40
  */
39
41
  export declare function panelHead(id: string, alias: string | undefined, contract: DisplayAssociation | undefined, context?: readonly string[]): readonly string[];
40
42
  /**
@@ -64,12 +66,6 @@ export type ActivityStream = ((activity: RenderedActivity) => readonly string[])
64
66
  * always print.
65
67
  */
66
68
  export declare function activityStream(context: TextRenderContext): ActivityStream;
67
- export declare function inputWaitConclusion(observation: AkumaAskObservation, input: Readonly<{
68
- startedAt: number;
69
- completedAt?: string | null;
70
- now?: number;
71
- status?: LiveStatusObservation["status"];
72
- }>): readonly string[];
73
69
  /** The identity a streamed observing call's head frame renders from its resolved birth. */
74
70
  export type ObservedCallHead = Readonly<{
75
71
  id: string;
@@ -106,13 +102,6 @@ export type InputWaitStream = Readonly<{
106
102
  conclude: (result: InputWaitConclusion) => string;
107
103
  opened: () => boolean;
108
104
  }>;
109
- /**
110
- * The call-observation projection of one input wait: the same admitted/observe/frame/flush/opened
111
- * lifetime with the closing judgment from the native compact spawn result.
112
- */
113
- export type CallObservationStream = Readonly<Omit<InputWaitStream, "conclude"> & {
114
- conclude: (result: SpawnResult) => string;
115
- }>;
116
105
  /**
117
106
  * Live view over one observing input: its identity frame opens once, selected
118
107
  * activity follows, and the input-bound outcome supplies the closing row.
@@ -122,36 +111,25 @@ export declare function inputWaitStream(context: TextRenderContext, head: () =>
122
111
  now?: () => number | undefined;
123
112
  answerSeparator?: true;
124
113
  }>): InputWaitStream;
125
- export declare function callObservationStream(context: TextRenderContext, head: ObservedCallHead, options?: Readonly<{
126
- now?: () => number | undefined;
127
- admittedAt?: string;
128
- prompt?: string;
129
- }>): CallObservationStream;
130
114
  type SnapshotView = AkumaObservation;
131
- type SnapshotCoreOptions = Readonly<{
132
- alias?: string;
133
- facts?: readonly string[];
134
- }>;
135
115
  export declare function currentWorkLines(work: CurrentWork, context: TextRenderContext): readonly string[];
136
- export declare function snapshotText(view: SnapshotView, context: TextRenderContext, options?: SnapshotCoreOptions): string;
116
+ export declare function snapshotText(view: SnapshotView, context: TextRenderContext, options?: Readonly<{
117
+ alias?: string;
118
+ }>): string;
137
119
  export declare function killResultText(id: string, evidence: KillEvidence, alias?: string): string;
138
120
  /** Presentation-only state for one akuma invocation; it never reaches JSON. */
139
121
  type AkumaPresentation = Readonly<{
140
122
  alias?: string;
141
123
  }>;
142
- export declare function inputObservation(result: AkumaAskResult | AkumaTellResult): AkumaAskObservation;
143
- export declare function askRawAnswer(result: AkumaAskResult | AkumaTellResult): string | undefined;
144
- export declare function callRawAnswer(result: SpawnResult, streamed: boolean): string | undefined;
124
+ /** The settlement instant a settled observation carries; an open observation has none. */
125
+ export declare function observationCompletedAt(observation: AkumaAskObservation): string | undefined;
126
+ export declare function askRawAnswer(result: AkumaAskResult): string | undefined;
145
127
  export declare function historyRawAnswer(result: AkumaHistoryResult, historyId: string | undefined): string | undefined;
146
- /**
147
- * One wait's final text: one compact line per observed member, then one failure line per member
148
- * the wait could not read. A wait opens no frame and extracts no separate answer, so an answer is
149
- * visible only as the snapshot's own bounded summary.
150
- */
128
+ /** Compact final facts, actual recent events, and an exact-turn full outcome; never a live frame. */
151
129
  export declare function waitText(result: AkumaWaitResult, presentation: AkumaPresentation, context: TextRenderContext): string;
152
130
  export declare function historyText(result: AkumaHistoryResult, presentation: AkumaPresentation & Readonly<{
153
131
  id?: string;
154
- last?: boolean;
132
+ answer?: boolean;
155
133
  since?: number;
156
134
  }>, context: TextRenderContext): string;
157
135
  /** One bounded, quoted preview of a Tell an outer receipt already admitted, indented beneath it. */