{"_id":"@deads-inc/dsh-web-search-brave","name":"@deads-inc/dsh-web-search-brave","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@deads-inc/dsh-web-search-brave","description":"Brave Search API-backed web search provider for the DeepSeek Harness web capability seam (ctx.web)","version":"1.0.0","type":"module","main":"index.js","exports":{".":"./index.js","./package.json":"./package.json"},"license":"MIT","author":{"name":"Deadman","email":"christopher.hubmann@gmail.com"},"keywords":["deepseek-harness","dsh","dsh-plugin","plugin","cordis","web-search","brave","brave-search","search-provider","search","agent","llm"],"repository":{"type":"git","url":"git+https://github.com/ChrisDeadman/dsh-web-search-brave.git"},"homepage":"https://github.com/ChrisDeadman/dsh-web-search-brave#readme","bugs":{"url":"https://github.com/ChrisDeadman/dsh-web-search-brave/issues"},"engines":{"node":">=18.17"},"publishConfig":{"access":"public"},"dsh":{"bundle":{"patch":"./cordis.patch.yml"}},"peerDependencies":{"@deepseek-ai/cordis":">=4.0.1","@deepseek-ai/dsh-credentials":">=0.1.0-rc.6","@deepseek-ai/dsh-launch-environment":">=0.1.0-rc.6","@deepseek-ai/dsh-settings":">=0.1.0-rc.6","@deepseek-ai/dsh-web":">=0.1.0-rc.6","@deepseek-ai/schemastery":">=3.18.1"},"gitHead":"10799a8c19ec6d672789257be609750515dbb513","_id":"@deads-inc/dsh-web-search-brave@1.0.0","_nodeVersion":"22.23.1","_npmVersion":"12.0.2","dist":{"integrity":"sha512-hvWRv7peeduST7OSiGwvKdnjY77BvwpWcrXd/Q3dJ0MbVF+YdZJU0gP73Y1bJ9RkHakY0f0QY8rpPTxO4w8ygg==","shasum":"facac6467eb1e946d1483260aa61000bc6246c86","tarball":"https://registry.npmjs.org/@deads-inc/dsh-web-search-brave/-/dsh-web-search-brave-1.0.0.tgz","fileCount":7,"unpackedSize":21263,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCJHnUlQkIVbsmZogwsr0gkhsXRgRUkCjkpq6bpPjDROwIhAK706PyJWv/i10UMOPTElbBQpIesqBFx7bS9ZIjADQ9L"}]},"_npmUser":{"name":"cdeadman","email":"christopher.hubmann@proton.me"},"directories":{},"maintainers":[{"name":"cdeadman","email":"christopher.hubmann@proton.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-web-search-brave_1.0.0_1787226432518_0.8104307317643971"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-20T11:47:12.209Z","1.0.0":"2026-08-20T11:47:12.681Z","modified":"2026-08-20T11:47:13.088Z"},"maintainers":[{"name":"cdeadman","email":"christopher.hubmann@proton.me"}],"description":"Brave Search API-backed web search provider for the DeepSeek Harness web capability seam (ctx.web)","homepage":"https://github.com/ChrisDeadman/dsh-web-search-brave#readme","keywords":["deepseek-harness","dsh","dsh-plugin","plugin","cordis","web-search","brave","brave-search","search-provider","search","agent","llm"],"repository":{"type":"git","url":"git+https://github.com/ChrisDeadman/dsh-web-search-brave.git"},"author":{"name":"Deadman","email":"christopher.hubmann@gmail.com"},"bugs":{"url":"https://github.com/ChrisDeadman/dsh-web-search-brave/issues"},"license":"MIT","readme":"# @deads-inc/dsh-web-search-brave\n\nBrave Search API-backed web search provider for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (`dsh`). It registers a `WebSearchProvider` into the `ctx.web` seam, so the built-in `web_search` tool works out of the box when you have a Brave Search API key.\n\n- MIT license, ~270 lines of code, zero runtime dependencies\n- Concurrency-safe rate limiting (1500ms gap between requests)\n- Exponential backoff with jitter on 429s\n- Configurable via DSH Settings or env vars\n\n## Install\n\nRequires `BRAVE_API_KEY` from [brave.com/search/api](https://brave.com/search/api/).\n\n**From npm (recommended):**\n\n```bash\ndsh plugin --profile web add @deads-inc/dsh-web-search-brave\nexport BRAVE_API_KEY=<your-key>\n```\n\n**From this repo:**\n\n```bash\ngit clone https://github.com/ChrisDeadman/dsh-web-search-brave.git\ncd dsh-web-search-brave\nexport BRAVE_API_KEY=<your-key>\nbash install.sh\n```\n\nRestart `dsh web`. Verify the provider is active:\n\n```bash\ndsh --profile web --dump-config | grep -A3 brave\n```\n\n## How it works\n\n- Registers the `brave-search` provider on the `ctx.web` seam.\n- Resolves the API key in this order:\n  1. Literal `apiKey` in the config (not recommended).\n  2. The `BRAVE_API_KEY` credential stored in the DSH credentials service.\n  3. The `BRAVE_API_KEY` env var at launch time.\n- Serializes concurrent calls through an in-process rate limiter (1500ms gap, configurable).\n- On 429/403, honors `Retry-After`, backs off with exponential + jittered backoff (capped at 30s), up to 3 attempts.\n\n## Configuration\n\nAll options are optional; sensible defaults are used.\n\n| Option | Env / Config Key | Default | Notes |\n|---|---|---|---|\n| API key | `BRAVE_API_KEY` | — | Required. |\n| API base URL | `BRAVE_SEARCH_BASE_URL` | `https://api.search.brave.com/res/v1/web/search` | Override for proxies or testing. |\n| Throttle (ms) | — | 1500 | Min gap between outbound requests. |\n| Max attempts | — | 3 | Retries on 429/403 before failing. |\n\n### Enabling as the active search provider\n\nThe plugin registers `brave-search` but does not forcibly enable it. To use it as your search backend, add this to your profile's `cordis.patch.yml`:\n\n```yaml\n- id: web\n  config:\n    searchProvider: brave-search\n```\n\n`bash install.sh` does this automatically for you.\n\n## Security notes\n\n- Your `BRAVE_API_KEY` is only ever sent to the configured `baseURL` (default: Brave's official endpoint).\n- Custom `baseURL` is an escape hatch for proxies or testing; use it deliberately. The plugin does not validate the URL's domain.\n- There are no postinstall scripts, no network calls other than the search API, no telemetry.\n\n## Development\n\nThis package is plain ESM with no build step and no runtime dependencies —\neverything it imports (`@deepseek-ai/*`) is provided by the host DSH install\nas peer dependencies.\n\nTo test a local change, run `bash install.sh`, then in a fresh terminal:\n\n```bash\n# 1. Confirm the bundle is wired into the composed profile config:\ndsh --profile web --dump-config | grep -A3 brave\n\n# 2. (Optional) Import the module directly. This needs the profile's\n#    node_modules to already carry the @deepseek-ai/* peers (a web profile\n#    that has any dshmarket package does). It fails harmlessly otherwise —\n#    dsh itself always resolves the peers from its own installation at boot:\nnode --input-type=module -e \"\n  const m = await import('@deads-inc/dsh-web-search-brave');\n  if (typeof m.apply !== 'function' || m.name !== 'web-search-brave') throw new Error('bad module');\n  console.log('OK: exports:', Object.keys(m).join(', '));\n\"\n\n# 3. With BRAVE_API_KEY set, run a real end-to-end search:\ndsh --profile web \"Use web_search to find one page about Node.js 24. Reply with just the URL.\"\n```\n\nSee [AGENTS.md](./AGENTS.md) for guidance for AI coding agents working on this repo.\n\n## License\n\n[MIT](./LICENSE).\n","readmeFilename":"README.md","_rev":"1-a3cdb1639deaddb06fa5ecaff92ddf42"}