@astrosheep/keiyaku 4.6.31 → 4.6.33
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 +42 -23
- package/build/plugins/claude/skills/keiyaku-akuma/SKILL.md +24 -15
- package/build/plugins/claude/skills/keiyaku-babysit/SKILL.md +12 -8
- package/build/plugins/claude/skills/keiyaku-bind/SKILL.md +4 -3
- package/build/plugins/claude/skills/keiyaku-debt/SKILL.md +17 -17
- package/build/plugins/claude/skills/keiyaku-workflow/SKILL.md +6 -4
- package/build/plugins/codex/skills/keiyaku-akuma/SKILL.md +24 -15
- package/build/plugins/codex/skills/keiyaku-babysit/SKILL.md +12 -8
- package/build/plugins/codex/skills/keiyaku-bind/SKILL.md +4 -3
- package/build/plugins/codex/skills/keiyaku-debt/SKILL.md +17 -17
- package/build/plugins/codex/skills/keiyaku-workflow/SKILL.md +6 -4
- package/build/plugins/opencode/skills/keiyaku-akuma/SKILL.md +24 -15
- package/build/plugins/opencode/skills/keiyaku-babysit/SKILL.md +12 -8
- package/build/plugins/opencode/skills/keiyaku-bind/SKILL.md +4 -3
- package/build/plugins/opencode/skills/keiyaku-debt/SKILL.md +17 -17
- package/build/plugins/opencode/skills/keiyaku-workflow/SKILL.md +6 -4
- package/build/plugins/pi/README.md +53 -97
- package/build/plugins/pi/keiyaku.ts +10 -6
- package/build/skills/keiyaku-akuma/SKILL.md +24 -15
- package/build/skills/keiyaku-babysit/SKILL.md +12 -8
- package/build/skills/keiyaku-bind/SKILL.md +4 -3
- package/build/skills/keiyaku-debt/SKILL.md +17 -17
- package/build/skills/keiyaku-workflow/SKILL.md +6 -4
- package/build/src/akuma/akuma-call.d.ts +3 -5
- package/build/src/akuma/akuma-call.js +7 -10
- package/build/src/akuma/akuma-errors.d.ts +7 -4
- package/build/src/akuma/akuma-errors.js +16 -12
- package/build/src/akuma/akuma-instance.d.ts +50 -303
- package/build/src/akuma/akuma-instance.js +48 -49
- package/build/src/akuma/akuma-observe.d.ts +5 -4
- package/build/src/akuma/akuma-observe.js +74 -21
- package/build/src/akuma/akuma-owner.d.ts +14 -6
- package/build/src/akuma/akuma-owner.js +33 -27
- package/build/src/akuma/akuma-selection-execution.d.ts +97 -19
- package/build/src/akuma/akuma-selection-execution.js +79 -133
- package/build/src/akuma/akuma-wait.d.ts +43 -4
- package/build/src/akuma/akuma-wait.js +58 -29
- package/build/src/akuma/akuma.d.ts +58 -384
- package/build/src/akuma/akuma.js +8 -58
- package/build/src/akuma/archetype.d.ts +16 -19
- package/build/src/akuma/archetype.js +48 -49
- package/build/src/akuma/body.js +44 -44
- package/build/src/akuma/call-initial-tell.d.ts +4 -2
- package/build/src/akuma/call-initial-tell.js +9 -2
- package/build/src/akuma/call-input.d.ts +8 -1
- package/build/src/akuma/call-input.js +27 -18
- package/build/src/akuma/caller.js +2 -1
- package/build/src/akuma/detached-body.js +1 -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 +5 -4
- package/build/src/akuma/heart/facts.js +5 -5
- package/build/src/akuma/heart/index.d.ts +1 -1
- package/build/src/akuma/heart/index.js +9 -1
- package/build/src/akuma/heart/soul.js +20 -4
- package/build/src/akuma/heart/timeline.js +4 -4
- package/build/src/akuma/identity.d.ts +1 -1
- package/build/src/akuma/identity.js +9 -4
- package/build/src/akuma/index.d.ts +6 -7
- package/build/src/akuma/index.js +2 -3
- package/build/src/akuma/projection-read.d.ts +4 -2
- package/build/src/akuma/projection-read.js +21 -14
- package/build/src/akuma/projection.d.ts +97 -2
- package/build/src/akuma/projection.js +47 -47
- package/build/src/akuma/provider-recipe.js +3 -2
- package/build/src/akuma/provider.d.ts +2 -2
- package/build/src/akuma/provider.js +27 -20
- package/build/src/akuma/providers/acp/config.js +11 -10
- package/build/src/akuma/providers/acp/core.js +2 -5
- package/build/src/akuma/providers/acp/index.js +2 -1
- package/build/src/akuma/providers/codex-app-server/index.js +7 -1
- package/build/src/akuma/providers/grok-build/index.js +2 -1
- package/build/src/akuma/providers/index.d.ts +0 -1
- package/build/src/akuma/providers/index.js +0 -8
- 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/providers/paseo/index.js +7 -4
- package/build/src/akuma/providers/pi/index.js +4 -3
- package/build/src/akuma/publication.d.ts +1 -2
- package/build/src/akuma/publication.js +19 -16
- package/build/src/akuma/schema.d.ts +3 -49
- package/build/src/akuma/schema.js +6 -147
- package/build/src/akuma/selection-observation.d.ts +304 -240
- package/build/src/akuma/selection-observation.js +135 -70
- package/build/src/akuma/status-projection.d.ts +61 -284
- package/build/src/akuma/status-projection.js +216 -138
- package/build/src/akuma/turn-drive.js +21 -15
- package/build/src/body/amend.js +7 -18
- package/build/src/body/arc.js +3 -2
- package/build/src/body/criteria.js +4 -3
- package/build/src/body/decode.js +13 -2
- package/build/src/body/envelope.d.ts +5 -1
- package/build/src/body/envelope.js +6 -3
- package/build/src/body/region.d.ts +1 -3
- package/build/src/body/region.js +3 -8
- package/build/src/body/render.js +4 -6
- package/build/src/body-host.d.ts +4 -11
- package/build/src/body-host.js +5 -4
- package/build/src/bounded-list.js +2 -1
- package/build/src/cli/commands/akuma-grammar.d.ts +107 -66
- package/build/src/cli/commands/akuma-grammar.js +66 -104
- package/build/src/cli/commands/akuma.d.ts +7 -3
- package/build/src/cli/commands/akuma.js +49 -160
- package/build/src/cli/commands/contract-grammar.d.ts +4 -135
- package/build/src/cli/commands/contract-grammar.js +126 -223
- package/build/src/cli/commands/contract-help.d.ts +26 -22
- package/build/src/cli/commands/contract-help.js +52 -38
- package/build/src/cli/commands/contract.d.ts +6 -18
- package/build/src/cli/commands/contract.js +68 -272
- package/build/src/cli/commands/debt-grammar.d.ts +2 -4
- package/build/src/cli/commands/debt-grammar.js +23 -193
- package/build/src/cli/commands/debt.js +10 -87
- package/build/src/cli/commands/report.d.ts +2 -4
- package/build/src/cli/coordinates.d.ts +1 -1
- package/build/src/cli/coordinates.js +1 -1
- package/build/src/cli/main.js +9 -3
- package/build/src/cli/parse.d.ts +80 -3
- package/build/src/cli/parse.js +76 -19
- package/build/src/cli/render/akuma-activity.d.ts +18 -35
- package/build/src/cli/render/akuma-activity.js +141 -290
- package/build/src/cli/render/akuma.d.ts +2 -8
- package/build/src/cli/render/akuma.js +50 -65
- package/build/src/cli/render/catalog.d.ts +2 -5
- package/build/src/cli/render/catalog.js +3 -37
- package/build/src/cli/render/contract-history.js +3 -2
- package/build/src/cli/render/contract-observation.d.ts +2 -8
- package/build/src/cli/render/contract-observation.js +25 -4
- package/build/src/cli/render/contract-wait.d.ts +2 -2
- package/build/src/cli/render/contract-wait.js +13 -17
- package/build/src/cli/render/contract.d.ts +7 -9
- package/build/src/cli/render/contract.js +46 -72
- package/build/src/cli/render/debt.d.ts +3 -11
- package/build/src/cli/render/debt.js +17 -89
- package/build/src/cli/render/delivery-preview.js +4 -4
- package/build/src/cli/render/execution-progress.js +1 -3
- package/build/src/cli/render/kanshi-akuma.d.ts +5 -3
- package/build/src/cli/render/kanshi-akuma.js +23 -20
- package/build/src/cli/render/kanshi.d.ts +1 -3
- package/build/src/cli/render/kanshi.js +27 -56
- package/build/src/cli/render/receipt.d.ts +21 -12
- package/build/src/cli/render/receipt.js +78 -68
- package/build/src/cli/render/reconcile.js +2 -5
- package/build/src/cli/render/refusal.d.ts +4 -3
- package/build/src/cli/render/refusal.js +17 -22
- package/build/src/cli/render/settings.d.ts +1 -1
- package/build/src/cli/render/terminal.d.ts +11 -12
- package/build/src/cli/render/terminal.js +53 -44
- package/build/src/cli/render/verbs.d.ts +4 -1
- package/build/src/cli/render/verbs.js +88 -128
- package/build/src/cli/runtime.js +65 -70
- package/build/src/cli/streams.d.ts +2 -9
- package/build/src/cli/streams.js +8 -1
- package/build/src/cli/usage.d.ts +2 -1
- package/build/src/cli/usage.js +3 -2
- package/build/src/contract-worktree.js +2 -10
- package/build/src/core/facts/codec.js +16 -25
- package/build/src/core/facts/eligibility.d.ts +4 -4
- package/build/src/core/facts/eligibility.js +11 -0
- package/build/src/core/facts/errors.d.ts +2 -1
- package/build/src/core/facts/errors.js +3 -3
- 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 +7 -14
- package/build/src/core/facts/types.js +8 -6
- package/build/src/core/subject.d.ts +4 -1
- package/build/src/core/subject.js +10 -2
- package/build/src/core/verbs/abandon.d.ts +1 -2
- package/build/src/core/verbs/amend.d.ts +16 -6
- package/build/src/core/verbs/amend.js +19 -9
- package/build/src/core/verbs/arc.d.ts +1 -2
- package/build/src/core/verbs/attestation.d.ts +1 -2
- package/build/src/core/verbs/bind.d.ts +1 -2
- package/build/src/core/verbs/deliver.d.ts +1 -2
- package/build/src/core/verbs/placement.d.ts +1 -2
- package/build/src/core/verbs/reintegrate.d.ts +1 -2
- package/build/src/debt/board.d.ts +14 -94
- package/build/src/debt/board.js +25 -160
- package/build/src/debt/catalog.d.ts +0 -2
- package/build/src/debt/catalog.js +1 -22
- package/build/src/debt/document.d.ts +8 -11
- package/build/src/debt/document.js +19 -62
- package/build/src/debt/identity.d.ts +2 -14
- package/build/src/debt/identity.js +19 -49
- package/build/src/debt/index.d.ts +81 -220
- package/build/src/debt/index.js +61 -115
- package/build/src/debt/input.d.ts +21 -6
- package/build/src/debt/input.js +56 -180
- package/build/src/debt/lifecycle-operations.d.ts +1 -3
- package/build/src/debt/lifecycle-operations.js +1 -73
- package/build/src/debt/operation-types.d.ts +24 -128
- package/build/src/debt/operation-types.js +6 -62
- package/build/src/debt/operations.d.ts +8 -17
- package/build/src/debt/operations.js +58 -154
- package/build/src/debt/store.d.ts +0 -2
- package/build/src/debt/store.js +32 -87
- package/build/src/dispatch/index.d.ts +0 -17
- package/build/src/dispatch/index.js +1 -10
- package/build/src/errors.d.ts +28 -0
- package/build/src/errors.js +26 -0
- package/build/src/git/hooks.d.ts +1 -1
- package/build/src/git/identity.js +16 -45
- package/build/src/git/nuke.js +13 -23
- package/build/src/git/observe.d.ts +6 -0
- package/build/src/git/observe.js +40 -24
- package/build/src/git/process.js +11 -18
- package/build/src/git/read-observation.d.ts +5 -4
- package/build/src/git/reconcile.d.ts +3 -16
- package/build/src/git/reconcile.js +0 -18
- package/build/src/git/repository.d.ts +4 -1
- package/build/src/git/repository.js +16 -4
- package/build/src/git/scratch.js +2 -14
- package/build/src/git/target-placement.d.ts +4 -4
- package/build/src/git/target.d.ts +2 -2
- package/build/src/git/tender.d.ts +1 -2
- package/build/src/git/tender.js +5 -12
- package/build/src/git/terminal-reconcile.js +1 -13
- package/build/src/identity/coordinates.d.ts +1 -1
- package/build/src/identity/coordinates.js +3 -2
- package/build/src/identity/normalize.js +2 -1
- package/build/src/identity/selector.js +4 -3
- package/build/src/index.d.ts +36 -57
- package/build/src/index.js +11 -36
- package/build/src/kanshi/counts.d.ts +3 -8
- package/build/src/kanshi/counts.js +6 -14
- package/build/src/kanshi/index.d.ts +21 -7
- package/build/src/kanshi/index.js +29 -4
- package/build/src/kanshi/read.d.ts +101 -269
- package/build/src/kanshi/read.js +41 -200
- package/build/src/kanshi/report.d.ts +443 -1628
- package/build/src/kanshi/report.js +19 -31
- package/build/src/library/address.d.ts +20 -13
- package/build/src/library/address.js +48 -55
- package/build/src/library/akuma-creation.d.ts +249 -79
- package/build/src/library/akuma-creation.js +200 -247
- package/build/src/library/akumas.d.ts +24 -5
- package/build/src/library/akumas.js +96 -29
- package/build/src/library/bind.d.ts +7 -10
- package/build/src/library/bind.js +2 -8
- package/build/src/library/continuation.d.ts +151 -231
- package/build/src/library/continuation.js +22 -31
- package/build/src/library/contract-address.d.ts +6 -9
- package/build/src/library/contract-address.js +11 -16
- package/build/src/library/contract-composition.d.ts +2 -3
- package/build/src/library/contract-composition.js +12 -19
- package/build/src/library/contract-creation.js +35 -37
- package/build/src/library/contract-outcomes.d.ts +1349 -806
- package/build/src/library/contract-outcomes.js +12 -37
- package/build/src/library/contract-settings.d.ts +1 -2
- package/build/src/library/contract-settings.js +5 -7
- package/build/src/library/contract-types.d.ts +60 -67
- package/build/src/library/contract-types.js +17 -56
- package/build/src/library/contract-wait.d.ts +47 -3
- package/build/src/library/contract-wait.js +81 -70
- package/build/src/library/delivery.d.ts +391 -389
- package/build/src/library/delivery.js +5 -25
- package/build/src/library/input.d.ts +13 -5
- package/build/src/library/input.js +43 -38
- package/build/src/library/invocation.d.ts +13 -11
- package/build/src/library/invocation.js +69 -58
- package/build/src/library/kei.d.ts +16 -8
- package/build/src/library/kei.js +484 -25
- package/build/src/library/keiyaku-attribution.d.ts +0 -8
- package/build/src/library/keiyaku-attribution.js +0 -11
- package/build/src/library/keiyaku-classify.d.ts +2 -2
- package/build/src/library/keiyaku-classify.js +43 -62
- package/build/src/library/keiyaku-coordinates.d.ts +3 -8
- package/build/src/library/keiyaku-coordinates.js +6 -26
- package/build/src/library/keiyaku-debt.d.ts +21 -93
- package/build/src/library/keiyaku-debt.js +9 -159
- package/build/src/library/keiyaku-identity.d.ts +3 -3
- package/build/src/library/keiyaku-identity.js +16 -10
- package/build/src/library/keiyaku-verbs.d.ts +4102 -4889
- package/build/src/library/keiyaku-verbs.js +317 -291
- package/build/src/library/keiyaku-wait.d.ts +183 -0
- package/build/src/library/keiyaku-wait.js +213 -0
- package/build/src/library/keiyaku.d.ts +32 -860
- package/build/src/library/keiyaku.js +203 -314
- package/build/src/library/model-tools.d.ts +556 -0
- package/build/src/library/model-tools.js +347 -0
- package/build/src/library/nuke.d.ts +4 -2
- package/build/src/library/nuke.js +5 -1
- package/build/src/library/outcome.d.ts +424 -307
- package/build/src/library/outcome.js +166 -362
- package/build/src/library/reconcile.d.ts +331 -143
- package/build/src/library/reconcile.js +38 -72
- package/build/src/library/refusal.d.ts +45 -29
- package/build/src/library/refusal.js +5 -16
- package/build/src/library/repo.js +4 -3
- package/build/src/library/selection.d.ts +44 -21
- package/build/src/library/selection.js +63 -88
- package/build/src/mcp/adapter.js +37 -51
- 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 +16 -9
- package/build/src/pi/index.d.ts +3 -0
- package/build/src/pi/index.js +83 -0
- package/build/src/plugin/public.d.ts +4 -0
- package/build/src/plugin/runtime.d.ts +1 -1
- package/build/src/plugin/runtime.js +2 -2
- package/build/src/protocol/amend.d.ts +15 -4
- package/build/src/protocol/amend.js +114 -47
- package/build/src/protocol/bind.d.ts +5 -7
- package/build/src/protocol/bind.js +8 -19
- package/build/src/protocol/completion.d.ts +188 -195
- package/build/src/protocol/completion.js +63 -24
- package/build/src/protocol/deliver.d.ts +11 -6
- package/build/src/protocol/deliver.js +37 -50
- package/build/src/protocol/delivery-preview.d.ts +18 -11
- package/build/src/protocol/delivery-preview.js +2 -2
- package/build/src/protocol/execution-observation.d.ts +13 -13
- package/build/src/protocol/intent.d.ts +7 -9
- package/build/src/protocol/intent.js +22 -32
- package/build/src/protocol/operations.d.ts +102 -69
- package/build/src/protocol/operations.js +33 -56
- package/build/src/protocol/outcome.d.ts +3 -1
- package/build/src/protocol/placement.d.ts +1 -2
- package/build/src/protocol/placement.js +7 -1
- package/build/src/protocol/progress.d.ts +1 -0
- package/build/src/protocol/progress.js +0 -6
- package/build/src/protocol/read/status.d.ts +69 -112
- package/build/src/protocol/read/status.js +59 -88
- package/build/src/protocol/reintegrate.d.ts +1 -2
- package/build/src/protocol/reintegrate.js +2 -3
- package/build/src/protocol/result-leaves.d.ts +67 -40
- package/build/src/protocol/result-leaves.js +28 -58
- package/build/src/protocol/result-reasons.d.ts +6 -6
- package/build/src/protocol/review.js +0 -1
- package/build/src/protocol/run.js +1 -4
- package/build/src/protocol/verify.d.ts +202 -146
- package/build/src/protocol/verify.js +61 -47
- package/build/src/runtime/proc/windows-launch.exe +0 -0
- package/build/src/settings.d.ts +8 -9
- package/build/src/settings.js +16 -13
- package/build/src/settlement/holder.js +2 -2
- package/build/src/settlement/settle.d.ts +0 -6
- package/build/src/settlement/settle.js +19 -72
- package/build/src/verification/declaration.d.ts +3 -6
- package/build/src/verification/declaration.js +3 -5
- package/build/src/verification/observation.d.ts +2 -2
- package/build/src/world.d.ts +3 -2
- package/build/src/world.js +5 -6
- package/package.json +7 -3
- package/plugins/paseo/plugin/index.server.ts +1 -1
- package/plugins/paseo/plugin/server/attach.ts +74 -67
- package/plugins/paseo/plugin/server/keiyaku.ts +80 -14
- package/plugins/paseo/plugin/server/message.ts +2 -1
- package/plugins/paseo/plugin/server/mirror-identity.ts +6 -4
- package/plugins/paseo/plugin/server/sdk.ts +9 -11
- package/plugins/paseo/plugin/server/transport.ts +24 -1
- package/plugins/pi/README.md +53 -97
- package/plugins/pi/keiyaku.ts +10 -6
- package/skills/keiyaku-akuma/SKILL.md +24 -15
- package/skills/keiyaku-babysit/SKILL.md +12 -8
- package/skills/keiyaku-bind/SKILL.md +4 -3
- package/skills/keiyaku-debt/SKILL.md +17 -17
- package/skills/keiyaku-workflow/SKILL.md +6 -4
- package/build/plugins/pi/akuma-tools.ts +0 -290
- package/build/src/akuma/providers/codex-app-server/configuration.d.ts +0 -5
- package/build/src/akuma/providers/codex-app-server/configuration.js +0 -72
- package/build/src/body/keys.d.ts +0 -4
- package/build/src/body/keys.js +0 -11
- package/build/src/cli/commands/debt-query.d.ts +0 -5
- package/build/src/cli/commands/debt-query.js +0 -194
- package/build/src/cli/render/akuma-tool-command.d.ts +0 -6
- package/build/src/cli/render/akuma-tool-command.js +0 -143
- package/build/src/cli/render/akuma-tool.d.ts +0 -29
- package/build/src/cli/render/akuma-tool.js +0 -225
- package/build/src/debt/context.d.ts +0 -28
- package/build/src/debt/context.js +0 -102
- package/build/src/debt/created-observation.d.ts +0 -26
- package/build/src/debt/created-observation.js +0 -38
- package/build/src/debt/query.d.ts +0 -80
- package/build/src/debt/query.js +0 -283
- package/build/src/kanshi/roster.d.ts +0 -2
- package/build/src/kanshi/roster.js +0 -2
- package/build/src/library/contract-execution.d.ts +0 -28
- package/build/src/library/contract-execution.js +0 -506
- package/build/src/library/keiyaku-policy.d.ts +0 -27
- package/build/src/library/keiyaku-policy.js +0 -44
- package/build/src/library/keiyaku-status.d.ts +0 -1487
- package/build/src/library/keiyaku-status.js +0 -92
- package/plugins/pi/akuma-tools.ts +0 -290
|
@@ -1,28 +1,31 @@
|
|
|
1
1
|
/** @architectureCompositionRoot */
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
export { classifyVerb } from "./keiyaku-classify.js";
|
|
4
|
-
import {
|
|
4
|
+
import { durationSchema } from "../akuma/call-input.js";
|
|
5
|
+
import { parseDuration } from "../duration.js";
|
|
6
|
+
import { addDebtInputSchema, updateDebtInputSchema } from "../debt/input.js";
|
|
7
|
+
import { amendInputSchema } from "./input.js";
|
|
5
8
|
import { askProgressSchema } from "../akuma/akuma-selection-execution.js";
|
|
6
9
|
import { akumaReportResultSchema } from "../akuma/akuma-instance.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
10
|
+
import { akumaIdSchema } from "../akuma/identity.js";
|
|
11
|
+
import { contractIdSchema } from "../git/identity.js";
|
|
12
|
+
import { akumaNameCatalogSchema } from "../akuma/archetype.js";
|
|
13
|
+
import { akumaCatalogueSchema, akumaObservationSchema, akumaAskResultSchema, akumaAskNormalResultSchema, akumaKillResultSchema, akumaTellResultSchema, } from "../akuma/selection-observation.js";
|
|
14
|
+
import { regionResultSchema, kanshiReportSchema, contractStatusSchema, contractNormalStatusSchema, } from "../kanshi/report.js";
|
|
11
15
|
import { settingsSchema } from "../settings.js";
|
|
12
16
|
import { contractCatalogueSchema } from "../protocol/read/status.js";
|
|
13
17
|
import { executionObservationSchema } from "../protocol/execution-observation.js";
|
|
14
|
-
import {
|
|
15
|
-
import { bindOutcomeSchema, amendOutcomeSchema, arcOutcomeSchema, deliverOutcomeSchema, deliveryPreviewOutcomeSchema, verifyOutcomeSchema, reviewOutcomeSchema, abandonOutcomeSchema, } from "./contract-outcomes.js";
|
|
18
|
+
import { spawnResultSchema, spawnNormalResultSchema, forkResultSchema, forkNormalResultSchema, } from "./akuma-creation.js";
|
|
19
|
+
import { bindOutcomeSchema, bindNormalOutcomeSchema, amendOutcomeSchema, arcOutcomeSchema, deliverOutcomeSchema, deliveryPreviewOutcomeSchema, verifyOutcomeSchema, verifyNormalOutcomeSchema, reviewOutcomeSchema, abandonOutcomeSchema, } from "./contract-outcomes.js";
|
|
16
20
|
import { contractHistorySchema } from "./contract-types.js";
|
|
17
|
-
import { guidanceSchema } from "./kei.js";
|
|
18
|
-
import {
|
|
21
|
+
import { guidanceSchema, guidanceNormalSchema } from "./kei.js";
|
|
22
|
+
import { invocationWaitResultSchema, invocationWaitNormalResultSchema } from "./keiyaku-wait.js";
|
|
23
|
+
import { parseAkumaGlob, parseReadableAkumaAlias } from "../identity/selector.js";
|
|
19
24
|
import { reconcileResultSchema } from "./reconcile.js";
|
|
20
|
-
import { akumaHistoryResultSchema } from "./selection.js";
|
|
21
|
-
import { statusResultSchema } from "./keiyaku-status.js";
|
|
25
|
+
import { akumaHistoryResultSchema, historySelectionSchemas } from "./selection.js";
|
|
22
26
|
import { whoamiFactsSchema } from "./keiyaku-identity.js";
|
|
23
27
|
import { resetOutcomeSchema } from "./outcome.js";
|
|
24
|
-
import { debtAbsentSchema,
|
|
25
|
-
import { debtPrioritySchema, debtStateSchema } from "../debt/document.js";
|
|
28
|
+
import { debtAbsentSchema, debtShowResultSchema, debtShowNormalResultSchema, debtDoctorReportSchema, debtMutationResultSchema, debtMutationNormalResultSchema, debtCatalogueSchema, debtListSchema, debtUpdateResultSchema, } from "../debt/index.js";
|
|
26
29
|
import { debtIdSchema } from "../debt/identity.js";
|
|
27
30
|
const text = z.string();
|
|
28
31
|
const nonblank = text.regex(/\S/u, "Must not be blank");
|
|
@@ -30,261 +33,367 @@ const optText = text.exactOptional();
|
|
|
30
33
|
const optBool = z.boolean().exactOptional();
|
|
31
34
|
const strings = z.array(text).readonly();
|
|
32
35
|
const positive = z.number().int().positive();
|
|
33
|
-
const timeout =
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
+
const timeout = durationSchema.exactOptional();
|
|
37
|
+
const waitDuration = text.refine((value) => parseDuration(value).kind === "parsed", {
|
|
38
|
+
message: "wait requires an integer duration with unit ms, s, m, or h within the safe millisecond range",
|
|
39
|
+
});
|
|
40
|
+
const contract = {
|
|
41
|
+
contract: optText.describe("Target Contract selector (kei/...); omit to resolve from cwd when inside an appointed Contract worktree."),
|
|
42
|
+
};
|
|
36
43
|
const commonBind = {
|
|
37
|
-
target: text
|
|
38
|
-
|
|
39
|
-
|
|
44
|
+
target: text
|
|
45
|
+
.nullable()
|
|
46
|
+
.exactOptional()
|
|
47
|
+
.describe("Integration target: branch name, active kei/... to stack on, or null for a targetless Contract. Omit to target the current branch."),
|
|
40
48
|
};
|
|
41
|
-
const
|
|
42
|
-
z.null(),
|
|
43
|
-
z.boolean(),
|
|
44
|
-
z.number().finite(),
|
|
45
|
-
z.string(),
|
|
46
|
-
z.array(jsonValue).readonly(),
|
|
47
|
-
z.record(z.string(), jsonValue).readonly(),
|
|
48
|
-
]));
|
|
49
|
-
const jsonDocument = z.record(z.string(), jsonValue).readonly();
|
|
49
|
+
const jsonDocument = z.record(z.string(), z.unknown()).readonly();
|
|
50
50
|
const contractSelector = text.startsWith("kei/");
|
|
51
51
|
const akumaSelector = text.regex(/^(?!kei\/)/u);
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
const debtSelection = z
|
|
53
|
+
.enum(["active", "closed", "all"])
|
|
54
|
+
.exactOptional()
|
|
55
|
+
.describe('Debt lifecycle filter (valid only with "debt"/"debt/"): "active" (open, default), "closed" (done or drop), or "all".');
|
|
56
|
+
const catalogueSelector = 'Catalogue path selector: "kei"/"kei/", "debt"/"debt/", "aku"/"aku/" (akumaName values), or "aku/*" / "aku/*/*" / "aku/<name>" / "aku/<name>/*" (instances).';
|
|
57
|
+
const lsInputSchema = z
|
|
58
|
+
.strictObject({
|
|
59
|
+
selector: text
|
|
60
|
+
.regex(/^(?:kei|debt|aku)\/?$|^aku\/(?:\*(?:\/\*)?|[^/*]+(?:\/\*|\/)?)$/u)
|
|
61
|
+
.describe(catalogueSelector),
|
|
62
|
+
limit: positive.exactOptional().describe("Maximum rows to return (positive integer)."),
|
|
63
|
+
selection: debtSelection,
|
|
64
|
+
mine: optBool.describe("When true on an Akuma-instance selector, restrict to direct and transitive descendants of this server environment's caller identity."),
|
|
65
|
+
})
|
|
66
|
+
.superRefine(({ selector, selection, mine }, context) => {
|
|
67
|
+
if (selection !== undefined && selector !== "debt" && selector !== "debt/")
|
|
68
|
+
context.addIssue({ code: "custom", message: "selection is valid only with a Debt catalogue" });
|
|
69
|
+
if (mine !== undefined && (!selector.startsWith("aku/") || selector === "aku/"))
|
|
70
|
+
context.addIssue({ code: "custom", message: "mine is valid only with an Akuma-instance catalogue" });
|
|
71
|
+
})
|
|
72
|
+
.readonly();
|
|
73
|
+
const spawnFields = {
|
|
74
|
+
akumaName: nonblank.describe('akumaName to spawn. Use ls {"selector":"aku/"} to list valid names, including when the selected name is not found. Always births a new instance; use tell or ask to continue an existing Akuma.'),
|
|
75
|
+
contract: optText.describe("Contract ID (kei/...) to record as Dispatch association for status/kanshi; does not set workdir or inject Contract text."),
|
|
76
|
+
workdir: optText.describe("Execution directory for the Akuma (relative paths resolve from cwd; defaults to cwd)."),
|
|
77
|
+
alias: optText.describe("World-local alias (with or without leading @) assigned to this Akuma, reassigning any previous holder."),
|
|
78
|
+
bare: optBool.describe("Omit Keiyaku runtime instructions for this Akuma's lifetime (required for generic ACP providers)."),
|
|
56
79
|
};
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
supersedes: strings.exactOptional(),
|
|
62
|
-
relates: strings.exactOptional(),
|
|
80
|
+
const tellFields = {
|
|
81
|
+
akuma: text.describe("Target Akuma selector (aku/<name>/<hex> or @alias)."),
|
|
82
|
+
prompt: nonblank.describe("Nonblank text instruction to admit."),
|
|
83
|
+
interrupt: optBool.describe("Request the currently running turn to yield before waking a successor turn for this prompt."),
|
|
63
84
|
};
|
|
64
|
-
const debtPredicate = z.union([
|
|
65
|
-
z.strictObject({ field: z.literal("state"), operator: z.enum(["=", "!="]), value: debtStateSchema }).readonly(),
|
|
66
|
-
z
|
|
67
|
-
.strictObject({
|
|
68
|
-
field: z.literal("priority"),
|
|
69
|
-
operator: z.enum(["=", "!=", "<", "<=", ">", ">="]),
|
|
70
|
-
value: debtPrioritySchema,
|
|
71
|
-
})
|
|
72
|
-
.readonly(),
|
|
73
|
-
z.strictObject({ field: z.enum(["title", "id"]), operator: z.enum(["=", "!=", "~"]), value: text }).readonly(),
|
|
74
|
-
z
|
|
75
|
-
.strictObject({ field: z.literal("parent"), operator: z.enum(["=", "!="]), value: debtIdSchema.nullable() })
|
|
76
|
-
.readonly(),
|
|
77
|
-
z
|
|
78
|
-
.strictObject({ field: z.enum(["under", "needs", "blocks"]), operator: z.enum(["=", "!="]), value: debtIdSchema })
|
|
79
|
-
.readonly(),
|
|
80
|
-
z.strictObject({ field: z.enum(["ready", "blocked"]), operator: z.enum(["=", "!="]), value: z.boolean() }).readonly(),
|
|
81
|
-
z
|
|
82
|
-
.strictObject({
|
|
83
|
-
field: z.enum(["created", "updated"]),
|
|
84
|
-
operator: z.enum(["=", "!=", "<", "<=", ">", ">="]),
|
|
85
|
-
value: text,
|
|
86
|
-
})
|
|
87
|
-
.readonly(),
|
|
88
|
-
]);
|
|
89
|
-
const debtQueryExpression = z.lazy(() => z.union([
|
|
90
|
-
z.strictObject({ kind: z.enum(["and", "or"]), terms: z.array(debtQueryExpression).readonly() }).readonly(),
|
|
91
|
-
z.strictObject({ kind: z.literal("not"), term: debtQueryExpression }).readonly(),
|
|
92
|
-
z.strictObject({ kind: z.literal("predicate"), predicate: debtPredicate }).readonly(),
|
|
93
|
-
]));
|
|
94
85
|
export const verbs = Object.freeze({
|
|
95
86
|
bind: {
|
|
96
|
-
description: "Bind Contract terms or
|
|
87
|
+
description: "Bind a Contract: one tracked delivery with fixed terms. Complete Markdown terms in (or forkOf to copy another's); a kei/... id and its own worktree out. target is where the work lands once accepted; gates is what must pass first. Runs no checks.",
|
|
97
88
|
input: z.union([
|
|
98
89
|
z
|
|
99
90
|
.strictObject({
|
|
100
|
-
markdown: text,
|
|
101
|
-
debt:
|
|
91
|
+
markdown: text.describe("Complete Contract Markdown document (# Title, ## Context, ## Objective, ## Design, ## Region, ## Criteria, optional ## Verification). Mutually exclusive with forkOf."),
|
|
92
|
+
debt: debtIdSchema
|
|
93
|
+
.exactOptional()
|
|
94
|
+
.describe("Open Debt ID (debt/<slug>-<hex>) to associate as this Contract's held Debt."),
|
|
95
|
+
...commonBind,
|
|
96
|
+
after: strings
|
|
97
|
+
.exactOptional()
|
|
98
|
+
.describe("Logical prerequisite Contract IDs (kei/...) that must be accepted before placement completes."),
|
|
99
|
+
gates: strings
|
|
100
|
+
.exactOptional()
|
|
101
|
+
.describe('Acceptance gate names overriding default gates (for example ["reviewed", "verified"], or [] for ungated placement).'),
|
|
102
|
+
})
|
|
103
|
+
.readonly(),
|
|
104
|
+
z
|
|
105
|
+
.strictObject({
|
|
106
|
+
forkOf: text.describe("Existing Contract selector (kei/...) whose terms are copied into a new Contract. Mutually exclusive with markdown, debt, after, and gates."),
|
|
102
107
|
...commonBind,
|
|
103
|
-
after: strings.exactOptional(),
|
|
104
|
-
gates: strings.exactOptional(),
|
|
105
108
|
})
|
|
106
109
|
.readonly(),
|
|
107
|
-
z.strictObject({ forkOf: text, ...commonBind }).readonly(),
|
|
108
110
|
]),
|
|
109
111
|
output: bindOutcomeSchema,
|
|
112
|
+
normal: bindNormalOutcomeSchema,
|
|
110
113
|
effect: "write",
|
|
111
114
|
},
|
|
112
115
|
amend: {
|
|
113
|
-
description: "
|
|
114
|
-
input:
|
|
115
|
-
.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
...actor,
|
|
116
|
+
description: "Rewrite an active Contract's terms, target, prerequisites (after), or gates; naming none reports the Contract unchanged and writes nothing. markdown is H2 edits such as ## Replace: Objective, not a new Contract. Returns only what changed.",
|
|
117
|
+
input: amendInputSchema
|
|
118
|
+
.extend({
|
|
119
|
+
markdown: amendInputSchema.shape.markdown.describe("Replacement Contract Markdown document or section-level amendment."),
|
|
120
|
+
after: amendInputSchema.shape.after.describe("Replacement prerequisite Contract IDs (kei/...); pass [] to clear prerequisites."),
|
|
121
|
+
gates: amendInputSchema.shape.gates.describe("Replacement acceptance gate names; pass [] to clear all gates."),
|
|
122
|
+
target: amendInputSchema.shape.target.describe("Explicit existing branch or active Contract destination; omission retains the current target."),
|
|
121
123
|
})
|
|
124
|
+
.extend(contract)
|
|
122
125
|
.readonly(),
|
|
123
126
|
output: amendOutcomeSchema,
|
|
124
127
|
effect: "write",
|
|
125
128
|
},
|
|
126
129
|
arc: {
|
|
127
|
-
description: "
|
|
128
|
-
input: z.strictObject({ ...contract, markdown: text, ...actor }).readonly(),
|
|
129
|
-
output: arcOutcomeSchema,
|
|
130
|
-
effect: "write",
|
|
131
|
-
},
|
|
132
|
-
deliver: {
|
|
133
|
-
description: "Deliver a Contract candidate.",
|
|
130
|
+
description: "Open the next chapter of an active Contract: a # Title and optional notes telling its Akumas what is being done now. The terms stay as bound.",
|
|
134
131
|
input: z
|
|
135
132
|
.strictObject({
|
|
136
133
|
...contract,
|
|
137
|
-
|
|
138
|
-
includeDirty: optBool,
|
|
139
|
-
materializeConflict: optBool,
|
|
140
|
-
overwrite: optBool,
|
|
134
|
+
markdown: text.describe("Arc Markdown body naming and scoping the current chapter."),
|
|
141
135
|
})
|
|
142
136
|
.readonly(),
|
|
143
|
-
output:
|
|
144
|
-
progress: executionObservationSchema,
|
|
137
|
+
output: arcOutcomeSchema,
|
|
145
138
|
effect: "write",
|
|
146
139
|
},
|
|
147
|
-
|
|
148
|
-
description: "
|
|
149
|
-
input: z.
|
|
150
|
-
|
|
140
|
+
deliver: {
|
|
141
|
+
description: "Hand in the work from a Contract's worktree. It lands on the target once prerequisites are accepted and every gate passes (reviewed: a satisfied review; verified: passing verify results); until then it waits, delivered. Uncommitted changes need includeDirty. dryRun: true only looks. Runs no checks and records no review.",
|
|
142
|
+
input: z.union([
|
|
143
|
+
z
|
|
144
|
+
.strictObject({
|
|
145
|
+
...contract,
|
|
146
|
+
dryRun: z
|
|
147
|
+
.literal(true)
|
|
148
|
+
.describe("When true, read-only preview of candidate integration, standing gate evidence, and target followability without recording delivery or mutating refs."),
|
|
149
|
+
includeDirty: optBool.describe("Capture uncommitted worktree and untracked changes via a private index without altering the worktree's real Git index."),
|
|
150
|
+
showDiff: optBool.describe("Include the candidate patch diff in dryRun preview output (valid only with dryRun: true)."),
|
|
151
|
+
})
|
|
152
|
+
.readonly(),
|
|
153
|
+
z
|
|
154
|
+
.strictObject({
|
|
155
|
+
...contract,
|
|
156
|
+
dryRun: z
|
|
157
|
+
.literal(false)
|
|
158
|
+
.exactOptional()
|
|
159
|
+
.describe("When true, read-only preview of candidate integration, standing gate evidence, and target followability without recording delivery or mutating refs."),
|
|
160
|
+
message: optText.describe("Optional commit/integration message for the delivered candidate (submission only)."),
|
|
161
|
+
includeDirty: optBool.describe("Capture uncommitted worktree and untracked changes via a private index without altering the worktree's real Git index."),
|
|
162
|
+
materializeConflict: optBool.describe("When target integration conflicts, materialize conflict markers into the appointed worktree for resolution instead of refusing cleanly (submission only)."),
|
|
163
|
+
overwrite: optBool.describe("Allow replacing an earlier delivered candidate when required by conflict or rewrite state (submission only)."),
|
|
164
|
+
})
|
|
165
|
+
.readonly(),
|
|
166
|
+
]),
|
|
167
|
+
output: z.union([deliverOutcomeSchema, deliveryPreviewOutcomeSchema]),
|
|
151
168
|
progress: executionObservationSchema,
|
|
152
|
-
effect: "
|
|
169
|
+
effect: "write",
|
|
153
170
|
},
|
|
154
171
|
verify: {
|
|
155
|
-
description: "Run
|
|
156
|
-
input: z
|
|
172
|
+
description: "Run the Contract's ## Verification checks now. A failed check is a verdict, not a tool error. Results are bound to the exact integration tree they ran on: any change to the work or the target makes them stale. They count only under the verified gate, and may land an already-delivered Contract.",
|
|
173
|
+
input: z
|
|
174
|
+
.strictObject({
|
|
175
|
+
...contract,
|
|
176
|
+
index: positive
|
|
177
|
+
.exactOptional()
|
|
178
|
+
.describe("1-based position of a single ## Verification fence to execute; omit to run all declared fences."),
|
|
179
|
+
includeDirty: optBool.describe("Verify a prospective snapshot that includes uncommitted worktree changes without staging them."),
|
|
180
|
+
})
|
|
181
|
+
.readonly(),
|
|
157
182
|
output: verifyOutcomeSchema,
|
|
183
|
+
normal: verifyNormalOutcomeSchema,
|
|
158
184
|
progress: executionObservationSchema,
|
|
159
185
|
effect: "write",
|
|
160
186
|
},
|
|
161
187
|
review: {
|
|
162
|
-
description: "Record Contract
|
|
188
|
+
description: "Record your verdict on a Contract's diff: satisfied or unsatisfied, with reasons. Valid before or after deliver. Bound to the diff content: a pure rebase keeps it, a changed diff makes it stale. Satisfied may land an already-delivered Contract.",
|
|
163
189
|
input: z
|
|
164
|
-
.strictObject({
|
|
190
|
+
.strictObject({
|
|
191
|
+
...contract,
|
|
192
|
+
verdict: z
|
|
193
|
+
.enum(["satisfied", "unsatisfied"])
|
|
194
|
+
.describe('Review judgment for the candidate: "satisfied" or "unsatisfied".'),
|
|
195
|
+
summary: nonblank.describe("Nonblank review rationale and findings recorded as testimony."),
|
|
196
|
+
})
|
|
165
197
|
.readonly(),
|
|
166
198
|
output: reviewOutcomeSchema,
|
|
167
199
|
progress: executionObservationSchema,
|
|
168
200
|
effect: "write",
|
|
169
201
|
},
|
|
170
202
|
abandon: {
|
|
171
|
-
description: "
|
|
172
|
-
input: z
|
|
203
|
+
description: "Break an active Contract. Its work never lands; its worktree is reclaimed. No undo.",
|
|
204
|
+
input: z
|
|
205
|
+
.strictObject({
|
|
206
|
+
...contract,
|
|
207
|
+
note: optText.describe("Optional reason recorded on the abandonment entry."),
|
|
208
|
+
})
|
|
209
|
+
.readonly(),
|
|
173
210
|
output: abandonOutcomeSchema,
|
|
174
211
|
effect: "destroy",
|
|
175
212
|
},
|
|
176
213
|
show: {
|
|
177
|
-
description: "Read Contract
|
|
178
|
-
input: z
|
|
179
|
-
|
|
214
|
+
description: "Read a Contract in full: terms, current chapter, and working instructions. Or read one Debt in full with its prerequisites. Omit id to read the Contract whose worktree you stand in.",
|
|
215
|
+
input: z
|
|
216
|
+
.strictObject({
|
|
217
|
+
id: text
|
|
218
|
+
.superRefine((id, context) => {
|
|
219
|
+
if (debtIdSchema.safeParse(id).success ||
|
|
220
|
+
contractIdSchema.safeParse(id.startsWith("@") ? `kei/${id.slice(1)}` : id).success)
|
|
221
|
+
return;
|
|
222
|
+
context.addIssue({
|
|
223
|
+
code: "custom",
|
|
224
|
+
message: id.startsWith("@kei/")
|
|
225
|
+
? `redundant short contract selector: ${id}`
|
|
226
|
+
: "show requires one Contract selector or one Debt ID",
|
|
227
|
+
});
|
|
228
|
+
})
|
|
229
|
+
.exactOptional()
|
|
230
|
+
.describe("One kei/... or @name for Contract guidance, or one debt/... ID. Omit for contextual Contract guidance from cwd."),
|
|
231
|
+
})
|
|
232
|
+
.readonly(),
|
|
233
|
+
output: z.union([guidanceSchema, debtShowResultSchema, debtAbsentSchema]),
|
|
234
|
+
normal: z.union([guidanceNormalSchema, debtShowNormalResultSchema]),
|
|
180
235
|
effect: "read",
|
|
181
236
|
},
|
|
182
237
|
reconcile: {
|
|
183
|
-
description: "
|
|
184
|
-
input: z
|
|
238
|
+
description: "Finish what an interrupted or lagging call left half done: Git, worktree, and hook steps, for one Contract or all. Safe to repeat; never undoes a recorded result.",
|
|
239
|
+
input: z
|
|
240
|
+
.strictObject({
|
|
241
|
+
contract: optText.describe("Contract selector (kei/...) to reconcile; omit to reconcile all Contracts in the repo."),
|
|
242
|
+
retryHooks: optBool.describe("Re-run failed worktree lifecycle hooks during reconciliation."),
|
|
243
|
+
})
|
|
244
|
+
.readonly(),
|
|
185
245
|
output: reconcileResultSchema,
|
|
186
246
|
effect: "write",
|
|
187
247
|
},
|
|
188
248
|
spawn: {
|
|
189
|
-
description: "
|
|
249
|
+
description: "Birth a new Akuma from akumaName (ls aku/), with an optional first order. Returns birth and admission, not an answer; observe separately with wait. contract only marks whose work it is; give it a workdir and the terms yourself. A failed result with an akumaId still left an Akuma alive.",
|
|
190
250
|
input: z
|
|
191
251
|
.strictObject({
|
|
192
|
-
|
|
193
|
-
prompt:
|
|
194
|
-
...contract,
|
|
195
|
-
workdir: optText,
|
|
196
|
-
alias: optText,
|
|
197
|
-
mode: z.enum(["wait", "detach"]).exactOptional(),
|
|
198
|
-
timeoutMs: timeout,
|
|
199
|
-
writableDirectories: strings.exactOptional(),
|
|
200
|
-
bare: optBool,
|
|
201
|
-
schema: jsonDocument.exactOptional(),
|
|
252
|
+
...spawnFields,
|
|
253
|
+
prompt: nonblank.exactOptional().describe("Opening instruction text; omit to birth idle."),
|
|
202
254
|
})
|
|
203
255
|
.readonly(),
|
|
204
256
|
output: spawnResultSchema,
|
|
205
|
-
|
|
257
|
+
normal: spawnNormalResultSchema,
|
|
206
258
|
effect: "write",
|
|
207
259
|
},
|
|
208
260
|
fork: {
|
|
209
|
-
description: "
|
|
210
|
-
input: z
|
|
261
|
+
description: "Birth a copy of an Akuma as it stood at an answered turn (turn/<n> from history), to try another path. The copy wakes idle; give it orders with tell. Needs provider support.",
|
|
262
|
+
input: z
|
|
263
|
+
.strictObject({
|
|
264
|
+
akuma: text.describe("Source Akuma selector (aku/<name>/<hex> or @alias)."),
|
|
265
|
+
at: text.describe("Exact retained answered turn coordinate (turn/<n>) to branch from."),
|
|
266
|
+
bare: optBool.describe("Omit Keiyaku runtime instructions on the forked child (a bare parent stays bare regardless)."),
|
|
267
|
+
})
|
|
268
|
+
.readonly(),
|
|
211
269
|
output: forkResultSchema,
|
|
270
|
+
normal: forkNormalResultSchema,
|
|
212
271
|
effect: "write",
|
|
213
272
|
},
|
|
214
273
|
tell: {
|
|
215
|
-
description: "
|
|
216
|
-
input: z
|
|
274
|
+
description: "Give an Akuma new orders: steers its current work or wakes it. Returns admission, not an answer. Observe work separately with wait, or use ask for a structured answer.",
|
|
275
|
+
input: z
|
|
276
|
+
.strictObject({
|
|
277
|
+
...tellFields,
|
|
278
|
+
})
|
|
279
|
+
.readonly(),
|
|
217
280
|
output: akumaTellResultSchema,
|
|
218
281
|
effect: "write",
|
|
219
282
|
},
|
|
220
283
|
ask: {
|
|
221
|
-
description: "
|
|
284
|
+
description: "Demand a structured answer from an Akuma: a prompt and a JSON Schema in, parsed JSON out. The answer is not checked against the schema; non-JSON is a failure. Not every provider honors schemas.",
|
|
222
285
|
input: z
|
|
223
286
|
.strictObject({
|
|
224
|
-
akuma: text,
|
|
225
|
-
prompt:
|
|
226
|
-
timeoutMs: timeout,
|
|
227
|
-
schema: jsonDocument.
|
|
228
|
-
interrupt: optBool,
|
|
287
|
+
akuma: text.describe("Target Akuma selector (aku/<name>/<hex> or @alias)."),
|
|
288
|
+
prompt: nonblank.describe("Nonblank question or instruction to admit."),
|
|
289
|
+
timeoutMs: timeout.describe("Optional observation deadline in integer milliseconds (stops observation on deadline without retracting the prompt or killing the Akuma)."),
|
|
290
|
+
schema: jsonDocument.describe("JSON Schema object sent to the provider to constrain the turn's JSON output."),
|
|
291
|
+
interrupt: optBool.describe("Request the currently running turn to yield before running this Ask."),
|
|
229
292
|
})
|
|
230
293
|
.readonly(),
|
|
231
294
|
output: akumaAskResultSchema,
|
|
295
|
+
normal: akumaAskNormalResultSchema,
|
|
232
296
|
progress: askProgressSchema,
|
|
233
297
|
effect: "write",
|
|
234
298
|
},
|
|
235
299
|
kill: {
|
|
236
|
-
description: "Kill
|
|
237
|
-
input: z
|
|
300
|
+
description: "Kill an Akuma's current execution. Nothing is erased: history and queued orders remain, and tell or ask wakes it.",
|
|
301
|
+
input: z
|
|
302
|
+
.strictObject({
|
|
303
|
+
akuma: nonblank.describe('One Akuma selector: aku/<name>/<hex>, @alias, kei/... (all Akumas dispatched to that Contract), or glob "aku/<name-pattern>/<hex-pattern>". Contract/glob selection may expand to several members.'),
|
|
304
|
+
})
|
|
305
|
+
.readonly(),
|
|
238
306
|
output: akumaKillResultSchema,
|
|
239
307
|
effect: "destroy",
|
|
240
308
|
},
|
|
241
309
|
wait: {
|
|
242
|
-
description: "Wait for
|
|
243
|
-
input: z
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
310
|
+
description: "Wait for Contracts to change or close and Akumas to finish their current work, together or separately. Any/all applies to the whole selection. Already satisfied members count immediately. A timeout ends observation, never the work.",
|
|
311
|
+
input: z
|
|
312
|
+
.strictObject({
|
|
313
|
+
selectors: z
|
|
314
|
+
.array(z.union([
|
|
315
|
+
contractIdSchema,
|
|
316
|
+
text.refine((value) => {
|
|
317
|
+
try {
|
|
318
|
+
if (value.startsWith("@"))
|
|
319
|
+
parseReadableAkumaAlias(value);
|
|
320
|
+
else if (value.includes("*"))
|
|
321
|
+
parseAkumaGlob(value);
|
|
322
|
+
else
|
|
323
|
+
return akumaIdSchema.safeParse(value).success;
|
|
324
|
+
return true;
|
|
325
|
+
}
|
|
326
|
+
catch {
|
|
327
|
+
return false;
|
|
328
|
+
}
|
|
329
|
+
}, "Expected an Akuma ID, alias or glob"),
|
|
330
|
+
]))
|
|
331
|
+
.min(1)
|
|
332
|
+
.readonly()
|
|
333
|
+
.describe('Contract IDs (kei/...) and Akuma selectors (aku/<name>/<hex>, @alias, or "aku/<name-pattern>/<hex-pattern>"), in caller order. A Contract selects its journal, not dispatched Akumas.'),
|
|
334
|
+
completion: z
|
|
335
|
+
.enum(["any", "all"])
|
|
336
|
+
.exactOptional()
|
|
337
|
+
.describe('Wake when "any" member satisfies (default), or wait for "all" members.'),
|
|
338
|
+
timeout: waitDuration
|
|
339
|
+
.exactOptional()
|
|
340
|
+
.describe("One observation deadline as a duration (e.g. 5m); never cancels work."),
|
|
341
|
+
})
|
|
342
|
+
.readonly(),
|
|
343
|
+
output: invocationWaitResultSchema,
|
|
344
|
+
normal: invocationWaitNormalResultSchema,
|
|
260
345
|
effect: "read",
|
|
261
346
|
},
|
|
262
347
|
history: {
|
|
263
|
-
description: "
|
|
348
|
+
description: "Look back: a Contract's journal, or an Akuma's recent activity. For an Akuma, last returns its latest answer and id opens one item such as turn/<n> or report/<n>.",
|
|
264
349
|
input: z.union([
|
|
265
|
-
z.strictObject({ selector: contractSelector, full: optBool }).readonly(),
|
|
266
350
|
z
|
|
267
351
|
.strictObject({
|
|
268
|
-
selector:
|
|
269
|
-
|
|
270
|
-
before: positive.exactOptional(),
|
|
271
|
-
since: positive.exactOptional(),
|
|
272
|
-
limit: positive.exactOptional(),
|
|
273
|
-
last: optBool,
|
|
352
|
+
selector: contractSelector.describe("Single subject: kei/... for Contract history, or aku/<name>/<hex> / @alias for Akuma history."),
|
|
353
|
+
full: optBool.describe("Include full event details on Contract history (valid only for kei/... selectors)."),
|
|
274
354
|
})
|
|
275
355
|
.readonly(),
|
|
356
|
+
...historySelectionSchemas.map((branch) => branch.extend({
|
|
357
|
+
last: branch.shape.last.describe("When true, return only the Akuma's latest retained answer bytes (mutually exclusive with id, before, since, and limit)."),
|
|
358
|
+
...("id" in branch.shape
|
|
359
|
+
? {
|
|
360
|
+
id: branch.shape.id.describe("Exact Akuma item coordinate: turn/<n> (turn outcome), report/<n> (full progress report), or positive decimal activity sequence. Mutually exclusive with before, since, limit, and last."),
|
|
361
|
+
}
|
|
362
|
+
: {}),
|
|
363
|
+
...("before" in branch.shape
|
|
364
|
+
? {
|
|
365
|
+
before: branch.shape.before.describe("Page older Akuma timeline events strictly before this positive decimal sequence."),
|
|
366
|
+
}
|
|
367
|
+
: {}),
|
|
368
|
+
...("since" in branch.shape
|
|
369
|
+
? {
|
|
370
|
+
since: branch.shape.since.describe("Page newer Akuma timeline events strictly after this nonnegative decimal sequence (mutually exclusive with before)."),
|
|
371
|
+
}
|
|
372
|
+
: {}),
|
|
373
|
+
...("limit" in branch.shape
|
|
374
|
+
? { limit: branch.shape.limit.describe("Maximum Akuma timeline rows to return (1..5000, default 12).") }
|
|
375
|
+
: {}),
|
|
376
|
+
})
|
|
377
|
+
.extend({
|
|
378
|
+
selector: akumaSelector.describe("Single subject: kei/... for Contract history, or aku/<name>/<hex> / @alias for Akuma history."),
|
|
379
|
+
})
|
|
380
|
+
.readonly()),
|
|
276
381
|
]),
|
|
277
382
|
output: z.union([contractHistorySchema, akumaHistoryResultSchema]),
|
|
278
383
|
effect: "read",
|
|
279
384
|
},
|
|
280
385
|
report: {
|
|
281
|
-
description: "
|
|
282
|
-
input: z
|
|
386
|
+
description: "From inside a running Akuma, leave a progress note for whoever holds it and keep working. Only works when this server runs inside that Akuma.",
|
|
387
|
+
input: z
|
|
388
|
+
.strictObject({
|
|
389
|
+
text: nonblank.describe("Nonblank progress report Markdown/text recorded on the current turn timeline."),
|
|
390
|
+
})
|
|
391
|
+
.readonly(),
|
|
283
392
|
output: akumaReportResultSchema,
|
|
284
393
|
effect: "write",
|
|
285
394
|
},
|
|
286
395
|
whoami: {
|
|
287
|
-
description: "
|
|
396
|
+
description: "Who this server acts as: caller or Akuma identity, its Contract link and turn initiator, and which Contract worktree cwd stands in. Read from the environment; not authentication.",
|
|
288
397
|
input: z.strictObject({}).readonly(),
|
|
289
398
|
output: whoamiFactsSchema,
|
|
290
399
|
effect: "read",
|
|
@@ -301,158 +410,75 @@ export const verbs = Object.freeze({
|
|
|
301
410
|
output: resetOutcomeSchema,
|
|
302
411
|
effect: "destroy",
|
|
303
412
|
},
|
|
413
|
+
kanshi: {
|
|
414
|
+
description: "Watch everything at once: active Contracts, Debts, and Akumas. Use status, show, or history to look closer.",
|
|
415
|
+
input: z.strictObject({}).readonly(),
|
|
416
|
+
output: kanshiReportSchema,
|
|
417
|
+
effect: "read",
|
|
418
|
+
},
|
|
304
419
|
status: {
|
|
305
|
-
description: "
|
|
306
|
-
input: z
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
420
|
+
description: "Where one Contract stands (stage, gates, prerequisites, worktree) or what one Akuma is doing (state, current work, changed files). Exact kei/... or aku/<name>/<id> only; no aliases.",
|
|
421
|
+
input: z
|
|
422
|
+
.strictObject({
|
|
423
|
+
id: z
|
|
424
|
+
.union([contractIdSchema, akumaIdSchema])
|
|
425
|
+
.describe("Exact Contract ID (kei/...) or Akuma ID (aku/<name>/<hex>); @aliases and category paths are refused."),
|
|
426
|
+
})
|
|
427
|
+
.readonly(),
|
|
428
|
+
output: z.union([contractStatusSchema, akumaObservationSchema]),
|
|
429
|
+
normal: z.union([contractNormalStatusSchema, akumaObservationSchema]),
|
|
313
430
|
effect: "read",
|
|
314
431
|
},
|
|
315
|
-
|
|
316
|
-
description: "
|
|
317
|
-
input:
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
z.strictObject({ paths: z.array(text).min(1).readonly() }).readonly(),
|
|
321
|
-
]),
|
|
322
|
-
output: regionResultSchema,
|
|
432
|
+
ls: {
|
|
433
|
+
description: "List ids of one kind: active Contracts (kei/), open Debts (debt/), akumaName values you can birth (aku/), or existing Akumas (aku/*).",
|
|
434
|
+
input: lsInputSchema,
|
|
435
|
+
output: z.union([contractCatalogueSchema, akumaCatalogueSchema, akumaNameCatalogSchema, debtCatalogueSchema]),
|
|
436
|
+
normal: z.union([contractCatalogueSchema, akumaCatalogueSchema, akumaNameCatalogSchema, debtListSchema]),
|
|
323
437
|
effect: "read",
|
|
324
438
|
},
|
|
325
|
-
|
|
326
|
-
description: "
|
|
439
|
+
region: {
|
|
440
|
+
description: "Before parallel work: which files active Contracts claim to change and where those claims overlap. Advisory only; no locks, no conflict prediction.",
|
|
327
441
|
input: z
|
|
328
442
|
.strictObject({
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
443
|
+
contract: optText.describe("Contract selector (kei/...) whose declared Region and overlaps to inspect; mutually exclusive with paths."),
|
|
444
|
+
paths: z
|
|
445
|
+
.array(text)
|
|
446
|
+
.min(1)
|
|
447
|
+
.readonly()
|
|
448
|
+
.refine((paths) => paths.length > 0)
|
|
449
|
+
.exactOptional()
|
|
450
|
+
.describe("Nonempty repository-relative path or glob patterns to check against active Contract Regions; mutually exclusive with contract."),
|
|
337
451
|
})
|
|
452
|
+
.refine((input) => !(input.contract !== undefined && input.paths !== undefined), "contract and paths are mutually exclusive")
|
|
338
453
|
.readonly(),
|
|
454
|
+
output: regionResultSchema,
|
|
455
|
+
effect: "read",
|
|
456
|
+
},
|
|
457
|
+
"debt.add": {
|
|
458
|
+
description: "Record open work still owed, with optional body, priority and prerequisite needs. Returns its debt/... id.",
|
|
459
|
+
input: addDebtInputSchema.readonly(),
|
|
339
460
|
output: debtMutationResultSchema,
|
|
461
|
+
normal: debtMutationNormalResultSchema,
|
|
340
462
|
effect: "write",
|
|
341
463
|
},
|
|
342
464
|
"debt.addDocument": {
|
|
343
465
|
description: "Create a Debt from Markdown.",
|
|
344
|
-
input: z.strictObject({ markdown: text
|
|
466
|
+
input: z.strictObject({ markdown: text }).readonly(),
|
|
345
467
|
output: debtMutationResultSchema,
|
|
346
468
|
effect: "write",
|
|
347
469
|
},
|
|
348
470
|
"debt.update": {
|
|
349
|
-
description: "
|
|
350
|
-
input:
|
|
351
|
-
.
|
|
352
|
-
id: text,
|
|
353
|
-
title: optText,
|
|
354
|
-
body: optText,
|
|
355
|
-
appendBody: optText,
|
|
356
|
-
note: optText,
|
|
357
|
-
priority: debtPrioritySchema.exactOptional(),
|
|
358
|
-
...debtRelations,
|
|
359
|
-
addNeeds: strings.exactOptional(),
|
|
360
|
-
dropNeeds: strings.exactOptional(),
|
|
361
|
-
addSupersedes: strings.exactOptional(),
|
|
362
|
-
dropSupersedes: strings.exactOptional(),
|
|
363
|
-
addRelates: strings.exactOptional(),
|
|
364
|
-
dropRelates: strings.exactOptional(),
|
|
365
|
-
})
|
|
471
|
+
description: "Replace a Debt's text, priority or prerequisites, or set its disposition to open, done or drop. Any state may be reopened or changed; omitted fields are preserved and empty body, note or needs clears them.",
|
|
472
|
+
input: updateDebtInputSchema
|
|
473
|
+
.safeExtend({ id: debtIdSchema.describe("Target Debt ID (debt/<slug>-<hex>).") })
|
|
366
474
|
.readonly(),
|
|
367
475
|
output: debtUpdateResultSchema,
|
|
368
476
|
effect: "write",
|
|
369
477
|
},
|
|
370
|
-
"debt.show": {
|
|
371
|
-
description: "Read one or more Debts.",
|
|
372
|
-
input: z.union([
|
|
373
|
-
z.strictObject({ id: text }).readonly(),
|
|
374
|
-
z.strictObject({ ids: z.array(text).min(1).readonly() }).readonly(),
|
|
375
|
-
]),
|
|
376
|
-
output: z.union([debtShowResultSchema, debtAbsentSchema]),
|
|
377
|
-
effect: "read",
|
|
378
|
-
},
|
|
379
|
-
"debt.done": {
|
|
380
|
-
description: "Complete Debts in caller order.",
|
|
381
|
-
input: z.strictObject({ ids: z.array(text).min(1).readonly(), note: optText }).readonly(),
|
|
382
|
-
output: debtBatchResultSchema,
|
|
383
|
-
effect: "write",
|
|
384
|
-
},
|
|
385
|
-
"debt.drop": {
|
|
386
|
-
description: "Drop Debts in caller order.",
|
|
387
|
-
input: z.strictObject({ ids: z.array(text).min(1).readonly(), note: optText }).readonly(),
|
|
388
|
-
output: debtBatchResultSchema,
|
|
389
|
-
effect: "write",
|
|
390
|
-
},
|
|
391
|
-
"debt.ready": {
|
|
392
|
-
description: "List ready Debts.",
|
|
393
|
-
input: z.strictObject({ ...debtReadScope, parent: optText }).readonly(),
|
|
394
|
-
output: debtReadyListSchema,
|
|
395
|
-
effect: "read",
|
|
396
|
-
},
|
|
397
|
-
"debt.blocked": {
|
|
398
|
-
description: "List blocked Debts.",
|
|
399
|
-
input: z.strictObject({ ...debtReadScope, parent: optText }).readonly(),
|
|
400
|
-
output: blockedDebtListSchema,
|
|
401
|
-
effect: "read",
|
|
402
|
-
},
|
|
403
|
-
"debt.query": {
|
|
404
|
-
description: "Query Debts using the owner expression.",
|
|
405
|
-
input: z
|
|
406
|
-
.strictObject({
|
|
407
|
-
...debtReadScope,
|
|
408
|
-
selection: debtSelection,
|
|
409
|
-
where: debtQueryExpression.exactOptional(),
|
|
410
|
-
sort: z.enum(["priority", "created", "updated", "id"]).exactOptional(),
|
|
411
|
-
})
|
|
412
|
-
.readonly(),
|
|
413
|
-
output: debtQueryResultSchema,
|
|
414
|
-
effect: "read",
|
|
415
|
-
},
|
|
416
|
-
"debt.tree": {
|
|
417
|
-
description: "Observe a Debt decomposition tree.",
|
|
418
|
-
input: z.strictObject({ id: text }).readonly(),
|
|
419
|
-
output: z.union([debtTreeResultSchema, debtAbsentSchema]),
|
|
420
|
-
effect: "read",
|
|
421
|
-
},
|
|
422
478
|
"debt.doctor": {
|
|
423
|
-
description: "Diagnose Debt authority and
|
|
479
|
+
description: "Diagnose Debt authority and prerequisites.",
|
|
424
480
|
input: z.strictObject({}).readonly(),
|
|
425
481
|
output: z.union([debtDoctorReportSchema, debtAbsentSchema]),
|
|
426
482
|
effect: "read",
|
|
427
483
|
},
|
|
428
|
-
"debt.context": {
|
|
429
|
-
description: "Observe or set the Debt namespace context.",
|
|
430
|
-
input: z.strictObject({ namespace: strings.exactOptional() }).readonly(),
|
|
431
|
-
output: debtContextResultSchema,
|
|
432
|
-
effect: "write",
|
|
433
|
-
},
|
|
434
|
-
ls: {
|
|
435
|
-
description: "List Contracts, Akumas, archetypes, or Debts.",
|
|
436
|
-
input: z.union([
|
|
437
|
-
z.strictObject({ of: z.literal("kei"), limit: positive.exactOptional() }).readonly(),
|
|
438
|
-
z
|
|
439
|
-
.strictObject({
|
|
440
|
-
of: z.literal("aku"),
|
|
441
|
-
limit: positive.exactOptional(),
|
|
442
|
-
akumaName: optText,
|
|
443
|
-
caller: z
|
|
444
|
-
.union([
|
|
445
|
-
z.strictObject({ kind: z.literal("mine") }).readonly(),
|
|
446
|
-
z.strictObject({ kind: z.literal("external"), caller: akumaCallerSchema }).readonly(),
|
|
447
|
-
z.strictObject({ kind: z.literal("akuma"), akumaId: text }).readonly(),
|
|
448
|
-
])
|
|
449
|
-
.exactOptional(),
|
|
450
|
-
})
|
|
451
|
-
.readonly(),
|
|
452
|
-
z.strictObject({ of: z.literal("akuma-name"), limit: positive.exactOptional() }).readonly(),
|
|
453
|
-
z.strictObject({ of: z.literal("debt"), ...debtReadScope, selection: debtSelection }).readonly(),
|
|
454
|
-
]),
|
|
455
|
-
output: z.union([contractCatalogueSchema, akumaListSchema, archetypeCatalogSchema, debtCatalogueSchema]),
|
|
456
|
-
effect: "read",
|
|
457
|
-
},
|
|
458
484
|
});
|