@jeffusion/bungee-core 6.19.3 → 6.19.4
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/dist/access-database.d.ts +22 -0
- package/dist/api/handlers/logs.d.ts +66 -0
- package/dist/api/handlers/stats.d.ts +50 -0
- package/dist/api/logs.d.ts +145 -0
- package/dist/api/types.d.ts +21 -0
- package/dist/{chunk-assets-swq50rh3.js → chunk-assets-vsan7gav.js} +11 -11
- package/dist/{chunk-body-capture-gtta9q26.js → chunk-body-capture-sbk6cdf9.js} +2 -2
- package/dist/{chunk-handler-ehkkxpnq.js → chunk-handler-9k6b95w4.js} +2 -2
- package/dist/{chunk-main-rcw37zhd.js → chunk-main-1p15rgq5.js} +1 -1
- package/dist/{chunk-main-10pgdbgn.js → chunk-main-2efrk1nt.js} +1 -1
- package/dist/{chunk-main-a4eygw79.js → chunk-main-d74e7qxc.js} +1 -1
- package/dist/{chunk-main-p5rpfk7t.js → chunk-main-gwaw6pxp.js} +1 -1
- package/dist/{chunk-main-25kbhd4n.js → chunk-main-mqgkewnx.js} +1 -1
- package/dist/{chunk-main-0w3jk2x4.js → chunk-main-qm1tgaka.js} +2 -2
- package/dist/{chunk-master-276v10xm.js → chunk-master-wtcfwd6g.js} +6 -6
- package/dist/{chunk-plugin-context-manager-nexyp0jb.js → chunk-plugin-context-manager-kabrbg0s.js} +1 -1
- package/dist/{chunk-plugin-manager-dvxc5w6p.js → chunk-plugin-manager-q1bt6xnw.js} +2 -2
- package/dist/{chunk-runtime-upgrade-sjxsa2r6.js → chunk-runtime-upgrade-rvm3d096.js} +3 -3
- package/dist/{chunk-runtime-qbfd9z3p.js → chunk-runtime-xmp308t7.js} +2 -2
- package/dist/{chunk-worker-5mdsmhte.js → chunk-worker-99q8qnj9.js} +9 -9
- package/dist/config-publication/admission-handoff.d.ts +13 -0
- package/dist/config-publication/coordinator-types.d.ts +176 -0
- package/dist/config-publication/current-startup.d.ts +26 -0
- package/dist/config-publication/drain-workers.d.ts +15 -0
- package/dist/config-publication/index.d.ts +6 -0
- package/dist/config-publication/master-coordinator.d.ts +45 -0
- package/dist/config-publication/master-messages.d.ts +2 -0
- package/dist/config-publication/message-fields.d.ts +20 -0
- package/dist/config-publication/messages.d.ts +3 -0
- package/dist/config-publication/process-cleanup.d.ts +30 -0
- package/dist/config-publication/process-identity.d.ts +14 -0
- package/dist/config-publication/process-termination.d.ts +7 -0
- package/dist/config-publication/publication-runner.d.ts +50 -0
- package/dist/config-publication/recovery-disposition.d.ts +17 -0
- package/dist/config-publication/types.d.ts +137 -0
- package/dist/config-publication/waiter-safety.d.ts +2 -0
- package/dist/config-publication/worker-messages.d.ts +2 -0
- package/dist/config-publication/worker-runtime-contract.d.ts +76 -0
- package/dist/config-publication/worker-runtime-plugins.d.ts +8 -0
- package/dist/config-publication/worker-runtime.d.ts +22 -0
- package/dist/config-publication/worker-wait.d.ts +44 -0
- package/dist/config-storage/active-publication.d.ts +37 -0
- package/dist/config-storage/aggregate.d.ts +4 -0
- package/dist/config-storage/async-config-repository.d.ts +125 -0
- package/dist/config-storage/commit-transaction.d.ts +13 -0
- package/dist/config-storage/compiler.d.ts +4 -0
- package/dist/config-storage/config-repository.d.ts +118 -0
- package/dist/config-storage/consistent-read.d.ts +2 -0
- package/dist/config-storage/content-hash.d.ts +17 -0
- package/dist/config-storage/cross-table-audit.d.ts +20 -0
- package/dist/config-storage/current-revision.d.ts +2 -0
- package/dist/config-storage/domain-validation.d.ts +5 -0
- package/dist/config-storage/expression-ast.d.ts +2 -0
- package/dist/config-storage/expression-call-policy.d.ts +2 -0
- package/dist/config-storage/expression-syntax.d.ts +2 -0
- package/dist/config-storage/gateway-target-validation.d.ts +5 -0
- package/dist/config-storage/global-scalars.d.ts +6 -0
- package/dist/config-storage/global-validation.d.ts +2 -0
- package/dist/config-storage/immutable-snapshot.d.ts +4 -0
- package/dist/config-storage/index.d.ts +21 -0
- package/dist/config-storage/json-preflight.d.ts +15 -0
- package/dist/config-storage/management-protection.d.ts +10 -0
- package/dist/config-storage/materialize.d.ts +3 -0
- package/dist/config-storage/menu-store.d.ts +12 -0
- package/dist/config-storage/migrations/baseline.d.ts +8 -0
- package/dist/config-storage/migrations/index.d.ts +8 -0
- package/dist/config-storage/migrations/management-protection.d.ts +2 -0
- package/dist/config-storage/migrations/plan.d.ts +9 -0
- package/dist/config-storage/migrations/prepared-worker-allocation.d.ts +2 -0
- package/dist/config-storage/migrations/publication-retirement.d.ts +3 -0
- package/dist/config-storage/migrations/publication-targets.d.ts +3 -0
- package/dist/config-storage/migrations/request-logs-default.d.ts +2 -0
- package/dist/config-storage/migrations/runtime-cutover.d.ts +2 -0
- package/dist/config-storage/migrations/service-references.d.ts +3 -0
- package/dist/config-storage/migrations/ui-menus.d.ts +2 -0
- package/dist/config-storage/migrations/websocket-connections.d.ts +2 -0
- package/dist/config-storage/migrations/websocket-message-size.d.ts +2 -0
- package/dist/config-storage/migrations/worker-launch-capacity.d.ts +2 -0
- package/dist/config-storage/modification-validation.d.ts +4 -0
- package/dist/config-storage/operation-records.d.ts +42 -0
- package/dist/config-storage/operation-relations.d.ts +6 -0
- package/dist/config-storage/operation-store.d.ts +12 -0
- package/dist/config-storage/persisted-json.d.ts +2 -0
- package/dist/config-storage/persisted-validation.d.ts +7 -0
- package/dist/config-storage/plugin-name.d.ts +2 -0
- package/dist/config-storage/plugin-schema.d.ts +16 -0
- package/dist/config-storage/policy-fields.d.ts +15 -0
- package/dist/config-storage/prepared-command.d.ts +14 -0
- package/dist/config-storage/read-materialization.d.ts +4 -0
- package/dist/config-storage/recovery-store.d.ts +21 -0
- package/dist/config-storage/relation-materialization.d.ts +30 -0
- package/dist/config-storage/repository-snapshot.d.ts +5 -0
- package/dist/config-storage/repository-types.d.ts +216 -0
- package/dist/config-storage/repository-validation.d.ts +6 -0
- package/dist/config-storage/request-logs-default.d.ts +5 -0
- package/dist/config-storage/retirement-store.d.ts +78 -0
- package/dist/config-storage/route-policy-validation.d.ts +2 -0
- package/dist/config-storage/runtime-config.d.ts +14 -0
- package/dist/config-storage/runtime-cutover.d.ts +13 -0
- package/dist/config-storage/runtime-recovery-budget.d.ts +35 -0
- package/dist/config-storage/schema-fingerprint.d.ts +5 -0
- package/dist/config-storage/schema.d.ts +2 -0
- package/dist/config-storage/service-policy-validation.d.ts +4 -0
- package/dist/config-storage/service-reference-upgrade.d.ts +4 -0
- package/dist/config-storage/serving-snapshot.d.ts +9 -0
- package/dist/config-storage/snapshot-validation.d.ts +3 -0
- package/dist/config-storage/sqlite-errors.d.ts +3 -0
- package/dist/config-storage/sqlite-query.d.ts +3 -0
- package/dist/config-storage/sqlite-version.d.ts +10 -0
- package/dist/config-storage/storage-protocol.d.ts +52 -0
- package/dist/config-storage/utf16.d.ts +2 -0
- package/dist/config-storage/validation.d.ts +31 -0
- package/dist/config-storage/worker-launch-store.d.ts +93 -0
- package/dist/config-worker/http-provider.d.ts +6 -0
- package/dist/config-worker/lifecycle.d.ts +84 -0
- package/dist/config-worker/private-transport.d.ts +31 -0
- package/dist/config-worker/process-environment.d.ts +38 -0
- package/dist/config-worker/rate-limit-provider.d.ts +31 -0
- package/dist/config-worker/runtime-dependencies.d.ts +12 -0
- package/dist/config-worker/snapshot-compiler.d.ts +5 -0
- package/dist/config-worker/supervised-process-entry.d.ts +8 -0
- package/dist/core-version.d.ts +1 -0
- package/dist/daemon-control/bootstrap.d.ts +41 -0
- package/dist/daemon-control/index.d.ts +1 -0
- package/dist/daemon-control/launch-identity.d.ts +26 -0
- package/dist/daemon-control/shutdown.d.ts +22 -0
- package/dist/data-admission/errors.d.ts +16 -0
- package/dist/data-admission/host.d.ts +92 -0
- package/dist/data-admission/keyed-state.d.ts +21 -0
- package/dist/data-admission/rpc.d.ts +40 -0
- package/dist/data-admission/worker.d.ts +66 -0
- package/dist/database-schema.d.ts +2 -0
- package/dist/expression-engine.d.ts +33 -0
- package/dist/gateway/admission-plugin.d.ts +7 -0
- package/dist/gateway/auxiliary-request.d.ts +7 -0
- package/dist/gateway/body-contracts.d.ts +39 -0
- package/dist/gateway/body-events.d.ts +58 -0
- package/dist/gateway/body-factory.d.ts +4 -0
- package/dist/gateway/body-observation-stream.d.ts +6 -0
- package/dist/gateway/body-plugin.d.ts +8 -0
- package/dist/gateway/body-resources.d.ts +37 -0
- package/dist/gateway/body-service.d.ts +116 -0
- package/dist/gateway/contracts.d.ts +196 -0
- package/dist/gateway/controlled-views.d.ts +5 -0
- package/dist/gateway/dispatch-plugin.d.ts +11 -0
- package/dist/gateway/dispatch-targets.d.ts +4 -0
- package/dist/gateway/forward-plugin.d.ts +136 -0
- package/dist/gateway/plugin.d.ts +23 -0
- package/dist/gateway/plugin.js +18 -18
- package/dist/gateway/request-log-contracts.d.ts +346 -0
- package/dist/gateway/request-log.d.ts +105 -0
- package/dist/gateway/request-plugin.d.ts +98 -0
- package/dist/gateway/request-rules-plugin.d.ts +61 -0
- package/dist/gateway/response-plugin.d.ts +34 -0
- package/dist/gateway/response-views.d.ts +33 -0
- package/dist/gateway/responses-websocket-session.d.ts +24 -0
- package/dist/gateway/retry-action.d.ts +7 -0
- package/dist/gateway/retry-plugin.d.ts +7 -0
- package/dist/gateway/routing-plugin.d.ts +11 -0
- package/dist/gateway/runtime.d.ts +15 -0
- package/dist/gateway/selection-plugin.d.ts +7 -0
- package/dist/gateway/sse-response.d.ts +6 -0
- package/dist/gateway/websocket-contracts.d.ts +71 -0
- package/dist/gateway/websocket-credential.d.ts +3 -0
- package/dist/gateway/websocket-plugin.d.ts +9 -0
- package/dist/hooks/impl.d.ts +119 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/plugin-hooks.d.ts +308 -0
- package/dist/hooks/types.d.ts +130 -0
- package/dist/ingress/admission-registry.d.ts +56 -0
- package/dist/ingress/admission-set.d.ts +29 -0
- package/dist/ingress/index.d.ts +4 -0
- package/dist/ingress/master-controller.d.ts +278 -0
- package/dist/ingress/runtime.d.ts +29 -0
- package/dist/ingress/supervision-http.d.ts +118 -0
- package/dist/ingress.d.ts +5 -0
- package/dist/instance-lock.d.ts +2 -0
- package/dist/logger/access-log-writer.d.ts +120 -0
- package/dist/logger/body-capture.d.ts +21 -0
- package/dist/logger/body-log-redaction.d.ts +6 -0
- package/dist/logger/body-storage.d.ts +71 -0
- package/dist/logger/content-capture.d.ts +47 -0
- package/dist/logger/dated-log-files.d.ts +5 -0
- package/dist/logger/header-storage.d.ts +54 -0
- package/dist/logger/log-cleanup.d.ts +69 -0
- package/dist/logger/log-url.d.ts +2 -0
- package/dist/logger/request-logger.d.ts +308 -0
- package/dist/logger/transport-outcome.d.ts +25 -0
- package/dist/logger/websocket-body-capture.d.ts +26 -0
- package/dist/logger.d.ts +16 -0
- package/dist/main.d.ts +19 -0
- package/dist/main.js +8 -8
- package/dist/management-listener/index.d.ts +2 -0
- package/dist/management-listener/listener.d.ts +48 -0
- package/dist/management-listener/request-source.d.ts +4 -0
- package/dist/master-runtime/component-recovery.d.ts +40 -0
- package/dist/master-runtime/composition.d.ts +129 -0
- package/dist/master-runtime/configuration-recovery.d.ts +80 -0
- package/dist/master-runtime/control-api-body.d.ts +9 -0
- package/dist/master-runtime/control-api.d.ts +122 -0
- package/dist/master-runtime/error-chain.d.ts +9 -0
- package/dist/master-runtime/initialize-configuration.d.ts +4 -0
- package/dist/master-runtime/instance-lock.d.ts +25 -0
- package/dist/master-runtime/kernel-exit-timer.d.ts +7 -0
- package/dist/master-runtime/kernel-monotonic-clock.d.ts +15 -0
- package/dist/master-runtime/management-auth.d.ts +43 -0
- package/dist/master-runtime/master-plugin-catalog-api.d.ts +18 -0
- package/dist/master-runtime/master-stats.d.ts +52 -0
- package/dist/master-runtime/menu-api.d.ts +19 -0
- package/dist/master-runtime/observability-client.d.ts +49 -0
- package/dist/master-runtime/offline-recovery.d.ts +9 -0
- package/dist/master-runtime/offline-storage-session.d.ts +8 -0
- package/dist/master-runtime/plugin-journal-recovery.d.ts +28 -0
- package/dist/master-runtime/process-identity.d.ts +48 -0
- package/dist/master-runtime/process-options.d.ts +59 -0
- package/dist/master-runtime/publication-task-manager.d.ts +47 -0
- package/dist/master-runtime/reconcile-plugin-dependencies.d.ts +7 -0
- package/dist/master-runtime/recovery-prompt.d.ts +9 -0
- package/dist/master-runtime/route-body-plan.d.ts +31 -0
- package/dist/master-runtime/runtime-cleanup.d.ts +3 -0
- package/dist/master-runtime/runtime-contracts.d.ts +101 -0
- package/dist/master-runtime/runtime-evidence.d.ts +8 -0
- package/dist/master-runtime/runtime-status.d.ts +36 -0
- package/dist/master-runtime/runtime-supervisor.d.ts +30 -0
- package/dist/master-runtime/runtime-upgrade.d.ts +11 -0
- package/dist/master-runtime/runtime-upstreams.d.ts +14 -0
- package/dist/master-runtime/runtime.d.ts +23 -0
- package/dist/master-runtime/shutdown-diagnostics.d.ts +28 -0
- package/dist/master-runtime/signal-handlers.d.ts +18 -0
- package/dist/master-runtime/stopped-instance-lock.d.ts +6 -0
- package/dist/master-runtime/stopped-process.d.ts +2 -0
- package/dist/master-runtime/supervised-worker-client.d.ts +108 -0
- package/dist/master-runtime/supervised-worker-discovery.d.ts +41 -0
- package/dist/master-runtime/supervised-worker-factory.d.ts +298 -0
- package/dist/master-runtime/supervised-worker-process-adapter.d.ts +146 -0
- package/dist/master-runtime/worker-initialization-diagnostics.d.ts +18 -0
- package/dist/master.d.ts +2 -0
- package/dist/oauth-callback.d.ts +8 -0
- package/dist/plugin-artifact-contract.d.ts +4 -0
- package/dist/plugin-artifact-negotiation.d.ts +12 -0
- package/dist/plugin-artifact-types.d.ts +61 -0
- package/dist/plugin-context-manager.d.ts +91 -0
- package/dist/plugin-control/artifact-loader.d.ts +3 -0
- package/dist/plugin-control/contracts.d.ts +180 -0
- package/dist/plugin-control/host.d.ts +90 -0
- package/dist/plugin-control/index.d.ts +3 -0
- package/dist/plugin-control/master-invocation-projector.d.ts +52 -0
- package/dist/plugin-control/request-service-authority.d.ts +33 -0
- package/dist/plugin-control/secret-crypto.d.ts +13 -0
- package/dist/plugin-control/secret-store.d.ts +15 -0
- package/dist/plugin-dependencies.d.ts +30 -0
- package/dist/plugin-durable-state.d.ts +62 -0
- package/dist/plugin-extensions.d.ts +99 -0
- package/dist/plugin-logger.d.ts +17 -0
- package/dist/plugin-manifest-catalog/catalog.d.ts +28 -0
- package/dist/plugin-manifest-catalog/config-constraint-parser.d.ts +3 -0
- package/dist/plugin-manifest-catalog/config-default-validator.d.ts +3 -0
- package/dist/plugin-manifest-catalog/config-field-parser.d.ts +3 -0
- package/dist/plugin-manifest-catalog/config-field-references.d.ts +2 -0
- package/dist/plugin-manifest-catalog/index.d.ts +6 -0
- package/dist/plugin-manifest-catalog/manifest-filesystem.d.ts +9 -0
- package/dist/plugin-manifest-catalog/manifest-json.d.ts +1 -0
- package/dist/plugin-manifest-catalog/manifest-nested-parser.d.ts +11 -0
- package/dist/plugin-manifest-catalog/manifest-parser.d.ts +2 -0
- package/dist/plugin-manifest-catalog/manifest-semver.d.ts +4 -0
- package/dist/plugin-manifest-catalog/manifest-values.d.ts +6 -0
- package/dist/plugin-manifest-catalog/parse-utils.d.ts +19 -0
- package/dist/plugin-manifest-catalog/plugin-field-value.d.ts +3 -0
- package/dist/plugin-manifest-catalog/runtime-identity.d.ts +12 -0
- package/dist/plugin-manifest-catalog/types.d.ts +187 -0
- package/dist/plugin-path-resolver.d.ts +17 -0
- package/dist/plugin-registry.d.ts +165 -0
- package/dist/plugin-runtime-config.d.ts +10 -0
- package/dist/plugin-runtime-diff.d.ts +15 -0
- package/dist/plugin-runtime-orchestrator.d.ts +69 -0
- package/dist/plugin-runtime-state-machine.d.ts +78 -0
- package/dist/plugin-runtime-status.d.ts +29 -0
- package/dist/plugin-services/channels.d.ts +391 -0
- package/dist/plugin-services/command-journal.d.ts +234 -0
- package/dist/plugin-services/contracts.d.ts +23 -0
- package/dist/plugin-services/host-rpc.d.ts +268 -0
- package/dist/plugin-services/peer-broker.d.ts +351 -0
- package/dist/plugin-services/peer-channel-hub.d.ts +457 -0
- package/dist/plugin-services/peer-channel-protocol.d.ts +339 -0
- package/dist/plugin-services/peer-directory.d.ts +163 -0
- package/dist/plugin-services/peer-executor-proof.d.ts +13 -0
- package/dist/plugin-services/peer-frame.d.ts +65 -0
- package/dist/plugin-services/peer-journal.d.ts +25 -0
- package/dist/plugin-services/peer-protocol.d.ts +128 -0
- package/dist/plugin-services/peer-rpc-link.d.ts +218 -0
- package/dist/plugin-services/peer-rpc-mapping.d.ts +133 -0
- package/dist/plugin-services/peer-websocket.d.ts +146 -0
- package/dist/plugin-services/persistence.d.ts +166 -0
- package/dist/plugin-services/rpc-runtime.d.ts +227 -0
- package/dist/plugin-services/snapshot-store.d.ts +77 -0
- package/dist/plugin-services/wire-contract.d.ts +158 -0
- package/dist/plugin-services.d.ts +237 -0
- package/dist/plugin-state/client.d.ts +160 -0
- package/dist/plugin-state/message-size.d.ts +2 -0
- package/dist/plugin-state/operations.d.ts +4 -0
- package/dist/plugin-state/protocol.d.ts +40 -0
- package/dist/plugin-state/storage-rpc.d.ts +7 -0
- package/dist/plugin.types.d.ts +999 -0
- package/dist/plugins/anthropic-request-sanitizer/index.js +17 -17
- package/dist/plugins/anthropic-request-sanitizer/index.js.map +1 -1
- package/dist/plugins/anthropic-tool-name-transformer/index.js +17 -17
- package/dist/plugins/anthropic-tool-name-transformer/index.js.map +1 -1
- package/dist/plugins/chatgpt-oauth/control.js +24 -24
- package/dist/plugins/chatgpt-oauth/control.js.map +1 -1
- package/dist/plugins/chatgpt-oauth/index.js +23 -23
- package/dist/plugins/chatgpt-oauth/index.js.map +1 -1
- package/dist/plugins/codex-router/control.js +19 -19
- package/dist/plugins/codex-router/control.js.map +1 -1
- package/dist/plugins/codex-router/index.js +31 -31
- package/dist/plugins/codex-router/index.js.map +1 -1
- package/dist/plugins/deepseek-reasoning-fix/index.js +17 -17
- package/dist/plugins/deepseek-reasoning-fix/index.js.map +1 -1
- package/dist/plugins/key-access/control.js +18 -18
- package/dist/plugins/key-access/control.js.map +1 -1
- package/dist/plugins/key-access/index.js +19 -19
- package/dist/plugins/key-access/index.js.map +1 -1
- package/dist/plugins/key-access/ingress.js +18 -18
- package/dist/plugins/key-access/ingress.js.map +1 -1
- package/dist/plugins/key-rate-limit/control.js +3 -3
- package/dist/plugins/key-rate-limit/control.js.map +1 -1
- package/dist/plugins/key-rate-limit/index.js +18 -18
- package/dist/plugins/key-rate-limit/index.js.map +1 -1
- package/dist/plugins/key-rate-limit/ingress.js +2 -2
- package/dist/plugins/key-rate-limit/ingress.js.map +1 -1
- package/dist/plugins/llm-protocol-adapter/control.js +48 -48
- package/dist/plugins/llm-protocol-adapter/control.js.map +1 -1
- package/dist/plugins/llm-protocol-adapter/index.js +53 -53
- package/dist/plugins/llm-protocol-adapter/index.js.map +1 -1
- package/dist/plugins/llm-tps/control.js +5 -5
- package/dist/plugins/llm-tps/control.js.map +1 -1
- package/dist/plugins/llm-tps/index.js +20 -20
- package/dist/plugins/llm-tps/index.js.map +1 -1
- package/dist/plugins/model-mapping/control.js +4 -4
- package/dist/plugins/model-mapping/control.js.map +1 -1
- package/dist/plugins/model-mapping/index.js +19 -19
- package/dist/plugins/model-mapping/index.js.map +1 -1
- package/dist/plugins/models-dev/control.js +10 -10
- package/dist/plugins/models-dev/control.js.map +1 -1
- package/dist/plugins/models-dev/index.js +23 -23
- package/dist/plugins/models-dev/index.js.map +1 -1
- package/dist/plugins/request-body-redaction/control.js +2 -2
- package/dist/plugins/request-body-redaction/control.js.map +1 -1
- package/dist/plugins/request-body-redaction/index.js +21 -21
- package/dist/plugins/request-body-redaction/index.js.map +1 -1
- package/dist/plugins/request-logs/index.js +27 -27
- package/dist/plugins/request-logs/index.js.map +1 -1
- package/dist/plugins/request-logs/ingress.js +2 -2
- package/dist/plugins/request-logs/ingress.js.map +1 -1
- package/dist/plugins/signature-repair/index.js +17 -17
- package/dist/plugins/signature-repair/index.js.map +1 -1
- package/dist/plugins/sse-envelope.d.ts +3 -0
- package/dist/plugins/token-budget/control.js +19 -19
- package/dist/plugins/token-budget/control.js.map +1 -1
- package/dist/plugins/token-budget/index.js +19 -19
- package/dist/plugins/token-budget/index.js.map +1 -1
- package/dist/plugins/token-budget/ingress.js +2 -2
- package/dist/plugins/token-budget/ingress.js.map +1 -1
- package/dist/plugins/token-metering/index.js +30 -30
- package/dist/plugins/token-metering/index.js.map +1 -1
- package/dist/plugins/token-stats/control.js +22 -22
- package/dist/plugins/token-stats/control.js.map +1 -1
- package/dist/plugins/token-stats/index.js +22 -22
- package/dist/plugins/token-stats/index.js.map +1 -1
- package/dist/plugins/user-auth/control.js +21 -21
- package/dist/plugins/user-auth/control.js.map +1 -1
- package/dist/plugins/user-auth/index.js +17 -17
- package/dist/plugins/user-auth/index.js.map +1 -1
- package/dist/public-listener/admission-registry.d.ts +15 -0
- package/dist/public-listener/forwarding.d.ts +24 -0
- package/dist/public-listener/headers.d.ts +5 -0
- package/dist/public-listener/index.d.ts +4 -0
- package/dist/public-listener/listener.d.ts +21 -0
- package/dist/public-listener/websocket.d.ts +4 -0
- package/dist/rate-limit/http.d.ts +80 -0
- package/dist/rate-limit/index.d.ts +7 -0
- package/dist/rate-limit/json.d.ts +8 -0
- package/dist/rate-limit/profile.d.ts +46 -0
- package/dist/rate-limit/protocol.d.ts +104 -0
- package/dist/rate-limit/store.d.ts +61 -0
- package/dist/scoped-plugin-registry.d.ts +645 -0
- package/dist/supervision/index.d.ts +12 -0
- package/dist/supervision/process-lifetime-guard.d.ts +54 -0
- package/dist/supervision/protocol.d.ts +173 -0
- package/dist/supervision/state-repository.d.ts +15 -0
- package/dist/supervision/strict-json.d.ts +2 -0
- package/dist/supervision/worker-descriptor.d.ts +77 -0
- package/dist/supervision/worker-http.d.ts +135 -0
- package/dist/supervision/worker-runtime-snapshot.d.ts +64 -0
- package/dist/token-stats-window.d.ts +23 -0
- package/dist/ui/assets.d.ts +8 -0
- package/dist/ui/icon-resources.d.ts +28 -0
- package/dist/ui/menu-icons.d.ts +15 -0
- package/dist/ui/menu-layout.d.ts +10 -0
- package/dist/ui/plugin-sandbox-policy.d.ts +11 -0
- package/dist/ui/server.d.ts +10 -0
- package/dist/updates/archive-installer.d.ts +8 -0
- package/dist/updates/controller.d.ts +50 -0
- package/dist/updates/download.d.ts +8 -0
- package/dist/updates/installation.d.ts +26 -0
- package/dist/updates/names.d.ts +3 -0
- package/dist/updates/release.d.ts +23 -0
- package/dist/updates/restart.d.ts +13 -0
- package/dist/utils/config-validator.d.ts +40 -0
- package/dist/utils/endpoint-resolver.d.ts +20 -0
- package/dist/utils/expression-dependencies.d.ts +10 -0
- package/dist/utils/plugin-helpers.d.ts +46 -0
- package/dist/websocket/headers.d.ts +9 -0
- package/dist/websocket/index.d.ts +3 -0
- package/dist/websocket/message.d.ts +3 -0
- package/dist/websocket/observation.d.ts +36 -0
- package/dist/websocket/transport.d.ts +197 -0
- package/dist/worker/health/checker.d.ts +54 -0
- package/dist/worker/health/scheduler.d.ts +27 -0
- package/dist/worker/request/body-source.d.ts +1 -0
- package/dist/worker/request/context-builder.d.ts +78 -0
- package/dist/worker/request/context.d.ts +55 -0
- package/dist/worker/request/credential.d.ts +10 -0
- package/dist/worker/request/handler.d.ts +3 -0
- package/dist/worker/request/proxy.d.ts +4 -0
- package/dist/worker/request/response-detector.d.ts +9 -0
- package/dist/worker/request/snapshot.d.ts +18 -0
- package/dist/worker/response/attempt-observation.d.ts +24 -0
- package/dist/worker/response/processor.d.ts +4 -0
- package/dist/worker/response/streaming-response.d.ts +1 -0
- package/dist/worker/rules/deep-merge.d.ts +2 -0
- package/dist/worker/rules/modifier.d.ts +3 -0
- package/dist/worker/state/plugin-manager.d.ts +95 -0
- package/dist/worker/state/runtime-state.d.ts +90 -0
- package/dist/worker/types.d.ts +44 -0
- package/dist/worker/upstream/condition-filter.d.ts +31 -0
- package/dist/worker/upstream/failover-coordinator.d.ts +93 -0
- package/dist/worker/upstream/filter.d.ts +37 -0
- package/dist/worker/upstream/priority-group.d.ts +66 -0
- package/dist/worker/upstream/selector.d.ts +10 -0
- package/dist/worker/upstream/service-execution.d.ts +17 -0
- package/dist/worker/utils/jitter.d.ts +81 -0
- package/dist/worker/utils/slow-start.d.ts +67 -0
- package/dist/worker/utils/status-code-matcher.d.ts +10 -0
- package/dist/worker.d.ts +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host communication lane protocol (P5): strict, bounded codecs for the three
|
|
3
|
+
* non-RPC lanes — `event`, `snapshot`, `stream`.
|
|
4
|
+
*
|
|
5
|
+
* Scope boundary: this module only defines shapes and constants. It opens no
|
|
6
|
+
* transport, keeps no state, and grants no authority: every request/response is
|
|
7
|
+
* authenticated and correlated by the peer link (`peer-rpc-link.ts`), and every
|
|
8
|
+
* authorization decision belongs to the host adapter (`channels.ts`).
|
|
9
|
+
*
|
|
10
|
+
* Design rules:
|
|
11
|
+
* - A lane request rides the link's existing request/response machinery; only the
|
|
12
|
+
* lane payload is lane-specific. Bulk bytes never ride a request envelope: they
|
|
13
|
+
* travel as `emit` frames (stream chunks) or as bounded chunk responses
|
|
14
|
+
* (snapshot bodies), never by enlarging the 64 KiB RPC message.
|
|
15
|
+
* - Every codec is strict: exact key sets, bounded strings/numbers, and a byte
|
|
16
|
+
* bound. A malformed lane payload is refused, never partially trusted.
|
|
17
|
+
* - Every request carries the host-minted `caller` + `callerScope`, so the
|
|
18
|
+
* receiving host correlates an inbound frame to the exact original owner it was
|
|
19
|
+
* authorized for (never to a bare plugin name).
|
|
20
|
+
* - Result bodies are pure JSON `{ ok: true, ... } | { ok: false, code, detail? }`,
|
|
21
|
+
* so a lane can report `gap`/`conflict`/`unauthorized` without widening the
|
|
22
|
+
* link's own fixed wire-error vocabulary.
|
|
23
|
+
*/
|
|
24
|
+
import { type RpcCallPurpose, type RpcJson } from './wire-contract';
|
|
25
|
+
import type { PluginPeerRpcRequestExecution } from './peer-rpc-link';
|
|
26
|
+
export declare const PLUGIN_CHANNEL_VERSION: 1;
|
|
27
|
+
/** A lane request context stays far below the 8 KiB peer header cap. */
|
|
28
|
+
export declare const CHANNEL_REQUEST_MAX_BYTES: number;
|
|
29
|
+
/** A JSON result payload (event body / snapshot descriptor) stays below the frame cap. */
|
|
30
|
+
export declare const CHANNEL_RESULT_MAX_BYTES: number;
|
|
31
|
+
/** Largest single chunk body that fits one peer frame with the emit wrapper. */
|
|
32
|
+
export declare const CHANNEL_MAX_CHUNK_BYTES: number;
|
|
33
|
+
export type PluginChannelLane = 'event' | 'snapshot' | 'stream';
|
|
34
|
+
/**
|
|
35
|
+
* The exact transport surface a lane engine needs. `PluginPeerRpcLink` satisfies
|
|
36
|
+
* it structurally; a same-process route uses the hub's in-process loopback port,
|
|
37
|
+
* so local and remote transfers share one implementation and one set of limits.
|
|
38
|
+
*/
|
|
39
|
+
export interface PluginChannelLinkPort {
|
|
40
|
+
/**
|
|
41
|
+
* Exact transport admission state. `true` once this link has retired: NEW
|
|
42
|
+
* open/subscribe/read work is refused by the hub, while frames belonging to an
|
|
43
|
+
* already-accepted transfer/subscription/session keep flowing.
|
|
44
|
+
*/
|
|
45
|
+
readonly retired?: boolean;
|
|
46
|
+
requestOnLane(lane: PluginChannelLane, context: RpcJson, body: Uint8Array, options: {
|
|
47
|
+
readonly deadlineAt: number;
|
|
48
|
+
readonly signal?: AbortSignal;
|
|
49
|
+
}): PluginPeerRpcRequestExecution;
|
|
50
|
+
emitLane(lane: PluginChannelLane, kind: 'chunk' | 'notification', requestId: string, deadlineAt: number, context: RpcJson, body: Uint8Array, priority?: 'data' | 'control'): boolean;
|
|
51
|
+
}
|
|
52
|
+
export type PluginChannelErrorCode = 'unavailable' | 'ambiguous' | 'unauthorized' | 'invalid' | 'overloaded' | 'expired' | 'conflict' | 'gap' | 'truncated' | 'rejected' | 'cancelled' | 'closed' | 'unknown' | 'failed';
|
|
53
|
+
export declare const PLUGIN_CHANNEL_LANES: readonly PluginChannelLane[];
|
|
54
|
+
/** Fixed-code channel error. It never carries a cause, path, or payload. */
|
|
55
|
+
export declare class PluginChannelError extends Error {
|
|
56
|
+
readonly code: PluginChannelErrorCode;
|
|
57
|
+
readonly name = "PluginChannelError";
|
|
58
|
+
constructor(code: PluginChannelErrorCode, message: string);
|
|
59
|
+
}
|
|
60
|
+
export declare function failChannel(code: PluginChannelErrorCode, message: string): never;
|
|
61
|
+
/** Logical target of one lane request; the physical identity is never a plugin concern. */
|
|
62
|
+
export interface PluginChannelTarget {
|
|
63
|
+
readonly provider: string;
|
|
64
|
+
readonly service: string;
|
|
65
|
+
readonly major: number;
|
|
66
|
+
}
|
|
67
|
+
export declare function encodeChannelResult(value: {
|
|
68
|
+
readonly ok: true;
|
|
69
|
+
readonly [key: string]: unknown;
|
|
70
|
+
} | {
|
|
71
|
+
readonly ok: false;
|
|
72
|
+
readonly code: PluginChannelErrorCode;
|
|
73
|
+
readonly detail?: Record<string, unknown>;
|
|
74
|
+
}): Uint8Array;
|
|
75
|
+
export type PluginChannelResult = {
|
|
76
|
+
readonly ok: true;
|
|
77
|
+
readonly value: Record<string, unknown>;
|
|
78
|
+
} | {
|
|
79
|
+
readonly ok: false;
|
|
80
|
+
readonly code: PluginChannelErrorCode;
|
|
81
|
+
readonly detail?: Record<string, unknown>;
|
|
82
|
+
};
|
|
83
|
+
/** Strict decode of a JSON lane result body; `null` is a protocol failure. */
|
|
84
|
+
export declare function decodeChannelResult(bytes: Uint8Array): PluginChannelResult | null;
|
|
85
|
+
/** Raw chunk response body: bytes carried by a snapshot/stream chunk call. */
|
|
86
|
+
export declare function encodeChannelBytes(bytes: Uint8Array): Uint8Array;
|
|
87
|
+
interface LaneRequestBase {
|
|
88
|
+
readonly v: typeof PLUGIN_CHANNEL_VERSION;
|
|
89
|
+
readonly target: PluginChannelTarget;
|
|
90
|
+
/** Consumer plugin name; host-minted, never payload-claimed. */
|
|
91
|
+
readonly caller: string;
|
|
92
|
+
/** Consumer owner scope key; host-minted (`global` or a binding scope). */
|
|
93
|
+
readonly callerScope: string;
|
|
94
|
+
/**
|
|
95
|
+
* Host-minted invocation purpose shared across the peer boundary, so the
|
|
96
|
+
* providing host can keep the original request/attempt/management context
|
|
97
|
+
* instead of re-interpreting the call as an unauthenticated background task.
|
|
98
|
+
*/
|
|
99
|
+
readonly purpose: RpcCallPurpose;
|
|
100
|
+
/**
|
|
101
|
+
* Canonical hash of the consumer's declared lane contract (id + version + the
|
|
102
|
+
* `wire-contract` data schema). The provider refuses a request that does not
|
|
103
|
+
* hash to its own contract, so the two sides cannot silently disagree about
|
|
104
|
+
* the payload type.
|
|
105
|
+
*/
|
|
106
|
+
readonly contract: string;
|
|
107
|
+
readonly kind: string;
|
|
108
|
+
}
|
|
109
|
+
export interface ChannelStreamOpenRequest extends LaneRequestBase {
|
|
110
|
+
readonly kind: 'stream.open' | 'stream.open-write';
|
|
111
|
+
readonly request: {
|
|
112
|
+
/** Consumer-minted correlation id; becomes the transfer id for every later frame. */
|
|
113
|
+
readonly clientId: string;
|
|
114
|
+
readonly objectId: string;
|
|
115
|
+
readonly version: number;
|
|
116
|
+
readonly offset: number;
|
|
117
|
+
readonly size: number | null;
|
|
118
|
+
readonly digest: `sha256:${string}` | null;
|
|
119
|
+
readonly creditBytes: number;
|
|
120
|
+
readonly idleMs: number;
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* One duplex session negotiation: a SINGLE transfer id carries both a provider ->
|
|
125
|
+
* consumer read flow and a consumer -> provider write flow, each with its own
|
|
126
|
+
* independent absolute credit window, over one shared terminal.
|
|
127
|
+
*/
|
|
128
|
+
export interface ChannelStreamOpenDuplexRequest extends LaneRequestBase {
|
|
129
|
+
readonly kind: 'stream.open-duplex';
|
|
130
|
+
readonly request: {
|
|
131
|
+
readonly clientId: string;
|
|
132
|
+
readonly objectId: string;
|
|
133
|
+
readonly version: number;
|
|
134
|
+
readonly readOffset: number;
|
|
135
|
+
readonly readSize: number | null;
|
|
136
|
+
readonly readDigest: `sha256:${string}` | null;
|
|
137
|
+
readonly writeSize: number | null;
|
|
138
|
+
readonly writeDigest: `sha256:${string}` | null;
|
|
139
|
+
readonly readCreditBytes: number;
|
|
140
|
+
readonly writeCreditBytes: number;
|
|
141
|
+
readonly idleMs: number;
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
export interface ChannelStreamFinishRequest extends LaneRequestBase {
|
|
145
|
+
readonly kind: 'stream.finish';
|
|
146
|
+
readonly request: {
|
|
147
|
+
readonly transferId: string;
|
|
148
|
+
readonly size: number;
|
|
149
|
+
readonly digest: `sha256:${string}`;
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
export interface ChannelEventSubscribeRequest extends LaneRequestBase {
|
|
153
|
+
readonly kind: 'event.subscribe';
|
|
154
|
+
readonly request: {
|
|
155
|
+
readonly clientId: string;
|
|
156
|
+
readonly delivery: 'transient' | 'reliable';
|
|
157
|
+
readonly consumerId: string;
|
|
158
|
+
readonly from: number | null;
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
export interface ChannelEventAckRequest extends LaneRequestBase {
|
|
162
|
+
readonly kind: 'event.ack';
|
|
163
|
+
readonly request: {
|
|
164
|
+
readonly subscriptionId: string;
|
|
165
|
+
readonly sequence: number;
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
export interface ChannelSnapshotDescribeRequest extends LaneRequestBase {
|
|
169
|
+
readonly kind: 'snapshot.describe';
|
|
170
|
+
readonly request: {
|
|
171
|
+
readonly version: number | null;
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Pins one immutable version for a WHOLE read: the provider retains the exact
|
|
176
|
+
* source until `snapshot.release` (or its bounded idle expiry), so a refresh or a
|
|
177
|
+
* version eviction can never swap or free the body mid-read.
|
|
178
|
+
*/
|
|
179
|
+
export interface ChannelSnapshotOpenRequest extends LaneRequestBase {
|
|
180
|
+
readonly kind: 'snapshot.open';
|
|
181
|
+
readonly request: {
|
|
182
|
+
readonly version: number | null;
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
export interface ChannelSnapshotChunkRequest extends LaneRequestBase {
|
|
186
|
+
readonly kind: 'snapshot.chunk';
|
|
187
|
+
readonly request: {
|
|
188
|
+
readonly sessionId: string;
|
|
189
|
+
readonly offset: number;
|
|
190
|
+
readonly length: number;
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
export interface ChannelSnapshotReleaseRequest extends LaneRequestBase {
|
|
194
|
+
readonly kind: 'snapshot.release';
|
|
195
|
+
readonly request: {
|
|
196
|
+
readonly sessionId: string;
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
export declare function encodeStreamOpenRequest(kind: 'stream.open' | 'stream.open-write', target: PluginChannelTarget, caller: string, callerScope: string, contract: string, request: ChannelStreamOpenRequest['request'], purpose?: RpcCallPurpose): RpcJson;
|
|
200
|
+
export declare function decodeStreamOpenRequest(payload: unknown): ChannelStreamOpenRequest | null;
|
|
201
|
+
export declare function encodeStreamOpenDuplexRequest(target: PluginChannelTarget, caller: string, callerScope: string, contract: string, request: ChannelStreamOpenDuplexRequest['request'], purpose?: RpcCallPurpose): RpcJson;
|
|
202
|
+
export declare function decodeStreamOpenDuplexRequest(payload: unknown): ChannelStreamOpenDuplexRequest | null;
|
|
203
|
+
export declare function encodeStreamFinishRequest(target: PluginChannelTarget, caller: string, callerScope: string, contract: string, request: ChannelStreamFinishRequest['request'], purpose?: RpcCallPurpose): RpcJson;
|
|
204
|
+
export declare function decodeStreamFinishRequest(payload: unknown): ChannelStreamFinishRequest | null;
|
|
205
|
+
export declare function encodeEventSubscribeRequest(target: PluginChannelTarget, caller: string, callerScope: string, contract: string, request: ChannelEventSubscribeRequest['request'], purpose?: RpcCallPurpose): RpcJson;
|
|
206
|
+
export declare function decodeEventSubscribeRequest(payload: unknown): ChannelEventSubscribeRequest | null;
|
|
207
|
+
export declare function encodeEventAckRequest(target: PluginChannelTarget, caller: string, callerScope: string, contract: string, request: ChannelEventAckRequest['request'], purpose?: RpcCallPurpose): RpcJson;
|
|
208
|
+
export declare function decodeEventAckRequest(payload: unknown): ChannelEventAckRequest | null;
|
|
209
|
+
export declare function encodeSnapshotDescribeRequest(target: PluginChannelTarget, caller: string, callerScope: string, contract: string, request: ChannelSnapshotDescribeRequest['request'], purpose?: RpcCallPurpose): RpcJson;
|
|
210
|
+
export declare function decodeSnapshotDescribeRequest(payload: unknown): ChannelSnapshotDescribeRequest | null;
|
|
211
|
+
export declare function encodeSnapshotOpenRequest(target: PluginChannelTarget, caller: string, callerScope: string, contract: string, request: ChannelSnapshotOpenRequest['request'], purpose?: RpcCallPurpose): RpcJson;
|
|
212
|
+
export declare function decodeSnapshotOpenRequest(payload: unknown): ChannelSnapshotOpenRequest | null;
|
|
213
|
+
export declare function encodeSnapshotChunkRequest(target: PluginChannelTarget, caller: string, callerScope: string, contract: string, request: ChannelSnapshotChunkRequest['request'], purpose?: RpcCallPurpose): RpcJson;
|
|
214
|
+
export declare function decodeSnapshotChunkRequest(payload: unknown): ChannelSnapshotChunkRequest | null;
|
|
215
|
+
export declare function encodeSnapshotReleaseRequest(target: PluginChannelTarget, caller: string, callerScope: string, contract: string, request: ChannelSnapshotReleaseRequest['request'], purpose?: RpcCallPurpose): RpcJson;
|
|
216
|
+
export declare function decodeSnapshotReleaseRequest(payload: unknown): ChannelSnapshotReleaseRequest | null;
|
|
217
|
+
export interface ChannelStreamChunkEmit {
|
|
218
|
+
readonly kind: 'stream.chunk';
|
|
219
|
+
readonly transferId: string;
|
|
220
|
+
readonly offset: number;
|
|
221
|
+
readonly last: boolean;
|
|
222
|
+
}
|
|
223
|
+
export interface ChannelStreamDataEmit {
|
|
224
|
+
readonly kind: 'stream.data';
|
|
225
|
+
readonly transferId: string;
|
|
226
|
+
readonly offset: number;
|
|
227
|
+
readonly last: boolean;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Consumer half-close of the READ direction of a duplex session: it will accept
|
|
231
|
+
* no further read chunks (and stops granting read credit), while the WRITE
|
|
232
|
+
* direction of the same session keeps running.
|
|
233
|
+
*/
|
|
234
|
+
export interface ChannelStreamEndReadEmit {
|
|
235
|
+
readonly kind: 'stream.end-read';
|
|
236
|
+
readonly transferId: string;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Provider -> consumer end of the READ direction: the producer has emitted every
|
|
240
|
+
* byte of this immutable version (including a zero-byte body). It is ordered on
|
|
241
|
+
* the same link AFTER the final data frame, so the receiver can settle the read
|
|
242
|
+
* with a real protocol end instead of a timing guess.
|
|
243
|
+
*/
|
|
244
|
+
export interface ChannelStreamEndEmit {
|
|
245
|
+
readonly kind: 'stream.end';
|
|
246
|
+
readonly transferId: string;
|
|
247
|
+
}
|
|
248
|
+
export interface ChannelStreamCreditEmit {
|
|
249
|
+
readonly kind: 'stream.credit';
|
|
250
|
+
readonly transferId: string;
|
|
251
|
+
/**
|
|
252
|
+
* Which window this grant governs, so one duplex session can carry two fully
|
|
253
|
+
* independent credit windows on the SAME transfer id:
|
|
254
|
+
* - `read`: the provider -> consumer flow (granted by the consumer);
|
|
255
|
+
* - `write`: the consumer -> provider flow (granted by the provider).
|
|
256
|
+
*/
|
|
257
|
+
readonly direction: 'read' | 'write';
|
|
258
|
+
/**
|
|
259
|
+
* ABSOLUTE credit window: the total byte count the receiver currently allows
|
|
260
|
+
* from offset 0. Absolute (never a delta) because a window is idempotent: a
|
|
261
|
+
* retried or repeated grant can never double-count, and a lost frame heals as
|
|
262
|
+
* soon as the sender re-emits the current window.
|
|
263
|
+
*/
|
|
264
|
+
readonly window: number;
|
|
265
|
+
}
|
|
266
|
+
export interface ChannelEventNotifyEmit {
|
|
267
|
+
readonly kind: 'event.notify';
|
|
268
|
+
readonly subscriptionId: string;
|
|
269
|
+
readonly sequence: number;
|
|
270
|
+
readonly eventId: string;
|
|
271
|
+
readonly delivery: 'transient' | 'reliable';
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Provider -> consumer reliable-event gap/failure notice: the ordered delivery
|
|
275
|
+
* can no longer continue (a refused emit while disconnected, a bounded queue
|
|
276
|
+
* overflow, an unreadable replay). The consumer must observe a REAL failure
|
|
277
|
+
* instead of a silent close, and re-subscribe from its durable checkpoint.
|
|
278
|
+
*/
|
|
279
|
+
export interface ChannelEventGapEmit {
|
|
280
|
+
readonly kind: 'event.gap';
|
|
281
|
+
readonly subscriptionId: string;
|
|
282
|
+
readonly code: PluginChannelErrorCode;
|
|
283
|
+
}
|
|
284
|
+
export type ChannelEmitPayload = ChannelStreamChunkEmit | ChannelStreamDataEmit | ChannelStreamCreditEmit | ChannelStreamEndReadEmit | ChannelStreamEndEmit | ChannelEventNotifyEmit | ChannelEventGapEmit;
|
|
285
|
+
export declare function encodeChannelEmit(payload: ChannelEmitPayload): RpcJson;
|
|
286
|
+
export declare function decodeChannelEmit(payload: unknown): ChannelEmitPayload | null;
|
|
287
|
+
export interface ChannelStreamOpenResult {
|
|
288
|
+
readonly transferId: string;
|
|
289
|
+
readonly size: number | null;
|
|
290
|
+
readonly digest: `sha256:${string}` | null;
|
|
291
|
+
readonly frameBytes: number;
|
|
292
|
+
readonly creditBytes: number;
|
|
293
|
+
}
|
|
294
|
+
export declare function decodeStreamOpenResult(result: PluginChannelResult): ChannelStreamOpenResult | null;
|
|
295
|
+
export interface ChannelStreamOpenDuplexResult {
|
|
296
|
+
readonly transferId: string;
|
|
297
|
+
readonly readSize: number | null;
|
|
298
|
+
readonly readDigest: `sha256:${string}` | null;
|
|
299
|
+
readonly readFrameBytes: number;
|
|
300
|
+
readonly readCreditBytes: number;
|
|
301
|
+
readonly writeCreditBytes: number;
|
|
302
|
+
}
|
|
303
|
+
export declare function decodeStreamOpenDuplexResult(result: PluginChannelResult): ChannelStreamOpenDuplexResult | null;
|
|
304
|
+
export interface ChannelSnapshotOpenResult {
|
|
305
|
+
readonly sessionId: string;
|
|
306
|
+
readonly descriptor: ChannelSnapshotDescriptor;
|
|
307
|
+
}
|
|
308
|
+
export declare function decodeSnapshotOpenResult(result: PluginChannelResult): ChannelSnapshotOpenResult | null;
|
|
309
|
+
export interface ChannelEventSubscribeResult {
|
|
310
|
+
readonly subscriptionId: string;
|
|
311
|
+
readonly delivery: 'transient' | 'reliable';
|
|
312
|
+
readonly fromSequence: number;
|
|
313
|
+
readonly oldestSequence: number | null;
|
|
314
|
+
readonly prunedThrough: number;
|
|
315
|
+
}
|
|
316
|
+
export declare function decodeEventSubscribeResult(result: PluginChannelResult): ChannelEventSubscribeResult | null;
|
|
317
|
+
export interface ChannelEventAckResult {
|
|
318
|
+
readonly acked: number;
|
|
319
|
+
}
|
|
320
|
+
export declare function decodeEventAckResult(result: PluginChannelResult): ChannelEventAckResult | null;
|
|
321
|
+
export interface ChannelSnapshotDescriptor {
|
|
322
|
+
readonly owner: string;
|
|
323
|
+
readonly epoch: number;
|
|
324
|
+
readonly version: number;
|
|
325
|
+
readonly schemaVersion: number;
|
|
326
|
+
readonly digest: `sha256:${string}`;
|
|
327
|
+
readonly size: number;
|
|
328
|
+
readonly chunkBytes: number;
|
|
329
|
+
}
|
|
330
|
+
export declare function decodeSnapshotDescriptor(result: PluginChannelResult): ChannelSnapshotDescriptor | null;
|
|
331
|
+
/** Encoding helpers for the lane success/error bodies, kept in one place. */
|
|
332
|
+
export declare function streamOpenResultBody(result: ChannelStreamOpenResult): Uint8Array;
|
|
333
|
+
export declare function streamOpenDuplexResultBody(result: ChannelStreamOpenDuplexResult): Uint8Array;
|
|
334
|
+
export declare function snapshotOpenResultBody(result: ChannelSnapshotOpenResult): Uint8Array;
|
|
335
|
+
export declare function eventSubscribeResultBody(result: ChannelEventSubscribeResult): Uint8Array;
|
|
336
|
+
export declare function eventAckResultBody(result: ChannelEventAckResult): Uint8Array;
|
|
337
|
+
export declare function successBody(value?: Record<string, unknown>): Uint8Array;
|
|
338
|
+
export declare function errorBody(code: PluginChannelErrorCode, detail?: Record<string, unknown>): Uint8Array;
|
|
339
|
+
export {};
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host-private read-only publication directory exchanged over an already
|
|
3
|
+
* authenticated peer link.
|
|
4
|
+
*
|
|
5
|
+
* It is NOT a second protocol: the query and its answer travel through the
|
|
6
|
+
* existing peer link + the existing native RPC mux (`link.request` on the sender
|
|
7
|
+
* side, the mapped `onRequest` handler on the receiver side), and the answer is
|
|
8
|
+
* a bounded JSON page — the exact metadata a host needs to route to a peer's
|
|
9
|
+
* REAL publication (provider/service/major/scope/scopeKey/ready and the actual
|
|
10
|
+
* kernel binding), never a contract schema (a consumer already owns its DSL) and
|
|
11
|
+
* never a plugin-visible handle.
|
|
12
|
+
*
|
|
13
|
+
* The reserved principal/provider are host-minted constants. A plugin cannot
|
|
14
|
+
* send a peer frame at all, and even a host-built frame carrying them is only
|
|
15
|
+
* admitted by the mux for a directory read, so a plugin can never claim them.
|
|
16
|
+
*
|
|
17
|
+
* Consistency: every page carries a revision derived from the full entry set, so
|
|
18
|
+
* a reader can detect a directory that changed while paging and reload instead
|
|
19
|
+
* of mixing two generations.
|
|
20
|
+
*/
|
|
21
|
+
import type { HostRpcPublicationView } from './host-rpc';
|
|
22
|
+
import type { PluginServiceProcess, PluginServiceScope } from './contracts';
|
|
23
|
+
/** Reserved host principal; never a plugin name and never plugin-addressable. */
|
|
24
|
+
export declare const PLUGIN_PEER_DIRECTORY_PRINCIPAL = "!bungee-host";
|
|
25
|
+
/** Reserved directory target; never a published plugin service. */
|
|
26
|
+
export declare const PLUGIN_PEER_DIRECTORY_PROVIDER = "!bungee-host.directory";
|
|
27
|
+
export declare const PLUGIN_PEER_DIRECTORY_SERVICE = "publication-directory";
|
|
28
|
+
export declare const PLUGIN_PEER_DIRECTORY_MAJOR = 1;
|
|
29
|
+
export declare const PLUGIN_PEER_DIRECTORY_METHOD = "page";
|
|
30
|
+
export declare const PLUGIN_PEER_DIRECTORY_VERSION = 1;
|
|
31
|
+
/**
|
|
32
|
+
* One page must stay inside both the canonical RPC JSON envelope (64 KiB) and
|
|
33
|
+
* the frame body cap (64 KiB), so it keeps a real margin below both.
|
|
34
|
+
*/
|
|
35
|
+
export declare const PLUGIN_PEER_DIRECTORY_PAGE_MAX_BYTES: number;
|
|
36
|
+
/** Entries per page and pages per load are both bounded. */
|
|
37
|
+
export declare const PLUGIN_PEER_DIRECTORY_PAGE_ENTRIES = 64;
|
|
38
|
+
export declare const PLUGIN_PEER_DIRECTORY_MAX_PAGES = 8;
|
|
39
|
+
export declare const PLUGIN_PEER_DIRECTORY_DEADLINE_MS = 2000;
|
|
40
|
+
export interface PeerDirectoryBinding {
|
|
41
|
+
readonly endpoint: string;
|
|
42
|
+
readonly process: PluginServiceProcess;
|
|
43
|
+
readonly instance: string;
|
|
44
|
+
readonly generation: number;
|
|
45
|
+
readonly catalog: string;
|
|
46
|
+
readonly scope: PluginServiceScope;
|
|
47
|
+
readonly subject: string;
|
|
48
|
+
}
|
|
49
|
+
export interface PeerDirectoryEntry {
|
|
50
|
+
readonly provider: string;
|
|
51
|
+
readonly service: string;
|
|
52
|
+
readonly major: number;
|
|
53
|
+
readonly scope: PluginServiceScope;
|
|
54
|
+
readonly scopeKey: string;
|
|
55
|
+
readonly ready: boolean;
|
|
56
|
+
readonly binding: PeerDirectoryBinding;
|
|
57
|
+
}
|
|
58
|
+
export interface PeerDirectoryPage {
|
|
59
|
+
readonly version: typeof PLUGIN_PEER_DIRECTORY_VERSION;
|
|
60
|
+
readonly revision: string;
|
|
61
|
+
readonly total: number;
|
|
62
|
+
readonly cursor: number;
|
|
63
|
+
readonly more: boolean;
|
|
64
|
+
readonly entries: readonly PeerDirectoryEntry[];
|
|
65
|
+
}
|
|
66
|
+
export interface PeerDirectoryQuery {
|
|
67
|
+
readonly version: typeof PLUGIN_PEER_DIRECTORY_VERSION;
|
|
68
|
+
readonly cursor: number;
|
|
69
|
+
}
|
|
70
|
+
/** True only for the exact reserved host-private read; nothing else may use it. */
|
|
71
|
+
export declare function isHostDirectoryQuery(input: {
|
|
72
|
+
readonly target: {
|
|
73
|
+
readonly provider: string;
|
|
74
|
+
readonly service: string;
|
|
75
|
+
readonly major: number;
|
|
76
|
+
readonly method: string;
|
|
77
|
+
};
|
|
78
|
+
readonly caller: {
|
|
79
|
+
readonly subject: string;
|
|
80
|
+
readonly scope: PluginServiceScope;
|
|
81
|
+
};
|
|
82
|
+
readonly binding: {
|
|
83
|
+
readonly scope: PluginServiceScope;
|
|
84
|
+
};
|
|
85
|
+
}): boolean;
|
|
86
|
+
/** A reserved host name is never accepted as a plugin identity in the normal path. */
|
|
87
|
+
export declare function isReservedHostName(value: string): boolean;
|
|
88
|
+
/** Stable reference of a complete entry set; changes exactly when the set does. */
|
|
89
|
+
export declare function directoryRevision(entries: readonly PeerDirectoryEntry[]): string;
|
|
90
|
+
/** Strict, bounded decode of one directory page; anything else is refused. */
|
|
91
|
+
export declare function decodePeerDirectoryPage(value: unknown): PeerDirectoryPage | null;
|
|
92
|
+
/** Strict decode of one directory query body (its only legal shape). */
|
|
93
|
+
export declare function decodePeerDirectoryQuery(value: unknown): PeerDirectoryQuery | null;
|
|
94
|
+
/**
|
|
95
|
+
* Projects the adapter's real publication view onto the minimal routable
|
|
96
|
+
* directory DTO. Only `global` scope is exposed: a binding-scope publication is
|
|
97
|
+
* never a cross-process routing target, so it is not advertised at all.
|
|
98
|
+
*/
|
|
99
|
+
export declare function toDirectoryEntries(view: readonly HostRpcPublicationView[], process: PluginServiceProcess): PeerDirectoryEntry[];
|
|
100
|
+
/** One bounded page of an already sorted entry set. */
|
|
101
|
+
export declare function buildDirectoryPage(entries: readonly PeerDirectoryEntry[], revision: string, cursor: number): {
|
|
102
|
+
readonly page: PeerDirectoryPage;
|
|
103
|
+
readonly encodedBytes: number;
|
|
104
|
+
} | null;
|
|
105
|
+
/**
|
|
106
|
+
* A second, independent page of the SAME host-private directory read: the
|
|
107
|
+
* channel (stream/snapshot/event) publications of this process. It is a separate
|
|
108
|
+
* `method` on the same reserved service so the RPC publication page keeps its
|
|
109
|
+
* exact wire shape and its existing consumers keep working unchanged.
|
|
110
|
+
*/
|
|
111
|
+
export declare const PLUGIN_PEER_CHANNEL_DIRECTORY_METHOD = "channel-page";
|
|
112
|
+
export interface PeerChannelDirectoryEntry {
|
|
113
|
+
readonly provider: string;
|
|
114
|
+
readonly service: string;
|
|
115
|
+
readonly major: number;
|
|
116
|
+
readonly scope: PluginServiceScope;
|
|
117
|
+
readonly scopeKey: string;
|
|
118
|
+
readonly ready: boolean;
|
|
119
|
+
readonly kind: 'stream' | 'snapshot' | 'event';
|
|
120
|
+
}
|
|
121
|
+
export interface PeerChannelDirectoryPage {
|
|
122
|
+
readonly version: typeof PLUGIN_PEER_DIRECTORY_VERSION;
|
|
123
|
+
readonly revision: string;
|
|
124
|
+
readonly total: number;
|
|
125
|
+
readonly cursor: number;
|
|
126
|
+
readonly more: boolean;
|
|
127
|
+
readonly entries: readonly PeerChannelDirectoryEntry[];
|
|
128
|
+
}
|
|
129
|
+
/** True only for the exact reserved host-private channel-page read. */
|
|
130
|
+
export declare function isHostChannelDirectoryQuery(input: {
|
|
131
|
+
readonly target: {
|
|
132
|
+
readonly provider: string;
|
|
133
|
+
readonly service: string;
|
|
134
|
+
readonly major: number;
|
|
135
|
+
readonly method: string;
|
|
136
|
+
};
|
|
137
|
+
readonly caller: {
|
|
138
|
+
readonly subject: string;
|
|
139
|
+
readonly scope: PluginServiceScope;
|
|
140
|
+
};
|
|
141
|
+
readonly binding: {
|
|
142
|
+
readonly scope: PluginServiceScope;
|
|
143
|
+
};
|
|
144
|
+
}): boolean;
|
|
145
|
+
/** Strict, bounded decode of one channel directory page; anything else is refused. */
|
|
146
|
+
export declare function decodePeerChannelDirectoryPage(value: unknown): PeerChannelDirectoryPage | null;
|
|
147
|
+
/** Stable reference of a complete channel entry set; changes exactly when it does. */
|
|
148
|
+
export declare function channelDirectoryRevision(entries: readonly PeerChannelDirectoryEntry[]): string;
|
|
149
|
+
/** Projects the channel adapter's real local publication view onto the directory DTO. */
|
|
150
|
+
export declare function toChannelDirectoryEntries(view: readonly {
|
|
151
|
+
readonly provider: string;
|
|
152
|
+
readonly service: string;
|
|
153
|
+
readonly major: number;
|
|
154
|
+
readonly scope: PluginServiceScope;
|
|
155
|
+
readonly scopeKey: string;
|
|
156
|
+
readonly ready: boolean;
|
|
157
|
+
readonly lane: 'stream' | 'snapshot' | 'event';
|
|
158
|
+
}[], process?: PluginServiceProcess): PeerChannelDirectoryEntry[];
|
|
159
|
+
/** One bounded page of an already sorted channel entry set. */
|
|
160
|
+
export declare function buildChannelDirectoryPage(entries: readonly PeerChannelDirectoryEntry[], revision: string, cursor: number): {
|
|
161
|
+
readonly page: PeerChannelDirectoryPage;
|
|
162
|
+
readonly encodedBytes: number;
|
|
163
|
+
} | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CommandSourceIdentity } from './command-journal';
|
|
2
|
+
import type { CapturedProcessIdentity } from '../master-runtime/process-identity';
|
|
3
|
+
import { type HeldProcessLifetimeGuardFacts } from '../supervision/process-lifetime-guard';
|
|
4
|
+
/** Host-authored, authenticated evidence; PID or controller epoch alone is insufficient. */
|
|
5
|
+
export interface PluginExecutorProof {
|
|
6
|
+
readonly source: CommandSourceIdentity;
|
|
7
|
+
readonly physical: CapturedProcessIdentity;
|
|
8
|
+
readonly boot: string;
|
|
9
|
+
readonly guard: HeldProcessLifetimeGuardFacts | null;
|
|
10
|
+
readonly retired: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** Input has already passed the bounded, accessor-free RPC JSON decoder. */
|
|
13
|
+
export declare function decodePluginExecutorProof(value: unknown): PluginExecutorProof | null;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin peer channel binary frame codec (P4).
|
|
3
|
+
*
|
|
4
|
+
* STRUCTURE ONLY — this module is a pure, deterministic framing codec. It packs
|
|
5
|
+
* an already-authenticated {@link PluginPeerPacket} into one bounded WebSocket
|
|
6
|
+
* binary message and unpacks it again.
|
|
7
|
+
*
|
|
8
|
+
* It does NOT authenticate anything. `decodePluginPeerFrame` proves only that a
|
|
9
|
+
* byte string is structurally a well-formed frame with a syntactic header and a
|
|
10
|
+
* bounded body. It never proves a MAC, a peer identity, a direction, a
|
|
11
|
+
* controller authority, or that a sequence is fresh. A receiver MUST:
|
|
12
|
+
* 1. `decodePluginPeerFrame(frame)`, then
|
|
13
|
+
* 2. `verifyPluginPeerPacket(header, body, credential, expected)`, then
|
|
14
|
+
* 3. `PluginPeerReplayWindow.accept(header.sequence)`,
|
|
15
|
+
* before dispatching. Structure is never admission.
|
|
16
|
+
*
|
|
17
|
+
* Wire format (every integer is unsigned big-endian, 12-byte prefix):
|
|
18
|
+
* offset 0 uint32 magic 0x42504331 ("BPC1")
|
|
19
|
+
* offset 4 uint32 headerLength raw canonical UTF-8 JSON header bytes
|
|
20
|
+
* offset 8 uint32 bodyLength raw body bytes
|
|
21
|
+
* offset 12 headerLength header bytes, then bodyLength body bytes
|
|
22
|
+
*
|
|
23
|
+
* Exactly one frame per WebSocket binary message. Frames are never split across
|
|
24
|
+
* messages and multiple packets are never concatenated into one message. The
|
|
25
|
+
* header budget ({@link PEER_HEADER_MAX_BYTES}) and the body budget
|
|
26
|
+
* ({@link PEER_BODY_MAX_BYTES}) stay independent; a multi-megabyte payload never
|
|
27
|
+
* rides one frame, never rides the old 64 KiB control RPC envelope, and is
|
|
28
|
+
* streamed as a sequence of these same bounded frames by a later layer.
|
|
29
|
+
*
|
|
30
|
+
* The codec allocates nothing before validating every declared length: an
|
|
31
|
+
* oversized `headerLength`/`bodyLength` is rejected before any slice or parse,
|
|
32
|
+
* and the declared lengths must sum to the exact frame length (no truncation,
|
|
33
|
+
* no ignored suffix).
|
|
34
|
+
*/
|
|
35
|
+
import { type PluginPeerPacket } from './peer-protocol';
|
|
36
|
+
/** Fixed 12-byte frame prefix: uint32BE magic, headerLength, bodyLength. */
|
|
37
|
+
export declare const PEER_FRAME_PREFIX_BYTES = 12;
|
|
38
|
+
/** Largest legal frame: prefix + max metadata header + max body (73740 bytes). */
|
|
39
|
+
export declare const PEER_FRAME_MAX_BYTES: number;
|
|
40
|
+
/**
|
|
41
|
+
* Frames one packet as a single bounded buffer.
|
|
42
|
+
*
|
|
43
|
+
* The header bytes are the raw canonical UTF-8 JSON — recovered by decoding the
|
|
44
|
+
* canonical base64url that {@link encodePluginPeerHeader} produces — so the 8 KiB
|
|
45
|
+
* budget is measured against the JSON bytes, never against the base64url text.
|
|
46
|
+
* The body is validated against the 64 KiB budget and copied into the frame, so
|
|
47
|
+
* a later caller mutation of the packet body cannot change an encoded frame.
|
|
48
|
+
*/
|
|
49
|
+
export declare function encodePluginPeerFrame(packet: PluginPeerPacket): Uint8Array;
|
|
50
|
+
/**
|
|
51
|
+
* Unpacks one bounded frame. Structural only: the returned packet is
|
|
52
|
+
* unauthenticated and MUST be verified by the caller.
|
|
53
|
+
*
|
|
54
|
+
* Every declared length is bounded before any allocation or parsing, and the
|
|
55
|
+
* declared lengths must account for the exact frame length. A `Uint8Array` view
|
|
56
|
+
* is honoured through its `byteOffset`/`byteLength`, and the header is decoded by
|
|
57
|
+
* the peer-protocol codec so its fatal-UTF-8 and canonical-JSON/byte-bound rules
|
|
58
|
+
* are reused rather than re-implemented.
|
|
59
|
+
*
|
|
60
|
+
* The returned packet object is frozen and its body is an independent copy, so
|
|
61
|
+
* mutating the source frame after decoding cannot change the payload that was
|
|
62
|
+
* (or will be) verified. The copy is a defensive boundary, not immutability:
|
|
63
|
+
* the body is a normal `Uint8Array` whose bytes the receiver may still write.
|
|
64
|
+
*/
|
|
65
|
+
export declare function decodePluginPeerFrame(frame: Uint8Array | ArrayBuffer): PluginPeerPacket;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Production resolver: all journal storage and maintenance runs in plugin-state Worker. */
|
|
2
|
+
import type { HostRpcJournalRequest } from './host-rpc';
|
|
3
|
+
import type { PluginStateClient, AsyncCommandJournal, StateRecoveryAuthorizer } from '../plugin-state/client';
|
|
4
|
+
export interface PluginPeerJournalOptions {
|
|
5
|
+
readonly client: PluginStateClient;
|
|
6
|
+
readonly authorizeRecovery?: StateRecoveryAuthorizer;
|
|
7
|
+
}
|
|
8
|
+
export interface PluginPeerJournalMaintenance {
|
|
9
|
+
readonly namespaces: number;
|
|
10
|
+
readonly recovered: number;
|
|
11
|
+
readonly collected: number;
|
|
12
|
+
readonly failures: readonly {
|
|
13
|
+
readonly namespace: string;
|
|
14
|
+
readonly code: string;
|
|
15
|
+
}[];
|
|
16
|
+
}
|
|
17
|
+
export interface PluginPeerJournalResolver {
|
|
18
|
+
resolve(request: HostRpcJournalRequest): AsyncCommandJournal | null;
|
|
19
|
+
maintain(options?: {
|
|
20
|
+
readonly namespaceLimit?: number;
|
|
21
|
+
readonly recordLimit?: number;
|
|
22
|
+
}): Promise<PluginPeerJournalMaintenance>;
|
|
23
|
+
close(): Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
export declare function createPluginPeerJournalResolver(options: PluginPeerJournalOptions): PluginPeerJournalResolver;
|