@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/packet-wire.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// Format and omission rules are owned by {§packet-markdown}. Section producers
|
|
8
8
|
// supply names and typed content; this projection preserves their ordered evidence.
|
|
9
9
|
import { relative, sep } from "node:path";
|
|
10
|
-
import { Problems, Validator } from "@plurnk/plurnk-contracts";
|
|
10
|
+
import { Problems, Validator, isRecord, isSafeInteger, isExecutionOp } from "@plurnk/plurnk-contracts";
|
|
11
11
|
import { TextCoordinates } from "@plurnk/plurnk-mimetypes";
|
|
12
12
|
import BodyPreview from "../content/body-preview.js";
|
|
13
13
|
import { renderAuthoredTarget, renderTarget } from "./plurnk-uri.js";
|
|
@@ -21,7 +21,6 @@ import { Results as SchemeResults } from "@plurnk/plurnk-schemes";
|
|
|
21
21
|
import { assertEditReceipt, assertResourceEffects, LineAnchors, } from "../content/index.js";
|
|
22
22
|
// {§packet-attachment-parts} — the attachment kinds and their readout weights live in one table.
|
|
23
23
|
import { audioWeight, imageWeight, pdfWeight } from "./attachments.js";
|
|
24
|
-
import { isExecutionOp } from "@plurnk/plurnk-contracts";
|
|
25
24
|
export default class PacketWire {
|
|
26
25
|
// {§packet-markdown} Render the sections in `slot` to one ChatMessage.content
|
|
27
26
|
// string. Sections render in list order; empties are omitted (no empty headers on the wire);
|
|
@@ -47,17 +46,13 @@ export default class PacketWire {
|
|
|
47
46
|
// Durable operation failures render as `{status, path}` JSON pointers to the log rows that
|
|
48
47
|
// own their exact RFC 9457 results.
|
|
49
48
|
static renderFailurePointers(failures) {
|
|
50
|
-
const
|
|
51
|
-
const pointers = rows
|
|
52
|
-
.filter((row) => typeof row.status === "number" && typeof row.coordinate === "string")
|
|
53
|
-
.map((row) => JSON.stringify({ status: row.status, path: `log:///${row.coordinate}` }));
|
|
49
|
+
const pointers = failures.map((row) => JSON.stringify({ status: row.status, path: `log:///${row.coordinate}` }));
|
|
54
50
|
return pointers.length === 0 ? "" : `[${pointers.join(",\n")}]`;
|
|
55
51
|
}
|
|
56
52
|
// {§notice-callout} — non-terminal observations, deliberately separate from operation failures, in the
|
|
57
53
|
// card's own callout form: the level picks the callout, the directive leads, the fact follows, the kind closes.
|
|
58
54
|
static renderNotices(notices) {
|
|
59
|
-
|
|
60
|
-
return observations.map((notice) => {
|
|
55
|
+
return notices.map((notice) => {
|
|
61
56
|
const kind = typeof notice.kind === "string" ? notice.kind : "notice";
|
|
62
57
|
const callout = notice.level === "error" ? "CAUTION" : notice.level === "warn" ? "WARNING" : "NOTE";
|
|
63
58
|
const text = [notice.directive, notice.message]
|
|
@@ -82,8 +77,7 @@ export default class PacketWire {
|
|
|
82
77
|
return `{"workers":${PacketWire.#pointers(workers)},\n"streams":${PacketWire.#pointers(streams)},\n"messages":${PacketWire.#pointers(messages)}}`;
|
|
83
78
|
}
|
|
84
79
|
static #pointers(rows) {
|
|
85
|
-
const
|
|
86
|
-
const pointers = items.map((r) => JSON.stringify({
|
|
80
|
+
const pointers = rows.map((r) => JSON.stringify({
|
|
87
81
|
status: r.status,
|
|
88
82
|
path: r.path,
|
|
89
83
|
...(typeof r.detail === "string" && r.detail.length > 0 ? { detail: r.detail } : {}),
|
|
@@ -97,7 +91,7 @@ export default class PacketWire {
|
|
|
97
91
|
}
|
|
98
92
|
// The git section content: the working-tree summary. "" when absent.
|
|
99
93
|
static renderGit(git) {
|
|
100
|
-
const status = git === null
|
|
94
|
+
const status = git === null ? "" : PacketWire.#renderGitState(git);
|
|
101
95
|
return status.length === 0 ? "" : `> [!NOTE]\n${status.split("\n").map((line) => `> ${line}`).join("\n")}`;
|
|
102
96
|
}
|
|
103
97
|
// The log section's content: the model's curated rows as Markdown-framed records ({§log-wire-format}).
|
|
@@ -109,17 +103,15 @@ export default class PacketWire {
|
|
|
109
103
|
// {§context-gauge} — the wire row and its reclaimable-body accounting come from one render
|
|
110
104
|
// pass; packet assembly never re-parses its text.
|
|
111
105
|
static renderLogWithAccounting(entries, weighContent, options = {}) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
const rows = PacketWire.#renderLogEntries(log, weighContent, options);
|
|
106
|
+
if (entries.length === 0)
|
|
107
|
+
return { content: "", records: [], curationTargets: [], attachments: [] };
|
|
108
|
+
const rows = PacketWire.#renderLogEntries(entries, weighContent, options);
|
|
116
109
|
const records = rows.map(({ content }) => content);
|
|
117
110
|
return {
|
|
118
111
|
content: records.join("\n\n"),
|
|
119
112
|
records,
|
|
120
113
|
curationTargets: rows.flatMap(({ curationTarget }) => curationTarget === null ? [] : [curationTarget]),
|
|
121
114
|
attachments: rows.flatMap(({ attachment }) => attachment === null ? [] : [attachment]),
|
|
122
|
-
bodied: rows.flatMap(({ bodied }) => bodied === null ? [] : [bodied]),
|
|
123
115
|
};
|
|
124
116
|
}
|
|
125
117
|
// Read one section's content by name off a packet (Engine's or re-parsed).
|
|
@@ -236,7 +228,7 @@ export default class PacketWire {
|
|
|
236
228
|
}
|
|
237
229
|
// {§log-wire-format} Orientation precedes telemetry on every receipt.
|
|
238
230
|
static #canonicalJson(obj) {
|
|
239
|
-
return JSON.stringify(Object.fromEntries(Object.keys(obj).
|
|
231
|
+
return JSON.stringify(Object.fromEntries(Object.keys(obj).toSorted().map((key) => [key, obj[key]])));
|
|
240
232
|
}
|
|
241
233
|
static #receiptMeta(value) {
|
|
242
234
|
const receipt = assertEditReceipt(value);
|
|
@@ -317,7 +309,7 @@ export default class PacketWire {
|
|
|
317
309
|
if (e.op !== "SEND" || e.origin !== "_plurnk")
|
|
318
310
|
return false;
|
|
319
311
|
const attrs = typeof e.attrs === "string" ? JSON.parse(e.attrs) : e.attrs;
|
|
320
|
-
return attrs
|
|
312
|
+
return isRecord(attrs) && attrs.kind === "message";
|
|
321
313
|
}
|
|
322
314
|
// {§markerless-first-page} — a body the model did not author or ask for exactly takes its first page in
|
|
323
315
|
// the packet: not the model's own row, not a retrieval (paged at its source), not an emission row,
|
|
@@ -412,7 +404,8 @@ export default class PacketWire {
|
|
|
412
404
|
return entries.map((e, index) => {
|
|
413
405
|
const identity = PacketWire.#rowIdentity(e, options);
|
|
414
406
|
// Parse rx once — reused for the matcher/items enrichment and the body.
|
|
415
|
-
const
|
|
407
|
+
const parsedRx = typeof e.rx === "string" ? PacketWire.#safeParse(e.rx) : e.rx;
|
|
408
|
+
const rx = isRecord(parsedRx) ? parsedRx : null;
|
|
416
409
|
const facts = PacketWire.#rowResultFacts(identity, e, rx, bodies[index]);
|
|
417
410
|
const paired = options.paired?.has(String(e.coordinate)) ?? false;
|
|
418
411
|
const projected = paired && bodies[index].provenance === "authored"
|
|
@@ -423,22 +416,23 @@ export default class PacketWire {
|
|
|
423
416
|
}
|
|
424
417
|
static #attrsOf(e) {
|
|
425
418
|
const attrs = typeof e.attrs === "string" ? PacketWire.#safeParse(e.attrs) : e.attrs;
|
|
426
|
-
return
|
|
419
|
+
return isRecord(attrs) ? attrs : {};
|
|
427
420
|
}
|
|
428
421
|
// One stored log row as the renderer sees it: the durable columns decoded once, a transient
|
|
429
422
|
// open row rendered open ({§invalid-emission-attempts}).
|
|
430
423
|
static entryView(r, transientOpenLogEntryId = null) {
|
|
431
|
-
const
|
|
424
|
+
const parsedTx = r.mimetype_tx === "application/json" ? JSON.parse(r.tx) : r.tx;
|
|
425
|
+
const tx = isRecord(parsedTx) ? parsedTx : typeof parsedTx === "string" ? parsedTx : null;
|
|
432
426
|
const rx = r.mimetype_rx === "application/json" ? JSON.parse(r.rx) : r.rx;
|
|
433
427
|
// {§context-fit} — a READ row's anchors ride with its lines whatever its status: a receipt that
|
|
434
428
|
// carries a prefix carries the prefix's anchors.
|
|
435
|
-
const readResult = LogEntryProjection.op(r) === "READ" && rx
|
|
436
|
-
const rawLineAnchors = readResult && Object.hasOwn(
|
|
437
|
-
if (rawLineAnchors !== undefined && !Array.isArray(rawLineAnchors)) {
|
|
438
|
-
throw new TypeError("A READ result's lineAnchors field must be an array.");
|
|
429
|
+
const readResult = LogEntryProjection.op(r) === "READ" && isRecord(rx) && typeof rx.content === "string" ? rx : null;
|
|
430
|
+
const rawLineAnchors = readResult !== null && Object.hasOwn(readResult, "lineAnchors") ? readResult.lineAnchors : undefined;
|
|
431
|
+
if (rawLineAnchors !== undefined && !(Array.isArray(rawLineAnchors) && rawLineAnchors.every((anchor) => typeof anchor === "string"))) {
|
|
432
|
+
throw new TypeError("A READ result's lineAnchors field must be an array of strings.");
|
|
439
433
|
}
|
|
440
434
|
const lineAnchors = rawLineAnchors;
|
|
441
|
-
const rawLineNumberWidth = readResult && Object.hasOwn(
|
|
435
|
+
const rawLineNumberWidth = readResult !== null && Object.hasOwn(readResult, "lineNumberWidth") ? readResult.lineNumberWidth : undefined;
|
|
442
436
|
if (rawLineNumberWidth !== undefined && !LineAnchors.isLineNumberWidth(rawLineNumberWidth)) {
|
|
443
437
|
throw new TypeError("A READ result's lineNumberWidth field must be a valid decimal line width.");
|
|
444
438
|
}
|
|
@@ -502,16 +496,16 @@ export default class PacketWire {
|
|
|
502
496
|
// subsystem token when present; absence means the owning worker.
|
|
503
497
|
// {§message-short-identity} an arrival whose source is the transport's own name for it adds
|
|
504
498
|
// nothing to its address; a peer's or an agent's source still shows.
|
|
505
|
-
const
|
|
506
|
-
const selfAddressed =
|
|
499
|
+
const attrs = PacketWire.#attrsOf(e);
|
|
500
|
+
const selfAddressed = attrs.selfAddressed === true;
|
|
507
501
|
if (typeof e.source === "string" && e.source.length > 0 && !selfAddressed)
|
|
508
502
|
meta.source = e.source;
|
|
509
503
|
// {§message-causal-source}: every other sender has an address; the operator's message is named
|
|
510
504
|
// for the model, or it reads as the model's own SEND.
|
|
511
505
|
if (PacketWire.isArrival(e) && meta.source === undefined)
|
|
512
506
|
meta.origin = "user";
|
|
513
|
-
if (e.source === "file" &&
|
|
514
|
-
const git =
|
|
507
|
+
if (e.source === "file" && Object.hasOwn(attrs, "git")) {
|
|
508
|
+
const git = attrs.git;
|
|
515
509
|
if (typeof git !== "string" || git.length !== 2) {
|
|
516
510
|
throw new TypeError("A source=file log row carries malformed Git XY metadata.");
|
|
517
511
|
}
|
|
@@ -520,19 +514,20 @@ export default class PacketWire {
|
|
|
520
514
|
// {§log-wire-format}: routine success is implicit, independently of the operation.
|
|
521
515
|
if (typeof e.status === "number" && e.status !== 200)
|
|
522
516
|
meta.status = e.status;
|
|
523
|
-
const
|
|
517
|
+
const parsedTx = typeof e.tx === "string" ? PacketWire.#safeParse(e.tx) : e.tx;
|
|
518
|
+
const tx = isRecord(parsedTx) ? parsedTx : null;
|
|
524
519
|
const replay = options.paired?.get(String(e.coordinate));
|
|
525
520
|
const paired = replay !== undefined;
|
|
526
521
|
if (!paired && typeof tx?.aside === "string")
|
|
527
522
|
meta.aside = tx.aside;
|
|
528
|
-
const authored = tx?.target;
|
|
529
|
-
const target = PacketWire.#operandPath(e.target ??
|
|
523
|
+
const authored = PacketWire.#authoredPath(tx?.target);
|
|
524
|
+
const target = PacketWire.#operandPath(e.target ?? PacketWire.#actionTarget(tx?.target), options.projectRoot ?? null, authored);
|
|
530
525
|
const pair = op === "COPY" || op === "MOVE";
|
|
531
526
|
const selections = pair
|
|
532
|
-
? [tx?.source, tx?.destination]
|
|
527
|
+
? [PacketWire.#selection(tx?.source), PacketWire.#selection(tx?.destination)]
|
|
533
528
|
: [{ ...tx, target: e.target ?? tx?.target }];
|
|
534
|
-
const paths = selections.map((selection) => PacketWire.#operandPath(selection?.target, options.projectRoot ?? null, authored
|
|
535
|
-
if (pair && typeof e.status === "number" && e.status < 400 && paths.some((
|
|
529
|
+
const paths = selections.map((selection) => PacketWire.#operandPath(PacketWire.#actionTarget(selection?.target), options.projectRoot ?? null, authored));
|
|
530
|
+
if (pair && typeof e.status === "number" && e.status < 400 && paths.some((candidate) => candidate === null)) {
|
|
536
531
|
throw new Error(`A successful ${op} log row must retain both operand selections.`);
|
|
537
532
|
}
|
|
538
533
|
for (const field of ["scope", "metadata"]) {
|
|
@@ -540,45 +535,39 @@ export default class PacketWire {
|
|
|
540
535
|
continue;
|
|
541
536
|
const values = selections.map((selection) => field === "scope"
|
|
542
537
|
? PacketWire.#requestScope(selection?.lineMarker)
|
|
543
|
-
: selection?.metadata
|
|
538
|
+
: PacketWire.#metadata(selection?.metadata));
|
|
544
539
|
if (pair) {
|
|
545
|
-
const
|
|
546
|
-
if (Object.keys(
|
|
547
|
-
meta[field] =
|
|
540
|
+
const pairedValues = Object.fromEntries(values.flatMap((value, index) => value === null ? [] : [[index === 0 ? "from" : "to", value]]));
|
|
541
|
+
if (Object.keys(pairedValues).length > 0)
|
|
542
|
+
meta[field] = pairedValues;
|
|
548
543
|
}
|
|
549
544
|
else if (values[0] !== null)
|
|
550
545
|
meta[field] = values[0];
|
|
551
546
|
}
|
|
552
547
|
// {§log-wire-format}: describe resources and patterns directly; never serialize an OP.
|
|
553
548
|
const parts = selections.flatMap((selection, index) => {
|
|
554
|
-
const
|
|
549
|
+
const matcher = selection?.matcher;
|
|
550
|
+
const pattern = isRecord(matcher) ? matcher.raw : undefined;
|
|
555
551
|
return [
|
|
556
552
|
...(paths[index] === null ? [] : [`→ ${paths[index]}`]),
|
|
557
553
|
...(typeof pattern !== "string" || pattern.length === 0 ? []
|
|
558
554
|
: [/[\r\n]/u.test(pattern) ? JSON.stringify(pattern) : pattern]),
|
|
559
555
|
];
|
|
560
556
|
});
|
|
561
|
-
|
|
562
|
-
const
|
|
563
|
-
? [request.source, request.destination] : [request];
|
|
564
|
-
const resolved = paired && paths.some((path, index) => {
|
|
565
|
-
const selection = requestedSelections[index];
|
|
566
|
-
const requested = selection !== undefined && "target" in selection ? selection.target : null;
|
|
567
|
-
return path !== PacketWire.#operandPath(requested, options.projectRoot ?? null, requested);
|
|
568
|
-
});
|
|
557
|
+
// {§paired-receipt}: every receipt names its operand; a paired one leaves its pattern to the replayed operation.
|
|
558
|
+
const operands = paths.filter((candidate) => candidate !== null).map((candidate) => `→ ${candidate}`).join(" ");
|
|
569
559
|
const description = op === "error" || op === "extension" || parts.length === 0 ? null
|
|
570
|
-
: !paired ? parts.join(" ") :
|
|
560
|
+
: !paired ? parts.join(" ") : operands.length > 0 ? operands : null;
|
|
571
561
|
// {§worker-auto-name} The created identity is an outcome, not an authored target.
|
|
572
|
-
if ((op === "WORK" || op === "FORK") &&
|
|
573
|
-
|
|
574
|
-
meta.worker = e.attrs.worker;
|
|
562
|
+
if ((op === "WORK" || op === "FORK") && typeof attrs.worker === "string") {
|
|
563
|
+
meta.worker = attrs.worker;
|
|
575
564
|
// {§worker-scheme-spawn} — a WORK that reached a worker the name already held says so.
|
|
576
|
-
if (
|
|
565
|
+
if (attrs.delivered === "message")
|
|
577
566
|
meta.delivered = "message";
|
|
578
567
|
}
|
|
579
568
|
// {§worker-wait-timing} — the accepted bound, not elapsed time or the current configuration.
|
|
580
|
-
if (op === "WAIT" &&
|
|
581
|
-
const seconds =
|
|
569
|
+
if (op === "WAIT" && Object.hasOwn(attrs, "waiting")) {
|
|
570
|
+
const seconds = attrs.waiting;
|
|
582
571
|
if (typeof seconds !== "number" || !Number.isFinite(seconds) || seconds < 0) {
|
|
583
572
|
throw new TypeError("A WAIT receipt carries a malformed waiting bound.");
|
|
584
573
|
}
|
|
@@ -588,21 +577,21 @@ export default class PacketWire {
|
|
|
588
577
|
// `stream` link, distinct from the runtime-owned invocation target.
|
|
589
578
|
// {§exec-target-routing} {§fs-namespace} — the receipt names the working directory only
|
|
590
579
|
// when it is not the project root, and then in project-relative form.
|
|
591
|
-
if (isExecutionOp(op) &&
|
|
592
|
-
const cwd = PacketWire.#projectRelativeCwd(
|
|
580
|
+
if (isExecutionOp(op) && typeof attrs.cwd === "string") {
|
|
581
|
+
const cwd = PacketWire.#projectRelativeCwd(attrs.cwd, options.projectRoot ?? null);
|
|
593
582
|
if (cwd !== null)
|
|
594
583
|
meta.cwd = cwd;
|
|
595
584
|
}
|
|
596
|
-
if (isExecutionOp(op) &&
|
|
597
|
-
meta.stream =
|
|
585
|
+
if (isExecutionOp(op) && typeof attrs.stream === "string") {
|
|
586
|
+
meta.stream = attrs.stream;
|
|
598
587
|
}
|
|
599
588
|
return { meta, op, tx, coordinate, path, renderedLeaf, target, description };
|
|
600
589
|
}
|
|
601
|
-
// The row's result facts from its rx
|
|
602
|
-
//
|
|
603
|
-
// projection needs to know about the result.
|
|
590
|
+
// The row's result facts from its rx, added to the metadata line stage by stage: the attachments and the
|
|
591
|
+
// returned address, the terminal stream's exit, the Problem or detail, the retrieval extents, and the
|
|
592
|
+
// structured mutation receipts. Returns what the body projection needs to know about the result.
|
|
604
593
|
static #rowResultFacts(identity, e, rx, fullBody) {
|
|
605
|
-
const { meta, op
|
|
594
|
+
const { meta, op } = identity;
|
|
606
595
|
if (op === "SEND" && rx !== null && typeof rx === "object" && Array.isArray(rx.attachments) && rx.attachments.length > 0) {
|
|
607
596
|
meta.attachments = rx.attachments.map(({ name, mediaType, target }) => ({ name, mediaType, path: target }));
|
|
608
597
|
}
|
|
@@ -611,8 +600,19 @@ export default class PacketWire {
|
|
|
611
600
|
&& rx.resource.length > 0 && rx.resource !== identity.target && rx.resource !== meta.stream) {
|
|
612
601
|
meta.resource = rx.resource;
|
|
613
602
|
}
|
|
614
|
-
|
|
615
|
-
|
|
603
|
+
PacketWire.#streamReadFacts(meta, op, rx);
|
|
604
|
+
PacketWire.#problemFacts(identity, e, rx);
|
|
605
|
+
const { findItems, range } = PacketWire.#retrievalFacts(identity, e, rx, fullBody);
|
|
606
|
+
const structuredMutationReceipt = PacketWire.#mutationReceiptFacts(meta, op, rx);
|
|
607
|
+
return {
|
|
608
|
+
findItems, range, structuredMutationReceipt,
|
|
609
|
+
...(op === "READ" && rx?.matches !== undefined
|
|
610
|
+
? { matches: SchemeResults.assertMatchEvidenceList(rx.matches) } : {}),
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
// {§exec-stream}: explicit and automatic READs preserve the same
|
|
614
|
+
// durable liveness facts, including an empty active channel.
|
|
615
|
+
static #streamReadFacts(meta, op, rx) {
|
|
616
616
|
if (op === "READ" && rx !== null && typeof rx === "object" && Object.hasOwn(rx, "terminal")) {
|
|
617
617
|
if (typeof rx.terminal !== "boolean") {
|
|
618
618
|
throw new TypeError("A stream READ result carries a malformed terminal flag.");
|
|
@@ -627,36 +627,39 @@ export default class PacketWire {
|
|
|
627
627
|
// {§executor-page-receipt} — a producer's full-page fact survives projection as written.
|
|
628
628
|
if (Object.hasOwn(rx, "page")) {
|
|
629
629
|
const page = rx.page;
|
|
630
|
-
if (page
|
|
630
|
+
if (!isRecord(page) || !isSafeInteger(page.size) || !isSafeInteger(page.returned)) {
|
|
631
631
|
throw new TypeError("A stream READ result carries a malformed page.");
|
|
632
632
|
}
|
|
633
633
|
meta.page = { size: page.size, returned: page.returned };
|
|
634
634
|
}
|
|
635
635
|
}
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
636
|
+
}
|
|
637
|
+
// {§problem-projection} — the exact durable Problem remains the
|
|
638
|
+
// failure authority; the packet carries only facts not already
|
|
639
|
+
// owned by its enclosing row. Errors remains only an index.
|
|
640
|
+
// The success-side sibling (#342): a sub-problem receipt may carry one
|
|
641
|
+
// terse `detail` (e.g. the EDIT 304) so situational teaching is paid
|
|
642
|
+
// only when the situation occurs, never in the hot path.
|
|
643
|
+
static #problemFacts(identity, e, rx) {
|
|
644
|
+
const { meta } = identity;
|
|
639
645
|
if (typeof e.status === "number" && e.status >= 400 && rx !== null && typeof rx === "object") {
|
|
640
|
-
const problem = rx.problem;
|
|
641
|
-
Validator.assertProblemDetails(problem);
|
|
646
|
+
const problem = Validator.assertProblemDetails(rx.problem);
|
|
642
647
|
meta.problem = Problems.project(problem, {
|
|
643
648
|
status: e.status,
|
|
644
649
|
row: { ...meta, target: identity.target },
|
|
645
650
|
});
|
|
646
651
|
}
|
|
647
|
-
|
|
648
|
-
// terse `detail` (e.g. the EDIT 304) so situational teaching is paid
|
|
649
|
-
// only when the situation occurs, never in the hot path.
|
|
650
|
-
if (!Object.hasOwn(meta, "problem") && rx !== null && typeof rx === "object"
|
|
651
|
-
&& typeof rx.detail === "string"
|
|
652
|
-
&& rx.detail.length > 0) {
|
|
652
|
+
if (!Object.hasOwn(meta, "problem") && rx !== null && typeof rx.detail === "string" && rx.detail.length > 0) {
|
|
653
653
|
meta.detail = rx.detail;
|
|
654
654
|
}
|
|
655
|
-
|
|
656
|
-
|
|
655
|
+
}
|
|
656
|
+
// {§retrieval-packet-metadata}: one extent/coordinate owner plus
|
|
657
|
+
// only FIND aggregates that add information beyond that extent.
|
|
658
|
+
static #retrievalFacts(identity, e, rx, fullBody) {
|
|
659
|
+
const { meta, op, tx } = identity;
|
|
657
660
|
let findItems = null;
|
|
658
661
|
let range = null;
|
|
659
|
-
const patterned = tx !== null && tx !== undefined && typeof tx === "object" && tx.matcher
|
|
662
|
+
const patterned = tx !== null && tx !== undefined && typeof tx === "object" && isRecord(tx.matcher) && typeof tx.matcher.raw === "string";
|
|
660
663
|
if (patterned && op !== "FIND" && rx !== null && typeof rx === "object" && typeof rx.matched === "number")
|
|
661
664
|
meta.matched = rx.matched;
|
|
662
665
|
// {§channel-selection-visibility} — a READ names the resource's other channels with their
|
|
@@ -677,13 +680,10 @@ export default class PacketWire {
|
|
|
677
680
|
range = rx !== null && typeof rx === "object" && rx.range !== undefined
|
|
678
681
|
? Validator.assertRangeExtent(rx.range)
|
|
679
682
|
: null;
|
|
680
|
-
const
|
|
681
|
-
|
|
682
|
-
&& meta.problem !== null
|
|
683
|
-
&& typeof meta.problem === "object"
|
|
684
|
-
&& Object.hasOwn(meta.problem, "range");
|
|
683
|
+
const problem = isRecord(meta.problem) ? meta.problem : null;
|
|
684
|
+
const problemOwnsRange = typeof e.status === "number" && e.status >= 400 && problem !== null && Object.hasOwn(problem, "range");
|
|
685
685
|
if (problemOwnsRange) {
|
|
686
|
-
Validator.assertRangeExtent(
|
|
686
|
+
Validator.assertRangeExtent(problem?.range);
|
|
687
687
|
delete meta.scope;
|
|
688
688
|
}
|
|
689
689
|
if (range !== null && !problemOwnsRange) {
|
|
@@ -722,9 +722,12 @@ export default class PacketWire {
|
|
|
722
722
|
meta.matchLocationCount = rx.matchLocationCount;
|
|
723
723
|
}
|
|
724
724
|
}
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
725
|
+
return { findItems, range };
|
|
726
|
+
}
|
|
727
|
+
// {§edit-result-receipt-projection} {§edit-result-copy-move-effects}
|
|
728
|
+
// EDIT/scoped entry KILL own one receipt; COPY/MOVE own resource effects whose
|
|
729
|
+
// optional receipts describe scoped textual materializations.
|
|
730
|
+
static #mutationReceiptFacts(meta, op, rx) {
|
|
728
731
|
let structuredMutationReceipt = false;
|
|
729
732
|
if ((op === "EDIT" || op === "KILL") && rx !== null && typeof rx === "object" && Object.hasOwn(rx, "receipt")) {
|
|
730
733
|
Object.assign(meta, PacketWire.#receiptMeta(rx.receipt));
|
|
@@ -744,11 +747,7 @@ export default class PacketWire {
|
|
|
744
747
|
}));
|
|
745
748
|
structuredMutationReceipt = effects.some((effect) => effect.receipt !== undefined);
|
|
746
749
|
}
|
|
747
|
-
return
|
|
748
|
-
findItems, range, structuredMutationReceipt,
|
|
749
|
-
...(op === "READ" && rx?.matches !== undefined
|
|
750
|
-
? { matches: SchemeResults.assertMatchEvidenceList(rx.matches) } : {}),
|
|
751
|
-
};
|
|
750
|
+
return structuredMutationReceipt;
|
|
752
751
|
}
|
|
753
752
|
// The body the row shows: the canonical full body, shared with log READ, log FIND and search
|
|
754
753
|
// derivation, whole. Whether a result fit was decided where it landed ({§context-fit}).
|
|
@@ -791,8 +790,9 @@ export default class PacketWire {
|
|
|
791
790
|
...(enclosingRegion === undefined ? {} : { enclosingRegion: ScopeFormat.region(enclosingRegion) }),
|
|
792
791
|
}));
|
|
793
792
|
if (evidence.length > 0) {
|
|
794
|
-
|
|
795
|
-
|
|
793
|
+
const shown = BodyPreview.items(evidence, JSON.stringify);
|
|
794
|
+
meta.matches = shown;
|
|
795
|
+
if (shown.length !== evidence.length)
|
|
796
796
|
meta.matchLocationCount = evidence.length;
|
|
797
797
|
}
|
|
798
798
|
}
|
|
@@ -823,7 +823,7 @@ export default class PacketWire {
|
|
|
823
823
|
meta.preview = projectedChunk;
|
|
824
824
|
delete meta.lines;
|
|
825
825
|
}
|
|
826
|
-
return { body,
|
|
826
|
+
return { body, display };
|
|
827
827
|
}
|
|
828
828
|
// The row's native attachment, a landed-unfit arrival's size, and the accounting field that
|
|
829
829
|
// participates in the row it measures: iterate until its decimal width and therefore the
|
|
@@ -867,52 +867,35 @@ export default class PacketWire {
|
|
|
867
867
|
}
|
|
868
868
|
throw new Error("packet log row accounting did not converge");
|
|
869
869
|
};
|
|
870
|
-
const
|
|
871
|
-
|
|
872
|
-
// {§context-own-rows-fit} — a row the wall may take carries a body or a native part and is not an
|
|
873
|
-
// emission row, whose folded record carries no body.
|
|
874
|
-
if (typeof e.id !== "number" || LogEntryProjection.isEmission(e) || (display !== "open" && attachment === null))
|
|
875
|
-
return row(whole, attachment, null);
|
|
876
|
-
if (!(options.bodiless?.has(e.id) ?? false))
|
|
877
|
-
return row(whole, attachment, { id: e.id, tokens: whole.tokens });
|
|
878
|
-
// Taken: the fit rule's receipt shape — its size and address, no body, no native part.
|
|
879
|
-
meta.size = { lines: projected.projectedLineCount, tokens: whole.tokens };
|
|
880
|
-
const receipt = converge(false, null);
|
|
881
|
-
if (receipt.tokens < whole.tokens)
|
|
882
|
-
return row(receipt, null, null);
|
|
883
|
-
// A receipt that weighs no less than the body it stands for sheds nothing: the row stays whole and
|
|
884
|
-
// is spent.
|
|
885
|
-
delete meta.size;
|
|
886
|
-
return row(converge(display === "open", attachment), attachment, null);
|
|
870
|
+
const rendered = converge(display === "open", attachment);
|
|
871
|
+
return { content: rendered.content, curationTarget: { path, tokens: rendered.tokens }, attachment };
|
|
887
872
|
}
|
|
888
873
|
static #attachmentOf(rx, target, coordinate, path) {
|
|
889
|
-
|
|
890
|
-
const contentHash = rx?.nativeContentHash;
|
|
891
|
-
if (typeof contentHash !== "string")
|
|
874
|
+
if (!isRecord(rx) || typeof rx.nativeContentHash !== "string")
|
|
892
875
|
return null;
|
|
876
|
+
const contentHash = rx.nativeContentHash;
|
|
893
877
|
const pathname = typeof target?.pathname === "string" && target.pathname.length > 0
|
|
894
878
|
? target.pathname
|
|
895
879
|
: typeof target?.raw === "string" ? target.raw : null;
|
|
896
880
|
if (pathname === null || coordinate === null || path === null)
|
|
897
881
|
return null;
|
|
898
882
|
const scheme = target?.scheme ?? "file";
|
|
899
|
-
const image =
|
|
900
|
-
if (image
|
|
901
|
-
const width = image
|
|
902
|
-
const height = image.height;
|
|
883
|
+
const image = rx.image;
|
|
884
|
+
if (isRecord(image) && typeof image.mimetype === "string" && isSafeInteger(image.width) && isSafeInteger(image.height)) {
|
|
885
|
+
const { width, height } = image;
|
|
903
886
|
return { contentHash, coordinate, path, scheme, pathname, mimetype: image.mimetype, kind: "image", width, height, weight: imageWeight(width, height) };
|
|
904
887
|
}
|
|
905
|
-
const document =
|
|
906
|
-
if (document
|
|
907
|
-
const pages =
|
|
888
|
+
const document = rx.document;
|
|
889
|
+
if (isRecord(document) && typeof document.mimetype === "string" && isSafeInteger(document.bytes)) {
|
|
890
|
+
const pages = isSafeInteger(document.pages) ? document.pages : null;
|
|
908
891
|
return {
|
|
909
892
|
contentHash, coordinate, path, scheme, pathname, mimetype: document.mimetype, kind: "pdf",
|
|
910
893
|
...(pages === null ? {} : { pages }),
|
|
911
894
|
weight: pdfWeight(pages, document.bytes),
|
|
912
895
|
};
|
|
913
896
|
}
|
|
914
|
-
const audio =
|
|
915
|
-
if (audio
|
|
897
|
+
const audio = rx.audio;
|
|
898
|
+
if (isRecord(audio) && typeof audio.mimetype === "string" && isSafeInteger(audio.bytes)) {
|
|
916
899
|
const duration = typeof audio.duration === "number" && Number.isFinite(audio.duration) && audio.duration >= 0 ? audio.duration : null;
|
|
917
900
|
return {
|
|
918
901
|
contentHash, coordinate, path, scheme, pathname, mimetype: audio.mimetype, kind: "audio",
|
|
@@ -943,7 +926,7 @@ export default class PacketWire {
|
|
|
943
926
|
const parts = [];
|
|
944
927
|
for (const [at, section] of sections.entries()) {
|
|
945
928
|
parts.push({ type: "text", text: `${at === 0 ? "" : "\n\n"}${PacketWire.renderSection(section)}` });
|
|
946
|
-
for (const attachment of attachments.filter((
|
|
929
|
+
for (const attachment of attachments.filter((candidate) => candidate.section === section.name)) {
|
|
947
930
|
parts.push({ type: "text", text: `\n\n${PacketWire.attachmentCaption(attachment)}` });
|
|
948
931
|
parts.push({ type: "file", data: await bytesOf(attachment), mediaType: attachment.mimetype });
|
|
949
932
|
}
|
|
@@ -1011,15 +994,54 @@ export default class PacketWire {
|
|
|
1011
994
|
static #requestScope(marker) {
|
|
1012
995
|
if (marker === null || marker === undefined)
|
|
1013
996
|
return null;
|
|
1014
|
-
const marks = marker.marks;
|
|
1015
|
-
|
|
997
|
+
const marks = isRecord(marker) ? marker.marks : undefined;
|
|
998
|
+
const isMark = (mark) => typeof mark === "string" || typeof mark === "number";
|
|
999
|
+
if (!Array.isArray(marks) || !marks.every(isMark)) {
|
|
1016
1000
|
throw new TypeError("An operation scope must retain its authored marks.");
|
|
1017
1001
|
}
|
|
1002
|
+
const [first, ...rest] = marks;
|
|
1003
|
+
if (first === undefined)
|
|
1004
|
+
throw new TypeError("An operation scope must retain its authored marks.");
|
|
1018
1005
|
// Failed selections still describe what was attempted; the operation owns validity.
|
|
1019
|
-
return ScopeFormat.marker(
|
|
1006
|
+
return ScopeFormat.marker({ marks: [first, ...rest] });
|
|
1007
|
+
}
|
|
1008
|
+
// {§packet-stored-shape} A stored operand target: the address columns as nullable strings, the port a number, the
|
|
1009
|
+
// authored `kind` and `raw` read where used. A field of another type is a malformed row.
|
|
1010
|
+
static #actionTarget(value) {
|
|
1011
|
+
if (value === null || value === undefined)
|
|
1012
|
+
return null;
|
|
1013
|
+
if (!isRecord(value))
|
|
1014
|
+
throw new TypeError("A stored operand target must be an object.");
|
|
1015
|
+
const text = (name) => {
|
|
1016
|
+
const field = value[name];
|
|
1017
|
+
if (field === undefined || field === null || typeof field === "string")
|
|
1018
|
+
return field;
|
|
1019
|
+
throw new TypeError(`A stored operand target carries a malformed ${name}.`);
|
|
1020
|
+
};
|
|
1021
|
+
const port = value.port;
|
|
1022
|
+
if (port !== undefined && port !== null && typeof port !== "number") {
|
|
1023
|
+
throw new TypeError("A stored operand target carries a malformed port.");
|
|
1024
|
+
}
|
|
1025
|
+
return {
|
|
1026
|
+
kind: value.kind, raw: value.raw, scheme: text("scheme"), hostname: text("hostname"), port, pathname: text("pathname"),
|
|
1027
|
+
query: text("query"), fragment: text("fragment"), username: text("username"), password: text("password"),
|
|
1028
|
+
};
|
|
1029
|
+
}
|
|
1030
|
+
// The target as the model authored it, when the stored statement's target is a path the grammar names; a row
|
|
1031
|
+
// whose stored target is not renders without its authored spelling.
|
|
1032
|
+
static #authoredPath(value) {
|
|
1033
|
+
if (value === null || value === undefined)
|
|
1034
|
+
return null;
|
|
1035
|
+
return Validator.validateParsedPath(value).valid ? Validator.assertParsedPath(value) : null;
|
|
1036
|
+
}
|
|
1037
|
+
static #selection(value) {
|
|
1038
|
+
return isRecord(value) ? value : null;
|
|
1039
|
+
}
|
|
1040
|
+
static #metadata(value) {
|
|
1041
|
+
return Array.isArray(value) && value.length > 0 && value.every((item) => typeof item === "string") ? value : null;
|
|
1020
1042
|
}
|
|
1021
1043
|
// {§packet-git-status}: the count line, then one bounded line per non-empty class. Untracked paths are
|
|
1022
|
-
// named because they are NOT members ({§membership-baseline}) —
|
|
1044
|
+
// named because they are NOT members ({§membership-baseline}) — the user admits them.
|
|
1023
1045
|
static #renderGitState(git) {
|
|
1024
1046
|
const sync = git.ahead > 0 || git.behind > 0 ? ` (↑${git.ahead} ↓${git.behind})` : "";
|
|
1025
1047
|
const position = git.branch === null ? "detached HEAD" : `branch \`${git.branch}\`${git.unborn ? " (no commits)" : ""}`;
|