DeepSeek Harness 的 PowerContext 常驻插件:模型每步前自动召回有界上下文,19 个 pc_* 工具覆盖记忆、工作移交、经验与技能,附带 Windows Server 看门狗实现常驻自启与崩溃自动拉起。
安装
# Release 预构建包
dsh plugin --profile web add "https://github.com/yangyizhu8/dsh-powercontext/releases/download/v0.0.3/powercontext-dsh-0.0.3.tgz"
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:yangyizhu8/dsh-powercontext
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。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
PowerContext 的 DeepSeek Harness 常驻插件(官方 integrations/dsh 集成的独立发行副本)。
一键把会话工作移交与项目记忆接入 dsh:模型每步前自动召回有界上下文(预置注入),19 个 pc_* 工具覆盖记忆/交接/经验/技能/审阅,/pc doctor 检查连通性。Server 不可用时 fail-open,绝不阻塞正常工作。
English: a thin DeepSeek Harness plugin that connects to a running PowerContext Server over HTTP — bounded context recall before each model step, pc_* tools for memory/handoff/experience/skills, and /pc doctor for liveness. Fail-open by design.
安装 / Install
dsh plugin --profile web add dsh-powercontext
或从本仓库目录:dsh plugin --profile web add <本目录>
前置条件(一次性):
# 1) PowerContext Server(Python/uv)
uv tool install --force "powercontext[cli,server] @ git+https://github.com/oceanbase/powercontext.git@master"
powercontext server run # 默认 http://127.0.0.1:8000(SQLite 本地存储)
# 2)(推荐)Server 常驻看门狗:登录自启 + 每分钟巡检自动拉起
# 见 scripts/server-watchdog.ps1(本仓库附带),注册为计划任务:
$wd = "<repo>\scripts\server-watchdog.ps1"
$action = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument "-NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -File `"$wd`""
$tLogon = New-ScheduledTaskTrigger -AtLogOn -User "$env:USERDOMAIN\$env:USERNAME"
$tRepeat = New-ScheduledTaskTrigger -Once -At (Get-Date).AddMinutes(1) -RepetitionInterval (New-TimeSpan -Minutes 1) -RepetitionDuration (New-TimeSpan -Days 3650)
Register-ScheduledTask -TaskName 'PowerContext-Server-Watchdog' -Action $action -Trigger $tLogon,$tRepeat -Force
能力 / What you get
- 自动召回:
agent/pre-step每模型步前POST /v1/context/prepare注入有界上下文;当前输入自动捕获为 Source 证据(POWERCONTEXT_DSH_CAPTURE_PROMPTS=false可关) - 19 个 pc_* 工具:memory(remember/list/get/revise/retire)、handoff(activate/prepare/finalize/commit/continue)、experience/skill(generate/get)、search、review(list/get)
/pc命令:/pc doctor连通性与就绪检查- 安全边界:审阅类变更为显式人工
/pc review命令;破坏性与管理类 OpenAPI 操作不暴露为模型工具 - fail-open:Server 不可用时不阻塞 DSH 正常工作
配置
patch config(cordis.patch.yml):baseUrl / timeoutMs / requestTimeoutMs / maxBytes / capturePrompts / flushOnCapture;环境变量前缀 POWERCONTEXT_DSH_(BASE_URL / AUTHORIZATION / SCOPE_ID / CAPTURE_PROMPTS / FLUSH_ON_CAPTURE)。召回返回的上下文按不可信历史标注——当前用户、仓库与系统指令始终优先。
Windows 常驻适配说明
本副本附带 scripts/server-watchdog.ps1(PowerContext Server 计划任务看门狗:登录自启 + 每分钟健康巡检 + 崩溃自动拉起),并在插件内以 node_modules junction 指向宿主 dsh 部署的 @deepseek-ai/* 官方包实例(不向 profile node_modules 复制官方包)。其余与上游一致,跟随上游更新。
上游与许可
- 上游项目:https://github.com/oceanbase/powercontext (Apache-2.0)
- 本仓库为官方
integrations/dsh插件的独立发行副本,跟随上游更新
链接
同类插件
vectorize-io/hindsight#coding-agents★ 54464
Hindsight:会学习的 Agent 长期记忆系统,自动召回/保存、知识页、深度反思与按仓库隔离的记忆银行。
volcengine/OpenViking#examples/dsh-memory-plugin★ 40976
面向 DeepSeek Harness 的 OpenViking 记忆与上下文插件:pre-step 自动召回与画像注入、会话捕获、`viking://` URI 防护,以及对接 OpenViking 服务端的 recall/write 记忆工具。
MemTensor/MemOS#memos-local-plugin★ 12136
DeepSeek Harness 本地记忆插件:分层 L1/L2/L3 记忆,自动沉淀与手动 memos_* 检索工具并存,内置记忆浏览器。
agentscope-ai/ReMe#dsh★ 3702
将 DeepSeek Harness 接入 ReMe 本地优先、自进化的个人知识库:自动把已完成的主 Agent 对话沉淀为用户掌控的 Markdown 记忆,通过 reme_search 结合 BM25、可选向量检索和 wikilink 展开搜索对话与资料,并按日整理长期记忆。
zilliztech/memsearch#MemSearch★ 2802
供 DSH 与其他编程 Agent 共享的 Markdown 记忆,支持自动捕获、步骤前上下文注入、搜索召回,以及通过审阅面板实现 memory-to-skill 自进化。
vshulcz/deja-vu#extensions/dsh★ 1321
读取本机上其他四十二个编程智能体已经写下的会话文件(Claude Code、Codex、Cursor、VS Code Copilot Chat、opencode、OpenClaw、Hermes、Kimi、Cline、Zed 等),包括安装之前的历史:提供 deja_recall、deja_session、deja_blame、deja_fix、deja_how、deja_remember 六个工具与 /deja 命令,并可选地把召回结果加入运行时上下文。本地 BM25 索引,不用大模型,不用向量嵌入,不联网(dsh plugin --profile web add dsh-deja)。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。