@astrosheep/keiyaku 4.6.30 → 4.6.32
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 +39 -22
- package/build/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/build/plugins/claude/skills/keiyaku/SKILL.md +12 -12
- package/build/plugins/claude/skills/keiyaku-akuma/SKILL.md +27 -22
- package/build/plugins/claude/skills/keiyaku-akuma/references/automation.md +14 -14
- package/build/plugins/claude/skills/keiyaku-babysit/SKILL.md +15 -13
- package/build/plugins/claude/skills/keiyaku-bind/SKILL.md +18 -17
- package/build/plugins/claude/skills/keiyaku-debt/SKILL.md +30 -30
- package/build/plugins/claude/skills/keiyaku-workflow/SKILL.md +24 -23
- package/build/plugins/codex/.codex-plugin/plugin.json +1 -1
- package/build/plugins/codex/skills/keiyaku/SKILL.md +12 -12
- package/build/plugins/codex/skills/keiyaku-akuma/SKILL.md +27 -22
- package/build/plugins/codex/skills/keiyaku-akuma/references/automation.md +14 -14
- package/build/plugins/codex/skills/keiyaku-babysit/SKILL.md +15 -13
- package/build/plugins/codex/skills/keiyaku-bind/SKILL.md +18 -17
- package/build/plugins/codex/skills/keiyaku-debt/SKILL.md +30 -30
- package/build/plugins/codex/skills/keiyaku-workflow/SKILL.md +24 -23
- package/build/plugins/opencode/package.json +1 -1
- package/build/plugins/opencode/skills/keiyaku/SKILL.md +12 -12
- package/build/plugins/opencode/skills/keiyaku-akuma/SKILL.md +27 -22
- package/build/plugins/opencode/skills/keiyaku-akuma/references/automation.md +14 -14
- package/build/plugins/opencode/skills/keiyaku-babysit/SKILL.md +15 -13
- package/build/plugins/opencode/skills/keiyaku-bind/SKILL.md +18 -17
- package/build/plugins/opencode/skills/keiyaku-debt/SKILL.md +30 -30
- package/build/plugins/opencode/skills/keiyaku-workflow/SKILL.md +24 -23
- package/build/plugins/pi/README.md +20 -22
- package/build/plugins/pi/akuma-tools.ts +43 -56
- package/build/plugins/pi/keiyaku.ts +15 -4
- package/build/skills/keiyaku/SKILL.md +12 -12
- package/build/skills/keiyaku-akuma/SKILL.md +27 -22
- package/build/skills/keiyaku-akuma/references/automation.md +14 -14
- package/build/skills/keiyaku-babysit/SKILL.md +15 -13
- package/build/skills/keiyaku-bind/SKILL.md +18 -17
- package/build/skills/keiyaku-debt/SKILL.md +30 -30
- package/build/skills/keiyaku-workflow/SKILL.md +24 -23
- package/build/src/akuma/akuma-call.d.ts +4 -6
- package/build/src/akuma/akuma-call.js +12 -15
- package/build/src/akuma/akuma-errors.d.ts +12 -9
- package/build/src/akuma/akuma-errors.js +16 -12
- package/build/src/akuma/akuma-instance.d.ts +102 -23
- package/build/src/akuma/akuma-instance.js +66 -66
- package/build/src/akuma/akuma-observe.d.ts +15 -15
- package/build/src/akuma/akuma-observe.js +34 -32
- package/build/src/akuma/akuma-owner.d.ts +46 -17
- package/build/src/akuma/akuma-owner.js +68 -43
- package/build/src/akuma/akuma-probe.d.ts +3 -3
- package/build/src/akuma/akuma-probe.js +2 -2
- package/build/src/akuma/akuma-selection-execution.d.ts +992 -5
- package/build/src/akuma/akuma-selection-execution.js +96 -125
- package/build/src/akuma/akuma-stream.d.ts +2 -2
- package/build/src/akuma/akuma-stream.js +1 -1
- package/build/src/akuma/akuma-wait.d.ts +7 -7
- package/build/src/akuma/akuma-wait.js +52 -14
- package/build/src/akuma/akuma.d.ts +88 -451
- package/build/src/akuma/akuma.js +58 -56
- package/build/src/akuma/archetype.d.ts +31 -21
- package/build/src/akuma/archetype.js +67 -52
- package/build/src/akuma/body-launch.d.ts +2 -2
- package/build/src/akuma/body.js +35 -30
- package/build/src/akuma/call-initial-tell.d.ts +63 -44
- package/build/src/akuma/call-initial-tell.js +50 -3
- package/build/src/akuma/call-input.d.ts +8 -1
- package/build/src/akuma/call-input.js +27 -18
- package/build/src/akuma/caller.d.ts +26 -17
- package/build/src/akuma/caller.js +24 -10
- package/build/src/akuma/coordinate.d.ts +9 -0
- package/build/src/akuma/coordinate.js +13 -0
- package/build/src/akuma/detached-body.js +3 -3
- package/build/src/akuma/dispatch-association.d.ts +4 -4
- package/build/src/akuma/dispatch-association.js +12 -3
- package/build/src/akuma/execution-instructions.js +2 -2
- package/build/src/akuma/heart/facts.d.ts +32 -9
- package/build/src/akuma/heart/facts.js +18 -5
- package/build/src/akuma/heart/index.d.ts +0 -3
- package/build/src/akuma/heart/index.js +3 -6
- package/build/src/akuma/heart/rows.js +2 -2
- package/build/src/akuma/heart/soul.js +25 -9
- package/build/src/akuma/identity.d.ts +18 -17
- package/build/src/akuma/identity.js +29 -23
- package/build/src/akuma/index.d.ts +7 -9
- package/build/src/akuma/index.js +2 -3
- package/build/src/akuma/lineage-cache.d.ts +4 -4
- package/build/src/akuma/lineage-cache.js +10 -10
- package/build/src/akuma/projection-read.d.ts +2 -5
- package/build/src/akuma/projection-read.js +34 -47
- package/build/src/akuma/projection.d.ts +662 -569
- package/build/src/akuma/projection.js +203 -94
- package/build/src/akuma/provider-recipe.js +3 -2
- package/build/src/akuma/providers/acp/config.js +11 -10
- package/build/src/akuma/providers/acp/index.js +3 -2
- package/build/src/akuma/providers/codex-app-server/index.js +7 -1
- package/build/src/akuma/providers/execution-environment.d.ts +1 -3
- package/build/src/akuma/providers/execution-environment.js +0 -4
- 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/paseo/index.js +7 -4
- package/build/src/akuma/providers/pi/index.js +4 -3
- package/build/src/akuma/publication.d.ts +3 -4
- package/build/src/akuma/publication.js +19 -17
- package/build/src/akuma/retention.js +2 -2
- 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 +559 -54
- package/build/src/akuma/selection-observation.js +207 -1
- package/build/src/akuma/status-projection.d.ts +52 -0
- package/build/src/akuma/status-projection.js +194 -0
- package/build/src/akuma/turn-drive.js +0 -3
- package/build/src/alias/index.d.ts +9 -4
- package/build/src/alias/index.js +11 -9
- package/build/src/body/amend.js +2 -1
- package/build/src/body/arc.js +3 -2
- package/build/src/body/criteria.js +4 -3
- package/build/src/body/decode.js +2 -1
- package/build/src/body/envelope.js +2 -1
- package/build/src/body/region.d.ts +1 -3
- package/build/src/body/region.js +3 -8
- package/build/src/body-host.d.ts +4 -11
- package/build/src/body-host.js +5 -4
- package/build/src/bounded-list.d.ts +8 -0
- package/build/src/bounded-list.js +11 -1
- package/build/src/cli/commands/akuma-grammar.d.ts +109 -66
- package/build/src/cli/commands/akuma-grammar.js +90 -110
- package/build/src/cli/commands/akuma.d.ts +8 -4
- package/build/src/cli/commands/akuma.js +92 -287
- package/build/src/cli/commands/contract-grammar.d.ts +3 -134
- package/build/src/cli/commands/contract-grammar.js +127 -203
- package/build/src/cli/commands/contract-help.d.ts +26 -21
- package/build/src/cli/commands/contract-help.js +45 -36
- package/build/src/cli/commands/contract.d.ts +6 -15
- package/build/src/cli/commands/contract.js +80 -518
- package/build/src/cli/commands/debt-grammar.d.ts +2 -4
- package/build/src/cli/commands/debt-grammar.js +22 -190
- package/build/src/cli/commands/debt.d.ts +2 -3
- package/build/src/cli/commands/debt.js +41 -334
- package/build/src/cli/commands/report.d.ts +2 -4
- package/build/src/cli/commands/report.js +11 -28
- package/build/src/cli/commands/whoami.d.ts +3 -43
- package/build/src/cli/commands/whoami.js +8 -121
- package/build/src/cli/coordinates.d.ts +3 -34
- package/build/src/cli/coordinates.js +13 -129
- package/build/src/cli/main.js +9 -3
- package/build/src/cli/parse.d.ts +78 -7
- package/build/src/cli/parse.js +49 -32
- package/build/src/cli/render/akuma-activity.d.ts +41 -31
- package/build/src/cli/render/akuma-activity.js +262 -349
- package/build/src/cli/render/akuma.d.ts +26 -27
- package/build/src/cli/render/akuma.js +99 -135
- package/build/src/cli/render/catalog.d.ts +3 -9
- package/build/src/cli/render/catalog.js +27 -105
- package/build/src/cli/render/contract-history.d.ts +3 -1
- package/build/src/cli/render/contract-history.js +139 -215
- package/build/src/cli/render/contract-observation.d.ts +36 -30
- package/build/src/cli/render/contract-observation.js +64 -34
- package/build/src/cli/render/contract-wait.js +6 -6
- package/build/src/cli/render/contract.d.ts +39 -6
- package/build/src/cli/render/contract.js +249 -374
- package/build/src/cli/render/debt.d.ts +7 -25
- package/build/src/cli/render/debt.js +74 -210
- package/build/src/cli/render/delivery-preview.d.ts +4 -3
- package/build/src/cli/render/delivery-preview.js +68 -96
- package/build/src/cli/render/kanshi-akuma.d.ts +8 -6
- package/build/src/cli/render/kanshi-akuma.js +77 -62
- package/build/src/cli/render/kanshi.d.ts +2 -4
- package/build/src/cli/render/kanshi.js +184 -223
- package/build/src/cli/render/marks.d.ts +11 -2
- package/build/src/cli/render/marks.js +13 -3
- package/build/src/cli/render/nuke.d.ts +3 -3
- package/build/src/cli/render/nuke.js +13 -16
- package/build/src/cli/render/receipt.d.ts +46 -43
- package/build/src/cli/render/receipt.js +318 -236
- package/build/src/cli/render/reconcile.d.ts +6 -4
- package/build/src/cli/render/reconcile.js +53 -137
- package/build/src/cli/render/refusal.d.ts +6 -4
- package/build/src/cli/render/refusal.js +82 -65
- package/build/src/cli/render/region.d.ts +11 -2
- package/build/src/cli/render/region.js +17 -23
- package/build/src/cli/render/settings.d.ts +1 -2
- package/build/src/cli/render/settings.js +8 -17
- package/build/src/cli/render/terminal.d.ts +11 -8
- package/build/src/cli/render/terminal.js +48 -32
- package/build/src/cli/render/verbs.d.ts +6 -0
- package/build/src/cli/render/verbs.js +270 -0
- package/build/src/cli/render/whoami.d.ts +1 -1
- package/build/src/cli/render/whoami.js +24 -31
- package/build/src/cli/runtime.d.ts +3 -11
- package/build/src/cli/runtime.js +119 -101
- package/build/src/cli/scan.d.ts +1 -1
- package/build/src/cli/streams.d.ts +2 -9
- package/build/src/cli/streams.js +9 -1
- package/build/src/cli/usage.d.ts +2 -1
- package/build/src/cli/usage.js +3 -2
- package/build/src/contract-guidance.js +2 -2
- package/build/src/contract-worktree.d.ts +2 -15
- package/build/src/contract-worktree.js +20 -44
- package/build/src/core/facts/codec.js +9 -23
- package/build/src/core/facts/errors.d.ts +2 -1
- package/build/src/core/facts/errors.js +3 -3
- package/build/src/core/facts/observation.d.ts +4 -5
- package/build/src/core/facts/observation.js +7 -9
- package/build/src/core/facts/types.d.ts +2 -13
- package/build/src/core/facts/types.js +1 -6
- package/build/src/core/verbs/abandon.d.ts +1 -2
- package/build/src/core/verbs/amend.d.ts +1 -3
- package/build/src/core/verbs/amend.js +3 -3
- 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 -3
- package/build/src/core/verbs/bind.js +5 -5
- package/build/src/core/verbs/deliver.d.ts +4 -4
- package/build/src/core/verbs/deliver.js +2 -2
- package/build/src/core/verbs/placement.d.ts +1 -7
- package/build/src/core/verbs/placement.js +4 -6
- package/build/src/core/verbs/reintegrate.d.ts +1 -3
- package/build/src/core/verbs/reintegrate.js +2 -2
- package/build/src/debt/board.d.ts +70 -134
- package/build/src/debt/board.js +99 -190
- package/build/src/debt/catalog.d.ts +4 -6
- package/build/src/debt/catalog.js +3 -40
- package/build/src/debt/document.d.ts +23 -21
- package/build/src/debt/document.js +32 -58
- package/build/src/debt/identity.d.ts +2 -14
- package/build/src/debt/identity.js +19 -49
- package/build/src/debt/index.d.ts +239 -54
- package/build/src/debt/index.js +85 -88
- package/build/src/debt/input.d.ts +21 -6
- package/build/src/debt/input.js +57 -169
- package/build/src/debt/lifecycle-operations.d.ts +1 -3
- package/build/src/debt/lifecycle-operations.js +6 -86
- package/build/src/debt/operation-types.d.ts +97 -79
- package/build/src/debt/operation-types.js +57 -1
- package/build/src/debt/operations.d.ts +11 -19
- package/build/src/debt/operations.js +70 -191
- package/build/src/debt/store.d.ts +4 -4
- package/build/src/debt/store.js +40 -95
- package/build/src/debt/view.d.ts +0 -3
- package/build/src/debt/view.js +0 -4
- package/build/src/dispatch/index.d.ts +22 -5
- package/build/src/dispatch/index.js +46 -37
- package/build/src/errors.d.ts +28 -0
- package/build/src/errors.js +26 -0
- package/build/src/git/admission.d.ts +2 -2
- package/build/src/git/admission.js +2 -1
- package/build/src/git/hooks.d.ts +15 -36
- package/build/src/git/hooks.js +45 -25
- package/build/src/git/integration.d.ts +6 -24
- package/build/src/git/integration.js +10 -16
- package/build/src/git/observe.d.ts +3 -0
- package/build/src/git/observe.js +19 -5
- package/build/src/git/private-state-seat.d.ts +2 -2
- package/build/src/git/private-state-seat.js +2 -1
- package/build/src/git/reconcile.d.ts +20 -95
- package/build/src/git/reconcile.js +37 -70
- package/build/src/git/repository.d.ts +2 -1
- package/build/src/git/repository.js +3 -3
- package/build/src/git/scratch.d.ts +3 -3
- package/build/src/git/scratch.js +4 -1
- package/build/src/git/target-placement.d.ts +27 -35
- package/build/src/git/target-placement.js +42 -27
- package/build/src/git/target.d.ts +4 -4
- package/build/src/git/target.js +2 -1
- package/build/src/git/tender.d.ts +8 -41
- package/build/src/git/tender.js +26 -66
- package/build/src/git/terminal-reconcile.js +15 -18
- package/build/src/git/terminal-seal.d.ts +2 -4
- package/build/src/git/terminal-seal.js +7 -33
- package/build/src/git/workspace.d.ts +65 -41
- package/build/src/git/workspace.js +45 -14
- 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.d.ts +2 -0
- package/build/src/identity/selector.js +17 -6
- package/build/src/index.d.ts +37 -66
- package/build/src/index.js +10 -47
- package/build/src/kanshi/counts.d.ts +44 -15
- package/build/src/kanshi/counts.js +18 -15
- package/build/src/kanshi/index.d.ts +22 -7
- package/build/src/kanshi/index.js +30 -3
- package/build/src/kanshi/read.d.ts +309 -15
- package/build/src/kanshi/read.js +226 -535
- package/build/src/kanshi/report.d.ts +1225 -103
- package/build/src/kanshi/report.js +153 -1
- package/build/src/kanshi/select.d.ts +0 -8
- package/build/src/kanshi/select.js +20 -59
- package/build/src/library/address.d.ts +17 -17
- package/build/src/library/address.js +41 -34
- package/build/src/library/akuma-creation.d.ts +828 -91
- package/build/src/library/akuma-creation.js +292 -273
- package/build/src/library/akuma-retention.d.ts +2 -2
- package/build/src/library/akuma-retention.js +2 -2
- package/build/src/library/akumas.d.ts +33 -10
- package/build/src/library/akumas.js +109 -25
- package/build/src/library/bind.d.ts +32 -61
- package/build/src/library/bind.js +8 -12
- package/build/src/library/continuation.d.ts +133 -505
- package/build/src/library/continuation.js +37 -29
- package/build/src/library/contract-address.d.ts +8 -10
- package/build/src/library/contract-address.js +16 -23
- package/build/src/library/contract-composition.d.ts +18 -13
- package/build/src/library/contract-composition.js +62 -61
- package/build/src/library/contract-creation.d.ts +3 -2
- package/build/src/library/contract-creation.js +54 -49
- package/build/src/library/contract-outcomes.d.ts +2365 -43
- package/build/src/library/contract-outcomes.js +73 -16
- package/build/src/library/contract-settings.d.ts +3 -4
- package/build/src/library/contract-settings.js +21 -19
- package/build/src/library/contract-types.d.ts +227 -75
- package/build/src/library/contract-types.js +90 -1
- package/build/src/library/contract-wait.d.ts +75 -17
- package/build/src/library/contract-wait.js +61 -24
- package/build/src/library/delivery.d.ts +566 -37
- package/build/src/library/delivery.js +16 -28
- package/build/src/library/input.d.ts +31 -5
- package/build/src/library/input.js +40 -41
- package/build/src/library/invocation.d.ts +18 -12
- package/build/src/library/invocation.js +98 -96
- package/build/src/library/kei.d.ts +56 -0
- package/build/src/library/kei.js +696 -0
- package/build/src/{cli/delivery-identity.js → library/keiyaku-attribution.js} +1 -1
- package/build/src/library/keiyaku-classify.d.ts +11 -0
- package/build/src/library/keiyaku-classify.js +127 -0
- package/build/src/library/keiyaku-coordinates.d.ts +26 -0
- package/build/src/library/keiyaku-coordinates.js +83 -0
- package/build/src/library/keiyaku-debt.d.ts +70 -0
- package/build/src/library/keiyaku-debt.js +39 -0
- package/build/src/library/keiyaku-identity.d.ts +58 -0
- package/build/src/library/keiyaku-identity.js +177 -0
- package/build/src/library/keiyaku-verbs.d.ts +6893 -0
- package/build/src/library/keiyaku-verbs.js +496 -0
- package/build/src/library/keiyaku.d.ts +41 -38
- package/build/src/library/keiyaku.js +590 -127
- package/build/src/library/nuke.d.ts +25 -1
- package/build/src/library/nuke.js +9 -2
- package/build/src/library/outcome.d.ts +867 -736
- package/build/src/library/outcome.js +431 -211
- package/build/src/library/reconcile.d.ts +652 -116
- package/build/src/library/reconcile.js +146 -108
- package/build/src/library/refusal.d.ts +118 -590
- package/build/src/library/refusal.js +54 -51
- package/build/src/library/region.d.ts +5 -24
- package/build/src/library/region.js +6 -21
- package/build/src/library/repo.js +4 -3
- package/build/src/library/selection.d.ts +205 -45
- package/build/src/library/selection.js +139 -128
- package/build/src/mcp/adapter.d.ts +17 -0
- package/build/src/mcp/adapter.js +241 -0
- package/build/src/mcp/help.d.ts +1 -0
- package/build/src/mcp/help.js +31 -0
- package/build/src/mcp/index.d.ts +2 -0
- package/build/src/mcp/index.js +37 -0
- package/build/src/mcp/output.d.ts +385 -0
- package/build/src/mcp/output.js +193 -0
- package/build/src/plugin/public.d.ts +5 -1
- package/build/src/plugin/runtime.d.ts +1 -1
- package/build/src/plugin/runtime.js +19 -16
- package/build/src/protocol/amend.d.ts +1 -1
- package/build/src/protocol/amend.js +2 -2
- package/build/src/protocol/arc.d.ts +4 -1
- package/build/src/protocol/arc.js +7 -1
- package/build/src/protocol/attempt.d.ts +2 -3
- package/build/src/protocol/attempt.js +1 -10
- package/build/src/protocol/bind.d.ts +10 -13
- package/build/src/protocol/bind.js +12 -8
- package/build/src/protocol/completion.d.ts +412 -13
- package/build/src/protocol/completion.js +202 -28
- package/build/src/protocol/deliver.d.ts +35 -28
- package/build/src/protocol/deliver.js +52 -80
- package/build/src/protocol/delivery-preview.d.ts +102 -250
- package/build/src/protocol/delivery-preview.js +134 -130
- package/build/src/protocol/execution-observation.d.ts +136 -121
- package/build/src/protocol/execution-observation.js +9 -6
- package/build/src/protocol/intent.d.ts +14 -56
- package/build/src/protocol/intent.js +46 -73
- package/build/src/protocol/operations.d.ts +240 -543
- package/build/src/protocol/operations.js +89 -151
- package/build/src/protocol/outcome.d.ts +3 -1
- package/build/src/protocol/placement.d.ts +1 -3
- package/build/src/protocol/placement.js +6 -3
- package/build/src/protocol/progress.d.ts +8 -97
- package/build/src/protocol/progress.js +7 -55
- package/build/src/protocol/read/observation.d.ts +13 -6
- package/build/src/protocol/read/observation.js +10 -9
- package/build/src/protocol/read/status.d.ts +386 -98
- package/build/src/protocol/read/status.js +400 -139
- package/build/src/protocol/reconcile.d.ts +2 -0
- package/build/src/protocol/reconcile.js +12 -11
- package/build/src/protocol/reintegrate.d.ts +1 -3
- package/build/src/protocol/reintegrate.js +4 -5
- package/build/src/protocol/result-leaves.d.ts +507 -0
- package/build/src/protocol/result-leaves.js +156 -0
- package/build/src/protocol/result-reasons.d.ts +129 -0
- package/build/src/protocol/result-reasons.js +87 -0
- package/build/src/protocol/review.d.ts +14 -11
- package/build/src/protocol/review.js +30 -15
- package/build/src/protocol/run.d.ts +4 -4
- package/build/src/protocol/run.js +4 -1
- package/build/src/protocol/verify.d.ts +406 -31
- package/build/src/protocol/verify.js +137 -34
- package/build/src/region.d.ts +26 -0
- package/build/src/region.js +28 -0
- package/build/src/runtime/proc/diagnostic.d.ts +11 -0
- package/build/src/runtime/proc/diagnostic.js +20 -0
- package/build/src/runtime/proc/windows-launch.exe +0 -0
- package/build/src/settings.d.ts +133 -40
- package/build/src/settings.js +122 -46
- package/build/src/settlement/holder.js +2 -2
- package/build/src/settlement/settle.d.ts +29 -18
- package/build/src/settlement/settle.js +22 -19
- package/build/src/verification/declaration.d.ts +4 -9
- package/build/src/verification/declaration.js +5 -10
- package/build/src/verification/execution.d.ts +7 -19
- package/build/src/verification/execution.js +37 -16
- package/build/src/verification/observation.d.ts +11 -11
- package/build/src/verification/observation.js +9 -7
- package/build/src/world.d.ts +11 -2
- package/build/src/world.js +12 -6
- package/package.json +6 -5
- 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 +73 -40
- package/plugins/paseo/plugin/server/message.ts +9 -30
- package/plugins/paseo/plugin/server/mirror-identity.ts +6 -4
- package/plugins/paseo/plugin/server/mirror.ts +16 -20
- package/plugins/paseo/plugin/server/provider.ts +1 -1
- package/plugins/paseo/plugin/server/sdk.ts +12 -6
- package/plugins/paseo/plugin/server/transport.ts +24 -1
- package/plugins/pi/README.md +20 -22
- package/plugins/pi/akuma-tools.ts +43 -56
- package/plugins/pi/keiyaku.ts +15 -4
- package/skills/keiyaku/SKILL.md +12 -12
- package/skills/keiyaku-akuma/SKILL.md +27 -22
- package/skills/keiyaku-akuma/references/automation.md +14 -14
- package/skills/keiyaku-babysit/SKILL.md +15 -13
- package/skills/keiyaku-bind/SKILL.md +18 -17
- package/skills/keiyaku-debt/SKILL.md +30 -30
- package/skills/keiyaku-workflow/SKILL.md +24 -23
- 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/cli/actor.d.ts +0 -10
- package/build/src/cli/actor.js +0 -24
- package/build/src/cli/akuma-caller.d.ts +0 -3
- package/build/src/cli/akuma-caller.js +0 -31
- 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 -32
- package/build/src/cli/render/akuma-tool.js +0 -219
- package/build/src/cli/render/effects.d.ts +0 -26
- package/build/src/cli/render/effects.js +0 -41
- package/build/src/cli/selectors.d.ts +0 -10
- package/build/src/cli/selectors.js +0 -42
- package/build/src/debt/context.d.ts +0 -16
- package/build/src/debt/context.js +0 -91
- package/build/src/debt/created-observation.d.ts +0 -38
- package/build/src/debt/created-observation.js +0 -30
- package/build/src/debt/query.d.ts +0 -76
- package/build/src/debt/query.js +0 -292
- package/build/src/library/contract-execution.d.ts +0 -28
- package/build/src/library/contract-execution.js +0 -467
- package/build/src/markdown/diff.d.ts +0 -1
- package/build/src/markdown/diff.js +0 -4
- /package/build/src/{cli/delivery-identity.d.ts → library/keiyaku-attribution.d.ts} +0 -0
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { ReconcileCompletion, RepoReconcileReport } from "../../library/reconcile.js";
|
|
2
|
+
import type { VerbDisposition } from "../../library/keiyaku-verbs.js";
|
|
3
3
|
import { type TextRenderContext } from "./terminal.js";
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
type ReconcileReport = ReconcileCompletion | RepoReconcileReport;
|
|
5
|
+
/** Reconcile reports only native disposition, movement, and repair issues; it never re-adjudicates them. */
|
|
6
|
+
export declare function renderReconcile(report: ReconcileReport, context?: TextRenderContext, disposition?: VerbDisposition): string;
|
|
7
|
+
export {};
|
|
@@ -1,152 +1,68 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { invocationIssueIsFailure } from "../../library/outcome.js";
|
|
2
|
+
import { contractIssueLines } from "./contract.js";
|
|
2
3
|
import { abbreviateGitIds, displayGitId } from "./contract-observation.js";
|
|
3
|
-
import {
|
|
4
|
-
import { DEFAULT_CLI_COLUMNS } from "./terminal.js";
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
return null;
|
|
8
|
-
const ids = effect.kind === "ref"
|
|
9
|
-
? [effect.before ?? "", effect.after ?? ""]
|
|
10
|
-
: effect.kind === "worktree" && effect.action === "followed"
|
|
11
|
-
? [effect.before, effect.after]
|
|
12
|
-
: effect.kind === "recovery-snapshot"
|
|
13
|
-
? [effect.snapshot]
|
|
14
|
-
: [];
|
|
15
|
-
const abbreviations = abbreviateGitIds(ids);
|
|
16
|
-
const state = effect.kind === "ref"
|
|
17
|
-
? `${effect.action}${effect.before === null ? "" : ` · ${displayGitId(effect.before, abbreviations)}`}${effect.after === null ? "" : ` → ${displayGitId(effect.after, abbreviations)}`}`
|
|
18
|
-
: effect.kind === "worktree" && effect.action === "followed"
|
|
19
|
-
? `followed · ${displayGitId(effect.before, abbreviations)} → ${displayGitId(effect.after, abbreviations)}`
|
|
20
|
-
: effect.action;
|
|
21
|
-
const path = effect.kind === "ref"
|
|
22
|
-
? effect.name
|
|
23
|
-
: effect.kind === "recovery-snapshot"
|
|
24
|
-
? displayGitId(effect.snapshot, abbreviations)
|
|
25
|
-
: effect.path;
|
|
26
|
-
return [effect.kind, state, path];
|
|
4
|
+
import { receiptRow } from "./receipt.js";
|
|
5
|
+
import { DEFAULT_CLI_COLUMNS, safeText } from "./terminal.js";
|
|
6
|
+
function words(kind) {
|
|
7
|
+
return kind.replaceAll("-", " ");
|
|
27
8
|
}
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const error = "stderr" in lag.failure ? lag.failure.stderr : undefined;
|
|
40
|
-
if (lag.failure.kind === "spawn-error") {
|
|
41
|
-
receiptRow(lines, "!", "reason", [{ text: lag.failure.diagnostic, opaque: true }], columns);
|
|
42
|
-
}
|
|
43
|
-
if (output !== undefined && output.length > 0)
|
|
44
|
-
receiptPayload(lines, "stdout", output);
|
|
45
|
-
if (error !== undefined && error.length > 0)
|
|
46
|
-
receiptPayload(lines, "stderr", error);
|
|
47
|
-
}
|
|
48
|
-
function lagRow(lines, lag, columns, contract) {
|
|
49
|
-
switch (lag.kind) {
|
|
50
|
-
case "worktree-hook-failed":
|
|
51
|
-
worktreeHookLagRows(lines, lag, columns, contract);
|
|
52
|
-
break;
|
|
53
|
-
case "reconcile-failed":
|
|
54
|
-
receiptRow(lines, "!", "reconcile", [
|
|
55
|
-
...(contract === undefined ? [] : [{ text: contract, opaque: true }]),
|
|
56
|
-
{ text: lag.stage, opaque: true },
|
|
57
|
-
{ text: lag.diagnostic, opaque: true },
|
|
58
|
-
], columns);
|
|
59
|
-
break;
|
|
60
|
-
case "worktree-retained":
|
|
61
|
-
receiptRow(lines, " ", "worktree retained at", [{ text: lag.path, opaque: true }], columns);
|
|
62
|
-
if (lag.diagnostic !== undefined)
|
|
63
|
-
receiptRow(lines, " ", "reason", [{ text: lag.diagnostic, opaque: true }], columns);
|
|
64
|
-
break;
|
|
65
|
-
case "worktree-follow-retained":
|
|
66
|
-
receiptRow(lines, " ", "worktree follow kept at", [{ text: lag.path, opaque: true }, { text: `· ${lag.reason.replaceAll("-", " ")}` }], columns);
|
|
67
|
-
break;
|
|
68
|
-
case "unsealed-bytes":
|
|
69
|
-
receiptRow(lines, " ", "unsealed bytes kept at", [{ text: lag.path, opaque: true }], columns);
|
|
70
|
-
break;
|
|
71
|
-
case "target-checkout-retained":
|
|
72
|
-
receiptRow(lines, "!", "target checkout kept at", [
|
|
73
|
-
{ text: lag.path, opaque: true },
|
|
74
|
-
{ text: `· ${lag.target}`, opaque: true },
|
|
75
|
-
], columns);
|
|
76
|
-
receiptRow(lines, " ", "reason", [{ text: lag.diagnostic, opaque: true }], columns);
|
|
77
|
-
break;
|
|
78
|
-
case "target-workspace-retained":
|
|
79
|
-
receiptRow(lines, "!", "target workspace unavailable", [{ text: lag.contractId, opaque: true }, { text: `· ${lag.reason.replaceAll("-", " ")}` }], columns);
|
|
80
|
-
break;
|
|
81
|
-
case "contract-file-failed":
|
|
82
|
-
receiptRow(lines, "!", "contract file unavailable", [
|
|
83
|
-
{ text: lag.worktree, opaque: true },
|
|
84
|
-
{ text: `· ${lag.path}`, opaque: true },
|
|
85
|
-
], columns);
|
|
86
|
-
receiptRow(lines, " ", "reason", [{ text: lag.diagnostic, opaque: true }], columns);
|
|
87
|
-
break;
|
|
88
|
-
default: {
|
|
89
|
-
const exhaustive = lag;
|
|
90
|
-
return exhaustive;
|
|
9
|
+
function effectSegments(effect) {
|
|
10
|
+
switch (effect.kind) {
|
|
11
|
+
case "ref": {
|
|
12
|
+
const ids = abbreviateGitIds([effect.before ?? "", effect.after ?? ""]);
|
|
13
|
+
return [
|
|
14
|
+
{ text: "ref" },
|
|
15
|
+
{
|
|
16
|
+
text: `${effect.before === null ? "absent" : displayGitId(effect.before, ids)} → ${effect.after === null ? "absent" : displayGitId(effect.after, ids)}`,
|
|
17
|
+
},
|
|
18
|
+
{ text: effect.name, opaque: true },
|
|
19
|
+
];
|
|
91
20
|
}
|
|
21
|
+
case "target-checkout":
|
|
22
|
+
return [{ text: "target checkout" }, { text: effect.target, opaque: true }, { text: effect.path, opaque: true }];
|
|
23
|
+
case "recovery-snapshot":
|
|
24
|
+
return [
|
|
25
|
+
{ text: "recovery snapshot" },
|
|
26
|
+
{ text: displayGitId(effect.snapshot, abbreviateGitIds([effect.snapshot])), opaque: true },
|
|
27
|
+
];
|
|
28
|
+
case "debt-settled":
|
|
29
|
+
return [{ text: "debt settled" }, { text: effect.debtId, opaque: true }];
|
|
30
|
+
case "worktree-created":
|
|
31
|
+
case "worktree-removed":
|
|
32
|
+
return [{ text: words(effect.kind) }, { text: effect.path, opaque: true }];
|
|
92
33
|
}
|
|
93
34
|
}
|
|
94
|
-
function
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
35
|
+
function nativeDisposition(report) {
|
|
36
|
+
if (report.kind === "missing")
|
|
37
|
+
return "refused";
|
|
38
|
+
if (report.kind === "world-observation-failed")
|
|
39
|
+
return "failed";
|
|
40
|
+
const rows = report.kind === "world" ? (report.contracts ?? []) : [report];
|
|
41
|
+
return rows.some((row) => row.issues?.some(invocationIssueIsFailure) === true) ? "failed" : "accepted";
|
|
42
|
+
}
|
|
43
|
+
function appendReport(lines, report, columns, seen) {
|
|
44
|
+
for (const effect of report.effects ?? []) {
|
|
45
|
+
const key = JSON.stringify([report.contractId, effect]);
|
|
100
46
|
if (seen.has(key))
|
|
101
47
|
continue;
|
|
102
48
|
seen.add(key);
|
|
103
|
-
receiptRow(lines, " ", "effect",
|
|
104
|
-
}
|
|
105
|
-
for (const lag of report.lag)
|
|
106
|
-
lagRow(lines, lag, columns, contract);
|
|
107
|
-
for (const action of report.settlement?.actions ?? []) {
|
|
108
|
-
receiptRow(lines, " ", "settlement", [{ text: action.kind, opaque: true }], columns);
|
|
109
|
-
}
|
|
110
|
-
for (const lag of report.settlement?.lags ?? []) {
|
|
111
|
-
receiptRow(lines, "!", "settlement", Object.entries(lag)
|
|
112
|
-
.filter(([key]) => key !== "kind")
|
|
113
|
-
.map(([key, value]) => ({ text: `${key} ${String(value)}`, opaque: true })), columns);
|
|
49
|
+
receiptRow(lines, " ", "effect", effectSegments(effect), columns);
|
|
114
50
|
}
|
|
115
|
-
|
|
116
|
-
receiptRow(lines, "!", "settlement", [{ text: failure.kind, opaque: true }], columns);
|
|
117
|
-
receiptRow(lines, "!", "reason", [{ text: failure.diagnostic, opaque: true }], columns);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
function isRepoReport(report) {
|
|
121
|
-
return "kind" in report && (report.kind === "completed" || report.kind === "world-observation-failed");
|
|
51
|
+
lines.push(...contractIssueLines(report, columns));
|
|
122
52
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
if (report.kind === "world-observation-failed")
|
|
126
|
-
return true;
|
|
127
|
-
return report.contracts.some((item) => reconcileHasFailure(item.report));
|
|
128
|
-
}
|
|
129
|
-
return (report.lag.some((lag) => reconcileLagIsFailure(lag)) ||
|
|
130
|
-
(report.settlement?.lags.length ?? 0) > 0 ||
|
|
131
|
-
(report.settlement?.seatClose?.length ?? 0) > 0);
|
|
132
|
-
}
|
|
133
|
-
export function renderReconcile(report, context) {
|
|
53
|
+
/** Reconcile reports only native disposition, movement, and repair issues; it never re-adjudicates them. */
|
|
54
|
+
export function renderReconcile(report, context, disposition) {
|
|
134
55
|
const columns = context?.columns ?? DEFAULT_CLI_COLUMNS;
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
];
|
|
56
|
+
if (report.kind === "world-observation-failed")
|
|
57
|
+
return [`! reconcile failed`, `! reconcile ${safeText(report.diagnostic)}`].join("\n");
|
|
58
|
+
if (report.kind === "missing")
|
|
59
|
+
return `× reconcile refused\n reason contract missing\n contract ${safeText(report.contractId)}`;
|
|
60
|
+
const verdict = disposition ?? nativeDisposition(report);
|
|
61
|
+
const lines = [verdict === "failed" ? "! reconcile incomplete" : "✓ reconcile"];
|
|
142
62
|
const seen = new Set();
|
|
143
|
-
if (
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
return lines.join("\n");
|
|
147
|
-
}
|
|
148
|
-
for (const item of report.contracts)
|
|
149
|
-
appendReport(lines, item.report, columns, seen, item.contractId);
|
|
63
|
+
if (report.kind === "world") {
|
|
64
|
+
for (const item of report.contracts ?? [])
|
|
65
|
+
appendReport(lines, item, columns, seen);
|
|
150
66
|
}
|
|
151
67
|
else
|
|
152
68
|
appendReport(lines, report, columns, seen);
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import type { NextCall } from "../../errors.js";
|
|
1
2
|
import type { BindDraftReceipt } from "../draft.js";
|
|
2
3
|
import { type CliUsageGuide } from "../usage.js";
|
|
3
|
-
import type { ContractId,
|
|
4
|
+
import type { ContractId, KeiyakuRefusal } from "../../index.js";
|
|
5
|
+
import type { HandoffOutcome } from "../../library/outcome.js";
|
|
4
6
|
import { type TextRenderContext } from "./terminal.js";
|
|
5
7
|
type DirtyWithOption = Extract<KeiyakuRefusal, {
|
|
6
8
|
kind: "dirty-workspace";
|
|
7
9
|
}> & {
|
|
8
10
|
option?: Readonly<{
|
|
9
|
-
|
|
11
|
+
next: NextCall;
|
|
10
12
|
available: boolean;
|
|
11
13
|
}>;
|
|
12
14
|
};
|
|
@@ -16,7 +18,7 @@ type CliEdgeRefusal = Readonly<{
|
|
|
16
18
|
diagnostic: string;
|
|
17
19
|
}>;
|
|
18
20
|
export type RenderableRefusal = KeiyakuRefusal | DirtyWithOption | CliEdgeRefusal;
|
|
19
|
-
export declare function renderRefusalFacts(refusal: RenderableRefusal, indent: string, columns: number, addressed?: string): readonly string[];
|
|
21
|
+
export declare function renderRefusalFacts(refusal: RenderableRefusal, indent: string, columns: number, addressed?: string, surface?: TextRenderContext["surface"]): readonly string[];
|
|
20
22
|
/**
|
|
21
23
|
* The one refusal receipt assembly: a denied-verdict title, a labeled reason, labeled facts, and the
|
|
22
24
|
* applicable acceptance grammar. Typed refusals and bare command refusals both render through here.
|
|
@@ -29,6 +31,6 @@ type RefusedInvocation = Readonly<{
|
|
|
29
31
|
refusal: RenderableRefusal;
|
|
30
32
|
}>;
|
|
31
33
|
export declare function renderRefusal(refused: RefusedInvocation, draft?: BindDraftReceipt, context?: TextRenderContext): string;
|
|
32
|
-
export declare function renderConflictMaterialized(result:
|
|
34
|
+
export declare function renderConflictMaterialized(result: HandoffOutcome, context?: TextRenderContext): string;
|
|
33
35
|
export declare function renderBindDraftReceipt(receipt: BindDraftReceipt): string;
|
|
34
36
|
export {};
|
|
@@ -1,49 +1,46 @@
|
|
|
1
1
|
import { usageAcceptanceLines } from "../usage.js";
|
|
2
|
-
import {
|
|
3
|
-
import { DEFAULT_CLI_COLUMNS,
|
|
2
|
+
import { contractOperationName, shortGitId } from "./contract-observation.js";
|
|
3
|
+
import { DEFAULT_CLI_COLUMNS, formatNextCall, orderRefusalFacts, renderOpaqueBlock, safeText, } from "./terminal.js";
|
|
4
4
|
function wrap(lines, text, indent, columns) {
|
|
5
5
|
lines.push(...renderOpaqueBlock(text, indent, columns));
|
|
6
6
|
}
|
|
7
|
+
function words(kind) {
|
|
8
|
+
return kind.replaceAll("-", " ");
|
|
9
|
+
}
|
|
7
10
|
function collectionLines(name, members, indent) {
|
|
8
11
|
if (members.length === 0)
|
|
9
12
|
return [];
|
|
10
13
|
return [`${indent}${name}`, ...members.map((member) => `${indent} ${safeText(member)}`)];
|
|
11
14
|
}
|
|
12
|
-
function
|
|
13
|
-
return
|
|
15
|
+
function addressedContract(addressed, contractId) {
|
|
16
|
+
return contractId !== undefined && contractId !== addressed ? contractId : undefined;
|
|
14
17
|
}
|
|
15
18
|
function refusalIdentity(refusal, addressed) {
|
|
16
|
-
const contractId = "contractId" in refusal ? refusal.contractId : undefined;
|
|
17
|
-
return
|
|
19
|
+
const contractId = "contractId" in refusal && typeof refusal.contractId === "string" ? refusal.contractId : undefined;
|
|
20
|
+
return addressedContract(addressed, contractId);
|
|
18
21
|
}
|
|
19
22
|
const REFUSAL_WORDS = {
|
|
20
23
|
"contract-missing": "contract missing",
|
|
21
24
|
};
|
|
22
25
|
function refusalWords(kind) {
|
|
23
|
-
return REFUSAL_WORDS[kind] ?? kind
|
|
24
|
-
}
|
|
25
|
-
function refusalHead(kind, identity, details) {
|
|
26
|
-
return [refusalWords(kind), identity, ...details].filter((part) => part !== undefined).join(" ");
|
|
26
|
+
return REFUSAL_WORDS[kind] ?? words(kind);
|
|
27
27
|
}
|
|
28
|
-
function renderDirtyRefusal(refusal, indent, columns,
|
|
28
|
+
function renderDirtyRefusal(refusal, indent, columns, surface) {
|
|
29
29
|
const lines = [];
|
|
30
|
-
wrap(lines, refusalHead(refusal.kind, identity, []), indent, columns);
|
|
31
30
|
wrap(lines, "reason worktree has uncommitted changes", indent, columns);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
wrap(lines, gitShortStat(refusal.shortStat), indent, columns);
|
|
31
|
+
lines.push(...collectionLines("paths", refusal.paths ?? [], indent));
|
|
32
|
+
lines.push(...collectionLines("submodules", refusal.submodules ?? [], indent));
|
|
36
33
|
if (refusal.option === undefined) {
|
|
37
|
-
if (refusal.submodules.length > 0)
|
|
34
|
+
if ((refusal.submodules ?? []).length > 0)
|
|
38
35
|
wrap(lines, "reason submodule changes cannot be captured for review", indent, columns);
|
|
39
36
|
}
|
|
40
37
|
else if (!refusal.option.available) {
|
|
41
|
-
lines.push(`${indent}option ${refusal.option.
|
|
38
|
+
lines.push(`${indent}option ${formatNextCall(refusal.option.next, surface)} · unavailable with submodule changes`);
|
|
42
39
|
}
|
|
43
40
|
else {
|
|
44
|
-
lines.push(`${indent}option ${refusal.option.
|
|
41
|
+
lines.push(`${indent}option ${formatNextCall(refusal.option.next, surface)} · captures complete non-ignored worktree bytes`);
|
|
45
42
|
lines.push(`${indent}capture index private · real index unchanged, including any unmerged entries`);
|
|
46
|
-
lines.push(`${indent}staging not required for
|
|
43
|
+
lines.push(`${indent}staging not required for worktree capture`);
|
|
47
44
|
}
|
|
48
45
|
return lines;
|
|
49
46
|
}
|
|
@@ -52,78 +49,98 @@ function verificationRefusalFacts(refusal, indent, identity) {
|
|
|
52
49
|
if (refusal.kind === "verification-declaration-invalid")
|
|
53
50
|
return [
|
|
54
51
|
...contract,
|
|
55
|
-
`${indent}reason
|
|
52
|
+
`${indent}reason Verification requires valid executable declarations; the Contract declares none`,
|
|
56
53
|
];
|
|
57
|
-
if (refusal.kind === "verification-not-selected")
|
|
58
|
-
return [`${indent}reason Contract does not select the verified gate`, ...contract];
|
|
59
54
|
if (refusal.kind === "verification-index-out-of-range")
|
|
60
55
|
return [
|
|
61
56
|
`${indent}reason Verification declaration index is out of range`,
|
|
62
57
|
...contract,
|
|
63
|
-
`${indent}index ${refusal.index}`,
|
|
64
58
|
`${indent}declarations ${refusal.total}`,
|
|
65
59
|
];
|
|
66
60
|
return undefined;
|
|
67
61
|
}
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
function targetRefusalLines(target, indent, identity, contract) {
|
|
63
|
+
return [
|
|
64
|
+
...(identity === undefined ? [] : [`${indent}contract ${safeText(identity)}`]),
|
|
65
|
+
...(target === undefined ? [] : [`${indent}target ${safeText(target)}`]),
|
|
66
|
+
...(contract === undefined ? [] : [`${indent}detail ${safeText(contract)}`]),
|
|
67
|
+
];
|
|
68
|
+
}
|
|
69
|
+
function nukeRefusalFacts(refusal, indent) {
|
|
70
|
+
const world = safeText(refusal.world);
|
|
71
|
+
return [
|
|
72
|
+
`${indent}reason ${refusalWords(refusal.kind)}`,
|
|
73
|
+
`${indent}world ${world}`,
|
|
74
|
+
...(refusal.kind === "nuke-confirmation-mismatch"
|
|
75
|
+
? [`${indent}confirmation ${safeText(refusal.confirmation)}`]
|
|
76
|
+
: []),
|
|
77
|
+
`${indent}option keiyaku nuke --confirm '${world.replaceAll("'", "'\"'\"'")}'`,
|
|
78
|
+
];
|
|
79
|
+
}
|
|
80
|
+
function refusalFacts(refusal, indent, columns, addressed, surface) {
|
|
70
81
|
const identity = refusalIdentity(refusal, addressed);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return
|
|
74
|
-
`${indent}reason ${refusalWords(refusal.kind)}`,
|
|
75
|
-
`${indent}world ${world}`,
|
|
76
|
-
...(refusal.kind === "nuke-confirmation-mismatch"
|
|
77
|
-
? [`${indent}confirmation ${safeText(refusal.confirmation)}`]
|
|
78
|
-
: []),
|
|
79
|
-
`${indent}option keiyaku nuke --confirm '${world.replaceAll("'", "'\"'\"'")}'`,
|
|
80
|
-
];
|
|
81
|
-
}
|
|
82
|
+
const target = "targetContractId" in refusal ? refusal.targetContractId : undefined;
|
|
83
|
+
if (refusal.kind === "nuke-confirmation-mismatch" || refusal.kind === "nuke-confirmation-required")
|
|
84
|
+
return nukeRefusalFacts(refusal, indent);
|
|
82
85
|
const verification = verificationRefusalFacts(refusal, indent, identity);
|
|
83
86
|
if (verification !== undefined)
|
|
84
87
|
return verification;
|
|
85
88
|
if (refusal.kind === "dirty-workspace")
|
|
86
|
-
return renderDirtyRefusal(refusal, indent, columns,
|
|
87
|
-
if (refusal.kind === "
|
|
88
|
-
return [
|
|
89
|
+
return renderDirtyRefusal(refusal, indent, columns, surface);
|
|
90
|
+
if (refusal.kind === "dirty-submodules") {
|
|
91
|
+
return [
|
|
92
|
+
`${indent}reason submodule changes cannot be captured for review`,
|
|
93
|
+
...collectionLines("paths", refusal.paths, indent),
|
|
94
|
+
];
|
|
95
|
+
}
|
|
96
|
+
if (refusal.kind === "integration-conflict") {
|
|
97
|
+
return [
|
|
98
|
+
`${indent}reason integration conflict`,
|
|
99
|
+
...targetRefusalLines(undefined, indent, identity, undefined),
|
|
100
|
+
`${indent}target ${safeText(refusal.targetHead)}`,
|
|
101
|
+
...collectionLines("conflicts", refusal.conflictPaths, indent),
|
|
102
|
+
`${indent}option materialize ${formatNextCall({ verb: "deliver", input: { materializeConflict: true, includeDirty: true } }, surface)}`,
|
|
103
|
+
`${indent}option deliver ${formatNextCall({ verb: "deliver", input: { includeDirty: true } }, surface)}`,
|
|
104
|
+
];
|
|
89
105
|
}
|
|
90
|
-
if (refusal.kind === "
|
|
91
|
-
|
|
106
|
+
if (refusal.kind === "not-based-on-target" || refusal.kind === "unrelated-histories") {
|
|
107
|
+
return [
|
|
92
108
|
`${indent}reason ${refusalWords(refusal.kind)}`,
|
|
93
|
-
...(
|
|
109
|
+
...targetRefusalLines(undefined, indent, identity, undefined),
|
|
110
|
+
`${indent}target ${safeText(refusal.targetHead)}`,
|
|
94
111
|
];
|
|
95
|
-
lines.push(`${indent}reason ${safeText(refusal.reason)}`, `${indent}target ${safeText(refusal.targetHead)}`);
|
|
96
|
-
if (refusal.conflictPaths !== undefined)
|
|
97
|
-
lines.push(...collectionLines("conflicts", refusal.conflictPaths, indent));
|
|
98
|
-
if ("recovery" in refusal && refusal.recovery !== undefined) {
|
|
99
|
-
lines.push(`${indent}option materialize ${safeText(refusal.recovery.materialize)}`);
|
|
100
|
-
lines.push(`${indent}option deliver ${safeText(refusal.recovery.deliver)}`);
|
|
101
|
-
}
|
|
102
|
-
return lines;
|
|
103
112
|
}
|
|
104
113
|
if (refusal.kind === "merge-state-present") {
|
|
105
114
|
return [
|
|
106
115
|
`${indent}reason ${refusalWords(refusal.kind)}`,
|
|
107
|
-
...(
|
|
108
|
-
`${indent}
|
|
109
|
-
`${indent}workspace ${safeText(refusal.workspace.path)}`,
|
|
116
|
+
...targetRefusalLines(undefined, indent, identity, undefined),
|
|
117
|
+
`${indent}worktree ${safeText(refusal.worktreePath)}`,
|
|
110
118
|
];
|
|
111
119
|
}
|
|
112
120
|
if (refusal.kind === "integration-unsupported") {
|
|
113
121
|
return [
|
|
114
122
|
`${indent}reason ${refusalWords(refusal.kind)}`,
|
|
115
|
-
...(
|
|
116
|
-
`${indent}required Git ${safeText(refusal.requiredGit)}`,
|
|
123
|
+
...targetRefusalLines(undefined, indent, identity, undefined),
|
|
117
124
|
];
|
|
118
125
|
}
|
|
119
126
|
if (refusal.kind === "checkout-not-followable") {
|
|
120
|
-
return
|
|
127
|
+
return [
|
|
128
|
+
`${indent}reason checkout not followable`,
|
|
129
|
+
...targetRefusalLines(refusal.target, indent, identity, undefined),
|
|
130
|
+
`${indent}checkout ${safeText(refusal.path)}`,
|
|
131
|
+
...collectionLines("paths", refusal.paths, indent),
|
|
132
|
+
];
|
|
121
133
|
}
|
|
122
134
|
if (refusal.kind === "target-workspace-unavailable") {
|
|
123
135
|
return [
|
|
124
136
|
`${indent}reason target workspace unavailable`,
|
|
125
|
-
|
|
126
|
-
|
|
137
|
+
...targetRefusalLines(target, indent, identity, words(refusal.reason)),
|
|
138
|
+
];
|
|
139
|
+
}
|
|
140
|
+
if (refusal.kind === "target-contract-missing" || refusal.kind === "target-contract-terminal") {
|
|
141
|
+
return [
|
|
142
|
+
`${indent}reason ${refusalWords(refusal.kind)}`,
|
|
143
|
+
...targetRefusalLines(target, indent, identity, undefined),
|
|
127
144
|
];
|
|
128
145
|
}
|
|
129
146
|
const lines = [`${indent}reason ${refusalWords(refusal.kind)}`];
|
|
@@ -134,8 +151,8 @@ function refusalFacts(refusal, indent, columns, addressed) {
|
|
|
134
151
|
lines.push(`${indent}detail ${safeText(detail)}`);
|
|
135
152
|
return lines;
|
|
136
153
|
}
|
|
137
|
-
export function renderRefusalFacts(refusal, indent, columns, addressed) {
|
|
138
|
-
return orderRefusalFacts(refusalFacts(refusal, indent, columns, addressed).map((line) => line.slice(indent.length))).map((line) => `${indent}${line}`);
|
|
154
|
+
export function renderRefusalFacts(refusal, indent, columns, addressed, surface) {
|
|
155
|
+
return orderRefusalFacts(refusalFacts(refusal, indent, columns, addressed, surface).map((line) => line.slice(indent.length))).map((line) => `${indent}${line}`);
|
|
139
156
|
}
|
|
140
157
|
function refusalTitle(verb) {
|
|
141
158
|
return `× ${contractOperationName(verb)} refused`;
|
|
@@ -155,11 +172,11 @@ export function renderRefusal(refused, draft, context) {
|
|
|
155
172
|
const lines = [refusalTitle(refused.operation)];
|
|
156
173
|
if (refused.contract !== undefined)
|
|
157
174
|
lines.push(` contract ${safeText(refused.contract)}`);
|
|
158
|
-
lines.push(...renderRefusalFacts(refused.refusal, " ", columns, refused.contract));
|
|
175
|
+
lines.push(...renderRefusalFacts(refused.refusal, " ", columns, refused.contract, context?.surface));
|
|
159
176
|
const output = lines.join("\n");
|
|
160
177
|
return draft === undefined ? output : `${output}\n${renderBindDraftReceipt(draft)}`;
|
|
161
178
|
}
|
|
162
|
-
export function renderConflictMaterialized(result,
|
|
179
|
+
export function renderConflictMaterialized(result, context) {
|
|
163
180
|
const indent = " ";
|
|
164
181
|
return [
|
|
165
182
|
"! integration-conflict-materialized",
|
|
@@ -169,8 +186,8 @@ export function renderConflictMaterialized(result, _context) {
|
|
|
169
186
|
`${indent}saved worktree bytes before projection`,
|
|
170
187
|
`${indent}handoff base ${shortGitId(result.handoffBase)}`,
|
|
171
188
|
...collectionLines("conflicts", result.conflictPaths, indent),
|
|
172
|
-
`${indent}workspace ${safeText(result.
|
|
173
|
-
`${indent}option deliver ${
|
|
189
|
+
`${indent}workspace ${safeText(result.worktreePath)}`,
|
|
190
|
+
`${indent}option deliver ${formatNextCall({ verb: "deliver", input: { includeDirty: true } }, context?.surface)} · reads worktree bytes, not index`,
|
|
174
191
|
].join("\n");
|
|
175
192
|
}
|
|
176
193
|
export function renderBindDraftReceipt(receipt) {
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
import type { RegionRead
|
|
2
|
-
|
|
1
|
+
import type { RegionRead } from "../../kanshi/index.js";
|
|
2
|
+
/** The edge refusals are rendered by the CLI refusal grammar; this owns the owner observation. */
|
|
3
|
+
export type RegionObservation = Exclude<RegionRead, {
|
|
4
|
+
kind: "contract-missing";
|
|
5
|
+
} | {
|
|
6
|
+
kind: "contract-terminal";
|
|
7
|
+
}>;
|
|
8
|
+
export declare function renderRegionText(result: RegionObservation, input?: Readonly<{
|
|
9
|
+
contract?: string;
|
|
10
|
+
paths?: readonly string[];
|
|
11
|
+
}>): string;
|
|
@@ -3,35 +3,29 @@ function overlapBlocks(overlaps) {
|
|
|
3
3
|
return overlaps.flatMap((overlap) => {
|
|
4
4
|
const patterns = overlap.patterns.filter((pattern) => pattern.mine !== pattern.theirs);
|
|
5
5
|
if (patterns.length === 0)
|
|
6
|
-
return [`overlap ${overlap.
|
|
6
|
+
return [`overlap ${overlap.contractId} exact match`];
|
|
7
7
|
const count = patterns.length;
|
|
8
8
|
return [
|
|
9
|
-
`overlap ${overlap.
|
|
9
|
+
`overlap ${overlap.contractId} ${count} ${count === 1 ? "pair" : "pairs"}`,
|
|
10
10
|
...patterns.map((pattern) => ` ${pattern.mine} ~ ${pattern.theirs}`),
|
|
11
11
|
];
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
if (
|
|
16
|
-
return
|
|
17
|
-
if (
|
|
18
|
-
return [`× region`, ` reason ${
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return [emptyCatalogue("region")];
|
|
23
|
-
return value.declarations.map((declaration) => `region ${declaration.contract} ${declaration.patterns.join(" ")}`);
|
|
14
|
+
export function renderRegionText(result, input = {}) {
|
|
15
|
+
if (result.kind === "absent")
|
|
16
|
+
return emptyCatalogue("region");
|
|
17
|
+
if (result.kind === "failed")
|
|
18
|
+
return [`× region`, ` reason ${result.diagnostic}`].join("\n");
|
|
19
|
+
if ("id" in result) {
|
|
20
|
+
const header = `region ${result.id} ${result.patterns.join(" ")}`;
|
|
21
|
+
return [header, ...(result.overlaps === undefined ? [" overlap none"] : overlapBlocks(result.overlaps))].join("\n");
|
|
24
22
|
}
|
|
25
|
-
if (
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
return [header, " overlap none"];
|
|
29
|
-
return [header, ...overlapBlocks(value.overlaps)];
|
|
23
|
+
if (input.paths !== undefined) {
|
|
24
|
+
const overlaps = "overlaps" in result ? result.overlaps : undefined;
|
|
25
|
+
return (overlaps === undefined ? ["region none"] : overlapBlocks(overlaps)).join("\n");
|
|
30
26
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
export function renderRegionText(section) {
|
|
36
|
-
return rows(section).join("\n");
|
|
27
|
+
const declarations = "declarations" in result ? (result.declarations ?? []) : [];
|
|
28
|
+
return declarations.length === 0
|
|
29
|
+
? emptyCatalogue("region")
|
|
30
|
+
: declarations.map((declaration) => `region ${declaration.id} ${declaration.patterns.join(" ")}`).join("\n");
|
|
37
31
|
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import type { Settings } from "../../settings.js";
|
|
2
|
-
export declare function
|
|
3
|
-
export declare function renderSettingsText(value: Settings, columns?: number): string;
|
|
2
|
+
export declare function renderSettingsText(value: Omit<Settings, "namespace">, columns?: number): string;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { DEFAULT_CLI_COLUMNS, displayColumns, renderTextBlock } from "./terminal.js";
|
|
2
2
|
import { fieldName, namedValueLines } from "./value.js";
|
|
3
|
-
function namespaceNames(value) {
|
|
4
|
-
return [
|
|
5
|
-
...new Set([value.scopes.user, value.scopes.project].flatMap((scope) => (scope.kind === "read" ? scope.namespaces : []))),
|
|
6
|
-
].sort();
|
|
7
|
-
}
|
|
8
3
|
function labeledTokens(label, tokens, indent, columns) {
|
|
9
4
|
const inline = [label, ...tokens].filter((part) => part.length > 0).join(" ");
|
|
10
5
|
if (displayColumns(`${indent}${inline}`) <= columns)
|
|
@@ -17,27 +12,23 @@ function labeledTokens(label, tokens, indent, columns) {
|
|
|
17
12
|
}
|
|
18
13
|
return [...renderTextBlock(label, indent, columns), ...tokens.map((token) => `${indent} ${token}`)];
|
|
19
14
|
}
|
|
20
|
-
export function settingsJsonValue(value) {
|
|
21
|
-
return {
|
|
22
|
-
scopes: value.scopes,
|
|
23
|
-
namespaces: namespaceNames(value).map((name) => value.namespace(name)),
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
15
|
export function renderSettingsText(value, columns = DEFAULT_CLI_COLUMNS) {
|
|
27
16
|
const lines = [
|
|
28
17
|
"settings",
|
|
29
18
|
...scopeLines("user", value.scopes.user, columns),
|
|
30
19
|
...scopeLines("project", value.scopes.project, columns),
|
|
31
20
|
];
|
|
32
|
-
for (const name of
|
|
33
|
-
const view = value.namespace(name);
|
|
21
|
+
for (const [name, view] of Object.entries(value.namespaces ?? {})) {
|
|
34
22
|
lines.push(` namespace ${fieldName(name)} ${view.kind}`);
|
|
35
23
|
if (view.kind === "failed") {
|
|
36
|
-
for (const failure of view.failures)
|
|
37
|
-
|
|
24
|
+
for (const failure of view.failures) {
|
|
25
|
+
const scope = value.scopes[failure.scope];
|
|
26
|
+
const diagnostic = failure.diagnostic ?? (scope.kind === "failed" ? scope.diagnostic : undefined);
|
|
27
|
+
lines.push(` failure ${failure.scope}${diagnostic === undefined ? "" : ` ${diagnostic}`}`);
|
|
28
|
+
}
|
|
38
29
|
}
|
|
39
|
-
for (const entry of view.entries) {
|
|
40
|
-
lines.push(` entry ${fieldName(
|
|
30
|
+
for (const [entryName, entry] of Object.entries(view.entries ?? {})) {
|
|
31
|
+
lines.push(` entry ${fieldName(entryName)} · ${entry.source}${entry.shadows ? " · shadows user" : ""}`);
|
|
41
32
|
lines.push(...namedValueLines("value", entry.value, " "));
|
|
42
33
|
}
|
|
43
34
|
}
|