@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,645 @@
|
|
|
1
|
+
import type { PluginBodyRequirements, PluginBodyRequirementContext } from './plugin.types';
|
|
2
|
+
import type { WorkerAdmissionPlugin } from './data-admission/worker';
|
|
3
|
+
import type { PluginDependencyGraph } from './plugin-dependencies';
|
|
4
|
+
import { PluginServiceHost } from './plugin-services';
|
|
5
|
+
import type { PluginHooks, PluginInitContext } from './hooks';
|
|
6
|
+
import type { Endpoint, PluginConfig, Service, ServiceReference } from '@jeffusion/bungee-types';
|
|
7
|
+
import type { PluginMetadata, PluginConfigField, PluginTranslations } from './plugin.types';
|
|
8
|
+
import type { PluginRuntimeStateSnapshot } from './plugin-runtime-state-machine';
|
|
9
|
+
/**
|
|
10
|
+
* A plugin instance was created (or partially created) and its own cleanup did
|
|
11
|
+
* not complete. It is never a retryable initialization failure: retrying could
|
|
12
|
+
* create a fresh instance and hide that the previous one stayed unreleased.
|
|
13
|
+
*/
|
|
14
|
+
export declare class PluginInstanceCleanupError extends Error {
|
|
15
|
+
readonly initError: unknown;
|
|
16
|
+
readonly cleanupErrors: readonly unknown[];
|
|
17
|
+
constructor(initError: unknown, cleanupErrors: readonly unknown[]);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 插件作用域
|
|
21
|
+
*/
|
|
22
|
+
export type PluginScope = {
|
|
23
|
+
type: 'global';
|
|
24
|
+
} | {
|
|
25
|
+
type: 'route';
|
|
26
|
+
routeId: string;
|
|
27
|
+
} | {
|
|
28
|
+
type: 'service';
|
|
29
|
+
routeId: string;
|
|
30
|
+
serviceName: string;
|
|
31
|
+
} | {
|
|
32
|
+
type: 'upstream';
|
|
33
|
+
routeId: string;
|
|
34
|
+
upstreamId: string;
|
|
35
|
+
};
|
|
36
|
+
export interface AttemptObservationOwner {
|
|
37
|
+
readonly pluginName: string;
|
|
38
|
+
readonly scopeKey: string;
|
|
39
|
+
readonly hooks: PluginHooks['onAttemptObservation'];
|
|
40
|
+
readonly observe?: PluginBodyRequirements['observe'];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* 类型守卫:检查是否为全局作用域
|
|
44
|
+
*/
|
|
45
|
+
export declare function isGlobalScope(scope: PluginScope): scope is {
|
|
46
|
+
type: 'global';
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* 类型守卫:检查是否为路由作用域
|
|
50
|
+
*/
|
|
51
|
+
export declare function isRouteScope(scope: PluginScope): scope is {
|
|
52
|
+
type: 'route';
|
|
53
|
+
routeId: string;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* 类型守卫:检查是否为上游作用域
|
|
57
|
+
*/
|
|
58
|
+
export declare function isUpstreamScope(scope: PluginScope): scope is {
|
|
59
|
+
type: 'upstream';
|
|
60
|
+
routeId: string;
|
|
61
|
+
upstreamId: string;
|
|
62
|
+
};
|
|
63
|
+
export declare function isServiceScope(scope: PluginScope): scope is {
|
|
64
|
+
type: 'service';
|
|
65
|
+
routeId: string;
|
|
66
|
+
serviceName: string;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* 获取作用域的唯一标识字符串
|
|
70
|
+
*/
|
|
71
|
+
export declare function getScopeKey(scope: PluginScope): string;
|
|
72
|
+
/**
|
|
73
|
+
* 插件处理器接口
|
|
74
|
+
* 由 PluginClass.createHandler() 创建,长生命周期
|
|
75
|
+
*/
|
|
76
|
+
export interface PluginHandler extends WorkerAdmissionPlugin {
|
|
77
|
+
bodyRequirements(ctx: PluginBodyRequirementContext): PluginBodyRequirements;
|
|
78
|
+
/** 插件名称 */
|
|
79
|
+
readonly pluginName: string;
|
|
80
|
+
/** 此处理器的配置 */
|
|
81
|
+
readonly config: Record<string, any>;
|
|
82
|
+
/** 执行优先级(可选) */
|
|
83
|
+
readonly priority?: number;
|
|
84
|
+
/**
|
|
85
|
+
* 注册 Hooks 回调
|
|
86
|
+
* 在创建时调用一次,将回调注册到 hooks 系统
|
|
87
|
+
*/
|
|
88
|
+
register(hooks: PluginHooks): void;
|
|
89
|
+
/**
|
|
90
|
+
* 销毁处理器(可选)
|
|
91
|
+
* 释放资源,如数据库连接、定时器等
|
|
92
|
+
*/
|
|
93
|
+
destroy?(): Promise<void>;
|
|
94
|
+
}
|
|
95
|
+
/** Empty scopes have no demands; initialized plugins must declare them explicitly. */
|
|
96
|
+
export declare function collectPluginBodyRequirements(phases: Array<PrecompiledHooks | null | undefined>, ctx: PluginBodyRequirementContext): PluginBodyRequirements;
|
|
97
|
+
/**
|
|
98
|
+
* 插件类接口(工厂模式)
|
|
99
|
+
* 插件类是无状态的,通过 createHandler 创建配置实例
|
|
100
|
+
*/
|
|
101
|
+
export interface PluginClass {
|
|
102
|
+
readonly admissionRpcContract?: import('./plugin-services/wire-contract').RpcServiceContract;
|
|
103
|
+
readonly controlRpcContract?: import('./plugin-services/wire-contract').RpcServiceContract;
|
|
104
|
+
/** 插件唯一标识符 */
|
|
105
|
+
readonly name: string;
|
|
106
|
+
/** 插件版本 */
|
|
107
|
+
readonly version: string;
|
|
108
|
+
/** 插件元数据(可选) */
|
|
109
|
+
readonly metadata?: PluginMetadata;
|
|
110
|
+
/** 配置 Schema(可选) */
|
|
111
|
+
readonly configSchema?: PluginConfigField[];
|
|
112
|
+
/** 翻译内容(可选) */
|
|
113
|
+
readonly translations?: PluginTranslations;
|
|
114
|
+
/**
|
|
115
|
+
* 根据配置创建处理器
|
|
116
|
+
* 每个 (scope + config) 组合调用一次
|
|
117
|
+
*
|
|
118
|
+
* @param config 插件配置
|
|
119
|
+
* @param initContext 初始化上下文(包含 storage, logger 等)
|
|
120
|
+
* @returns 处理器实例
|
|
121
|
+
*/
|
|
122
|
+
createHandler(config: Record<string, any>, initContext: PluginInitContext): PluginHandler | Promise<PluginHandler>;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* 预编译的 Hooks 集合
|
|
126
|
+
* 应用启动时创建,请求时直接使用(零创建开销)
|
|
127
|
+
*/
|
|
128
|
+
export interface PrecompiledHooks {
|
|
129
|
+
/** 关联的处理器列表 */
|
|
130
|
+
readonly handlers: PluginHandler[];
|
|
131
|
+
/** 预编译的 hooks(所有回调已注册) */
|
|
132
|
+
readonly hooks: PluginHooks;
|
|
133
|
+
/** 是否有流式处理回调 */
|
|
134
|
+
readonly hasStreamCallbacks: boolean;
|
|
135
|
+
/** 是否有响应处理回调 */
|
|
136
|
+
readonly hasResponseCallbacks: boolean;
|
|
137
|
+
/** 是否有严格原始响应回调 */
|
|
138
|
+
readonly hasRawResponseCallbacks?: boolean;
|
|
139
|
+
/** 是否有请求拦截回调 */
|
|
140
|
+
readonly hasInterceptCallbacks: boolean;
|
|
141
|
+
/** 元数据(调试用) */
|
|
142
|
+
readonly metadata: {
|
|
143
|
+
createdAt: number;
|
|
144
|
+
pluginCount: number;
|
|
145
|
+
pluginNames: string[];
|
|
146
|
+
scope: string;
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
export interface InboundChain {
|
|
150
|
+
onResponse: (res: Response, ctx: any) => Promise<Response>;
|
|
151
|
+
onRawResponse?: (result: import('./plugin-control/contracts').RawResponseResult, ctx: any) => Promise<import('./plugin-control/contracts').RawResponseResult>;
|
|
152
|
+
onStreamChunk: (chunk: any, ctx: any) => Promise<any[]>;
|
|
153
|
+
onFlushStream: (chunks: any[], ctx: any) => Promise<any[]>;
|
|
154
|
+
onError: (ctx: any) => Promise<void>;
|
|
155
|
+
}
|
|
156
|
+
export interface PhaseAwareHooks {
|
|
157
|
+
dispatchAdapter?: PrecompiledHooks;
|
|
158
|
+
routePhase: PrecompiledHooks;
|
|
159
|
+
servicePhase: PrecompiledHooks | null;
|
|
160
|
+
servicePhases?: PrecompiledHooks[];
|
|
161
|
+
upstreamPhase: PrecompiledHooks;
|
|
162
|
+
inbound: InboundChain;
|
|
163
|
+
globalPrecompiled: PrecompiledHooks | null;
|
|
164
|
+
routePrecompiled: PrecompiledHooks | null;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* 作用域插件实例
|
|
168
|
+
* 存储处理器和其元数据
|
|
169
|
+
*/
|
|
170
|
+
interface ScopedPluginInstance {
|
|
171
|
+
/** 作用域 */
|
|
172
|
+
scope: PluginScope;
|
|
173
|
+
/** 处理器实例 */
|
|
174
|
+
handler: PluginHandler;
|
|
175
|
+
/** 执行优先级(数字越小优先级越高) */
|
|
176
|
+
priority: number;
|
|
177
|
+
/** 插件配置(用于调试) */
|
|
178
|
+
config: PluginConfig;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* 作用域插件注册表
|
|
182
|
+
*
|
|
183
|
+
* 管理所有插件实例的生命周期,支持三级作用域:
|
|
184
|
+
* - Global: 所有请求都会执行
|
|
185
|
+
* - Route: 匹配特定路由的请求执行
|
|
186
|
+
* - Upstream: 匹配特定上游的请求执行
|
|
187
|
+
*
|
|
188
|
+
* 性能优化:
|
|
189
|
+
* - 预编译 Hooks:启动时创建,请求时 O(1) 查找
|
|
190
|
+
* - 组合缓存:route+upstream 组合的 Hooks 被缓存
|
|
191
|
+
* - 无 acquire/release:长生命周期实例,无请求级开销
|
|
192
|
+
*/
|
|
193
|
+
export declare class ScopedPluginRegistry {
|
|
194
|
+
/**
|
|
195
|
+
* Canonical worker-process service host. A runtime that has peer
|
|
196
|
+
* communications injects its configured host so worker plugins reach the
|
|
197
|
+
* same canonical owner/lifecycle/lease registry as every other consumer.
|
|
198
|
+
*/
|
|
199
|
+
readonly serviceHost: PluginServiceHost;
|
|
200
|
+
private readonly rpcContexts;
|
|
201
|
+
private readonly requestLeases;
|
|
202
|
+
private readonly dispatchInvocations;
|
|
203
|
+
/** Host request entry: async credential work reuses the original owner lease. */
|
|
204
|
+
runWithRequestLeases<T>(leases: ReadonlyMap<string, () => void>, run: () => T): T;
|
|
205
|
+
getBoundControlOwners(routeId: string, upstreamId: string): ReadonlyArray<{
|
|
206
|
+
pluginName: string;
|
|
207
|
+
scopeKey: string;
|
|
208
|
+
}>;
|
|
209
|
+
/** Execute async admission work under the original retained request lease. */
|
|
210
|
+
invokeAdmissionRpc(plugin: string, method: string, payload: unknown, target: import('./plugin-extensions').AdmissionTarget, lease: () => void): Promise<unknown>;
|
|
211
|
+
/** Binding caller identity remains separate from the global control provider. */
|
|
212
|
+
invokeBoundControl(binding: import('./plugin-control/contracts').ControlBindingIdentity, attempt: import('./config-worker/runtime-dependencies').BoundControlAttemptIdentity, method: string, payload: unknown, signal: AbortSignal): Promise<unknown>;
|
|
213
|
+
private invokeBusinessRpc;
|
|
214
|
+
private serviceDependencies;
|
|
215
|
+
/** Supply catalog-validated manifest dependencies before handler initialization. */
|
|
216
|
+
setServiceDependencies(dependencies: ReadonlyMap<string, Readonly<Record<string, string>>>): void;
|
|
217
|
+
/**
|
|
218
|
+
* Host hook awaited once per `initializeFromConfig`, AFTER the dependency graph
|
|
219
|
+
* and service declarations are updated and BEFORE any plugin instance is
|
|
220
|
+
* created. The worker runtime uses it to await the real publication directory,
|
|
221
|
+
* so a bootstrap consumption never races the peer transport.
|
|
222
|
+
*/
|
|
223
|
+
private beforeBootstrapHook;
|
|
224
|
+
/** Install (or clear) the one-shot before-bootstrap gate; never a plugin API. */
|
|
225
|
+
setBeforeBootstrapHook(hook: ((signal: AbortSignal) => Promise<void>) | null): void;
|
|
226
|
+
/** 全局插件实例 */
|
|
227
|
+
private dependencies?;
|
|
228
|
+
private globalInstances;
|
|
229
|
+
/** 路由级插件实例:routeId → instances */
|
|
230
|
+
private routeInstances;
|
|
231
|
+
/** 服务级插件实例:`${routeId}#${serviceName}` → instances */
|
|
232
|
+
private serviceInstances;
|
|
233
|
+
/** 上游级插件实例:`${routeId}#${upstreamId}` → instances */
|
|
234
|
+
private upstreamInstances;
|
|
235
|
+
/** 全局预编译 Hooks */
|
|
236
|
+
private globalPrecompiled;
|
|
237
|
+
/** 路由级预编译 Hooks:routeId → PrecompiledHooks */
|
|
238
|
+
private routePrecompiled;
|
|
239
|
+
/** 服务级预编译 Hooks:`${routeId}#${serviceName}` → PrecompiledHooks */
|
|
240
|
+
private servicePrecompiled;
|
|
241
|
+
/** 上游级预编译 Hooks:upstreamId → PrecompiledHooks */
|
|
242
|
+
private upstreamPrecompiled;
|
|
243
|
+
/** 组合 Hooks 缓存:`route:${routeId}|upstream:${upstreamId}` → PrecompiledHooks */
|
|
244
|
+
private combinedHooksCache;
|
|
245
|
+
/** Phase-aware Hooks 缓存:`phase-aware:${routeId}#${upstreamId}#${serviceName}` → PhaseAwareHooks */
|
|
246
|
+
private phaseAwareCache;
|
|
247
|
+
private routeRequestPhases;
|
|
248
|
+
private dispatchRequestHooks;
|
|
249
|
+
private websocketHandshakeHooks;
|
|
250
|
+
private websocketObservationHooks;
|
|
251
|
+
private attemptObservationHooks;
|
|
252
|
+
/** 已加载的插件类:pluginName → PluginClass */
|
|
253
|
+
private pluginClasses;
|
|
254
|
+
/** 插件翻译内容缓存 */
|
|
255
|
+
private pluginTranslations;
|
|
256
|
+
/** 配置基础路径 */
|
|
257
|
+
private configBasePath;
|
|
258
|
+
private pathResolver;
|
|
259
|
+
/** 是否已销毁 */
|
|
260
|
+
private destroyed;
|
|
261
|
+
private destroyTask;
|
|
262
|
+
/** Uninstalled partial instance whose cleanup failed; teardown must keep it. */
|
|
263
|
+
private initializationCleanupFailure;
|
|
264
|
+
/** 是否已完成预编译 */
|
|
265
|
+
private precompiled;
|
|
266
|
+
/** 初始化开始时间 */
|
|
267
|
+
private initStartTime;
|
|
268
|
+
/** 初始化完成时间 */
|
|
269
|
+
private initEndTime;
|
|
270
|
+
/** 最后预编译时间 */
|
|
271
|
+
private lastPrecompileTime;
|
|
272
|
+
/** 预编译耗时(毫秒) */
|
|
273
|
+
private lastPrecompileDuration;
|
|
274
|
+
/** 插件初始化失败计数 */
|
|
275
|
+
private initFailures;
|
|
276
|
+
private runtimeFailures;
|
|
277
|
+
/** 重试次数 */
|
|
278
|
+
private initRetryCount;
|
|
279
|
+
/** 重试延迟(毫秒) */
|
|
280
|
+
private initRetryDelayMs;
|
|
281
|
+
/** 热更新后销毁旧实例的延迟(毫秒) */
|
|
282
|
+
private hotReloadDestroyDelayMs;
|
|
283
|
+
/** 热更新锁:routeId/upstreamId → Promise */
|
|
284
|
+
private hotReloadLocks;
|
|
285
|
+
constructor(configBasePath?: string, services?: PluginServiceHost);
|
|
286
|
+
/**
|
|
287
|
+
* 配置重试选项
|
|
288
|
+
*/
|
|
289
|
+
setRetryOptions(options: {
|
|
290
|
+
retryCount?: number;
|
|
291
|
+
retryDelayMs?: number;
|
|
292
|
+
}): void;
|
|
293
|
+
setHotReloadDestroyDelayMs(delayMs: number): void;
|
|
294
|
+
getHotReloadDestroyDelayMs(): number;
|
|
295
|
+
private recordRuntimeFailure;
|
|
296
|
+
private clearRuntimeFailure;
|
|
297
|
+
/**
|
|
298
|
+
* 带重试的插件实例创建
|
|
299
|
+
*
|
|
300
|
+
* @param scope 作用域
|
|
301
|
+
* @param pluginConfig 插件配置
|
|
302
|
+
* @param retryCount 当前可重试次数
|
|
303
|
+
* @returns 创建结果
|
|
304
|
+
*/
|
|
305
|
+
private createInstanceWithRetry;
|
|
306
|
+
/**
|
|
307
|
+
* 加载插件类(不创建实例)
|
|
308
|
+
*
|
|
309
|
+
* @param pluginPath 插件文件路径
|
|
310
|
+
* @returns 插件类
|
|
311
|
+
*/
|
|
312
|
+
loadPluginClass(pluginPath: string, logicalPluginName?: string): Promise<PluginClass>;
|
|
313
|
+
/**
|
|
314
|
+
* 适配旧架构插件为新架构
|
|
315
|
+
*
|
|
316
|
+
* 该方法为向后兼容层,将旧架构插件包装为新架构 PluginClass。
|
|
317
|
+
*
|
|
318
|
+
* 架构对比:
|
|
319
|
+
* - 旧架构:`class Plugin { constructor(config) {...} register(hooks) {...} }`
|
|
320
|
+
* - 需要实例化后调用 register()
|
|
321
|
+
* - 状态存储在实例中
|
|
322
|
+
*
|
|
323
|
+
* - 新架构:`class PluginClass { static createHandler(config, ctx) {...} }`
|
|
324
|
+
* - 工厂模式,静态方法创建 handler
|
|
325
|
+
* - 支持更好的生命周期管理
|
|
326
|
+
*
|
|
327
|
+
* 适配逻辑:
|
|
328
|
+
* 1. 检查是否已有 createHandler 静态方法(新架构),有则直接返回
|
|
329
|
+
* 2. 否则创建适配器,在 createHandler 中实例化旧插件
|
|
330
|
+
* 3. 代理实例方法到 handler 上(支持 API 处理等场景)
|
|
331
|
+
*
|
|
332
|
+
* @param PluginClassDef 插件类定义(可能是新架构或旧架构)
|
|
333
|
+
* @returns 符合新架构的 PluginClass
|
|
334
|
+
*/
|
|
335
|
+
private adaptPluginClass;
|
|
336
|
+
/**
|
|
337
|
+
* 通过名称获取已加载的插件类
|
|
338
|
+
*/
|
|
339
|
+
getPluginClass(name: string): PluginClass | undefined;
|
|
340
|
+
/**
|
|
341
|
+
* 确保插件类已加载
|
|
342
|
+
*/
|
|
343
|
+
ensurePluginClassLoaded(pluginConfig: PluginConfig | string): Promise<PluginClass>;
|
|
344
|
+
/**
|
|
345
|
+
* 获取插件搜索路径
|
|
346
|
+
*/
|
|
347
|
+
private getSearchPaths;
|
|
348
|
+
private validatedPluginOptions;
|
|
349
|
+
/**
|
|
350
|
+
* 创建插件处理器实例
|
|
351
|
+
*
|
|
352
|
+
* @param scope 作用域
|
|
353
|
+
* @param pluginConfig 插件配置
|
|
354
|
+
* @returns 创建的实例
|
|
355
|
+
*/
|
|
356
|
+
createInstance(scope: PluginScope, pluginConfig: PluginConfig, signal?: AbortSignal): Promise<ScopedPluginInstance>;
|
|
357
|
+
/**
|
|
358
|
+
* 添加实例到对应作用域
|
|
359
|
+
*/
|
|
360
|
+
private addInstance;
|
|
361
|
+
/**
|
|
362
|
+
* 创建插件初始化上下文
|
|
363
|
+
*
|
|
364
|
+
* 为插件提供运行时依赖(storage、logger 等),支持两种模式:
|
|
365
|
+
*
|
|
366
|
+
* 1. 完整模式(PluginContextManager 已初始化):
|
|
367
|
+
* - 复用全局 context 或创建新的
|
|
368
|
+
* - 提供完整的 storage、logger 功能
|
|
369
|
+
*
|
|
370
|
+
* 2. 降级模式(PluginContextManager 未初始化):
|
|
371
|
+
* - 创建内存存储(DummyStorage)
|
|
372
|
+
* - 创建简单日志器
|
|
373
|
+
* - 适用于测试或独立运行场景
|
|
374
|
+
*
|
|
375
|
+
* @param pluginName 插件名称
|
|
376
|
+
* @param config 插件配置
|
|
377
|
+
* @param scope 作用域信息(可选)
|
|
378
|
+
* @returns 初始化上下文
|
|
379
|
+
*/
|
|
380
|
+
private createInitContext;
|
|
381
|
+
/**
|
|
382
|
+
* 创建插件日志器
|
|
383
|
+
*/
|
|
384
|
+
private createPluginLogger;
|
|
385
|
+
/**
|
|
386
|
+
* 创建空的 storage(降级用)
|
|
387
|
+
*/
|
|
388
|
+
private createDummyStorage;
|
|
389
|
+
/**
|
|
390
|
+
* 获取请求的预编译 Hooks(O(1) 操作)
|
|
391
|
+
*
|
|
392
|
+
* 这是请求处理的核心方法,性能至关重要。
|
|
393
|
+
* 如果尚未预编译,会自动触发预编译。
|
|
394
|
+
*
|
|
395
|
+
* 缓存策略:
|
|
396
|
+
* - 首次请求时构建并缓存
|
|
397
|
+
* - 后续请求直接从缓存返回(O(1))
|
|
398
|
+
* - 配置热更新时自动失效相关缓存
|
|
399
|
+
*
|
|
400
|
+
* @param routeId 路由 ID
|
|
401
|
+
* @param upstreamId 上游 ID(可选)
|
|
402
|
+
* @returns 预编译的 Hooks,如果没有任何插件则返回 null
|
|
403
|
+
*
|
|
404
|
+
* @example
|
|
405
|
+
* ```typescript
|
|
406
|
+
* // 在请求处理中获取 hooks
|
|
407
|
+
* const hooks = registry.getPrecompiledHooks('/api/v1', 'upstream-1');
|
|
408
|
+
* if (hooks) {
|
|
409
|
+
* await hooks.hooks.onBeforeRequest.promise(context);
|
|
410
|
+
* }
|
|
411
|
+
* ```
|
|
412
|
+
*/
|
|
413
|
+
getPrecompiledHooks(routeId: string, upstreamId?: string, serviceName?: string | readonly string[], adapter?: import('./plugin.types').Plugin): PhaseAwareHooks;
|
|
414
|
+
getServicePluginOwners(routeId: string, serviceId: string): Array<{
|
|
415
|
+
pluginName: string;
|
|
416
|
+
scopeKey: string;
|
|
417
|
+
}>;
|
|
418
|
+
/** Retain every instance actually executed by handshake phases; observer precedence is different. */
|
|
419
|
+
getWebSocketHandshakeOwners(routeId: string, upstreamId: string, serviceName?: string | readonly string[]): Array<{
|
|
420
|
+
pluginName: string;
|
|
421
|
+
scopeKey: string;
|
|
422
|
+
}>;
|
|
423
|
+
getWebSocketOwners(routeId: string, upstreamId?: string, serviceName?: string | readonly string[]): Array<{
|
|
424
|
+
pluginName: string;
|
|
425
|
+
scopeKey: string;
|
|
426
|
+
hooks: PluginHooks['onWebSocketObservation'];
|
|
427
|
+
}>;
|
|
428
|
+
getAttemptObservationOwners(routeId: string, upstreamId?: string, serviceName?: string | readonly string[], context?: PluginBodyRequirementContext): AttemptObservationOwner[];
|
|
429
|
+
/**
|
|
430
|
+
* 获取路由级预编译 Hooks(不含上游插件)
|
|
431
|
+
*
|
|
432
|
+
* @param routeId 路由 ID
|
|
433
|
+
* @returns 预编译的 Hooks
|
|
434
|
+
*/
|
|
435
|
+
getRoutePrecompiledHooks(routeId: string): PrecompiledHooks | null;
|
|
436
|
+
/** Request-log extensions belong to the entry route binding only. */
|
|
437
|
+
getRequestLogHooks(routeId: string): PluginHooks | undefined;
|
|
438
|
+
/**
|
|
439
|
+
* 预编译所有 Hooks
|
|
440
|
+
*
|
|
441
|
+
* 在应用启动时或配置变更后调用。
|
|
442
|
+
* 为每个 scope 创建预编译的 Hooks。
|
|
443
|
+
*/
|
|
444
|
+
precompileAllHooks(): void;
|
|
445
|
+
/**
|
|
446
|
+
* 构建单个 scope 的预编译 Hooks
|
|
447
|
+
*/
|
|
448
|
+
private buildPrecompiledHooks;
|
|
449
|
+
private buildEmptyPrecompiledHooks;
|
|
450
|
+
buildRoutePhaseHooks(routeId: string): PrecompiledHooks;
|
|
451
|
+
buildServicePhaseHooks(routeId: string, serviceName: string): PrecompiledHooks | null;
|
|
452
|
+
buildUpstreamPhaseHooks(routeId: string, upstreamId: string): PrecompiledHooks;
|
|
453
|
+
buildInboundChain(routeId: string, upstreamId: string, serviceName?: string | readonly string[], adapter?: PrecompiledHooks): InboundChain;
|
|
454
|
+
/**
|
|
455
|
+
* 清除指定 scope 的预编译缓存
|
|
456
|
+
*/
|
|
457
|
+
private invalidatePrecompiledCache;
|
|
458
|
+
private warnForSameNameCrossScopePlugins;
|
|
459
|
+
/** Captured by the host once for the complete logical request and all attempts. */
|
|
460
|
+
getGatewayHooks(): PluginHooks;
|
|
461
|
+
getGlobalAdmissionHandlers(): readonly PluginHandler[];
|
|
462
|
+
/** Entry plugins retained across dispatch/session work even when the final route differs. */
|
|
463
|
+
getRoutePluginOwners(routeId: string, dispatchOnly?: boolean): Array<{
|
|
464
|
+
pluginName: string;
|
|
465
|
+
scopeKey: string;
|
|
466
|
+
}>;
|
|
467
|
+
/** Dispatch and deferred response callbacks share the retained entry owner's RPC authority. */
|
|
468
|
+
dispatchRequest(routeId: string, input: import('./gateway/contracts').DispatchRequestInput, callee: unknown): Promise<import('./gateway/contracts').DispatchRequestDecision | undefined>;
|
|
469
|
+
getDeclaredDispatchTargets(routeId: string): import('./gateway/contracts').GatewayDispatchTarget[];
|
|
470
|
+
/**
|
|
471
|
+
* 从配置初始化所有插件实例
|
|
472
|
+
*
|
|
473
|
+
* @param config 应用配置
|
|
474
|
+
*/
|
|
475
|
+
initializeFromConfig(config: {
|
|
476
|
+
plugins?: Array<PluginConfig | string>;
|
|
477
|
+
routes?: Array<{
|
|
478
|
+
id?: string;
|
|
479
|
+
path: string;
|
|
480
|
+
plugins?: Array<PluginConfig | string>;
|
|
481
|
+
endpoints?: Endpoint[];
|
|
482
|
+
service_references?: ServiceReference[];
|
|
483
|
+
upstreams?: Array<{
|
|
484
|
+
id?: string;
|
|
485
|
+
target: string;
|
|
486
|
+
plugins?: Array<PluginConfig | string>;
|
|
487
|
+
[key: string]: any;
|
|
488
|
+
}>;
|
|
489
|
+
[key: string]: any;
|
|
490
|
+
}>;
|
|
491
|
+
services?: Service[];
|
|
492
|
+
[key: string]: any;
|
|
493
|
+
}, dependencies?: PluginDependencyGraph, signal?: AbortSignal): Promise<{
|
|
494
|
+
success: number;
|
|
495
|
+
failed: number;
|
|
496
|
+
}>;
|
|
497
|
+
/**
|
|
498
|
+
* 获取热更新锁
|
|
499
|
+
* 使用 Promise 链实现简单的互斥锁
|
|
500
|
+
*/
|
|
501
|
+
private acquireHotReloadLock;
|
|
502
|
+
/**
|
|
503
|
+
* 延迟销毁旧的 handler 实例
|
|
504
|
+
* 等待正在处理的请求完成后再销毁
|
|
505
|
+
*
|
|
506
|
+
* @param instances 要销毁的实例列表
|
|
507
|
+
* @param context 日志上下文信息
|
|
508
|
+
* @param delayMs 延迟时间(毫秒),默认 DEFAULT_CONFIG.HOT_RELOAD_DESTROY_DELAY_MS
|
|
509
|
+
*/
|
|
510
|
+
private scheduleHandlerDestruction;
|
|
511
|
+
/**
|
|
512
|
+
* 热更新路由的插件配置
|
|
513
|
+
*
|
|
514
|
+
* @param routeId 路由 ID
|
|
515
|
+
* @param newPluginConfigs 新的插件配置
|
|
516
|
+
*/
|
|
517
|
+
hotReloadRoutePlugins(routeId: string, newPluginConfigs: PluginConfig[]): Promise<void>;
|
|
518
|
+
/**
|
|
519
|
+
* 热更新上游的插件配置
|
|
520
|
+
*
|
|
521
|
+
* @param routeId 路由 ID
|
|
522
|
+
* @param upstreamId 上游 ID
|
|
523
|
+
* @param newPluginConfigs 新的插件配置
|
|
524
|
+
*/
|
|
525
|
+
hotReloadUpstreamPlugins(routeId: string, upstreamId: string, newPluginConfigs: PluginConfig[]): Promise<void>;
|
|
526
|
+
/**
|
|
527
|
+
* 为路由动态创建插件实例
|
|
528
|
+
* 用于兼容现有的按需加载逻辑
|
|
529
|
+
*/
|
|
530
|
+
ensureRoutePluginsLoaded(routeId: string, pluginConfigs: PluginConfig[]): Promise<void>;
|
|
531
|
+
/**
|
|
532
|
+
* 获取总处理器数量
|
|
533
|
+
*/
|
|
534
|
+
private getTotalHandlerCount;
|
|
535
|
+
/**
|
|
536
|
+
* 销毁所有实例
|
|
537
|
+
*
|
|
538
|
+
* @param timeoutMs 单个插件销毁超时时间(默认 DEFAULT_CONFIG.DESTROY_TIMEOUT_MS)
|
|
539
|
+
*/
|
|
540
|
+
destroy(timeoutMs?: number): Promise<void>;
|
|
541
|
+
private destroyInstances;
|
|
542
|
+
/**
|
|
543
|
+
* 获取所有已加载的插件类元数据
|
|
544
|
+
*/
|
|
545
|
+
getAllPluginsMetadata(): Array<{
|
|
546
|
+
name: string;
|
|
547
|
+
version: string;
|
|
548
|
+
description?: string;
|
|
549
|
+
metadata?: PluginMetadata;
|
|
550
|
+
instances: {
|
|
551
|
+
global: number;
|
|
552
|
+
route: number;
|
|
553
|
+
service: number;
|
|
554
|
+
upstream: number;
|
|
555
|
+
};
|
|
556
|
+
}>;
|
|
557
|
+
/**
|
|
558
|
+
* 获取所有插件的翻译内容
|
|
559
|
+
*/
|
|
560
|
+
getAllPluginTranslations(): Record<string, any>;
|
|
561
|
+
/**
|
|
562
|
+
* 获取插件系统的运行时统计信息
|
|
563
|
+
*
|
|
564
|
+
* 返回的统计信息用于监控、调试和 API 端点。
|
|
565
|
+
*
|
|
566
|
+
* 包含的信息:
|
|
567
|
+
* - 插件类数量和实例分布(global/route/upstream)
|
|
568
|
+
* - 预编译缓存状态
|
|
569
|
+
* - 可观测性指标(初始化时间、预编译耗时、失败统计)
|
|
570
|
+
*
|
|
571
|
+
* @returns 统计信息对象,可直接序列化为 JSON
|
|
572
|
+
*
|
|
573
|
+
* @example
|
|
574
|
+
* ```typescript
|
|
575
|
+
* const stats = registry.getStats();
|
|
576
|
+
* console.log(stats.totalHandlers); // 总 handler 数量
|
|
577
|
+
* console.log(stats.observability.initializationTime); // 初始化耗时(ms)
|
|
578
|
+
* ```
|
|
579
|
+
*/
|
|
580
|
+
getStats(): {
|
|
581
|
+
pluginClasses: number;
|
|
582
|
+
globalInstances: number;
|
|
583
|
+
routeInstances: number;
|
|
584
|
+
serviceInstances: number;
|
|
585
|
+
upstreamInstances: number;
|
|
586
|
+
totalHandlers: number;
|
|
587
|
+
precompiled: boolean;
|
|
588
|
+
precompiledCache: {
|
|
589
|
+
global: number;
|
|
590
|
+
route: number;
|
|
591
|
+
service: number;
|
|
592
|
+
upstream: number;
|
|
593
|
+
combined: number;
|
|
594
|
+
phaseAware: number;
|
|
595
|
+
};
|
|
596
|
+
destroyed: boolean;
|
|
597
|
+
observability: {
|
|
598
|
+
initializationTime: number | null;
|
|
599
|
+
initStartTime: string | null;
|
|
600
|
+
initEndTime: string | null;
|
|
601
|
+
lastPrecompileTime: string | null;
|
|
602
|
+
lastPrecompileDurationMs: number | null;
|
|
603
|
+
initFailures: Record<string, {
|
|
604
|
+
count: number;
|
|
605
|
+
lastError: string;
|
|
606
|
+
lastTime: number;
|
|
607
|
+
}>;
|
|
608
|
+
totalInitFailures: number;
|
|
609
|
+
runtimeFailures: Record<string, {
|
|
610
|
+
loadState: "degraded" | "quarantined";
|
|
611
|
+
failureReason: string;
|
|
612
|
+
failureCode: "runtime-load-failure";
|
|
613
|
+
lastTime: number;
|
|
614
|
+
}>;
|
|
615
|
+
totalRuntimeFailures: number;
|
|
616
|
+
pluginInstanceCounts: Record<string, {
|
|
617
|
+
global: number;
|
|
618
|
+
route: number;
|
|
619
|
+
service: number;
|
|
620
|
+
upstream: number;
|
|
621
|
+
}>;
|
|
622
|
+
};
|
|
623
|
+
};
|
|
624
|
+
/**
|
|
625
|
+
* 获取全局作用域的插件实例列表
|
|
626
|
+
* 用于 API 委派:只有 global scope 的插件才能处理 API 请求
|
|
627
|
+
*/
|
|
628
|
+
getGlobalInstances(): ScopedPluginInstance[];
|
|
629
|
+
getPluginRuntimeStateSnapshot(pluginName: string): PluginRuntimeStateSnapshot;
|
|
630
|
+
getAllPluginRuntimeStateSnapshots(): Map<string, PluginRuntimeStateSnapshot>;
|
|
631
|
+
}
|
|
632
|
+
/**
|
|
633
|
+
* 获取全局 ScopedPluginRegistry 实例
|
|
634
|
+
*/
|
|
635
|
+
export declare function getScopedPluginRegistry(): ScopedPluginRegistry | null;
|
|
636
|
+
/**
|
|
637
|
+
* 初始化全局 ScopedPluginRegistry 实例
|
|
638
|
+
*/
|
|
639
|
+
export declare function initScopedPluginRegistry(configBasePath?: string): ScopedPluginRegistry;
|
|
640
|
+
export declare function setScopedPluginRegistry(registry: ScopedPluginRegistry | null): void;
|
|
641
|
+
/**
|
|
642
|
+
* 销毁全局 ScopedPluginRegistry 实例
|
|
643
|
+
*/
|
|
644
|
+
export declare function destroyScopedPluginRegistry(): Promise<void>;
|
|
645
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { SupervisionStateRepository, readSupervisionState } from './state-repository';
|
|
2
|
+
export type { SupervisionState } from './state-repository';
|
|
3
|
+
export { acceptAttach, deriveSupervisionProcessKey, deriveWorkerSupervisionCredential, deriveWorkerSupervisionSeed, deriveWorkerTransportSecret, hashSupervisionBody, isCanonicalSupervisionPath, isValidSupervisionMessage, importSupervisionCredential, importWorkerSupervisionSeed, parseSupervisionMessage, PendingChallengeStore, serializeSupervisionCredential, serializeWorkerSupervisionSeed, signSupervisionMessage, SupervisionAuthorityGuard, SupervisionCommandGuard, SupervisionProtocolError, SupervisionSendQueue, SupervisionStatusReplayGuard, validateControllerAuthority, verifySupervisionMessage, MAX_SUPERVISION_INTEGER, SUPERVISION_PROTOCOL, } from './protocol';
|
|
4
|
+
export type { AttachMessage, ChallengeMessage, CommandEnvelope, ControllerAuthority, LeaseMessage, CommandExecutionResult, PendingChallenge, PendingChallengeStoreOptions, ProcessIdentity, StatusMessage, SupervisionMac, SupervisionMessage, SupervisionMessageKind, SupervisionDirection, SupervisionGuardSnapshot, SupervisionProcessCredential, SupervisionCommandGuardOptions, SupervisionProtocolErrorCode, SupervisionRole, SupervisionRootKeyMaterial, WorkerSupervisionSeed, UnsignedSupervisionMessage, } from './protocol';
|
|
5
|
+
export { WorkerSupervisionHttpServer, } from './worker-http';
|
|
6
|
+
export { createWorkerRuntimeSnapshotFromState, normalizeWorkerRuntimeSnapshotBody, parseWorkerRuntimeSnapshot, WorkerRuntimeSnapshotError, MAX_WORKER_RUNTIME_SNAPSHOT_BODY_BYTES, MAX_WORKER_RUNTIME_SNAPSHOT_RECORDS, WORKER_RUNTIME_SNAPSHOT_SCHEMA, } from './worker-runtime-snapshot';
|
|
7
|
+
export type { WorkerRuntimeCircuitState, WorkerRuntimeSnapshot, WorkerRuntimeSnapshotComplete, WorkerRuntimeSnapshotErrorCode, WorkerRuntimeSnapshotIdentity, WorkerRuntimeSnapshotInput, WorkerRuntimeSnapshotRecord, WorkerRuntimeSnapshotOverflow, WorkerRuntimeSnapshotOverflowReason, WorkerRuntimeSnapshotProvider, WorkerRuntimeSnapshotResult, } from './worker-runtime-snapshot';
|
|
8
|
+
export type { WorkerCleanupEvidence, WorkerDescriptor, WorkerDescriptorBody, WorkerDescriptorEvidence, WorkerDescriptorPhase, WorkerDescriptorFile, WorkerDescriptorFs, WorkerDescriptorWriteOptions, } from './worker-descriptor';
|
|
9
|
+
export { removeWorkerDescriptor, parseWorkerDescriptor, parseWorkerDescriptorEvidence, signWorkerDescriptor, verifyWorkerDescriptor, writeWorkerDescriptor, } from './worker-descriptor';
|
|
10
|
+
export type { WorkerStatusEvidence, WorkerStatusPayload, WorkerControllerAuthorityListener, WorkerSupervisionHttpServerOptions, } from './worker-http';
|
|
11
|
+
export { armProcessLifetimeGuard, holdInheritedProcessLifetimeGuard, parseHeldProcessLifetimeGuardFacts, parseProcessLifetimeGuardFacts, parseProcessLifetimeHeldAck, probeExistingProcessLifetimeGuard, processLifetimeHostBootId, writeProcessLifetimeHeldAck, PROCESS_LIFETIME_GUARD_DOMAIN, PROCESS_LIFETIME_GUARD_ENV, } from './process-lifetime-guard';
|
|
12
|
+
export type { HeldProcessLifetimeGuardFacts, ProcessLifetimeGuardFacts, ProcessLifetimeGuardProbe, ProcessLifetimeHeldAck, ProcessLifetimeRetirementFence, } from './process-lifetime-guard';
|