
Security News
Deno Goes the Way of the Dinosaur
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.
dsh-env-profile
Advanced tools
DSH 全局经验插件(骨架):自动探测本地依赖/便捷路径/网络/磁盘并沉淀为跨会话环境档案,订阅 session/event 折叠每会话统计,把低开销摘要注入每轮系统提示,env_profile 工具按需查全量——减少重复探测、加快会话、降低 token 消耗。
DSH 全局经验插件:自动探测本地环境(依赖工具 / 便捷路径 / 网络 / 磁盘),
订阅 session/event 折叠每会话统计,沉淀为跨会话的全局档案,
并把低开销摘要注入每一轮系统提示——让每个会话开局就知道
「这台机器有什么、哪些路径靠谱、网络快不快、以往会话里沉淀过什么」,
减少重复探测与重复解释,加快会话、降低 token 消耗。
状态:骨架 v0.1。核心闭环(探测 → 沉淀 → 注入 → 查询)可用, LLM 自动抽取知识条目等进阶能力见文末「路线图」。
本地开发先读这个坑(本机 2026-08-16 实测):
dsh plugin --profile web add link:<路径>装完会报Cannot find package '@deepseek-ai/schemastery'而无法加载。原因: 官方@deepseek-ai/*包不随插件分发,靠「插件的真实文件位于 profile 目录树内、 Node 父目录上溯命中$DSH_HOME/profiles/node_modules平铺闭包」解析; pnpm 对本地路径依赖一律建 junction(真实路径在 profile 树外),ESM 解析必失败。 因此本地验证用物理拷贝(与 npm/git 安装的真实布局一致):
# 0) 前置:pnpm 需在 PATH(没有就装:npm i -g pnpm;或用 npx --yes pnpm@9 包一层 shim)
# 1) 登记依赖 + bundle 层(profile package.json 的 dsh.profile.bundles 会追加 dsh-env-profile)
dsh plugin --profile web add "E:\My Documents\DskHarness-PC\dsh-env-profile"
# 2) 用物理拷贝替换 pnpm 建的 junction(官方包解析的关键一步)
$dst = "$env:USERPROFILE\.dsh\profiles\web\node_modules\dsh-env-profile"
cmd /c rmdir "$dst"
Copy-Item -Recurse "E:\My Documents\DskHarness-PC\dsh-env-profile" "$dst"
# 3) 重启 dsh web 生效;改代码后重复 2)+3)(ESM 按 URL 缓存,必须重启)
不装 pnpm 的纯手工路径(等价):在 $env:USERPROFILE\.dsh\profiles\web\package.json
的 dsh.profile.bundles 里追加 "dsh-env-profile",然后直接把插件目录拷到
$env:USERPROFILE\.dsh\profiles\web\node_modules\dsh-env-profile,重启 web。
正式分发(npm / git 源,物理落盘进 profile,无上述问题):
dsh plugin --profile web add dsh-env-profile # 发布到 npm 后
# 或 git 源(产物已入库 lib/,无 prepare 构建)
dsh plugin --profile web add "github:Yvesgao/dsh-env-profile#v0.1.0"
重启 dsh web 后验证:
$DSH_HOME/storages/ 下出现 env_profile.json(首次探测后,含 tools/paths/network/disk);## Environment profile 段;headless profile 同样适用(把上面路径里的
web换成headless)。 卸载:dsh plugin --profile web remove dsh-env-profile。
session/event ──▶ collector ──┐ ┌──▶ systemPrompt.section ──▶ 每轮注入
(tool/call,result,turn/end) │ │ (order 500, 预算 600 字符)
├── store ─┤
宿主探测(定时/手动) ──▶ probes ─┘ (env_profile 领域) └──▶ env_profile 工具 ──▶ 按需查全量
(where.exe/路径/TCP/磁盘采样) │
$DSH_HOME/storages/env_profile.json
| 部件 | 文件 | 职责 |
|---|---|---|
| 领域声明 | lib/spec.js | zod schema:env(机器档案)/ sessions(会话统计)/ facts(知识条目)三张表 |
| 宿主探测 | lib/probes.js | where.exe 扫 33 个常见命令、便捷路径存在性、TCP 443 建连耗时、1 MiB 磁盘读写采样;并发 8 路、逐条超时、全 fail-soft |
| 经验库 | lib/store.js | 内存镜像 + 写回存储领域;summarize() 同步且字节确定(KV cache 稳定的前提);remember() 知识条目去重沉淀;会话镜像剪枝(留 200 条,存储表同步删旧) |
| 采集器 | lib/collector.js | tool/call 记工具名(配对 callId),tool/result 记错误,turn/end 从 sessionProjections 折叠 llmMs/toolMs/token 账;节流写回(事件数/间隔双触发) |
| 注入器 | lib/injector.js | systemPrompt.section(order 500)+ variable 每轮求值摘要 |
| 查询工具 | lib/tool.js | env_profile:scope=summary/env/sessions/facts/all、kind 过滤、refresh 强制重测 |
store.summarize() 生成——排序、格式全部确定,
档案状态不变则每轮 system-prompt 逐字节相同,DeepSeek 前缀缓存持续命中;
段放在 order 500(工具引导之后),即使摘要变化也只使尾缀失效,
harness 身份 / persona / 工具 schema 这些大块稳定前缀照常命中。probeIntervalHours(默认 6h)缓存。schema 见 index.js 的 Config,典型覆盖(profile 的 cordis.patch.yml,
顶层数组元素按行 id 覆盖,config 整体替换、未列出的键回落到插件默认值):
- id: env-profile
config:
injectMaxChars: 400 # 注入预算调小
probeIntervalHours: 24 # 探测更懒
networkHost: api.deepseek.com
trackSessions: true
learnEnabled: false # 关闭 LLM 自动抽取(有 token 成本)
learnIntervalTurns: 5 # 每 5 轮抽取一次(默认 10)
learnMaxInputChars: 4000 # 抽取输入上限(默认 8000 字符)
where.exe 与 %LOCALAPPDATA% 等为 win32 约定;
POSIX 版本需要改用 command -v 与 $XDG_*(见路线图)。7z/wsl/pwsh 等无稳定版本参数或启动慢,只记录存在与路径。store.remember() 用 slug 去重 + 计数,
同义改写的事实可能并存(近义合并留作后续)。sourceSeq 溯源),
条目自动进入每轮注入摘要toolVersions/toolPathscommand -v / XDG 目录 / /dev/null 磁盘采样)git status、目录列表)跨会话复用settings.section slot)查看/编辑档案与条目MIT
FAQs
DSH 全局经验插件(骨架):自动探测本地依赖/便捷路径/网络/磁盘并沉淀为跨会话环境档案,订阅 session/event 折叠每会话统计,把低开销摘要注入每轮系统提示,env_profile 工具按需查全量——减少重复探测、加快会话、降低 token 消耗。
The npm package dsh-env-profile receives a total of 12 weekly downloads. As such, dsh-env-profile popularity was classified as not popular.
We found that dsh-env-profile demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.

Security News
Anthropic’s free OSS Scanner uses Mythos and other Claude models to find open source vulnerabilities and send maintainers reports with proposed fixes.

Security News
On Front Lines’ Early Adopters: CISO podcast, Andrew Becherer shares lessons from Datadog, weighs the long-term costs of AI-built tools, and explains how founders can actually gain a CISO’s trust.