rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:the-ninth-moon/dsh-preset-switch
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
在 DeepSeek Harness(dsh)Web 界面中,为运行中的会话提供 Agent 模式(agent preset)中途切换能力:
agentPresets.recompose 实时重链 agent scope,并在会话日志记录 agent-preset/selected 事件;<system-reminder> 通知,让模型知道自己的工具与提示词已切换到新模式;/preset <id> 完成切换。前提:dsh Web 版(本包依赖 host 侧 commands 与 agentPresets 服务,两者在默认 profile 中均已挂载)。
重要:本包是零依赖的(host 半不 import 任何
@deepseek-ai/*包,只使用ctx上的公共服务;client 半仅require("react"),由浏览器模块表提供)。它必须作为唯一的包实例加载——dsh 的 agent scope 依赖@deepseek-ai/dsh-scope的模块私有 Symbol,任何@deepseek-ai/*核心包出现第二份副本都会让 scope 识别失效、所有会话无法创建。所以不要把本包(或任何会带入@deepseek-aipeer 依赖的包)装进profiles/web/node_modules,也不要给它加peerDependencies。
profiles/web 下,避免双包):cd $DSH_HOME/profiles
npm install github:the-ninth-moon/dsh-preset-switch
若你的
profiles/node_modules不是 junction 而是真实目录,安装后请把profiles/node_modules/dsh-preset-switch放进 dsh 实际解析模块的根(与@deepseek-ai同级的目录)。
$DSH_HOME/profiles/web/cordis.patch.yml,加入:- insert:
- id: preset-switch
name: 'dsh-preset-switch'
大概长这样
# Your patch layer for this dsh profile, applied after every bundle layer:
# a top-level YAML array of loader patch entries (id-targeted config
# overrides, disables, and insert lists; `!!js` expressions allowed).
# dsh-preset-switch: mid-session agent-preset switching (composer button beside
# the access-mode control + /preset command).
- insert:
- id: preset-switch
name: 'dsh-preset-switch'
也可以直接输入 /preset <id>(如 /preset minimal-v3)。
lib/client.js):注册到 conversation.input.left 槽位;菜单数据来自现有 agentPresets.list Remote;切换通过会话命令通道 session.command('/preset <id>') 执行——与内置 /permission 选择器同一机制。lib/index.js):注册 /preset 命令;handler 内依次执行agentPresets.resolve(id) 校验目标预设;agentPresets.recompose(agent.ctx, id) 实时重链 scope(与空白会话切换同一 API,不带锁定);session.append('agent-preset/selected', …) 记录切换;session.append('user/message', <system-reminder>…)</system-reminder> 通知模型。会话历史中已有的轮次不变,从下一轮起使用新模式的工具与提示词。
MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。