@astrosheep/keiyaku 4.6.4 → 4.6.7
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.
- package/README.md +7 -0
- package/build/{integrations/marketplace → plugins}/.agents/plugins/marketplace.json +1 -1
- package/build/plugins/.claude-plugin/marketplace.json +5 -0
- package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/.claude-plugin/plugin.json +1 -1
- package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku-akuma/SKILL.md +43 -8
- package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku-bind/SKILL.md +7 -8
- package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku-workflow/SKILL.md +3 -3
- package/build/{integrations/marketplace/plugins/keiyaku → plugins/codex}/.codex-plugin/plugin.json +1 -1
- package/build/plugins/codex/skills/keiyaku/SKILL.md +44 -0
- package/build/plugins/codex/skills/keiyaku-akuma/SKILL.md +130 -0
- package/build/plugins/codex/skills/keiyaku-akuma/references/automation.md +269 -0
- package/build/plugins/codex/skills/keiyaku-babysit/SKILL.md +65 -0
- package/build/plugins/codex/skills/keiyaku-bind/SKILL.md +216 -0
- package/build/plugins/codex/skills/keiyaku-bind/agents/openai.yaml +4 -0
- package/build/plugins/codex/skills/keiyaku-task/SKILL.md +104 -0
- package/build/plugins/codex/skills/keiyaku-workflow/SKILL.md +129 -0
- package/build/plugins/opencode/package.json +6 -0
- package/build/plugins/opencode/skills/keiyaku/SKILL.md +44 -0
- package/build/plugins/opencode/skills/keiyaku-akuma/SKILL.md +130 -0
- package/build/plugins/opencode/skills/keiyaku-akuma/references/automation.md +269 -0
- package/build/plugins/opencode/skills/keiyaku-babysit/SKILL.md +65 -0
- package/build/plugins/opencode/skills/keiyaku-bind/SKILL.md +216 -0
- package/build/plugins/opencode/skills/keiyaku-bind/agents/openai.yaml +4 -0
- package/build/plugins/opencode/skills/keiyaku-task/SKILL.md +104 -0
- package/build/plugins/opencode/skills/keiyaku-workflow/SKILL.md +129 -0
- package/build/skills/keiyaku/SKILL.md +44 -0
- package/build/skills/keiyaku-akuma/SKILL.md +130 -0
- package/build/skills/keiyaku-akuma/references/automation.md +269 -0
- package/build/skills/keiyaku-babysit/SKILL.md +65 -0
- package/build/skills/keiyaku-bind/SKILL.md +216 -0
- package/build/skills/keiyaku-bind/agents/openai.yaml +4 -0
- package/build/skills/keiyaku-task/SKILL.md +104 -0
- package/build/skills/keiyaku-workflow/SKILL.md +129 -0
- package/build/src/akuma/akuma-instance.js +7 -5
- package/build/src/akuma/akuma-observe.d.ts +22 -15
- package/build/src/akuma/akuma-observe.js +87 -16
- package/build/src/akuma/akuma-owner.d.ts +3 -2
- package/build/src/akuma/akuma-owner.js +28 -10
- package/build/src/akuma/akuma-selection-execution.d.ts +3 -1
- package/build/src/akuma/akuma-selection-execution.js +2 -1
- package/build/src/akuma/akuma-wait.d.ts +6 -4
- package/build/src/akuma/akuma-wait.js +78 -53
- package/build/src/akuma/akuma.d.ts +6 -4
- package/build/src/akuma/akuma.js +4 -0
- package/build/src/akuma/body.d.ts +1 -0
- package/build/src/akuma/body.js +12 -23
- package/build/src/akuma/call-initial-tell.d.ts +2 -2
- package/build/src/akuma/call-initial-tell.js +1 -1
- package/build/src/akuma/call-request.d.ts +2 -2
- package/build/src/akuma/heart/index.d.ts +7 -2
- package/build/src/akuma/heart/index.js +50 -5
- package/build/src/akuma/heart/tells.d.ts +33 -2
- package/build/src/akuma/heart/tells.js +24 -18
- package/build/src/akuma/heart/timeline.d.ts +23 -1
- package/build/src/akuma/heart/timeline.js +28 -21
- package/build/src/akuma/projection.d.ts +10 -10
- package/build/src/akuma/providers/pi/index.js +72 -39
- package/build/src/akuma/selection-observation.d.ts +20 -20
- package/build/src/akuma/selection-owner-port.d.ts +1 -1
- package/build/src/akuma/selection-owner-port.js +16 -5
- package/build/src/akuma/selection-request.d.ts +2 -0
- package/build/src/akuma/selection-request.js +2 -1
- package/build/src/akuma-body.js +5 -2
- package/build/src/alias/index.d.ts +0 -1
- package/build/src/alias/index.js +0 -4
- package/build/src/body/amend.d.ts +0 -4
- package/build/src/body/amend.js +0 -3
- package/build/src/body/region.d.ts +0 -1
- package/build/src/body/region.js +0 -3
- package/build/src/body/verification.d.ts +0 -1
- package/build/src/cli/commands/akuma-grammar.js +23 -66
- package/build/src/cli/commands/akuma.js +23 -42
- package/build/src/cli/commands/contract-grammar.d.ts +14 -1
- package/build/src/cli/commands/contract-grammar.js +54 -21
- package/build/src/cli/commands/contract-help.d.ts +9 -8
- package/build/src/cli/commands/contract-help.js +14 -7
- package/build/src/cli/commands/contract.js +57 -117
- package/build/src/cli/commands/install.d.ts +5 -5
- package/build/src/cli/commands/install.js +4 -7
- package/build/src/cli/commands/task-grammar.js +10 -66
- package/build/src/cli/commands/task.d.ts +0 -1
- package/build/src/cli/commands/task.js +34 -53
- package/build/src/cli/coordinates.d.ts +1 -2
- package/build/src/cli/coordinates.js +1 -4
- package/build/src/cli/parse.d.ts +2 -3
- package/build/src/cli/parse.js +24 -66
- package/build/src/cli/render/akuma.d.ts +3 -16
- package/build/src/cli/render/akuma.js +1 -13
- package/build/src/cli/render/audit.js +1 -1
- package/build/src/cli/render/contract.js +34 -32
- package/build/src/cli/render/kanshi-akuma.d.ts +8 -2
- package/build/src/cli/render/kanshi-akuma.js +14 -7
- package/build/src/cli/render/kanshi.d.ts +3 -1
- package/build/src/cli/render/kanshi.js +44 -32
- package/build/src/cli/render/receipt.js +6 -1
- package/build/src/cli/render/task.d.ts +1 -1
- package/build/src/cli/render/task.js +3 -27
- package/build/src/cli/render/terminal.d.ts +6 -2
- package/build/src/cli/render/terminal.js +8 -2
- package/build/src/cli/runtime.js +3 -16
- package/build/src/cli/scan.d.ts +26 -0
- package/build/src/cli/scan.js +82 -0
- package/build/src/cli/streams.d.ts +5 -0
- package/build/src/cli/streams.js +11 -0
- package/build/src/contract-worktree.js +38 -21
- package/build/src/core/facts/codec.d.ts +1 -2
- package/build/src/core/facts/codec.js +5 -11
- package/build/src/core/facts/types.d.ts +16 -2
- package/build/src/core/facts/types.js +15 -0
- package/build/src/core/verbs/abandon.js +3 -9
- package/build/src/core/verbs/amend.js +2 -9
- package/build/src/core/verbs/arc.js +6 -13
- package/build/src/core/verbs/attestation.js +2 -9
- package/build/src/core/verbs/bind.js +2 -9
- package/build/src/core/verbs/deliver.js +2 -9
- package/build/src/core/verbs/placement.d.ts +1 -1
- package/build/src/core/verbs/placement.js +2 -9
- package/build/src/core/verbs/reintegrate.d.ts +1 -1
- package/build/src/core/verbs/reintegrate.js +2 -9
- package/build/src/dispatch/index.d.ts +2 -2
- package/build/src/dispatch/index.js +33 -11
- package/build/src/git/hooks.d.ts +2 -4
- package/build/src/git/hooks.js +0 -12
- package/build/src/git/integration.d.ts +5 -3
- package/build/src/git/integration.js +36 -25
- package/build/src/git/nuke.js +4 -4
- package/build/src/git/observe.d.ts +4 -4
- package/build/src/git/observe.js +5 -5
- package/build/src/git/process.d.ts +1 -4
- package/build/src/git/process.js +1 -11
- package/build/src/git/read-observation.js +1 -1
- package/build/src/git/reconcile.d.ts +1 -1
- package/build/src/git/reconcile.js +15 -13
- package/build/src/git/repository.d.ts +2 -6
- package/build/src/git/repository.js +18 -31
- package/build/src/git/scratch.d.ts +6 -6
- package/build/src/git/scratch.js +110 -46
- package/build/src/git/target-placement.d.ts +5 -5
- package/build/src/git/target-placement.js +18 -33
- package/build/src/git/tender.d.ts +6 -2
- package/build/src/git/tender.js +19 -12
- package/build/src/git/terminal-reconcile.js +24 -13
- package/build/src/git/terminal-seal.d.ts +2 -5
- package/build/src/git/terminal-seal.js +5 -3
- package/build/src/git/workspace.d.ts +17 -13
- package/build/src/git/workspace.js +58 -41
- package/build/src/kanshi/index.d.ts +2 -2
- package/build/src/kanshi/index.js +1 -1
- package/build/src/kanshi/read.d.ts +8 -1
- package/build/src/kanshi/read.js +72 -7
- package/build/src/kanshi/report.d.ts +12 -0
- package/build/src/library/akuma-creation.d.ts +4 -4
- package/build/src/library/akuma-creation.js +21 -19
- package/build/src/library/bind.d.ts +1 -63
- package/build/src/library/bind.js +3 -9
- package/build/src/library/contract-creation.js +2 -30
- package/build/src/library/contract-execution.d.ts +0 -1
- package/build/src/library/contract-execution.js +9 -34
- package/build/src/library/contract-operations.d.ts +5 -1
- package/build/src/library/contract-operations.js +7 -3
- package/build/src/library/contract-types.d.ts +1 -1
- package/build/src/library/delivery.d.ts +91 -93
- package/build/src/library/delivery.js +2 -1
- package/build/src/library/input.d.ts +0 -2
- package/build/src/library/input.js +0 -4
- package/build/src/library/invocation.d.ts +0 -1
- package/build/src/library/invocation.js +3 -25
- package/build/src/library/outcome.d.ts +651 -602
- package/build/src/library/outcome.js +4 -4
- package/build/src/library/reconcile.d.ts +6 -0
- package/build/src/library/reconcile.js +31 -1
- package/build/src/library/repo.d.ts +0 -1
- package/build/src/library/selection.d.ts +1 -10
- package/build/src/library/selection.js +19 -17
- package/build/src/plugin/akuma-signals.d.ts +10 -11
- package/build/src/plugin/akuma-signals.js +36 -20
- package/build/src/plugin/public.d.ts +5 -0
- package/build/src/plugin/runtime.d.ts +1 -0
- package/build/src/plugin/runtime.js +34 -23
- package/build/src/protocol/abandon.d.ts +1 -1
- package/build/src/protocol/abandon.js +3 -10
- package/build/src/protocol/amend.js +2 -5
- package/build/src/protocol/arc.d.ts +1 -1
- package/build/src/protocol/arc.js +2 -9
- package/build/src/protocol/attempt.d.ts +3 -20
- package/build/src/protocol/attempt.js +6 -5
- package/build/src/protocol/audit.d.ts +1 -0
- package/build/src/protocol/audit.js +10 -11
- package/build/src/protocol/completion.d.ts +129 -55
- package/build/src/protocol/completion.js +62 -73
- package/build/src/protocol/deliver.d.ts +7 -5
- package/build/src/protocol/deliver.js +74 -44
- package/build/src/protocol/execution-observation.d.ts +2 -4
- package/build/src/protocol/execution-observation.js +3 -7
- package/build/src/protocol/intent.d.ts +1 -1
- package/build/src/protocol/intent.js +1 -0
- package/build/src/protocol/operations.d.ts +24 -12
- package/build/src/protocol/operations.js +36 -15
- package/build/src/protocol/placement.d.ts +2 -1
- package/build/src/protocol/placement.js +21 -5
- package/build/src/protocol/progress.d.ts +1 -1
- package/build/src/protocol/read/status.js +58 -41
- package/build/src/protocol/reintegrate.d.ts +1 -1
- package/build/src/protocol/reintegrate.js +10 -19
- package/build/src/protocol/review.d.ts +3 -28
- package/build/src/protocol/review.js +10 -37
- package/build/src/protocol/run.d.ts +19 -7
- package/build/src/protocol/run.js +19 -9
- package/build/src/runtime/proc/windows-launch.exe +0 -0
- package/build/src/settlement/holder.d.ts +2 -4
- package/build/src/settlement/holder.js +3 -6
- package/build/src/task/board.d.ts +6 -0
- package/build/src/task/board.js +30 -1
- package/build/src/task/catalog.js +1 -4
- package/build/src/task/compose.d.ts +0 -1
- package/build/src/task/compose.js +0 -1
- package/build/src/task/context.d.ts +0 -1
- package/build/src/task/context.js +0 -3
- package/build/src/task/created-observation.d.ts +5 -1
- package/build/src/task/created-observation.js +12 -5
- package/build/src/task/index.d.ts +1 -1
- package/build/src/task/index.js +7 -6
- package/build/src/task/input.d.ts +0 -6
- package/build/src/task/input.js +2 -14
- package/build/src/task/mutation.d.ts +3 -4
- package/build/src/task/mutation.js +11 -39
- package/build/src/task/operations.d.ts +2 -7
- package/build/src/task/operations.js +37 -49
- package/build/src/task/query.d.ts +0 -1
- package/build/src/task/query.js +1 -4
- package/build/src/task/store.d.ts +0 -2
- package/build/src/task/store.js +27 -11
- package/build/src/verification/declaration.js +3 -2
- package/build/src/verification/execution.d.ts +3 -2
- package/build/src/verification/execution.js +10 -6
- package/build/src/workspace-place.d.ts +0 -1
- package/build/src/workspace-place.js +0 -11
- package/package.json +13 -9
- package/build/integrations/marketplace/.claude-plugin/marketplace.json +0 -5
- package/build/integrations/marketplace/plugins/keiyaku/package.json +0 -17
- /package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku/SKILL.md +0 -0
- /package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku-akuma/references/automation.md +0 -0
- /package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku-babysit/SKILL.md +0 -0
- /package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku-bind/agents/openai.yaml +0 -0
- /package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku-task/SKILL.md +0 -0
- /package/build/{integrations/marketplace/plugins/keiyaku/opencode.js → plugins/opencode/index.js} +0 -0
- /package/build/{integrations → plugins}/pi/keiyaku.ts +0 -0
|
@@ -2,7 +2,7 @@ import { CliUsageError, isBlankInput } from "../usage.js";
|
|
|
2
2
|
import { readFile } from "node:fs/promises";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
import { squareAssignedParticipantName } from "@astrosheep/square";
|
|
5
|
-
import {
|
|
5
|
+
import { emitPluginSignal } from "../../plugin/akuma-signals.js";
|
|
6
6
|
import { canonicalBirthCwd } from "../../akuma/call-input.js";
|
|
7
7
|
import { Schema } from "../../akuma/index.js";
|
|
8
8
|
import { executionChannel } from "../../akuma/requests.js";
|
|
@@ -12,10 +12,10 @@ import { akumasWithExecution } from "../../library/akumas.js";
|
|
|
12
12
|
import { World } from "../../world.js";
|
|
13
13
|
import { contractFromInput } from "../selectors.js";
|
|
14
14
|
import { ActivityDriver } from "../activity.js";
|
|
15
|
-
import { displayContext, resultContext, writeJson, writeStderr, writeStdout } from "../streams.js";
|
|
15
|
+
import { displayContext, emit, resultContext, writeJson, writeStderr, writeStdout } from "../streams.js";
|
|
16
16
|
import { callObservationStream, inputWaitStream, waitObservationStream, } from "../render/akuma-activity.js";
|
|
17
|
-
import { askRawAnswer, callRawAnswer, historyRawAnswer, waitRawAnswer } from "../render/akuma-activity.js";
|
|
18
|
-
import { askExitCode, askProgressStream, callExitCode, callObservationHead, forkExitCode, historyExitCode, killExitCode, renderCallText, renderForkText,
|
|
17
|
+
import { askRawAnswer, callRawAnswer, historyRawAnswer, historyText, tellText, waitRawAnswer, waitText, } from "../render/akuma-activity.js";
|
|
18
|
+
import { askExitCode, askProgressStream, callExitCode, callObservationHead, forkExitCode, historyExitCode, killExitCode, renderCallText, renderForkText, renderKillText, tellExitCode, waitedTellProgress, } from "../render/akuma.js";
|
|
19
19
|
export { isParsedAkumaCommand, renderAkumaHelp } from "./akuma-grammar.js";
|
|
20
20
|
// ---------------------------------------------------------------------------
|
|
21
21
|
// Leaf dispatch: acquisition, one public SDK invocation, direct rendering
|
|
@@ -73,20 +73,14 @@ async function inputInitiator(input) {
|
|
|
73
73
|
// The initiator still travels with the request either way.
|
|
74
74
|
if (!(await World.established(input.path)))
|
|
75
75
|
return { initiator };
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
reportDiagnostic: (message) => writeStderr(message),
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
catch (error) {
|
|
85
|
-
writeStderr(`! plugin initiation: ${error instanceof Error ? error.message : String(error)}`);
|
|
86
|
-
}
|
|
76
|
+
await emitPluginSignal({
|
|
77
|
+
world: input.path,
|
|
78
|
+
...(input.settings === undefined ? {} : { settings: input.settings }),
|
|
79
|
+
reportDiagnostic: (message) => writeStderr(message),
|
|
80
|
+
}, { kind: "akuma.initiating", initiator });
|
|
87
81
|
return { initiator };
|
|
88
82
|
}
|
|
89
|
-
function
|
|
83
|
+
function emitAnswer(body, exact) {
|
|
90
84
|
if (exact)
|
|
91
85
|
process.stdout.write(body);
|
|
92
86
|
else
|
|
@@ -152,9 +146,9 @@ async function runCall(command, input) {
|
|
|
152
146
|
}
|
|
153
147
|
const raw = callRawAnswer(result, streamed);
|
|
154
148
|
if (raw === undefined)
|
|
155
|
-
|
|
149
|
+
emitAnswer(renderCallText(result, streamed, displayContext()), false);
|
|
156
150
|
else
|
|
157
|
-
|
|
151
|
+
emitAnswer(raw, true);
|
|
158
152
|
return callExitCode(result);
|
|
159
153
|
}
|
|
160
154
|
finally {
|
|
@@ -195,9 +189,9 @@ async function runWait(command, input) {
|
|
|
195
189
|
}
|
|
196
190
|
const raw = waitRawAnswer(result, streamed);
|
|
197
191
|
if (raw === undefined)
|
|
198
|
-
|
|
192
|
+
emitAnswer(waitText(result, presentation, displayContext()), false);
|
|
199
193
|
else
|
|
200
|
-
|
|
194
|
+
emitAnswer(raw, true);
|
|
201
195
|
return 0;
|
|
202
196
|
}
|
|
203
197
|
finally {
|
|
@@ -214,12 +208,8 @@ async function runTell(command, input) {
|
|
|
214
208
|
...(input.repo === undefined ? {} : { repo: input.repo }),
|
|
215
209
|
...(input.signal === undefined ? {} : { signal: input.signal }),
|
|
216
210
|
});
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
return tellExitCode(result);
|
|
220
|
-
}
|
|
221
|
-
emitResult(renderTellText(result, inputAlias(command.akuma), displayContext()), false);
|
|
222
|
-
return tellExitCode(result);
|
|
211
|
+
const text = () => tellText(result, inputAlias(command.akuma), displayContext());
|
|
212
|
+
return emit(command.output, result, text, tellExitCode(result));
|
|
223
213
|
}
|
|
224
214
|
async function runAsk(command, input) {
|
|
225
215
|
const body = await promptBody("ask", command, input);
|
|
@@ -261,7 +251,7 @@ async function runAsk(command, input) {
|
|
|
261
251
|
writeJson(result);
|
|
262
252
|
return askExitCode(result);
|
|
263
253
|
}
|
|
264
|
-
|
|
254
|
+
emitAnswer(askRawAnswer(result, schema !== undefined) ?? "", true);
|
|
265
255
|
return askExitCode(result);
|
|
266
256
|
}
|
|
267
257
|
finally {
|
|
@@ -289,11 +279,11 @@ async function runHistory(command, input) {
|
|
|
289
279
|
last: command.last,
|
|
290
280
|
};
|
|
291
281
|
if (raw !== undefined)
|
|
292
|
-
|
|
282
|
+
emitAnswer(raw, true);
|
|
293
283
|
else if (command.last && result.kind === "last")
|
|
294
|
-
|
|
284
|
+
emitAnswer(result.answer, true);
|
|
295
285
|
else
|
|
296
|
-
|
|
286
|
+
emitAnswer(historyText(result, presentation, displayContext()), false);
|
|
297
287
|
return historyExitCode(result, command.id);
|
|
298
288
|
}
|
|
299
289
|
async function runFork(command, input) {
|
|
@@ -302,12 +292,7 @@ async function runFork(command, input) {
|
|
|
302
292
|
at: command.at,
|
|
303
293
|
...(input.repo === undefined ? {} : { repo: input.repo }),
|
|
304
294
|
});
|
|
305
|
-
|
|
306
|
-
writeJson(receipt);
|
|
307
|
-
return forkExitCode(receipt);
|
|
308
|
-
}
|
|
309
|
-
emitResult(renderForkText(receipt), false);
|
|
310
|
-
return forkExitCode(receipt);
|
|
295
|
+
return emit(command.output, receipt, () => renderForkText(receipt), forkExitCode(receipt));
|
|
311
296
|
}
|
|
312
297
|
async function runKill(command, input) {
|
|
313
298
|
const alias = command.akuma.length === 1 ? inputAlias(command.akuma[0]) : undefined;
|
|
@@ -316,12 +301,8 @@ async function runKill(command, input) {
|
|
|
316
301
|
...(input.repo === undefined ? {} : { repo: input.repo }),
|
|
317
302
|
...(input.signal === undefined ? {} : { signal: input.signal }),
|
|
318
303
|
});
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
return killExitCode(result);
|
|
322
|
-
}
|
|
323
|
-
emitResult(renderKillText(result, alias, displayContext()), false);
|
|
324
|
-
return killExitCode(result);
|
|
304
|
+
const text = () => renderKillText(result, alias, displayContext());
|
|
305
|
+
return emit(command.output, result, text, killExitCode(result));
|
|
325
306
|
}
|
|
326
307
|
async function akumaWorld(command, coordinates) {
|
|
327
308
|
const world = command.command === "call"
|
|
@@ -44,7 +44,7 @@ export type ParsedDeliver = Output & Readonly<{
|
|
|
44
44
|
materializeConflict: boolean;
|
|
45
45
|
overwrite: boolean;
|
|
46
46
|
}>;
|
|
47
|
-
export type ParsedReview = Output & Readonly<{
|
|
47
|
+
export type ParsedReview = Output & Actor & Readonly<{
|
|
48
48
|
command: "review";
|
|
49
49
|
contract?: string;
|
|
50
50
|
verdict: "satisfied" | "unsatisfied";
|
|
@@ -66,11 +66,23 @@ export type ParsedStatus = Output & (Readonly<{
|
|
|
66
66
|
selectors?: readonly string[];
|
|
67
67
|
akuma?: never;
|
|
68
68
|
guidance?: true;
|
|
69
|
+
category?: never;
|
|
70
|
+
limit?: never;
|
|
69
71
|
}> | Readonly<{
|
|
70
72
|
command: "status";
|
|
71
73
|
contract: string;
|
|
72
74
|
akuma: true;
|
|
73
75
|
guidance?: never;
|
|
76
|
+
category?: never;
|
|
77
|
+
limit?: never;
|
|
78
|
+
}> | Readonly<{
|
|
79
|
+
command: "status";
|
|
80
|
+
category: StatusCategory;
|
|
81
|
+
limit?: number;
|
|
82
|
+
contract?: never;
|
|
83
|
+
selectors?: never;
|
|
84
|
+
akuma?: never;
|
|
85
|
+
guidance?: never;
|
|
74
86
|
}>);
|
|
75
87
|
export type ParsedLs = Output & Readonly<{
|
|
76
88
|
command: "ls";
|
|
@@ -108,5 +120,6 @@ export type ParsedContractParts = Readonly<{
|
|
|
108
120
|
actor?: string;
|
|
109
121
|
}>;
|
|
110
122
|
export type ParsedContractCommand = ParsedBind | ParsedAmend | ParsedDeliver | ParsedReview | ParsedArc | ParsedAbandon | ParsedStatus | ParsedLs | ParsedAudit | ParsedReconcile | ParsedNuke | ParsedSettings | ParsedRegion;
|
|
123
|
+
export type StatusCategory = "akuma" | "contract";
|
|
111
124
|
export declare function parseContractCommand(parts: ParsedContractParts): ParsedContractCommand;
|
|
112
125
|
export {};
|
|
@@ -123,32 +123,65 @@ function parseReview(parts) {
|
|
|
123
123
|
verdict: parts.flags.satisfied === true ? "satisfied" : "unsatisfied",
|
|
124
124
|
...(summary === undefined ? {} : { summary }),
|
|
125
125
|
...(parts.stdin ? { summaryFromStdin: true } : {}),
|
|
126
|
+
...(parts.actor === undefined ? {} : { actor: parts.actor }),
|
|
126
127
|
output: parts.output,
|
|
127
128
|
};
|
|
128
129
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
};
|
|
130
|
+
// Only these fixed category forms are status selectors.
|
|
131
|
+
const STATUS_CATEGORY_SELECTORS = new Map([
|
|
132
|
+
["aku", "akuma"],
|
|
133
|
+
["aku/", "akuma"],
|
|
134
|
+
["aku/*", "akuma"],
|
|
135
|
+
["kei", "contract"],
|
|
136
|
+
["kei/", "contract"],
|
|
137
|
+
["kei/*", "contract"],
|
|
138
|
+
]);
|
|
139
|
+
function rejectStatusGlobs(positionals) {
|
|
140
|
+
for (const selector of positionals) {
|
|
141
|
+
if (!STATUS_CATEGORY_SELECTORS.has(selector) && !selector.startsWith("@") && /[*?\[\]]/u.test(selector))
|
|
142
|
+
refuse("status", `unsupported status glob: ${selector}`);
|
|
143
143
|
}
|
|
144
|
+
}
|
|
145
|
+
function parseStatusGuidance(parts, limit) {
|
|
146
|
+
if (limit !== undefined)
|
|
147
|
+
refuse("status", "--limit is not valid with --guidance");
|
|
148
|
+
const selected = parts.positionals[0];
|
|
149
|
+
if (selected !== undefined && STATUS_CATEGORY_SELECTORS.has(selected))
|
|
150
|
+
refuse("status", "--guidance cannot select a category");
|
|
151
|
+
if (parts.positionals.length > 1)
|
|
152
|
+
refuse("status", "--guidance accepts at most one Contract selector");
|
|
153
|
+
if (selected?.startsWith("aku/") === true)
|
|
154
|
+
refuse("status", "--guidance cannot select an Akuma");
|
|
155
|
+
if (selected !== undefined && !selected.startsWith("@") && /[*?\[\]]/u.test(selected))
|
|
156
|
+
refuse("status", `unsupported status glob: ${selected}`);
|
|
157
|
+
return {
|
|
158
|
+
command: "status",
|
|
159
|
+
...(selected === undefined ? {} : { contract: selected }),
|
|
160
|
+
guidance: true,
|
|
161
|
+
output: parts.output,
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
function parseStatus(parts) {
|
|
165
|
+
const limit = listLimit(parts, "status");
|
|
166
|
+
if (parts.flags.guidance === true)
|
|
167
|
+
return parseStatusGuidance(parts, limit);
|
|
168
|
+
rejectStatusGlobs(parts.positionals);
|
|
144
169
|
if (parts.positionals.length > 1) {
|
|
170
|
+
if (limit !== undefined)
|
|
171
|
+
refuse("status", "--limit is valid only for one category selector");
|
|
172
|
+
if (parts.positionals.some((selector) => STATUS_CATEGORY_SELECTORS.has(selector)))
|
|
173
|
+
refuse("status", "a category selector cannot combine with other selectors");
|
|
145
174
|
return { command: "status", selectors: parts.positionals, output: parts.output };
|
|
146
175
|
}
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
176
|
+
const selected = parts.positionals[0];
|
|
177
|
+
const category = selected === undefined ? undefined : STATUS_CATEGORY_SELECTORS.get(selected);
|
|
178
|
+
if (category !== undefined)
|
|
179
|
+
return { command: "status", category, ...(limit === undefined ? {} : { limit }), output: parts.output };
|
|
180
|
+
if (limit !== undefined)
|
|
181
|
+
refuse("status", "--limit is valid only for a category selector");
|
|
182
|
+
if (selected?.startsWith("aku/") === true)
|
|
183
|
+
return { command: "status", contract: selected, akuma: true, output: parts.output };
|
|
184
|
+
return { command: "status", ...(selected === undefined ? {} : { contract: selected }), output: parts.output };
|
|
152
185
|
}
|
|
153
186
|
function parseRegion(parts) {
|
|
154
187
|
const contract = parts.positionals[0];
|
|
@@ -172,10 +205,10 @@ function akumaCatalogQuery(query, parts) {
|
|
|
172
205
|
...(limit === undefined ? {} : { limit: Number(limit) }),
|
|
173
206
|
};
|
|
174
207
|
}
|
|
175
|
-
function listLimit(parts) {
|
|
208
|
+
function listLimit(parts, command = "ls") {
|
|
176
209
|
const limit = optionalFlag(parts.flags, "limit");
|
|
177
210
|
if (limit !== undefined && (!/^[1-9][0-9]*$/u.test(limit) || !Number.isSafeInteger(Number(limit))))
|
|
178
|
-
refuse(
|
|
211
|
+
refuse(command, "--limit requires a positive safe integer");
|
|
179
212
|
return limit === undefined ? undefined : Number(limit);
|
|
180
213
|
}
|
|
181
214
|
function taskCatalogQuery(path, limit) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
type
|
|
1
|
+
import type { ScanFlagKind } from "../scan.js";
|
|
2
2
|
export type ContractCommandSpec = Readonly<{
|
|
3
3
|
positional: "none" | "optional";
|
|
4
4
|
stdin: "none" | "optional" | "required";
|
|
5
|
-
flags: Readonly<Record<string,
|
|
5
|
+
flags: Readonly<Record<string, ScanFlagKind>>;
|
|
6
6
|
usage: string;
|
|
7
7
|
purpose: string;
|
|
8
8
|
details?: string;
|
|
@@ -15,7 +15,7 @@ export declare const CONTRACT_COMMAND_SPECS: {
|
|
|
15
15
|
readonly actor: "value";
|
|
16
16
|
readonly task: "value";
|
|
17
17
|
readonly target: "value";
|
|
18
|
-
readonly after: "repeat
|
|
18
|
+
readonly after: "repeat";
|
|
19
19
|
readonly gates: "raw-value";
|
|
20
20
|
readonly "fork-of": "value";
|
|
21
21
|
readonly json: "boolean";
|
|
@@ -29,7 +29,7 @@ export declare const CONTRACT_COMMAND_SPECS: {
|
|
|
29
29
|
readonly stdin: "optional";
|
|
30
30
|
readonly flags: {
|
|
31
31
|
readonly actor: "value";
|
|
32
|
-
readonly after: "repeat
|
|
32
|
+
readonly after: "repeat";
|
|
33
33
|
readonly "clear-after": "boolean";
|
|
34
34
|
readonly gates: "raw-value";
|
|
35
35
|
readonly json: "boolean";
|
|
@@ -56,12 +56,13 @@ export declare const CONTRACT_COMMAND_SPECS: {
|
|
|
56
56
|
readonly positional: "optional";
|
|
57
57
|
readonly stdin: "optional";
|
|
58
58
|
readonly flags: {
|
|
59
|
+
readonly actor: "value";
|
|
59
60
|
readonly satisfied: "boolean";
|
|
60
61
|
readonly unsatisfied: "boolean";
|
|
61
62
|
readonly summary: "value";
|
|
62
63
|
readonly json: "boolean";
|
|
63
64
|
};
|
|
64
|
-
readonly usage: "review [<contract>|@<contract>] (--satisfied | --unsatisfied) (--summary <text> | -)";
|
|
65
|
+
readonly usage: "review [<contract>|@<contract>] (--satisfied | --unsatisfied) (--summary <text> | -) [--actor <actor>]";
|
|
65
66
|
readonly purpose: "Record whether a Contract meets its acceptance criteria.";
|
|
66
67
|
readonly details: string;
|
|
67
68
|
};
|
|
@@ -92,9 +93,10 @@ export declare const CONTRACT_COMMAND_SPECS: {
|
|
|
92
93
|
readonly stdin: "none";
|
|
93
94
|
readonly flags: {
|
|
94
95
|
readonly guidance: "boolean";
|
|
96
|
+
readonly limit: "value";
|
|
95
97
|
readonly json: "boolean";
|
|
96
98
|
};
|
|
97
|
-
readonly usage: "status [<contract>|@name|<aku/...>]...\nstatus --guidance [<contract>|@<contract>]";
|
|
99
|
+
readonly usage: "status [<contract>|@name|<aku/...>]...\nstatus (aku|aku/|aku/*) [--limit <count>]\nstatus (kei|kei/|kei/*) [--limit <count>]\nstatus --guidance [<contract>|@<contract>]";
|
|
98
100
|
readonly purpose: "Show the world overview or selected Contract and Akuma status.";
|
|
99
101
|
readonly details: string;
|
|
100
102
|
};
|
|
@@ -156,7 +158,7 @@ export declare const CONTRACT_COMMAND_SPECS: {
|
|
|
156
158
|
readonly positional: "optional";
|
|
157
159
|
readonly stdin: "none";
|
|
158
160
|
readonly flags: {
|
|
159
|
-
readonly path: "repeat
|
|
161
|
+
readonly path: "repeat";
|
|
160
162
|
readonly json: "boolean";
|
|
161
163
|
};
|
|
162
164
|
readonly usage: "region [<contract>]\nregion --path <pattern> [--path <pattern> ...]";
|
|
@@ -166,4 +168,3 @@ export declare const CONTRACT_COMMAND_SPECS: {
|
|
|
166
168
|
};
|
|
167
169
|
export type ContractCommand = keyof typeof CONTRACT_COMMAND_SPECS;
|
|
168
170
|
export declare function renderContractHelp(command: ContractCommand): string;
|
|
169
|
-
export {};
|
|
@@ -7,7 +7,7 @@ export const CONTRACT_COMMAND_SPECS = {
|
|
|
7
7
|
actor: "value",
|
|
8
8
|
task: "value",
|
|
9
9
|
target: "value",
|
|
10
|
-
after: "repeat
|
|
10
|
+
after: "repeat",
|
|
11
11
|
gates: "raw-value",
|
|
12
12
|
"fork-of": "value",
|
|
13
13
|
json: "boolean",
|
|
@@ -47,6 +47,7 @@ export const CONTRACT_COMMAND_SPECS = {
|
|
|
47
47
|
"A pattern containing whitespace binds with a warning. A fence carries no",
|
|
48
48
|
"info string or exactly 'txt'.",
|
|
49
49
|
"",
|
|
50
|
+
"Verification runs only with the verified gate; without it the section is inert text.",
|
|
50
51
|
"Verification uses one or more closed bash, zsh, or pwsh fences. Its fence",
|
|
51
52
|
"may add timeout=<integer><ms|s|m|h>; the section contains no other prose.",
|
|
52
53
|
"Unknown ## sections are retained as extensions; reserved section names are refused.",
|
|
@@ -55,7 +56,7 @@ export const CONTRACT_COMMAND_SPECS = {
|
|
|
55
56
|
amend: {
|
|
56
57
|
positional: "optional",
|
|
57
58
|
stdin: "optional",
|
|
58
|
-
flags: { actor: "value", after: "repeat
|
|
59
|
+
flags: { actor: "value", after: "repeat", "clear-after": "boolean", gates: "raw-value", json: "boolean" },
|
|
59
60
|
usage: "amend [<contract>|@<contract>] [--after <kei/...> ... | --clear-after] [--gates <name,...>] [--actor <actor>] [-]",
|
|
60
61
|
purpose: "Change a Contract's document, prerequisites, or acceptance gates.",
|
|
61
62
|
details: [
|
|
@@ -91,6 +92,7 @@ export const CONTRACT_COMMAND_SPECS = {
|
|
|
91
92
|
purpose: "Submit work for a Contract and integrate it when its requirements are met.",
|
|
92
93
|
details: [
|
|
93
94
|
"The Contract, not the current Arc, sets what delivery must satisfy. An Arc records progress; it does not narrow acceptance.",
|
|
95
|
+
"With the verified gate, delivery runs Verification or reuses current satisfied evidence.",
|
|
94
96
|
"Verification, integration, and cleanup progress appears on stderr; stdout contains one final result.",
|
|
95
97
|
"By default, delivery uses HEAD. --include-dirty includes all non-ignored worktree changes, staged or not; it leaves your branch and index unchanged, so staging or committing is unnecessary.",
|
|
96
98
|
"Repeating delivery with unchanged work resumes unfinished verification or integration. Changed work replaces the candidate.",
|
|
@@ -107,8 +109,8 @@ export const CONTRACT_COMMAND_SPECS = {
|
|
|
107
109
|
review: {
|
|
108
110
|
positional: "optional",
|
|
109
111
|
stdin: "optional",
|
|
110
|
-
flags: { satisfied: "boolean", unsatisfied: "boolean", summary: "value", json: "boolean" },
|
|
111
|
-
usage: "review [<contract>|@<contract>] (--satisfied | --unsatisfied) (--summary <text> | -)",
|
|
112
|
+
flags: { actor: "value", satisfied: "boolean", unsatisfied: "boolean", summary: "value", json: "boolean" },
|
|
113
|
+
usage: "review [<contract>|@<contract>] (--satisfied | --unsatisfied) (--summary <text> | -) [--actor <actor>]",
|
|
112
114
|
purpose: "Record whether a Contract meets its acceptance criteria.",
|
|
113
115
|
details: [
|
|
114
116
|
"A review checks the whole Contract, not just one Arc. After delivery it checks the candidate; before delivery it checks the current Contract and worktree, but cannot integrate.",
|
|
@@ -141,12 +143,16 @@ export const CONTRACT_COMMAND_SPECS = {
|
|
|
141
143
|
status: {
|
|
142
144
|
positional: "optional",
|
|
143
145
|
stdin: "none",
|
|
144
|
-
flags: { guidance: "boolean", json: "boolean" },
|
|
145
|
-
usage: "status [<contract>|@name|<aku/...>]...\nstatus --guidance [<contract>|@<contract>]",
|
|
146
|
+
flags: { guidance: "boolean", limit: "value", json: "boolean" },
|
|
147
|
+
usage: "status [<contract>|@name|<aku/...>]...\nstatus (aku|aku/|aku/*) [--limit <count>]\nstatus (kei|kei/|kei/*) [--limit <count>]\nstatus --guidance [<contract>|@<contract>]",
|
|
146
148
|
purpose: "Show the world overview or selected Contract and Akuma status.",
|
|
147
149
|
details: [
|
|
148
150
|
"Akuma entries show the directory each Akuma was started in.",
|
|
149
151
|
"",
|
|
152
|
+
"aku, aku/, and aku/* show the recent Akuma board; kei, kei/, and kei/* show the",
|
|
153
|
+
"recent active Contract board. --limit bounds the board to that many recent rows",
|
|
154
|
+
"(default 10). The Contract category requires a Repo; the Akuma category does not.",
|
|
155
|
+
"",
|
|
150
156
|
"--guidance reads one Contract's guidance instead of status. It accepts one Contract",
|
|
151
157
|
"selector or the installed Contract selection context, and refuses an Akuma, plural,",
|
|
152
158
|
"or world selection before the read.",
|
|
@@ -173,6 +179,7 @@ export const CONTRACT_COMMAND_SPECS = {
|
|
|
173
179
|
details: [
|
|
174
180
|
"--include-dirty checks all non-ignored worktree changes, staged or not.",
|
|
175
181
|
"--show-diff includes the proposed candidate diff when one can be prepared.",
|
|
182
|
+
"Verification runs only with the verified gate; without it the section is inert text.",
|
|
176
183
|
"Content identity names the change's content hash, never a commit; it survives rebase and Git cannot look it up.",
|
|
177
184
|
"Progress appears on stderr; stdout contains one final result.",
|
|
178
185
|
].join("\n"),
|
|
@@ -203,7 +210,7 @@ export const CONTRACT_COMMAND_SPECS = {
|
|
|
203
210
|
region: {
|
|
204
211
|
positional: "optional",
|
|
205
212
|
stdin: "none",
|
|
206
|
-
flags: { path: "repeat
|
|
213
|
+
flags: { path: "repeat", json: "boolean" },
|
|
207
214
|
usage: "region [<contract>]\nregion --path <pattern> [--path <pattern> ...]",
|
|
208
215
|
purpose: "Show declared Contract write patterns — all, one Contract's, or those overlapping given paths.",
|
|
209
216
|
details: "Check overlap before starting parallel work.",
|