@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,47 @@
|
|
|
1
|
+
import type { ContentAvailability, ContentView, RequestLogContentContribution, RequestLogContentDirection, RequestLogContentSink, RequestLogProjection } from '../gateway/request-log-contracts';
|
|
2
|
+
import type { BodyStorageManager } from './body-storage';
|
|
3
|
+
type Storage = Pick<BodyStorageManager, 'saveStream'>;
|
|
4
|
+
/** A bounded JSON array spool. Only serialized, redacted copies outlive append(). */
|
|
5
|
+
export declare class ContentArraySpool {
|
|
6
|
+
private readonly maxBytes;
|
|
7
|
+
private readonly values?;
|
|
8
|
+
private readonly lease;
|
|
9
|
+
private readonly controller;
|
|
10
|
+
private readonly queue;
|
|
11
|
+
private wake?;
|
|
12
|
+
private bytes;
|
|
13
|
+
private queuedBytes;
|
|
14
|
+
private count;
|
|
15
|
+
private ended;
|
|
16
|
+
private reason?;
|
|
17
|
+
private saved?;
|
|
18
|
+
private slot;
|
|
19
|
+
constructor(maxBytes: number, values?: (() => Iterable<unknown>) | undefined);
|
|
20
|
+
append(value: unknown): void;
|
|
21
|
+
attach(id: string, storage: Storage, type: 'original-request' | 'response'): void;
|
|
22
|
+
abort(reason: string): void;
|
|
23
|
+
finish(): Promise<ContentAvailability>;
|
|
24
|
+
private chunks;
|
|
25
|
+
}
|
|
26
|
+
export declare class CanonicalContentCapture implements RequestLogContentSink {
|
|
27
|
+
private readonly direction;
|
|
28
|
+
private readonly spool;
|
|
29
|
+
private readonly lease;
|
|
30
|
+
private readonly pending;
|
|
31
|
+
private readonly groups;
|
|
32
|
+
private readonly fragments;
|
|
33
|
+
private retained;
|
|
34
|
+
private unattachedEvents;
|
|
35
|
+
private attached;
|
|
36
|
+
private failed;
|
|
37
|
+
private projection;
|
|
38
|
+
private observed;
|
|
39
|
+
private ended;
|
|
40
|
+
private completion?;
|
|
41
|
+
constructor(direction: RequestLogContentDirection, maxBytes: number);
|
|
42
|
+
project(direction: RequestLogContentDirection, contributions: readonly RequestLogContentContribution[], projection: RequestLogProjection): void;
|
|
43
|
+
attach(id: string, storage: Storage): void;
|
|
44
|
+
abort(reason: string): void;
|
|
45
|
+
finish(): Promise<Partial<ContentView>>;
|
|
46
|
+
}
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export interface HeaderStorageConfig {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
retentionDays: number;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Header 存储管理器
|
|
7
|
+
*
|
|
8
|
+
* 特性:
|
|
9
|
+
* - 按日期分层存储(logs/headers/YYYY-MM-DD/)
|
|
10
|
+
* - 默认启用
|
|
11
|
+
* - 提供按日期清理能力(由 Master 调度)
|
|
12
|
+
*/
|
|
13
|
+
export declare class HeaderStorageManager {
|
|
14
|
+
private config;
|
|
15
|
+
private readonly headersDir;
|
|
16
|
+
constructor(config?: Partial<HeaderStorageConfig>, headersDir?: string);
|
|
17
|
+
/**
|
|
18
|
+
* 保存 header 内容
|
|
19
|
+
* @returns header ID(如果保存成功),或 null
|
|
20
|
+
*/
|
|
21
|
+
save(requestId: string, headers: Record<string, string>, type: 'request' | 'response' | 'original-request'): Promise<string | null>;
|
|
22
|
+
/**
|
|
23
|
+
* 读取 header 内容
|
|
24
|
+
*/
|
|
25
|
+
load(headerId: string): Promise<Record<string, string> | null>;
|
|
26
|
+
/**
|
|
27
|
+
* 清理过期 header 数据
|
|
28
|
+
*/
|
|
29
|
+
cleanup(cutoffTime?: number, signal?: AbortSignal): Promise<{
|
|
30
|
+
deletedDirs: number;
|
|
31
|
+
deletedFiles: number;
|
|
32
|
+
}>;
|
|
33
|
+
/**
|
|
34
|
+
* 更新配置
|
|
35
|
+
*/
|
|
36
|
+
updateConfig(config: Partial<HeaderStorageConfig>): void;
|
|
37
|
+
/**
|
|
38
|
+
* 获取配置
|
|
39
|
+
*/
|
|
40
|
+
getConfig(): HeaderStorageConfig;
|
|
41
|
+
/**
|
|
42
|
+
* 获取 header 文件路径
|
|
43
|
+
*/
|
|
44
|
+
private getHeaderFilePath;
|
|
45
|
+
private isDate;
|
|
46
|
+
private isSafeDirectory;
|
|
47
|
+
private ensureSafeDirectory;
|
|
48
|
+
private isSafeRegularFile;
|
|
49
|
+
private isSafePath;
|
|
50
|
+
/**
|
|
51
|
+
* 获取日期字符串(YYYY-MM-DD)
|
|
52
|
+
*/
|
|
53
|
+
private getDateString;
|
|
54
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { Database } from 'bun:sqlite';
|
|
2
|
+
import type { BodyStorageManager } from './body-storage';
|
|
3
|
+
import type { HeaderStorageManager } from './header-storage';
|
|
4
|
+
export interface CleanupConfig {
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
retentionDays: number;
|
|
7
|
+
scheduleIntervalHours: number;
|
|
8
|
+
}
|
|
9
|
+
export interface LogCleanupServiceOptions extends Partial<CleanupConfig> {
|
|
10
|
+
readonly database: Database;
|
|
11
|
+
readonly bodyStorage: Pick<BodyStorageManager, 'cleanup'>;
|
|
12
|
+
readonly headerStorage: Pick<HeaderStorageManager, 'cleanup'>;
|
|
13
|
+
readonly config?: Partial<CleanupConfig>;
|
|
14
|
+
readonly readRetentionDays?: () => number;
|
|
15
|
+
}
|
|
16
|
+
export declare const DEFAULT_CLEANUP_CONFIG: Readonly<CleanupConfig>;
|
|
17
|
+
/**
|
|
18
|
+
* 日志清理服务
|
|
19
|
+
*
|
|
20
|
+
* 特性:
|
|
21
|
+
* - 定期自动清理过期日志
|
|
22
|
+
* - 可配置保留天数
|
|
23
|
+
* - 支持手动触发清理
|
|
24
|
+
* - 仅删除过期 SQLite/body/header 数据;live 数据库不执行 VACUUM
|
|
25
|
+
*/
|
|
26
|
+
export declare class LogCleanupService {
|
|
27
|
+
private config;
|
|
28
|
+
private cleanupTimer;
|
|
29
|
+
private initialCleanupTimer;
|
|
30
|
+
private stopping;
|
|
31
|
+
private activeRun;
|
|
32
|
+
private readonly database;
|
|
33
|
+
private readonly bodyStorage;
|
|
34
|
+
private readonly headerStorage;
|
|
35
|
+
private readonly readRetentionDays?;
|
|
36
|
+
constructor(options: LogCleanupServiceOptions);
|
|
37
|
+
constructor(database: Database, bodyStorage: Pick<BodyStorageManager, 'cleanup'>, headerStorage: Pick<HeaderStorageManager, 'cleanup'>, config?: Partial<CleanupConfig>);
|
|
38
|
+
constructor(config?: Partial<CleanupConfig>);
|
|
39
|
+
/**
|
|
40
|
+
* 启动自动清理服务
|
|
41
|
+
*/
|
|
42
|
+
start(): void;
|
|
43
|
+
/**
|
|
44
|
+
* 停止自动清理服务
|
|
45
|
+
*/
|
|
46
|
+
stop(): Promise<void>;
|
|
47
|
+
/** Update the authoritative retention before the next scheduled/manual pass. */
|
|
48
|
+
configure(config: Partial<CleanupConfig>): void;
|
|
49
|
+
/**
|
|
50
|
+
* 执行清理任务
|
|
51
|
+
*/
|
|
52
|
+
runCleanup(): Promise<{
|
|
53
|
+
deletedSqliteRecords: number;
|
|
54
|
+
deletedFileLogFiles: number;
|
|
55
|
+
deletedBodyDirs: number;
|
|
56
|
+
deletedBodyFiles: number;
|
|
57
|
+
durationMs: number;
|
|
58
|
+
}>;
|
|
59
|
+
private cleanupDatabase;
|
|
60
|
+
private runSqliteStep;
|
|
61
|
+
/**
|
|
62
|
+
* 获取当前配置
|
|
63
|
+
*/
|
|
64
|
+
getConfig(): CleanupConfig;
|
|
65
|
+
/**
|
|
66
|
+
* 检查服务状态
|
|
67
|
+
*/
|
|
68
|
+
isActive(): boolean;
|
|
69
|
+
}
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import type { ProcessingStep } from './access-log-writer';
|
|
2
|
+
import type { AccessLogEntry } from './access-log-writer';
|
|
3
|
+
import type { BodyStorageManager } from './body-storage';
|
|
4
|
+
import type { HeaderStorageManager } from './header-storage';
|
|
5
|
+
import type { RawResponseError } from '../plugin-control/contracts';
|
|
6
|
+
import type { RequestLogBodyContext, RequestLogBodyHandler, RequestLogFactWriter, LogExecutionCause } from '../gateway/request-log-contracts';
|
|
7
|
+
import type { WebSocketMessageView } from '../gateway/websocket-contracts';
|
|
8
|
+
import type { TransportOutcome, TransportType } from './transport-outcome';
|
|
9
|
+
import { type BodyCaptureOptions } from './body-capture';
|
|
10
|
+
type BodyType = 'request' | 'response' | 'original-request';
|
|
11
|
+
export declare const requestLogNow: () => number;
|
|
12
|
+
type RequestPhase = {
|
|
13
|
+
step: string;
|
|
14
|
+
startedAt: number;
|
|
15
|
+
};
|
|
16
|
+
export type RequestLoggerDependencies = {
|
|
17
|
+
/** Exact local process UUID:boot_nonce, injected by the host. */
|
|
18
|
+
readonly ownerId?: string;
|
|
19
|
+
/** Host restriction overrides configured body capture and explicit body setters. */
|
|
20
|
+
readonly captureBody?: boolean;
|
|
21
|
+
readonly bodyParser?: (context: RequestLogBodyContext) => RequestLogBodyHandler | null | undefined;
|
|
22
|
+
readonly accessLogWriter?: Pick<RequestLogFactWriter, 'beginRequest' | 'bindObservation' | 'writeSemantic' | 'patchTransport' | 'patchContent' | 'patchMetadata' | 'endOwner'> & {
|
|
23
|
+
writeAttempt(entry: AccessLogEntry): void;
|
|
24
|
+
};
|
|
25
|
+
/** The production worker adapter confirms local admission; other sinks may await storage. */
|
|
26
|
+
readonly fileLogWriter?: {
|
|
27
|
+
write(entry: AccessLogEntry & {
|
|
28
|
+
recordKind: 'attempt';
|
|
29
|
+
}): boolean | void | Promise<boolean | void>;
|
|
30
|
+
};
|
|
31
|
+
readonly bodyStorage?: Pick<BodyStorageManager, 'save'> & Partial<Pick<BodyStorageManager, 'getConfig' | 'saveStream'>>;
|
|
32
|
+
readonly headerStorage?: Pick<HeaderStorageManager, 'save'>;
|
|
33
|
+
};
|
|
34
|
+
export interface FailoverAttemptOptions {
|
|
35
|
+
accessId?: string;
|
|
36
|
+
operationId?: string;
|
|
37
|
+
executionRequired?: boolean;
|
|
38
|
+
transportType?: TransportType;
|
|
39
|
+
isFailoverAttempt?: boolean;
|
|
40
|
+
parentRequestId?: string;
|
|
41
|
+
attemptNumber?: number;
|
|
42
|
+
attemptUpstream?: string;
|
|
43
|
+
requestType?: 'final' | 'retry' | 'recovery';
|
|
44
|
+
}
|
|
45
|
+
export interface RequestLogCompletionOptions {
|
|
46
|
+
routePath?: string;
|
|
47
|
+
upstream?: string;
|
|
48
|
+
transformer?: string;
|
|
49
|
+
authSuccess?: boolean;
|
|
50
|
+
authLevel?: string;
|
|
51
|
+
errorMessage?: string;
|
|
52
|
+
protocolOutcome?: 'completed' | 'failed' | 'incomplete' | 'cancelled';
|
|
53
|
+
protocolCode?: string;
|
|
54
|
+
transportOutcome?: TransportOutcome;
|
|
55
|
+
transportCode?: string;
|
|
56
|
+
success?: boolean;
|
|
57
|
+
protocolError?: RawResponseError;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* 请求日志记录器
|
|
61
|
+
*
|
|
62
|
+
* 用于在请求处理过程中收集日志信息:
|
|
63
|
+
* - 请求基本信息(method, path, status, duration)
|
|
64
|
+
* - 业务信息(route, upstream, transformer)
|
|
65
|
+
* - 处理步骤(path rewrite, body transformation, auth)
|
|
66
|
+
* - 错误信息
|
|
67
|
+
* - 请求/响应体(可选)
|
|
68
|
+
*
|
|
69
|
+
* 使用方式:
|
|
70
|
+
* ```typescript
|
|
71
|
+
* const reqLogger = new RequestLogger(req, undefined, logging);
|
|
72
|
+
* reqLogger.setRequestBody(requestBody);
|
|
73
|
+
* reqLogger.addStep('auth', { success: true });
|
|
74
|
+
* reqLogger.addStep('transformer', { name: 'openai-to-anthropic' });
|
|
75
|
+
* reqLogger.setResponseBody(responseBody);
|
|
76
|
+
* reqLogger.recordUpstreamResponse(response.status);
|
|
77
|
+
* await reqLogger.complete(response.status, { routePath, upstream, transformer });
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export declare class RequestLogger {
|
|
81
|
+
private requestId;
|
|
82
|
+
private startTime;
|
|
83
|
+
private method;
|
|
84
|
+
private transportType;
|
|
85
|
+
private readonly linkage;
|
|
86
|
+
private readonly executionRequired;
|
|
87
|
+
private executionStarted;
|
|
88
|
+
private upstreamHttpStatus;
|
|
89
|
+
private executionCause?;
|
|
90
|
+
private executionEnded;
|
|
91
|
+
private attemptRevision;
|
|
92
|
+
recordUpstreamResponse(status: number): void;
|
|
93
|
+
getUpstreamResponse(): {
|
|
94
|
+
attemptId: string;
|
|
95
|
+
httpStatus: number;
|
|
96
|
+
} | undefined;
|
|
97
|
+
recordExecutionCause(cause: LogExecutionCause): void;
|
|
98
|
+
getExecutionCause(): LogExecutionCause | undefined;
|
|
99
|
+
recordRequestAbort(signal: AbortSignal): void;
|
|
100
|
+
private websocketCapture?;
|
|
101
|
+
private websocketCaptureFinished;
|
|
102
|
+
private originalWebSocketCapture?;
|
|
103
|
+
private websocketProtocol?;
|
|
104
|
+
private path;
|
|
105
|
+
private transformedPath;
|
|
106
|
+
private steps;
|
|
107
|
+
private requestBody;
|
|
108
|
+
private responseBody;
|
|
109
|
+
private requestHeaders;
|
|
110
|
+
private responseHeaders;
|
|
111
|
+
private originalRequestHeaders;
|
|
112
|
+
private originalRequestBody;
|
|
113
|
+
private isFailoverAttempt;
|
|
114
|
+
private parentRequestId;
|
|
115
|
+
private attemptNumber;
|
|
116
|
+
private attemptUpstream;
|
|
117
|
+
private requestType;
|
|
118
|
+
private rootPersisted;
|
|
119
|
+
private completed;
|
|
120
|
+
private completionPromise;
|
|
121
|
+
private completionEndedAt?;
|
|
122
|
+
private fileLogEntry;
|
|
123
|
+
private fileLogWritten;
|
|
124
|
+
private protocolError?;
|
|
125
|
+
private protocolOutcomeErrorMessage?;
|
|
126
|
+
private explicitErrorMessage?;
|
|
127
|
+
private observedProtocol?;
|
|
128
|
+
private attemptProtocolObservation;
|
|
129
|
+
private attemptProtocol?;
|
|
130
|
+
private attemptProtocolKind?;
|
|
131
|
+
useAttemptProtocolObservation(): void;
|
|
132
|
+
recordAttemptProtocol(outcome: NonNullable<RequestLogCompletionOptions['protocolOutcome']>, code?: string, kind?: 'terminal' | 'protocol_error' | 'http_error'): void;
|
|
133
|
+
private attemptEntry?;
|
|
134
|
+
private transportOutcome;
|
|
135
|
+
private transportCode?;
|
|
136
|
+
private transportStarted;
|
|
137
|
+
private clientTransportObserved;
|
|
138
|
+
private deferTransportFileLog;
|
|
139
|
+
private fileLogWritePromise;
|
|
140
|
+
private readonly bodyCaptures;
|
|
141
|
+
private readonly capturedTypes;
|
|
142
|
+
private readonly capturedIds;
|
|
143
|
+
private readonly canonicalContent;
|
|
144
|
+
private readonly nativeJson;
|
|
145
|
+
private readonly captureVersions;
|
|
146
|
+
private readonly inheritedBodyCompletions;
|
|
147
|
+
private fileLogTask?;
|
|
148
|
+
private fileLogReady?;
|
|
149
|
+
private readonly dependencies;
|
|
150
|
+
private readonly observationBinding?;
|
|
151
|
+
private metadata?;
|
|
152
|
+
private inheritedOriginalBody;
|
|
153
|
+
private phase?;
|
|
154
|
+
private ownsRequestSteps;
|
|
155
|
+
private preparationPhase?;
|
|
156
|
+
configureExecutionTransport(type: TransportType): void;
|
|
157
|
+
beginExecution(type: TransportType): void;
|
|
158
|
+
recordWebSocketProtocol(outcome: NonNullable<RequestLogCompletionOptions['protocolOutcome']>): void;
|
|
159
|
+
captureOriginalWebSocket(message: WebSocketMessageView, maxBytes: number): void;
|
|
160
|
+
observeWebSocketMessage(direction: 'client' | 'upstream', message: WebSocketMessageView, maxBytes: number): void;
|
|
161
|
+
private finishWebSocketCapture;
|
|
162
|
+
startRequestPreparation(): RequestPhase;
|
|
163
|
+
startPhase(step: string): RequestPhase;
|
|
164
|
+
transitionPhase(phase: RequestPhase | undefined, step: string): RequestPhase | undefined;
|
|
165
|
+
endPhase(phase?: RequestPhase | undefined, endedAt?: number): void;
|
|
166
|
+
private appendSteps;
|
|
167
|
+
constructor(req: Request, failoverOptions: FailoverAttemptOptions | undefined, dependencies: RequestLoggerDependencies | null);
|
|
168
|
+
/**
|
|
169
|
+
* 添加处理步骤(无耗时信息)
|
|
170
|
+
* @param step 步骤名称,如:'auth', 'path_rewrite', 'transformer', 'body_add'
|
|
171
|
+
* @param detail 步骤详情
|
|
172
|
+
*/
|
|
173
|
+
addStep(step: string, detail?: any): void;
|
|
174
|
+
/** Record the actual representation independently of parsing, rewriting and plugin observers. */
|
|
175
|
+
observeBody(body: BodyInit | null, type: BodyType, headers: Headers, config?: {
|
|
176
|
+
enabled: boolean;
|
|
177
|
+
max_size?: number;
|
|
178
|
+
}, signal?: AbortSignal, status?: number, bodyOptions?: BodyCaptureOptions): BodyInit | null;
|
|
179
|
+
private recordCapturedId;
|
|
180
|
+
private publishContent;
|
|
181
|
+
private unavailableContent;
|
|
182
|
+
inheritOriginalBody(source: RequestLogger): void;
|
|
183
|
+
bodyLoggingCompletion(): Promise<void>;
|
|
184
|
+
stopBodyLogging(): void;
|
|
185
|
+
/** Only the HTTP root whose handler returned no response can finish unstarted output. */
|
|
186
|
+
finishUnreturnedBodyLogging(): void;
|
|
187
|
+
/** The handler can still replace a failed attempt's response until request cleanup. */
|
|
188
|
+
deferFileLog(): () => void;
|
|
189
|
+
/** Route retries reuse one access record; only the current representation may update its IDs. */
|
|
190
|
+
beginBodyLoggingAttempt(): void;
|
|
191
|
+
beginResponseBodyLogging(): void;
|
|
192
|
+
private resetBodyCapture;
|
|
193
|
+
/**
|
|
194
|
+
* 添加处理步骤(带耗时信息)
|
|
195
|
+
* @param step 步骤名称
|
|
196
|
+
* @param startedAt 同源单调 epoch 起点
|
|
197
|
+
* @param endedAt 同源单调 epoch 终点
|
|
198
|
+
* @param detail 步骤详情
|
|
199
|
+
*/
|
|
200
|
+
addStepWithDuration(step: string, startedAt: number, endedAt: number, detail?: any): void;
|
|
201
|
+
/**
|
|
202
|
+
* 测量并记录步骤耗时的辅助方法
|
|
203
|
+
* @param step 步骤名称
|
|
204
|
+
* @param fn 要执行的异步函数
|
|
205
|
+
* @param detail 步骤详情(可选,也可以是返回详情的函数)
|
|
206
|
+
* @returns 函数执行结果
|
|
207
|
+
*/
|
|
208
|
+
measureStep<T>(step: string, fn: () => Promise<T>, detail?: any | ((result: T) => any)): Promise<T>;
|
|
209
|
+
/**
|
|
210
|
+
* 测量并记录同步步骤耗时
|
|
211
|
+
* @param step 步骤名称
|
|
212
|
+
* @param fn 要执行的同步函数
|
|
213
|
+
* @param detail 步骤详情
|
|
214
|
+
* @returns 函数执行结果
|
|
215
|
+
*/
|
|
216
|
+
measureStepSync<T>(step: string, fn: () => T, detail?: any | ((result: T) => any)): T;
|
|
217
|
+
/**
|
|
218
|
+
* 设置请求体(用于记录)
|
|
219
|
+
* @param body 请求体内容
|
|
220
|
+
*/
|
|
221
|
+
setRequestBody(body: any): void;
|
|
222
|
+
/**
|
|
223
|
+
* 设置响应体(用于记录)
|
|
224
|
+
* @param body 响应体内容
|
|
225
|
+
*/
|
|
226
|
+
setResponseBody(body: any): void;
|
|
227
|
+
/**
|
|
228
|
+
* 设置请求头(用于记录)
|
|
229
|
+
* @param headers 请求头
|
|
230
|
+
*/
|
|
231
|
+
setRequestHeaders(headers: Record<string, string>): void;
|
|
232
|
+
/**
|
|
233
|
+
* 设置响应头(用于记录)
|
|
234
|
+
* @param headers 响应头
|
|
235
|
+
*/
|
|
236
|
+
setResponseHeaders(headers: Record<string, string>): void;
|
|
237
|
+
/**
|
|
238
|
+
* 设置原始请求头(转换前)
|
|
239
|
+
* @param headers 原始请求头
|
|
240
|
+
*/
|
|
241
|
+
setOriginalRequestHeaders(headers: Record<string, string>): void;
|
|
242
|
+
/**
|
|
243
|
+
* 设置原始请求体(转换前)
|
|
244
|
+
* @param body 原始请求体
|
|
245
|
+
*/
|
|
246
|
+
setOriginalRequestBody(body: any): void;
|
|
247
|
+
/**
|
|
248
|
+
* 设置转换后的路径(经过 pathRewrite)
|
|
249
|
+
* @param path 转换后的路径
|
|
250
|
+
*/
|
|
251
|
+
setTransformedPath(path: string): void;
|
|
252
|
+
/**
|
|
253
|
+
* 设置请求类型分类
|
|
254
|
+
* @param type 请求类型: 'final' | 'retry' | 'recovery'
|
|
255
|
+
*/
|
|
256
|
+
setRequestType(type: 'final' | 'retry' | 'recovery'): void;
|
|
257
|
+
/**
|
|
258
|
+
* 完成请求并写入日志。同一进行中的调用共享 Promise;SQLite 入队成功后重复调用不会重复入队。
|
|
259
|
+
* 入队前失败可重试,入队后的文件日志失败仅重试文件日志。
|
|
260
|
+
* @param status HTTP 状态码
|
|
261
|
+
* @param options 其他选项
|
|
262
|
+
*/
|
|
263
|
+
complete(status: number, options?: RequestLogCompletionOptions, endedAt?: number): Promise<void>;
|
|
264
|
+
private trackCompletion;
|
|
265
|
+
private completeOnce;
|
|
266
|
+
private saveBody;
|
|
267
|
+
private writeFileLog;
|
|
268
|
+
/** The request handler enables this before any completion can serialize a final JSONL record. */
|
|
269
|
+
deferFileLogUntilTransportObserved(): void;
|
|
270
|
+
/** The attempt was superseded or the handler threw before returning a response. */
|
|
271
|
+
releaseUnreturnedTransportFileLog(): void;
|
|
272
|
+
private enqueueReadyFileLog;
|
|
273
|
+
/** 显式持久化没有 upstream attempt 的 root final 记录。 */
|
|
274
|
+
persistRoot(status: number, options?: RequestLogCompletionOptions, endedAt?: number): Promise<void>;
|
|
275
|
+
persistStreamResponseBody(body: unknown): Promise<string | null>;
|
|
276
|
+
updateStreamResponseBodyId(bodyId: string): void;
|
|
277
|
+
/** Publish in-progress metadata without saving bodies or finalizing plugin/accounting hooks. */
|
|
278
|
+
beginTransport(status: number, options?: Pick<RequestLogCompletionOptions, 'routePath' | 'upstream'>): void;
|
|
279
|
+
updateTransportOutcome(outcome: TransportOutcome, code?: string): void;
|
|
280
|
+
/** Earlier attempts observe their upstream; the returned response owns the final observation. */
|
|
281
|
+
updateUpstreamTransportOutcome(outcome: TransportOutcome, code?: string): void;
|
|
282
|
+
updateProtocolOutcome(outcome: 'completed' | 'failed' | 'incomplete' | 'cancelled', _success: boolean, code?: string, error?: RawResponseError): void;
|
|
283
|
+
private writeAttempt;
|
|
284
|
+
private publishMetadata;
|
|
285
|
+
/**
|
|
286
|
+
* 获取 Request ID(用于日志关联)
|
|
287
|
+
*/
|
|
288
|
+
getRequestId(): string;
|
|
289
|
+
/**
|
|
290
|
+
* 获取请求基本信息(用于传统日志输出)
|
|
291
|
+
*/
|
|
292
|
+
getRequestInfo(): {
|
|
293
|
+
requestId: string;
|
|
294
|
+
method: string;
|
|
295
|
+
url: string;
|
|
296
|
+
};
|
|
297
|
+
/**
|
|
298
|
+
* 获取所有处理步骤(用于步骤传递)
|
|
299
|
+
* @returns 处理步骤数组的副本
|
|
300
|
+
*/
|
|
301
|
+
getSteps(): ProcessingStep[];
|
|
302
|
+
/**
|
|
303
|
+
* 批量添加处理步骤(用于步骤合并)
|
|
304
|
+
* @param steps 要添加的步骤数组
|
|
305
|
+
*/
|
|
306
|
+
addSteps(steps: ProcessingStep[]): void;
|
|
307
|
+
}
|
|
308
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Client ingress protocol, independent of the upstream transport. */
|
|
2
|
+
import type { RequestResult } from '../gateway/request-log-contracts';
|
|
3
|
+
export type TransportType = 'http' | 'websocket';
|
|
4
|
+
/** Proxy-observed byte-stream lifecycle, independent of HTTP and application protocols. */
|
|
5
|
+
export declare const TRANSPORT_OUTCOMES: readonly ["pending", "completed", "failed", "cancelled", "unknown"];
|
|
6
|
+
export type TransportOutcome = typeof TRANSPORT_OUTCOMES[number];
|
|
7
|
+
export interface HttpStatusCounts {
|
|
8
|
+
status2xx: number;
|
|
9
|
+
status3xx: number;
|
|
10
|
+
status4xx: number;
|
|
11
|
+
status5xx: number;
|
|
12
|
+
statusOther: number;
|
|
13
|
+
}
|
|
14
|
+
export type RequestCounts = Record<RequestResult['state'], number>;
|
|
15
|
+
export declare const emptyRequestCounts: () => RequestCounts;
|
|
16
|
+
export interface TransportCounts {
|
|
17
|
+
pending: number;
|
|
18
|
+
completed: number;
|
|
19
|
+
failed: number;
|
|
20
|
+
cancelled: number;
|
|
21
|
+
unknown: number;
|
|
22
|
+
}
|
|
23
|
+
export declare const emptyHttpCounts: () => HttpStatusCounts;
|
|
24
|
+
export declare const emptyTransportCounts: () => TransportCounts;
|
|
25
|
+
export { observeTransportResponse } from '../gateway/body-observation-stream';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ContentView, RequestLogContentContribution, RequestLogContentDirection, RequestLogProjection, RequestLogWebSocketBody } from '../gateway/request-log-contracts';
|
|
2
|
+
import type { WebSocketMessageView } from '../gateway/websocket-contracts';
|
|
3
|
+
import type { BodyStorageManager } from './body-storage';
|
|
4
|
+
/** Native evidence and canonical projections have independent bounded directional spools. */
|
|
5
|
+
export declare class WebSocketBodyCapture implements RequestLogWebSocketBody {
|
|
6
|
+
private readonly maxBytes;
|
|
7
|
+
private readonly framePolicy;
|
|
8
|
+
private readonly native;
|
|
9
|
+
private readonly canonical;
|
|
10
|
+
private attached;
|
|
11
|
+
private ended;
|
|
12
|
+
private readonly frames;
|
|
13
|
+
private completion?;
|
|
14
|
+
constructor(message: WebSocketMessageView, maxBytes: number, framePolicy?: 'attributed' | 'single-wire-frame');
|
|
15
|
+
append(direction: RequestLogContentDirection, message: WebSocketMessageView): void;
|
|
16
|
+
project(direction: RequestLogContentDirection, contributions: readonly RequestLogContentContribution[], projection: RequestLogProjection): void;
|
|
17
|
+
discardNative(direction: RequestLogContentDirection, message?: WebSocketMessageView): void;
|
|
18
|
+
discardRequest(): void;
|
|
19
|
+
discardResponse(reason?: 'size_limit' | 'ambiguous'): void;
|
|
20
|
+
discard(): void;
|
|
21
|
+
attach(id: string, storage: Pick<BodyStorageManager, 'saveStream'>): boolean;
|
|
22
|
+
finish(): Promise<{
|
|
23
|
+
input: Partial<ContentView>;
|
|
24
|
+
output: Partial<ContentView>;
|
|
25
|
+
}>;
|
|
26
|
+
}
|
package/dist/logger.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type LoggerContext = Readonly<Record<string, unknown>>;
|
|
2
|
+
interface Logger {
|
|
3
|
+
info(obj: LoggerContext, msg?: string): void;
|
|
4
|
+
info(msg: string): void;
|
|
5
|
+
warn(obj: LoggerContext, msg?: string): void;
|
|
6
|
+
warn(msg: string): void;
|
|
7
|
+
error(obj: LoggerContext, msg?: string): void;
|
|
8
|
+
error(msg: string): void;
|
|
9
|
+
debug(obj: LoggerContext, msg?: string): void;
|
|
10
|
+
debug(msg: string): void;
|
|
11
|
+
fatal(obj: LoggerContext, msg?: string): void;
|
|
12
|
+
fatal(msg: string): void;
|
|
13
|
+
child(bindings: LoggerContext): Logger;
|
|
14
|
+
}
|
|
15
|
+
export declare const logger: Logger;
|
|
16
|
+
export {};
|
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
import { initializeConfigurationDatabase } from './master-runtime/initialize-configuration';
|
|
3
|
+
export { initializeConfigurationDatabase };
|
|
4
|
+
export type * from './gateway/plugin';
|
|
5
|
+
import { recoverOffline } from './master-runtime/offline-recovery';
|
|
6
|
+
export { recoverOffline };
|
|
7
|
+
export interface ProcessRoleDependencies {
|
|
8
|
+
startWorker(): Promise<unknown>;
|
|
9
|
+
startMaster(bootNonce?: string | null): Promise<unknown>;
|
|
10
|
+
startIngress?(): Promise<unknown>;
|
|
11
|
+
}
|
|
12
|
+
export declare class ProcessRoleError extends Error {
|
|
13
|
+
readonly code: 'invalid_role';
|
|
14
|
+
readonly role: string;
|
|
15
|
+
readonly name = "ProcessRoleError";
|
|
16
|
+
constructor(code: 'invalid_role', role: string);
|
|
17
|
+
}
|
|
18
|
+
export declare function dispatchProcessRole(role: string, dependencies?: ProcessRoleDependencies, bootNonce?: string | null): Promise<void>;
|
|
19
|
+
export declare function runMain(): Promise<void>;
|
package/dist/main.js
CHANGED
|
@@ -12,21 +12,21 @@ import {
|
|
|
12
12
|
PluginStateClient,
|
|
13
13
|
loadImmutableControlArtifact,
|
|
14
14
|
parsePluginSecretsKey
|
|
15
|
-
} from "./chunk-main-
|
|
15
|
+
} from "./chunk-main-qm1tgaka.js";
|
|
16
16
|
import"./chunk-main-zvyp24je.js";
|
|
17
|
-
import"./chunk-main-
|
|
17
|
+
import"./chunk-main-mqgkewnx.js";
|
|
18
18
|
import"./chunk-main-7t1ctxcy.js";
|
|
19
19
|
import"./chunk-main-a6agb3ap.js";
|
|
20
20
|
import {
|
|
21
21
|
CORE_HOST_VERSION
|
|
22
|
-
} from "./chunk-main-
|
|
22
|
+
} from "./chunk-main-1p15rgq5.js";
|
|
23
23
|
import"./chunk-main-djevb9tg.js";
|
|
24
24
|
import {
|
|
25
25
|
withOfflineStorageSession
|
|
26
26
|
} from "./chunk-main-sg8m4ese.js";
|
|
27
27
|
import {
|
|
28
28
|
buildPluginManifestCatalog
|
|
29
|
-
} from "./chunk-main-
|
|
29
|
+
} from "./chunk-main-gwaw6pxp.js";
|
|
30
30
|
import {
|
|
31
31
|
serializeErrorChain
|
|
32
32
|
} from "./chunk-main-qcpqgfy1.js";
|
|
@@ -677,13 +677,13 @@ class ProcessRoleError extends Error {
|
|
|
677
677
|
}
|
|
678
678
|
var PRODUCTION_DEPENDENCIES = {
|
|
679
679
|
async startWorker() {
|
|
680
|
-
const { initializeGateway } = await import("./chunk-runtime-
|
|
680
|
+
const { initializeGateway } = await import("./chunk-runtime-xmp308t7.js");
|
|
681
681
|
initializeGateway();
|
|
682
|
-
const { startConfigWorkerProcess } = await import("./chunk-worker-
|
|
682
|
+
const { startConfigWorkerProcess } = await import("./chunk-worker-99q8qnj9.js");
|
|
683
683
|
await startConfigWorkerProcess();
|
|
684
684
|
},
|
|
685
685
|
async startMaster(bootNonce = null) {
|
|
686
|
-
const { startMasterProcess } = await import("./chunk-master-
|
|
686
|
+
const { startMasterProcess } = await import("./chunk-master-wtcfwd6g.js");
|
|
687
687
|
if (bootNonce === null)
|
|
688
688
|
await startMasterProcess();
|
|
689
689
|
else
|
|
@@ -734,7 +734,7 @@ async function runMain() {
|
|
|
734
734
|
if (command !== "--prepare-runtime-upgrade" || !path || path.startsWith("--") || extra.length !== 0 || flag !== undefined && (flag !== "--stopped-docker-container" || !containerId)) {
|
|
735
735
|
throw new Error("invalid_runtime_upgrade_arguments");
|
|
736
736
|
}
|
|
737
|
-
const { prepareRuntimeUpgrade, prepareStoppedDockerCutover } = await import("./chunk-runtime-upgrade-
|
|
737
|
+
const { prepareRuntimeUpgrade, prepareStoppedDockerCutover } = await import("./chunk-runtime-upgrade-rvm3d096.js");
|
|
738
738
|
const result = containerId === undefined ? await prepareRuntimeUpgrade(path) : await prepareStoppedDockerCutover(path, containerId);
|
|
739
739
|
console.log(JSON.stringify(result));
|
|
740
740
|
} else if (process.argv.includes("--recover")) {
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { createManagementListener, handleManagementRequest, mergeManagementRequestSignals, trackManagementResponse, ManagementListenerLifecycleError, type ManagementControlApi, type MasterUIHandler, type ManagementListener, type ManagementListenerOptions, type ListenerRouteProfile, } from './listener';
|
|
2
|
+
export type { DaemonControlRequestContext, DaemonShutdownHandler, } from '../daemon-control';
|