import { type WorkloadSignal } from "@decionis/agent-safe-pipeline"; import { type EnforcementBoundary } from "../boundary/BoundaryIdentity.js"; import { type ProvenanceProvider } from "../provenance/ProvenanceProvider.js"; import { type AcceptanceSigningKey } from "../acceptance/AcceptanceReport.js"; import { type Admission, type RunAnswer } from "../acceptance/AcceptanceRun.js"; import { HashChain } from "../audit/HashChain.js"; import type { ExposureLedger } from "../exposure/ExposureLedger.js"; import { type AddressResolver } from "../egress/GuardedFetch.js"; import type { FetchLike } from "../handlers/HandlerRegistration.js"; import { type SecretStore } from "../secrets/SecretStore.js"; import { type ActionSpaceStatus } from "../posture/ActionSpaceDrift.js"; import { type DeploymentFingerprint, type DeploymentFingerprintDocument } from "../posture/DeploymentFingerprint.js"; import { ActivationFunnel, type ActivationMilestone } from "./Activation.js"; import { type DemoAuthorityHandle } from "./DemoAuthority.js"; import { type GatewayConfig } from "./GatewayConfig.js"; import { type InstallSurface } from "./InstallSurface.js"; import { type InterceptedRequest } from "./InterceptedRequest.js"; import { type RateDecision } from "./RateLimit.js"; import { type RoutePlan } from "./RouteTable.js"; import { type ShadowSummary } from "./ShadowLedger.js"; import { type ProofAdmission, type ProofSnapshot, type TxtResolver } from "./UpstreamProof.js"; /** * When a shadow gateway prints its report unasked: as the count of settled * observations reaches each of these, and whenever a day has passed since * the last report at the moment an observation settles. A gateway that * observes nothing says nothing; the stop always prints one. */ export declare const SHADOW_REPORT_MILESTONES: readonly number[]; export declare const SHADOW_REPORT_INTERVAL_MS: number; /** The gateway's own evidence stream: what it did that the pipeline's audit contract has no event for. */ export declare const GATEWAY_STREAM = "agent-safe.gateway-events/1"; /** Every path under it belongs to the gateway and is never forwarded. */ export declare const GATEWAY_PREFIX = "/_agentsafe"; /** The version of the wire shape the gateway answers with on its own responses. */ export declare const GATEWAY_RESPONSE_VERSION = "agent-safe.gateway/1"; export interface GatewayResponse { readonly status: number; readonly headers: readonly (readonly [string, string])[]; readonly body: Buffer; } export interface GatewayIo { readonly stdout: (line: string) => void; readonly stderr: (line: string) => void; readonly color: boolean; } export interface GatewayDependencies { readonly env?: Readonly>; readonly io?: GatewayIo; /** The transport under the guard for the authority and Presence; `node:https` when absent. */ readonly authorityFetch?: FetchLike; /** The transport to the upstream; the global fetch when absent, or the guarded egress when public-only. */ readonly upstreamFetch?: FetchLike; /** Name resolution for a public-only upstream and its proof; the system resolver when absent. */ readonly upstreamResolve?: AddressResolver; /** TXT lookup for the upstream's proof; the system resolver's when absent. */ readonly upstreamResolveTxt?: TxtResolver; /** The transport under the guard for the identity provider's key set; `node:https` when absent. */ readonly subjectJwksFetch?: FetchLike; readonly secrets?: SecretStore; readonly demoAuthority?: () => Promise; readonly clock?: () => number; readonly version?: string; /** * The distribution this process was installed from, carried as `surface` * in the `User-Agent` of hosted calls; derived from the process when * absent, and `null` when it is not one of the named surfaces. */ readonly surface?: InstallSurface | null; /** The provenance providers to ask, in order; the surface picks them when unset. */ readonly provenance?: readonly ProvenanceProvider[]; /** * What a hosted call names as the example, `agentsafe-gateway@` * when absent; `agentsafe test --hosted` names itself, so the authority's * record tells a test run from a gateway in service. */ readonly clientExample?: string; /** * What the gateway this one replaces hands on: its chains are continued, * neither restored from the journal nor started again from genesis, and * its funnel's milestones are not reported twice. The upstream's proof is * not part of it: that is taken over at the swap (`takeOver`), as it * stands then. */ readonly continues?: GatewayContinuation; /** * The exposure ledger a route that releases money reserves against; the * Decionis ledger, through the authority's egress and key, when absent. * Asked only when a route declares `exposure`. */ readonly exposureLedger?: ExposureLedger; } /** * A gateway's chains and adoption funnel, handed to the gateway built to * replace it. Linking is synchronous, so the replaced gateway, finishing * what it has in flight, and its replacement write one sequence per stream. */ export interface GatewayContinuation { readonly evidence: HashChain; readonly gateway: HashChain; readonly security: HashChain; readonly activation: ActivationFunnel; /** The replaced gateway's fingerprint digest: the replacement records its own only when it differs. */ readonly fingerprint?: string; } /** Where a hosted gateway's configuration came from, when a host built it from a tenant registry. */ export interface RegistrySource { /** The registry the host last loaded, as a short digest of its text. */ readonly revision: string; /** The tenant's entry this gateway was built from, as a short digest of its fingerprint. */ readonly entry: string; } /** What `/_agentsafe/status` reports: identifiers and counts, never a value. */ export interface GatewayStatus { readonly status: "ready"; readonly version: string; readonly mode: "SHADOW" | "ENFORCEMENT"; readonly authority: string; readonly failure_policy: "FAIL_CLOSED" | "FAIL_OPEN"; readonly upstream: string; readonly routes: number; readonly held: number; readonly counts: Readonly>; readonly evidence: { readonly seq: number; readonly hash: string; }; /** The adoption milestones this process has reached, with when; never a payload. */ readonly activation: Readonly>; /** The distribution this process came from, as sent on hosted calls; null when unknown. */ readonly surface: InstallSurface | null; /** In shadow, what the authority would have decided so far, by verdict and action; null in enforcement. */ readonly shadow: ShadowSummary | null; /** What this gateway is (`agent-safe.deployment-fingerprint/1`) and its digest; absent from an older gateway. */ readonly fingerprint?: { readonly digest: string; readonly document: DeploymentFingerprintDocument; }; /** The action space it loaded against the one the deciding release was checked against; absent from an older gateway. */ readonly action_space?: ActionSpaceStatus; /** The key acceptance reports are signed with, when the gateway serves runs; null when it does not; absent from an older gateway. */ readonly acceptance?: { readonly kid: string; readonly public_jwk: AcceptanceSigningKey["publicJwk"]; } | null; /** * A hosted gateway's tenant, the tenant keys it admits now, each as a * short prefix of its digest and never the digest, and the registry it was * built from when a host built it; null for a gateway that is not hosted, * whose status may answer without the operator's token. */ readonly hosted: { readonly tenant: string | null; readonly tenant_keys: readonly string[]; readonly registry: RegistrySource | null; /** Where the upstream's proof stands, when the gateway requires one; never its text. */ readonly upstream_proof: ProofSnapshot | null; /** Whether this gateway is the only one its process serves, as an enforcing one must be. */ readonly dedicated: boolean; /** The header the gateway presents its upstream credential in; never the value. */ readonly upstream_credential: { readonly header: string; } | null; /** Whether the gateway sends its upstream a gateway token; never the token. */ readonly gateway_token: boolean; } | null; } /** How much of a `sha256:` digest a readback shows: enough to tell two apart, never the digest. */ export declare function shortDigest(digest: string): string; /** The response header that names the dossier of the INDETERMINATE attempt a request retries. */ export declare const RETRY_OF_HEADER = "agentsafe-retry-of"; /** Why a caller cannot see or resume a hold: nothing is held, or the token is not the holder's. */ type HoldRefusal = "ESCALATION_NOT_HELD" | "RESUME_TOKEN_INVALID"; /** Why a tenant key refuses a request: none was presented, or not one of the tenant's. */ export type TenantKeyRefusal = "TENANT_KEY_MISSING" | "TENANT_KEY_INVALID"; /** * The header a resume token travels in. Never the path or the query: those * are what proxies, access logs and this gateway's own report write down. */ export declare const RESUME_TOKEN_HEADER = "agentsafe-resume-token"; export declare class Gateway { readonly config: GatewayConfig; private readonly upstream; private readonly routes; private readonly metrics; private readonly emitLine; private readonly io; private readonly security; private readonly secrets; private readonly demo; private readonly evidence; private readonly chain; private readonly clock; private readonly version; private readonly surface; readonly boundary: EnforcementBoundary; readonly workload: WorkloadSignal | null; private readonly proof; private readonly sessions; private readonly jwks; private readonly effects; /** The digest of the gateway this one replaces, when it replaces one. */ private readonly replaced; private readonly acceptance; /** The requests held for a person's decision: in memory, or in a directory every replica shares. */ private readonly holds; /** The INDETERMINATE attempts a retry with the same idempotency key is linked to: kept where the holds are. */ private readonly attempts; /** * For each governed request whose operation names where the subject sits * in its answer: the session and operation the answer is checked against, * wherever it is relayed (enforced, observed in shadow, forwarded failing * open, or after a resumed escalation, which holds the same request). */ private readonly answerScopes; private readonly holder; /** * What the gateway read of each captured write's target before the * authority was asked, for the reads after it: once the write lands, or * once it is refused. Keyed by the captured intent, which a held * escalation keeps, so a resumed write is read back too. */ private readonly plans; /** The reads after a refusal still waiting for their window; the stop waits for them. */ private readonly observing; /** A profiled write's target reads, in enforcement only; null otherwise. */ private readonly reader; /** * The key of the facts-only request digest, so the digest an authority * receives confirms nothing about the request to anyone without it: * derived from the tenant's key in custody (`interception.digestKeyFile`), * the same on every replica; otherwise made here and held only here, so a * held escalation is resumed by this same gateway. */ private readonly digestKey; private readonly capture; private readonly executor; private readonly shadow; private readonly resolver; private readonly stopFollowing; private readonly counts; private readonly activation; private readonly ledger; private readonly bucket; /** The tenant key's refusals on the security stream, bounded per window. */ private readonly refusals; private lastShadowReportAt; /** The tenant keys admitted now: the configuration's, until a host replaces them in place. */ private admitted; private registry; /** What this gateway is: computed once, since nothing it is built from changes while it runs. */ readonly fingerprint: DeploymentFingerprint; private readonly actionSpace; /** Acceptance runs, when the configuration names their key and token; null otherwise. */ private readonly runs; /** The plan write each request a run sent is, by request. */ private readonly acceptanceWrites; /** The cumulative-limit check, when a route releases money; null otherwise. */ private readonly exposure; private constructor(); /** * The facts-only digest key: derived from the custody file for this * tenant (HKDF-SHA-256, the tenant as salt), so every replica that mounts * the file derives the same key and no other use of the file's key shares * it; 32 random bytes of this process's own without one. The file's * contents are never logged: a refusal names the setting only. */ private static digestKeyOf; /** * Assembles the gateway: the secrets it needs opened, the demo authority * started when chosen, the guarded egress sealed to the authority, the * pipeline objects built over it, the evidence chains restored or * continued. Nothing listens; the listener is the caller's. */ static create(config: GatewayConfig, dependencies?: GatewayDependencies): Promise; /** * The upstream's proof, when the configuration requires one: a check of its * own and a monitor, pending until it looks or takes over from the gateway * this one replaces (`takeOver`). */ private static upstreamProof; /** * The identity provider's key set, when the gateway pins subjects: the file * when there is one, else one fetch from the address at start, refused by * name when it fails; refreshed from the address through the guarded * egress, sealed to its origin, with the last good set kept on a failure. */ private static subjectKeys; /** TXT through the system's resolver, bounded, so a check never waits on DNS for long. */ private static systemTxt; get authorityLabel(): string; get evidenceLabel(): string; /** The banner, once the listener is bound. */ started(gatewayUrl: string): void; stopped(signal: string): void; /** The shadow report, now: the counts so far and the switch. */ private shadowReport; /** * The report on its own cadence, so a gateway that runs for weeks is read * without being stopped: at each milestone in the count of observations, * and once a day has passed since the last report. */ private shadowReportOnCadence; plan(method: string, path: string, search?: string): RoutePlan; /** A query for planning only; a name the intent contract forbids is left out, and refused later. */ private static queryOf; readiness(): { readonly ready: boolean; readonly body: Record; }; status(): GatewayStatus; /** The tenant keys the gateway admits now, as digests. */ get tenantKeys(): readonly string[]; /** * Replaces the tenant keys the gateway admits, at once and without a * rebuild, so a rotation or a revocation changes nothing else: not the * chains, the rate, the counts or what is in flight. The digests are held * to the configuration's rule; digests that break it are refused whole, * and the keys admitted stay as they were. */ admitKeys(digests: readonly string[]): void; /** The registry a host last loaded, and the entry this gateway was built from, for the status. */ builtFrom(source: RegistrySource): void; /** What the gateway built to replace this one takes up: its chains and its funnel. */ continuation(): GatewayContinuation; /** * The swap: this gateway, built to replace `from` with its continuation, * takes over what `from` still did itself. `from` stops persisting the * chains' heads and looking at the upstream's proof, a look in flight * included, and only finishes what it has in flight. The proof is taken as * it stands now, not as it stood when this one was built: a look that ended * while the registry was loading counts, and is reported once, by `from`; * the last look and the next stay when they were. When `from` was bound to * another tenant, organization or origin, this one looks from the start. */ takeOver(from: Gateway): void; /** * Hands on what the gateway that continues this one now does itself: * persisting the chains' heads, and looking at the upstream's proof. This * one goes on finishing what it has in flight. Called again, it does nothing. */ handedOn(): void; /** * What the upstream's proof lets a tenant's request do now: forwarded, * forwarded and marked missing, or refused. Always forwarded when the * gateway requires no proof. */ upstreamProof(): ProofAdmission; /** Whether the first look at the upstream's proof has ended, or there is none to take. */ get upstreamProofSettled(): boolean; /** * The answer to an admitted request while the upstream's proof is not * established: nothing forwarded, and the upstream named, since the gateway * only observes and calling it directly loses nothing but the observation. */ unverified(): GatewayResponse; /** * Stops persisting the chains' heads, once the gateway that continues them * persists them itself. A replaced gateway still finishing its requests * links on the same chains, so its last checkpoint, at the end of its * drain, would otherwise land after the live one's. */ releaseJournal(): void; /** The switch the shadow report ends with, for whoever renders the status elsewhere. */ get enforcementSwitch(): string; metricsText(): string; /** * A request that is not consequential: forwarded unchanged, counted, not * evaluated, and relayed as `PASSTHROUGH`, so a caller can tell an answer * that came through the gateway from one that never reached it. */ passthrough(request: InterceptedRequest): Promise; /** * A consequential request, through the whole lifecycle. When the gateway * pins subjects, a session the request presents is resolved first: one * that does not stand is refused before anything else, and the subject of * one that does is stated to the authority as `session.subject`, so a * write's policy can compare a fact with it. */ govern(request: InterceptedRequest, action: string): Promise; /** * Where an enforced request stands among its idempotency key's attempts: * null without a key, or in shadow, which forwards every request as it * came and so links none. */ private retryLink; /** * The same idempotency key with another request, while the key's last * attempt is INDETERMINATE: the key promised one operation, which may * already have happened, so this one is refused and never forwarded. */ private keyReused; /** * The reservation key of the INDETERMINATE attempt this request retries: * the same idempotency key and the same request, so the same payment. * Undefined when it retries none, or none that reserved. */ private retriedReservation; /** * After an enforced execution, what its idempotency key remembers: an * INDETERMINATE attempt is recorded for a retry to be linked to; a * definite outcome (forwarded and answered, or answered with a refusal) * settles the key, so a later request is not linked to an attempt that * is no longer unknown. Anything that sent nothing leaves the record. */ private settleAttempt; /** * Why a request's tenant key refuses it, or null when it admits it: always * admitted when the gateway has no keys; otherwise only a key that hashes * to one of them. Every configured digest is compared, in constant time, * whether or not an earlier one matched. A refusal is counted and put on * the security stream with its reason, never with the value presented: * one line each up to a bound per window, and a count of the rest, so a * flood without the key cannot grow the chained stream with its rate. */ keyRefusal(presented: string | undefined): TenantKeyRefusal | null; /** * Whether the gateway's rate admits one more request now. Taken after the * tenant key, so only the tenant's own traffic spends the tenant's rate; a * refusal is counted, and says when to try again. */ rate(): RateDecision; /** * What a held escalation looks like from outside, to the caller holding its * resume token; otherwise why not. The intent id is a correlation id, written * to stdout and to evidence, so it is never enough on its own. */ escalation(intentId: string, resumeToken: string | null): Record | HoldRefusal; /** * Asks the authority again about a held intent. Only a fresh `ALLOW` with * a grant executes, once; anything else is still held or refused. The * gateway never turns the hold into permission on its own. */ resume(intentId: string, resumeToken: string | null): Promise; close(): Promise; /** Whether this gateway serves acceptance runs: its configuration names their key and token. */ get servesAcceptance(): boolean; /** * Whether a bearer is the acceptance runs' operator token: compared by * digest, in constant time, against the file as it is now, so a rotated * token takes effect at once. Never an agent's credential. */ acceptanceToken(presented: string | undefined): boolean; openAcceptance(body: unknown): RunAnswer; decideAcceptance(runId: string, write: string): Promise; closeAcceptance(runId: string, zone: unknown): Promise; /** * Whether a request carrying the run header is a write the open run names, * sent as named: tracked when it is, refused when it is not. A gateway that * serves no run refuses every request carrying the header. */ admitAcceptance(request: InterceptedRequest, tag: string | undefined): Admission; /** The answer to a write a run sent, for one the gateway refused before capturing it. */ answeredAcceptance(request: InterceptedRequest, answer: GatewayResponse): void; /** What this gateway lends a run: its routes, its reads, its chain and its key. */ private acceptanceHost; /** A plan's write as the listener would have handed it over. */ private static acceptanceRequest; private acceptanceRoute; /** * A plan's write decided in shadow: captured as its route captures it, with * no read of its target, asked of the authority in shadow, and forwarded * nowhere. The shadow pipeline records the decision on the evidence chain. */ private acceptanceDecide; /** * A plan's write through a second gateway built from this configuration, * its authority unreachable and its upstream recording, closed after: what * it answered, and how many writes reached its upstream. */ private static acceptanceOutage; /** * The configuration the outage case's second gateway is built from: this * one, with nothing it could write to or wait on outside the process. No * evidence file or journal (the deployed gateway's chains are its own), no * upstream proof or public-only resolution, no subject keys to fetch, no * reads after a refusal, and no acceptance runs of its own. */ private static outageConfig; /** The deployed gateway's secrets, lent: the second gateway reads them and never closes them. */ private static borrowed; private captureIntent; /** * Facts-only privacy: the authority receives the profile operation that * named the call, its path template and the facts it names, and the keyed * digest that binds the held request. No path, query, header or body byte * of the request is in the intent; a call the profile does not describe * never reaches here, because the route table refused it. */ private captureFacts; /** * What a captured write binds of its target, exactly as an executor binds * it: the version read before the authority is asked, stamped by the * capture into the hashed context as `agent_safe.precondition`, and the * digest of the effect the call asks for, which the grant then commits to. * Nothing for a write whose operation names no read. */ private static targetBinding; /** * The read a profiled write's operation names, made before the authority * is asked, in enforcement only; null when there is none to make: no * profile, a call the profile does not name as this action, or an * operation that names no read. */ private targetPlan; /** * A write whose target stated no usable version: refused before the * authority is asked, as an executor's is, rather than decided against no * version at all. A report line, a line on the evidence chain naming the * reason, and the gateway's own `502`, since it is the upstream's answer * that could not be read. */ private targetUnreadable; /** * After a refusal of a write whose operation names a read: the target read * again once the window has passed, and a chained `REFUSAL_OBSERVATION` * naming the version before the decision, the version after and both * instants. An unchanged version says no write landed on that resource * between the two reads, by any route; nothing about another resource or * another time. The caller's answer never waits for it; the stop does. */ private observeRefusal; /** * The pinned subject as the authority reads it: the fact `session.subject`. * A verified claim of the identity provider, never a value of the request; * absent, never null, when the request presented no session. */ /** * What the intent says of the INDETERMINATE attempt it retries: that * attempt's dossier, so policy can decide a retry of a write that may * already have happened, and the new dossier names the earlier one. */ private static retryContext; private static sessionContext; /** The session a request presents, when the gateway pins subjects; null when it presents none. */ private sessionOf; /** * A read a profile operation names, checked against the session's subject * and never decided. Before it is sent: the request must present a session * that stands, and when the operation says where the subject sits in the * call, it must be the session's. After: when the operation says where the * subject sits in each item of a successful answer, every item must name * the session's subject, or the whole answer is refused and none of it is * relayed; nothing is filtered, since a partial answer would look complete. * An answer that is not a success is relayed as it came. Every refusal is * a reason code and a line on the gateway's evidence chain. */ check(request: InterceptedRequest, operationId: string): Promise; /** * Why a successful answer may not be relayed for this session, or null when * it may: every item the operation's response pointer reaches must name the * session's subject, and beside a list only the envelope's keys may stand. * An answer that is not a success is relayed as it came. */ private answerRefusal; /** * A forwarded answer, relayed: as it came, or, when the request's operation * names where the subject sits in its answer and the answer names another * subject, withheld. The effect, if any, has happened; the response says * the call reached the upstream (`WITHHELD`) and with what status, so a * caller never takes it for a call that was not made. */ private answer; /** The profile operation that named a governed call, when it names a subject; else null. */ private scopedOperation; /** * A checked read's query, decoded as RFC 3986 writes it: each name and * value percent-decoded once, and a `+` refused rather than read as a space * or a plus, since an upstream may read it either way and a subject check * must see what the upstream sees. Null when a component does not decode, * holds a `+`, or is a name the intent contract forbids. */ private static strictQuery; /** * RFC 8693 token exchange at the gateway: the identity provider's subject * token in, a session token for this gateway out. The answer is the RFC's, * never cached; issuing and refusing are both lines on the evidence chain, * with the session's short digest and never a token or the subject. */ exchange(form: URLSearchParams): Promise; /** An OAuth token endpoint's answer: JSON, never stored by anything between. */ private oauth; /** * A subject refusal: the gateway's own answer, a report line and a line on * the evidence chain naming the operation, the reason and the session by * its short digest. `WITHHELD`, with the upstream's status, when the call * reached the upstream and its answer was not relayed; `NOT_FORWARDED` * otherwise. */ private subjectRefused; /** * The facts the gateway's API profile names for this call, when the profile * named its action: each at the top level of the trusted context, beside the * operation, exactly as a native executor reading the same profile states * them. The body is read for facts whether or not it is embedded. */ private profileFacts; private profile; /** What the gateway's API profile says about a call, its JSON body read when there is one. */ private profileMatch; /** A call as the gateway's API profile reads it; null when the gateway has no profile. */ private profileRequest; /** * The observation, when it has settled by now or settles within `waitMs`; * otherwise null. With 0 it never waits: an already settled promise wins * the race against the resolved sentinel because it is listed first. */ private static settledWithin; private principalOf; private observe; private enforce; /** The authority could not be asked: its own state, and never a policy BLOCK. */ private unavailable; /** An ALLOW: the grant claimed, the exact request sent once, the outcome finalized and relayed. */ private execute; /** * The route's money declaration and what the request states for it, when * the request is governed by a route that releases money; null otherwise, * and always null for a gateway with no such route. */ private moneyOf; /** * The check run after the grant is claimed and before the payment is sent: * reserve against every covering limit, and refuse, sending nothing, when * one would be exceeded or, unless the route fails open, when the ledger * cannot be asked. What it found is left in `reserved` for the outcome. */ private beforeDispatch; /** What a report and an answer say about a payment's reservations; null for a route that releases none. */ private static exposureReport; /** * The gateway's answer to a payment its cumulative limits refused: the * authority allowed it and its grant was claimed, but nothing was sent. * A limit that escalates is refused as one that holds: the claimed grant * cannot be held for a person, so the answer names the limit and its * `on_exceed`, and a new request is decided afresh once the limit allows. */ private exposureRefused; /** * In shadow, after the authority would have allowed a payment: what the * ledger would have said, without counting it. */ private observeExposure; /** * What a forwarded write's report says of its effect: what the read after * it said, or why nothing was read. A write that names no read, or no * effect, holds only the upstream's acknowledgement. */ private effectOf; private hold; /** * The request as a hold keeps it: without the gateway's own credentials * (they end here, and the caller was admitted when it was held) or the * upstream credential, which the gateway sets again when it forwards. */ private holdable; /** * The hold under an id, for the caller presenting its token. A refusal is * linked to the evidence stream, because a wrong token for a live hold is * someone who read an intent id and is not its caller. */ private heldFor; private static resumeDigest; private release; private holdBody; /** The handoff without the intent, which the gateway holds itself. */ private handoffBody; private interception; /** * Forwards a request as it came, counted as a passthrough, and relays the * answer with the gateway's own headers; a failure is the gateway's own * response, which carries its own. */ private forwardUnchanged; private relay; /** * What a failed forward is. It is `NOT_FORWARDED` only when nothing of the * request can have been accepted: a public-only upstream resolved inward, * the upstream refused the handshake or its certificate did not verify, * or no connection was ever made. Anything else may have come after the * request was written, and the upstream may have acted on it, so it is * never a refusal a caller may retry. A timeout is one wherever the send * was when it ran out: the send cannot say whether it had written the * request. Too large is the relay's own bound or the guarded egress's just * outside it, whichever reader saw it first. A refused handshake is the * tenant's configuration, reported once as `UPSTREAM_TLS_REFUSED`. */ private failureOf; /** The gateway's own answer to a forward that failed. */ private failed; /** A failed send's transport code: its own, as `node:http` raises it, or its cause's, as `fetch` wraps it. */ private static transportCode; /** A response the gateway itself makes: JSON, protective headers, the wire version. */ private own; private report; /** One chained line on the gateway's own stream, and where it went. */ private link; private count; } export {}; //# sourceMappingURL=Gateway.d.ts.map