dshbase

插件目录 / Developer / dsh-user-agent

dsh-user-agent

已验证 · 实测可装 dsh-plugins

✓ 持续维护 基于 6 个官方 DSH 包

查看 GitHub ↗ ← 返回插件目录

0Stars
0Forks
0未关闭 issue
—语言
2026-08-21最近推送
跨平台平台

功能简介

Rewrites the User-Agent sent by every outgoing HTTP request (LLM API calls and other global-fetch traffic) to a value of your choice, configured live from a dedicated UA 设置 (User-Agent) tab in the Web settings. 为 dsh 发出的所有出站 HTTP 请求(LLM API 调用等走全局 fetch 的流量)改写 User-Agent,并可在 Web 设置的 UA 设置 选项卡中实时配置。

✅
我们的评价
可用 — 实测通过,早期项目

Rewrites the User-Agent sent by every outgoing HTTP request (LLM API calls and other global-fetch traffic) to a value of your choice, configured live from a dedicated UA 设置 (User-Agent) tab in the Web settings. 为 dsh 发出的所有出站 HTTP 请求(LLM API 调用等走全局 fetch 的流量)改写 User-Agent,并可在 Web 设置的 UA 设置 选项卡中实时配置。 实测能干净安装、正常启动。早期项目,但功能可用。

「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。

README

@dsh-plugin/dsh-user-agent

A DeepSeek Harness plugin that rewrites the User-Agent sent by every outgoing HTTP request (LLM API calls and other global-fetch traffic) to a value of your choice, configured live from a dedicated UA 设置 (User-Agent) tab in the Web settings.

Features

  • Rewrite anything that uses global fetch — including the DeepSeek / OpenAI-compatible adapter calls from dsh-llm-deepseek, web search, and tools that fetch over HTTP. The configured UA overrides the caller's own header (e.g. dsh-llm's attribution baseline).
  • Live settings page — a settings.section tab in the Web GUI Settings panel: toggle rewriting on/off and edit the User-Agent string. Changes apply to the very next request, no restart.
  • Standard settings integration — the value lives in the dsh-user-agent user-settings namespace, so it persists across sessions and is editable by any settings-aware surface.
  • Clean lifecycle — wraps globalThis.fetch only while the plugin runs; the original fetch is captured once and restored on stop / update / removal. Read-only fallback whenever fetch is unavailable.

Install

The package is a dsh bundle plugin (dsh.bundle.patch), installable with the standard dsh plugin add command:

dsh plugin add @dsh-plugin/dsh-user-agent
# or, with a specific profile
dsh plugin --profile web add @dsh-plugin/dsh-user-agent

Then open Settings → UA 设置 in the Web GUI: flip the switch on, type the User-Agent you want, and hit 保存 (Save).

Configuration

Plugin entry (cordis.patch.yml / profile override) — the values act as the composition base layer and are merged with the user-settings section:

Field Type Default Meaning
enabled boolean true Master switch; when off the wrapper is a pass-through.
userAgent string DeepSeek-Harness/0.1 (+https://github.com/deepseek-ai/dsh) The User-Agent applied to every rewritten request.

How it works

  • The host half wraps globalThis.fetch. On each call it reads the current config (resolved settings scope, or the composition entry when no settings service is mounted), and when enabled with a non-empty UA it builds a new Headers and forces user-agent before delegating to the original fetch.
  • The browser half registers the settings.section tab and reads/writes the namespace through the connection's ApiProxy (api.settings.describe / update), the same seam the aux/mainline DSH plugins use.

Development

npm install          # dev deps + auto-installed peers
npm run build        # tsc (host + client) + strip client module-ification artifact
npm test             # node --test
npm pack --dry-run   # inspect published contents

npm publish

.github/workflows/npm-publish.yml runs quality checks (matrix OS) and publishes:

  • pushes to main → X.Y.Z-dev.<run-id> under the next dist-tag;
  • tags vX.Y.Z (matching package.json) → publish X.Y.Z to latest with provenance.

License

MIT

安装

🧩 让 Agent 自动装(推荐)

装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 dsh-user-agent」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。

该插件是 GitHub 源码(未发 npm)——直接从仓库装:

Web profile:

dsh plugin --profile web add github:dsh-plugins/dsh-user-agent

Headless(CLI)profile:

dsh plugin --profile headless add github:dsh-plugins/dsh-user-agent

实测报告

验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。

安全:尚未扫描——我们的每日静态扫描将很快覆盖它。

分享徽章

Developer 里更多

浏览全部 7819 个插件 →