@astrosheep/keiyaku 4.6.32 → 4.6.34
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 +18 -7
- package/build/plugins/claude/skills/keiyaku-akuma/SKILL.md +18 -11
- package/build/plugins/claude/skills/keiyaku-babysit/SKILL.md +8 -6
- package/build/plugins/claude/skills/keiyaku-debt/SKILL.md +2 -1
- package/build/plugins/claude/skills/keiyaku-workflow/SKILL.md +2 -1
- package/build/plugins/codex/skills/keiyaku-akuma/SKILL.md +18 -11
- package/build/plugins/codex/skills/keiyaku-babysit/SKILL.md +8 -6
- package/build/plugins/codex/skills/keiyaku-debt/SKILL.md +2 -1
- package/build/plugins/codex/skills/keiyaku-workflow/SKILL.md +2 -1
- package/build/plugins/opencode/skills/keiyaku-akuma/SKILL.md +18 -11
- package/build/plugins/opencode/skills/keiyaku-babysit/SKILL.md +8 -6
- package/build/plugins/opencode/skills/keiyaku-debt/SKILL.md +2 -1
- package/build/plugins/opencode/skills/keiyaku-workflow/SKILL.md +2 -1
- package/build/plugins/pi/README.md +55 -97
- package/build/plugins/pi/keiyaku.ts +1 -142
- package/build/skills/keiyaku-akuma/SKILL.md +18 -11
- package/build/skills/keiyaku-babysit/SKILL.md +8 -6
- package/build/skills/keiyaku-debt/SKILL.md +2 -1
- package/build/skills/keiyaku-workflow/SKILL.md +2 -1
- package/build/src/akuma/akuma-instance.d.ts +11 -0
- package/build/src/akuma/akuma-instance.js +1 -2
- package/build/src/akuma/akuma-observe.d.ts +8 -0
- package/build/src/akuma/akuma-observe.js +81 -14
- package/build/src/akuma/akuma-owner.d.ts +1 -0
- package/build/src/akuma/akuma-owner.js +3 -5
- package/build/src/akuma/akuma-selection-execution.d.ts +82 -7
- package/build/src/akuma/akuma-selection-execution.js +26 -27
- package/build/src/akuma/akuma-wait.d.ts +155 -1
- package/build/src/akuma/akuma-wait.js +94 -34
- package/build/src/akuma/akuma.d.ts +17 -1
- package/build/src/akuma/akuma.js +37 -18
- package/build/src/akuma/body.js +13 -18
- package/build/src/akuma/call-initial-tell.d.ts +0 -1
- package/build/src/akuma/call-initial-tell.js +0 -1
- package/build/src/akuma/heart/activity-schema.d.ts +16 -0
- package/build/src/akuma/heart/activity-schema.js +7 -0
- package/build/src/akuma/heart/facts.d.ts +1 -0
- package/build/src/akuma/heart/facts.js +14 -0
- package/build/src/akuma/heart/index.d.ts +7 -1
- package/build/src/akuma/heart/index.js +35 -9
- package/build/src/akuma/heart/rows.d.ts +1 -0
- package/build/src/akuma/heart/rows.js +4 -0
- package/build/src/akuma/heart/timeline.js +4 -4
- package/build/src/akuma/lineage-cache.d.ts +7 -2
- package/build/src/akuma/lineage-cache.js +48 -24
- package/build/src/akuma/projection-read.d.ts +4 -2
- package/build/src/akuma/projection-read.js +25 -23
- package/build/src/akuma/projection.d.ts +94 -2
- package/build/src/akuma/projection.js +47 -47
- package/build/src/akuma/provider.d.ts +2 -2
- package/build/src/akuma/provider.js +27 -20
- package/build/src/akuma/providers/acp/core.js +2 -5
- package/build/src/akuma/providers/opencode-sdk/events.d.ts +2 -1
- package/build/src/akuma/providers/opencode-sdk/events.js +31 -1
- package/build/src/akuma/publication.js +3 -2
- package/build/src/akuma/selection-observation.d.ts +645 -0
- package/build/src/akuma/selection-observation.js +22 -7
- package/build/src/akuma/status-projection.d.ts +14 -1
- package/build/src/akuma/status-projection.js +40 -2
- package/build/src/akuma/turn-drive.js +21 -15
- package/build/src/body/amend.js +5 -17
- package/build/src/body/decode.js +11 -1
- package/build/src/body/envelope.d.ts +5 -1
- package/build/src/body/envelope.js +4 -2
- package/build/src/body/render.js +4 -6
- package/build/src/bounded-list.d.ts +8 -0
- package/build/src/bounded-list.js +10 -0
- package/build/src/cli/commands/akuma-grammar.d.ts +5 -8
- package/build/src/cli/commands/akuma-grammar.js +52 -77
- package/build/src/cli/commands/akuma.d.ts +1 -2
- package/build/src/cli/commands/akuma.js +12 -61
- package/build/src/cli/commands/contract-grammar.d.ts +1 -0
- package/build/src/cli/commands/contract-grammar.js +39 -42
- package/build/src/cli/commands/contract-help.d.ts +6 -5
- package/build/src/cli/commands/contract-help.js +21 -13
- package/build/src/cli/commands/contract.d.ts +3 -3
- package/build/src/cli/commands/contract.js +13 -9
- package/build/src/cli/commands/debt-grammar.js +2 -4
- package/build/src/cli/parse.d.ts +4 -10
- package/build/src/cli/parse.js +2 -5
- package/build/src/cli/render/akuma-activity.d.ts +12 -34
- package/build/src/cli/render/akuma-activity.js +99 -180
- package/build/src/cli/render/akuma.d.ts +5 -11
- package/build/src/cli/render/akuma.js +22 -30
- package/build/src/cli/render/catalog.js +4 -6
- package/build/src/cli/render/contract-history.d.ts +1 -3
- package/build/src/cli/render/contract-history.js +70 -49
- package/build/src/cli/render/contract-observation.d.ts +2 -1
- package/build/src/cli/render/contract-observation.js +25 -1
- package/build/src/cli/render/contract-wait.d.ts +2 -2
- package/build/src/cli/render/contract-wait.js +21 -17
- package/build/src/cli/render/contract.js +12 -9
- package/build/src/cli/render/debt.js +1 -2
- package/build/src/cli/render/execution-progress.js +1 -3
- package/build/src/cli/render/kanshi-akuma.d.ts +4 -3
- package/build/src/cli/render/kanshi-akuma.js +27 -23
- package/build/src/cli/render/kanshi.js +45 -60
- package/build/src/cli/render/receipt.d.ts +1 -1
- package/build/src/cli/render/receipt.js +33 -28
- package/build/src/cli/render/reconcile.js +2 -5
- package/build/src/cli/render/refusal.js +3 -6
- package/build/src/cli/render/terminal.d.ts +2 -4
- package/build/src/cli/render/terminal.js +10 -17
- package/build/src/cli/render/verbs.d.ts +1 -0
- package/build/src/cli/render/verbs.js +39 -34
- package/build/src/cli/runtime.js +12 -32
- package/build/src/core/facts/codec.js +7 -2
- package/build/src/core/facts/eligibility.d.ts +4 -4
- package/build/src/core/facts/eligibility.js +11 -0
- package/build/src/core/facts/fold.js +9 -5
- package/build/src/core/facts/gate.d.ts +5 -1
- package/build/src/core/facts/gate.js +14 -10
- package/build/src/core/facts/types.d.ts +5 -1
- package/build/src/core/facts/types.js +7 -0
- package/build/src/core/subject.d.ts +4 -1
- package/build/src/core/subject.js +10 -2
- package/build/src/core/verbs/amend.d.ts +15 -4
- package/build/src/core/verbs/amend.js +19 -9
- package/build/src/debt/board.d.ts +2 -1
- package/build/src/debt/board.js +3 -3
- package/build/src/debt/catalog.js +2 -1
- package/build/src/debt/document.d.ts +1 -0
- package/build/src/debt/document.js +3 -0
- package/build/src/debt/index.d.ts +2 -2
- package/build/src/debt/index.js +9 -14
- package/build/src/debt/input.d.ts +2 -1
- package/build/src/debt/input.js +6 -4
- package/build/src/debt/operations.d.ts +2 -1
- package/build/src/dispatch/index.d.ts +0 -17
- package/build/src/dispatch/index.js +1 -10
- package/build/src/git/identity.js +16 -45
- package/build/src/git/nuke.js +13 -23
- package/build/src/git/observe.d.ts +7 -3
- package/build/src/git/observe.js +29 -26
- package/build/src/git/process.js +11 -18
- package/build/src/git/read-observation.d.ts +5 -4
- package/build/src/git/repository.d.ts +2 -0
- package/build/src/git/repository.js +13 -1
- package/build/src/git/scratch.js +2 -14
- package/build/src/git/terminal-reconcile.js +1 -13
- package/build/src/history.d.ts +26 -0
- package/build/src/history.js +43 -0
- package/build/src/index.d.ts +6 -3
- package/build/src/kanshi/counts.d.ts +15 -1
- package/build/src/kanshi/counts.js +14 -3
- package/build/src/kanshi/index.d.ts +3 -4
- package/build/src/kanshi/index.js +2 -3
- package/build/src/kanshi/read.d.ts +21 -0
- package/build/src/kanshi/read.js +7 -3
- package/build/src/kanshi/report.d.ts +94 -0
- package/build/src/library/address.d.ts +12 -5
- package/build/src/library/address.js +18 -32
- package/build/src/library/akuma-creation.d.ts +39 -0
- package/build/src/library/akuma-creation.js +3 -9
- package/build/src/library/akumas.d.ts +5 -1
- package/build/src/library/akumas.js +11 -5
- package/build/src/library/continuation.d.ts +10 -0
- package/build/src/library/contract-composition.js +10 -10
- package/build/src/library/contract-creation.js +12 -13
- package/build/src/library/contract-outcomes.d.ts +72 -1
- package/build/src/library/contract-outcomes.js +1 -0
- package/build/src/library/contract-types.d.ts +233 -25
- package/build/src/library/contract-types.js +32 -12
- package/build/src/library/contract-wait.d.ts +212 -0
- package/build/src/library/contract-wait.js +65 -49
- package/build/src/library/delivery.d.ts +25 -0
- package/build/src/library/input.d.ts +8 -26
- package/build/src/library/input.js +17 -12
- package/build/src/library/kei.js +167 -90
- package/build/src/library/keiyaku-attribution.d.ts +1 -1
- package/build/src/library/keiyaku-attribution.js +3 -1
- package/build/src/library/keiyaku-classify.js +8 -4
- package/build/src/library/keiyaku-debt.d.ts +8 -7
- package/build/src/library/keiyaku-debt.js +1 -2
- package/build/src/library/keiyaku-identity.d.ts +4 -3
- package/build/src/library/keiyaku-identity.js +35 -7
- package/build/src/library/keiyaku-verbs.d.ts +974 -1409
- package/build/src/library/keiyaku-verbs.js +154 -161
- package/build/src/library/keiyaku-wait.d.ts +753 -0
- package/build/src/library/keiyaku-wait.js +230 -0
- package/build/src/library/keiyaku.d.ts +3110 -29
- package/build/src/library/keiyaku.js +342 -438
- package/build/src/library/model-tools.d.ts +754 -0
- package/build/src/library/model-tools.js +362 -0
- package/build/src/library/outcome.js +5 -6
- package/build/src/library/refusal.d.ts +25 -1
- package/build/src/library/refusal.js +4 -5
- package/build/src/library/selection.d.ts +18 -5
- package/build/src/library/selection.js +11 -5
- package/build/src/mcp/adapter.d.ts +0 -6
- package/build/src/mcp/adapter.js +11 -160
- package/build/src/mcp/description.d.ts +2 -0
- package/build/src/mcp/description.js +2 -0
- package/build/src/mcp/help.d.ts +1 -1
- package/build/src/mcp/help.js +10 -7
- package/build/src/pi/index.d.ts +5 -0
- package/build/src/pi/index.js +99 -0
- package/build/src/pi/status.d.ts +12 -0
- package/build/src/pi/status.js +140 -0
- package/build/src/protocol/amend.d.ts +14 -3
- package/build/src/protocol/amend.js +113 -46
- package/build/src/protocol/bind.d.ts +1 -1
- package/build/src/protocol/bind.js +5 -16
- package/build/src/protocol/completion.d.ts +30 -0
- package/build/src/protocol/completion.js +8 -5
- package/build/src/protocol/deliver.js +7 -20
- package/build/src/protocol/delivery-preview.d.ts +5 -0
- package/build/src/protocol/execution-observation.d.ts +8 -0
- package/build/src/protocol/intent.d.ts +1 -0
- package/build/src/protocol/intent.js +4 -1
- package/build/src/protocol/operations.d.ts +56 -16
- package/build/src/protocol/operations.js +18 -32
- package/build/src/protocol/placement.js +7 -1
- package/build/src/protocol/progress.js +0 -6
- package/build/src/protocol/read/status.d.ts +52 -4
- package/build/src/protocol/read/status.js +26 -22
- package/build/src/protocol/reintegrate.js +2 -2
- package/build/src/protocol/result-leaves.d.ts +56 -8
- package/build/src/protocol/result-leaves.js +11 -2
- package/build/src/protocol/run.js +1 -4
- package/build/src/protocol/verify.d.ts +10 -0
- package/build/src/protocol/verify.js +1 -0
- package/build/src/runtime/proc/windows-launch.exe +0 -0
- package/build/src/settlement/settle.js +19 -68
- package/package.json +7 -3
- package/plugins/paseo/plugin/index.server.ts +6 -2
- package/plugins/paseo/plugin/server/attach.ts +68 -48
- package/plugins/paseo/plugin/server/directory.ts +259 -0
- package/plugins/paseo/plugin/server/mirror-identity.ts +3 -32
- package/plugins/paseo/plugin/server/reopen.ts +52 -38
- package/plugins/pi/README.md +55 -97
- package/plugins/pi/keiyaku.ts +1 -142
- package/skills/keiyaku-akuma/SKILL.md +18 -11
- package/skills/keiyaku-babysit/SKILL.md +8 -6
- package/skills/keiyaku-debt/SKILL.md +2 -1
- package/skills/keiyaku-workflow/SKILL.md +2 -1
- package/build/plugins/pi/akuma-tools.ts +0 -283
- package/build/src/body/keys.d.ts +0 -4
- package/build/src/body/keys.js +0 -11
- package/build/src/kanshi/roster.d.ts +0 -2
- package/build/src/kanshi/roster.js +0 -2
- package/build/src/mcp/output.d.ts +0 -385
- package/build/src/mcp/output.js +0 -193
- package/plugins/pi/akuma-tools.ts +0 -283
|
@@ -50,8 +50,7 @@ export const CONTRACT_COMMAND_SPECS = {
|
|
|
50
50
|
"Region lists the narrowest writes this approach needs, not every file involved;",
|
|
51
51
|
"avoid broad directories and redundant parent/child patterns. Put one repository-relative",
|
|
52
52
|
"pattern per nonblank line: bare lines, list items, or fences (no info string, or",
|
|
53
|
-
"txt) are combined. A trailing '/' means 'path/**'.
|
|
54
|
-
"binds with a warning.",
|
|
53
|
+
"txt) are combined. A trailing '/' means 'path/**'.",
|
|
55
54
|
"",
|
|
56
55
|
"Only explicit verify runs Verification; gate selection controls recording and placement.",
|
|
57
56
|
"Verification uses one or more closed bash, zsh, or pwsh fences. Its fence",
|
|
@@ -62,15 +61,22 @@ export const CONTRACT_COMMAND_SPECS = {
|
|
|
62
61
|
amend: {
|
|
63
62
|
positional: "optional",
|
|
64
63
|
stdin: "optional",
|
|
65
|
-
flags: { after: "repeat", "clear-after": "boolean", gates: "raw-value", json: "boolean" },
|
|
66
|
-
usage: "amend [<contract>|@name] [--after <kei/...> [--after <kei/...>]... | --clear-after] [--gates <name,...>] [--repo <path>] [-]",
|
|
67
|
-
purpose: "Change a Contract's document, prerequisites, or acceptance gates.",
|
|
64
|
+
flags: { after: "repeat", "clear-after": "boolean", gates: "raw-value", target: "value", json: "boolean" },
|
|
65
|
+
usage: "amend [<contract>|@name] [--after <kei/...> [--after <kei/...>]... | --clear-after] [--gates <name,...>] [--target <branch|kei/...>] [--repo <path>] [-]",
|
|
66
|
+
purpose: "Change a Contract's document, target, prerequisites, or acceptance gates.",
|
|
68
67
|
details: [
|
|
69
68
|
"Gates are checked at integration: reviewed needs a satisfied review;",
|
|
70
69
|
"verified needs satisfied evidence for every declaration. --gates <name,...> replaces them with",
|
|
71
70
|
"reviewed, verified, or configured groups (see keiyaku settings).",
|
|
72
71
|
'Omitting --gates keeps them; --gates "" clears them.',
|
|
73
72
|
"",
|
|
73
|
+
"--target explicitly selects an existing local branch or active Contract destination.",
|
|
74
|
+
"Omission keeps the current target, even after its Contract is accepted or abandoned.",
|
|
75
|
+
"Self-targets and destination cycles refuse. Use refs/heads/kei/... for a branch named kei/....",
|
|
76
|
+
"Retargeting requires fresh verify; unchanged candidate content keeps its review.",
|
|
77
|
+
"",
|
|
78
|
+
"Naming no edit at all reports the active Contract unchanged and writes nothing.",
|
|
79
|
+
"",
|
|
74
80
|
"stdin is an amendment; each heading is one edit:",
|
|
75
81
|
" ## Context|Objective|Design|Region|Criteria|Verification|<extension> (replace, or add a new extension)",
|
|
76
82
|
" ## Replace: Context|Objective|Design|Region|Criteria|Verification|<extension>",
|
|
@@ -192,11 +198,11 @@ export const CONTRACT_COMMAND_SPECS = {
|
|
|
192
198
|
positional: "optional",
|
|
193
199
|
stdin: "none",
|
|
194
200
|
flags: { json: "boolean" },
|
|
195
|
-
usage: "show
|
|
201
|
+
usage: "show <contract|@name> [--repo <path>]\nshow <debt/...>",
|
|
196
202
|
purpose: "Read one Contract's guidance or one Debt and its prerequisites.",
|
|
197
203
|
details: [
|
|
198
204
|
"Accepts a complete Contract identity, exact @name short selector, or one complete Debt identity.",
|
|
199
|
-
"
|
|
205
|
+
"An explicit selector is required, including inside a Contract worktree.",
|
|
200
206
|
"Akuma, category, glob, and plural selections are refused before reading.",
|
|
201
207
|
"Debt reads use the invocation World and do not accept --repo.",
|
|
202
208
|
"Text returns Contract guidance directly or renders the Debt owner's detail; --json serializes the same native value.",
|
|
@@ -218,7 +224,8 @@ export const CONTRACT_COMMAND_SPECS = {
|
|
|
218
224
|
purpose: "Show one Contract or Akuma status.",
|
|
219
225
|
details: [
|
|
220
226
|
"Use kanshi for the selector-free World board.",
|
|
221
|
-
"
|
|
227
|
+
"The selector accepts one complete identity or @name (Contract shorthand or World-local Akuma alias).",
|
|
228
|
+
"Names use the shared invocation resolver; a Contract/Akuma collision is refused. Results keep the full canonical id.",
|
|
222
229
|
"Plural selectors, categories, globs and --limit are refused before reading.",
|
|
223
230
|
"Akuma entries show the directory each Akuma was started in.",
|
|
224
231
|
].join("\n"),
|
|
@@ -226,16 +233,17 @@ export const CONTRACT_COMMAND_SPECS = {
|
|
|
226
233
|
ls: {
|
|
227
234
|
positional: "optional",
|
|
228
235
|
stdin: "none",
|
|
229
|
-
flags: { limit: "value", json: "boolean", mine: "boolean",
|
|
230
|
-
usage: 'ls debt[/] [--
|
|
236
|
+
flags: { limit: "value", json: "boolean", mine: "boolean", settled: "boolean", all: "boolean" },
|
|
237
|
+
usage: 'ls debt[/] [--settled | --all] [--limit <count>]\nls kei[/] [--settled | --all] [--limit <count>]\nls aku[/] [--limit <count>]\nls aku/<name>[/] [--settled | --all] [--limit <count>]\nls "aku/<name>/*" [--settled | --all] [--limit <count>]\nls "aku/*" [--settled | --all] [--limit <count>]\nls "aku/*/*" [--settled | --all] [--limit <count>]\nls [aku/<name>[/] | "aku/<name>/*" | "aku/*/*"] --mine [--settled | --all] [--limit <count>]',
|
|
231
238
|
purpose: "List debts (ls debt), contracts (ls kei), or akumas (ls aku).",
|
|
232
239
|
details: [
|
|
233
|
-
"Debt lists
|
|
234
|
-
"
|
|
240
|
+
"Contract, Debt, and Akuma-instance lists select active work by default; --settled selects work at rest and --all selects both.",
|
|
241
|
+
"Contracts are active while bound; accepted and abandoned Contracts are settled. Open Debts are active; done and dropped Debts are settled.",
|
|
242
|
+
"Asleep, killed, and stillborn Akumas are settled; running, unborn, stranded, hung, and untidy Akumas remain active.",
|
|
235
243
|
"ls aku/ lists the spawnable Akuma-name catalog; ls aku/<name> lists recent retained Akuma instances under one name.",
|
|
236
244
|
'ls "aku/<name>/*" is the same roster in glob form; ls "aku/*/*" lists recent retained Akuma instances across names.',
|
|
237
245
|
"--mine selects the caller identity of this process and lists that caller's direct and transitive descendants in this World.",
|
|
238
|
-
"Caller scoping is World-local and refuses for Contract, Debt, or Akuma-name catalogues.",
|
|
246
|
+
"Caller scoping is World-local, composes with lifecycle selection, and refuses for Contract, Debt, or Akuma-name catalogues. Lifecycle selection also refuses for Akuma-name catalogues.",
|
|
239
247
|
"Descendant rows name their immediate calling Akuma beside the row.",
|
|
240
248
|
].join("\n"),
|
|
241
249
|
},
|
|
@@ -3,11 +3,11 @@ import type { PendingRequest, VerbRequest } from "../parse.js";
|
|
|
3
3
|
import { type CliOutcome } from "../streams.js";
|
|
4
4
|
/** Admit bind Markdown before coordinate resolution and retain a malformed draft. */
|
|
5
5
|
export declare function admitBindMarkdown(input: Readonly<{
|
|
6
|
-
|
|
6
|
+
terms: string;
|
|
7
7
|
processCwd?: string;
|
|
8
8
|
cwd?: string;
|
|
9
9
|
}>): Promise<void>;
|
|
10
10
|
export declare function acquireContractRequest(request: Exclude<PendingRequest, {
|
|
11
|
-
name: "spawn" | "tell" | "ask"
|
|
11
|
+
name: "spawn" | "tell" | "ask";
|
|
12
12
|
}>, runtime: CliRuntime): Promise<VerbRequest>;
|
|
13
|
-
export declare function runContractRequest(request: VerbRequest, runtime: CliRuntime
|
|
13
|
+
export declare function runContractRequest(request: VerbRequest, runtime: CliRuntime): Promise<CliOutcome>;
|
|
@@ -15,17 +15,17 @@ function draftWarning(error) {
|
|
|
15
15
|
}
|
|
16
16
|
/** Admit bind Markdown before coordinate resolution and retain a malformed draft. */
|
|
17
17
|
export async function admitBindMarkdown(input) {
|
|
18
|
-
if (isBlankInput(input.
|
|
18
|
+
if (isBlankInput(input.terms))
|
|
19
19
|
throw new CliUsageError("bind requires a nonblank stdin document");
|
|
20
20
|
try {
|
|
21
|
-
validateContractMarkdown(input.
|
|
21
|
+
validateContractMarkdown(input.terms);
|
|
22
22
|
}
|
|
23
23
|
catch (error) {
|
|
24
24
|
if (error instanceof Error && "executionReceipt" in error)
|
|
25
25
|
throw error;
|
|
26
26
|
if (errorCategory(error) !== "invalid-input")
|
|
27
27
|
throw error;
|
|
28
|
-
throw new BindDraftError(error, await bindDraftReceipt(() => resolveInvocationCwd(input), input.
|
|
28
|
+
throw new BindDraftError(error, await bindDraftReceipt(() => resolveInvocationCwd(input), input.terms));
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
async function bindDraftReceipt(world, markdown) {
|
|
@@ -47,13 +47,18 @@ export async function acquireContractRequest(request, runtime) {
|
|
|
47
47
|
}
|
|
48
48
|
if (request.name === "amend" && isBlankInput(bytes))
|
|
49
49
|
throw new CliUsageError("amend requires a nonblank stdin document");
|
|
50
|
-
|
|
50
|
+
if (request.name === "bind")
|
|
51
|
+
return { name: request.name, input: { ...request.input, terms: bytes }, output: request.output };
|
|
52
|
+
if (request.name === "amend")
|
|
53
|
+
return { name: request.name, input: { ...request.input, edits: bytes }, output: request.output };
|
|
54
|
+
return { name: request.name, input: { ...request.input, body: bytes }, output: request.output };
|
|
51
55
|
}
|
|
52
|
-
async function invokeAndFinish(request, runtime
|
|
56
|
+
async function invokeAndFinish(request, runtime) {
|
|
53
57
|
const progressing = request.name === "deliver" || request.name === "verify" || request.name === "review";
|
|
54
58
|
const driver = progressing && request.output === "text" ? await runtime.progress() : undefined;
|
|
55
59
|
const cancellable = progressing ||
|
|
56
60
|
request.name === "wait" ||
|
|
61
|
+
request.name === "spawn" ||
|
|
57
62
|
request.name === "tell" ||
|
|
58
63
|
request.name === "fork" ||
|
|
59
64
|
request.name === "kill";
|
|
@@ -69,7 +74,6 @@ async function invokeAndFinish(request, runtime, alias) {
|
|
|
69
74
|
const completion = { kind: "returned", value };
|
|
70
75
|
return emit(request.output, value, () => renderVerb(request.name, request.input, completion, {
|
|
71
76
|
...displayContext(),
|
|
72
|
-
...(alias === undefined ? {} : { alias }),
|
|
73
77
|
...(request.name === "ls" &&
|
|
74
78
|
"mine" in request.input &&
|
|
75
79
|
request.input.mine === true &&
|
|
@@ -82,7 +86,7 @@ async function runBind(request, runtime) {
|
|
|
82
86
|
const { input, output } = request;
|
|
83
87
|
if ("forkOf" in input)
|
|
84
88
|
return invokeAndFinish(request, runtime);
|
|
85
|
-
const markdown = input.
|
|
89
|
+
const markdown = input.terms;
|
|
86
90
|
try {
|
|
87
91
|
const answer = await runtime.facet.run("bind", input);
|
|
88
92
|
const completion = { kind: "returned", value: answer };
|
|
@@ -102,7 +106,7 @@ async function runBind(request, runtime) {
|
|
|
102
106
|
throw new BindDraftError(error, await bindDraftReceipt(runtime.draftWorld, markdown));
|
|
103
107
|
}
|
|
104
108
|
}
|
|
105
|
-
export async function runContractRequest(request, runtime
|
|
109
|
+
export async function runContractRequest(request, runtime) {
|
|
106
110
|
if (request.name === "bind")
|
|
107
111
|
return runBind(request, runtime);
|
|
108
112
|
if (request.name === "arc") {
|
|
@@ -119,5 +123,5 @@ export async function runContractRequest(request, runtime, alias) {
|
|
|
119
123
|
}
|
|
120
124
|
if (request.name === "review" && isBlankInput(request.input.summary))
|
|
121
125
|
throw new CliUsageError("review requires a nonblank summary");
|
|
122
|
-
return invokeAndFinish(request, runtime
|
|
126
|
+
return invokeAndFinish(request, runtime);
|
|
123
127
|
}
|
|
@@ -98,8 +98,6 @@ function validateUpdate(scanned, fail) {
|
|
|
98
98
|
if (Object.keys(flags).every((name) => name === "json"))
|
|
99
99
|
fail("debt update requires at least one update option");
|
|
100
100
|
}
|
|
101
|
-
/** Actions whose positionals are all addressed DebtIds validated by the native owner. */
|
|
102
|
-
const DEBT_ID_ACTIONS = new Set(["update"]);
|
|
103
101
|
/** Validate every addressed DebtId positional through the native owner before any read or write. */
|
|
104
102
|
function validateDebtIdPositionals(positionals, fail) {
|
|
105
103
|
for (const debtId of positionals) {
|
|
@@ -123,10 +121,10 @@ function validateDebtScan(action, scanned, fail) {
|
|
|
123
121
|
fail("debt add requires either TITLE or '-' input");
|
|
124
122
|
if (action === "add" && stdin === "document" && Object.keys(flags).some((name) => name !== "json"))
|
|
125
123
|
fail("debt add document input owns its creation fields");
|
|
126
|
-
if (
|
|
124
|
+
if (action === "update") {
|
|
127
125
|
validateDebtIdPositionals(positionals, fail);
|
|
128
|
-
if (action === "update")
|
|
129
126
|
validateUpdate(scanned, fail);
|
|
127
|
+
}
|
|
130
128
|
}
|
|
131
129
|
export function parseDebtCommand(argv) {
|
|
132
130
|
const candidate = argv[0];
|
package/build/src/cli/parse.d.ts
CHANGED
|
@@ -21,23 +21,23 @@ export type VerbRequest<K extends CliVerb = CliVerb> = {
|
|
|
21
21
|
}>;
|
|
22
22
|
}[K];
|
|
23
23
|
type DocumentBind = Extract<VerbInput<"bind">, {
|
|
24
|
-
|
|
24
|
+
terms: string;
|
|
25
25
|
}>;
|
|
26
26
|
type Acquisitions = {
|
|
27
27
|
bind: {
|
|
28
|
-
input: Omit<DocumentBind, "
|
|
28
|
+
input: Omit<DocumentBind, "terms">;
|
|
29
29
|
acquire: {
|
|
30
30
|
markdown: true;
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
amend: {
|
|
34
|
-
input: Omit<VerbInput<"amend">, "
|
|
34
|
+
input: Omit<VerbInput<"amend">, "edits">;
|
|
35
35
|
acquire: {
|
|
36
36
|
markdown: true;
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
39
|
arc: {
|
|
40
|
-
input: Omit<VerbInput<"arc">, "
|
|
40
|
+
input: Omit<VerbInput<"arc">, "body">;
|
|
41
41
|
acquire: {
|
|
42
42
|
markdown: true;
|
|
43
43
|
};
|
|
@@ -54,12 +54,6 @@ type Acquisitions = {
|
|
|
54
54
|
prompt?: AkumaPromptSource;
|
|
55
55
|
};
|
|
56
56
|
};
|
|
57
|
-
status: {
|
|
58
|
-
input: Record<string, never>;
|
|
59
|
-
acquire: {
|
|
60
|
-
selector: string;
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
57
|
tell: {
|
|
64
58
|
input: Omit<VerbInput<"tell">, "prompt">;
|
|
65
59
|
acquire: {
|
package/build/src/cli/parse.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isDebtAction, parseDebtCommand, renderDebtHelp, debtUsageGuide, } from "./commands/debt-grammar.js";
|
|
2
2
|
import { akumaUsageGuide, isAkumaAction, parseAkumaCommand, renderAkumaHelp, renderAkumaRootRows, } from "./commands/akuma-grammar.js";
|
|
3
3
|
import { INSTALL_ROOT_PURPOSE, INSTALL_USAGE, parseInstallCommand, renderInstallHelp, } from "./commands/install.js";
|
|
4
|
-
import { parseContractCommand } from "./commands/contract-grammar.js";
|
|
4
|
+
import { parseContractCommand, refuse } from "./commands/contract-grammar.js";
|
|
5
5
|
import { CONTRACT_COMMAND_SPECS, renderContractHelp as renderContractHelpForOwner, } from "./commands/contract-help.js";
|
|
6
6
|
import { renderOpaqueBlock, renderTextBlock } from "./render/terminal.js";
|
|
7
7
|
import { scanArgs } from "./scan.js";
|
|
@@ -113,7 +113,7 @@ export function commandRepoPolicy(command) {
|
|
|
113
113
|
case "region":
|
|
114
114
|
return { use: "required", acceptsExplicit: true };
|
|
115
115
|
case "show": {
|
|
116
|
-
const debt = command.input.
|
|
116
|
+
const debt = command.input.selector.startsWith("debt/");
|
|
117
117
|
return { use: debt ? "none" : "required", acceptsExplicit: !debt };
|
|
118
118
|
}
|
|
119
119
|
case "ls":
|
|
@@ -166,9 +166,6 @@ export function assertExplicitRepoUse(command, repo) {
|
|
|
166
166
|
if (repo !== undefined && !commandRepoPolicy(command).acceptsExplicit)
|
|
167
167
|
refuseUnusedRepo(command);
|
|
168
168
|
}
|
|
169
|
-
function refuse(command, message) {
|
|
170
|
-
throw new CliUsageError(message, commandGuide(command, CONTRACT_COMMAND_SPECS[command].usage));
|
|
171
|
-
}
|
|
172
169
|
/** The contract surfaces' one scan spec: `-` carries the edge's own stdin input. */
|
|
173
170
|
function contractScanSpec(command, spec) {
|
|
174
171
|
return {
|
|
@@ -33,8 +33,10 @@ type DisplayAssociation = Readonly<{
|
|
|
33
33
|
/** Indent already-decided supporting lines one level, for every caller of this family. */
|
|
34
34
|
export declare function subordinateLines(lines: readonly string[]): readonly string[];
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
36
|
+
* The one observation identity line: complete Akuma identity, optional alias as a parenthetical
|
|
37
|
+
* supplement, and a known associated Contract inline behind the shared separator.
|
|
38
|
+
* The execution directory and any already-exposed effective actions belong above the content
|
|
39
|
+
* boundary; an absent coordinate is an absent line.
|
|
38
40
|
*/
|
|
39
41
|
export declare function panelHead(id: string, alias: string | undefined, contract: DisplayAssociation | undefined, context?: readonly string[]): readonly string[];
|
|
40
42
|
/**
|
|
@@ -64,12 +66,6 @@ export type ActivityStream = ((activity: RenderedActivity) => readonly string[])
|
|
|
64
66
|
* always print.
|
|
65
67
|
*/
|
|
66
68
|
export declare function activityStream(context: TextRenderContext): ActivityStream;
|
|
67
|
-
export declare function inputWaitConclusion(observation: AkumaAskObservation, input: Readonly<{
|
|
68
|
-
startedAt: number;
|
|
69
|
-
completedAt?: string | null;
|
|
70
|
-
now?: number;
|
|
71
|
-
status?: LiveStatusObservation["status"];
|
|
72
|
-
}>): readonly string[];
|
|
73
69
|
/** The identity a streamed observing call's head frame renders from its resolved birth. */
|
|
74
70
|
export type ObservedCallHead = Readonly<{
|
|
75
71
|
id: string;
|
|
@@ -106,13 +102,6 @@ export type InputWaitStream = Readonly<{
|
|
|
106
102
|
conclude: (result: InputWaitConclusion) => string;
|
|
107
103
|
opened: () => boolean;
|
|
108
104
|
}>;
|
|
109
|
-
/**
|
|
110
|
-
* The call-observation projection of one input wait: the same admitted/observe/frame/flush/opened
|
|
111
|
-
* lifetime with the closing judgment from the native compact spawn result.
|
|
112
|
-
*/
|
|
113
|
-
export type CallObservationStream = Readonly<Omit<InputWaitStream, "conclude"> & {
|
|
114
|
-
conclude: (result: SpawnResult) => string;
|
|
115
|
-
}>;
|
|
116
105
|
/**
|
|
117
106
|
* Live view over one observing input: its identity frame opens once, selected
|
|
118
107
|
* activity follows, and the input-bound outcome supplies the closing row.
|
|
@@ -122,36 +111,25 @@ export declare function inputWaitStream(context: TextRenderContext, head: () =>
|
|
|
122
111
|
now?: () => number | undefined;
|
|
123
112
|
answerSeparator?: true;
|
|
124
113
|
}>): InputWaitStream;
|
|
125
|
-
export declare function callObservationStream(context: TextRenderContext, head: ObservedCallHead, options?: Readonly<{
|
|
126
|
-
now?: () => number | undefined;
|
|
127
|
-
admittedAt?: string;
|
|
128
|
-
prompt?: string;
|
|
129
|
-
}>): CallObservationStream;
|
|
130
114
|
type SnapshotView = AkumaObservation;
|
|
131
|
-
type SnapshotCoreOptions = Readonly<{
|
|
132
|
-
alias?: string;
|
|
133
|
-
facts?: readonly string[];
|
|
134
|
-
}>;
|
|
135
115
|
export declare function currentWorkLines(work: CurrentWork, context: TextRenderContext): readonly string[];
|
|
136
|
-
export declare function snapshotText(view: SnapshotView, context: TextRenderContext, options?:
|
|
116
|
+
export declare function snapshotText(view: SnapshotView, context: TextRenderContext, options?: Readonly<{
|
|
117
|
+
alias?: string;
|
|
118
|
+
}>): string;
|
|
137
119
|
export declare function killResultText(id: string, evidence: KillEvidence, alias?: string): string;
|
|
138
120
|
/** Presentation-only state for one akuma invocation; it never reaches JSON. */
|
|
139
121
|
type AkumaPresentation = Readonly<{
|
|
140
122
|
alias?: string;
|
|
141
123
|
}>;
|
|
142
|
-
|
|
143
|
-
export declare function
|
|
144
|
-
export declare function
|
|
124
|
+
/** The settlement instant a settled observation carries; an open observation has none. */
|
|
125
|
+
export declare function observationCompletedAt(observation: AkumaAskObservation): string | undefined;
|
|
126
|
+
export declare function askRawAnswer(result: AkumaAskResult): string | undefined;
|
|
145
127
|
export declare function historyRawAnswer(result: AkumaHistoryResult, historyId: string | undefined): string | undefined;
|
|
146
|
-
/**
|
|
147
|
-
* One wait's final text: one compact line per observed member, then one failure line per member
|
|
148
|
-
* the wait could not read. A wait opens no frame and extracts no separate answer, so an answer is
|
|
149
|
-
* visible only as the snapshot's own bounded summary.
|
|
150
|
-
*/
|
|
128
|
+
/** Compact final facts, actual recent events, and an exact-turn full outcome; never a live frame. */
|
|
151
129
|
export declare function waitText(result: AkumaWaitResult, presentation: AkumaPresentation, context: TextRenderContext): string;
|
|
152
130
|
export declare function historyText(result: AkumaHistoryResult, presentation: AkumaPresentation & Readonly<{
|
|
153
131
|
id?: string;
|
|
154
|
-
|
|
132
|
+
answer?: boolean;
|
|
155
133
|
since?: number;
|
|
156
134
|
}>, context: TextRenderContext): string;
|
|
157
135
|
/** One bounded, quoted preview of a Tell an outer receipt already admitted, indented beneath it. */
|