#!/usr/bin/env node /** * JD Codec connector CLI — local MCP proxy that wraps Playwright MCP, applies * the on-device Privacy Shield, and forwards snapshots to the cloud codec. * * Config: * - JDC_API_KEY (env) or ~/.jdcodec/config.json `api_key` (file) — required unless JDC_BYPASS=1. * - JDC_BYPASS=1 — skip cloud codec, return the already-redacted snapshot. Privacy Shield remains mandatory. * - JDC_CLOUD_URL — override cloud endpoint (default https://api.jdcodec.com). * - JDC_REGION — Cloudflare DO location hint (wnam|enam|sam|weur|eeur|apac|oc|afr|me). * - JDC_LLM_PROVIDER — downstream LLM provider the agent calls (`anthropic`|`openai`|`gemini`). * Optional. When set, the connector forwards it with every snapshot so the cloud's * tokenizer picks the matching family; when unset, the cloud falls back to an * approximate tokenizer and the usage row records that fact explicitly. * - JDC_LLM_MODEL — optional model identifier (e.g. `claude-sonnet-4-6`, `gpt-4o`, * `gemini-2.5-pro`). Refines tokenizer-version selection when a provider supports * multiple. Ignored unless `JDC_LLM_PROVIDER` is also set. * - JDC_PLAYWRIGHT_CMD / JDC_PLAYWRIGHT_ARGS — override the upstream MCP server command. * - JDC_PRIVACY_FAIL_OPEN=1 — debug-only escape hatch; emits a critical log. * - JDC_TRACE=1 — debug-only; appends per-match redaction span detail (rule, offsets, raw value) * to ${JDC_TRACE_DIR}/spans-.jsonl. Default off; raw values are PII by definition, * so trace files stay local to the developer's machine and must not be committed or shared. * - JDC_TRACE_DIR — directory for span JSONL files when JDC_TRACE=1 (default: ./traces). */ export {};