@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,308 @@
|
|
|
1
|
+
import type { WebSocketObservationEvent, WebSocketHandshakeContext, GatewayWebSocketInput, GatewayWebSocketResult } from '../gateway/websocket-contracts';
|
|
2
|
+
/**
|
|
3
|
+
* Bungee Plugin Hooks 定义
|
|
4
|
+
*
|
|
5
|
+
* 定义了插件系统中所有可用的 Hook 及其上下文类型。
|
|
6
|
+
* 每个 Hook 有预设的执行模式(Parallel/Series/Bail/Waterfall),
|
|
7
|
+
* 插件通过 register() 方法选择合适的注册方式。
|
|
8
|
+
*/
|
|
9
|
+
import { SyncBailHook, AsyncParallelHook, AsyncSeriesBailHook, AsyncSeriesWaterfallHook, AsyncSeriesMapHook } from './impl';
|
|
10
|
+
import type { PluginServices } from '../plugin-services';
|
|
11
|
+
import type { PluginStorage, SSEEnvelope, PluginConfigValue } from '../plugin.types';
|
|
12
|
+
import type { InterceptResult, PluginPhase } from '@jeffusion/bungee-types';
|
|
13
|
+
import type { RawResponseResult } from '../plugin-control/contracts';
|
|
14
|
+
import type { GatewayBodyArguments, GatewayRequestArguments, GatewayForwardArguments, GatewayResponseRuleArguments, GatewayBodyRuleArguments, GatewayQueryRuleArguments, GatewayHeaderRuleArguments, GatewayCorsArguments, GatewayRouteInput, GatewayRouteDecision, GatewayDispatchInput, GatewayDispatchDecision, DispatchRequestInput, DispatchRequestDecision, GatewayAdmissionInput, GatewayAdmissionDecision, GatewayAdmissionSessionInput, GatewayAdmissionPrepareInput, GatewaySelectInput, GatewaySelectDecision, GatewayFailoverInput, GatewayRetryInput } from '../gateway/contracts';
|
|
15
|
+
import type { WorkerRequestAdmission, PreparedAdmissionAttempt } from '../data-admission/worker';
|
|
16
|
+
import type { RuntimeCandidate } from '../worker/types';
|
|
17
|
+
import type { FailoverCoordinator } from '../worker/upstream/failover-coordinator';
|
|
18
|
+
import type { ProxyRequestResult } from '../gateway/forward-plugin';
|
|
19
|
+
import type { PrepareResponseResult } from '../gateway/response-plugin';
|
|
20
|
+
import type { BodySource } from '../gateway/body-service';
|
|
21
|
+
import type { BodyHandle, BodyViewIdentity } from '../gateway/body-contracts';
|
|
22
|
+
import type { RequestLogBodyContext, RequestLogBodyHandler, RequestLogContext, RequestLogObserver } from '../gateway/request-log-contracts';
|
|
23
|
+
/**
|
|
24
|
+
* 请求上下文(只读部分)
|
|
25
|
+
*/
|
|
26
|
+
export interface RequestContext {
|
|
27
|
+
/** HTTP 方法 */
|
|
28
|
+
readonly method: string;
|
|
29
|
+
/** 原始请求 URL */
|
|
30
|
+
readonly originalUrl: URL;
|
|
31
|
+
/** 客户端 IP */
|
|
32
|
+
readonly clientIP: string;
|
|
33
|
+
/** 请求唯一 ID */
|
|
34
|
+
readonly requestId: string;
|
|
35
|
+
/** 路由 ID */
|
|
36
|
+
readonly routeId?: string;
|
|
37
|
+
/** 上游 ID */
|
|
38
|
+
readonly upstreamId?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* 可修改的请求上下文
|
|
42
|
+
*/
|
|
43
|
+
export interface MutableRequestContext extends RequestContext {
|
|
44
|
+
readonly bodyHandle?: BodyHandle;
|
|
45
|
+
/** 目标 URL(可修改) */
|
|
46
|
+
url: URL;
|
|
47
|
+
/** 请求头(可修改) */
|
|
48
|
+
headers: Record<string, string>;
|
|
49
|
+
/** 请求体(可修改) */
|
|
50
|
+
body: any;
|
|
51
|
+
/** Plugin-owned JSON metadata carried through request phases and isolated per attempt. */
|
|
52
|
+
annotations?: Record<string, PluginConfigValue>;
|
|
53
|
+
}
|
|
54
|
+
/** Immutable final attempt boundary, after all rewrites and before upstream connection. */
|
|
55
|
+
export interface OutboundValidationContext extends RequestContext {
|
|
56
|
+
readonly url: string;
|
|
57
|
+
readonly model: string | null;
|
|
58
|
+
readonly body: unknown;
|
|
59
|
+
/** Deep-frozen snapshot of the final attempt annotations. */
|
|
60
|
+
readonly annotations?: Readonly<Record<string, PluginConfigValue>>;
|
|
61
|
+
readonly attemptId: string;
|
|
62
|
+
readonly signal?: AbortSignal;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* 响应上下文
|
|
66
|
+
*/
|
|
67
|
+
export interface ResponseContext extends RequestContext {
|
|
68
|
+
responseOrigin: 'upstream' | 'gateway';
|
|
69
|
+
readonly bodyHandle?: BodyHandle;
|
|
70
|
+
/** 响应对象 */
|
|
71
|
+
response: Response;
|
|
72
|
+
/** 请求延迟(毫秒) */
|
|
73
|
+
readonly latencyMs: number;
|
|
74
|
+
}
|
|
75
|
+
/** Strict raw response boundary. Unlike legacy response hooks, failures propagate. */
|
|
76
|
+
export interface RawResponseContext extends RequestContext {
|
|
77
|
+
/** Facts decoded from this attempt's original upstream body, never execution completion. */
|
|
78
|
+
readonly reportUpstreamProtocol?: (proof: {
|
|
79
|
+
readonly kind: 'terminal' | 'protocol_error' | 'http_error';
|
|
80
|
+
readonly outcome: 'completed' | 'failed' | 'incomplete' | 'cancelled';
|
|
81
|
+
readonly code?: string;
|
|
82
|
+
}) => void;
|
|
83
|
+
responseOrigin: 'upstream' | 'gateway';
|
|
84
|
+
/** Actual selected upstream URL after request hooks and rewrites. */
|
|
85
|
+
readonly upstreamUrl?: string;
|
|
86
|
+
readonly bodyHandle?: BodyHandle;
|
|
87
|
+
readonly signal: AbortSignal;
|
|
88
|
+
readonly attemptId: string;
|
|
89
|
+
/** Redacts credentials acquired by the host without exposing them to plugins. */
|
|
90
|
+
readonly redactDiagnostic?: (message: string) => string;
|
|
91
|
+
}
|
|
92
|
+
export type AttemptObservationOutcome = 'completed' | 'failed' | 'cancelled';
|
|
93
|
+
export type AttemptObservationEvent = Readonly<{
|
|
94
|
+
/** Host-derived credential identity; never copied from client headers. */
|
|
95
|
+
keyId?: string | null;
|
|
96
|
+
/** Host monotonic observation time, captured before observer queues. */
|
|
97
|
+
observedAtMonotonicMs?: number;
|
|
98
|
+
requestId: string;
|
|
99
|
+
routeId: string;
|
|
100
|
+
attemptId: string;
|
|
101
|
+
upstreamId: string;
|
|
102
|
+
/** Identifies the independent observation branch and the exact body version. */
|
|
103
|
+
direction?: 'request' | 'response';
|
|
104
|
+
representation?: 'wire' | 'decoded' | 'json' | 'sse';
|
|
105
|
+
view?: BodyViewIdentity;
|
|
106
|
+
consumerId?: string;
|
|
107
|
+
/**
|
|
108
|
+
* Cooperative validity lease for this delivery. It becomes false after the callback
|
|
109
|
+
* resolves/rejects or the host times it out. Plugins must check it after every await
|
|
110
|
+
* and immediately before mutating state; a timed-out callback cannot be forcibly stopped.
|
|
111
|
+
*/
|
|
112
|
+
isActive: () => boolean;
|
|
113
|
+
} & ({
|
|
114
|
+
phase: 'selected';
|
|
115
|
+
} | {
|
|
116
|
+
phase: 'request';
|
|
117
|
+
url: string;
|
|
118
|
+
body: unknown;
|
|
119
|
+
/** Actual outbound URL.host; excludes credentials, path, query and fragment. */
|
|
120
|
+
upstreamHost?: string;
|
|
121
|
+
} | {
|
|
122
|
+
phase: 'response';
|
|
123
|
+
status: number;
|
|
124
|
+
protocol: 'json' | 'sse';
|
|
125
|
+
body: Record<string, unknown>;
|
|
126
|
+
envelope?: SSEEnvelope;
|
|
127
|
+
} | {
|
|
128
|
+
phase: 'incomplete';
|
|
129
|
+
reason: 'observer-timeout' | 'observer-error' | 'raw-response-incomplete' | 'buffer-limit' | 'frame-limit' | 'frame-truncated' | 'decode-error' | 'unsupported-encoding';
|
|
130
|
+
} | {
|
|
131
|
+
phase: 'end';
|
|
132
|
+
outcome: AttemptObservationOutcome;
|
|
133
|
+
sent: boolean;
|
|
134
|
+
} | {
|
|
135
|
+
phase: 'request-end';
|
|
136
|
+
})>;
|
|
137
|
+
/** Parallel observer dispatch must surface failures so the request host can disable a broken observer. */
|
|
138
|
+
declare class AttemptObservationHook extends AsyncParallelHook<[AttemptObservationEvent]> {
|
|
139
|
+
promise(...args: [AttemptObservationEvent]): Promise<void>;
|
|
140
|
+
}
|
|
141
|
+
/** Strict, isolated WebSocket observers use the same plugin registration contract. */
|
|
142
|
+
declare class WebSocketObservationHook extends AsyncParallelHook<[WebSocketObservationEvent]> {
|
|
143
|
+
promise(...args: [WebSocketObservationEvent]): Promise<void>;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* 错误上下文
|
|
147
|
+
*/
|
|
148
|
+
export interface ErrorContext extends RequestContext {
|
|
149
|
+
/** 错误对象 */
|
|
150
|
+
readonly error: Error;
|
|
151
|
+
/** 请求头 */
|
|
152
|
+
headers: Record<string, string>;
|
|
153
|
+
/** 请求体 */
|
|
154
|
+
body: any;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* 流式数据块上下文
|
|
158
|
+
*
|
|
159
|
+
* 性能优化:chunkIndex/isFirstChunk/isLastChunk 不再是 readonly,
|
|
160
|
+
* 保存当前事件序号与本次响应内的插件状态
|
|
161
|
+
*/
|
|
162
|
+
export interface StreamChunkContext extends RequestContext {
|
|
163
|
+
/** 块索引 */
|
|
164
|
+
chunkIndex: number;
|
|
165
|
+
/** 是否为第一个块 */
|
|
166
|
+
isFirstChunk: boolean;
|
|
167
|
+
/** 是否为最后一个块 */
|
|
168
|
+
isLastChunk: boolean;
|
|
169
|
+
/**
|
|
170
|
+
* 流状态存储
|
|
171
|
+
* 每个插件可以使用此 Map 存储跨 chunk 的状态
|
|
172
|
+
* Key 由插件自行管理
|
|
173
|
+
*/
|
|
174
|
+
streamState: Map<string, any>;
|
|
175
|
+
/**
|
|
176
|
+
* 请求日志对象(用于调试)
|
|
177
|
+
*/
|
|
178
|
+
readonly request?: any;
|
|
179
|
+
/** Strict raw-response processing must propagate plugin failures. */
|
|
180
|
+
readonly strict?: boolean;
|
|
181
|
+
/** Metadata of the current SSE event, independent from its JSON payload. */
|
|
182
|
+
readonly sseEvent?: SSEEnvelope;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* 请求完成上下文
|
|
186
|
+
*/
|
|
187
|
+
export interface FinallyContext extends RequestContext {
|
|
188
|
+
/** 请求是否成功 */
|
|
189
|
+
readonly success: boolean;
|
|
190
|
+
/** 请求延迟(毫秒) */
|
|
191
|
+
readonly latencyMs: number;
|
|
192
|
+
/** 响应状态码(如果有) */
|
|
193
|
+
readonly statusCode?: number;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* 插件作用域信息
|
|
197
|
+
* 用于需要按作用域隔离数据的插件
|
|
198
|
+
*/
|
|
199
|
+
export interface PluginScopeInfo {
|
|
200
|
+
/** 作用域类型 */
|
|
201
|
+
type: 'global' | 'route' | 'service' | 'upstream';
|
|
202
|
+
phase?: PluginPhase;
|
|
203
|
+
routeId?: string;
|
|
204
|
+
serviceName?: string;
|
|
205
|
+
upstreamId?: string;
|
|
206
|
+
/** @deprecated Use phase + routeId/serviceName/upstreamId instead */
|
|
207
|
+
id?: string;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* 插件初始化上下文
|
|
211
|
+
*/
|
|
212
|
+
export interface PluginInitContext {
|
|
213
|
+
/**
|
|
214
|
+
* Aborts when the worker runtime shuts down. Long-running initialization must
|
|
215
|
+
* stop waiting cooperatively (pass it to I/O); it is not cleanup evidence.
|
|
216
|
+
*/
|
|
217
|
+
readonly signal?: AbortSignal;
|
|
218
|
+
/** Host-generated providers have no application binding; configured instances do. */
|
|
219
|
+
readonly initializationKind?: 'automatic-provider' | 'configured';
|
|
220
|
+
/** Host-controlled, dependency-restricted public service facade. */
|
|
221
|
+
readonly services?: PluginServices;
|
|
222
|
+
readonly dispatchTargets?: readonly import('../gateway/contracts').GatewayDispatchTarget[];
|
|
223
|
+
/** 插件配置 */
|
|
224
|
+
config: Record<string, any>;
|
|
225
|
+
/** 插件存储 */
|
|
226
|
+
storage: PluginStorage;
|
|
227
|
+
/** 插件日志 */
|
|
228
|
+
logger: PluginLogger;
|
|
229
|
+
/**
|
|
230
|
+
* 作用域信息(可选)
|
|
231
|
+
*
|
|
232
|
+
* 用于需要按作用域隔离数据的插件。
|
|
233
|
+
* 注意:Storage 默认是插件级别共享的,如需隔离请在 key 中添加作用域前缀
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* // 按作用域隔离 storage key
|
|
237
|
+
* const scopedKey = ctx.scope
|
|
238
|
+
* ? `${ctx.scope.type}:${ctx.scope.id || 'default'}:${key}`
|
|
239
|
+
* : key;
|
|
240
|
+
* await this.storage.set(scopedKey, value);
|
|
241
|
+
*/
|
|
242
|
+
scope?: PluginScopeInfo;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* 插件日志接口
|
|
246
|
+
*/
|
|
247
|
+
export interface PluginLogger {
|
|
248
|
+
debug(msg: string, data?: object): void;
|
|
249
|
+
info(msg: string, data?: object): void;
|
|
250
|
+
warn(msg: string, data?: object): void;
|
|
251
|
+
error(msg: string, data?: object): void;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* 创建一组新的 Plugin Hooks
|
|
255
|
+
*
|
|
256
|
+
* 每个请求应该创建独立的 hooks 实例,以避免状态污染。
|
|
257
|
+
* 或者使用单例 hooks,在请求处理开始前清理状态。
|
|
258
|
+
*/
|
|
259
|
+
export declare function createPluginHooks(): PluginHooks;
|
|
260
|
+
/**
|
|
261
|
+
* Plugin Hooks 类型
|
|
262
|
+
*/
|
|
263
|
+
export interface PluginHooks {
|
|
264
|
+
onGatewayWebSocket: AsyncSeriesBailHook<[GatewayWebSocketInput], GatewayWebSocketResult>;
|
|
265
|
+
onWebSocketSessionMode: AsyncSeriesBailHook<[URL], 'responses'>;
|
|
266
|
+
onWebSocketHandshake: AsyncSeriesWaterfallHook<WebSocketHandshakeContext>;
|
|
267
|
+
onWebSocketObservation: WebSocketObservationHook;
|
|
268
|
+
onRequestLog: SyncBailHook<[], true>;
|
|
269
|
+
onRequestLogBody: SyncBailHook<[RequestLogBodyContext], RequestLogBodyHandler | null>;
|
|
270
|
+
onRequestLogApplication: SyncBailHook<[RequestLogContext], RequestLogObserver>;
|
|
271
|
+
onGatewayBody: SyncBailHook<GatewayBodyArguments, BodySource>;
|
|
272
|
+
onGatewayHeaderRules: AsyncSeriesBailHook<GatewayHeaderRuleArguments, true>;
|
|
273
|
+
onGatewayCors: AsyncSeriesBailHook<GatewayCorsArguments, Response>;
|
|
274
|
+
onGatewayRequest: AsyncSeriesBailHook<GatewayRequestArguments, Response>;
|
|
275
|
+
onGatewayRoute: AsyncSeriesBailHook<[GatewayRouteInput], GatewayRouteDecision>;
|
|
276
|
+
onGatewayDispatch: AsyncSeriesBailHook<[GatewayDispatchInput], GatewayDispatchDecision>;
|
|
277
|
+
onDispatchRequest: AsyncSeriesBailHook<[DispatchRequestInput], DispatchRequestDecision>;
|
|
278
|
+
onGatewayAdmission: AsyncSeriesBailHook<[GatewayAdmissionInput], GatewayAdmissionDecision>;
|
|
279
|
+
onGatewayAdmissionSession: AsyncSeriesBailHook<[GatewayAdmissionSessionInput], WorkerRequestAdmission>;
|
|
280
|
+
onGatewayAdmissionPrepare: AsyncSeriesBailHook<[GatewayAdmissionPrepareInput], PreparedAdmissionAttempt[]>;
|
|
281
|
+
onGatewaySelect: AsyncSeriesBailHook<[GatewaySelectInput], GatewaySelectDecision>;
|
|
282
|
+
onGatewayFailover: AsyncSeriesBailHook<[GatewayFailoverInput], FailoverCoordinator<RuntimeCandidate>>;
|
|
283
|
+
onGatewayRetry: AsyncSeriesBailHook<[GatewayRetryInput], ProxyRequestResult>;
|
|
284
|
+
onGatewayForward: AsyncSeriesBailHook<GatewayForwardArguments, ProxyRequestResult>;
|
|
285
|
+
onGatewayBodyRules: AsyncSeriesBailHook<GatewayBodyRuleArguments, Record<string, any>>;
|
|
286
|
+
onGatewayQueryRules: AsyncSeriesBailHook<GatewayQueryRuleArguments, URLSearchParams>;
|
|
287
|
+
onGatewayResponseRules: AsyncSeriesBailHook<GatewayResponseRuleArguments, PrepareResponseResult>;
|
|
288
|
+
onRequestInit: AsyncParallelHook<[RequestContext]>;
|
|
289
|
+
onBeforeRequest: AsyncSeriesWaterfallHook<MutableRequestContext>;
|
|
290
|
+
onValidateOutbound: AsyncSeriesWaterfallHook<OutboundValidationContext>;
|
|
291
|
+
onInterceptRequest: AsyncSeriesBailHook<[MutableRequestContext], InterceptResult>;
|
|
292
|
+
onResponse: AsyncSeriesWaterfallHook<Response, [ResponseContext]>;
|
|
293
|
+
onRawResponse: AsyncSeriesWaterfallHook<RawResponseResult, [RawResponseContext]>;
|
|
294
|
+
onAttemptObservation: AttemptObservationHook;
|
|
295
|
+
onStreamChunk: AsyncSeriesMapHook<SSEEnvelope, [StreamChunkContext]>;
|
|
296
|
+
onFlushStream: AsyncSeriesWaterfallHook<SSEEnvelope[], [StreamChunkContext]>;
|
|
297
|
+
onError: AsyncParallelHook<[ErrorContext]>;
|
|
298
|
+
onFinally: AsyncParallelHook<[FinallyContext]>;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* 获取所有 Hook 的统计信息
|
|
302
|
+
*/
|
|
303
|
+
export declare function getHooksStats(hooks: PluginHooks): {
|
|
304
|
+
[k: string]: any;
|
|
305
|
+
};
|
|
306
|
+
export declare function resetHooksStats(hooks: PluginHooks): void;
|
|
307
|
+
export declare function clearHooks(hooks: PluginHooks): void;
|
|
308
|
+
export {};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook 类型定义
|
|
3
|
+
*
|
|
4
|
+
* 参考 Webpack Tapable 设计,提供多种 Hook 类型以支持不同的执行模式。
|
|
5
|
+
* 插件可以根据需要选择合适的注册方式(tap/tapAsync/tapPromise)。
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Hook 注册回调的元信息
|
|
9
|
+
*/
|
|
10
|
+
export interface TapInfo {
|
|
11
|
+
/** 插件名称(用于调试和日志) */
|
|
12
|
+
name: string;
|
|
13
|
+
/** 执行优先级(可选,默认 0,负数优先执行) */
|
|
14
|
+
stage?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 已注册的 Tap 项
|
|
18
|
+
*/
|
|
19
|
+
export interface Tap<_T extends any[], _R = void> {
|
|
20
|
+
info: TapInfo;
|
|
21
|
+
type: 'sync' | 'async' | 'promise';
|
|
22
|
+
fn: (...args: any[]) => any;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 异步并行 Hook 接口
|
|
26
|
+
* 所有回调并行执行,全部完成后返回
|
|
27
|
+
*/
|
|
28
|
+
export interface IAsyncParallelHook<T extends any[] = []> {
|
|
29
|
+
/** 同步注册(会被包装为 Promise) */
|
|
30
|
+
tap(info: TapInfo | string, fn: (...args: T) => void): void;
|
|
31
|
+
/** 异步回调风格注册 */
|
|
32
|
+
tapAsync(info: TapInfo | string, fn: (...args: [...T, done: (err?: Error) => void]) => void): void;
|
|
33
|
+
/** Promise 风格注册 */
|
|
34
|
+
tapPromise(info: TapInfo | string, fn: (...args: T) => Promise<void>): void;
|
|
35
|
+
/** 执行所有回调(并行) */
|
|
36
|
+
promise(...args: T): Promise<void>;
|
|
37
|
+
/** 检查是否有注册的回调 */
|
|
38
|
+
hasCallbacks(): boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* 异步串行 Hook 接口
|
|
42
|
+
* 所有回调按顺序串行执行
|
|
43
|
+
*/
|
|
44
|
+
export interface IAsyncSeriesHook<T extends any[] = []> {
|
|
45
|
+
/** 同步注册 */
|
|
46
|
+
tap(info: TapInfo | string, fn: (...args: T) => void): void;
|
|
47
|
+
/** 异步回调风格注册 */
|
|
48
|
+
tapAsync(info: TapInfo | string, fn: (...args: [...T, done: (err?: Error) => void]) => void): void;
|
|
49
|
+
/** Promise 风格注册 */
|
|
50
|
+
tapPromise(info: TapInfo | string, fn: (...args: T) => Promise<void>): void;
|
|
51
|
+
/** 执行所有回调(串行) */
|
|
52
|
+
promise(...args: T): Promise<void>;
|
|
53
|
+
/** 检查是否有注册的回调 */
|
|
54
|
+
hasCallbacks(): boolean;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* 异步串行可中断 Hook 接口
|
|
58
|
+
* 任意回调返回非 undefined 值则停止执行并返回该值
|
|
59
|
+
*/
|
|
60
|
+
export interface IAsyncSeriesBailHook<T extends any[] = [], R = any> {
|
|
61
|
+
/** 同步注册 */
|
|
62
|
+
tap(info: TapInfo | string, fn: (...args: T) => R | undefined): void;
|
|
63
|
+
/** 异步回调风格注册 */
|
|
64
|
+
tapAsync(info: TapInfo | string, fn: (...args: [...T, done: (err?: Error, result?: R) => void]) => void): void;
|
|
65
|
+
/** Promise 风格注册 */
|
|
66
|
+
tapPromise(info: TapInfo | string, fn: (...args: T) => Promise<R | undefined>): void;
|
|
67
|
+
/** 执行所有回调(串行可中断) */
|
|
68
|
+
promise(...args: T): Promise<R | undefined>;
|
|
69
|
+
/** 检查是否有注册的回调 */
|
|
70
|
+
hasCallbacks(): boolean;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* 异步串行瀑布 Hook 接口
|
|
74
|
+
* 每个回调的返回值作为下一个回调的第一个参数
|
|
75
|
+
*/
|
|
76
|
+
export interface IAsyncSeriesWaterfallHook<T, A extends any[] = []> {
|
|
77
|
+
/** 同步注册 */
|
|
78
|
+
tap(info: TapInfo | string, fn: (value: T, ...args: A) => T): void;
|
|
79
|
+
/** 异步回调风格注册 */
|
|
80
|
+
tapAsync(info: TapInfo | string, fn: (value: T, ...args: [...A, done: (err?: Error, result?: T) => void]) => void): void;
|
|
81
|
+
/** Promise 风格注册 */
|
|
82
|
+
tapPromise(info: TapInfo | string, fn: (value: T, ...args: A) => Promise<T>): void;
|
|
83
|
+
/** 执行所有回调(串行瀑布) */
|
|
84
|
+
promise(value: T, ...args: A): Promise<T>;
|
|
85
|
+
/** 检查是否有注册的回调 */
|
|
86
|
+
hasCallbacks(): boolean;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* 异步串行映射 Hook 接口
|
|
90
|
+
* 支持 N:M 转换:每个回调处理一批输入,返回一批输出
|
|
91
|
+
*
|
|
92
|
+
* 执行流程:
|
|
93
|
+
* 1. 初始输入:[chunk]
|
|
94
|
+
* 2. 第一个插件处理所有输入,返回新的输出数组
|
|
95
|
+
* 3. 第二个插件处理上一步的所有输出,返回新的输出数组
|
|
96
|
+
* 4. 以此类推...
|
|
97
|
+
*
|
|
98
|
+
* 返回值约定:
|
|
99
|
+
* - null/undefined: 不处理,原样输出当前 chunk
|
|
100
|
+
* - []: 缓冲当前 chunk,不输出(N:0)
|
|
101
|
+
* - [chunk]: 1:1 转换
|
|
102
|
+
* - [chunk1, chunk2, ...]: 1:M 拆分
|
|
103
|
+
*/
|
|
104
|
+
export interface IAsyncSeriesMapHook<T, A extends any[] = []> {
|
|
105
|
+
/** 同步注册 */
|
|
106
|
+
tap(info: TapInfo | string, fn: (value: T, ...args: A) => T[] | null | undefined): void;
|
|
107
|
+
/** 异步回调风格注册 */
|
|
108
|
+
tapAsync(info: TapInfo | string, fn: (value: T, ...args: [...A, done: (err?: Error, result?: T[] | null) => void]) => void): void;
|
|
109
|
+
/** Promise 风格注册 */
|
|
110
|
+
tapPromise(info: TapInfo | string, fn: (value: T, ...args: A) => Promise<T[] | null | undefined>): void;
|
|
111
|
+
/** 执行所有回调(串行映射) */
|
|
112
|
+
promise(value: T, ...args: A): Promise<T[]>;
|
|
113
|
+
/** 检查是否有注册的回调 */
|
|
114
|
+
hasCallbacks(): boolean;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Hook 统计信息
|
|
118
|
+
*/
|
|
119
|
+
export interface HookStats {
|
|
120
|
+
/** Hook 名称 */
|
|
121
|
+
name: string;
|
|
122
|
+
/** 注册的回调数量 */
|
|
123
|
+
tapCount: number;
|
|
124
|
+
/** 调用次数 */
|
|
125
|
+
callCount: number;
|
|
126
|
+
/** 总执行时间(毫秒) */
|
|
127
|
+
totalTimeMs: number;
|
|
128
|
+
/** 平均执行时间(毫秒) */
|
|
129
|
+
avgTimeMs: number;
|
|
130
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type AdmissionSet, type AdmissionWorker } from './admission-set';
|
|
2
|
+
import type { RateLimitWorkerAuthorization, RateLimitWorkerIdentity } from '../rate-limit';
|
|
3
|
+
export type AdmissionRegistryStatus = {
|
|
4
|
+
readonly active: AdmissionSet | null;
|
|
5
|
+
readonly prepared: AdmissionSet | null;
|
|
6
|
+
readonly retired: readonly AdmissionSet[];
|
|
7
|
+
readonly handoff?: {
|
|
8
|
+
readonly retired_id: string;
|
|
9
|
+
readonly pending: number;
|
|
10
|
+
readonly complete: boolean;
|
|
11
|
+
readonly remaining_ms: number;
|
|
12
|
+
} | null;
|
|
13
|
+
};
|
|
14
|
+
export declare class AdmissionRegistryError extends Error {
|
|
15
|
+
readonly code: 'stale' | 'conflict' | 'missing' | 'frozen' | 'capacity';
|
|
16
|
+
readonly name = "AdmissionRegistryError";
|
|
17
|
+
constructor(code: 'stale' | 'conflict' | 'missing' | 'frozen' | 'capacity', message: string);
|
|
18
|
+
}
|
|
19
|
+
export declare class IngressAdmissionRegistry {
|
|
20
|
+
private readonly monotonicNow;
|
|
21
|
+
private readonly messagePolicyListeners;
|
|
22
|
+
private active;
|
|
23
|
+
private activeRetiredId;
|
|
24
|
+
private activeRequestLoggingEnabled;
|
|
25
|
+
private prepared;
|
|
26
|
+
private retired;
|
|
27
|
+
private nextIndex;
|
|
28
|
+
private frozen;
|
|
29
|
+
private readonly retiredCapacity;
|
|
30
|
+
private readonly aborted;
|
|
31
|
+
private readonly releasedRetired;
|
|
32
|
+
private readonly pendingByAdmission;
|
|
33
|
+
private activeTransport;
|
|
34
|
+
private handoff;
|
|
35
|
+
constructor(monotonicNow?: () => number);
|
|
36
|
+
setFrozen(frozen: boolean): void;
|
|
37
|
+
prepare(input: unknown, handoffTimeoutMs?: number, requestLoggingEnabled?: boolean): AdmissionSet;
|
|
38
|
+
commitTarget(input: unknown): AdmissionSet | null;
|
|
39
|
+
commit(input: unknown, prepareDataAdmission?: () => () => void): void;
|
|
40
|
+
private scheduleRetiredTransport;
|
|
41
|
+
abort(input: unknown): void;
|
|
42
|
+
releaseRetired(input: unknown): void;
|
|
43
|
+
get websocketMaxConnections(): number | null;
|
|
44
|
+
subscribeWebSocketMessagePolicy(listener: (maxMessageBytes: number) => void): () => void;
|
|
45
|
+
get websocketMaxMessageBytes(): number;
|
|
46
|
+
get requestLoggingEnabled(): boolean;
|
|
47
|
+
select(): AdmissionWorker | null;
|
|
48
|
+
acquire(): {
|
|
49
|
+
readonly worker: AdmissionWorker | null;
|
|
50
|
+
readonly retirementSignal?: AbortSignal;
|
|
51
|
+
release(): void;
|
|
52
|
+
};
|
|
53
|
+
/** Maps a signed rate-limit worker identity to the current admission state. */
|
|
54
|
+
authorizeRateLimitWorker(worker: RateLimitWorkerIdentity): RateLimitWorkerAuthorization;
|
|
55
|
+
status(): AdmissionRegistryStatus;
|
|
56
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type Sha256Digest } from '@jeffusion/bungee-types';
|
|
2
|
+
export type AdmissionWorker = {
|
|
3
|
+
/** PID is intentionally absent: it is diagnostic only, not identity/fencing. */
|
|
4
|
+
readonly master_generation: string;
|
|
5
|
+
readonly worker_instance_id: string;
|
|
6
|
+
readonly boot_nonce: string;
|
|
7
|
+
readonly worker_slot: number;
|
|
8
|
+
readonly private_port: number;
|
|
9
|
+
};
|
|
10
|
+
export type AdmissionSet = {
|
|
11
|
+
readonly websocket_max_connections: number | null;
|
|
12
|
+
readonly websocket_max_message_bytes: number;
|
|
13
|
+
/** PID is deliberately absent: identity/fencing uses generation, instance, boot nonce and slot. */
|
|
14
|
+
readonly master_generation: string;
|
|
15
|
+
readonly admission_sequence: number;
|
|
16
|
+
readonly revision: number;
|
|
17
|
+
readonly content_hash: Sha256Digest;
|
|
18
|
+
readonly plugin_catalog_hash: Sha256Digest;
|
|
19
|
+
readonly request_log_collector_entry?: string;
|
|
20
|
+
readonly workers: readonly AdmissionWorker[];
|
|
21
|
+
};
|
|
22
|
+
export declare class AdmissionSetError extends Error {
|
|
23
|
+
readonly code: 'malformed' | 'mixed_generation' | 'duplicate_slot';
|
|
24
|
+
readonly name = "AdmissionSetError";
|
|
25
|
+
constructor(code: 'malformed' | 'mixed_generation' | 'duplicate_slot', message: string);
|
|
26
|
+
}
|
|
27
|
+
export declare function parseAdmissionSet(input: unknown): AdmissionSet;
|
|
28
|
+
export declare function admissionSetIdentity(set: AdmissionSet): string;
|
|
29
|
+
export declare function admissionSetRetiredId(set: AdmissionSet): string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { AdmissionSetError, admissionSetIdentity, admissionSetRetiredId, parseAdmissionSet, type AdmissionSet, type AdmissionWorker, } from './admission-set';
|
|
2
|
+
export { AdmissionRegistryError, IngressAdmissionRegistry, type AdmissionRegistryStatus, } from './admission-registry';
|
|
3
|
+
export { IngressHttpError, IngressSupervisionHttpServer, IngressControllerClient, credentialFromSerialized, parseIngressStatusPayload, type IngressControllerClientOptions, type IngressSupervisionServerOptions, type IngressStatusPayload, type IngressHandoffStatus, } from './supervision-http';
|
|
4
|
+
export { INGRESS_SUPERVISION_HOST, ingressOptionsFromEnvironment, startIngressProcess, type IngressEnvironmentOptions, type IngressProcessHandle, type IngressRuntimeOptions, } from './runtime';
|