npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-web-search-openai

v0.2.2

Published

OpenAI-compatible web search provider (Responses API + web_search tool) for DeepSeek Harness — works with Qwen Token Plan, OpenAI and other compatible gateways, with an in-GUI configuration card

Readme

dsh-web-search-openai

面向 DeepSeek Harness(DSH)的 OpenAI 兼容联网搜索提供方。 插件挂载到 harness 的 ctx.web seam,让内置 web_search 工具通过任意实现了 OpenAI Responses API 与内置 web_search 工具的网关执行真实搜索。

工作原理

你的对话 LLM(如 deepseek-v4)判断需要实时信息时调用 web_search 工具;工具经 ctx.web seam 路由到本插件配置的 搜索提供方(如 qwen3.7-plus + 你的 Qwen Token Plan key)。搜索与对话模型完全解耦——无需切换模型、无需手动干预。

你 ──> 对话 LLM(deepseek-v4 等)
            │ 判断需要实时信息
            ▼
        web_search 工具(与模型无关)
            │ ctx.web seam ──> 配置的提供方
            ▼
        本插件:POST {baseURL}/responses
            tools: [{ type: "web_search" }]
            │
            ▼
        qwen3.7-plus / 任意兼容模型 ──> 真实搜索结果
            │
            ▼
        对话 LLM 基于搜索结果作答

已验证配置

| 字段 | 值 | |---|---| | baseURL | https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1(Qwen Token Plan 国内版) | | apiKeyEnv | QWEN_TOKEN_PLAN_CN_API_KEY | | model | qwen3.7-plusqwen3.7-maxqwen3.8-max 亦可) |

为什么必须走 Responses API? Qwen Token Plan 的内置联网搜索只在 Responses API + 显式声明 tools: [{type: "web_search"}] 时触发;chat/completionsenable_search 参数在该网关上会被静默忽略。 OpenAI 及多数 OpenAI 兼容网关使用相同的调用形态。

安装

发布为 npm 包,发布后一条命令即可:

dsh plugin add dsh-web-search-openai

本地开发目录(未经发布)方式:将包加入 profile 依赖与 bundle 列表

cd ~/.dsh/profiles/web
pnpm add file:/path/to/dsh-web-search-openai

然后把包名追加到 profiles/web/package.jsondsh.profile.bundles 列表末尾,重启应用。包内自带 cordis.patch.yml:注册 provider,并把 web 服务的 searchProvider 切到 openai-search——不修改任何随包自带文件

配置

Web 配置卡片(v0.2+)

安装后打开 设置 → 插件 → 插件配置dsh-web-search-openai 卡片可编辑端点、 凭据引用、模型、maxOutputTokens 与 API 密钥(密钥经凭据服务只写存储, 绝不落配置或代码)。保存立即生效,无需重启。

运行时优先级:UI 配置文件$DSH_HOME/dsh-web-search-openai.json

web-search-openai: 设置分节 > 包默认值。

配置

web-search-openai 设置分节(或组合中插件行)里配置:

web-search-openai:
  baseURL: https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1
  apiKeyEnv: QWEN_TOKEN_PLAN_CN_API_KEY
  model: qwen3.7-plus

| 键 | 默认值 | 含义 | |---|---|---| | apiKey | 未设置 | API key 字面值(优先用 apiKeyEnv;密钥不应写进配置) | | apiKeyEnv | QWEN_TOKEN_PLAN_CN_API_KEY | 凭据引用,每次搜索经 ctx.credentials seam 解析,回退到启动环境 | | baseURL | Qwen Token Plan 国内版 | OpenAI 兼容端点基址(不带末尾 /),自动追加 /responses | | model | qwen3.7-plus | 你的网关上支持 web_search 工具的任意模型 | | maxOutputTokens | 1024 | 单次搜索的生成 token 上限(搜索本身不受此限制) |

API key 配置

通过 harness 标准凭据路径存放即可——Web Models 设置页、~/.dsh/.credentials.yaml、或启动环境变量, 键名与你的 apiKeyEnv 一致。

计费说明

每次 web_search 调用都是搜索网关上的一次完整模型轮次(思考 + 工具调用 + 基于结果的回答,约 3~4k tokens)。 Qwen Token Plan 的内置工具按成功调用次数计费,从套餐 Credits 扣除;对话模型的 token 费用另计。

冒烟测试

cd dsh-web-search-openai
npm install
QWEN_TOKEN_PLAN_CN_API_KEY=sk-... node scripts/smoke.mjs "2025年诺贝尔物理学奖得主是谁?"

插件行为

  • 通过 registerSearchProviderctx.web 注册搜索提供方(id: openai-search)。
  • 自身不注册任何面向模型的工具;入口始终是随包提供的 web_search 工具。
  • 响应映射为严格模式:响应没有 web_search_call 块时以 WEB_PROVIDER_ERROR 失败,而非抓取正文兜底。 来源按 URL 去重;存在 url_citation 注解时补全标题。
  • 错误码遵循 seam 词汇表:WEB_PROVIDER_CREDENTIAL_MISSINGWEB_PROVIDER_ERRORWEB_ABORTED

开发与发布

npm install
node scripts/smoke.mjs            # 需在环境变量中提供 key

npm publish                       # 先升版本号

MIT 协议。任意兼容网关均可:改 baseURL / apiKeyEnv / model 三个配置即可切换。