@astrosheep/keiyaku 2.9.4 → 2.9.5

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 (126) hide show
  1. package/build/.tsbuildinfo +1 -1
  2. package/build/agents/call-terms.js +1 -0
  3. package/build/agents/harness/execution-handle.js +1 -0
  4. package/build/agents/harness/outcome.js +21 -1
  5. package/build/agents/harness/projection.js +147 -75
  6. package/build/agents/providers/codex-app-server/adapter.js +32 -0
  7. package/build/agents/providers/codex-app-server/events.js +23 -0
  8. package/build/agents/providers/pi/events.js +4 -3
  9. package/build/agents/types.js +2 -0
  10. package/build/cli/commands/akuma/akuma/meta.js +1 -1
  11. package/build/cli/commands/akuma/list/meta-ls.js +1 -1
  12. package/build/cli/commands/akuma/view/meta.js +1 -1
  13. package/build/cli/commands/contract/amend/meta.js +4 -4
  14. package/build/cli/commands/contract/arc/handler.js +1 -1
  15. package/build/cli/commands/contract/arc/meta.js +4 -4
  16. package/build/cli/commands/contract/audit/handler.js +16 -0
  17. package/build/cli/commands/contract/audit/meta.js +16 -0
  18. package/build/cli/commands/contract/bind/meta.js +20 -11
  19. package/build/cli/commands/contract/catalog.js +2 -0
  20. package/build/cli/commands/contract/forfeit/meta.js +1 -1
  21. package/build/cli/commands/contract/log/meta.js +1 -1
  22. package/build/cli/commands/contract/petition/handler.js +1 -2
  23. package/build/cli/commands/contract/petition/meta.js +6 -6
  24. package/build/cli/commands/contract/renew/handler.js +2 -2
  25. package/build/cli/commands/contract/renew/meta.js +4 -4
  26. package/build/cli/commands/metadata.js +3 -2
  27. package/build/cli/commands/projection/call/meta.js +4 -1
  28. package/build/cli/commands/projection/kill/meta.js +1 -1
  29. package/build/cli/commands/projection/revive/meta.js +4 -1
  30. package/build/cli/commands/projection/status/meta.js +1 -1
  31. package/build/cli/commands/projection/tell/handler.js +1 -1
  32. package/build/cli/commands/projection/tell/meta.js +4 -1
  33. package/build/cli/commands/projection/wait/meta.js +1 -1
  34. package/build/cli/commands/skills/install/meta.js +1 -1
  35. package/build/cli/commands/skills/skills/meta.js +1 -1
  36. package/build/cli/commands/system/completion/meta.js +1 -1
  37. package/build/cli/commands/system/dump-env/meta.js +1 -1
  38. package/build/cli/commands/system/guide/meta.js +1 -1
  39. package/build/cli/commands/task/add/handler.js +2 -2
  40. package/build/cli/commands/task/add/meta.js +4 -1
  41. package/build/cli/commands/task/doctor/meta.js +1 -1
  42. package/build/cli/commands/task/done/meta.js +1 -1
  43. package/build/cli/commands/task/drop/meta.js +1 -1
  44. package/build/cli/commands/task/ls/handler.js +10 -4
  45. package/build/cli/commands/task/ls/meta.js +3 -3
  46. package/build/cli/commands/task/show/meta.js +1 -1
  47. package/build/cli/commands/task/start/meta.js +1 -1
  48. package/build/cli/commands/task/stop/meta.js +1 -1
  49. package/build/cli/commands/task/task/meta.js +1 -1
  50. package/build/cli/commands/task/update/handler.js +2 -3
  51. package/build/cli/commands/task/update/meta.js +4 -1
  52. package/build/cli/flags.js +18 -3
  53. package/build/cli/help.js +3 -3
  54. package/build/cli/index.js +59 -75
  55. package/build/cli/output-stream-error-policy.js +19 -5
  56. package/build/cli/parse-flags.js +19 -2
  57. package/build/cli/parse-metadata.js +1 -7
  58. package/build/cli/parse-selectors.js +1 -0
  59. package/build/cli/parse.js +16 -7
  60. package/build/cli/projection-address.js +6 -1
  61. package/build/cli/render/audit.js +121 -0
  62. package/build/cli/render/misc.js +3 -1
  63. package/build/cli/render/projection-activity.js +12 -6
  64. package/build/cli/render/status.js +28 -18
  65. package/build/cli/render/success-response.js +6 -5
  66. package/build/cli/render/task.js +12 -43
  67. package/build/cli/render/terminal-failure.js +7 -2
  68. package/build/cli/render/wait.js +36 -8
  69. package/build/config/env-keys.js +2 -0
  70. package/build/config/env.js +3 -0
  71. package/build/core/amend.js +20 -94
  72. package/build/core/arc.js +14 -6
  73. package/build/core/audit.js +650 -0
  74. package/build/core/bind.js +1 -1
  75. package/build/core/call/execution.js +1 -0
  76. package/build/core/contract-view.js +2 -3
  77. package/build/core/draft.js +33 -20
  78. package/build/core/entry.js +3 -4
  79. package/build/core/markdown/lex.js +2 -1
  80. package/build/core/projection/generation/database.js +41 -16
  81. package/build/core/projection/generation/model.js +22 -2
  82. package/build/core/projection/generation/projection-generation-execution.js +20 -7
  83. package/build/core/projection/generation/projection-generation-launcher.js +4 -4
  84. package/build/core/projection/generation/projection-generation-runner.js +1 -0
  85. package/build/core/projection/generation/store.js +1 -1
  86. package/build/core/projection/generation/transitions.js +19 -3
  87. package/build/core/projection/index.js +2 -2
  88. package/build/core/projection/projection-execution-observer.js +35 -21
  89. package/build/core/projection/projection-life-observer.js +16 -2
  90. package/build/core/projection/projection-status.js +67 -22
  91. package/build/core/projection/projection-terminal-failure.js +2 -0
  92. package/build/core/projection/projection-wait.js +6 -9
  93. package/build/core/projection/projection-wake.js +30 -6
  94. package/build/core/renew.js +41 -22
  95. package/build/core/scope.js +129 -2
  96. package/build/core/seal.js +36 -15
  97. package/build/core/settlement/petition-claim-gates.js +4 -33
  98. package/build/core/settlement/petition-preview.js +1 -1
  99. package/build/core/settlement/petition.js +10 -3
  100. package/build/core/settlement/settlement.js +3 -10
  101. package/build/core/settlement/verification.js +59 -0
  102. package/build/core/status/board.js +48 -28
  103. package/build/core/stored-agent-event.js +3 -2
  104. package/build/core/task/board.js +1 -0
  105. package/build/core/task/commands.js +20 -12
  106. package/build/core/task/document.js +5 -0
  107. package/build/core/task/index.js +1 -1
  108. package/build/core/task/model.js +8 -1
  109. package/build/core/task/query.js +172 -0
  110. package/build/core/task/settlement-git.js +115 -16
  111. package/build/core/task/settlement-policy.js +17 -9
  112. package/build/core/task/source-board.js +1 -0
  113. package/build/core/task/task-contract.js +125 -51
  114. package/build/core/task/task-store-repository.js +1 -0
  115. package/build/core/task/task.js +2 -0
  116. package/build/flow-error.js +2 -4
  117. package/build/generated/version.js +2 -2
  118. package/build/git/diff/parsers.js +23 -13
  119. package/build/git/diff/structured.js +127 -0
  120. package/build/index.js +7 -7
  121. package/build/telemetry/logger.js +4 -2
  122. package/package.json +1 -1
  123. package/skills/keiyaku/SKILL.md +2 -2
  124. package/skills/keiyaku-akuma/SKILL.md +17 -6
  125. package/skills/keiyaku-task/SKILL.md +16 -7
  126. package/skills/keiyaku-workflow/SKILL.md +42 -13
@@ -5,7 +5,7 @@ export const meta = {
5
5
  "keiyaku forfeit [-C|--cwd DIR] [--repo DIR] [--contract ADDR] [--reason TEXT]",
6
6
  "keiyaku @addr forfeit [-C|--cwd DIR] [--repo DIR] [--reason TEXT]",
7
7
  ],
8
- stdin: "none",
8
+ stdin: { mode: "argument" },
9
9
  flags: ["cwd", "repo", "contract", "reason"],
10
10
  purpose: "Record an abandoned contract without sealing it.",
11
11
  completionRank: 11,
@@ -5,7 +5,7 @@ export const meta = {
5
5
  "keiyaku log [-C|--cwd DIR] [--repo DIR] [--contract ADDR]",
6
6
  "keiyaku @addr log [-C|--cwd DIR] [--repo DIR]",
7
7
  ],
8
- stdin: "none",
8
+ stdin: { mode: "argument" },
9
9
  flags: ["cwd", "repo", "contract"],
10
10
  purpose: "Read a contract ledger.",
11
11
  completionRank: 5,
@@ -10,13 +10,12 @@ export const handler = async (stdin, flags, signal) => {
10
10
  const cwd = await repositoryDirectory(flags, "petition");
11
11
  const address = await resolveExistingContractAddress(cwd, flags.contractId, flags.contractAddressSource, effectiveDirectory(flags));
12
12
  return await withResolvedAddress(address, async () => {
13
- const input = buildPetitionClaimInput({ cwd, contractId: address.binding.commissionId, stdin, signal, waivePaths: flags.waivePaths });
13
+ const input = buildPetitionClaimInput({ cwd, contractId: address.binding.commissionId, stdin, signal, appendScope: flags.appendScope });
14
14
  if (flags.dryRun) {
15
15
  return buildPetitionPreviewResponse(await previewPetition({
16
16
  cwd,
17
17
  contractId: address.binding.commissionId,
18
18
  oath: input.oath,
19
- waivePaths: flags.waivePaths,
20
19
  }), flags.json === true);
21
20
  }
22
21
  return buildPetitionClaimResponse({ ...await petitionKeiyaku(input), address }, input);
@@ -2,19 +2,19 @@ export const meta = {
2
2
  command: "petition",
3
3
  summary: "Run or preview the gated settlement pipeline",
4
4
  usage: [
5
- "keiyaku petition [-C|--cwd DIR] [--repo DIR] [--contract ADDR] [--waive PATH] [< petition.md]",
6
- "keiyaku @<id> petition [-C|--cwd DIR] [--repo DIR] [--waive PATH] [< petition.md]",
7
- "keiyaku @<id> petition --dry-run [--json] [< petition.md]",
5
+ "keiyaku petition [-C|--cwd DIR] [--repo DIR] [--contract ADDR] [--append-scope PATTERN] [- < petition.md]",
6
+ "keiyaku @<id> petition [-C|--cwd DIR] [--repo DIR] [--append-scope PATTERN] [- < petition.md]",
7
+ "keiyaku @<id> petition --dry-run [--json] [- < petition.md]",
8
8
  ],
9
- stdin: "optional",
10
- flags: ["cwd", "repo", "contract", "waive", "dry-run", "json"],
9
+ stdin: { mode: "document", selector: { kind: "positional", index: 0, required: false, rejectBlank: false } },
10
+ flags: ["cwd", "repo", "contract", "append-scope", "dry-run", "json"],
11
11
  purpose: "Seal the current a0 or open explicit arc, queue the contract, and run verdict and claim processing; dry-run previews deterministic gates without mutation.",
12
12
  input: [
13
13
  "## Oath",
14
14
  "<free first-person attestation>",
15
15
  ],
16
16
  notes: [
17
- "Petition stdin is optional at the command mouth; a missing, empty, or blank oath is rejected by the settlement gate with OATH_MISSING.",
17
+ "Petition stdin is optional and read only when literal - is supplied; a missing, empty, or blank oath is rejected by the settlement gate with OATH_MISSING.",
18
18
  "The machine checks only that the oath is present. Accepted oath text is persisted in the petition entry and hidden from the reviewer.",
19
19
  "Base drift requires explicit `keiyaku renew` before petition.",
20
20
  "Dry-run never runs verification or review and exits 0, 1, or 2.",
@@ -10,7 +10,7 @@ export const handler = async (_stdin, flags) => {
10
10
  : resolveExistingContractAddress;
11
11
  const address = await resolveAddress(cwd, flags.contractId, flags.contractAddressSource, effectiveDirectory(flags));
12
12
  if (flags.renewContinue) {
13
- return renderCoreResult(continueRenewKeiyaku({ cwd, address, waivePaths: flags.waivePaths }), buildRenewResponse);
13
+ return renderCoreResult(continueRenewKeiyaku({ cwd, address, appendScope: flags.appendScope }), buildRenewResponse);
14
14
  }
15
15
  if (flags.renewAbort) {
16
16
  return renderCoreResult(abortRenewKeiyaku({ cwd, address }), buildRenewAbortResponse);
@@ -18,7 +18,7 @@ export const handler = async (_stdin, flags) => {
18
18
  return renderCoreResult(renewKeiyaku({
19
19
  cwd,
20
20
  address,
21
- waivePaths: flags.waivePaths,
21
+ appendScope: flags.appendScope,
22
22
  resolveConflicts: flags.renewResolve,
23
23
  }), buildRenewResponse);
24
24
  };
@@ -2,12 +2,12 @@ export const meta = {
2
2
  command: "renew",
3
3
  summary: "Rewrite delivery onto the current base",
4
4
  usage: [
5
- "keiyaku renew [-C|--cwd DIR] [--repo DIR] [--contract ADDR] [--waive PATH] [--resolve]",
6
- "keiyaku @<id> renew --continue [--waive PATH]",
5
+ "keiyaku renew [-C|--cwd DIR] [--repo DIR] [--contract ADDR] [--append-scope PATTERN] [--resolve]",
6
+ "keiyaku @<id> renew --continue [--append-scope PATTERN]",
7
7
  "keiyaku @<id> renew --abort",
8
8
  ],
9
- stdin: "none",
10
- flags: ["cwd", "repo", "contract", "waive", "resolve", "continue", "abort"],
9
+ stdin: { mode: "argument" },
10
+ flags: ["cwd", "repo", "contract", "append-scope", "resolve", "continue", "abort"],
11
11
  purpose: "Capture receipts, rewrite delivery onto the default branch, then seal the current a0 or open explicit arc and record the renewal.",
12
12
  notes: [
13
13
  "After an explicit arc closes, refuses loose commits until another arc is open.",
@@ -12,6 +12,7 @@ import { meta as akumaViewMeta } from "./akuma/view/meta.js";
12
12
  import { meta as skillsMeta } from "./skills/skills/meta.js";
13
13
  import { meta as skillsInstallMeta } from "./skills/install/meta.js";
14
14
  import { meta as amendMeta } from "./contract/amend/meta.js";
15
+ import { meta as auditMeta } from "./contract/audit/meta.js";
15
16
  import { meta as renewMeta } from "./contract/renew/meta.js";
16
17
  import { meta as petitionMeta } from "./contract/petition/meta.js";
17
18
  import { meta as forfeitMeta } from "./contract/forfeit/meta.js";
@@ -31,14 +32,14 @@ import { meta as taskDoctorMeta } from "./task/doctor/meta.js";
31
32
  import { meta as dumpEnvMeta } from "./system/dump-env/meta.js";
32
33
  export const COMMAND_METADATA_ORDER = [
33
34
  "bind", "arc", "call", "revive", "wait", "tell", "kill", "log",
34
- "akuma", "akuma ls", "akuma view", "skills", "skills install", "amend",
35
+ "akuma", "akuma ls", "akuma view", "skills", "skills install", "amend", "audit",
35
36
  "renew", "petition", "forfeit", "guide", "completion", "status", "task",
36
37
  "task add", "task show", "task ls", "task start", "task stop", "task done",
37
38
  "task drop", "task update", "task doctor", "dump-env",
38
39
  ];
39
40
  const COMMAND_METADATA = [
40
41
  bindMeta, arcMeta, callMeta, reviveMeta, waitMeta, tellMeta, killMeta, logMeta,
41
- akumaMeta, akumaLsMeta, akumaViewMeta, skillsMeta, skillsInstallMeta, amendMeta,
42
+ akumaMeta, akumaLsMeta, akumaViewMeta, skillsMeta, skillsInstallMeta, amendMeta, auditMeta,
42
43
  renewMeta, petitionMeta, forfeitMeta, guideMeta, completionMeta, statusMeta,
43
44
  taskMeta, taskAddMeta, taskShowMeta, taskLsMeta, taskStartMeta, taskStopMeta,
44
45
  taskDoneMeta, taskDropMeta, taskUpdateMeta, taskDoctorMeta, dumpEnvMeta,
@@ -2,7 +2,10 @@ export const meta = {
2
2
  command: "call",
3
3
  summary: "Start an Akuma helper session",
4
4
  usage: ["keiyaku call NAME [--wait DURATION] <BODY|->"],
5
- stdin: "none",
5
+ stdin: {
6
+ mode: "argument",
7
+ selector: { kind: "positional", index: 0, required: true, rejectBlank: true },
8
+ },
6
9
  flags: ["cwd", "repo", "contract", "akuma", "model", "effort", "incognito", "bare", "detach", "alias", "wait"],
7
10
  purpose: "Run a scoped helper task.",
8
11
  completionRank: 2,
@@ -5,7 +5,7 @@ export const meta = {
5
5
  "keiyaku kill <projection-address> [--wait DURATION]",
6
6
  "keiyaku @addr kill <projection-address> [--wait DURATION]",
7
7
  ],
8
- stdin: "none",
8
+ stdin: { mode: "argument" },
9
9
  flags: ["cwd", "repo", "contract", "wait"],
10
10
  purpose: "Terminate the current generation while keeping the projection identity and tell ledger.",
11
11
  };
@@ -2,7 +2,10 @@ export const meta = {
2
2
  command: "revive",
3
3
  summary: "Revive an Akuma helper session",
4
4
  usage: ["keiyaku revive ARTIFACT [BODY|-]"],
5
- stdin: "none",
5
+ stdin: {
6
+ mode: "argument",
7
+ selector: { kind: "positional", index: 1, required: false, rejectBlank: true },
8
+ },
6
9
  flags: ["cwd", "repo", "model", "effort"],
7
10
  purpose: "Continue a persisted helper session.",
8
11
  completionRank: 4,
@@ -2,7 +2,7 @@ export const meta = {
2
2
  command: "status",
3
3
  summary: "Show the Kanshi board",
4
4
  usage: ["keiyaku status [PROJECTION] [-C|--cwd DIR] [--repo DIR] [--target REF] [--all]"],
5
- stdin: "none",
5
+ stdin: { mode: "argument" },
6
6
  flags: ["cwd", "repo", "target", "all"],
7
7
  purpose: "Read the Kanshi board or filter it to one projection without mutation.",
8
8
  completionRank: 14,
@@ -11,7 +11,7 @@ export const handler = async (body, flags, signal, positional) => runProjectionC
11
11
  throw new FlowError("EMPTY_PARAM", "tell requires a projection address and message");
12
12
  const projection = await resolveProjectionCommandTarget(ctx, projectionAddress, "tell");
13
13
  assertTellEffortSupported(projection.directory, flags.effort);
14
- // Mailbox first: do not inspect phase before this immutable write.
14
+ // Address admission and any effort validation precede the durable mailbox write.
15
15
  writeInboxTell(projection.directory, body, Date.now(), { effort: flags.effort });
16
16
  await tellProjection(projection.directory, projection.id, flags.effort);
17
17
  if (flags.timeoutMs === undefined)
@@ -2,7 +2,10 @@ export const meta = {
2
2
  command: "tell",
3
3
  summary: "Send intent to a projection mailbox",
4
4
  usage: ["keiyaku tell PROJECTION [--wait DURATION] [--] <BODY|->"],
5
- stdin: "none",
5
+ stdin: {
6
+ mode: "argument",
7
+ selector: { kind: "positional", index: 1, required: true, rejectBlank: true },
8
+ },
6
9
  flags: ["cwd", "repo", "contract", "effort", "wait"],
7
10
  purpose: "Write intent to the mailbox and wake only when eligible.",
8
11
  completionRank: 3,
@@ -7,7 +7,7 @@ export const meta = {
7
7
  "keiyaku wait <projection-address> <projection-address>... (--any|--all) [--timeout DURATION]",
8
8
  "keiyaku @addr wait [<projection-address>...] (--any|--all) [--timeout DURATION]",
9
9
  ],
10
- stdin: "none",
10
+ stdin: { mode: "argument" },
11
11
  flags: ["cwd", "repo", "contract", "timeout", "any", "all"],
12
12
  flagDescriptions: {
13
13
  all: "For a projection set, return only after every admitted member reaches a terminal state.",
@@ -2,7 +2,7 @@ export const meta = {
2
2
  command: "skills install",
3
3
  summary: "Install the official Keiyaku skills",
4
4
  usage: ["keiyaku skills install [-f|--force]"],
5
- stdin: "none",
5
+ stdin: { mode: "argument" },
6
6
  flags: ["force"],
7
7
  purpose: "Install the bundled official Keiyaku skills into supported agent skill directories.",
8
8
  notes: ["Force permits replacement of foreign collisions."],
@@ -2,7 +2,7 @@ export const meta = {
2
2
  command: "skills",
3
3
  summary: "Install official skills",
4
4
  usage: ["keiyaku skills install"],
5
- stdin: "none",
5
+ stdin: { mode: "argument" },
6
6
  flags: [],
7
7
  purpose: "Install bundled official Keiyaku skills into supported agent skill directories.",
8
8
  subcommands: ["install"],
@@ -2,7 +2,7 @@ export const meta = {
2
2
  command: "completion",
3
3
  summary: "Print shell completion",
4
4
  usage: ["keiyaku completion [--shell bash|zsh]"],
5
- stdin: "none",
5
+ stdin: { mode: "argument" },
6
6
  flags: ["cwd", "repo", "shell", "word", "previous", "complete"],
7
7
  purpose: "Print command and address candidates.",
8
8
  completionRank: 13,
@@ -2,7 +2,7 @@ export const meta = {
2
2
  command: "dump-env",
3
3
  summary: "Print the environment template",
4
4
  usage: ["keiyaku dump-env"],
5
- stdin: "none",
5
+ stdin: { mode: "argument" },
6
6
  flags: [],
7
7
  purpose: "Print supported environment keys.",
8
8
  notes: ["Keiyaku loads <KEIYAKU_HOME>/.env, then .keiyaku/.env; process environment values win."],
@@ -2,7 +2,7 @@ export const meta = {
2
2
  command: "guide",
3
3
  summary: "Print the Keiyaku guide",
4
4
  usage: ["keiyaku guide"],
5
- stdin: "none",
5
+ stdin: { mode: "argument" },
6
6
  flags: [],
7
7
  purpose: "Print workflow guidance.",
8
8
  completionRank: 12,
@@ -1,7 +1,7 @@
1
1
  import { createTask, resolveTaskCreator, } from "../../../../core/task/index.js";
2
2
  import { parseTaskAddInput, runTaskMutationCommand } from "../shared.js";
3
- export const handler = async (stdin, flags, _signal, positional) => {
4
- const input = parseTaskAddInput(positional[0] === "-" ? stdin : positional[0]);
3
+ export const handler = async (stdin, flags) => {
4
+ const input = parseTaskAddInput(stdin);
5
5
  return runTaskMutationCommand(flags, async (repository, cwd) => createTask(repository, {
6
6
  ...input,
7
7
  creator: await resolveTaskCreator(cwd),
@@ -2,7 +2,10 @@ export const meta = {
2
2
  command: "task add",
3
3
  summary: "Add a task",
4
4
  usage: ["keiyaku task add [-C|--cwd DIR] [--needs ID] [--parent ID] [--from ID] [--pri 0-3] <BODY|->"],
5
- stdin: "none",
5
+ stdin: {
6
+ mode: "argument",
7
+ selector: { kind: "positional", index: 0, required: true, rejectBlank: true },
8
+ },
6
9
  flags: ["cwd", "needs", "parent", "from", "pri"],
7
10
  purpose: "Create a lightweight task from a title and optional body.",
8
11
  };
@@ -2,7 +2,7 @@ export const meta = {
2
2
  command: "task doctor",
3
3
  summary: "Diagnose the task board",
4
4
  usage: ["keiyaku task doctor [-C|--cwd DIR]"],
5
- stdin: "none",
5
+ stdin: { mode: "argument" },
6
6
  flags: ["cwd"],
7
7
  purpose: "Report task state counts, supported board diseases, and lock state without repair.",
8
8
  };
@@ -2,7 +2,7 @@ export const meta = {
2
2
  command: "task done",
3
3
  summary: "Complete a task",
4
4
  usage: ["keiyaku task done [-C|--cwd DIR] [ID]"],
5
- stdin: "none",
5
+ stdin: { mode: "argument" },
6
6
  flags: ["cwd"],
7
7
  purpose: "Complete an open or in-progress task.",
8
8
  };
@@ -2,7 +2,7 @@ export const meta = {
2
2
  command: "task drop",
3
3
  summary: "Drop a task",
4
4
  usage: ["keiyaku task drop [-C|--cwd DIR] ID"],
5
- stdin: "none",
5
+ stdin: { mode: "argument" },
6
6
  flags: ["cwd"],
7
7
  purpose: "Abandon an open or in-progress task.",
8
8
  };
@@ -1,11 +1,17 @@
1
- import { readTaskBoard } from "../../../../core/task/index.js";
2
- import { renderTaskList, renderTaskListJson } from "../../../render/task.js";
1
+ import { readTaskBoard, selectTaskList } from "../../../../core/task/index.js";
2
+ import { renderSelectedTaskList, renderSelectedTaskListJson } from "../../../render/task.js";
3
3
  import { textResponse } from "../../../render/shared.js";
4
4
  import { taskJsonText, taskSelection, withTaskCommandRepository } from "../shared.js";
5
5
  export const handler = async (_stdin, flags) => {
6
6
  const board = await withTaskCommandRepository(flags, (repository) => readTaskBoard(repository));
7
7
  const selection = taskSelection(flags);
8
+ const tasks = selectTaskList(board.tasks, {
9
+ selection,
10
+ filters: flags.taskFilters,
11
+ sort: flags.taskSort,
12
+ nowMs: Date.now(),
13
+ });
8
14
  return textResponse(flags.json
9
- ? taskJsonText(renderTaskListJson(board.tasks, selection))
10
- : renderTaskList(board.tasks, { selection }));
15
+ ? taskJsonText(renderSelectedTaskListJson(tasks))
16
+ : renderSelectedTaskList(tasks));
11
17
  };
@@ -1,8 +1,8 @@
1
1
  export const meta = {
2
2
  command: "task ls",
3
3
  summary: "List tasks",
4
- usage: ["keiyaku task ls [-C|--cwd DIR] [--all|--done] [--json]"],
5
- stdin: "none",
6
- flags: ["cwd", "all", "done", "json"],
4
+ usage: ["keiyaku task ls [-C|--cwd DIR] [--all|--done] [--filter EXPR] [--sort KEYS] [--json]"],
5
+ stdin: { mode: "argument" },
6
+ flags: ["cwd", "all", "done", "filter", "sort", "json"],
7
7
  purpose: "List tasks from the working-tree board.",
8
8
  };
@@ -2,7 +2,7 @@ export const meta = {
2
2
  command: "task show",
3
3
  summary: "Show one task and its children tree",
4
4
  usage: ["keiyaku task show [-C|--cwd DIR] ID [--json]"],
5
- stdin: "none",
5
+ stdin: { mode: "argument" },
6
6
  flags: ["cwd", "json"],
7
7
  purpose: "Read one task and every descendant linked by parent edges.",
8
8
  };
@@ -2,7 +2,7 @@ export const meta = {
2
2
  command: "task start",
3
3
  summary: "Start a task",
4
4
  usage: ["keiyaku task start [-C|--cwd DIR] ID"],
5
- stdin: "none",
5
+ stdin: { mode: "argument" },
6
6
  flags: ["cwd"],
7
7
  purpose: "Move an open task to in_progress.",
8
8
  };
@@ -2,7 +2,7 @@ export const meta = {
2
2
  command: "task stop",
3
3
  summary: "Stop a task",
4
4
  usage: ["keiyaku task stop [-C|--cwd DIR] [ID]"],
5
- stdin: "none",
5
+ stdin: { mode: "argument" },
6
6
  flags: ["cwd"],
7
7
  purpose: "Return an in-progress task to open.",
8
8
  };
@@ -3,7 +3,7 @@ export const meta = {
3
3
  command: "task",
4
4
  summary: "Manage lightweight repository tasks",
5
5
  usage: ["keiyaku task <subcommand>"],
6
- stdin: "none",
6
+ stdin: { mode: "argument" },
7
7
  flags: [],
8
8
  purpose: "Manage the file-backed task board.",
9
9
  subcommands: TASK_SUBCOMMANDS,
@@ -1,10 +1,9 @@
1
1
  import { updateTask } from "../../../../core/task/index.js";
2
2
  import { runTaskMutationCommand } from "../shared.js";
3
- export const handler = async (stdin, flags, _signal, positional) => {
4
- const body = flags.taskBody === "-" ? stdin : flags.taskBody;
3
+ export const handler = async (_stdin, flags, _signal, positional) => {
5
4
  return runTaskMutationCommand(flags, (repository) => updateTask(repository, positional[0], {
6
5
  ...(flags.taskTitle === undefined ? {} : { title: flags.taskTitle }),
7
- ...(body === undefined ? {} : { body }),
6
+ ...(flags.taskBody === undefined ? {} : { body: flags.taskBody }),
8
7
  ...(flags.taskPri === undefined ? {} : { pri: flags.taskPri }),
9
8
  ...(flags.taskNeeds === undefined ? {} : { addNeeds: flags.taskNeeds }),
10
9
  ...(flags.taskDropNeeds === undefined ? {} : { dropNeeds: flags.taskDropNeeds }),
@@ -2,7 +2,10 @@ export const meta = {
2
2
  command: "task update",
3
3
  summary: "Update task facts",
4
4
  usage: ["keiyaku task update [-C|--cwd DIR] ID [--title TEXT] [--body TEXT|-] [--pri 0-3] [--needs ID] [--drop-needs ID] [--parent ID|--no-parent] [--from ID]"],
5
- stdin: "none",
5
+ stdin: {
6
+ mode: "argument",
7
+ selector: { kind: "flag", name: "taskBody", required: false, rejectBlank: false },
8
+ },
6
9
  flags: ["cwd", "title", "body", "pri", "needs", "drop-needs", "parent", "no-parent", "from"],
7
10
  purpose: "Change mutable task facts.",
8
11
  };
@@ -118,10 +118,10 @@ export const FLAG_SPECS = {
118
118
  kind: "boolean",
119
119
  description: "Preview bind input or petition preflight without mutation.",
120
120
  },
121
- waive: {
121
+ "append-scope": {
122
122
  kind: "value",
123
- placeholder: "PATH",
124
- description: "Allow one explicit out-of-scope path for this seal. May be repeated.",
123
+ placeholder: "PATTERN",
124
+ description: "Append one ordered scope pattern to the contract before audit. May be repeated.",
125
125
  },
126
126
  resolve: {
127
127
  kind: "boolean",
@@ -167,10 +167,25 @@ export const FLAG_SPECS = {
167
167
  kind: "boolean",
168
168
  description: "Render task data as JSON.",
169
169
  },
170
+ "diff-budget": {
171
+ kind: "value",
172
+ placeholder: "BYTES",
173
+ description: "Set the audit raw-diff presentation budget in bytes.",
174
+ },
170
175
  done: {
171
176
  kind: "boolean",
172
177
  description: "Show terminal tasks.",
173
178
  },
179
+ filter: {
180
+ kind: "value",
181
+ placeholder: "FIELD OP VALUE",
182
+ description: "Filter structured task facts. Repeat for AND; comma-separated values are OR.",
183
+ },
184
+ sort: {
185
+ kind: "value",
186
+ placeholder: "KEY[,KEY...]",
187
+ description: "Sort by priority ascending, modified descending, or created descending.",
188
+ },
174
189
  pri: {
175
190
  kind: "value",
176
191
  placeholder: "0-3",
package/build/cli/help.js CHANGED
@@ -62,9 +62,9 @@ export function renderCliHelp(version) {
62
62
  "",
63
63
  "Input:",
64
64
  " <> means required; [] means optional.",
65
- " bind, arc, and amend read Markdown from stdin.",
66
- " call and tell require literal BODY or `-`; only literal `-` opens stdin.",
67
- " revive accepts an artifact plus optional BODY or `-`; only literal `-` opens stdin.",
65
+ " bind, arc, amend, and petition read document stdin only when literal `-` selects it.",
66
+ " call and tell require literal BODY or `-`; literal `-` selects stdin.",
67
+ " revive accepts an artifact plus optional BODY or `-`; unselected stdin is ignored.",
68
68
  "",
69
69
  "Configuration:",
70
70
  " Akuma profiles <KEIYAKU_HOME>/akuma/*.md or .keiyaku/akuma/*.md",