@astrosheep/keiyaku 4.6.31 → 4.6.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -23
- package/build/plugins/claude/skills/keiyaku-akuma/SKILL.md +24 -15
- package/build/plugins/claude/skills/keiyaku-babysit/SKILL.md +12 -8
- package/build/plugins/claude/skills/keiyaku-bind/SKILL.md +4 -3
- package/build/plugins/claude/skills/keiyaku-debt/SKILL.md +17 -17
- package/build/plugins/claude/skills/keiyaku-workflow/SKILL.md +6 -4
- package/build/plugins/codex/skills/keiyaku-akuma/SKILL.md +24 -15
- package/build/plugins/codex/skills/keiyaku-babysit/SKILL.md +12 -8
- package/build/plugins/codex/skills/keiyaku-bind/SKILL.md +4 -3
- package/build/plugins/codex/skills/keiyaku-debt/SKILL.md +17 -17
- package/build/plugins/codex/skills/keiyaku-workflow/SKILL.md +6 -4
- package/build/plugins/opencode/skills/keiyaku-akuma/SKILL.md +24 -15
- package/build/plugins/opencode/skills/keiyaku-babysit/SKILL.md +12 -8
- package/build/plugins/opencode/skills/keiyaku-bind/SKILL.md +4 -3
- package/build/plugins/opencode/skills/keiyaku-debt/SKILL.md +17 -17
- package/build/plugins/opencode/skills/keiyaku-workflow/SKILL.md +6 -4
- package/build/plugins/pi/README.md +53 -97
- package/build/plugins/pi/keiyaku.ts +10 -6
- package/build/skills/keiyaku-akuma/SKILL.md +24 -15
- package/build/skills/keiyaku-babysit/SKILL.md +12 -8
- package/build/skills/keiyaku-bind/SKILL.md +4 -3
- package/build/skills/keiyaku-debt/SKILL.md +17 -17
- package/build/skills/keiyaku-workflow/SKILL.md +6 -4
- package/build/src/akuma/akuma-call.d.ts +3 -5
- package/build/src/akuma/akuma-call.js +7 -10
- package/build/src/akuma/akuma-errors.d.ts +7 -4
- package/build/src/akuma/akuma-errors.js +16 -12
- package/build/src/akuma/akuma-instance.d.ts +50 -303
- package/build/src/akuma/akuma-instance.js +48 -49
- package/build/src/akuma/akuma-observe.d.ts +5 -4
- package/build/src/akuma/akuma-observe.js +74 -21
- package/build/src/akuma/akuma-owner.d.ts +14 -6
- package/build/src/akuma/akuma-owner.js +33 -27
- package/build/src/akuma/akuma-selection-execution.d.ts +97 -19
- package/build/src/akuma/akuma-selection-execution.js +79 -133
- package/build/src/akuma/akuma-wait.d.ts +43 -4
- package/build/src/akuma/akuma-wait.js +58 -29
- package/build/src/akuma/akuma.d.ts +58 -384
- package/build/src/akuma/akuma.js +8 -58
- package/build/src/akuma/archetype.d.ts +16 -19
- package/build/src/akuma/archetype.js +48 -49
- package/build/src/akuma/body.js +44 -44
- package/build/src/akuma/call-initial-tell.d.ts +4 -2
- package/build/src/akuma/call-initial-tell.js +9 -2
- package/build/src/akuma/call-input.d.ts +8 -1
- package/build/src/akuma/call-input.js +27 -18
- package/build/src/akuma/caller.js +2 -1
- package/build/src/akuma/detached-body.js +1 -1
- package/build/src/akuma/heart/activity-schema.d.ts +16 -0
- package/build/src/akuma/heart/activity-schema.js +7 -0
- package/build/src/akuma/heart/facts.d.ts +5 -4
- package/build/src/akuma/heart/facts.js +5 -5
- package/build/src/akuma/heart/index.d.ts +1 -1
- package/build/src/akuma/heart/index.js +9 -1
- package/build/src/akuma/heart/soul.js +20 -4
- package/build/src/akuma/heart/timeline.js +4 -4
- package/build/src/akuma/identity.d.ts +1 -1
- package/build/src/akuma/identity.js +9 -4
- package/build/src/akuma/index.d.ts +6 -7
- package/build/src/akuma/index.js +2 -3
- package/build/src/akuma/projection-read.d.ts +4 -2
- package/build/src/akuma/projection-read.js +21 -14
- package/build/src/akuma/projection.d.ts +97 -2
- package/build/src/akuma/projection.js +47 -47
- package/build/src/akuma/provider-recipe.js +3 -2
- package/build/src/akuma/provider.d.ts +2 -2
- package/build/src/akuma/provider.js +27 -20
- package/build/src/akuma/providers/acp/config.js +11 -10
- package/build/src/akuma/providers/acp/core.js +2 -5
- package/build/src/akuma/providers/acp/index.js +2 -1
- package/build/src/akuma/providers/codex-app-server/index.js +7 -1
- package/build/src/akuma/providers/grok-build/index.js +2 -1
- package/build/src/akuma/providers/index.d.ts +0 -1
- package/build/src/akuma/providers/index.js +0 -8
- package/build/src/akuma/providers/opencode-sdk/events.d.ts +2 -1
- package/build/src/akuma/providers/opencode-sdk/events.js +31 -1
- package/build/src/akuma/providers/paseo/index.js +7 -4
- package/build/src/akuma/providers/pi/index.js +4 -3
- package/build/src/akuma/publication.d.ts +1 -2
- package/build/src/akuma/publication.js +19 -16
- package/build/src/akuma/schema.d.ts +3 -49
- package/build/src/akuma/schema.js +6 -147
- package/build/src/akuma/selection-observation.d.ts +304 -240
- package/build/src/akuma/selection-observation.js +135 -70
- package/build/src/akuma/status-projection.d.ts +61 -284
- package/build/src/akuma/status-projection.js +216 -138
- package/build/src/akuma/turn-drive.js +21 -15
- package/build/src/body/amend.js +7 -18
- package/build/src/body/arc.js +3 -2
- package/build/src/body/criteria.js +4 -3
- package/build/src/body/decode.js +13 -2
- package/build/src/body/envelope.d.ts +5 -1
- package/build/src/body/envelope.js +6 -3
- package/build/src/body/region.d.ts +1 -3
- package/build/src/body/region.js +3 -8
- package/build/src/body/render.js +4 -6
- package/build/src/body-host.d.ts +4 -11
- package/build/src/body-host.js +5 -4
- package/build/src/bounded-list.js +2 -1
- package/build/src/cli/commands/akuma-grammar.d.ts +107 -66
- package/build/src/cli/commands/akuma-grammar.js +66 -104
- package/build/src/cli/commands/akuma.d.ts +7 -3
- package/build/src/cli/commands/akuma.js +49 -160
- package/build/src/cli/commands/contract-grammar.d.ts +4 -135
- package/build/src/cli/commands/contract-grammar.js +126 -223
- package/build/src/cli/commands/contract-help.d.ts +26 -22
- package/build/src/cli/commands/contract-help.js +52 -38
- package/build/src/cli/commands/contract.d.ts +6 -18
- package/build/src/cli/commands/contract.js +68 -272
- package/build/src/cli/commands/debt-grammar.d.ts +2 -4
- package/build/src/cli/commands/debt-grammar.js +23 -193
- package/build/src/cli/commands/debt.js +10 -87
- package/build/src/cli/commands/report.d.ts +2 -4
- package/build/src/cli/coordinates.d.ts +1 -1
- package/build/src/cli/coordinates.js +1 -1
- package/build/src/cli/main.js +9 -3
- package/build/src/cli/parse.d.ts +80 -3
- package/build/src/cli/parse.js +76 -19
- package/build/src/cli/render/akuma-activity.d.ts +18 -35
- package/build/src/cli/render/akuma-activity.js +141 -290
- package/build/src/cli/render/akuma.d.ts +2 -8
- package/build/src/cli/render/akuma.js +50 -65
- package/build/src/cli/render/catalog.d.ts +2 -5
- package/build/src/cli/render/catalog.js +3 -37
- package/build/src/cli/render/contract-history.js +3 -2
- package/build/src/cli/render/contract-observation.d.ts +2 -8
- package/build/src/cli/render/contract-observation.js +25 -4
- package/build/src/cli/render/contract-wait.d.ts +2 -2
- package/build/src/cli/render/contract-wait.js +13 -17
- package/build/src/cli/render/contract.d.ts +7 -9
- package/build/src/cli/render/contract.js +46 -72
- package/build/src/cli/render/debt.d.ts +3 -11
- package/build/src/cli/render/debt.js +17 -89
- package/build/src/cli/render/delivery-preview.js +4 -4
- package/build/src/cli/render/execution-progress.js +1 -3
- package/build/src/cli/render/kanshi-akuma.d.ts +5 -3
- package/build/src/cli/render/kanshi-akuma.js +23 -20
- package/build/src/cli/render/kanshi.d.ts +1 -3
- package/build/src/cli/render/kanshi.js +27 -56
- package/build/src/cli/render/receipt.d.ts +21 -12
- package/build/src/cli/render/receipt.js +78 -68
- package/build/src/cli/render/reconcile.js +2 -5
- package/build/src/cli/render/refusal.d.ts +4 -3
- package/build/src/cli/render/refusal.js +17 -22
- package/build/src/cli/render/settings.d.ts +1 -1
- package/build/src/cli/render/terminal.d.ts +11 -12
- package/build/src/cli/render/terminal.js +53 -44
- package/build/src/cli/render/verbs.d.ts +4 -1
- package/build/src/cli/render/verbs.js +88 -128
- package/build/src/cli/runtime.js +65 -70
- package/build/src/cli/streams.d.ts +2 -9
- package/build/src/cli/streams.js +8 -1
- package/build/src/cli/usage.d.ts +2 -1
- package/build/src/cli/usage.js +3 -2
- package/build/src/contract-worktree.js +2 -10
- package/build/src/core/facts/codec.js +16 -25
- package/build/src/core/facts/eligibility.d.ts +4 -4
- package/build/src/core/facts/eligibility.js +11 -0
- package/build/src/core/facts/errors.d.ts +2 -1
- package/build/src/core/facts/errors.js +3 -3
- package/build/src/core/facts/fold.js +9 -5
- package/build/src/core/facts/gate.d.ts +5 -1
- package/build/src/core/facts/gate.js +14 -10
- package/build/src/core/facts/types.d.ts +7 -14
- package/build/src/core/facts/types.js +8 -6
- package/build/src/core/subject.d.ts +4 -1
- package/build/src/core/subject.js +10 -2
- package/build/src/core/verbs/abandon.d.ts +1 -2
- package/build/src/core/verbs/amend.d.ts +16 -6
- package/build/src/core/verbs/amend.js +19 -9
- package/build/src/core/verbs/arc.d.ts +1 -2
- package/build/src/core/verbs/attestation.d.ts +1 -2
- package/build/src/core/verbs/bind.d.ts +1 -2
- package/build/src/core/verbs/deliver.d.ts +1 -2
- package/build/src/core/verbs/placement.d.ts +1 -2
- package/build/src/core/verbs/reintegrate.d.ts +1 -2
- package/build/src/debt/board.d.ts +14 -94
- package/build/src/debt/board.js +25 -160
- package/build/src/debt/catalog.d.ts +0 -2
- package/build/src/debt/catalog.js +1 -22
- package/build/src/debt/document.d.ts +8 -11
- package/build/src/debt/document.js +19 -62
- package/build/src/debt/identity.d.ts +2 -14
- package/build/src/debt/identity.js +19 -49
- package/build/src/debt/index.d.ts +81 -220
- package/build/src/debt/index.js +61 -115
- package/build/src/debt/input.d.ts +21 -6
- package/build/src/debt/input.js +56 -180
- package/build/src/debt/lifecycle-operations.d.ts +1 -3
- package/build/src/debt/lifecycle-operations.js +1 -73
- package/build/src/debt/operation-types.d.ts +24 -128
- package/build/src/debt/operation-types.js +6 -62
- package/build/src/debt/operations.d.ts +8 -17
- package/build/src/debt/operations.js +58 -154
- package/build/src/debt/store.d.ts +0 -2
- package/build/src/debt/store.js +32 -87
- package/build/src/dispatch/index.d.ts +0 -17
- package/build/src/dispatch/index.js +1 -10
- package/build/src/errors.d.ts +28 -0
- package/build/src/errors.js +26 -0
- package/build/src/git/hooks.d.ts +1 -1
- package/build/src/git/identity.js +16 -45
- package/build/src/git/nuke.js +13 -23
- package/build/src/git/observe.d.ts +6 -0
- package/build/src/git/observe.js +40 -24
- package/build/src/git/process.js +11 -18
- package/build/src/git/read-observation.d.ts +5 -4
- package/build/src/git/reconcile.d.ts +3 -16
- package/build/src/git/reconcile.js +0 -18
- package/build/src/git/repository.d.ts +4 -1
- package/build/src/git/repository.js +16 -4
- package/build/src/git/scratch.js +2 -14
- package/build/src/git/target-placement.d.ts +4 -4
- package/build/src/git/target.d.ts +2 -2
- package/build/src/git/tender.d.ts +1 -2
- package/build/src/git/tender.js +5 -12
- package/build/src/git/terminal-reconcile.js +1 -13
- package/build/src/identity/coordinates.d.ts +1 -1
- package/build/src/identity/coordinates.js +3 -2
- package/build/src/identity/normalize.js +2 -1
- package/build/src/identity/selector.js +4 -3
- package/build/src/index.d.ts +36 -57
- package/build/src/index.js +11 -36
- package/build/src/kanshi/counts.d.ts +3 -8
- package/build/src/kanshi/counts.js +6 -14
- package/build/src/kanshi/index.d.ts +21 -7
- package/build/src/kanshi/index.js +29 -4
- package/build/src/kanshi/read.d.ts +101 -269
- package/build/src/kanshi/read.js +41 -200
- package/build/src/kanshi/report.d.ts +443 -1628
- package/build/src/kanshi/report.js +19 -31
- package/build/src/library/address.d.ts +20 -13
- package/build/src/library/address.js +48 -55
- package/build/src/library/akuma-creation.d.ts +249 -79
- package/build/src/library/akuma-creation.js +200 -247
- package/build/src/library/akumas.d.ts +24 -5
- package/build/src/library/akumas.js +96 -29
- package/build/src/library/bind.d.ts +7 -10
- package/build/src/library/bind.js +2 -8
- package/build/src/library/continuation.d.ts +151 -231
- package/build/src/library/continuation.js +22 -31
- package/build/src/library/contract-address.d.ts +6 -9
- package/build/src/library/contract-address.js +11 -16
- package/build/src/library/contract-composition.d.ts +2 -3
- package/build/src/library/contract-composition.js +12 -19
- package/build/src/library/contract-creation.js +35 -37
- package/build/src/library/contract-outcomes.d.ts +1349 -806
- package/build/src/library/contract-outcomes.js +12 -37
- package/build/src/library/contract-settings.d.ts +1 -2
- package/build/src/library/contract-settings.js +5 -7
- package/build/src/library/contract-types.d.ts +60 -67
- package/build/src/library/contract-types.js +17 -56
- package/build/src/library/contract-wait.d.ts +47 -3
- package/build/src/library/contract-wait.js +81 -70
- package/build/src/library/delivery.d.ts +391 -389
- package/build/src/library/delivery.js +5 -25
- package/build/src/library/input.d.ts +13 -5
- package/build/src/library/input.js +43 -38
- package/build/src/library/invocation.d.ts +13 -11
- package/build/src/library/invocation.js +69 -58
- package/build/src/library/kei.d.ts +16 -8
- package/build/src/library/kei.js +484 -25
- package/build/src/library/keiyaku-attribution.d.ts +0 -8
- package/build/src/library/keiyaku-attribution.js +0 -11
- package/build/src/library/keiyaku-classify.d.ts +2 -2
- package/build/src/library/keiyaku-classify.js +43 -62
- package/build/src/library/keiyaku-coordinates.d.ts +3 -8
- package/build/src/library/keiyaku-coordinates.js +6 -26
- package/build/src/library/keiyaku-debt.d.ts +21 -93
- package/build/src/library/keiyaku-debt.js +9 -159
- package/build/src/library/keiyaku-identity.d.ts +3 -3
- package/build/src/library/keiyaku-identity.js +16 -10
- package/build/src/library/keiyaku-verbs.d.ts +4102 -4889
- package/build/src/library/keiyaku-verbs.js +317 -291
- package/build/src/library/keiyaku-wait.d.ts +183 -0
- package/build/src/library/keiyaku-wait.js +213 -0
- package/build/src/library/keiyaku.d.ts +32 -860
- package/build/src/library/keiyaku.js +203 -314
- package/build/src/library/model-tools.d.ts +556 -0
- package/build/src/library/model-tools.js +347 -0
- package/build/src/library/nuke.d.ts +4 -2
- package/build/src/library/nuke.js +5 -1
- package/build/src/library/outcome.d.ts +424 -307
- package/build/src/library/outcome.js +166 -362
- package/build/src/library/reconcile.d.ts +331 -143
- package/build/src/library/reconcile.js +38 -72
- package/build/src/library/refusal.d.ts +45 -29
- package/build/src/library/refusal.js +5 -16
- package/build/src/library/repo.js +4 -3
- package/build/src/library/selection.d.ts +44 -21
- package/build/src/library/selection.js +63 -88
- package/build/src/mcp/adapter.js +37 -51
- package/build/src/mcp/description.d.ts +2 -0
- package/build/src/mcp/description.js +2 -0
- package/build/src/mcp/help.d.ts +1 -1
- package/build/src/mcp/help.js +16 -9
- package/build/src/pi/index.d.ts +3 -0
- package/build/src/pi/index.js +83 -0
- package/build/src/plugin/public.d.ts +4 -0
- package/build/src/plugin/runtime.d.ts +1 -1
- package/build/src/plugin/runtime.js +2 -2
- package/build/src/protocol/amend.d.ts +15 -4
- package/build/src/protocol/amend.js +114 -47
- package/build/src/protocol/bind.d.ts +5 -7
- package/build/src/protocol/bind.js +8 -19
- package/build/src/protocol/completion.d.ts +188 -195
- package/build/src/protocol/completion.js +63 -24
- package/build/src/protocol/deliver.d.ts +11 -6
- package/build/src/protocol/deliver.js +37 -50
- package/build/src/protocol/delivery-preview.d.ts +18 -11
- package/build/src/protocol/delivery-preview.js +2 -2
- package/build/src/protocol/execution-observation.d.ts +13 -13
- package/build/src/protocol/intent.d.ts +7 -9
- package/build/src/protocol/intent.js +22 -32
- package/build/src/protocol/operations.d.ts +102 -69
- package/build/src/protocol/operations.js +33 -56
- package/build/src/protocol/outcome.d.ts +3 -1
- package/build/src/protocol/placement.d.ts +1 -2
- package/build/src/protocol/placement.js +7 -1
- package/build/src/protocol/progress.d.ts +1 -0
- package/build/src/protocol/progress.js +0 -6
- package/build/src/protocol/read/status.d.ts +69 -112
- package/build/src/protocol/read/status.js +59 -88
- package/build/src/protocol/reintegrate.d.ts +1 -2
- package/build/src/protocol/reintegrate.js +2 -3
- package/build/src/protocol/result-leaves.d.ts +67 -40
- package/build/src/protocol/result-leaves.js +28 -58
- package/build/src/protocol/result-reasons.d.ts +6 -6
- package/build/src/protocol/review.js +0 -1
- package/build/src/protocol/run.js +1 -4
- package/build/src/protocol/verify.d.ts +202 -146
- package/build/src/protocol/verify.js +61 -47
- package/build/src/runtime/proc/windows-launch.exe +0 -0
- package/build/src/settings.d.ts +8 -9
- package/build/src/settings.js +16 -13
- package/build/src/settlement/holder.js +2 -2
- package/build/src/settlement/settle.d.ts +0 -6
- package/build/src/settlement/settle.js +19 -72
- package/build/src/verification/declaration.d.ts +3 -6
- package/build/src/verification/declaration.js +3 -5
- package/build/src/verification/observation.d.ts +2 -2
- package/build/src/world.d.ts +3 -2
- package/build/src/world.js +5 -6
- package/package.json +7 -3
- package/plugins/paseo/plugin/index.server.ts +1 -1
- package/plugins/paseo/plugin/server/attach.ts +74 -67
- package/plugins/paseo/plugin/server/keiyaku.ts +80 -14
- package/plugins/paseo/plugin/server/message.ts +2 -1
- package/plugins/paseo/plugin/server/mirror-identity.ts +6 -4
- package/plugins/paseo/plugin/server/sdk.ts +9 -11
- package/plugins/paseo/plugin/server/transport.ts +24 -1
- package/plugins/pi/README.md +53 -97
- package/plugins/pi/keiyaku.ts +10 -6
- package/skills/keiyaku-akuma/SKILL.md +24 -15
- package/skills/keiyaku-babysit/SKILL.md +12 -8
- package/skills/keiyaku-bind/SKILL.md +4 -3
- package/skills/keiyaku-debt/SKILL.md +17 -17
- package/skills/keiyaku-workflow/SKILL.md +6 -4
- package/build/plugins/pi/akuma-tools.ts +0 -290
- package/build/src/akuma/providers/codex-app-server/configuration.d.ts +0 -5
- package/build/src/akuma/providers/codex-app-server/configuration.js +0 -72
- package/build/src/body/keys.d.ts +0 -4
- package/build/src/body/keys.js +0 -11
- package/build/src/cli/commands/debt-query.d.ts +0 -5
- package/build/src/cli/commands/debt-query.js +0 -194
- package/build/src/cli/render/akuma-tool-command.d.ts +0 -6
- package/build/src/cli/render/akuma-tool-command.js +0 -143
- package/build/src/cli/render/akuma-tool.d.ts +0 -29
- package/build/src/cli/render/akuma-tool.js +0 -225
- package/build/src/debt/context.d.ts +0 -28
- package/build/src/debt/context.js +0 -102
- package/build/src/debt/created-observation.d.ts +0 -26
- package/build/src/debt/created-observation.js +0 -38
- package/build/src/debt/query.d.ts +0 -80
- package/build/src/debt/query.js +0 -283
- package/build/src/kanshi/roster.d.ts +0 -2
- package/build/src/kanshi/roster.js +0 -2
- package/build/src/library/contract-execution.d.ts +0 -28
- package/build/src/library/contract-execution.js +0 -506
- package/build/src/library/keiyaku-policy.d.ts +0 -27
- package/build/src/library/keiyaku-policy.js +0 -44
- package/build/src/library/keiyaku-status.d.ts +0 -1487
- package/build/src/library/keiyaku-status.js +0 -92
- package/plugins/pi/akuma-tools.ts +0 -290
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/** @architectureCompositionRoot */
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { contractIdSchema, snapshotIdSchema } from "../git/identity.js";
|
|
4
|
-
import {
|
|
4
|
+
import { retrySchema } from "../protocol/result-reasons.js";
|
|
5
5
|
import { deliveryPreviewReportSchema } from "../protocol/delivery-preview.js";
|
|
6
6
|
import { placementSchema } from "../protocol/completion.js";
|
|
7
|
-
import { verifyValueSchema } from "../protocol/verify.js";
|
|
7
|
+
import { verifyValueSchema, verifyNormalValueSchema } from "../protocol/verify.js";
|
|
8
8
|
import { deliveredValueSchema } from "./delivery.js";
|
|
9
|
-
import { continuationReportSchema } from "./continuation.js";
|
|
10
|
-
import { handoffOutcomeSchema, operationOutcomeSchema, invocationIssueSchema, localIssueSchema,
|
|
9
|
+
import { continuationReportSchema, continuationNormalReportSchema } from "./continuation.js";
|
|
10
|
+
import { handoffOutcomeSchema, operationOutcomeSchema, acceptedOutcomeSchema, optionalInvocationIssueSchema, optionalLocalIssueSchema, invocationIssueSchema, localIssueSchema, previewIssueSchema, } from "./outcome.js";
|
|
11
11
|
import { operationRefusalSchemas } from "./refusal.js";
|
|
12
12
|
import { regionOverlapResultSchema } from "./region.js";
|
|
13
13
|
const regionFields = {
|
|
@@ -20,6 +20,7 @@ const bindFields = {
|
|
|
20
20
|
...regionFields,
|
|
21
21
|
};
|
|
22
22
|
const amendFields = {
|
|
23
|
+
target: z.string().exactOptional(),
|
|
23
24
|
changedSections: z.array(z.string()).min(1).readonly().exactOptional(),
|
|
24
25
|
gatesChanged: z.literal(true).exactOptional(),
|
|
25
26
|
afterChanged: z.literal(true).exactOptional(),
|
|
@@ -41,40 +42,24 @@ const reviewFields = {
|
|
|
41
42
|
const bindValueSchema = z.strictObject(bindFields).readonly();
|
|
42
43
|
const amendValueSchema = z.strictObject(amendFields).readonly();
|
|
43
44
|
const localRecoveries = { recoverySnapshots: z.array(snapshotIdSchema).min(1).readonly().exactOptional() };
|
|
45
|
+
export const bindNormalOutcomeSchema = acceptedOutcomeSchema({ ...bindFields, ...localRecoveries }, optionalLocalIssueSchema);
|
|
44
46
|
const bindOutcomes = operationOutcomeSchema(bindFields, operationRefusalSchemas.bind, localIssueSchema);
|
|
45
47
|
export const bindOutcomeSchema = z.union([
|
|
46
48
|
bindOutcomes.options[0].unwrap().extend(localRecoveries).readonly(),
|
|
47
49
|
bindOutcomes.options[1].unwrap().omit({ contractId: true }).readonly(),
|
|
48
50
|
...retrySchema.options,
|
|
49
51
|
]);
|
|
50
|
-
const
|
|
51
|
-
export const amendOutcomeSchema = z.union([
|
|
52
|
-
amendOutcomes.options[0].unwrap().extend(localRecoveries).readonly(),
|
|
53
|
-
amendOutcomes.options[1],
|
|
54
|
-
amendOutcomes.options[2],
|
|
55
|
-
amendOutcomes.options[3],
|
|
56
|
-
]);
|
|
52
|
+
export const amendOutcomeSchema = operationOutcomeSchema({ ...amendFields, ...localRecoveries }, operationRefusalSchemas.amend, localIssueSchema);
|
|
57
53
|
export const deliverOutcomeSchema = z.union([
|
|
58
|
-
operationOutcomeSchema(deliveredValueSchema.unwrap().shape, operationRefusalSchemas.deliver,
|
|
54
|
+
operationOutcomeSchema(deliveredValueSchema.unwrap().shape, operationRefusalSchemas.deliver, invocationIssueSchema),
|
|
59
55
|
handoffOutcomeSchema,
|
|
60
56
|
]);
|
|
61
57
|
const verifyOutcomes = operationOutcomeSchema({ ...verifyValueSchema.unwrap().shape, continuation: continuationReportSchema.exactOptional() }, operationRefusalSchemas.verify, invocationIssueSchema);
|
|
58
|
+
export const verifyNormalOutcomeSchema = acceptedOutcomeSchema({ ...verifyNormalValueSchema.unwrap().shape, continuation: continuationNormalReportSchema.exactOptional() }, optionalInvocationIssueSchema);
|
|
62
59
|
export const verifyOutcomeSchema = z.union([verifyOutcomes.options[0], verifyOutcomes.options[1]]);
|
|
63
|
-
export const reviewOutcomeSchema = operationOutcomeSchema(reviewFields, operationRefusalSchemas.review,
|
|
64
|
-
const
|
|
65
|
-
export const
|
|
66
|
-
arcOutcomes.options[0].unwrap().extend(localRecoveries).readonly(),
|
|
67
|
-
arcOutcomes.options[1],
|
|
68
|
-
arcOutcomes.options[2],
|
|
69
|
-
arcOutcomes.options[3],
|
|
70
|
-
]);
|
|
71
|
-
const abandonOutcomes = operationOutcomeSchema({}, operationRefusalSchemas.abandon, localIssueSchema);
|
|
72
|
-
export const abandonOutcomeSchema = z.union([
|
|
73
|
-
abandonOutcomes.options[0].unwrap().extend(localRecoveries).readonly(),
|
|
74
|
-
abandonOutcomes.options[1],
|
|
75
|
-
abandonOutcomes.options[2],
|
|
76
|
-
abandonOutcomes.options[3],
|
|
77
|
-
]);
|
|
60
|
+
export const reviewOutcomeSchema = operationOutcomeSchema(reviewFields, operationRefusalSchemas.review, invocationIssueSchema);
|
|
61
|
+
export const arcOutcomeSchema = operationOutcomeSchema({ chapter: z.number().int().positive(), ...localRecoveries }, operationRefusalSchemas.arc, localIssueSchema);
|
|
62
|
+
export const abandonOutcomeSchema = operationOutcomeSchema(localRecoveries, operationRefusalSchemas.abandon, localIssueSchema);
|
|
78
63
|
const previewIssues = { issues: z.array(previewIssueSchema).min(1).readonly().exactOptional() };
|
|
79
64
|
export const deliveryPreviewOutcomeSchema = z.union([
|
|
80
65
|
deliveryPreviewReportSchema.options[0].unwrap().extend(previewIssues).readonly(),
|
|
@@ -87,16 +72,6 @@ export const deliveryPreviewOutcomeSchema = z.union([
|
|
|
87
72
|
})
|
|
88
73
|
.readonly(),
|
|
89
74
|
]);
|
|
90
|
-
export function expected(contract, admission) {
|
|
91
|
-
return admission.kind === "refused"
|
|
92
|
-
? { kind: "refused", ...(contract === undefined ? {} : { contract }), refusal: compactReason(admission.refusal) }
|
|
93
|
-
: { kind: "retry", ...(contract === undefined ? {} : { contract }), reason: admission.reason };
|
|
94
|
-
}
|
|
95
|
-
export function acceptedOutcome(contract, accumulator, value) {
|
|
96
|
-
if (accumulator.head(contract) === undefined)
|
|
97
|
-
throw new Error("missing leading admission receipt");
|
|
98
|
-
return { kind: "accepted", contract, value };
|
|
99
|
-
}
|
|
100
75
|
export function retainAdmission(accumulator, contract, leading) {
|
|
101
76
|
accumulator.recordPublication(contract, leading.head, leading.facts);
|
|
102
77
|
accumulator.recordResidue(contract, leading);
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/** @architectureCompositionRoot */
|
|
2
|
-
import { type
|
|
2
|
+
import { type Gate } from "../core/facts/types.js";
|
|
3
3
|
import { type WorktreeHooks } from "../git/hooks.js";
|
|
4
4
|
import { type Settings } from "../settings.js";
|
|
5
5
|
import type { KeisOptions } from "./contract-types.js";
|
|
6
6
|
/** The one immutable Contract-local composition captured at construction. */
|
|
7
7
|
export type LocalContractCompositionCapture = Readonly<{
|
|
8
8
|
settings?: Settings;
|
|
9
|
-
actor?: ActorId;
|
|
10
9
|
}>;
|
|
11
10
|
/**
|
|
12
11
|
* Hooks, freshness, and gate bundles are read from the captured Settings only at the operation
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { gate, gateWord } from "../core/facts/types.js";
|
|
3
3
|
import { EMPTY_WORKTREE_HOOKS, worktreeHooksFrom } from "../git/hooks.js";
|
|
4
4
|
import { SettingsError } from "../settings.js";
|
|
5
|
-
import {
|
|
5
|
+
import { requireInput } from "./input.js";
|
|
6
6
|
import { KeiyakuError } from "./outcome.js";
|
|
7
7
|
/** One scoped Settings lookup: its native failure stays the cause of caller-invalid input. */
|
|
8
8
|
function settingsScopedFailure(error) {
|
|
@@ -57,10 +57,10 @@ export function gateNames(value) {
|
|
|
57
57
|
if (value === undefined)
|
|
58
58
|
return undefined;
|
|
59
59
|
if (!Array.isArray(value))
|
|
60
|
-
throw new
|
|
60
|
+
throw new KeiyakuError("invalid-input", "gates must be an array");
|
|
61
61
|
return value.map((item, index) => {
|
|
62
62
|
if (typeof item !== "string")
|
|
63
|
-
throw new
|
|
63
|
+
throw new KeiyakuError("invalid-input", `gates[${index}] must be a string`);
|
|
64
64
|
return item;
|
|
65
65
|
});
|
|
66
66
|
}
|
|
@@ -135,14 +135,12 @@ export function derivedGates(composition, names) {
|
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
export function captureLocalContractComposition(input) {
|
|
138
|
-
const values = requireInput(input === undefined ? {} : input, "Keis.of input", ["settings"
|
|
139
|
-
const actor = actorOption(values.actor).actor;
|
|
138
|
+
const values = requireInput(input === undefined ? {} : input, "Keis.of input", ["settings"]);
|
|
140
139
|
const settings = values.settings;
|
|
141
140
|
if (settings !== undefined && (settings === null || typeof settings !== "object")) {
|
|
142
|
-
throw new
|
|
141
|
+
throw new KeiyakuError("invalid-input", "Keis.of settings must be a Settings value");
|
|
143
142
|
}
|
|
144
143
|
return Object.freeze({
|
|
145
|
-
...(actor === undefined ? {} : { actor }),
|
|
146
144
|
...(settings === undefined ? {} : { settings: settings }),
|
|
147
145
|
});
|
|
148
146
|
}
|
|
@@ -1,58 +1,64 @@
|
|
|
1
1
|
/** @architectureCompositionRoot */
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import type {
|
|
3
|
+
import type { AttestationData, ContractId } from "../core/facts/types.js";
|
|
4
4
|
import type { ContractCatalogue } from "../protocol/read/status.js";
|
|
5
5
|
import type { Settings } from "../settings.js";
|
|
6
6
|
import type { DebtId } from "../debt/identity.js";
|
|
7
7
|
/** Public gate words remain ordinary strings; private policy interprets them. */
|
|
8
|
-
export type Gate
|
|
8
|
+
export type { Gate } from "../core/facts/types.js";
|
|
9
9
|
export declare const contractHistoryEventSchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
10
10
|
kind: z.ZodLiteral<"bind">;
|
|
11
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
12
|
+
at: z.ZodString;
|
|
11
13
|
start: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
|
|
12
14
|
target: z.ZodExactOptional<z.ZodUnion<readonly [z.ZodString, z.ZodReadonly<z.ZodObject<{
|
|
13
15
|
kind: z.ZodLiteral<"contract">;
|
|
14
16
|
contractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
|
|
15
17
|
}, z.core.$strict>>]>>;
|
|
16
|
-
gates: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<
|
|
18
|
+
gates: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>>;
|
|
17
19
|
after: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>>>;
|
|
18
20
|
document: z.ZodExactOptional<z.ZodString>;
|
|
19
21
|
targetIncarnation: z.ZodExactOptional<z.ZodReadonly<z.ZodObject<{
|
|
20
22
|
id: z.ZodString;
|
|
21
23
|
identity: z.ZodString;
|
|
22
24
|
}, z.core.$strict>>>;
|
|
23
|
-
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
24
|
-
at: z.ZodString;
|
|
25
|
-
actor: z.ZodExactOptional<z.ZodString>;
|
|
26
25
|
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
27
26
|
kind: z.ZodLiteral<"amend">;
|
|
27
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
28
|
+
at: z.ZodString;
|
|
29
|
+
target: z.ZodExactOptional<z.ZodUnion<readonly [z.ZodString, z.ZodReadonly<z.ZodObject<{
|
|
30
|
+
kind: z.ZodLiteral<"contract">;
|
|
31
|
+
contractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
|
|
32
|
+
}, z.core.$strict>>]>>;
|
|
33
|
+
targetIncarnation: z.ZodExactOptional<z.ZodReadonly<z.ZodObject<{
|
|
34
|
+
id: z.ZodString;
|
|
35
|
+
identity: z.ZodString;
|
|
36
|
+
}, z.core.$strict>>>;
|
|
28
37
|
changedSections: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
29
|
-
gates: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<
|
|
38
|
+
gates: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>>;
|
|
30
39
|
after: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>>>;
|
|
31
40
|
document: z.ZodExactOptional<z.ZodString>;
|
|
32
|
-
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
33
|
-
at: z.ZodString;
|
|
34
|
-
actor: z.ZodExactOptional<z.ZodString>;
|
|
35
41
|
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
36
42
|
kind: z.ZodLiteral<"deliver">;
|
|
43
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
44
|
+
at: z.ZodString;
|
|
37
45
|
candidate: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
|
|
38
46
|
integration: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
|
|
39
47
|
contentId: z.ZodString;
|
|
40
48
|
predecessor: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
|
|
41
49
|
note: z.ZodExactOptional<z.ZodString>;
|
|
42
50
|
requireBranchesToBeUpToDate: z.ZodExactOptional<z.ZodBoolean>;
|
|
43
|
-
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
44
|
-
at: z.ZodString;
|
|
45
|
-
actor: z.ZodExactOptional<z.ZodString>;
|
|
46
51
|
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
47
52
|
kind: z.ZodLiteral<"reintegrated">;
|
|
48
|
-
predecessor: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
|
|
49
|
-
integration: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
|
|
50
53
|
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
51
54
|
at: z.ZodString;
|
|
52
|
-
|
|
55
|
+
predecessor: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
|
|
56
|
+
integration: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
|
|
53
57
|
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
54
58
|
kind: z.ZodLiteral<"attestation">;
|
|
55
|
-
|
|
59
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
60
|
+
at: z.ZodString;
|
|
61
|
+
gate: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
56
62
|
requirement: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").RequirementId, string>>;
|
|
57
63
|
verdict: z.ZodEnum<{
|
|
58
64
|
satisfied: "satisfied";
|
|
@@ -60,29 +66,23 @@ export declare const contractHistoryEventSchema: z.ZodUnion<readonly [z.ZodReado
|
|
|
60
66
|
}>;
|
|
61
67
|
subject: z.ZodString;
|
|
62
68
|
summary: z.ZodExactOptional<z.ZodString>;
|
|
63
|
-
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
64
|
-
at: z.ZodString;
|
|
65
|
-
actor: z.ZodExactOptional<z.ZodString>;
|
|
66
69
|
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
67
70
|
kind: z.ZodLiteral<"claimed">;
|
|
68
|
-
deliveryId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
69
71
|
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
70
72
|
at: z.ZodString;
|
|
71
|
-
|
|
73
|
+
deliveryId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
72
74
|
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
73
75
|
kind: z.ZodLiteral<"arc">;
|
|
76
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
77
|
+
at: z.ZodString;
|
|
74
78
|
chapter: z.ZodNumber;
|
|
75
79
|
title: z.ZodString;
|
|
76
80
|
body: z.ZodExactOptional<z.ZodString>;
|
|
77
|
-
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
78
|
-
at: z.ZodString;
|
|
79
|
-
actor: z.ZodExactOptional<z.ZodString>;
|
|
80
81
|
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
81
82
|
kind: z.ZodLiteral<"abandoned">;
|
|
82
|
-
note: z.ZodExactOptional<z.ZodString>;
|
|
83
83
|
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
84
84
|
at: z.ZodString;
|
|
85
|
-
|
|
85
|
+
note: z.ZodExactOptional<z.ZodString>;
|
|
86
86
|
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
87
87
|
kind: z.ZodLiteral<"dispatch">;
|
|
88
88
|
at: z.ZodString;
|
|
@@ -93,51 +93,57 @@ export declare const contractHistorySchema: z.ZodUnion<readonly [z.ZodReadonly<z
|
|
|
93
93
|
contractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
|
|
94
94
|
events: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
95
95
|
kind: z.ZodLiteral<"bind">;
|
|
96
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
97
|
+
at: z.ZodString;
|
|
96
98
|
start: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
|
|
97
99
|
target: z.ZodExactOptional<z.ZodUnion<readonly [z.ZodString, z.ZodReadonly<z.ZodObject<{
|
|
98
100
|
kind: z.ZodLiteral<"contract">;
|
|
99
101
|
contractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
|
|
100
102
|
}, z.core.$strict>>]>>;
|
|
101
|
-
gates: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<
|
|
103
|
+
gates: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>>;
|
|
102
104
|
after: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>>>;
|
|
103
105
|
document: z.ZodExactOptional<z.ZodString>;
|
|
104
106
|
targetIncarnation: z.ZodExactOptional<z.ZodReadonly<z.ZodObject<{
|
|
105
107
|
id: z.ZodString;
|
|
106
108
|
identity: z.ZodString;
|
|
107
109
|
}, z.core.$strict>>>;
|
|
108
|
-
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
109
|
-
at: z.ZodString;
|
|
110
|
-
actor: z.ZodExactOptional<z.ZodString>;
|
|
111
110
|
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
112
111
|
kind: z.ZodLiteral<"amend">;
|
|
112
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
113
|
+
at: z.ZodString;
|
|
114
|
+
target: z.ZodExactOptional<z.ZodUnion<readonly [z.ZodString, z.ZodReadonly<z.ZodObject<{
|
|
115
|
+
kind: z.ZodLiteral<"contract">;
|
|
116
|
+
contractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
|
|
117
|
+
}, z.core.$strict>>]>>;
|
|
118
|
+
targetIncarnation: z.ZodExactOptional<z.ZodReadonly<z.ZodObject<{
|
|
119
|
+
id: z.ZodString;
|
|
120
|
+
identity: z.ZodString;
|
|
121
|
+
}, z.core.$strict>>>;
|
|
113
122
|
changedSections: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
114
|
-
gates: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<
|
|
123
|
+
gates: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>>;
|
|
115
124
|
after: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>>>>;
|
|
116
125
|
document: z.ZodExactOptional<z.ZodString>;
|
|
117
|
-
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
118
|
-
at: z.ZodString;
|
|
119
|
-
actor: z.ZodExactOptional<z.ZodString>;
|
|
120
126
|
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
121
127
|
kind: z.ZodLiteral<"deliver">;
|
|
128
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
129
|
+
at: z.ZodString;
|
|
122
130
|
candidate: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
|
|
123
131
|
integration: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
|
|
124
132
|
contentId: z.ZodString;
|
|
125
133
|
predecessor: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
|
|
126
134
|
note: z.ZodExactOptional<z.ZodString>;
|
|
127
135
|
requireBranchesToBeUpToDate: z.ZodExactOptional<z.ZodBoolean>;
|
|
128
|
-
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
129
|
-
at: z.ZodString;
|
|
130
|
-
actor: z.ZodExactOptional<z.ZodString>;
|
|
131
136
|
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
132
137
|
kind: z.ZodLiteral<"reintegrated">;
|
|
133
|
-
predecessor: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
|
|
134
|
-
integration: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
|
|
135
138
|
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
136
139
|
at: z.ZodString;
|
|
137
|
-
|
|
140
|
+
predecessor: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
|
|
141
|
+
integration: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
|
|
138
142
|
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
139
143
|
kind: z.ZodLiteral<"attestation">;
|
|
140
|
-
|
|
144
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
145
|
+
at: z.ZodString;
|
|
146
|
+
gate: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
141
147
|
requirement: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").RequirementId, string>>;
|
|
142
148
|
verdict: z.ZodEnum<{
|
|
143
149
|
satisfied: "satisfied";
|
|
@@ -145,29 +151,23 @@ export declare const contractHistorySchema: z.ZodUnion<readonly [z.ZodReadonly<z
|
|
|
145
151
|
}>;
|
|
146
152
|
subject: z.ZodString;
|
|
147
153
|
summary: z.ZodExactOptional<z.ZodString>;
|
|
148
|
-
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
149
|
-
at: z.ZodString;
|
|
150
|
-
actor: z.ZodExactOptional<z.ZodString>;
|
|
151
154
|
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
152
155
|
kind: z.ZodLiteral<"claimed">;
|
|
153
|
-
deliveryId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
154
156
|
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
155
157
|
at: z.ZodString;
|
|
156
|
-
|
|
158
|
+
deliveryId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
157
159
|
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
158
160
|
kind: z.ZodLiteral<"arc">;
|
|
161
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
162
|
+
at: z.ZodString;
|
|
159
163
|
chapter: z.ZodNumber;
|
|
160
164
|
title: z.ZodString;
|
|
161
165
|
body: z.ZodExactOptional<z.ZodString>;
|
|
162
|
-
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
163
|
-
at: z.ZodString;
|
|
164
|
-
actor: z.ZodExactOptional<z.ZodString>;
|
|
165
166
|
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
166
167
|
kind: z.ZodLiteral<"abandoned">;
|
|
167
|
-
note: z.ZodExactOptional<z.ZodString>;
|
|
168
168
|
id: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").EntryUlid, string>>;
|
|
169
169
|
at: z.ZodString;
|
|
170
|
-
|
|
170
|
+
note: z.ZodExactOptional<z.ZodString>;
|
|
171
171
|
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
172
172
|
kind: z.ZodLiteral<"dispatch">;
|
|
173
173
|
at: z.ZodString;
|
|
@@ -176,8 +176,8 @@ export declare const contractHistorySchema: z.ZodUnion<readonly [z.ZodReadonly<z
|
|
|
176
176
|
dispatches: z.ZodExactOptional<z.ZodReadonly<z.ZodObject<{
|
|
177
177
|
kind: z.ZodLiteral<"unavailable">;
|
|
178
178
|
category: z.ZodEnum<{
|
|
179
|
-
internal: "internal";
|
|
180
179
|
"authority-corruption": "authority-corruption";
|
|
180
|
+
internal: "internal";
|
|
181
181
|
}>;
|
|
182
182
|
diagnostic: z.ZodString;
|
|
183
183
|
}, z.core.$strict>>>;
|
|
@@ -195,8 +195,6 @@ type MarkdownBindInput = Readonly<{
|
|
|
195
195
|
debt?: DebtId;
|
|
196
196
|
/** A literal target branch; `null` is deliberately targetless; omitted is the Repo worktree's current branch. */
|
|
197
197
|
target?: string | null;
|
|
198
|
-
workspace?: "worktree";
|
|
199
|
-
actor?: string;
|
|
200
198
|
after?: readonly ContractId[];
|
|
201
199
|
gates?: readonly string[];
|
|
202
200
|
}>;
|
|
@@ -204,24 +202,20 @@ type ForkBindInput = Readonly<{
|
|
|
204
202
|
forkOf: ContractId;
|
|
205
203
|
/** A literal target branch; `null` clears the source target; omitted inherits it. */
|
|
206
204
|
target?: string | null;
|
|
207
|
-
workspace?: "worktree";
|
|
208
|
-
actor?: string;
|
|
209
205
|
}>;
|
|
210
206
|
export type BindInput = MarkdownBindInput | ForkBindInput;
|
|
211
|
-
|
|
212
|
-
actor?: string;
|
|
213
|
-
}>;
|
|
214
|
-
/** Contract-local composition: one captured Settings selection and the operation actor. */
|
|
207
|
+
/** Contract-local composition: one captured Settings selection. */
|
|
215
208
|
export type KeisOptions = Readonly<{
|
|
216
209
|
settings?: Settings;
|
|
217
|
-
actor?: ActorId;
|
|
218
210
|
}>;
|
|
219
|
-
export type AmendInput =
|
|
211
|
+
export type AmendInput = Readonly<{
|
|
212
|
+
/** Explicit existing branch or active Contract; omission retains the target. */
|
|
213
|
+
target?: string;
|
|
220
214
|
markdown?: string;
|
|
221
215
|
after?: readonly ContractId[];
|
|
222
216
|
gates?: readonly string[];
|
|
223
217
|
}>;
|
|
224
|
-
export type ArcInput =
|
|
218
|
+
export type ArcInput = Readonly<{
|
|
225
219
|
markdown: string;
|
|
226
220
|
}>;
|
|
227
221
|
export type ContractListInput = Readonly<{
|
|
@@ -283,12 +277,12 @@ export declare const contractResolutionSchema: z.ZodUnion<readonly [z.ZodReadonl
|
|
|
283
277
|
}, z.core.$strict>>]>;
|
|
284
278
|
export type ContractSelectorRefusal = z.output<typeof contractSelectorRefusalSchema>;
|
|
285
279
|
export type ContractResolution = z.output<typeof contractResolutionSchema>;
|
|
286
|
-
export type ReviewInput =
|
|
280
|
+
export type ReviewInput = Readonly<{
|
|
287
281
|
verdict: AttestationData["verdict"];
|
|
288
282
|
summary: string;
|
|
289
283
|
signal?: AbortSignal;
|
|
290
284
|
}>;
|
|
291
|
-
export type AbandonInput =
|
|
285
|
+
export type AbandonInput = Readonly<{
|
|
292
286
|
note?: string;
|
|
293
287
|
}>;
|
|
294
288
|
export type VerifyInput = Readonly<{
|
|
@@ -303,4 +297,3 @@ export type DeliverInput = Readonly<{
|
|
|
303
297
|
overwrite?: boolean;
|
|
304
298
|
signal?: AbortSignal;
|
|
305
299
|
}>;
|
|
306
|
-
export {};
|
|
@@ -6,7 +6,6 @@ import { akumaIdSchema } from "../akuma/identity.js";
|
|
|
6
6
|
const historyCommon = {
|
|
7
7
|
id: entryUlidSchema,
|
|
8
8
|
at: z.string(),
|
|
9
|
-
actor: z.string().exactOptional(),
|
|
10
9
|
};
|
|
11
10
|
const historyTarget = z.union([
|
|
12
11
|
z.string(),
|
|
@@ -14,83 +13,45 @@ const historyTarget = z.union([
|
|
|
14
13
|
]);
|
|
15
14
|
const historyGates = z.array(gateSchema).readonly().exactOptional();
|
|
16
15
|
const historyAfter = z.array(contractIdSchema).readonly().exactOptional();
|
|
16
|
+
function historyEvent(kind, fields) {
|
|
17
|
+
return z.strictObject({ ...historyCommon, kind: z.literal(kind), ...fields }).readonly();
|
|
18
|
+
}
|
|
17
19
|
export const contractHistoryEventSchema = z.union([
|
|
18
|
-
|
|
19
|
-
.strictObject({
|
|
20
|
-
...historyCommon,
|
|
21
|
-
kind: z.literal("bind"),
|
|
20
|
+
historyEvent("bind", {
|
|
22
21
|
start: snapshotIdSchema,
|
|
23
22
|
target: historyTarget.exactOptional(),
|
|
24
23
|
gates: historyGates,
|
|
25
24
|
after: historyAfter,
|
|
26
25
|
document: z.string().exactOptional(),
|
|
27
26
|
targetIncarnation: z.strictObject({ id: z.string(), identity: z.string() }).readonly().exactOptional(),
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
.strictObject({
|
|
32
|
-
...historyCommon,
|
|
33
|
-
kind: z.literal("amend"),
|
|
27
|
+
}),
|
|
28
|
+
historyEvent("amend", {
|
|
29
|
+
target: historyTarget.exactOptional(),
|
|
30
|
+
targetIncarnation: z.strictObject({ id: z.string(), identity: z.string() }).readonly().exactOptional(),
|
|
34
31
|
changedSections: z.array(z.string()).readonly().exactOptional(),
|
|
35
32
|
gates: historyGates,
|
|
36
33
|
after: historyAfter,
|
|
37
34
|
document: z.string().exactOptional(),
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
z
|
|
41
|
-
.strictObject({
|
|
42
|
-
...historyCommon,
|
|
43
|
-
kind: z.literal("deliver"),
|
|
35
|
+
}),
|
|
36
|
+
historyEvent("deliver", {
|
|
44
37
|
candidate: snapshotIdSchema,
|
|
45
38
|
integration: snapshotIdSchema,
|
|
46
39
|
contentId: z.string(),
|
|
47
40
|
predecessor: snapshotIdSchema,
|
|
48
41
|
note: z.string().exactOptional(),
|
|
49
42
|
requireBranchesToBeUpToDate: z.boolean().exactOptional(),
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
.strictObject({
|
|
54
|
-
...historyCommon,
|
|
55
|
-
kind: z.literal("reintegrated"),
|
|
56
|
-
predecessor: snapshotIdSchema,
|
|
57
|
-
integration: snapshotIdSchema,
|
|
58
|
-
})
|
|
59
|
-
.readonly(),
|
|
60
|
-
z
|
|
61
|
-
.strictObject({
|
|
62
|
-
...historyCommon,
|
|
63
|
-
kind: z.literal("attestation"),
|
|
43
|
+
}),
|
|
44
|
+
historyEvent("reintegrated", { predecessor: snapshotIdSchema, integration: snapshotIdSchema }),
|
|
45
|
+
historyEvent("attestation", {
|
|
64
46
|
gate: gateSchema,
|
|
65
47
|
requirement: requirementIdSchema,
|
|
66
48
|
verdict: verdictSchema,
|
|
67
49
|
subject: z.string(),
|
|
68
50
|
summary: z.string().exactOptional(),
|
|
69
|
-
})
|
|
70
|
-
|
|
71
|
-
z
|
|
72
|
-
|
|
73
|
-
...historyCommon,
|
|
74
|
-
kind: z.literal("claimed"),
|
|
75
|
-
deliveryId: entryUlidSchema,
|
|
76
|
-
})
|
|
77
|
-
.readonly(),
|
|
78
|
-
z
|
|
79
|
-
.strictObject({
|
|
80
|
-
...historyCommon,
|
|
81
|
-
kind: z.literal("arc"),
|
|
82
|
-
chapter: z.number().int().positive(),
|
|
83
|
-
title: z.string(),
|
|
84
|
-
body: z.string().exactOptional(),
|
|
85
|
-
})
|
|
86
|
-
.readonly(),
|
|
87
|
-
z
|
|
88
|
-
.strictObject({
|
|
89
|
-
...historyCommon,
|
|
90
|
-
kind: z.literal("abandoned"),
|
|
91
|
-
note: z.string().exactOptional(),
|
|
92
|
-
})
|
|
93
|
-
.readonly(),
|
|
51
|
+
}),
|
|
52
|
+
historyEvent("claimed", { deliveryId: entryUlidSchema }),
|
|
53
|
+
historyEvent("arc", { chapter: z.number().int().positive(), title: z.string(), body: z.string().exactOptional() }),
|
|
54
|
+
historyEvent("abandoned", { note: z.string().exactOptional() }),
|
|
94
55
|
z
|
|
95
56
|
.strictObject({
|
|
96
57
|
kind: z.literal("dispatch"),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { type ContractId } from "../core/facts/types.js";
|
|
3
3
|
import type { RepositoryScope } from "../protocol/operations.js";
|
|
4
|
+
export declare const contractWaitDurationSchema: z.ZodNumber;
|
|
4
5
|
export type ContractWaitOptions = Readonly<{
|
|
5
6
|
completion?: "any" | "all";
|
|
6
7
|
timeoutMs?: number;
|
|
@@ -24,10 +25,10 @@ export declare const contractWaitMemberSchema: z.ZodReadonly<z.ZodObject<{
|
|
|
24
25
|
export declare const contractWaitResultSchema: z.ZodReadonly<z.ZodObject<{
|
|
25
26
|
kind: z.ZodLiteral<"contract">;
|
|
26
27
|
reason: z.ZodEnum<{
|
|
27
|
-
changed: "changed";
|
|
28
|
-
terminal: "terminal";
|
|
29
|
-
missing: "missing";
|
|
30
28
|
deadline: "deadline";
|
|
29
|
+
missing: "missing";
|
|
30
|
+
terminal: "terminal";
|
|
31
|
+
changed: "changed";
|
|
31
32
|
}>;
|
|
32
33
|
contracts: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
33
34
|
id: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
|
|
@@ -42,6 +43,42 @@ export declare const contractWaitResultSchema: z.ZodReadonly<z.ZodObject<{
|
|
|
42
43
|
}>>;
|
|
43
44
|
}, z.core.$strict>>>>;
|
|
44
45
|
}, z.core.$strict>>;
|
|
46
|
+
export declare const contractWaitNormalResultSchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
47
|
+
kind: z.ZodLiteral<"contract">;
|
|
48
|
+
reason: z.ZodLiteral<"changed">;
|
|
49
|
+
contracts: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
50
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
|
|
51
|
+
terminal: z.ZodExactOptional<z.ZodEnum<{
|
|
52
|
+
claimed: "claimed";
|
|
53
|
+
abandoned: "abandoned";
|
|
54
|
+
}>>;
|
|
55
|
+
changed: z.ZodExactOptional<z.ZodLiteral<true>>;
|
|
56
|
+
}, z.core.$strict>>>>;
|
|
57
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
58
|
+
kind: z.ZodLiteral<"contract">;
|
|
59
|
+
reason: z.ZodLiteral<"terminal">;
|
|
60
|
+
contracts: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
61
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
|
|
62
|
+
terminal: z.ZodExactOptional<z.ZodEnum<{
|
|
63
|
+
claimed: "claimed";
|
|
64
|
+
abandoned: "abandoned";
|
|
65
|
+
}>>;
|
|
66
|
+
}, z.core.$strict>>>>;
|
|
67
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
68
|
+
kind: z.ZodLiteral<"contract">;
|
|
69
|
+
reason: z.ZodLiteral<"deadline">;
|
|
70
|
+
contracts: z.ZodUnion<readonly [z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
71
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
|
|
72
|
+
terminal: z.ZodExactOptional<z.ZodEnum<{
|
|
73
|
+
claimed: "claimed";
|
|
74
|
+
abandoned: "abandoned";
|
|
75
|
+
}>>;
|
|
76
|
+
changed: z.ZodExactOptional<z.ZodLiteral<true>>;
|
|
77
|
+
}, z.core.$strict>>>>, z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
78
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
|
|
79
|
+
presence: z.ZodLiteral<"unknown">;
|
|
80
|
+
}, z.core.$strict>>>>]>;
|
|
81
|
+
}, z.core.$strict>>]>;
|
|
45
82
|
export type ContractWaitMember = z.output<typeof contractWaitMemberSchema>;
|
|
46
83
|
export type ContractWaitResult = z.output<typeof contractWaitResultSchema>;
|
|
47
84
|
export type ValidatedWait = Readonly<{
|
|
@@ -53,4 +90,11 @@ export type ValidatedWait = Readonly<{
|
|
|
53
90
|
}>;
|
|
54
91
|
export declare function validateContractWait(scope: RepositoryScope, input: unknown): ValidatedWait;
|
|
55
92
|
export declare function validateContractWaitHandle(scope: RepositoryScope, id: ContractId, input?: ContractWaitOptions): ValidatedWait;
|
|
93
|
+
/** One invocation's journal baselines and witnessed progress, shared with mixed observation. */
|
|
94
|
+
export declare function createContractWaitObserver(scope: RepositoryScope, ids: readonly ContractId[]): {
|
|
95
|
+
members: () => readonly ContractWaitMember[];
|
|
96
|
+
reason: (completion: "any" | "all") => "deadline" | "missing" | "terminal" | "changed" | undefined;
|
|
97
|
+
satisfied: () => ContractId[];
|
|
98
|
+
observe(signal?: AbortSignal): Promise<void>;
|
|
99
|
+
};
|
|
56
100
|
export declare function waitContractLocal(input: ValidatedWait): Promise<ContractWaitResult>;
|