@plurnk/plurnk-service 1.18.0 → 1.19.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/.env.defaults +76 -13
- package/README.md +5 -3
- package/SPEC.md +924 -689
- package/dist/Paths.js +3 -3
- package/dist/build-info.json +1 -1
- package/dist/content/body-preview.d.ts +1 -0
- package/dist/content/body-preview.d.ts.map +1 -1
- package/dist/content/body-preview.js +8 -10
- package/dist/content/body-preview.js.map +1 -1
- package/dist/content/edit-receipt.d.ts.map +1 -1
- package/dist/content/edit-receipt.js +30 -29
- package/dist/content/edit-receipt.js.map +1 -1
- package/dist/content/line-anchors.d.ts.map +1 -1
- package/dist/content/line-anchors.js +17 -5
- package/dist/content/line-anchors.js.map +1 -1
- package/dist/content/read-projector.d.ts +2 -2
- package/dist/content/read-projector.d.ts.map +1 -1
- package/dist/content/read-projector.js +79 -37
- package/dist/content/read-projector.js.map +1 -1
- package/dist/content/scope-format.d.ts +9 -0
- package/dist/content/scope-format.d.ts.map +1 -0
- package/dist/content/scope-format.js +28 -0
- package/dist/content/scope-format.js.map +1 -0
- package/dist/core/AdministrativeLoop.d.ts +8 -0
- package/dist/core/AdministrativeLoop.d.ts.map +1 -0
- package/dist/core/AdministrativeLoop.js +16 -0
- package/dist/core/AdministrativeLoop.js.map +1 -0
- package/dist/core/AdmittedTurnExecutor.d.ts +2 -1
- package/dist/core/AdmittedTurnExecutor.d.ts.map +1 -1
- package/dist/core/AdmittedTurnExecutor.js +19 -19
- package/dist/core/AdmittedTurnExecutor.js.map +1 -1
- package/dist/core/BareBatchRunner.d.ts +1 -2
- package/dist/core/BareBatchRunner.d.ts.map +1 -1
- package/dist/core/BareBatchRunner.js +7 -12
- package/dist/core/BareBatchRunner.js.map +1 -1
- package/dist/core/BudgetReadout.d.ts.map +1 -1
- package/dist/core/BudgetReadout.js +3 -4
- package/dist/core/BudgetReadout.js.map +1 -1
- package/dist/core/CapabilityPolicies.d.ts +4 -2
- package/dist/core/CapabilityPolicies.d.ts.map +1 -1
- package/dist/core/CapabilityPolicies.js +23 -2
- package/dist/core/CapabilityPolicies.js.map +1 -1
- package/dist/core/CapabilityResolver.d.ts +2 -2
- package/dist/core/CapabilityResolver.d.ts.map +1 -1
- package/dist/core/CapabilityResolver.js +6 -3
- package/dist/core/CapabilityResolver.js.map +1 -1
- package/dist/core/ChannelWrite.d.ts +3 -6
- package/dist/core/ChannelWrite.d.ts.map +1 -1
- package/dist/core/ChannelWrite.js +8 -8
- package/dist/core/ChannelWrite.js.map +1 -1
- package/dist/core/ChannelWrite.sql +17 -11
- package/dist/core/ClientInteractions.d.ts +11 -1
- package/dist/core/ClientInteractions.d.ts.map +1 -1
- package/dist/core/ClientInteractions.js +26 -2
- package/dist/core/ClientInteractions.js.map +1 -1
- package/dist/core/CoreSchemeServices.d.ts.map +1 -1
- package/dist/core/CoreSchemeServices.js +1 -0
- package/dist/core/CoreSchemeServices.js.map +1 -1
- package/dist/core/DataStatementRunner.js +6 -6
- package/dist/core/DataStatementRunner.js.map +1 -1
- package/dist/core/Dispatcher.d.ts +12 -4
- package/dist/core/Dispatcher.d.ts.map +1 -1
- package/dist/core/Dispatcher.js +112 -90
- package/dist/core/Dispatcher.js.map +1 -1
- package/dist/core/Dispatcher.sql +11 -26
- package/dist/core/DurableStatement.d.ts +4 -1
- package/dist/core/DurableStatement.d.ts.map +1 -1
- package/dist/core/DurableStatement.js +4 -4
- package/dist/core/DurableStatement.js.map +1 -1
- package/dist/core/EditMutations.d.ts.map +1 -1
- package/dist/core/EditMutations.js +5 -2
- package/dist/core/EditMutations.js.map +1 -1
- package/dist/core/Engine.d.ts +11 -9
- package/dist/core/Engine.d.ts.map +1 -1
- package/dist/core/Engine.js +27 -65
- package/dist/core/Engine.js.map +1 -1
- package/dist/core/Engine.sql +2 -22
- package/dist/core/EnvFlags.d.ts.map +1 -1
- package/dist/core/EnvFlags.js +4 -2
- package/dist/core/EnvFlags.js.map +1 -1
- package/dist/core/ExecutorRegistry.d.ts.map +1 -1
- package/dist/core/ExecutorRegistry.js +2 -1
- package/dist/core/ExecutorRegistry.js.map +1 -1
- package/dist/core/KillHandler.d.ts.map +1 -1
- package/dist/core/KillHandler.js +7 -12
- package/dist/core/KillHandler.js.map +1 -1
- package/dist/core/Knob.d.ts +9 -0
- package/dist/core/Knob.d.ts.map +1 -0
- package/dist/core/Knob.js +50 -0
- package/dist/core/Knob.js.map +1 -0
- package/dist/core/LogBody.d.ts.map +1 -1
- package/dist/core/LogBody.js +6 -35
- package/dist/core/LogBody.js.map +1 -1
- package/dist/core/LogEntryProjection.d.ts.map +1 -1
- package/dist/core/LogEntryProjection.js +4 -0
- package/dist/core/LogEntryProjection.js.map +1 -1
- package/dist/core/LogVisibility.d.ts.map +1 -1
- package/dist/core/LogVisibility.js +2 -1
- package/dist/core/LogVisibility.js.map +1 -1
- package/dist/core/LogWriter.js +2 -2
- package/dist/core/LogWriter.js.map +1 -1
- package/dist/core/LoopDriver.d.ts +1 -1
- package/dist/core/LoopDriver.d.ts.map +1 -1
- package/dist/core/LoopDriver.js +23 -29
- package/dist/core/LoopDriver.js.map +1 -1
- package/dist/core/LoopLifecycle.d.ts +4 -17
- package/dist/core/LoopLifecycle.d.ts.map +1 -1
- package/dist/core/LoopLifecycle.js +20 -22
- package/dist/core/LoopLifecycle.js.map +1 -1
- package/dist/core/LoopLifecycle.sql +36 -49
- package/dist/core/LoopOutcome.d.ts +10 -0
- package/dist/core/LoopOutcome.d.ts.map +1 -0
- package/dist/core/LoopOutcome.js +28 -0
- package/dist/core/LoopOutcome.js.map +1 -0
- package/dist/core/LoopPolicies.d.ts +7 -0
- package/dist/core/LoopPolicies.d.ts.map +1 -0
- package/dist/core/LoopPolicies.js +37 -0
- package/dist/core/LoopPolicies.js.map +1 -0
- package/dist/core/MessageResources.d.ts +15 -0
- package/dist/core/MessageResources.d.ts.map +1 -0
- package/dist/core/MessageResources.js +46 -0
- package/dist/core/MessageResources.js.map +1 -0
- package/dist/core/MessageResources.sql +36 -0
- package/dist/core/OperatorConfig.d.ts +2 -1
- package/dist/core/OperatorConfig.d.ts.map +1 -1
- package/dist/core/OperatorConfig.js +14 -6
- package/dist/core/OperatorConfig.js.map +1 -1
- package/dist/core/PacketBuilder.d.ts.map +1 -1
- package/dist/core/PacketBuilder.js +20 -35
- package/dist/core/PacketBuilder.js.map +1 -1
- package/dist/core/PacketBuilder.sql +24 -6
- package/dist/core/PatternSelection.d.ts +1 -1
- package/dist/core/PatternSelection.d.ts.map +1 -1
- package/dist/core/ProposalLifecycle.d.ts +3 -1
- package/dist/core/ProposalLifecycle.d.ts.map +1 -1
- package/dist/core/ProposalLifecycle.js +85 -22
- package/dist/core/ProposalLifecycle.js.map +1 -1
- package/dist/core/ProviderInstantiate.d.ts +1 -0
- package/dist/core/ProviderInstantiate.d.ts.map +1 -1
- package/dist/core/ProviderInstantiate.js +12 -7
- package/dist/core/ProviderInstantiate.js.map +1 -1
- package/dist/core/ReasoningView.d.ts +1 -2
- package/dist/core/ReasoningView.d.ts.map +1 -1
- package/dist/core/ReasoningView.js +9 -20
- package/dist/core/ReasoningView.js.map +1 -1
- package/dist/core/ResourceBindings.d.ts.map +1 -1
- package/dist/core/ResourceBindings.js +5 -4
- package/dist/core/ResourceBindings.js.map +1 -1
- package/dist/core/ResourceMutations.d.ts +4 -4
- package/dist/core/ResourceMutations.d.ts.map +1 -1
- package/dist/core/ResourceMutations.js +2 -3
- package/dist/core/ResourceMutations.js.map +1 -1
- package/dist/core/ResourceSelector.d.ts +10 -3
- package/dist/core/ResourceSelector.d.ts.map +1 -1
- package/dist/core/ResourceSelector.js +52 -13
- package/dist/core/ResourceSelector.js.map +1 -1
- package/dist/core/ResourceTransfers.d.ts.map +1 -1
- package/dist/core/ResourceTransfers.js +4 -2
- package/dist/core/ResourceTransfers.js.map +1 -1
- package/dist/core/SchemeRegistry.d.ts +2 -0
- package/dist/core/SchemeRegistry.d.ts.map +1 -1
- package/dist/core/SchemeRegistry.js +11 -5
- package/dist/core/SchemeRegistry.js.map +1 -1
- package/dist/core/StoredPacket.d.ts +3 -1
- package/dist/core/StoredPacket.d.ts.map +1 -1
- package/dist/core/StoredPacket.js +7 -3
- package/dist/core/StoredPacket.js.map +1 -1
- package/dist/core/StrikeRail.d.ts.map +1 -1
- package/dist/core/StrikeRail.js +9 -3
- package/dist/core/StrikeRail.js.map +1 -1
- package/dist/core/TerminalResult.d.ts +2 -2
- package/dist/core/TerminalResult.d.ts.map +1 -1
- package/dist/core/TerminalResult.js +15 -8
- package/dist/core/TerminalResult.js.map +1 -1
- package/dist/core/ToolInputSchema.d.ts.map +1 -1
- package/dist/core/ToolInputSchema.js +24 -8
- 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 +45 -23
- package/dist/core/ToolResources.js.map +1 -1
- package/dist/core/Turn.d.ts +3 -1
- package/dist/core/Turn.d.ts.map +1 -1
- package/dist/core/Turn.js +4 -1
- package/dist/core/Turn.js.map +1 -1
- package/dist/core/Turn.sql +14 -2
- package/dist/core/TurnDispositionHandler.d.ts +13 -21
- package/dist/core/TurnDispositionHandler.d.ts.map +1 -1
- package/dist/core/TurnDispositionHandler.js +32 -190
- package/dist/core/TurnDispositionHandler.js.map +1 -1
- package/dist/core/TurnMaterialization.d.ts +9 -7
- package/dist/core/TurnMaterialization.d.ts.map +1 -1
- package/dist/core/TurnMaterialization.js +63 -41
- package/dist/core/TurnMaterialization.js.map +1 -1
- package/dist/core/TurnMaterialization.sql +23 -6
- package/dist/core/TurnOps.js +1 -1
- package/dist/core/TurnRunner.d.ts +1 -3
- package/dist/core/TurnRunner.d.ts.map +1 -1
- package/dist/core/TurnRunner.js +148 -189
- package/dist/core/TurnRunner.js.map +1 -1
- package/dist/core/TurnRunner.sql +1 -24
- package/dist/core/TurnSources.sql +42 -11
- package/dist/core/WorkerName.d.ts +1 -1
- package/dist/core/WorkerName.d.ts.map +1 -1
- package/dist/core/WorkerName.js +3 -3
- package/dist/core/WorkerName.js.map +1 -1
- package/dist/core/ambient.sql +45 -19
- package/dist/core/attachments.d.ts +3 -1
- package/dist/core/attachments.d.ts.map +1 -1
- package/dist/core/attachments.js +4 -0
- package/dist/core/attachments.js.map +1 -1
- package/dist/core/caps/CoreInteractionCaps.d.ts +1 -1
- package/dist/core/caps/CoreInteractionCaps.d.ts.map +1 -1
- package/dist/core/caps/CoreInteractionCaps.js +4 -2
- package/dist/core/caps/CoreInteractionCaps.js.map +1 -1
- package/dist/core/caps/DbChannelCaps.js +6 -6
- package/dist/core/caps/DbChannelCaps.js.map +1 -1
- package/dist/core/caps/DbEntryCaps.js +1 -1
- package/dist/core/caps/DbEntryCaps.js.map +1 -1
- package/dist/core/caps/DbMessageCaps.d.ts +10 -0
- package/dist/core/caps/DbMessageCaps.d.ts.map +1 -0
- package/dist/core/caps/DbMessageCaps.js +39 -0
- package/dist/core/caps/DbMessageCaps.js.map +1 -0
- package/dist/core/caps/DbProjectionCaps.d.ts +2 -2
- package/dist/core/caps/DbProjectionCaps.d.ts.map +1 -1
- package/dist/core/caps/DbProjectionCaps.js +10 -4
- package/dist/core/caps/DbProjectionCaps.js.map +1 -1
- package/dist/core/caps/SchemeCtxImpl.d.ts +3 -1
- package/dist/core/caps/SchemeCtxImpl.d.ts.map +1 -1
- package/dist/core/caps/SchemeCtxImpl.js +11 -0
- package/dist/core/caps/SchemeCtxImpl.js.map +1 -1
- package/dist/core/fork.sql +7 -6
- package/dist/core/git-state.d.ts +3 -2
- package/dist/core/git-state.d.ts.map +1 -1
- package/dist/core/git-state.js +37 -20
- package/dist/core/git-state.js.map +1 -1
- package/dist/core/packet-inject.js +1 -1
- package/dist/core/packet-wire.d.ts +11 -0
- package/dist/core/packet-wire.d.ts.map +1 -1
- package/dist/core/packet-wire.js +112 -88
- package/dist/core/packet-wire.js.map +1 -1
- package/dist/core/plurnk-uri.d.ts +4 -5
- package/dist/core/plurnk-uri.d.ts.map +1 -1
- package/dist/core/plurnk-uri.js +10 -31
- package/dist/core/plurnk-uri.js.map +1 -1
- package/dist/core/scheme-types.d.ts +3 -1
- package/dist/core/scheme-types.d.ts.map +1 -1
- package/dist/core/scheme-types.js +1 -1
- package/dist/core/scheme-types.js.map +1 -1
- package/dist/core/teaching.d.ts.map +1 -1
- package/dist/core/teaching.js +2 -1
- package/dist/core/teaching.js.map +1 -1
- package/dist/core/types.d.ts +1 -2
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/core/worker-ops.sql +3 -8
- package/dist/digest/Digest.d.ts.map +1 -1
- package/dist/digest/Digest.js +35 -30
- package/dist/digest/Digest.js.map +1 -1
- package/dist/digest/DigestRender.d.ts +1 -0
- package/dist/digest/DigestRender.d.ts.map +1 -1
- package/dist/digest/DigestRender.js +53 -1
- package/dist/digest/DigestRender.js.map +1 -1
- package/dist/digest/DigestRequiem.d.ts.map +1 -1
- package/dist/digest/DigestRequiem.js +13 -15
- package/dist/digest/DigestRequiem.js.map +1 -1
- package/dist/digest/digest-db.d.ts +3 -0
- package/dist/digest/digest-db.d.ts.map +1 -0
- package/dist/digest/digest-db.js +68 -0
- package/dist/digest/digest-db.js.map +1 -0
- package/dist/digest/digest-paths.d.ts +6 -0
- package/dist/digest/digest-paths.d.ts.map +1 -0
- package/dist/digest/digest-paths.js +23 -0
- package/dist/digest/digest-paths.js.map +1 -0
- package/dist/digest/digest-rows.d.ts +15 -0
- package/dist/digest/digest-rows.d.ts.map +1 -1
- package/dist/digest/digest.sql +13 -3
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/observe/genai.d.ts +2 -2
- package/dist/observe/genai.d.ts.map +1 -1
- package/dist/observe/genai.js +15 -5
- package/dist/observe/genai.js.map +1 -1
- package/dist/schemes/EffectPolicy.d.ts +0 -2
- package/dist/schemes/EffectPolicy.d.ts.map +1 -1
- package/dist/schemes/EffectPolicy.js +25 -36
- package/dist/schemes/EffectPolicy.js.map +1 -1
- package/dist/schemes/Exec.d.ts +4 -5
- package/dist/schemes/Exec.d.ts.map +1 -1
- package/dist/schemes/Exec.js +74 -62
- package/dist/schemes/Exec.js.map +1 -1
- package/dist/schemes/ExecOutputScheme.d.ts +6 -5
- package/dist/schemes/ExecOutputScheme.d.ts.map +1 -1
- package/dist/schemes/ExecOutputScheme.js +49 -16
- package/dist/schemes/ExecOutputScheme.js.map +1 -1
- package/dist/schemes/File.d.ts.map +1 -1
- package/dist/schemes/File.js +28 -20
- package/dist/schemes/File.js.map +1 -1
- package/dist/schemes/Log.d.ts +4 -4
- package/dist/schemes/Log.d.ts.map +1 -1
- package/dist/schemes/Log.js +29 -9
- package/dist/schemes/Log.js.map +1 -1
- package/dist/schemes/QuestionTool.d.ts.map +1 -1
- package/dist/schemes/QuestionTool.js +14 -1
- package/dist/schemes/QuestionTool.js.map +1 -1
- package/dist/schemes/TurnSource.d.ts +3 -2
- package/dist/schemes/TurnSource.d.ts.map +1 -1
- package/dist/schemes/TurnSource.js +80 -35
- package/dist/schemes/TurnSource.js.map +1 -1
- package/dist/schemes/Worker.d.ts.map +1 -1
- package/dist/schemes/Worker.js +22 -56
- package/dist/schemes/Worker.js.map +1 -1
- package/dist/schemes/_entry-crud.js +6 -6
- package/dist/schemes/_entry-crud.js.map +1 -1
- package/dist/schemes/_entry-crud.sql +19 -17
- package/dist/schemes/_entry-find.d.ts.map +1 -1
- package/dist/schemes/_entry-find.js +6 -5
- package/dist/schemes/_entry-find.js.map +1 -1
- package/dist/schemes/_entry-fts.d.ts.map +1 -1
- package/dist/schemes/_entry-fts.js +6 -3
- package/dist/schemes/_entry-fts.js.map +1 -1
- package/dist/schemes/_entry-fts.sql +25 -6
- package/dist/schemes/_entry-manifest.d.ts +1 -1
- package/dist/schemes/_entry-manifest.d.ts.map +1 -1
- package/dist/schemes/_entry-manifest.js +5 -3
- package/dist/schemes/_entry-manifest.js.map +1 -1
- package/dist/schemes/_entry-ops.js +4 -4
- package/dist/schemes/_entry-ops.js.map +1 -1
- package/dist/schemes/_entry-ops.sql +2 -2
- package/dist/schemes/_entry-readable.d.ts.map +1 -1
- package/dist/schemes/_entry-readable.js +5 -4
- package/dist/schemes/_entry-readable.js.map +1 -1
- package/dist/schemes/_entry-send.js +2 -2
- package/dist/schemes/_entry-send.js.map +1 -1
- package/dist/schemes/_search-exclusion.d.ts +1 -0
- package/dist/schemes/_search-exclusion.d.ts.map +1 -1
- package/dist/schemes/_search-exclusion.js +12 -0
- package/dist/schemes/_search-exclusion.js.map +1 -1
- package/dist/schemes/_search-index.js +4 -4
- package/dist/schemes/_search-index.js.map +1 -1
- package/dist/schemes/exec-abort.d.ts.map +1 -1
- package/dist/schemes/exec-abort.js +4 -3
- package/dist/schemes/exec-abort.js.map +1 -1
- package/dist/schemes/exec-lifetime.d.ts +11 -0
- package/dist/schemes/exec-lifetime.d.ts.map +1 -0
- package/dist/schemes/exec-lifetime.js +29 -0
- package/dist/schemes/exec-lifetime.js.map +1 -0
- package/dist/server/ClientReads.d.ts.map +1 -1
- package/dist/server/ClientReads.js +3 -1
- package/dist/server/ClientReads.js.map +1 -1
- package/dist/server/Daemon.d.ts +30 -7
- package/dist/server/Daemon.d.ts.map +1 -1
- package/dist/server/Daemon.js +107 -48
- package/dist/server/Daemon.js.map +1 -1
- package/dist/server/DaemonModule.d.ts +19 -5
- package/dist/server/DaemonModule.d.ts.map +1 -1
- package/dist/server/DrainSupervisor.d.ts +13 -11
- package/dist/server/DrainSupervisor.d.ts.map +1 -1
- package/dist/server/DrainSupervisor.js +87 -98
- package/dist/server/DrainSupervisor.js.map +1 -1
- package/dist/server/EnvFunctionality.d.ts +12 -3
- package/dist/server/EnvFunctionality.d.ts.map +1 -1
- package/dist/server/EnvFunctionality.js +19 -14
- package/dist/server/EnvFunctionality.js.map +1 -1
- package/dist/server/Functionality.d.ts +2 -2
- package/dist/server/Functionality.d.ts.map +1 -1
- package/dist/server/Functionality.js +97 -62
- package/dist/server/Functionality.js.map +1 -1
- package/dist/server/FunctionalityManager.d.ts +3 -1
- package/dist/server/FunctionalityManager.d.ts.map +1 -1
- package/dist/server/FunctionalityManager.js +11 -5
- package/dist/server/FunctionalityManager.js.map +1 -1
- package/dist/server/HttpListener.d.ts +16 -0
- package/dist/server/HttpListener.d.ts.map +1 -0
- package/dist/server/HttpListener.js +81 -0
- package/dist/server/HttpListener.js.map +1 -0
- package/dist/server/MembersFunctionality.d.ts.map +1 -1
- package/dist/server/MembersFunctionality.js +12 -16
- package/dist/server/MembersFunctionality.js.map +1 -1
- package/dist/server/PlurnkSkill.d.ts.map +1 -1
- package/dist/server/PlurnkSkill.js +1 -0
- package/dist/server/PlurnkSkill.js.map +1 -1
- package/dist/server/Retention.d.ts +11 -0
- package/dist/server/Retention.d.ts.map +1 -1
- package/dist/server/Retention.js +47 -2
- package/dist/server/Retention.js.map +1 -1
- package/dist/server/Retention.sql +32 -1
- package/dist/server/ServiceModules.d.ts.map +1 -1
- package/dist/server/ServiceModules.js +2 -0
- package/dist/server/ServiceModules.js.map +1 -1
- package/dist/server/SkillsFunctionality.d.ts +2 -0
- package/dist/server/SkillsFunctionality.d.ts.map +1 -1
- package/dist/server/SkillsFunctionality.js +22 -15
- package/dist/server/SkillsFunctionality.js.map +1 -1
- package/dist/server/WorkspaceCapabilities.d.ts.map +1 -1
- package/dist/server/WorkspaceCapabilities.js +1 -0
- package/dist/server/WorkspaceCapabilities.js.map +1 -1
- package/dist/server/WorkspaceStorage.d.ts +8 -0
- package/dist/server/WorkspaceStorage.d.ts.map +1 -0
- package/dist/server/WorkspaceStorage.js +26 -0
- package/dist/server/WorkspaceStorage.js.map +1 -0
- package/dist/server/client-input.d.ts +4 -3
- package/dist/server/client-input.d.ts.map +1 -1
- package/dist/server/client-input.js +24 -26
- package/dist/server/client-input.js.map +1 -1
- package/dist/server/dispatch-as-plurnk.js +2 -2
- package/dist/server/dispatch-as-plurnk.js.map +1 -1
- package/dist/server/drain.sql +69 -132
- package/dist/server/envelope.d.ts +2 -2
- package/dist/server/envelope.d.ts.map +1 -1
- package/dist/server/envelope.js +7 -9
- package/dist/server/envelope.js.map +1 -1
- package/dist/server/envelope.sql +10 -6
- package/dist/server/exec-poll-backoff.js +3 -3
- package/dist/server/exec-poll-backoff.js.map +1 -1
- package/dist/server/lifecycle-recovery.sql +8 -35
- package/dist/server/logEntry.sql +2 -2
- package/dist/server/loopDocs.js +3 -3
- package/dist/server/loopDocs.sql +4 -2
- package/dist/server/model-catalog.d.ts.map +1 -1
- package/dist/server/model-catalog.js +2 -2
- package/dist/server/model-catalog.js.map +1 -1
- package/dist/server/seam-loop.sql +0 -1
- package/dist/server/workspace-storage.sql +8 -0
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +21 -10
- package/dist/service.js.map +1 -1
- package/docs/copy-move.md +31 -0
- package/docs/env.md +19 -7
- package/docs/skills.md +2 -2
- package/migrations/002_workers.sql +26 -17
- package/migrations/003_loops.sql +82 -28
- package/migrations/005_entries.sql +135 -22
- package/migrations/006_log.sql +77 -25
- package/migrations/007_subscriptions.sql +10 -15
- package/package.json +35 -36
- package/dist/core/PromptFrames.d.ts +0 -12
- package/dist/core/PromptFrames.d.ts.map +0 -1
- package/dist/core/PromptFrames.js +0 -28
- package/dist/core/PromptFrames.js.map +0 -1
- package/dist/schemes/Prompt.d.ts +0 -8
- package/dist/schemes/Prompt.d.ts.map +0 -1
- package/dist/schemes/Prompt.js +0 -25
- package/dist/schemes/Prompt.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packet-wire.d.ts","sourceRoot":"","sources":["../../src/core/packet-wire.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,EAAmB,WAAW,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"packet-wire.d.ts","sourceRoot":"","sources":["../../src/core/packet-wire.ts"],"names":[],"mappings":"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"}
|
package/dist/core/packet-wire.js
CHANGED
|
@@ -3,13 +3,15 @@ import { relative, sep } from "node:path";
|
|
|
3
3
|
import { Problems, Validator } from "@plurnk/plurnk-contracts";
|
|
4
4
|
import { TextCoordinates } from "@plurnk/plurnk-mimetypes";
|
|
5
5
|
import { renderTarget } from "./plurnk-uri.js";
|
|
6
|
+
import GitState from "./git-state.js";
|
|
6
7
|
import LogBody from "./LogBody.js";
|
|
7
8
|
import LogEntryProjection from "./LogEntryProjection.js";
|
|
8
9
|
import LogVisibility from "./LogVisibility.js";
|
|
9
10
|
import BodyPreview from "../content/body-preview.js";
|
|
11
|
+
import ScopeFormat from "../content/scope-format.js";
|
|
10
12
|
import { assertEditReceipt, assertResourceEffects, LineAnchors, } from "../content/index.js";
|
|
11
13
|
// {§packet-attachment-parts} — the attachment kinds and their readout weights live in one table.
|
|
12
|
-
import { imageWeight, pdfWeight } from "./attachments.js";
|
|
14
|
+
import { audioWeight, imageWeight, pdfWeight } from "./attachments.js";
|
|
13
15
|
import { isExecutionOp } from "@plurnk/plurnk-contracts";
|
|
14
16
|
export { imageWeight, pdfWeight };
|
|
15
17
|
export default class PacketWire {
|
|
@@ -205,7 +207,7 @@ export default class PacketWire {
|
|
|
205
207
|
static #canonicalJson(obj) {
|
|
206
208
|
const keys = Object.keys(obj).sort();
|
|
207
209
|
const sorted = {};
|
|
208
|
-
for (const key of ["
|
|
210
|
+
for (const key of ["path", "from", "to", "aside"]) {
|
|
209
211
|
if (Object.hasOwn(obj, key))
|
|
210
212
|
sorted[key] = obj[key];
|
|
211
213
|
}
|
|
@@ -227,7 +229,7 @@ export default class PacketWire {
|
|
|
227
229
|
return {
|
|
228
230
|
...head,
|
|
229
231
|
change: `-${receipt.effect.removed} +${receipt.effect.inserted}`,
|
|
230
|
-
|
|
232
|
+
effect: `${receipt.effect.source} -> ${receipt.effect.result}`,
|
|
231
233
|
// {§edit-receipt-removed-text} — what a deletion took, so it can be put back from the receipt.
|
|
232
234
|
...(receipt.effect.removedText === undefined ? {} : { removed: receipt.effect.removedText }),
|
|
233
235
|
};
|
|
@@ -240,7 +242,7 @@ export default class PacketWire {
|
|
|
240
242
|
? {}
|
|
241
243
|
: {
|
|
242
244
|
change: `-${receipt.replacement.removed} +${receipt.replacement.inserted}`,
|
|
243
|
-
replacement: `${receipt.replacement.
|
|
245
|
+
replacement: `${receipt.replacement.source} -> ${receipt.replacement.result}`,
|
|
244
246
|
}),
|
|
245
247
|
};
|
|
246
248
|
}
|
|
@@ -256,21 +258,7 @@ export default class PacketWire {
|
|
|
256
258
|
}
|
|
257
259
|
return endsWithLineBreak ? body.replace(/(?:\r\n|\r|\n)$/, "") : body;
|
|
258
260
|
}
|
|
259
|
-
//
|
|
260
|
-
// No body, no fence — every meaningful field is in the JSON. Naming
|
|
261
|
-
// follows the uniform principle: `path` is identity (this log row's
|
|
262
|
-
// own URI), `target` is the URI in the statement's target slot. COPY/MOVE
|
|
263
|
-
// retain their source and destination selections separately from ordered
|
|
264
|
-
// applied `effects`.
|
|
265
|
-
//
|
|
266
|
-
// On error, status >= 400 signals the failure; Problem Details live on
|
|
267
|
-
// this durable row and the next packet's Errors section points here.
|
|
268
|
-
//
|
|
269
|
-
// Per-entry render: one meta JSON line plus the row's canonical body.
|
|
270
|
-
// LogBody owns tx/rx storage interpretation; packet projection owns only
|
|
271
|
-
// visibility, previewing, mimetype rendering, and metadata.
|
|
272
|
-
// The log:/// handle the model sees for an entry.
|
|
273
|
-
// ({§log-kill-scope}).
|
|
261
|
+
// {§log-address-metadata} — row identity belongs to the H3, not its operand metadata.
|
|
274
262
|
static #entryPath(coordinate, leaf) {
|
|
275
263
|
if (coordinate === null)
|
|
276
264
|
throw new TypeError("A packet log row requires an addressable coordinate.");
|
|
@@ -291,30 +279,26 @@ export default class PacketWire {
|
|
|
291
279
|
chunk: cut ? PacketWire.#chunk(coordinates, physicalLines, end, text.length) : null,
|
|
292
280
|
};
|
|
293
281
|
}
|
|
294
|
-
static #formatRegion(region) {
|
|
295
|
-
return `<${region.startLine},${region.startColumn},${region.endLine},${region.endColumn}>`;
|
|
296
|
-
}
|
|
297
282
|
static #chunk(coordinates, lines, end, completeEnd) {
|
|
298
283
|
const finalCompleteLine = lines.findIndex((line) => line.separator.length > 0 && line.end === end);
|
|
299
284
|
if (finalCompleteLine !== -1) {
|
|
300
|
-
const selected =
|
|
301
|
-
|
|
302
|
-
if (selected === complete) {
|
|
285
|
+
const selected = ScopeFormat.lines(1, finalCompleteLine + 1);
|
|
286
|
+
if (finalCompleteLine + 1 === lines.length) {
|
|
303
287
|
throw new Error("a bounded body chunk must differ from its complete line extent");
|
|
304
288
|
}
|
|
305
|
-
return
|
|
289
|
+
return `${selected} of ${ScopeFormat.count("line", lines.length)}`;
|
|
306
290
|
}
|
|
307
291
|
const selectedRegion = coordinates.regionFromOffsets(0, end);
|
|
308
292
|
const completeRegion = coordinates.regionFromOffsets(0, completeEnd);
|
|
309
293
|
if (selectedRegion === null || completeRegion === null) {
|
|
310
294
|
throw new Error("a character-bound body chunk must resolve to exact text coordinates");
|
|
311
295
|
}
|
|
312
|
-
const selected =
|
|
313
|
-
const complete =
|
|
296
|
+
const selected = ScopeFormat.region(selectedRegion);
|
|
297
|
+
const complete = ScopeFormat.region(completeRegion);
|
|
314
298
|
if (selected === complete) {
|
|
315
299
|
throw new Error("a bounded body chunk must differ from its complete text extent");
|
|
316
300
|
}
|
|
317
|
-
return
|
|
301
|
+
return `${selected} of ${complete}`;
|
|
318
302
|
}
|
|
319
303
|
static #sparseChunk(completeContent, visibleContent, visibleOrdinals, projectedContent) {
|
|
320
304
|
const end = projectedContent.length;
|
|
@@ -333,8 +317,8 @@ export default class PacketWire {
|
|
|
333
317
|
previous[1] = ordinal;
|
|
334
318
|
}
|
|
335
319
|
}
|
|
336
|
-
const selected = runs.map(([start, finish]) =>
|
|
337
|
-
return
|
|
320
|
+
const selected = runs.map(([start, finish]) => ScopeFormat.lines(start, finish)).join(",");
|
|
321
|
+
return `${selected} of ${ScopeFormat.count("line", TextCoordinates.logicalLines(completeContent).length)}`;
|
|
338
322
|
}
|
|
339
323
|
const local = coordinates.regionFromOffsets(0, end);
|
|
340
324
|
const complete = new TextCoordinates(completeContent)
|
|
@@ -347,11 +331,11 @@ export default class PacketWire {
|
|
|
347
331
|
if (startLine === undefined || endLine === undefined) {
|
|
348
332
|
throw new Error("a sparse character-bound chunk must map to canonical body lines");
|
|
349
333
|
}
|
|
350
|
-
return
|
|
334
|
+
return `${ScopeFormat.region({
|
|
351
335
|
...local,
|
|
352
336
|
startLine,
|
|
353
337
|
endLine,
|
|
354
|
-
})} of ${
|
|
338
|
+
})} of ${ScopeFormat.region(complete)}`;
|
|
355
339
|
}
|
|
356
340
|
static #promptProjection(body, budget, weighContent, render = (content) => PacketWire.#renderContentBody(content, body.startLine, null)) {
|
|
357
341
|
const weightAt = (end) => weighContent(render(body.content.slice(0, end)));
|
|
@@ -425,10 +409,24 @@ export default class PacketWire {
|
|
|
425
409
|
readableContent: select(readableOrdinals),
|
|
426
410
|
readableOrdinals,
|
|
427
411
|
folded: clipped,
|
|
412
|
+
trimmed: LogVisibility.clipped(trimmed, totalLines),
|
|
428
413
|
totalLines,
|
|
429
414
|
fullyFolded: LogVisibility.fullyFolded(clipped, totalLines),
|
|
430
415
|
};
|
|
431
416
|
}
|
|
417
|
+
// {§message-arrival} — an inbound SEND row: harness-published, the sender's statement as its
|
|
418
|
+
// sent side. {§message-causal-source}: a `source` names the actor; absence is the owner.
|
|
419
|
+
static isArrival(e) {
|
|
420
|
+
if (e.op !== "SEND" || e.origin !== "_plurnk")
|
|
421
|
+
return false;
|
|
422
|
+
const attrs = typeof e.attrs === "string" ? JSON.parse(e.attrs) : e.attrs;
|
|
423
|
+
return attrs !== null && typeof attrs === "object" && attrs.kind === "message";
|
|
424
|
+
}
|
|
425
|
+
// {§message-projection} — a peer worker's message takes the ordinary bounds; every other
|
|
426
|
+
// arrival, the loop's own assignment included, shares the allowance.
|
|
427
|
+
static isExteriorArrival(e) {
|
|
428
|
+
return PacketWire.isArrival(e) && !(typeof e.source === "string" && e.source.startsWith("worker://"));
|
|
429
|
+
}
|
|
432
430
|
static #promptProjectionWeights(entries, bodies, visibility, weighContent, budget) {
|
|
433
431
|
if (budget === undefined)
|
|
434
432
|
return new Map();
|
|
@@ -436,7 +434,9 @@ export default class PacketWire {
|
|
|
436
434
|
throw new RangeError(`promptProjectionWeight must be a non-negative safe integer, got ${JSON.stringify(budget)}`);
|
|
437
435
|
}
|
|
438
436
|
const costs = entries.flatMap((entry, index) => {
|
|
439
|
-
|
|
437
|
+
// {§message-projection} — an arrival from outside the workspace shares the allowance;
|
|
438
|
+
// a peer worker's message takes the ordinary bounds.
|
|
439
|
+
if (!PacketWire.isExteriorArrival(entry) || bodies[index].content.length === 0)
|
|
440
440
|
return [];
|
|
441
441
|
const body = bodies[index];
|
|
442
442
|
const visible = visibility[index];
|
|
@@ -488,7 +488,7 @@ export default class PacketWire {
|
|
|
488
488
|
const identity = PacketWire.#rowIdentity(e, options);
|
|
489
489
|
// Parse rx once — reused for the matcher/items enrichment and the body.
|
|
490
490
|
const rx = (typeof e.rx === "string" ? PacketWire.#safeParse(e.rx) : e.rx);
|
|
491
|
-
const facts = PacketWire.#rowResultFacts(identity, e, rx);
|
|
491
|
+
const facts = PacketWire.#rowResultFacts(identity, e, rx, bodies[index]);
|
|
492
492
|
const projected = PacketWire.#rowBody(identity, e, bodies[index], visibility[index], facts, promptProjectionWeights.get(index), weighContent);
|
|
493
493
|
return PacketWire.#rowAccounting(identity, e, bodies[index], visibility[index], projected, weighContent, options);
|
|
494
494
|
});
|
|
@@ -504,12 +504,18 @@ export default class PacketWire {
|
|
|
504
504
|
const renderedLeaf = LogEntryProjection.leaf(e);
|
|
505
505
|
const path = PacketWire.#entryPath(coordinate, renderedLeaf);
|
|
506
506
|
// Absence = "model" — the worker's own authorship is the default,
|
|
507
|
-
// exactly as `source` absence means the owning worker (#338).
|
|
508
|
-
|
|
507
|
+
// exactly as `source` absence means the owning worker (#338). An arrival is an inbound
|
|
508
|
+
// SEND row the harness published ({§message-causal-source}): its origin says nothing, so
|
|
509
|
+
// the row carries only the causal `source` when another actor supplied one (#706).
|
|
510
|
+
if (typeof e.origin === "string" && e.origin !== "model" && !PacketWire.isArrival(e))
|
|
509
511
|
meta.origin = e.origin;
|
|
510
512
|
// {§env-delta-attribution}: render the causal worker address or
|
|
511
513
|
// subsystem token when present; absence means the owning worker.
|
|
512
|
-
|
|
514
|
+
// {§message-short-identity} an arrival whose source is the transport's own name for it adds
|
|
515
|
+
// nothing to its address; a peer's or an agent's source still shows.
|
|
516
|
+
const arrivalAttrs = typeof e.attrs === "string" ? PacketWire.#safeParse(e.attrs) : e.attrs;
|
|
517
|
+
const selfAddressed = arrivalAttrs !== null && typeof arrivalAttrs === "object" && arrivalAttrs.selfAddressed === true;
|
|
518
|
+
if (typeof e.source === "string" && e.source.length > 0 && !selfAddressed)
|
|
513
519
|
meta.source = e.source;
|
|
514
520
|
if (e.source === "file" && e.attrs !== null && typeof e.attrs === "object" && "git" in e.attrs) {
|
|
515
521
|
const git = e.attrs.git;
|
|
@@ -518,7 +524,7 @@ export default class PacketWire {
|
|
|
518
524
|
}
|
|
519
525
|
meta.git = git;
|
|
520
526
|
}
|
|
521
|
-
// SEND,
|
|
527
|
+
// SEND, lifecycle verbs, destructive KILL, and non-200 statuses stay explicit.
|
|
522
528
|
// Successful log-KILL rows never reach this projection
|
|
523
529
|
// ({§log-kill-meta-operation}).
|
|
524
530
|
if (typeof e.status === "number" && (op === "SEND" || op === "KILL" || typeof op === "string" && TurnDisposition.isOp(op) || e.status !== 200))
|
|
@@ -527,20 +533,14 @@ export default class PacketWire {
|
|
|
527
533
|
if (typeof tx?.aside === "string")
|
|
528
534
|
meta.aside = tx.aside;
|
|
529
535
|
const target = PacketWire.#renderActionTarget(e.target);
|
|
530
|
-
// {§
|
|
531
|
-
// rendered under `stream` like the invocation's own link — never a `target`, which
|
|
532
|
-
// the model would otherwise author into an execution slot (#425 F4).
|
|
533
|
-
const terminalStream = op === "READ"
|
|
534
|
-
&& e.attrs !== null
|
|
535
|
-
&& typeof e.attrs === "object"
|
|
536
|
-
&& e.attrs.terminal === true;
|
|
536
|
+
// {§log-address-metadata}: operands are independent of record identity and attribution.
|
|
537
537
|
if (op === "COPY" || op === "MOVE") {
|
|
538
538
|
const source = PacketWire.#renderSelection(tx?.source?.target, tx?.source?.lineMarker);
|
|
539
539
|
const destination = PacketWire.#renderSelection(tx?.destination?.target, tx?.destination?.lineMarker);
|
|
540
540
|
if (source !== null)
|
|
541
|
-
meta.
|
|
541
|
+
meta.from = source;
|
|
542
542
|
if (destination !== null)
|
|
543
|
-
meta.
|
|
543
|
+
meta.to = destination;
|
|
544
544
|
if (typeof e.status === "number"
|
|
545
545
|
&& e.status < 400
|
|
546
546
|
&& (source === null || destination === null)) {
|
|
@@ -548,7 +548,7 @@ export default class PacketWire {
|
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
550
|
else if (target !== null) {
|
|
551
|
-
meta
|
|
551
|
+
meta.path = target;
|
|
552
552
|
}
|
|
553
553
|
// {§worker-auto-name} The created identity is an outcome, not an authored target.
|
|
554
554
|
if ((op === "WORK" || op === "FORK") && e.attrs !== null && typeof e.attrs === "object"
|
|
@@ -568,21 +568,31 @@ export default class PacketWire {
|
|
|
568
568
|
if (isExecutionOp(op) && e.attrs !== null && typeof e.attrs === "object" && typeof e.attrs.stream === "string") {
|
|
569
569
|
meta.stream = e.attrs.stream;
|
|
570
570
|
}
|
|
571
|
-
return { meta, op, tx, coordinate, path, renderedLeaf, target
|
|
571
|
+
return { meta, op, tx, coordinate, path, renderedLeaf, target };
|
|
572
572
|
}
|
|
573
573
|
// The row's result facts from its rx: the terminal stream's exit, the Problem or detail, the
|
|
574
574
|
// matcher, the retrieval extents, and the structured mutation receipts. Returns what the body
|
|
575
575
|
// projection needs to know about the result.
|
|
576
|
-
static #rowResultFacts(identity, e, rx) {
|
|
577
|
-
const { meta, op, tx
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
576
|
+
static #rowResultFacts(identity, e, rx, fullBody) {
|
|
577
|
+
const { meta, op, tx } = identity;
|
|
578
|
+
if (op === "SEND" && rx !== null && typeof rx === "object" && Array.isArray(rx.attachments) && rx.attachments.length > 0) {
|
|
579
|
+
meta.attachments = rx.attachments.map(({ name, mediaType, target }) => ({ name, mediaType, path: target }));
|
|
580
|
+
}
|
|
581
|
+
// {§operation-resource-receipt}: preserve the returned address, not a second authored target.
|
|
582
|
+
if (rx !== null && typeof rx === "object" && typeof rx.resource === "string"
|
|
583
|
+
&& rx.resource.length > 0 && rx.resource !== meta.path && rx.resource !== meta.stream) {
|
|
584
|
+
meta.resource = rx.resource;
|
|
585
|
+
}
|
|
586
|
+
// {§exec-stream}: explicit and automatic READs preserve the same
|
|
587
|
+
// durable liveness facts, including an empty active channel.
|
|
588
|
+
if (op === "READ" && rx !== null && typeof rx === "object" && Object.hasOwn(rx, "terminal")) {
|
|
589
|
+
if (typeof rx.terminal !== "boolean") {
|
|
590
|
+
throw new TypeError("A stream READ result carries a malformed terminal flag.");
|
|
591
|
+
}
|
|
592
|
+
meta.terminal = rx.terminal;
|
|
593
|
+
if (Object.hasOwn(rx, "exitCode")) {
|
|
584
594
|
if (typeof rx.exitCode !== "number" || !Number.isSafeInteger(rx.exitCode)) {
|
|
585
|
-
throw new TypeError("A
|
|
595
|
+
throw new TypeError("A stream READ result carries a malformed exitCode.");
|
|
586
596
|
}
|
|
587
597
|
meta.exitCode = rx.exitCode;
|
|
588
598
|
}
|
|
@@ -595,7 +605,7 @@ export default class PacketWire {
|
|
|
595
605
|
Validator.assertProblemDetails(problem);
|
|
596
606
|
meta.problem = Problems.project(problem, {
|
|
597
607
|
status: e.status,
|
|
598
|
-
row: meta,
|
|
608
|
+
row: { ...meta, target: identity.target },
|
|
599
609
|
});
|
|
600
610
|
}
|
|
601
611
|
// The success-side sibling (#342): a sub-problem receipt may carry one
|
|
@@ -609,6 +619,7 @@ export default class PacketWire {
|
|
|
609
619
|
// {§retrieval-packet-metadata}: one extent/coordinate owner plus
|
|
610
620
|
// only FIND aggregates that add information beyond that extent.
|
|
611
621
|
let findItems = null;
|
|
622
|
+
let range = null;
|
|
612
623
|
const patterned = tx !== null && tx !== undefined && typeof tx === "object" && tx.matcher !== null && typeof tx.matcher === "object" && typeof tx.matcher.raw === "string";
|
|
613
624
|
if (patterned) {
|
|
614
625
|
meta.matcher = tx.matcher.raw;
|
|
@@ -621,8 +632,8 @@ export default class PacketWire {
|
|
|
621
632
|
meta.channels = rx.channels;
|
|
622
633
|
}
|
|
623
634
|
// {§send-response-receipt} — a reply's row names the prompts it answered.
|
|
624
|
-
if (op === "SEND" && rx !== null && typeof rx === "object" && Array.isArray(rx.
|
|
625
|
-
meta.
|
|
635
|
+
if (op === "SEND" && rx !== null && typeof rx === "object" && Array.isArray(rx.answers)) {
|
|
636
|
+
meta.answers = rx.answers;
|
|
626
637
|
}
|
|
627
638
|
if (op === "READ" || op === "FIND") {
|
|
628
639
|
if (op === "FIND" && rx !== null && typeof rx === "object" && typeof rx.content === "string") {
|
|
@@ -630,9 +641,9 @@ export default class PacketWire {
|
|
|
630
641
|
if (Array.isArray(parsed))
|
|
631
642
|
findItems = parsed.length;
|
|
632
643
|
}
|
|
633
|
-
|
|
634
|
-
? rx.range
|
|
635
|
-
:
|
|
644
|
+
range = rx !== null && typeof rx === "object" && rx.range !== undefined
|
|
645
|
+
? Validator.assertRangeExtent(rx.range)
|
|
646
|
+
: null;
|
|
636
647
|
const problemOwnsRange = typeof e.status === "number"
|
|
637
648
|
&& e.status >= 400
|
|
638
649
|
&& meta.problem !== null
|
|
@@ -641,11 +652,16 @@ export default class PacketWire {
|
|
|
641
652
|
if (problemOwnsRange) {
|
|
642
653
|
Validator.assertRangeExtent(meta.problem.range);
|
|
643
654
|
}
|
|
644
|
-
if (range !==
|
|
645
|
-
|
|
655
|
+
if (range !== null && !problemOwnsRange) {
|
|
656
|
+
const sparse = fullBody.lineOrdinals !== undefined
|
|
657
|
+
&& range.returned !== undefined
|
|
658
|
+
&& fullBody.lineOrdinals.length !== range.returned[1] - range.returned[0] + 1;
|
|
659
|
+
meta.range = typeof e.status === "number" && e.status >= 400
|
|
660
|
+
? range
|
|
661
|
+
: ScopeFormat.range(range, sparse);
|
|
646
662
|
}
|
|
647
|
-
else if (op === "READ" && rx !== null && typeof rx === "object" && rx.region !== undefined) {
|
|
648
|
-
meta.
|
|
663
|
+
else if (range === null && !problemOwnsRange && op === "READ" && rx !== null && typeof rx === "object" && rx.region !== undefined) {
|
|
664
|
+
meta.range = ScopeFormat.region(Validator.assertTextRegion(rx.region));
|
|
649
665
|
}
|
|
650
666
|
// These are underlying selected-content weights, distinct from
|
|
651
667
|
// the emitted body's generic `tokens` measurement.
|
|
@@ -662,9 +678,7 @@ export default class PacketWire {
|
|
|
662
678
|
}
|
|
663
679
|
if (op === "FIND"
|
|
664
680
|
&& patterned
|
|
665
|
-
&& range
|
|
666
|
-
&& typeof range === "object"
|
|
667
|
-
&& range.unit === "resource"
|
|
681
|
+
&& range?.unit === "resource"
|
|
668
682
|
&& rx !== null
|
|
669
683
|
&& typeof rx === "object"
|
|
670
684
|
&& typeof rx.matchLocationCount === "number"
|
|
@@ -686,7 +700,7 @@ export default class PacketWire {
|
|
|
686
700
|
&& Object.hasOwn(rx, "effects")) {
|
|
687
701
|
const effects = assertResourceEffects(rx.effects);
|
|
688
702
|
meta.effects = effects.map((effect) => ({
|
|
689
|
-
|
|
703
|
+
path: effect.target,
|
|
690
704
|
action: effect.action,
|
|
691
705
|
...(effect.receipt === undefined
|
|
692
706
|
? {}
|
|
@@ -694,11 +708,11 @@ export default class PacketWire {
|
|
|
694
708
|
}));
|
|
695
709
|
structuredMutationReceipt = effects.some((effect) => effect.receipt !== undefined);
|
|
696
710
|
}
|
|
697
|
-
return { findItems, structuredMutationReceipt };
|
|
711
|
+
return { findItems, range, structuredMutationReceipt };
|
|
698
712
|
}
|
|
699
713
|
// The body the row shows: the canonical full body is shared with log READ, log FIND, and
|
|
700
|
-
// search derivation. READ/FIND own selection bounds,
|
|
701
|
-
// complete, and
|
|
714
|
+
// search derivation. READ/FIND own selection bounds, NOTE, lifecycle bodies and admitted programs remain
|
|
715
|
+
// complete, and exterior arrivals share their packet allowance. Structured mutation receipts own
|
|
702
716
|
// their join bound; every remaining body uses the ordinary fixed preview.
|
|
703
717
|
static #rowBody(identity, e, fullBody, bodyVisibility, facts, promptProjectionWeight, weighContent) {
|
|
704
718
|
const { meta, op, renderedLeaf } = identity;
|
|
@@ -709,7 +723,7 @@ export default class PacketWire {
|
|
|
709
723
|
const emptyFind = op === "FIND" && e.status === 200 && facts.findItems === 0;
|
|
710
724
|
const previewExempt = op === "READ"
|
|
711
725
|
|| op === "FIND"
|
|
712
|
-
|| op === "
|
|
726
|
+
|| op === "NOTE" || typeof op === "string" && TurnDisposition.isOp(op)
|
|
713
727
|
|| (op === null && renderedLeaf === "ops")
|
|
714
728
|
|| facts.structuredMutationReceipt;
|
|
715
729
|
const lineAnchors = op === "READ" ? e.lineAnchors ?? null : null;
|
|
@@ -717,9 +731,7 @@ export default class PacketWire {
|
|
|
717
731
|
if (lineAnchors !== null) {
|
|
718
732
|
LineAnchors.assertProjection(fullBody.content, lineAnchors);
|
|
719
733
|
}
|
|
720
|
-
const findRange = op === "FIND"
|
|
721
|
-
? meta.range
|
|
722
|
-
: null;
|
|
734
|
+
const findRange = op === "FIND" ? facts.range : null;
|
|
723
735
|
const bodyStartLine = findRange?.returned?.[0] ?? fullBody.startLine;
|
|
724
736
|
const numericLineNumberWidth = findRange === null
|
|
725
737
|
? bodyStartLine === null || bodyVisibility.totalLines === 0
|
|
@@ -747,8 +759,8 @@ export default class PacketWire {
|
|
|
747
759
|
if (fullBody.content.length > 0 && op !== "READ" && op !== "FIND") {
|
|
748
760
|
meta.lines = bodyVisibility.totalLines;
|
|
749
761
|
}
|
|
750
|
-
if (bodyVisibility.
|
|
751
|
-
meta.
|
|
762
|
+
if (bodyVisibility.trimmed.length > 0 && !bodyVisibility.fullyFolded) {
|
|
763
|
+
meta.trimmed = LogVisibility.format(bodyVisibility.trimmed);
|
|
752
764
|
}
|
|
753
765
|
const display = bodyVisibility.readableContent.length === 0
|
|
754
766
|
? "none"
|
|
@@ -762,8 +774,10 @@ export default class PacketWire {
|
|
|
762
774
|
&& !bodyVisibility.fullyFolded
|
|
763
775
|
? PacketWire.#sparseChunk(fullBody.content, projectedBody.content, sourceOrdinals, projection.text)
|
|
764
776
|
: projection.chunk;
|
|
765
|
-
if (display === "open" && projectedChunk !== null)
|
|
766
|
-
meta.
|
|
777
|
+
if (display === "open" && projectedChunk !== null) {
|
|
778
|
+
meta.preview = projectedChunk;
|
|
779
|
+
delete meta.lines;
|
|
780
|
+
}
|
|
767
781
|
return { body, projectedLineCount, display };
|
|
768
782
|
}
|
|
769
783
|
// The row's native attachment, its withholding receipt, and the accounting field that
|
|
@@ -843,6 +857,15 @@ export default class PacketWire {
|
|
|
843
857
|
weight: pdfWeight(pages, document.bytes),
|
|
844
858
|
};
|
|
845
859
|
}
|
|
860
|
+
const audio = view?.audio;
|
|
861
|
+
if (audio !== undefined && typeof audio.mimetype === "string" && Number.isSafeInteger(audio.bytes)) {
|
|
862
|
+
const duration = typeof audio.duration === "number" && Number.isFinite(audio.duration) && audio.duration >= 0 ? audio.duration : null;
|
|
863
|
+
return {
|
|
864
|
+
contentHash, coordinate, path, scheme, pathname, mimetype: audio.mimetype, kind: "audio",
|
|
865
|
+
...(duration === null ? {} : { duration }),
|
|
866
|
+
weight: audioWeight(duration, audio.bytes),
|
|
867
|
+
};
|
|
868
|
+
}
|
|
846
869
|
return null;
|
|
847
870
|
}
|
|
848
871
|
// {§packet-attachment-parts} — the wire form with native parts: user text first, then each accepted
|
|
@@ -896,10 +919,10 @@ export default class PacketWire {
|
|
|
896
919
|
}
|
|
897
920
|
// {§packet-git-status}: the count line, then one bounded line per non-empty class. Untracked paths are
|
|
898
921
|
// named because they are NOT members ({§membership-baseline}) — a human `git add`s or picks them.
|
|
899
|
-
static #GIT_PATHS_PER_CLASS = 8;
|
|
900
922
|
static #renderGitState(git) {
|
|
901
923
|
const sync = git.ahead > 0 || git.behind > 0 ? ` (↑${git.ahead} ↓${git.behind})` : "";
|
|
902
|
-
const
|
|
924
|
+
const position = git.branch === null ? "detached HEAD" : `branch \`${git.branch}\`${git.unborn ? " (no commits)" : ""}`;
|
|
925
|
+
const head = `${position}${sync} — ${git.staged} staged, ${git.unstaged} unstaged, ${git.untracked} untracked`;
|
|
903
926
|
const files = git.files ?? [];
|
|
904
927
|
const path = (p) => `\`${p}\``;
|
|
905
928
|
const untracked = files.filter((f) => f.status === "??");
|
|
@@ -913,8 +936,9 @@ export default class PacketWire {
|
|
|
913
936
|
const lines = classes
|
|
914
937
|
.filter(([, items]) => items.length > 0)
|
|
915
938
|
.map(([label, items]) => {
|
|
916
|
-
const
|
|
917
|
-
const
|
|
939
|
+
const paths = GitState.renderedPaths();
|
|
940
|
+
const shown = items.slice(0, paths).join(" · ");
|
|
941
|
+
const more = items.length > paths ? ` (+${items.length - paths} more)` : "";
|
|
918
942
|
return `${label}: ${shown}${more}`;
|
|
919
943
|
});
|
|
920
944
|
return [head, ...lines].join("\n");
|