@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,69 @@
|
|
|
1
|
+
import type { AppConfig } from '@jeffusion/bungee-types';
|
|
2
|
+
import { PluginRegistry } from './plugin-registry';
|
|
3
|
+
import { ScopedPluginRegistry } from './scoped-plugin-registry';
|
|
4
|
+
import type { PluginServiceHost } from './plugin-services';
|
|
5
|
+
import { type PluginRuntimeOrchestratorDiff } from './plugin-runtime-diff';
|
|
6
|
+
import { type PluginRuntimeOrchestratorStatusReport } from './plugin-runtime-status';
|
|
7
|
+
export type { PluginRuntimeOrchestratorDiff } from './plugin-runtime-diff';
|
|
8
|
+
export type { PluginRuntimeOrchestratorStatusEntry, PluginRuntimeOrchestratorStatusReport } from './plugin-runtime-status';
|
|
9
|
+
/**
|
|
10
|
+
* Initialization failed and its owned teardown did not complete. Callers that
|
|
11
|
+
* own a worker process must propagate this instead of reporting a plain apply
|
|
12
|
+
* failure, so cleanup evidence stays honest.
|
|
13
|
+
*/
|
|
14
|
+
export declare class PluginRuntimeInitializationCleanupError extends Error {
|
|
15
|
+
readonly cause: unknown;
|
|
16
|
+
readonly cleanupError: unknown;
|
|
17
|
+
constructor(cause: unknown, cleanupError: unknown);
|
|
18
|
+
}
|
|
19
|
+
export interface PluginRuntimeOrchestratorApplyResult {
|
|
20
|
+
generation: number;
|
|
21
|
+
diff: PluginRuntimeOrchestratorDiff;
|
|
22
|
+
runtime: {
|
|
23
|
+
success: number;
|
|
24
|
+
failed: number;
|
|
25
|
+
};
|
|
26
|
+
status: PluginRuntimeOrchestratorStatusReport;
|
|
27
|
+
}
|
|
28
|
+
export declare class PluginRuntimeOrchestrator {
|
|
29
|
+
private readonly configBasePath;
|
|
30
|
+
/**
|
|
31
|
+
* Canonical worker-process service host. The runtime injects its configured
|
|
32
|
+
* (peer-communication enabled) host so the registry, its plugins and the
|
|
33
|
+
* host RPC adapter share exactly one owner/lifecycle/lease registry.
|
|
34
|
+
*/
|
|
35
|
+
private readonly services?;
|
|
36
|
+
/**
|
|
37
|
+
* Host gate awaited once per registry initialization, after the dependency
|
|
38
|
+
* graph is updated and before any plugin handler is created.
|
|
39
|
+
*/
|
|
40
|
+
private readonly beforeBootstrap?;
|
|
41
|
+
private pluginRegistry;
|
|
42
|
+
private scopedRegistry;
|
|
43
|
+
private generation;
|
|
44
|
+
private appliedAt;
|
|
45
|
+
private drainingScopedRegistries;
|
|
46
|
+
private pendingScopedRegistryDestroyers;
|
|
47
|
+
private readonly activatedPluginNames;
|
|
48
|
+
private lastStatus;
|
|
49
|
+
constructor(configBasePath?: string, activatedPluginNames?: readonly string[],
|
|
50
|
+
/**
|
|
51
|
+
* Canonical worker-process service host. The runtime injects its configured
|
|
52
|
+
* (peer-communication enabled) host so the registry, its plugins and the
|
|
53
|
+
* host RPC adapter share exactly one owner/lifecycle/lease registry.
|
|
54
|
+
*/
|
|
55
|
+
services?: PluginServiceHost | undefined,
|
|
56
|
+
/**
|
|
57
|
+
* Host gate awaited once per registry initialization, after the dependency
|
|
58
|
+
* graph is updated and before any plugin handler is created.
|
|
59
|
+
*/
|
|
60
|
+
beforeBootstrap?: ((signal: AbortSignal) => Promise<void>) | undefined);
|
|
61
|
+
getPluginRegistry(): PluginRegistry | null;
|
|
62
|
+
getScopedRegistry(): ScopedPluginRegistry | null;
|
|
63
|
+
getStatusReport(): PluginRuntimeOrchestratorStatusReport;
|
|
64
|
+
applyConfig(config: AppConfig, signal?: AbortSignal): Promise<PluginRuntimeOrchestratorApplyResult>;
|
|
65
|
+
destroy(): Promise<void>;
|
|
66
|
+
private resetRuntime;
|
|
67
|
+
private scheduleScopedRegistryDestroy;
|
|
68
|
+
private buildStatusReport;
|
|
69
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { LoadedPluginManifest } from './plugin.types';
|
|
2
|
+
import type { PluginScope } from './scoped-plugin-registry';
|
|
3
|
+
import { type PluginManifestContractSnapshot, type PluginManifestValidationFailureCode } from './plugin-artifact-contract';
|
|
4
|
+
export type PluginDiscoveryState = 'undiscovered' | 'discovered';
|
|
5
|
+
export type PluginValidationState = 'pending' | 'validated' | 'degraded' | 'quarantined';
|
|
6
|
+
export type PluginPersistedEnabledState = 'unknown' | 'enabled' | 'disabled';
|
|
7
|
+
export type PluginRuntimeLoadState = 'not-loaded' | 'loaded' | 'degraded' | 'quarantined';
|
|
8
|
+
export type PluginScopedServingState = 'non-serving' | 'serving';
|
|
9
|
+
export type PluginRuntimeFailureCode = 'runtime-load-failure';
|
|
10
|
+
export type PluginFailureStage = 'validation' | 'runtime';
|
|
11
|
+
export type PluginFailureClassification = 'degraded' | 'quarantined';
|
|
12
|
+
export type PluginLifecycleState = 'undiscovered' | 'discovered' | 'validated' | 'enabled' | 'loaded' | 'serving' | 'disabled' | 'degraded' | 'quarantined';
|
|
13
|
+
export interface PluginRegistryStateSnapshot {
|
|
14
|
+
pluginName: string;
|
|
15
|
+
discovery: PluginDiscoveryState;
|
|
16
|
+
validation: PluginValidationState;
|
|
17
|
+
persistedEnabled: PluginPersistedEnabledState;
|
|
18
|
+
manifest?: LoadedPluginManifest;
|
|
19
|
+
contract?: PluginManifestContractSnapshot;
|
|
20
|
+
failureReason?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface PluginRuntimeStateSnapshot {
|
|
23
|
+
pluginName: string;
|
|
24
|
+
loadState: PluginRuntimeLoadState;
|
|
25
|
+
servingScopes: PluginScope[];
|
|
26
|
+
failureReason?: string;
|
|
27
|
+
failureCode?: PluginRuntimeFailureCode;
|
|
28
|
+
}
|
|
29
|
+
export interface PluginFailureSnapshot {
|
|
30
|
+
stage: PluginFailureStage;
|
|
31
|
+
classification: PluginFailureClassification;
|
|
32
|
+
reason: string;
|
|
33
|
+
code?: PluginManifestValidationFailureCode | PluginRuntimeFailureCode;
|
|
34
|
+
generation?: number;
|
|
35
|
+
}
|
|
36
|
+
export interface FrozenPluginRuntimeState {
|
|
37
|
+
pluginName: string;
|
|
38
|
+
lifecycle: PluginLifecycleState;
|
|
39
|
+
authorities: {
|
|
40
|
+
discovery: 'plugin-registry';
|
|
41
|
+
validation: 'plugin-registry';
|
|
42
|
+
persistedEnabled: 'configuration';
|
|
43
|
+
runtimeLoaded: 'scoped-plugin-registry';
|
|
44
|
+
scopedServing: 'scoped-plugin-registry';
|
|
45
|
+
};
|
|
46
|
+
states: {
|
|
47
|
+
discovery: PluginDiscoveryState;
|
|
48
|
+
validation: PluginValidationState;
|
|
49
|
+
persistedEnabled: PluginPersistedEnabledState;
|
|
50
|
+
runtimeLoaded: PluginRuntimeLoadState;
|
|
51
|
+
scopedServing: PluginScopedServingState;
|
|
52
|
+
};
|
|
53
|
+
runtime: {
|
|
54
|
+
servingScopes: PluginScope[];
|
|
55
|
+
currentGeneration: number | null;
|
|
56
|
+
servingGeneration: number | null;
|
|
57
|
+
drainingGenerations: number[];
|
|
58
|
+
};
|
|
59
|
+
contract: PluginManifestContractSnapshot | null;
|
|
60
|
+
reasons: {
|
|
61
|
+
validation?: string;
|
|
62
|
+
runtime?: string;
|
|
63
|
+
};
|
|
64
|
+
failures: {
|
|
65
|
+
validation?: PluginFailureSnapshot;
|
|
66
|
+
runtime?: PluginFailureSnapshot;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export declare function createPluginRegistryStateSnapshot(input: Partial<PluginRegistryStateSnapshot> & Pick<PluginRegistryStateSnapshot, 'pluginName'>): PluginRegistryStateSnapshot;
|
|
70
|
+
export declare function createPluginRuntimeStateSnapshot(input: Partial<PluginRuntimeStateSnapshot> & Pick<PluginRuntimeStateSnapshot, 'pluginName'>): PluginRuntimeStateSnapshot;
|
|
71
|
+
export declare function classifyPluginValidationFailure(error: unknown): Exclude<PluginValidationState, 'pending' | 'validated'>;
|
|
72
|
+
export declare function freezePluginRuntimeState(registrySnapshot: PluginRegistryStateSnapshot, runtimeSnapshot?: PluginRuntimeStateSnapshot, runtimeObservation?: {
|
|
73
|
+
currentGeneration?: number | null;
|
|
74
|
+
servingGeneration?: number | null;
|
|
75
|
+
drainingGenerations?: number[];
|
|
76
|
+
servingScopes?: PluginScope[];
|
|
77
|
+
failedGeneration?: number | null;
|
|
78
|
+
}): FrozenPluginRuntimeState;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type PluginRegistry } from './plugin-registry';
|
|
2
|
+
import { type FrozenPluginRuntimeState } from './plugin-runtime-state-machine';
|
|
3
|
+
import type { ScopedPluginRegistry } from './scoped-plugin-registry';
|
|
4
|
+
export interface PluginRuntimeOrchestratorStatusEntry {
|
|
5
|
+
pluginName: string;
|
|
6
|
+
generation: number;
|
|
7
|
+
state: FrozenPluginRuntimeState;
|
|
8
|
+
sources: {
|
|
9
|
+
registry: boolean;
|
|
10
|
+
runtime: boolean;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export interface PluginRuntimeOrchestratorStatusReport {
|
|
14
|
+
generation: number;
|
|
15
|
+
appliedAt: string | null;
|
|
16
|
+
plugins: PluginRuntimeOrchestratorStatusEntry[];
|
|
17
|
+
summary: {
|
|
18
|
+
total: number;
|
|
19
|
+
serving: number;
|
|
20
|
+
disabled: number;
|
|
21
|
+
degraded: number;
|
|
22
|
+
quarantined: number;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export interface DrainingScopedRegistryEntry {
|
|
26
|
+
registry: ScopedPluginRegistry;
|
|
27
|
+
generation: number;
|
|
28
|
+
}
|
|
29
|
+
export declare function buildPluginRuntimeStatusReport(pluginRegistry: PluginRegistry | null, scopedRegistry: ScopedPluginRegistry | null, drainingRegistries: DrainingScopedRegistryEntry[], generation: number, appliedAt: number | null, activatedPluginNames: ReadonlySet<string>): PluginRuntimeOrchestratorStatusReport;
|
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host channel adapter (P5): the plugin-facing, host-authorized surface for the
|
|
3
|
+
* `stream` (read + write), `events` and `snapshot` lanes.
|
|
4
|
+
*
|
|
5
|
+
* It is deliberately a sibling of `HostRpcAdapter`, not a second host: the same
|
|
6
|
+
* `PluginServiceHost` owner lifecycle drives `markReady`/`retire`/`dispose`, the
|
|
7
|
+
* same manifest declarations authorize every provide/consume, the same
|
|
8
|
+
* `wire-contract` data schemas type every lane payload, and every byte still
|
|
9
|
+
* crosses the one authenticated peer link (or stays in-process when the provider
|
|
10
|
+
* lives in this same Host). This adapter only:
|
|
11
|
+
*
|
|
12
|
+
* - validates the declared contract for the calling owner (kind/process/scope),
|
|
13
|
+
* - registers provider implementations with the shared {@link PluginPeerChannelHub},
|
|
14
|
+
* - hands the consumer a bounded, cancelable handle that holds a real Host lease
|
|
15
|
+
* for its whole lifetime (so owner disposal can never race live lane work),
|
|
16
|
+
* - supplies the default durable reliable-event log over the host communication
|
|
17
|
+
* store (namespace-isolated per provider plugin), including the same-transaction
|
|
18
|
+
* outbox seam, and the host-managed snapshot view store.
|
|
19
|
+
*/
|
|
20
|
+
import type { PluginServiceDeclarations, PluginServiceProcess, PluginServiceScope } from './contracts';
|
|
21
|
+
import type { HostRpcLifecycleIdentity, HostRpcLifecycleState } from './host-rpc';
|
|
22
|
+
import type { InferRpcData, RpcCallPurpose, RpcDataSchema } from './wire-contract';
|
|
23
|
+
import type { DurableMutation, PluginDurableState } from '../plugin-durable-state';
|
|
24
|
+
import { PluginPeerChannelHub, type PluginChannelEventSubscription, type PluginChannelReliableEventLog, type PluginChannelDuplexSession, type PluginChannelSnapshotRead, type PluginChannelStream, type PluginChannelWriteStream } from './peer-channel-hub';
|
|
25
|
+
import type { ChannelSnapshotDescriptor } from './peer-channel-protocol';
|
|
26
|
+
import type { CommunicationNamespaceStore } from './persistence';
|
|
27
|
+
import type { AsyncHostSnapshotStore } from '../plugin-state/client';
|
|
28
|
+
export interface PluginChannelPublication {
|
|
29
|
+
readonly contractId: string;
|
|
30
|
+
readonly version: number;
|
|
31
|
+
readonly lane: 'stream' | 'snapshot' | 'event';
|
|
32
|
+
/** Canonical hash of the declared contract; both sides must agree on it. */
|
|
33
|
+
readonly contract: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Read/write stream contract. `object` is the `wire-contract` schema of the
|
|
37
|
+
* immutable object reference the consumer names (`{ objectId, version, ... }`),
|
|
38
|
+
* so the SDK type and the runtime schema come from the same literal.
|
|
39
|
+
*/
|
|
40
|
+
export interface PluginStreamContract<S extends RpcDataSchema = RpcDataSchema> {
|
|
41
|
+
readonly id: string;
|
|
42
|
+
readonly version: number;
|
|
43
|
+
readonly object: S;
|
|
44
|
+
}
|
|
45
|
+
export interface PluginStreamReadInput {
|
|
46
|
+
readonly offset?: number;
|
|
47
|
+
readonly size?: number | null;
|
|
48
|
+
readonly digest?: `sha256:${string}` | null;
|
|
49
|
+
/**
|
|
50
|
+
* Read credit in bytes: defaults to and may not exceed 245760 (4 × 60 KiB),
|
|
51
|
+
* the receiver's per-transfer receive buffer. Every consumed byte is granted
|
|
52
|
+
* back once; an out-of-range value is rejected.
|
|
53
|
+
*/
|
|
54
|
+
readonly creditBytes?: number;
|
|
55
|
+
readonly idleMs?: number;
|
|
56
|
+
readonly timeoutMs?: number;
|
|
57
|
+
readonly signal?: AbortSignal;
|
|
58
|
+
}
|
|
59
|
+
export interface PluginStreamWriteInput {
|
|
60
|
+
readonly size?: number | null;
|
|
61
|
+
readonly digest?: `sha256:${string}` | null;
|
|
62
|
+
readonly creditBytes?: number;
|
|
63
|
+
readonly idleMs?: number;
|
|
64
|
+
readonly timeoutMs?: number;
|
|
65
|
+
readonly signal?: AbortSignal;
|
|
66
|
+
}
|
|
67
|
+
export interface PluginStreamDuplexInput {
|
|
68
|
+
readonly readOffset?: number;
|
|
69
|
+
readonly readSize?: number | null;
|
|
70
|
+
readonly readDigest?: `sha256:${string}` | null;
|
|
71
|
+
readonly writeSize?: number | null;
|
|
72
|
+
readonly writeDigest?: `sha256:${string}` | null;
|
|
73
|
+
/**
|
|
74
|
+
* Read-direction credit in bytes: same default and 245760 (4 × 60 KiB)
|
|
75
|
+
* ceiling as {@link PluginStreamReadInput.creditBytes}, returned once per
|
|
76
|
+
* consumed byte.
|
|
77
|
+
*/
|
|
78
|
+
readonly readCreditBytes?: number;
|
|
79
|
+
readonly writeCreditBytes?: number;
|
|
80
|
+
readonly idleMs?: number;
|
|
81
|
+
readonly timeoutMs?: number;
|
|
82
|
+
readonly signal?: AbortSignal;
|
|
83
|
+
}
|
|
84
|
+
export interface PluginStreamSourceReader {
|
|
85
|
+
readonly size: number;
|
|
86
|
+
readonly digest: `sha256:${string}`;
|
|
87
|
+
read(offset: number, length: number): Promise<Uint8Array> | Uint8Array;
|
|
88
|
+
}
|
|
89
|
+
export interface PluginStreamSinkWriter {
|
|
90
|
+
write(offset: number, bytes: Uint8Array): Promise<void> | void;
|
|
91
|
+
finish(size: number, digest: `sha256:${string}`): Promise<void> | void;
|
|
92
|
+
abort?(reason: 'cancelled' | 'failed' | 'closed'): void;
|
|
93
|
+
}
|
|
94
|
+
export interface PluginStreamServices {
|
|
95
|
+
/** Provider side: announce an immutable object family (read and/or write). */
|
|
96
|
+
provide<S extends RpcDataSchema>(contract: PluginStreamContract<S>, provider: {
|
|
97
|
+
open?(input: {
|
|
98
|
+
readonly caller: string;
|
|
99
|
+
readonly callerScope: string;
|
|
100
|
+
readonly object: InferRpcData<S>;
|
|
101
|
+
}): PluginStreamSourceReader | null;
|
|
102
|
+
accept?(input: {
|
|
103
|
+
readonly caller: string;
|
|
104
|
+
readonly callerScope: string;
|
|
105
|
+
readonly object: InferRpcData<S>;
|
|
106
|
+
}): PluginStreamSinkWriter | null;
|
|
107
|
+
/** True duplex: ONE session carries both directions and one shared terminal. */
|
|
108
|
+
duplex?(input: {
|
|
109
|
+
readonly caller: string;
|
|
110
|
+
readonly callerScope: string;
|
|
111
|
+
readonly object: InferRpcData<S>;
|
|
112
|
+
}): {
|
|
113
|
+
readonly source?: PluginStreamSourceReader;
|
|
114
|
+
readonly sink?: PluginStreamSinkWriter;
|
|
115
|
+
} | null;
|
|
116
|
+
}): PluginChannelPublication;
|
|
117
|
+
/** Consumer side: read a peer/local-provided immutable version. */
|
|
118
|
+
open<S extends RpcDataSchema>(provider: string, contract: PluginStreamContract<S>, object: InferRpcData<S>, input?: PluginStreamReadInput): PluginChannelStream;
|
|
119
|
+
/** Consumer side: write a body the provider durably accepts and commits. */
|
|
120
|
+
openWrite<S extends RpcDataSchema>(provider: string, contract: PluginStreamContract<S>, object: InferRpcData<S>, input?: PluginStreamWriteInput): PluginChannelWriteStream;
|
|
121
|
+
/** Consumer side: one true duplex session over a single transfer id. */
|
|
122
|
+
openDuplex<S extends RpcDataSchema>(provider: string, contract: PluginStreamContract<S>, object: InferRpcData<S>, input?: PluginStreamDuplexInput): PluginChannelDuplexSession;
|
|
123
|
+
}
|
|
124
|
+
export interface PluginSnapshotContract<S extends RpcDataSchema = RpcDataSchema> {
|
|
125
|
+
readonly id: string;
|
|
126
|
+
readonly version: number;
|
|
127
|
+
/** Schema of the snapshot's plugin-defined content (same literal both sides). */
|
|
128
|
+
readonly content: S;
|
|
129
|
+
}
|
|
130
|
+
export interface HostSnapshotStoreOptionsView {
|
|
131
|
+
readonly id: string;
|
|
132
|
+
readonly schemaVersion: number;
|
|
133
|
+
readonly epoch?: number;
|
|
134
|
+
readonly maxVersions?: number;
|
|
135
|
+
readonly maxBytes?: number;
|
|
136
|
+
readonly chunkBytes?: number;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* One provider-owned immutable version. `retain`/`release` are optional but are
|
|
140
|
+
* honoured for the WHOLE host read session, so a bounded/GC'd store can keep the
|
|
141
|
+
* exact version alive while it is being read (and free it afterwards).
|
|
142
|
+
*/
|
|
143
|
+
export interface PluginSnapshotVersionSource {
|
|
144
|
+
readonly descriptor: ChannelSnapshotDescriptor;
|
|
145
|
+
read(offset: number, length: number): Promise<Uint8Array>;
|
|
146
|
+
retain?(): void | Promise<void>;
|
|
147
|
+
release?(): void | Promise<void>;
|
|
148
|
+
}
|
|
149
|
+
export interface PluginSnapshotServices {
|
|
150
|
+
/** Provider side: single writer of the current immutable snapshot + retained versions. */
|
|
151
|
+
provide<S extends RpcDataSchema>(contract: PluginSnapshotContract<S>, provider: {
|
|
152
|
+
current(): PluginSnapshotVersionSource | null | Promise<PluginSnapshotVersionSource | null>;
|
|
153
|
+
version(version: number): PluginSnapshotVersionSource | null | Promise<PluginSnapshotVersionSource | null>;
|
|
154
|
+
}): PluginChannelPublication;
|
|
155
|
+
/** Consumer side: the host-managed local view of the peer's current version. */
|
|
156
|
+
consume<S extends RpcDataSchema>(provider: string, contract: PluginSnapshotContract<S>): PluginSnapshotView;
|
|
157
|
+
/**
|
|
158
|
+
* Host-managed persistent, atomic, digest-addressed version store for THIS
|
|
159
|
+
* provider plugin (bounded retention, chunked over the host communication
|
|
160
|
+
* store). `null` when this process has no durable host store: a provider then
|
|
161
|
+
* keeps its own in-memory source rather than inventing its own persistence.
|
|
162
|
+
*/
|
|
163
|
+
store?(options: HostSnapshotStoreOptionsView): AsyncHostSnapshotStore | null;
|
|
164
|
+
}
|
|
165
|
+
export interface PluginSnapshotStatus {
|
|
166
|
+
readonly status: 'empty' | 'loading' | 'ready' | 'stale' | 'failed';
|
|
167
|
+
readonly version: number | null;
|
|
168
|
+
readonly digest: `sha256:${string}` | null;
|
|
169
|
+
readonly size: number | null;
|
|
170
|
+
readonly appliedAt: number | null;
|
|
171
|
+
readonly error: string | null;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Host-managed local snapshot view: the host performs the verified atomic
|
|
175
|
+
* replace, keeps the previous view readable while a refresh is in flight, and
|
|
176
|
+
* reconciles continuously so a lost notification or a reconnect recovers.
|
|
177
|
+
*/
|
|
178
|
+
export interface PluginSnapshotView {
|
|
179
|
+
/** The currently applied immutable version, or `null` before the first apply. */
|
|
180
|
+
current(): PluginChannelSnapshotRead | null;
|
|
181
|
+
status(): PluginSnapshotStatus;
|
|
182
|
+
/** One reconciliation pass: `applied`, `unchanged`, or `failed`. */
|
|
183
|
+
sync(options?: {
|
|
184
|
+
readonly timeoutMs?: number;
|
|
185
|
+
readonly signal?: AbortSignal;
|
|
186
|
+
readonly version?: number | null;
|
|
187
|
+
readonly force?: boolean;
|
|
188
|
+
}): Promise<'applied' | 'unchanged' | 'failed'>;
|
|
189
|
+
/** Continuous reconciliation; returns the stop function. */
|
|
190
|
+
start(options?: {
|
|
191
|
+
readonly intervalMs?: number;
|
|
192
|
+
}): () => void;
|
|
193
|
+
/** Notified exactly when a new version becomes the applied view. */
|
|
194
|
+
onApplied(listener: (view: PluginChannelSnapshotRead) => void): () => void;
|
|
195
|
+
}
|
|
196
|
+
export interface PluginEventContract<S extends RpcDataSchema = RpcDataSchema> {
|
|
197
|
+
readonly id: string;
|
|
198
|
+
readonly version: number;
|
|
199
|
+
readonly delivery: 'transient' | 'reliable';
|
|
200
|
+
/** Schema of one event payload; the same literal types both sides. */
|
|
201
|
+
readonly event: S;
|
|
202
|
+
/** Reliable topics: explicit bounded retention (events kept, then real gap). */
|
|
203
|
+
readonly retention?: {
|
|
204
|
+
readonly maxEvents: number;
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
export interface PluginEventServices {
|
|
208
|
+
/** Provider side: register one topic; reliable topics require a durable log. */
|
|
209
|
+
provide<S extends RpcDataSchema>(contract: PluginEventContract<S>, options?: {
|
|
210
|
+
readonly log?: PluginChannelReliableEventLog;
|
|
211
|
+
}): PluginEventPublisher<S>;
|
|
212
|
+
/** Consumer side: subscribe to a peer/local theme; reliable is at-least-once. */
|
|
213
|
+
subscribe<S extends RpcDataSchema>(provider: string, contract: PluginEventContract<S>, options: {
|
|
214
|
+
readonly consumerId: string;
|
|
215
|
+
readonly from?: number | null;
|
|
216
|
+
readonly onEvent: (event: {
|
|
217
|
+
readonly sequence: number;
|
|
218
|
+
readonly eventId: string;
|
|
219
|
+
readonly payload: InferRpcData<S>;
|
|
220
|
+
readonly delivery: 'transient' | 'reliable';
|
|
221
|
+
}) => void;
|
|
222
|
+
readonly timeoutMs?: number;
|
|
223
|
+
readonly signal?: AbortSignal;
|
|
224
|
+
}): Promise<PluginChannelEventSubscription>;
|
|
225
|
+
}
|
|
226
|
+
export interface PluginEventPublisher<S extends RpcDataSchema = RpcDataSchema> {
|
|
227
|
+
readonly contractId: string;
|
|
228
|
+
readonly delivery: 'transient' | 'reliable';
|
|
229
|
+
/** Reliable: durable append + fan-out; resolves with the durable sequence. */
|
|
230
|
+
publish(payload: InferRpcData<S>): Promise<number>;
|
|
231
|
+
/**
|
|
232
|
+
* Reliable outbox: commits the event and the plugin's business state in ONE
|
|
233
|
+
* durable transaction (the same Host database). Never a distributed promise.
|
|
234
|
+
*/
|
|
235
|
+
publishWithState(payload: InferRpcData<S>, mutations: readonly DurableMutation[]): Promise<number>;
|
|
236
|
+
/** Transient: best-effort fan-out; `false` means it was not admitted. */
|
|
237
|
+
notify(payload: InferRpcData<S>): boolean;
|
|
238
|
+
}
|
|
239
|
+
/** Deployment capability declaration, available before the plugin declares work. */
|
|
240
|
+
export interface PluginChannelCapabilities {
|
|
241
|
+
/** Same-process provide/consume works. */
|
|
242
|
+
readonly local: boolean;
|
|
243
|
+
/** A peer transport is wired for this process. */
|
|
244
|
+
readonly remote: boolean;
|
|
245
|
+
/** Reliable event topics can be provided (a durable log exists here). */
|
|
246
|
+
readonly reliableEvents: boolean;
|
|
247
|
+
/** `publishWithState` can commit state + outbox atomically here. */
|
|
248
|
+
readonly outbox: boolean;
|
|
249
|
+
/** Host-managed snapshot views are available. */
|
|
250
|
+
readonly snapshotViews: boolean;
|
|
251
|
+
/** Write streams are available. */
|
|
252
|
+
readonly writeStreams: boolean;
|
|
253
|
+
}
|
|
254
|
+
/** Host-only directory entry for one real local channel publication. */
|
|
255
|
+
export interface HostChannelPublicationView {
|
|
256
|
+
readonly provider: string;
|
|
257
|
+
readonly service: string;
|
|
258
|
+
readonly major: number;
|
|
259
|
+
readonly scope: PluginServiceScope;
|
|
260
|
+
readonly scopeKey: string;
|
|
261
|
+
readonly ready: boolean;
|
|
262
|
+
readonly lane: 'stream' | 'snapshot' | 'event';
|
|
263
|
+
readonly contract: string;
|
|
264
|
+
}
|
|
265
|
+
export interface HostChannelOperation {
|
|
266
|
+
readonly purpose: RpcCallPurpose;
|
|
267
|
+
readonly signal?: AbortSignal;
|
|
268
|
+
readonly deadlineAt?: number;
|
|
269
|
+
readonly release: () => void;
|
|
270
|
+
}
|
|
271
|
+
export interface PluginChannelOwnerInput {
|
|
272
|
+
readonly plugin: string;
|
|
273
|
+
readonly scope: string;
|
|
274
|
+
readonly declarations: PluginServiceDeclarations;
|
|
275
|
+
readonly lifecycle: HostRpcLifecycleIdentity;
|
|
276
|
+
readonly getLifecycleState: () => HostRpcLifecycleState;
|
|
277
|
+
/** Trusted host dependency records; a channel consumption must be a declared dependency. */
|
|
278
|
+
readonly dependencies: Readonly<Record<string, string>>;
|
|
279
|
+
/** Registers a real pending task so owner disposal drains it honestly. */
|
|
280
|
+
readonly trackPending: (promise: Promise<unknown>) => void;
|
|
281
|
+
/**
|
|
282
|
+
* Host-only: begins one channel operation (lease + invocation-frame rules).
|
|
283
|
+
* `options.background` requests the explicit Host background context used by
|
|
284
|
+
* Host-managed work (e.g. snapshot reconciliation timers), which must not be
|
|
285
|
+
* derived from a plugin's closed bootstrap closure.
|
|
286
|
+
*/
|
|
287
|
+
readonly beginOperation: (options?: {
|
|
288
|
+
readonly background?: boolean;
|
|
289
|
+
}) => HostChannelOperation | null;
|
|
290
|
+
}
|
|
291
|
+
export interface HostChannelOwnerHandle {
|
|
292
|
+
readonly stream?: PluginStreamServices;
|
|
293
|
+
readonly events?: PluginEventServices;
|
|
294
|
+
readonly snapshot?: PluginSnapshotServices;
|
|
295
|
+
readonly capabilities: PluginChannelCapabilities;
|
|
296
|
+
markReady(): void;
|
|
297
|
+
retire(): void;
|
|
298
|
+
dispose(): Promise<void>;
|
|
299
|
+
}
|
|
300
|
+
export type PluginReliableEventLogFactory = (input: {
|
|
301
|
+
readonly plugin: string;
|
|
302
|
+
readonly topic: string;
|
|
303
|
+
/** Contract major: a different major is a different schema and log. */
|
|
304
|
+
readonly major: number;
|
|
305
|
+
readonly maxEvents: number;
|
|
306
|
+
}) => PluginChannelReliableEventLog | null;
|
|
307
|
+
export interface HostChannelAdapterOptions {
|
|
308
|
+
readonly hub: PluginPeerChannelHub;
|
|
309
|
+
readonly process: PluginServiceProcess;
|
|
310
|
+
/** Provider-side durable namespace factory; absent refuses reliable topics. */
|
|
311
|
+
readonly eventLog?: PluginReliableEventLogFactory;
|
|
312
|
+
/** Provider-side durable state for the same-transaction outbox seam. */
|
|
313
|
+
readonly durableState?: (plugin: string) => PluginDurableState | null;
|
|
314
|
+
/** True when a peer transport is actually wired in this process. */
|
|
315
|
+
readonly remoteTransport?: () => boolean;
|
|
316
|
+
/**
|
|
317
|
+
* Host durable namespace for the snapshot version store of one provider plugin.
|
|
318
|
+
* Absent (e.g. a worker without a durable store) means `store()` returns null.
|
|
319
|
+
*/
|
|
320
|
+
readonly snapshotStore?: (plugin: string, options: HostSnapshotStoreOptionsView) => AsyncHostSnapshotStore | null;
|
|
321
|
+
}
|
|
322
|
+
export declare class HostChannelAdapter {
|
|
323
|
+
#private;
|
|
324
|
+
constructor(options: HostChannelAdapterOptions);
|
|
325
|
+
get process(): PluginServiceProcess;
|
|
326
|
+
capabilities(): PluginChannelCapabilities;
|
|
327
|
+
/** Host-only: one owner's lane surface. */
|
|
328
|
+
createOwner(input: PluginChannelOwnerInput): HostChannelOwnerHandle;
|
|
329
|
+
/** Bounded, rotating retry of snapshot retention; publication success is independent. */
|
|
330
|
+
maintainSnapshots(limit?: number): Promise<{
|
|
331
|
+
readonly stores: number;
|
|
332
|
+
readonly removed: number;
|
|
333
|
+
readonly failures: number;
|
|
334
|
+
}>;
|
|
335
|
+
/** Host-only: local channel publications advertised to a peer over the directory. */
|
|
336
|
+
publicationView(): readonly HostChannelPublicationView[];
|
|
337
|
+
}
|
|
338
|
+
/** Bounded replay window; the retained event log never grows past this. */
|
|
339
|
+
export declare const CHANNEL_EVENT_LOG_MAX = 128;
|
|
340
|
+
/** Bounded total bytes the host-managed snapshot view cache may retain. */
|
|
341
|
+
export declare const CHANNEL_SNAPSHOT_VIEW_CACHE_MAX_BYTES: number;
|
|
342
|
+
/** Bounded number of live snapshot views a host adapter may hold at once. */
|
|
343
|
+
export declare const CHANNEL_SNAPSHOT_VIEW_MAX_COUNT = 64;
|
|
344
|
+
/**
|
|
345
|
+
* Namespace-isolated durable log over the host's `plugin_communication_records`
|
|
346
|
+
* table. It owns no schema and no file: the table is created by the audited v14
|
|
347
|
+
* migration, and one provider plugin can never read another namespace.
|
|
348
|
+
*
|
|
349
|
+
* Durability contract:
|
|
350
|
+
* - sequence is monotonic and durable (a per-topic meta record), so publishing
|
|
351
|
+
* continues after every consumer acknowledged and never restarts at 1;
|
|
352
|
+
* - event ids are derived from (namespace, topic, sequence), so two events with
|
|
353
|
+
* identical payloads are still distinct;
|
|
354
|
+
* - every append + prune + meta update is ONE immediate transaction;
|
|
355
|
+
* - retention is an explicit bounded policy (events per topic), never one
|
|
356
|
+
* consumer's ack, so a second consumer can still replay inside the window;
|
|
357
|
+
* - checkpoints are per consumer and monotonic.
|
|
358
|
+
*/
|
|
359
|
+
export declare class StoreBackedReliableEventLog implements PluginChannelReliableEventLog {
|
|
360
|
+
#private;
|
|
361
|
+
constructor(store: CommunicationNamespaceStore, topic: string, maxEvents?: number, major?: number);
|
|
362
|
+
get topic(): string;
|
|
363
|
+
get major(): number;
|
|
364
|
+
append(payload: Uint8Array): {
|
|
365
|
+
readonly sequence: number;
|
|
366
|
+
readonly eventId: string;
|
|
367
|
+
};
|
|
368
|
+
appendWithinTransaction(payload: Uint8Array, receiptId?: string): {
|
|
369
|
+
readonly sequence: number;
|
|
370
|
+
readonly eventId: string;
|
|
371
|
+
};
|
|
372
|
+
receipt(receiptId: string): {
|
|
373
|
+
readonly sequence: number;
|
|
374
|
+
readonly eventId: string;
|
|
375
|
+
readonly payloadHash: string;
|
|
376
|
+
} | null;
|
|
377
|
+
oldestSequence(): number | null;
|
|
378
|
+
latestSequence(): number;
|
|
379
|
+
prunedThrough(): number;
|
|
380
|
+
list(fromSequence: number, limit: number): Promise<readonly {
|
|
381
|
+
readonly sequence: number;
|
|
382
|
+
readonly eventId: string;
|
|
383
|
+
readonly payload: Uint8Array;
|
|
384
|
+
}[]>;
|
|
385
|
+
checkpoint(consumerId: string): number;
|
|
386
|
+
ack(consumerId: string, sequence: number): {
|
|
387
|
+
readonly acked: number;
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
/** Host factory: one namespace-isolated log per provider plugin + topic. */
|
|
391
|
+
export declare function createReliableEventLogFactory(namespaceStore: (plugin: string) => CommunicationNamespaceStore | null): PluginReliableEventLogFactory;
|