mirage
strukto-ai
The World's First Unified Virtual Filesystem For AI Agents
PROJECT TOPICS
PROJECT README
dsh-security-manager 是一个 DeepSeek Harness(DSH)插件管理器:自动识别 profile 中已安装的插件, 定位其 npm / GitHub 来源,并提供快照保护的更新与回退——全部集成在 Web 的 设置 → 插件 → 安全 标签页中。
package.json 依赖,自动发现已安装的插件(无需手动登记名单)registry.npmjs.org 获取最新版本repository 字段解析仓库,用 github:<owner>/<repo> 更新package.json / cordis.patch.yml / pnpm-lock.yaml,
可一键回退到任意快照replaceRisk: none),不影响现有功能# 1. 安装包(pnpm 的 github: 协议,或先 clone 后用本地路径)
dsh plugin --profile web add "github:Kolos-alter/dsh-security-manager"
# 2. 在 profile 的 cordis.patch.yml 挂载(热加载,无需重启)
# profiles/web/cordis.patch.yml
- insert:
- id: security-manager
name: dsh-security-manager
config:
# 可选:pnpm 不在 PATH 时指定可执行文件
pnpmPath: 'C:\path\to\pnpm.cmd'
# 可选:home(默认 $DSH_HOME 或 ~/.dsh)、profile(默认 web)
dsh plugin --profile web add dsh-security-manager
git clone https://github.com/Kolos-alter/dsh-security-manager.git
cd dsh-security-manager
# 在 profile 目录执行(相对路径,避免空格路径问题)
cd "$env:DSH_HOME\profiles\web"
pnpm add "file:..\..\..\..\Kolos-alter\dsh-security-manager"
安装后刷新页面:设置 → 插件 → 安全 标签页即出现。
插件通过 cordis.patch.yml 的 config 字段配置(全部可选):
| 字段 | 默认 | 说明 |
|---|---|---|
home |
$DSH_HOME 或 ~/.dsh |
DSH 数据目录 |
profile |
web |
管理的 profile 名 |
pnpmPath |
pnpm(PATH) |
pnpm 可执行文件;便携版/非 PATH 环境建议填绝对路径 |
npm / GitHub / npm+GitHub / 未知before-update-<包名>),随后从识别到的源更新Host 半通过 webServer 提供 JSON 路由(同源访问):
| 路由 | 方法 | 说明 |
|---|---|---|
/api/security-manager/status |
GET | 自动识别的插件列表(版本 / 来源 / 仓库 / 安全标记) |
/api/security-manager/snapshots |
GET | 快照历史 |
/api/security-manager/snapshot |
POST {label} |
创建快照 |
/api/security-manager/update-check |
POST {package} |
npm 元数据(最新版 + 仓库) |
/api/security-manager/update |
POST {package, version?} |
更新(npm 或 GitHub 源,先快照) |
/api/security-manager/rollback |
POST {snapshot} |
回退到快照 |
profiles/<profile>/package.json 的 dependencies,逐个读 node_modules 下的包信息https://registry.npmjs.org/<pkg> 查询(dist-tags.latest + repository 字段)repository / npm 元数据解析 github.com/<owner>/<repo>pnpm add(npm 源:<pkg>[@version];GitHub 源:github:<owner>/<repo>[#ref])pnpm install# 自测:显示自动发现的插件、已装版本、快照
node lib/manager.js --self-test
dsh-security-manager/
├── lib/
│ ├── index.js # Host 半:cordis 插件 + webServer JSON 路由
│ ├── manager.js # 核心:自动发现 / 来源定位 / 快照 / 更新 / 回退(纯 Node,可独立运行)
│ └── client.js # Client 半:设置页"安全"标签页(__ModuleLoader__ 格式)
├── package.json # dsh.client 声明 + 元数据
└── README.md / README.en.md / LICENSE
.. 等非法 spec)profiles/<profile>/.security-snapshots/MIT © Kolos-alter
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: plugin-manager、security。