dsh-gamemode:用 /gamemode 切换 DeepSeek Harness Agent 预设

前言

在 DeepSeek Harness(DSH)里,Agent 预设需要在会话开始前确定。已有做法通常是在 Web UI 的预设选择器里手动选择;如果希望在新会话里用一条斜杠命令完成同样切换,dsh-gamemode 提供了一个入口。

下面介绍它的能力、安装方式、用法和限制。

这是什么

dsh-gamemode 是一个 DSH 斜杠命令插件:/gamemode 1 用于一键切换到 DeepSeek Harness 内置“创造模式”(cordis Agent 预设)。维护者为 XCNXNXNX

它解决的是一个具体问题:在会话还没有开始之前,用命令把当前 live agent 切换到目标 Agent 预设,并记录这个选择。

核心功能

dsh-gamemode 支持以下命令和记录行为:

1、支持 /gamemode 1/gamemode creative,切换到创造模式(cordis 预设)。

2、支持 /gamemode 0/gamemode survival,切换到标准模式(standard 预设)。

3、支持 /gamemode,查看当前会话预设。

4、执行与 Web UI 预设选择器相同的操作:recompose live agent 到目标预设的 standing mount

5、记录 agent-preset/selected,以便 resume / fork 时重建同一组合。

6、包声明 dsh.bundlecordis.patch.yml 自动插入插件行。

从插件行为看,核心动作是:

ctx.agentPresets.recompose(agent.ctx, presetId)
agent.session.append('agent-preset/selected', { agentPreset })

第一句把当前 live agent 重新挂到目标预设的 standing mount;第二句落盘持久选择,使 resume / fork 时能重建同一组合。

安装与启用

在 profile 名为 web 的环境中,使用下面的安装命令:

dsh plugin --profile web add dsh-gamemode

如果你的 profile 名不是 web,需要把命令中的 web 替换为自己的 profile 名。

安装后,插件包声明的 dsh.bundlecordis.patch.yml 会自动插入插件行。

典型用法

先创建或确认一个新会话,再发送第一条消息前执行切换命令。

命令 作用
/gamemode 1(或 /gamemode creative 切换到创造模式(cordis 预设)
/gamemode 0(或 /gamemode survival 切换到标准模式(standard 预设)
/gamemode 查看当前会话预设

限制与官方界面一致:Agent 预设只能在会话尚未开始(还没有 turn/start)时切换;对话开始后预设锁定。原因是历史是在旧组合下产生的。

因此典型步骤是:

1、新建会话。

2、在发送第一条消息前执行 /gamemode 1

3、如需切回标准模式,执行 /gamemode 0

4、用 /gamemode 查看当前会话预设。

适用场景与注意

适合在新会话开始前需要在 standardcordis 之间切换的 DSH 用户。如果你已经在对话中,这个插件不能改变已产生历史对应的预设。

使用前注意:

1、插件以当前 dsh 进程权限运行。安装前应检查源码、依赖和许可证。

2、许可证为 BSD-3-Clause

3、peerDependencies 中的 @deepseek-ai/cordis@deepseek-ai/dsh-agent-presets@deepseek-ai/dsh-commands 被标记为 optional

4、如果本地构建,构建命令为:

bash scripts/build.sh

安装/注入生成的包可使用 DSH 插件工具链,例如 dev_inject_plugin

结尾

dsh-gamemode 的价值不在于新增一套预设系统,而是把 DSH 已有的预设切换路径做成一条斜杠命令:在新会话开始前,用 /gamemode 1 切到 cordis,用 /gamemode 0 切到 standard,并用 /gamemode 查看当前选择。

链接:

  • GitHub:https://github.com/XCNXNXNX/dsh-gamemode
  • 目录页:URL 未确认,因此不在此列出。
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye