@plurnk/plurnk-service 4.2.1 → 4.3.1
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/INSTALL.md +7 -2
- package/README.md +3 -1
- package/SPEC.md +1988 -1408
- package/dist/build-info.d.ts.map +1 -1
- package/dist/build-info.js +25 -3
- package/dist/build-info.js.map +1 -1
- package/dist/build-info.json +1 -1
- package/dist/completions/_plurnk-service +1 -1
- package/dist/completions/plurnk-service.bash +1 -1
- package/dist/completions/plurnk-service.fish +1 -0
- package/dist/content/body-preview.js.map +1 -1
- package/dist/content/byte-view.d.ts.map +1 -1
- package/dist/content/byte-view.js +3 -2
- package/dist/content/byte-view.js.map +1 -1
- package/dist/content/edit-collision.d.ts +2 -1
- package/dist/content/edit-collision.d.ts.map +1 -1
- package/dist/content/edit-collision.js.map +1 -1
- package/dist/content/edit-receipt.d.ts.map +1 -1
- package/dist/content/edit-receipt.js +28 -23
- package/dist/content/edit-receipt.js.map +1 -1
- package/dist/content/edited-span.js +1 -1
- package/dist/content/edited-span.js.map +1 -1
- package/dist/content/line-anchors.d.ts +3 -2
- package/dist/content/line-anchors.d.ts.map +1 -1
- package/dist/content/line-anchors.js +33 -19
- package/dist/content/line-anchors.js.map +1 -1
- package/dist/content/line-selection.js.map +1 -1
- package/dist/content/pattern-edits.js +1 -1
- package/dist/content/pattern-edits.js.map +1 -1
- package/dist/content/read-projector.d.ts +1 -1
- package/dist/content/read-projector.d.ts.map +1 -1
- package/dist/content/read-projector.js +10 -8
- package/dist/content/read-projector.js.map +1 -1
- package/dist/content/read-resolve.d.ts.map +1 -1
- package/dist/content/read-resolve.js +6 -5
- package/dist/content/read-resolve.js.map +1 -1
- package/dist/core/AdmittedTurnExecutor.d.ts +4 -4
- package/dist/core/AdmittedTurnExecutor.d.ts.map +1 -1
- package/dist/core/AdmittedTurnExecutor.js +20 -18
- package/dist/core/AdmittedTurnExecutor.js.map +1 -1
- package/dist/core/AmbientMembers.d.ts +1 -1
- package/dist/core/AmbientMembers.d.ts.map +1 -1
- package/dist/core/AmbientMembers.js +5 -2
- package/dist/core/AmbientMembers.js.map +1 -1
- package/dist/core/BareBatchRunner.d.ts +1 -1
- package/dist/core/BareBatchRunner.d.ts.map +1 -1
- package/dist/core/BareBatchRunner.js +2 -2
- package/dist/core/BareBatchRunner.js.map +1 -1
- package/dist/core/CapabilityPolicies.js.map +1 -1
- package/dist/core/CapabilityResolver.d.ts +1 -2
- package/dist/core/CapabilityResolver.d.ts.map +1 -1
- package/dist/core/CapabilityResolver.js +11 -7
- package/dist/core/CapabilityResolver.js.map +1 -1
- package/dist/core/ChannelWrite.d.ts +2 -2
- package/dist/core/ChannelWrite.d.ts.map +1 -1
- package/dist/core/ChannelWrite.js.map +1 -1
- package/dist/core/ChannelWrite.sql +27 -0
- package/dist/core/ClientInteractions.js.map +1 -1
- package/dist/core/ContextFit.js +1 -1
- package/dist/core/ContextFit.js.map +1 -1
- package/dist/core/CoreSchemeServices.d.ts.map +1 -1
- package/dist/core/CoreSchemeServices.js +4 -4
- package/dist/core/CoreSchemeServices.js.map +1 -1
- package/dist/core/DataStatementRunner.d.ts.map +1 -1
- package/dist/core/DataStatementRunner.js +15 -15
- package/dist/core/DataStatementRunner.js.map +1 -1
- package/dist/core/Dispatcher.d.ts +29 -5
- package/dist/core/Dispatcher.d.ts.map +1 -1
- package/dist/core/Dispatcher.js +210 -130
- package/dist/core/Dispatcher.js.map +1 -1
- package/dist/core/EditMutations.d.ts.map +1 -1
- package/dist/core/EditMutations.js +12 -6
- package/dist/core/EditMutations.js.map +1 -1
- package/dist/core/EditSequence.js.map +1 -1
- package/dist/core/Engine.d.ts +15 -7
- package/dist/core/Engine.d.ts.map +1 -1
- package/dist/core/Engine.js +32 -7
- package/dist/core/Engine.js.map +1 -1
- package/dist/core/ExecutionOutputs.js.map +1 -1
- package/dist/core/ExecutorRegistry.d.ts +1 -2
- package/dist/core/ExecutorRegistry.d.ts.map +1 -1
- package/dist/core/ExecutorRegistry.js +2 -2
- package/dist/core/ExecutorRegistry.js.map +1 -1
- package/dist/core/FileAddress.js.map +1 -1
- package/dist/core/FilePublication.d.ts.map +1 -1
- package/dist/core/FilePublication.js +6 -3
- package/dist/core/FilePublication.js.map +1 -1
- package/dist/core/FileSnapshot.d.ts.map +1 -1
- package/dist/core/FileSnapshot.js +8 -5
- package/dist/core/FileSnapshot.js.map +1 -1
- package/dist/core/KillHandler.d.ts.map +1 -1
- package/dist/core/KillHandler.js +7 -0
- package/dist/core/KillHandler.js.map +1 -1
- package/dist/core/LiveSubscription.d.ts +1 -0
- package/dist/core/LiveSubscription.d.ts.map +1 -1
- package/dist/core/LiveSubscription.js +3 -2
- package/dist/core/LiveSubscription.js.map +1 -1
- package/dist/core/LiveSubscriptions.d.ts +4 -1
- package/dist/core/LiveSubscriptions.d.ts.map +1 -1
- package/dist/core/LiveSubscriptions.js +42 -1
- package/dist/core/LiveSubscriptions.js.map +1 -1
- package/dist/core/LogBody.d.ts.map +1 -1
- package/dist/core/LogBody.js +22 -19
- package/dist/core/LogBody.js.map +1 -1
- package/dist/core/LogVisibility.d.ts +1 -1
- package/dist/core/LogVisibility.d.ts.map +1 -1
- package/dist/core/LogVisibility.js +4 -6
- package/dist/core/LogVisibility.js.map +1 -1
- package/dist/core/LogWriter.d.ts.map +1 -1
- package/dist/core/LogWriter.js +6 -9
- package/dist/core/LogWriter.js.map +1 -1
- package/dist/core/LoopDriver.d.ts +4 -4
- package/dist/core/LoopDriver.d.ts.map +1 -1
- package/dist/core/LoopDriver.js +4 -5
- package/dist/core/LoopDriver.js.map +1 -1
- package/dist/core/LoopLifecycle.d.ts +2 -0
- package/dist/core/LoopLifecycle.d.ts.map +1 -1
- package/dist/core/LoopLifecycle.js +13 -3
- package/dist/core/LoopLifecycle.js.map +1 -1
- package/dist/core/LoopLifecycle.sql +4 -4
- package/dist/core/LoopOutcome.d.ts.map +1 -1
- package/dist/core/LoopOutcome.js +2 -2
- package/dist/core/LoopOutcome.js.map +1 -1
- package/dist/core/MembershipMaterialization.d.ts.map +1 -1
- package/dist/core/MembershipMaterialization.js +29 -29
- package/dist/core/MembershipMaterialization.js.map +1 -1
- package/dist/core/MessageResources.d.ts +5 -1
- package/dist/core/MessageResources.d.ts.map +1 -1
- package/dist/core/MessageResources.js +12 -0
- package/dist/core/MessageResources.js.map +1 -1
- package/dist/core/MessageResources.sql +26 -0
- package/dist/core/MutationEffects.d.ts +1 -0
- package/dist/core/MutationEffects.d.ts.map +1 -1
- package/dist/core/MutationEffects.js +14 -10
- package/dist/core/MutationEffects.js.map +1 -1
- package/dist/core/OperationHistory.d.ts.map +1 -1
- package/dist/core/OperationHistory.js +4 -3
- package/dist/core/OperationHistory.js.map +1 -1
- package/dist/core/OperatorConfig.d.ts.map +1 -1
- package/dist/core/OperatorConfig.js +3 -2
- package/dist/core/OperatorConfig.js.map +1 -1
- package/dist/core/PacketBuilder.d.ts +3 -7
- package/dist/core/PacketBuilder.d.ts.map +1 -1
- package/dist/core/PacketBuilder.js +40 -31
- package/dist/core/PacketBuilder.js.map +1 -1
- package/dist/core/PacketBuilder.sql +11 -0
- package/dist/core/ProblemLog.d.ts +2 -5
- package/dist/core/ProblemLog.d.ts.map +1 -1
- package/dist/core/ProblemLog.js +2 -3
- package/dist/core/ProblemLog.js.map +1 -1
- package/dist/core/ProposalLifecycle.d.ts +12 -11
- package/dist/core/ProposalLifecycle.d.ts.map +1 -1
- package/dist/core/ProposalLifecycle.js +92 -84
- package/dist/core/ProposalLifecycle.js.map +1 -1
- package/dist/core/ReasoningEvent.d.ts +2 -0
- package/dist/core/ReasoningEvent.d.ts.map +1 -1
- package/dist/core/ReplyMetadata.d.ts.map +1 -1
- package/dist/core/ReplyMetadata.js +4 -3
- package/dist/core/ReplyMetadata.js.map +1 -1
- package/dist/core/ResourceBindings.d.ts +2 -2
- package/dist/core/ResourceBindings.d.ts.map +1 -1
- package/dist/core/ResourceBindings.js.map +1 -1
- package/dist/core/ResourceMutations.d.ts +1 -1
- package/dist/core/ResourceMutations.d.ts.map +1 -1
- package/dist/core/ResourceMutations.js +1 -2
- package/dist/core/ResourceMutations.js.map +1 -1
- package/dist/core/ResourceSelector.js +2 -2
- package/dist/core/ResourceSelector.js.map +1 -1
- package/dist/core/ResourceTransfers.d.ts.map +1 -1
- package/dist/core/ResourceTransfers.js +162 -120
- package/dist/core/ResourceTransfers.js.map +1 -1
- package/dist/core/SchemeRegistry.d.ts +6 -5
- package/dist/core/SchemeRegistry.d.ts.map +1 -1
- package/dist/core/SchemeRegistry.js +32 -26
- package/dist/core/SchemeRegistry.js.map +1 -1
- package/dist/core/ServiceHelp.d.ts.map +1 -1
- package/dist/core/ServiceHelp.js +2 -1
- package/dist/core/ServiceHelp.js.map +1 -1
- package/dist/core/StoredPacket.d.ts.map +1 -1
- package/dist/core/StoredPacket.js +26 -19
- package/dist/core/StoredPacket.js.map +1 -1
- package/dist/core/StrikeRail.d.ts +1 -2
- package/dist/core/StrikeRail.d.ts.map +1 -1
- package/dist/core/StrikeRail.js +4 -4
- package/dist/core/StrikeRail.js.map +1 -1
- package/dist/core/TerminalResult.d.ts +0 -2
- package/dist/core/TerminalResult.d.ts.map +1 -1
- package/dist/core/TerminalResult.js +0 -18
- package/dist/core/TerminalResult.js.map +1 -1
- package/dist/core/TokenCalibration.d.ts +4 -2
- package/dist/core/TokenCalibration.d.ts.map +1 -1
- package/dist/core/TokenCalibration.js +30 -13
- package/dist/core/TokenCalibration.js.map +1 -1
- package/dist/core/TokenCalibration.sql +7 -17
- package/dist/core/ToolResources.d.ts +2 -1
- package/dist/core/ToolResources.d.ts.map +1 -1
- package/dist/core/ToolResources.js +10 -34
- package/dist/core/ToolResources.js.map +1 -1
- package/dist/core/TurnDispositionHandler.d.ts +1 -1
- package/dist/core/TurnDispositionHandler.d.ts.map +1 -1
- package/dist/core/TurnDispositionHandler.js +7 -3
- package/dist/core/TurnDispositionHandler.js.map +1 -1
- package/dist/core/TurnMaterialization.d.ts.map +1 -1
- package/dist/core/TurnMaterialization.js +3 -2
- package/dist/core/TurnMaterialization.js.map +1 -1
- package/dist/core/TurnRunner.d.ts +13 -12
- package/dist/core/TurnRunner.d.ts.map +1 -1
- package/dist/core/TurnRunner.js +198 -230
- package/dist/core/TurnRunner.js.map +1 -1
- package/dist/core/TurnRunner.sql +3 -3
- package/dist/core/WorkerOwners.js.map +1 -1
- package/dist/core/caps/DbEntryCaps.js.map +1 -1
- package/dist/core/caps/DbMessageCaps.d.ts +3 -3
- package/dist/core/caps/DbMessageCaps.d.ts.map +1 -1
- package/dist/core/caps/DbProjectionCaps.js +1 -1
- package/dist/core/caps/DbProjectionCaps.js.map +1 -1
- package/dist/core/caps/DbSubscriptionCaps.d.ts.map +1 -1
- package/dist/core/caps/DbSubscriptionCaps.js +1 -0
- package/dist/core/caps/DbSubscriptionCaps.js.map +1 -1
- package/dist/core/caps/SchemeCtxImpl.d.ts.map +1 -1
- package/dist/core/caps/SchemeCtxImpl.js +4 -1
- package/dist/core/caps/SchemeCtxImpl.js.map +1 -1
- package/dist/core/env-catalog.js.map +1 -1
- package/dist/core/env-defaults.d.ts.map +1 -1
- package/dist/core/env-defaults.js +5 -3
- package/dist/core/env-defaults.js.map +1 -1
- package/dist/core/file-creation-policy.d.ts.map +1 -1
- package/dist/core/file-creation-policy.js +2 -1
- package/dist/core/file-creation-policy.js.map +1 -1
- package/dist/core/file-materialization.d.ts.map +1 -1
- package/dist/core/file-materialization.js +9 -11
- package/dist/core/file-materialization.js.map +1 -1
- package/dist/core/git-env.d.ts +1 -0
- package/dist/core/git-env.d.ts.map +1 -1
- package/dist/core/git-env.js +34 -3
- package/dist/core/git-env.js.map +1 -1
- package/dist/core/git-membership.d.ts +5 -0
- package/dist/core/git-membership.d.ts.map +1 -1
- package/dist/core/git-membership.js +55 -21
- package/dist/core/git-membership.js.map +1 -1
- package/dist/core/git-state.d.ts.map +1 -1
- package/dist/core/git-state.js +1 -0
- package/dist/core/git-state.js.map +1 -1
- package/dist/core/packet-wire.d.ts +26 -27
- package/dist/core/packet-wire.d.ts.map +1 -1
- package/dist/core/packet-wire.js +154 -132
- package/dist/core/packet-wire.js.map +1 -1
- package/dist/core/results.d.ts +9 -4
- package/dist/core/results.d.ts.map +1 -1
- package/dist/core/results.js +14 -1
- package/dist/core/results.js.map +1 -1
- package/dist/core/runtime-floor.d.ts +8 -0
- package/dist/core/runtime-floor.d.ts.map +1 -0
- package/dist/core/runtime-floor.js +40 -0
- package/dist/core/runtime-floor.js.map +1 -0
- package/dist/core/runtime-guard.d.ts +2 -0
- package/dist/core/runtime-guard.d.ts.map +1 -0
- package/dist/core/runtime-guard.js +5 -0
- package/dist/core/runtime-guard.js.map +1 -0
- package/dist/core/sqlite-synchronous.d.ts +1 -1
- package/dist/core/sqlite-synchronous.d.ts.map +1 -1
- package/dist/core/sqlite-synchronous.js.map +1 -1
- package/dist/core/statement-primary.d.ts +2 -2
- package/dist/core/statement-primary.d.ts.map +1 -1
- package/dist/core/statement-primary.js.map +1 -1
- package/dist/core/workspace-settings.js +1 -1
- package/dist/core/workspace-settings.js.map +1 -1
- package/dist/evidence/EvidenceReader.d.ts.map +1 -1
- package/dist/evidence/EvidenceReader.js +20 -6
- package/dist/evidence/EvidenceReader.js.map +1 -1
- package/dist/launch/Launch.d.ts +1 -0
- package/dist/launch/Launch.d.ts.map +1 -1
- package/dist/launch/Launch.js +28 -12
- package/dist/launch/Launch.js.map +1 -1
- package/dist/man/plurnk-service.1 +6 -2
- package/dist/schemes/EffectPolicy.js +1 -1
- package/dist/schemes/EffectPolicy.js.map +1 -1
- package/dist/schemes/Env.d.ts +1 -1
- package/dist/schemes/Env.d.ts.map +1 -1
- package/dist/schemes/Env.js +7 -1
- package/dist/schemes/Env.js.map +1 -1
- package/dist/schemes/Exec.d.ts +10 -12
- package/dist/schemes/Exec.d.ts.map +1 -1
- package/dist/schemes/Exec.js +337 -437
- package/dist/schemes/Exec.js.map +1 -1
- package/dist/schemes/ExecOutputScheme.d.ts +4 -6
- package/dist/schemes/ExecOutputScheme.d.ts.map +1 -1
- package/dist/schemes/ExecOutputScheme.js +17 -17
- package/dist/schemes/ExecOutputScheme.js.map +1 -1
- package/dist/schemes/ExecScheduler.d.ts.map +1 -1
- package/dist/schemes/ExecScheduler.js +1 -2
- package/dist/schemes/ExecScheduler.js.map +1 -1
- package/dist/schemes/ExecutionInput.js +3 -3
- package/dist/schemes/ExecutionInput.js.map +1 -1
- package/dist/schemes/File.d.ts +3 -18
- package/dist/schemes/File.d.ts.map +1 -1
- package/dist/schemes/File.js +136 -79
- package/dist/schemes/File.js.map +1 -1
- package/dist/schemes/Log.d.ts.map +1 -1
- package/dist/schemes/Log.js +193 -161
- package/dist/schemes/Log.js.map +1 -1
- package/dist/schemes/QuestionTool.d.ts.map +1 -1
- package/dist/schemes/QuestionTool.js +6 -8
- package/dist/schemes/QuestionTool.js.map +1 -1
- package/dist/schemes/ResourceTreeScheme.d.ts.map +1 -1
- package/dist/schemes/ResourceTreeScheme.js +2 -2
- package/dist/schemes/ResourceTreeScheme.js.map +1 -1
- package/dist/schemes/TurnSource.js +3 -3
- package/dist/schemes/TurnSource.js.map +1 -1
- package/dist/schemes/Worker.js.map +1 -1
- package/dist/schemes/_entry-crud.d.ts.map +1 -1
- package/dist/schemes/_entry-crud.js +4 -2
- package/dist/schemes/_entry-crud.js.map +1 -1
- package/dist/schemes/_entry-find.d.ts.map +1 -1
- package/dist/schemes/_entry-find.js +187 -139
- package/dist/schemes/_entry-find.js.map +1 -1
- package/dist/schemes/_entry-manifest.js +1 -1
- package/dist/schemes/_entry-manifest.js.map +1 -1
- package/dist/schemes/_entry-ops.js.map +1 -1
- package/dist/schemes/_search-index.js.map +1 -1
- package/dist/schemes/exec-entry-sink.d.ts +30 -0
- package/dist/schemes/exec-entry-sink.d.ts.map +1 -0
- package/dist/schemes/exec-entry-sink.js +238 -0
- package/dist/schemes/exec-entry-sink.js.map +1 -0
- package/dist/schemes/exec-lifetime.d.ts.map +1 -1
- package/dist/schemes/exec-lifetime.js +5 -2
- package/dist/schemes/exec-lifetime.js.map +1 -1
- package/dist/server/ClientOperations.d.ts +45 -0
- package/dist/server/ClientOperations.d.ts.map +1 -0
- package/dist/server/ClientOperations.js +192 -0
- package/dist/server/ClientOperations.js.map +1 -0
- package/dist/server/ClientReads.d.ts +13 -5
- package/dist/server/ClientReads.d.ts.map +1 -1
- package/dist/server/ClientReads.js +108 -21
- package/dist/server/ClientReads.js.map +1 -1
- package/dist/server/Credentials.js +2 -2
- package/dist/server/Credentials.js.map +1 -1
- package/dist/server/Daemon.d.ts +40 -28
- package/dist/server/Daemon.d.ts.map +1 -1
- package/dist/server/Daemon.js +255 -839
- package/dist/server/Daemon.js.map +1 -1
- package/dist/server/DaemonLock.d.ts +2 -0
- package/dist/server/DaemonLock.d.ts.map +1 -1
- package/dist/server/DaemonLock.js +10 -1
- package/dist/server/DaemonLock.js.map +1 -1
- package/dist/server/DaemonModules.d.ts +39 -0
- package/dist/server/DaemonModules.d.ts.map +1 -0
- package/dist/server/DaemonModules.js +219 -0
- package/dist/server/DaemonModules.js.map +1 -0
- package/dist/server/DrainSupervisor.d.ts +4 -2
- package/dist/server/DrainSupervisor.d.ts.map +1 -1
- package/dist/server/DrainSupervisor.js +318 -290
- package/dist/server/DrainSupervisor.js.map +1 -1
- package/dist/server/EnvFunctionality.d.ts +10 -7
- package/dist/server/EnvFunctionality.d.ts.map +1 -1
- package/dist/server/EnvFunctionality.js +6 -5
- package/dist/server/EnvFunctionality.js.map +1 -1
- package/dist/server/Functionality.d.ts +8 -6
- package/dist/server/Functionality.d.ts.map +1 -1
- package/dist/server/Functionality.js +110 -32
- package/dist/server/Functionality.js.map +1 -1
- package/dist/server/FunctionalityManager.d.ts.map +1 -1
- package/dist/server/FunctionalityManager.js +16 -2
- package/dist/server/FunctionalityManager.js.map +1 -1
- package/dist/server/HttpListener.d.ts.map +1 -1
- package/dist/server/HttpListener.js +28 -8
- package/dist/server/HttpListener.js.map +1 -1
- package/dist/server/MembersFunctionality.d.ts +19 -7
- package/dist/server/MembersFunctionality.d.ts.map +1 -1
- package/dist/server/MembersFunctionality.js +30 -16
- package/dist/server/MembersFunctionality.js.map +1 -1
- package/dist/server/MessageDelivery.d.ts +43 -0
- package/dist/server/MessageDelivery.d.ts.map +1 -0
- package/dist/server/MessageDelivery.js +186 -0
- package/dist/server/MessageDelivery.js.map +1 -0
- package/dist/server/ModuleHost.d.ts +3 -3
- package/dist/server/ModuleHost.d.ts.map +1 -1
- package/dist/server/Places.d.ts +19 -0
- package/dist/server/Places.d.ts.map +1 -0
- package/dist/server/Places.js +76 -0
- package/dist/server/Places.js.map +1 -0
- package/dist/server/PluginSources.d.ts.map +1 -1
- package/dist/server/PluginSources.js +2 -1
- package/dist/server/PluginSources.js.map +1 -1
- package/dist/server/PlurnkSkill.d.ts.map +1 -1
- package/dist/server/PlurnkSkill.js +5 -4
- package/dist/server/PlurnkSkill.js.map +1 -1
- package/dist/server/Rollback.d.ts.map +1 -1
- package/dist/server/Rollback.js +2 -1
- package/dist/server/Rollback.js.map +1 -1
- package/dist/server/WorkerModels.d.ts +87 -0
- package/dist/server/WorkerModels.d.ts.map +1 -0
- package/dist/server/WorkerModels.js +540 -0
- package/dist/server/WorkerModels.js.map +1 -0
- package/dist/server/WorkerOverview.d.ts +22 -0
- package/dist/server/WorkerOverview.d.ts.map +1 -0
- package/dist/server/WorkerOverview.js +42 -0
- package/dist/server/WorkerOverview.js.map +1 -0
- package/dist/server/WorkspacePlugins.d.ts +1 -1
- package/dist/server/WorkspacePlugins.d.ts.map +1 -1
- package/dist/server/WorkspacePlugins.js +0 -1
- package/dist/server/WorkspacePlugins.js.map +1 -1
- package/dist/server/WorkspaceResidency.d.ts +3 -3
- package/dist/server/WorkspaceResidency.d.ts.map +1 -1
- package/dist/server/WorkspaceResidency.js.map +1 -1
- package/dist/server/client-input.d.ts +2 -2
- package/dist/server/client-input.d.ts.map +1 -1
- package/dist/server/client-input.js +19 -12
- package/dist/server/client-input.js.map +1 -1
- package/dist/server/envelope.d.ts +4 -1
- package/dist/server/envelope.d.ts.map +1 -1
- package/dist/server/envelope.js +7 -3
- package/dist/server/envelope.js.map +1 -1
- package/dist/server/envelope.sql +10 -6
- package/dist/server/logEntry.d.ts +38 -1
- package/dist/server/logEntry.d.ts.map +1 -1
- package/dist/server/logEntry.js +9 -9
- package/dist/server/logEntry.js.map +1 -1
- package/dist/server/logEntry.sql +4 -2
- package/dist/server/loopDocs.d.ts.map +1 -1
- package/dist/server/loopDocs.js +11 -2
- package/dist/server/loopDocs.js.map +1 -1
- package/dist/server/module-discovery.d.ts +2 -3
- package/dist/server/module-discovery.d.ts.map +1 -1
- package/dist/server/module-discovery.js +6 -6
- package/dist/server/module-discovery.js.map +1 -1
- package/dist/server/places.sql +83 -0
- package/dist/server/seam-loop.sql +8 -0
- package/dist/server/worker-overview.sql +57 -0
- package/dist/service.d.ts +1 -0
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +35 -9
- package/dist/service.js.map +1 -1
- package/docs/members.md +11 -21
- package/migrations/033_hidden_places.sql +10 -0
- package/package.json +52 -61
- package/dist/core/ToolInputSchema.d.ts +0 -7
- package/dist/core/ToolInputSchema.d.ts.map +0 -1
- package/dist/core/ToolInputSchema.js +0 -65
- package/dist/core/ToolInputSchema.js.map +0 -1
- package/dist/observe/init.d.ts +0 -8
- package/dist/observe/init.d.ts.map +0 -1
- package/dist/observe/init.js +0 -163
- package/dist/observe/init.js.map +0 -1
- package/dist/server/WorkerModelResolver.d.ts +0 -20
- package/dist/server/WorkerModelResolver.d.ts.map +0 -1
- package/dist/server/WorkerModelResolver.js +0 -200
- package/dist/server/WorkerModelResolver.js.map +0 -1
package/dist/core/Dispatcher.js
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
import { parsePath } from "@plurnk/plurnk-parser";
|
|
2
2
|
import { ConfigurationError, Knob } from "@plurnk/plurnk-meta";
|
|
3
3
|
import AmbientMembers from "./AmbientMembers.js";
|
|
4
|
-
import { TurnDisposition, UNKNOWN_POSITION } from "@plurnk/plurnk-contracts";
|
|
4
|
+
import { TurnDisposition, UNKNOWN_POSITION, PathSyntax, Validator, isExecution, isRecord } from "@plurnk/plurnk-contracts";
|
|
5
5
|
import Turn from "./Turn.js";
|
|
6
6
|
import { entryAddress, foldAuthorityIntoPath, renderAddress, renderAuthoredTarget, renderTarget, schemeNameOf } from "./plurnk-uri.js";
|
|
7
7
|
import WorkerName from "./WorkerName.js";
|
|
8
|
-
import { PathSyntax } from "@plurnk/plurnk-contracts";
|
|
9
8
|
import Namespace from "./namespace.js";
|
|
10
9
|
import FileAddress from "./FileAddress.js";
|
|
11
10
|
import CapabilityResolver from "./CapabilityResolver.js";
|
|
12
11
|
import SchemeCtxImpl from "./caps/SchemeCtxImpl.js";
|
|
13
|
-
import
|
|
14
|
-
import Results from "./results.js";
|
|
15
|
-
import { OperationFailureError } from "./results.js";
|
|
12
|
+
import DbMessageCaps from "./caps/DbMessageCaps.js";
|
|
13
|
+
import Results, { OperationFailureError } from "./results.js";
|
|
16
14
|
import EffectPolicy from "../schemes/EffectPolicy.js";
|
|
17
|
-
import { CoreSchemeAdapterBase } from "./CoreSchemeServices.js";
|
|
15
|
+
import { CoreSchemeAdapterBase, coreRepresentationProvider } from "./CoreSchemeServices.js";
|
|
18
16
|
import { InvalidOperationResultError, MessageAttachments } from "@plurnk/plurnk-schemes";
|
|
19
17
|
import ResourceMutations from "./ResourceMutations.js";
|
|
20
18
|
import ResourceSelector from "./ResourceSelector.js";
|
|
21
19
|
import { primaryTargetOf } from "./statement-primary.js";
|
|
22
20
|
import LogBody from "./LogBody.js";
|
|
23
21
|
import BodyPreview from "../content/body-preview.js";
|
|
22
|
+
import LineSelection from "../content/line-selection.js";
|
|
24
23
|
import ReadResolve from "../content/read-resolve.js";
|
|
25
24
|
import LogVisibility from "./LogVisibility.js";
|
|
26
25
|
import PacketWire, {} from "./packet-wire.js";
|
|
@@ -37,13 +36,16 @@ import LogEntryProjection from "./LogEntryProjection.js";
|
|
|
37
36
|
import DurableStatement from "./DurableStatement.js";
|
|
38
37
|
import DataStatementRunner from "./DataStatementRunner.js";
|
|
39
38
|
import ResourceBindings from "./ResourceBindings.js";
|
|
40
|
-
import { isExecution } from "@plurnk/plurnk-contracts";
|
|
41
39
|
// SPEC {§scheme-surface}: writer must be in target scheme's manifest.writableBy.
|
|
42
40
|
// READ/FIND are not gated — they read, never mutating an entry.
|
|
43
41
|
const MUTATING_OPS = new Set(["EDIT", "SEND", "COPY", "MOVE", "KILL", "FORK", "WORK"]);
|
|
44
42
|
// Op dispatch ({§op-methods-op-dispatch}): admission, operation-owner routing,
|
|
45
43
|
// durable log writing, and proposal lifecycle.
|
|
46
44
|
export default class Dispatcher {
|
|
45
|
+
// {§log-kill-distillation} The log scheme curates: the hook the registry's log handler publishes.
|
|
46
|
+
static #curates(handler) {
|
|
47
|
+
return "curate" in handler && typeof handler.curate === "function";
|
|
48
|
+
}
|
|
47
49
|
static #failure(code, status, detail, fields = {}, extensions = {}) {
|
|
48
50
|
return Results.failure("engine:dispatcher", code, status, detail, fields, extensions);
|
|
49
51
|
}
|
|
@@ -275,7 +277,7 @@ export default class Dispatcher {
|
|
|
275
277
|
if (schemeName === null || schemeName === "log")
|
|
276
278
|
return null;
|
|
277
279
|
const handler = this.#schemes.get(schemeName, workspaceId);
|
|
278
|
-
if (handler === undefined || typeof handler.kill === "function")
|
|
280
|
+
if (handler === undefined || ("kill" in handler && typeof handler.kill === "function"))
|
|
279
281
|
return null;
|
|
280
282
|
const edit = {
|
|
281
283
|
op: "EDIT",
|
|
@@ -347,7 +349,9 @@ export default class Dispatcher {
|
|
|
347
349
|
this.#loopSignal(context.loopId)?.throwIfAborted();
|
|
348
350
|
const execution = await ResourceBindings.using(this.#schemes, this.#buildSchemeCtx(context), (ctx) => this.#dispatchOne(context, ctx, targetsResolved));
|
|
349
351
|
let { result } = execution;
|
|
350
|
-
const edit = context.statement.op === "EDIT"
|
|
352
|
+
const edit = context.statement.op === "EDIT"
|
|
353
|
+
? context.statement
|
|
354
|
+
: context.statement.op === "KILL" ? this.#scopedEntryEdits.get(context.statement) : undefined;
|
|
351
355
|
if (edit !== undefined) {
|
|
352
356
|
// {§edit-batch-merges} — a proposal's apply result replaces the projected one; the
|
|
353
357
|
// statement's merge facts ride every EDIT result, whichever route produced it.
|
|
@@ -360,13 +364,13 @@ export default class Dispatcher {
|
|
|
360
364
|
// environment is the model's to retire, never the daemon's to drop.
|
|
361
365
|
const distillation = Dispatcher.#distillationOf(context.statement);
|
|
362
366
|
if (distillation !== null) {
|
|
363
|
-
const note = { op: "NOTE", aside: null, metadata: null, target: null, lineMarker: null, body: distillation, position: context.statement.position };
|
|
364
|
-
this.#distillations.set(note,
|
|
367
|
+
const note = { op: "NOTE", aside: null, metadata: null, target: null, lineMarker: null, body: distillation.body, position: context.statement.position };
|
|
368
|
+
this.#distillations.set(note, distillation.target);
|
|
365
369
|
const noteContext = { ...context, statement: note, sequence: context.sequence + 1 };
|
|
366
370
|
delete noteContext.fanout;
|
|
367
371
|
delete noteContext.emissionIndex;
|
|
368
372
|
await ResourceBindings.using(this.#schemes, this.#buildSchemeCtx(noteContext), (ctx) => this.#dispatchOne(noteContext, ctx));
|
|
369
|
-
result = Results.assert({ ...result, rowsWritten: (result
|
|
373
|
+
result = Results.assert({ ...result, rowsWritten: Results.rowsWritten(result) + 1 });
|
|
370
374
|
}
|
|
371
375
|
return { ...execution, result };
|
|
372
376
|
}
|
|
@@ -382,9 +386,17 @@ export default class Dispatcher {
|
|
|
382
386
|
return Results.failure("grammar:matcher", "unreadable-pattern", 400, unreadable.message, {}, { stage: "matcher", recovery: unreadable.recovery, retryable: false });
|
|
383
387
|
}
|
|
384
388
|
static #distillationOf(statement) {
|
|
385
|
-
if (statement.op !== "KILL" || schemeNameOf(statement.target) !== "log" || typeof statement.body !== "string")
|
|
389
|
+
if (statement.op !== "KILL" || statement.target === null || schemeNameOf(statement.target) !== "log" || typeof statement.body !== "string")
|
|
386
390
|
return null;
|
|
387
|
-
return statement.body.trim() === "" ? null : statement.body;
|
|
391
|
+
return statement.body.trim() === "" ? null : { body: statement.body, target: statement.target.raw };
|
|
392
|
+
}
|
|
393
|
+
// {§bulk-resource-targeting} — the paths a FIND matched: each catalog item's, never a scope group's.
|
|
394
|
+
static #matchedPaths(results) {
|
|
395
|
+
const items = Array.isArray(results) ? results : [];
|
|
396
|
+
return items.flatMap((item) => {
|
|
397
|
+
const head = Array.isArray(item) ? item[0] : undefined;
|
|
398
|
+
return isRecord(head) && !("items" in head) && typeof head.path === "string" ? [head.path] : [];
|
|
399
|
+
});
|
|
388
400
|
}
|
|
389
401
|
static #globTarget(target) {
|
|
390
402
|
if (target === null)
|
|
@@ -402,7 +414,7 @@ export default class Dispatcher {
|
|
|
402
414
|
if (found.status >= 400)
|
|
403
415
|
return { result: found };
|
|
404
416
|
const paths = found.status < 300
|
|
405
|
-
? (found.results
|
|
417
|
+
? Dispatcher.#matchedPaths(found.results)
|
|
406
418
|
: [];
|
|
407
419
|
const matched = typeof found.matchingPathCount === "number" ? found.matchingPathCount : paths.length;
|
|
408
420
|
if (survey.lineMarker !== null && matched !== paths.length) {
|
|
@@ -421,7 +433,7 @@ export default class Dispatcher {
|
|
|
421
433
|
if (statement.op === "COPY" || statement.op === "MOVE") {
|
|
422
434
|
if (![statement.source, statement.destination].some(({ target }) => Dispatcher.#globTarget(target)))
|
|
423
435
|
return null;
|
|
424
|
-
|
|
436
|
+
const resolved = { ...statement };
|
|
425
437
|
for (const operand of ["source", "destination"]) {
|
|
426
438
|
const selection = statement[operand];
|
|
427
439
|
if (!Dispatcher.#globTarget(selection.target))
|
|
@@ -434,7 +446,7 @@ export default class Dispatcher {
|
|
|
434
446
|
return found;
|
|
435
447
|
if (found.targets.length !== 1)
|
|
436
448
|
return { result: Dispatcher.#failure("target-cardinality", 400, `${statement.op} ${operand} matched ${found.matched} resources; expected one.`, {}, { operand, matchingPathCount: found.matched, recovery: "Name one source and one destination per pair.", retryable: false }) };
|
|
437
|
-
resolved
|
|
449
|
+
resolved[operand] = { ...selection, target: found.targets[0] };
|
|
438
450
|
}
|
|
439
451
|
return { statements: [resolved] };
|
|
440
452
|
}
|
|
@@ -473,7 +485,7 @@ export default class Dispatcher {
|
|
|
473
485
|
...(context.fit === undefined ? {} : { fit: reserved(context.fit, admitted.length - index - 1) }),
|
|
474
486
|
}, true);
|
|
475
487
|
results.push(result);
|
|
476
|
-
rowsWritten +=
|
|
488
|
+
rowsWritten += Results.rowsWritten(result);
|
|
477
489
|
if (context.failOnOperationError && result.status >= 400 && !isContextReceipt(result))
|
|
478
490
|
break;
|
|
479
491
|
}
|
|
@@ -488,6 +500,54 @@ export default class Dispatcher {
|
|
|
488
500
|
}
|
|
489
501
|
async #dispatchOne(context, schemeCtx, targetsResolved = false) {
|
|
490
502
|
const { statement, workspaceId, workerId, loopId, turnId, sequence, origin, onDispatch, } = context;
|
|
503
|
+
const routed = await this.#route(context, schemeCtx, targetsResolved);
|
|
504
|
+
let { result } = routed;
|
|
505
|
+
const { resolved, curationPlan } = routed;
|
|
506
|
+
// Child dispatch includes persistence and proposal settlement; their failures are
|
|
507
|
+
// internal, not exceptions from a scheme handler.
|
|
508
|
+
if (resolved !== null)
|
|
509
|
+
return this.#dispatchSelection(context, resolved);
|
|
510
|
+
if (result === undefined)
|
|
511
|
+
throw new Error("Operation dispatch produced neither targets nor a result.");
|
|
512
|
+
result = await this.#fitResult(context, statement, result);
|
|
513
|
+
// {§configuration-repair-path}: decide admission before persisting a proposed row.
|
|
514
|
+
const admission = this.#proposalAdmission(statement, result, workspaceId, origin);
|
|
515
|
+
const { autoAccept } = admission;
|
|
516
|
+
result = admission.result;
|
|
517
|
+
// {§bulk-resource-targeting} — a row on behalf of a glob names the statement it came from.
|
|
518
|
+
if (context.fanout !== undefined) {
|
|
519
|
+
const attrs = isRecord(result.attrs) ? result.attrs : {};
|
|
520
|
+
result = { ...result, attrs: { ...attrs, fanout: context.fanout } };
|
|
521
|
+
}
|
|
522
|
+
// Persist log curation for forensics; packet rendering suppresses its
|
|
523
|
+
// successful receipts while the exact state effects remain durable.
|
|
524
|
+
// A running-worker READ arms this turn's blocking collect.
|
|
525
|
+
// {§join-blocking-collect}
|
|
526
|
+
const logEntryId = await this.#logWriter.writeLog({
|
|
527
|
+
statement,
|
|
528
|
+
emissionIndex: context.emissionIndex,
|
|
529
|
+
result,
|
|
530
|
+
workspaceId,
|
|
531
|
+
workerId,
|
|
532
|
+
loopId,
|
|
533
|
+
turnId,
|
|
534
|
+
sequence,
|
|
535
|
+
origin,
|
|
536
|
+
curationPlan,
|
|
537
|
+
modelCallId: null,
|
|
538
|
+
});
|
|
539
|
+
onDispatch?.(logEntryId);
|
|
540
|
+
// {§proposal-202-pauses} A 202 that proposes (a WAIT parks instead — #isProposal) settles in its own step.
|
|
541
|
+
if (Dispatcher.#isProposal(statement, result))
|
|
542
|
+
return this.#settleProposedRow(context, schemeCtx, result, logEntryId, autoAccept);
|
|
543
|
+
await this.#notifySettled(context, logEntryId);
|
|
544
|
+
return Dispatcher.#singleExecution(result);
|
|
545
|
+
}
|
|
546
|
+
// {§op-methods-op-dispatch} The operation's owner, by statement: a refusal first — an unwritable target, a denied
|
|
547
|
+
// capability, an unreadable matcher — then the one handler whose result is the row's, or the target selection a
|
|
548
|
+
// glob resolves to. A scheme handler's exception is the row's 500 ({§scheme-surface-exception-500}), never a throw.
|
|
549
|
+
async #route(context, schemeCtx, targetsResolved) {
|
|
550
|
+
const { statement, workspaceId, workerId, loopId, turnId, sequence, origin } = context;
|
|
491
551
|
let result;
|
|
492
552
|
let resolved = null;
|
|
493
553
|
let curationPlan = null;
|
|
@@ -582,17 +642,15 @@ export default class Dispatcher {
|
|
|
582
642
|
}
|
|
583
643
|
}
|
|
584
644
|
}
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
result = await this.#fitResult(context, statement, result);
|
|
592
|
-
// {§configuration-repair-path}: decide admission before persisting a proposed row.
|
|
645
|
+
return { result, resolved, curationPlan };
|
|
646
|
+
}
|
|
647
|
+
// {§configuration-repair-path} {§runtime-bookkeeping-policy} Whether a proposal settles itself under the effect
|
|
648
|
+
// policy, decided before its row is persisted: an execution or a runtime-scheme SEND must declare its effect, the
|
|
649
|
+
// runtime actor never grants itself authority, and a policy the configuration cannot read is the row's failure.
|
|
650
|
+
#proposalAdmission(statement, result, workspaceId, origin) {
|
|
593
651
|
let autoAccept = false;
|
|
594
652
|
if (Dispatcher.#isProposal(statement, result)) {
|
|
595
|
-
const effect = result.attrs
|
|
653
|
+
const effect = isRecord(result.attrs) ? result.attrs.effect : undefined;
|
|
596
654
|
const mustDeclareEffect = isExecution(statement) || (statement.op === "SEND"
|
|
597
655
|
&& this.#schemes.isRuntimeScheme(schemeNameOf(statement.target) ?? "", workspaceId));
|
|
598
656
|
if (mustDeclareEffect || effect !== undefined) {
|
|
@@ -610,80 +668,18 @@ export default class Dispatcher {
|
|
|
610
668
|
}
|
|
611
669
|
}
|
|
612
670
|
}
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
result,
|
|
626
|
-
workspaceId,
|
|
627
|
-
workerId,
|
|
628
|
-
loopId,
|
|
629
|
-
turnId,
|
|
630
|
-
sequence,
|
|
631
|
-
origin,
|
|
632
|
-
curationPlan,
|
|
633
|
-
modelCallId: null,
|
|
634
|
-
});
|
|
635
|
-
onDispatch?.(logEntryId);
|
|
636
|
-
// Proposal lifecycle (SPEC.md {§engine-rails} + {§methods-proposal-resolve}; {§proposal-202-pauses}). When a
|
|
637
|
-
// side-effecting op returns status 202 (a WAIT parks rather
|
|
638
|
-
// than proposing — #isProposal), the entry is written
|
|
639
|
-
// state='proposed'; dispatch then PAUSES on a per-entry waiter until
|
|
640
|
-
// resolution arrives via Engine.resolveProposal (from a client-interface resume,
|
|
641
|
-
// core-owned disposition, or timeout). The post-resolution status replaces 202 in the
|
|
642
|
-
// result the caller sees, so runTurn never branches on a pending state.
|
|
643
|
-
if (Dispatcher.#isProposal(statement, result)) {
|
|
644
|
-
if (autoAccept) {
|
|
645
|
-
await this.#proposals.recordDecision(logEntryId, { decision: "accept" });
|
|
646
|
-
const initialSettlement = await this.#applyProposal(context, schemeCtx, result, { decision: "accept" }, logEntryId);
|
|
647
|
-
const effective = await this.#resourceMutations.settleProposal({
|
|
648
|
-
statement,
|
|
649
|
-
result,
|
|
650
|
-
settlement: initialSettlement,
|
|
651
|
-
ctx: schemeCtx,
|
|
652
|
-
ids: { workspaceId, workerId, loopId, turnId, logEntryId },
|
|
653
|
-
});
|
|
654
|
-
const post = await this.#proposals.applyResolution(logEntryId, effective);
|
|
655
|
-
await this.#notifySettled(context, logEntryId);
|
|
656
|
-
return Dispatcher.#singleExecution(post);
|
|
657
|
-
}
|
|
658
|
-
// Register the resolution waiter SYNCHRONOUSLY before any await
|
|
659
|
-
// yields. A same-tick resolveProposal() (e.g. from a test that
|
|
660
|
-
// awaits the onDispatch callback and immediately resolves) must
|
|
661
|
-
// find the waiter registered — adding an await between insert
|
|
662
|
-
// and waiter-registration would open a race window.
|
|
663
|
-
// Core derives one validated projection from the durable row for both
|
|
664
|
-
// this live event and reconnect discovery ({§proposal-projection}). Its
|
|
665
|
-
// disposition is also the one automatic settlement decision: policy is
|
|
666
|
-
// not an observer and cannot silently degrade into client ownership.
|
|
667
|
-
let resolutionPromise;
|
|
668
|
-
try {
|
|
669
|
-
resolutionPromise = this.#proposals.awaitResolution(logEntryId, this.#loopSignal(loopId));
|
|
670
|
-
const event = await this.#proposals.pending(logEntryId);
|
|
671
|
-
if (event !== null) {
|
|
672
|
-
this.#proposals.settleOwned(event);
|
|
673
|
-
this.#proposals.notifyPending(event);
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
catch (cause) {
|
|
677
|
-
await this.#proposals.failPreparation(logEntryId, cause);
|
|
678
|
-
await this.#notifySettled(context, logEntryId);
|
|
679
|
-
throw cause;
|
|
680
|
-
}
|
|
681
|
-
const resolution = await resolutionPromise;
|
|
682
|
-
// Run the scheme's applyResolution hook on accept (writes the
|
|
683
|
-
// file, spawns the process, etc.). Its operation result is
|
|
684
|
-
// preserved: an apply failure keeps its original status and
|
|
685
|
-
// Problem Details instead of masquerading as a client rejection.
|
|
686
|
-
const initialSettlement = await this.#applyProposal(context, schemeCtx, result, resolution, logEntryId);
|
|
671
|
+
return { autoAccept, result };
|
|
672
|
+
}
|
|
673
|
+
// Proposal lifecycle (SPEC.md {§engine-rails} + {§methods-proposal-resolve}; {§proposal-202-pauses}). A
|
|
674
|
+
// side-effecting op that returned 202 was written state='proposed'; an automatic acceptance applies at once,
|
|
675
|
+
// otherwise dispatch PAUSES on a per-entry waiter until resolution arrives via Engine.resolveProposal (a client
|
|
676
|
+
// resume, core-owned disposition, or timeout). The post-resolution status replaces 202 in the result the caller
|
|
677
|
+
// sees, so runTurn never branches on a pending state.
|
|
678
|
+
async #settleProposedRow(context, schemeCtx, result, logEntryId, autoAccept) {
|
|
679
|
+
const { statement, workspaceId, workerId, loopId, turnId } = context;
|
|
680
|
+
if (autoAccept) {
|
|
681
|
+
await this.#proposals.recordDecision(logEntryId, { decision: "accept" });
|
|
682
|
+
const initialSettlement = await this.#applyProposal(context, schemeCtx, result, { decision: "accept" }, logEntryId);
|
|
687
683
|
const effective = await this.#resourceMutations.settleProposal({
|
|
688
684
|
statement,
|
|
689
685
|
result,
|
|
@@ -695,8 +691,45 @@ export default class Dispatcher {
|
|
|
695
691
|
await this.#notifySettled(context, logEntryId);
|
|
696
692
|
return Dispatcher.#singleExecution(post);
|
|
697
693
|
}
|
|
694
|
+
// Register the resolution waiter SYNCHRONOUSLY before any await
|
|
695
|
+
// yields. A same-tick resolveProposal() (e.g. from a test that
|
|
696
|
+
// awaits the onDispatch callback and immediately resolves) must
|
|
697
|
+
// find the waiter registered — adding an await between insert
|
|
698
|
+
// and waiter-registration would open a race window.
|
|
699
|
+
// Core derives one validated projection from the durable row for both
|
|
700
|
+
// this live event and reconnect discovery ({§proposal-projection}). Its
|
|
701
|
+
// disposition is also the one automatic settlement decision: policy is
|
|
702
|
+
// not an observer and cannot silently degrade into client ownership.
|
|
703
|
+
let resolutionPromise;
|
|
704
|
+
try {
|
|
705
|
+
resolutionPromise = this.#proposals.awaitResolution(logEntryId, this.#loopSignal(loopId));
|
|
706
|
+
const event = await this.#proposals.pending(logEntryId);
|
|
707
|
+
if (event !== null) {
|
|
708
|
+
this.#proposals.settleOwned(event);
|
|
709
|
+
this.#proposals.notifyPending(event);
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
catch (cause) {
|
|
713
|
+
await this.#proposals.failPreparation(logEntryId, cause);
|
|
714
|
+
await this.#notifySettled(context, logEntryId);
|
|
715
|
+
throw cause;
|
|
716
|
+
}
|
|
717
|
+
const resolution = await resolutionPromise;
|
|
718
|
+
// Run the scheme's applyResolution hook on accept (writes the
|
|
719
|
+
// file, spawns the process, etc.). Its operation result is
|
|
720
|
+
// preserved: an apply failure keeps its original status and
|
|
721
|
+
// Problem Details instead of masquerading as a client rejection.
|
|
722
|
+
const initialSettlement = await this.#applyProposal(context, schemeCtx, result, resolution, logEntryId);
|
|
723
|
+
const effective = await this.#resourceMutations.settleProposal({
|
|
724
|
+
statement,
|
|
725
|
+
result,
|
|
726
|
+
settlement: initialSettlement,
|
|
727
|
+
ctx: schemeCtx,
|
|
728
|
+
ids: { workspaceId, workerId, loopId, turnId, logEntryId },
|
|
729
|
+
});
|
|
730
|
+
const post = await this.#proposals.applyResolution(logEntryId, effective);
|
|
698
731
|
await this.#notifySettled(context, logEntryId);
|
|
699
|
-
return Dispatcher.#singleExecution(
|
|
732
|
+
return Dispatcher.#singleExecution(post);
|
|
700
733
|
}
|
|
701
734
|
// {§context-fit} — a result the model asked for arrives whole when it fits the remaining budget;
|
|
702
735
|
// otherwise the row is its size and address — a READ of lines above the longest prefix of them that
|
|
@@ -712,15 +745,15 @@ export default class Dispatcher {
|
|
|
712
745
|
const tokens = await this.#rowTokens(context, statement, result);
|
|
713
746
|
if (tokens <= remaining)
|
|
714
747
|
return result;
|
|
715
|
-
const
|
|
716
|
-
const
|
|
748
|
+
const range = result.range === undefined ? undefined : Validator.assertRangeExtent(result.range);
|
|
749
|
+
const size = resultSize({ range, content: result.content });
|
|
717
750
|
const retained = statement.op === "READ"
|
|
718
751
|
? { content: null, mimetype: null, channel: result.channel ?? null, ...(range === undefined ? {} : { range }) }
|
|
719
752
|
: { ...(range === undefined ? {} : { range }), ...Object.fromEntries(["matchingPathCount", "matchLocationCount", "itemsWeightTotal"].flatMap((key) => key in result ? [[key, result[key]]] : [])) };
|
|
720
753
|
const receipt = (delivered) => unfitResult(retained, size, tokens, remaining, statement.op, delivered);
|
|
721
754
|
if (statement.op !== "READ" || size.unit !== "line")
|
|
722
755
|
return receipt(0);
|
|
723
|
-
const whole = result;
|
|
756
|
+
const whole = { ...result, content: result.content };
|
|
724
757
|
const withPrefix = (count) => {
|
|
725
758
|
const prefix = resultPrefix(whole, count);
|
|
726
759
|
const carried = Object.fromEntries(["content", "mimetype", "startLine", "lineAnchors", "lineNumberWidth", "lineOrdinals", "matches", "range"]
|
|
@@ -755,35 +788,81 @@ export default class Dispatcher {
|
|
|
755
788
|
await context.onSettled?.(logEntryId);
|
|
756
789
|
await this.#notify.operationSettledNotify?.(context.workspaceId, logEntryId);
|
|
757
790
|
}
|
|
791
|
+
// {§actor-boundary-catalog-preview} Whether a survey selects anything: its FIND run through the scheme context and
|
|
792
|
+
// owner its dispatch would use, writing no row. A survey the FIND refuses counts as selecting, so its dispatch reports it.
|
|
793
|
+
async selects(survey, ids) {
|
|
794
|
+
const found = await ResourceBindings.using(this.#schemes, this.#buildSchemeCtx(ids), (ctx) => this.#dataRun.run(schemeNameOf(survey.target), survey, ctx));
|
|
795
|
+
return found.status >= 300 || !Array.isArray(found.results) || found.results.length > 0;
|
|
796
|
+
}
|
|
758
797
|
capabilityProjection(workspaceId) {
|
|
759
798
|
return this.#capabilities.projection(workspaceId);
|
|
760
799
|
}
|
|
761
|
-
//
|
|
762
|
-
//
|
|
763
|
-
//
|
|
764
|
-
|
|
800
|
+
// {§client-entry-address} A client read acquires `target` as exact READ does, from the worker's perspective: the
|
|
801
|
+
// representation a core scheme computes, or a data entry. Only core's own acquisition runs for it: a core scheme's
|
|
802
|
+
// preparation, and the materialization of a message core retains, whichever module minted its address
|
|
803
|
+
// ({§message-source-scheme}); never an extension's. Null for a target no data or computing scheme claims.
|
|
804
|
+
async readClientEntry(context) {
|
|
765
805
|
const { target, workspaceId, workerId } = context;
|
|
766
|
-
const
|
|
767
|
-
|
|
768
|
-
workerId,
|
|
769
|
-
loopId: 0,
|
|
770
|
-
turnId: 0,
|
|
771
|
-
origin: "client",
|
|
772
|
-
});
|
|
773
|
-
const resolved = await this.bindEntryAddress(target, coreCtx);
|
|
774
|
-
if (resolved === null)
|
|
775
|
-
return null;
|
|
776
|
-
if (resolved.address === null)
|
|
806
|
+
const routedScheme = schemeNameOf(target);
|
|
807
|
+
if (routedScheme === null)
|
|
777
808
|
return null;
|
|
778
|
-
const
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
809
|
+
const coreCtx = this.#buildSchemeCtx({ workspaceId, workerId, loopId: 0, turnId: 0, origin: "client" });
|
|
810
|
+
return ResourceBindings.using(this.#schemes, coreCtx, async (ctx) => {
|
|
811
|
+
try {
|
|
812
|
+
const binding = await ResourceBindings.resolve(target, ctx);
|
|
813
|
+
if (binding === undefined)
|
|
814
|
+
return null;
|
|
815
|
+
const neutral = target.kind === "url"
|
|
816
|
+
? { ...target, raw: renderTarget({ ...target, fragment: null }) ?? target.raw, fragment: null }
|
|
817
|
+
: target;
|
|
818
|
+
const computing = coreRepresentationProvider(binding.handler);
|
|
819
|
+
if (computing !== null) {
|
|
820
|
+
const resolved = await computing.resolveCoreRepresentation(neutral, ctx);
|
|
821
|
+
if ("result" in resolved)
|
|
822
|
+
return resolved.result.status >= 400 ? { kind: "refused", result: resolved.result } : null;
|
|
823
|
+
return { kind: "computed", target: resolved.identity ?? renderAuthoredTarget(neutral), channels: this.#computedChannels(resolved) };
|
|
824
|
+
}
|
|
825
|
+
if (binding.manifest.category !== "data")
|
|
826
|
+
return null;
|
|
827
|
+
const handler = binding.handler;
|
|
828
|
+
const coreScheme = this.#schemes.coreOwns(routedScheme);
|
|
829
|
+
const resolved = coreScheme
|
|
830
|
+
? await this.#prepareDataRepresentation({ target, metadata: null, routedScheme, handler, manifest: binding.manifest, ctx, publishedChannel: null })
|
|
831
|
+
: await this.#resolveDataEntryAddress({ target, routedScheme, handler, manifest: binding.manifest, ctx });
|
|
832
|
+
if (resolved.result !== null && resolved.result.status >= 400)
|
|
833
|
+
return { kind: "refused", result: resolved.result };
|
|
834
|
+
if (resolved.address === null)
|
|
835
|
+
return null;
|
|
836
|
+
if (!coreScheme) {
|
|
837
|
+
const retained = await new DbMessageCaps(ctx, routedScheme).prepare(neutral.raw);
|
|
838
|
+
if (retained.status >= 400 && retained.status !== 404)
|
|
839
|
+
return { kind: "refused", result: retained };
|
|
840
|
+
}
|
|
841
|
+
const rendered = resolved.address.scheme === "file"
|
|
842
|
+
? entryAddress("file", "", resolved.address.pathname, await this.#workspaceRoot(workspaceId))
|
|
843
|
+
: renderAuthoredTarget(neutral);
|
|
844
|
+
return { kind: "stored", address: {
|
|
845
|
+
scheme: resolved.address.scheme,
|
|
846
|
+
authority: resolved.address.authority,
|
|
847
|
+
pathname: resolved.address.pathname,
|
|
848
|
+
target: rendered,
|
|
849
|
+
} };
|
|
850
|
+
}
|
|
851
|
+
catch (error) {
|
|
852
|
+
if (error instanceof OperationFailureError)
|
|
853
|
+
return { kind: "refused", result: error.result };
|
|
854
|
+
throw error;
|
|
855
|
+
}
|
|
856
|
+
});
|
|
857
|
+
}
|
|
858
|
+
// {§client-entry-address} {§log-readable-projection} A computed representation's channels as a client reads them:
|
|
859
|
+
// deliberate trimming applied, each weighed as a stored channel is.
|
|
860
|
+
#computedChannels(resolved) {
|
|
861
|
+
return Object.fromEntries(Object.entries(resolved.representation.channels).map(([name, { content, mimetype, state }]) => {
|
|
862
|
+
const retained = resolved.visibleLines?.[name];
|
|
863
|
+
const visible = retained === undefined ? content : LineSelection.retain(content, retained).content;
|
|
864
|
+
return [name, { content: visible, mimetype, state, weight: visible.length === 0 ? 0 : this.#weighContent(visible) }];
|
|
865
|
+
}));
|
|
787
866
|
}
|
|
788
867
|
async bindEntryAddress(target, ctx) {
|
|
789
868
|
const routedScheme = schemeNameOf(target);
|
|
@@ -1346,7 +1425,8 @@ export default class Dispatcher {
|
|
|
1346
1425
|
plan: null,
|
|
1347
1426
|
};
|
|
1348
1427
|
}
|
|
1349
|
-
const
|
|
1428
|
+
const registered = this.#schemes.get("log");
|
|
1429
|
+
const handler = registered !== undefined && Dispatcher.#curates(registered) ? registered : undefined;
|
|
1350
1430
|
const manifest = this.#schemes.manifestFor("log");
|
|
1351
1431
|
if (handler === undefined || manifest === undefined) {
|
|
1352
1432
|
throw new Error("the core log curation owner is not registered");
|