@astrosheep/keiyaku 4.5.29 → 4.6.2
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/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku/SKILL.md +0 -13
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-akuma/SKILL.md +47 -78
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-akuma/references/automation.md +54 -41
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-babysit/SKILL.md +10 -0
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-bind/SKILL.md +27 -9
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-workflow/SKILL.md +68 -71
- package/build/src/akuma/akuma-call.d.ts +53 -0
- package/build/src/akuma/akuma-call.js +113 -0
- package/build/src/akuma/akuma-instance.d.ts +20 -18
- package/build/src/akuma/akuma-instance.js +65 -175
- package/build/src/akuma/akuma-observe.d.ts +3 -21
- package/build/src/akuma/akuma-observe.js +7 -24
- package/build/src/akuma/{akuma-handle.d.ts → akuma-owner.d.ts} +55 -27
- package/build/src/akuma/{akuma-handle.js → akuma-owner.js} +24 -23
- package/build/src/akuma/akuma-selection-execution.d.ts +51 -0
- package/build/src/akuma/akuma-selection-execution.js +134 -0
- package/build/src/akuma/{fleet-execution.d.ts → akuma-wait.d.ts} +24 -44
- package/build/src/akuma/akuma-wait.js +113 -0
- package/build/src/akuma/akuma.d.ts +35 -89
- package/build/src/akuma/akuma.js +148 -30
- package/build/src/akuma/archetype.d.ts +12 -0
- package/build/src/akuma/archetype.js +47 -19
- package/build/src/akuma/body.d.ts +76 -36
- package/build/src/akuma/body.js +84 -49
- package/build/src/akuma/call-initial-tell.d.ts +131 -22
- package/build/src/akuma/call-initial-tell.js +31 -1
- package/build/src/akuma/call-request.d.ts +237 -31
- package/build/src/akuma/call-request.js +67 -94
- package/build/src/akuma/coordinate.d.ts +15 -5
- package/build/src/akuma/coordinate.js +12 -22
- package/build/src/akuma/dispatch-association.d.ts +1 -1
- package/build/src/akuma/dispatch-association.js +1 -10
- package/build/src/akuma/heart/activity-schema.d.ts +325 -0
- package/build/src/akuma/heart/activity-schema.js +53 -0
- package/build/src/akuma/heart/facts.d.ts +1 -6
- package/build/src/akuma/heart/index.d.ts +3 -1
- package/build/src/akuma/heart/index.js +4 -1
- package/build/src/akuma/heart/rows.d.ts +49 -2
- package/build/src/akuma/heart/rows.js +16 -2
- package/build/src/akuma/heart/soul.d.ts +1 -0
- package/build/src/akuma/heart/soul.js +6 -4
- package/build/src/akuma/heart/tells.d.ts +1 -0
- package/build/src/akuma/heart/tells.js +18 -0
- package/build/src/akuma/identity.d.ts +10 -7
- package/build/src/akuma/identity.js +23 -0
- package/build/src/akuma/index.d.ts +10 -8
- package/build/src/akuma/index.js +2 -2
- package/build/src/akuma/nuke.d.ts +3 -0
- package/build/src/akuma/nuke.js +13 -7
- package/build/src/akuma/projection.d.ts +0 -5
- package/build/src/akuma/projection.js +22 -43
- package/build/src/akuma/provider-recipe.d.ts +58 -13
- package/build/src/akuma/provider-recipe.js +62 -80
- package/build/src/akuma/provider.d.ts +6 -76
- package/build/src/akuma/provider.js +11 -219
- package/build/src/akuma/providers/acp/config.d.ts +2 -0
- package/build/src/akuma/providers/acp/config.js +26 -1
- package/build/src/akuma/providers/acp/core.d.ts +7 -0
- package/build/src/akuma/providers/acp/core.js +49 -18
- package/build/src/akuma/providers/acp/index.js +14 -6
- package/build/src/akuma/providers/grok-build/index.js +44 -13
- package/build/src/akuma/providers/index.d.ts +3 -3
- package/build/src/akuma/providers/index.js +2 -13
- package/build/src/akuma/providers/opencode-sdk/event-stream.d.ts +28 -0
- package/build/src/akuma/providers/opencode-sdk/event-stream.js +92 -0
- package/build/src/akuma/providers/opencode-sdk/events.d.ts +0 -1
- package/build/src/akuma/providers/opencode-sdk/index.js +200 -64
- package/build/src/akuma/providers/opencode-sdk/session.d.ts +41 -1
- package/build/src/akuma/providers/opencode-sdk/session.js +69 -2
- package/build/src/akuma/providers/pi/events.js +5 -2
- package/build/src/akuma/providers/pi/index.d.ts +3 -4
- package/build/src/akuma/providers/pi/index.js +99 -45
- package/build/src/akuma/publication.d.ts +84 -3
- package/build/src/akuma/publication.js +145 -2
- package/build/src/akuma/read-pool.d.ts +2 -0
- package/build/src/akuma/read-pool.js +15 -0
- package/build/src/akuma/request-rendezvous.js +10 -0
- package/build/src/akuma/request-serve.js +7 -0
- package/build/src/akuma/request-wire.d.ts +14 -26
- package/build/src/akuma/request-wire.js +4 -0
- package/build/src/akuma/requests.d.ts +0 -2
- package/build/src/akuma/requests.js +0 -17
- package/build/src/akuma/{fleet-observation.d.ts → selection-observation.d.ts} +37 -36
- package/build/src/akuma/selection-observation.js +65 -0
- package/build/src/akuma/{fleet-owner-port.d.ts → selection-owner-port.d.ts} +3 -3
- package/build/src/akuma/{fleet-owner-port.js → selection-owner-port.js} +11 -17
- package/build/src/akuma/{fleet-request.d.ts → selection-request.d.ts} +42 -82
- package/build/src/akuma/{fleet-request.js → selection-request.js} +92 -136
- package/build/src/akuma/turn-drive.js +73 -14
- package/build/src/akuma-body.js +91 -56
- package/build/src/body/amend.d.ts +5 -0
- package/build/src/body/amend.js +26 -50
- package/build/src/body/arc.d.ts +4 -2
- package/build/src/body/arc.js +19 -26
- package/build/src/body/criteria.d.ts +6 -0
- package/build/src/body/criteria.js +37 -0
- package/build/src/body/decode.js +5 -42
- package/build/src/body/region.d.ts +5 -0
- package/build/src/body/region.js +45 -2
- package/build/src/body/render.js +2 -4
- package/build/src/cli/activity.d.ts +26 -0
- package/build/src/cli/activity.js +75 -0
- package/build/src/cli/actor.d.ts +3 -1
- package/build/src/cli/actor.js +15 -2
- package/build/src/cli/commands/akuma-grammar.d.ts +75 -0
- package/build/src/cli/commands/akuma-grammar.js +414 -0
- package/build/src/cli/commands/akuma.d.ts +5 -69
- package/build/src/cli/commands/akuma.js +352 -319
- package/build/src/cli/commands/amend.d.ts +4 -5
- package/build/src/cli/commands/amend.js +1 -2
- package/build/src/cli/commands/bind.d.ts +4 -5
- package/build/src/cli/commands/bind.js +7 -10
- package/build/src/cli/commands/contract-grammar.d.ts +112 -0
- package/build/src/cli/commands/contract-grammar.js +282 -0
- package/build/src/cli/commands/contract-help.d.ts +17 -22
- package/build/src/cli/commands/contract-help.js +37 -24
- package/build/src/cli/commands/contract.d.ts +18 -97
- package/build/src/cli/commands/contract.js +621 -233
- package/build/src/cli/commands/install.d.ts +1 -1
- package/build/src/cli/commands/install.js +2 -2
- package/build/src/cli/commands/task-grammar.d.ts +19 -0
- package/build/src/cli/commands/task-grammar.js +438 -0
- package/build/src/cli/commands/task-query.js +23 -104
- package/build/src/cli/commands/task.d.ts +5 -20
- package/build/src/cli/commands/task.js +414 -364
- package/build/src/cli/coordinates.d.ts +10 -0
- package/build/src/cli/coordinates.js +20 -0
- package/build/src/cli/draft.d.ts +7 -1
- package/build/src/cli/main.js +10 -1
- package/build/src/cli/parse.d.ts +8 -9
- package/build/src/cli/parse.js +62 -62
- package/build/src/cli/render/akuma-activity.d.ts +54 -36
- package/build/src/cli/render/akuma-activity.js +262 -242
- package/build/src/cli/render/akuma-tool.d.ts +8 -4
- package/build/src/cli/render/akuma-tool.js +6 -5
- package/build/src/cli/render/akuma.d.ts +36 -16
- package/build/src/cli/render/akuma.js +65 -132
- package/build/src/cli/render/audit.d.ts +6 -2
- package/build/src/cli/render/audit.js +59 -28
- package/build/src/cli/render/catalog.d.ts +11 -2
- package/build/src/cli/render/catalog.js +75 -95
- package/build/src/cli/render/contract-history.d.ts +3 -1
- package/build/src/cli/render/contract-history.js +215 -22
- package/build/src/cli/render/contract-observation.d.ts +10 -5
- package/build/src/cli/render/contract-observation.js +29 -46
- package/build/src/cli/render/contract.d.ts +10 -3
- package/build/src/cli/render/contract.js +252 -103
- package/build/src/cli/render/effects.d.ts +26 -0
- package/build/src/cli/render/effects.js +41 -0
- package/build/src/cli/render/execution-progress.d.ts +18 -6
- package/build/src/cli/render/execution-progress.js +34 -31
- package/build/src/cli/render/kanshi-akuma.d.ts +1 -2
- package/build/src/cli/render/kanshi-akuma.js +5 -26
- package/build/src/cli/render/kanshi.js +107 -128
- package/build/src/cli/render/marks.d.ts +13 -0
- package/build/src/cli/render/marks.js +74 -0
- package/build/src/cli/render/nuke.js +18 -7
- package/build/src/cli/render/receipt.d.ts +10 -4
- package/build/src/cli/render/receipt.js +124 -44
- package/build/src/cli/render/reconcile.d.ts +5 -0
- package/build/src/cli/render/reconcile.js +152 -0
- package/build/src/cli/render/refusal.d.ts +21 -4
- package/build/src/cli/render/refusal.js +60 -33
- package/build/src/cli/render/region.js +3 -2
- package/build/src/cli/render/settings.js +2 -12
- package/build/src/cli/render/task.d.ts +37 -6
- package/build/src/cli/render/task.js +161 -157
- package/build/src/cli/render/terminal.d.ts +20 -1
- package/build/src/cli/render/terminal.js +92 -18
- package/build/src/cli/runtime.d.ts +32 -8
- package/build/src/cli/runtime.js +157 -165
- package/build/src/cli/selectors.d.ts +5 -2
- package/build/src/cli/selectors.js +11 -3
- package/build/src/cli/streams.d.ts +11 -0
- package/build/src/cli/streams.js +32 -0
- package/build/src/cli/usage.d.ts +2 -0
- package/build/src/cli/usage.js +12 -8
- package/build/src/contract-guidance.js +3 -7
- package/build/src/contract-worktree.d.ts +20 -28
- package/build/src/contract-worktree.js +18 -70
- package/build/src/coordination/durable-file.d.ts +2 -2
- package/build/src/coordination/durable-file.js +0 -27
- package/build/src/core/facts/codec.d.ts +1 -2
- package/build/src/core/facts/codec.js +6 -7
- package/build/src/core/facts/gate.d.ts +0 -1
- package/build/src/core/facts/gate.js +0 -82
- package/build/src/core/facts/types.d.ts +1 -2
- package/build/src/core/verbs/abandon.d.ts +2 -6
- package/build/src/core/verbs/abandon.js +0 -16
- package/build/src/core/verbs/amend.d.ts +0 -1
- package/build/src/core/verbs/amend.js +0 -20
- package/build/src/core/verbs/arc.d.ts +7 -8
- package/build/src/core/verbs/arc.js +2 -19
- package/build/src/core/verbs/attestation.d.ts +2 -6
- package/build/src/core/verbs/attestation.js +0 -16
- package/build/src/core/verbs/bind.d.ts +0 -1
- package/build/src/core/verbs/bind.js +0 -16
- package/build/src/core/verbs/deliver.d.ts +0 -1
- package/build/src/core/verbs/deliver.js +0 -16
- package/build/src/core/verbs/placement.d.ts +2 -1
- package/build/src/core/verbs/placement.js +10 -59
- package/build/src/git/admission.d.ts +6 -4
- package/build/src/git/admission.js +4 -0
- package/build/src/git/hooks.d.ts +55 -30
- package/build/src/git/hooks.js +30 -3
- package/build/src/git/identity.d.ts +6 -0
- package/build/src/git/identity.js +47 -0
- package/build/src/git/integration.d.ts +31 -13
- package/build/src/git/integration.js +32 -1
- package/build/src/git/nuke.d.ts +10 -1
- package/build/src/git/nuke.js +31 -11
- package/build/src/git/observe.js +2 -15
- package/build/src/git/private-state-seat.d.ts +6 -7
- package/build/src/git/private-state-seat.js +8 -6
- package/build/src/git/read-observation.d.ts +6 -1
- package/build/src/git/read-observation.js +81 -46
- package/build/src/git/reconcile.d.ts +117 -40
- package/build/src/git/reconcile.js +169 -40
- package/build/src/git/scratch.d.ts +7 -4
- package/build/src/git/scratch.js +28 -6
- package/build/src/git/target-placement.d.ts +53 -38
- package/build/src/git/target-placement.js +69 -54
- package/build/src/git/tender.d.ts +37 -28
- package/build/src/git/tender.js +39 -0
- package/build/src/git/terminal-reconcile.js +21 -23
- package/build/src/git/terminal-seal.d.ts +8 -6
- package/build/src/git/terminal-seal.js +10 -0
- package/build/src/git/workspace.d.ts +29 -15
- package/build/src/git/workspace.js +28 -2
- package/build/src/identity/normalize.js +19 -6
- package/build/src/index.d.ts +78 -7
- package/build/src/index.js +52 -4
- package/build/src/kanshi/read.d.ts +3 -3
- package/build/src/kanshi/read.js +21 -21
- package/build/src/kanshi/report.d.ts +9 -8
- package/build/src/kanshi/roster.d.ts +2 -0
- package/build/src/kanshi/roster.js +2 -0
- package/build/src/kanshi/select.js +7 -3
- package/build/src/library/address.d.ts +3 -7
- package/build/src/library/address.js +7 -7
- package/build/src/library/akuma-creation.d.ts +21 -32
- package/build/src/library/akuma-creation.js +148 -165
- package/build/src/library/akumas.d.ts +20 -22
- package/build/src/library/akumas.js +43 -20
- package/build/src/library/bind.d.ts +107 -13
- package/build/src/library/bind.js +29 -23
- package/build/src/library/continuation.d.ts +556 -28
- package/build/src/library/continuation.js +29 -54
- package/build/src/library/contract-composition.d.ts +40 -0
- package/build/src/library/contract-composition.js +105 -0
- package/build/src/library/contract-creation.d.ts +7 -0
- package/build/src/library/contract-creation.js +192 -0
- package/build/src/library/contract-execution.d.ts +29 -40
- package/build/src/library/contract-execution.js +503 -128
- package/build/src/library/contract-operations.d.ts +275 -134
- package/build/src/library/contract-operations.js +83 -92
- package/build/src/library/contract-outcomes.d.ts +71 -0
- package/build/src/library/contract-outcomes.js +32 -0
- package/build/src/library/contract-settings.d.ts +25 -0
- package/build/src/library/contract-settings.js +135 -0
- package/build/src/library/contract-types.d.ts +17 -38
- package/build/src/library/delivery.d.ts +530 -10
- package/build/src/library/delivery.js +20 -45
- package/build/src/library/input.d.ts +3 -1
- package/build/src/library/input.js +11 -16
- package/build/src/library/invocation.d.ts +87 -0
- package/build/src/library/invocation.js +290 -0
- package/build/src/library/keiyaku.d.ts +45 -22
- package/build/src/library/keiyaku.js +134 -8
- package/build/src/library/nuke.d.ts +2 -11
- package/build/src/library/nuke.js +70 -57
- package/build/src/library/outcome.d.ts +13196 -0
- package/build/src/library/outcome.js +487 -0
- package/build/src/library/reconcile.d.ts +96 -24
- package/build/src/library/reconcile.js +102 -42
- package/build/src/library/refusal.d.ts +470 -42
- package/build/src/library/refusal.js +55 -143
- package/build/src/library/region.d.ts +15 -7
- package/build/src/library/region.js +23 -3
- package/build/src/library/repo.d.ts +2 -12
- package/build/src/library/repo.js +1 -22
- package/build/src/library/selection.d.ts +121 -0
- package/build/src/library/{fleet.js → selection.js} +169 -152
- package/build/src/plugin/public.d.ts +2 -0
- package/build/src/protocol/abandon.d.ts +2 -2
- package/build/src/protocol/abandon.js +1 -0
- package/build/src/protocol/amend.js +1 -0
- package/build/src/protocol/arc.d.ts +6 -4
- package/build/src/protocol/attempt.d.ts +4 -2
- package/build/src/protocol/attempt.js +10 -0
- package/build/src/protocol/audit.d.ts +255 -52
- package/build/src/protocol/audit.js +63 -5
- package/build/src/protocol/bind.d.ts +18 -17
- package/build/src/protocol/bind.js +9 -28
- package/build/src/protocol/completion.d.ts +256 -22
- package/build/src/protocol/completion.js +100 -12
- package/build/src/protocol/deliver.d.ts +34 -23
- package/build/src/protocol/deliver.js +39 -25
- package/build/src/protocol/execution-observation.d.ts +36 -37
- package/build/src/protocol/execution-observation.js +7 -9
- package/build/src/protocol/intent.d.ts +101 -30
- package/build/src/protocol/intent.js +74 -1
- package/build/src/protocol/operations.d.ts +570 -64
- package/build/src/protocol/operations.js +189 -9
- package/build/src/protocol/outcome.d.ts +2 -1
- package/build/src/protocol/placement.d.ts +2 -2
- package/build/src/protocol/placement.js +3 -1
- package/build/src/protocol/progress.d.ts +108 -65
- package/build/src/protocol/progress.js +82 -132
- package/build/src/protocol/read/status.d.ts +4 -3
- package/build/src/protocol/read/status.js +6 -5
- package/build/src/protocol/reconcile.d.ts +3 -3
- package/build/src/protocol/reconcile.js +4 -0
- package/build/src/protocol/reintegrate.d.ts +2 -2
- package/build/src/protocol/review.d.ts +30 -12
- package/build/src/protocol/review.js +15 -24
- package/build/src/protocol/run.d.ts +34 -5
- package/build/src/protocol/run.js +24 -12
- package/build/src/runtime/proc/windows-launch.exe +0 -0
- package/build/src/settings.d.ts +0 -10
- package/build/src/settings.js +0 -76
- package/build/src/settlement/holder.d.ts +1 -1
- package/build/src/settlement/settle.d.ts +25 -16
- package/build/src/settlement/settle.js +80 -20
- package/build/src/task/board.d.ts +3 -1
- package/build/src/task/board.js +13 -17
- package/build/src/task/catalog.d.ts +0 -4
- package/build/src/task/catalog.js +0 -15
- package/build/src/task/compose-language.d.ts +19 -9
- package/build/src/task/compose-language.js +30 -20
- package/build/src/task/compose.d.ts +7 -37
- package/build/src/task/compose.js +20 -2
- package/build/src/task/created-observation.d.ts +0 -1
- package/build/src/task/created-observation.js +1 -4
- package/build/src/task/document.d.ts +12 -2
- package/build/src/task/document.js +4 -0
- package/build/src/task/identity.d.ts +4 -1
- package/build/src/task/identity.js +21 -17
- package/build/src/task/index.d.ts +36 -16
- package/build/src/task/index.js +103 -96
- package/build/src/task/lifecycle-operations.d.ts +1 -1
- package/build/src/task/mutation-result.d.ts +647 -586
- package/build/src/task/mutation-result.js +79 -46
- package/build/src/task/mutation.d.ts +298 -270
- package/build/src/task/mutation.js +93 -110
- package/build/src/task/operation-types.d.ts +6 -49
- package/build/src/task/operations.d.ts +2 -1
- package/build/src/task/operations.js +35 -12
- package/build/src/task/query.d.ts +9 -3
- package/build/src/task/query.js +42 -16
- package/build/src/task/store.d.ts +2 -1
- package/build/src/task/store.js +10 -14
- package/build/src/verification/declaration.d.ts +0 -1
- package/build/src/verification/declaration.js +1 -18
- package/build/src/verification/execution.d.ts +6 -2
- package/build/src/verification/observation.d.ts +1 -1
- package/package.json +2 -18
- package/build/src/akuma/akuma-product.d.ts +0 -58
- package/build/src/akuma/akuma-product.js +0 -276
- package/build/src/akuma/fleet-execution.js +0 -234
- package/build/src/akuma/fleet-observation.js +0 -97
- package/build/src/cli/accepted.d.ts +0 -24
- package/build/src/cli/accepted.js +0 -167
- package/build/src/cli/catalog.d.ts +0 -45
- package/build/src/cli/catalog.js +0 -1
- package/build/src/cli/commands/akuma-invoke.d.ts +0 -114
- package/build/src/cli/commands/akuma-invoke.js +0 -375
- package/build/src/cli/commands/contract-invoke.d.ts +0 -34
- package/build/src/cli/commands/contract-invoke.js +0 -259
- package/build/src/cli/commands/nuke.d.ts +0 -10
- package/build/src/cli/commands/nuke.js +0 -20
- package/build/src/cli/commands/status-set.d.ts +0 -4
- package/build/src/cli/commands/status-set.js +0 -52
- package/build/src/cli/commands/task-invoke.d.ts +0 -49
- package/build/src/cli/commands/task-invoke.js +0 -306
- package/build/src/cli/invoke.d.ts +0 -27
- package/build/src/cli/invoke.js +0 -521
- package/build/src/cli/render/board.d.ts +0 -3
- package/build/src/cli/render/board.js +0 -25
- package/build/src/cli/render/status-set.d.ts +0 -5
- package/build/src/cli/render/status-set.js +0 -19
- package/build/src/cli/render/text.d.ts +0 -3
- package/build/src/cli/render/text.js +0 -33
- package/build/src/cli/result.d.ts +0 -240
- package/build/src/cli/result.js +0 -1
- package/build/src/git/result-codec.d.ts +0 -29
- package/build/src/git/result-codec.js +0 -309
- package/build/src/kanshi/fleet.d.ts +0 -6
- package/build/src/kanshi/fleet.js +0 -27
- package/build/src/library/audit.d.ts +0 -29
- package/build/src/library/audit.js +0 -41
- package/build/src/library/composition.d.ts +0 -15
- package/build/src/library/composition.js +0 -28
- package/build/src/library/configuration.d.ts +0 -4
- package/build/src/library/configuration.js +0 -2
- package/build/src/library/contract-bind.d.ts +0 -31
- package/build/src/library/contract-bind.js +0 -140
- package/build/src/library/contract-forwarding.d.ts +0 -55
- package/build/src/library/contract-forwarding.js +0 -67
- package/build/src/library/contract-handle.d.ts +0 -50
- package/build/src/library/contract-handle.js +0 -385
- package/build/src/library/contract.d.ts +0 -46
- package/build/src/library/contract.js +0 -73
- package/build/src/library/execution-result.d.ts +0 -243
- package/build/src/library/execution-result.js +0 -101
- package/build/src/library/execution.d.ts +0 -8
- package/build/src/library/execution.js +0 -102
- package/build/src/library/fleet.d.ts +0 -83
- package/build/src/library/mutation.d.ts +0 -501
- package/build/src/library/mutation.js +0 -248
- package/build/src/library/result-codec.d.ts +0 -2
- package/build/src/library/result-codec.js +0 -12
- package/build/src/protocol/result-codec.d.ts +0 -23
- package/build/src/protocol/result-codec.js +0 -488
- package/build/src/settlement/result-codec.d.ts +0 -2
- package/build/src/settlement/result-codec.js +0 -56
- package/build/src/task/public.d.ts +0 -2
- package/build/src/task/public.js +0 -1
|
@@ -1,23 +1,95 @@
|
|
|
1
1
|
/** @architectureCompositionRoot */
|
|
2
|
-
import {
|
|
3
|
-
import { AkumaObservationError } from "../akuma/akuma-errors.js";
|
|
4
|
-
import {
|
|
2
|
+
import { withoutReportedChanges } from "../akuma/projection.js";
|
|
3
|
+
import { AkumaNotBornError, AkumaObservationError } from "../akuma/akuma-errors.js";
|
|
4
|
+
import { AkumaOwner } from "../akuma/akuma-owner.js";
|
|
5
|
+
import { decodeAskObservation, executeAskAkuma, executeKillAkuma, executeTellAkuma, } from "../akuma/akuma-selection-execution.js";
|
|
6
|
+
import { executeWaitAkuma, } from "../akuma/akuma-wait.js";
|
|
7
|
+
import { parsePublicHistoryId } from "../akuma/identity.js";
|
|
5
8
|
import { executionChannel, localExecutionContext } from "../akuma/requests.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
9
|
+
import { schemaJsonText } from "../akuma/schema.js";
|
|
10
|
+
import { requestForwardedSelectionAsk, requestForwardedSelectionKill, requestForwardedSelectionTell, requestForwardedSelectionWait, } from "../akuma/selection-request.js";
|
|
8
11
|
import { readAliases } from "../alias/index.js";
|
|
9
12
|
import { observeDispatchAssociation } from "../dispatch/index.js";
|
|
10
13
|
import { observeContractAt } from "../git/observe.js";
|
|
11
14
|
import { withGitDecodeChannel } from "../git/read-observation.js";
|
|
12
15
|
import { observeCreatedTaskObservations } from "../task/created-observation.js";
|
|
13
|
-
import { schemaJsonText } from "../akuma/schema.js";
|
|
14
16
|
import { addressAkuma, addressAkumaSet, resolveAkuma, resolveAkumaSet, } from "./address.js";
|
|
15
17
|
import { requireInput } from "./input.js";
|
|
16
|
-
import { fleetResultSchemas, parseAkumaObservation, } from "../akuma/fleet-observation.js";
|
|
17
18
|
import { scopeForRepo } from "./repo.js";
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return
|
|
19
|
+
export function selectionSeam(execution) {
|
|
20
|
+
const channel = executionChannel(execution);
|
|
21
|
+
return channel.kind === "body-request" ? forwardedSelection(channel.directory) : localSelection();
|
|
22
|
+
}
|
|
23
|
+
function forwardedSelection(directory) {
|
|
24
|
+
return {
|
|
25
|
+
addressOne: resolveAkuma,
|
|
26
|
+
addressSet: resolveAkumaSet,
|
|
27
|
+
wait: async (addressed, mode) => await forwardedWait(addressed, { ...mode, directory }),
|
|
28
|
+
kill: async (addressed, abort) => await requestForwardedSelectionKill({
|
|
29
|
+
directory,
|
|
30
|
+
targets: addressed.orderedIds,
|
|
31
|
+
...(abort === undefined ? {} : { signal: abort }),
|
|
32
|
+
}),
|
|
33
|
+
tell: async (addressed, input, abort) => await requestForwardedSelectionTell({
|
|
34
|
+
directory,
|
|
35
|
+
target: addressed.id,
|
|
36
|
+
body: input.body,
|
|
37
|
+
...(input.interrupt === true ? { interrupt: true } : {}),
|
|
38
|
+
...(input.initiator === undefined ? {} : { initiator: input.initiator }),
|
|
39
|
+
...(abort === undefined ? {} : { signal: abort }),
|
|
40
|
+
}),
|
|
41
|
+
ask: async (addressed, input, abort) => {
|
|
42
|
+
const result = await requestForwardedSelectionAsk({
|
|
43
|
+
directory,
|
|
44
|
+
target: addressed.id,
|
|
45
|
+
body: input.body,
|
|
46
|
+
...(input.timeoutMs === undefined ? {} : { timeoutMs: input.timeoutMs }),
|
|
47
|
+
...(input.schema === undefined ? {} : { schema: input.schema }),
|
|
48
|
+
...(input.interrupt === true ? { interrupt: true } : {}),
|
|
49
|
+
...(input.initiator === undefined ? {} : { initiator: input.initiator }),
|
|
50
|
+
...(abort === undefined ? {} : { signal: abort }),
|
|
51
|
+
});
|
|
52
|
+
return (input.schema === undefined
|
|
53
|
+
? result
|
|
54
|
+
: { ...result, observation: decodeAskObservation(result.observation, input.schema) });
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function localSelection() {
|
|
59
|
+
return {
|
|
60
|
+
addressOne: addressAkuma,
|
|
61
|
+
addressSet: addressAkumaSet,
|
|
62
|
+
wait: async (addressed, mode, observer) => await localWait(addressed, { ...mode, ...(observer === undefined ? {} : { observer }) }),
|
|
63
|
+
kill: async (addressed, abort) => await executeKillAkuma({
|
|
64
|
+
path: addressed.path,
|
|
65
|
+
ids: addressed.orderedIds,
|
|
66
|
+
...(abort === undefined ? {} : { signal: abort }),
|
|
67
|
+
}),
|
|
68
|
+
tell: async (addressed, input, abort) => await executeTellAkuma({
|
|
69
|
+
path: addressed.path,
|
|
70
|
+
id: addressed.id,
|
|
71
|
+
body: input.body,
|
|
72
|
+
...(input.interrupt === true ? { interrupt: true } : {}),
|
|
73
|
+
...(input.initiator === undefined ? {} : { initiator: input.initiator }),
|
|
74
|
+
...(abort === undefined ? {} : { signal: abort }),
|
|
75
|
+
}),
|
|
76
|
+
ask: async (addressed, input, abort) => {
|
|
77
|
+
const result = await executeAskAkuma({
|
|
78
|
+
path: addressed.path,
|
|
79
|
+
id: addressed.id,
|
|
80
|
+
body: input.body,
|
|
81
|
+
...(input.timeoutMs === undefined ? {} : { timeoutMs: input.timeoutMs }),
|
|
82
|
+
...(input.schema === undefined ? {} : { schemaJson: schemaJsonText(input.schema) }),
|
|
83
|
+
...(input.interrupt === true ? { interrupt: true } : {}),
|
|
84
|
+
...(input.initiator === undefined ? {} : { initiator: input.initiator }),
|
|
85
|
+
...(input.observe === undefined ? {} : { onObserve: input.observe }),
|
|
86
|
+
...(abort === undefined ? {} : { signal: abort }),
|
|
87
|
+
});
|
|
88
|
+
return (input.schema === undefined
|
|
89
|
+
? result
|
|
90
|
+
: { ...result, observation: decodeAskObservation(result.observation, input.schema) });
|
|
91
|
+
},
|
|
92
|
+
};
|
|
21
93
|
}
|
|
22
94
|
function observationDiagnostic(error) {
|
|
23
95
|
return error instanceof Error ? error.message : String(error);
|
|
@@ -86,32 +158,23 @@ function waitIdentityFacts(path, repo) {
|
|
|
86
158
|
};
|
|
87
159
|
}
|
|
88
160
|
async function observeAkuma(status, path, repo) {
|
|
89
|
-
return (await
|
|
161
|
+
return (await composeAkumaAssociations([status], path, repo))[0];
|
|
90
162
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
return { kind: "observed", ...(await observeAkuma(observed.status, path, repo)) };
|
|
98
|
-
}
|
|
99
|
-
catch (error) {
|
|
100
|
-
if (error instanceof AkumaNotBornError)
|
|
101
|
-
throw error;
|
|
102
|
-
return { kind: "unobserved", diagnostic: observationDiagnostic(error) };
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
async function observeAkumaSet(statuses, path, repo) {
|
|
163
|
+
/**
|
|
164
|
+
* The one upper composition of association-free native status evidence into its
|
|
165
|
+
* public observation shape. It reads Alias-independent Dispatch and Task
|
|
166
|
+
* associations after the lower values, never before or inside them.
|
|
167
|
+
*/
|
|
168
|
+
async function composeAkumaAssociations(statuses, path, repo) {
|
|
106
169
|
const created = await createdTasksFor(path, statuses);
|
|
107
170
|
const discharged = placementDischarged(repo);
|
|
108
171
|
return await Promise.all(statuses.map(async (status, index) => {
|
|
109
172
|
const contract = await dispatchAssociation(repo, status.id);
|
|
110
|
-
return
|
|
173
|
+
return {
|
|
111
174
|
status: await composeObservation(status, contract, discharged),
|
|
112
175
|
contract,
|
|
113
176
|
createdTasks: created[index],
|
|
114
|
-
}
|
|
177
|
+
};
|
|
115
178
|
}));
|
|
116
179
|
}
|
|
117
180
|
function timeout(value) {
|
|
@@ -129,19 +192,29 @@ function signal(value) {
|
|
|
129
192
|
throw new TypeError("signal must be an AbortSignal");
|
|
130
193
|
return value;
|
|
131
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* Compose one wait's association-free native evidence into its public
|
|
197
|
+
* observation shape, attaching the same upper associations as a single-status
|
|
198
|
+
* observation.
|
|
199
|
+
*/
|
|
200
|
+
async function composeWaitResult(path, repo, result) {
|
|
201
|
+
return {
|
|
202
|
+
mode: result.mode,
|
|
203
|
+
reason: result.reason,
|
|
204
|
+
observations: await composeAkumaAssociations(result.observations, path, repo),
|
|
205
|
+
unobserved: result.unobserved,
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Re-attach upper associations after a wait result crosses a forwarded
|
|
210
|
+
* boundary; the serving side must observe its own Dispatch and Task state.
|
|
211
|
+
*/
|
|
132
212
|
async function attachWaitAssociations(path, repo, result) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
const contract = await dispatchAssociation(repo, observation.status.id);
|
|
139
|
-
return parseAkumaObservation({
|
|
140
|
-
status: await composeObservation(observation.status, contract, discharged),
|
|
141
|
-
contract,
|
|
142
|
-
createdTasks: created[index],
|
|
143
|
-
});
|
|
144
|
-
})),
|
|
213
|
+
return await composeWaitResult(path, repo, {
|
|
214
|
+
mode: result.mode,
|
|
215
|
+
reason: result.reason,
|
|
216
|
+
observations: result.observations.map((observation) => observation.status),
|
|
217
|
+
unobserved: result.unobserved,
|
|
145
218
|
});
|
|
146
219
|
}
|
|
147
220
|
function directAddress(values) {
|
|
@@ -161,7 +234,7 @@ function setAddress(values) {
|
|
|
161
234
|
export async function statusAkuma(input) {
|
|
162
235
|
const addressed = await addressAkuma(input);
|
|
163
236
|
try {
|
|
164
|
-
return await observeAkuma(await
|
|
237
|
+
return await observeAkuma(await new AkumaOwner(addressed.id, addressed.path).status(), addressed.path, input.repo);
|
|
165
238
|
}
|
|
166
239
|
catch (error) {
|
|
167
240
|
throw observationError(addressed.id, error);
|
|
@@ -176,7 +249,7 @@ function completionMode(value) {
|
|
|
176
249
|
return value;
|
|
177
250
|
}
|
|
178
251
|
async function forwardedWait(addressed, input) {
|
|
179
|
-
return await attachWaitAssociations(addressed.path, input.repo, await
|
|
252
|
+
return await attachWaitAssociations(addressed.path, input.repo, await requestForwardedSelectionWait({
|
|
180
253
|
directory: input.directory,
|
|
181
254
|
targets: addressed.orderedIds,
|
|
182
255
|
completion: input.completion,
|
|
@@ -186,7 +259,7 @@ async function forwardedWait(addressed, input) {
|
|
|
186
259
|
}
|
|
187
260
|
async function localWait(addressed, input) {
|
|
188
261
|
try {
|
|
189
|
-
return await
|
|
262
|
+
return await composeWaitResult(addressed.path, input.repo, await executeWaitAkuma({
|
|
190
263
|
path: addressed.path,
|
|
191
264
|
ids: addressed.orderedIds,
|
|
192
265
|
completion: input.completion,
|
|
@@ -204,155 +277,99 @@ async function localWait(addressed, input) {
|
|
|
204
277
|
throw observationError(addressed.orderedIds[0], error);
|
|
205
278
|
}
|
|
206
279
|
}
|
|
207
|
-
export async function waitAkuma(input, execution = localExecutionContext()
|
|
280
|
+
export async function waitAkuma(input, execution = localExecutionContext()) {
|
|
281
|
+
return await waitAkumaOn(selectionSeam(execution), input);
|
|
282
|
+
}
|
|
283
|
+
function waitObserver(value) {
|
|
284
|
+
if (value === undefined)
|
|
285
|
+
return undefined;
|
|
286
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
287
|
+
throw new TypeError("observe must be a WaitObserver");
|
|
288
|
+
const record = value;
|
|
289
|
+
for (const key of Object.keys(record)) {
|
|
290
|
+
if (key !== "selected" && key !== "observe")
|
|
291
|
+
throw new TypeError(`observe has unknown field: ${key}`);
|
|
292
|
+
if (record[key] !== undefined && typeof record[key] !== "function")
|
|
293
|
+
throw new TypeError(`observe.${key} must be a function`);
|
|
294
|
+
}
|
|
295
|
+
return {
|
|
296
|
+
...(record.selected === undefined
|
|
297
|
+
? {}
|
|
298
|
+
: { selected: record.selected }),
|
|
299
|
+
...(record.observe === undefined
|
|
300
|
+
? {}
|
|
301
|
+
: { observe: record.observe }),
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
export async function waitAkumaOn(seam, input) {
|
|
208
305
|
const values = requireInput(input, "Akumas.wait input");
|
|
209
306
|
for (const key of Object.keys(values)) {
|
|
210
|
-
if (!["path", "akuma", "repo", "completion", "timeoutMs", "signal"].includes(key)) {
|
|
307
|
+
if (!["path", "akuma", "repo", "completion", "timeoutMs", "signal", "observe"].includes(key)) {
|
|
211
308
|
throw new TypeError(`Akumas.wait input has unknown field: ${key}`);
|
|
212
309
|
}
|
|
213
310
|
}
|
|
311
|
+
const observer = waitObserver(values.observe);
|
|
214
312
|
const selected = completionMode(values.completion);
|
|
215
313
|
const timeoutMs = timeout(values.timeoutMs);
|
|
216
314
|
const callerSignal = signal(values.signal);
|
|
217
|
-
const channel = executionChannel(execution);
|
|
218
315
|
const repo = values.repo;
|
|
219
|
-
const
|
|
316
|
+
const addressed = await seam.addressSet(setAddress(values));
|
|
317
|
+
return await seam.wait(addressed, {
|
|
220
318
|
completion: selected,
|
|
221
319
|
...(timeoutMs === undefined ? {} : { timeoutMs }),
|
|
222
320
|
...(callerSignal === undefined ? {} : { signal: callerSignal }),
|
|
223
321
|
...(repo === undefined ? {} : { repo }),
|
|
224
|
-
};
|
|
225
|
-
if (channel.kind === "body-request") {
|
|
226
|
-
// A forwarded operation resolves coordinates without proving birth: the
|
|
227
|
-
// parent Fleet owns the target, so this process never probes locally.
|
|
228
|
-
const addressed = await resolveAkumaSet(setAddress(values));
|
|
229
|
-
return await forwardedWait(addressed, { ...mode, directory: channel.directory });
|
|
230
|
-
}
|
|
231
|
-
const addressed = await addressAkumaSet(setAddress(values));
|
|
232
|
-
return await localWait(addressed, { ...mode, ...(observer === undefined ? {} : { observer }) });
|
|
322
|
+
}, observer);
|
|
233
323
|
}
|
|
234
|
-
export async function
|
|
324
|
+
export async function killAkumaOn(seam, input) {
|
|
235
325
|
const values = requireInput(input, "Akumas.kill input");
|
|
236
326
|
for (const key of Object.keys(values)) {
|
|
237
327
|
if (!["path", "akuma", "repo", "signal"].includes(key)) {
|
|
238
328
|
throw new TypeError(`Akumas.kill input has unknown field: ${key}`);
|
|
239
329
|
}
|
|
240
330
|
}
|
|
241
|
-
|
|
242
|
-
const channel = executionChannel(execution);
|
|
243
|
-
if (channel.kind === "body-request") {
|
|
244
|
-
const addressed = await resolveAkumaSet(setAddress(values));
|
|
245
|
-
return await requestForwardedFleetKill({
|
|
246
|
-
directory: channel.directory,
|
|
247
|
-
targets: addressed.orderedIds,
|
|
248
|
-
...(callerSignal === undefined ? {} : { signal: callerSignal }),
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
const addressed = await addressAkumaSet(setAddress(values));
|
|
252
|
-
return await executeKillAkuma({
|
|
253
|
-
path: addressed.path,
|
|
254
|
-
ids: addressed.orderedIds,
|
|
255
|
-
...(callerSignal === undefined ? {} : { signal: callerSignal }),
|
|
256
|
-
});
|
|
331
|
+
return await seam.kill(await seam.addressSet(setAddress(values)), signal(values.signal));
|
|
257
332
|
}
|
|
258
333
|
export async function tellAkuma(input, execution = localExecutionContext()) {
|
|
334
|
+
return await tellAkumaOn(selectionSeam(execution), input);
|
|
335
|
+
}
|
|
336
|
+
export async function tellAkumaOn(seam, input) {
|
|
259
337
|
const values = requireInput(input, "Akumas.tell input");
|
|
260
338
|
for (const key of Object.keys(values)) {
|
|
261
|
-
if (
|
|
339
|
+
if (key === "schema")
|
|
340
|
+
throw new TypeError("Akumas.tell does not accept schema; use Akumas.ask");
|
|
341
|
+
if (!["path", "akuma", "body", "repo", "interrupt", "initiator", "signal"].includes(key)) {
|
|
262
342
|
throw new TypeError(`Akumas.tell input has unknown field: ${key}`);
|
|
263
343
|
}
|
|
264
344
|
}
|
|
265
345
|
if (typeof values.body !== "string")
|
|
266
346
|
throw new TypeError("body must be a string");
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
const addressed = await resolveAkuma(directAddress(values));
|
|
271
|
-
return await requestForwardedFleetTell({
|
|
272
|
-
directory: channel.directory,
|
|
273
|
-
target: addressed.id,
|
|
274
|
-
body: values.body,
|
|
275
|
-
...(input.initiator === undefined ? {} : { initiator: input.initiator }),
|
|
276
|
-
...(callerSignal === undefined ? {} : { signal: callerSignal }),
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
const addressed = await addressAkuma(directAddress(values));
|
|
280
|
-
return await executeTellAkuma({
|
|
281
|
-
path: addressed.path,
|
|
282
|
-
id: addressed.id,
|
|
283
|
-
body: values.body,
|
|
284
|
-
...(input.initiator === undefined ? {} : { initiator: input.initiator }),
|
|
285
|
-
...(callerSignal === undefined ? {} : { signal: callerSignal }),
|
|
286
|
-
});
|
|
347
|
+
if (values.interrupt !== undefined && typeof values.interrupt !== "boolean")
|
|
348
|
+
throw new TypeError("interrupt must be a boolean");
|
|
349
|
+
return await seam.tell(await seam.addressOne(directAddress(values)), input, signal(values.signal));
|
|
287
350
|
}
|
|
288
|
-
function
|
|
351
|
+
function validateAskInput(values) {
|
|
289
352
|
for (const key of Object.keys(values)) {
|
|
290
353
|
if (!["path", "akuma", "body", "repo", "timeoutMs", "schema", "interrupt", "initiator", "signal", "observe"].includes(key)) {
|
|
291
|
-
throw new TypeError(`Akumas
|
|
354
|
+
throw new TypeError(`Akumas.ask input has unknown field: ${key}`);
|
|
292
355
|
}
|
|
293
356
|
}
|
|
294
357
|
if (typeof values.body !== "string")
|
|
295
358
|
throw new TypeError("body must be a string");
|
|
296
|
-
if (
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
359
|
+
if (values.timeoutMs !== undefined &&
|
|
360
|
+
(typeof values.timeoutMs !== "number" ||
|
|
361
|
+
!Number.isFinite(values.timeoutMs) ||
|
|
362
|
+
!Number.isInteger(values.timeoutMs) ||
|
|
363
|
+
values.timeoutMs < 0)) {
|
|
300
364
|
throw new TypeError("timeoutMs must be a nonnegative finite millisecond duration");
|
|
301
365
|
}
|
|
302
366
|
if (values.interrupt !== undefined && typeof values.interrupt !== "boolean")
|
|
303
367
|
throw new TypeError("interrupt must be a boolean");
|
|
304
368
|
}
|
|
305
|
-
export async function
|
|
306
|
-
const values = requireInput(input, "Akumas
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
const channel = executionChannel(execution);
|
|
310
|
-
if (channel.kind === "body-request") {
|
|
311
|
-
// A forwarded Tell is resolved by its serving parent, so this process must
|
|
312
|
-
// not prove the target against its own Heart files.
|
|
313
|
-
const addressed = await resolveAkuma(directAddress(values));
|
|
314
|
-
return await requestForwardedFleetTellWait({
|
|
315
|
-
directory: channel.directory,
|
|
316
|
-
target: addressed.id,
|
|
317
|
-
body: values.body,
|
|
318
|
-
timeoutMs: values.timeoutMs,
|
|
319
|
-
...(input.schema === undefined ? {} : { schema: input.schema }),
|
|
320
|
-
...(input.interrupt === true ? { interrupt: true } : {}),
|
|
321
|
-
...(input.initiator === undefined ? {} : { initiator: input.initiator }),
|
|
322
|
-
...(callerSignal === undefined ? {} : { signal: callerSignal }),
|
|
323
|
-
});
|
|
324
|
-
}
|
|
325
|
-
const addressed = await addressAkuma(directAddress(values));
|
|
326
|
-
return await executeTellWaitAkuma({
|
|
327
|
-
path: addressed.path,
|
|
328
|
-
id: addressed.id,
|
|
329
|
-
body: values.body,
|
|
330
|
-
timeoutMs: values.timeoutMs,
|
|
331
|
-
...(input.schema === undefined ? {} : { schemaJson: schemaJsonText(input.schema) }),
|
|
332
|
-
...(input.interrupt === true ? { interrupt: true } : {}),
|
|
333
|
-
...(input.initiator === undefined ? {} : { initiator: input.initiator }),
|
|
334
|
-
...(input.observe === undefined ? {} : { onObserve: input.observe }),
|
|
335
|
-
...(callerSignal === undefined ? {} : { signal: callerSignal }),
|
|
336
|
-
});
|
|
337
|
-
}
|
|
338
|
-
export async function interruptAkuma(input) {
|
|
339
|
-
const values = requireInput(input, "Akumas.interrupt input");
|
|
340
|
-
for (const key of Object.keys(values)) {
|
|
341
|
-
if (!["path", "akuma", "body", "repo", "initiator", "signal"].includes(key)) {
|
|
342
|
-
throw new TypeError(`Akumas.interrupt input has unknown field: ${key}`);
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
if (typeof values.body !== "string")
|
|
346
|
-
throw new TypeError("body must be a string");
|
|
347
|
-
const callerSignal = signal(values.signal);
|
|
348
|
-
const addressed = await addressAkuma(directAddress(values));
|
|
349
|
-
const handle = source(addressed.path).selectHandle({ id: addressed.id });
|
|
350
|
-
const receipt = await handle.interrupt(values.body, {
|
|
351
|
-
...(input.initiator === undefined ? {} : { initiator: input.initiator }),
|
|
352
|
-
...(callerSignal === undefined ? {} : { signal: callerSignal }),
|
|
353
|
-
});
|
|
354
|
-
const observation = await observeAkumaStage(addressed.path, addressed.id, values.repo);
|
|
355
|
-
return { id: addressed.id, receipt, observation };
|
|
369
|
+
export async function askAkumaOn(seam, input) {
|
|
370
|
+
const values = requireInput(input, "Akumas.ask input");
|
|
371
|
+
validateAskInput(values);
|
|
372
|
+
return await seam.ask(await seam.addressOne(directAddress(values)), input, signal(values.signal));
|
|
356
373
|
}
|
|
357
374
|
function validateHistoryInput(values) {
|
|
358
375
|
for (const key of Object.keys(values)) {
|
|
@@ -374,7 +391,7 @@ export async function historyAkuma(input) {
|
|
|
374
391
|
validateHistoryInput(values);
|
|
375
392
|
const addressed = await addressAkuma(directAddress(values));
|
|
376
393
|
try {
|
|
377
|
-
const handle =
|
|
394
|
+
const handle = new AkumaOwner(addressed.id, addressed.path);
|
|
378
395
|
const contract = await dispatchAssociation(values.repo, addressed.id);
|
|
379
396
|
if (values.last === true) {
|
|
380
397
|
const answer = await handle.lastAnswer();
|
|
@@ -29,6 +29,7 @@ export type PluginSignalMap = Readonly<{
|
|
|
29
29
|
bodySequence: number;
|
|
30
30
|
turnSequence: number;
|
|
31
31
|
initiator?: string;
|
|
32
|
+
participants?: readonly string[];
|
|
32
33
|
outcome: PluginOutcome;
|
|
33
34
|
contractId?: string;
|
|
34
35
|
}>;
|
|
@@ -37,6 +38,7 @@ export type PluginSignalMap = Readonly<{
|
|
|
37
38
|
bodySequence: number;
|
|
38
39
|
end: PluginBodyEnd;
|
|
39
40
|
initiator?: string;
|
|
41
|
+
participants?: readonly string[];
|
|
40
42
|
diagnostic?: string;
|
|
41
43
|
contractId?: string;
|
|
42
44
|
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ActiveContractRefusal } from "../core/facts/observation.js";
|
|
2
2
|
import type { GitTreeSelection } from "../git/read-observation.js";
|
|
3
3
|
import type { CompanionDecorator } from "./run.js";
|
|
4
4
|
import type { IntentOutcome, MutationOperationInput } from "./operations.js";
|
|
@@ -6,4 +6,4 @@ export declare function abandonOperation(input: MutationOperationInput & Readonl
|
|
|
6
6
|
note?: string;
|
|
7
7
|
decorateOffer?: CompanionDecorator;
|
|
8
8
|
observationSelection?: GitTreeSelection;
|
|
9
|
-
}>): Promise<IntentOutcome<void,
|
|
9
|
+
}>): Promise<IntentOutcome<void, ActiveContractRefusal>>;
|
|
@@ -11,5 +11,6 @@ export async function abandonOperation(input) {
|
|
|
11
11
|
}, decideAbandon, {
|
|
12
12
|
...(input.decorateOffer === undefined ? {} : { decorateOffer: input.decorateOffer }),
|
|
13
13
|
...(input.observationSelection === undefined ? {} : { observationSelection: input.observationSelection }),
|
|
14
|
+
...(input.progress === undefined ? {} : { progress: input.progress }),
|
|
14
15
|
}), undefined);
|
|
15
16
|
}
|
|
@@ -70,6 +70,7 @@ export async function amendOperation(input) {
|
|
|
70
70
|
attempt: attempts[index],
|
|
71
71
|
offer: decision.offer,
|
|
72
72
|
primaryContract: input.contractId,
|
|
73
|
+
...(input.progress === undefined ? {} : { progress: input.progress }),
|
|
73
74
|
});
|
|
74
75
|
if (admission.kind === "accepted") {
|
|
75
76
|
if (amendment === undefined)
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { type ArcRefusal } from "../core/verbs/arc.js";
|
|
1
|
+
import type { ActiveContractRefusal } from "../core/facts/observation.js";
|
|
3
2
|
import type { IntentOutcome, MutationOperationInput } from "./operations.js";
|
|
4
3
|
export declare function arcOperation(input: MutationOperationInput & Readonly<{
|
|
5
|
-
chapter:
|
|
6
|
-
|
|
4
|
+
chapter: Readonly<{
|
|
5
|
+
title: string;
|
|
6
|
+
body: string;
|
|
7
|
+
}>;
|
|
8
|
+
}>): Promise<IntentOutcome<void, ActiveContractRefusal>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { ProtocolProgress } from "./progress.js";
|
|
2
3
|
import { type PublicationFailed } from "../git/admission.js";
|
|
3
4
|
import { type GitDecisionObservation } from "../git/observe.js";
|
|
4
5
|
import { type PrivateStatePublicationSeat, type PrivateStateSeatCloseLag } from "../git/private-state-seat.js";
|
|
@@ -8,6 +9,7 @@ import type { GitRepository } from "../git/process.js";
|
|
|
8
9
|
import type { AttemptContext } from "../core/decide.js";
|
|
9
10
|
import type { Offer } from "../core/facts/offer.js";
|
|
10
11
|
import { type ContractId, type ContractState, type EntryUlid, type JournalEntry } from "../core/facts/types.js";
|
|
12
|
+
export declare const entryUlidSchema: z.ZodPipe<z.ZodString, z.ZodTransform<EntryUlid, string>>;
|
|
11
13
|
export declare function mintEntryUlids(count: number): readonly EntryUlid[];
|
|
12
14
|
export declare function mintAttempts(input: Readonly<{
|
|
13
15
|
entryCount: number;
|
|
@@ -53,7 +55,7 @@ export declare function admitDecidedOffer<Refusal = never>(input: Readonly<{
|
|
|
53
55
|
primaryContract: ContractId;
|
|
54
56
|
assertions?: readonly GitRefAssertion[];
|
|
55
57
|
validateAdmission?: (observation: GitDecisionObservation) => Refusal | undefined | Promise<Refusal | undefined>;
|
|
56
|
-
progress?:
|
|
58
|
+
progress?: ProtocolProgress;
|
|
57
59
|
}>): Promise<DecidedOfferResult<Refusal>>;
|
|
58
60
|
/** Classify an unknown atomic-publication outcome using only a captured Git observation. */
|
|
59
61
|
export declare function classifyUnknownAttempt(observation: Readonly<{
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
1
2
|
import { randomBytes } from "node:crypto";
|
|
2
3
|
import { encodeEntry } from "../core/facts/codec.js";
|
|
3
4
|
import { admit } from "../git/admission.js";
|
|
@@ -8,6 +9,15 @@ import { GIT_REF, readRefs } from "../git/repository.js";
|
|
|
8
9
|
import { foldJournal } from "../core/facts/fold.js";
|
|
9
10
|
import { AuthorityCorruptionError } from "../core/facts/errors.js";
|
|
10
11
|
import { entryUlid, } from "../core/facts/types.js";
|
|
12
|
+
export const entryUlidSchema = z.string().transform((value, context) => {
|
|
13
|
+
try {
|
|
14
|
+
return entryUlid(value);
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
context.addIssue({ code: "custom", message: "invalid entryUlid" });
|
|
18
|
+
return z.NEVER;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
11
21
|
const ALPHABET = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
12
22
|
const MAX_SEMANTIC_ATTEMPTS = 3;
|
|
13
23
|
function nextEntryUlid() {
|