feat(web): add DeepSeek-backed web search provider

Add @deepseek-ai/dsh-web-search-deepseek: a WebSearchProvider that calls
DeepSeek's Anthropic-compatible Messages API with the native
web_search_20250305 server tool and parses the structured
web_search_tool_result blocks into the ctx.web seam's WebSearchResult.

- Namespace plugin (inject: ['web']), no default export — registers into
  ctx.web like dsh-llm-deepseek registers into ctx.llm.
- Strict mode: a response with no web_search_tool_result block throws
  WEB_PROVIDER_ERROR rather than scraping URLs from model prose.
- Reuses $DEEPSEEK_API_KEY; baseURL defaults to the Anthropic-compatible
  base (api.deepseek.com/anthropic/v1) and does NOT reuse
  $DEEPSEEK_BASE_URL, which belongs to the chat-completions LLM adapter.
- snippet joined from text-block citations; sources deduped by url.
- Two-stage build layout (outDir lib/types) matching the other web
  packages; registered in tsconfig.json, tsconfig.build.json, knip.json,
  and docs/module-graph.md.
This commit is contained in:
Dudu-0223
2026-06-29 15:21:12 +08:00
parent b62cf1a31c
commit b92a3c531a
13 changed files with 834 additions and 0 deletions

13
pnpm-lock.yaml generated
View File

@@ -763,6 +763,19 @@ importers:
specifier: ^4.0.0-rc.6
version: 4.0.0-rc.6(@cordisjs/plugin-include@1.0.4)(@cordisjs/plugin-loader@1.0.0-rc.4)
packages/web/web-search-deepseek:
dependencies:
schemastery:
specifier: ^3.18.0
version: 3.18.0
devDependencies:
'@deepseek-ai/dsh-web':
specifier: workspace:^
version: link:../web
cordis:
specifier: ^4.0.0-rc.6
version: 4.0.0-rc.6(@cordisjs/plugin-include@1.0.4)(@cordisjs/plugin-loader@1.0.0-rc.4)
packages/web/web-search-exa:
dependencies:
schemastery: