Files
hack/tools/scripts/llm-key-hunter/results/_cache/content/ackness_covel.json
T

1 line
18 KiB
JSON

{"repo": "ackness/covel", "files": {".env.llm.example": {"448b5f90a6c58484d12f95b2e8bfc0c8f95ea459": {"t": 1785745121.4024448, "n": 1900, "h": "5c03a454d4674049", "c": "# LLM Provider Keys\n# Copy this file to .env.llm and fill in your keys.\n# These are loaded by the dev server and Docker container.\n#\n# NOTE: In production, API keys are passed per-request from the browser\n# via the X-Provider-Keys header (stored in browser localStorage).\n# Server-side env vars are only needed for:\n# 1. Local development auto-injection\n# 2. Langfuse tracing\n# 3. Server-initiated LLM calls (if any)\n\n# ── DeepSeek ─────────────────────────────────────────────────────\n# DEEPSEEK_API_KEY=sk-xxx\n# DEEPSEEK_BASE_URL=https://api.deepseek.com\n\n# ── DashScope (Alibaba Cloud / Qwen) ────────────────────────────\n# DASHSCOPE_API_KEY=sk-xxx\n# DASHSCOPE_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1\n\n# ── OpenAI ───────────────────────────────────────────────────────\n# OPENAI_API_KEY=sk-xxx\n# OPENAI_BASE_URL=https://api.openai.com/v1\n\n# ── Anthropic ────────────────────────────────────────────────────\n# ANTHROPIC_API_KEY=sk-ant-xxx\n# ANTHROPIC_BASE_URL=https://api.anthropic.com\n\n# ── OpenRouter (used by embedding bench Phase 0) ─────────────────\n# OPENROUTER_API_KEY=sk-or-v1-xxx\n# OPENROUTER_BASE_URL=https://openrouter.ai/api/v1\n\n# ── Groq ─────────────────────────────────────────────────────────\n# GROQ_API_KEY=gsk_xxx\n# GROQ_BASE_URL=https://api.groq.com/openai/v1\n\n# ── Cerebras ─────────────────────────────────────────────────────\n# CEREBRAS_API_KEY=csk-xxx\n# CEREBRAS_BASE_URL=https://api.cerebras.ai/v1\n\n# ── Packey / gateway-compatible providers ────────────────────────\n# PACKEY_API_KEY=sk-xxx\n# PACKEY_BASE_URL=https://api.packey.ai/v1\n\n# ── Local OpenAI-compatible endpoint ──────────────────────────────\n# LOCAL_API_KEY=local-placeholder\n# LOCAL_BASE_URL=http://localhost:1234/v1\n\n# ── Ollama (local, used as default embedding backend) ────────────\n# Run: ollama pull nomic-embed-text-v2-moe && ollama serve\n# OLLAMA_BASE_URL=http://localhost:11434\n"}, "d2ab5815a66b4bf4b4512dce7a6145e4da3010e0": {"t": 1785747962.975779, "n": 1900, "h": "5c03a454d4674049", "c": "# LLM Provider Keys\n# Copy this file to .env.llm and fill in your keys.\n# These are loaded by the dev server and Docker container.\n#\n# NOTE: In production, API keys are passed per-request from the browser\n# via the X-Provider-Keys header (stored in browser localStorage).\n# Server-side env vars are only needed for:\n# 1. Local development auto-injection\n# 2. Langfuse tracing\n# 3. Server-initiated LLM calls (if any)\n\n# ── DeepSeek ─────────────────────────────────────────────────────\n# DEEPSEEK_API_KEY=sk-xxx\n# DEEPSEEK_BASE_URL=https://api.deepseek.com\n\n# ── DashScope (Alibaba Cloud / Qwen) ────────────────────────────\n# DASHSCOPE_API_KEY=sk-xxx\n# DASHSCOPE_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1\n\n# ── OpenAI ───────────────────────────────────────────────────────\n# OPENAI_API_KEY=sk-xxx\n# OPENAI_BASE_URL=https://api.openai.com/v1\n\n# ── Anthropic ────────────────────────────────────────────────────\n# ANTHROPIC_API_KEY=sk-ant-xxx\n# ANTHROPIC_BASE_URL=https://api.anthropic.com\n\n# ── OpenRouter (used by embedding bench Phase 0) ─────────────────\n# OPENROUTER_API_KEY=sk-or-v1-xxx\n# OPENROUTER_BASE_URL=https://openrouter.ai/api/v1\n\n# ── Groq ─────────────────────────────────────────────────────────\n# GROQ_API_KEY=gsk_xxx\n# GROQ_BASE_URL=https://api.groq.com/openai/v1\n\n# ── Cerebras ─────────────────────────────────────────────────────\n# CEREBRAS_API_KEY=csk-xxx\n# CEREBRAS_BASE_URL=https://api.cerebras.ai/v1\n\n# ── Packey / gateway-compatible providers ────────────────────────\n# PACKEY_API_KEY=sk-xxx\n# PACKEY_BASE_URL=https://api.packey.ai/v1\n\n# ── Local OpenAI-compatible endpoint ──────────────────────────────\n# LOCAL_API_KEY=local-placeholder\n# LOCAL_BASE_URL=http://localhost:1234/v1\n\n# ── Ollama (local, used as default embedding backend) ────────────\n# Run: ollama pull nomic-embed-text-v2-moe && ollama serve\n# OLLAMA_BASE_URL=http://localhost:11434\n"}, "f80f5f2cdc771b14f96b586e85cb246fd4d329f9": {"t": 1785747964.0391517, "n": 1336, "h": "048356fa37764928", "c": "# LLM Provider Keys\n# Copy this file to .env.llm and fill in your keys.\n# These are loaded by the dev server and Docker container.\n#\n# NOTE: In production, API keys are passed per-request from the browser\n# via the X-Provider-Keys header (stored in browser localStorage).\n# Server-side env vars are only needed for:\n# 1. Local development auto-injection\n# 2. Langfuse tracing\n# 3. Server-initiated LLM calls (if any)\n\n# ── DeepSeek ─────────────────────────────────────────────────────\n# DEEPSEEK_API_KEY=sk-xxx\n# DEEPSEEK_BASE_URL=https://api.deepseek.com\n\n# ── DashScope (Alibaba Cloud / Qwen) ────────────────────────────\n# DASHSCOPE_API_KEY=sk-xxx\n# DASHSCOPE_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1\n\n# ── OpenAI ───────────────────────────────────────────────────────\n# OPENAI_API_KEY=sk-xxx\n# OPENAI_BASE_URL=https://api.openai.com/v1\n\n# ── Anthropic ────────────────────────────────────────────────────\n# ANTHROPIC_API_KEY=sk-ant-xxx\n# ANTHROPIC_BASE_URL=https://api.anthropic.com\n\n# ── OpenRouter (used by embedding bench Phase 0) ─────────────────\n# OPENROUTER_API_KEY=sk-or-v1-xxx\n# OPENROUTER_BASE_URL=https://openrouter.ai/api/v1\n\n# ── Ollama (local, used as default embedding backend) ────────────\n# Run: ollama pull nomic-embed-text-v2-moe && ollama serve\n# OLLAMA_BASE_URL=http://localhost:11434\n"}, "b05f099edcb853793698c5ee0cd9db61af19eec9": {"t": 1785747965.099939, "n": 1013, "h": "3110d21de4d1391f", "c": "# LLM Provider Keys\n# Copy this file to .env.llm and fill in your keys.\n# These are loaded by the dev server and Docker container.\n#\n# NOTE: In production, API keys are passed per-request from the browser\n# via the X-Provider-Keys header (stored in browser localStorage).\n# Server-side env vars are only needed for:\n# 1. Local development auto-injection\n# 2. Langfuse tracing\n# 3. Server-initiated LLM calls (if any)\n\n# ── DeepSeek ─────────────────────────────────────────────────────\n# DEEPSEEK_API_KEY=sk-xxx\n# DEEPSEEK_BASE_URL=https://api.deepseek.com\n\n# ── DashScope (Alibaba Cloud / Qwen) ────────────────────────────\n# DASHSCOPE_API_KEY=sk-xxx\n# DASHSCOPE_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1\n\n# ── OpenAI ───────────────────────────────────────────────────────\n# OPENAI_API_KEY=sk-xxx\n# OPENAI_BASE_URL=https://api.openai.com/v1\n\n# ── Anthropic ────────────────────────────────────────────────────\n# ANTHROPIC_API_KEY=sk-ant-xxx\n# ANTHROPIC_BASE_URL=https://api.anthropic.com\n"}, "31fa35758231b354ff729e6765a930e81bfa4a62": {"t": 1785747966.1733854, "n": 321, "h": "cd743ee7def60cc0", "c": "# LLM Provider Keys (local development only)\n# Copy this file to .env.llm and fill in your keys\n# This file is loaded automatically by the dev server\n\n# DASHSCOPE_API_KEY=sk-xxx\n# DASHSCOPE_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1\n\n# DEEPSEEK_API_KEY=sk-xxx\n# DEEPSEEK_BASE_URL=https://api.deepseek.com\n"}}, "apps/desktop/src/env-files.ts": {"448b5f90a6c58484d12f95b2e8bfc0c8f95ea459": {"t": 1785745566.720062, "n": 2878, "h": "cd12eead196972d1", "c": "import fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { normalizeProviderKeyMap, toApiKeyEnvMap } from \"./provider-keys.js\";\n\nexport function loadEnvFiles(baseDir: string): Record<string, string> {\n const result: Record<string, string> = {};\n for (const name of [\".env\", \".env.llm\"]) {\n const filePath = path.join(baseDir, name);\n if (!fs.existsSync(filePath)) continue;\n parseEnvFileInto(filePath, result);\n }\n return result;\n}\n\n/**\n * Read `~/.covel/keys.env` into a provider-id keyed record for the renderer.\n * Missing file is fine (fresh install). Legacy bare keys like `deepseek=...`\n * are folded into the same shape as `DEEPSEEK_API_KEY=...`.\n */\nexport function loadKeysEnv(keysFile: string): Record<string, string> {\n const result: Record<string, string> = {};\n if (!fs.existsSync(keysFile)) return result;\n parseEnvFileInto(keysFile, result);\n return normalizeProviderKeyMap(result);\n}\n\nexport function loadKeysEnvForChild(keysFile: string): Record<string, string> {\n return toApiKeyEnvMap(loadKeysEnv(keysFile));\n}\n\nexport function saveKeysEnv(\n keysFile: string,\n keys: Record<string, string>,\n): void {\n const envKeys = toApiKeyEnvMap(keys);\n const body =\n `# Covel provider API keys. One KEY=VALUE per line.\\n` +\n `# Example:\\n# DEEPSEEK_API_KEY=sk-xxx\\n# OPENAI_API_KEY=sk-xxx\\n\\n` +\n Object.entries(envKeys)\n // audit M2: reject values with CR/LF — a newline would inject extra\n // `KEY=VALUE` lines and poison other providers' key parsing.\n .filter(([k, v]) => {\n if (!k || typeof v !== \"string\" || !v.trim()) return false;\n if (/[\\r\\n]/.test(v)) {\n console.warn(\n `[env-files] Skipping key \"${k}\": value contains a newline`,\n );\n return false;\n }\n return true;\n })\n .map(([k, v]) => `${k}=${v.trim()}`)\n .join(\"\\n\") +\n \"\\n\";\n fs.mkdirSync(path.dirname(keysFile), { recursive: true });\n // mode in writeFileSync only applies when creating a new file. Re-assert\n // 0600 after the write so an existing looser-permission file gets tightened\n // (audit M1). chmod is a no-op on Windows but does not throw.\n fs.writeFileSync(keysFile, body, { mode: 0o600 });\n fs.chmodSync(keysFile, 0o600);\n}\n\nfunction parseEnvFileInto(\n filePath: string,\n into: Record<string, string>,\n): void {\n const content = fs.readFileSync(filePath, \"utf-8\");\n for (const line of content.split(\"\\n\")) {\n const trimmed = line.trim();\n if (!trimmed || trimmed.startsWith(\"#\")) continue;\n const eqIdx = trimmed.indexOf(\"=\");\n if (eqIdx < 0) continue;\n const key = trimmed.slice(0, eqIdx).trim();\n let val = trimmed.slice(eqIdx + 1).trim();\n if (\n (val.startsWith('\"') && val.endsWith('\"')) ||\n (val.startsWith(\"'\") && val.endsWith(\"'\"))\n ) {\n val = val.slice(1, -1);\n }\n into[key] = val;\n }\n}\n"}, "8b0612a5acc2a820d5dc2c60d9b3ce9b00247583": {"t": 1785747963.4429622, "n": 2878, "h": "cd12eead196972d1", "c": "import fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { normalizeProviderKeyMap, toApiKeyEnvMap } from \"./provider-keys.js\";\n\nexport function loadEnvFiles(baseDir: string): Record<string, string> {\n const result: Record<string, string> = {};\n for (const name of [\".env\", \".env.llm\"]) {\n const filePath = path.join(baseDir, name);\n if (!fs.existsSync(filePath)) continue;\n parseEnvFileInto(filePath, result);\n }\n return result;\n}\n\n/**\n * Read `~/.covel/keys.env` into a provider-id keyed record for the renderer.\n * Missing file is fine (fresh install). Legacy bare keys like `deepseek=...`\n * are folded into the same shape as `DEEPSEEK_API_KEY=...`.\n */\nexport function loadKeysEnv(keysFile: string): Record<string, string> {\n const result: Record<string, string> = {};\n if (!fs.existsSync(keysFile)) return result;\n parseEnvFileInto(keysFile, result);\n return normalizeProviderKeyMap(result);\n}\n\nexport function loadKeysEnvForChild(keysFile: string): Record<string, string> {\n return toApiKeyEnvMap(loadKeysEnv(keysFile));\n}\n\nexport function saveKeysEnv(\n keysFile: string,\n keys: Record<string, string>,\n): void {\n const envKeys = toApiKeyEnvMap(keys);\n const body =\n `# Covel provider API keys. One KEY=VALUE per line.\\n` +\n `# Example:\\n# DEEPSEEK_API_KEY=sk-xxx\\n# OPENAI_API_KEY=sk-xxx\\n\\n` +\n Object.entries(envKeys)\n // audit M2: reject values with CR/LF — a newline would inject extra\n // `KEY=VALUE` lines and poison other providers' key parsing.\n .filter(([k, v]) => {\n if (!k || typeof v !== \"string\" || !v.trim()) return false;\n if (/[\\r\\n]/.test(v)) {\n console.warn(\n `[env-files] Skipping key \"${k}\": value contains a newline`,\n );\n return false;\n }\n return true;\n })\n .map(([k, v]) => `${k}=${v.trim()}`)\n .join(\"\\n\") +\n \"\\n\";\n fs.mkdirSync(path.dirname(keysFile), { recursive: true });\n // mode in writeFileSync only applies when creating a new file. Re-assert\n // 0600 after the write so an existing looser-permission file gets tightened\n // (audit M1). chmod is a no-op on Windows but does not throw.\n fs.writeFileSync(keysFile, body, { mode: 0o600 });\n fs.chmodSync(keysFile, 0o600);\n}\n\nfunction parseEnvFileInto(\n filePath: string,\n into: Record<string, string>,\n): void {\n const content = fs.readFileSync(filePath, \"utf-8\");\n for (const line of content.split(\"\\n\")) {\n const trimmed = line.trim();\n if (!trimmed || trimmed.startsWith(\"#\")) continue;\n const eqIdx = trimmed.indexOf(\"=\");\n if (eqIdx < 0) continue;\n const key = trimmed.slice(0, eqIdx).trim();\n let val = trimmed.slice(eqIdx + 1).trim();\n if (\n (val.startsWith('\"') && val.endsWith('\"')) ||\n (val.startsWith(\"'\") && val.endsWith(\"'\"))\n ) {\n val = val.slice(1, -1);\n }\n into[key] = val;\n }\n}\n"}, "010e1cf71682111c280c047f27be4b65bd35926e": {"t": 1785747965.5636823, "n": 2246, "h": "5faa7da9432191e0", "c": "import fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { normalizeProviderKeyMap, toApiKeyEnvMap } from \"./provider-keys.js\";\n\nexport function loadEnvFiles(baseDir: string): Record<string, string> {\n const result: Record<string, string> = {};\n for (const name of [\".env\", \".env.llm\"]) {\n const filePath = path.join(baseDir, name);\n if (!fs.existsSync(filePath)) continue;\n parseEnvFileInto(filePath, result);\n }\n return result;\n}\n\n/**\n * Read `~/.covel/keys.env` into a provider-id keyed record for the renderer.\n * Missing file is fine (fresh install). Legacy bare keys like `deepseek=...`\n * are folded into the same shape as `DEEPSEEK_API_KEY=...`.\n */\nexport function loadKeysEnv(keysFile: string): Record<string, string> {\n const result: Record<string, string> = {};\n if (!fs.existsSync(keysFile)) return result;\n parseEnvFileInto(keysFile, result);\n return normalizeProviderKeyMap(result);\n}\n\nexport function loadKeysEnvForChild(keysFile: string): Record<string, string> {\n return toApiKeyEnvMap(loadKeysEnv(keysFile));\n}\n\nexport function saveKeysEnv(\n keysFile: string,\n keys: Record<string, string>,\n): void {\n const envKeys = toApiKeyEnvMap(keys);\n const body =\n `# Covel provider API keys. One KEY=VALUE per line.\\n` +\n `# Example:\\n# DEEPSEEK_API_KEY=sk-xxx\\n# OPENAI_API_KEY=sk-xxx\\n\\n` +\n Object.entries(envKeys)\n .filter(([k, v]) => k && typeof v === \"string\" && v.trim())\n .map(([k, v]) => `${k}=${v.trim()}`)\n .join(\"\\n\") +\n \"\\n\";\n fs.mkdirSync(path.dirname(keysFile), { recursive: true });\n fs.writeFileSync(keysFile, body, { mode: 0o600 });\n}\n\nfunction parseEnvFileInto(\n filePath: string,\n into: Record<string, string>,\n): void {\n const content = fs.readFileSync(filePath, \"utf-8\");\n for (const line of content.split(\"\\n\")) {\n const trimmed = line.trim();\n if (!trimmed || trimmed.startsWith(\"#\")) continue;\n const eqIdx = trimmed.indexOf(\"=\");\n if (eqIdx < 0) continue;\n const key = trimmed.slice(0, eqIdx).trim();\n let val = trimmed.slice(eqIdx + 1).trim();\n if (\n (val.startsWith('\"') && val.endsWith('\"')) ||\n (val.startsWith(\"'\") && val.endsWith(\"'\"))\n ) {\n val = val.slice(1, -1);\n }\n into[key] = val;\n }\n}\n"}}}}