Files
hack/tools/scripts/llm-key-hunter/results/_cache/content/cancelllls_deepseek-cli.json
T
OpenCode 68a9071cf1 feat: reconcile local master with origin (exa/hot-platform hunters, leaks ledger, latest results)
Local branch had diverged from origin/master (sibling commits on the same base). Rewrote local history linearly on top of origin/master, folding in all local content: exa/hot-platform discovery hunters, leaks ledger, nightly sweep orchestrator, updated .gitignore and skill docs, plus the latest hunt output and vault state. Remote-only files (vault keys, channel scripts) were restored rather than dropped, so the resulting tree is a full union of both sides.
2026-08-07 12:53:47 +08:00

1 line
2.3 KiB
JSON

{"repo": "cancelllls/deepseek-cli", "files": {"src/config.rs": {"0172e5e25e9af7e7eb251e06737915bfc5a6b6b6": {"t": 1786068336.22695, "n": 2079, "h": "cb647ddd1bd22d3c", "c": "use anyhow::{Context, Result};\nuse serde::{Deserialize, Serialize};\nuse std::path::PathBuf;\n\n#[derive(Debug, Clone, Serialize, Deserialize)]\npub struct Config {\n pub api_key: String,\n #[serde(default = \"default_base_url\")]\n pub base_url: String,\n #[serde(default = \"default_model\")]\n pub model: String,\n #[serde(default = \"default_max_tokens\")]\n pub max_tokens: u32,\n #[serde(default = \"default_temperature\")]\n pub temperature: f32,\n}\n\nfn default_base_url() -> String {\n \"https://api.deepseek.com\".into()\n}\nfn default_model() -> String {\n \"deepseek-v4-pro\".into()\n}\nfn default_max_tokens() -> u32 {\n 65536\n}\nfn default_temperature() -> f32 {\n 0.0\n}\n\nimpl Config {\n pub fn load() -> Result<Self> {\n if let Ok(key) = std::env::var(\"DEEPSEEK_API_KEY\") {\n return Ok(Config {\n api_key: key,\n base_url: std::env::var(\"DEEPSEEK_BASE_URL\").unwrap_or_else(|_| default_base_url()),\n model: std::env::var(\"DEEPSEEK_MODEL\").unwrap_or_else(|_| default_model()),\n max_tokens: default_max_tokens(),\n temperature: default_temperature(),\n });\n }\n\n let config_path = config_path().context(\"could not determine config path\")?;\n if config_path.exists() {\n let content =\n std::fs::read_to_string(&config_path).context(\"failed to read config file\")?;\n let config: Config = toml::from_str(&content).context(\"failed to parse config file\")?;\n return Ok(config);\n }\n\n anyhow::bail!(\n \"No API key found. Set DEEPSEEK_API_KEY env var or create {} with:\\n[api_key]\\napi_key = \\\"sk-...\\\"\",\n config_path.display()\n );\n }\n\n pub fn config_dir() -> Result<PathBuf> {\n let dir = dirs::config_dir()\n .unwrap_or_else(|| PathBuf::from(\".\"))\n .join(\"deepseek-cli\");\n std::fs::create_dir_all(&dir).ok();\n Ok(dir)\n }\n}\n\nfn config_path() -> Result<PathBuf> {\n Ok(Config::config_dir()?.join(\"config.toml\"))\n}\n"}}}}