@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
@@ -1,27 +1,40 @@
1
1
  /** @architectureCompositionRoot */
2
2
  import { z } from "zod";
3
+ import { lifecycleSelectionSchema } from "../bounded-list.js";
3
4
  export { classifyVerb } from "./keiyaku-classify.js";
4
- import { durationSchema } from "../akuma/call-input.js";
5
+ // Native owner declarations shared with transport descriptions at this composition boundary.
6
+ export { akumaCatalogueSchema, akumaCatalogueRowSchema, akumaObservationSchema, observedAkumaWaitItemSchema, } from "../akuma/selection-observation.js";
7
+ export { dispatchAssociationSchema } from "../akuma/dispatch-association.js";
8
+ export { currentWorkSchema } from "../akuma/status-projection.js";
9
+ export { contractCatalogueSchema, contractSummarySchema } from "../protocol/read/status.js";
10
+ export { contractNormalStatusSchema } from "../kanshi/report.js";
11
+ export { akumaNameCatalogSchema, akumaNameCatalogRowSchema } from "../akuma/archetype.js";
12
+ export { debtListSchema, debtSummarySchema } from "../debt/index.js";
13
+ export { contractIdSchema } from "../git/identity.js";
14
+ export { akumaIdSchema } from "../akuma/identity.js";
5
15
  import { parseDuration } from "../duration.js";
6
16
  import { addDebtInputSchema, updateDebtInputSchema } from "../debt/input.js";
7
- import { amendInputSchemas } from "./input.js";
17
+ import { amendInputSchema } from "./input.js";
8
18
  import { askProgressSchema } from "../akuma/akuma-selection-execution.js";
9
19
  import { akumaReportResultSchema } from "../akuma/akuma-instance.js";
10
20
  import { akumaIdSchema } from "../akuma/identity.js";
11
21
  import { contractIdSchema } from "../git/identity.js";
12
22
  import { akumaNameCatalogSchema } from "../akuma/archetype.js";
13
- import { akumaCatalogueSchema, akumaObservationSchema, akumaAskResultSchema, akumaAskNormalResultSchema, akumaKillResultSchema, akumaTellResultSchema, akumaWaitResultSchema, akumaWaitNormalResultSchema, } from "../akuma/selection-observation.js";
23
+ import { akumaCatalogueSchema, akumaObservationSchema, akumaAskResultSchema, akumaAskNormalResultSchema, akumaKillResultSchema, akumaTellResultSchema, } from "../akuma/selection-observation.js";
14
24
  import { regionResultSchema, kanshiReportSchema, contractStatusSchema, contractNormalStatusSchema, } from "../kanshi/report.js";
15
25
  import { settingsSchema } from "../settings.js";
16
26
  import { contractCatalogueSchema } from "../protocol/read/status.js";
17
27
  import { executionObservationSchema } from "../protocol/execution-observation.js";
18
- import { spawnProgressSchema, spawnResultSchema, spawnNormalResultSchema, forkResultSchema, forkNormalResultSchema, } from "./akuma-creation.js";
28
+ import { spawnResultSchema, spawnNormalResultSchema, forkResultSchema, forkNormalResultSchema, } from "./akuma-creation.js";
19
29
  import { bindOutcomeSchema, bindNormalOutcomeSchema, amendOutcomeSchema, arcOutcomeSchema, deliverOutcomeSchema, deliveryPreviewOutcomeSchema, verifyOutcomeSchema, verifyNormalOutcomeSchema, reviewOutcomeSchema, abandonOutcomeSchema, } from "./contract-outcomes.js";
20
30
  import { contractHistorySchema } from "./contract-types.js";
31
+ import { canonicalDecimalSchema, historyPageSchemas } from "../history.js";
21
32
  import { guidanceSchema, guidanceNormalSchema } from "./kei.js";
22
- import { contractWaitDurationSchema, contractWaitResultSchema, contractWaitNormalResultSchema, } from "./contract-wait.js";
33
+ import { invocationWaitResultSchema, invocationWaitNormalResultSchema } from "./keiyaku-wait.js";
34
+ import { akumaAliasSchema, parseAkumaGlob, parseReadableAkumaAlias } from "../identity/selector.js";
23
35
  import { reconcileResultSchema } from "./reconcile.js";
24
- import { akumaHistoryResultSchema, historySelectionSchemas } from "./selection.js";
36
+ import { akumaHistoryResultSchema } from "./selection.js";
37
+ import { historyInputSchemas } from "../akuma/akuma-owner.js";
25
38
  import { whoamiFactsSchema } from "./keiyaku-identity.js";
26
39
  import { resetOutcomeSchema } from "./outcome.js";
27
40
  import { debtAbsentSchema, debtShowResultSchema, debtShowNormalResultSchema, debtDoctorReportSchema, debtMutationResultSchema, debtMutationNormalResultSchema, debtCatalogueSchema, debtListSchema, debtUpdateResultSchema, } from "../debt/index.js";
@@ -32,9 +45,8 @@ const optText = text.exactOptional();
32
45
  const optBool = z.boolean().exactOptional();
33
46
  const strings = z.array(text).readonly();
34
47
  const positive = z.number().int().positive();
35
- const timeout = durationSchema.exactOptional();
36
- const waitDuration = text.refine((value) => parseDuration(value).kind === "parsed", {
37
- message: "wait requires an integer duration with unit ms, s, m, or h within the safe millisecond range",
48
+ const duration = text.refine((value) => parseDuration(value).kind === "parsed", {
49
+ message: "timeout requires an integer duration with unit ms, s, m, or h within the safe millisecond range",
38
50
  });
39
51
  const contract = {
40
52
  contract: optText.describe("Target Contract selector (kei/...); omit to resolve from cwd when inside an appointed Contract worktree."),
@@ -43,53 +55,55 @@ const commonBind = {
43
55
  target: text
44
56
  .nullable()
45
57
  .exactOptional()
46
- .describe("Integration target: branch name, active kei/... to stack on, or null for a targetless Contract. Omit to target the current branch."),
58
+ .describe("Where accepted work lands: an existing branch, an active kei/... to stack on, or null for no target. Omit to use the current branch, or copy the source target with forkOf."),
47
59
  };
48
60
  const jsonDocument = z.record(z.string(), z.unknown()).readonly();
49
61
  const contractSelector = text.startsWith("kei/");
50
62
  const akumaSelector = text.regex(/^(?!kei\/)/u);
51
- const debtSelection = z
52
- .enum(["active", "closed", "all"])
63
+ const historySelectorDescription = "Single subject: kei/... for a Contract, or aku/<name>/<hex> / @alias for an Akuma.";
64
+ const historyItemDescription = 'Open one complete retained item: a canonical positive safe decimal address for a Contract record or Akuma activity; Akumas also accept turn/<n> for an outcome, report/<n> for a report, or "answer" for the latest answered Turn and its exact coordinate. Cannot be combined with before, since, or limit.';
65
+ const catalogueSelection = lifecycleSelectionSchema
53
66
  .exactOptional()
54
- .describe('Debt lifecycle filter (valid only with "debt"/"debt/"): "active" (open, default), "closed" (done or drop), or "all".');
55
- const listBound = { limit: positive.exactOptional().describe("Maximum rows to return (positive integer).") };
67
+ .describe('Lifecycle selection for Contract, Debt, and Akuma-instance catalogues: "active" (still in play, default), "settled" (at rest), or "all". Not valid for akumaName values (aku/).');
56
68
  const catalogueSelector = 'Catalogue path selector: "kei"/"kei/", "debt"/"debt/", "aku"/"aku/" (akumaName values), or "aku/*" / "aku/*/*" / "aku/<name>" / "aku/<name>/*" (instances).';
57
- const lsInputSchema = z.union([
58
- z.strictObject({ selector: text.regex(/^(?:kei|aku)\/?$/u).describe(catalogueSelector), ...listBound }).readonly(),
59
- z
60
- .strictObject({
61
- selector: text.regex(/^debt\/?$/u).describe(catalogueSelector),
62
- selection: debtSelection,
63
- ...listBound,
64
- })
65
- .readonly(),
66
- z
67
- .strictObject({
68
- selector: text.regex(/^aku\/(?:\*(?:\/\*)?|[^/*]+(?:\/\*|\/)?)$/u).describe(catalogueSelector),
69
- mine: optBool.describe("When true on an Akuma-instance selector, restrict to direct and transitive descendants of this server environment's caller identity."),
70
- ...listBound,
71
- })
72
- .readonly(),
73
- ]);
69
+ const lsInputSchema = z
70
+ .strictObject({
71
+ selector: text
72
+ .regex(/^(?:kei|debt|aku)\/?$|^aku\/(?:\*(?:\/\*)?|[^/*]+(?:\/\*|\/)?)$/u)
73
+ .describe(catalogueSelector),
74
+ limit: positive.exactOptional().describe("Maximum rows to return (positive integer)."),
75
+ lifecycle: catalogueSelection,
76
+ mine: optBool.describe("Only Akumas you started, directly or through your Akumas; valid only for instances."),
77
+ })
78
+ .superRefine(({ selector, lifecycle, mine }, context) => {
79
+ if (lifecycle !== undefined && (selector === "aku" || selector === "aku/"))
80
+ context.addIssue({
81
+ code: "custom",
82
+ message: "lifecycle is valid only with a Contract, Debt, or Akuma-instance catalogue",
83
+ });
84
+ if (mine !== undefined && (!selector.startsWith("aku/") || selector === "aku/"))
85
+ context.addIssue({ code: "custom", message: "mine is valid only with an Akuma-instance catalogue" });
86
+ })
87
+ .readonly();
74
88
  const spawnFields = {
75
89
  akumaName: nonblank.describe('akumaName to spawn. Use ls {"selector":"aku/"} to list valid names, including when the selected name is not found. Always births a new instance; use tell or ask to continue an existing Akuma.'),
76
- contract: optText.describe("Contract ID (kei/...) to record as Dispatch association for status/kanshi; does not set workdir or inject Contract text."),
90
+ contract: optText.describe("Contract ID (kei/...) whose work this Akuma does, shown in status and kanshi; does not set workdir or supply its terms."),
77
91
  workdir: optText.describe("Execution directory for the Akuma (relative paths resolve from cwd; defaults to cwd)."),
78
92
  alias: optText.describe("World-local alias (with or without leading @) assigned to this Akuma, reassigning any previous holder."),
79
- bare: optBool.describe("Omit Keiyaku runtime instructions for this Akuma's lifetime (required for generic ACP providers)."),
93
+ bare: optBool.describe("Omit Keiyaku-specific instructions for this Akuma's lifetime."),
80
94
  };
81
95
  const tellFields = {
82
96
  akuma: text.describe("Target Akuma selector (aku/<name>/<hex> or @alias)."),
83
97
  prompt: nonblank.describe("Nonblank text instruction to admit."),
84
- interrupt: optBool.describe("Request the currently running turn to yield before waking a successor turn for this prompt."),
98
+ interrupt: optBool.describe("Interrupt current work before running this prompt."),
85
99
  };
86
100
  export const verbs = Object.freeze({
87
101
  bind: {
88
- description: "Bind a Contract: one tracked delivery with fixed terms. Complete Markdown terms in (or forkOf to copy another's); a kei/... id and its own worktree out. target is where the work lands once accepted; gates is what must pass first. Runs no checks.",
102
+ description: "Bind a Contract: give exactly one of terms (complete Contract Markdown) or forkOf (copy another Contract). Returns a kei/... id and its own worktree. target is where accepted work lands; gates is what must pass first. Runs no checks.",
89
103
  input: z.union([
90
104
  z
91
105
  .strictObject({
92
- markdown: text.describe("Complete Contract Markdown document (# Title, ## Context, ## Objective, ## Design, ## Region, ## Criteria, optional ## Verification). Mutually exclusive with forkOf."),
106
+ terms: text.describe("Complete Contract Markdown document (# Title, ## Context, ## Objective, ## Design, ## Region, ## Criteria, optional ## Verification). Mutually exclusive with forkOf."),
93
107
  debt: debtIdSchema
94
108
  .exactOptional()
95
109
  .describe("Open Debt ID (debt/<slug>-<hex>) to associate as this Contract's held Debt."),
@@ -104,7 +118,7 @@ export const verbs = Object.freeze({
104
118
  .readonly(),
105
119
  z
106
120
  .strictObject({
107
- forkOf: text.describe("Existing Contract selector (kei/...) whose terms are copied into a new Contract. Mutually exclusive with markdown, debt, after, and gates."),
121
+ forkOf: text.describe("Existing Contract selector (kei/...) whose terms are copied into a new Contract. Mutually exclusive with terms, debt, after, and gates."),
108
122
  ...commonBind,
109
123
  })
110
124
  .readonly(),
@@ -114,23 +128,25 @@ export const verbs = Object.freeze({
114
128
  effect: "write",
115
129
  },
116
130
  amend: {
117
- description: "Rewrite an active Contract's terms, prerequisites (after), or gates. markdown is H2 edits such as ## Replace: Objective, not a new Contract. Returns only what changed.",
118
- input: z.union(amendInputSchemas.map((branch) => branch.extend({
119
- markdown: branch.shape.markdown.describe("Replacement Contract Markdown document or section-level amendment."),
120
- after: branch.shape.after.describe("Replacement prerequisite Contract IDs (kei/...); pass [] to clear prerequisites."),
121
- gates: branch.shape.gates.describe("Replacement acceptance gate names; pass [] to clear all gates."),
131
+ description: "Edit an active Contract's terms, target, prerequisites (after), or gates; naming none reports the Contract unchanged. Supply edits as section operations such as ## Replace: Objective, not a replacement Contract. Returns only what changed.",
132
+ input: amendInputSchema
133
+ .extend({
134
+ edits: amendInputSchema.shape.edits.describe("Section edits to the current terms, using H2 headings such as ## Replace: Objective; not a replacement Contract."),
135
+ after: amendInputSchema.shape.after.describe("Replacement prerequisite Contract IDs (kei/...); pass [] to clear prerequisites."),
136
+ gates: amendInputSchema.shape.gates.describe("Replacement acceptance gate names; pass [] to clear all gates."),
137
+ target: amendInputSchema.shape.target.describe("Explicit existing branch or active Contract destination; omission retains the current target."),
122
138
  })
123
139
  .extend(contract)
124
- .readonly())),
140
+ .readonly(),
125
141
  output: amendOutcomeSchema,
126
142
  effect: "write",
127
143
  },
128
144
  arc: {
129
- description: "Open the next chapter of an active Contract: a # Title and optional notes telling its Akumas what is being done now. The terms stay as bound.",
145
+ description: "Open the next chapter of an active Contract: give a # Title and optional narrative telling its Akumas what is being done now. Returns the new chapter number; the Contract terms stay unchanged.",
130
146
  input: z
131
147
  .strictObject({
132
148
  ...contract,
133
- markdown: text.describe("Arc Markdown body naming and scoping the current chapter."),
149
+ body: text.describe("Chapter Markdown: a # Title and optional narrative describing the current work."),
134
150
  })
135
151
  .readonly(),
136
152
  output: arcOutcomeSchema,
@@ -144,8 +160,8 @@ export const verbs = Object.freeze({
144
160
  ...contract,
145
161
  dryRun: z
146
162
  .literal(true)
147
- .describe("When true, read-only preview of candidate integration, standing gate evidence, and target followability without recording delivery or mutating refs."),
148
- includeDirty: optBool.describe("Capture uncommitted worktree and untracked changes via a private index without altering the worktree's real Git index."),
163
+ .describe("Preview the candidate, current gate evidence, and target readiness without submitting delivery."),
164
+ includeDirty: optBool.describe("Include uncommitted and untracked worktree changes in the candidate without staging them."),
149
165
  showDiff: optBool.describe("Include the candidate patch diff in dryRun preview output (valid only with dryRun: true)."),
150
166
  })
151
167
  .readonly(),
@@ -155,9 +171,9 @@ export const verbs = Object.freeze({
155
171
  dryRun: z
156
172
  .literal(false)
157
173
  .exactOptional()
158
- .describe("When true, read-only preview of candidate integration, standing gate evidence, and target followability without recording delivery or mutating refs."),
174
+ .describe("Preview the candidate, current gate evidence, and target readiness without submitting delivery."),
159
175
  message: optText.describe("Optional commit/integration message for the delivered candidate (submission only)."),
160
- includeDirty: optBool.describe("Capture uncommitted worktree and untracked changes via a private index without altering the worktree's real Git index."),
176
+ includeDirty: optBool.describe("Include uncommitted and untracked worktree changes in the candidate without staging them."),
161
177
  materializeConflict: optBool.describe("When target integration conflicts, materialize conflict markers into the appointed worktree for resolution instead of refusing cleanly (submission only)."),
162
178
  overwrite: optBool.describe("Allow replacing an earlier delivered candidate when required by conflict or rewrite state (submission only)."),
163
179
  })
@@ -210,23 +226,22 @@ export const verbs = Object.freeze({
210
226
  effect: "destroy",
211
227
  },
212
228
  show: {
213
- description: "Read a Contract in full: terms, current chapter, and working instructions. Or read one Debt in full with its prerequisites. Omit id to read the Contract whose worktree you stand in.",
229
+ description: "Read a Contract in full: terms, current chapter, and working instructions. Or read one Debt in full with its prerequisites. Requires one explicit selector.",
214
230
  input: z
215
231
  .strictObject({
216
- id: text
217
- .superRefine((id, context) => {
218
- if (debtIdSchema.safeParse(id).success ||
219
- contractIdSchema.safeParse(id.startsWith("@") ? `kei/${id.slice(1)}` : id).success)
232
+ selector: text
233
+ .superRefine((selector, context) => {
234
+ if (debtIdSchema.safeParse(selector).success ||
235
+ contractIdSchema.safeParse(selector.startsWith("@") ? `kei/${selector.slice(1)}` : selector).success)
220
236
  return;
221
237
  context.addIssue({
222
238
  code: "custom",
223
- message: id.startsWith("@kei/")
224
- ? `redundant short contract selector: ${id}`
239
+ message: selector.startsWith("@kei/")
240
+ ? `redundant short contract selector: ${selector}`
225
241
  : "show requires one Contract selector or one Debt ID",
226
242
  });
227
243
  })
228
- .exactOptional()
229
- .describe("One kei/... or @name for Contract guidance, or one debt/... ID. Omit for contextual Contract guidance from cwd."),
244
+ .describe("One explicit kei/... or @name for Contract guidance, or one debt/... ID."),
230
245
  })
231
246
  .readonly(),
232
247
  output: z.union([guidanceSchema, debtShowResultSchema, debtAbsentSchema]),
@@ -245,29 +260,24 @@ export const verbs = Object.freeze({
245
260
  effect: "write",
246
261
  },
247
262
  spawn: {
248
- description: "Birth a new Akuma from akumaName (ls aku/), with an optional first order. contract only marks whose work it is; give it a workdir and the terms yourself. A failed result with an akumaId still left an Akuma alive.",
263
+ description: "Birth a new Akuma from akumaName (ls aku/), with an optional first order. Returns birth and admission, not an answer; observe separately with wait. contract only marks whose work it is; give it a workdir and the terms yourself. A failed result with an akumaId still left an Akuma alive.",
249
264
  input: z
250
265
  .strictObject({
251
266
  ...spawnFields,
252
- wait: waitDuration
253
- .exactOptional()
254
- .describe("Wait for the opening turn's text answer up to this duration (e.g. 10m); requires prompt. The deadline never kills the Akuma. Omit to return after birth and admission."),
255
- prompt: nonblank.exactOptional().describe("Opening instruction text; omit to birth idle. Required with wait."),
267
+ prompt: nonblank.exactOptional().describe("Opening instruction text; omit to birth idle."),
256
268
  })
257
- .refine((input) => input.wait === undefined || input.prompt !== undefined, "spawn wait requires prompt")
258
269
  .readonly(),
259
270
  output: spawnResultSchema,
260
271
  normal: spawnNormalResultSchema,
261
- progress: spawnProgressSchema,
262
272
  effect: "write",
263
273
  },
264
274
  fork: {
265
- description: "Birth a copy of an Akuma as it stood at an answered turn (turn/<n> from history), to try another path. The copy wakes idle; give it orders with tell. Needs provider support.",
275
+ description: "Birth a copy of an Akuma as it stood at an answered turn (turn/<n> from history), to try another path. The copy wakes idle; give it orders with tell. Available only for Akumas that support forking.",
266
276
  input: z
267
277
  .strictObject({
268
278
  akuma: text.describe("Source Akuma selector (aku/<name>/<hex> or @alias)."),
269
279
  at: text.describe("Exact retained answered turn coordinate (turn/<n>) to branch from."),
270
- bare: optBool.describe("Omit Keiyaku runtime instructions on the forked child (a bare parent stays bare regardless)."),
280
+ bare: optBool.describe("Omit Keiyaku instructions on the forked child (a bare parent stays bare regardless)."),
271
281
  })
272
282
  .readonly(),
273
283
  output: forkResultSchema,
@@ -275,28 +285,26 @@ export const verbs = Object.freeze({
275
285
  effect: "write",
276
286
  },
277
287
  tell: {
278
- description: "Give an Akuma new orders: steers its current work or wakes it. Returns once accepted; wait (e.g. 10m) also returns that turn's answer. A timeout ends the waiting, not the work.",
288
+ description: "Give an Akuma new orders: steers its current work or wakes it. Returns admission, not an answer. Observe work separately with wait, or use ask for a structured answer.",
279
289
  input: z
280
290
  .strictObject({
281
291
  ...tellFields,
282
- wait: waitDuration
283
- .exactOptional()
284
- .describe("Wait for this exact turn's text answer up to this duration (e.g. 10m). Omit to return after admission; the deadline never retracts the Tell or kills the Akuma."),
285
292
  })
286
293
  .readonly(),
287
294
  output: akumaTellResultSchema,
288
- progress: askProgressSchema,
289
295
  effect: "write",
290
296
  },
291
297
  ask: {
292
- description: "Demand a structured answer from an Akuma: a prompt and a JSON Schema in, parsed JSON out. The answer is not checked against the schema; non-JSON is a failure. Not every provider honors schemas.",
298
+ description: "Demand a structured answer from an Akuma: a prompt and a JSON Schema in, parsed JSON out. The answer is not checked against the schema; non-JSON is a failure. Some Akumas cannot constrain answers to a schema.",
293
299
  input: z
294
300
  .strictObject({
295
301
  akuma: text.describe("Target Akuma selector (aku/<name>/<hex> or @alias)."),
296
302
  prompt: nonblank.describe("Nonblank question or instruction to admit."),
297
- timeoutMs: timeout.describe("Optional observation deadline in integer milliseconds (stops observation on deadline without retracting the prompt or killing the Akuma)."),
298
- schema: jsonDocument.describe("JSON Schema object sent to the provider to constrain the turn's JSON output."),
299
- interrupt: optBool.describe("Request the currently running turn to yield before running this Ask."),
303
+ timeout: duration
304
+ .exactOptional()
305
+ .describe("How long to watch for the answer (e.g. 30s or 5m); omit for no deadline. The deadline only stops watching, never the work."),
306
+ schema: jsonDocument.describe("JSON Schema object describing the JSON answer you want."),
307
+ interrupt: optBool.describe("Interrupt current work before answering this Ask."),
300
308
  })
301
309
  .readonly(),
302
310
  output: akumaAskResultSchema,
@@ -315,75 +323,63 @@ export const verbs = Object.freeze({
315
323
  effect: "destroy",
316
324
  },
317
325
  wait: {
318
- description: "Wait until selected Contracts change or close, or selected Akumas finish their current work. Contracts or Akumas, never both in one call. Already closed or finished returns at once. A timeout ends the waiting, not the work.",
319
- input: z.union([
320
- z
321
- .strictObject({
322
- selectors: z
323
- .array(contractSelector)
324
- .min(1)
325
- .readonly()
326
- .describe('Nonempty homogeneous selector list: either all Contract IDs (kei/...) or all Akuma selectors (aku/<name>/<hex>, @alias, or "aku/<name-pattern>/<hex-pattern>").'),
327
- completion: z
328
- .enum(["any", "all"])
329
- .exactOptional()
330
- .describe('Wake when "any" selected target settles/changes (default) or wait for "all".'),
331
- timeoutMs: contractWaitDurationSchema
332
- .exactOptional()
333
- .describe('Observation deadline in integer milliseconds; returns reason "deadline" without canceling work.'),
334
- })
335
- .readonly(),
336
- z
337
- .strictObject({
338
- selectors: z
339
- .array(akumaSelector)
340
- .min(1)
341
- .readonly()
342
- .describe('Nonempty homogeneous selector list: either all Contract IDs (kei/...) or all Akuma selectors (aku/<name>/<hex>, @alias, or "aku/<name-pattern>/<hex-pattern>").'),
343
- completion: z
344
- .enum(["any", "all"])
345
- .exactOptional()
346
- .describe('Wake when "any" selected target settles/changes (default) or wait for "all".'),
347
- timeoutMs: timeout.describe('Observation deadline in integer milliseconds; returns reason "deadline" without canceling work.'),
348
- })
349
- .readonly(),
350
- ]),
351
- output: z.union([contractWaitResultSchema, akumaWaitResultSchema]),
352
- normal: z.union([contractWaitNormalResultSchema, akumaWaitNormalResultSchema]),
326
+ description: "Wait for Contracts to change or close and Akumas to finish their current work, together or separately. Any/all applies to the whole selection. Already satisfied members count immediately. A timeout ends observation, never the work.",
327
+ input: z
328
+ .strictObject({
329
+ selectors: z
330
+ .array(z.union([
331
+ contractIdSchema,
332
+ text.refine((value) => {
333
+ try {
334
+ if (value.startsWith("@"))
335
+ parseReadableAkumaAlias(value);
336
+ else if (value.includes("*"))
337
+ parseAkumaGlob(value);
338
+ else
339
+ return akumaIdSchema.safeParse(value).success;
340
+ return true;
341
+ }
342
+ catch {
343
+ return false;
344
+ }
345
+ }, "Expected an Akuma ID, alias or glob"),
346
+ ]))
347
+ .min(1)
348
+ .readonly()
349
+ .describe('Contract IDs (kei/...) and Akuma selectors (aku/<name>/<hex>, @alias, or "aku/<name-pattern>/<hex-pattern>"), in caller order. A Contract selects its journal, not dispatched Akumas.'),
350
+ completion: z
351
+ .enum(["any", "all"])
352
+ .exactOptional()
353
+ .describe('Wake when "any" member satisfies (default), or wait for "all" members.'),
354
+ timeout: duration
355
+ .exactOptional()
356
+ .describe("How long to watch (e.g. 30s or 5m); omit for no deadline. The deadline only stops watching, never the work. 0ms returns the current state at once."),
357
+ })
358
+ .readonly(),
359
+ output: invocationWaitResultSchema,
360
+ normal: invocationWaitNormalResultSchema,
353
361
  effect: "read",
354
362
  },
355
363
  history: {
356
- description: "Look back: a Contract's journal, or an Akuma's recent activity. For an Akuma, last returns its latest answer and id opens one item such as turn/<n> or report/<n>.",
364
+ description: "Read a bounded Contract or Akuma timeline, or open one complete item by its visible address.",
357
365
  input: z.union([
358
366
  z
359
367
  .strictObject({
360
- selector: contractSelector.describe("Single subject: kei/... for Contract history, or aku/<name>/<hex> / @alias for Akuma history."),
361
- full: optBool.describe("Include full event details on Contract history (valid only for kei/... selectors)."),
368
+ selector: contractSelector.describe(historySelectorDescription),
369
+ item: canonicalDecimalSchema.describe(historyItemDescription),
362
370
  })
363
371
  .readonly(),
364
- ...historySelectionSchemas.map((branch) => branch.extend({
365
- last: branch.shape.last.describe("When true, return only the Akuma's latest retained answer bytes (mutually exclusive with id, before, since, and limit)."),
366
- ...("id" in branch.shape
367
- ? {
368
- id: branch.shape.id.describe("Exact Akuma item coordinate: turn/<n> (turn outcome), report/<n> (full progress report), or positive decimal activity sequence. Mutually exclusive with before, since, limit, and last."),
369
- }
370
- : {}),
371
- ...("before" in branch.shape
372
- ? {
373
- before: branch.shape.before.describe("Page older Akuma timeline events strictly before this positive decimal sequence."),
374
- }
375
- : {}),
376
- ...("since" in branch.shape
377
- ? {
378
- since: branch.shape.since.describe("Page newer Akuma timeline events strictly after this nonnegative decimal sequence (mutually exclusive with before)."),
379
- }
380
- : {}),
381
- ...("limit" in branch.shape
382
- ? { limit: branch.shape.limit.describe("Maximum Akuma timeline rows to return (1..5000, default 12).") }
383
- : {}),
372
+ z
373
+ .strictObject({
374
+ selector: akumaSelector.describe(historySelectorDescription),
375
+ item: text
376
+ .refine((value) => value === "answer" || historyInputSchemas[0].shape.id.safeParse(value).success, "item must be answer, turn/<positive safe integer>, report/<positive safe integer>, or a canonical positive safe decimal sequence")
377
+ .describe(historyItemDescription),
384
378
  })
379
+ .readonly(),
380
+ ...historyPageSchemas.map((branch) => branch
385
381
  .extend({
386
- selector: akumaSelector.describe("Single subject: kei/... for Contract history, or aku/<name>/<hex> / @alias for Akuma history."),
382
+ selector: text.describe(historySelectorDescription),
387
383
  })
388
384
  .readonly()),
389
385
  ]),
@@ -391,17 +387,17 @@ export const verbs = Object.freeze({
391
387
  effect: "read",
392
388
  },
393
389
  report: {
394
- description: "From inside a running Akuma, leave a progress note for whoever holds it and keep working. Only works when this server runs inside that Akuma.",
390
+ description: "From inside a running Akuma only, leave a progress note for whoever holds you and keep working. Returns confirmation that the note was recorded, not that it was received.",
395
391
  input: z
396
392
  .strictObject({
397
- text: nonblank.describe("Nonblank progress report Markdown/text recorded on the current turn timeline."),
393
+ text: nonblank.describe("Nonblank progress note, in Markdown or plain text, to add to your current turn."),
398
394
  })
399
395
  .readonly(),
400
396
  output: akumaReportResultSchema,
401
397
  effect: "write",
402
398
  },
403
399
  whoami: {
404
- description: "Who this server acts as: caller or Akuma identity, its Contract link and turn initiator, and which Contract worktree cwd stands in. Read from the environment; not authentication.",
400
+ description: "See who you are acting as and which Contract/worktree you are in, including your Akuma identity and turn initiator when available. This is context, not authentication.",
405
401
  input: z.strictObject({}).readonly(),
406
402
  output: whoamiFactsSchema,
407
403
  effect: "read",
@@ -425,12 +421,13 @@ export const verbs = Object.freeze({
425
421
  effect: "read",
426
422
  },
427
423
  status: {
428
- description: "Where one Contract stands (stage, gates, prerequisites, worktree) or what one Akuma is doing (state, current work, changed files). Exact kei/... or aku/<name>/<id> only; no aliases.",
424
+ description: "Where one Contract stands (stage, gates, prerequisites, worktree) or what one Akuma is doing (state, current work, changed files). Select one complete identity or @name; returns its canonical id.",
429
425
  input: z
430
426
  .strictObject({
431
- id: z
432
- .union([contractIdSchema, akumaIdSchema])
433
- .describe("Exact Contract ID (kei/...) or Akuma ID (aku/<name>/<hex>); @aliases and category paths are refused."),
427
+ selector: z
428
+ .union([contractIdSchema, akumaIdSchema, akumaAliasSchema])
429
+ .refine((value) => !/[*?\[\]]/u.test(value), "status does not accept globs")
430
+ .describe("One complete Contract ID (kei/...), Akuma ID (aku/<name>/<hex>), or @name (Contract shorthand or World-local Akuma alias). Ambiguous names, globs and categories are refused."),
434
431
  })
435
432
  .readonly(),
436
433
  output: z.union([contractStatusSchema, akumaObservationSchema]),
@@ -438,7 +435,7 @@ export const verbs = Object.freeze({
438
435
  effect: "read",
439
436
  },
440
437
  ls: {
441
- description: "List ids of one kind: active Contracts (kei/), open Debts (debt/), akumaName values you can birth (aku/), or existing Akumas (aku/*).",
438
+ description: "List ids of one kind: Contracts (kei/), Debts (debt/), Akuma instances (aku/*), or akumaName values you can birth (aku/). Lifecycle selection is active (default), settled, or all; akumaName values have no lifecycle selection.",
442
439
  input: lsInputSchema,
443
440
  output: z.union([contractCatalogueSchema, akumaCatalogueSchema, akumaNameCatalogSchema, debtCatalogueSchema]),
444
441
  normal: z.union([contractCatalogueSchema, akumaCatalogueSchema, akumaNameCatalogSchema, debtListSchema]),
@@ -446,23 +443,19 @@ export const verbs = Object.freeze({
446
443
  },
447
444
  region: {
448
445
  description: "Before parallel work: which files active Contracts claim to change and where those claims overlap. Advisory only; no locks, no conflict prediction.",
449
- input: z.union([
450
- z.strictObject({}).readonly(),
451
- z
452
- .strictObject({
453
- contract: text.describe("Contract selector (kei/...) whose declared Region and overlaps to inspect; mutually exclusive with paths."),
454
- })
455
- .readonly(),
456
- z
457
- .strictObject({
458
- paths: z
459
- .array(text)
460
- .min(1)
461
- .readonly()
462
- .describe("Nonempty repository-relative path or glob patterns to check against active Contract Regions; mutually exclusive with contract."),
463
- })
464
- .readonly(),
465
- ]),
446
+ input: z
447
+ .strictObject({
448
+ contract: optText.describe("Contract selector (kei/...) whose declared Region and overlaps to inspect; mutually exclusive with paths."),
449
+ paths: z
450
+ .array(text)
451
+ .min(1)
452
+ .readonly()
453
+ .refine((paths) => paths.length > 0)
454
+ .exactOptional()
455
+ .describe("Nonempty repository-relative path or glob patterns to check against active Contract Regions; mutually exclusive with contract."),
456
+ })
457
+ .refine((input) => !(input.contract !== undefined && input.paths !== undefined), "contract and paths are mutually exclusive")
458
+ .readonly(),
466
459
  output: regionResultSchema,
467
460
  effect: "read",
468
461
  },
@@ -480,7 +473,7 @@ export const verbs = Object.freeze({
480
473
  effect: "write",
481
474
  },
482
475
  "debt.update": {
483
- description: "Replace a Debt's text, priority or prerequisites, or set its disposition to open, done or drop. Any state may be reopened or changed; omitted fields are preserved and empty body, note or needs clears them.",
476
+ description: "Change at least one Debt field: text, priority, prerequisites, or disposition (open, done, drop). Any state may be reopened or changed; omitted fields are preserved and empty body, note or needs clears them. Returns the updated Debt or reports no change.",
484
477
  input: updateDebtInputSchema
485
478
  .safeExtend({ id: debtIdSchema.describe("Target Debt ID (debt/<slug>-<hex>).") })
486
479
  .readonly(),