yangzhe1003
dsh-web-search-firecrawl
Firecrawl-backed search provider plugin for the DeepSeek Harness web capability seam (ctx.web)
- Stars
- 2
- Language
- TypeScript
- Created
- Aug 13, 2026
- Updated
- Aug 14, 2026
Introduction
dsh-web-search-firecrawl
English | 中文
A Firecrawl-backed search provider for the DeepSeek Harness web capability seam (ctx.web): it makes the built-in web_search tool run on Firecrawl's search API instead of the shipped DeepSeek route.
The plugin is a Cordis function plugin that registers a WebSearchProvider (id: firecrawl) into the seam — it does not own ctx.web and does not register a model-facing tool (the tool schema stays with @deepseek-ai/dsh-tool-web). It calls Firecrawl's POST /v1/search endpoint and maps the flat data[] into the seam's normalized WebSearchResult.
Requirements
- A DeepSeek Harness installation on the
0.1.0-rc.6line of the official packages (the plugin peers on@deepseek-ai/dsh-web ^0.1.0-rc.6and friends — the current release line). On an older line, pnpm nests a second copy of the seam into the profile and error classification degrades (cross-copyWebError); check from the profile directory withnpm ls @deepseek-ai/dsh-web. - A Firecrawl API key. The provider reads it from
$FIRECRAWL_API_KEYor theapiKeyconfig below (API Key). Get one at firecrawl.dev.
Install
The steps below assume the dsh CLI is on your PATH (for example installed with npm install -g @deepseek-ai/dsh). If you run dsh differently — via npx without any install, or from a source checkout — replace every dsh ... below with the matching invocation; the CLI, the profile, and the plugin must come from the same installation:
Where dsh comes from | Install command for this plugin |
|---|---|
Global install (npm install -g @deepseek-ai/dsh) | dsh plugin --profile web add -w @yangzhe1003/dsh-web-search-firecrawl |
No install — via npx | npx @deepseek-ai/dsh plugin --profile web add -w @yangzhe1003/dsh-web-search-firecrawl |
| Source checkout of deepseek-harness | pnpm dsh plugin --profile web add -w @yangzhe1003/dsh-web-search-firecrawl (from the repository root) |
-
Install the bundle (needs
pnpmon PATH; pnpm 9.x through 11.x all work — see the-wnote below):dsh plugin --profile web add -w @yangzhe1003/dsh-web-search-firecrawldsh pluginforwards to pnpm inside the profile directory and appends the bundle to the profile's layer stack automatically. The profile is a single-package pnpm workspace (itspnpm-workspace.yamldeclarespackages: [.]), so-wexplicitly targets the profile's own manifest: pnpm <10 refuses an unqualifiedaddat a workspace root (ERR_PNPM_ADDING_TO_ROOT), while pnpm ≥10 accepts both forms. The bundle patch inserts theweb-search-firecrawlplugin row and switches thewebseam row tosearchProvider: firecrawl(replacing the base bundle'sdeepseek-official). -
Provide the API key — temporary or persistent, see API Key.
-
Restart
dsh web— bundle layers are composed at boot, so a running instance does not pick up a newly installed bundle. Exit the currentdsh webprocess completely, then start it again with the same invocation you used above (dsh web,npx @deepseek-ai/dsh web, orpnpm dsh web):dsh web -
Verify — in a session, ask the agent to perform a web search; the request goes to Firecrawl. The composed tree can be inspected with
dsh --profile web --dump-config. A missing key fails the search withWEB_PROVIDER_CONFIGURED_UNAVAILABLE.
To keep DeepSeek search as the default and enable Firecrawl per instance instead, restate the web row in your profile's own cordis.patch.yml afterwards — the last write wins per row. The base bundle pins searchProvider: deepseek-official, so $DSH_WEB_SEARCH_PROVIDER selects the provider only when the web row sets no searchProvider: restate web with an empty config (- id: web + config: {}) for env selection, or with searchProvider: deepseek-official to pin DeepSeek.
API Key
Provide the key either way:
Temporary — export it in the shell before launching dsh; it lasts only for the current terminal session:
export FIRECRAWL_API_KEY=fc-...
dsh --profile web
Persistent — write it to $DSH_HOME/.env (default ~/.dsh/.env) as one bare KEY=value line (no export prefix); dsh reads it at every boot, so it survives reboots. Keep the file private:
echo 'FIRECRAWL_API_KEY=fc-...' >> ~/.dsh/.env
chmod 600 ~/.dsh/.env
Config
| Key | Default | Meaning |
|---|---|---|
apiKey | $FIRECRAWL_API_KEY | Firecrawl API key. Empty/absent makes the provider unavailable. |
baseURL | https://api.firecrawl.dev | Endpoint base; /v1/search is appended. An unparseable value makes the provider unavailable. |
limit | (unset) | Default result count when a request carries no maxResults. Unset sends no default. Must be a positive integer. |
maxSnippetChars | 600 | Upper bound on characters kept from one description when mapping snippet. Must be a positive integer. |
# profile cordis.patch.yml
- id: web-search-firecrawl
name: '@yangzhe1003/dsh-web-search-firecrawl'
config:
apiKey: !!js process.env.FIRECRAWL_API_KEY
Mapping
Firecrawl returns a flat data[] and no generated answer, so content is omitted. Each entry maps to a WebSearchSource: url ← url, title ← title, snippet ← description trimmed and bounded to maxSnippetChars (an entry without a non-blank description keeps its citeable URL-only source). A request's maxResults wins over the configured limit default and is sent as Firecrawl's limit for a cost/latency optimization; the final bound is enforced by the seam. Provider failures (HTTP errors, network failure, unparseable or wrong-shape bodies, a success: false envelope) surface as WebError WEB_PROVIDER_ERROR; an aborted request surfaces as WEB_ABORTED. HTTP redirects are rejected before the Location target is contacted.
Model Experience
Indirect, through @deepseek-ai/dsh-tool-web: the model sees the maxResults-bounded URLs, titles, and bounded descriptions, plus the consumer's error wrapper around Firecrawl search aborted, Firecrawl search request failed: <error>, and Firecrawl returned an unprocessable response body: <error>. Generated answers and provider-private fields stay out of context.
Known Limitations
- A snippet is Firecrawl's
descriptionexcerpt, not a search-engine summary — it can be long page markdown, so the provider bounds it tomaxSnippetChars; entries without a description carry no snippet at all (URL-only). - Only
limit/maxSnippetCharsare exposed — Firecrawl's other controls (language, country, recency, location, targeting, scrape options) wait on provider-neutral Service Definition fields in@deepseek-ai/dsh-web. - Abort classification is error-shape-based — only a
DOMExceptionnamedAbortErrormaps toWEB_ABORTED; an abort carrying a custom reason surfaces asWEB_PROVIDER_ERROR.
Development
pnpm install
pnpm run typecheck
pnpm test # unit suite (no network)
FIRECRAWL_API_KEY=... pnpm run test:e2e # live-API smoke, self-skips without the key
pnpm run build # emits lib/ (ESM) + lib/types/ (d.ts)
Releasing
Pushing a v<semver> tag publishes that commit to npm automatically (.github/workflows/publish.yml): the tag name becomes the published version, so
git tag v0.1.3 && git push origin v0.1.3
builds, tests, and publishes 0.1.3 with SLSA provenance. Publishing uses npm Trusted Publishing (OIDC, no npm token stored anywhere). Once, on the package's settings page on npmjs.com (https://www.npmjs.com/package/@yangzhe1003/dsh-web-search-firecrawl → Settings → Trusted Publisher), add the trusted publisher:
- CI/CD provider: GitHub Actions
- Organization or user:
yangzhe1003 - Repository:
dsh-web-search-firecrawl - Workflow filename:
publish.yml - Environment name:
publish - Allowed actions:
npm publish
The workflow references the GitHub environment publish, which is created automatically on the first run. Trusted Publishing requires npm CLI ≥ 11.5.1 and Node ≥ 22.14 — the workflow's Node 24 runner bundles npm 11.13, so this is satisfied out of the box.
License
MIT