@astrosheep/keiyaku 2.9.4 → 2.9.6
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/build/.tsbuildinfo +1 -1
- package/build/agents/call-terms.js +1 -0
- package/build/agents/harness/execution-handle.js +1 -0
- package/build/agents/harness/outcome.js +31 -5
- package/build/agents/harness/projection.js +151 -78
- package/build/agents/harness/router.js +2 -1
- package/build/agents/providers/claude-agent-sdk/adapter.js +13 -1
- package/build/agents/providers/claude-agent-sdk/registration.js +2 -1
- package/build/agents/providers/codex-app-server/adapter.js +43 -10
- package/build/agents/providers/codex-app-server/events.js +23 -0
- package/build/agents/providers/codex-app-server/registration.js +2 -1
- package/build/agents/providers/opencode-sdk/adapter.js +7 -0
- package/build/agents/providers/opencode-sdk/registration.js +2 -1
- package/build/agents/providers/pi/adapter.js +10 -0
- package/build/agents/providers/pi/events.js +4 -3
- package/build/agents/providers/pi/registration.js +3 -1
- package/build/agents/types.js +2 -0
- package/build/cli/commands/akuma/akuma/meta.js +1 -1
- package/build/cli/commands/akuma/list/meta-ls.js +1 -1
- package/build/cli/commands/akuma/view/meta.js +1 -1
- package/build/cli/commands/contract/amend/meta.js +4 -4
- package/build/cli/commands/contract/arc/handler.js +1 -1
- package/build/cli/commands/contract/arc/meta.js +4 -4
- package/build/cli/commands/contract/audit/handler.js +16 -0
- package/build/cli/commands/contract/audit/meta.js +16 -0
- package/build/cli/commands/contract/bind/meta.js +20 -11
- package/build/cli/commands/contract/catalog.js +2 -0
- package/build/cli/commands/contract/forfeit/meta.js +1 -1
- package/build/cli/commands/contract/log/meta.js +1 -1
- package/build/cli/commands/contract/petition/handler.js +1 -2
- package/build/cli/commands/contract/petition/meta.js +6 -6
- package/build/cli/commands/contract/renew/handler.js +2 -2
- package/build/cli/commands/contract/renew/meta.js +4 -4
- package/build/cli/commands/metadata.js +3 -2
- package/build/cli/commands/projection/call/meta.js +4 -1
- package/build/cli/commands/projection/kill/meta.js +1 -1
- package/build/cli/commands/projection/revive/meta.js +4 -1
- package/build/cli/commands/projection/status/meta.js +1 -1
- package/build/cli/commands/projection/tell/handler.js +1 -1
- package/build/cli/commands/projection/tell/meta.js +4 -1
- package/build/cli/commands/projection/wait/meta.js +1 -1
- package/build/cli/commands/skills/install/meta.js +1 -1
- package/build/cli/commands/skills/skills/meta.js +1 -1
- package/build/cli/commands/system/completion/meta.js +1 -1
- package/build/cli/commands/system/dump-env/meta.js +1 -1
- package/build/cli/commands/system/guide/meta.js +1 -1
- package/build/cli/commands/task/add/handler.js +2 -2
- package/build/cli/commands/task/add/meta.js +4 -1
- package/build/cli/commands/task/doctor/meta.js +1 -1
- package/build/cli/commands/task/done/meta.js +1 -1
- package/build/cli/commands/task/drop/meta.js +1 -1
- package/build/cli/commands/task/ls/handler.js +10 -4
- package/build/cli/commands/task/ls/meta.js +3 -3
- package/build/cli/commands/task/show/meta.js +1 -1
- package/build/cli/commands/task/start/meta.js +1 -1
- package/build/cli/commands/task/stop/meta.js +1 -1
- package/build/cli/commands/task/task/meta.js +1 -1
- package/build/cli/commands/task/update/handler.js +2 -3
- package/build/cli/commands/task/update/meta.js +4 -1
- package/build/cli/completion.js +9 -2
- package/build/cli/flags.js +19 -3
- package/build/cli/help.js +3 -3
- package/build/cli/index.js +59 -75
- package/build/cli/output-stream-error-policy.js +19 -5
- package/build/cli/parse-flags.js +19 -2
- package/build/cli/parse-metadata.js +1 -7
- package/build/cli/parse-selectors.js +1 -0
- package/build/cli/parse.js +16 -7
- package/build/cli/projection-address.js +6 -1
- package/build/cli/render/audit.js +121 -0
- package/build/cli/render/errors.js +18 -1
- package/build/cli/render/format.js +5 -2
- package/build/cli/render/misc.js +3 -1
- package/build/cli/render/projection-activity.js +12 -6
- package/build/cli/render/status.js +28 -18
- package/build/cli/render/success-response.js +6 -5
- package/build/cli/render/task.js +12 -43
- package/build/cli/render/terminal-failure.js +7 -2
- package/build/cli/render/wait.js +36 -8
- package/build/config/env-keys.js +2 -0
- package/build/config/env.js +3 -0
- package/build/core/amend.js +20 -94
- package/build/core/arc.js +14 -6
- package/build/core/audit/candidate.js +48 -0
- package/build/core/audit/coordinates.js +180 -0
- package/build/core/audit/evidence.js +158 -0
- package/build/core/audit/facade.js +42 -0
- package/build/core/audit/readiness.js +4 -0
- package/build/core/audit/report.js +38 -0
- package/build/core/audit.js +1 -0
- package/build/core/bind.js +1 -1
- package/build/core/call/execution.js +1 -0
- package/build/core/contract-view.js +2 -3
- package/build/core/draft.js +33 -20
- package/build/core/entry.js +3 -4
- package/build/core/markdown/lex.js +2 -1
- package/build/core/projection/generation/database.js +41 -16
- package/build/core/projection/generation/model.js +22 -2
- package/build/core/projection/generation/projection-generation-execution.js +20 -7
- package/build/core/projection/generation/projection-generation-launcher.js +4 -4
- package/build/core/projection/generation/projection-generation-runner.js +1 -0
- package/build/core/projection/generation/store.js +1 -1
- package/build/core/projection/generation/transitions.js +19 -3
- package/build/core/projection/index.js +2 -2
- package/build/core/projection/projection-execution-observer.js +35 -21
- package/build/core/projection/projection-life-observer.js +16 -2
- package/build/core/projection/projection-status.js +67 -22
- package/build/core/projection/projection-terminal-failure.js +2 -0
- package/build/core/projection/projection-wait.js +6 -9
- package/build/core/projection/projection-wake.js +30 -6
- package/build/core/renew.js +41 -22
- package/build/core/scope.js +129 -2
- package/build/core/seal.js +36 -15
- package/build/core/settlement/petition-claim-gates.js +4 -33
- package/build/core/settlement/petition-preview.js +1 -1
- package/build/core/settlement/petition.js +10 -3
- package/build/core/settlement/settlement.js +3 -10
- package/build/core/settlement/verification.js +59 -0
- package/build/core/status/board.js +48 -28
- package/build/core/stored-agent-event.js +3 -2
- package/build/core/task/board.js +1 -0
- package/build/core/task/commands.js +20 -12
- package/build/core/task/document.js +5 -0
- package/build/core/task/index.js +1 -1
- package/build/core/task/model.js +8 -1
- package/build/core/task/query.js +214 -0
- package/build/core/task/settlement-git.js +115 -16
- package/build/core/task/settlement-policy.js +17 -9
- package/build/core/task/source-board.js +1 -0
- package/build/core/task/task-contract.js +125 -51
- package/build/core/task/task-store-repository.js +1 -0
- package/build/core/task/task.js +2 -0
- package/build/flow-error.js +2 -4
- package/build/generated/version.js +2 -2
- package/build/git/diff/parsers.js +23 -13
- package/build/git/diff/structured.js +127 -0
- package/build/index.js +7 -7
- package/build/telemetry/logger.js +4 -2
- package/package.json +1 -1
- package/skills/keiyaku/SKILL.md +2 -2
- package/skills/keiyaku-akuma/SKILL.md +17 -6
- package/skills/keiyaku-task/SKILL.md +16 -7
- package/skills/keiyaku-workflow/SKILL.md +48 -13
|
@@ -109,7 +109,7 @@ export const piRegistration = {
|
|
|
109
109
|
return loader ? { ...terms, loader } : terms;
|
|
110
110
|
},
|
|
111
111
|
nativePolicyOwnership: () => null,
|
|
112
|
-
startLive: async ({ terms, signal, reviveTerms, onSyncCheckpoint, onIngress }) => {
|
|
112
|
+
startLive: async ({ terms, signal, reviveTerms, onSyncCheckpoint, onSessionAdmission, onIngress }) => {
|
|
113
113
|
if (terms.provider !== PI_PROVIDER) {
|
|
114
114
|
throw new Error(`startLive expected ${PI_PROVIDER}`);
|
|
115
115
|
}
|
|
@@ -125,6 +125,7 @@ export const piRegistration = {
|
|
|
125
125
|
appendSystemPromptOverride: piTerms.appendSystemPromptOverride,
|
|
126
126
|
onSyncCheckpoint,
|
|
127
127
|
onEvidence: piTerms.onEvidence,
|
|
128
|
+
onSessionAdmission,
|
|
128
129
|
onIngress,
|
|
129
130
|
initialTurn: piTerms.initialTurn,
|
|
130
131
|
loader: piTerms.loader,
|
|
@@ -137,6 +138,7 @@ export const piRegistration = {
|
|
|
137
138
|
appendSystemPromptOverride: piTerms.appendSystemPromptOverride,
|
|
138
139
|
onSyncCheckpoint,
|
|
139
140
|
onEvidence: piTerms.onEvidence,
|
|
141
|
+
onSessionAdmission,
|
|
140
142
|
onIngress,
|
|
141
143
|
initialTurn: piTerms.initialTurn,
|
|
142
144
|
loader: piTerms.loader,
|
package/build/agents/types.js
CHANGED
|
@@ -2,7 +2,7 @@ export const meta = {
|
|
|
2
2
|
command: "akuma ls",
|
|
3
3
|
summary: "List Akuma profiles",
|
|
4
4
|
usage: ["keiyaku akuma ls [-C|--cwd DIR] [--repo DIR]"],
|
|
5
|
-
stdin: "
|
|
5
|
+
stdin: { mode: "argument" },
|
|
6
6
|
flags: ["cwd", "repo"],
|
|
7
7
|
purpose: "List configured helper profiles.",
|
|
8
8
|
notes: ["Project profiles override user profiles, which override builtins."],
|
|
@@ -2,7 +2,7 @@ export const meta = {
|
|
|
2
2
|
command: "akuma view",
|
|
3
3
|
summary: "View one Akuma profile",
|
|
4
4
|
usage: ["keiyaku akuma view NAME [-C|--cwd DIR] [--repo DIR]"],
|
|
5
|
-
stdin: "
|
|
5
|
+
stdin: { mode: "argument" },
|
|
6
6
|
flags: ["cwd", "repo"],
|
|
7
7
|
purpose: "Read one configured helper profile and its current nonterminal projections.",
|
|
8
8
|
};
|
|
@@ -2,11 +2,11 @@ export const meta = {
|
|
|
2
2
|
command: "amend",
|
|
3
3
|
summary: "Record an amendment",
|
|
4
4
|
usage: [
|
|
5
|
-
"keiyaku amend [-C|--cwd DIR] [--repo DIR] [--contract ADDR] < amendment.md",
|
|
6
|
-
"keiyaku @addr amend [-C|--cwd DIR] [--repo DIR] < amendment.md",
|
|
5
|
+
"keiyaku amend [-C|--cwd DIR] [--repo DIR] [--contract ADDR] - < amendment.md",
|
|
6
|
+
"keiyaku @addr amend [-C|--cwd DIR] [--repo DIR] - < amendment.md",
|
|
7
7
|
],
|
|
8
|
-
stdin: "
|
|
8
|
+
stdin: { mode: "document", selector: { kind: "positional", index: 0, required: true, rejectBlank: true } },
|
|
9
9
|
flags: ["cwd", "repo", "contract"],
|
|
10
|
-
purpose: "Append a prose amendment and optional
|
|
10
|
+
purpose: "Append a prose amendment and optional Scope Append gitignore-pattern delta.",
|
|
11
11
|
completionRank: 8,
|
|
12
12
|
};
|
|
@@ -4,7 +4,7 @@ import { buildArcResponse } from "../../../render/arc.js";
|
|
|
4
4
|
import { renderCoreResult } from "../../../render/shared.js";
|
|
5
5
|
import { effectiveDirectory, repositoryDirectory } from "../../shared.js";
|
|
6
6
|
export const handler = async (stdin, flags) => {
|
|
7
|
-
const parsed = buildArcInput(stdin, effectiveDirectory(flags), flags.
|
|
7
|
+
const parsed = buildArcInput(stdin, effectiveDirectory(flags), flags.appendScope, flags.contractId, flags.contractAddressSource);
|
|
8
8
|
const cwd = await repositoryDirectory(flags, "arc");
|
|
9
9
|
const address = await resolveExistingContractAddress(cwd, flags.contractId, flags.contractAddressSource, effectiveDirectory(flags));
|
|
10
10
|
return renderCoreResult(arcKeiyaku({
|
|
@@ -2,11 +2,11 @@ export const meta = {
|
|
|
2
2
|
command: "arc",
|
|
3
3
|
summary: "Optional iteration; seals current intent first",
|
|
4
4
|
usage: [
|
|
5
|
-
"keiyaku arc [-C|--cwd DIR] [--repo DIR] [--contract ADDR] [--
|
|
6
|
-
"keiyaku @addr arc [-C|--cwd DIR] [--repo DIR] [--
|
|
5
|
+
"keiyaku arc [-C|--cwd DIR] [--repo DIR] [--contract ADDR] [--append-scope PATTERN] - < arc.md",
|
|
6
|
+
"keiyaku @addr arc [-C|--cwd DIR] [--repo DIR] [--append-scope PATTERN] - < arc.md",
|
|
7
7
|
],
|
|
8
|
-
stdin: "
|
|
9
|
-
flags: ["cwd", "repo", "contract", "
|
|
8
|
+
stdin: { mode: "document", selector: { kind: "positional", index: 0, required: true, rejectBlank: true } },
|
|
9
|
+
flags: ["cwd", "repo", "contract", "append-scope"],
|
|
10
10
|
purpose: "Optional iteration boundary: record the next title, objective, and brief, and seal the current intent first.",
|
|
11
11
|
input: [
|
|
12
12
|
"# <arc title>",
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { auditContract } from "../../../../core/audit.js";
|
|
2
|
+
import { resolveContractAddress, withResolvedAddress } from "../../../../core/addressing.js";
|
|
3
|
+
import { buildAuditConstructionFailure, buildAuditResponse } from "../../../render/audit.js";
|
|
4
|
+
import { effectiveDirectory, repositoryDirectory } from "../../shared.js";
|
|
5
|
+
export const handler = async (_stdin, flags) => {
|
|
6
|
+
try {
|
|
7
|
+
const cwd = await repositoryDirectory(flags, "audit");
|
|
8
|
+
const address = await resolveContractAddress(cwd, flags.contractId, flags.contractAddressSource, effectiveDirectory(flags));
|
|
9
|
+
return await withResolvedAddress(address, async () => {
|
|
10
|
+
return buildAuditResponse(await auditContract({ cwd, address, diffBudgetBytes: flags.auditDiffBudgetBytes }), flags.json === true);
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
return buildAuditConstructionFailure(error, flags.json === true);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const meta = {
|
|
2
|
+
command: "audit",
|
|
3
|
+
summary: "Read settlement facts from one pinned delivery candidate",
|
|
4
|
+
usage: [
|
|
5
|
+
"keiyaku audit [-C|--cwd DIR] [--repo DIR] [--contract ADDR] [--diff-budget BYTES] [--json]",
|
|
6
|
+
"keiyaku @<id> audit [--diff-budget BYTES] [--json]",
|
|
7
|
+
],
|
|
8
|
+
stdin: { mode: "argument" },
|
|
9
|
+
flags: ["cwd", "repo", "contract", "diff-budget", "json"],
|
|
10
|
+
purpose: "Inspect one pinned delivery candidate, report settlement facts, and recheck its coordinates without mutating the source repository.",
|
|
11
|
+
notes: [
|
|
12
|
+
"Audit never invokes an Akuma or settles the contract.",
|
|
13
|
+
"Exit 0 means the report was constructed; exit 1 carries a typed construction cause.",
|
|
14
|
+
],
|
|
15
|
+
completionRank: 9,
|
|
16
|
+
};
|
|
@@ -2,14 +2,14 @@ export const meta = {
|
|
|
2
2
|
command: "bind",
|
|
3
3
|
summary: "Create a contract ledger and workspace files",
|
|
4
4
|
usage: [
|
|
5
|
-
"keiyaku bind [-C|--cwd DIR] [--repo DIR] [--task ID]...
|
|
5
|
+
"keiyaku bind [-C|--cwd DIR] [--repo DIR] [--task ID]... [- < contract.md]",
|
|
6
6
|
"keiyaku bind [-C|--cwd DIR] [--repo DIR] [--task ID]... --place NAME --objective TEXT --scope GLOB --checks CHECK [--dry-run]",
|
|
7
7
|
],
|
|
8
|
-
stdin: "
|
|
8
|
+
stdin: { mode: "document", selector: { kind: "positional", index: 0, required: false, rejectBlank: false } },
|
|
9
9
|
flags: ["cwd", "repo", "after", "exclusive", "draft-only", "place", "objective", "scope", "checks", "task", "dry-run"],
|
|
10
10
|
// contract is parseable only so the mouth can reject it with bind-specific copy.
|
|
11
11
|
parseFlags: ["cwd", "repo", "contract", "after", "exclusive", "draft-only", "place", "objective", "scope", "checks", "task", "dry-run"],
|
|
12
|
-
purpose: "Bind a Keiyaku from contract Markdown
|
|
12
|
+
purpose: "Bind a Keiyaku from contract Markdown selected by literal -.",
|
|
13
13
|
input: [
|
|
14
14
|
"# <name>",
|
|
15
15
|
"",
|
|
@@ -17,36 +17,45 @@ export const meta = {
|
|
|
17
17
|
"<what the commission should accomplish>",
|
|
18
18
|
"",
|
|
19
19
|
"## Scope",
|
|
20
|
-
"
|
|
20
|
+
"```",
|
|
21
|
+
"<pattern>",
|
|
22
|
+
"<another-pattern>",
|
|
23
|
+
"```",
|
|
21
24
|
"",
|
|
22
25
|
"## Checks",
|
|
23
26
|
"- <verification>",
|
|
24
27
|
],
|
|
25
28
|
notes: [
|
|
26
29
|
"bind creates a contract and does not accept @addr or --contract.",
|
|
27
|
-
"Primary form is
|
|
28
|
-
"With --task, title and body supply name/objective defaults;
|
|
29
|
-
"Domain flags remain available as a full-document alternative; they cannot mix with
|
|
30
|
+
"Primary document form is literal - followed by Markdown on stdin (full document below).",
|
|
31
|
+
"With --task, title and body supply name/objective defaults; literal - may send only the missing sections and any present section overrides the task default.",
|
|
32
|
+
"Domain flags remain available as a full-document alternative; they cannot mix with Markdown selected by literal -.",
|
|
30
33
|
],
|
|
31
34
|
examples: [
|
|
32
35
|
[
|
|
33
|
-
"keiyaku bind <<'KEIYAKU'",
|
|
36
|
+
"keiyaku bind - <<'KEIYAKU'",
|
|
34
37
|
"# <name>",
|
|
35
38
|
"",
|
|
36
39
|
"## Objective",
|
|
37
40
|
"<what the commission should accomplish>",
|
|
38
41
|
"",
|
|
39
42
|
"## Scope",
|
|
40
|
-
"
|
|
43
|
+
"```",
|
|
44
|
+
"<pattern>",
|
|
45
|
+
"<another-pattern>",
|
|
46
|
+
"```",
|
|
41
47
|
"",
|
|
42
48
|
"## Checks",
|
|
43
49
|
"- <verification>",
|
|
44
50
|
"KEIYAKU",
|
|
45
51
|
].join("\n"),
|
|
46
52
|
[
|
|
47
|
-
"keiyaku bind --task fix-flaky-pump <<'KEIYAKU'",
|
|
53
|
+
"keiyaku bind --task fix-flaky-pump - <<'KEIYAKU'",
|
|
48
54
|
"## Scope",
|
|
49
|
-
"
|
|
55
|
+
"```",
|
|
56
|
+
"<pattern>",
|
|
57
|
+
"<another-pattern>",
|
|
58
|
+
"```",
|
|
50
59
|
"",
|
|
51
60
|
"## Checks",
|
|
52
61
|
"- <verification>",
|
|
@@ -2,6 +2,7 @@ import { meta as bindMeta } from "./bind/meta.js";
|
|
|
2
2
|
import { meta as arcMeta } from "./arc/meta.js";
|
|
3
3
|
import { meta as logMeta } from "./log/meta.js";
|
|
4
4
|
import { meta as amendMeta } from "./amend/meta.js";
|
|
5
|
+
import { meta as auditMeta } from "./audit/meta.js";
|
|
5
6
|
import { meta as renewMeta } from "./renew/meta.js";
|
|
6
7
|
import { meta as petitionMeta } from "./petition/meta.js";
|
|
7
8
|
import { meta as forfeitMeta } from "./forfeit/meta.js";
|
|
@@ -10,6 +11,7 @@ export const contractCatalog = [
|
|
|
10
11
|
{ meta: arcMeta, load: () => import("./arc/handler.js") },
|
|
11
12
|
{ meta: logMeta, load: () => import("./log/handler.js") },
|
|
12
13
|
{ meta: amendMeta, load: () => import("./amend/handler.js") },
|
|
14
|
+
{ meta: auditMeta, load: () => import("./audit/handler.js") },
|
|
13
15
|
{ meta: renewMeta, load: () => import("./renew/handler.js") },
|
|
14
16
|
{ meta: petitionMeta, load: () => import("./petition/handler.js") },
|
|
15
17
|
{ meta: forfeitMeta, load: () => import("./forfeit/handler.js") },
|
|
@@ -5,7 +5,7 @@ export const meta = {
|
|
|
5
5
|
"keiyaku forfeit [-C|--cwd DIR] [--repo DIR] [--contract ADDR] [--reason TEXT]",
|
|
6
6
|
"keiyaku @addr forfeit [-C|--cwd DIR] [--repo DIR] [--reason TEXT]",
|
|
7
7
|
],
|
|
8
|
-
stdin: "
|
|
8
|
+
stdin: { mode: "argument" },
|
|
9
9
|
flags: ["cwd", "repo", "contract", "reason"],
|
|
10
10
|
purpose: "Record an abandoned contract without sealing it.",
|
|
11
11
|
completionRank: 11,
|
|
@@ -5,7 +5,7 @@ export const meta = {
|
|
|
5
5
|
"keiyaku log [-C|--cwd DIR] [--repo DIR] [--contract ADDR]",
|
|
6
6
|
"keiyaku @addr log [-C|--cwd DIR] [--repo DIR]",
|
|
7
7
|
],
|
|
8
|
-
stdin: "
|
|
8
|
+
stdin: { mode: "argument" },
|
|
9
9
|
flags: ["cwd", "repo", "contract"],
|
|
10
10
|
purpose: "Read a contract ledger.",
|
|
11
11
|
completionRank: 5,
|
|
@@ -10,13 +10,12 @@ export const handler = async (stdin, flags, signal) => {
|
|
|
10
10
|
const cwd = await repositoryDirectory(flags, "petition");
|
|
11
11
|
const address = await resolveExistingContractAddress(cwd, flags.contractId, flags.contractAddressSource, effectiveDirectory(flags));
|
|
12
12
|
return await withResolvedAddress(address, async () => {
|
|
13
|
-
const input = buildPetitionClaimInput({ cwd, contractId: address.binding.commissionId, stdin, signal,
|
|
13
|
+
const input = buildPetitionClaimInput({ cwd, contractId: address.binding.commissionId, stdin, signal, appendScope: flags.appendScope });
|
|
14
14
|
if (flags.dryRun) {
|
|
15
15
|
return buildPetitionPreviewResponse(await previewPetition({
|
|
16
16
|
cwd,
|
|
17
17
|
contractId: address.binding.commissionId,
|
|
18
18
|
oath: input.oath,
|
|
19
|
-
waivePaths: flags.waivePaths,
|
|
20
19
|
}), flags.json === true);
|
|
21
20
|
}
|
|
22
21
|
return buildPetitionClaimResponse({ ...await petitionKeiyaku(input), address }, input);
|
|
@@ -2,19 +2,19 @@ export const meta = {
|
|
|
2
2
|
command: "petition",
|
|
3
3
|
summary: "Run or preview the gated settlement pipeline",
|
|
4
4
|
usage: [
|
|
5
|
-
"keiyaku petition [-C|--cwd DIR] [--repo DIR] [--contract ADDR] [--
|
|
6
|
-
"keiyaku @<id> petition [-C|--cwd DIR] [--repo DIR] [--
|
|
7
|
-
"keiyaku @<id> petition --dry-run [--json] [< petition.md]",
|
|
5
|
+
"keiyaku petition [-C|--cwd DIR] [--repo DIR] [--contract ADDR] [--append-scope PATTERN] [- < petition.md]",
|
|
6
|
+
"keiyaku @<id> petition [-C|--cwd DIR] [--repo DIR] [--append-scope PATTERN] [- < petition.md]",
|
|
7
|
+
"keiyaku @<id> petition --dry-run [--json] [- < petition.md]",
|
|
8
8
|
],
|
|
9
|
-
stdin: "
|
|
10
|
-
flags: ["cwd", "repo", "contract", "
|
|
9
|
+
stdin: { mode: "document", selector: { kind: "positional", index: 0, required: false, rejectBlank: false } },
|
|
10
|
+
flags: ["cwd", "repo", "contract", "append-scope", "dry-run", "json"],
|
|
11
11
|
purpose: "Seal the current a0 or open explicit arc, queue the contract, and run verdict and claim processing; dry-run previews deterministic gates without mutation.",
|
|
12
12
|
input: [
|
|
13
13
|
"## Oath",
|
|
14
14
|
"<free first-person attestation>",
|
|
15
15
|
],
|
|
16
16
|
notes: [
|
|
17
|
-
"Petition stdin is optional
|
|
17
|
+
"Petition stdin is optional and read only when literal - is supplied; a missing, empty, or blank oath is rejected by the settlement gate with OATH_MISSING.",
|
|
18
18
|
"The machine checks only that the oath is present. Accepted oath text is persisted in the petition entry and hidden from the reviewer.",
|
|
19
19
|
"Base drift requires explicit `keiyaku renew` before petition.",
|
|
20
20
|
"Dry-run never runs verification or review and exits 0, 1, or 2.",
|
|
@@ -10,7 +10,7 @@ export const handler = async (_stdin, flags) => {
|
|
|
10
10
|
: resolveExistingContractAddress;
|
|
11
11
|
const address = await resolveAddress(cwd, flags.contractId, flags.contractAddressSource, effectiveDirectory(flags));
|
|
12
12
|
if (flags.renewContinue) {
|
|
13
|
-
return renderCoreResult(continueRenewKeiyaku({ cwd, address,
|
|
13
|
+
return renderCoreResult(continueRenewKeiyaku({ cwd, address, appendScope: flags.appendScope }), buildRenewResponse);
|
|
14
14
|
}
|
|
15
15
|
if (flags.renewAbort) {
|
|
16
16
|
return renderCoreResult(abortRenewKeiyaku({ cwd, address }), buildRenewAbortResponse);
|
|
@@ -18,7 +18,7 @@ export const handler = async (_stdin, flags) => {
|
|
|
18
18
|
return renderCoreResult(renewKeiyaku({
|
|
19
19
|
cwd,
|
|
20
20
|
address,
|
|
21
|
-
|
|
21
|
+
appendScope: flags.appendScope,
|
|
22
22
|
resolveConflicts: flags.renewResolve,
|
|
23
23
|
}), buildRenewResponse);
|
|
24
24
|
};
|
|
@@ -2,12 +2,12 @@ export const meta = {
|
|
|
2
2
|
command: "renew",
|
|
3
3
|
summary: "Rewrite delivery onto the current base",
|
|
4
4
|
usage: [
|
|
5
|
-
"keiyaku renew [-C|--cwd DIR] [--repo DIR] [--contract ADDR] [--
|
|
6
|
-
"keiyaku @<id> renew --continue [--
|
|
5
|
+
"keiyaku renew [-C|--cwd DIR] [--repo DIR] [--contract ADDR] [--append-scope PATTERN] [--resolve]",
|
|
6
|
+
"keiyaku @<id> renew --continue [--append-scope PATTERN]",
|
|
7
7
|
"keiyaku @<id> renew --abort",
|
|
8
8
|
],
|
|
9
|
-
stdin: "
|
|
10
|
-
flags: ["cwd", "repo", "contract", "
|
|
9
|
+
stdin: { mode: "argument" },
|
|
10
|
+
flags: ["cwd", "repo", "contract", "append-scope", "resolve", "continue", "abort"],
|
|
11
11
|
purpose: "Capture receipts, rewrite delivery onto the default branch, then seal the current a0 or open explicit arc and record the renewal.",
|
|
12
12
|
notes: [
|
|
13
13
|
"After an explicit arc closes, refuses loose commits until another arc is open.",
|
|
@@ -12,6 +12,7 @@ import { meta as akumaViewMeta } from "./akuma/view/meta.js";
|
|
|
12
12
|
import { meta as skillsMeta } from "./skills/skills/meta.js";
|
|
13
13
|
import { meta as skillsInstallMeta } from "./skills/install/meta.js";
|
|
14
14
|
import { meta as amendMeta } from "./contract/amend/meta.js";
|
|
15
|
+
import { meta as auditMeta } from "./contract/audit/meta.js";
|
|
15
16
|
import { meta as renewMeta } from "./contract/renew/meta.js";
|
|
16
17
|
import { meta as petitionMeta } from "./contract/petition/meta.js";
|
|
17
18
|
import { meta as forfeitMeta } from "./contract/forfeit/meta.js";
|
|
@@ -31,14 +32,14 @@ import { meta as taskDoctorMeta } from "./task/doctor/meta.js";
|
|
|
31
32
|
import { meta as dumpEnvMeta } from "./system/dump-env/meta.js";
|
|
32
33
|
export const COMMAND_METADATA_ORDER = [
|
|
33
34
|
"bind", "arc", "call", "revive", "wait", "tell", "kill", "log",
|
|
34
|
-
"akuma", "akuma ls", "akuma view", "skills", "skills install", "amend",
|
|
35
|
+
"akuma", "akuma ls", "akuma view", "skills", "skills install", "amend", "audit",
|
|
35
36
|
"renew", "petition", "forfeit", "guide", "completion", "status", "task",
|
|
36
37
|
"task add", "task show", "task ls", "task start", "task stop", "task done",
|
|
37
38
|
"task drop", "task update", "task doctor", "dump-env",
|
|
38
39
|
];
|
|
39
40
|
const COMMAND_METADATA = [
|
|
40
41
|
bindMeta, arcMeta, callMeta, reviveMeta, waitMeta, tellMeta, killMeta, logMeta,
|
|
41
|
-
akumaMeta, akumaLsMeta, akumaViewMeta, skillsMeta, skillsInstallMeta, amendMeta,
|
|
42
|
+
akumaMeta, akumaLsMeta, akumaViewMeta, skillsMeta, skillsInstallMeta, amendMeta, auditMeta,
|
|
42
43
|
renewMeta, petitionMeta, forfeitMeta, guideMeta, completionMeta, statusMeta,
|
|
43
44
|
taskMeta, taskAddMeta, taskShowMeta, taskLsMeta, taskStartMeta, taskStopMeta,
|
|
44
45
|
taskDoneMeta, taskDropMeta, taskUpdateMeta, taskDoctorMeta, dumpEnvMeta,
|
|
@@ -2,7 +2,10 @@ export const meta = {
|
|
|
2
2
|
command: "call",
|
|
3
3
|
summary: "Start an Akuma helper session",
|
|
4
4
|
usage: ["keiyaku call NAME [--wait DURATION] <BODY|->"],
|
|
5
|
-
stdin:
|
|
5
|
+
stdin: {
|
|
6
|
+
mode: "argument",
|
|
7
|
+
selector: { kind: "positional", index: 0, required: true, rejectBlank: true },
|
|
8
|
+
},
|
|
6
9
|
flags: ["cwd", "repo", "contract", "akuma", "model", "effort", "incognito", "bare", "detach", "alias", "wait"],
|
|
7
10
|
purpose: "Run a scoped helper task.",
|
|
8
11
|
completionRank: 2,
|
|
@@ -5,7 +5,7 @@ export const meta = {
|
|
|
5
5
|
"keiyaku kill <projection-address> [--wait DURATION]",
|
|
6
6
|
"keiyaku @addr kill <projection-address> [--wait DURATION]",
|
|
7
7
|
],
|
|
8
|
-
stdin: "
|
|
8
|
+
stdin: { mode: "argument" },
|
|
9
9
|
flags: ["cwd", "repo", "contract", "wait"],
|
|
10
10
|
purpose: "Terminate the current generation while keeping the projection identity and tell ledger.",
|
|
11
11
|
};
|
|
@@ -2,7 +2,10 @@ export const meta = {
|
|
|
2
2
|
command: "revive",
|
|
3
3
|
summary: "Revive an Akuma helper session",
|
|
4
4
|
usage: ["keiyaku revive ARTIFACT [BODY|-]"],
|
|
5
|
-
stdin:
|
|
5
|
+
stdin: {
|
|
6
|
+
mode: "argument",
|
|
7
|
+
selector: { kind: "positional", index: 1, required: false, rejectBlank: true },
|
|
8
|
+
},
|
|
6
9
|
flags: ["cwd", "repo", "model", "effort"],
|
|
7
10
|
purpose: "Continue a persisted helper session.",
|
|
8
11
|
completionRank: 4,
|
|
@@ -2,7 +2,7 @@ export const meta = {
|
|
|
2
2
|
command: "status",
|
|
3
3
|
summary: "Show the Kanshi board",
|
|
4
4
|
usage: ["keiyaku status [PROJECTION] [-C|--cwd DIR] [--repo DIR] [--target REF] [--all]"],
|
|
5
|
-
stdin: "
|
|
5
|
+
stdin: { mode: "argument" },
|
|
6
6
|
flags: ["cwd", "repo", "target", "all"],
|
|
7
7
|
purpose: "Read the Kanshi board or filter it to one projection without mutation.",
|
|
8
8
|
completionRank: 14,
|
|
@@ -11,7 +11,7 @@ export const handler = async (body, flags, signal, positional) => runProjectionC
|
|
|
11
11
|
throw new FlowError("EMPTY_PARAM", "tell requires a projection address and message");
|
|
12
12
|
const projection = await resolveProjectionCommandTarget(ctx, projectionAddress, "tell");
|
|
13
13
|
assertTellEffortSupported(projection.directory, flags.effort);
|
|
14
|
-
//
|
|
14
|
+
// Address admission and any effort validation precede the durable mailbox write.
|
|
15
15
|
writeInboxTell(projection.directory, body, Date.now(), { effort: flags.effort });
|
|
16
16
|
await tellProjection(projection.directory, projection.id, flags.effort);
|
|
17
17
|
if (flags.timeoutMs === undefined)
|
|
@@ -2,7 +2,10 @@ export const meta = {
|
|
|
2
2
|
command: "tell",
|
|
3
3
|
summary: "Send intent to a projection mailbox",
|
|
4
4
|
usage: ["keiyaku tell PROJECTION [--wait DURATION] [--] <BODY|->"],
|
|
5
|
-
stdin:
|
|
5
|
+
stdin: {
|
|
6
|
+
mode: "argument",
|
|
7
|
+
selector: { kind: "positional", index: 1, required: true, rejectBlank: true },
|
|
8
|
+
},
|
|
6
9
|
flags: ["cwd", "repo", "contract", "effort", "wait"],
|
|
7
10
|
purpose: "Write intent to the mailbox and wake only when eligible.",
|
|
8
11
|
completionRank: 3,
|
|
@@ -7,7 +7,7 @@ export const meta = {
|
|
|
7
7
|
"keiyaku wait <projection-address> <projection-address>... (--any|--all) [--timeout DURATION]",
|
|
8
8
|
"keiyaku @addr wait [<projection-address>...] (--any|--all) [--timeout DURATION]",
|
|
9
9
|
],
|
|
10
|
-
stdin: "
|
|
10
|
+
stdin: { mode: "argument" },
|
|
11
11
|
flags: ["cwd", "repo", "contract", "timeout", "any", "all"],
|
|
12
12
|
flagDescriptions: {
|
|
13
13
|
all: "For a projection set, return only after every admitted member reaches a terminal state.",
|
|
@@ -2,7 +2,7 @@ export const meta = {
|
|
|
2
2
|
command: "skills install",
|
|
3
3
|
summary: "Install the official Keiyaku skills",
|
|
4
4
|
usage: ["keiyaku skills install [-f|--force]"],
|
|
5
|
-
stdin: "
|
|
5
|
+
stdin: { mode: "argument" },
|
|
6
6
|
flags: ["force"],
|
|
7
7
|
purpose: "Install the bundled official Keiyaku skills into supported agent skill directories.",
|
|
8
8
|
notes: ["Force permits replacement of foreign collisions."],
|
|
@@ -2,7 +2,7 @@ export const meta = {
|
|
|
2
2
|
command: "skills",
|
|
3
3
|
summary: "Install official skills",
|
|
4
4
|
usage: ["keiyaku skills install"],
|
|
5
|
-
stdin: "
|
|
5
|
+
stdin: { mode: "argument" },
|
|
6
6
|
flags: [],
|
|
7
7
|
purpose: "Install bundled official Keiyaku skills into supported agent skill directories.",
|
|
8
8
|
subcommands: ["install"],
|
|
@@ -2,7 +2,7 @@ export const meta = {
|
|
|
2
2
|
command: "completion",
|
|
3
3
|
summary: "Print shell completion",
|
|
4
4
|
usage: ["keiyaku completion [--shell bash|zsh]"],
|
|
5
|
-
stdin: "
|
|
5
|
+
stdin: { mode: "argument" },
|
|
6
6
|
flags: ["cwd", "repo", "shell", "word", "previous", "complete"],
|
|
7
7
|
purpose: "Print command and address candidates.",
|
|
8
8
|
completionRank: 13,
|
|
@@ -2,7 +2,7 @@ export const meta = {
|
|
|
2
2
|
command: "dump-env",
|
|
3
3
|
summary: "Print the environment template",
|
|
4
4
|
usage: ["keiyaku dump-env"],
|
|
5
|
-
stdin: "
|
|
5
|
+
stdin: { mode: "argument" },
|
|
6
6
|
flags: [],
|
|
7
7
|
purpose: "Print supported environment keys.",
|
|
8
8
|
notes: ["Keiyaku loads <KEIYAKU_HOME>/.env, then .keiyaku/.env; process environment values win."],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createTask, resolveTaskCreator, } from "../../../../core/task/index.js";
|
|
2
2
|
import { parseTaskAddInput, runTaskMutationCommand } from "../shared.js";
|
|
3
|
-
export const handler = async (stdin, flags
|
|
4
|
-
const input = parseTaskAddInput(
|
|
3
|
+
export const handler = async (stdin, flags) => {
|
|
4
|
+
const input = parseTaskAddInput(stdin);
|
|
5
5
|
return runTaskMutationCommand(flags, async (repository, cwd) => createTask(repository, {
|
|
6
6
|
...input,
|
|
7
7
|
creator: await resolveTaskCreator(cwd),
|
|
@@ -2,7 +2,10 @@ export const meta = {
|
|
|
2
2
|
command: "task add",
|
|
3
3
|
summary: "Add a task",
|
|
4
4
|
usage: ["keiyaku task add [-C|--cwd DIR] [--needs ID] [--parent ID] [--from ID] [--pri 0-3] <BODY|->"],
|
|
5
|
-
stdin:
|
|
5
|
+
stdin: {
|
|
6
|
+
mode: "argument",
|
|
7
|
+
selector: { kind: "positional", index: 0, required: true, rejectBlank: true },
|
|
8
|
+
},
|
|
6
9
|
flags: ["cwd", "needs", "parent", "from", "pri"],
|
|
7
10
|
purpose: "Create a lightweight task from a title and optional body.",
|
|
8
11
|
};
|
|
@@ -2,7 +2,7 @@ export const meta = {
|
|
|
2
2
|
command: "task doctor",
|
|
3
3
|
summary: "Diagnose the task board",
|
|
4
4
|
usage: ["keiyaku task doctor [-C|--cwd DIR]"],
|
|
5
|
-
stdin: "
|
|
5
|
+
stdin: { mode: "argument" },
|
|
6
6
|
flags: ["cwd"],
|
|
7
7
|
purpose: "Report task state counts, supported board diseases, and lock state without repair.",
|
|
8
8
|
};
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import { readTaskBoard } from "../../../../core/task/index.js";
|
|
2
|
-
import {
|
|
1
|
+
import { readTaskBoard, selectTaskList } from "../../../../core/task/index.js";
|
|
2
|
+
import { renderSelectedTaskList, renderSelectedTaskListJson } from "../../../render/task.js";
|
|
3
3
|
import { textResponse } from "../../../render/shared.js";
|
|
4
4
|
import { taskJsonText, taskSelection, withTaskCommandRepository } from "../shared.js";
|
|
5
5
|
export const handler = async (_stdin, flags) => {
|
|
6
6
|
const board = await withTaskCommandRepository(flags, (repository) => readTaskBoard(repository));
|
|
7
7
|
const selection = taskSelection(flags);
|
|
8
|
+
const tasks = selectTaskList(board.tasks, {
|
|
9
|
+
selection,
|
|
10
|
+
filters: flags.taskFilters,
|
|
11
|
+
sort: flags.taskSort,
|
|
12
|
+
nowMs: Date.now(),
|
|
13
|
+
});
|
|
8
14
|
return textResponse(flags.json
|
|
9
|
-
? taskJsonText(
|
|
10
|
-
:
|
|
15
|
+
? taskJsonText(renderSelectedTaskListJson(tasks))
|
|
16
|
+
: renderSelectedTaskList(tasks));
|
|
11
17
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const meta = {
|
|
2
2
|
command: "task ls",
|
|
3
3
|
summary: "List tasks",
|
|
4
|
-
usage: ["keiyaku task ls [-C|--cwd DIR] [--all|--done] [--json]"],
|
|
5
|
-
stdin: "
|
|
6
|
-
flags: ["cwd", "all", "done", "json"],
|
|
4
|
+
usage: ["keiyaku task ls [-C|--cwd DIR] [--all|--done] [--filter EXPR] [--sort KEYS] [--json]"],
|
|
5
|
+
stdin: { mode: "argument" },
|
|
6
|
+
flags: ["cwd", "all", "done", "filter", "sort", "json"],
|
|
7
7
|
purpose: "List tasks from the working-tree board.",
|
|
8
8
|
};
|
|
@@ -2,7 +2,7 @@ export const meta = {
|
|
|
2
2
|
command: "task show",
|
|
3
3
|
summary: "Show one task and its children tree",
|
|
4
4
|
usage: ["keiyaku task show [-C|--cwd DIR] ID [--json]"],
|
|
5
|
-
stdin: "
|
|
5
|
+
stdin: { mode: "argument" },
|
|
6
6
|
flags: ["cwd", "json"],
|
|
7
7
|
purpose: "Read one task and every descendant linked by parent edges.",
|
|
8
8
|
};
|