@astrosheep/keiyaku 4.0.0 → 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 +133 -8
- package/build/integrations/marketplace/plugins/keiyaku/.claude-plugin/plugin.json +2 -2
- package/build/integrations/marketplace/plugins/keiyaku/.codex-plugin/plugin.json +4 -4
- package/build/integrations/marketplace/plugins/keiyaku/opencode.js +2 -2
- package/build/integrations/marketplace/plugins/keiyaku/package.json +2 -2
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku/SKILL.md +13 -5
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-akuma/SKILL.md +91 -32
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-bind/SKILL.md +134 -0
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-bind/agents/openai.yaml +4 -0
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-task/SKILL.md +41 -6
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-workflow/SKILL.md +262 -46
- package/build/src/akuma/abort.d.ts +2 -0
- package/build/src/akuma/abort.js +50 -0
- package/build/src/akuma/akuma.d.ts +50 -33
- package/build/src/akuma/akuma.js +175 -127
- package/build/src/akuma/archetype.d.ts +14 -5
- package/build/src/akuma/archetype.js +85 -39
- package/build/src/akuma/body.d.ts +3 -5
- package/build/src/akuma/body.js +490 -183
- package/build/src/akuma/coordinate.d.ts +9 -0
- package/build/src/akuma/coordinate.js +22 -0
- package/build/src/akuma/heart/facts.d.ts +88 -45
- package/build/src/akuma/heart/facts.js +19 -8
- package/build/src/akuma/heart/index.d.ts +64 -55
- package/build/src/akuma/heart/index.js +172 -252
- package/build/src/akuma/heart/rows.d.ts +38 -83
- package/build/src/akuma/heart/rows.js +117 -155
- package/build/src/akuma/heart/schema.d.ts +1 -1
- package/build/src/akuma/heart/schema.js +61 -22
- 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 +47 -0
- package/build/src/akuma/heart/storage.js +224 -0
- package/build/src/akuma/heart/tells.d.ts +12 -0
- package/build/src/akuma/heart/tells.js +79 -0
- package/build/src/akuma/heart/timeline.d.ts +15 -0
- package/build/src/akuma/heart/timeline.js +86 -0
- package/build/src/akuma/identity.d.ts +2 -2
- package/build/src/akuma/identity.js +9 -9
- package/build/src/akuma/index.d.ts +10 -3
- package/build/src/akuma/index.js +7 -1
- package/build/src/akuma/projection.d.ts +176 -0
- package/build/src/akuma/projection.js +256 -0
- 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 +67 -13
- package/build/src/akuma/provider.js +172 -105
- 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.d.ts → claude/events.d.ts} +9 -41
- package/build/src/akuma/providers/claude/events.js +238 -0
- package/build/src/akuma/providers/claude/index.d.ts +47 -0
- package/build/src/akuma/providers/claude/index.js +279 -0
- package/build/src/akuma/providers/claude/input.d.ts +13 -0
- package/build/src/akuma/providers/claude/input.js +109 -0
- package/build/src/akuma/providers/codex-app-server/events.d.ts +1 -1
- package/build/src/akuma/providers/codex-app-server/events.js +15 -12
- package/build/src/akuma/providers/codex-app-server/index.d.ts +15 -13
- package/build/src/akuma/providers/codex-app-server/index.js +77 -33
- 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 +35 -56
- package/build/src/akuma/providers/opencode-sdk/events.d.ts +54 -0
- package/build/src/akuma/providers/opencode-sdk/events.js +235 -0
- package/build/src/akuma/providers/opencode-sdk/index.d.ts +33 -0
- package/build/src/akuma/providers/opencode-sdk/index.js +308 -0
- package/build/src/akuma/providers/opencode-sdk/session.d.ts +26 -0
- package/build/src/akuma/providers/opencode-sdk/session.js +63 -0
- package/build/src/akuma/providers/pi/events.d.ts +33 -0
- package/build/src/akuma/providers/pi/events.js +166 -0
- package/build/src/akuma/providers/pi/index.d.ts +11 -0
- package/build/src/akuma/providers/pi/index.js +191 -0
- 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 -6
- package/build/src/akuma/requests.js +95 -65
- package/build/src/alias/index.d.ts +4 -3
- package/build/src/alias/index.js +12 -13
- 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/body/render.js +2 -1
- package/build/src/body/shape.js +7 -1
- package/build/src/body/verification.js +19 -4
- package/build/src/cli/accepted.d.ts +18 -12
- package/build/src/cli/accepted.js +73 -34
- package/build/src/cli/actor.js +3 -3
- package/build/src/cli/commands/akuma-invoke.d.ts +44 -19
- package/build/src/cli/commands/akuma-invoke.js +101 -52
- package/build/src/cli/commands/akuma.d.ts +27 -9
- package/build/src/cli/commands/akuma.js +151 -80
- package/build/src/cli/commands/contract.d.ts +155 -0
- package/build/src/cli/commands/contract.js +20 -0
- package/build/src/cli/commands/install.js +2 -0
- package/build/src/cli/commands/task-invoke.d.ts +19 -4
- package/build/src/cli/commands/task-invoke.js +65 -17
- 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 +52 -14
- 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 +9 -3
- package/build/src/cli/invoke.js +287 -108
- package/build/src/cli/main.js +54 -7
- package/build/src/cli/parse.d.ts +21 -117
- package/build/src/cli/parse.js +79 -84
- 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 +4 -2
- package/build/src/cli/render/akuma-tool.js +35 -5
- package/build/src/cli/render/akuma.d.ts +3 -1
- package/build/src/cli/render/akuma.js +247 -212
- package/build/src/cli/render/audit.d.ts +3 -0
- package/build/src/cli/render/audit.js +104 -0
- package/build/src/cli/render/catalog.d.ts +2 -0
- package/build/src/cli/render/catalog.js +16 -0
- package/build/src/cli/render/contract.d.ts +3 -3
- package/build/src/cli/render/contract.js +200 -54
- package/build/src/cli/render/kanshi.js +272 -129
- 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 -3
- 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 +20 -0
- package/build/src/cli/render/terminal.js +121 -0
- package/build/src/cli/render/text.js +11 -3
- package/build/src/cli/result.d.ts +126 -19
- package/build/src/cli/usage.d.ts +1 -0
- package/build/src/cli/usage.js +3 -0
- package/build/src/contract-worktree.d.ts +44 -0
- package/build/src/contract-worktree.js +251 -0
- package/build/src/coordination/durable-file.d.ts +5 -1
- package/build/src/coordination/durable-file.js +57 -10
- 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/codec.js +23 -4
- package/build/src/core/facts/eligibility.d.ts +1 -10
- package/build/src/core/facts/eligibility.js +0 -49
- 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/facts/observation.d.ts +3 -0
- package/build/src/core/facts/observation.js +12 -0
- package/build/src/core/facts/types.d.ts +10 -3
- package/build/src/core/subject.js +2 -2
- package/build/src/core/verbs/amend.d.ts +1 -1
- package/build/src/core/verbs/amend.js +3 -18
- package/build/src/core/verbs/bind.js +2 -16
- package/build/src/core/verbs/deliver.d.ts +1 -1
- package/build/src/core/verbs/deliver.js +14 -4
- package/build/src/core/verbs/placement.d.ts +1 -1
- package/build/src/core/verbs/placement.js +7 -9
- package/build/src/dispatch/index.d.ts +5 -3
- package/build/src/dispatch/index.js +30 -21
- package/build/src/duration.d.ts +10 -0
- package/build/src/duration.js +22 -0
- package/build/src/git/admission.d.ts +2 -2
- package/build/src/git/admission.js +33 -23
- package/build/src/git/hooks.d.ts +15 -0
- package/build/src/git/hooks.js +70 -18
- package/build/src/git/identity.d.ts +5 -1
- package/build/src/git/identity.js +23 -4
- package/build/src/git/integration.d.ts +48 -0
- package/build/src/git/integration.js +250 -0
- package/build/src/git/observe.d.ts +29 -15
- package/build/src/git/observe.js +185 -76
- package/build/src/git/read-observation.d.ts +41 -0
- package/build/src/git/read-observation.js +361 -0
- package/build/src/git/reconcile.d.ts +17 -5
- package/build/src/git/reconcile.js +305 -109
- package/build/src/git/repository.d.ts +41 -18
- package/build/src/git/repository.js +220 -114
- package/build/src/git/scratch.d.ts +17 -0
- package/build/src/git/scratch.js +73 -0
- package/build/src/git/target-placement.d.ts +92 -0
- package/build/src/git/target-placement.js +375 -0
- package/build/src/git/tender.d.ts +49 -0
- package/build/src/git/tender.js +63 -0
- package/build/src/git/terminal-seal.d.ts +24 -0
- package/build/src/git/terminal-seal.js +89 -0
- package/build/src/git/tree.d.ts +2 -2
- package/build/src/git/tree.js +4 -0
- package/build/src/git/workspace.d.ts +53 -0
- package/build/src/git/workspace.js +139 -0
- package/build/src/identity/selector.d.ts +6 -0
- package/build/src/identity/selector.js +19 -0
- package/build/src/index.d.ts +4 -2
- package/build/src/index.js +2 -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 +7 -3
- package/build/src/kanshi/read.js +245 -45
- package/build/src/kanshi/report.d.ts +81 -6
- package/build/src/kanshi/select.d.ts +5 -0
- package/build/src/kanshi/select.js +33 -1
- package/build/src/library/address.d.ts +57 -0
- package/build/src/library/address.js +165 -0
- package/build/src/library/akuma-creation.d.ts +16 -7
- package/build/src/library/akuma-creation.js +96 -22
- package/build/src/library/audit.d.ts +18 -0
- package/build/src/library/audit.js +44 -0
- package/build/src/library/bind.d.ts +21 -0
- package/build/src/library/bind.js +56 -0
- package/build/src/library/catalog.d.ts +58 -0
- package/build/src/library/catalog.js +69 -0
- package/build/src/library/configuration.d.ts +6 -15
- package/build/src/library/configuration.js +14 -17
- package/build/src/library/contract.d.ts +23 -49
- package/build/src/library/contract.js +171 -185
- package/build/src/library/delivery.d.ts +24 -0
- package/build/src/library/delivery.js +21 -0
- package/build/src/library/fleet.d.ts +65 -0
- package/build/src/library/fleet.js +153 -0
- package/build/src/library/input.d.ts +3 -0
- package/build/src/library/input.js +19 -0
- package/build/src/library/keiyaku.d.ts +18 -3
- package/build/src/library/keiyaku.js +12 -1
- package/build/src/library/mutation.d.ts +39 -0
- package/build/src/library/mutation.js +37 -0
- package/build/src/library/reconcile.d.ts +29 -0
- package/build/src/library/reconcile.js +179 -0
- package/build/src/library/refusal.d.ts +21 -0
- package/build/src/library/refusal.js +29 -0
- package/build/src/library/region.d.ts +14 -1
- package/build/src/library/region.js +18 -4
- package/build/src/library/repo.d.ts +4 -13
- package/build/src/library/repo.js +14 -24
- package/build/src/protocol/attempt.d.ts +16 -3
- package/build/src/protocol/attempt.js +41 -10
- package/build/src/protocol/bind.d.ts +9 -2
- package/build/src/protocol/bind.js +48 -40
- package/build/src/protocol/intent.d.ts +57 -20
- package/build/src/protocol/intent.js +55 -79
- package/build/src/protocol/operations.d.ts +152 -43
- package/build/src/protocol/operations.js +482 -166
- package/build/src/protocol/outcome.d.ts +14 -3
- package/build/src/protocol/outcome.js +11 -3
- package/build/src/protocol/placement.d.ts +41 -0
- package/build/src/protocol/placement.js +147 -0
- package/build/src/protocol/read/documents.d.ts +2 -2
- package/build/src/protocol/read/documents.js +4 -4
- package/build/src/protocol/read/status.d.ts +18 -5
- package/build/src/protocol/read/status.js +73 -13
- package/build/src/protocol/run.d.ts +49 -7
- package/build/src/protocol/run.js +53 -25
- package/build/src/runtime/proc/line-rpc.d.ts +4 -8
- package/build/src/runtime/proc/line-rpc.js +22 -28
- package/build/src/runtime/proc/run.d.ts +23 -21
- package/build/src/runtime/proc/run.js +123 -89
- 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 +7 -1
- package/build/src/settings.js +32 -17
- package/build/src/settlement/fence.d.ts +5 -0
- package/build/src/settlement/fence.js +14 -0
- package/build/src/settlement/holder.d.ts +35 -4
- package/build/src/settlement/holder.js +127 -28
- package/build/src/settlement/settle.d.ts +9 -1
- package/build/src/settlement/settle.js +74 -37
- package/build/src/task/board.d.ts +23 -5
- package/build/src/task/board.js +17 -10
- package/build/src/task/compose.d.ts +2 -2
- package/build/src/task/compose.js +18 -10
- package/build/src/task/context.d.ts +3 -3
- package/build/src/task/context.js +15 -20
- package/build/src/task/document.d.ts +2 -1
- package/build/src/task/document.js +15 -5
- package/build/src/task/index.d.ts +27 -15
- package/build/src/task/index.js +57 -35
- package/build/src/task/operations.d.ts +38 -13
- package/build/src/task/operations.js +80 -46
- package/build/src/task/query.d.ts +67 -0
- package/build/src/task/query.js +279 -0
- package/build/src/task/store.d.ts +5 -7
- package/build/src/task/store.js +43 -28
- package/build/src/verification/declaration.d.ts +1 -0
- package/build/src/verification/execution.d.ts +51 -0
- package/build/src/verification/execution.js +108 -0
- package/build/src/workspace-place.d.ts +41 -0
- package/build/src/workspace-place.js +386 -0
- package/build/src/world.d.ts +24 -0
- package/build/src/world.js +136 -0
- package/package.json +8 -4
- package/build/src/akuma/activity.d.ts +0 -66
- package/build/src/akuma/activity.js +0 -139
- package/build/src/akuma/providers/claude.js +0 -305
- package/build/src/context-root.d.ts +0 -4
- package/build/src/context-root.js +0 -15
- package/build/src/git/delivery.d.ts +0 -20
- package/build/src/git/delivery.js +0 -109
- package/build/src/git/verification.d.ts +0 -14
- package/build/src/git/verification.js +0 -56
- package/build/src/protocol/read/audit.d.ts +0 -25
- package/build/src/protocol/read/audit.js +0 -39
- package/build/src/verification/producer.d.ts +0 -23
- package/build/src/verification/producer.js +0 -54
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { CliUsageError, usageLine } from "../usage.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { CliUsageError, isBlankInput, usageLine } from "../usage.js";
|
|
2
|
+
import { archetypeName, parseAkuId } from "../../akuma/identity.js";
|
|
3
|
+
import { parseDuration as decodeDuration } from "../../duration.js";
|
|
4
|
+
import { parseAkumaAlias, parseAkumaGlob } from "../../identity/selector.js";
|
|
4
5
|
const AKUMA_COMMAND_SPECS = {
|
|
5
6
|
call: {
|
|
6
7
|
arity: 1,
|
|
@@ -8,41 +9,43 @@ const AKUMA_COMMAND_SPECS = {
|
|
|
8
9
|
flags: {
|
|
9
10
|
contract: "value",
|
|
10
11
|
alias: "value",
|
|
11
|
-
|
|
12
|
-
wait: "boolean",
|
|
13
|
-
timeout: "value",
|
|
12
|
+
wait: "value",
|
|
14
13
|
detach: "boolean",
|
|
15
14
|
json: "boolean",
|
|
16
15
|
},
|
|
17
|
-
usage: "call <akuma> [--contract <kei/...>] [--alias @name] [--
|
|
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
|
-
arity:
|
|
27
|
+
arity: "one-or-more",
|
|
22
28
|
stdin: false,
|
|
23
|
-
flags: { timeout: "value", json: "boolean" },
|
|
24
|
-
usage: "wait <
|
|
25
|
-
purpose: "Wait for one Akuma or
|
|
29
|
+
flags: { any: "boolean", all: "boolean", timeout: "value", json: "boolean" },
|
|
30
|
+
usage: "wait <akuma-selector>... [--any | --all] [--timeout <duration>] [--json]",
|
|
31
|
+
purpose: "Wait for one Akuma or an explicitly selected Akuma set.",
|
|
26
32
|
},
|
|
27
33
|
tell: {
|
|
28
34
|
arity: 1,
|
|
29
35
|
stdin: true,
|
|
30
|
-
flags: { json: "boolean" },
|
|
31
|
-
usage: "tell <aku
|
|
32
|
-
purpose: "
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
flags: { json: "boolean" },
|
|
38
|
-
usage: "interrupt <aku/...> [--json] -",
|
|
39
|
-
purpose: "Put down the current body and deliver an stdin body.",
|
|
36
|
+
flags: { interrupt: "boolean", json: "boolean" },
|
|
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"),
|
|
40
43
|
},
|
|
41
44
|
history: {
|
|
42
45
|
arity: 1,
|
|
43
46
|
stdin: false,
|
|
44
|
-
flags: { before: "value", since: "value", last: "boolean", json: "boolean" },
|
|
45
|
-
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]",
|
|
46
49
|
purpose: "Read the persistent execution history or the last answer.",
|
|
47
50
|
},
|
|
48
51
|
fork: {
|
|
@@ -53,11 +56,11 @@ const AKUMA_COMMAND_SPECS = {
|
|
|
53
56
|
purpose: "Fork one Akuma at a retained answered history point.",
|
|
54
57
|
},
|
|
55
58
|
kill: {
|
|
56
|
-
arity:
|
|
59
|
+
arity: "one-or-more",
|
|
57
60
|
stdin: false,
|
|
58
61
|
flags: { json: "boolean" },
|
|
59
|
-
usage: "kill <
|
|
60
|
-
purpose: "
|
|
62
|
+
usage: "kill <akuma-selector>... [--json]",
|
|
63
|
+
purpose: "Put down the current Body of an Akuma selector snapshot.",
|
|
61
64
|
},
|
|
62
65
|
};
|
|
63
66
|
export function isAkumaAction(value) {
|
|
@@ -71,25 +74,35 @@ export function renderAkumaRootRows() {
|
|
|
71
74
|
}
|
|
72
75
|
export function renderAkumaHelp(action) {
|
|
73
76
|
const spec = AKUMA_COMMAND_SPECS[action];
|
|
74
|
-
return `${spec.purpose}\n\n${usageLine(spec.usage)}`;
|
|
77
|
+
return `${spec.purpose}\n\n${usageLine(spec.usage)}${spec.details === undefined ? "" : `\n\n${spec.details}`}`;
|
|
75
78
|
}
|
|
76
79
|
export function renderAkumaUsage(action) {
|
|
77
80
|
return usageLine(AKUMA_COMMAND_SPECS[action].usage);
|
|
78
81
|
}
|
|
82
|
+
export function parseAkumaCatalogPath(value) {
|
|
83
|
+
if (value === "aku/")
|
|
84
|
+
return { kind: "archetypes" };
|
|
85
|
+
if (value === "aku/*/*")
|
|
86
|
+
return { kind: "akuma" };
|
|
87
|
+
const match = /^aku\/(.+)\/$/u.exec(value);
|
|
88
|
+
if (match === null)
|
|
89
|
+
return null;
|
|
90
|
+
return { kind: "akuma", archetype: archetypeName(match[1]) };
|
|
91
|
+
}
|
|
79
92
|
function stringFlag(value, diagnostic, fail) {
|
|
80
93
|
if (typeof value !== "string")
|
|
81
94
|
fail(diagnostic);
|
|
82
95
|
return value;
|
|
83
96
|
}
|
|
84
|
-
function parseDuration(raw, fail) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
if (
|
|
91
|
-
fail(
|
|
92
|
-
return
|
|
97
|
+
function parseDuration(raw, option, fail) {
|
|
98
|
+
if (typeof raw !== "string")
|
|
99
|
+
fail(`${option} requires an integer duration with unit ms, s, m, or h`);
|
|
100
|
+
const duration = decodeDuration(raw);
|
|
101
|
+
if (duration.kind === "invalid")
|
|
102
|
+
fail(`${option} requires an integer duration with unit ms, s, m, or h`);
|
|
103
|
+
if (duration.kind === "overflow")
|
|
104
|
+
fail(`${option} duration exceeds the safe millisecond range`);
|
|
105
|
+
return duration.milliseconds;
|
|
93
106
|
}
|
|
94
107
|
function scanAkuma(action, argv, fail) {
|
|
95
108
|
const spec = AKUMA_COMMAND_SPECS[action];
|
|
@@ -110,8 +123,11 @@ function scanAkuma(action, argv, fail) {
|
|
|
110
123
|
fail("duplicate option: --detach");
|
|
111
124
|
flags.detach = true;
|
|
112
125
|
}
|
|
113
|
-
else if (!token.startsWith("--"))
|
|
126
|
+
else if (!token.startsWith("--")) {
|
|
127
|
+
if (isBlankInput(token))
|
|
128
|
+
fail(`${action} requires a nonblank value`);
|
|
114
129
|
positionals.push(token);
|
|
130
|
+
}
|
|
115
131
|
else {
|
|
116
132
|
const name = token.slice(2);
|
|
117
133
|
const kind = spec.flags[name];
|
|
@@ -126,6 +142,8 @@ function scanAkuma(action, argv, fail) {
|
|
|
126
142
|
if (value === undefined || value === "-" || value === "-d" || value.startsWith("--")) {
|
|
127
143
|
fail(`${token} requires a value`);
|
|
128
144
|
}
|
|
145
|
+
if (isBlankInput(value))
|
|
146
|
+
fail(`${token} requires a nonblank value`);
|
|
129
147
|
flags[name] = value;
|
|
130
148
|
index += 1;
|
|
131
149
|
}
|
|
@@ -141,44 +159,94 @@ function positiveIndex(raw, option, fail) {
|
|
|
141
159
|
fail(`${option} exceeds the safe integer range`);
|
|
142
160
|
return value;
|
|
143
161
|
}
|
|
144
|
-
function
|
|
145
|
-
let id;
|
|
162
|
+
function validateDirect(value, fail) {
|
|
146
163
|
try {
|
|
147
|
-
|
|
164
|
+
if (value.startsWith("@"))
|
|
165
|
+
parseAkumaAlias(value);
|
|
166
|
+
else
|
|
167
|
+
parseAkuId(value);
|
|
148
168
|
}
|
|
149
169
|
catch (error) {
|
|
150
|
-
fail(error instanceof Error ? error.message : "invalid Akuma
|
|
170
|
+
fail(error instanceof Error ? error.message : "invalid Akuma selector");
|
|
151
171
|
}
|
|
152
|
-
|
|
153
|
-
|
|
172
|
+
return value;
|
|
173
|
+
}
|
|
174
|
+
function validateSet(value, fail) {
|
|
175
|
+
if (value.startsWith("kei/"))
|
|
176
|
+
return value;
|
|
177
|
+
if (value.includes("*")) {
|
|
178
|
+
try {
|
|
179
|
+
parseAkumaGlob(value);
|
|
180
|
+
}
|
|
181
|
+
catch (error) {
|
|
182
|
+
fail(error instanceof Error ? error.message : `invalid Akuma glob: ${value}`);
|
|
183
|
+
}
|
|
184
|
+
return value;
|
|
154
185
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
186
|
+
return validateDirect(value, fail);
|
|
187
|
+
}
|
|
188
|
+
function parseWait(rawSelectors, flags, output, fail) {
|
|
189
|
+
if (flags.any === true && flags.all === true)
|
|
190
|
+
fail("wait --any and --all are mutually exclusive");
|
|
191
|
+
if (rawSelectors.length > 1 && flags.any !== true && flags.all !== true) {
|
|
192
|
+
fail("wait requires --any or --all when selecting multiple Akuma");
|
|
160
193
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
194
|
+
const completion = flags.any === true ? "any" : flags.all === true ? "all" : undefined;
|
|
195
|
+
return {
|
|
196
|
+
command: "wait",
|
|
197
|
+
akuma: rawSelectors.map((value) => validateSet(value, fail)),
|
|
198
|
+
...(completion === undefined ? {} : { completion }),
|
|
199
|
+
...(flags.timeout === undefined ? {} : { timeoutMs: parseDuration(flags.timeout, "--timeout", fail) }),
|
|
200
|
+
output,
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
function parseHistory(akuma, flags, output, fail) {
|
|
204
|
+
if (flags.before !== undefined && flags.since !== undefined)
|
|
205
|
+
fail("history --before and --since are mutually exclusive");
|
|
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");
|
|
175
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");
|
|
212
|
+
return {
|
|
213
|
+
command: "history",
|
|
214
|
+
akuma,
|
|
215
|
+
last: flags.last === true,
|
|
216
|
+
...(flags.before === undefined ? {} : { before: positiveIndex(flags.before, "--before", fail) }),
|
|
217
|
+
...(flags.since === undefined ? {} : { since: positiveIndex(flags.since, "--since", fail) }),
|
|
218
|
+
...(limit === undefined ? {} : { limit }),
|
|
219
|
+
output,
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
function parseAddressed(action, rawSelectors, flags, output, fail) {
|
|
223
|
+
if (action === "kill")
|
|
224
|
+
return { command: action, akuma: rawSelectors.map((value) => validateSet(value, fail)), output };
|
|
225
|
+
if (action === "wait")
|
|
226
|
+
return parseWait(rawSelectors, flags, output, fail);
|
|
227
|
+
const akuma = validateDirect(rawSelectors[0], fail);
|
|
228
|
+
if (action === "history")
|
|
229
|
+
return parseHistory(akuma, flags, output, fail);
|
|
176
230
|
const at = stringFlag(flags.at, "fork requires --at <historyId>", fail);
|
|
177
|
-
|
|
178
|
-
fail("fork requires --at <historyId>");
|
|
179
|
-
return { command: action, id, at, output };
|
|
231
|
+
return { command: action, akuma, at, output };
|
|
180
232
|
}
|
|
181
|
-
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) {
|
|
182
250
|
let alias;
|
|
183
251
|
if (flags.alias !== undefined) {
|
|
184
252
|
try {
|
|
@@ -188,20 +256,18 @@ function parseCall(flags, positionals, output, fail) {
|
|
|
188
256
|
fail(error instanceof Error ? error.message : "invalid Akuma alias");
|
|
189
257
|
}
|
|
190
258
|
}
|
|
191
|
-
if (flags.detach === true && flags.wait
|
|
259
|
+
if (flags.detach === true && flags.wait !== undefined)
|
|
192
260
|
fail("call --wait and --detach are mutually exclusive");
|
|
193
|
-
if (flags.detach === true && flags.timeout !== undefined)
|
|
194
|
-
fail("call --timeout and --detach are mutually exclusive");
|
|
195
261
|
const mode = flags.detach === true ? "detach" : "wait";
|
|
196
|
-
const timeoutMs = flags.
|
|
262
|
+
const timeoutMs = flags.wait === undefined ? undefined : parseDuration(flags.wait, "--wait", fail);
|
|
197
263
|
return {
|
|
198
264
|
command: "call",
|
|
199
|
-
archetype
|
|
265
|
+
archetype,
|
|
200
266
|
...(typeof flags.contract === "string" ? { contract: flags.contract } : {}),
|
|
201
267
|
...(alias === undefined ? {} : { alias }),
|
|
202
|
-
...(typeof flags.workdir === "string" ? { workdir: flags.workdir } : {}),
|
|
203
268
|
mode,
|
|
204
269
|
...(timeoutMs === undefined ? {} : { timeoutMs }),
|
|
270
|
+
prompt,
|
|
205
271
|
output,
|
|
206
272
|
};
|
|
207
273
|
}
|
|
@@ -213,12 +279,17 @@ export function parseAkumaCommand(argv) {
|
|
|
213
279
|
const spec = AKUMA_COMMAND_SPECS[action];
|
|
214
280
|
const fail = (message) => { throw new CliUsageError(message, renderAkumaUsage(action)); };
|
|
215
281
|
const { flags, positionals, stdin } = scanAkuma(action, argv, fail);
|
|
216
|
-
if (positionals.length !== spec.arity)
|
|
217
|
-
fail(`${action} has invalid positional arguments`);
|
|
218
|
-
if (stdin !== spec.stdin)
|
|
219
|
-
fail(`${action} ${spec.stdin ? "requires" : "reads no"} stdin`);
|
|
220
282
|
const output = flags.json === true ? "json" : "text";
|
|
221
|
-
if (action === "call")
|
|
222
|
-
|
|
223
|
-
|
|
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
|
+
}
|
|
289
|
+
if (spec.arity === "one-or-more" ? positionals.length === 0 : positionals.length !== spec.arity) {
|
|
290
|
+
fail(`${action} has invalid positional arguments`);
|
|
291
|
+
}
|
|
292
|
+
if (stdin)
|
|
293
|
+
fail(`${action} reads no stdin`);
|
|
294
|
+
return parseAddressed(action, positionals, flags, output, fail);
|
|
224
295
|
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
export type ContractFlagKind = "boolean" | "value" | "repeat-value";
|
|
2
|
+
export type ContractCommandSpec = Readonly<{
|
|
3
|
+
positional: "none" | "optional";
|
|
4
|
+
stdin: "none" | "optional" | "required";
|
|
5
|
+
flags: Readonly<Record<string, ContractFlagKind>>;
|
|
6
|
+
usage: string;
|
|
7
|
+
purpose: string;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const AMEND_MINIMAL_STDIN_HELP: string;
|
|
10
|
+
export declare const CONTRACT_COMMAND_SPECS: {
|
|
11
|
+
readonly bind: {
|
|
12
|
+
readonly positional: "none";
|
|
13
|
+
readonly stdin: "required";
|
|
14
|
+
readonly flags: {
|
|
15
|
+
readonly actor: "value";
|
|
16
|
+
readonly task: "value";
|
|
17
|
+
readonly target: "value";
|
|
18
|
+
readonly here: "boolean";
|
|
19
|
+
readonly after: "repeat-value";
|
|
20
|
+
readonly gates: "value";
|
|
21
|
+
readonly json: "boolean";
|
|
22
|
+
};
|
|
23
|
+
readonly usage: "bind [--task <task/...>] [--target <ref>] [--here] [--after <kei/...> ...] [--gates <name>] [--actor <actor>] [--json] -";
|
|
24
|
+
readonly purpose: "Create one Contract from stdin Markdown.";
|
|
25
|
+
};
|
|
26
|
+
readonly amend: {
|
|
27
|
+
readonly positional: "optional";
|
|
28
|
+
readonly stdin: "required";
|
|
29
|
+
readonly flags: {
|
|
30
|
+
readonly actor: "value";
|
|
31
|
+
readonly after: "repeat-value";
|
|
32
|
+
readonly "clear-after": "boolean";
|
|
33
|
+
readonly gates: "value";
|
|
34
|
+
readonly json: "boolean";
|
|
35
|
+
};
|
|
36
|
+
readonly usage: "amend [<contract>|@<contract>] [--after <kei/...> ... | --clear-after] [--gates <name>] [--actor <actor>] [--json] -";
|
|
37
|
+
readonly purpose: "Apply stdin amendment operations to one Contract.";
|
|
38
|
+
};
|
|
39
|
+
readonly deliver: {
|
|
40
|
+
readonly positional: "optional";
|
|
41
|
+
readonly stdin: "none";
|
|
42
|
+
readonly flags: {
|
|
43
|
+
readonly actor: "value";
|
|
44
|
+
readonly message: "value";
|
|
45
|
+
readonly "include-dirty": "boolean";
|
|
46
|
+
readonly json: "boolean";
|
|
47
|
+
};
|
|
48
|
+
readonly usage: "deliver [<contract>|@<contract>] [--message <text>] [--include-dirty] [--actor <actor>] [--json]";
|
|
49
|
+
readonly purpose: "Deliver one Contract candidate.";
|
|
50
|
+
};
|
|
51
|
+
readonly review: {
|
|
52
|
+
readonly positional: "optional";
|
|
53
|
+
readonly stdin: "optional";
|
|
54
|
+
readonly flags: {
|
|
55
|
+
readonly actor: "value";
|
|
56
|
+
readonly satisfied: "boolean";
|
|
57
|
+
readonly unsatisfied: "boolean";
|
|
58
|
+
readonly summary: "value";
|
|
59
|
+
readonly json: "boolean";
|
|
60
|
+
};
|
|
61
|
+
readonly usage: "review [<contract>|@<contract>] (--satisfied | --unsatisfied) (--summary <text> | -) [--actor <actor>] [--json]";
|
|
62
|
+
readonly purpose: "Record one review verdict.";
|
|
63
|
+
};
|
|
64
|
+
readonly arc: {
|
|
65
|
+
readonly positional: "optional";
|
|
66
|
+
readonly stdin: "required";
|
|
67
|
+
readonly flags: {
|
|
68
|
+
readonly actor: "value";
|
|
69
|
+
readonly json: "boolean";
|
|
70
|
+
};
|
|
71
|
+
readonly usage: "arc [<contract>|@<contract>] [--actor <actor>] [--json] -";
|
|
72
|
+
readonly purpose: "Record stdin arc Markdown for one Contract.";
|
|
73
|
+
};
|
|
74
|
+
readonly abandon: {
|
|
75
|
+
readonly positional: "optional";
|
|
76
|
+
readonly stdin: "none";
|
|
77
|
+
readonly flags: {
|
|
78
|
+
readonly actor: "value";
|
|
79
|
+
readonly note: "value";
|
|
80
|
+
readonly json: "boolean";
|
|
81
|
+
};
|
|
82
|
+
readonly usage: "abandon [<contract>|@<contract>] [--note <text>] [--actor <actor>] [--json]";
|
|
83
|
+
readonly purpose: "Abandon one Contract with an optional note.";
|
|
84
|
+
};
|
|
85
|
+
readonly status: {
|
|
86
|
+
readonly positional: "optional";
|
|
87
|
+
readonly stdin: "none";
|
|
88
|
+
readonly flags: {
|
|
89
|
+
readonly json: "boolean";
|
|
90
|
+
};
|
|
91
|
+
readonly usage: "status [<contract>|@name|<aku/...>] [--json]";
|
|
92
|
+
readonly purpose: "Read the world status board or one Contract projection.";
|
|
93
|
+
};
|
|
94
|
+
readonly show: {
|
|
95
|
+
readonly positional: "optional";
|
|
96
|
+
readonly stdin: "none";
|
|
97
|
+
readonly flags: {
|
|
98
|
+
readonly json: "boolean";
|
|
99
|
+
};
|
|
100
|
+
readonly usage: "show [<contract>|@<contract>] [--json]";
|
|
101
|
+
readonly purpose: "Read one Contract guidance projection.";
|
|
102
|
+
};
|
|
103
|
+
readonly ls: {
|
|
104
|
+
readonly positional: "optional";
|
|
105
|
+
readonly stdin: "none";
|
|
106
|
+
readonly flags: {
|
|
107
|
+
readonly json: "boolean";
|
|
108
|
+
};
|
|
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]";
|
|
110
|
+
readonly purpose: "List one identity directory.";
|
|
111
|
+
};
|
|
112
|
+
readonly audit: {
|
|
113
|
+
readonly positional: "optional";
|
|
114
|
+
readonly stdin: "none";
|
|
115
|
+
readonly flags: {
|
|
116
|
+
readonly "include-dirty": "boolean";
|
|
117
|
+
readonly diff: "boolean";
|
|
118
|
+
readonly actor: "value";
|
|
119
|
+
readonly json: "boolean";
|
|
120
|
+
};
|
|
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.";
|
|
123
|
+
};
|
|
124
|
+
readonly reconcile: {
|
|
125
|
+
readonly positional: "optional";
|
|
126
|
+
readonly stdin: "none";
|
|
127
|
+
readonly flags: {
|
|
128
|
+
readonly "retry-hooks": "boolean";
|
|
129
|
+
readonly json: "boolean";
|
|
130
|
+
};
|
|
131
|
+
readonly usage: "reconcile [<contract>|@<contract>] [--retry-hooks] [--json]";
|
|
132
|
+
readonly purpose: "Reconcile one Contract or the invocation world.";
|
|
133
|
+
};
|
|
134
|
+
readonly settings: {
|
|
135
|
+
readonly positional: "none";
|
|
136
|
+
readonly stdin: "none";
|
|
137
|
+
readonly flags: {
|
|
138
|
+
readonly json: "boolean";
|
|
139
|
+
};
|
|
140
|
+
readonly usage: "settings [--json]";
|
|
141
|
+
readonly purpose: "Read user and project Settings resources.";
|
|
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
|
+
};
|
|
154
|
+
};
|
|
155
|
+
export type ContractCommand = keyof typeof CONTRACT_COMMAND_SPECS;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const AMEND_MINIMAL_STDIN_HELP = [
|
|
2
|
+
"minimal stdin:",
|
|
3
|
+
" ## Replace: Design",
|
|
4
|
+
" <complete replacement>",
|
|
5
|
+
].join("\n");
|
|
6
|
+
export const CONTRACT_COMMAND_SPECS = {
|
|
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." },
|
|
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." },
|
|
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." },
|
|
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." },
|
|
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." },
|
|
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." },
|
|
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." },
|
|
14
|
+
show: { positional: "optional", stdin: "none", flags: { json: "boolean" }, usage: "show [<contract>|@<contract>] [--json]", purpose: "Read one Contract guidance projection." },
|
|
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." },
|
|
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." },
|
|
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." },
|
|
20
|
+
};
|
|
@@ -70,6 +70,8 @@ function diagnostic(argv, outcome) {
|
|
|
70
70
|
return `${argv[0]} timed out`;
|
|
71
71
|
if (outcome.kind === "unknown-exit")
|
|
72
72
|
return `${argv[0]} exited without a status`;
|
|
73
|
+
if (outcome.kind === "cancelled")
|
|
74
|
+
return `${argv[0]} cancelled`;
|
|
73
75
|
if (outcome.code === 0)
|
|
74
76
|
return "";
|
|
75
77
|
const detail = outcome.stderr.trim() || outcome.stdout.trim();
|
|
@@ -1,9 +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 | 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
|
+
}>;
|
|
4
17
|
type TaskInput = Readonly<{
|
|
5
|
-
|
|
6
|
-
|
|
18
|
+
world: WorldRoot | null;
|
|
19
|
+
establish(): Promise<WorldRoot>;
|
|
20
|
+
readStdin(): Promise<string>;
|
|
21
|
+
actor?: string;
|
|
7
22
|
}>;
|
|
8
23
|
export declare function invokeTask(command: ParsedTaskCommand, input: TaskInput): Promise<TaskInvocationResult>;
|
|
9
24
|
export {};
|