@astrosheep/keiyaku 4.5.19 → 4.5.21
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 +4 -4
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku/SKILL.md +14 -7
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-akuma/SKILL.md +53 -20
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-akuma/references/automation.md +237 -0
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-bind/SKILL.md +6 -7
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-task/SKILL.md +2 -4
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-workflow/SKILL.md +3 -3
- package/build/src/akuma/akuma-handle.d.ts +5 -1
- package/build/src/akuma/akuma-handle.js +4 -1
- package/build/src/akuma/akuma-instance.d.ts +7 -2
- package/build/src/akuma/akuma-instance.js +14 -7
- package/build/src/akuma/akuma-observe.d.ts +11 -0
- package/build/src/akuma/akuma-observe.js +23 -0
- package/build/src/akuma/akuma-product.d.ts +2 -0
- package/build/src/akuma/akuma-product.js +6 -0
- package/build/src/akuma/akuma.d.ts +20 -1
- package/build/src/akuma/akuma.js +2 -0
- package/build/src/akuma/allowed.d.ts +20 -0
- package/build/src/akuma/allowed.js +11 -0
- package/build/src/akuma/archetype.js +3 -0
- package/build/src/akuma/body.d.ts +25 -5
- package/build/src/akuma/body.js +70 -31
- package/build/src/akuma/call-request.d.ts +5 -0
- package/build/src/akuma/call-request.js +14 -4
- package/build/src/akuma/fleet-execution.d.ts +28 -0
- package/build/src/akuma/fleet-execution.js +36 -4
- package/build/src/akuma/fleet-observation.d.ts +54 -0
- package/build/src/akuma/fleet-request.d.ts +10 -0
- package/build/src/akuma/fleet-request.js +13 -3
- package/build/src/akuma/heart/facts.d.ts +2 -0
- package/build/src/akuma/heart/index.d.ts +1 -0
- package/build/src/akuma/heart/index.js +4 -1
- package/build/src/akuma/heart/rows.d.ts +2 -0
- package/build/src/akuma/heart/rows.js +7 -5
- package/build/src/akuma/heart/schema.d.ts +1 -1
- package/build/src/akuma/heart/schema.js +3 -1
- package/build/src/akuma/heart/tells.js +6 -5
- package/build/src/akuma/heart/timeline.js +1 -1
- package/build/src/akuma/provider-recipe.d.ts +1 -0
- package/build/src/akuma/provider-recipe.js +5 -0
- package/build/src/akuma/provider.d.ts +1 -1
- package/build/src/akuma/provider.js +1 -1
- package/build/src/akuma/providers/acp/core.js +3 -6
- package/build/src/akuma/providers/acp/index.js +3 -0
- package/build/src/akuma/providers/claude/index.js +10 -10
- package/build/src/akuma/providers/codex-app-server/index.js +12 -11
- package/build/src/akuma/providers/execution-environment.d.ts +6 -0
- package/build/src/akuma/providers/execution-environment.js +24 -0
- package/build/src/akuma/providers/grok-build/index.js +3 -0
- package/build/src/akuma/providers/opencode-sdk/index.js +32 -23
- package/build/src/akuma/providers/opencode-sdk/session.d.ts +8 -1
- package/build/src/akuma/providers/opencode-sdk/session.js +6 -5
- package/build/src/akuma/providers/pi/events.js +7 -2
- package/build/src/akuma/providers/pi/index.js +5 -2
- package/build/src/akuma/request-observation.d.ts +45 -0
- package/build/src/akuma/request-observation.js +162 -0
- package/build/src/akuma/request-rendezvous.d.ts +6 -3
- package/build/src/akuma/request-rendezvous.js +80 -14
- package/build/src/akuma/request-serve.js +27 -4
- package/build/src/akuma/request-wire.d.ts +5 -0
- package/build/src/akuma/request-wire.js +2 -0
- package/build/src/akuma/turn-drive.d.ts +1 -0
- package/build/src/akuma/turn-drive.js +2 -0
- package/build/src/akuma-body.js +5 -0
- package/build/src/body/amend.js +6 -4
- package/build/src/body/decode.d.ts +3 -1
- package/build/src/body/decode.js +53 -17
- package/build/src/body/region.d.ts +9 -1
- package/build/src/body/region.js +87 -12
- package/build/src/body/render.js +1 -1
- package/build/src/body/verification.d.ts +3 -1
- package/build/src/body/verification.js +4 -1
- package/build/src/cli/accepted.js +19 -2
- package/build/src/cli/commands/akuma-invoke.d.ts +3 -1
- package/build/src/cli/commands/akuma-invoke.js +134 -14
- package/build/src/cli/commands/akuma.js +24 -12
- package/build/src/cli/commands/contract-help.d.ts +15 -15
- package/build/src/cli/commands/contract-help.js +45 -19
- package/build/src/cli/commands/contract-invoke.d.ts +3 -0
- package/build/src/cli/commands/contract-invoke.js +25 -11
- package/build/src/cli/commands/contract.js +6 -4
- package/build/src/cli/commands/install.d.ts +1 -1
- package/build/src/cli/commands/install.js +1 -1
- package/build/src/cli/commands/status-set.js +15 -24
- package/build/src/cli/commands/task.js +18 -18
- package/build/src/cli/invoke.d.ts +3 -0
- package/build/src/cli/invoke.js +58 -23
- package/build/src/cli/main.js +5 -0
- package/build/src/cli/parse.d.ts +3 -0
- package/build/src/cli/parse.js +26 -4
- package/build/src/cli/render/akuma-activity.d.ts +100 -2
- package/build/src/cli/render/akuma-activity.js +485 -40
- package/build/src/cli/render/akuma.d.ts +10 -0
- package/build/src/cli/render/akuma.js +31 -21
- package/build/src/cli/render/audit.js +1 -1
- package/build/src/cli/render/board.js +1 -1
- package/build/src/cli/render/catalog.js +16 -13
- package/build/src/cli/render/contract-history.js +39 -10
- package/build/src/cli/render/contract-observation.js +10 -6
- package/build/src/cli/render/contract.js +109 -106
- package/build/src/cli/render/execution-progress.d.ts +26 -0
- package/build/src/cli/render/execution-progress.js +178 -0
- package/build/src/cli/render/kanshi-akuma.js +27 -39
- package/build/src/cli/render/kanshi.js +33 -26
- package/build/src/cli/render/nuke.js +1 -1
- package/build/src/cli/render/receipt.d.ts +1 -1
- package/build/src/cli/render/receipt.js +6 -6
- package/build/src/cli/render/refusal.js +10 -7
- package/build/src/cli/render/region.js +1 -1
- package/build/src/cli/render/settings.js +12 -2
- package/build/src/cli/render/status-line.d.ts +30 -0
- package/build/src/cli/render/status-line.js +58 -0
- package/build/src/cli/render/status-set.js +1 -1
- package/build/src/cli/render/task.d.ts +2 -0
- package/build/src/cli/render/task.js +11 -7
- package/build/src/cli/render/terminal.d.ts +0 -1
- package/build/src/cli/render/terminal.js +47 -15
- package/build/src/cli/result.d.ts +1 -0
- package/build/src/cli/runtime.d.ts +2 -0
- package/build/src/cli/runtime.js +36 -4
- package/build/src/cli/usage.js +2 -2
- package/build/src/cli/version.d.ts +1 -0
- package/build/src/cli/version.js +25 -0
- package/build/src/git/hooks.d.ts +13 -1
- package/build/src/git/hooks.js +2 -1
- package/build/src/git/workspace.d.ts +1 -1
- package/build/src/git/workspace.js +1 -1
- package/build/src/identity/mint.d.ts +13 -0
- package/build/src/identity/mint.js +26 -0
- package/build/src/identity/normalize.d.ts +4 -0
- package/build/src/identity/normalize.js +30 -0
- package/build/src/index.d.ts +2 -0
- package/build/src/index.js +1 -0
- package/build/src/kanshi/read.js +17 -4
- package/build/src/kanshi/report.d.ts +1 -0
- package/build/src/library/akuma-creation.d.ts +2 -0
- package/build/src/library/akuma-creation.js +34 -18
- package/build/src/library/audit.d.ts +2 -0
- package/build/src/library/audit.js +1 -0
- package/build/src/library/bind.js +18 -16
- package/build/src/library/composition.d.ts +1 -0
- package/build/src/library/contract-bind.d.ts +3 -1
- package/build/src/library/contract-bind.js +5 -3
- package/build/src/library/contract-execution.d.ts +2 -0
- package/build/src/library/contract-execution.js +15 -1
- package/build/src/library/contract-forwarding.d.ts +4 -0
- package/build/src/library/contract-forwarding.js +3 -0
- package/build/src/library/contract-handle.d.ts +7 -0
- package/build/src/library/contract-handle.js +25 -0
- package/build/src/library/contract-operations.d.ts +7 -2
- package/build/src/library/contract-operations.js +21 -1
- package/build/src/library/contract-types.d.ts +1 -0
- package/build/src/library/execution-result.d.ts +2 -2
- package/build/src/library/execution.d.ts +8 -0
- package/build/src/library/execution.js +102 -0
- package/build/src/library/fleet.d.ts +4 -1
- package/build/src/library/fleet.js +32 -8
- package/build/src/library/keiyaku.d.ts +2 -0
- package/build/src/library/mutation.js +15 -7
- package/build/src/plugin/akuma-signals.d.ts +6 -0
- package/build/src/plugin/akuma-signals.js +9 -1
- package/build/src/plugin/public.d.ts +6 -2
- package/build/src/plugin/runtime.d.ts +1 -3
- package/build/src/plugin/runtime.js +95 -103
- package/build/src/protocol/amend.js +4 -3
- package/build/src/protocol/attempt.d.ts +2 -0
- package/build/src/protocol/bind.js +41 -14
- package/build/src/protocol/completion.d.ts +3 -0
- package/build/src/protocol/completion.js +35 -11
- package/build/src/protocol/deliver.js +165 -92
- package/build/src/protocol/execution-observation.d.ts +181 -0
- package/build/src/protocol/execution-observation.js +45 -0
- package/build/src/protocol/intent.d.ts +18 -22
- package/build/src/protocol/intent.js +63 -41
- package/build/src/protocol/operations.d.ts +2 -0
- package/build/src/protocol/placement.js +5 -1
- package/build/src/protocol/progress.d.ts +5 -1
- package/build/src/protocol/progress.js +10 -1
- package/build/src/protocol/read/status.d.ts +1 -0
- package/build/src/protocol/read/status.js +10 -2
- package/build/src/protocol/reintegrate.d.ts +1 -1
- package/build/src/protocol/reintegrate.js +70 -43
- package/build/src/protocol/result-codec.js +27 -11
- package/build/src/protocol/review.js +53 -30
- package/build/src/protocol/run.d.ts +83 -36
- package/build/src/protocol/run.js +90 -75
- package/build/src/runtime/proc/run.d.ts +16 -4
- package/build/src/runtime/proc/run.js +64 -22
- package/build/src/runtime/proc/windows-launch.exe +0 -0
- package/build/src/settings.js +5 -14
- package/build/src/task/document.d.ts +5 -1
- package/build/src/task/document.js +6 -1
- package/build/src/verification/execution.d.ts +10 -2
- package/build/src/verification/execution.js +143 -42
- package/build/src/verification/observation.d.ts +41 -0
- package/build/src/verification/observation.js +29 -0
- package/package.json +3 -1
|
@@ -1,11 +1,65 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
|
-
import {
|
|
2
|
+
import { squareAssignedParticipantName } from "@astrosheep/square";
|
|
3
|
+
import { emitInitiatingPluginSignal } from "../../plugin/akuma-signals.js";
|
|
4
|
+
import { observeAkumaStatus } from "../../akuma/akuma-observe.js";
|
|
5
|
+
import { AuthorityCorruptionError, Keiyaku, } from "../../index.js";
|
|
6
|
+
import { callObservationStream, waitObservationStream } from "../render/akuma-activity.js";
|
|
7
|
+
import { callObservationHead } from "../render/akuma.js";
|
|
3
8
|
import { killAkuma, tellAkuma, waitAkuma } from "../../library/fleet.js";
|
|
4
9
|
import { localExecutionContext } from "../../akuma/requests.js";
|
|
5
10
|
import { Akuma, Schema } from "../../akuma/index.js";
|
|
6
11
|
import { addressAkuma } from "../../library/address.js";
|
|
7
12
|
import { executionChannel } from "../../akuma/requests.js";
|
|
8
13
|
import { requestForwardedFleetTellAnswer } from "../../akuma/fleet-request.js";
|
|
14
|
+
/** The window a call observes for when the caller gives no `--wait` duration. */
|
|
15
|
+
const CALL_TIMEOUT_MS = 300_000;
|
|
16
|
+
function integrationFailure(error) {
|
|
17
|
+
return {
|
|
18
|
+
kind: error instanceof AuthorityCorruptionError ? "authority-corruption" : "infrastructure",
|
|
19
|
+
diagnostic: error instanceof Error ? error.message : String(error),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/** The display context the command result renders with, so live progress rows match the result. */
|
|
23
|
+
function resultContext() {
|
|
24
|
+
const tty = process.stderr.isTTY === true;
|
|
25
|
+
return {
|
|
26
|
+
columns: tty && Number.isInteger(process.stderr.columns) ? process.stderr.columns : 80,
|
|
27
|
+
color: tty && process.env.NO_COLOR === undefined,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function writeProgress(body) {
|
|
31
|
+
process.stderr.write(body.endsWith("\n") ? body : `${body}\n`);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The live half of an observe-mode call: the resolved birth opens one identity
|
|
35
|
+
* frame (never the detached receipt's cwd row), each later observation prints
|
|
36
|
+
* the settled rows that arrived since the previous one, and the return appends
|
|
37
|
+
* one conclusion. The stream is append-only, so no final snapshot replays.
|
|
38
|
+
*/
|
|
39
|
+
async function observeCallUntilComplete(command, input, born) {
|
|
40
|
+
const stream = callObservationStream(resultContext(), callObservationHead(born));
|
|
41
|
+
try {
|
|
42
|
+
const status = await observeAkumaStatus(input.path, born.akuma, {
|
|
43
|
+
timeoutMs: command.timeoutMs ?? CALL_TIMEOUT_MS,
|
|
44
|
+
observe: (observed) => {
|
|
45
|
+
const lines = stream.observe(observed);
|
|
46
|
+
if (lines.length > 0)
|
|
47
|
+
writeProgress(lines.join("\n"));
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
const conclusion = stream.conclude({ kind: "observed", status });
|
|
51
|
+
if (conclusion.length > 0)
|
|
52
|
+
writeProgress(conclusion);
|
|
53
|
+
return { kind: "observed", status };
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
const failure = integrationFailure(error);
|
|
57
|
+
const conclusion = stream.conclude({ kind: "failed", failure });
|
|
58
|
+
if (conclusion.length > 0)
|
|
59
|
+
writeProgress(conclusion);
|
|
60
|
+
return { kind: "failed", failure };
|
|
61
|
+
}
|
|
62
|
+
}
|
|
9
63
|
async function schemaFromFile(path) {
|
|
10
64
|
try {
|
|
11
65
|
const parsed = JSON.parse(await readFile(path, "utf8"));
|
|
@@ -21,21 +75,73 @@ function inputAlias(selector) {
|
|
|
21
75
|
async function promptBody(command, input) {
|
|
22
76
|
return command.prompt.kind === "stdin" ? await input.readStdin() : command.prompt.value;
|
|
23
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* The live half of a local wait: each observation round opens every newly seen
|
|
80
|
+
* Akuma with its identity frame, then prints only the rows that settled since
|
|
81
|
+
* the previous round. The first sighting of an Akuma only establishes its
|
|
82
|
+
* baseline, so an already settled Akuma prints no backlog rows. When the wait
|
|
83
|
+
* ends, `conclude` prints its closing scoreboard on the same channel.
|
|
84
|
+
*/
|
|
85
|
+
function waitObserver(stream) {
|
|
86
|
+
return {
|
|
87
|
+
selected: (selected) => stream.select(selected),
|
|
88
|
+
observe: (observed) => {
|
|
89
|
+
const lines = stream.observe(observed);
|
|
90
|
+
if (lines.length > 0)
|
|
91
|
+
writeProgress(lines.join("\n"));
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
}
|
|
24
95
|
async function invokeWait(command, input) {
|
|
25
96
|
const alias = command.akuma.length === 1 ? inputAlias(command.akuma[0]) : undefined;
|
|
97
|
+
const stream = command.output === "text" ? waitObservationStream(resultContext()) : undefined;
|
|
98
|
+
const result = await waitAkuma({
|
|
99
|
+
path: input.path,
|
|
100
|
+
akuma: command.akuma,
|
|
101
|
+
...(input.repo === undefined ? {} : { repo: input.repo }),
|
|
102
|
+
...(command.completion === undefined ? {} : { completion: command.completion }),
|
|
103
|
+
...(command.timeoutMs === undefined ? {} : { timeoutMs: command.timeoutMs }),
|
|
104
|
+
}, input.execution ?? localExecutionContext(), stream === undefined ? undefined : waitObserver(stream));
|
|
105
|
+
if (stream !== undefined && stream.streamed()) {
|
|
106
|
+
const closing = stream.conclude(result);
|
|
107
|
+
if (closing.length > 0)
|
|
108
|
+
writeProgress(closing);
|
|
109
|
+
return {
|
|
110
|
+
kind: "akuma",
|
|
111
|
+
action: "wait",
|
|
112
|
+
result,
|
|
113
|
+
streamed: true,
|
|
114
|
+
...(alias === undefined ? {} : { alias }),
|
|
115
|
+
};
|
|
116
|
+
}
|
|
26
117
|
return {
|
|
27
118
|
kind: "akuma",
|
|
28
119
|
action: "wait",
|
|
29
|
-
result
|
|
30
|
-
path: input.path,
|
|
31
|
-
akuma: command.akuma,
|
|
32
|
-
...(input.repo === undefined ? {} : { repo: input.repo }),
|
|
33
|
-
...(command.completion === undefined ? {} : { completion: command.completion }),
|
|
34
|
-
...(command.timeoutMs === undefined ? {} : { timeoutMs: command.timeoutMs }),
|
|
35
|
-
}, input.execution ?? localExecutionContext()),
|
|
120
|
+
result,
|
|
36
121
|
...(alias === undefined ? {} : { alias }),
|
|
37
122
|
};
|
|
38
123
|
}
|
|
124
|
+
async function inputInitiator(input) {
|
|
125
|
+
let initiator;
|
|
126
|
+
try {
|
|
127
|
+
initiator = squareAssignedParticipantName(input.environment);
|
|
128
|
+
}
|
|
129
|
+
catch { }
|
|
130
|
+
if (initiator === undefined)
|
|
131
|
+
return {};
|
|
132
|
+
try {
|
|
133
|
+
await emitInitiatingPluginSignal({
|
|
134
|
+
world: input.path,
|
|
135
|
+
...(input.settings === undefined ? {} : { settings: input.settings }),
|
|
136
|
+
initiator,
|
|
137
|
+
reportDiagnostic: (message) => process.stderr.write(`${message}\n`),
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
process.stderr.write(`! plugin initiation: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
142
|
+
}
|
|
143
|
+
return { initiator };
|
|
144
|
+
}
|
|
39
145
|
async function invokeTell(command, input) {
|
|
40
146
|
const body = await promptBody(command, input);
|
|
41
147
|
if (command.schema !== undefined) {
|
|
@@ -45,6 +151,7 @@ async function invokeTell(command, input) {
|
|
|
45
151
|
akuma: command.akuma,
|
|
46
152
|
...(input.repo === undefined ? {} : { repo: input.repo }),
|
|
47
153
|
});
|
|
154
|
+
const initiator = await inputInitiator(input);
|
|
48
155
|
const channel = executionChannel(input.execution);
|
|
49
156
|
const answer = channel.kind === "body-request"
|
|
50
157
|
? await requestForwardedFleetTellAnswer({
|
|
@@ -53,9 +160,11 @@ async function invokeTell(command, input) {
|
|
|
53
160
|
body,
|
|
54
161
|
schema,
|
|
55
162
|
interrupt: command.interrupt,
|
|
163
|
+
...initiator,
|
|
56
164
|
})
|
|
57
165
|
: await Akuma.select(addressed.path, addressed.id).tell(body, {
|
|
58
166
|
schema,
|
|
167
|
+
...initiator,
|
|
59
168
|
...(command.interrupt ? { interrupt: true } : {}),
|
|
60
169
|
});
|
|
61
170
|
const alias = inputAlias(command.akuma);
|
|
@@ -68,8 +177,10 @@ async function invokeTell(command, input) {
|
|
|
68
177
|
...(alias === undefined ? {} : { alias }),
|
|
69
178
|
};
|
|
70
179
|
}
|
|
180
|
+
const initiator = await inputInitiator(input);
|
|
71
181
|
if (command.interrupt) {
|
|
72
182
|
const result = await Keiyaku.interrupt({
|
|
183
|
+
...initiator,
|
|
73
184
|
path: input.path,
|
|
74
185
|
akuma: command.akuma,
|
|
75
186
|
body,
|
|
@@ -86,6 +197,7 @@ async function invokeTell(command, input) {
|
|
|
86
197
|
};
|
|
87
198
|
}
|
|
88
199
|
const result = await tellAkuma({
|
|
200
|
+
...initiator,
|
|
89
201
|
path: input.path,
|
|
90
202
|
akuma: command.akuma,
|
|
91
203
|
body,
|
|
@@ -151,24 +263,32 @@ export async function invokeAkuma(command, input) {
|
|
|
151
263
|
const body = await promptBody(command, input);
|
|
152
264
|
const schema = command.schema === undefined ? undefined : await schemaFromFile(command.schema);
|
|
153
265
|
const caller = input.execution === undefined ? Keiyaku : Keiyaku.withExecution({ execution: input.execution });
|
|
154
|
-
const
|
|
266
|
+
const request = {
|
|
267
|
+
...(await inputInitiator(input)),
|
|
155
268
|
path: input.path,
|
|
156
269
|
archetype: command.archetype,
|
|
157
270
|
body,
|
|
158
271
|
...(input.home === undefined ? {} : { home: input.home }),
|
|
159
272
|
...(input.settings === undefined ? {} : { settings: input.settings }),
|
|
160
|
-
...(input.
|
|
161
|
-
mode: command.mode,
|
|
162
|
-
...(command.timeoutMs === undefined ? {} : { timeoutMs: command.timeoutMs }),
|
|
273
|
+
...(input.executionCwd === undefined ? {} : { cwd: input.executionCwd }),
|
|
163
274
|
...(input.contract === undefined ? {} : { contract: input.contract }),
|
|
164
275
|
...(command.alias === undefined ? {} : { alias: command.alias }),
|
|
165
276
|
...(command.allowed === undefined ? {} : { allowed: command.allowed }),
|
|
166
277
|
...(schema === undefined ? {} : { schema }),
|
|
167
|
-
}
|
|
278
|
+
};
|
|
279
|
+
const observing = schema === undefined && command.mode === "wait" && command.output === "text";
|
|
280
|
+
const born = await caller.call(observing
|
|
281
|
+
? { ...request, mode: "detach" }
|
|
282
|
+
: {
|
|
283
|
+
...request,
|
|
284
|
+
mode: command.mode,
|
|
285
|
+
...(command.timeoutMs === undefined ? {} : { timeoutMs: command.timeoutMs }),
|
|
286
|
+
});
|
|
287
|
+
const result = observing ? { ...born, observation: await observeCallUntilComplete(command, input, born) } : born;
|
|
168
288
|
if (schema !== undefined && command.mode === "wait" && result.schemaAnswer !== undefined) {
|
|
169
289
|
return { kind: "akuma", action: "call", result, world: input.path, schemaAnswer: result.schemaAnswer };
|
|
170
290
|
}
|
|
171
|
-
return { kind: "akuma", action: "call", result, world: input.path };
|
|
291
|
+
return { kind: "akuma", action: "call", result, world: input.path, ...(observing ? { streamed: true } : {}) };
|
|
172
292
|
}
|
|
173
293
|
case "wait":
|
|
174
294
|
return await invokeWait(command, input);
|
|
@@ -2,7 +2,7 @@ import { CliUsageError, commandGuide, isBlankInput, usageLine } from "../usage.j
|
|
|
2
2
|
import { parseAkuId } from "../../akuma/identity.js";
|
|
3
3
|
import { parseDuration as decodeDuration } from "../../duration.js";
|
|
4
4
|
import { parseAkumaAlias, parseAkumaGlob } from "../../identity/selector.js";
|
|
5
|
-
import { decodeAllowedActions } from "../../akuma/allowed.js";
|
|
5
|
+
import { ALLOWED_ACTIONS, decodeAllowedActions } from "../../akuma/allowed.js";
|
|
6
6
|
import { parsePublicHistoryId } from "../../akuma/identity.js";
|
|
7
7
|
const AKUMA_COMMAND_SPECS = {
|
|
8
8
|
call: {
|
|
@@ -17,30 +17,45 @@ const AKUMA_COMMAND_SPECS = {
|
|
|
17
17
|
json: "boolean",
|
|
18
18
|
schema: "value",
|
|
19
19
|
},
|
|
20
|
-
usage: "call <akuma-name> [--contract <kei/...>] [--alias @name] [--allowed <product.action>]... [--schema <file>] [--wait <duration> | -d | --detach]
|
|
20
|
+
usage: "call <akuma-name> [--contract <kei/...>] [--workdir <path>] [--alias @name] [--allowed <product.action>]... [--schema <file>] [--wait <duration> | -d | --detach] (<prompt> | -)",
|
|
21
21
|
purpose: "Birth an Akuma from <akuma-name> with one prompt.",
|
|
22
22
|
details: [
|
|
23
23
|
"Give <prompt> as one argument, or use - to read stdin.",
|
|
24
24
|
"Default: --wait 5m. An explicit --wait replaces that duration; -d and --detach return after birth.",
|
|
25
25
|
"--contract dispatches the born Akuma to that Contract.",
|
|
26
|
+
"--workdir selects the execution directory; a relative path is relative to the invocation cwd.",
|
|
27
|
+
"Without --workdir, a Contract call uses its appointed worktree; an unassociated call uses the invocation cwd.",
|
|
26
28
|
"--alias assigns the world-local @name selector to the born Akuma.",
|
|
27
|
-
|
|
29
|
+
`Legal actions: ${ALLOWED_ACTIONS.join(", ")}.`,
|
|
30
|
+
"Repeated --allowed adds actions to the selected Akuma's defaults; it never narrows them.",
|
|
31
|
+
"An omitted Archetype default permits every legal action; an explicit empty default permits none.",
|
|
32
|
+
"A nested birth is clipped to its direct parent's frozen actions. status <aku/...|@alias> shows the born effective set.",
|
|
28
33
|
"--schema reads a JSON Schema file for the answer contract; stdin remains the prompt source.",
|
|
29
34
|
"With --contract, Dispatch succeeds first. If @name exists, the alias then moves.",
|
|
35
|
+
"While it waits, settled timeline rows stream on stderr; the final answer is written to stdout once.",
|
|
30
36
|
].join("\n"),
|
|
31
37
|
},
|
|
32
38
|
wait: {
|
|
33
39
|
arity: "one-or-more",
|
|
34
40
|
stdin: false,
|
|
35
41
|
flags: { any: "boolean", all: "boolean", timeout: "value", json: "boolean" },
|
|
36
|
-
usage: "wait <akuma-selector>... [--any | --all] [--timeout <duration>]
|
|
37
|
-
purpose: "Wait for one Akuma or
|
|
42
|
+
usage: "wait <akuma-selector>... [--any | --all] [--timeout <duration>]",
|
|
43
|
+
purpose: "Wait for one Akuma or a selected Akuma set.",
|
|
44
|
+
details: [
|
|
45
|
+
"Without --any or --all the mode is any: the wait returns when any selected Akuma completes.",
|
|
46
|
+
"--all waits until every selected Akuma completes.",
|
|
47
|
+
"An already completed member counts immediately, so repeating a selection can return at once.",
|
|
48
|
+
"Identity frames, settled rows, and the closing scoreboard stream on stderr.",
|
|
49
|
+
"A streamed plural wait leaves stdout empty, and so does a single wait with no answer.",
|
|
50
|
+
"Only a single selected Akuma that answered writes to stdout, exactly its answer.",
|
|
51
|
+
"With --json nothing streams and stdout carries the result document.",
|
|
52
|
+
].join("\n"),
|
|
38
53
|
},
|
|
39
54
|
tell: {
|
|
40
55
|
arity: 1,
|
|
41
56
|
stdin: true,
|
|
42
57
|
flags: { interrupt: "boolean", schema: "value", json: "boolean" },
|
|
43
|
-
usage: "tell <aku/...|@alias> [--interrupt] [--schema <file>]
|
|
58
|
+
usage: "tell <aku/...|@alias> [--interrupt] [--schema <file>] (<prompt> | -)",
|
|
44
59
|
purpose: "Send one prompt to an existing Akuma and wake it.",
|
|
45
60
|
details: [
|
|
46
61
|
"Give <prompt> as one argument, or use - to read stdin.",
|
|
@@ -52,21 +67,21 @@ const AKUMA_COMMAND_SPECS = {
|
|
|
52
67
|
arity: 1,
|
|
53
68
|
stdin: false,
|
|
54
69
|
flags: { id: "value", before: "value", since: "value", limit: "value", last: "boolean", json: "boolean" },
|
|
55
|
-
usage: "history <aku/...|@alias> [--id <historyId> | --before <index> | --since <index>] [--limit <count>] [--last]
|
|
70
|
+
usage: "history <aku/...|@alias> [--id <historyId> | --before <index> | --since <index>] [--limit <count>] [--last]\nhistory <kei/...>",
|
|
56
71
|
purpose: "Read Akuma execution history or one complete Contract journal and Dispatch timeline.",
|
|
57
72
|
},
|
|
58
73
|
fork: {
|
|
59
74
|
arity: 1,
|
|
60
75
|
stdin: false,
|
|
61
76
|
flags: { at: "value", json: "boolean" },
|
|
62
|
-
usage: "fork <aku/...|@alias> --at <historyId>
|
|
77
|
+
usage: "fork <aku/...|@alias> --at <historyId>",
|
|
63
78
|
purpose: "Fork one Akuma at a retained answered history point.",
|
|
64
79
|
},
|
|
65
80
|
kill: {
|
|
66
81
|
arity: "one-or-more",
|
|
67
82
|
stdin: false,
|
|
68
83
|
flags: { json: "boolean" },
|
|
69
|
-
usage: "kill <akuma-selector>...
|
|
84
|
+
usage: "kill <akuma-selector>...",
|
|
70
85
|
purpose: "Put down the current Body of an Akuma selector snapshot.",
|
|
71
86
|
},
|
|
72
87
|
};
|
|
@@ -194,9 +209,6 @@ function validateSet(value, fail) {
|
|
|
194
209
|
function parseWait(rawSelectors, flags, output, fail) {
|
|
195
210
|
if (flags.any === true && flags.all === true)
|
|
196
211
|
fail("wait --any and --all are mutually exclusive");
|
|
197
|
-
if (rawSelectors.length > 1 && flags.any !== true && flags.all !== true) {
|
|
198
|
-
fail("wait requires --any or --all when selecting multiple Akuma");
|
|
199
|
-
}
|
|
200
212
|
const completion = flags.any === true ? "any" : flags.all === true ? "all" : undefined;
|
|
201
213
|
return {
|
|
202
214
|
command: "wait",
|
|
@@ -20,7 +20,7 @@ export declare const CONTRACT_COMMAND_SPECS: {
|
|
|
20
20
|
readonly "fork-of": "value";
|
|
21
21
|
readonly json: "boolean";
|
|
22
22
|
};
|
|
23
|
-
readonly usage: "bind [--task <task/...>] [--target <ref>] [--after <kei/...> ...] [--gates <name,...>] [--actor <actor>]
|
|
23
|
+
readonly usage: "bind [--task <task/...>] [--target <ref>] [--after <kei/...> ...] [--gates <name,...>] [--actor <actor>] - | bind --fork-of <kei/...> [--target <ref>] [--actor <actor>]";
|
|
24
24
|
readonly purpose: "Create one Contract from stdin Markdown or a sibling fork.";
|
|
25
25
|
readonly details: string;
|
|
26
26
|
};
|
|
@@ -34,7 +34,7 @@ export declare const CONTRACT_COMMAND_SPECS: {
|
|
|
34
34
|
readonly gates: "raw-value";
|
|
35
35
|
readonly json: "boolean";
|
|
36
36
|
};
|
|
37
|
-
readonly usage: "amend [<contract>|@<contract>] [--after <kei/...> ... | --clear-after] [--gates <name,...>] [--actor <actor>] [
|
|
37
|
+
readonly usage: "amend [<contract>|@<contract>] [--after <kei/...> ... | --clear-after] [--gates <name,...>] [--actor <actor>] [-]";
|
|
38
38
|
readonly purpose: "Amend one Contract's document operations or structured terms.";
|
|
39
39
|
readonly details: string;
|
|
40
40
|
};
|
|
@@ -48,7 +48,7 @@ export declare const CONTRACT_COMMAND_SPECS: {
|
|
|
48
48
|
readonly overwrite: "boolean";
|
|
49
49
|
readonly json: "boolean";
|
|
50
50
|
};
|
|
51
|
-
readonly usage: "deliver [<contract>|@<contract>] [--message <text>] [--include-dirty] [--materialize-conflict] [--overwrite]
|
|
51
|
+
readonly usage: "deliver [<contract>|@<contract>] [--message <text>] [--include-dirty] [--materialize-conflict] [--overwrite]";
|
|
52
52
|
readonly purpose: "Deliver your work as this Contract's candidate.";
|
|
53
53
|
readonly details: string;
|
|
54
54
|
};
|
|
@@ -61,7 +61,7 @@ export declare const CONTRACT_COMMAND_SPECS: {
|
|
|
61
61
|
readonly summary: "value";
|
|
62
62
|
readonly json: "boolean";
|
|
63
63
|
};
|
|
64
|
-
readonly usage: "review [<contract>|@<contract>] (--satisfied | --unsatisfied) (--summary <text> | -)
|
|
64
|
+
readonly usage: "review [<contract>|@<contract>] (--satisfied | --unsatisfied) (--summary <text> | -)";
|
|
65
65
|
readonly purpose: "Record one review verdict over this Contract's current subject.";
|
|
66
66
|
readonly details: string;
|
|
67
67
|
};
|
|
@@ -72,7 +72,7 @@ export declare const CONTRACT_COMMAND_SPECS: {
|
|
|
72
72
|
readonly actor: "value";
|
|
73
73
|
readonly json: "boolean";
|
|
74
74
|
};
|
|
75
|
-
readonly usage: "arc [<contract>|@<contract>] [--actor <actor>]
|
|
75
|
+
readonly usage: "arc [<contract>|@<contract>] [--actor <actor>] -";
|
|
76
76
|
readonly purpose: "Record stdin arc Markdown for one Contract.";
|
|
77
77
|
};
|
|
78
78
|
readonly abandon: {
|
|
@@ -83,7 +83,7 @@ export declare const CONTRACT_COMMAND_SPECS: {
|
|
|
83
83
|
readonly note: "value";
|
|
84
84
|
readonly json: "boolean";
|
|
85
85
|
};
|
|
86
|
-
readonly usage: "abandon [<contract>|@<contract>] [--note <text>] [--actor <actor>]
|
|
86
|
+
readonly usage: "abandon [<contract>|@<contract>] [--note <text>] [--actor <actor>]";
|
|
87
87
|
readonly purpose: "Abandon one Contract with an optional note.";
|
|
88
88
|
};
|
|
89
89
|
readonly status: {
|
|
@@ -92,7 +92,7 @@ export declare const CONTRACT_COMMAND_SPECS: {
|
|
|
92
92
|
readonly flags: {
|
|
93
93
|
readonly json: "boolean";
|
|
94
94
|
};
|
|
95
|
-
readonly usage: "status [<contract>|@name|<aku/...>]...
|
|
95
|
+
readonly usage: "status [<contract>|@name|<aku/...>]...";
|
|
96
96
|
readonly purpose: "Read the world status board or one or more Contract and Akuma projections.";
|
|
97
97
|
};
|
|
98
98
|
readonly show: {
|
|
@@ -101,7 +101,7 @@ export declare const CONTRACT_COMMAND_SPECS: {
|
|
|
101
101
|
readonly flags: {
|
|
102
102
|
readonly json: "boolean";
|
|
103
103
|
};
|
|
104
|
-
readonly usage: "show [<contract>|@<contract>]
|
|
104
|
+
readonly usage: "show [<contract>|@<contract>]";
|
|
105
105
|
readonly purpose: "Read one Contract guidance projection.";
|
|
106
106
|
};
|
|
107
107
|
readonly ls: {
|
|
@@ -111,7 +111,7 @@ export declare const CONTRACT_COMMAND_SPECS: {
|
|
|
111
111
|
readonly limit: "value";
|
|
112
112
|
readonly json: "boolean";
|
|
113
113
|
};
|
|
114
|
-
readonly usage: "ls task[/] [--limit <count>]
|
|
114
|
+
readonly usage: "ls task[/] [--limit <count>]\nls kei[/] [--limit <count>]\nls aku[/]\nls aku/<akuma>[/] [--limit <count>]\nls \"aku/*/*\" [--limit <count>]";
|
|
115
115
|
readonly purpose: "List one identity directory.";
|
|
116
116
|
};
|
|
117
117
|
readonly audit: {
|
|
@@ -122,8 +122,8 @@ export declare const CONTRACT_COMMAND_SPECS: {
|
|
|
122
122
|
readonly diff: "boolean";
|
|
123
123
|
readonly json: "boolean";
|
|
124
124
|
};
|
|
125
|
-
readonly usage: "audit [<contract>|@<contract>] [--include-dirty] [--diff]
|
|
126
|
-
readonly purpose: "Ask what candidate preparation, Verification, and target placement would do.";
|
|
125
|
+
readonly usage: "audit [<contract>|@<contract>] [--include-dirty] [--diff]";
|
|
126
|
+
readonly purpose: "Ask what candidate preparation, Verification, and target placement would do; progress is on stderr.";
|
|
127
127
|
};
|
|
128
128
|
readonly reconcile: {
|
|
129
129
|
readonly positional: "optional";
|
|
@@ -132,7 +132,7 @@ export declare const CONTRACT_COMMAND_SPECS: {
|
|
|
132
132
|
readonly "retry-hooks": "boolean";
|
|
133
133
|
readonly json: "boolean";
|
|
134
134
|
};
|
|
135
|
-
readonly usage: "reconcile [<contract>|@<contract>] [--retry-hooks]
|
|
135
|
+
readonly usage: "reconcile [<contract>|@<contract>] [--retry-hooks]";
|
|
136
136
|
readonly purpose: "Reconcile one Contract or the invocation world.";
|
|
137
137
|
};
|
|
138
138
|
readonly nuke: {
|
|
@@ -142,7 +142,7 @@ export declare const CONTRACT_COMMAND_SPECS: {
|
|
|
142
142
|
readonly confirm: "value";
|
|
143
143
|
readonly json: "boolean";
|
|
144
144
|
};
|
|
145
|
-
readonly usage: "nuke [--confirm <WorldRoot>]
|
|
145
|
+
readonly usage: "nuke [--confirm <WorldRoot>]";
|
|
146
146
|
readonly purpose: "Remove Keiyaku-owned data from one confirmed World.";
|
|
147
147
|
};
|
|
148
148
|
readonly settings: {
|
|
@@ -151,7 +151,7 @@ export declare const CONTRACT_COMMAND_SPECS: {
|
|
|
151
151
|
readonly flags: {
|
|
152
152
|
readonly json: "boolean";
|
|
153
153
|
};
|
|
154
|
-
readonly usage: "settings
|
|
154
|
+
readonly usage: "settings";
|
|
155
155
|
readonly purpose: "Show effective Settings (user + project, read-only)";
|
|
156
156
|
};
|
|
157
157
|
readonly region: {
|
|
@@ -161,7 +161,7 @@ export declare const CONTRACT_COMMAND_SPECS: {
|
|
|
161
161
|
readonly path: "repeat-value";
|
|
162
162
|
readonly json: "boolean";
|
|
163
163
|
};
|
|
164
|
-
readonly usage: "region [<contract>]
|
|
164
|
+
readonly usage: "region [<contract>]\nregion --path <pattern> [--path <pattern> ...]";
|
|
165
165
|
readonly purpose: "Read active declared Contract Regions.";
|
|
166
166
|
};
|
|
167
167
|
};
|
|
@@ -12,21 +12,29 @@ export const CONTRACT_COMMAND_SPECS = {
|
|
|
12
12
|
"fork-of": "value",
|
|
13
13
|
json: "boolean",
|
|
14
14
|
},
|
|
15
|
-
usage: "bind [--task <task/...>] [--target <ref>] [--after <kei/...> ...] [--gates <name,...>] [--actor <actor>]
|
|
15
|
+
usage: "bind [--task <task/...>] [--target <ref>] [--after <kei/...> ...] [--gates <name,...>] [--actor <actor>] - | bind --fork-of <kei/...> [--target <ref>] [--actor <actor>]",
|
|
16
16
|
purpose: "Create one Contract from stdin Markdown or a sibling fork.",
|
|
17
17
|
details: [
|
|
18
|
+
"--gates <name,...> accepts gate words and configured bundle names together.",
|
|
19
|
+
"A matching bundle expands; otherwise the name is a literal gate. Duplicates",
|
|
20
|
+
"are removed in first-seen order. Gate words match ^[a-z][a-z0-9-]{0,63}$.",
|
|
21
|
+
"Omitting --gates selects gates.default, or reviewed when no default exists.",
|
|
22
|
+
'--gates "" explicitly binds without gates; --gates reviewed needs no bundle.',
|
|
23
|
+
"",
|
|
18
24
|
"stdin is Contract Markdown:",
|
|
19
25
|
" # <title>",
|
|
20
26
|
" ## Context motivation, authority, baseline, and boundaries",
|
|
21
27
|
" ## Objective one observable end state",
|
|
22
28
|
" ## Design closed decisions and ordering",
|
|
23
|
-
" ## Region
|
|
29
|
+
" ## Region intended path patterns as fenced lines, list items, or bare lines",
|
|
24
30
|
" ## Criteria one or more ### <criterion> entries",
|
|
25
31
|
" ## Verification optional fenced executor declarations",
|
|
26
32
|
"",
|
|
27
|
-
"Region
|
|
28
|
-
"repository-relative path pattern on
|
|
29
|
-
"is directory shorthand for 'path/**'.",
|
|
33
|
+
"Region accepts intended path patterns as fenced lines, list items, or bare",
|
|
34
|
+
"lines; the three forms union. Put one repository-relative path pattern on",
|
|
35
|
+
"each nonblank line. A trailing '/' is directory shorthand for 'path/**'.",
|
|
36
|
+
"A pattern containing whitespace binds with a warning. A fence carries no",
|
|
37
|
+
"info string or exactly 'txt'.",
|
|
30
38
|
"",
|
|
31
39
|
"Verification uses one or more closed bash, zsh, or pwsh fences. Its fence",
|
|
32
40
|
"may add timeout=<integer><ms|s|m|h>; the section contains no other prose.",
|
|
@@ -37,9 +45,14 @@ export const CONTRACT_COMMAND_SPECS = {
|
|
|
37
45
|
positional: "optional",
|
|
38
46
|
stdin: "optional",
|
|
39
47
|
flags: { actor: "value", after: "repeat-value", "clear-after": "boolean", gates: "raw-value", json: "boolean" },
|
|
40
|
-
usage: "amend [<contract>|@<contract>] [--after <kei/...> ... | --clear-after] [--gates <name,...>] [--actor <actor>] [
|
|
48
|
+
usage: "amend [<contract>|@<contract>] [--after <kei/...> ... | --clear-after] [--gates <name,...>] [--actor <actor>] [-]",
|
|
41
49
|
purpose: "Amend one Contract's document operations or structured terms.",
|
|
42
50
|
details: [
|
|
51
|
+
"--gates <name,...> replaces gates using gate words and configured bundle names.",
|
|
52
|
+
"A matching bundle expands; otherwise the name is a literal gate. Duplicates",
|
|
53
|
+
"are removed in first-seen order. Gate words match ^[a-z][a-z0-9-]{0,63}$.",
|
|
54
|
+
'Omitting --gates leaves gates unchanged; --gates "" clears them.',
|
|
55
|
+
"",
|
|
43
56
|
" ## Context|Objective|Design|Region|Criteria|Verification|<extension> (replace, or add new extension)",
|
|
44
57
|
" ## Replace: Context|Objective|Design|Region|Criteria|Verification|<extension>",
|
|
45
58
|
" ## Append: Context|Objective|Design|Criteria|<extension>",
|
|
@@ -58,13 +71,14 @@ export const CONTRACT_COMMAND_SPECS = {
|
|
|
58
71
|
overwrite: "boolean",
|
|
59
72
|
json: "boolean",
|
|
60
73
|
},
|
|
61
|
-
usage: "deliver [<contract>|@<contract>] [--message <text>] [--include-dirty] [--materialize-conflict] [--overwrite]
|
|
74
|
+
usage: "deliver [<contract>|@<contract>] [--message <text>] [--include-dirty] [--materialize-conflict] [--overwrite]",
|
|
62
75
|
purpose: "Deliver your work as this Contract's candidate.",
|
|
63
76
|
details: [
|
|
64
77
|
"The subject is the whole Contract. An Arc names the chapter you are in — it",
|
|
65
78
|
"frames the work, it never shrinks what the Contract accepts. Finishing a chapter",
|
|
66
79
|
"is progress; deliver is the different claim that the worktree, as it stands, is",
|
|
67
80
|
"the Contract's candidate.",
|
|
81
|
+
"Verification, placement, and cleanup progress is printed to stderr; stdout stays one final text or JSON result.",
|
|
68
82
|
"",
|
|
69
83
|
"A clean worktree delivers its HEAD. --include-dirty captures the complete final",
|
|
70
84
|
"non-ignored worktree bytes through a private index, even while the shared index",
|
|
@@ -103,7 +117,7 @@ export const CONTRACT_COMMAND_SPECS = {
|
|
|
103
117
|
positional: "optional",
|
|
104
118
|
stdin: "optional",
|
|
105
119
|
flags: { satisfied: "boolean", unsatisfied: "boolean", summary: "value", json: "boolean" },
|
|
106
|
-
usage: "review [<contract>|@<contract>] (--satisfied | --unsatisfied) (--summary <text> | -)
|
|
120
|
+
usage: "review [<contract>|@<contract>] (--satisfied | --unsatisfied) (--summary <text> | -)",
|
|
107
121
|
purpose: "Record one review verdict over this Contract's current subject.",
|
|
108
122
|
details: [
|
|
109
123
|
"You are judging the whole Contract, not the current Arc. The subject is whatever",
|
|
@@ -126,76 +140,77 @@ export const CONTRACT_COMMAND_SPECS = {
|
|
|
126
140
|
"--summary is your testimony, not decoration. Satisfied: the conclusion that the",
|
|
127
141
|
"whole Contract is complete, and the evidence it rests on. Unsatisfied: the specific",
|
|
128
142
|
"blocker, missing evidence, or unmet term.",
|
|
143
|
+
"Confirmed admission and later work are shown on stderr; stdout remains one final result.",
|
|
129
144
|
].join("\n"),
|
|
130
145
|
},
|
|
131
146
|
arc: {
|
|
132
147
|
positional: "optional",
|
|
133
148
|
stdin: "required",
|
|
134
149
|
flags: { actor: "value", json: "boolean" },
|
|
135
|
-
usage: "arc [<contract>|@<contract>] [--actor <actor>]
|
|
150
|
+
usage: "arc [<contract>|@<contract>] [--actor <actor>] -",
|
|
136
151
|
purpose: "Record stdin arc Markdown for one Contract.",
|
|
137
152
|
},
|
|
138
153
|
abandon: {
|
|
139
154
|
positional: "optional",
|
|
140
155
|
stdin: "none",
|
|
141
156
|
flags: { actor: "value", note: "value", json: "boolean" },
|
|
142
|
-
usage: "abandon [<contract>|@<contract>] [--note <text>] [--actor <actor>]
|
|
157
|
+
usage: "abandon [<contract>|@<contract>] [--note <text>] [--actor <actor>]",
|
|
143
158
|
purpose: "Abandon one Contract with an optional note.",
|
|
144
159
|
},
|
|
145
160
|
status: {
|
|
146
161
|
positional: "optional",
|
|
147
162
|
stdin: "none",
|
|
148
163
|
flags: { json: "boolean" },
|
|
149
|
-
usage: "status [<contract>|@name|<aku/...>]...
|
|
164
|
+
usage: "status [<contract>|@name|<aku/...>]...",
|
|
150
165
|
purpose: "Read the world status board or one or more Contract and Akuma projections.",
|
|
151
166
|
},
|
|
152
167
|
show: {
|
|
153
168
|
positional: "optional",
|
|
154
169
|
stdin: "none",
|
|
155
170
|
flags: { json: "boolean" },
|
|
156
|
-
usage: "show [<contract>|@<contract>]
|
|
171
|
+
usage: "show [<contract>|@<contract>]",
|
|
157
172
|
purpose: "Read one Contract guidance projection.",
|
|
158
173
|
},
|
|
159
174
|
ls: {
|
|
160
175
|
positional: "optional",
|
|
161
176
|
stdin: "none",
|
|
162
177
|
flags: { limit: "value", json: "boolean" },
|
|
163
|
-
usage: 'ls task[/] [--limit <count>]
|
|
178
|
+
usage: 'ls task[/] [--limit <count>]\nls kei[/] [--limit <count>]\nls aku[/]\nls aku/<akuma>[/] [--limit <count>]\nls "aku/*/*" [--limit <count>]',
|
|
164
179
|
purpose: "List one identity directory.",
|
|
165
180
|
},
|
|
166
181
|
audit: {
|
|
167
182
|
positional: "optional",
|
|
168
183
|
stdin: "none",
|
|
169
184
|
flags: { "include-dirty": "boolean", diff: "boolean", json: "boolean" },
|
|
170
|
-
usage: "audit [<contract>|@<contract>] [--include-dirty] [--diff]
|
|
171
|
-
purpose: "Ask what candidate preparation, Verification, and target placement would do.",
|
|
185
|
+
usage: "audit [<contract>|@<contract>] [--include-dirty] [--diff]",
|
|
186
|
+
purpose: "Ask what candidate preparation, Verification, and target placement would do; progress is on stderr.",
|
|
172
187
|
},
|
|
173
188
|
reconcile: {
|
|
174
189
|
positional: "optional",
|
|
175
190
|
stdin: "none",
|
|
176
191
|
flags: { "retry-hooks": "boolean", json: "boolean" },
|
|
177
|
-
usage: "reconcile [<contract>|@<contract>] [--retry-hooks]
|
|
192
|
+
usage: "reconcile [<contract>|@<contract>] [--retry-hooks]",
|
|
178
193
|
purpose: "Reconcile one Contract or the invocation world.",
|
|
179
194
|
},
|
|
180
195
|
nuke: {
|
|
181
196
|
positional: "none",
|
|
182
197
|
stdin: "none",
|
|
183
198
|
flags: { confirm: "value", json: "boolean" },
|
|
184
|
-
usage: "nuke [--confirm <WorldRoot>]
|
|
199
|
+
usage: "nuke [--confirm <WorldRoot>]",
|
|
185
200
|
purpose: "Remove Keiyaku-owned data from one confirmed World.",
|
|
186
201
|
},
|
|
187
202
|
settings: {
|
|
188
203
|
positional: "none",
|
|
189
204
|
stdin: "none",
|
|
190
205
|
flags: { json: "boolean" },
|
|
191
|
-
usage: "settings
|
|
206
|
+
usage: "settings",
|
|
192
207
|
purpose: "Show effective Settings (user + project, read-only)",
|
|
193
208
|
},
|
|
194
209
|
region: {
|
|
195
210
|
positional: "optional",
|
|
196
211
|
stdin: "none",
|
|
197
212
|
flags: { path: "repeat-value", json: "boolean" },
|
|
198
|
-
usage: "region [<contract>]
|
|
213
|
+
usage: "region [<contract>]\nregion --path <pattern> [--path <pattern> ...]",
|
|
199
214
|
purpose: "Read active declared Contract Regions.",
|
|
200
215
|
},
|
|
201
216
|
};
|
|
@@ -220,6 +235,17 @@ export function renderContractHelp(command) {
|
|
|
220
235
|
"Each entry is validated by the feature that reads it. A rejected",
|
|
221
236
|
"value's diagnostic states the expected shape.",
|
|
222
237
|
"",
|
|
238
|
+
"Akuma definitions are Markdown files, one per name:",
|
|
239
|
+
" user ~/.keiyaku/akuma/<name>.md",
|
|
240
|
+
" project <WorldRoot>/.keiyaku/akuma/<name>.md",
|
|
241
|
+
"A project file wholly shadows the same-name user file. YAML",
|
|
242
|
+
"frontmatter selects the provider and may declare base, model,",
|
|
243
|
+
"effort, readonly, network, sandbox, allowed, systemPromptMode, and",
|
|
244
|
+
"description; the body is an optional system prompt. sandbox:",
|
|
245
|
+
"full-access disables a supporting provider's native command",
|
|
246
|
+
"sandbox for future births; it grants no extra operating-system",
|
|
247
|
+
"permissions and cannot combine with readonly or network: disabled.",
|
|
248
|
+
"",
|
|
223
249
|
usageLine(spec.usage),
|
|
224
250
|
].join("\n");
|
|
225
251
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ExecutionEvent } from "../../library/execution.js";
|
|
1
2
|
import type { InvocationResult } from "../result.js";
|
|
2
3
|
import type { ParsedCommand } from "../parse.js";
|
|
3
4
|
import type { WorktreeHooks } from "../../library/configuration.js";
|
|
@@ -11,6 +12,8 @@ type ContractMutation = Extract<ParsedCommand, {
|
|
|
11
12
|
type InvocationEdge = Readonly<{
|
|
12
13
|
environment: NodeJS.ProcessEnv;
|
|
13
14
|
readStdin: () => Promise<string>;
|
|
15
|
+
signal?: AbortSignal;
|
|
16
|
+
progress?: (events: AsyncIterable<ExecutionEvent>) => Promise<void>;
|
|
14
17
|
}>;
|
|
15
18
|
export type ContractMutationInput = Readonly<{
|
|
16
19
|
parsed: ContractMutation;
|