DeepSeek Harness Plugin Hub

发布与管理完整 Harness Profiles,发现适合你的插件。

探索

插件目录环境预设文档中心动态

社区

发布插件联系我们报告问题

相关链接

Plugin Hub GitHubDeepSeek Harness 官方项目系统状态隐私说明
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

独立、非官方社区项目,与 DeepSeek 官方无隶属、授权或背书关系。

DeepSeek Harness Plugin Hub
ProfilesPlugins分类动态文档登录管理 Profiles
ProfilesPlugins分类动态文档登录
← Plugins
P

@huanlin/dsh-plugin-preface-context

Plugin Preface Context

在每次会话开头固定注入一段用户配置的文本上下文(可在设置页编辑),作为模型可见的指令注入第一轮请求。

插件会安装到这里;不确定时保持 web。

npx -y @deepseek-ai/dsh plugin --profile web add github:HuanLinOTO/dsh-plugin-preface-context#63b78e18b2f8154ab8808724af9a2271036ce8a5
README兼容性版本

说明

在每次 DSH 会话开头注入一段用户配置的文本上下文(可在设置页编辑),作为模型可见的指令。

兼容性与来源证明

Plugin Preface Context 以 @huanlin/dsh-plugin-preface-context 发布,当前版本为 0.4.0。Plugin Hub 会校验它的 manifest,并保存精确安装来源,便于复现安装结果。

DSH 兼容范围
*
运行环境
web
发布来源
github
Registry 更新时间
2026/10/18

版本

0.4.0stable
2026/10/18
0.3.1stable
2026/9/30
0.3.0stable
2026/9/24
查看其余 4 个版本收起版本
0.2.2stable
2026/9/24
0.2.1stable
2026/9/11
0.2.0stable
2026/9/10
0.1.0stable
2026/9/3

相关插件

正在加载相关插件…

最新版
0.4.0
DSH
*
HMR
重启进程
Tree shaking
未声明可安全裁剪
解包体积
未提供
文件数
未提供
Surface
web
许可证
AGPL-3.0
发布源
github
GitHub
★ 0
周下载
0
最近提交
2026/10/18
查看源码 ↗
README Badge

点击下方 Badge 复制 Markdown,粘贴到 README 即可。

这是你的 Plugin?认领权益 · 优先安全扫描

验证 package.json 声明的 GitHub 仓库,即可管理这个公开页面。认领后,Hub 会优先安排当前版本的安全扫描,并在通过后公开展示结果。

认领这个 Plugin →
报告问题

相关插件

继续浏览 memory-context 分类下经过校验的插件。

Experimental Session Search@deepseek-ai/dsh-experimental-session-search为 Agents 提供搜索和读取当前工作区早期会话的工具。Hindsight Coding Agents@vectorize-io/hindsight-coding-agents面向编程代理的仅反思式 Hindsight 长期记忆(可插拔支持多种运行框架:opencode、……),自动在后台导入(无需设置 CLI)。Contextdsh-context用于上下文洞察和管理的 DeepSeek Harness 插件,提供上下文仪表板和上下文命令,帮助了解上下文的构成及其演变过程。Memory Plugin@openviking/dsh-memory-plugin适用于 DeepSeek Harness 的 OpenViking 记忆与上下文套件

README

dsh-plugin-preface-context card

dsh-plugin-preface-context

在每次会话开头固定注入一段用户配置的文本上下文(插件行配置页可编辑),作为模型可见的 instructions 注入第一轮请求。

Injects a user-configured text block as model-visible instructions context at the start of every DSH session (editable from the plugin row's page in the Plugins manager).

功能

  • 会话开始注入:监听 agent/created 事件,在每次新建/恢复/清空/压缩会话时,通过 agent.inject() 把用户配置的文本作为一条 source.kind: 'preface-context'、form: 'instructions' 的 user/message 注入会话收件箱。该消息被第一轮 agent/pre-step 领取后送入模型请求,作为指令上下文最贴近模型的首个回答。
  • 插件行配置页可编辑:在 Plugins 管理页的本插件行配置页注册一张卡片(plugins.row.config 槽),包含:
    • 启用开关(boolean toggle)
    • 上下文文本(multiline textarea,保留换行和缩进)
  • 实时生效:配置页保存后,下一次会话开始即使用新文本,无需重启(字段为 .volatile() Config,读引用取最新值)。

开发

仓库结构

src/
├── index.ts                 # host 入口: name/inject/Config/apply + agent/created hook
├── config.ts                # Config schema (Schemastery, .volatile()) + resolvePrefaceConfig
├── settings.ts              # installPrefacePage (own-page policy; no settings.register)
└── client/
    ├── index.ts             # client 入口: 挂 plugins.row.config 槽
    ├── preface-card.tsx     # 配置卡组件
    ├── preface-card-controller.ts  # ConfigForm 桥接 (staged edit / save / discard)
    ├── bind-snapshot-selector.ts    # 内联 uSES bridge (上游不再从包根导出)
    ├── preface-card.css.ts  # 卡片样式 + <style data-plugin-css> 注入
    └── locales.ts           # zh/en 字典
tests/
├── config.test.ts           # Config schema 校验
├── settings.test.ts         # installPrefacePage 接线
├── index.test.ts            # buildPrefaceMessage 注入决策 + agent/created 接线
├── preface-card-controller.test.ts  # controller stage/save/discard
└── preface-card.spec.tsx    # 卡片渲染 + 交互 (jsdom)

前置依赖

  • Node.js >= 22
  • pnpm
  • 本机 ~/.dsh/source/current 指向 DSH 源码 checkout(tsconfig paths 解析 @deepseek-ai/* 类型)

三件套

pnpm install
pnpm run typecheck   # tsc --noEmit (host + client)
pnpm test            # vitest run
pnpm run build       # tsdown 双 bundle (host ESM + client __ModuleLoader__ CJS) + tsc 类型产物

构建策略

预构建 lib/ 入库(不含 prepare 脚本)。client 半部依赖 @deepseek-ai/dsh-client-* private peer deps,pnpm 在 git install 的 prepare 阶段会在临时目录拉不到这些包,所以 lib/ 必须预构建并提交。改源码后需 pnpm run build + commit lib/。

运行

安装到 profile

# 本地开发(热更新)
dsh plugin --profile web add "link:D:/Projects/deepseek-harness/dsh-plugin-preface-context"

# 从 GitHub 安装
dsh plugin --profile web add "github:huanlinoto/dsh-plugin-preface-context"

安装后重启 dsh web,浏览器硬刷新(Ctrl+Shift+R)。在 Plugins 管理页打开本插件所在 bundle,进入插件行配置页可见「前言上下文」卡片。

配置

插件行配置页中:

  • 启用:开关关闭时不注入任何文本。
  • 上下文文本:输入要注入的文本(支持多行)。文本为空时不注入。

也可通过 cordis.patch.yml 的 plugin-row config 块提供默认值(默认 enabled: true, contextText: '');表单编辑写回本 profile 的 cordis.patch.yml 中该 entry 的 config。

检查

pnpm run typecheck   # 类型门禁
pnpm test            # 38 个单元/组件测试
pnpm run build       # 产物: lib/index.js, lib/client.js (+ types)

为何不发布 ./invariant

本插件没有独立可分歧的观察:agent/created 监听器是 cordis effect,随插件 fiber 自动 dispose;own-page 策略挂在自己的 conditional inject child 上,disposal 由 settings 服务契约保证。按上游收紧的 invariant 规则(空 installer 与「检查服务/元数据存在」式 invariant 无效),不发布 ./invariant 子路径导出。

合规自检

  • 零源码 patch:未修改 DSH checkout 任何文件
  • B1: package.json 声明 dsh.bundle.patch
  • B2: 自带 cordis.patch.yml(insert 行 id/name/config 齐全)
  • B3: patch 行 name 用包名
  • F1: files 含 lib/ + cordis.patch.yml
  • F2: peerDependencies 含 cordis + @deepseek-ai/*(全部 optional)
  • F3: typecheck/test/build 三 script 齐全
  • A4: Config 用 Schemastery z.object
  • A6: 不导出 default
  • 预构建策略:lib/ 不在 .gitignore,无 prepare 脚本
  • UI1: plugins.row.config keyed 槽位
  • G: Unit + Component 测试分层

License

AGPL-3.0