@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,29 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { BlockedDebtList, DebtBatchResult, DebtContextResult, DebtDecompositionTree, DebtDetail, DebtDoctorReport, DebtList, DebtMutationResult, DebtQueryResult, DebtUpdateResult } from "../../debt/index.js";
|
|
1
|
+
import type { DebtAbsent, DebtCatalogue, DebtDoctorReport, DebtMutationResult, DebtShowResult, DebtUpdateResult } from "../../debt/index.js";
|
|
3
2
|
import { type TextRenderContext } from "./terminal.js";
|
|
4
3
|
export { debtMark } from "./marks.js";
|
|
5
|
-
type DebtListOutcome = DebtList | BlockedDebtList | DebtQueryResult;
|
|
6
|
-
/** One addressed show selection: native details, or a refusal naming a missing addressed read. */
|
|
7
|
-
export type DebtShowResult = DebtDetail | DebtDetail[] | Extract<DebtMutationResult, {
|
|
8
|
-
kind: "refused";
|
|
9
|
-
}>;
|
|
10
|
-
/** Presentation-only list scope the leaf acquired; never part of a product value. */
|
|
11
|
-
export type DebtListScope = "world" | "current" | Readonly<{
|
|
12
|
-
namespace: string;
|
|
13
|
-
}>;
|
|
14
|
-
/** The union of native Debt SDK answers one leaf renders directly; the CLI adds no result envelope. */
|
|
15
|
-
type DebtNativeResult = DebtMutationResult | DebtUpdateResult | DebtBatchResult | DebtShowResult | DebtList | BlockedDebtList | DebtQueryResult | DebtDecompositionTree | DebtDoctorReport | DebtContextResult;
|
|
16
|
-
/** Debt dispositions and relation states are snake_case facts; people read them as words. */
|
|
17
4
|
export declare function dispositionText(word: string): string;
|
|
18
|
-
export declare function
|
|
19
|
-
|
|
20
|
-
export declare function renderDebtShow(result: DebtShowResult, context?: TextRenderContext): string;
|
|
21
|
-
export declare function renderDoctor(report: DebtDoctorReport): string;
|
|
22
|
-
export declare function renderDebtUpdate(result: DebtUpdateResult, context?: TextRenderContext): string;
|
|
23
|
-
|
|
24
|
-
export declare function renderDebtContext(result: DebtContextResult, context?: TextRenderContext): string;
|
|
25
|
-
/** One single-Debt mutation answer; `verb` is the literal action the leaf invoked. */
|
|
5
|
+
export declare function renderDebtList(result: DebtCatalogue, context?: TextRenderContext): string;
|
|
6
|
+
/** Each item corresponds to the same invocation position, including missing targets. */
|
|
7
|
+
export declare function renderDebtShow(result: DebtShowResult | DebtAbsent, context?: TextRenderContext): string;
|
|
8
|
+
export declare function renderDoctor(report: DebtDoctorReport | DebtAbsent): string;
|
|
9
|
+
export declare function renderDebtUpdate(id: string | undefined, result: DebtUpdateResult, context?: TextRenderContext): string;
|
|
10
|
+
/** Creation retains its minted identity in the native answer. */
|
|
26
11
|
export declare function renderDebtMutation(verb: string, result: DebtMutationResult, context?: TextRenderContext): string;
|
|
27
|
-
/** One lifecycle answer: a single mutation or a plural batch, both native shapes. */
|
|
28
|
-
export declare function renderDebtLifecycle(verb: string, result: DebtMutationResult | DebtBatchResult, context?: TextRenderContext): string;
|
|
29
|
-
export declare function debtOutcome(result: DebtNativeResult): CliOutcome;
|
|
@@ -1,175 +1,85 @@
|
|
|
1
1
|
import { debtMark } from "./marks.js";
|
|
2
|
-
import { outcomeLines,
|
|
3
|
-
import { DEFAULT_CLI_COLUMNS, displayColumns, emptyCatalogue, renderTextBlock, safeText, } from "./terminal.js";
|
|
2
|
+
import { outcomeLines, receiptRow, refusalLines } from "./receipt.js";
|
|
3
|
+
import { DEFAULT_CLI_COLUMNS, displayColumns, emptyCatalogue, renderOpaqueBlock, renderTextBlock, safeText, } from "./terminal.js";
|
|
4
4
|
export { debtMark } from "./marks.js";
|
|
5
5
|
const DEFAULT_CONTEXT = { columns: DEFAULT_CLI_COLUMNS, color: false };
|
|
6
|
-
/** Debt dispositions and relation states are snake_case facts; people read them as words. */
|
|
7
6
|
export function dispositionText(word) {
|
|
8
7
|
return word === "drop" ? "dropped" : word.replaceAll("_", " ");
|
|
9
8
|
}
|
|
10
|
-
function priorityText(priority) {
|
|
11
|
-
return priority === null ? "P?" : `P${priority}`;
|
|
12
|
-
}
|
|
13
|
-
function scanUnit(id, priority, word) {
|
|
14
|
-
return word === undefined
|
|
15
|
-
? `${debtMark("ready")} ${id} · ${priorityText(priority)}`
|
|
16
|
-
: `${debtMark(word)} ${id} · ${dispositionText(word)} · ${priorityText(priority)}`;
|
|
17
|
-
}
|
|
18
9
|
function entityLines(entity, columns, indent = "") {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
const parts = [
|
|
11
|
+
`${entity.mark} ${entity.id}`,
|
|
12
|
+
...(entity.word === undefined ? [] : [dispositionText(entity.word)]),
|
|
13
|
+
`P${entity.priority}`,
|
|
14
|
+
];
|
|
15
|
+
const scan = `${indent}${parts.join(" · ")}`;
|
|
22
16
|
const title = safeText(entity.title);
|
|
23
17
|
const inline = `${scan} — ${title}`;
|
|
24
18
|
if (displayColumns(inline) <= columns)
|
|
25
19
|
return [inline];
|
|
26
20
|
return [scan, ...renderTextBlock(title, `${indent} `, columns, "—")];
|
|
27
21
|
}
|
|
28
|
-
function stateEntity(debt) {
|
|
29
|
-
return {
|
|
30
|
-
id: debt.id,
|
|
31
|
-
priority: "priority" in debt && debt.priority !== undefined ? debt.priority : null,
|
|
32
|
-
word: debt.state,
|
|
33
|
-
title: debt.title,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
22
|
function projectRefusal(refusal) {
|
|
37
|
-
const diagnostic = refusal.
|
|
38
|
-
if (refusal.
|
|
39
|
-
return { diagnostic
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if (
|
|
44
|
-
return
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
function renderFailure(verb, result, columns) {
|
|
58
|
-
if (result.kind === "retry") {
|
|
59
|
-
return [...outcomeLines("?", verb, "retry", undefined, columns), result.reason].join("\n");
|
|
60
|
-
}
|
|
61
|
-
const facts = projectRefusal(result.refusal);
|
|
62
|
-
return refusalLines(verb, [`reason ${facts.diagnostic}`, ...(facts.facts ?? [])], columns).join("\n");
|
|
63
|
-
}
|
|
64
|
-
function edge(label, ref, mark) {
|
|
65
|
-
const prefix = mark === undefined ? ` ${label}` : ` ${mark} ${label}`;
|
|
66
|
-
return `${prefix} ${ref.id} · ${dispositionText(ref.state)}`;
|
|
67
|
-
}
|
|
68
|
-
export function debtFrameHead(view, scope) {
|
|
69
|
-
return `${view.toUpperCase()} // ${scope}`;
|
|
70
|
-
}
|
|
71
|
-
function updatedAge(updatedAt) {
|
|
72
|
-
const elapsed = Math.max(0, performance.timeOrigin + performance.now() - Date.parse(updatedAt));
|
|
73
|
-
const minutes = Math.floor(elapsed / 60_000);
|
|
74
|
-
if (minutes < 60)
|
|
75
|
-
return `${minutes}m`;
|
|
76
|
-
const hours = Math.floor(minutes / 60);
|
|
77
|
-
if (hours < 24)
|
|
78
|
-
return `${hours}h`;
|
|
79
|
-
return `${Math.floor(hours / 24)}d`;
|
|
80
|
-
}
|
|
81
|
-
function compactFacts(item) {
|
|
82
|
-
return [
|
|
83
|
-
`updated ${updatedAge(item.updatedAt)}`,
|
|
84
|
-
...(item.children === undefined ? [] : [`children ${item.children.live} live · ${item.children.total} total`]),
|
|
85
|
-
].join(" · ");
|
|
86
|
-
}
|
|
87
|
-
function listEntity(item, omitDisposition) {
|
|
88
|
-
return {
|
|
89
|
-
id: item.id,
|
|
90
|
-
priority: item.priority,
|
|
91
|
-
...(omitDisposition ? {} : { word: item.disposition }),
|
|
92
|
-
facts: compactFacts(item),
|
|
93
|
-
title: item.title,
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
function renderListRow(item, columns, omitDisposition) {
|
|
97
|
-
const lines = [...entityLines(listEntity(item, omitDisposition), columns)];
|
|
98
|
-
if ("blockers" in item) {
|
|
99
|
-
for (const blocker of item.blockers)
|
|
100
|
-
lines.push(` needs ${blocker.id} · ${dispositionText(blocker.state)}`);
|
|
101
|
-
}
|
|
102
|
-
return lines;
|
|
103
|
-
}
|
|
104
|
-
export function renderDebtList(action, scope, result, context = DEFAULT_CONTEXT) {
|
|
23
|
+
const diagnostic = refusal.reason.replaceAll("-", " ");
|
|
24
|
+
if (refusal.reason === "debt-missing")
|
|
25
|
+
return { diagnostic };
|
|
26
|
+
return { diagnostic, facts: [`detail ${refusal.diagnostic}`] };
|
|
27
|
+
}
|
|
28
|
+
function renderFailure(verb, result, columns, id) {
|
|
29
|
+
if (result.kind === "retry")
|
|
30
|
+
return [...outcomeLines("?", verb, "retry", id, columns), result.reason].join("\n");
|
|
31
|
+
const facts = projectRefusal(result);
|
|
32
|
+
return refusalLines(verb, [...(id === undefined ? [] : [`debt ${id}`]), `reason ${facts.diagnostic}`, ...(facts.facts ?? [])], columns).join("\n");
|
|
33
|
+
}
|
|
34
|
+
/** A cleanup problem cannot reverse the confirmed write. */
|
|
35
|
+
function warningLines(warning, columns) {
|
|
36
|
+
return [" ! warning", ...renderOpaqueBlock(warning, " ", columns)];
|
|
37
|
+
}
|
|
38
|
+
function edge(label, ref) {
|
|
39
|
+
return ` ${label} ${ref.id} · ${dispositionText(ref.state)}`;
|
|
40
|
+
}
|
|
41
|
+
export function renderDebtList(result, context = DEFAULT_CONTEXT) {
|
|
42
|
+
const page = result;
|
|
105
43
|
const columns = context.columns;
|
|
106
|
-
if (
|
|
107
|
-
return
|
|
108
|
-
const
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
? "world"
|
|
112
|
-
: scope === "current"
|
|
113
|
-
? "current namespace"
|
|
114
|
-
: `namespace ${scope.namespace.replace(/^debt\//u, "").replace(/\/$/u, "") || "root"}`;
|
|
115
|
-
const heading = debtFrameHead(view, scopeText);
|
|
116
|
-
if (result.value.rows.length === 0)
|
|
44
|
+
if ("absent" in page)
|
|
45
|
+
return "debt world absent";
|
|
46
|
+
const rows = page.rows ?? [];
|
|
47
|
+
const view = "debts";
|
|
48
|
+
if (rows.length === 0)
|
|
117
49
|
return emptyCatalogue(view);
|
|
118
50
|
return [
|
|
119
|
-
|
|
120
|
-
...
|
|
121
|
-
...
|
|
51
|
+
"DEBTS // world",
|
|
52
|
+
...rows.flatMap((row) => entityLines({ ...row, mark: debtMark(row.disposition), word: row.disposition }, columns)),
|
|
53
|
+
...(page.more === true ? ["…"] : []),
|
|
122
54
|
].join("\n");
|
|
123
55
|
}
|
|
124
56
|
function textTimestamp(timestamp) {
|
|
125
57
|
return timestamp.replace(/\.\d+(?=Z$)/u, "");
|
|
126
58
|
}
|
|
127
|
-
function renderShowDetail(
|
|
128
|
-
const debt = result.debt;
|
|
59
|
+
function renderShowDetail(id, debt, columns) {
|
|
129
60
|
const lines = [
|
|
130
|
-
...entityLines(
|
|
61
|
+
...entityLines({ id, priority: debt.priority, mark: debtMark(debt.state), word: debt.state, title: debt.title }, columns),
|
|
131
62
|
` created ${textTimestamp(debt.createdAt)}`,
|
|
132
63
|
` updated ${textTimestamp(debt.updatedAt)}`,
|
|
133
|
-
...(debt.createdBy === undefined ? [] : [` created by ${debt.createdBy}`]),
|
|
134
64
|
];
|
|
135
|
-
for (const need of
|
|
136
|
-
lines.push(edge("needs", need
|
|
137
|
-
for (const
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
lines.push(edge("parent", result.parent));
|
|
143
|
-
for (const item of result.children)
|
|
144
|
-
lines.push(edge("child", item));
|
|
145
|
-
for (const item of result.supersedes)
|
|
146
|
-
lines.push(edge("supersedes", item));
|
|
147
|
-
for (const item of result.supersededBy)
|
|
148
|
-
lines.push(edge("superseded-by", item));
|
|
149
|
-
for (const item of result.related)
|
|
150
|
-
lines.push(edge("related", item));
|
|
151
|
-
if (debt.note.length > 0)
|
|
152
|
-
receiptPayload(lines, "note", debt.note);
|
|
153
|
-
if (debt.body.length > 0)
|
|
154
|
-
receiptPayload(lines, "body", debt.body);
|
|
65
|
+
for (const need of debt.needs ?? [])
|
|
66
|
+
lines.push(edge("needs", need));
|
|
67
|
+
for (const label of ["note", "body"]) {
|
|
68
|
+
const payload = debt[label];
|
|
69
|
+
if (payload !== undefined)
|
|
70
|
+
lines.push(` ${label}`, ...payload.split("\n").map((line) => ` ${safeText(line)}`), "");
|
|
71
|
+
}
|
|
155
72
|
return lines.join("\n");
|
|
156
73
|
}
|
|
74
|
+
/** Each item corresponds to the same invocation position, including missing targets. */
|
|
157
75
|
export function renderDebtShow(result, context = DEFAULT_CONTEXT) {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
function treeLines(node, columns, depth = 0) {
|
|
166
|
-
const indent = " ".repeat(depth);
|
|
167
|
-
if (node.cycle === true)
|
|
168
|
-
return [`${indent}! ${node.debt.id} · cycle`];
|
|
169
|
-
return [
|
|
170
|
-
...entityLines(stateEntity(node.debt), columns, indent),
|
|
171
|
-
...node.children.flatMap((child) => treeLines(child, columns, depth + 1)),
|
|
172
|
-
];
|
|
76
|
+
if (result.kind === "absent")
|
|
77
|
+
return "debt world absent";
|
|
78
|
+
return result.items
|
|
79
|
+
.map((item) => item.kind === "found"
|
|
80
|
+
? renderShowDetail(item.id, item, context.columns)
|
|
81
|
+
: refusalLines("show", ["reason debt missing", `debt ${item.id}`], context.columns).join("\n"))
|
|
82
|
+
.join("\n\n");
|
|
173
83
|
}
|
|
174
84
|
function doctorIssue(issue) {
|
|
175
85
|
if (issue.kind === "missing-target")
|
|
@@ -179,79 +89,33 @@ function doctorIssue(issue) {
|
|
|
179
89
|
return `! cycle ${issue.relation} ${issue.debts.join(" ")}`;
|
|
180
90
|
}
|
|
181
91
|
export function renderDoctor(report) {
|
|
182
|
-
if (report.
|
|
92
|
+
if (report.kind === "absent")
|
|
93
|
+
return "debt world absent";
|
|
94
|
+
if (report.issues === undefined)
|
|
183
95
|
return "✓ doctor healthy";
|
|
184
96
|
const noun = report.issues.length === 1 ? "issue" : "issues";
|
|
185
97
|
return [`! doctor ${report.issues.length} ${noun}`, ...report.issues.map(doctorIssue)].join("\n");
|
|
186
98
|
}
|
|
187
|
-
const PAST_VERBS = {
|
|
188
|
-
|
|
189
|
-
done: "done",
|
|
190
|
-
drop: "dropped",
|
|
191
|
-
update: "updated",
|
|
192
|
-
};
|
|
193
|
-
function renderAcceptedMutation(verb, debt, columns, changes = []) {
|
|
194
|
-
const lines = [];
|
|
195
|
-
receiptRow(lines, "✓", PAST_VERBS[verb] ?? verb, [{ text: debt.id, opaque: true }], columns);
|
|
196
|
-
lines.push(...entityLines(stateEntity(debt), columns));
|
|
197
|
-
for (const change of changes)
|
|
198
|
-
lines.push(` ${change.field} ${change.action}`);
|
|
199
|
-
return lines.join("\n");
|
|
200
|
-
}
|
|
201
|
-
function renderMutation(action, result, columns) {
|
|
202
|
-
if (result.kind !== "accepted")
|
|
203
|
-
return renderFailure(action, result, columns);
|
|
204
|
-
return renderAcceptedMutation(action, result.value, columns);
|
|
205
|
-
}
|
|
206
|
-
export function renderDebtUpdate(result, context = DEFAULT_CONTEXT) {
|
|
99
|
+
const PAST_VERBS = { add: "added", update: "updated" };
|
|
100
|
+
export function renderDebtUpdate(id, result, context = DEFAULT_CONTEXT) {
|
|
207
101
|
const columns = context.columns;
|
|
208
102
|
if (result.kind !== "accepted")
|
|
209
|
-
return renderFailure("update", result, columns);
|
|
210
|
-
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
const facts = projectRefusal(item.outcome.refusal);
|
|
218
|
-
const rest = (facts.facts ?? []).filter((fact) => fact !== `debt ${item.id}`);
|
|
219
|
-
return refusalLines(verb, [`debt ${item.id}`, `reason ${facts.diagnostic}`, ...rest], columns).join("\n");
|
|
220
|
-
}
|
|
221
|
-
function renderBatch(verb, batch, columns) {
|
|
222
|
-
return batch.items.map((item) => renderBatchItem(verb, item, columns)).join("\n");
|
|
223
|
-
}
|
|
224
|
-
export function renderDebtTree(result, context = DEFAULT_CONTEXT) {
|
|
225
|
-
return result.kind === "accepted"
|
|
226
|
-
? treeLines(result.value, context.columns).join("\n")
|
|
227
|
-
: renderFailure("tree", result, context.columns);
|
|
228
|
-
}
|
|
229
|
-
export function renderDebtContext(result, context = DEFAULT_CONTEXT) {
|
|
230
|
-
if (result.kind !== "accepted")
|
|
231
|
-
return renderFailure("context", result, context.columns);
|
|
232
|
-
const value = result.value.namespace.length === 0 ? "root" : result.value.namespace.join("/");
|
|
233
|
-
return `context ${value} · ${result.value.source}`;
|
|
103
|
+
return renderFailure("update", result, columns, id);
|
|
104
|
+
const lines = [];
|
|
105
|
+
receiptRow(lines, "✓", PAST_VERBS.update, id === undefined ? [] : [{ text: id, opaque: true }], columns);
|
|
106
|
+
for (const field of result.changes ?? [])
|
|
107
|
+
lines.push(` ${field} changed`);
|
|
108
|
+
if (result.warning !== undefined)
|
|
109
|
+
lines.push(...warningLines(result.warning, columns));
|
|
110
|
+
return lines.join("\n");
|
|
234
111
|
}
|
|
235
|
-
/**
|
|
112
|
+
/** Creation retains its minted identity in the native answer. */
|
|
236
113
|
export function renderDebtMutation(verb, result, context = DEFAULT_CONTEXT) {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
if ("issues" in result)
|
|
245
|
-
return result.issues.length === 0 ? "accepted" : "failed";
|
|
246
|
-
if ("items" in result) {
|
|
247
|
-
const kinds = result.items.map((item) => item.outcome.kind);
|
|
248
|
-
return kinds.includes("retry") ? "retryable" : kinds.includes("refused") ? "refused" : "accepted";
|
|
249
|
-
}
|
|
250
|
-
if ("kind" in result) {
|
|
251
|
-
if (result.kind === "retry")
|
|
252
|
-
return "retryable";
|
|
253
|
-
if (result.kind === "refused")
|
|
254
|
-
return "refused";
|
|
255
|
-
}
|
|
256
|
-
return "accepted";
|
|
114
|
+
if (result.kind !== "accepted")
|
|
115
|
+
return renderFailure(verb, result, context.columns);
|
|
116
|
+
const lines = [];
|
|
117
|
+
receiptRow(lines, "✓", PAST_VERBS[verb] ?? verb, [{ text: result.id, opaque: true }], context.columns);
|
|
118
|
+
if (result.warning !== undefined)
|
|
119
|
+
lines.push(...warningLines(result.warning, context.columns));
|
|
120
|
+
return lines.join("\n");
|
|
257
121
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { DeliveryPreviewOutcome } from "../../index.js";
|
|
2
2
|
import { type TextRenderContext } from "./terminal.js";
|
|
3
|
-
type
|
|
4
|
-
kind: "
|
|
3
|
+
type Preview = Extract<DeliveryPreviewOutcome, {
|
|
4
|
+
kind: "ready" | "blocked";
|
|
5
5
|
}>;
|
|
6
|
-
|
|
6
|
+
/** A preview is an observation, not a successful mutation or a prediction of placement. */
|
|
7
|
+
export declare function renderDeliveryPreview(report: Preview, context?: TextRenderContext): string;
|
|
7
8
|
export {};
|
|
@@ -1,129 +1,101 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { executionCleanupLines, executionStopLines, standingGateLines, receiptPayload, receiptRow, titleLines, } from "./receipt.js";
|
|
1
|
+
import { unmetRequirementLines, receiptPayload, receiptRow, titleLines } from "./receipt.js";
|
|
3
2
|
import { renderRefusalFacts } from "./refusal.js";
|
|
4
3
|
import { abbreviateGitIds, displayGitId } from "./contract-observation.js";
|
|
5
|
-
import { DEFAULT_CLI_COLUMNS, gitShortStat,
|
|
6
|
-
|
|
7
|
-
function
|
|
8
|
-
return [`${CHILD}worktree ${safeText(workspace.path)}`];
|
|
9
|
-
}
|
|
10
|
-
function candidateLines(report, columns, addressed, abbreviations) {
|
|
11
|
-
const candidate = report.candidate;
|
|
12
|
-
const lines = [];
|
|
13
|
-
if (candidate.kind === "blocked") {
|
|
14
|
-
receiptRow(lines, "!", "candidate", [{ text: "blocked" }], columns);
|
|
15
|
-
lines.push(...renderRefusalFacts(candidate.refusal, CHILD, columns, addressed));
|
|
16
|
-
return lines;
|
|
17
|
-
}
|
|
18
|
-
const identity = candidate.identity;
|
|
19
|
-
receiptRow(lines, " ", "candidate", [{ text: "prepared" }, { text: displayGitId(identity.tenderSnapshot, abbreviations), opaque: true }], columns);
|
|
20
|
-
lines.push(`${CHILD}integration result ${displayGitId(identity.integration.snapshot, abbreviations)}`);
|
|
21
|
-
if (!/^0{40}$/u.test(identity.integration.changeId))
|
|
22
|
-
lines.push(`${CHILD}content identity ${displayGitId(identity.integration.changeId, abbreviations)}`);
|
|
23
|
-
lines.push(...workspaceEvidence(candidate.workspace));
|
|
24
|
-
lines.push(...standingGateLines(candidate.requirements.gates.filter((report) => report.gate !== "verified"), columns));
|
|
25
|
-
for (const prerequisite of candidate.requirements.unmetPrerequisites) {
|
|
26
|
-
receiptRow(lines, "!", "prerequisite", [{ text: prerequisite.contractId }, { text: prerequisite.state }], columns);
|
|
27
|
-
}
|
|
28
|
-
lines.push(...renderTextBlock(gitShortStat(candidate.scope), CHILD, columns));
|
|
29
|
-
if (candidate.scope.paths !== undefined) {
|
|
30
|
-
for (const path of candidate.scope.paths) {
|
|
31
|
-
lines.push(`${CHILD}${safeText(path)}`);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
if (candidate.diff !== undefined)
|
|
35
|
-
receiptPayload(lines, "diff", candidate.diff);
|
|
36
|
-
return lines;
|
|
37
|
-
}
|
|
38
|
-
function verificationLines(verification, columns) {
|
|
39
|
-
if (verification.kind === "requirements")
|
|
40
|
-
return standingGateLines([{ gate: "verified", requirements: verification.requirements }], columns);
|
|
41
|
-
const lines = [];
|
|
42
|
-
receiptRow(lines, " ", "verification", [{ text: verification.kind === "undeclared" ? "none declared" : "not run" }], columns);
|
|
43
|
-
return lines;
|
|
44
|
-
}
|
|
45
|
-
function admittedCandidateLines(report, columns) {
|
|
46
|
-
if (report.delivery === undefined)
|
|
47
|
-
return [];
|
|
48
|
-
const lines = [];
|
|
49
|
-
receiptRow(lines, " ", "admitted candidate", [
|
|
50
|
-
{ text: report.delivery.relation },
|
|
51
|
-
{
|
|
52
|
-
text: `· content identity ${displayGitId(report.delivery.changeId, abbreviateGitIds([report.delivery.changeId]))}`,
|
|
53
|
-
},
|
|
54
|
-
], columns);
|
|
55
|
-
return lines;
|
|
56
|
-
}
|
|
57
|
-
function targetLines(report, columns, addressed, abbreviations) {
|
|
4
|
+
import { DEFAULT_CLI_COLUMNS, gitShortStat, safeText } from "./terminal.js";
|
|
5
|
+
import { contractIssueLines } from "./contract.js";
|
|
6
|
+
function targetLines(report, columns, ids, surface) {
|
|
58
7
|
const target = report.target;
|
|
59
8
|
const lines = [];
|
|
60
|
-
if (target
|
|
61
|
-
receiptRow(lines, " ", "target", [{ text: "none" }], columns);
|
|
9
|
+
if (target === undefined)
|
|
62
10
|
return lines;
|
|
63
|
-
}
|
|
64
11
|
if (target.kind === "placeable") {
|
|
12
|
+
const lag = target.behind === undefined ? "" : ` · behind ${target.behind === "unknown" ? "unknown" : String(target.behind)}`;
|
|
65
13
|
receiptRow(lines, " ", "target", [
|
|
66
14
|
{ text: "placeable" },
|
|
67
15
|
{
|
|
68
|
-
text: `${target.ref.replace(/^refs\/heads\//u, "")} @ ${displayGitId(target.head,
|
|
16
|
+
text: `${target.ref.replace(/^refs\/heads\//u, "")} @ ${displayGitId(target.head, ids)}${lag}`,
|
|
69
17
|
opaque: true,
|
|
70
18
|
},
|
|
71
19
|
], columns);
|
|
72
|
-
for (const checkout of target.checkouts) {
|
|
73
|
-
if (checkout.kind === "followable")
|
|
74
|
-
continue;
|
|
20
|
+
for (const checkout of target.checkouts ?? []) {
|
|
75
21
|
receiptRow(lines, "!", "checkout cannot follow", [{ text: checkout.path, opaque: true }], columns);
|
|
76
22
|
receiptPayload(lines, "reason", checkout.diagnostic);
|
|
77
23
|
}
|
|
78
|
-
return lines;
|
|
79
24
|
}
|
|
80
|
-
if (target.kind === "moved") {
|
|
25
|
+
else if (target.kind === "moved") {
|
|
81
26
|
receiptRow(lines, "!", "target", [
|
|
82
27
|
{ text: "moved" },
|
|
83
28
|
{ text: target.ref, opaque: true },
|
|
84
29
|
{
|
|
85
|
-
text: `${displayGitId(target.expected,
|
|
30
|
+
text: `${displayGitId(target.expected, ids)} -> ${target.observed === null ? "absent" : displayGitId(target.observed, ids)}`,
|
|
86
31
|
opaque: true,
|
|
87
32
|
},
|
|
88
33
|
], columns);
|
|
89
|
-
return lines;
|
|
90
34
|
}
|
|
91
|
-
if (target.kind === "failed") {
|
|
35
|
+
else if (target.kind === "failed") {
|
|
92
36
|
receiptRow(lines, "!", "target", [{ text: "failed" }], columns);
|
|
93
37
|
receiptPayload(lines, "reason", target.diagnostic);
|
|
94
|
-
return lines;
|
|
95
38
|
}
|
|
96
|
-
|
|
97
|
-
|
|
39
|
+
else {
|
|
40
|
+
receiptRow(lines, "!", "target", [{ text: "refused" }], columns);
|
|
41
|
+
lines.push(...renderRefusalFacts(target.reason, " ", columns, report.contractId, surface));
|
|
42
|
+
}
|
|
43
|
+
return lines;
|
|
44
|
+
}
|
|
45
|
+
function previewGitIds(report) {
|
|
46
|
+
const ids = [report.candidate, report.integration, report.contentId];
|
|
47
|
+
if (report.previousContentId !== undefined)
|
|
48
|
+
ids.push(report.previousContentId);
|
|
49
|
+
if (report.target?.kind === "placeable")
|
|
50
|
+
ids.push(report.target.head);
|
|
51
|
+
if (report.target?.kind === "moved")
|
|
52
|
+
ids.push(report.target.expected, report.target.observed ?? "");
|
|
53
|
+
return abbreviateGitIds(ids);
|
|
54
|
+
}
|
|
55
|
+
function unmetLines(report, columns) {
|
|
56
|
+
const lines = [];
|
|
57
|
+
lines.push(...unmetRequirementLines(report.unmetGates ?? [], columns));
|
|
58
|
+
for (const prerequisite of report.unmetPrerequisites ?? [])
|
|
59
|
+
receiptRow(lines, "!", "prerequisite", [{ text: prerequisite.contractId, opaque: true }, { text: prerequisite.state }], columns);
|
|
98
60
|
return lines;
|
|
99
61
|
}
|
|
100
|
-
function
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
62
|
+
function scopeLines(report) {
|
|
63
|
+
const lines = [
|
|
64
|
+
` ${safeText(gitShortStat({
|
|
65
|
+
filesChanged: report.scope.filesChanged ?? 0,
|
|
66
|
+
insertions: report.scope.insertions ?? 0,
|
|
67
|
+
deletions: report.scope.deletions ?? 0,
|
|
68
|
+
}))}`,
|
|
104
69
|
];
|
|
70
|
+
for (const path of report.scope.paths ?? [])
|
|
71
|
+
lines.push(` ${safeText(path)}`);
|
|
72
|
+
return lines;
|
|
105
73
|
}
|
|
106
|
-
|
|
107
|
-
|
|
74
|
+
/** A preview is an observation, not a successful mutation or a prediction of placement. */
|
|
75
|
+
export function renderDeliveryPreview(report, context) {
|
|
108
76
|
const columns = context?.columns ?? DEFAULT_CLI_COLUMNS;
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
if (report.
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
77
|
+
const lines = titleLines(report.kind === "ready" ? "✓" : "!", "deliver --dry-run", report.contractId, columns);
|
|
78
|
+
if (report.kind === "blocked") {
|
|
79
|
+
receiptRow(lines, "!", "candidate", [{ text: "blocked" }], columns);
|
|
80
|
+
lines.push(...renderRefusalFacts(report.reason, " ", columns, report.contractId, context?.surface), ...contractIssueLines(report, columns));
|
|
81
|
+
return lines.join("\n");
|
|
82
|
+
}
|
|
83
|
+
const ids = previewGitIds(report);
|
|
84
|
+
receiptRow(lines, " ", "candidate", [{ text: "prepared" }, { text: displayGitId(report.candidate, ids), opaque: true }], columns);
|
|
85
|
+
receiptRow(lines, " ", "integration result", [{ text: displayGitId(report.integration, ids), opaque: true }], columns);
|
|
86
|
+
if (!/^0{40}$/u.test(report.contentId))
|
|
87
|
+
receiptRow(lines, " ", "content identity", [{ text: displayGitId(report.contentId, ids), opaque: true }], columns);
|
|
88
|
+
lines.push(...unmetLines(report, columns), ...scopeLines(report));
|
|
89
|
+
if (report.diff?.kind === "present") {
|
|
90
|
+
if (report.diff.text.length === 0)
|
|
91
|
+
receiptRow(lines, " ", "diff", [{ text: "empty" }], columns);
|
|
92
|
+
else
|
|
93
|
+
receiptPayload(lines, "diff", report.diff.text);
|
|
94
|
+
}
|
|
95
|
+
else if (report.diff?.kind === "unavailable")
|
|
96
|
+
receiptRow(lines, "!", "diff", [{ text: "unavailable" }], columns);
|
|
97
|
+
if (report.previousContentId !== undefined)
|
|
98
|
+
receiptRow(lines, " ", "admitted candidate", [{ text: `previous content ${displayGitId(report.previousContentId, ids)}` }], columns);
|
|
99
|
+
lines.push(...targetLines(report, columns, ids, context?.surface), ...contractIssueLines(report, columns));
|
|
100
|
+
return lines.join("\n");
|
|
129
101
|
}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import type { AkumaKanshiRow, AkumaKanshiWorld, KanshiReport,
|
|
1
|
+
import type { AkumaKanshiRow, AkumaKanshiWorld, KanshiReport, BoardSection } from "../../kanshi/report.js";
|
|
2
2
|
import { type TextRenderContext } from "./terminal.js";
|
|
3
3
|
declare const NARROW_COLUMNS = 72;
|
|
4
4
|
declare function akumaLabel(row: Pick<AkumaKanshiRow, "aliases">, aliasesUnavailable: boolean): string;
|
|
5
|
-
declare function
|
|
5
|
+
declare function associationFact(contract: NonNullable<AkumaKanshiRow["contract"]>): string;
|
|
6
6
|
/**
|
|
7
7
|
* One Akuma board section. The World board omits an empty section because its other
|
|
8
|
-
* sections already say what the World holds; a
|
|
9
|
-
*
|
|
8
|
+
* sections already say what the World holds; a standalone catalogue states its
|
|
9
|
+
* own emptiness. A failed Alias observation belongs to the
|
|
10
10
|
* section, so an empty roster still states its emptiness rather than dropping that
|
|
11
11
|
* evidence.
|
|
12
12
|
*/
|
|
13
|
-
declare function renderAkumaBoard(section:
|
|
13
|
+
declare function renderAkumaBoard(section: BoardSection<AkumaKanshiWorld>, observedAt: string, context: TextRenderContext & Readonly<{
|
|
14
|
+
caller?: string;
|
|
15
|
+
}>, emptyRows?: readonly string[]): readonly string[];
|
|
14
16
|
declare function renderAkuma(report: KanshiReport, context: TextRenderContext): readonly string[];
|
|
15
17
|
declare function formatAge(source: string | null | undefined, observedAt: string): string;
|
|
16
|
-
export { akumaLabel,
|
|
18
|
+
export { akumaLabel, associationFact, formatAge, NARROW_COLUMNS, renderAkuma, renderAkumaBoard };
|