@astrosheep/keiyaku 4.0.1 → 4.0.2
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 +137 -5
- package/build/integrations/marketplace/plugins/keiyaku/.claude-plugin/plugin.json +1 -1
- package/build/integrations/marketplace/plugins/keiyaku/.codex-plugin/plugin.json +1 -1
- package/build/integrations/marketplace/plugins/keiyaku/package.json +1 -1
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku/SKILL.md +3 -3
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-akuma/SKILL.md +91 -35
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-bind/SKILL.md +98 -58
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-workflow/SKILL.md +152 -53
- package/build/src/akuma/abort.d.ts +2 -0
- package/build/src/akuma/abort.js +50 -0
- package/build/src/akuma/akuma.d.ts +23 -14
- package/build/src/akuma/akuma.js +120 -104
- package/build/src/akuma/archetype.d.ts +7 -6
- package/build/src/akuma/archetype.js +68 -41
- package/build/src/akuma/body.d.ts +3 -5
- package/build/src/akuma/body.js +408 -213
- package/build/src/akuma/heart/facts.d.ts +25 -34
- package/build/src/akuma/heart/facts.js +18 -7
- package/build/src/akuma/heart/index.d.ts +39 -42
- package/build/src/akuma/heart/index.js +134 -93
- package/build/src/akuma/heart/rows.d.ts +9 -31
- package/build/src/akuma/heart/rows.js +26 -44
- package/build/src/akuma/heart/schema.d.ts +1 -1
- package/build/src/akuma/heart/schema.js +7 -15
- package/build/src/akuma/heart/soul.d.ts +8 -0
- package/build/src/akuma/heart/soul.js +136 -0
- package/build/src/akuma/heart/storage.d.ts +28 -14
- package/build/src/akuma/heart/storage.js +86 -26
- package/build/src/akuma/identity.d.ts +2 -2
- package/build/src/akuma/identity.js +9 -9
- package/build/src/akuma/index.d.ts +6 -1
- package/build/src/akuma/index.js +6 -0
- package/build/src/akuma/projection.d.ts +117 -38
- package/build/src/akuma/projection.js +208 -97
- package/build/src/akuma/provider-recipe.d.ts +24 -0
- package/build/src/akuma/provider-recipe.js +100 -0
- package/build/src/akuma/provider.d.ts +12 -4
- package/build/src/akuma/provider.js +117 -70
- package/build/src/akuma/providers/acp/core.d.ts +19 -0
- package/build/src/akuma/providers/acp/core.js +159 -0
- package/build/src/akuma/providers/acp/events.d.ts +20 -0
- package/build/src/akuma/providers/acp/events.js +73 -0
- package/build/src/akuma/providers/acp/index.d.ts +12 -0
- package/build/src/akuma/providers/acp/index.js +94 -0
- package/build/src/akuma/providers/claude/events.js +66 -13
- package/build/src/akuma/providers/claude/index.d.ts +2 -1
- package/build/src/akuma/providers/claude/index.js +35 -21
- package/build/src/akuma/providers/codex-app-server/events.js +4 -1
- package/build/src/akuma/providers/codex-app-server/index.d.ts +3 -3
- package/build/src/akuma/providers/codex-app-server/index.js +24 -31
- package/build/src/akuma/providers/grok-build/index.d.ts +4 -0
- package/build/src/akuma/providers/grok-build/index.js +70 -0
- package/build/src/akuma/providers/index.d.ts +5 -3
- package/build/src/akuma/providers/index.js +24 -59
- package/build/src/akuma/providers/opencode-sdk/events.d.ts +40 -34
- package/build/src/akuma/providers/opencode-sdk/events.js +220 -101
- package/build/src/akuma/providers/opencode-sdk/index.d.ts +3 -2
- package/build/src/akuma/providers/opencode-sdk/index.js +233 -128
- package/build/src/akuma/providers/opencode-sdk/session.d.ts +11 -26
- package/build/src/akuma/providers/opencode-sdk/session.js +10 -9
- package/build/src/akuma/providers/pi/events.js +49 -11
- package/build/src/akuma/providers/pi/index.d.ts +1 -1
- package/build/src/akuma/providers/pi/index.js +50 -21
- package/build/src/akuma/publication.d.ts +3 -3
- package/build/src/akuma/publication.js +28 -40
- package/build/src/akuma/requests.d.ts +9 -7
- package/build/src/akuma/requests.js +92 -65
- package/build/src/alias/index.d.ts +2 -2
- package/build/src/alias/index.js +10 -10
- package/build/src/body/decode.js +7 -1
- package/build/src/body/region.d.ts +2 -0
- package/build/src/body/region.js +77 -7
- package/build/src/cli/accepted.d.ts +17 -13
- package/build/src/cli/accepted.js +72 -34
- package/build/src/cli/actor.js +3 -3
- package/build/src/cli/commands/akuma-invoke.d.ts +4 -3
- package/build/src/cli/commands/akuma-invoke.js +14 -9
- package/build/src/cli/commands/akuma.d.ts +13 -3
- package/build/src/cli/commands/akuma.js +67 -34
- package/build/src/cli/commands/contract.d.ts +18 -5
- package/build/src/cli/commands/contract.js +9 -3
- package/build/src/cli/commands/task-invoke.d.ts +17 -4
- package/build/src/cli/commands/task-invoke.js +43 -20
- package/build/src/cli/commands/task-query.d.ts +5 -0
- package/build/src/cli/commands/task-query.js +247 -0
- package/build/src/cli/commands/task.d.ts +3 -1
- package/build/src/cli/commands/task.js +51 -13
- package/build/src/cli/coordinates.d.ts +18 -0
- package/build/src/cli/coordinates.js +120 -0
- package/build/src/cli/draft.d.ts +8 -0
- package/build/src/cli/draft.js +96 -0
- package/build/src/cli/invoke.d.ts +4 -3
- package/build/src/cli/invoke.js +160 -179
- package/build/src/cli/main.js +34 -6
- package/build/src/cli/parse.d.ts +9 -2
- package/build/src/cli/parse.js +29 -7
- package/build/src/cli/render/akuma-tool-command.d.ts +6 -0
- package/build/src/cli/render/akuma-tool-command.js +144 -0
- package/build/src/cli/render/akuma-tool.d.ts +2 -2
- package/build/src/cli/render/akuma-tool.js +30 -4
- package/build/src/cli/render/akuma.d.ts +1 -0
- package/build/src/cli/render/akuma.js +211 -116
- package/build/src/cli/render/audit.d.ts +3 -0
- package/build/src/cli/render/audit.js +104 -0
- package/build/src/cli/render/contract.d.ts +3 -3
- package/build/src/cli/render/contract.js +192 -79
- package/build/src/cli/render/kanshi.js +263 -168
- package/build/src/cli/render/receipt.d.ts +19 -0
- package/build/src/cli/render/receipt.js +106 -0
- package/build/src/cli/render/refusal.d.ts +16 -2
- package/build/src/cli/render/refusal.js +88 -20
- package/build/src/cli/render/region.d.ts +2 -0
- package/build/src/cli/render/region.js +17 -0
- package/build/src/cli/render/task.d.ts +2 -1
- package/build/src/cli/render/task.js +223 -60
- package/build/src/cli/render/terminal.d.ts +7 -0
- package/build/src/cli/render/terminal.js +46 -0
- package/build/src/cli/render/text.js +6 -3
- package/build/src/cli/result.d.ts +115 -20
- package/build/src/cli/usage.d.ts +1 -0
- package/build/src/cli/usage.js +3 -0
- package/build/src/contract-worktree.d.ts +6 -5
- package/build/src/contract-worktree.js +95 -57
- package/build/src/coordination/durable-file.d.ts +4 -3
- package/build/src/coordination/durable-file.js +29 -25
- package/build/src/coordination/sqlite-transaction-lock.d.ts +4 -0
- package/build/src/coordination/sqlite-transaction-lock.js +22 -5
- package/build/src/core/facts/fold.js +1 -6
- package/build/src/core/facts/gate.d.ts +1 -0
- package/build/src/core/facts/gate.js +1 -0
- package/build/src/core/verbs/amend.d.ts +1 -1
- package/build/src/core/verbs/amend.js +0 -11
- package/build/src/core/verbs/deliver.d.ts +1 -1
- package/build/src/core/verbs/deliver.js +1 -7
- package/build/src/core/verbs/placement.d.ts +1 -1
- package/build/src/core/verbs/placement.js +4 -1
- package/build/src/dispatch/index.d.ts +2 -2
- package/build/src/dispatch/index.js +17 -17
- package/build/src/git/admission.d.ts +1 -1
- package/build/src/git/admission.js +11 -11
- package/build/src/git/hooks.js +13 -13
- package/build/src/git/integration.d.ts +14 -15
- package/build/src/git/integration.js +80 -44
- package/build/src/git/observe.d.ts +5 -3
- package/build/src/git/observe.js +18 -12
- package/build/src/git/read-observation.js +9 -9
- package/build/src/git/reconcile.d.ts +2 -0
- package/build/src/git/reconcile.js +138 -95
- package/build/src/git/repository.d.ts +27 -19
- package/build/src/git/repository.js +155 -83
- package/build/src/git/scratch.d.ts +7 -3
- package/build/src/git/scratch.js +44 -37
- package/build/src/git/target-placement.d.ts +40 -4
- package/build/src/git/target-placement.js +221 -101
- package/build/src/git/tender.d.ts +6 -5
- package/build/src/git/tender.js +24 -43
- package/build/src/git/terminal-seal.d.ts +1 -1
- package/build/src/git/terminal-seal.js +7 -5
- package/build/src/git/workspace.d.ts +36 -4
- package/build/src/git/workspace.js +53 -18
- package/build/src/identity/selector.js +1 -1
- package/build/src/index.d.ts +3 -3
- package/build/src/index.js +1 -1
- package/build/src/kanshi/index.d.ts +2 -2
- package/build/src/kanshi/index.js +1 -1
- package/build/src/kanshi/read.d.ts +2 -1
- package/build/src/kanshi/read.js +118 -27
- package/build/src/kanshi/report.d.ts +50 -0
- package/build/src/kanshi/select.d.ts +5 -0
- package/build/src/kanshi/select.js +32 -0
- package/build/src/library/address.d.ts +12 -3
- package/build/src/library/address.js +77 -46
- package/build/src/library/akuma-creation.d.ts +6 -1
- package/build/src/library/akuma-creation.js +86 -13
- package/build/src/library/audit.d.ts +18 -0
- package/build/src/library/audit.js +44 -0
- package/build/src/library/bind.js +4 -4
- package/build/src/library/catalog.d.ts +1 -1
- package/build/src/library/catalog.js +5 -8
- package/build/src/library/contract.d.ts +5 -6
- package/build/src/library/contract.js +11 -35
- package/build/src/library/delivery.d.ts +2 -1
- package/build/src/library/fleet.d.ts +2 -2
- package/build/src/library/fleet.js +35 -71
- package/build/src/library/keiyaku.d.ts +3 -2
- package/build/src/library/keiyaku.js +1 -0
- package/build/src/library/mutation.d.ts +7 -6
- package/build/src/library/mutation.js +23 -25
- package/build/src/library/reconcile.d.ts +29 -0
- package/build/src/library/reconcile.js +179 -0
- package/build/src/library/region.d.ts +12 -0
- package/build/src/library/region.js +15 -1
- package/build/src/library/repo.d.ts +4 -16
- package/build/src/library/repo.js +13 -38
- package/build/src/protocol/attempt.js +6 -6
- package/build/src/protocol/bind.js +4 -4
- package/build/src/protocol/intent.d.ts +15 -2
- package/build/src/protocol/intent.js +21 -6
- package/build/src/protocol/operations.d.ts +73 -22
- package/build/src/protocol/operations.js +292 -88
- package/build/src/protocol/outcome.d.ts +9 -3
- package/build/src/protocol/outcome.js +3 -1
- package/build/src/protocol/placement.d.ts +15 -4
- package/build/src/protocol/placement.js +58 -25
- package/build/src/protocol/read/status.d.ts +8 -1
- package/build/src/protocol/read/status.js +61 -14
- package/build/src/runtime/proc/line-rpc.d.ts +3 -8
- package/build/src/runtime/proc/line-rpc.js +16 -43
- package/build/src/runtime/proc/run.d.ts +15 -29
- package/build/src/runtime/proc/run.js +113 -105
- package/build/src/runtime/proc/stdio.d.ts +18 -0
- package/build/src/runtime/proc/stdio.js +58 -0
- package/build/src/settings.d.ts +2 -2
- package/build/src/settings.js +8 -8
- package/build/src/settlement/fence.d.ts +0 -4
- package/build/src/settlement/fence.js +0 -9
- package/build/src/settlement/holder.d.ts +11 -1
- package/build/src/settlement/holder.js +25 -0
- package/build/src/settlement/settle.d.ts +1 -1
- package/build/src/settlement/settle.js +52 -89
- package/build/src/task/board.d.ts +3 -3
- package/build/src/task/board.js +6 -9
- package/build/src/task/compose.d.ts +1 -1
- package/build/src/task/compose.js +18 -10
- package/build/src/task/context.d.ts +3 -3
- package/build/src/task/context.js +14 -14
- package/build/src/task/document.d.ts +2 -1
- package/build/src/task/document.js +15 -5
- package/build/src/task/index.d.ts +19 -7
- package/build/src/task/index.js +42 -23
- package/build/src/task/operations.d.ts +15 -9
- package/build/src/task/operations.js +78 -48
- package/build/src/task/query.d.ts +67 -0
- package/build/src/task/query.js +279 -0
- package/build/src/task/store.d.ts +2 -2
- package/build/src/task/store.js +40 -25
- package/build/src/verification/execution.d.ts +4 -2
- package/build/src/verification/execution.js +9 -5
- package/build/src/workspace-place.d.ts +41 -0
- package/build/src/workspace-place.js +386 -0
- package/build/src/world.d.ts +13 -2
- package/build/src/world.js +81 -48
- package/package.json +3 -2
- package/build/src/protocol/read/audit.d.ts +0 -31
- package/build/src/protocol/read/audit.js +0 -55
|
@@ -1,48 +1,86 @@
|
|
|
1
1
|
import { KeiyakuRefused, KeiyakuRetry, } from "../index.js";
|
|
2
|
-
function
|
|
3
|
-
return
|
|
2
|
+
function acceptedFacts(result) {
|
|
3
|
+
return result.facts.map((fact) => ({
|
|
4
|
+
contract: fact.contract,
|
|
5
|
+
entry: fact.entry,
|
|
6
|
+
kind: fact.kind,
|
|
7
|
+
}));
|
|
4
8
|
}
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function hasDocumentDiff(value) {
|
|
9
|
-
return "documentDiff" in value && typeof value.documentDiff === "string";
|
|
10
|
-
}
|
|
11
|
-
function resultFromMutation(verb, result, options) {
|
|
12
|
-
const acceptedContract = options.coordinate ?? result.facts[0]?.contract;
|
|
13
|
-
if (acceptedContract === undefined)
|
|
9
|
+
function acceptedEnvelope(result, coordinate) {
|
|
10
|
+
const contract = coordinate ?? result.facts[0]?.contract;
|
|
11
|
+
if (contract === undefined)
|
|
14
12
|
throw new Error("accepted mutation is missing its contract identity");
|
|
13
|
+
const firstLag = result.lags[0];
|
|
15
14
|
return {
|
|
16
15
|
kind: "accepted",
|
|
17
|
-
|
|
18
|
-
contract: acceptedContract,
|
|
16
|
+
contract,
|
|
19
17
|
head: result.head,
|
|
20
|
-
facts: result
|
|
21
|
-
contract: fact.contract,
|
|
22
|
-
entry: fact.entry,
|
|
23
|
-
kind: fact.kind,
|
|
24
|
-
})),
|
|
18
|
+
facts: acceptedFacts(result),
|
|
25
19
|
effects: result.effects,
|
|
26
20
|
settlement: result.settlement,
|
|
27
|
-
...(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
21
|
+
...(result.lags.length === 0 || firstLag === undefined ? {} : { lag: [firstLag, ...result.lags.slice(1)] }),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function acceptedRegion(result) {
|
|
25
|
+
if (result.overlapFailure !== undefined)
|
|
26
|
+
return { overlapFailure: result.overlapFailure };
|
|
27
|
+
return { overlaps: result.overlaps };
|
|
28
|
+
}
|
|
29
|
+
export function acceptedBind(result, target) {
|
|
30
|
+
return {
|
|
31
|
+
...acceptedEnvelope(result, undefined),
|
|
32
|
+
verb: "bind",
|
|
33
|
+
target,
|
|
34
|
+
...acceptedRegion(result),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export function acceptedAmend(result, coordinate) {
|
|
38
|
+
return {
|
|
39
|
+
...acceptedEnvelope(result, coordinate),
|
|
40
|
+
verb: "amend",
|
|
41
|
+
diff: result.documentDiff,
|
|
42
|
+
...acceptedRegion(result),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export function acceptedDeliver(result, coordinate) {
|
|
46
|
+
const value = result.value;
|
|
47
|
+
return {
|
|
48
|
+
...acceptedEnvelope(result, coordinate),
|
|
49
|
+
verb: "deliver",
|
|
50
|
+
...(value.verification === undefined ? {} : { verification: value.verification }),
|
|
51
|
+
...(value.verificationReuse === undefined ? {} : { verificationReuse: value.verificationReuse }),
|
|
52
|
+
...(value.placement === undefined ? {} : { placement: value.placement }),
|
|
53
|
+
...(value.cleanup === undefined ? {} : { cleanup: value.cleanup }),
|
|
54
|
+
...(value.leak === undefined ? {} : { leak: value.leak }),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
export function acceptedReview(result, coordinate) {
|
|
58
|
+
const value = result.value;
|
|
59
|
+
return {
|
|
60
|
+
...acceptedEnvelope(result, coordinate),
|
|
61
|
+
verb: "review",
|
|
62
|
+
...(value.placement === undefined ? {} : { placement: value.placement }),
|
|
63
|
+
...(value.workspace === undefined ? {} : { workspace: value.workspace }),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
export function acceptedArc(result, coordinate) {
|
|
67
|
+
return { ...acceptedEnvelope(result, coordinate), verb: "arc" };
|
|
68
|
+
}
|
|
69
|
+
export function acceptedAbandon(result, coordinate) {
|
|
70
|
+
return { ...acceptedEnvelope(result, coordinate), verb: "abandon" };
|
|
71
|
+
}
|
|
72
|
+
export function acceptedAudit(result, coordinate) {
|
|
73
|
+
return {
|
|
74
|
+
...acceptedEnvelope(result, coordinate),
|
|
75
|
+
verb: "audit",
|
|
76
|
+
report: result.value,
|
|
77
|
+
...(result.cleanup === undefined ? {} : { cleanup: result.cleanup }),
|
|
78
|
+
...(result.leak === undefined ? {} : { leak: result.leak }),
|
|
36
79
|
};
|
|
37
80
|
}
|
|
38
|
-
export async function resultFromMutationCall(verb, call, options = {}) {
|
|
81
|
+
export async function resultFromMutationCall(verb, call, project, options = {}) {
|
|
39
82
|
try {
|
|
40
|
-
|
|
41
|
-
const projected = options.project === undefined ? {} : await options.project(result);
|
|
42
|
-
return resultFromMutation(verb, result, {
|
|
43
|
-
...projected,
|
|
44
|
-
...(options.coordinate === undefined ? {} : { coordinate: options.coordinate }),
|
|
45
|
-
});
|
|
83
|
+
return project(await call());
|
|
46
84
|
}
|
|
47
85
|
catch (error) {
|
|
48
86
|
if (error instanceof KeiyakuRefused) {
|
package/build/src/cli/actor.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const ACTOR_ID_ENV = "KEIYAKU_ACTOR_ID";
|
|
2
2
|
/** Resolve optional caller testimony from the current CLI edge vocabulary. */
|
|
3
3
|
export function resolveActor(input = {}) {
|
|
4
4
|
if (input.actor !== undefined) {
|
|
@@ -6,6 +6,6 @@ export function resolveActor(input = {}) {
|
|
|
6
6
|
throw new TypeError("actor must be a nonblank string");
|
|
7
7
|
return input.actor;
|
|
8
8
|
}
|
|
9
|
-
const
|
|
10
|
-
return
|
|
9
|
+
const actorId = input.env?.[ACTOR_ID_ENV];
|
|
10
|
+
return actorId !== undefined && actorId.trim().length > 0 ? actorId : undefined;
|
|
11
11
|
}
|
|
@@ -7,6 +7,7 @@ export type AkumaInvocationResult = Readonly<{
|
|
|
7
7
|
kind: "akuma";
|
|
8
8
|
action: "call";
|
|
9
9
|
result: CallResult;
|
|
10
|
+
world: WorldRoot;
|
|
10
11
|
}> | Readonly<{
|
|
11
12
|
kind: "akuma";
|
|
12
13
|
action: "status";
|
|
@@ -66,12 +67,12 @@ export type AkumaInvocationResult = Readonly<{
|
|
|
66
67
|
}>;
|
|
67
68
|
type InvokeInput = Readonly<{
|
|
68
69
|
path: WorldRoot;
|
|
69
|
-
executionCwd
|
|
70
|
+
executionCwd?: string;
|
|
70
71
|
settings: Settings;
|
|
71
72
|
contract?: KeiyakuContract;
|
|
72
73
|
repo?: Repo;
|
|
73
|
-
readStdin(): string
|
|
74
|
+
readStdin(): Promise<string>;
|
|
74
75
|
}>;
|
|
75
76
|
export declare function invokeAkuma(command: ParsedAkumaCommand, input: InvokeInput): Promise<AkumaInvocationResult>;
|
|
76
|
-
export declare function invokeAkumaStatus(path: WorldRoot, akuma: string, settings: Settings, alias?: string, repo?: Repo): AkumaInvocationResult
|
|
77
|
+
export declare function invokeAkumaStatus(path: WorldRoot, akuma: string, settings: Settings, alias?: string, repo?: Repo): Promise<AkumaInvocationResult>;
|
|
77
78
|
export {};
|
|
@@ -2,6 +2,9 @@ import { Keiyaku, } from "../../index.js";
|
|
|
2
2
|
function inputAlias(selector) {
|
|
3
3
|
return selector.startsWith("@") ? selector : undefined;
|
|
4
4
|
}
|
|
5
|
+
async function promptBody(command, input) {
|
|
6
|
+
return command.prompt.kind === "stdin" ? await input.readStdin() : command.prompt.value;
|
|
7
|
+
}
|
|
5
8
|
async function invokeWait(command, input) {
|
|
6
9
|
const alias = command.akuma.length === 1 ? inputAlias(command.akuma[0]) : undefined;
|
|
7
10
|
return {
|
|
@@ -19,7 +22,7 @@ async function invokeWait(command, input) {
|
|
|
19
22
|
};
|
|
20
23
|
}
|
|
21
24
|
async function invokeTell(command, input) {
|
|
22
|
-
const body = input
|
|
25
|
+
const body = await promptBody(command, input);
|
|
23
26
|
if (command.interrupt) {
|
|
24
27
|
const result = await Keiyaku.interrupt({ path: input.path, akuma: command.akuma, settings: input.settings, body, ...(input.repo === undefined ? {} : { repo: input.repo }) });
|
|
25
28
|
const alias = inputAlias(command.akuma);
|
|
@@ -29,14 +32,15 @@ async function invokeTell(command, input) {
|
|
|
29
32
|
const alias = inputAlias(command.akuma);
|
|
30
33
|
return { kind: "akuma", action: "tell", mode: "ordinary", result, body, ...(alias === undefined ? {} : { alias }) };
|
|
31
34
|
}
|
|
32
|
-
function invokeHistory(command, input) {
|
|
33
|
-
const result = Keiyaku.history({
|
|
35
|
+
async function invokeHistory(command, input) {
|
|
36
|
+
const result = await Keiyaku.history({
|
|
34
37
|
path: input.path,
|
|
35
38
|
akuma: command.akuma,
|
|
36
39
|
settings: input.settings,
|
|
37
40
|
...(input.repo === undefined ? {} : { repo: input.repo }),
|
|
38
41
|
...(command.before === undefined ? {} : { before: command.before }),
|
|
39
42
|
...(command.since === undefined ? {} : { since: command.since }),
|
|
43
|
+
...(command.limit === undefined ? {} : { limit: command.limit }),
|
|
40
44
|
last: command.last,
|
|
41
45
|
});
|
|
42
46
|
return {
|
|
@@ -82,31 +86,32 @@ async function invokeKill(command, input) {
|
|
|
82
86
|
export async function invokeAkuma(command, input) {
|
|
83
87
|
switch (command.command) {
|
|
84
88
|
case "call": {
|
|
89
|
+
const body = await promptBody(command, input);
|
|
85
90
|
const result = await Keiyaku.call({
|
|
86
91
|
path: input.path,
|
|
87
92
|
archetype: command.archetype,
|
|
88
|
-
body
|
|
93
|
+
body,
|
|
89
94
|
settings: input.settings,
|
|
90
|
-
cwd: input.executionCwd,
|
|
95
|
+
...(input.executionCwd === undefined ? {} : { cwd: input.executionCwd }),
|
|
91
96
|
mode: command.mode,
|
|
92
97
|
...(command.timeoutMs === undefined ? {} : { timeoutMs: command.timeoutMs }),
|
|
93
98
|
...(input.contract === undefined ? {} : { contract: input.contract }),
|
|
94
99
|
...(command.alias === undefined ? {} : { alias: command.alias }),
|
|
95
100
|
});
|
|
96
|
-
return { kind: "akuma", action: "call", result };
|
|
101
|
+
return { kind: "akuma", action: "call", result, world: input.path };
|
|
97
102
|
}
|
|
98
103
|
case "wait": return await invokeWait(command, input);
|
|
99
104
|
case "tell": return await invokeTell(command, input);
|
|
100
|
-
case "history": return invokeHistory(command, input);
|
|
105
|
+
case "history": return await invokeHistory(command, input);
|
|
101
106
|
case "fork": return await invokeFork(command, input);
|
|
102
107
|
case "kill": return await invokeKill(command, input);
|
|
103
108
|
}
|
|
104
109
|
}
|
|
105
|
-
export function invokeAkumaStatus(path, akuma, settings, alias, repo) {
|
|
110
|
+
export async function invokeAkumaStatus(path, akuma, settings, alias, repo) {
|
|
106
111
|
return {
|
|
107
112
|
kind: "akuma",
|
|
108
113
|
action: "status",
|
|
109
|
-
status: Keiyaku.status({ path, akuma, settings, ...(repo === undefined ? {} : { repo }) }),
|
|
114
|
+
status: await Keiyaku.status({ path, akuma, settings, ...(repo === undefined ? {} : { repo }) }),
|
|
110
115
|
...(alias === undefined ? {} : { alias }),
|
|
111
116
|
};
|
|
112
117
|
}
|
|
@@ -5,14 +5,23 @@ type Output = Readonly<{
|
|
|
5
5
|
type Addressed = Readonly<{
|
|
6
6
|
akuma: string;
|
|
7
7
|
}>;
|
|
8
|
-
export type
|
|
8
|
+
export type AkumaPromptSource = Readonly<{
|
|
9
|
+
kind: "argument";
|
|
10
|
+
value: string;
|
|
11
|
+
}> | Readonly<{
|
|
12
|
+
kind: "stdin";
|
|
13
|
+
}>;
|
|
14
|
+
type Prompted = Readonly<{
|
|
15
|
+
prompt: AkumaPromptSource;
|
|
16
|
+
}>;
|
|
17
|
+
export type ParsedAkumaCommand = Output & ((Readonly<{
|
|
9
18
|
command: "call";
|
|
10
19
|
archetype: string;
|
|
11
20
|
contract?: string;
|
|
12
21
|
alias?: AkumaAlias;
|
|
13
22
|
mode: "wait" | "detach";
|
|
14
23
|
timeoutMs?: number;
|
|
15
|
-
}> | Readonly<{
|
|
24
|
+
}> & Prompted) | Readonly<{
|
|
16
25
|
command: "kill";
|
|
17
26
|
akuma: readonly string[];
|
|
18
27
|
}> | Readonly<{
|
|
@@ -23,11 +32,12 @@ export type ParsedAkumaCommand = Output & (Readonly<{
|
|
|
23
32
|
}> | (Readonly<{
|
|
24
33
|
command: "tell";
|
|
25
34
|
interrupt: boolean;
|
|
26
|
-
}> & Addressed) | (Readonly<{
|
|
35
|
+
}> & Addressed & Prompted) | (Readonly<{
|
|
27
36
|
command: "history";
|
|
28
37
|
last: boolean;
|
|
29
38
|
before?: number;
|
|
30
39
|
since?: number;
|
|
40
|
+
limit?: number;
|
|
31
41
|
}> & Addressed) | (Readonly<{
|
|
32
42
|
command: "fork";
|
|
33
43
|
at: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CliUsageError, usageLine } from "../usage.js";
|
|
1
|
+
import { CliUsageError, isBlankInput, usageLine } from "../usage.js";
|
|
2
2
|
import { archetypeName, parseAkuId } from "../../akuma/identity.js";
|
|
3
3
|
import { parseDuration as decodeDuration } from "../../duration.js";
|
|
4
4
|
import { parseAkumaAlias, parseAkumaGlob } from "../../identity/selector.js";
|
|
@@ -9,13 +9,19 @@ const AKUMA_COMMAND_SPECS = {
|
|
|
9
9
|
flags: {
|
|
10
10
|
contract: "value",
|
|
11
11
|
alias: "value",
|
|
12
|
-
wait: "
|
|
13
|
-
timeout: "value",
|
|
12
|
+
wait: "value",
|
|
14
13
|
detach: "boolean",
|
|
15
14
|
json: "boolean",
|
|
16
15
|
},
|
|
17
|
-
usage: "call <akuma> [--contract <kei/...>] [--alias @name] [--wait
|
|
18
|
-
purpose: "
|
|
16
|
+
usage: "call <akuma-name> [--contract <kei/...>] [--alias @name] [--wait <duration> | -d | --detach] [--json] (<prompt> | -)",
|
|
17
|
+
purpose: "Birth an Akuma from <akuma-name> with one prompt.",
|
|
18
|
+
details: [
|
|
19
|
+
"Give <prompt> as one argument, or use final - to read stdin.",
|
|
20
|
+
"Default: --wait 5m. An explicit --wait replaces that duration; -d and --detach return after birth.",
|
|
21
|
+
"--contract dispatches the born Akuma to that Contract.",
|
|
22
|
+
"--alias assigns the world-local @name selector to the born Akuma.",
|
|
23
|
+
"With --contract, Dispatch succeeds first. If @name exists, the alias then moves.",
|
|
24
|
+
].join("\n"),
|
|
19
25
|
},
|
|
20
26
|
wait: {
|
|
21
27
|
arity: "one-or-more",
|
|
@@ -28,14 +34,18 @@ const AKUMA_COMMAND_SPECS = {
|
|
|
28
34
|
arity: 1,
|
|
29
35
|
stdin: true,
|
|
30
36
|
flags: { interrupt: "boolean", json: "boolean" },
|
|
31
|
-
usage: "tell <aku
|
|
32
|
-
purpose: "
|
|
37
|
+
usage: "tell <aku/...|@alias> [--interrupt] [--json] (<prompt> | -)",
|
|
38
|
+
purpose: "Send one prompt to an existing Akuma and wake it.",
|
|
39
|
+
details: [
|
|
40
|
+
"Give <prompt> as one argument, or use final - to read stdin.",
|
|
41
|
+
"--interrupt ends the current Body before recording the prompt and waking its successor.",
|
|
42
|
+
].join("\n"),
|
|
33
43
|
},
|
|
34
44
|
history: {
|
|
35
45
|
arity: 1,
|
|
36
46
|
stdin: false,
|
|
37
|
-
flags: { before: "value", since: "value", last: "boolean", json: "boolean" },
|
|
38
|
-
usage: "history <aku/...> [--before <index> | --since <index>
|
|
47
|
+
flags: { before: "value", since: "value", limit: "value", last: "boolean", json: "boolean" },
|
|
48
|
+
usage: "history <aku/...> [--before <index> | --since <index>] [--limit <count>] [--last] [--json]",
|
|
39
49
|
purpose: "Read the persistent execution history or the last answer.",
|
|
40
50
|
},
|
|
41
51
|
fork: {
|
|
@@ -64,7 +74,7 @@ export function renderAkumaRootRows() {
|
|
|
64
74
|
}
|
|
65
75
|
export function renderAkumaHelp(action) {
|
|
66
76
|
const spec = AKUMA_COMMAND_SPECS[action];
|
|
67
|
-
return `${spec.purpose}\n\n${usageLine(spec.usage)}`;
|
|
77
|
+
return `${spec.purpose}\n\n${usageLine(spec.usage)}${spec.details === undefined ? "" : `\n\n${spec.details}`}`;
|
|
68
78
|
}
|
|
69
79
|
export function renderAkumaUsage(action) {
|
|
70
80
|
return usageLine(AKUMA_COMMAND_SPECS[action].usage);
|
|
@@ -84,14 +94,14 @@ function stringFlag(value, diagnostic, fail) {
|
|
|
84
94
|
fail(diagnostic);
|
|
85
95
|
return value;
|
|
86
96
|
}
|
|
87
|
-
function parseDuration(raw, fail) {
|
|
97
|
+
function parseDuration(raw, option, fail) {
|
|
88
98
|
if (typeof raw !== "string")
|
|
89
|
-
fail(
|
|
99
|
+
fail(`${option} requires an integer duration with unit ms, s, m, or h`);
|
|
90
100
|
const duration = decodeDuration(raw);
|
|
91
101
|
if (duration.kind === "invalid")
|
|
92
|
-
fail(
|
|
102
|
+
fail(`${option} requires an integer duration with unit ms, s, m, or h`);
|
|
93
103
|
if (duration.kind === "overflow")
|
|
94
|
-
fail(
|
|
104
|
+
fail(`${option} duration exceeds the safe millisecond range`);
|
|
95
105
|
return duration.milliseconds;
|
|
96
106
|
}
|
|
97
107
|
function scanAkuma(action, argv, fail) {
|
|
@@ -113,8 +123,11 @@ function scanAkuma(action, argv, fail) {
|
|
|
113
123
|
fail("duplicate option: --detach");
|
|
114
124
|
flags.detach = true;
|
|
115
125
|
}
|
|
116
|
-
else if (!token.startsWith("--"))
|
|
126
|
+
else if (!token.startsWith("--")) {
|
|
127
|
+
if (isBlankInput(token))
|
|
128
|
+
fail(`${action} requires a nonblank value`);
|
|
117
129
|
positionals.push(token);
|
|
130
|
+
}
|
|
118
131
|
else {
|
|
119
132
|
const name = token.slice(2);
|
|
120
133
|
const kind = spec.flags[name];
|
|
@@ -129,6 +142,8 @@ function scanAkuma(action, argv, fail) {
|
|
|
129
142
|
if (value === undefined || value === "-" || value === "-d" || value.startsWith("--")) {
|
|
130
143
|
fail(`${token} requires a value`);
|
|
131
144
|
}
|
|
145
|
+
if (isBlankInput(value))
|
|
146
|
+
fail(`${token} requires a nonblank value`);
|
|
132
147
|
flags[name] = value;
|
|
133
148
|
index += 1;
|
|
134
149
|
}
|
|
@@ -181,42 +196,57 @@ function parseWait(rawSelectors, flags, output, fail) {
|
|
|
181
196
|
command: "wait",
|
|
182
197
|
akuma: rawSelectors.map((value) => validateSet(value, fail)),
|
|
183
198
|
...(completion === undefined ? {} : { completion }),
|
|
184
|
-
...(flags.timeout === undefined ? {} : { timeoutMs: parseDuration(flags.timeout, fail) }),
|
|
199
|
+
...(flags.timeout === undefined ? {} : { timeoutMs: parseDuration(flags.timeout, "--timeout", fail) }),
|
|
185
200
|
output,
|
|
186
201
|
};
|
|
187
202
|
}
|
|
188
203
|
function parseHistory(akuma, flags, output, fail) {
|
|
189
204
|
if (flags.before !== undefined && flags.since !== undefined)
|
|
190
205
|
fail("history --before and --since are mutually exclusive");
|
|
191
|
-
if (flags.last === true && (flags.before !== undefined || flags.since !== undefined)) {
|
|
192
|
-
fail("history --last cannot be combined with --before or --
|
|
206
|
+
if (flags.last === true && (flags.before !== undefined || flags.since !== undefined || flags.limit !== undefined)) {
|
|
207
|
+
fail("history --last cannot be combined with --before, --since, or --limit");
|
|
193
208
|
}
|
|
209
|
+
const limit = flags.limit === undefined ? undefined : positiveIndex(flags.limit, "--limit", fail);
|
|
210
|
+
if (limit !== undefined && limit > 5_000)
|
|
211
|
+
fail("--limit must be no greater than 5000");
|
|
194
212
|
return {
|
|
195
213
|
command: "history",
|
|
196
214
|
akuma,
|
|
197
215
|
last: flags.last === true,
|
|
198
216
|
...(flags.before === undefined ? {} : { before: positiveIndex(flags.before, "--before", fail) }),
|
|
199
217
|
...(flags.since === undefined ? {} : { since: positiveIndex(flags.since, "--since", fail) }),
|
|
218
|
+
...(limit === undefined ? {} : { limit }),
|
|
200
219
|
output,
|
|
201
220
|
};
|
|
202
221
|
}
|
|
203
222
|
function parseAddressed(action, rawSelectors, flags, output, fail) {
|
|
204
223
|
if (action === "kill")
|
|
205
224
|
return { command: action, akuma: rawSelectors.map((value) => validateSet(value, fail)), output };
|
|
206
|
-
if (action === "tell") {
|
|
207
|
-
return { command: action, akuma: validateDirect(rawSelectors[0], fail), interrupt: flags.interrupt === true, output };
|
|
208
|
-
}
|
|
209
225
|
if (action === "wait")
|
|
210
226
|
return parseWait(rawSelectors, flags, output, fail);
|
|
211
227
|
const akuma = validateDirect(rawSelectors[0], fail);
|
|
212
228
|
if (action === "history")
|
|
213
229
|
return parseHistory(akuma, flags, output, fail);
|
|
214
230
|
const at = stringFlag(flags.at, "fork requires --at <historyId>", fail);
|
|
215
|
-
if (at.trim().length === 0)
|
|
216
|
-
fail("fork requires --at <historyId>");
|
|
217
231
|
return { command: action, akuma, at, output };
|
|
218
232
|
}
|
|
219
|
-
function
|
|
233
|
+
function parsePrompted(action, positionals, stdin, fail) {
|
|
234
|
+
if (positionals.length < 1 || positionals.length > 2)
|
|
235
|
+
fail(`${action} has invalid positional arguments`);
|
|
236
|
+
const argument = positionals[1];
|
|
237
|
+
if (stdin && argument !== undefined)
|
|
238
|
+
fail(`${action} accepts either a prompt argument or stdin, not both`);
|
|
239
|
+
if (!stdin && argument === undefined)
|
|
240
|
+
fail(`${action} requires a prompt argument or stdin`);
|
|
241
|
+
return {
|
|
242
|
+
subject: positionals[0],
|
|
243
|
+
prompt: stdin ? { kind: "stdin" } : { kind: "argument", value: argument },
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
function parseTell(flags, subject, prompt, output, fail) {
|
|
247
|
+
return { command: "tell", akuma: validateDirect(subject, fail), interrupt: flags.interrupt === true, prompt, output };
|
|
248
|
+
}
|
|
249
|
+
function parseCall(flags, archetype, prompt, output, fail) {
|
|
220
250
|
let alias;
|
|
221
251
|
if (flags.alias !== undefined) {
|
|
222
252
|
try {
|
|
@@ -226,19 +256,18 @@ function parseCall(flags, positionals, output, fail) {
|
|
|
226
256
|
fail(error instanceof Error ? error.message : "invalid Akuma alias");
|
|
227
257
|
}
|
|
228
258
|
}
|
|
229
|
-
if (flags.detach === true && flags.wait
|
|
259
|
+
if (flags.detach === true && flags.wait !== undefined)
|
|
230
260
|
fail("call --wait and --detach are mutually exclusive");
|
|
231
|
-
if (flags.detach === true && flags.timeout !== undefined)
|
|
232
|
-
fail("call --timeout and --detach are mutually exclusive");
|
|
233
261
|
const mode = flags.detach === true ? "detach" : "wait";
|
|
234
|
-
const timeoutMs = flags.
|
|
262
|
+
const timeoutMs = flags.wait === undefined ? undefined : parseDuration(flags.wait, "--wait", fail);
|
|
235
263
|
return {
|
|
236
264
|
command: "call",
|
|
237
|
-
archetype
|
|
265
|
+
archetype,
|
|
238
266
|
...(typeof flags.contract === "string" ? { contract: flags.contract } : {}),
|
|
239
267
|
...(alias === undefined ? {} : { alias }),
|
|
240
268
|
mode,
|
|
241
269
|
...(timeoutMs === undefined ? {} : { timeoutMs }),
|
|
270
|
+
prompt,
|
|
242
271
|
output,
|
|
243
272
|
};
|
|
244
273
|
}
|
|
@@ -250,13 +279,17 @@ export function parseAkumaCommand(argv) {
|
|
|
250
279
|
const spec = AKUMA_COMMAND_SPECS[action];
|
|
251
280
|
const fail = (message) => { throw new CliUsageError(message, renderAkumaUsage(action)); };
|
|
252
281
|
const { flags, positionals, stdin } = scanAkuma(action, argv, fail);
|
|
282
|
+
const output = flags.json === true ? "json" : "text";
|
|
283
|
+
if (action === "call" || action === "tell") {
|
|
284
|
+
const parsed = parsePrompted(action, positionals, stdin, fail);
|
|
285
|
+
return action === "call"
|
|
286
|
+
? parseCall(flags, parsed.subject, parsed.prompt, output, fail)
|
|
287
|
+
: parseTell(flags, parsed.subject, parsed.prompt, output, fail);
|
|
288
|
+
}
|
|
253
289
|
if (spec.arity === "one-or-more" ? positionals.length === 0 : positionals.length !== spec.arity) {
|
|
254
290
|
fail(`${action} has invalid positional arguments`);
|
|
255
291
|
}
|
|
256
|
-
if (stdin
|
|
257
|
-
fail(`${action}
|
|
258
|
-
const output = flags.json === true ? "json" : "text";
|
|
259
|
-
if (action === "call")
|
|
260
|
-
return parseCall(flags, positionals, output, fail);
|
|
292
|
+
if (stdin)
|
|
293
|
+
fail(`${action} reads no stdin`);
|
|
261
294
|
return parseAddressed(action, positionals, flags, output, fail);
|
|
262
295
|
}
|
|
@@ -6,6 +6,7 @@ export type ContractCommandSpec = Readonly<{
|
|
|
6
6
|
usage: string;
|
|
7
7
|
purpose: string;
|
|
8
8
|
}>;
|
|
9
|
+
export declare const AMEND_MINIMAL_STDIN_HELP: string;
|
|
9
10
|
export declare const CONTRACT_COMMAND_SPECS: {
|
|
10
11
|
readonly bind: {
|
|
11
12
|
readonly positional: "none";
|
|
@@ -57,7 +58,7 @@ export declare const CONTRACT_COMMAND_SPECS: {
|
|
|
57
58
|
readonly summary: "value";
|
|
58
59
|
readonly json: "boolean";
|
|
59
60
|
};
|
|
60
|
-
readonly usage: "review [<contract>|@<contract>] (--satisfied | --unsatisfied)
|
|
61
|
+
readonly usage: "review [<contract>|@<contract>] (--satisfied | --unsatisfied) (--summary <text> | -) [--actor <actor>] [--json]";
|
|
61
62
|
readonly purpose: "Record one review verdict.";
|
|
62
63
|
};
|
|
63
64
|
readonly arc: {
|
|
@@ -105,19 +106,20 @@ export declare const CONTRACT_COMMAND_SPECS: {
|
|
|
105
106
|
readonly flags: {
|
|
106
107
|
readonly json: "boolean";
|
|
107
108
|
};
|
|
108
|
-
readonly usage: "ls task/ [--json]\n keiyaku ls kei/ [--json]\n keiyaku ls aku/ [--json]\n keiyaku ls aku/<
|
|
109
|
+
readonly usage: "ls task/ [--json]\n keiyaku ls kei/ [--json]\n keiyaku ls aku/ [--json]\n keiyaku ls aku/<akuma>/ [--json]\n keiyaku ls \"aku/*/*\" [--json]";
|
|
109
110
|
readonly purpose: "List one identity directory.";
|
|
110
111
|
};
|
|
111
112
|
readonly audit: {
|
|
112
113
|
readonly positional: "optional";
|
|
113
114
|
readonly stdin: "none";
|
|
114
115
|
readonly flags: {
|
|
115
|
-
readonly "
|
|
116
|
+
readonly "include-dirty": "boolean";
|
|
117
|
+
readonly diff: "boolean";
|
|
116
118
|
readonly actor: "value";
|
|
117
119
|
readonly json: "boolean";
|
|
118
120
|
};
|
|
119
|
-
readonly usage: "audit [<contract>|@<contract>] [--
|
|
120
|
-
readonly purpose: "
|
|
121
|
+
readonly usage: "audit [<contract>|@<contract>] [--include-dirty] [--diff] [--actor <actor>] [--json]";
|
|
122
|
+
readonly purpose: "Ask what candidate preparation, Verification, and target placement would do.";
|
|
121
123
|
};
|
|
122
124
|
readonly reconcile: {
|
|
123
125
|
readonly positional: "optional";
|
|
@@ -138,5 +140,16 @@ export declare const CONTRACT_COMMAND_SPECS: {
|
|
|
138
140
|
readonly usage: "settings [--json]";
|
|
139
141
|
readonly purpose: "Read user and project Settings resources.";
|
|
140
142
|
};
|
|
143
|
+
readonly region: {
|
|
144
|
+
readonly positional: "optional";
|
|
145
|
+
readonly stdin: "none";
|
|
146
|
+
readonly flags: {
|
|
147
|
+
readonly overlap: "boolean";
|
|
148
|
+
readonly path: "value";
|
|
149
|
+
readonly json: "boolean";
|
|
150
|
+
};
|
|
151
|
+
readonly usage: "region [<contract>] [--overlap] [--json]\n region --path <repo-relative-path> [--json]";
|
|
152
|
+
readonly purpose: "Read active declared Contract Regions.";
|
|
153
|
+
};
|
|
141
154
|
};
|
|
142
155
|
export type ContractCommand = keyof typeof CONTRACT_COMMAND_SPECS;
|
|
@@ -1,14 +1,20 @@
|
|
|
1
|
+
export const AMEND_MINIMAL_STDIN_HELP = [
|
|
2
|
+
"minimal stdin:",
|
|
3
|
+
" ## Replace: Design",
|
|
4
|
+
" <complete replacement>",
|
|
5
|
+
].join("\n");
|
|
1
6
|
export const CONTRACT_COMMAND_SPECS = {
|
|
2
7
|
bind: { positional: "none", stdin: "required", flags: { actor: "value", task: "value", target: "value", here: "boolean", after: "repeat-value", gates: "value", json: "boolean" }, usage: "bind [--task <task/...>] [--target <ref>] [--here] [--after <kei/...> ...] [--gates <name>] [--actor <actor>] [--json] -", purpose: "Create one Contract from stdin Markdown." },
|
|
3
8
|
amend: { positional: "optional", stdin: "required", flags: { actor: "value", after: "repeat-value", "clear-after": "boolean", gates: "value", json: "boolean" }, usage: "amend [<contract>|@<contract>] [--after <kei/...> ... | --clear-after] [--gates <name>] [--actor <actor>] [--json] -", purpose: "Apply stdin amendment operations to one Contract." },
|
|
4
9
|
deliver: { positional: "optional", stdin: "none", flags: { actor: "value", message: "value", "include-dirty": "boolean", json: "boolean" }, usage: "deliver [<contract>|@<contract>] [--message <text>] [--include-dirty] [--actor <actor>] [--json]", purpose: "Deliver one Contract candidate." },
|
|
5
|
-
review: { positional: "optional", stdin: "optional", flags: { actor: "value", satisfied: "boolean", unsatisfied: "boolean", summary: "value", json: "boolean" }, usage: "review [<contract>|@<contract>] (--satisfied | --unsatisfied)
|
|
10
|
+
review: { positional: "optional", stdin: "optional", flags: { actor: "value", satisfied: "boolean", unsatisfied: "boolean", summary: "value", json: "boolean" }, usage: "review [<contract>|@<contract>] (--satisfied | --unsatisfied) (--summary <text> | -) [--actor <actor>] [--json]", purpose: "Record one review verdict." },
|
|
6
11
|
arc: { positional: "optional", stdin: "required", flags: { actor: "value", json: "boolean" }, usage: "arc [<contract>|@<contract>] [--actor <actor>] [--json] -", purpose: "Record stdin arc Markdown for one Contract." },
|
|
7
12
|
abandon: { positional: "optional", stdin: "none", flags: { actor: "value", note: "value", json: "boolean" }, usage: "abandon [<contract>|@<contract>] [--note <text>] [--actor <actor>] [--json]", purpose: "Abandon one Contract with an optional note." },
|
|
8
13
|
status: { positional: "optional", stdin: "none", flags: { json: "boolean" }, usage: "status [<contract>|@name|<aku/...>] [--json]", purpose: "Read the world status board or one Contract projection." },
|
|
9
14
|
show: { positional: "optional", stdin: "none", flags: { json: "boolean" }, usage: "show [<contract>|@<contract>] [--json]", purpose: "Read one Contract guidance projection." },
|
|
10
|
-
ls: { positional: "optional", stdin: "none", flags: { json: "boolean" }, usage: "ls task/ [--json]\n keiyaku ls kei/ [--json]\n keiyaku ls aku/ [--json]\n keiyaku ls aku/<
|
|
11
|
-
audit: { positional: "optional", stdin: "none", flags: { "
|
|
15
|
+
ls: { positional: "optional", stdin: "none", flags: { json: "boolean" }, usage: "ls task/ [--json]\n keiyaku ls kei/ [--json]\n keiyaku ls aku/ [--json]\n keiyaku ls aku/<akuma>/ [--json]\n keiyaku ls \"aku/*/*\" [--json]", purpose: "List one identity directory." },
|
|
16
|
+
audit: { positional: "optional", stdin: "none", flags: { "include-dirty": "boolean", diff: "boolean", actor: "value", json: "boolean" }, usage: "audit [<contract>|@<contract>] [--include-dirty] [--diff] [--actor <actor>] [--json]", purpose: "Ask what candidate preparation, Verification, and target placement would do." },
|
|
12
17
|
reconcile: { positional: "optional", stdin: "none", flags: { "retry-hooks": "boolean", json: "boolean" }, usage: "reconcile [<contract>|@<contract>] [--retry-hooks] [--json]", purpose: "Reconcile one Contract or the invocation world." },
|
|
13
18
|
settings: { positional: "none", stdin: "none", flags: { json: "boolean" }, usage: "settings [--json]", purpose: "Read user and project Settings resources." },
|
|
19
|
+
region: { positional: "optional", stdin: "none", flags: { overlap: "boolean", path: "value", json: "boolean" }, usage: "region [<contract>] [--overlap] [--json]\n region --path <repo-relative-path> [--json]", purpose: "Read active declared Contract Regions." },
|
|
14
20
|
};
|
|
@@ -1,11 +1,24 @@
|
|
|
1
|
-
import { type BlockedTaskList, type TaskBatchResult, type TaskCompositionResult, type
|
|
1
|
+
import { type BlockedTaskList, type TaskBatchResult, type TaskCompositionResult, type TaskDecompositionTree, type TaskDetail, type TaskDoctorReport, type TaskList, type TaskMutationResult, type TaskNamespaceResult, type TaskQueryResult, type TaskUpdateResult } from "../../task/index.js";
|
|
2
2
|
import type { ParsedTaskCommand } from "./task.js";
|
|
3
3
|
import type { WorldRoot } from "../../world.js";
|
|
4
|
-
export type TaskInvocationResult = TaskMutationResult | TaskUpdateResult | TaskBatchResult | TaskCompositionResult | TaskDetail | TaskList | BlockedTaskList |
|
|
4
|
+
export type TaskInvocationResult = TaskMutationResult | TaskUpdateResult | TaskBatchResult | TaskCompositionResult | TaskDetail | TaskList | BlockedTaskList | TaskQueryResult | TaskDecompositionTree | TaskDoctorReport | TaskNamespaceResult | TaskWorldObservation;
|
|
5
|
+
type TaskWorldRead = TaskList | BlockedTaskList | TaskQueryResult | TaskDoctorReport;
|
|
6
|
+
export type TaskWorldObservation = Readonly<{
|
|
7
|
+
kind: "present";
|
|
8
|
+
value: TaskWorldRead;
|
|
9
|
+
}> | Readonly<{
|
|
10
|
+
kind: "absent";
|
|
11
|
+
}> | Readonly<{
|
|
12
|
+
kind: "failed";
|
|
13
|
+
failure: Readonly<{
|
|
14
|
+
message: string;
|
|
15
|
+
}>;
|
|
16
|
+
}>;
|
|
5
17
|
type TaskInput = Readonly<{
|
|
6
18
|
world: WorldRoot | null;
|
|
7
|
-
establish(): WorldRoot
|
|
8
|
-
readStdin(): string
|
|
19
|
+
establish(): Promise<WorldRoot>;
|
|
20
|
+
readStdin(): Promise<string>;
|
|
21
|
+
actor?: string;
|
|
9
22
|
}>;
|
|
10
23
|
export declare function invokeTask(command: ParsedTaskCommand, input: TaskInput): Promise<TaskInvocationResult>;
|
|
11
24
|
export {};
|