@forgeax/dsh-game:把 ForgeaX 遊戲工具接入 DSH profile

前言

DeepSeek Harness(DSH)按 profile 管理插件層。若想在 DSH 會話中使用 ForgeaX 遊戲工具,需要把已發佈的 @forgeax/game MCP server、包內攜帶的 ForgeaX Skills,以及 workspace guard 同時掛到同一個 profile。手動拼配置容易漏掉工具名、服務名或技能註冊。

@forgeax/dsh-game 是面向這個場景的 DSH bundle:安裝到命名 profile 後,它把 @forgeax/game MCP server、其 bundled ForgeaX Skills 和 workspace guard 接入 DSH 會話。

這是什麼

  • 包名:@forgeax/dsh-game
  • GitHub 倉庫路徑:https://github.com/ForgeaX-Games/forgeax-dsh-game-plugin
  • 許可證:MIT
  • 定位:DSH bundle,用於把 @forgeax/game MCP server、其 bundled ForgeaX Skills 和 workspace guard 接入 DSH profile。

它本身是純 JS bundle,不含遊戲邏輯,也不包含 ForgeaX 副本。它解析並驗證已發佈的 @forgeax/game,發佈 forgeaxGameLaunch 服務,再由 DSH 會話使用。

核心功能

下面介紹它提供的主要能力:

1、將已發佈的 @forgeax/game MCP server 接入 DSH 會話。

2、註冊 forgeax-game 以及已解析包內攜帶的 forgeax-engine-* Skills。

3、暴露兩個工具:

mcp__forgeax__forgeax_status_lite
mcp__forgeax__forgeax_run_current_game

4、提供 workspace guard:拒絕 mcp__forgeax__* 調用中 target_dir 不等於當前會話 cwd 的調用。

5、解析並驗證 @forgeax/game,發佈 forgeaxGameLaunch 服務。

安裝前檢查

先確認環境滿足條件:

1、平臺爲 macOS arm64、Linux x64 或 Windows x64。Intel Mac、ARM Linux、ARM Windows 可安裝,但 runtime 啓動時會失敗。

2、pnpmPATH 中。若缺少 pnpmdsh plugin 會退出碼 127

3、Node 版本 ≥ 22

4、準備一個命名 profile。--profile 是必填項,DSH 沒有隱式默認 profile。

同時檢查信任邊界:該 bundle 會解析並驗證 @forgeax/game,並在 DSH 會話中接入相關子進程。請把它當作以當前 dsh 進程權限運行的本地組件,在安裝前檢查源碼與許可證。

按已覈實資料,該 bundle 不讀取、存儲或記錄 API key、token 或 secret 值;子進程以 env: {} 啓動,DSH 清除父環境後再合併 config.env

安裝與啓用

安裝到命名 profile:

dsh plugin --profile web add @forgeax/dsh-game

如果多個 profile 都要使用,需要對每個 profile 重複執行一次。

安裝完成後重啓 dsh

dsh --profile web

bundle layers 只在啓動時讀取一次;新加的 bundle 在下次啓動前不生效。

典型用法

查詢 ForgeaX 狀態

啓動 dsh --profile web 後,在會話中請求 ForgeaX 狀態。模型應調用:

mcp__forgeax__forgeax_status_lite

注意 DSH MCP 只橋接 tools,不橋接 resources;forgeax://status 在 DSH 會話中不可達。

運行當前遊戲

該 bundle 暴露的工具中包含:

mcp__forgeax__forgeax_run_current_game

可在 DSH 會話中作爲 ForgeaX 遊戲運行入口調用。

一次性操作仍走 CLI

一次性 ForgeaX 操作仍使用 CLI:

forgeax-game <init|use|doctor|devkit|upgrade>

配置修改

如果要修改 bundle 插入的某一行,需要在 profile 的 user patch file 中插入相同 id 的行。例如修改:

id: forgeax-game.mcp-client
field: toolCallTimeoutMs

具體 patch 寫法以 DSH profile patch 規則爲準;修改後需要重啓 dsh 纔會生效。

適用場景與注意

適合這些場景:

  • 需要在 DSH 會話中調用 ForgeaX 遊戲工具。
  • 希望把 @forgeax/game MCP server、ForgeaX Skills、workspace guard 收斂到同一個 profile。
  • 希望避免在 DSH 裏手工維護重複 Skills 安裝。

使用注意:

1、不支持 transitive bundles。只有直接列在 dsh.profile.bundles 的包貢獻 patch layer;依賴該 bundle 的其他包不會自動繼承它的行。

2、不要運行 forgeax-game devkit install。該 bundle 直接註冊 Skills;同時運行安裝器只會留下 DSH 不讀取的重複副本。

3、workspace guard 對無法取得 session cwd 的 mcp__forgeax__* 調用(例如 Code Mode、nested dispatch)會在存在性檢查後允許,並告知模型未被完全檢查。

4、DSH 會話只暴露 tools;不要依賴 forgeax://status 這類 resource。

5、環境傳遞以 DSH 子進程配置爲準:子進程以 env: {} 啓動,之後合併 config.env

結尾

@forgeax/dsh-game 的價值在於把 @forgeax/game 的 MCP server、ForgeaX Skills 和 workspace guard 接入 DSH profile,使 DSH 會話可以調用 mcp__forgeax__forgeax_status_litemcp__forgeax__forgeax_run_current_game

GitHub 倉庫:https://github.com/ForgeaX-Games/forgeax-dsh-game-plugin

目錄頁:已覈實資料中沒有目錄頁 URL;如需從 DSH 社區目錄安裝,請按包名 @forgeax/dsh-game 查找。

羽毛球分组比赛记分
小程序二维码

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

小夜