Files
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
4.7 KiB
JSON

{"repo": "1percentsync/flashlight", "files": {"README.md": {"9f2ae0dc7a89ba5cbcfe76608cee77e4cc2bbcf0": {"t": 1786068584.2941005, "n": 4477, "h": "cfdb2ac14eb1f6c9", "c": "# Flashlight\n\nMCP Server that uses DeepSeek's 1M context window for whole-codebase code search.\n\n## How it works\n\nFlashlight loads your entire codebase into DeepSeek's context, then uses LLM understanding to find relevant code — no embeddings, no keyword matching, just brute-force full-context search.\n\nIt relies on DeepSeek's prefix caching for repeat queries: as long as the same prefix (system instructions + base code) is sent, tokens are served from cache (¥0.02/million tokens vs ¥1/million tokens for miss).\n\nFor large projects exceeding the 1M token limit, Flashlight automatically shards the codebase by directory, queries all shards in parallel, and merges results.\n\n## Setup\n\n### 1. Install\n\n```bash\nnpm install -g @1percentsync/flashlight\n```\n\n### 2. Get a DeepSeek API key\n\nGet one at [platform.deepseek.com](https://platform.deepseek.com/api_keys).\n\n### 3. Configure MCP\n\nAdd to your MCP client config:\n\n**Claude Code** (`~/.claude.json` under `mcpServers`):\n\n```json\n{\n \"flashlight\": {\n \"command\": \"flashlight\",\n \"env\": {\n \"DEEPSEEK_API_KEY\": \"sk-...\"\n }\n }\n}\n```\n\nFlashlight detects the workspace from MCP roots when the client provides them. If roots are unavailable, it falls back to the server process working directory.\n\n## Usage\n\nThe server exposes a single tool `search` with parameters:\n\n| Parameter | Required | Description |\n|-----------|----------|-------------|\n| `query` | Yes | Natural language description of the code to find |\n| `scope` | No | Optional workspace-relative directory prefix (e.g. `app` or `framework/src`). Omit to search the entire workspace. Do not pass `.`, `./`, absolute paths, or paths outside the current workspace. |\n| `file_types` | No | File extensions to filter (e.g. `[\".ts\", \".py\"]`) |\n\n### Output\n\nResults are returned as code snippets — the matched line ranges with line numbers.\n\n## Configuration\n\n### Environment variables\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `DEEPSEEK_API_KEY` | (required) | DeepSeek API key |\n| `DEEPSEEK_BASE_URL` | `https://api.deepseek.com` | DeepSeek API base URL |\n| `FLASHLIGHT_MODEL` | `deepseek-v4-flash` | Model (`deepseek-v4-flash` or `deepseek-v4-pro`) |\n| `FLASHLIGHT_REASONING_EFFORT` | `max` | Thinking effort (`high` or `max`) |\n| `FLASHLIGHT_CHANGE_THRESHOLD` | `0.1` | Ratio of changed tokens to trigger base rebuild |\n| `FLASHLIGHT_MAX_CONTEXT_TOKENS` | `900000` | Max tokens per shard (triggers auto-sharding when exceeded) |\n\n### Project-level config\n\nCreate `.flashlight/config.json` in the workspace root to customize file extensions per project:\n\n```json\n{\n \"ext_whitelist\": [\".mdx\", \".astro\"],\n \"ext_whitelist_override\": false\n}\n```\n\n| Field | Default | Description |\n|-------|---------|-------------|\n| `ext_whitelist` | `[]` | File extensions to include |\n| `ext_whitelist_override` | `false` | `true` = only index listed extensions; `false` = merge with global defaults |\n\n**Priority:** project config > `FLASHLIGHT_EXT_WHITELIST` env var > built-in defaults.\n\nThe config is read once at process start. Changes require restarting the agent environment.\n\n## How caching works\n\nFlashlight relies on DeepSeek's prefix caching. On first query, it sends all code and saves a base snapshot. On subsequent queries:\n\n1. Detect file changes against the saved base\n2. If changed tokens exceed `FLASHLIGHT_CHANGE_THRESHOLD` (default 10%) — rebuild the base entirely\n3. Otherwise — reuse the stored base text and append only changed files as incremental context\n\nThis ensures the prompt prefix stays stable across queries, maximizing cache hit rate.\n\n## Sharding (large projects)\n\nWhen a project exceeds `FLASHLIGHT_MAX_CONTEXT_TOKENS`, Flashlight automatically:\n\n1. Splits files by directory — tries the whole project first, then recursively splits by top-level directories until each group fits\n2. Queries all shards in parallel\n3. Merges and deduplicates results\n\nEach shard maintains independent cache state. Shard boundaries only change when a shard overflows (split eagerly, merge lazily).\n\n## Logs\n\nLogs are written to `.flashlight/flashlight.log` in the workspace root. Each query logs:\n- Snapshot size and shard plan\n- File change detection\n- Per-shard query cache hit ratio\n- Search results\n\n## Cost\n\nWith `deepseek-v4-flash` on a ~50K token codebase:\n\n| Operation | Cost |\n|-----------|------|\n| First query (build cache) | ~¥0.05 |\n| Subsequent query (cache hit) | ~¥0.001 + output tokens |\n\n## License\n\nISC\n"}}}}