@astrosheep/keiyaku 4.5.7 → 4.5.9
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 +10 -0
- package/build/integrations/marketplace/plugins/keiyaku/.claude-plugin/plugin.json +1 -1
- package/build/integrations/marketplace/plugins/keiyaku/.codex-plugin/plugin.json +1 -1
- package/build/integrations/marketplace/plugins/keiyaku/opencode.js +3 -2
- package/build/integrations/marketplace/plugins/keiyaku/package.json +1 -1
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku/SKILL.md +12 -11
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-akuma/SKILL.md +33 -12
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-babysit/SKILL.md +35 -96
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-bind/SKILL.md +28 -49
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-task/SKILL.md +21 -15
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-workflow/SKILL.md +148 -89
- package/build/src/akuma/abort.d.ts +2 -1
- package/build/src/akuma/abort.js +6 -23
- package/build/src/akuma/akuma-handle.js +4 -2
- package/build/src/akuma/akuma-observe.d.ts +2 -0
- package/build/src/akuma/akuma-observe.js +1 -0
- package/build/src/akuma/akuma-product.js +9 -7
- package/build/src/akuma/akuma.d.ts +392 -9
- package/build/src/akuma/akuma.js +31 -1
- package/build/src/akuma/allowed.d.ts +1 -1
- package/build/src/akuma/allowed.js +1 -0
- package/build/src/akuma/archetype.js +1 -1
- package/build/src/akuma/body.d.ts +8 -5
- package/build/src/akuma/body.js +12 -5
- package/build/src/akuma/call-request.d.ts +80 -0
- package/build/src/akuma/call-request.js +211 -0
- package/build/src/akuma/heart/facts.d.ts +16 -78
- package/build/src/akuma/heart/facts.js +11 -0
- package/build/src/akuma/heart/index.d.ts +3 -2
- package/build/src/akuma/heart/index.js +4 -1
- package/build/src/akuma/heart/request-authority.d.ts +5 -4
- package/build/src/akuma/heart/request-authority.js +20 -34
- package/build/src/akuma/heart/request-rows.js +12 -23
- package/build/src/akuma/heart/schema.d.ts +1 -1
- package/build/src/akuma/heart/schema.js +5 -13
- package/build/src/akuma/index.d.ts +1 -1
- package/build/src/akuma/index.js +1 -1
- package/build/src/akuma/projection-read.d.ts +1 -0
- package/build/src/akuma/projection-read.js +8 -1
- package/build/src/akuma/projection.d.ts +907 -137
- package/build/src/akuma/projection.js +193 -9
- package/build/src/akuma/provider.d.ts +30 -3
- package/build/src/akuma/provider.js +111 -0
- package/build/src/akuma/providers/acp/core.d.ts +2 -2
- package/build/src/akuma/providers/acp/core.js +13 -6
- package/build/src/akuma/providers/acp/index.js +5 -4
- package/build/src/akuma/providers/claude/events.d.ts +2 -2
- package/build/src/akuma/providers/claude/events.js +16 -3
- package/build/src/akuma/providers/claude/index.d.ts +3 -3
- package/build/src/akuma/providers/claude/index.js +16 -5
- package/build/src/akuma/providers/codex-app-server/events.d.ts +2 -2
- package/build/src/akuma/providers/codex-app-server/events.js +25 -4
- package/build/src/akuma/providers/codex-app-server/index.js +18 -6
- package/build/src/akuma/providers/grok-build/index.js +5 -4
- package/build/src/akuma/providers/opencode-sdk/index.js +66 -25
- package/build/src/akuma/providers/opencode-sdk/session.d.ts +3 -2
- package/build/src/akuma/providers/opencode-sdk/session.js +28 -11
- package/build/src/akuma/providers/pi/index.js +72 -58
- package/build/src/akuma/request-lifecycle.d.ts +4 -10
- package/build/src/akuma/request-lifecycle.js +7 -5
- package/build/src/akuma/request-rendezvous.d.ts +26 -0
- package/build/src/akuma/request-rendezvous.js +100 -0
- package/build/src/akuma/request-serve.d.ts +6 -66
- package/build/src/akuma/request-serve.js +83 -210
- package/build/src/akuma/request-wire.d.ts +109 -115
- package/build/src/akuma/request-wire.js +63 -318
- package/build/src/akuma/requests.d.ts +19 -47
- package/build/src/akuma/requests.js +51 -107
- package/build/src/akuma/turn-drive.d.ts +5 -3
- package/build/src/akuma/turn-drive.js +39 -11
- package/build/src/akuma-body.d.ts +7 -2
- package/build/src/akuma-body.js +68 -46
- package/build/src/body/amend.js +18 -19
- package/build/src/cli/accepted.d.ts +1 -1
- package/build/src/cli/accepted.js +2 -2
- package/build/src/cli/commands/akuma-invoke.d.ts +2 -0
- package/build/src/cli/commands/akuma-invoke.js +17 -9
- package/build/src/cli/commands/akuma.js +8 -8
- package/build/src/cli/commands/contract-invoke.d.ts +3 -2
- package/build/src/cli/commands/contract-invoke.js +42 -30
- package/build/src/cli/commands/contract.d.ts +16 -20
- package/build/src/cli/commands/contract.js +58 -25
- package/build/src/cli/commands/install.d.ts +2 -1
- package/build/src/cli/commands/install.js +3 -2
- package/build/src/cli/commands/task-invoke.d.ts +3 -0
- package/build/src/cli/commands/task-invoke.js +23 -140
- package/build/src/cli/commands/task.js +54 -20
- package/build/src/cli/invoke.js +39 -25
- package/build/src/cli/main.js +2 -1
- package/build/src/cli/parse.d.ts +2 -2
- package/build/src/cli/parse.js +56 -27
- package/build/src/cli/render/akuma-activity.d.ts +3 -0
- package/build/src/cli/render/akuma-activity.js +45 -29
- package/build/src/cli/render/akuma-tool.d.ts +5 -1
- package/build/src/cli/render/akuma.js +4 -8
- package/build/src/cli/render/audit.js +1 -1
- package/build/src/cli/render/catalog.js +80 -21
- package/build/src/cli/render/contract-observation.d.ts +2 -0
- package/build/src/cli/render/contract-observation.js +11 -0
- package/build/src/cli/render/contract.js +35 -62
- package/build/src/cli/render/kanshi-akuma.d.ts +8 -0
- package/build/src/cli/render/kanshi-akuma.js +132 -0
- package/build/src/cli/render/kanshi.js +131 -213
- package/build/src/cli/render/receipt.d.ts +1 -2
- package/build/src/cli/render/receipt.js +76 -26
- package/build/src/cli/render/refusal.js +2 -10
- package/build/src/cli/render/region.js +5 -2
- package/build/src/cli/render/settings.d.ts +1 -1
- package/build/src/cli/render/settings.js +27 -8
- package/build/src/cli/render/task.js +22 -5
- package/build/src/cli/render/terminal.d.ts +32 -1
- package/build/src/cli/render/terminal.js +77 -1
- package/build/src/cli/result.d.ts +3 -3
- package/build/src/cli/runtime.js +4 -2
- package/build/src/cli/selectors.d.ts +2 -1
- package/build/src/cli/selectors.js +4 -3
- package/build/src/cli/square-edge.js +120 -36
- package/build/src/cli/usage.js +2 -1
- package/build/src/contract-guidance.d.ts +5 -0
- package/build/src/contract-guidance.js +121 -0
- package/build/src/contract-worktree.d.ts +0 -1
- package/build/src/contract-worktree.js +32 -83
- package/build/src/coordination/sqlite-transaction-lock.d.ts +1 -0
- package/build/src/coordination/sqlite-transaction-lock.js +5 -0
- package/build/src/core/facts/codec.d.ts +2 -0
- package/build/src/core/facts/codec.js +4 -0
- package/build/src/core/verbs/placement.d.ts +6 -1
- package/build/src/core/verbs/placement.js +5 -3
- package/build/src/dispatch/index.d.ts +0 -2
- package/build/src/dispatch/index.js +54 -55
- package/build/src/git/admission.js +2 -2
- package/build/src/git/hooks.d.ts +9 -15
- package/build/src/git/hooks.js +23 -317
- package/build/src/git/nuke.d.ts +2 -1
- package/build/src/git/nuke.js +39 -21
- package/build/src/git/private-state-seat.d.ts +12 -0
- package/build/src/git/private-state-seat.js +39 -0
- package/build/src/git/process.d.ts +6 -0
- package/build/src/git/process.js +26 -11
- package/build/src/git/read-observation.js +29 -20
- package/build/src/git/reconcile.d.ts +13 -1
- package/build/src/git/reconcile.js +70 -11
- package/build/src/git/ref-migration.d.ts +22 -0
- package/build/src/git/ref-migration.js +55 -0
- package/build/src/git/repository.d.ts +10 -6
- package/build/src/git/repository.js +16 -8
- package/build/src/git/target-placement.d.ts +1 -0
- package/build/src/git/target-placement.js +5 -0
- package/build/src/git/tender.d.ts +1 -0
- package/build/src/git/terminal-reconcile.d.ts +1 -1
- package/build/src/git/terminal-reconcile.js +22 -20
- package/build/src/git/workspace.d.ts +14 -0
- package/build/src/git/workspace.js +44 -0
- package/build/src/kanshi/index.d.ts +1 -1
- package/build/src/kanshi/read.js +16 -16
- package/build/src/kanshi/report.d.ts +2 -2
- package/build/src/library/address.d.ts +9 -3
- package/build/src/library/address.js +3 -2
- package/build/src/library/akuma-creation.d.ts +4 -3
- package/build/src/library/akuma-creation.js +19 -13
- package/build/src/library/audit.d.ts +14 -6
- package/build/src/library/audit.js +13 -23
- package/build/src/library/catalog.d.ts +3 -1
- package/build/src/library/catalog.js +20 -6
- package/build/src/library/composition.d.ts +385 -0
- package/build/src/library/composition.js +28 -0
- package/build/src/library/configuration.js +8 -2
- package/build/src/library/continuation.js +66 -30
- package/build/src/library/contract-bind.js +10 -2
- package/build/src/library/contract-forwarding-reconciliation-result.d.ts +102 -0
- package/build/src/library/contract-forwarding-reconciliation-result.js +92 -0
- package/build/src/library/contract-forwarding-result.d.ts +4464 -0
- package/build/src/library/contract-forwarding-result.js +521 -0
- package/build/src/library/contract-forwarding.d.ts +71 -0
- package/build/src/library/contract-forwarding.js +114 -0
- package/build/src/library/contract-handle.d.ts +38 -0
- package/build/src/library/contract-handle.js +314 -0
- package/build/src/library/contract-operations.d.ts +214 -69
- package/build/src/library/contract-operations.js +189 -118
- package/build/src/library/contract-types.d.ts +7 -3
- package/build/src/library/contract.d.ts +21 -34
- package/build/src/library/contract.js +29 -287
- package/build/src/library/fleet-result.d.ts +1580 -0
- package/build/src/library/fleet-result.js +98 -0
- package/build/src/library/fleet.d.ts +112 -54
- package/build/src/library/fleet.js +211 -71
- package/build/src/library/input.d.ts +3 -1
- package/build/src/library/input.js +11 -1
- package/build/src/library/keiyaku.d.ts +388 -20
- package/build/src/library/keiyaku.js +13 -21
- package/build/src/library/mutation.d.ts +3 -3
- package/build/src/library/mutation.js +5 -9
- package/build/src/library/nuke.d.ts +1 -1
- package/build/src/library/nuke.js +4 -3
- package/build/src/library/reconcile.d.ts +4 -0
- package/build/src/library/reconcile.js +2 -0
- package/build/src/library/refusal.d.ts +0 -9
- package/build/src/library/refusal.js +0 -7
- package/build/src/protocol/amend.js +56 -50
- package/build/src/protocol/attempt.d.ts +2 -0
- package/build/src/protocol/attempt.js +8 -1
- package/build/src/protocol/completion.js +7 -0
- package/build/src/protocol/deliver.js +6 -2
- package/build/src/protocol/operations.d.ts +4 -1
- package/build/src/protocol/operations.js +5 -2
- package/build/src/protocol/placement.d.ts +1 -0
- package/build/src/protocol/placement.js +52 -38
- package/build/src/protocol/read/observation.d.ts +1 -4
- package/build/src/protocol/read/observation.js +2 -15
- package/build/src/protocol/reintegrate.js +62 -58
- package/build/src/protocol/review.js +5 -0
- package/build/src/protocol/run.js +17 -13
- package/build/src/runtime/proc/run.d.ts +9 -0
- package/build/src/runtime/proc/run.js +51 -4
- package/build/src/runtime/proc/termination.js +26 -22
- package/build/src/runtime/proc/windows-launch.exe +0 -0
- package/build/src/settlement/holder.d.ts +2 -1
- package/build/src/settlement/holder.js +15 -4
- package/build/src/settlement/settle.js +99 -33
- package/build/src/task/board.d.ts +68 -27
- package/build/src/task/board.js +31 -1
- package/build/src/task/catalog.d.ts +4 -0
- package/build/src/task/catalog.js +23 -0
- package/build/src/task/compose-language.js +33 -7
- package/build/src/task/compose-parser.d.ts +1 -1
- package/build/src/task/compose-parser.js +1 -1
- package/build/src/task/compose.js +2 -0
- package/build/src/task/index.d.ts +12 -4
- package/build/src/task/index.js +97 -16
- package/build/src/task/mutation-result.d.ts +923 -0
- package/build/src/task/mutation-result.js +140 -0
- package/build/src/task/mutation.d.ts +552 -28
- package/build/src/task/mutation.js +304 -97
- package/build/src/task/operations.d.ts +1 -4
- package/build/src/task/operations.js +0 -6
- package/build/src/task/public.d.ts +2 -0
- package/build/src/task/public.js +1 -0
- package/build/src/workspace-place.d.ts +7 -2
- package/build/src/workspace-place.js +34 -24
- package/build/src/world.d.ts +1 -0
- package/build/src/world.js +11 -0
- package/package.json +8 -6
- package/build/src/akuma/request-execution.d.ts +0 -8
- package/build/src/akuma/request-execution.js +0 -98
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { archetypeName } from "../../akuma/identity.js";
|
|
2
|
+
import { parseTaskNamespaceSelector } from "../../task/catalog.js";
|
|
2
3
|
import { CliUsageError, usageLine } from "../usage.js";
|
|
3
4
|
function parseAkumaCatalogPath(value) {
|
|
4
5
|
if (value === "aku" || value === "aku/")
|
|
@@ -23,21 +24,21 @@ export const CONTRACT_COMMAND_SPECS = {
|
|
|
23
24
|
"fork-of": "value",
|
|
24
25
|
json: "boolean",
|
|
25
26
|
},
|
|
26
|
-
usage: "bind [--task <task/...>] [--target <ref>] [--after <kei/...> ...] [--gates <name,...>] [--actor <actor>] - | bind --fork-of <kei/...> [--target <ref>] [--actor <actor>]",
|
|
27
|
+
usage: "bind [--task <task/...>] [--target <ref>] [--after <kei/...> ...] [--gates <name,...>] [--actor <actor>] [--json] - | bind --fork-of <kei/...> [--target <ref>] [--actor <actor>] [--json]",
|
|
27
28
|
purpose: "Create one Contract from stdin Markdown or a sibling fork.",
|
|
28
29
|
},
|
|
29
30
|
amend: {
|
|
30
31
|
positional: "optional",
|
|
31
32
|
stdin: "optional",
|
|
32
33
|
flags: { actor: "value", after: "repeat-value", "clear-after": "boolean", gates: "raw-value", json: "boolean" },
|
|
33
|
-
usage: "amend [<contract>|@<contract>] [--after <kei/...> ... | --clear-after] [--gates <name,...>] [--actor <actor>] [-]",
|
|
34
|
+
usage: "amend [<contract>|@<contract>] [--after <kei/...> ... | --clear-after] [--gates <name,...>] [--actor <actor>] [--json] [-]",
|
|
34
35
|
purpose: "Amend one Contract's document operations or structured terms.",
|
|
35
36
|
details: [
|
|
37
|
+
" ## Context|Objective|Design|Region|Criteria|Verification|<extension> (replace, or add new extension)",
|
|
36
38
|
" ## Replace: Context|Objective|Design|Region|Criteria|Verification|<extension>",
|
|
37
39
|
" ## Append: Context|Objective|Design|Criteria|<extension>",
|
|
38
40
|
" ## Add: Criteria|<new-extension-title>",
|
|
39
41
|
" ## Update: <existing-extension-title>",
|
|
40
|
-
" ## Remove: Criterion <existing-title>",
|
|
41
42
|
" ## Remove: <existing-extension-title>",
|
|
42
43
|
].join("\n"),
|
|
43
44
|
},
|
|
@@ -45,77 +46,76 @@ export const CONTRACT_COMMAND_SPECS = {
|
|
|
45
46
|
positional: "optional",
|
|
46
47
|
stdin: "none",
|
|
47
48
|
flags: {
|
|
48
|
-
actor: "value",
|
|
49
49
|
message: "value",
|
|
50
50
|
"include-dirty": "boolean",
|
|
51
51
|
"materialize-conflict": "boolean",
|
|
52
52
|
json: "boolean",
|
|
53
53
|
},
|
|
54
|
-
usage: "deliver [<contract>|@<contract>] [--message <text>] [--include-dirty] [--materialize-conflict] [--
|
|
54
|
+
usage: "deliver [<contract>|@<contract>] [--message <text>] [--include-dirty] [--materialize-conflict] [--json]",
|
|
55
55
|
purpose: "Deliver one Contract candidate from the appointed worktree.",
|
|
56
56
|
details: [
|
|
57
57
|
" --include-dirty Capture the complete non-ignored worktree tree as the",
|
|
58
|
-
" candidate; stages nothing, commits nothing
|
|
59
|
-
"
|
|
58
|
+
" candidate; stages nothing, commits nothing, including",
|
|
59
|
+
" an unmerged shared index.",
|
|
60
60
|
" --materialize-conflict After a conflict result, project the judged targetHead",
|
|
61
61
|
" into the worktree as an uncommitted merge. Not a",
|
|
62
|
-
" delivery: resolve,
|
|
62
|
+
" delivery: resolve, then deliver with --include-dirty.",
|
|
63
63
|
].join("\n"),
|
|
64
64
|
},
|
|
65
65
|
review: {
|
|
66
66
|
positional: "optional",
|
|
67
67
|
stdin: "optional",
|
|
68
|
-
flags: {
|
|
69
|
-
usage: "review [<contract>|@<contract>] (--satisfied | --unsatisfied) (--summary <text> | -) [--
|
|
68
|
+
flags: { satisfied: "boolean", unsatisfied: "boolean", summary: "value", json: "boolean" },
|
|
69
|
+
usage: "review [<contract>|@<contract>] (--satisfied | --unsatisfied) (--summary <text> | -) [--json]",
|
|
70
70
|
purpose: "Record one review verdict.",
|
|
71
71
|
},
|
|
72
72
|
arc: {
|
|
73
73
|
positional: "optional",
|
|
74
74
|
stdin: "required",
|
|
75
75
|
flags: { actor: "value", json: "boolean" },
|
|
76
|
-
usage: "arc [<contract>|@<contract>] [--actor <actor>] -",
|
|
76
|
+
usage: "arc [<contract>|@<contract>] [--actor <actor>] [--json] -",
|
|
77
77
|
purpose: "Record stdin arc Markdown for one Contract.",
|
|
78
78
|
},
|
|
79
79
|
abandon: {
|
|
80
80
|
positional: "optional",
|
|
81
81
|
stdin: "none",
|
|
82
82
|
flags: { actor: "value", note: "value", json: "boolean" },
|
|
83
|
-
usage: "abandon [<contract>|@<contract>] [--note <text>] [--actor <actor>]",
|
|
83
|
+
usage: "abandon [<contract>|@<contract>] [--note <text>] [--actor <actor>] [--json]",
|
|
84
84
|
purpose: "Abandon one Contract with an optional note.",
|
|
85
85
|
},
|
|
86
86
|
status: {
|
|
87
87
|
positional: "optional",
|
|
88
88
|
stdin: "none",
|
|
89
89
|
flags: { json: "boolean" },
|
|
90
|
-
usage: "status [<contract>|@name|<aku/...>]...",
|
|
90
|
+
usage: "status [<contract>|@name|<aku/...>]... [--json]",
|
|
91
91
|
purpose: "Read the world status board or one or more Contract and Akuma projections.",
|
|
92
92
|
},
|
|
93
93
|
show: {
|
|
94
94
|
positional: "optional",
|
|
95
95
|
stdin: "none",
|
|
96
96
|
flags: { json: "boolean" },
|
|
97
|
-
usage: "show [<contract>|@<contract>]",
|
|
97
|
+
usage: "show [<contract>|@<contract>] [--json]",
|
|
98
98
|
purpose: "Read one Contract guidance projection.",
|
|
99
99
|
},
|
|
100
100
|
ls: {
|
|
101
101
|
positional: "optional",
|
|
102
102
|
stdin: "none",
|
|
103
103
|
flags: { json: "boolean" },
|
|
104
|
-
usage: 'ls task[/]\
|
|
104
|
+
usage: 'ls task[/] [--json]\nls kei[/] [--json]\nls aku[/] [--json]\nls aku/<akuma>[/] [--json]\nls "aku/*/*" [--json]',
|
|
105
105
|
purpose: "List one identity directory.",
|
|
106
106
|
},
|
|
107
107
|
audit: {
|
|
108
108
|
positional: "optional",
|
|
109
109
|
stdin: "none",
|
|
110
|
-
flags: { "include-dirty": "boolean", diff: "boolean",
|
|
111
|
-
usage: "audit [<contract>|@<contract>] [--include-dirty] [--diff] [--
|
|
110
|
+
flags: { "include-dirty": "boolean", diff: "boolean", json: "boolean" },
|
|
111
|
+
usage: "audit [<contract>|@<contract>] [--include-dirty] [--diff] [--json]",
|
|
112
112
|
purpose: "Ask what candidate preparation, Verification, and target placement would do.",
|
|
113
113
|
},
|
|
114
114
|
reconcile: {
|
|
115
115
|
positional: "optional",
|
|
116
116
|
stdin: "none",
|
|
117
117
|
flags: { "retry-hooks": "boolean", json: "boolean" },
|
|
118
|
-
usage: "reconcile [<contract>|@<contract>] [--retry-hooks]",
|
|
118
|
+
usage: "reconcile [<contract>|@<contract>] [--retry-hooks] [--json]",
|
|
119
119
|
purpose: "Reconcile one Contract or the invocation world.",
|
|
120
120
|
},
|
|
121
121
|
nuke: {
|
|
@@ -129,14 +129,14 @@ export const CONTRACT_COMMAND_SPECS = {
|
|
|
129
129
|
positional: "none",
|
|
130
130
|
stdin: "none",
|
|
131
131
|
flags: { json: "boolean" },
|
|
132
|
-
usage: "settings",
|
|
133
|
-
purpose: "
|
|
132
|
+
usage: "settings [--json]",
|
|
133
|
+
purpose: "Show effective Settings (user + project, read-only)",
|
|
134
134
|
},
|
|
135
135
|
region: {
|
|
136
136
|
positional: "optional",
|
|
137
137
|
stdin: "none",
|
|
138
138
|
flags: { path: "repeat-value", json: "boolean" },
|
|
139
|
-
usage: "region [<contract>]\
|
|
139
|
+
usage: "region [<contract>] [--json]\nregion --path <pattern> [--path <pattern> ...] [--json]",
|
|
140
140
|
purpose: "Read active declared Contract Regions.",
|
|
141
141
|
},
|
|
142
142
|
};
|
|
@@ -217,7 +217,6 @@ function parseDeliver(parts) {
|
|
|
217
217
|
return {
|
|
218
218
|
command: "deliver",
|
|
219
219
|
...(contract === undefined ? {} : { contract }),
|
|
220
|
-
...(parts.actor === undefined ? {} : { actor: parts.actor }),
|
|
221
220
|
...(message === undefined ? {} : { message }),
|
|
222
221
|
includeDirty: parts.flags["include-dirty"] === true,
|
|
223
222
|
materializeConflict: parts.flags["materialize-conflict"] === true,
|
|
@@ -239,7 +238,6 @@ function parseReview(parts) {
|
|
|
239
238
|
verdict: parts.flags.satisfied === true ? "satisfied" : "unsatisfied",
|
|
240
239
|
...(summary === undefined ? {} : { summary }),
|
|
241
240
|
...(parts.stdin ? { summaryFromStdin: true } : {}),
|
|
242
|
-
...(parts.actor === undefined ? {} : { actor: parts.actor }),
|
|
243
241
|
output: parts.output,
|
|
244
242
|
};
|
|
245
243
|
}
|
|
@@ -269,7 +267,21 @@ function parseRegion(parts) {
|
|
|
269
267
|
function parseLs(parts) {
|
|
270
268
|
const path = parts.positionals[0];
|
|
271
269
|
if (path === "task" || path === "task/")
|
|
272
|
-
return { command: "ls", query: { kind: "tasks" }, output: parts.output };
|
|
270
|
+
return { command: "ls", query: { kind: "tasks", namespace: [] }, output: parts.output };
|
|
271
|
+
if (path.startsWith("task/")) {
|
|
272
|
+
if (!path.endsWith("/"))
|
|
273
|
+
refuse("ls", `invalid Task namespace selector: ${path}`);
|
|
274
|
+
const body = path.slice("task/".length, -1);
|
|
275
|
+
if (body.length === 0 || body.split("/").some((segment) => segment.length === 0))
|
|
276
|
+
refuse("ls", `invalid Task namespace selector: ${path}`);
|
|
277
|
+
try {
|
|
278
|
+
const namespace = parseTaskNamespaceSelector(path);
|
|
279
|
+
return { command: "ls", query: { kind: "tasks", namespace }, output: parts.output };
|
|
280
|
+
}
|
|
281
|
+
catch (error) {
|
|
282
|
+
refuse("ls", error instanceof Error ? error.message : `invalid Task namespace selector: ${path}`);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
273
285
|
if (path === "kei" || path === "kei/")
|
|
274
286
|
return { command: "ls", query: { kind: "contracts" }, output: parts.output };
|
|
275
287
|
try {
|
|
@@ -286,6 +298,28 @@ function parseLs(parts) {
|
|
|
286
298
|
}
|
|
287
299
|
export function renderContractHelp(command) {
|
|
288
300
|
const spec = CONTRACT_COMMAND_SPECS[command];
|
|
301
|
+
if (command === "settings") {
|
|
302
|
+
return [
|
|
303
|
+
"Show effective Settings — the merged read-only view of:",
|
|
304
|
+
" user ~/.keiyaku/settings.json",
|
|
305
|
+
" project <WorldRoot>/.keiyaku/settings.json",
|
|
306
|
+
"A project record wholly shadows the same-name user record.",
|
|
307
|
+
"",
|
|
308
|
+
"Shape: namespace -> entry -> JSON value. There is no write",
|
|
309
|
+
"command; edit the files directly.",
|
|
310
|
+
"",
|
|
311
|
+
"Recognized settings:",
|
|
312
|
+
" gates gate bundles selected by bind and amend",
|
|
313
|
+
" worktree commands run when worktrees are created or destroyed",
|
|
314
|
+
" git.requireBranchesToBeUpToDate whether deliver and audit require up-to-date target branches",
|
|
315
|
+
" providers the available Akuma and how each is run",
|
|
316
|
+
"",
|
|
317
|
+
"Each entry is validated by the feature that reads it. A rejected",
|
|
318
|
+
"value's diagnostic states the expected shape.",
|
|
319
|
+
"",
|
|
320
|
+
usageLine(spec.usage),
|
|
321
|
+
].join("\n");
|
|
322
|
+
}
|
|
289
323
|
const help = `${spec.purpose}\n\n${usageLine(spec.usage)}`;
|
|
290
324
|
return spec.details === undefined ? help : `${help}\n\n${spec.details}`;
|
|
291
325
|
}
|
|
@@ -337,7 +371,6 @@ export function parseContractCommand(parts) {
|
|
|
337
371
|
...(contract === undefined ? {} : { contract }),
|
|
338
372
|
includeDirty: parts.flags["include-dirty"] === true,
|
|
339
373
|
showDiff: parts.flags.diff === true,
|
|
340
|
-
...(parts.actor === undefined ? {} : { actor: parts.actor }),
|
|
341
374
|
output: parts.output,
|
|
342
375
|
};
|
|
343
376
|
}
|
|
@@ -16,7 +16,8 @@ export type InstallInvocationResult = Readonly<{
|
|
|
16
16
|
results: readonly HarnessInstallResult[];
|
|
17
17
|
}>;
|
|
18
18
|
export type InstallRunner = (input: ProcessInput) => Promise<ProcessOutcome>;
|
|
19
|
-
export declare const INSTALL_USAGE = "install <codex|claude|opencode|pi
|
|
19
|
+
export declare const INSTALL_USAGE = "install <codex|claude|opencode|pi> [--json]\ninstall --all [--json]";
|
|
20
|
+
export declare const INSTALL_ROOT_PURPOSE = "Install Keiyaku into coding harnesses";
|
|
20
21
|
export declare function parseInstallCommand(argv: readonly string[]): ParsedInstallCommand;
|
|
21
22
|
export declare function renderInstallHelp(): string;
|
|
22
23
|
export declare function installAssetsRoot(): string;
|
|
@@ -2,7 +2,8 @@ import { dirname, resolve } from "node:path";
|
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
3
|
import { CliUsageError, usageLine } from "../usage.js";
|
|
4
4
|
export const HARNESS_NAMES = ["codex", "claude", "opencode", "pi"];
|
|
5
|
-
export const INSTALL_USAGE = "install <codex|claude|opencode|pi
|
|
5
|
+
export const INSTALL_USAGE = "install <codex|claude|opencode|pi> [--json]\ninstall --all [--json]";
|
|
6
|
+
export const INSTALL_ROOT_PURPOSE = "Install Keiyaku into coding harnesses";
|
|
6
7
|
function isHarness(value) {
|
|
7
8
|
return value !== undefined && HARNESS_NAMES.includes(value);
|
|
8
9
|
}
|
|
@@ -42,7 +43,7 @@ export function parseInstallCommand(argv) {
|
|
|
42
43
|
};
|
|
43
44
|
}
|
|
44
45
|
export function renderInstallHelp() {
|
|
45
|
-
return `Install
|
|
46
|
+
return `Install Keiyaku into your coding harnesses via each harness's native plugin/package installer. --all continues past failures; any failure exits 1.\n\n${usageLine(INSTALL_USAGE)}`;
|
|
46
47
|
}
|
|
47
48
|
const INSTALL_TIMEOUT_MS = 5 * 60 * 1000;
|
|
48
49
|
const ASSET_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "../../../integrations/marketplace");
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type BlockedTaskList, type TaskBatchResult, type TaskCompositionResult, type TaskDecompositionTree, type TaskDetail, type TaskDoctorReport, type TaskList, type TaskMutationResult, type TaskContextResult, 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
|
+
import { type ExecutionContext } from "../../akuma/requests.js";
|
|
4
5
|
export type TaskShowResult = TaskDetail | readonly TaskDetail[] | Extract<TaskMutationResult, {
|
|
5
6
|
kind: "refused";
|
|
6
7
|
}>;
|
|
@@ -29,6 +30,7 @@ type TaskInput = Readonly<{
|
|
|
29
30
|
establish(): Promise<WorldRoot>;
|
|
30
31
|
readStdin(): Promise<string>;
|
|
31
32
|
actor?: string;
|
|
33
|
+
execution: ExecutionContext;
|
|
32
34
|
}>;
|
|
33
35
|
export declare function invokeTaskFromEdge(input: Readonly<{
|
|
34
36
|
parsed: ParsedTaskCommand;
|
|
@@ -41,6 +43,7 @@ export declare function invokeTaskFromEdge(input: Readonly<{
|
|
|
41
43
|
establish: () => Promise<WorldRoot>;
|
|
42
44
|
readStdin: () => Promise<string>;
|
|
43
45
|
actor: string | undefined;
|
|
46
|
+
execution?: ExecutionContext;
|
|
44
47
|
}>): Promise<TaskInvocationResult>;
|
|
45
48
|
export declare function invokeTask(command: ParsedTaskCommand, input: TaskInput): Promise<TaskInvocationResult>;
|
|
46
49
|
export {};
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { Tasks, } from "../../task/index.js";
|
|
3
3
|
import { taskCompositionNamespaceHeader } from "../../task/compose-language.js";
|
|
4
4
|
import { observeTaskDetails } from "../../task/operations.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { parseTaskNamespaceSelector } from "../../task/catalog.js";
|
|
6
|
+
import { localExecutionContext } from "../../akuma/requests.js";
|
|
7
7
|
import { resolveTaskNamespaceContext, writeTaskNamespaceContext } from "../../task/context.js";
|
|
8
8
|
import { CliUsageError } from "../usage.js";
|
|
9
9
|
export async function invokeTaskFromEdge(input) {
|
|
@@ -15,6 +15,7 @@ export async function invokeTaskFromEdge(input) {
|
|
|
15
15
|
establish: input.establish,
|
|
16
16
|
readStdin: input.readStdin,
|
|
17
17
|
...(input.actor === undefined ? {} : { actor: input.actor }),
|
|
18
|
+
execution: input.execution ?? localExecutionContext(),
|
|
18
19
|
});
|
|
19
20
|
}
|
|
20
21
|
catch (error) {
|
|
@@ -50,6 +51,11 @@ function limit(command) {
|
|
|
50
51
|
const raw = value(command, "limit");
|
|
51
52
|
return raw === undefined ? undefined : Number(raw);
|
|
52
53
|
}
|
|
54
|
+
function explicitListNamespace(command) {
|
|
55
|
+
return command.action === "ls" && command.positionals.length === 1
|
|
56
|
+
? parseTaskNamespaceSelector(command.positionals[0])
|
|
57
|
+
: undefined;
|
|
58
|
+
}
|
|
53
59
|
async function invokeAdd(tasks, command, input, current) {
|
|
54
60
|
const selectedNamespace = namespace(value(command, "namespace")) ?? current;
|
|
55
61
|
const actor = input.actor;
|
|
@@ -104,127 +110,6 @@ async function invokeUpdate(tasks, command, readStdin) {
|
|
|
104
110
|
...(dropRelates === undefined ? {} : { dropRelates }),
|
|
105
111
|
});
|
|
106
112
|
}
|
|
107
|
-
async function addMutationRequest(command, input, current) {
|
|
108
|
-
const selectedNamespace = namespace(value(command, "namespace")) ?? current;
|
|
109
|
-
if (command.stdin === "document")
|
|
110
|
-
return {
|
|
111
|
-
action: "task.addDocument",
|
|
112
|
-
input: {
|
|
113
|
-
markdown: await input.readStdin(),
|
|
114
|
-
namespace: selectedNamespace,
|
|
115
|
-
},
|
|
116
|
-
};
|
|
117
|
-
const body = value(command, "body"), note = value(command, "note");
|
|
118
|
-
const initialState = state(value(command, "state")), selectedPriority = priority(value(command, "priority"));
|
|
119
|
-
const needs = ids(values(command, "needs")), parent = value(command, "parent");
|
|
120
|
-
const supersedes = ids(values(command, "supersedes")), relates = ids(values(command, "relates"));
|
|
121
|
-
return {
|
|
122
|
-
action: "task.add",
|
|
123
|
-
input: {
|
|
124
|
-
title: command.positionals[0],
|
|
125
|
-
namespace: selectedNamespace,
|
|
126
|
-
...(body === undefined ? {} : { body }),
|
|
127
|
-
...(note === undefined ? {} : { note }),
|
|
128
|
-
...(initialState === undefined ? {} : { state: initialState }),
|
|
129
|
-
...(selectedPriority === undefined ? {} : { priority: selectedPriority }),
|
|
130
|
-
...(needs === undefined ? {} : { needs }),
|
|
131
|
-
...(parent === undefined ? {} : { parent: parent }),
|
|
132
|
-
...(supersedes === undefined ? {} : { supersedes }),
|
|
133
|
-
...(relates === undefined ? {} : { relates }),
|
|
134
|
-
},
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
async function updateMutationRequest(command, input) {
|
|
138
|
-
const body = command.stdin === "body" ? await input.readStdin() : value(command, "body");
|
|
139
|
-
const appendBody = command.stdin === "append" ? await input.readStdin() : value(command, "append");
|
|
140
|
-
const note = command.stdin === "note" ? await input.readStdin() : value(command, "note");
|
|
141
|
-
const title = value(command, "title"), selectedPriority = priority(value(command, "priority"));
|
|
142
|
-
const addNeeds = ids(values(command, "needs")), dropNeeds = ids(values(command, "drop-needs"));
|
|
143
|
-
const parent = value(command, "parent"), addSupersedes = ids(values(command, "supersedes"));
|
|
144
|
-
const dropSupersedes = ids(values(command, "drop-supersedes")), addRelates = ids(values(command, "relates"));
|
|
145
|
-
const dropRelates = ids(values(command, "drop-relates"));
|
|
146
|
-
return {
|
|
147
|
-
action: "task.update",
|
|
148
|
-
id: command.positionals[0],
|
|
149
|
-
input: {
|
|
150
|
-
...(title === undefined ? {} : { title }),
|
|
151
|
-
...(body === undefined ? {} : { body }),
|
|
152
|
-
...(appendBody === undefined ? {} : { appendBody }),
|
|
153
|
-
...(note === undefined ? {} : { note }),
|
|
154
|
-
...(selectedPriority === undefined ? {} : { priority: selectedPriority }),
|
|
155
|
-
...(addNeeds === undefined ? {} : { addNeeds }),
|
|
156
|
-
...(dropNeeds === undefined ? {} : { dropNeeds }),
|
|
157
|
-
...(command.flags["no-parent"] === true
|
|
158
|
-
? { parent: null }
|
|
159
|
-
: parent === undefined
|
|
160
|
-
? {}
|
|
161
|
-
: { parent: parent }),
|
|
162
|
-
...(addSupersedes === undefined ? {} : { addSupersedes }),
|
|
163
|
-
...(dropSupersedes === undefined ? {} : { dropSupersedes }),
|
|
164
|
-
...(addRelates === undefined ? {} : { addRelates }),
|
|
165
|
-
...(dropRelates === undefined ? {} : { dropRelates }),
|
|
166
|
-
},
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
function lifecycleMutationRequest(command) {
|
|
170
|
-
const id = command.positionals[0];
|
|
171
|
-
switch (command.action) {
|
|
172
|
-
case "start":
|
|
173
|
-
return { action: "task.start", id };
|
|
174
|
-
case "stop":
|
|
175
|
-
return { action: "task.stop", id };
|
|
176
|
-
case "resume":
|
|
177
|
-
return { action: "task.resume", id };
|
|
178
|
-
case "hold":
|
|
179
|
-
return { action: "task.hold", ids: command.positionals };
|
|
180
|
-
case "done":
|
|
181
|
-
return {
|
|
182
|
-
action: "task.done",
|
|
183
|
-
ids: command.positionals,
|
|
184
|
-
...(value(command, "note") === undefined ? {} : { note: value(command, "note") }),
|
|
185
|
-
};
|
|
186
|
-
case "drop":
|
|
187
|
-
return {
|
|
188
|
-
action: "task.drop",
|
|
189
|
-
ids: command.positionals,
|
|
190
|
-
...(value(command, "note") === undefined ? {} : { note: value(command, "note") }),
|
|
191
|
-
};
|
|
192
|
-
default:
|
|
193
|
-
throw new Error(`task action cannot forward: ${command.action}`);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
async function mutationRequest(command, input, current, composeMarkdown) {
|
|
197
|
-
if (command.action === "add")
|
|
198
|
-
return await addMutationRequest(command, input, current);
|
|
199
|
-
if (command.action === "compose")
|
|
200
|
-
return { action: "task.compose", markdown: composeMarkdown ?? (await input.readStdin()), namespace: current };
|
|
201
|
-
if (command.action === "update")
|
|
202
|
-
return await updateMutationRequest(command, input);
|
|
203
|
-
return lifecycleMutationRequest(command);
|
|
204
|
-
}
|
|
205
|
-
function validatedMutationRequest(request) {
|
|
206
|
-
switch (request.action) {
|
|
207
|
-
case "task.add":
|
|
208
|
-
case "task.addDocument":
|
|
209
|
-
return decodeTaskMutationRequest(request.action, { input: request.input });
|
|
210
|
-
case "task.compose":
|
|
211
|
-
return decodeTaskMutationRequest(request.action, { markdown: request.markdown, namespace: request.namespace });
|
|
212
|
-
case "task.update":
|
|
213
|
-
return decodeTaskMutationRequest(request.action, { id: request.id, input: request.input });
|
|
214
|
-
case "task.start":
|
|
215
|
-
case "task.stop":
|
|
216
|
-
case "task.resume":
|
|
217
|
-
return decodeTaskMutationRequest(request.action, { id: request.id });
|
|
218
|
-
case "task.hold":
|
|
219
|
-
return decodeTaskMutationRequest(request.action, { ids: request.ids });
|
|
220
|
-
case "task.done":
|
|
221
|
-
case "task.drop":
|
|
222
|
-
return decodeTaskMutationRequest(request.action, {
|
|
223
|
-
ids: request.ids,
|
|
224
|
-
...(request.note === undefined ? {} : { note: request.note }),
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
113
|
function readScope(command, current) {
|
|
229
114
|
return command.flags.world === true ? { scope: "world" } : { namespace: current ?? [] };
|
|
230
115
|
}
|
|
@@ -241,7 +126,9 @@ async function invokeRead(tasks, command, current) {
|
|
|
241
126
|
case "ls":
|
|
242
127
|
return tasks.list({
|
|
243
128
|
selection: command.flags.all === true ? "all" : command.flags.closed === true ? "closed" : "active",
|
|
244
|
-
...
|
|
129
|
+
...(explicitListNamespace(command) === undefined
|
|
130
|
+
? readScope(command, current)
|
|
131
|
+
: { namespace: explicitListNamespace(command) }),
|
|
245
132
|
...(limit(command) === undefined ? {} : { limit: limit(command) }),
|
|
246
133
|
});
|
|
247
134
|
case "ready":
|
|
@@ -300,7 +187,12 @@ function missingWorld(command) {
|
|
|
300
187
|
return { kind: "absent" };
|
|
301
188
|
if (command.action === "context")
|
|
302
189
|
return { kind: "accepted", value: { namespace: [], source: "default-root" } };
|
|
303
|
-
if (command.action === "
|
|
190
|
+
if (command.action === "start" && command.positionals.length === 1)
|
|
191
|
+
return missing(command.positionals[0]);
|
|
192
|
+
if (command.action === "start" ||
|
|
193
|
+
command.action === "hold" ||
|
|
194
|
+
command.action === "done" ||
|
|
195
|
+
command.action === "drop") {
|
|
304
196
|
return { items: command.positionals.map((id) => ({ id: id, outcome: missing(id) })) };
|
|
305
197
|
}
|
|
306
198
|
return missing(command.positionals[0]);
|
|
@@ -318,7 +210,7 @@ async function invokeLocalMutation(input) {
|
|
|
318
210
|
const id = command.positionals[0];
|
|
319
211
|
switch (command.action) {
|
|
320
212
|
case "start":
|
|
321
|
-
return tasks.
|
|
213
|
+
return invokeStart(tasks, command.positionals, id);
|
|
322
214
|
case "stop":
|
|
323
215
|
return tasks.task({ id }).stop();
|
|
324
216
|
case "resume":
|
|
@@ -355,18 +247,14 @@ async function invokeLocalMutation(input) {
|
|
|
355
247
|
throw new Error(`task action has no invocation: ${command.action}`);
|
|
356
248
|
}
|
|
357
249
|
}
|
|
250
|
+
function invokeStart(tasks, ids, firstId) {
|
|
251
|
+
return ids.length === 1 ? tasks.task({ id: firstId }).start() : tasks.batch({ verb: "start", ids });
|
|
252
|
+
}
|
|
358
253
|
function establishesWorld(command) {
|
|
359
254
|
return (command.action === "add" ||
|
|
360
255
|
(command.action === "compose" && command.flags.plan !== true) ||
|
|
361
256
|
(command.action === "context" && command.positionals.length > 0));
|
|
362
257
|
}
|
|
363
|
-
function forwardsMutation(command) {
|
|
364
|
-
return (command.action !== "show" &&
|
|
365
|
-
command.action !== "tree" &&
|
|
366
|
-
command.action !== "context" &&
|
|
367
|
-
!(command.action === "compose" && command.flags.plan === true) &&
|
|
368
|
-
!isWorldObservation(command));
|
|
369
|
-
}
|
|
370
258
|
// eslint-disable-next-line complexity -- this is the single CLI edge ordering world, context, forwarding, and local execution.
|
|
371
259
|
export async function invokeTask(command, input) {
|
|
372
260
|
const planOnly = command.action === "compose" && command.flags.plan === true;
|
|
@@ -380,11 +268,11 @@ export async function invokeTask(command, input) {
|
|
|
380
268
|
const world = input.world ?? (planOnly ? input.candidate : establishesWorld(command) ? await input.establish() : null);
|
|
381
269
|
if (world === null)
|
|
382
270
|
return missingWorld(command);
|
|
383
|
-
const tasks = Tasks.of(world);
|
|
271
|
+
const tasks = Tasks.of(world, { execution: input.execution });
|
|
384
272
|
const contextSensitive = command.action === "context" ||
|
|
385
273
|
(command.action === "add" && explicitNamespace === undefined) ||
|
|
386
274
|
(command.action === "compose" && composition?.specified !== true) ||
|
|
387
|
-
((command.action === "ls" ||
|
|
275
|
+
(((command.action === "ls" && explicitListNamespace(command) === undefined) ||
|
|
388
276
|
command.action === "ready" ||
|
|
389
277
|
command.action === "blocked" ||
|
|
390
278
|
command.action === "query") &&
|
|
@@ -399,11 +287,6 @@ export async function invokeTask(command, input) {
|
|
|
399
287
|
return { kind: "accepted", value: resolved };
|
|
400
288
|
}
|
|
401
289
|
}
|
|
402
|
-
const requests = injectedBodyRequests();
|
|
403
|
-
if (requests !== null && forwardsMutation(command)) {
|
|
404
|
-
const request = validatedMutationRequest(await mutationRequest(command, input, explicitNamespace ?? current ?? [], composeMarkdown));
|
|
405
|
-
return (await requestBodyTask({ directory: requests, world, request }));
|
|
406
|
-
}
|
|
407
290
|
return await invokeLocalMutation({
|
|
408
291
|
tasks,
|
|
409
292
|
command,
|