import { type GatewayDependencies } from "../gateway/Gateway.js"; import { type GatewayConfig } from "../gateway/GatewayConfig.js"; import { type UnlistedPolicy } from "../http/InterceptGovernor.js"; import { type InterceptEvent, type InterceptorDependencies, type InterceptorOptions } from "../http/InterceptServer.js"; import type { InterceptProtocol } from "../intercept/Destination.js"; import { type ParsedArguments } from "./Arguments.js"; import type { CliProcess } from "./CliProcess.js"; export declare const INTERCEPT_ARGUMENTS: { readonly valued: readonly ["http-port", "https-port", "bind", "govern", "unlisted", "ca-cert", "ca-key", "mode", "failure-policy", "authority", "config"]; readonly flags: readonly ["json", "verbose"]; }; /** The variables the sidecar is configured with; the flags win over them. */ export declare const INTERCEPT_ENVIRONMENT: { readonly httpPort: "AGENTSAFE_INTERCEPT_HTTP_PORT"; readonly httpsPort: "AGENTSAFE_INTERCEPT_HTTPS_PORT"; readonly bind: "AGENTSAFE_INTERCEPT_BIND"; /** The destinations to govern, comma-separated host names; empty observes everything. */ readonly govern: "AGENTSAFE_INTERCEPT_GOVERN"; /** `passthrough` or `refuse` for a destination not governed. */ readonly unlisted: "AGENTSAFE_INTERCEPT_UNLISTED"; /** The operator authority's certificate, PEM, that governed TLS is terminated under. */ readonly caCertificateFile: "AGENTSAFE_INTERCEPT_CA_CERT_FILE"; /** The operator authority's private key, PEM. */ readonly caKeyFile: "AGENTSAFE_INTERCEPT_CA_KEY_FILE"; }; export declare class InterceptConfigError extends Error { readonly code: "CONFIG_INVALID" | "CONFIG_MISSING"; readonly setting: string; constructor(code: "CONFIG_INVALID" | "CONFIG_MISSING", setting: string, detail?: string); } /** What an operator asked the interceptor to govern, before any file is read. */ export interface GovernSettings { readonly hosts: ReadonlySet; readonly unlisted: UnlistedPolicy; /** Where the operator authority's certificate and key are; null when governed TLS is not to be terminated. */ readonly authority: { readonly certificateFile: string; readonly keyFile: string; } | null; } export interface InterceptSettings { readonly listeners: InterceptorOptions; /** Null when nothing is governed and nothing is refused: the observe phase alone. */ readonly govern: GovernSettings | null; } /** The interceptor's settings from the flags and the environment, each named when refused. */ export declare function resolveIntercept(parsed: ParsedArguments, env: Readonly>): InterceptSettings; /** One line per event for a terminal; the JSON form is the event itself. */ export declare function describe(event: InterceptEvent, version: string): string; /** What a test hands in beneath the command: the sockets, the clock, and the gateways' own seams. */ export interface InterceptDependencies extends Partial> { readonly gateway?: GatewayDependencies; } /** The configuration for one governed destination: the shared settings, with that host as the upstream. */ export declare function governedConfig(base: GatewayConfig, host: string, protocol: InterceptProtocol): GatewayConfig; /** * `agentsafe intercept`: the transparent interceptor as a process, the * sidecar the redirect rules point at. It binds its listeners, reports every * destination it places, governs or refuses as one line, and on `SIGTERM` or * `SIGINT` prints the ledger's report, stops, and exits 0. With nothing to * govern it holds no key and asks no authority; with governed destinations it * runs the gateway for each, under the configuration `agentsafe proxy` * takes, and terminates their TLS under the operator's authority. */ export declare function runIntercept(io: CliProcess, argv: readonly string[], dependencies?: InterceptDependencies): Promise; //# sourceMappingURL=Intercept.d.ts.map