import { type ResultPolicy } from './result-screen.js'; import type { WardenPolicy } from './types.js'; import { type MaskConfig } from './mask.js'; export type GatewayServerType = 'mcp-http' | 'openapi'; export interface GatewayServer { /** Path segment and flow-guard server name: its tools are `mcp____` to the policy. */ name: string; type: GatewayServerType; /** MCP endpoint (`mcp-http`) or the base URL whose `openapi.json` describes the operations (`openapi`). */ url: string; /** Sent to the tool server on every request; `${NAME}` is replaced by that environment variable. */ headers: Record; /** OpenAPI only: where the spec is, relative to `url`. Default `openapi.json`. */ specPath?: string; } export interface GatewayConfig { host: string; port: number; /** Bearer token OpenWebUI (or any client) sends to the proxy and to /v1 (except /v1/approve when approveToken is set). */ token: string; /** Optional second token for /v1/approve only, held by the adapter and never by a tool server connection. */ approveToken?: string; /** Request headers that carry the chat and the user. OpenWebUI sends these with ENABLE_FORWARD_USER_INFO_HEADERS. */ chatHeader: string; userHeader: string; servers: GatewayServer[]; stateDir: string; /** Flow policy file (labels, mode, …); default `/flow-policy.json`. */ flowPolicy?: string; /** Tool-definition gates, as `wrap --policy`. */ policy: WardenPolicy; /** Result screening, as `wrap --results`. */ results: ResultPolicy; /** Word the user types before an approval code. `approve` is always accepted as well. */ approvePhrase: string; approvalTtlSeconds: number; /** Chat state older than this is removed (days). Outside text never expires while the state exists. */ retentionDays: number; maxBodyBytes: number; /** Per upstream request. */ upstreamTimeoutMs: number; /** A chat the platform adapter never reported a message for counts as having read outside text (default true). */ requireAdapter: boolean; /** Masking (mask.ts): credentials on, personal data off unless set; without the field, the WARDEN_MASK* environment. */ mask: MaskConfig; } /** `${NAME}` → env value. A missing variable is an error: an empty credential would only fail later, upstream. */ export declare function expandEnv(value: string, env: NodeJS.ProcessEnv, what: string): string; export declare function parseGatewayConfig(raw: unknown, env?: NodeJS.ProcessEnv, baseDir?: string): GatewayConfig; export declare function loadGatewayConfig(path: string, env?: NodeJS.ProcessEnv): GatewayConfig; /** The environment the flow guard reads: the gateway's own state folder, never the Claude Code plugin's. */ export declare function flowEnv(config: GatewayConfig, env?: NodeJS.ProcessEnv): NodeJS.ProcessEnv; //# sourceMappingURL=gateway-config.d.ts.map