@plurnk/plurnk-service 4.2.1 → 4.3.0
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 +1977 -1397
- 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 +12 -6
- package/dist/core/Engine.d.ts.map +1 -1
- package/dist/core/Engine.js +29 -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 +8 -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 +1 -1
- package/dist/core/PacketBuilder.d.ts.map +1 -1
- package/dist/core/PacketBuilder.js +7 -5
- package/dist/core/PacketBuilder.js.map +1 -1
- 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/ToolInputSchema.d.ts.map +1 -1
- package/dist/core/ToolInputSchema.js +2 -2
- package/dist/core/ToolInputSchema.js.map +1 -1
- package/dist/core/ToolResources.d.ts +1 -0
- package/dist/core/ToolResources.d.ts.map +1 -1
- package/dist/core/ToolResources.js +7 -6
- 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 +0 -1
- 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 +174 -164
- 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 -21
- package/dist/core/packet-wire.d.ts.map +1 -1
- package/dist/core/packet-wire.js +150 -112
- 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 +250 -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 +4 -5
- package/dist/server/Functionality.d.ts.map +1 -1
- package/dist/server/Functionality.js +19 -15
- package/dist/server/Functionality.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 +83 -0
- package/dist/server/WorkerModels.d.ts.map +1 -0
- package/dist/server/WorkerModels.js +500 -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 +50 -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 +48 -57
- 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,10 +103,9 @@ 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
|
-
if (log.length === 0)
|
|
106
|
+
if (entries.length === 0)
|
|
114
107
|
return { content: "", records: [], curationTargets: [], attachments: [], bodied: [] };
|
|
115
|
-
const rows = PacketWire.#renderLogEntries(
|
|
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"),
|
|
@@ -236,7 +229,7 @@ export default class PacketWire {
|
|
|
236
229
|
}
|
|
237
230
|
// {§log-wire-format} Orientation precedes telemetry on every receipt.
|
|
238
231
|
static #canonicalJson(obj) {
|
|
239
|
-
return JSON.stringify(Object.fromEntries(Object.keys(obj).
|
|
232
|
+
return JSON.stringify(Object.fromEntries(Object.keys(obj).toSorted().map((key) => [key, obj[key]])));
|
|
240
233
|
}
|
|
241
234
|
static #receiptMeta(value) {
|
|
242
235
|
const receipt = assertEditReceipt(value);
|
|
@@ -317,7 +310,7 @@ export default class PacketWire {
|
|
|
317
310
|
if (e.op !== "SEND" || e.origin !== "_plurnk")
|
|
318
311
|
return false;
|
|
319
312
|
const attrs = typeof e.attrs === "string" ? JSON.parse(e.attrs) : e.attrs;
|
|
320
|
-
return attrs
|
|
313
|
+
return isRecord(attrs) && attrs.kind === "message";
|
|
321
314
|
}
|
|
322
315
|
// {§markerless-first-page} — a body the model did not author or ask for exactly takes its first page in
|
|
323
316
|
// the packet: not the model's own row, not a retrieval (paged at its source), not an emission row,
|
|
@@ -412,7 +405,8 @@ export default class PacketWire {
|
|
|
412
405
|
return entries.map((e, index) => {
|
|
413
406
|
const identity = PacketWire.#rowIdentity(e, options);
|
|
414
407
|
// Parse rx once — reused for the matcher/items enrichment and the body.
|
|
415
|
-
const
|
|
408
|
+
const parsedRx = typeof e.rx === "string" ? PacketWire.#safeParse(e.rx) : e.rx;
|
|
409
|
+
const rx = isRecord(parsedRx) ? parsedRx : null;
|
|
416
410
|
const facts = PacketWire.#rowResultFacts(identity, e, rx, bodies[index]);
|
|
417
411
|
const paired = options.paired?.has(String(e.coordinate)) ?? false;
|
|
418
412
|
const projected = paired && bodies[index].provenance === "authored"
|
|
@@ -423,22 +417,23 @@ export default class PacketWire {
|
|
|
423
417
|
}
|
|
424
418
|
static #attrsOf(e) {
|
|
425
419
|
const attrs = typeof e.attrs === "string" ? PacketWire.#safeParse(e.attrs) : e.attrs;
|
|
426
|
-
return
|
|
420
|
+
return isRecord(attrs) ? attrs : {};
|
|
427
421
|
}
|
|
428
422
|
// One stored log row as the renderer sees it: the durable columns decoded once, a transient
|
|
429
423
|
// open row rendered open ({§invalid-emission-attempts}).
|
|
430
424
|
static entryView(r, transientOpenLogEntryId = null) {
|
|
431
|
-
const
|
|
425
|
+
const parsedTx = r.mimetype_tx === "application/json" ? JSON.parse(r.tx) : r.tx;
|
|
426
|
+
const tx = isRecord(parsedTx) ? parsedTx : typeof parsedTx === "string" ? parsedTx : null;
|
|
432
427
|
const rx = r.mimetype_rx === "application/json" ? JSON.parse(r.rx) : r.rx;
|
|
433
428
|
// {§context-fit} — a READ row's anchors ride with its lines whatever its status: a receipt that
|
|
434
429
|
// 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.");
|
|
430
|
+
const readResult = LogEntryProjection.op(r) === "READ" && isRecord(rx) && typeof rx.content === "string" ? rx : null;
|
|
431
|
+
const rawLineAnchors = readResult !== null && Object.hasOwn(readResult, "lineAnchors") ? readResult.lineAnchors : undefined;
|
|
432
|
+
if (rawLineAnchors !== undefined && !(Array.isArray(rawLineAnchors) && rawLineAnchors.every((anchor) => typeof anchor === "string"))) {
|
|
433
|
+
throw new TypeError("A READ result's lineAnchors field must be an array of strings.");
|
|
439
434
|
}
|
|
440
435
|
const lineAnchors = rawLineAnchors;
|
|
441
|
-
const rawLineNumberWidth = readResult && Object.hasOwn(
|
|
436
|
+
const rawLineNumberWidth = readResult !== null && Object.hasOwn(readResult, "lineNumberWidth") ? readResult.lineNumberWidth : undefined;
|
|
442
437
|
if (rawLineNumberWidth !== undefined && !LineAnchors.isLineNumberWidth(rawLineNumberWidth)) {
|
|
443
438
|
throw new TypeError("A READ result's lineNumberWidth field must be a valid decimal line width.");
|
|
444
439
|
}
|
|
@@ -502,16 +497,16 @@ export default class PacketWire {
|
|
|
502
497
|
// subsystem token when present; absence means the owning worker.
|
|
503
498
|
// {§message-short-identity} an arrival whose source is the transport's own name for it adds
|
|
504
499
|
// nothing to its address; a peer's or an agent's source still shows.
|
|
505
|
-
const
|
|
506
|
-
const selfAddressed =
|
|
500
|
+
const attrs = PacketWire.#attrsOf(e);
|
|
501
|
+
const selfAddressed = attrs.selfAddressed === true;
|
|
507
502
|
if (typeof e.source === "string" && e.source.length > 0 && !selfAddressed)
|
|
508
503
|
meta.source = e.source;
|
|
509
504
|
// {§message-causal-source}: every other sender has an address; the operator's message is named
|
|
510
505
|
// for the model, or it reads as the model's own SEND.
|
|
511
506
|
if (PacketWire.isArrival(e) && meta.source === undefined)
|
|
512
507
|
meta.origin = "user";
|
|
513
|
-
if (e.source === "file" &&
|
|
514
|
-
const git =
|
|
508
|
+
if (e.source === "file" && Object.hasOwn(attrs, "git")) {
|
|
509
|
+
const git = attrs.git;
|
|
515
510
|
if (typeof git !== "string" || git.length !== 2) {
|
|
516
511
|
throw new TypeError("A source=file log row carries malformed Git XY metadata.");
|
|
517
512
|
}
|
|
@@ -520,19 +515,20 @@ export default class PacketWire {
|
|
|
520
515
|
// {§log-wire-format}: routine success is implicit, independently of the operation.
|
|
521
516
|
if (typeof e.status === "number" && e.status !== 200)
|
|
522
517
|
meta.status = e.status;
|
|
523
|
-
const
|
|
518
|
+
const parsedTx = typeof e.tx === "string" ? PacketWire.#safeParse(e.tx) : e.tx;
|
|
519
|
+
const tx = isRecord(parsedTx) ? parsedTx : null;
|
|
524
520
|
const replay = options.paired?.get(String(e.coordinate));
|
|
525
521
|
const paired = replay !== undefined;
|
|
526
522
|
if (!paired && typeof tx?.aside === "string")
|
|
527
523
|
meta.aside = tx.aside;
|
|
528
|
-
const authored = tx?.target;
|
|
529
|
-
const target = PacketWire.#operandPath(e.target ??
|
|
524
|
+
const authored = PacketWire.#authoredPath(tx?.target);
|
|
525
|
+
const target = PacketWire.#operandPath(e.target ?? PacketWire.#actionTarget(tx?.target), options.projectRoot ?? null, authored);
|
|
530
526
|
const pair = op === "COPY" || op === "MOVE";
|
|
531
527
|
const selections = pair
|
|
532
|
-
? [tx?.source, tx?.destination]
|
|
528
|
+
? [PacketWire.#selection(tx?.source), PacketWire.#selection(tx?.destination)]
|
|
533
529
|
: [{ ...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((
|
|
530
|
+
const paths = selections.map((selection) => PacketWire.#operandPath(PacketWire.#actionTarget(selection?.target), options.projectRoot ?? null, authored));
|
|
531
|
+
if (pair && typeof e.status === "number" && e.status < 400 && paths.some((candidate) => candidate === null)) {
|
|
536
532
|
throw new Error(`A successful ${op} log row must retain both operand selections.`);
|
|
537
533
|
}
|
|
538
534
|
for (const field of ["scope", "metadata"]) {
|
|
@@ -540,45 +536,39 @@ export default class PacketWire {
|
|
|
540
536
|
continue;
|
|
541
537
|
const values = selections.map((selection) => field === "scope"
|
|
542
538
|
? PacketWire.#requestScope(selection?.lineMarker)
|
|
543
|
-
: selection?.metadata
|
|
539
|
+
: PacketWire.#metadata(selection?.metadata));
|
|
544
540
|
if (pair) {
|
|
545
|
-
const
|
|
546
|
-
if (Object.keys(
|
|
547
|
-
meta[field] =
|
|
541
|
+
const pairedValues = Object.fromEntries(values.flatMap((value, index) => value === null ? [] : [[index === 0 ? "from" : "to", value]]));
|
|
542
|
+
if (Object.keys(pairedValues).length > 0)
|
|
543
|
+
meta[field] = pairedValues;
|
|
548
544
|
}
|
|
549
545
|
else if (values[0] !== null)
|
|
550
546
|
meta[field] = values[0];
|
|
551
547
|
}
|
|
552
548
|
// {§log-wire-format}: describe resources and patterns directly; never serialize an OP.
|
|
553
549
|
const parts = selections.flatMap((selection, index) => {
|
|
554
|
-
const
|
|
550
|
+
const matcher = selection?.matcher;
|
|
551
|
+
const pattern = isRecord(matcher) ? matcher.raw : undefined;
|
|
555
552
|
return [
|
|
556
553
|
...(paths[index] === null ? [] : [`→ ${paths[index]}`]),
|
|
557
554
|
...(typeof pattern !== "string" || pattern.length === 0 ? []
|
|
558
555
|
: [/[\r\n]/u.test(pattern) ? JSON.stringify(pattern) : pattern]),
|
|
559
556
|
];
|
|
560
557
|
});
|
|
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
|
-
});
|
|
558
|
+
// {§paired-receipt}: every receipt names its operand; a paired one leaves its pattern to the replayed operation.
|
|
559
|
+
const operands = paths.filter((candidate) => candidate !== null).map((candidate) => `→ ${candidate}`).join(" ");
|
|
569
560
|
const description = op === "error" || op === "extension" || parts.length === 0 ? null
|
|
570
|
-
: !paired ? parts.join(" ") :
|
|
561
|
+
: !paired ? parts.join(" ") : operands.length > 0 ? operands : null;
|
|
571
562
|
// {§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;
|
|
563
|
+
if ((op === "WORK" || op === "FORK") && typeof attrs.worker === "string") {
|
|
564
|
+
meta.worker = attrs.worker;
|
|
575
565
|
// {§worker-scheme-spawn} — a WORK that reached a worker the name already held says so.
|
|
576
|
-
if (
|
|
566
|
+
if (attrs.delivered === "message")
|
|
577
567
|
meta.delivered = "message";
|
|
578
568
|
}
|
|
579
569
|
// {§worker-wait-timing} — the accepted bound, not elapsed time or the current configuration.
|
|
580
|
-
if (op === "WAIT" &&
|
|
581
|
-
const seconds =
|
|
570
|
+
if (op === "WAIT" && Object.hasOwn(attrs, "waiting")) {
|
|
571
|
+
const seconds = attrs.waiting;
|
|
582
572
|
if (typeof seconds !== "number" || !Number.isFinite(seconds) || seconds < 0) {
|
|
583
573
|
throw new TypeError("A WAIT receipt carries a malformed waiting bound.");
|
|
584
574
|
}
|
|
@@ -588,21 +578,21 @@ export default class PacketWire {
|
|
|
588
578
|
// `stream` link, distinct from the runtime-owned invocation target.
|
|
589
579
|
// {§exec-target-routing} {§fs-namespace} — the receipt names the working directory only
|
|
590
580
|
// when it is not the project root, and then in project-relative form.
|
|
591
|
-
if (isExecutionOp(op) &&
|
|
592
|
-
const cwd = PacketWire.#projectRelativeCwd(
|
|
581
|
+
if (isExecutionOp(op) && typeof attrs.cwd === "string") {
|
|
582
|
+
const cwd = PacketWire.#projectRelativeCwd(attrs.cwd, options.projectRoot ?? null);
|
|
593
583
|
if (cwd !== null)
|
|
594
584
|
meta.cwd = cwd;
|
|
595
585
|
}
|
|
596
|
-
if (isExecutionOp(op) &&
|
|
597
|
-
meta.stream =
|
|
586
|
+
if (isExecutionOp(op) && typeof attrs.stream === "string") {
|
|
587
|
+
meta.stream = attrs.stream;
|
|
598
588
|
}
|
|
599
589
|
return { meta, op, tx, coordinate, path, renderedLeaf, target, description };
|
|
600
590
|
}
|
|
601
|
-
// The row's result facts from its rx
|
|
602
|
-
//
|
|
603
|
-
// projection needs to know about the result.
|
|
591
|
+
// The row's result facts from its rx, added to the metadata line stage by stage: the attachments and the
|
|
592
|
+
// returned address, the terminal stream's exit, the Problem or detail, the retrieval extents, and the
|
|
593
|
+
// structured mutation receipts. Returns what the body projection needs to know about the result.
|
|
604
594
|
static #rowResultFacts(identity, e, rx, fullBody) {
|
|
605
|
-
const { meta, op
|
|
595
|
+
const { meta, op } = identity;
|
|
606
596
|
if (op === "SEND" && rx !== null && typeof rx === "object" && Array.isArray(rx.attachments) && rx.attachments.length > 0) {
|
|
607
597
|
meta.attachments = rx.attachments.map(({ name, mediaType, target }) => ({ name, mediaType, path: target }));
|
|
608
598
|
}
|
|
@@ -611,8 +601,19 @@ export default class PacketWire {
|
|
|
611
601
|
&& rx.resource.length > 0 && rx.resource !== identity.target && rx.resource !== meta.stream) {
|
|
612
602
|
meta.resource = rx.resource;
|
|
613
603
|
}
|
|
614
|
-
|
|
615
|
-
|
|
604
|
+
PacketWire.#streamReadFacts(meta, op, rx);
|
|
605
|
+
PacketWire.#problemFacts(identity, e, rx);
|
|
606
|
+
const { findItems, range } = PacketWire.#retrievalFacts(identity, e, rx, fullBody);
|
|
607
|
+
const structuredMutationReceipt = PacketWire.#mutationReceiptFacts(meta, op, rx);
|
|
608
|
+
return {
|
|
609
|
+
findItems, range, structuredMutationReceipt,
|
|
610
|
+
...(op === "READ" && rx?.matches !== undefined
|
|
611
|
+
? { matches: SchemeResults.assertMatchEvidenceList(rx.matches) } : {}),
|
|
612
|
+
};
|
|
613
|
+
}
|
|
614
|
+
// {§exec-stream}: explicit and automatic READs preserve the same
|
|
615
|
+
// durable liveness facts, including an empty active channel.
|
|
616
|
+
static #streamReadFacts(meta, op, rx) {
|
|
616
617
|
if (op === "READ" && rx !== null && typeof rx === "object" && Object.hasOwn(rx, "terminal")) {
|
|
617
618
|
if (typeof rx.terminal !== "boolean") {
|
|
618
619
|
throw new TypeError("A stream READ result carries a malformed terminal flag.");
|
|
@@ -627,36 +628,39 @@ export default class PacketWire {
|
|
|
627
628
|
// {§executor-page-receipt} — a producer's full-page fact survives projection as written.
|
|
628
629
|
if (Object.hasOwn(rx, "page")) {
|
|
629
630
|
const page = rx.page;
|
|
630
|
-
if (page
|
|
631
|
+
if (!isRecord(page) || !isSafeInteger(page.size) || !isSafeInteger(page.returned)) {
|
|
631
632
|
throw new TypeError("A stream READ result carries a malformed page.");
|
|
632
633
|
}
|
|
633
634
|
meta.page = { size: page.size, returned: page.returned };
|
|
634
635
|
}
|
|
635
636
|
}
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
637
|
+
}
|
|
638
|
+
// {§problem-projection} — the exact durable Problem remains the
|
|
639
|
+
// failure authority; the packet carries only facts not already
|
|
640
|
+
// owned by its enclosing row. Errors remains only an index.
|
|
641
|
+
// The success-side sibling (#342): a sub-problem receipt may carry one
|
|
642
|
+
// terse `detail` (e.g. the EDIT 304) so situational teaching is paid
|
|
643
|
+
// only when the situation occurs, never in the hot path.
|
|
644
|
+
static #problemFacts(identity, e, rx) {
|
|
645
|
+
const { meta } = identity;
|
|
639
646
|
if (typeof e.status === "number" && e.status >= 400 && rx !== null && typeof rx === "object") {
|
|
640
|
-
const problem = rx.problem;
|
|
641
|
-
Validator.assertProblemDetails(problem);
|
|
647
|
+
const problem = Validator.assertProblemDetails(rx.problem);
|
|
642
648
|
meta.problem = Problems.project(problem, {
|
|
643
649
|
status: e.status,
|
|
644
650
|
row: { ...meta, target: identity.target },
|
|
645
651
|
});
|
|
646
652
|
}
|
|
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) {
|
|
653
|
+
if (!Object.hasOwn(meta, "problem") && rx !== null && typeof rx.detail === "string" && rx.detail.length > 0) {
|
|
653
654
|
meta.detail = rx.detail;
|
|
654
655
|
}
|
|
655
|
-
|
|
656
|
-
|
|
656
|
+
}
|
|
657
|
+
// {§retrieval-packet-metadata}: one extent/coordinate owner plus
|
|
658
|
+
// only FIND aggregates that add information beyond that extent.
|
|
659
|
+
static #retrievalFacts(identity, e, rx, fullBody) {
|
|
660
|
+
const { meta, op, tx } = identity;
|
|
657
661
|
let findItems = null;
|
|
658
662
|
let range = null;
|
|
659
|
-
const patterned = tx !== null && tx !== undefined && typeof tx === "object" && tx.matcher
|
|
663
|
+
const patterned = tx !== null && tx !== undefined && typeof tx === "object" && isRecord(tx.matcher) && typeof tx.matcher.raw === "string";
|
|
660
664
|
if (patterned && op !== "FIND" && rx !== null && typeof rx === "object" && typeof rx.matched === "number")
|
|
661
665
|
meta.matched = rx.matched;
|
|
662
666
|
// {§channel-selection-visibility} — a READ names the resource's other channels with their
|
|
@@ -677,13 +681,10 @@ export default class PacketWire {
|
|
|
677
681
|
range = rx !== null && typeof rx === "object" && rx.range !== undefined
|
|
678
682
|
? Validator.assertRangeExtent(rx.range)
|
|
679
683
|
: null;
|
|
680
|
-
const
|
|
681
|
-
|
|
682
|
-
&& meta.problem !== null
|
|
683
|
-
&& typeof meta.problem === "object"
|
|
684
|
-
&& Object.hasOwn(meta.problem, "range");
|
|
684
|
+
const problem = isRecord(meta.problem) ? meta.problem : null;
|
|
685
|
+
const problemOwnsRange = typeof e.status === "number" && e.status >= 400 && problem !== null && Object.hasOwn(problem, "range");
|
|
685
686
|
if (problemOwnsRange) {
|
|
686
|
-
Validator.assertRangeExtent(
|
|
687
|
+
Validator.assertRangeExtent(problem?.range);
|
|
687
688
|
delete meta.scope;
|
|
688
689
|
}
|
|
689
690
|
if (range !== null && !problemOwnsRange) {
|
|
@@ -722,9 +723,12 @@ export default class PacketWire {
|
|
|
722
723
|
meta.matchLocationCount = rx.matchLocationCount;
|
|
723
724
|
}
|
|
724
725
|
}
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
726
|
+
return { findItems, range };
|
|
727
|
+
}
|
|
728
|
+
// {§edit-result-receipt-projection} {§edit-result-copy-move-effects}
|
|
729
|
+
// EDIT/scoped entry KILL own one receipt; COPY/MOVE own resource effects whose
|
|
730
|
+
// optional receipts describe scoped textual materializations.
|
|
731
|
+
static #mutationReceiptFacts(meta, op, rx) {
|
|
728
732
|
let structuredMutationReceipt = false;
|
|
729
733
|
if ((op === "EDIT" || op === "KILL") && rx !== null && typeof rx === "object" && Object.hasOwn(rx, "receipt")) {
|
|
730
734
|
Object.assign(meta, PacketWire.#receiptMeta(rx.receipt));
|
|
@@ -744,11 +748,7 @@ export default class PacketWire {
|
|
|
744
748
|
}));
|
|
745
749
|
structuredMutationReceipt = effects.some((effect) => effect.receipt !== undefined);
|
|
746
750
|
}
|
|
747
|
-
return
|
|
748
|
-
findItems, range, structuredMutationReceipt,
|
|
749
|
-
...(op === "READ" && rx?.matches !== undefined
|
|
750
|
-
? { matches: SchemeResults.assertMatchEvidenceList(rx.matches) } : {}),
|
|
751
|
-
};
|
|
751
|
+
return structuredMutationReceipt;
|
|
752
752
|
}
|
|
753
753
|
// The body the row shows: the canonical full body, shared with log READ, log FIND and search
|
|
754
754
|
// derivation, whole. Whether a result fit was decided where it landed ({§context-fit}).
|
|
@@ -791,8 +791,9 @@ export default class PacketWire {
|
|
|
791
791
|
...(enclosingRegion === undefined ? {} : { enclosingRegion: ScopeFormat.region(enclosingRegion) }),
|
|
792
792
|
}));
|
|
793
793
|
if (evidence.length > 0) {
|
|
794
|
-
|
|
795
|
-
|
|
794
|
+
const shown = BodyPreview.items(evidence, JSON.stringify);
|
|
795
|
+
meta.matches = shown;
|
|
796
|
+
if (shown.length !== evidence.length)
|
|
796
797
|
meta.matchLocationCount = evidence.length;
|
|
797
798
|
}
|
|
798
799
|
}
|
|
@@ -886,33 +887,31 @@ export default class PacketWire {
|
|
|
886
887
|
return row(converge(display === "open", attachment), attachment, null);
|
|
887
888
|
}
|
|
888
889
|
static #attachmentOf(rx, target, coordinate, path) {
|
|
889
|
-
|
|
890
|
-
const contentHash = rx?.nativeContentHash;
|
|
891
|
-
if (typeof contentHash !== "string")
|
|
890
|
+
if (!isRecord(rx) || typeof rx.nativeContentHash !== "string")
|
|
892
891
|
return null;
|
|
892
|
+
const contentHash = rx.nativeContentHash;
|
|
893
893
|
const pathname = typeof target?.pathname === "string" && target.pathname.length > 0
|
|
894
894
|
? target.pathname
|
|
895
895
|
: typeof target?.raw === "string" ? target.raw : null;
|
|
896
896
|
if (pathname === null || coordinate === null || path === null)
|
|
897
897
|
return null;
|
|
898
898
|
const scheme = target?.scheme ?? "file";
|
|
899
|
-
const image =
|
|
900
|
-
if (image
|
|
901
|
-
const width = image
|
|
902
|
-
const height = image.height;
|
|
899
|
+
const image = rx.image;
|
|
900
|
+
if (isRecord(image) && typeof image.mimetype === "string" && isSafeInteger(image.width) && isSafeInteger(image.height)) {
|
|
901
|
+
const { width, height } = image;
|
|
903
902
|
return { contentHash, coordinate, path, scheme, pathname, mimetype: image.mimetype, kind: "image", width, height, weight: imageWeight(width, height) };
|
|
904
903
|
}
|
|
905
|
-
const document =
|
|
906
|
-
if (document
|
|
907
|
-
const pages =
|
|
904
|
+
const document = rx.document;
|
|
905
|
+
if (isRecord(document) && typeof document.mimetype === "string" && isSafeInteger(document.bytes)) {
|
|
906
|
+
const pages = isSafeInteger(document.pages) ? document.pages : null;
|
|
908
907
|
return {
|
|
909
908
|
contentHash, coordinate, path, scheme, pathname, mimetype: document.mimetype, kind: "pdf",
|
|
910
909
|
...(pages === null ? {} : { pages }),
|
|
911
910
|
weight: pdfWeight(pages, document.bytes),
|
|
912
911
|
};
|
|
913
912
|
}
|
|
914
|
-
const audio =
|
|
915
|
-
if (audio
|
|
913
|
+
const audio = rx.audio;
|
|
914
|
+
if (isRecord(audio) && typeof audio.mimetype === "string" && isSafeInteger(audio.bytes)) {
|
|
916
915
|
const duration = typeof audio.duration === "number" && Number.isFinite(audio.duration) && audio.duration >= 0 ? audio.duration : null;
|
|
917
916
|
return {
|
|
918
917
|
contentHash, coordinate, path, scheme, pathname, mimetype: audio.mimetype, kind: "audio",
|
|
@@ -943,7 +942,7 @@ export default class PacketWire {
|
|
|
943
942
|
const parts = [];
|
|
944
943
|
for (const [at, section] of sections.entries()) {
|
|
945
944
|
parts.push({ type: "text", text: `${at === 0 ? "" : "\n\n"}${PacketWire.renderSection(section)}` });
|
|
946
|
-
for (const attachment of attachments.filter((
|
|
945
|
+
for (const attachment of attachments.filter((candidate) => candidate.section === section.name)) {
|
|
947
946
|
parts.push({ type: "text", text: `\n\n${PacketWire.attachmentCaption(attachment)}` });
|
|
948
947
|
parts.push({ type: "file", data: await bytesOf(attachment), mediaType: attachment.mimetype });
|
|
949
948
|
}
|
|
@@ -1011,15 +1010,54 @@ export default class PacketWire {
|
|
|
1011
1010
|
static #requestScope(marker) {
|
|
1012
1011
|
if (marker === null || marker === undefined)
|
|
1013
1012
|
return null;
|
|
1014
|
-
const marks = marker.marks;
|
|
1015
|
-
|
|
1013
|
+
const marks = isRecord(marker) ? marker.marks : undefined;
|
|
1014
|
+
const isMark = (mark) => typeof mark === "string" || typeof mark === "number";
|
|
1015
|
+
if (!Array.isArray(marks) || !marks.every(isMark)) {
|
|
1016
1016
|
throw new TypeError("An operation scope must retain its authored marks.");
|
|
1017
1017
|
}
|
|
1018
|
+
const [first, ...rest] = marks;
|
|
1019
|
+
if (first === undefined)
|
|
1020
|
+
throw new TypeError("An operation scope must retain its authored marks.");
|
|
1018
1021
|
// Failed selections still describe what was attempted; the operation owns validity.
|
|
1019
|
-
return ScopeFormat.marker(
|
|
1022
|
+
return ScopeFormat.marker({ marks: [first, ...rest] });
|
|
1023
|
+
}
|
|
1024
|
+
// {§packet-stored-shape} A stored operand target: the address columns as nullable strings, the port a number, the
|
|
1025
|
+
// authored `kind` and `raw` read where used. A field of another type is a malformed row.
|
|
1026
|
+
static #actionTarget(value) {
|
|
1027
|
+
if (value === null || value === undefined)
|
|
1028
|
+
return null;
|
|
1029
|
+
if (!isRecord(value))
|
|
1030
|
+
throw new TypeError("A stored operand target must be an object.");
|
|
1031
|
+
const text = (name) => {
|
|
1032
|
+
const field = value[name];
|
|
1033
|
+
if (field === undefined || field === null || typeof field === "string")
|
|
1034
|
+
return field;
|
|
1035
|
+
throw new TypeError(`A stored operand target carries a malformed ${name}.`);
|
|
1036
|
+
};
|
|
1037
|
+
const port = value.port;
|
|
1038
|
+
if (port !== undefined && port !== null && typeof port !== "number") {
|
|
1039
|
+
throw new TypeError("A stored operand target carries a malformed port.");
|
|
1040
|
+
}
|
|
1041
|
+
return {
|
|
1042
|
+
kind: value.kind, raw: value.raw, scheme: text("scheme"), hostname: text("hostname"), port, pathname: text("pathname"),
|
|
1043
|
+
query: text("query"), fragment: text("fragment"), username: text("username"), password: text("password"),
|
|
1044
|
+
};
|
|
1045
|
+
}
|
|
1046
|
+
// The target as the model authored it, when the stored statement's target is a path the grammar names; a row
|
|
1047
|
+
// whose stored target is not renders without its authored spelling.
|
|
1048
|
+
static #authoredPath(value) {
|
|
1049
|
+
if (value === null || value === undefined)
|
|
1050
|
+
return null;
|
|
1051
|
+
return Validator.validateParsedPath(value).valid ? Validator.assertParsedPath(value) : null;
|
|
1052
|
+
}
|
|
1053
|
+
static #selection(value) {
|
|
1054
|
+
return isRecord(value) ? value : null;
|
|
1055
|
+
}
|
|
1056
|
+
static #metadata(value) {
|
|
1057
|
+
return Array.isArray(value) && value.length > 0 && value.every((item) => typeof item === "string") ? value : null;
|
|
1020
1058
|
}
|
|
1021
1059
|
// {§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}) —
|
|
1060
|
+
// named because they are NOT members ({§membership-baseline}) — the user admits them.
|
|
1023
1061
|
static #renderGitState(git) {
|
|
1024
1062
|
const sync = git.ahead > 0 || git.behind > 0 ? ` (↑${git.ahead} ↓${git.behind})` : "";
|
|
1025
1063
|
const position = git.branch === null ? "detached HEAD" : `branch \`${git.branch}\`${git.unborn ? " (no commits)" : ""}`;
|