零配置的 codebase-memory 保鲜插件:会话开始时、以及每次切换工作目录时,自动刷新该会话自己那个仓库的索引,让每个会话里的每个项目都查得到与当前代码一致的图;索引重活仍在共享 daemon 里完成。
安装
# npm 包(预构建)
dsh plugin --profile web add dsh-cbm-autorefresh
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:xingbei437/dsh-cbm-autorefresh
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
A DeepSeek Harness plugin that keeps codebase-memory indexes fresh per Session.
Harness opens one MCP connection for the whole app, so codebase-memory never learns which
workspace a Session is actually working in — every project reports
watch.reason: not_session_project and nothing auto-refreshes. This plugin closes that gap:
- on
session/created, it refreshes the index of that Session's own working directory; - on
working-directory/change, it refreshes the new directory instead; - when the plugin itself (re)loads, it catches up on the Sessions that already exist.
Each refresh is one or more short-lived CLI calls (1–3 s when nothing changed). All heavy indexing happens inside codebase-memory's shared daemon, so the plugin never keeps a background process alive: N Sessions do not mean N resident processes.
Install
# in your DSH profile directory, e.g. ~/.dsh/profiles/desktop
pnpm add dsh-cbm-autorefresh
Then add the bundle to the profile manifest and reload:
// package.json
{
"dsh": {
"profile": {
"bundles": ["@deepseek-ai/dsh-base", "dsh-cbm-autorefresh"]
}
}
}
The package ships its own cordis.patch.yml, so it mounts itself; override or disable it from
your profile patch:
- id: cbm-autorefresh
disabled: true
Configuration
- id: cbm-autorefresh
name: dsh-cbm-autorefresh
config:
enabled: true # false turns every trigger off
binary: /path/to/codebase-memory-mcp # default: $CBM_BIN, then ~/.local/bin/codebase-memory-mcp
minIntervalMs: 300000 # per-directory throttle (default 5 minutes)
timeoutMs: 600000 # per CLI call timeout (default 10 minutes)
logFile: /tmp/cbm-autorefresh.log # optional: also append every refresh line to a file
Behaviour and limits
| Situation | Result |
|---|---|
| Session starts in an indexed repo | index refreshed (≈1–3 s when unchanged) |
| Session switches to another indexed repo | that repo's index refreshed |
| Repo not indexed yet | skipped and logged — first indexing stays a deliberate act |
| Not a git working directory | skipped and logged |
Same directory within minIntervalMs |
skipped (throttled) |
| Same repo already refreshing | skipped (single-flight) |
Known limits:
- the plugin does not create indexes, it only refreshes existing ones;
- a Session that edits a lot without starting a new turn or changing directory stays refreshed at session start only — raise the triggers yourself if you need more;
- requires
codebase-memory-mcpon the machine (thebinaryconfig or$CBM_BIN).
How it works
session/created ─┐
├─► session working directory ─► git rev-parse --show-toplevel
working-directory/change ─┘ │
├─► codebase-memory-mcp cli list_projects --format json
│ (find the project whose root_path matches)
└─► codebase-memory-mcp cli index_repository --repo-path <root>
Testing
npm test
License
MIT
链接
同类插件
DayuanJiang/next-ai-draw-io#dsh-plugin★ 36802
dsh 的 draw.io 绘图插件:通过 next-ai-drawio MCP 服务器作图,点回复里的链接在右侧栏打开实时预览,可以手动修改图,AI 的每次修改都是可以恢复的版本。需 Node.js 18+,首次使用由 npx 下载 MCP 服务器。
Tencent/WeKnora#dsh-weknora★ 36302
把 WeKnora 知识库接入 dsh 的四个只读工具:列出知识库、混合检索原文片段、按顺序还原单篇文档,以及直接取用 WeKnora 自己带引用的 RAG 或 ReAct agent 回答(含可续聊的 session id)。
superdesigndev/treg★ 7042
给 Agent 的工具目录:按「要做的事」检索约 2,600 个外部接口(SEO 与 SERP、外链、社交、人物与公司信息补全、广告库、抓取),查看参数与单次调用价格后直接调用,凭据由服务端注入。附带技能,MCP 行在未设置 TREG_TOKEN 前保持禁用。
T-Auto/dsh-ops★ 5074
为 Windows 的 DSH 提供 bash、PowerShell 7 及 Rust 高性能工具,减少 token 消耗。
sixtysevenlf/dsh-blender-plugin★ 1575
让 DSH agent 通过直连 TCP 通道驱动本地 Blender,提供 15 个工具:视口帧、自定义视角渲染、Python 执行、无头与作业卸载、事务回滚,以及 34 个 family / 228 个 op 的规划层。
TencentCloudBase/CloudBase-AI-Toolkit#dsh-plugin★ 1155
把腾讯云 CloudBase 后端接入 DeepSeek Harness——在对话里搭好并部署全栈应用,查询结果渲染为表格卡片(分页、排序、导出 CSV),部署后可预览真实域名,并提供 CloudBase MCP 工具集(`mcp__cloudbase__*`),登录走 device-code 流程。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。