import type { AgentLlm } from "../cloud/types.js"; export interface ConnectorConfig { apiKey: string | null; cloudUrl: string; bypass: boolean; region: string | undefined; playwrightCmd: string; playwrightArgs: string[]; traceEnabled: boolean; traceDir: string; failOpen: boolean; /** * Privacy Shield posture. "on" (default) runs the Shield on every snapshot. * "off" only when explicitly disabled; any unset or malformed value resolves * to "on" (fail-safe). Sourced from `JDC_PRIVACY_SHIELD`, then the * `privacy_shield` key in `~/.jdcodec/config.json`. Distinct from `bypass` * (JDC_BYPASS, the codec bypass): turning the Shield off keeps the cloud path * active but sends the snapshot unredacted, and only together with the ack. */ privacyShield: "on" | "off"; /** * Deliberate acknowledgement that unredacted snapshots are intended. Required * in addition to `privacyShield === "off"` for bypass to engage. Sourced from * `JDC_PRIVACY_SHIELD_BYPASS_ACK` (truthy) or the `privacy_shield_bypass_ack` * key in `~/.jdcodec/config.json`. Default false. */ privacyShieldBypassAck: boolean; /** * Derived: redaction is skipped only when the Shield is off AND the ack is * set. Both signals are required, so a single misconfiguration cannot send * raw text. */ privacyShieldBypassEngaged: boolean; /** * Customer's agent-LLM metadata. Sourced from `JDC_LLM_PROVIDER` (+ * optional `JDC_LLM_MODEL`) env vars; falls back to the `agent_llm` * key in `~/.jdcodec/config.json` if env vars are absent. Undefined * when neither is set — the cloud service then falls back to an * approximate tokenizer for usage accounting. Char metrics are * unaffected. */ agentLlm: AgentLlm | undefined; } export interface ConfigSource { env?: NodeJS.ProcessEnv; configPath?: string; /** For testing — override the default path. */ readFile?: (path: string) => string | null; } /** * Verify a cloud URL is safe to send the bearer token to. Production must be * https; local-dev allows plain http on loopback only. Anything else (a typo, * a copy-paste from a debug session, a hostile env-file injection) would * leak the API key in cleartext. */ export declare function assertSafeCloudUrl(url: string): void; export declare function loadConfig(source?: ConfigSource): ConnectorConfig;