@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,234 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* P4 host-owned command journal: a real SQLite-backed `RpcCommandExecutor`.
|
|
3
|
+
*
|
|
4
|
+
* This leaf is the ONLY durable deduplication/transaction path behind the RPC kernel's command
|
|
5
|
+
* dispatch. It owns no wire security policy: the host admission callback already chose the
|
|
6
|
+
* endpoint, the `context.caller` it passes is taken as a parent-authorized logical partition,
|
|
7
|
+
* and this module never authenticates a wire caller.
|
|
8
|
+
*
|
|
9
|
+
* What it actually guarantees:
|
|
10
|
+
* - A stable journal key derived from the caller identity and the operation id. The key never
|
|
11
|
+
* contains the runtime generation, so deduplication survives a restart; it does contain caller
|
|
12
|
+
* subject/scope, so two callers cannot reuse one operation.
|
|
13
|
+
* - A canonical payload fingerprint (object keys sorted, array order preserved) over the
|
|
14
|
+
* operation id, contract major, method, caller, and input. A repeat with a changed id, payload,
|
|
15
|
+
* or contract major is refused as a conflict instead of silently reusing or overwriting.
|
|
16
|
+
* - Durable `pending | committed | unknown | rejected | error` entries, each carrying the kernel
|
|
17
|
+
* grant's source owner identity (process/instance/catalog/generation) so a trusted host can
|
|
18
|
+
* prove the exact old actor is terminal. Every terminal writer re-reads the exact entry inside
|
|
19
|
+
* the SAME SQL transaction, keeps an existing terminal entry immutable, makes a duplicate
|
|
20
|
+
* confirmation with the same fingerprint idempotent, refuses a contradictory one, and never
|
|
21
|
+
* returns a stale (expired) result. A `pending` entry that is not locally in flight stays
|
|
22
|
+
* `pending`; it becomes `unknown` only through explicit host recovery evidence that exactly
|
|
23
|
+
* matches the saved source owner and epoch.
|
|
24
|
+
* - A per-namespace policy binding stored as one prepaid P3 record in the same namespace (no
|
|
25
|
+
* second bookkeeping table), so a namespace's quota/private-state/contract-major/method are
|
|
26
|
+
* registered atomically on first admit, must match forever after, and a failed admit cannot
|
|
27
|
+
* create an unbilled permanent row.
|
|
28
|
+
* - A hard quota gate: before any side effect the real cumulative namespace charge (binding +
|
|
29
|
+
* live reservations + records + receipts + tombstones) is compared against the bound quota, and
|
|
30
|
+
* the write is rolled back if it would exceed it.
|
|
31
|
+
* - Entries are padded to a fixed header size so a pending→unknown transition shrinks padding
|
|
32
|
+
* instead of growing the record: recovery never needs new quota and an accepted command can
|
|
33
|
+
* always settle.
|
|
34
|
+
* - Retention is owned by the journal's own monotonic clock. The terminal reservation is always
|
|
35
|
+
* `required` with no expiry; the committed body is removed by `collect` through a bounded expiry
|
|
36
|
+
* index while the permanent receipt (old-id proof) remains.
|
|
37
|
+
*
|
|
38
|
+
* `local-transaction` is honest about SQLite: the runtime's async `executeBusiness` closure can
|
|
39
|
+
* never be wrapped in a synchronous SQLite transaction. A synchronous host atomic planner
|
|
40
|
+
* (`resolveAtomic`) is used instead. One synchronous `Database.transaction(...).immediate()`
|
|
41
|
+
* contains the planner READ, its plan validation, re-reads of the current entry, the reservation
|
|
42
|
+
* and quota gate, the private-state CAS applied with direct SQL (no second command history
|
|
43
|
+
* table), and the terminal journal record — with no `await`. Only the planner's pure-JSON SQL
|
|
44
|
+
* mutations are covered; external IO is not.
|
|
45
|
+
*
|
|
46
|
+
* `external-contract` and `none` commit the pending record + reservation before the single
|
|
47
|
+
* `executeBusiness` call. A lost/invalid response becomes `unknown`, keeps the accepted
|
|
48
|
+
* reservation, and is never retried automatically; only an explicit `reconcile` confirmed by a
|
|
49
|
+
* snapshot host capability commits a result. `external-contract` never guesses exactly-once.
|
|
50
|
+
*
|
|
51
|
+
* The host owns migration DDL; `COMMAND_JOURNAL_SCHEMA_SQL` is exported for that and `setup`
|
|
52
|
+
* exists for tests with a fresh database.
|
|
53
|
+
*/
|
|
54
|
+
import type { Database } from 'bun:sqlite';
|
|
55
|
+
import type { DurableMutation, DurableRecord } from '../plugin-durable-state';
|
|
56
|
+
import { type PluginCommunicationLimits } from './persistence';
|
|
57
|
+
import { type RpcJson } from './wire-contract';
|
|
58
|
+
import type { RpcCaller, RpcCommandExecution, RpcCommandExecutor } from './rpc-runtime';
|
|
59
|
+
/** Retention index for expired committed bodies; only the body row is removed, never the id. */
|
|
60
|
+
export declare const COMMAND_JOURNAL_RETENTION_SCHEMA_SQL = "\nCREATE TABLE IF NOT EXISTS plugin_command_journal_retention (\n namespace TEXT NOT NULL,\n key TEXT NOT NULL,\n expires_at INTEGER NOT NULL,\n PRIMARY KEY (namespace, key)\n) STRICT;\nCREATE INDEX IF NOT EXISTS plugin_command_journal_retention_expiry\n ON plugin_command_journal_retention (namespace, expires_at);\n";
|
|
61
|
+
/** Public DDL for the migration integration. The host must run it; this module does not migrate. */
|
|
62
|
+
export declare const COMMAND_JOURNAL_SCHEMA_SQL = "\nCREATE TABLE IF NOT EXISTS plugin_communication_reservations (\n namespace TEXT NOT NULL, reservation_id TEXT NOT NULL,\n capacity_bytes INTEGER NOT NULL CHECK(capacity_bytes >= 0),\n charged_bytes INTEGER NOT NULL CHECK(charged_bytes >= 0),\n required INTEGER NOT NULL CHECK(required IN (0,1)),\n expires_at INTEGER, created_at INTEGER NOT NULL,\n PRIMARY KEY(namespace, reservation_id)\n) STRICT;\nCREATE TABLE IF NOT EXISTS plugin_communication_records (\n namespace TEXT NOT NULL, key TEXT NOT NULL,\n payload BLOB NOT NULL, metadata TEXT,\n payload_bytes INTEGER NOT NULL CHECK(payload_bytes >= 0),\n metadata_bytes INTEGER NOT NULL CHECK(metadata_bytes >= 0),\n charged_bytes INTEGER NOT NULL CHECK(charged_bytes >= 0),\n required INTEGER NOT NULL CHECK(required IN (0,1)),\n expires_at INTEGER, created_at INTEGER NOT NULL,\n PRIMARY KEY(namespace, key)\n) STRICT;\nCREATE TABLE IF NOT EXISTS plugin_communication_receipts (\n namespace TEXT NOT NULL, reservation_id TEXT NOT NULL, key TEXT NOT NULL,\n capacity_bytes INTEGER NOT NULL CHECK(capacity_bytes >= 0),\n charged_bytes INTEGER NOT NULL CHECK(charged_bytes >= 0),\n fingerprint TEXT NOT NULL,\n required INTEGER NOT NULL CHECK(required IN (0,1)),\n committed_at INTEGER NOT NULL,\n PRIMARY KEY(namespace, reservation_id)\n) STRICT;\nCREATE TABLE IF NOT EXISTS plugin_communication_tombstones (\n namespace TEXT NOT NULL, reservation_id TEXT NOT NULL,\n charged_bytes INTEGER NOT NULL CHECK(charged_bytes >= 0),\n cancelled_at INTEGER NOT NULL,\n PRIMARY KEY(namespace, reservation_id)\n) STRICT;\nCREATE INDEX IF NOT EXISTS idx_plugin_communication_records_expiry\n ON plugin_communication_records(namespace, required, expires_at);\nCREATE INDEX IF NOT EXISTS idx_plugin_communication_reservations_expiry\n ON plugin_communication_reservations(namespace, required, expires_at);\n\n\nCREATE TABLE IF NOT EXISTS plugin_durable_records (\n namespace TEXT NOT NULL, key TEXT NOT NULL, version INTEGER NOT NULL CHECK(version > 0),\n value_json TEXT NOT NULL, PRIMARY KEY(namespace, key)\n) STRICT;\n\n\nCREATE TABLE IF NOT EXISTS plugin_command_journal_retention (\n namespace TEXT NOT NULL,\n key TEXT NOT NULL,\n expires_at INTEGER NOT NULL,\n PRIMARY KEY (namespace, key)\n) STRICT;\nCREATE INDEX IF NOT EXISTS plugin_command_journal_retention_expiry\n ON plugin_command_journal_retention (namespace, expires_at);\n";
|
|
63
|
+
/**
|
|
64
|
+
* Fixed-code journal error. It carries the validated operation id but never a database, SQLite,
|
|
65
|
+
* provider, or planner cause: hosts log the original exception separately. The journal only ever
|
|
66
|
+
* mints its own instances and never propagates a provider-shaped object.
|
|
67
|
+
*/
|
|
68
|
+
export type CommandJournalErrorCode = 'invalid_input' | 'invalid_output' | 'capability_unavailable' | 'overloaded' | 'storage_failure' | 'missing' | 'pending' | 'unknown' | 'expired' | 'rejected' | 'conflict';
|
|
69
|
+
export declare class CommandJournalError extends Error {
|
|
70
|
+
readonly code: CommandJournalErrorCode;
|
|
71
|
+
readonly operationId: string | null;
|
|
72
|
+
readonly name = "CommandJournalError";
|
|
73
|
+
constructor(code: CommandJournalErrorCode, operationId?: string | null);
|
|
74
|
+
}
|
|
75
|
+
/** The kernel grant's source owner identity, excluded from the logical deduplication key. */
|
|
76
|
+
export interface CommandSourceIdentity {
|
|
77
|
+
readonly process: string;
|
|
78
|
+
readonly instance: string;
|
|
79
|
+
readonly catalog: string;
|
|
80
|
+
readonly generation: number;
|
|
81
|
+
}
|
|
82
|
+
/** Trusted parent lifecycle proof that the previous owner of a pending command is terminal. */
|
|
83
|
+
export interface CommandRecoveryEvidence {
|
|
84
|
+
readonly owner: string;
|
|
85
|
+
readonly epoch: number;
|
|
86
|
+
readonly issuedAt: number;
|
|
87
|
+
}
|
|
88
|
+
export interface CommandRecoveryRequest {
|
|
89
|
+
readonly key: string;
|
|
90
|
+
readonly operationId: string;
|
|
91
|
+
readonly caller: RpcCaller;
|
|
92
|
+
readonly fingerprint: string;
|
|
93
|
+
readonly source: CommandSourceIdentity;
|
|
94
|
+
/** Stable logical owner id derived from the saved source (generation excluded). */
|
|
95
|
+
readonly owner: string;
|
|
96
|
+
/** Saved source generation; evidence must match it exactly. */
|
|
97
|
+
readonly epoch: number;
|
|
98
|
+
}
|
|
99
|
+
/** Returns evidence only when the host can prove the saved source owner is terminal; else null. */
|
|
100
|
+
export type CommandRecoveryAuthorizer = (request: CommandRecoveryRequest) => CommandRecoveryEvidence | null | undefined;
|
|
101
|
+
/**
|
|
102
|
+
* The host-facing command identity without the provider callback. `execute` receives the full
|
|
103
|
+
* `RpcCommandExecution` and preserves its `executeBusiness` closure; `reconcile` only needs this
|
|
104
|
+
* identity, so a host may reconstruct it after a restart without holding the provider closure.
|
|
105
|
+
*/
|
|
106
|
+
export type CommandJournalRequest = Omit<RpcCommandExecution<unknown>, 'executeBusiness'>;
|
|
107
|
+
/** Bounded, read-only durable-state view granted to one atomic planner invocation. */
|
|
108
|
+
export interface CommandAtomicReader {
|
|
109
|
+
get(key: string): DurableRecord | null;
|
|
110
|
+
list(): readonly DurableRecord[];
|
|
111
|
+
}
|
|
112
|
+
/** Pure-JSON plan produced by a host atomic planner; applied in one SQLite transaction. */
|
|
113
|
+
export interface CommandAtomicPlan {
|
|
114
|
+
readonly mutations: readonly DurableMutation[];
|
|
115
|
+
readonly result: RpcJson;
|
|
116
|
+
}
|
|
117
|
+
/** Synchronous planner with the validated invocation; no out-of-band input capture is needed. */
|
|
118
|
+
export type CommandAtomicPlanner = (reader: CommandAtomicReader, execution: CommandJournalRequest) => CommandAtomicPlan;
|
|
119
|
+
/** Sync resolver; `null`/`undefined` means the host has not bound an atomic planner. */
|
|
120
|
+
export type CommandAtomicResolver = (execution: CommandJournalRequest) => CommandAtomicPlanner | null | undefined;
|
|
121
|
+
/** Confirmed outcome of an external reconciliation; only `committed` may commit a result. */
|
|
122
|
+
export type CommandExternalReconciliation = {
|
|
123
|
+
readonly status: 'committed';
|
|
124
|
+
readonly result: RpcJson;
|
|
125
|
+
} | {
|
|
126
|
+
readonly status: 'not-executed';
|
|
127
|
+
} | {
|
|
128
|
+
readonly status: 'unknown';
|
|
129
|
+
};
|
|
130
|
+
/** Registered host capability for an external idempotency contract. */
|
|
131
|
+
export interface CommandExternalExecutor {
|
|
132
|
+
reconcile(execution: CommandJournalRequest): CommandExternalReconciliation | Promise<CommandExternalReconciliation>;
|
|
133
|
+
}
|
|
134
|
+
/** `null`/`undefined` means the host does not support this external contract (never guessed). */
|
|
135
|
+
export type CommandExternalResolver = (execution: CommandJournalRequest) => CommandExternalExecutor | null | undefined;
|
|
136
|
+
export interface CommandJournalOptions {
|
|
137
|
+
/** Shared database. The journal constructs its own bound stores so every write shares it. */
|
|
138
|
+
readonly db: Database;
|
|
139
|
+
/** Stable logical service namespace (survives restarts; never includes a runtime generation). */
|
|
140
|
+
readonly namespace: string;
|
|
141
|
+
/** Durable-state namespace declared by the host as the plugin's private local-transaction state. */
|
|
142
|
+
readonly privateStateNamespace: string;
|
|
143
|
+
/**
|
|
144
|
+
* Approved namespace quota. When set it must match the persisted binding and the command's
|
|
145
|
+
* declared quota; when omitted the persisted binding (or, on first admit, the command's declared
|
|
146
|
+
* quota) is authoritative.
|
|
147
|
+
*/
|
|
148
|
+
readonly quotaBytes?: number;
|
|
149
|
+
readonly limits?: PluginCommunicationLimits;
|
|
150
|
+
/** Test-only: create the communication + records + retention schema on this database. */
|
|
151
|
+
readonly setup?: boolean;
|
|
152
|
+
readonly resolveAtomic?: CommandAtomicResolver;
|
|
153
|
+
readonly resolveExternal?: CommandExternalResolver;
|
|
154
|
+
/** Explicit host authorization required before a pending command may be recovered. */
|
|
155
|
+
readonly authorizeRecovery?: CommandRecoveryAuthorizer;
|
|
156
|
+
readonly now?: () => number;
|
|
157
|
+
readonly atomicReadRows?: number;
|
|
158
|
+
readonly atomicReadBytes?: number;
|
|
159
|
+
/** SQL-query budget for the atomic read capability, checked BEFORE each statement. */
|
|
160
|
+
readonly atomicReadQueries?: number;
|
|
161
|
+
readonly maxInFlight?: number;
|
|
162
|
+
}
|
|
163
|
+
export type CommandJournalStatus = 'committed' | 'pending' | 'unknown' | 'expired' | 'rejected' | 'error' | 'conflict' | 'missing';
|
|
164
|
+
export type CommandJournalInspection = {
|
|
165
|
+
readonly status: 'committed';
|
|
166
|
+
readonly result: RpcJson;
|
|
167
|
+
readonly expiresAt: number | null;
|
|
168
|
+
} | {
|
|
169
|
+
readonly status: 'expired';
|
|
170
|
+
readonly expiresAt: number | null;
|
|
171
|
+
} | {
|
|
172
|
+
readonly status: 'pending';
|
|
173
|
+
} | {
|
|
174
|
+
readonly status: 'unknown';
|
|
175
|
+
} | {
|
|
176
|
+
readonly status: 'rejected';
|
|
177
|
+
} | {
|
|
178
|
+
readonly status: 'error';
|
|
179
|
+
} | {
|
|
180
|
+
readonly status: 'conflict';
|
|
181
|
+
} | {
|
|
182
|
+
readonly status: 'missing';
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Real SQLite command journal. The host injects the shared `Database`; the journal builds its own
|
|
186
|
+
* bound stores from it so every write shares one transaction.
|
|
187
|
+
*/
|
|
188
|
+
export declare class CommandJournal implements RpcCommandExecutor<unknown> {
|
|
189
|
+
#private;
|
|
190
|
+
constructor(options: CommandJournalOptions);
|
|
191
|
+
/** The ONLY execution path for commands; invoked once per delivered command by the kernel. */
|
|
192
|
+
execute(execution: RpcCommandExecution<unknown>): Promise<RpcJson>;
|
|
193
|
+
/**
|
|
194
|
+
* Status for a system service, partitioned by caller and operation id; never returns another
|
|
195
|
+
* operation's data. Status resolution itself does not throw, but a durable read failure still
|
|
196
|
+
* throws `storage_failure` — a missing entry is never faked for a broken read.
|
|
197
|
+
*/
|
|
198
|
+
inspect(operationId: string, caller: RpcCaller): CommandJournalInspection;
|
|
199
|
+
/** Returns the committed result DTO, or throws a fixed-code `CommandJournalError`. */
|
|
200
|
+
query(operationId: string, caller: RpcCaller): RpcJson;
|
|
201
|
+
/**
|
|
202
|
+
* Explicit reconciliation for an `unknown` command. Only a `committed` outcome confirmed by a
|
|
203
|
+
* snapshot host capability commits a result. The terminal writer re-reads the entry in the same
|
|
204
|
+
* transaction: an existing terminal entry is immutable, a same-fingerprint duplicate is
|
|
205
|
+
* idempotent, a contradictory confirmation is refused, and an expired existing result is
|
|
206
|
+
* reported as `expired` rather than returned stale.
|
|
207
|
+
*/
|
|
208
|
+
reconcile(execution: CommandJournalRequest): Promise<RpcJson>;
|
|
209
|
+
/**
|
|
210
|
+
* Removes the committed body of every operation whose retention window has passed, in bounded
|
|
211
|
+
* expiry order, while keeping the permanent receipt as the old-id proof. Pending/unknown/
|
|
212
|
+
* rejected entries are never indexed and are never removed.
|
|
213
|
+
*/
|
|
214
|
+
collect(limit?: number): number;
|
|
215
|
+
/**
|
|
216
|
+
* Explicit host recovery: only entries the host authorizer proves belong to the saved terminal
|
|
217
|
+
* source owner are turned into `unknown`. Without an authorizer this is a no-op; a plain restart
|
|
218
|
+
* never steals another object's live command.
|
|
219
|
+
*/
|
|
220
|
+
recoverPending(limit?: number): number;
|
|
221
|
+
/** Storage IPC preflight; does not mutate or advance the recovery cursor. */
|
|
222
|
+
pendingRecoveryRequests(limit?: number): readonly CommandRecoveryRequest[];
|
|
223
|
+
/** Host scan progress; capability-free maintenance keeps this facade between batches. */
|
|
224
|
+
recoveryScanComplete(): boolean;
|
|
225
|
+
/** Reopens only the persisted policy binding; it never retains execution capabilities. */
|
|
226
|
+
static forMaintenance(options: Pick<CommandJournalOptions, 'db' | 'namespace' | 'authorizeRecovery' | 'now' | 'limits'>): CommandJournal;
|
|
227
|
+
/** Exposes the underlying namespace accounting for host observability. */
|
|
228
|
+
status(): {
|
|
229
|
+
readonly usedBytes: number;
|
|
230
|
+
readonly reservedBytes: number;
|
|
231
|
+
readonly recordCount: number;
|
|
232
|
+
readonly namespaceQuotaBytes: number;
|
|
233
|
+
};
|
|
234
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** Logical contracts are independent of the physical host address and generation. */
|
|
2
|
+
export type PluginServiceProcess = 'control' | 'worker' | 'ingress';
|
|
3
|
+
export type PluginServiceKind = 'local' | 'rpc' | 'events' | 'snapshot' | 'stream';
|
|
4
|
+
export type PluginServiceScope = 'global' | 'binding';
|
|
5
|
+
export interface PluginServicePublication {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly version: number;
|
|
8
|
+
readonly process: PluginServiceProcess;
|
|
9
|
+
readonly kind?: PluginServiceKind;
|
|
10
|
+
readonly scope?: 'global';
|
|
11
|
+
}
|
|
12
|
+
export interface PluginServiceConsumption extends PluginServicePublication {
|
|
13
|
+
readonly plugin: string;
|
|
14
|
+
}
|
|
15
|
+
export interface PluginServiceDeclarations {
|
|
16
|
+
readonly provides?: readonly PluginServicePublication[];
|
|
17
|
+
readonly consumes?: readonly PluginServiceConsumption[];
|
|
18
|
+
}
|
|
19
|
+
/** Unpublished extensions are rejected by every Host entry, including trusted embedders. */
|
|
20
|
+
export declare function assertSupportedServiceDeclarations(declarations: PluginServiceDeclarations): void;
|
|
21
|
+
/** Explicit self RPC/snapshot consumption from a different process, without a dependency edge. */
|
|
22
|
+
export declare function isCrossProcessSelfService(plugin: string, consumption: PluginServiceConsumption, declarations: PluginServiceDeclarations): boolean;
|
|
23
|
+
export declare function isCrossProcessSelfSnapshot(plugin: string, consumption: PluginServiceConsumption, declarations: PluginServiceDeclarations): boolean;
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import type { AtomicReadSetResolver } from '../plugin-state/client';
|
|
2
|
+
import type { PluginServiceConsumption, PluginServiceDeclarations, PluginServiceProcess, PluginServicePublication, PluginServiceScope } from './contracts';
|
|
3
|
+
import { RpcServiceRuntime, type RpcAdmissionRequest, type RpcCaller, type RpcDrainResult, type RpcEndpointBinding, type RpcEndpointHandle, type RpcHandlerMap, type RpcInvocationErrorCode, type RpcInvokeRequest, type RpcRuntimeLimits, type RpcRuntimeStatus } from './rpc-runtime';
|
|
4
|
+
import { type CommandAtomicPlanner, type CommandExternalExecutor, type CommandJournal } from './command-journal';
|
|
5
|
+
import type { AsyncCommandJournal } from '../plugin-state/client';
|
|
6
|
+
import { type RpcCallPurpose, type InferRpcData, type RpcCommandPolicy, type RpcMethodDefinition } from './wire-contract';
|
|
7
|
+
export type RpcServiceErrorCode = RpcInvocationErrorCode | 'undeclared' | 'unavailable' | 'ambiguous_placement' | 'invalid_registration';
|
|
8
|
+
/** Fixed-code error. It never carries a provider cause, message, or payload. */
|
|
9
|
+
export declare class RpcServiceError extends Error {
|
|
10
|
+
readonly name = "RpcServiceError";
|
|
11
|
+
readonly code: RpcServiceErrorCode;
|
|
12
|
+
readonly operationId: string | null;
|
|
13
|
+
constructor(code: RpcServiceErrorCode, operationId?: string | null);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Rebuilds a fresh public error from the kernel's fixed code and the validated
|
|
17
|
+
* operation id of THIS call. It never reuses the incoming instance, never reads
|
|
18
|
+
* its operation id, and never reads a cause or message.
|
|
19
|
+
*/
|
|
20
|
+
export declare function toRpcServiceError(error: unknown, operationId: string | null): RpcServiceError;
|
|
21
|
+
export interface RpcCallOptions {
|
|
22
|
+
readonly signal?: AbortSignal;
|
|
23
|
+
readonly timeoutMs?: number;
|
|
24
|
+
readonly operationId?: string;
|
|
25
|
+
}
|
|
26
|
+
export type RpcCommandClientExtras<D extends RpcMethodDefinition> = D extends {
|
|
27
|
+
readonly command: RpcCommandPolicy;
|
|
28
|
+
} ? {
|
|
29
|
+
/** Durable committed result query; runs through the same runtime lease/deadline as execute. */
|
|
30
|
+
queryResult(operationId: string): Promise<InferRpcData<D['output']>>;
|
|
31
|
+
/** Explicit host-authorized reconciliation for an unknown command outcome. */
|
|
32
|
+
reconcile(operationId: string, input: InferRpcData<D['input']>): Promise<InferRpcData<D['output']>>;
|
|
33
|
+
} : Record<never, never>;
|
|
34
|
+
export type RpcMethodClient<D extends RpcMethodDefinition> = ((input: InferRpcData<D['input']>, options?: RpcCallOptions) => Promise<InferRpcData<D['output']>>) & RpcCommandClientExtras<D>;
|
|
35
|
+
/** Public plugin-facing RPC client derived from a literal contract. */
|
|
36
|
+
export type AsyncRpcClient<M extends Record<string, RpcMethodDefinition>> = {
|
|
37
|
+
readonly [K in keyof M]: RpcMethodClient<M[K]>;
|
|
38
|
+
};
|
|
39
|
+
/** Logical placement identity, independent of any physical address or generation. */
|
|
40
|
+
export interface HostRpcServiceDescriptor {
|
|
41
|
+
readonly provider: string;
|
|
42
|
+
readonly service: string;
|
|
43
|
+
readonly major: number;
|
|
44
|
+
readonly kind: 'rpc';
|
|
45
|
+
readonly process: PluginServiceProcess;
|
|
46
|
+
readonly scope: PluginServiceScope;
|
|
47
|
+
}
|
|
48
|
+
/** Physical endpoint identity supplied by the trusted host for one owner instance. */
|
|
49
|
+
export interface HostRpcLifecycleIdentity {
|
|
50
|
+
readonly endpoint: string;
|
|
51
|
+
readonly instance: string;
|
|
52
|
+
readonly generation: number;
|
|
53
|
+
readonly catalog: string;
|
|
54
|
+
/** Trusted callee subject; never derived from plugin input. */
|
|
55
|
+
readonly subject: string;
|
|
56
|
+
}
|
|
57
|
+
/** Canonical owner lifecycle view; the adapter never keeps a second copy. */
|
|
58
|
+
export interface HostRpcLifecycleState {
|
|
59
|
+
readonly ready: boolean;
|
|
60
|
+
readonly retiring: boolean;
|
|
61
|
+
readonly revoked: boolean;
|
|
62
|
+
}
|
|
63
|
+
/** Host-minted invocation frame; the real principal lives in the host callee frame. */
|
|
64
|
+
export interface HostRpcInvocationContext {
|
|
65
|
+
readonly purpose: RpcCallPurpose;
|
|
66
|
+
/** Opaque host correlation token; the leaf only trusts the required resolver. */
|
|
67
|
+
readonly token: object;
|
|
68
|
+
readonly signal?: AbortSignal;
|
|
69
|
+
readonly deadlineAt?: number;
|
|
70
|
+
}
|
|
71
|
+
export interface HostRpcLeaseRequest {
|
|
72
|
+
readonly role: 'caller' | 'callee';
|
|
73
|
+
readonly plugin: string;
|
|
74
|
+
readonly scope: string;
|
|
75
|
+
readonly state: HostRpcLifecycleState;
|
|
76
|
+
readonly purpose: RpcCallPurpose;
|
|
77
|
+
readonly operationId: string | null;
|
|
78
|
+
/** Logical target provider. */
|
|
79
|
+
readonly provider: string;
|
|
80
|
+
}
|
|
81
|
+
export interface HostRpcLeaseGrant {
|
|
82
|
+
readonly release: () => void;
|
|
83
|
+
/** Host-verified existing request lease; only honored for request/attempt. */
|
|
84
|
+
readonly allowRetired?: boolean;
|
|
85
|
+
}
|
|
86
|
+
export type HostRpcAcquireLease = (request: HostRpcLeaseRequest) => HostRpcLeaseGrant;
|
|
87
|
+
export interface HostRpcMethodCapability {
|
|
88
|
+
/** Synchronous private-state CAS planner for a `local-transaction` command. */
|
|
89
|
+
readonly atomic?: CommandAtomicPlanner;
|
|
90
|
+
/** Explicit bounded read set for the production storage Worker. */
|
|
91
|
+
readonly atomicReadSet?: AtomicReadSetResolver;
|
|
92
|
+
/** Reconcile capability for an `external-contract` command. */
|
|
93
|
+
readonly external?: CommandExternalExecutor;
|
|
94
|
+
}
|
|
95
|
+
export type HostRpcCommandCapabilities<M extends Record<string, RpcMethodDefinition>> = {
|
|
96
|
+
readonly [K in keyof M]?: HostRpcMethodCapability;
|
|
97
|
+
};
|
|
98
|
+
/** Everything the canonical host exposes for one owner to use RPC services. */
|
|
99
|
+
export interface HostRpcOwnerInput {
|
|
100
|
+
readonly token: object;
|
|
101
|
+
readonly plugin: string;
|
|
102
|
+
/** Canonical owner scope: `'global'` or a trusted binding scope key. */
|
|
103
|
+
readonly scope: string;
|
|
104
|
+
readonly declarations: PluginServiceDeclarations;
|
|
105
|
+
readonly dependencies: Readonly<Record<string, string>>;
|
|
106
|
+
readonly lifecycle: HostRpcLifecycleIdentity;
|
|
107
|
+
/** Canonical lifecycle source of truth; the adapter copies nothing. */
|
|
108
|
+
readonly getLifecycleState: () => HostRpcLifecycleState;
|
|
109
|
+
readonly acquireLease: HostRpcAcquireLease;
|
|
110
|
+
readonly registerPublication?: (publication: PluginServicePublication) => void;
|
|
111
|
+
readonly registerConsumption?: (consumption: PluginServiceConsumption, localProviderToken?: object) => void;
|
|
112
|
+
readonly onDispose?: (cleanup: () => void) => void;
|
|
113
|
+
readonly canCall?: (target: {
|
|
114
|
+
readonly provider: string;
|
|
115
|
+
readonly service: string;
|
|
116
|
+
readonly major: number;
|
|
117
|
+
readonly method: string;
|
|
118
|
+
}) => boolean;
|
|
119
|
+
/** Required host invocation-frame resolver; null for plain plugin background calls. */
|
|
120
|
+
readonly resolveInvocationContext: () => HostRpcInvocationContext | null;
|
|
121
|
+
}
|
|
122
|
+
/** Trusted peer broker input. This capability is never part of PluginServices. */
|
|
123
|
+
export interface HostRpcRemoteCallerInput extends HostRpcOwnerInput {
|
|
124
|
+
readonly process: PluginServiceProcess;
|
|
125
|
+
/** Must verify the current authenticated peer frame and logical caller authority. */
|
|
126
|
+
readonly authorizeIncoming: (request: RpcAdmissionRequest, endpoint: NonNullable<ReturnType<RpcServiceRuntime['endpointInfo']>>) => boolean;
|
|
127
|
+
}
|
|
128
|
+
export interface HostRpcRemoteCallerHandle {
|
|
129
|
+
invokeTracked(request: Omit<RpcInvokeRequest, 'caller' | 'callerToken'>): ReturnType<RpcServiceRuntime['invokeTracked']>;
|
|
130
|
+
dispose(): Promise<RpcDrainResult>;
|
|
131
|
+
}
|
|
132
|
+
/** Exact placement delegated to the host. `null` means "use the explicit local channel". */
|
|
133
|
+
export type HostRpcPlacementResolution = {
|
|
134
|
+
readonly kind: 'endpoint';
|
|
135
|
+
readonly endpoint: RpcEndpointHandle;
|
|
136
|
+
} | {
|
|
137
|
+
readonly kind: 'ambiguous';
|
|
138
|
+
} | null | undefined;
|
|
139
|
+
export interface HostRpcPlacementRequest {
|
|
140
|
+
readonly provider: string;
|
|
141
|
+
readonly service: string;
|
|
142
|
+
readonly major: number;
|
|
143
|
+
readonly method: string;
|
|
144
|
+
readonly scope: PluginServiceScope;
|
|
145
|
+
readonly bindingScope?: string;
|
|
146
|
+
readonly caller: RpcCaller;
|
|
147
|
+
readonly purpose?: RpcCallPurpose;
|
|
148
|
+
}
|
|
149
|
+
export type HostRpcPlacementResolver = (request: HostRpcPlacementRequest) => HostRpcPlacementResolution;
|
|
150
|
+
export interface HostRpcJournalRequest {
|
|
151
|
+
readonly provider: string;
|
|
152
|
+
readonly service: string;
|
|
153
|
+
readonly major: number;
|
|
154
|
+
readonly method: string;
|
|
155
|
+
readonly scope: PluginServiceScope;
|
|
156
|
+
/** Binding scope key when `scope` is `binding`; keeps two bindings apart. */
|
|
157
|
+
readonly bindingScope?: string;
|
|
158
|
+
readonly policy: RpcCommandPolicy;
|
|
159
|
+
readonly atomic?: CommandAtomicPlanner;
|
|
160
|
+
/** Explicit bounded read set for the production storage Worker. */
|
|
161
|
+
readonly atomicReadSet?: AtomicReadSetResolver;
|
|
162
|
+
readonly external?: CommandExternalExecutor;
|
|
163
|
+
}
|
|
164
|
+
/** Host-owned durable journal factory; `null` refuses commands for this key. */
|
|
165
|
+
export type HostRpcJournalResolver = (request: HostRpcJournalRequest) => AsyncCommandJournal | CommandJournal | null;
|
|
166
|
+
/** Trusted opaque callee context resolver. */
|
|
167
|
+
export type HostRpcCalleeResolver = (request: RpcAdmissionRequest, publication: HostRpcServiceDescriptor) => unknown;
|
|
168
|
+
/**
|
|
169
|
+
* Host-provided frame for one admitted native RPC handler. It lets the SAME
|
|
170
|
+
* `PluginServiceHost` invocation store the real purpose/deadline/cancellation
|
|
171
|
+
* for the duration of the handler, bound to the exact published owner, so a
|
|
172
|
+
* channel operation started inside a native handler is authorized by the real
|
|
173
|
+
* frame (never downgraded to `background`, never given a forged purpose).
|
|
174
|
+
*/
|
|
175
|
+
export interface HostRpcHandlerFrame {
|
|
176
|
+
readonly purpose: RpcCallPurpose;
|
|
177
|
+
readonly deadlineAt?: number;
|
|
178
|
+
readonly signal?: AbortSignal;
|
|
179
|
+
/** Exact published owner the call targets; `null` for a remote (peer) route. */
|
|
180
|
+
readonly ownerToken: object | null;
|
|
181
|
+
readonly operationId: string | null;
|
|
182
|
+
}
|
|
183
|
+
export interface HostRpcJournalCleanupFailure {
|
|
184
|
+
readonly operationId: string;
|
|
185
|
+
readonly code: string;
|
|
186
|
+
}
|
|
187
|
+
export interface HostRpcAdapterOptions {
|
|
188
|
+
/** Resource cleanup reports separately and never replaces a business outcome. */
|
|
189
|
+
readonly onJournalCleanupFailure?: (failure: HostRpcJournalCleanupFailure) => void;
|
|
190
|
+
readonly process: PluginServiceProcess;
|
|
191
|
+
readonly limits?: RpcRuntimeLimits;
|
|
192
|
+
readonly hostLifetime?: AbortSignal;
|
|
193
|
+
readonly maxCallDepth?: number;
|
|
194
|
+
/** Required host placement authority. */
|
|
195
|
+
readonly resolvePlacement: HostRpcPlacementResolver;
|
|
196
|
+
/** Required host journal authority. */
|
|
197
|
+
readonly resolveJournal: HostRpcJournalResolver;
|
|
198
|
+
/** Required trusted opaque callee frame authority. */
|
|
199
|
+
readonly resolveCallee: HostRpcCalleeResolver;
|
|
200
|
+
/**
|
|
201
|
+
* Host callback that enters the exact published owner's trusted invocation
|
|
202
|
+
* frame for one native handler call. The canonical `PluginServiceHost` wires
|
|
203
|
+
* it to its OWN invocation store, so a native RPC handler shares one
|
|
204
|
+
* purpose/deadline/cancel resolver with local dispatch and channel work.
|
|
205
|
+
*/
|
|
206
|
+
readonly enterHostHandlerFrame?: (frame: HostRpcHandlerFrame, run: () => unknown) => unknown;
|
|
207
|
+
}
|
|
208
|
+
export interface HostRpcPublication {
|
|
209
|
+
readonly descriptor: HostRpcServiceDescriptor;
|
|
210
|
+
}
|
|
211
|
+
/** Host-only readonly directory entry for one real registered publication. */
|
|
212
|
+
export interface HostRpcPublicationView {
|
|
213
|
+
readonly provider: string;
|
|
214
|
+
readonly service: string;
|
|
215
|
+
readonly major: number;
|
|
216
|
+
readonly scope: PluginServiceScope;
|
|
217
|
+
readonly scopeKey: string;
|
|
218
|
+
readonly ready: boolean;
|
|
219
|
+
readonly lifecycle: HostRpcLifecycleIdentity;
|
|
220
|
+
/** The kernel-selected binding of the exact endpoint handle; never re-derived. */
|
|
221
|
+
readonly binding: RpcEndpointBinding;
|
|
222
|
+
}
|
|
223
|
+
export interface HostRpcOwnerHandle {
|
|
224
|
+
readonly owner: HostRpcOwnerInput;
|
|
225
|
+
publish<const M extends Record<string, RpcMethodDefinition>>(contract: {
|
|
226
|
+
readonly id: string;
|
|
227
|
+
readonly version: number;
|
|
228
|
+
readonly methods: M;
|
|
229
|
+
}, handlers: RpcHandlerMap<M, unknown>, capabilities?: HostRpcCommandCapabilities<M>): HostRpcPublication;
|
|
230
|
+
consume<const M extends Record<string, RpcMethodDefinition>>(provider: string, contract: {
|
|
231
|
+
readonly id: string;
|
|
232
|
+
readonly version: number;
|
|
233
|
+
readonly methods: M;
|
|
234
|
+
}): AsyncRpcClient<M>;
|
|
235
|
+
/** Canonical host hook: ready maps to kernel `markReady`. */
|
|
236
|
+
markReady(): void;
|
|
237
|
+
/** Canonical host hook: retirement maps to kernel `retire`. */
|
|
238
|
+
retire(): void;
|
|
239
|
+
/**
|
|
240
|
+
* Canonical host hook: disposal maps to kernel `revoke` + bounded `drain`.
|
|
241
|
+
* Returns the REAL drain verdict; `drained: false` is reported, never hidden.
|
|
242
|
+
*/
|
|
243
|
+
dispose(): Promise<RpcDrainResult>;
|
|
244
|
+
}
|
|
245
|
+
/** Reads the trusted opaque callee frame the host resolver produced for an admitted call. */
|
|
246
|
+
export declare function readHostRpcCalleeFrame(callee: unknown): unknown;
|
|
247
|
+
export declare class HostRpcAdapter {
|
|
248
|
+
#private;
|
|
249
|
+
readonly runtime: RpcServiceRuntime<unknown>;
|
|
250
|
+
constructor(options: HostRpcAdapterOptions);
|
|
251
|
+
status(): RpcRuntimeStatus;
|
|
252
|
+
/**
|
|
253
|
+
* Host-only readonly directory of this adapter's *real* registered
|
|
254
|
+
* publications: the kernel-selected binding (endpoint/process/instance/
|
|
255
|
+
* generation/catalog/scope/subject) of the exact endpoint handle, its owner
|
|
256
|
+
* lifecycle identity and its current readiness. It is a plain snapshot for
|
|
257
|
+
* host decision making (peer routing/validation); it grants nothing, exposes
|
|
258
|
+
* no SDK surface and is never exposed through `PluginServices`.
|
|
259
|
+
*/
|
|
260
|
+
publicationView(): readonly HostRpcPublicationView[];
|
|
261
|
+
/** Closes the process runtime; the parent awaits this in the canonical shutdown. */
|
|
262
|
+
dispose(options?: {
|
|
263
|
+
readonly timeoutMs?: number;
|
|
264
|
+
}): Promise<import("./rpc-runtime").RpcDisposeResult>;
|
|
265
|
+
createOwner(input: HostRpcOwnerInput): HostRpcOwnerHandle;
|
|
266
|
+
/** Imports an authenticated concrete caller, not a plugin instance or SDK facade. */
|
|
267
|
+
createRemoteCaller(input: HostRpcRemoteCallerInput): HostRpcRemoteCallerHandle;
|
|
268
|
+
}
|