@astrosheep/keiyaku 4.6.29 → 4.6.31
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 +5 -5
- package/build/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/build/plugins/claude/skills/keiyaku/SKILL.md +24 -24
- package/build/plugins/claude/skills/keiyaku-akuma/SKILL.md +44 -168
- package/build/plugins/claude/skills/keiyaku-akuma/references/automation.md +61 -231
- package/build/plugins/claude/skills/keiyaku-babysit/SKILL.md +47 -58
- package/build/plugins/claude/skills/keiyaku-bind/SKILL.md +44 -185
- package/build/plugins/claude/skills/keiyaku-debt/SKILL.md +40 -89
- package/build/plugins/claude/skills/keiyaku-workflow/SKILL.md +56 -116
- package/build/plugins/codex/.codex-plugin/plugin.json +1 -1
- package/build/plugins/codex/skills/keiyaku/SKILL.md +24 -24
- package/build/plugins/codex/skills/keiyaku-akuma/SKILL.md +44 -168
- package/build/plugins/codex/skills/keiyaku-akuma/references/automation.md +61 -231
- package/build/plugins/codex/skills/keiyaku-babysit/SKILL.md +47 -58
- package/build/plugins/codex/skills/keiyaku-bind/SKILL.md +44 -185
- package/build/plugins/codex/skills/keiyaku-debt/SKILL.md +40 -89
- package/build/plugins/codex/skills/keiyaku-workflow/SKILL.md +56 -116
- package/build/plugins/opencode/package.json +1 -1
- package/build/plugins/opencode/skills/keiyaku/SKILL.md +24 -24
- package/build/plugins/opencode/skills/keiyaku-akuma/SKILL.md +44 -168
- package/build/plugins/opencode/skills/keiyaku-akuma/references/automation.md +61 -231
- package/build/plugins/opencode/skills/keiyaku-babysit/SKILL.md +47 -58
- package/build/plugins/opencode/skills/keiyaku-bind/SKILL.md +44 -185
- package/build/plugins/opencode/skills/keiyaku-debt/SKILL.md +40 -89
- package/build/plugins/opencode/skills/keiyaku-workflow/SKILL.md +56 -116
- package/build/plugins/pi/README.md +5 -5
- package/build/plugins/pi/akuma-tools.ts +17 -23
- package/build/skills/keiyaku/SKILL.md +24 -24
- package/build/skills/keiyaku-akuma/SKILL.md +44 -168
- package/build/skills/keiyaku-akuma/references/automation.md +61 -231
- package/build/skills/keiyaku-babysit/SKILL.md +47 -58
- package/build/skills/keiyaku-bind/SKILL.md +44 -185
- package/build/skills/keiyaku-debt/SKILL.md +40 -89
- package/build/skills/keiyaku-workflow/SKILL.md +56 -116
- package/build/src/akuma/akuma-call.d.ts +1 -1
- package/build/src/akuma/akuma-call.js +9 -9
- package/build/src/akuma/akuma-errors.d.ts +5 -5
- package/build/src/akuma/akuma-instance.d.ts +355 -12
- package/build/src/akuma/akuma-instance.js +20 -20
- package/build/src/akuma/akuma-observe.d.ts +11 -12
- package/build/src/akuma/akuma-observe.js +34 -26
- package/build/src/akuma/akuma-owner.d.ts +32 -11
- package/build/src/akuma/akuma-owner.js +35 -16
- 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 +985 -1
- package/build/src/akuma/akuma-selection-execution.js +42 -18
- 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 +5 -5
- package/build/src/akuma/akuma-wait.js +52 -14
- package/build/src/akuma/akuma.d.ts +245 -271
- package/build/src/akuma/akuma.js +98 -46
- package/build/src/akuma/archetype.d.ts +19 -6
- package/build/src/akuma/archetype.js +25 -9
- package/build/src/akuma/body-launch.d.ts +2 -2
- package/build/src/akuma/body.js +4 -4
- package/build/src/akuma/call-initial-tell.d.ts +60 -44
- package/build/src/akuma/call-initial-tell.js +41 -2
- package/build/src/akuma/caller.d.ts +26 -17
- package/build/src/akuma/caller.js +22 -9
- package/build/src/akuma/coordinate.d.ts +9 -0
- package/build/src/akuma/coordinate.js +13 -0
- package/build/src/akuma/detached-body.js +2 -2
- 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 +29 -7
- package/build/src/akuma/heart/facts.js +13 -0
- 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 +5 -5
- package/build/src/akuma/identity.d.ts +17 -16
- package/build/src/akuma/identity.js +20 -19
- package/build/src/akuma/index.d.ts +1 -2
- 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 +659 -569
- package/build/src/akuma/projection.js +203 -94
- package/build/src/akuma/providers/acp/index.js +1 -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/publication.d.ts +2 -2
- package/build/src/akuma/publication.js +3 -3
- package/build/src/akuma/retention.js +2 -2
- package/build/src/akuma/selection-observation.d.ts +507 -43
- package/build/src/akuma/selection-observation.js +153 -1
- package/build/src/akuma/status-projection.d.ts +288 -0
- package/build/src/akuma/status-projection.js +154 -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/bounded-list.d.ts +8 -0
- package/build/src/bounded-list.js +9 -0
- package/build/src/cli/commands/akuma-grammar.d.ts +2 -2
- package/build/src/cli/commands/akuma-grammar.js +21 -21
- package/build/src/cli/commands/akuma.d.ts +1 -2
- package/build/src/cli/commands/akuma.js +115 -251
- package/build/src/cli/commands/contract-grammar.d.ts +4 -3
- package/build/src/cli/commands/contract-grammar.js +39 -22
- package/build/src/cli/commands/contract-help.d.ts +3 -1
- package/build/src/cli/commands/contract-help.js +4 -3
- package/build/src/cli/commands/contract.d.ts +6 -3
- package/build/src/cli/commands/contract.js +203 -434
- package/build/src/cli/commands/debt.d.ts +2 -3
- package/build/src/cli/commands/debt.js +101 -317
- 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 +4 -35
- package/build/src/cli/coordinates.js +13 -129
- package/build/src/cli/parse.d.ts +0 -6
- package/build/src/cli/parse.js +5 -48
- package/build/src/cli/render/akuma-activity.d.ts +31 -16
- package/build/src/cli/render/akuma-activity.js +162 -122
- package/build/src/cli/render/akuma-tool.d.ts +3 -6
- package/build/src/cli/render/akuma-tool.js +20 -14
- package/build/src/cli/render/akuma.d.ts +25 -26
- package/build/src/cli/render/akuma.js +100 -129
- package/build/src/cli/render/catalog.d.ts +4 -7
- package/build/src/cli/render/catalog.js +52 -99
- package/build/src/cli/render/contract-history.d.ts +3 -1
- package/build/src/cli/render/contract-history.js +140 -215
- package/build/src/cli/render/contract-observation.d.ts +43 -30
- package/build/src/cli/render/contract-observation.js +64 -31
- package/build/src/cli/render/contract-wait.js +6 -6
- package/build/src/cli/render/contract.d.ts +41 -6
- package/build/src/cli/render/contract.js +274 -370
- package/build/src/cli/render/debt.d.ts +9 -19
- package/build/src/cli/render/debt.js +120 -185
- 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 +5 -4
- package/build/src/cli/render/kanshi-akuma.js +70 -59
- package/build/src/cli/render/kanshi.d.ts +4 -4
- package/build/src/cli/render/kanshi.js +205 -207
- 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 +37 -43
- package/build/src/cli/render/receipt.js +313 -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 +3 -2
- package/build/src/cli/render/refusal.js +73 -54
- 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 +0 -1
- package/build/src/cli/render/settings.js +8 -17
- package/build/src/cli/render/terminal.d.ts +2 -0
- package/build/src/cli/render/verbs.d.ts +4 -0
- package/build/src/cli/render/verbs.js +312 -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 +96 -79
- package/build/src/cli/scan.d.ts +1 -1
- package/build/src/cli/streams.js +1 -0
- package/build/src/contract-guidance.js +2 -2
- package/build/src/contract-worktree.d.ts +2 -15
- package/build/src/contract-worktree.js +35 -36
- package/build/src/core/facts/observation.d.ts +4 -5
- package/build/src/core/facts/observation.js +7 -9
- package/build/src/core/verbs/amend.d.ts +0 -1
- package/build/src/core/verbs/amend.js +3 -3
- package/build/src/core/verbs/bind.d.ts +0 -1
- package/build/src/core/verbs/bind.js +5 -5
- package/build/src/core/verbs/deliver.d.ts +3 -2
- package/build/src/core/verbs/deliver.js +2 -2
- package/build/src/core/verbs/placement.d.ts +0 -5
- package/build/src/core/verbs/placement.js +4 -6
- package/build/src/core/verbs/reintegrate.d.ts +0 -1
- package/build/src/core/verbs/reintegrate.js +2 -2
- package/build/src/debt/board.d.ts +132 -116
- package/build/src/debt/board.js +138 -94
- package/build/src/debt/catalog.d.ts +4 -4
- package/build/src/debt/catalog.js +2 -18
- package/build/src/debt/context.d.ts +15 -3
- package/build/src/debt/context.js +12 -1
- package/build/src/debt/created-observation.d.ts +5 -17
- package/build/src/debt/created-observation.js +14 -6
- package/build/src/debt/document.d.ts +20 -15
- package/build/src/debt/document.js +18 -1
- package/build/src/debt/index.d.ts +346 -23
- package/build/src/debt/index.js +68 -22
- package/build/src/debt/input.d.ts +2 -1
- package/build/src/debt/input.js +14 -0
- package/build/src/debt/lifecycle-operations.d.ts +2 -2
- package/build/src/debt/lifecycle-operations.js +14 -22
- package/build/src/debt/operation-types.d.ts +188 -66
- package/build/src/debt/operation-types.js +113 -1
- package/build/src/debt/operations.d.ts +11 -10
- package/build/src/debt/operations.js +46 -71
- package/build/src/debt/query.d.ts +14 -10
- package/build/src/debt/query.js +3 -12
- package/build/src/debt/store.d.ts +4 -2
- package/build/src/debt/store.js +8 -8
- 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/git/admission.d.ts +2 -2
- package/build/src/git/admission.js +2 -1
- package/build/src/git/hooks.d.ts +14 -35
- 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 +2 -1
- package/build/src/git/observe.js +29 -20
- 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 +17 -79
- package/build/src/git/reconcile.js +37 -52
- 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 +23 -31
- package/build/src/git/target-placement.js +42 -27
- package/build/src/git/target.d.ts +2 -2
- package/build/src/git/target.js +2 -1
- package/build/src/git/tender.d.ts +7 -39
- package/build/src/git/tender.js +21 -54
- 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/selector.d.ts +2 -0
- package/build/src/identity/selector.js +13 -3
- package/build/src/index.d.ts +48 -54
- package/build/src/index.js +31 -43
- package/build/src/kanshi/counts.d.ts +42 -8
- package/build/src/kanshi/counts.js +13 -2
- package/build/src/kanshi/index.d.ts +5 -5
- package/build/src/kanshi/index.js +4 -3
- package/build/src/kanshi/read.d.ts +489 -6
- package/build/src/kanshi/read.js +334 -483
- package/build/src/kanshi/report.d.ts +2504 -103
- package/build/src/kanshi/report.js +165 -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 +8 -8
- package/build/src/library/address.js +7 -7
- package/build/src/library/akuma-creation.d.ts +690 -84
- package/build/src/library/akuma-creation.js +202 -142
- 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 +10 -6
- package/build/src/library/akumas.js +24 -7
- package/build/src/library/bind.d.ts +28 -54
- package/build/src/library/bind.js +6 -4
- package/build/src/library/continuation.d.ts +197 -479
- package/build/src/library/continuation.js +40 -23
- package/build/src/library/contract-address.d.ts +6 -5
- package/build/src/library/contract-address.js +5 -7
- package/build/src/library/contract-composition.d.ts +18 -12
- package/build/src/library/contract-composition.js +55 -47
- package/build/src/library/contract-creation.d.ts +3 -2
- package/build/src/library/contract-creation.js +38 -32
- package/build/src/library/contract-execution.js +77 -38
- package/build/src/library/contract-outcomes.d.ts +1877 -27
- package/build/src/library/contract-outcomes.js +93 -10
- package/build/src/library/contract-settings.d.ts +2 -2
- package/build/src/library/contract-settings.js +18 -14
- package/build/src/library/contract-types.d.ts +238 -61
- package/build/src/library/contract-types.js +131 -1
- package/build/src/library/contract-wait.d.ts +38 -17
- package/build/src/library/contract-wait.js +40 -10
- package/build/src/library/delivery.d.ts +588 -36
- package/build/src/library/delivery.js +35 -27
- package/build/src/library/input.d.ts +1 -1
- package/build/src/library/input.js +1 -2
- package/build/src/library/invocation.d.ts +11 -7
- package/build/src/library/invocation.js +42 -51
- package/build/src/library/kei.d.ts +48 -0
- package/build/src/library/kei.js +256 -0
- package/build/src/library/keiyaku-attribution.d.ts +11 -0
- package/build/src/{cli/delivery-identity.js → library/keiyaku-attribution.js} +12 -1
- package/build/src/library/keiyaku-classify.d.ts +11 -0
- package/build/src/library/keiyaku-classify.js +146 -0
- package/build/src/library/keiyaku-coordinates.d.ts +31 -0
- package/build/src/library/keiyaku-coordinates.js +103 -0
- package/build/src/library/keiyaku-debt.d.ts +142 -0
- package/build/src/library/keiyaku-debt.js +188 -0
- package/build/src/library/keiyaku-identity.d.ts +58 -0
- package/build/src/library/keiyaku-identity.js +176 -0
- package/build/src/library/keiyaku-policy.d.ts +27 -0
- package/build/src/library/keiyaku-policy.js +44 -0
- package/build/src/library/keiyaku-status.d.ts +1487 -0
- package/build/src/library/keiyaku-status.js +92 -0
- package/build/src/library/keiyaku-verbs.d.ts +6774 -0
- package/build/src/library/keiyaku-verbs.js +458 -0
- package/build/src/library/keiyaku.d.ts +871 -38
- package/build/src/library/keiyaku.js +677 -127
- package/build/src/library/nuke.d.ts +22 -0
- package/build/src/library/nuke.js +4 -1
- package/build/src/library/outcome.d.ts +706 -692
- package/build/src/library/outcome.js +582 -167
- package/build/src/library/reconcile.d.ts +464 -116
- package/build/src/library/reconcile.js +174 -102
- package/build/src/library/refusal.d.ts +113 -577
- package/build/src/library/refusal.js +64 -51
- package/build/src/library/region.d.ts +5 -24
- package/build/src/library/region.js +6 -21
- package/build/src/library/selection.d.ts +181 -32
- package/build/src/library/selection.js +99 -64
- package/build/src/mcp/adapter.d.ts +11 -0
- package/build/src/mcp/adapter.js +106 -0
- package/build/src/mcp/help.d.ts +1 -0
- package/build/src/mcp/help.js +26 -0
- package/build/src/mcp/index.d.ts +2 -0
- package/build/src/mcp/index.js +37 -0
- package/build/src/plugin/public.d.ts +1 -1
- package/build/src/plugin/runtime.js +17 -14
- 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 +6 -7
- package/build/src/protocol/bind.js +9 -5
- package/build/src/protocol/completion.d.ts +448 -12
- package/build/src/protocol/completion.js +164 -26
- package/build/src/protocol/deliver.d.ts +26 -24
- package/build/src/protocol/deliver.js +24 -52
- package/build/src/protocol/delivery-preview.d.ts +97 -247
- package/build/src/protocol/delivery-preview.js +132 -128
- package/build/src/protocol/execution-observation.d.ts +146 -123
- package/build/src/protocol/execution-observation.js +9 -6
- package/build/src/protocol/intent.d.ts +9 -48
- package/build/src/protocol/intent.js +32 -46
- package/build/src/protocol/operations.d.ts +207 -505
- package/build/src/protocol/operations.js +81 -134
- package/build/src/protocol/placement.d.ts +0 -1
- package/build/src/protocol/placement.js +5 -2
- package/build/src/protocol/progress.d.ts +7 -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 +466 -95
- package/build/src/protocol/read/status.js +380 -91
- package/build/src/protocol/reconcile.d.ts +2 -0
- package/build/src/protocol/reconcile.js +12 -11
- package/build/src/protocol/reintegrate.d.ts +0 -1
- package/build/src/protocol/reintegrate.js +4 -4
- package/build/src/protocol/result-leaves.d.ts +528 -0
- package/build/src/protocol/result-leaves.js +195 -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 -14
- package/build/src/protocol/run.d.ts +4 -4
- package/build/src/protocol/run.js +4 -1
- package/build/src/protocol/verify.d.ts +359 -30
- package/build/src/protocol/verify.js +118 -28
- 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 +126 -32
- package/build/src/settings.js +107 -34
- package/build/src/settlement/settle.d.ts +29 -12
- package/build/src/settlement/settle.js +22 -15
- package/build/src/verification/declaration.d.ts +1 -3
- package/build/src/verification/declaration.js +2 -5
- package/build/src/verification/execution.d.ts +7 -19
- package/build/src/verification/execution.js +37 -16
- package/build/src/verification/observation.d.ts +13 -13
- package/build/src/verification/observation.js +9 -7
- package/build/src/world.d.ts +8 -0
- package/build/src/world.js +7 -0
- package/package.json +6 -5
- package/plugins/paseo/plugin/server/keiyaku.ts +13 -46
- package/plugins/paseo/plugin/server/message.ts +8 -30
- 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 +14 -6
- package/plugins/pi/README.md +5 -5
- package/plugins/pi/akuma-tools.ts +17 -23
- package/skills/keiyaku/SKILL.md +24 -24
- package/skills/keiyaku-akuma/SKILL.md +44 -168
- package/skills/keiyaku-akuma/references/automation.md +61 -231
- package/skills/keiyaku-babysit/SKILL.md +47 -58
- package/skills/keiyaku-bind/SKILL.md +44 -185
- package/skills/keiyaku-debt/SKILL.md +40 -89
- package/skills/keiyaku-workflow/SKILL.md +56 -116
- 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/delivery-identity.d.ts +0 -3
- 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/markdown/diff.d.ts +0 -1
- package/build/src/markdown/diff.js +0 -4
|
@@ -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,6 +1,7 @@
|
|
|
1
1
|
import type { BindDraftReceipt } from "../draft.js";
|
|
2
2
|
import { type CliUsageGuide } from "../usage.js";
|
|
3
|
-
import type { ContractId,
|
|
3
|
+
import type { ContractId, KeiyakuRefusal } from "../../index.js";
|
|
4
|
+
import type { HandoffOutcome } from "../../library/outcome.js";
|
|
4
5
|
import { type TextRenderContext } from "./terminal.js";
|
|
5
6
|
type DirtyWithOption = Extract<KeiyakuRefusal, {
|
|
6
7
|
kind: "dirty-workspace";
|
|
@@ -29,6 +30,6 @@ type RefusedInvocation = Readonly<{
|
|
|
29
30
|
refusal: RenderableRefusal;
|
|
30
31
|
}>;
|
|
31
32
|
export declare function renderRefusal(refused: RefusedInvocation, draft?: BindDraftReceipt, context?: TextRenderContext): string;
|
|
32
|
-
export declare function renderConflictMaterialized(result:
|
|
33
|
+
export declare function renderConflictMaterialized(result: HandoffOutcome, _context?: TextRenderContext): string;
|
|
33
34
|
export declare function renderBindDraftReceipt(receipt: BindDraftReceipt): string;
|
|
34
35
|
export {};
|
|
@@ -1,40 +1,37 @@
|
|
|
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, 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) {
|
|
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) {
|
|
@@ -60,70 +57,92 @@ function verificationRefusalFacts(refusal, indent, identity) {
|
|
|
60
57
|
return [
|
|
61
58
|
`${indent}reason Verification declaration index is out of range`,
|
|
62
59
|
...contract,
|
|
63
|
-
`${indent}index ${refusal.index}`,
|
|
64
60
|
`${indent}declarations ${refusal.total}`,
|
|
65
61
|
];
|
|
66
62
|
return undefined;
|
|
67
63
|
}
|
|
68
|
-
|
|
64
|
+
function targetRefusalLines(target, indent, identity, contract) {
|
|
65
|
+
return [
|
|
66
|
+
...(identity === undefined ? [] : [`${indent}contract ${safeText(identity)}`]),
|
|
67
|
+
...(target === undefined ? [] : [`${indent}target ${safeText(target)}`]),
|
|
68
|
+
...(contract === undefined ? [] : [`${indent}detail ${safeText(contract)}`]),
|
|
69
|
+
];
|
|
70
|
+
}
|
|
71
|
+
function nukeRefusalFacts(refusal, indent) {
|
|
72
|
+
const world = safeText(refusal.world);
|
|
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
|
+
}
|
|
69
82
|
function refusalFacts(refusal, indent, columns, addressed) {
|
|
70
83
|
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
|
-
}
|
|
84
|
+
const target = "targetContractId" in refusal ? refusal.targetContractId : undefined;
|
|
85
|
+
if (refusal.kind === "nuke-confirmation-mismatch" || refusal.kind === "nuke-confirmation-required")
|
|
86
|
+
return nukeRefusalFacts(refusal, indent);
|
|
82
87
|
const verification = verificationRefusalFacts(refusal, indent, identity);
|
|
83
88
|
if (verification !== undefined)
|
|
84
89
|
return verification;
|
|
85
90
|
if (refusal.kind === "dirty-workspace")
|
|
86
|
-
return renderDirtyRefusal(refusal, indent, columns
|
|
87
|
-
if (refusal.kind === "
|
|
88
|
-
return [
|
|
91
|
+
return renderDirtyRefusal(refusal, indent, columns);
|
|
92
|
+
if (refusal.kind === "dirty-submodules") {
|
|
93
|
+
return [
|
|
94
|
+
`${indent}reason submodule changes cannot be captured for review`,
|
|
95
|
+
...collectionLines("paths", refusal.paths, indent),
|
|
96
|
+
];
|
|
97
|
+
}
|
|
98
|
+
if (refusal.kind === "integration-conflict") {
|
|
99
|
+
return [
|
|
100
|
+
`${indent}reason integration conflict`,
|
|
101
|
+
...targetRefusalLines(undefined, indent, identity, undefined),
|
|
102
|
+
`${indent}target ${safeText(refusal.targetHead)}`,
|
|
103
|
+
...collectionLines("conflicts", refusal.conflictPaths, indent),
|
|
104
|
+
`${indent}option materialize deliver --materialize-conflict --include-dirty`,
|
|
105
|
+
`${indent}option deliver deliver --include-dirty`,
|
|
106
|
+
];
|
|
89
107
|
}
|
|
90
|
-
if (refusal.kind === "
|
|
91
|
-
|
|
108
|
+
if (refusal.kind === "not-based-on-target" || refusal.kind === "unrelated-histories") {
|
|
109
|
+
return [
|
|
92
110
|
`${indent}reason ${refusalWords(refusal.kind)}`,
|
|
93
|
-
...(
|
|
111
|
+
...targetRefusalLines(undefined, indent, identity, undefined),
|
|
112
|
+
`${indent}target ${safeText(refusal.targetHead)}`,
|
|
94
113
|
];
|
|
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
114
|
}
|
|
104
115
|
if (refusal.kind === "merge-state-present") {
|
|
105
116
|
return [
|
|
106
117
|
`${indent}reason ${refusalWords(refusal.kind)}`,
|
|
107
|
-
...(
|
|
108
|
-
`${indent}
|
|
109
|
-
`${indent}workspace ${safeText(refusal.workspace.path)}`,
|
|
118
|
+
...targetRefusalLines(undefined, indent, identity, undefined),
|
|
119
|
+
`${indent}worktree ${safeText(refusal.worktreePath)}`,
|
|
110
120
|
];
|
|
111
121
|
}
|
|
112
122
|
if (refusal.kind === "integration-unsupported") {
|
|
113
123
|
return [
|
|
114
124
|
`${indent}reason ${refusalWords(refusal.kind)}`,
|
|
115
|
-
...(
|
|
116
|
-
`${indent}required Git ${safeText(refusal.requiredGit)}`,
|
|
125
|
+
...targetRefusalLines(undefined, indent, identity, undefined),
|
|
117
126
|
];
|
|
118
127
|
}
|
|
119
128
|
if (refusal.kind === "checkout-not-followable") {
|
|
120
|
-
return
|
|
129
|
+
return [
|
|
130
|
+
`${indent}reason checkout not followable`,
|
|
131
|
+
...targetRefusalLines(refusal.target, indent, identity, undefined),
|
|
132
|
+
`${indent}checkout ${safeText(refusal.path)}`,
|
|
133
|
+
...collectionLines("paths", refusal.paths, indent),
|
|
134
|
+
];
|
|
121
135
|
}
|
|
122
136
|
if (refusal.kind === "target-workspace-unavailable") {
|
|
123
137
|
return [
|
|
124
138
|
`${indent}reason target workspace unavailable`,
|
|
125
|
-
|
|
126
|
-
|
|
139
|
+
...targetRefusalLines(target, indent, identity, words(refusal.reason)),
|
|
140
|
+
];
|
|
141
|
+
}
|
|
142
|
+
if (refusal.kind === "target-contract-missing" || refusal.kind === "target-contract-terminal") {
|
|
143
|
+
return [
|
|
144
|
+
`${indent}reason ${refusalWords(refusal.kind)}`,
|
|
145
|
+
...targetRefusalLines(target, indent, identity, undefined),
|
|
127
146
|
];
|
|
128
147
|
}
|
|
129
148
|
const lines = [`${indent}reason ${refusalWords(refusal.kind)}`];
|
|
@@ -169,8 +188,8 @@ export function renderConflictMaterialized(result, _context) {
|
|
|
169
188
|
`${indent}saved worktree bytes before projection`,
|
|
170
189
|
`${indent}handoff base ${shortGitId(result.handoffBase)}`,
|
|
171
190
|
...collectionLines("conflicts", result.conflictPaths, indent),
|
|
172
|
-
`${indent}workspace ${safeText(result.
|
|
173
|
-
`${indent}option deliver
|
|
191
|
+
`${indent}workspace ${safeText(result.worktreePath)}`,
|
|
192
|
+
`${indent}option deliver deliver --include-dirty · reads worktree bytes, not index`,
|
|
174
193
|
].join("\n");
|
|
175
194
|
}
|
|
176
195
|
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,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
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { VerbCompletion, VerbInput, VerbName, VerbOutput } from "../../library/keiyaku-verbs.js";
|
|
2
|
+
import { type TextRenderContext } from "./terminal.js";
|
|
3
|
+
/** Render native completion values without observing the World or parsing output. */
|
|
4
|
+
export declare function renderVerb<K extends VerbName>(name: K, input: VerbInput<K>, completion: VerbCompletion<VerbOutput<K>>, context: TextRenderContext): string;
|