@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,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AkumaId } from "../akuma/identity.js";
|
|
2
2
|
import type { WorldRoot } from "../world.js";
|
|
3
3
|
/**
|
|
4
4
|
* One deterministic, bounded retention sweep over the World's recognized Akuma
|
|
@@ -8,4 +8,4 @@ import type { WorldRoot } from "../world.js";
|
|
|
8
8
|
*/
|
|
9
9
|
export declare function sweepInactiveAkumas(world: WorldRoot, options?: Readonly<{
|
|
10
10
|
now?: number;
|
|
11
|
-
}>): Promise<readonly
|
|
11
|
+
}>): Promise<readonly AkumaId[]>;
|
|
@@ -57,7 +57,7 @@ async function retireCandidate(world, repository, entry, now) {
|
|
|
57
57
|
if (aliases === null)
|
|
58
58
|
return "retained";
|
|
59
59
|
try {
|
|
60
|
-
if (aliases.bindings.some((binding) => binding.
|
|
60
|
+
if (aliases.bindings.some((binding) => binding.akumaId === entry.id))
|
|
61
61
|
return "retained";
|
|
62
62
|
if (repository === undefined)
|
|
63
63
|
return await retireOrRetain();
|
|
@@ -115,7 +115,7 @@ export async function sweepInactiveAkumas(world, options = {}) {
|
|
|
115
115
|
})).filter((entry) => entry !== null);
|
|
116
116
|
if (candidates.length === 0)
|
|
117
117
|
return [];
|
|
118
|
-
const aliases = new Set((await readAliases(world)).map((binding) => binding.
|
|
118
|
+
const aliases = new Set((await readAliases(world)).map((binding) => binding.akumaId));
|
|
119
119
|
const repository = await retentionRepository(world);
|
|
120
120
|
const associations = await observeDispatchAssociations(repository, candidates.map((entry) => entry.id));
|
|
121
121
|
const retired = [];
|
|
@@ -1,30 +1,46 @@
|
|
|
1
1
|
/** @architectureCompositionRoot */
|
|
2
2
|
import { type AkumaHostOptions } from "../akuma/akuma-instance.js";
|
|
3
|
-
import
|
|
4
|
-
import type {
|
|
3
|
+
import { listAkumaNameDefinitions, type AkumaNameCatalog, type AkumaNameCatalogInput } from "../akuma/archetype.js";
|
|
4
|
+
import type { AkumaCaller } from "../akuma/caller.js";
|
|
5
|
+
import type { AkumaRosterInput } from "../akuma/akuma.js";
|
|
6
|
+
import { type Dispatch } from "../dispatch/index.js";
|
|
7
|
+
import { type GitReadObservation } from "../git/read-observation.js";
|
|
8
|
+
import { Repo } from "./repo.js";
|
|
9
|
+
import type { AkumaKanshiWorld, Section } from "../kanshi/report.js";
|
|
10
|
+
import type { z } from "zod";
|
|
11
|
+
import type { akumaCatalogueSchema } from "../akuma/selection-observation.js";
|
|
5
12
|
import type { BodyLauncher } from "../akuma/body-launch.js";
|
|
13
|
+
import { type AliasBinding } from "../alias/index.js";
|
|
6
14
|
import type { DispatchAssociation } from "../akuma/dispatch-association.js";
|
|
7
|
-
import type { CreatedDebtObservation } from "../debt/created-observation.js";
|
|
8
15
|
import { type WorldRoot } from "../world.js";
|
|
9
16
|
import type { AkumaAddressInput, AkumaWorldScopeRefusal } from "./address.js";
|
|
10
|
-
import type {
|
|
11
|
-
import { type AkumaAskInput, type AkumaAskResult, type AkumaHistoryInput, type AkumaHistoryResult, type AkumaKillInput, type AkumaKillResult, type AkumaObservation, type
|
|
17
|
+
import type { ForkInput, ForkResult, SpawnInput, SpawnResult, SpawnWaitHead } from "./akuma-creation.js";
|
|
18
|
+
import { type AkumaAskInput, type AkumaAskResult, type AkumaHistoryInput, type AkumaHistoryResult, type AkumaKillInput, type AkumaKillResult, type AkumaObservation, type AkumaTellInput, type AkumaTellResult, type AkumaWaitInput, type AkumaWaitResult } from "./selection.js";
|
|
12
19
|
export { AkumaAddressError, AkumaWorldScopeError } from "./address.js";
|
|
13
20
|
export type { AkumaAddressInput } from "./address.js";
|
|
14
|
-
export type {
|
|
21
|
+
export type { ForkInput, SpawnInput } from "./akuma-creation.js";
|
|
15
22
|
export type { AkumaAskInput, AkumaHistoryInput, AkumaKillInput, AkumaTellInput, AkumaWaitInput } from "./selection.js";
|
|
16
|
-
export type { AkumaAskResult, AkumaHistoryResult, AkumaKillResult,
|
|
17
|
-
/** The existing native wait-observation seam, exposed type-only for CLI composition. */
|
|
23
|
+
export type { AliasBinding, AkumaAskResult, AkumaHistoryResult, AkumaKillResult, AkumaObservation, AkumaTellResult, AkumaWaitResult, AkumaWorldScopeRefusal, DispatchAssociation, ForkResult, SpawnResult, SpawnWaitHead, };
|
|
18
24
|
export type Akumas = AkumasHandle;
|
|
25
|
+
export type AkumaAliasesInput = Readonly<{
|
|
26
|
+
akumaIds: readonly string[];
|
|
27
|
+
}>;
|
|
28
|
+
export type AkumaListInput = AkumaRosterInput & Readonly<{
|
|
29
|
+
repo?: Repo;
|
|
30
|
+
}>;
|
|
31
|
+
export type AkumaList = z.output<typeof akumaCatalogueSchema>;
|
|
32
|
+
export type AkumaNamesInput = Omit<AkumaNameCatalogInput, "cwd">;
|
|
19
33
|
declare class AkumasHandle {
|
|
20
34
|
#private;
|
|
21
35
|
constructor(world: WorldRoot, spawn: BodyLauncher, host?: AkumaHostOptions);
|
|
36
|
+
akumaNames(input?: AkumaNamesInput): Promise<AkumaNameCatalog>;
|
|
22
37
|
list(input?: AkumaListInput): Promise<AkumaList>;
|
|
23
|
-
|
|
38
|
+
aliases(input: AkumaAliasesInput): Promise<readonly AliasBinding[]>;
|
|
39
|
+
spawn(input: SpawnInput): Promise<SpawnResult>;
|
|
24
40
|
fork(input: ForkInput): Promise<ForkResult>;
|
|
25
41
|
status(input: AkumaAddressInput): Promise<AkumaObservation>;
|
|
26
42
|
tell(input: AkumaTellInput): Promise<AkumaTellResult>;
|
|
27
|
-
ask
|
|
43
|
+
ask(input: AkumaAskInput): Promise<AkumaAskResult>;
|
|
28
44
|
wait(input: AkumaWaitInput): Promise<AkumaWaitResult>;
|
|
29
45
|
kill(input: AkumaKillInput): Promise<AkumaKillResult>;
|
|
30
46
|
history(input: AkumaHistoryInput): Promise<AkumaHistoryResult>;
|
|
@@ -38,8 +54,15 @@ declare class AkumasHandle {
|
|
|
38
54
|
private sweep;
|
|
39
55
|
private withWorld;
|
|
40
56
|
}
|
|
57
|
+
export declare function diagnostic(error: unknown): string;
|
|
58
|
+
export declare function aliasesAt(world: WorldRoot | null): Promise<Section<readonly AliasBinding[]>>;
|
|
59
|
+
export declare function dispatchesAt(observation: GitReadObservation): Promise<Section<readonly Dispatch[]>>;
|
|
60
|
+
/** Shared catalogue projection; World bounds snapshots by original roster position. */
|
|
61
|
+
export declare function akumaRowsAt(world: WorldRoot, limit: number, name?: string, caller?: AkumaCaller, snapshotRows?: number): Promise<AkumaList>;
|
|
62
|
+
export declare function joinedAkumas<T extends AkumaKanshiWorld>(product: T, aliases: Section<readonly AliasBinding[]>, dispatches: Section<readonly Dispatch[]>): T;
|
|
41
63
|
/** Internal host composition for an explicitly owned launcher. */
|
|
42
64
|
export declare function akumasWithLauncher(world: WorldRoot, spawn: BodyLauncher, host?: AkumaHostOptions): Akumas;
|
|
43
65
|
export declare const Akumas: Readonly<{
|
|
66
|
+
akumaNames: typeof listAkumaNameDefinitions;
|
|
44
67
|
of(world: WorldRoot, host?: AkumaHostOptions): Akumas;
|
|
45
68
|
}>;
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
/** @architectureCompositionRoot */
|
|
2
2
|
import { captureAkumaHostDiagnostic } from "../akuma/akuma-instance.js";
|
|
3
|
-
import {
|
|
3
|
+
import { listAkumaNameDefinitions } from "../akuma/archetype.js";
|
|
4
|
+
import { observeAkumaRoster, readAkumaTimeline, rosterInput } from "../akuma/akuma.js";
|
|
5
|
+
import { boundedListLimit } from "../bounded-list.js";
|
|
6
|
+
import { boundedMap } from "../akuma/read-pool.js";
|
|
7
|
+
import { projectCurrentWork } from "../akuma/status-projection.js";
|
|
8
|
+
import { readDispatchesAt } from "../dispatch/index.js";
|
|
9
|
+
import { KeiyakuError } from "../errors.js";
|
|
10
|
+
import { withGitDecodeChannel, withGitReadObservation } from "../git/read-observation.js";
|
|
11
|
+
import { Repo, scopeForRepo } from "./repo.js";
|
|
4
12
|
import { captureAkumaHost } from "../body-host.js";
|
|
5
13
|
import { readAliases } from "../alias/index.js";
|
|
14
|
+
import { parseAkumaId } from "../akuma/identity.js";
|
|
6
15
|
import { World } from "../world.js";
|
|
7
16
|
import { sweepInactiveAkumas } from "./akuma-retention.js";
|
|
8
17
|
import { callAkumas, forkAkumas } from "./akuma-creation.js";
|
|
9
|
-
import { requireInput } from "./input.js";
|
|
18
|
+
import { normalizedList, requireInput } from "./input.js";
|
|
10
19
|
import { askAkuma, historyAkuma, killAkuma, statusAkuma, tellAkuma, waitAkuma, } from "./selection.js";
|
|
11
20
|
export { AkumaAddressError, AkumaWorldScopeError } from "./address.js";
|
|
12
21
|
class AkumasHandle {
|
|
@@ -20,15 +29,35 @@ class AkumasHandle {
|
|
|
20
29
|
this.#reportDiagnostic = captureAkumaHostDiagnostic(host);
|
|
21
30
|
Object.freeze(this);
|
|
22
31
|
}
|
|
23
|
-
async
|
|
32
|
+
async akumaNames(input = {}) {
|
|
33
|
+
const values = requireInput(input, "Akumas.akumaNames input", ["home", "limit"]);
|
|
34
|
+
return listAkumaNameDefinitions({ ...values, cwd: this.#world });
|
|
35
|
+
}
|
|
36
|
+
async list(input = {}) {
|
|
37
|
+
const { repo, ...native } = requireInput(input, "Akumas.list input", ["repo", "akumaName", "caller", "limit"]);
|
|
38
|
+
if (repo !== undefined && !(repo instanceof Repo))
|
|
39
|
+
throw new KeiyakuError("invalid-input", "Akumas.list repo must be a Repo");
|
|
40
|
+
const selection = rosterInput(native, true);
|
|
41
|
+
const limit = boundedListLimit(native.limit);
|
|
42
|
+
const path = await World.prove(this.#world);
|
|
43
|
+
const [roster, aliases] = await Promise.all([
|
|
44
|
+
akumaRowsAt(path, limit, selection.akumaName, selection.caller),
|
|
45
|
+
aliasesAt(path),
|
|
46
|
+
]);
|
|
47
|
+
if (repo === undefined)
|
|
48
|
+
return joinedAkumas(roster, aliases, { kind: "absent" });
|
|
49
|
+
return withGitDecodeChannel(scopeForRepo(repo), (channel) => withGitReadObservation(scopeForRepo(repo), channel, async (observation) => joinedAkumas(roster, aliases, await dispatchesAt(observation))));
|
|
50
|
+
}
|
|
51
|
+
async aliases(input) {
|
|
52
|
+
const values = requireInput(input, "Akumas.aliases input", ["akumaIds"]);
|
|
53
|
+
if (!Array.isArray(values.akumaIds))
|
|
54
|
+
throw new KeiyakuError("invalid-input", "akumaIds must be an array");
|
|
55
|
+
const selected = new Set(normalizedList(values.akumaIds, "akumaIds", (value) => parseAkumaId(value).id));
|
|
24
56
|
const path = await World.prove(this.#world);
|
|
25
|
-
|
|
26
|
-
if (roster.rows.length === 0)
|
|
27
|
-
return roster;
|
|
28
|
-
return withRosterAliases(roster, await readAliases(path));
|
|
57
|
+
return (await readAliases(path)).filter((binding) => selected.has(binding.akumaId));
|
|
29
58
|
}
|
|
30
|
-
|
|
31
|
-
const pending = callAkumas(this.withWorld(input, "Akumas.
|
|
59
|
+
spawn(input) {
|
|
60
|
+
const pending = callAkumas(this.withWorld(input, "Akumas.spawn input"), this.#spawn, this.#reportDiagnostic);
|
|
32
61
|
return pending.then(async (result) => {
|
|
33
62
|
await this.maintain(this.#world);
|
|
34
63
|
return result;
|
|
@@ -37,7 +66,7 @@ class AkumasHandle {
|
|
|
37
66
|
fork(input) {
|
|
38
67
|
const pending = forkAkumas(this.withWorld(input, "Akumas.fork input"), this.#spawn);
|
|
39
68
|
return pending.then(async (result) => {
|
|
40
|
-
if (
|
|
69
|
+
if ("childAkumaId" in result)
|
|
41
70
|
await this.maintain(this.#world);
|
|
42
71
|
return result;
|
|
43
72
|
});
|
|
@@ -46,7 +75,7 @@ class AkumasHandle {
|
|
|
46
75
|
return statusAkuma(this.withWorld(input, "Akumas.status input"), this.#reportDiagnostic);
|
|
47
76
|
}
|
|
48
77
|
tell(input) {
|
|
49
|
-
return tellAkuma(this.withWorld(input, "Akumas.tell input"), this.#spawn);
|
|
78
|
+
return tellAkuma(this.withWorld(input, "Akumas.tell input"), this.#spawn, this.#reportDiagnostic);
|
|
50
79
|
}
|
|
51
80
|
ask(input) {
|
|
52
81
|
return askAkuma(this.withWorld(input, "Akumas.ask input"), this.#spawn, this.#reportDiagnostic);
|
|
@@ -92,30 +121,85 @@ class AkumasHandle {
|
|
|
92
121
|
withWorld(input, label) {
|
|
93
122
|
const values = requireInput(input, label);
|
|
94
123
|
if (Object.hasOwn(values, "path"))
|
|
95
|
-
throw new
|
|
124
|
+
throw new KeiyakuError("invalid-input", `${label} does not accept path; select World with Akumas.of`);
|
|
96
125
|
return { ...values, path: this.#world };
|
|
97
126
|
}
|
|
98
127
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
|
|
128
|
+
export function diagnostic(error) {
|
|
129
|
+
const source = error instanceof Error ? error.message : String(error);
|
|
130
|
+
const line = source.replaceAll(/\s+/gu, " ").trim();
|
|
131
|
+
return line.length <= 240 ? line : `${line.slice(0, 239)}…`;
|
|
132
|
+
}
|
|
133
|
+
export async function aliasesAt(world) {
|
|
134
|
+
if (world === null)
|
|
135
|
+
return { kind: "absent" };
|
|
136
|
+
try {
|
|
137
|
+
return { kind: "present", value: await readAliases(world) };
|
|
138
|
+
}
|
|
139
|
+
catch (error) {
|
|
140
|
+
return { kind: "failed", failure: { message: diagnostic(error) } };
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
export async function dispatchesAt(observation) {
|
|
144
|
+
try {
|
|
145
|
+
return { kind: "present", value: await readDispatchesAt(observation) };
|
|
146
|
+
}
|
|
147
|
+
catch (error) {
|
|
148
|
+
return { kind: "failed", failure: { message: diagnostic(error) } };
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
/** Shared catalogue projection; World bounds snapshots by original roster position. */
|
|
152
|
+
export async function akumaRowsAt(world, limit, name, caller, snapshotRows = 0) {
|
|
153
|
+
const source = await observeAkumaRoster(world, limit, name, caller);
|
|
154
|
+
const rows = await boundedMap([...(source.rows ?? []).entries()], async ([index, row]) => {
|
|
155
|
+
if (row.kind === "unborn") {
|
|
156
|
+
const { kind: _kind, ...summary } = row;
|
|
157
|
+
return summary;
|
|
158
|
+
}
|
|
159
|
+
const { kind: _kind, caller, ...facts } = row;
|
|
160
|
+
const summary = { ...facts, ...(caller?.kind === "akuma" ? { parentAkumaId: caller.akumaId } : {}) };
|
|
161
|
+
if (index >= snapshotRows)
|
|
162
|
+
return summary;
|
|
163
|
+
try {
|
|
164
|
+
return { ...summary, work: projectCurrentWork(await readAkumaTimeline(world, row.id)) };
|
|
165
|
+
}
|
|
166
|
+
catch (error) {
|
|
167
|
+
return { ...summary, work: { kind: "unavailable", diagnostic: diagnostic(error) } };
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
return { ...source, kind: "akuma-catalogue", ...(rows.length === 0 ? {} : { rows }) };
|
|
171
|
+
}
|
|
172
|
+
export function joinedAkumas(product, aliases, dispatches) {
|
|
173
|
+
const byId = new Map(dispatches.kind === "present" ? dispatches.value.map((item) => [item.akumaId, item]) : []);
|
|
174
|
+
const rows = (product.rows ?? []).map((row) => {
|
|
175
|
+
const dispatch = byId.get(row.id);
|
|
176
|
+
const names = aliases.kind === "present"
|
|
177
|
+
? aliases.value.filter((binding) => binding.akumaId === row.id).map((binding) => binding.alias)
|
|
178
|
+
: [];
|
|
179
|
+
return {
|
|
180
|
+
...row,
|
|
181
|
+
...(names.length === 0 ? {} : { aliases: names }),
|
|
182
|
+
...(dispatches.kind === "failed"
|
|
183
|
+
? { contract: { kind: "unavailable" } }
|
|
184
|
+
: dispatch === undefined
|
|
185
|
+
? {}
|
|
186
|
+
: { contract: { kind: "associated", contractId: dispatch.contractId } }),
|
|
187
|
+
};
|
|
188
|
+
});
|
|
189
|
+
return {
|
|
190
|
+
...product,
|
|
191
|
+
...(rows.length === 0 ? {} : { rows }),
|
|
192
|
+
...(aliases.kind === "failed" ? { aliasesError: aliases.failure.message } : {}),
|
|
193
|
+
};
|
|
111
194
|
}
|
|
112
195
|
/** Internal host composition for an explicitly owned launcher. */
|
|
113
196
|
export function akumasWithLauncher(world, spawn, host) {
|
|
114
197
|
if (typeof world !== "string")
|
|
115
|
-
throw new
|
|
198
|
+
throw new KeiyakuError("invalid-input", "Akumas.of world must be a WorldRoot");
|
|
116
199
|
return new AkumasHandle(world, spawn, host);
|
|
117
200
|
}
|
|
118
201
|
export const Akumas = Object.freeze({
|
|
202
|
+
akumaNames: listAkumaNameDefinitions,
|
|
119
203
|
of(world, host) {
|
|
120
204
|
const { spawn, reportDiagnostic } = captureAkumaHost(host);
|
|
121
205
|
return akumasWithLauncher(world, spawn, reportDiagnostic === undefined ? undefined : { reportDiagnostic });
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { decodeContractDocument } from "../body/decode.js";
|
|
2
|
-
import { type
|
|
2
|
+
import { type ContractId } from "../core/facts/types.js";
|
|
3
3
|
import type { GitDecodeChannel } from "../git/read-observation.js";
|
|
4
|
-
import { type BindTargetSelection } from "../protocol/bind.js";
|
|
5
|
-
import { type
|
|
4
|
+
import { bindOperation, type BindTargetSelection } from "../protocol/bind.js";
|
|
5
|
+
import { type RepositoryScope } from "../protocol/operations.js";
|
|
6
6
|
import type { ProtocolProgress } from "../protocol/progress.js";
|
|
7
7
|
import type { DebtId } from "../debt/identity.js";
|
|
8
|
-
import type { ForkSourceRefusal
|
|
8
|
+
import type { ForkSourceRefusal } from "./refusal.js";
|
|
9
9
|
type ForkBindAdmission = Readonly<{
|
|
10
10
|
kind: "document";
|
|
11
11
|
document: ReturnType<typeof decodeContractDocument>;
|
|
12
|
-
admission:
|
|
13
|
-
contractId: ContractId;
|
|
14
|
-
}>, OperationRefusals["bind"]>;
|
|
12
|
+
admission: Awaited<ReturnType<typeof bindOperation>>;
|
|
15
13
|
}>;
|
|
16
14
|
/**
|
|
17
15
|
* A legally non-forkable source is an expected refusal; corrupt persisted authority for a source that
|
|
@@ -23,7 +21,6 @@ export declare function admitForkBindWithAppointment(input: Readonly<{
|
|
|
23
21
|
sourceId: ContractId;
|
|
24
22
|
target?: string | null;
|
|
25
23
|
progress?: ProtocolProgress;
|
|
26
|
-
actor?: ActorId;
|
|
27
24
|
}>): Promise<Readonly<{
|
|
28
25
|
kind: "refused";
|
|
29
26
|
refusal: ForkSourceRefusal;
|
|
@@ -34,81 +31,55 @@ export declare function prepareMarkdownBind(input: Readonly<{
|
|
|
34
31
|
document: ReturnType<typeof decodeContractDocument>;
|
|
35
32
|
gates: readonly import("../core/facts/types.js").Gate[];
|
|
36
33
|
after: readonly ContractId[];
|
|
37
|
-
workspace: "worktree";
|
|
38
34
|
targetSelection: BindTargetSelection;
|
|
39
35
|
debt?: DebtId;
|
|
40
36
|
progress?: ProtocolProgress;
|
|
41
|
-
actor?: ActorId;
|
|
42
37
|
}>): Promise<{
|
|
43
38
|
admission: (Readonly<{
|
|
44
39
|
kind: "completed";
|
|
45
|
-
result: IntentOutcome<Readonly<{
|
|
40
|
+
result: import("../protocol/outcome.js").IntentOutcome<Readonly<{
|
|
46
41
|
contractId: ContractId;
|
|
47
|
-
}>, {
|
|
42
|
+
}>, Readonly<{
|
|
48
43
|
kind: "target-workspace-unavailable";
|
|
49
44
|
contractId: ContractId;
|
|
50
|
-
reason: "
|
|
51
|
-
} | {
|
|
52
|
-
kind: "target-missing" | "unborn-head" | "invalid-target";
|
|
53
|
-
} | {
|
|
54
|
-
kind: "fork-source-moved";
|
|
55
|
-
contractId: ContractId;
|
|
56
|
-
} | {
|
|
57
|
-
kind: "target-contract-missing" | "target-contract-terminal" | "target-contract-self" | "contract-exists" | "invalid-after" | "unknown-prerequisite";
|
|
58
|
-
contractId: ContractId;
|
|
59
|
-
} | {
|
|
45
|
+
reason: "unappointed" | "missing" | "association" | "replaced" | "attached" | "uncommitted" | "operation";
|
|
46
|
+
}> | Readonly<{
|
|
60
47
|
kind: "verification-declaration-invalid";
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}>;
|
|
48
|
+
}> | Readonly<{
|
|
49
|
+
kind: "target-missing" | "invalid-target" | "unborn-head";
|
|
50
|
+
}> | Readonly<{
|
|
51
|
+
kind: "fork-source-moved";
|
|
52
|
+
}> | import("../protocol/bind.js").BindRefusal>;
|
|
66
53
|
}> | Readonly<{
|
|
67
54
|
kind: "accepted-release-failed";
|
|
68
|
-
result: IntentOutcome<Readonly<{
|
|
55
|
+
result: import("../protocol/outcome.js").IntentOutcome<Readonly<{
|
|
69
56
|
contractId: ContractId;
|
|
70
|
-
}>, {
|
|
57
|
+
}>, Readonly<{
|
|
71
58
|
kind: "target-workspace-unavailable";
|
|
72
59
|
contractId: ContractId;
|
|
73
|
-
reason: "
|
|
74
|
-
} | {
|
|
75
|
-
kind: "target-missing" | "unborn-head" | "invalid-target";
|
|
76
|
-
} | {
|
|
77
|
-
kind: "fork-source-moved";
|
|
78
|
-
contractId: ContractId;
|
|
79
|
-
} | {
|
|
80
|
-
kind: "target-contract-missing" | "target-contract-terminal" | "target-contract-self" | "contract-exists" | "invalid-after" | "unknown-prerequisite";
|
|
81
|
-
contractId: ContractId;
|
|
82
|
-
} | {
|
|
60
|
+
reason: "unappointed" | "missing" | "association" | "replaced" | "attached" | "uncommitted" | "operation";
|
|
61
|
+
}> | Readonly<{
|
|
83
62
|
kind: "verification-declaration-invalid";
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}>;
|
|
63
|
+
}> | Readonly<{
|
|
64
|
+
kind: "target-missing" | "invalid-target" | "unborn-head";
|
|
65
|
+
}> | Readonly<{
|
|
66
|
+
kind: "fork-source-moved";
|
|
67
|
+
}> | import("../protocol/bind.js").BindRefusal>;
|
|
89
68
|
debtId: DebtId;
|
|
90
69
|
diagnostic: string;
|
|
91
70
|
}>) | null;
|
|
92
|
-
result: IntentOutcome<Readonly<{
|
|
71
|
+
result: import("../protocol/outcome.js").IntentOutcome<Readonly<{
|
|
93
72
|
contractId: ContractId;
|
|
94
|
-
}>, {
|
|
73
|
+
}>, Readonly<{
|
|
95
74
|
kind: "target-workspace-unavailable";
|
|
96
75
|
contractId: ContractId;
|
|
97
|
-
reason: "
|
|
98
|
-
} | {
|
|
99
|
-
kind: "target-missing" | "unborn-head" | "invalid-target";
|
|
100
|
-
} | {
|
|
101
|
-
kind: "fork-source-moved";
|
|
102
|
-
contractId: ContractId;
|
|
103
|
-
} | {
|
|
104
|
-
kind: "target-contract-missing" | "target-contract-terminal" | "target-contract-self" | "contract-exists" | "invalid-after" | "unknown-prerequisite";
|
|
105
|
-
contractId: ContractId;
|
|
106
|
-
} | {
|
|
76
|
+
reason: "unappointed" | "missing" | "association" | "replaced" | "attached" | "uncommitted" | "operation";
|
|
77
|
+
}> | Readonly<{
|
|
107
78
|
kind: "verification-declaration-invalid";
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}>;
|
|
79
|
+
}> | Readonly<{
|
|
80
|
+
kind: "target-missing" | "invalid-target" | "unborn-head";
|
|
81
|
+
}> | Readonly<{
|
|
82
|
+
kind: "fork-source-moved";
|
|
83
|
+
}> | import("../protocol/bind.js").BindRefusal>;
|
|
113
84
|
}>;
|
|
114
85
|
export {};
|
|
@@ -8,6 +8,7 @@ import { fitIdentityStemWords, normalizeIdentityStem } from "../identity/normali
|
|
|
8
8
|
import { bindOperation } from "../protocol/bind.js";
|
|
9
9
|
import { stateOperation } from "../protocol/operations.js";
|
|
10
10
|
import { admitWithDebtHolderFence, claimDebtHolder } from "../settlement/holder.js";
|
|
11
|
+
import { gitObjectIdForSnapshot } from "../git/identity.js";
|
|
11
12
|
import { KeiyakuError } from "./outcome.js";
|
|
12
13
|
import { contractTerms, documentDerivation } from "./input.js";
|
|
13
14
|
const CONTRACT_ID_CODE_POINTS = 32;
|
|
@@ -33,7 +34,6 @@ async function attempt(input, id) {
|
|
|
33
34
|
channel: input.channel,
|
|
34
35
|
terms: input.terms,
|
|
35
36
|
verification: input.verification,
|
|
36
|
-
workspace: input.workspace,
|
|
37
37
|
targetSelection: input.targetSelection,
|
|
38
38
|
...(input.coordinates === undefined ? {} : { coordinates: input.coordinates }),
|
|
39
39
|
...(input.source === undefined ? {} : { source: input.source }),
|
|
@@ -43,7 +43,6 @@ async function attempt(input, id) {
|
|
|
43
43
|
: {
|
|
44
44
|
decorateOffer: ({ contractId: owner }) => [claimDebtHolder(input.debt, owner)],
|
|
45
45
|
}),
|
|
46
|
-
...(input.actor === undefined ? {} : { actor: input.actor }),
|
|
47
46
|
...(input.progress === undefined ? {} : { progress: input.progress }),
|
|
48
47
|
});
|
|
49
48
|
}
|
|
@@ -67,16 +66,17 @@ async function attemptCandidates(input) {
|
|
|
67
66
|
export async function admitForkBindWithAppointment(input) {
|
|
68
67
|
const missing = () => ({
|
|
69
68
|
kind: "refused",
|
|
70
|
-
refusal: { kind: "fork-source-missing"
|
|
69
|
+
refusal: { kind: "fork-source-missing" },
|
|
71
70
|
});
|
|
72
71
|
let source = await stateOperation({ scope: input.scope, channel: input.channel, contractId: input.sourceId });
|
|
73
72
|
if (source === null)
|
|
74
73
|
return missing();
|
|
75
|
-
const
|
|
74
|
+
const sourceOid = gitObjectIdForSnapshot(source.coordinates.start);
|
|
75
|
+
const sourceObject = (await input.channel.readObjects([sourceOid])).get(sourceOid);
|
|
76
76
|
if (sourceObject === undefined)
|
|
77
77
|
throw new Error(`missing fork source object observation: ${input.sourceId}`);
|
|
78
78
|
if (sourceObject.kind !== "present" || sourceObject.type !== "commit") {
|
|
79
|
-
return { kind: "refused", refusal: { kind: "fork-source-unavailable"
|
|
79
|
+
return { kind: "refused", refusal: { kind: "fork-source-unavailable" } };
|
|
80
80
|
}
|
|
81
81
|
const currentSource = await stateOperation({
|
|
82
82
|
scope: input.scope,
|
|
@@ -87,7 +87,7 @@ export async function admitForkBindWithAppointment(input) {
|
|
|
87
87
|
currentSource.head !== source.head ||
|
|
88
88
|
currentSource.coordinates.start !== source.coordinates.start ||
|
|
89
89
|
currentSource.terms.document.key !== source.terms.document.key) {
|
|
90
|
-
return { kind: "refused", refusal: { kind: "fork-source-moved"
|
|
90
|
+
return { kind: "refused", refusal: { kind: "fork-source-moved" } };
|
|
91
91
|
}
|
|
92
92
|
source = currentSource;
|
|
93
93
|
let sourceDocument;
|
|
@@ -109,8 +109,7 @@ export async function admitForkBindWithAppointment(input) {
|
|
|
109
109
|
channel: input.channel,
|
|
110
110
|
title: document.title,
|
|
111
111
|
terms,
|
|
112
|
-
verification: documentDerivation(document
|
|
113
|
-
workspace: "worktree",
|
|
112
|
+
verification: documentDerivation(document).verification,
|
|
114
113
|
targetSelection: forkTargetSelection(input.target, source.coordinates.target),
|
|
115
114
|
coordinates: { start: source.coordinates.start },
|
|
116
115
|
source: {
|
|
@@ -119,7 +118,6 @@ export async function admitForkBindWithAppointment(input) {
|
|
|
119
118
|
start: source.coordinates.start,
|
|
120
119
|
document: source.terms.document.key,
|
|
121
120
|
},
|
|
122
|
-
...(input.actor === undefined ? {} : { actor: input.actor }),
|
|
123
121
|
...(input.progress === undefined ? {} : { progress: input.progress }),
|
|
124
122
|
});
|
|
125
123
|
return { kind: "document", admission, document };
|
|
@@ -131,11 +129,9 @@ export async function prepareMarkdownBind(input) {
|
|
|
131
129
|
channel: input.channel,
|
|
132
130
|
title: input.document.title,
|
|
133
131
|
terms,
|
|
134
|
-
verification: documentDerivation(input.document
|
|
135
|
-
workspace: input.workspace,
|
|
132
|
+
verification: documentDerivation(input.document).verification,
|
|
136
133
|
targetSelection: input.targetSelection,
|
|
137
134
|
...(input.debt === undefined ? {} : { debt: input.debt }),
|
|
138
|
-
...(input.actor === undefined ? {} : { actor: input.actor }),
|
|
139
135
|
...(input.progress === undefined ? {} : { progress: input.progress }),
|
|
140
136
|
});
|
|
141
137
|
const admission = input.debt === undefined ? null : await admitWithDebtHolderFence(input.scope, input.debt, admitCandidate);
|