@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,278 @@
|
|
|
1
|
+
import type { CandidateDataAdmission, DataAdmissionPublication } from '../data-admission/host';
|
|
2
|
+
import { spawn as spawnChild } from 'node:child_process';
|
|
3
|
+
import type { PreparedWorkerAdmission, ServingConfigWorker, WorkerAdmissionController } from '../config-publication';
|
|
4
|
+
import { type AdmissionSet } from './admission-set';
|
|
5
|
+
import { type ControllerAuthority, type ProcessIdentity, type SupervisionRootKeyMaterial } from '../supervision';
|
|
6
|
+
import { type IngressStatusPayload } from './supervision-http';
|
|
7
|
+
import { type CapturedProcessIdentity, type ProcessIdentityProbe } from '../master-runtime/process-identity';
|
|
8
|
+
import type { SupervisedWorkerRateLimitSession } from '../config-worker/process-environment';
|
|
9
|
+
type PreparedIngressAdmission = PreparedWorkerAdmission & {
|
|
10
|
+
commit(dataAdmission?: CandidateDataAdmission): Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
export type MasterIngressControllerOptions = {
|
|
13
|
+
readonly rootKey: SupervisionRootKeyMaterial;
|
|
14
|
+
readonly instanceId: string;
|
|
15
|
+
readonly controllerId: string;
|
|
16
|
+
readonly controllerEpoch: number;
|
|
17
|
+
readonly controlPort: number;
|
|
18
|
+
readonly publicHost: string;
|
|
19
|
+
readonly publicPort: number;
|
|
20
|
+
readonly instanceLockPath: string;
|
|
21
|
+
readonly accessLogDbPath?: string;
|
|
22
|
+
readonly transportSecret: string;
|
|
23
|
+
readonly executable: string;
|
|
24
|
+
readonly entry: string;
|
|
25
|
+
readonly cwd: string;
|
|
26
|
+
readonly startupTimeoutMs?: number;
|
|
27
|
+
readonly leaseDurationMs?: number;
|
|
28
|
+
readonly now?: () => number;
|
|
29
|
+
readonly monotonicNow?: () => number;
|
|
30
|
+
readonly spawn?: typeof spawnChild;
|
|
31
|
+
readonly environment?: Readonly<NodeJS.ProcessEnv>;
|
|
32
|
+
readonly fetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
33
|
+
readonly onRecovered?: (event: MasterIngressRecoveryEvent) => Promise<MasterIngressRecoveryResult | void> | MasterIngressRecoveryResult | void;
|
|
34
|
+
readonly onNewBootAccepted?: (event: Extract<MasterIngressRecoveryEvent, {
|
|
35
|
+
readonly kind: 'new_boot';
|
|
36
|
+
}>) => void;
|
|
37
|
+
readonly onAdmissionResolved?: (event: {
|
|
38
|
+
readonly target: AdmissionSet;
|
|
39
|
+
readonly outcome: 'committed' | 'not_committed';
|
|
40
|
+
readonly previousActive: AdmissionSet | null;
|
|
41
|
+
}) => Promise<void> | void;
|
|
42
|
+
/** Injectable exact-process OS operations; production defaults to the real capture/probe primitive. */
|
|
43
|
+
readonly processIdentity?: IngressProcessIdentityControl;
|
|
44
|
+
/** Sleep used between shutdown exit probes; injectable for unit tests. */
|
|
45
|
+
readonly probeSleep?: (ms: number) => Promise<void>;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Exact OS-level process operations over the ingress PID. The PID is trusted only from the
|
|
49
|
+
* authenticated signed status body; capture proves the OS process carries the identity
|
|
50
|
+
* marker before any attach is accepted, and probe is the only shutdown exit evidence.
|
|
51
|
+
*/
|
|
52
|
+
export type IngressProcessIdentityControl = Readonly<{
|
|
53
|
+
readonly capture: (pid: number, processInstanceId: string) => Promise<CapturedProcessIdentity>;
|
|
54
|
+
readonly probe: (expected: CapturedProcessIdentity) => Promise<ProcessIdentityProbe>;
|
|
55
|
+
}>;
|
|
56
|
+
export type MasterIngressControllerState = 'attached' | 'control_recovering' | 'stopped';
|
|
57
|
+
export type MasterIngressControllerOrigin = 'adopted' | 'spawned';
|
|
58
|
+
export type MasterIngressMutationReadinessReason = 'not_attached' | 'authority_mismatch' | 'lease_margin' | 'active_missing' | 'prepared_pending' | 'retired_pending' | 'retired_release_pending' | 'active_operation' | 'active_revision_mismatch' | 'active_content_mismatch' | 'plugin_catalog_mismatch';
|
|
59
|
+
export type MasterIngressMutationReadiness = {
|
|
60
|
+
readonly ready: true;
|
|
61
|
+
} | {
|
|
62
|
+
readonly ready: false;
|
|
63
|
+
readonly reason: MasterIngressMutationReadinessReason;
|
|
64
|
+
};
|
|
65
|
+
export type MasterIngressMutationReadinessEvidence = {
|
|
66
|
+
readonly revision: number;
|
|
67
|
+
readonly content_hash: string;
|
|
68
|
+
readonly plugin_catalog_hash: string;
|
|
69
|
+
readonly hasActiveOperation: boolean;
|
|
70
|
+
};
|
|
71
|
+
export type MasterIngressRecoveryResult = 'complete' | 'retryable' | 'fatal';
|
|
72
|
+
export type IngressBootRecoveryToken = number;
|
|
73
|
+
export type MasterIngressStartupFailureDisposition = {
|
|
74
|
+
readonly kind: 'preserved';
|
|
75
|
+
readonly origin: MasterIngressControllerOrigin | null;
|
|
76
|
+
readonly evidence: {
|
|
77
|
+
readonly registry: IngressStatusPayload['registry'] | null;
|
|
78
|
+
readonly statusRefreshed: boolean;
|
|
79
|
+
readonly pendingAdmission: boolean;
|
|
80
|
+
readonly uncertainAdmission: boolean;
|
|
81
|
+
readonly pendingRetiredRelease: boolean;
|
|
82
|
+
readonly reason: 'adopted' | 'active' | 'prepared' | 'uncertain' | 'status_unavailable' | 'unowned';
|
|
83
|
+
};
|
|
84
|
+
} | {
|
|
85
|
+
readonly kind: 'shutdown_safe_empty';
|
|
86
|
+
readonly origin: 'spawned';
|
|
87
|
+
readonly evidence: {
|
|
88
|
+
readonly registry: IngressStatusPayload['registry'];
|
|
89
|
+
readonly statusRefreshed: true;
|
|
90
|
+
readonly pendingAdmission: false;
|
|
91
|
+
readonly uncertainAdmission: false;
|
|
92
|
+
readonly pendingRetiredRelease: false;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
export type MasterIngressRecoveryEvent = {
|
|
96
|
+
readonly kind: 'same_boot';
|
|
97
|
+
readonly token?: IngressBootRecoveryToken;
|
|
98
|
+
} | {
|
|
99
|
+
readonly kind: 'new_boot';
|
|
100
|
+
readonly previous: ProcessIdentity;
|
|
101
|
+
readonly current: ProcessIdentity;
|
|
102
|
+
readonly token: IngressBootRecoveryToken;
|
|
103
|
+
};
|
|
104
|
+
export declare class MasterIngressControllerError extends Error {
|
|
105
|
+
readonly code: 'control_recovering' | 'outcome_unknown' | 'admission_not_committed' | 'not_attached' | 'unavailable' | 'invalid_options' | 'stale_boot';
|
|
106
|
+
readonly name = "MasterIngressControllerError";
|
|
107
|
+
constructor(code: 'control_recovering' | 'outcome_unknown' | 'admission_not_committed' | 'not_attached' | 'unavailable' | 'invalid_options' | 'stale_boot', message: string, options?: {
|
|
108
|
+
readonly cause?: unknown;
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
type AdmissionHandleScope = {
|
|
112
|
+
readonly boot: number;
|
|
113
|
+
connection: number;
|
|
114
|
+
readonly lifecycle: number;
|
|
115
|
+
};
|
|
116
|
+
export declare class MasterIngressController implements WorkerAdmissionController {
|
|
117
|
+
private readonly options;
|
|
118
|
+
private readonly spawn;
|
|
119
|
+
private readonly startupTimeoutMs;
|
|
120
|
+
private readonly leaseDurationMs;
|
|
121
|
+
private readonly now;
|
|
122
|
+
private readonly monotonicNow;
|
|
123
|
+
private authority;
|
|
124
|
+
private client;
|
|
125
|
+
private child;
|
|
126
|
+
private queue;
|
|
127
|
+
private queueGeneration;
|
|
128
|
+
private queueGenerationController;
|
|
129
|
+
private leaseTimer;
|
|
130
|
+
private recoveryTimerScheduled;
|
|
131
|
+
private recoveryAttempt;
|
|
132
|
+
private sequence;
|
|
133
|
+
private admissionSequence;
|
|
134
|
+
private state;
|
|
135
|
+
private ingressOrigin;
|
|
136
|
+
private disconnected;
|
|
137
|
+
private recoveryCallbackRunning;
|
|
138
|
+
private recoveryCallbackPending;
|
|
139
|
+
private childCredential;
|
|
140
|
+
private readonly fetch;
|
|
141
|
+
private readonly stateListeners;
|
|
142
|
+
private readonly eligibilityListeners;
|
|
143
|
+
private pendingAdmission;
|
|
144
|
+
private trustedStatus;
|
|
145
|
+
private leaseDeadline;
|
|
146
|
+
private trustedStatusAt;
|
|
147
|
+
private trustedStatusAuthority;
|
|
148
|
+
/** Set only after a challenge/attach exchange and a signed status response. */
|
|
149
|
+
private authenticatedIngressIdentity;
|
|
150
|
+
/** Exact OS identity captured from the authenticated status pid; the only shutdown-probe baseline. */
|
|
151
|
+
private capturedIngressIdentity;
|
|
152
|
+
private readonly identityControl;
|
|
153
|
+
private readonly probeSleep;
|
|
154
|
+
private readonly probeIntervalMs;
|
|
155
|
+
private pendingRetiredRelease;
|
|
156
|
+
private uncertainAdmission;
|
|
157
|
+
private pendingPrepareRecovery;
|
|
158
|
+
private resolvingUncertain;
|
|
159
|
+
private recoveryEvent;
|
|
160
|
+
private pendingNewBootEvent;
|
|
161
|
+
private pendingSameBoot;
|
|
162
|
+
private retryRecoveryEvent;
|
|
163
|
+
private recoveryTokenActive;
|
|
164
|
+
private bootGeneration;
|
|
165
|
+
private connectionGeneration;
|
|
166
|
+
private lifecycleGeneration;
|
|
167
|
+
private sessionPublicationAllowed;
|
|
168
|
+
constructor(options: MasterIngressControllerOptions);
|
|
169
|
+
get currentState(): MasterIngressControllerState;
|
|
170
|
+
get origin(): MasterIngressControllerOrigin | null;
|
|
171
|
+
get controlPort(): number;
|
|
172
|
+
get publicPort(): number;
|
|
173
|
+
authenticatedRateLimitSession(token?: IngressBootRecoveryToken): SupervisedWorkerRateLimitSession | null;
|
|
174
|
+
subscribeState(listener: (state: MasterIngressControllerState) => void): () => void;
|
|
175
|
+
subscribeEligibilityChange(listener: () => void): () => void;
|
|
176
|
+
mutationReadiness(evidence?: MasterIngressMutationReadinessEvidence): MasterIngressMutationReadiness;
|
|
177
|
+
isMutationReady(evidence?: MasterIngressMutationReadinessEvidence): boolean;
|
|
178
|
+
/** Recovery control may run with no active workers, but never with an untrusted control plane. */
|
|
179
|
+
isRecoveryReady(): boolean;
|
|
180
|
+
hasTrustedActiveAdmission(): boolean;
|
|
181
|
+
trustedActiveAdmission(): AdmissionSet | null;
|
|
182
|
+
trustedActiveAdmissionIfFresh(): AdmissionSet | null;
|
|
183
|
+
trustedAdmissionRegistryIfFresh(): import('./admission-registry').AdmissionRegistryStatus | null;
|
|
184
|
+
currentControllerAuthority(): ControllerAuthority;
|
|
185
|
+
cleanupAfterStartupFailure(): Promise<MasterIngressStartupFailureDisposition>;
|
|
186
|
+
private startupFailureDisposition;
|
|
187
|
+
connect(): Promise<void>;
|
|
188
|
+
prepare(workers: readonly ServingConfigWorker[], signal?: AbortSignal, handoffTimeoutMs?: number, websocketMaxConnections?: number | null, websocketMaxMessageBytes?: number, requestLogCollectorEntry?: string, preparedPolicy?: CandidateDataAdmission): Promise<PreparedIngressAdmission>;
|
|
189
|
+
status(scope?: AdmissionHandleScope): Promise<IngressStatusPayload>;
|
|
190
|
+
/** A recovered commit has no new prepare/commit side effect. Every release stays boot-fenced. */
|
|
191
|
+
recoverActiveAdmission(expected: AdmissionSet, retiredInstances: readonly string[]): Promise<PreparedWorkerAdmission>;
|
|
192
|
+
private statusNow;
|
|
193
|
+
/** Establishes a sequence fence, then returns fresh signed registry evidence. */
|
|
194
|
+
fenceAndStatus(token?: IngressBootRecoveryToken): Promise<IngressStatusPayload['registry']>;
|
|
195
|
+
recover(): Promise<void>;
|
|
196
|
+
private recoverControl;
|
|
197
|
+
disconnect(): Promise<void>;
|
|
198
|
+
/** Synchronously prevents queued recovery, spawning, and session publication. */
|
|
199
|
+
stopRecovery(): void;
|
|
200
|
+
shutdownDataPlane(): Promise<void>;
|
|
201
|
+
/**
|
|
202
|
+
* Bounded OS probe of the saved exact identity: dead or mismatch proves the owned ingress
|
|
203
|
+
* instance is gone (including PID replacement); exact and unknown are retried within
|
|
204
|
+
* the same deadline and never count as exit proof. The child exit event is not used as a
|
|
205
|
+
* separate proof channel — the probe is unified for spawned and adopted ingresses.
|
|
206
|
+
*/
|
|
207
|
+
private probeIngressExit;
|
|
208
|
+
stop(shutdown?: boolean): Promise<void>;
|
|
209
|
+
private attachToExisting;
|
|
210
|
+
private spawnAndAttach;
|
|
211
|
+
private waitForIdentityAfterSpawn;
|
|
212
|
+
/**
|
|
213
|
+
* The pid is trusted only from the authenticated signed status body; the OS capture must
|
|
214
|
+
* prove that very process carries the identity marker before an attach is accepted.
|
|
215
|
+
*/
|
|
216
|
+
private captureIngressIdentity;
|
|
217
|
+
/**
|
|
218
|
+
* Oracle P1 gate: an authenticated new boot may replace the captured OS identity only
|
|
219
|
+
* when the previous capture proves the old ingress is gone (dead or PID replacement).
|
|
220
|
+
* exact or unknown — or an old authenticated boot without any capture — rejects the
|
|
221
|
+
* transfer while the recovery loop, the old client, and the old identity are kept; no
|
|
222
|
+
* OS signal is sent. A same-boot re-attach refreshes its own capture and is not an
|
|
223
|
+
* ownership transfer. Old ownership is judged only by authenticatedIngressIdentity —
|
|
224
|
+
* ingressOrigin is set by the very spawn in flight and never proves a prior boot.
|
|
225
|
+
*/
|
|
226
|
+
private requireOwnershipRelease;
|
|
227
|
+
private credential;
|
|
228
|
+
private mapDiscoveryFailure;
|
|
229
|
+
private baseUrl;
|
|
230
|
+
private isRecoveryEligible;
|
|
231
|
+
private assertRecoveryEligible;
|
|
232
|
+
private captureAdmissionHandleScope;
|
|
233
|
+
private assertAdmissionHandleScope;
|
|
234
|
+
private startLeaseRenewal;
|
|
235
|
+
private scheduleLeaseRenewal;
|
|
236
|
+
private scheduleRecovery;
|
|
237
|
+
private recoverNow;
|
|
238
|
+
private recoverNewBoot;
|
|
239
|
+
private acceptNewBoot;
|
|
240
|
+
private resetForNewBoot;
|
|
241
|
+
private assertCurrentRecoveryToken;
|
|
242
|
+
private queueRecoveryEvent;
|
|
243
|
+
private takeNextRecoveryEvent;
|
|
244
|
+
private markControlRecovering;
|
|
245
|
+
private invokeRecovered;
|
|
246
|
+
private resolvePendingAdmission;
|
|
247
|
+
private cancelTimer;
|
|
248
|
+
private requireMutation;
|
|
249
|
+
private nextSequence;
|
|
250
|
+
private rotateQueueGeneration;
|
|
251
|
+
private enqueueTask;
|
|
252
|
+
/** Serialized with worker-set mutations and authenticated by supervision commands. */
|
|
253
|
+
publishRuntimeState(publication: DataAdmissionPublication, signal?: AbortSignal): Promise<unknown>;
|
|
254
|
+
freezeRuntimeState(signal?: AbortSignal): Promise<unknown>;
|
|
255
|
+
freezePluginKey(plugin: string, keyId: string, signal?: AbortSignal): Promise<unknown>;
|
|
256
|
+
queryRuntimeState(signal?: AbortSignal): Promise<unknown>;
|
|
257
|
+
private enqueue;
|
|
258
|
+
private command;
|
|
259
|
+
private clearFreshness;
|
|
260
|
+
private beginUncertainAdmission;
|
|
261
|
+
private sendAdmissionCommit;
|
|
262
|
+
private beginPrepareRecovery;
|
|
263
|
+
private commitAdmission;
|
|
264
|
+
private resolveAdmission;
|
|
265
|
+
private resolveUncertain;
|
|
266
|
+
private resolvePrepareRecovery;
|
|
267
|
+
private releaseRetiredAfterExitProof;
|
|
268
|
+
private releaseRetiredAttempt;
|
|
269
|
+
private admissionOutcomeUnknown;
|
|
270
|
+
private safeToAbort;
|
|
271
|
+
private abortAdmission;
|
|
272
|
+
private statusAfterFailure;
|
|
273
|
+
private trustStatus;
|
|
274
|
+
private setState;
|
|
275
|
+
private notifyEligibilityChange;
|
|
276
|
+
private toAdmissionSet;
|
|
277
|
+
}
|
|
278
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { acquireInstanceLock } from '../instance-lock';
|
|
2
|
+
import { type SupervisionProcessCredential } from '../supervision';
|
|
3
|
+
export declare const INGRESS_SUPERVISION_HOST = "127.0.0.1";
|
|
4
|
+
export type IngressRuntimeOptions = {
|
|
5
|
+
readonly instanceLockPath: string;
|
|
6
|
+
readonly accessLogDbPath?: string;
|
|
7
|
+
readonly fileLogDir?: string;
|
|
8
|
+
readonly credential: SupervisionProcessCredential;
|
|
9
|
+
readonly transportSecret: string;
|
|
10
|
+
readonly publicHost: string;
|
|
11
|
+
readonly publicPort: number;
|
|
12
|
+
readonly supervisionPort: number;
|
|
13
|
+
readonly acquireLock?: typeof acquireInstanceLock;
|
|
14
|
+
/** Startup attach watchdog: self-stops when no authenticated attach arrives in time. */
|
|
15
|
+
readonly startupWatchdogMs?: number;
|
|
16
|
+
};
|
|
17
|
+
export type IngressProcessHandle = {
|
|
18
|
+
readonly publicPort: number | null;
|
|
19
|
+
readonly supervisionPort: number | null;
|
|
20
|
+
stop(): Promise<void>;
|
|
21
|
+
};
|
|
22
|
+
export declare function startIngressProcess(options: IngressRuntimeOptions): Promise<IngressProcessHandle>;
|
|
23
|
+
export type IngressEnvironmentOptions = Omit<IngressRuntimeOptions, 'instanceLockPath' | 'publicHost' | 'publicPort' | 'supervisionPort'> & {
|
|
24
|
+
readonly instanceLockPath?: string;
|
|
25
|
+
readonly publicHost?: string;
|
|
26
|
+
readonly publicPort?: number;
|
|
27
|
+
readonly supervisionPort?: number;
|
|
28
|
+
};
|
|
29
|
+
export declare function ingressOptionsFromEnvironment(credential: SupervisionProcessCredential, transportSecret: string, environment?: Record<string, string | undefined>): IngressRuntimeOptions;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import type { DataAdmissionHost } from '../data-admission/host';
|
|
2
|
+
import { PendingChallengeStore, SupervisionAuthorityGuard, SupervisionCommandGuard, type ControllerAuthority, type PendingChallenge, type ProcessIdentity, type SupervisionProcessCredential } from '../supervision';
|
|
3
|
+
import { IngressAdmissionRegistry, type AdmissionRegistryStatus } from './admission-registry';
|
|
4
|
+
export declare const DEFAULT_INGRESS_SUPERVISION_BODY_BYTES = 1048576;
|
|
5
|
+
export type IngressSupervisionServerOptions = {
|
|
6
|
+
readonly credential: SupervisionProcessCredential;
|
|
7
|
+
readonly registry: IngressAdmissionRegistry;
|
|
8
|
+
readonly dataAdmission?: DataAdmissionHost;
|
|
9
|
+
readonly challenges?: PendingChallengeStore;
|
|
10
|
+
readonly authority?: SupervisionAuthorityGuard;
|
|
11
|
+
readonly commands?: SupervisionCommandGuard;
|
|
12
|
+
readonly clock?: () => number;
|
|
13
|
+
readonly maxBodyBytes?: number;
|
|
14
|
+
readonly bodyTimeoutMs?: number;
|
|
15
|
+
readonly attachGraceMs?: number;
|
|
16
|
+
/** Reported in every signed status body; defaults to process.pid. Unit tests inject a fixed value. */
|
|
17
|
+
readonly pid?: number;
|
|
18
|
+
/** Invoked once an authenticated attach is accepted; cancels the runtime startup watchdog. */
|
|
19
|
+
readonly onAttached?: () => void;
|
|
20
|
+
readonly onShutdown?: () => Promise<void> | void;
|
|
21
|
+
};
|
|
22
|
+
export type IngressStatusPayload = {
|
|
23
|
+
readonly pid: number;
|
|
24
|
+
readonly state: 'frozen' | 'attached';
|
|
25
|
+
readonly dataAdmission?: {
|
|
26
|
+
readonly version: number;
|
|
27
|
+
readonly blocked: boolean;
|
|
28
|
+
};
|
|
29
|
+
readonly registry: AdmissionRegistryStatus;
|
|
30
|
+
};
|
|
31
|
+
export type IngressHandoffStatus = {
|
|
32
|
+
readonly retired_id: string;
|
|
33
|
+
readonly pending: number;
|
|
34
|
+
readonly complete: boolean;
|
|
35
|
+
readonly remaining_ms: number;
|
|
36
|
+
};
|
|
37
|
+
export declare function parseIngressStatusPayload(value: unknown): IngressStatusPayload;
|
|
38
|
+
export declare class IngressHttpError extends Error {
|
|
39
|
+
readonly code: 'body_too_large' | 'body_timeout' | 'invalid_json';
|
|
40
|
+
readonly status: 400 | 408 | 413;
|
|
41
|
+
readonly name = "IngressHttpError";
|
|
42
|
+
constructor(code: 'body_too_large' | 'body_timeout' | 'invalid_json', status: 400 | 408 | 413);
|
|
43
|
+
}
|
|
44
|
+
export declare class IngressDiscoveryError extends Error {
|
|
45
|
+
readonly code: 'unavailable' | 'outcome_unknown';
|
|
46
|
+
readonly name = "IngressDiscoveryError";
|
|
47
|
+
constructor(code: 'unavailable' | 'outcome_unknown', message: string, options?: {
|
|
48
|
+
readonly cause?: unknown;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
export declare function discoverIngressIdentity(baseUrl: string, send?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>, timeoutMs?: number, parentSignal?: AbortSignal): Promise<ProcessIdentity>;
|
|
52
|
+
export declare class IngressSupervisionHttpServer {
|
|
53
|
+
private readonly options;
|
|
54
|
+
readonly identity: ProcessIdentity;
|
|
55
|
+
readonly challenges: PendingChallengeStore;
|
|
56
|
+
readonly authority: SupervisionAuthorityGuard;
|
|
57
|
+
readonly commands: SupervisionCommandGuard;
|
|
58
|
+
private readonly credential;
|
|
59
|
+
private readonly registry;
|
|
60
|
+
private readonly clock;
|
|
61
|
+
private readonly maxBodyBytes;
|
|
62
|
+
private readonly bodyTimeoutMs;
|
|
63
|
+
private readonly attachGraceMs;
|
|
64
|
+
private readonly pid;
|
|
65
|
+
private readonly onAttached?;
|
|
66
|
+
private readonly onShutdown?;
|
|
67
|
+
private attached;
|
|
68
|
+
private frozen;
|
|
69
|
+
private admissionFence;
|
|
70
|
+
private preparedPolicy;
|
|
71
|
+
private deadline;
|
|
72
|
+
private deadlineTimer;
|
|
73
|
+
private statusSequence;
|
|
74
|
+
constructor(options: IngressSupervisionServerOptions);
|
|
75
|
+
fetch(request: Request): Promise<Response>;
|
|
76
|
+
isFrozen(): boolean;
|
|
77
|
+
/** True once an authenticated attach has been accepted; never reset by lease freeze. */
|
|
78
|
+
isAttached(): boolean;
|
|
79
|
+
stop(): void;
|
|
80
|
+
private freezeAt;
|
|
81
|
+
private scheduleDeadline;
|
|
82
|
+
private identityResponse;
|
|
83
|
+
private signedStatus;
|
|
84
|
+
private statusResponse;
|
|
85
|
+
private statusRequest;
|
|
86
|
+
private challenge;
|
|
87
|
+
private attach;
|
|
88
|
+
private lease;
|
|
89
|
+
private command;
|
|
90
|
+
private clearPreparedPolicy;
|
|
91
|
+
private loadCandidatePolicy;
|
|
92
|
+
}
|
|
93
|
+
export type IngressControllerClientOptions = {
|
|
94
|
+
readonly baseUrl: string;
|
|
95
|
+
readonly credential: SupervisionProcessCredential;
|
|
96
|
+
readonly fetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
97
|
+
readonly timeoutMs?: number;
|
|
98
|
+
};
|
|
99
|
+
export declare class IngressControllerClient {
|
|
100
|
+
private readonly options;
|
|
101
|
+
private readonly send;
|
|
102
|
+
private readonly timeoutMs;
|
|
103
|
+
private readonly statusReplay;
|
|
104
|
+
private statusRequestSequence;
|
|
105
|
+
constructor(options: IngressControllerClientOptions);
|
|
106
|
+
identity(signal?: AbortSignal): Promise<ProcessIdentity>;
|
|
107
|
+
challenge(authority: ControllerAuthority, requestId?: `${string}-${string}-${string}-${string}-${string}`, sequence?: number, signal?: AbortSignal): Promise<PendingChallenge>;
|
|
108
|
+
status(authority: ControllerAuthority, sequence?: number, signal?: AbortSignal): Promise<IngressStatusPayload>;
|
|
109
|
+
fence(authority: ControllerAuthority, sequence: number, requestId?: `${string}-${string}-${string}-${string}-${string}`, signal?: AbortSignal): Promise<IngressStatusPayload>;
|
|
110
|
+
attach(challenge: PendingChallenge, authority: ControllerAuthority, sequence?: number, requestId?: `${string}-${string}-${string}-${string}-${string}`, signal?: AbortSignal): Promise<unknown>;
|
|
111
|
+
lease(authority: ControllerAuthority, leaseExpiresAt: number, sequence: number, requestId?: `${string}-${string}-${string}-${string}-${string}`, signal?: AbortSignal): Promise<unknown>;
|
|
112
|
+
command(authority: ControllerAuthority, sequence: number, path: string, body: unknown, requestId?: `${string}-${string}-${string}-${string}-${string}`, signal?: AbortSignal): Promise<unknown>;
|
|
113
|
+
private post;
|
|
114
|
+
private request;
|
|
115
|
+
private verifyEnvelope;
|
|
116
|
+
private verifyStatus;
|
|
117
|
+
}
|
|
118
|
+
export declare function credentialFromSerialized(value: string): SupervisionProcessCredential;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
import { type IngressProcessHandle } from './ingress/runtime';
|
|
3
|
+
export * from './ingress/index';
|
|
4
|
+
export declare function startIngressProcess(): Promise<IngressProcessHandle>;
|
|
5
|
+
export declare function startIngressProcessFromEnvironment(environment?: Record<string, string | undefined>): Promise<IngressProcessHandle>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { acquireMasterInstanceLock as acquireInstanceLock, mintControllerClaimCapability, consumeControllerClaimCapability, MasterInstanceLockError, } from './master-runtime/instance-lock';
|
|
2
|
+
export type { ControllerClaimCapability, MasterInstanceLock } from './master-runtime/instance-lock';
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { Database } from 'bun:sqlite';
|
|
2
|
+
import { type LogEntry } from '../api/logs';
|
|
3
|
+
import type { ConfirmedLogOwnerEnd, LogContentPatch, LogMetadataPatch, LogObservationBinding, LogRequestInit, LogSemanticFact, LogTransportPatch, RequestLogScope } from '../gateway/request-log-contracts';
|
|
4
|
+
export interface ProcessingStep {
|
|
5
|
+
step: string;
|
|
6
|
+
detail?: any;
|
|
7
|
+
timestamp: number;
|
|
8
|
+
duration?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface AccessLogIdentity {
|
|
11
|
+
recordKind?: 'access' | 'operation' | 'attempt';
|
|
12
|
+
accessId?: string;
|
|
13
|
+
operationId?: string;
|
|
14
|
+
protocol?: string;
|
|
15
|
+
operation?: string;
|
|
16
|
+
closeCode?: number;
|
|
17
|
+
}
|
|
18
|
+
/** Attempt fields describe diagnostic executions, never the primary request result. */
|
|
19
|
+
export interface AccessLogEntry extends AccessLogIdentity {
|
|
20
|
+
scope: RequestLogScope;
|
|
21
|
+
revision: number;
|
|
22
|
+
requestId: string;
|
|
23
|
+
timestamp: number;
|
|
24
|
+
method: string;
|
|
25
|
+
path: string;
|
|
26
|
+
status: number | null;
|
|
27
|
+
duration: number;
|
|
28
|
+
transportType?: 'http' | 'websocket' | null;
|
|
29
|
+
query?: string;
|
|
30
|
+
routePath?: string;
|
|
31
|
+
upstream?: string;
|
|
32
|
+
transformer?: string;
|
|
33
|
+
transformedPath?: string;
|
|
34
|
+
processingSteps?: ProcessingStep[];
|
|
35
|
+
authSuccess?: boolean;
|
|
36
|
+
authLevel?: string;
|
|
37
|
+
errorMessage?: string;
|
|
38
|
+
reqBodyId?: string;
|
|
39
|
+
respBodyId?: string;
|
|
40
|
+
reqHeaderId?: string;
|
|
41
|
+
respHeaderId?: string;
|
|
42
|
+
originalReqHeaderId?: string;
|
|
43
|
+
originalReqBodyId?: string;
|
|
44
|
+
isFailoverAttempt?: boolean;
|
|
45
|
+
parentRequestId?: string;
|
|
46
|
+
attemptNumber?: number;
|
|
47
|
+
attemptUpstream?: string;
|
|
48
|
+
requestType?: 'final' | 'retry' | 'recovery';
|
|
49
|
+
/** Upstream-attempt diagnostics only; these never project the primary result. */
|
|
50
|
+
transportOutcome?: 'pending' | 'completed' | 'failed' | 'cancelled' | 'unknown';
|
|
51
|
+
transportCode?: string;
|
|
52
|
+
protocolOutcome?: 'completed' | 'failed' | 'incomplete' | 'cancelled';
|
|
53
|
+
protocolCode?: string;
|
|
54
|
+
}
|
|
55
|
+
/** Every physical writer uses this same persisted transaction reducer. */
|
|
56
|
+
export declare class AccessLogWriter {
|
|
57
|
+
private readonly maxQueuedEntries;
|
|
58
|
+
private readonly kernelBootId?;
|
|
59
|
+
private readonly db;
|
|
60
|
+
private queue;
|
|
61
|
+
private retainedBytes;
|
|
62
|
+
private inFlight;
|
|
63
|
+
private deadlineTimer;
|
|
64
|
+
private scheduled;
|
|
65
|
+
private closed;
|
|
66
|
+
private projectionSink?;
|
|
67
|
+
private pendingNotifications;
|
|
68
|
+
private notifications;
|
|
69
|
+
private projected;
|
|
70
|
+
private correctionCursor;
|
|
71
|
+
private correctionsPending;
|
|
72
|
+
constructor(databaseOrPath: Database | string, maxQueuedEntries?: number, kernelBootId?: string | undefined);
|
|
73
|
+
beginRequest(value: LogRequestInit): boolean;
|
|
74
|
+
bindObservation(value: LogObservationBinding): boolean;
|
|
75
|
+
writeSemantic(value: LogSemanticFact): boolean;
|
|
76
|
+
patchTransport(value: LogTransportPatch): boolean;
|
|
77
|
+
patchContent(value: LogContentPatch): boolean;
|
|
78
|
+
patchMetadata(value: LogMetadataPatch): boolean;
|
|
79
|
+
endOwner(value: ConfirmedLogOwnerEnd): boolean;
|
|
80
|
+
writeAttempt(value: AccessLogEntry): boolean;
|
|
81
|
+
getDatabase(): Database;
|
|
82
|
+
setProjectionSink(sink: (entry: LogEntry) => void): void;
|
|
83
|
+
/** Called by the master holding the access database instance lock, before starting producers. */
|
|
84
|
+
recoverKernelBoot(bootId: string): void;
|
|
85
|
+
/** Called by ingress after acquiring the same exclusive lock file and before serving requests. */
|
|
86
|
+
replaceIngressOwner(lockId: string, ownerId: string): void;
|
|
87
|
+
private recoverOwners;
|
|
88
|
+
private enqueue;
|
|
89
|
+
private scheduleFlush;
|
|
90
|
+
flush(): Promise<void>;
|
|
91
|
+
private read;
|
|
92
|
+
private applyOwnerEnd;
|
|
93
|
+
private apply;
|
|
94
|
+
private ownerEnd;
|
|
95
|
+
private publicTransport;
|
|
96
|
+
private projectResult;
|
|
97
|
+
private save;
|
|
98
|
+
private claimProjection;
|
|
99
|
+
private recoverCorrections;
|
|
100
|
+
private emitProjections;
|
|
101
|
+
private settleDeadlines;
|
|
102
|
+
private armDeadline;
|
|
103
|
+
private saveAttempt;
|
|
104
|
+
private retentionWatermark;
|
|
105
|
+
close(): Promise<void>;
|
|
106
|
+
}
|
|
107
|
+
export declare const accessLogWriter: {
|
|
108
|
+
beginRequest: (value: LogRequestInit) => boolean;
|
|
109
|
+
bindObservation: (value: LogObservationBinding) => boolean;
|
|
110
|
+
writeSemantic: (value: LogSemanticFact) => boolean;
|
|
111
|
+
patchTransport: (value: LogTransportPatch) => boolean;
|
|
112
|
+
patchContent: (value: LogContentPatch) => boolean;
|
|
113
|
+
patchMetadata: (value: LogMetadataPatch) => boolean;
|
|
114
|
+
endOwner: (value: ConfirmedLogOwnerEnd) => boolean;
|
|
115
|
+
writeAttempt: (value: AccessLogEntry) => boolean;
|
|
116
|
+
getDatabase: () => Database;
|
|
117
|
+
setProjectionSink: (sink: (entry: LogEntry) => void) => void;
|
|
118
|
+
flush: () => Promise<void>;
|
|
119
|
+
close: () => Promise<void>;
|
|
120
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BodyHandle, BodyViewIdentity } from '../gateway/body-contracts';
|
|
2
|
+
import type { RequestLogBodyHandler, RequestLogContentSink } from '../gateway/request-log-contracts';
|
|
3
|
+
export declare function trackBodyLogTask(task: Promise<void>): void;
|
|
4
|
+
export type BodyCapture = {
|
|
5
|
+
body: ReadableStream<Uint8Array>;
|
|
6
|
+
completion: Promise<void>;
|
|
7
|
+
stop(): void;
|
|
8
|
+
};
|
|
9
|
+
export type BodyCaptureReason = 'size_limit' | 'buffer_capacity' | 'cancelled' | 'stream_failed' | 'not_consumed' | 'capture_failed' | 'decode_failed' | 'parser_timeout' | 'storage_failed';
|
|
10
|
+
export interface BodyCaptureOptions {
|
|
11
|
+
bodyHandle?: BodyHandle;
|
|
12
|
+
identity?: BodyViewIdentity;
|
|
13
|
+
maxBodyBytes?: number;
|
|
14
|
+
content?: RequestLogContentSink;
|
|
15
|
+
nativeUnavailable?(reason: BodyCaptureReason): void;
|
|
16
|
+
}
|
|
17
|
+
type StreamSink = (chunks: AsyncIterable<string>, completed: Promise<void>, signal: AbortSignal, format?: 'text') => Promise<void>;
|
|
18
|
+
/** Transport pulls the wire; the parser has only an optional bounded view. */
|
|
19
|
+
export declare function captureBody(source: ReadableStream<Uint8Array>, maxBytes: number, coding: string, parse: RequestLogBodyHandler, save: (body: unknown) => Promise<void>, incomplete: (reason: BodyCaptureReason) => void, signal?: AbortSignal, options?: BodyCaptureOptions, saveStream?: StreamSink): BodyCapture;
|
|
20
|
+
export declare function flushBodyCaptures(): Promise<void>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const SECRET_KEY: RegExp;
|
|
2
|
+
export declare function redactLogText(value: string): string;
|
|
3
|
+
export declare function serializeLogContent(value: unknown): string;
|
|
4
|
+
export declare function retainedLogContentSize(value: unknown, limit: number): number;
|
|
5
|
+
export declare function isLogJson(value: string): Promise<boolean>;
|
|
6
|
+
export declare function redactBodyStream(chunks: AsyncIterable<string> | Iterable<string>, maxBytes: number, signal: AbortSignal, format?: 'text'): AsyncIterable<string>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { JsonValue } from '../gateway/request-log-contracts';
|
|
2
|
+
export interface BodyStorageConfig {
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
maxSize: number;
|
|
5
|
+
retentionDays: number;
|
|
6
|
+
}
|
|
7
|
+
declare const BODY_TYPES: readonly ["original-request", "request", "response"];
|
|
8
|
+
type BodyType = typeof BODY_TYPES[number];
|
|
9
|
+
/**
|
|
10
|
+
* Body 存储管理器
|
|
11
|
+
*
|
|
12
|
+
* 特性:
|
|
13
|
+
* - 按日期分层存储(logs/bodies/YYYY-MM-DD/)
|
|
14
|
+
* - 大小限制检查
|
|
15
|
+
* - 提供按日期清理能力(由 Master 调度)
|
|
16
|
+
*/
|
|
17
|
+
export declare class BodyStorageManager {
|
|
18
|
+
private config;
|
|
19
|
+
private readonly bodiesDir;
|
|
20
|
+
constructor(config?: Partial<BodyStorageConfig>, bodiesDir?: string);
|
|
21
|
+
/**
|
|
22
|
+
* 保存 body 内容
|
|
23
|
+
* @param requestId 请求 ID
|
|
24
|
+
* @param body body 内容
|
|
25
|
+
* @param type body 类型(request/response)
|
|
26
|
+
* @param isErrorResponse 是否是错误响应(错误响应不受大小限制)
|
|
27
|
+
* @returns body ID(如果保存成功),或 null
|
|
28
|
+
*/
|
|
29
|
+
save(requestId: string, body: any, type: 'request' | 'response' | 'original-request', isErrorResponse?: boolean): Promise<string | null>;
|
|
30
|
+
/** Persist an JSON or text value without retaining it in memory. */
|
|
31
|
+
saveStream(requestId: string, chunks: AsyncIterable<string> | Iterable<string>, type: BodyType, maxBytes: number, completed: Promise<void>, signal: AbortSignal, format?: 'text'): Promise<string | null>;
|
|
32
|
+
openStream(bodyId: string): Promise<Blob | null>;
|
|
33
|
+
/**
|
|
34
|
+
* 读取 body 内容
|
|
35
|
+
*/
|
|
36
|
+
load(bodyId: string): Promise<{
|
|
37
|
+
found: true;
|
|
38
|
+
value: JsonValue;
|
|
39
|
+
} | {
|
|
40
|
+
found: false;
|
|
41
|
+
}>;
|
|
42
|
+
/**
|
|
43
|
+
* 清理过期 body 数据
|
|
44
|
+
*/
|
|
45
|
+
cleanup(cutoffTime?: number, signal?: AbortSignal): Promise<{
|
|
46
|
+
deletedDirs: number;
|
|
47
|
+
deletedFiles: number;
|
|
48
|
+
}>;
|
|
49
|
+
/**
|
|
50
|
+
* 更新配置
|
|
51
|
+
*/
|
|
52
|
+
updateConfig(config: Partial<BodyStorageConfig>): void;
|
|
53
|
+
/**
|
|
54
|
+
* 获取配置
|
|
55
|
+
*/
|
|
56
|
+
getConfig(): BodyStorageConfig;
|
|
57
|
+
/**
|
|
58
|
+
* 获取 body 文件路径
|
|
59
|
+
*/
|
|
60
|
+
private getBodyFilePath;
|
|
61
|
+
private isDate;
|
|
62
|
+
private isSafeDirectory;
|
|
63
|
+
private ensureSafeDirectory;
|
|
64
|
+
private isSafeRegularFile;
|
|
65
|
+
private isSafePath;
|
|
66
|
+
/**
|
|
67
|
+
* 获取日期字符串(YYYY-MM-DD)
|
|
68
|
+
*/
|
|
69
|
+
private getDateString;
|
|
70
|
+
}
|
|
71
|
+
export {};
|