HelloQingTao/dsh-global-prompt ↗★ 0

@zfgcta/dsh-global-prompt

DeepSeek Harness plugin: edit the user-global instructions file (~/.dsh/AGENTS.md) from the Web settings UI. Maintained, installable fork of couplingartist/dsh-global-prompt — ships prebuilt lib/, declares dsh 0.2.x-compatible peers/engines, and installs from both npm and GitHub.

Package
@zfgcta/dsh-global-prompt
Compatibility
Unverified
Harness peer range
>=0.2.0-rc.1 <0.3.0-0
Cordis peer range
^4.0.1
Version
0.1.0
License
MIT
Last updated
Oct 13, 2026

Install

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:HelloQingTao/dsh-global-prompt

@zfgcta/dsh-global-prompt

English | 中文

Edit the user-global instructions file (~/.dsh/AGENTS.md) from the DeepSeek Harness Web settings UI — no need to open the .dsh folder by hand.

Based on couplingartist/dsh-global-prompt (MIT, © couplingartist); this repository fixes its packaging so the plugin actually installs, and continues the work.

Settings page

What you get

SituationBehavior
Settings → 全局指令 (Global instructions)A new settings section: multiline editor + Save button + file path + character count
First saveCreates ~/.dsh/AGENTS.md if it does not exist (UTF-8, no BOM)
Single source of truthThe settings page reads/writes the same file external editors do — no second copy
Effect timingFollows the harness's touch-driven reload: new sessions read the latest content immediately; open sessions re-read on their next successful file tool call or turn
SecurityThe HTTP API answers loopback (127.0.0.1) only; request bodies capped at 1 MiB

What this fork fixes

As published, upstream could never be installed from GitHub or npm:

Defect (upstream)Fix (here)
lib/ gitignored, no prepare/prepack → dsh plugin add github:... installs an empty shell (ERR_MODULE_NOT_FOUND)Prebuilt lib/ is committed, and prepack rebuilds before npm publish
The npm name dsh-global-prompt belongs to an unrelated projectPublished as @zfgcta/dsh-global-prompt
Peers pinned to 0.1.1-rc.2 → dsh 0.2.x rejects the install@deepseek-ai/dsh-client-* ranges >=0.2.0-rc.1 在 DeepSeek Harness 的 Web 设置界面里直接编辑**用户全局指令文件**(~/.dsh/AGENTS.md),不必再手动打开 .dsh` 目录改文件。

基于 couplingartist/dsh-global-prompt(MIT,© couplingartist);本仓库修复了它的打包问题使其真正可安装,并继续维护。

设置页

你会得到什么

场景行为
设置 → 全局指令新增一个设置分区页:多行编辑器 + 保存按钮 + 文件路径显示 + 字符数统计
首次保存文件不存在时自动创建 ~/.dsh/AGENTS.md(UTF-8 无 BOM)
唯一真源设置页与外部编辑器读写同一份文件,没有第二份数据
生效时机遵循系统触摸驱动刷新:新会话立即读到最新内容;已打开会话在下一次成功文件工具调用或新一轮时重新读取
安全HTTP 接口仅允许本机回环(127.0.0.1)访问;请求体上限 1 MiB

本仓库修复了什么

上游原版按它发布的样子在 GitHub / npm 上根本装不上:

缺陷(上游)修复(本仓库)
lib/ 被 gitignore 且没有 prepare/prepack → dsh plugin add github:... 装出来是空壳(ERR_MODULE_NOT_FOUND)预构建的 lib/ 直接入库,并在 npm publish 前用 prepack 重新构建
npm 上的 dsh-global-prompt 包名属于另一个无关项目改名发布为 @zfgcta/dsh-global-prompt
peer 钉死 0.1.1-rc.2 → 被 dsh 0.2.x 拒装@deepseek-ai/dsh-client-* 改为范围 >=0.2.0-rc.1 <0.3.0-0,并声明 engines.dsh
dsh.client.inject 引用了外壳里已不存在的模块改为 0.2.0-rc.2 冻结模块表实际存在的 dsh-client-ui-slots / dsh-client-ui-primitives
客户端 bundle id 硬编码旧名;sourcemap 泄漏本地路径按完整包名注册;关闭 sourcemap
缺 LICENSE / CHANGELOG / engines已补齐(MIT)

安装

# npm(推荐)
dsh plugin --profile web add @zfgcta/dsh-global-prompt

# 或者直接从 GitHub 安装(lib/ 已入库,开箱即用)
dsh plugin --profile web add github:HelloQingTao/dsh-global-prompt

重启 web 实例使新插件生效:

dsh web

然后打开 http://127.0.0.1:3080 → 设置 → 全局指令。(--profile web 请换成你实际使用的 profile。)

卸载

dsh plugin --profile web remove @zfgcta/dsh-global-prompt
dsh web

开发

pnpm install
pnpm test         # vitest:store(13)+ editor(7)
pnpm typecheck
pnpm build        # lib/index.js(宿主半)+ lib/client.js(客户端 bundle)
文件职责
src/store.ts接缝 1:用户全局指令文件的读写语义(单测覆盖)
src/index.tsHost 插件:注册 GET/PUT /api/global-prompt
src/client/GlobalPromptEditor.tsx接缝 2:编辑器组件(单测覆盖)
src/client/api.ts编辑器 IO 边界的 HTTP 实现
src/client/index.tsxClient 插件:注册 settings.section 分区
tsdown.config.ts构建:ESM 宿主 lib + 包在 __ModuleLoader__.load 里的 CJS 客户端工厂
cordis.patch.ymlbundle 层:插入 global-prompt 行

许可与致谢

MIT — 见 LICENSE。原作者 couplingartist(dsh-global-prompt);打包、兼容性与维护修复来自 HelloQingTao。