@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,61 @@
|
|
|
1
|
+
import type { LoadedPluginManifest, PluginManifest } from './plugin.types';
|
|
2
|
+
export { CORE_HOST_VERSION } from './core-version';
|
|
3
|
+
export declare const CURRENT_PLUGIN_SCHEMA_VERSION = 3;
|
|
4
|
+
export declare const VALID_PLUGIN_UI_EXTENSION_MODES: readonly ["none", "native-static", "sandbox-iframe"];
|
|
5
|
+
export declare const VALID_PLUGIN_ARTIFACT_KINDS: readonly ["runtime-plugin"];
|
|
6
|
+
export declare const SUPPORTED_PLUGIN_CAPABILITIES: readonly ["hooks", "api", "nativeWidgetsStatic", "sandboxUiExtension", "dynamicRuntimeLoad", "controlPlane", "requestLogging"];
|
|
7
|
+
export declare const PLUGIN_MANIFEST_UNSUPPORTED_CAPABILITY_ERROR = "manifest negotiation error: unsupported capability";
|
|
8
|
+
export declare const PLUGIN_MANIFEST_SCHEMA_MISMATCH_ERROR = "manifest negotiation error: schemaVersion is not compatible with host schema";
|
|
9
|
+
export declare const PLUGIN_MANIFEST_ENGINE_MISMATCH_ERROR = "manifest negotiation error: engines.bungee is not compatible with host version";
|
|
10
|
+
export declare const PLUGIN_MANIFEST_MISSING_ARTIFACT_ERROR = "artifact validation error: built server entry not found";
|
|
11
|
+
export type PluginUiExtensionMode = typeof VALID_PLUGIN_UI_EXTENSION_MODES[number];
|
|
12
|
+
export type PluginArtifactKind = typeof VALID_PLUGIN_ARTIFACT_KINDS[number];
|
|
13
|
+
export type PluginCapability = typeof SUPPORTED_PLUGIN_CAPABILITIES[number];
|
|
14
|
+
export interface PluginManifestNegotiationOptions {
|
|
15
|
+
hostVersion?: string;
|
|
16
|
+
hostCapabilities?: readonly string[];
|
|
17
|
+
supportedSchemaVersions?: ReadonlyArray<number | string>;
|
|
18
|
+
}
|
|
19
|
+
export type PluginManifestValidationFailureCode = 'invalid-manifest' | 'schema-mismatch' | 'unsupported-capability' | 'engine-mismatch' | 'missing-artifact';
|
|
20
|
+
export interface PluginManifestContractSnapshot {
|
|
21
|
+
manifestContract: 'vnext' | 'unknown';
|
|
22
|
+
schemaVersion?: number | string;
|
|
23
|
+
artifactKind?: string;
|
|
24
|
+
main?: string;
|
|
25
|
+
capabilities: string[];
|
|
26
|
+
uiExtensionMode?: string;
|
|
27
|
+
engines?: {
|
|
28
|
+
bungee?: string;
|
|
29
|
+
node?: string;
|
|
30
|
+
};
|
|
31
|
+
validationFailureCode?: PluginManifestValidationFailureCode;
|
|
32
|
+
}
|
|
33
|
+
export declare class PluginManifestValidationError extends Error {
|
|
34
|
+
readonly details: PluginManifestContractSnapshot;
|
|
35
|
+
constructor(message: string, details: PluginManifestContractSnapshot);
|
|
36
|
+
}
|
|
37
|
+
export interface PluginArtifactManifest extends PluginManifest {
|
|
38
|
+
schemaVersion: number | string;
|
|
39
|
+
artifactKind: PluginArtifactKind;
|
|
40
|
+
main: string;
|
|
41
|
+
capabilities: PluginCapability[];
|
|
42
|
+
uiExtensionMode: PluginUiExtensionMode;
|
|
43
|
+
manifestContract: 'vnext';
|
|
44
|
+
engines: {
|
|
45
|
+
bungee: string;
|
|
46
|
+
node?: string;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export interface LoadedPluginArtifactManifest extends LoadedPluginManifest {
|
|
50
|
+
schemaVersion: number | string;
|
|
51
|
+
artifactKind: PluginArtifactKind;
|
|
52
|
+
main: string;
|
|
53
|
+
capabilities: PluginCapability[];
|
|
54
|
+
uiExtensionMode: PluginUiExtensionMode;
|
|
55
|
+
uiAssetsPath?: string;
|
|
56
|
+
manifestContract: 'vnext';
|
|
57
|
+
engines: {
|
|
58
|
+
bungee: string;
|
|
59
|
+
node?: string;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Context Manager
|
|
3
|
+
*
|
|
4
|
+
* 管理插件的全局上下文,确保每个插件只有一个context实例
|
|
5
|
+
* 解决原有架构中临时实例导致的storage丢失问题
|
|
6
|
+
*/
|
|
7
|
+
import type { PluginInitContext } from './plugin.types';
|
|
8
|
+
import type { PluginStorageFactory } from './plugin-control/host';
|
|
9
|
+
/**
|
|
10
|
+
* 扩展的Plugin初始化上下文
|
|
11
|
+
* 添加更多元数据和能力
|
|
12
|
+
*/
|
|
13
|
+
export interface ExtendedPluginInitContext extends PluginInitContext {
|
|
14
|
+
/**
|
|
15
|
+
* 插件目录的绝对路径
|
|
16
|
+
*/
|
|
17
|
+
extensionPath: string;
|
|
18
|
+
/**
|
|
19
|
+
* 全局状态管理
|
|
20
|
+
* 跨会话持久化的状态
|
|
21
|
+
*/
|
|
22
|
+
globalState: StateManager;
|
|
23
|
+
/**
|
|
24
|
+
* 工作区状态管理
|
|
25
|
+
* 仅在当前会话有效的状态
|
|
26
|
+
*/
|
|
27
|
+
workspaceState: StateManager;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 状态管理器接口
|
|
31
|
+
* 提供简单的get/set API,底层使用Storage实现
|
|
32
|
+
*/
|
|
33
|
+
export interface StateManager {
|
|
34
|
+
get<T = any>(key: string, defaultValue?: T): Promise<T | undefined>;
|
|
35
|
+
update<T = any>(key: string, value: T): Promise<void>;
|
|
36
|
+
keys(): Promise<readonly string[]>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Plugin Context Manager
|
|
40
|
+
* 单例模式,全局唯一
|
|
41
|
+
*/
|
|
42
|
+
export declare class PluginContextManager {
|
|
43
|
+
private readonly storageFactory?;
|
|
44
|
+
private static instance;
|
|
45
|
+
/**
|
|
46
|
+
* 插件名称 -> 插件上下文
|
|
47
|
+
* 每个插件只有一个context实例
|
|
48
|
+
*/
|
|
49
|
+
private contexts;
|
|
50
|
+
private revocations;
|
|
51
|
+
private constructor();
|
|
52
|
+
static getInstance(storageFactory?: PluginStorageFactory): PluginContextManager;
|
|
53
|
+
/**
|
|
54
|
+
* 为插件创建或获取context
|
|
55
|
+
*
|
|
56
|
+
* @param pluginName - 插件名称
|
|
57
|
+
* @param pluginPath - 插件文件路径
|
|
58
|
+
* @param config - 插件配置
|
|
59
|
+
* @returns 插件上下文
|
|
60
|
+
*/
|
|
61
|
+
getOrCreateContext(pluginName: string, pluginPath: string, config: any): ExtendedPluginInitContext;
|
|
62
|
+
/**
|
|
63
|
+
* 获取已存在的context
|
|
64
|
+
*
|
|
65
|
+
* @param pluginName - 插件名称
|
|
66
|
+
* @returns 插件上下文,如果不存在则返回undefined
|
|
67
|
+
*/
|
|
68
|
+
getContext(pluginName: string): ExtendedPluginInitContext | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* 删除插件的context
|
|
71
|
+
* 在插件卸载时调用
|
|
72
|
+
*
|
|
73
|
+
* @param pluginName - 插件名称
|
|
74
|
+
*/
|
|
75
|
+
destroyContext(pluginName: string): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* 清理所有context
|
|
78
|
+
* 在服务器关闭时调用
|
|
79
|
+
*/
|
|
80
|
+
destroyAll(): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* 获取统计信息
|
|
83
|
+
*/
|
|
84
|
+
getStats(): {
|
|
85
|
+
totalContexts: number;
|
|
86
|
+
plugins: string[];
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
export declare function initializePluginContextManager(storageFactory?: PluginStorageFactory): void;
|
|
90
|
+
export declare function isPluginContextManagerInitialized(): boolean;
|
|
91
|
+
export declare function getPluginContextManager(): PluginContextManager;
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/** Public contracts shared by a control-plane plugin and its host. */
|
|
2
|
+
import type { PluginConfigOptions } from '@jeffusion/bungee-types';
|
|
3
|
+
import type { PluginStorage } from '../plugin.types';
|
|
4
|
+
import type { PluginDurableState } from '../plugin-durable-state';
|
|
5
|
+
import type { PluginServices } from '../plugin-services';
|
|
6
|
+
import type { ManagementProvider, ManagementSubject, PluginPolicyPublication, DataPrincipal } from '../plugin-extensions';
|
|
7
|
+
export interface SecretValue {
|
|
8
|
+
readonly version: number;
|
|
9
|
+
readonly value: string;
|
|
10
|
+
}
|
|
11
|
+
export interface SecretStore {
|
|
12
|
+
/** The host-injected namespace; plugins cannot select another namespace. */
|
|
13
|
+
readonly namespace: string;
|
|
14
|
+
get(key: string): Promise<SecretValue | null>;
|
|
15
|
+
compareAndSet(key: string, expectedVersion: number | null, value: string): Promise<number>;
|
|
16
|
+
delete(key: string, expectedVersion: number): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
export interface BoundControlClient {
|
|
19
|
+
call<TResult = unknown>(method: string, payload: unknown, signal: AbortSignal): Promise<TResult>;
|
|
20
|
+
}
|
|
21
|
+
export interface CredentialLease {
|
|
22
|
+
readonly version: number;
|
|
23
|
+
readonly expiresAt: number;
|
|
24
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
25
|
+
}
|
|
26
|
+
export interface UpstreamAccount {
|
|
27
|
+
readonly id: string;
|
|
28
|
+
readonly label: string;
|
|
29
|
+
readonly available: boolean;
|
|
30
|
+
readonly reason?: string;
|
|
31
|
+
}
|
|
32
|
+
export type UpstreamAccountListItem = UpstreamAccount;
|
|
33
|
+
export interface UpstreamDraft {
|
|
34
|
+
readonly target: string;
|
|
35
|
+
readonly bindingOptions: PluginConfigOptions;
|
|
36
|
+
}
|
|
37
|
+
export interface CredentialPolicy {
|
|
38
|
+
readonly allowedOrigins: readonly string[];
|
|
39
|
+
readonly allowedRequests: readonly CredentialRequestPolicy[];
|
|
40
|
+
readonly allowedHeaderNames: readonly string[];
|
|
41
|
+
}
|
|
42
|
+
export interface CredentialOutboundHeaderProfile {
|
|
43
|
+
readonly passthrough: readonly string[];
|
|
44
|
+
readonly set: Readonly<Record<string, string>>;
|
|
45
|
+
}
|
|
46
|
+
export interface CredentialRequestPolicy {
|
|
47
|
+
readonly pathname: string;
|
|
48
|
+
readonly methods: readonly string[];
|
|
49
|
+
readonly outboundHeaders?: CredentialOutboundHeaderProfile;
|
|
50
|
+
}
|
|
51
|
+
/** Bounded, redacted diagnostic fields; never attach an upstream body or stack. */
|
|
52
|
+
export interface RawResponseError {
|
|
53
|
+
readonly source: 'upstream' | 'transport';
|
|
54
|
+
readonly message: string;
|
|
55
|
+
readonly code?: string;
|
|
56
|
+
readonly type?: string;
|
|
57
|
+
}
|
|
58
|
+
export type RawResponseCompletion = {
|
|
59
|
+
readonly status: 'completed';
|
|
60
|
+
} | {
|
|
61
|
+
readonly status: 'failed';
|
|
62
|
+
readonly code: string;
|
|
63
|
+
readonly error?: RawResponseError;
|
|
64
|
+
} | {
|
|
65
|
+
readonly status: 'incomplete';
|
|
66
|
+
readonly code: string;
|
|
67
|
+
} | {
|
|
68
|
+
readonly status: 'cancelled';
|
|
69
|
+
};
|
|
70
|
+
export interface RawResponseResult {
|
|
71
|
+
readonly response: Response;
|
|
72
|
+
readonly completion: Promise<RawResponseCompletion>;
|
|
73
|
+
}
|
|
74
|
+
export interface BoundAttemptContext {
|
|
75
|
+
readonly attemptId: string;
|
|
76
|
+
readonly clientStreaming: boolean;
|
|
77
|
+
readonly signal: AbortSignal;
|
|
78
|
+
readonly boundClient: BoundControlClient;
|
|
79
|
+
}
|
|
80
|
+
export interface ControlHostContext {
|
|
81
|
+
readonly signal: AbortSignal;
|
|
82
|
+
/** Present during online preparation. Effects registered here run only after durable activation. */
|
|
83
|
+
readonly afterActivation?: (effect: () => void | Promise<void>) => void;
|
|
84
|
+
readonly managementOrigin?: string;
|
|
85
|
+
readonly trustedSource?: (request: Request) => string;
|
|
86
|
+
readonly secretStore: SecretStore;
|
|
87
|
+
readonly storage: PluginStorage;
|
|
88
|
+
/**
|
|
89
|
+
* Same-process local service facade captured once per control instance. It is
|
|
90
|
+
* optional only for legacy typed fixtures; the host always supplies it.
|
|
91
|
+
*/
|
|
92
|
+
readonly services?: PluginServices;
|
|
93
|
+
readonly durableState?: PluginDurableState;
|
|
94
|
+
/** Host-only projected worker request and durable settlement barrier. */
|
|
95
|
+
readonly resolveRpcCallee?: (callee: unknown) => unknown;
|
|
96
|
+
readonly runAdmissionOperation?: (method: string, payload: unknown, callee: unknown, task: (target: import('../plugin-extensions').AdmissionTarget) => unknown | Promise<unknown>) => Promise<unknown>;
|
|
97
|
+
readonly validateRouteReferences?: (routeIds: readonly string[]) => boolean | Promise<boolean>;
|
|
98
|
+
readonly readResourceExtensions?: (keyId: string) => Promise<unknown>;
|
|
99
|
+
readonly validateKeyPolicyReferences?: (keyId: string, policy: unknown) => boolean | Promise<boolean>;
|
|
100
|
+
readonly publishPolicy?: (policy: PluginPolicyPublication) => Promise<void>;
|
|
101
|
+
}
|
|
102
|
+
export interface ControlApiHandlerContext extends ControlHostContext {
|
|
103
|
+
readonly request: Request;
|
|
104
|
+
readonly requestSignal: AbortSignal;
|
|
105
|
+
readonly subject?: ManagementSubject;
|
|
106
|
+
}
|
|
107
|
+
export interface ControlBindingIdentity {
|
|
108
|
+
readonly plugin: string;
|
|
109
|
+
readonly contributionId: string;
|
|
110
|
+
readonly bindingId: string;
|
|
111
|
+
/** Host-resolved options from the bound endpoint; never sourced from RPC payload. */
|
|
112
|
+
readonly bindingOptions: PluginConfigOptions;
|
|
113
|
+
}
|
|
114
|
+
export interface ControlRpcContext extends ControlHostContext {
|
|
115
|
+
readonly attempt: BoundAttemptContext;
|
|
116
|
+
readonly binding: ControlBindingIdentity;
|
|
117
|
+
}
|
|
118
|
+
export interface ControlApiDeclaration {
|
|
119
|
+
readonly path: string;
|
|
120
|
+
readonly methods: readonly string[];
|
|
121
|
+
readonly handler: string;
|
|
122
|
+
readonly invoke: (context: ControlApiHandlerContext) => Response | Promise<Response>;
|
|
123
|
+
}
|
|
124
|
+
export interface ControlRpcDeclaration {
|
|
125
|
+
readonly name: string;
|
|
126
|
+
readonly handler: string;
|
|
127
|
+
readonly invoke: (payload: unknown, context: ControlRpcContext) => unknown | Promise<unknown>;
|
|
128
|
+
}
|
|
129
|
+
export interface PluginControl {
|
|
130
|
+
readonly api: readonly ControlApiDeclaration[];
|
|
131
|
+
readonly rpc: readonly ControlRpcDeclaration[];
|
|
132
|
+
readonly management?: ManagementProvider;
|
|
133
|
+
readonly policy?: () => PluginPolicyPublication;
|
|
134
|
+
start(): void | Promise<void>;
|
|
135
|
+
dispose(): void | Promise<void>;
|
|
136
|
+
}
|
|
137
|
+
export type ControlApiTable = readonly ControlApiDeclaration[];
|
|
138
|
+
export type ControlRpcTable = readonly ControlRpcDeclaration[];
|
|
139
|
+
export interface OfflineRecoveryContext {
|
|
140
|
+
readonly durableState: PluginDurableState;
|
|
141
|
+
readonly now?: () => number;
|
|
142
|
+
}
|
|
143
|
+
export interface OfflineRecoveryPrompt {
|
|
144
|
+
readonly name: string;
|
|
145
|
+
readonly label: string;
|
|
146
|
+
readonly secret: boolean;
|
|
147
|
+
}
|
|
148
|
+
export interface PluginRecoveryAction {
|
|
149
|
+
readonly prompts: readonly OfflineRecoveryPrompt[];
|
|
150
|
+
run(input: Record<string, string>, context: OfflineRecoveryContext): unknown | Promise<unknown>;
|
|
151
|
+
}
|
|
152
|
+
/** Identity recovery is terminal-only; structured stdin/files support plugin-state only. */
|
|
153
|
+
export type OfflineRecoveryCapability = {
|
|
154
|
+
readonly kind: 'identity';
|
|
155
|
+
readonly actions: Readonly<Record<string, PluginRecoveryAction>>;
|
|
156
|
+
} | {
|
|
157
|
+
readonly kind: 'plugin-state';
|
|
158
|
+
recover(input: unknown, context: OfflineRecoveryContext): unknown | Promise<unknown>;
|
|
159
|
+
};
|
|
160
|
+
export interface ControlPlugin {
|
|
161
|
+
/** Module loading, creation, and start prepare runtime services without external effects. */
|
|
162
|
+
readonly supportsOnlinePreparation?: true;
|
|
163
|
+
readManagementSetup?(state: Pick<PluginDurableState, 'get' | 'list'>): Promise<{
|
|
164
|
+
initialized: boolean;
|
|
165
|
+
}>;
|
|
166
|
+
readonly offlineRecovery?: OfflineRecoveryCapability;
|
|
167
|
+
createControl(context: ControlHostContext): PluginControl;
|
|
168
|
+
/** Read persisted protections even while runtime/control is unavailable. */
|
|
169
|
+
readAdmissionRequirements?(state: Pick<PluginDurableState, 'get' | 'list'>): Promise<readonly string[]>;
|
|
170
|
+
verifyDataPrincipal?(principal: DataPrincipal, state: Pick<PluginDurableState, 'get' | 'list'>): Promise<boolean>;
|
|
171
|
+
readResourceCollection?(resource: string, state: Pick<PluginDurableState, 'get' | 'list'>): readonly unknown[] | Promise<readonly unknown[]>;
|
|
172
|
+
/** Read a resource DTO without starting a disabled plugin or obtaining write capabilities. */
|
|
173
|
+
readResource?(resource: string, id: string, state: Pick<PluginDurableState, 'get' | 'list'>): {
|
|
174
|
+
value: unknown;
|
|
175
|
+
usage?: unknown;
|
|
176
|
+
} | Promise<{
|
|
177
|
+
value: unknown;
|
|
178
|
+
usage?: unknown;
|
|
179
|
+
}>;
|
|
180
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { PluginDurableState } from '../plugin-durable-state';
|
|
2
|
+
import type { ManagementSubject, PluginPolicyPublication, DataPrincipal } from '../plugin-extensions';
|
|
3
|
+
import type { PluginManifestRecord } from '../plugin-manifest-catalog/types';
|
|
4
|
+
import type { PluginStorage } from '../plugin.types';
|
|
5
|
+
import { PluginDependencyGraph } from '../plugin-dependencies';
|
|
6
|
+
import { PluginServiceHost, type PluginServices } from '../plugin-services';
|
|
7
|
+
import type { SecretKeyMaterial } from './secret-store';
|
|
8
|
+
import type { BoundAttemptContext, ControlBindingIdentity, ControlPlugin, PluginControl, SecretStore } from './contracts';
|
|
9
|
+
export type SecretStoreFactory = {
|
|
10
|
+
create(namespace: string): SecretStore;
|
|
11
|
+
revoke(store: SecretStore): void;
|
|
12
|
+
clear(store: SecretStore): void | Promise<void>;
|
|
13
|
+
};
|
|
14
|
+
export type PluginStorageFactory = {
|
|
15
|
+
create(pluginName: string): PluginStorage;
|
|
16
|
+
revoke(storage: PluginStorage): void;
|
|
17
|
+
};
|
|
18
|
+
export type ControlHostErrorCode = 'not_declared' | 'inactive' | 'restart_required' | 'start_failed' | 'method_not_allowed' | 'key_unavailable' | 'deadline' | 'invalid_binding' | 'disposed' | 'overloaded' | 'timeout';
|
|
19
|
+
export declare class PluginControlHostError extends Error {
|
|
20
|
+
readonly code: ControlHostErrorCode;
|
|
21
|
+
readonly name = "PluginControlHostError";
|
|
22
|
+
constructor(code: ControlHostErrorCode, message: string, cause?: unknown);
|
|
23
|
+
}
|
|
24
|
+
export type PluginControlStatus = 'inactive' | 'starting' | 'ready' | 'degraded' | 'stopping';
|
|
25
|
+
export type PluginControlHandle = {
|
|
26
|
+
readonly pluginName: string;
|
|
27
|
+
readonly artifactIdentity: string;
|
|
28
|
+
readonly control: PluginControl;
|
|
29
|
+
readonly secretStore: SecretStore;
|
|
30
|
+
readonly storage: PluginStorage;
|
|
31
|
+
readonly durableState?: PluginDurableState;
|
|
32
|
+
/** Captured same-process service facade reused by createControl, API, and bound RPC. */
|
|
33
|
+
readonly services: PluginServices;
|
|
34
|
+
readonly lifetime: AbortController;
|
|
35
|
+
status: PluginControlStatus;
|
|
36
|
+
admission: boolean;
|
|
37
|
+
};
|
|
38
|
+
export type PluginControlHostOptions = {
|
|
39
|
+
readonly records: readonly PluginManifestRecord[];
|
|
40
|
+
/** Catalog-validated dependency graph; defaults to one built from the supplied records. */
|
|
41
|
+
readonly dependencies?: PluginDependencyGraph;
|
|
42
|
+
/** Shared control-process service host; defaults to a local one. */
|
|
43
|
+
readonly services?: PluginServiceHost;
|
|
44
|
+
readonly managementOrigin?: string;
|
|
45
|
+
readonly trustedSource?: (request: Request) => string;
|
|
46
|
+
readonly secretStores: SecretStoreFactory;
|
|
47
|
+
readonly storage: Pick<PluginStorageFactory, 'create'> & Partial<Pick<PluginStorageFactory, 'revoke'>>;
|
|
48
|
+
readonly durableState?: (name: string) => PluginDurableState;
|
|
49
|
+
readonly isPreparing?: (name: string) => boolean;
|
|
50
|
+
readonly allowPreparedWrites?: (name: string) => boolean;
|
|
51
|
+
readonly runActivationEffect?: (name: string, effect: () => Promise<void>) => Promise<void>;
|
|
52
|
+
readonly validateRouteReferences?: (name: string, routeIds: readonly string[]) => boolean | Promise<boolean>;
|
|
53
|
+
readonly readResourceExtensions?: (keyId: string) => Promise<unknown>;
|
|
54
|
+
readonly validateKeyPolicyReferences?: (name: string, keyId: string, policy: unknown) => boolean | Promise<boolean>;
|
|
55
|
+
readonly publishPolicy?: (name: string, policy: PluginPolicyPublication) => Promise<void>;
|
|
56
|
+
readonly runAdmissionOperation?: (name: string, method: string, payload: unknown, callee: unknown, task: (target: import('../plugin-extensions').AdmissionTarget) => unknown | Promise<unknown>) => Promise<unknown>;
|
|
57
|
+
readonly startTimeoutMs?: number;
|
|
58
|
+
readonly loadControl?: (record: PluginManifestRecord) => Promise<ControlPlugin>;
|
|
59
|
+
};
|
|
60
|
+
export type PluginControlApi = {
|
|
61
|
+
handle(request: Request, subject?: ManagementSubject): Promise<Response | null>;
|
|
62
|
+
};
|
|
63
|
+
export type BoundControlInvocation = {
|
|
64
|
+
readonly pluginName: string;
|
|
65
|
+
readonly binding: ControlBindingIdentity;
|
|
66
|
+
readonly attempt: BoundAttemptContext;
|
|
67
|
+
};
|
|
68
|
+
export declare function withTimeout<T>(promise: Promise<T>, timeoutMs: number, code: ControlHostErrorCode): Promise<T>;
|
|
69
|
+
export declare function parsePluginSecretsKey(value: string | undefined): SecretKeyMaterial | undefined;
|
|
70
|
+
export declare function createPluginControlHost(options: PluginControlHostOptions): PluginControlHost;
|
|
71
|
+
export interface PluginControlHost {
|
|
72
|
+
readManagementSetup(name: string): Promise<{
|
|
73
|
+
initialized: boolean;
|
|
74
|
+
}>;
|
|
75
|
+
readResourceCollection(name: string, resource: string): Promise<readonly unknown[]>;
|
|
76
|
+
readAdmissionRequirements(name: string): Promise<readonly string[]>;
|
|
77
|
+
verifyDataPrincipal(name: string, principal: DataPrincipal): Promise<boolean>;
|
|
78
|
+
readResource(name: string, resource: string, id: string): Promise<{
|
|
79
|
+
value: unknown;
|
|
80
|
+
usage?: unknown;
|
|
81
|
+
}>;
|
|
82
|
+
activate(name: string): Promise<PluginControlHandle>;
|
|
83
|
+
deactivate(name: string): Promise<void>;
|
|
84
|
+
reconcile(activeNames: readonly string[]): Promise<void>;
|
|
85
|
+
invokeRpc(name: string, method: string, payload: unknown, invocation: BoundControlInvocation): Promise<unknown>;
|
|
86
|
+
readonly api: PluginControlApi;
|
|
87
|
+
get(name: string): PluginControlHandle | null;
|
|
88
|
+
status(name: string): PluginControlStatus;
|
|
89
|
+
dispose(): Promise<void>;
|
|
90
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { BoundAttemptContext, BoundControlClient, ControlApiDeclaration, ControlApiHandlerContext, ControlBindingIdentity, ControlHostContext, ControlPlugin, ControlRpcContext, ControlRpcDeclaration, PluginControl, SecretStore, } from './contracts';
|
|
2
|
+
export { createPluginControlHost, parsePluginSecretsKey, PluginControlHostError, type BoundControlInvocation, type PluginControlApi, type PluginControlHandle, type PluginControlHost, type PluginControlHostOptions, type PluginControlStatus, type PluginStorageFactory, type SecretStoreFactory, } from './host';
|
|
3
|
+
export { PluginControlInvocationProjector, createPluginControlInvocationProjector, type PluginControlMasterBridgeCatalog, type PluginControlMasterBridgeFactory, type PluginControlMasterBridgeIngress, type PluginControlMasterBridgeOptions, type PluginControlMasterBridgeRepository, } from './master-invocation-projector';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { Sha256Digest } from '@jeffusion/bungee-types';
|
|
2
|
+
import type { MasterIngressController } from '../ingress/master-controller';
|
|
3
|
+
import type { RepositorySnapshot } from '../config-storage/repository-types';
|
|
4
|
+
import type { PluginManifestRecord } from '../plugin-manifest-catalog/types';
|
|
5
|
+
import type { PluginControlHost, BoundControlInvocation } from './host';
|
|
6
|
+
import type { SupervisedWorkerAdmissionIdentity, SupervisedWorkerControlSession, SupervisedConfigWorkerFactory } from '../master-runtime/supervised-worker-factory';
|
|
7
|
+
export type PluginControlMasterBridgeIngress = Pick<MasterIngressController, 'trustedActiveAdmissionIfFresh' | 'currentControllerAuthority'>;
|
|
8
|
+
export type PluginControlMasterBridgeFactory = Pick<SupervisedConfigWorkerFactory, 'lookupExactControlSession'>;
|
|
9
|
+
export type PluginControlMasterBridgeRepository = {
|
|
10
|
+
readonly getSnapshot: () => RepositorySnapshot;
|
|
11
|
+
/** Returns the immutable configuration snapshot actually served by this worker. */
|
|
12
|
+
readonly getServingSnapshot: (worker: SupervisedWorkerControlSession['process']) => RepositorySnapshot | null;
|
|
13
|
+
};
|
|
14
|
+
export type PluginControlMasterBridgeCatalog = {
|
|
15
|
+
readonly hash: Sha256Digest;
|
|
16
|
+
readonly records: () => readonly PluginManifestRecord[];
|
|
17
|
+
};
|
|
18
|
+
export type PluginControlMasterBridgeOptions = {
|
|
19
|
+
readonly ingress: PluginControlMasterBridgeIngress;
|
|
20
|
+
readonly factory: PluginControlMasterBridgeFactory;
|
|
21
|
+
readonly repository: PluginControlMasterBridgeRepository;
|
|
22
|
+
readonly pluginControlHost: Pick<PluginControlHost, 'status'>;
|
|
23
|
+
readonly catalog: PluginControlMasterBridgeCatalog;
|
|
24
|
+
};
|
|
25
|
+
type InvocationWorker = Pick<SupervisedWorkerAdmissionIdentity, 'master_generation' | 'worker_instance_id' | 'worker_slot' | 'boot_nonce'>;
|
|
26
|
+
export type PluginControlInvocationIdentity = {
|
|
27
|
+
readonly worker: InvocationWorker;
|
|
28
|
+
readonly body: {
|
|
29
|
+
readonly revision: number;
|
|
30
|
+
readonly endpoint_id: string;
|
|
31
|
+
readonly attempt_id: string;
|
|
32
|
+
readonly method: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export declare class PluginControlInvocationProjector {
|
|
36
|
+
private readonly options;
|
|
37
|
+
private readonly authorization;
|
|
38
|
+
private readonly active;
|
|
39
|
+
private readonly sessions;
|
|
40
|
+
private activeMarker;
|
|
41
|
+
private disposed;
|
|
42
|
+
constructor(options: PluginControlMasterBridgeOptions);
|
|
43
|
+
syncActiveAdmission(): void;
|
|
44
|
+
dispose(): void;
|
|
45
|
+
private resolveSession;
|
|
46
|
+
private isCurrent;
|
|
47
|
+
/** The authenticated peer broker projects the original serving/binding evidence. */
|
|
48
|
+
projectInvocation(call: PluginControlInvocationIdentity, signal: AbortSignal): Promise<BoundControlInvocation>;
|
|
49
|
+
private activeKeyFor;
|
|
50
|
+
}
|
|
51
|
+
export declare function createPluginControlInvocationProjector(options: PluginControlMasterBridgeOptions): PluginControlInvocationProjector;
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { AdmissionTarget } from '../plugin-extensions';
|
|
2
|
+
type RequestServiceManifest = {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly dependencies?: Readonly<Record<string, unknown>>;
|
|
5
|
+
readonly services?: {
|
|
6
|
+
readonly consumes?: readonly {
|
|
7
|
+
readonly plugin: string;
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly version: number;
|
|
10
|
+
readonly process: string;
|
|
11
|
+
readonly kind?: string;
|
|
12
|
+
}[];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
/** The caller's trusted route frame may reach only its declared control RPC.
|
|
16
|
+
* Peer/kernel authorization still enforces the exact endpoint binding and lease.
|
|
17
|
+
*/
|
|
18
|
+
export declare function requestServiceDeclared(caller: RequestServiceManifest | undefined, target: {
|
|
19
|
+
provider: string;
|
|
20
|
+
service: string;
|
|
21
|
+
major: number;
|
|
22
|
+
}): boolean;
|
|
23
|
+
/** Anonymous request RPCs use only protections confirmed by ingress publication. */
|
|
24
|
+
export declare class RequestRouteProtections {
|
|
25
|
+
private publication;
|
|
26
|
+
private protectedRoutes;
|
|
27
|
+
beginPublication(): number;
|
|
28
|
+
confirmPublication(publication: number, requirements: readonly {
|
|
29
|
+
readonly routeIds: readonly string[];
|
|
30
|
+
}[]): void;
|
|
31
|
+
allowsAnonymous(target: Pick<AdmissionTarget, 'principal' | 'routeId' | 'entryRouteId'>): boolean;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type SecretKeyMaterial = Readonly<{
|
|
2
|
+
readonly keyId: string;
|
|
3
|
+
readonly key: Uint8Array;
|
|
4
|
+
}>;
|
|
5
|
+
export declare class SecretCryptoError extends Error {
|
|
6
|
+
readonly code: 'invalid_key' | 'invalid_envelope' | 'key_mismatch' | 'authentication_failed';
|
|
7
|
+
readonly name = "SecretCryptoError";
|
|
8
|
+
constructor(code: 'invalid_key' | 'invalid_envelope' | 'key_mismatch' | 'authentication_failed');
|
|
9
|
+
}
|
|
10
|
+
export declare function encodeSecretAad(namespace: string, key: string, version: number, namespaceEpoch: number): Uint8Array;
|
|
11
|
+
export declare function validateKeyMaterial(material: SecretKeyMaterial): Uint8Array;
|
|
12
|
+
export declare function encryptSecret(value: string, namespace: string, key: string, version: number, namespaceEpoch: number, material: SecretKeyMaterial): Uint8Array;
|
|
13
|
+
export declare function decryptSecret(envelope: Uint8Array, namespace: string, key: string, version: number, namespaceEpoch: number, material: SecretKeyMaterial): string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Database } from 'bun:sqlite';
|
|
2
|
+
import type { SecretStore } from './contracts';
|
|
3
|
+
import { type SecretKeyMaterial } from './secret-crypto';
|
|
4
|
+
export type { SecretKeyMaterial } from './secret-crypto';
|
|
5
|
+
export type SecretStoreErrorCode = 'invalid_handle' | 'invalid_input' | 'key_unavailable' | 'invalid_key' | 'handle_revoked' | 'namespace_invalidated' | 'version_conflict' | 'version_exhausted' | 'secret_corrupt' | 'storage_failure';
|
|
6
|
+
export declare class SecretStoreError extends Error {
|
|
7
|
+
readonly code: SecretStoreErrorCode;
|
|
8
|
+
readonly name = "SecretStoreError";
|
|
9
|
+
constructor(code: SecretStoreErrorCode);
|
|
10
|
+
}
|
|
11
|
+
export declare function createSecretStore(db: Database, namespace: string, material: SecretKeyMaterial | null | undefined): SecretStore;
|
|
12
|
+
/** Revokes only this host handle; it does not delete the namespace. */
|
|
13
|
+
export declare function revokeSecretStore(store: SecretStore): void;
|
|
14
|
+
/** Atomically deletes a namespace and advances its epoch, invalidating all old handles. */
|
|
15
|
+
export declare function clearSecretStore(store: SecretStore): void;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { PluginRuntimeScope } from '@jeffusion/bungee-types';
|
|
2
|
+
import type { PluginServiceDeclarations } from './plugin-services';
|
|
3
|
+
export interface PluginDependencyManifest {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly version: string;
|
|
6
|
+
readonly dependencies?: Readonly<Record<string, string>>;
|
|
7
|
+
readonly services?: PluginServiceDeclarations;
|
|
8
|
+
readonly runtimeScope?: PluginRuntimeScope;
|
|
9
|
+
readonly capabilities?: readonly string[];
|
|
10
|
+
readonly control?: unknown;
|
|
11
|
+
readonly ingress?: unknown;
|
|
12
|
+
}
|
|
13
|
+
/** Immutable, validated required-dependency graph. Providers precede consumers. */
|
|
14
|
+
export declare class PluginDependencyGraph {
|
|
15
|
+
#private;
|
|
16
|
+
constructor(manifests: Iterable<PluginDependencyManifest>);
|
|
17
|
+
declarations(): ReadonlyMap<string, Readonly<Record<string, string>>>;
|
|
18
|
+
serviceDeclarations(): ReadonlyMap<string, PluginServiceDeclarations>;
|
|
19
|
+
hasCapability(name: string, capability: string): boolean;
|
|
20
|
+
/** Activation dependencies and same-process startup requirements are different graphs. */
|
|
21
|
+
localDependenciesOf(name: string, process: 'control' | 'worker' | 'ingress'): readonly string[];
|
|
22
|
+
/** Sort only actual instances; remote snapshot consumption creates no local edge. */
|
|
23
|
+
initializationOrder(names: Iterable<string>, process: 'control' | 'worker' | 'ingress'): readonly string[];
|
|
24
|
+
dependenciesOf(name: string): readonly string[];
|
|
25
|
+
closure(names: Iterable<string>): readonly string[];
|
|
26
|
+
/** Paths only from activated consumers; installed but inactive consumers never block disable. */
|
|
27
|
+
dependentPaths(provider: string, activated: Iterable<string>): readonly (readonly string[])[];
|
|
28
|
+
assertClosed(activated: Iterable<string>): void;
|
|
29
|
+
}
|
|
30
|
+
export declare function updatePluginActivations(graph: PluginDependencyGraph, activated: Iterable<string>, name: string, enable: boolean): readonly string[];
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { Database } from 'bun:sqlite';
|
|
2
|
+
/** Plugin state initialization owns this DDL; constructors never modify schema. */
|
|
3
|
+
export declare const PLUGIN_DURABLE_STATE_SCHEMA_SQL = "\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";
|
|
4
|
+
export type DurableJson = null | boolean | number | string | DurableJson[] | {
|
|
5
|
+
[key: string]: DurableJson;
|
|
6
|
+
};
|
|
7
|
+
export interface DurableRecord {
|
|
8
|
+
readonly key: string;
|
|
9
|
+
readonly version: number;
|
|
10
|
+
readonly value: DurableJson;
|
|
11
|
+
}
|
|
12
|
+
export interface DurableMutation {
|
|
13
|
+
key: string;
|
|
14
|
+
expectedVersion: number;
|
|
15
|
+
value: DurableJson;
|
|
16
|
+
}
|
|
17
|
+
/** Pure data outbox request; callbacks and command identifiers are never accepted. */
|
|
18
|
+
export interface DurableTransactionOptions {
|
|
19
|
+
readonly outbox: {
|
|
20
|
+
readonly topic: string;
|
|
21
|
+
readonly major: number;
|
|
22
|
+
readonly maxEvents: number;
|
|
23
|
+
readonly payload: Uint8Array;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export interface PluginDurableState {
|
|
27
|
+
get(key: string): Promise<DurableRecord | null>;
|
|
28
|
+
list(): Promise<readonly DurableRecord[]>;
|
|
29
|
+
transact(mutations: readonly DurableMutation[], options?: DurableTransactionOptions): Promise<readonly DurableRecord[]>;
|
|
30
|
+
}
|
|
31
|
+
/** Synchronous leaf, usable only by storage workers and offline tooling. */
|
|
32
|
+
export interface StorageDurableState {
|
|
33
|
+
get(key: string): DurableRecord | null;
|
|
34
|
+
list(): readonly DurableRecord[];
|
|
35
|
+
transact(mutations: readonly DurableMutation[], extend?: () => void): readonly DurableRecord[];
|
|
36
|
+
}
|
|
37
|
+
export declare class DurableStateConflictError extends Error {
|
|
38
|
+
readonly code = "durable_state_conflict";
|
|
39
|
+
constructor();
|
|
40
|
+
}
|
|
41
|
+
/** Plugins load as independent bundles, so the host's error has a different constructor. */
|
|
42
|
+
export declare function isDurableStateConflictError(error: unknown): error is DurableStateConflictError;
|
|
43
|
+
/** Validate data before IPC structured cloning can erase prototypes or evaluate getters. */
|
|
44
|
+
export declare function validateDurableJson(value: unknown): void;
|
|
45
|
+
/** Host-only factory. Inject only the returned namespace capability into trusted plugins.
|
|
46
|
+
* Consumers validate their own record schema. expectedVersion=0 requires absence.
|
|
47
|
+
* Null values are retained records, so versions never reset.
|
|
48
|
+
*/
|
|
49
|
+
export declare class PluginDurableStateStore {
|
|
50
|
+
private readonly db;
|
|
51
|
+
constructor(db: Database);
|
|
52
|
+
/**
|
|
53
|
+
* Host-only: the shared database this store's records live in, so a host-owned
|
|
54
|
+
* durable journal can run its own atomic planner/reader against exactly the
|
|
55
|
+
* same `plugin_durable_records` rows the plugin sees. Never exposed through
|
|
56
|
+
* `PluginServices` and never handed to a plugin.
|
|
57
|
+
*/
|
|
58
|
+
get database(): Database;
|
|
59
|
+
/** Async SDK shape for offline tools and leaf fixtures; production uses PluginStateClient. */
|
|
60
|
+
forNamespace(namespace: string): PluginDurableState;
|
|
61
|
+
forStorageNamespace(namespace: string): StorageDurableState;
|
|
62
|
+
}
|