yin52133/dsh-luban--packages-dsh-luban-win-debug0

@yin52133/dsh-luban-win-debug

Safe Windows embedded-debug channels and DSH session injection

包名
@yin52133/dsh-luban-win-debug
版本
0.1.1
许可证
MIT
最近更新
2026年9月1日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:yin52133/dsh-luban#fd42aad0a6c5628a3bee24796f0caba131fb0252&path:packages/dsh-luban-win-debug

Configuration

- insert:
    - id: luban-win-debug
      name: @yin52133/dsh-luban-win-debug
      config:
        serial:
          defaultBaud: 115200
          timestamp: true
          pollIntervalMs: 1500
        snippet:
          dir: ~/.dsh/luban/win-debug/snippets
          maxLines: 500
          maxBytes: 524288
        execution:
          timeoutMs: 120000
          startupTimeoutMs: 10000
          processLifetimeMs: 28800000
          maxOutputBytes: 1048576
          cwd: D:/firmware
          allowedRoots: [D:/firmware, D:/tool-config]
        tools:
          openocd: C:/Tools/OpenOCD/bin/openocd.exe
          jlink: C:/Program Files/SEGGER/JLink/JLink.exe
          esptool: C:/Tools/esptool/esptool.exe
          stm32cubeprogrammer: C:/Program Files/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32_Programmer_CLI.exe
          gdb: C:/Tools/gcc-arm/bin/arm-none-eabi-gdb.exe
          adb: C:/Android/platform-tools/adb.exe
          fastboot: C:/Android/platform-tools/fastboot.exe
          ssh: C:/Windows/System32/OpenSSH/ssh.exe
        gdb: { target: 127.0.0.1:3333 }
        remote:
          - id: lab-board
            label: Lab board SSH
            kind: ssh
            host: board.lab
            port: 22
            user: debug
            allowedCommands: [uname, journalctl]
          - id: uart-server
            label: Network UART
            kind: tcp-serial
            host: 192.0.2.10
            port: 7001
            allowedCommands: []
        desktopMcp:
          enabled: false
          command: C:/Tools/windows-mcp/windows-mcp.exe
          args: [--stdio]
          tools: [desktop.capture, desktop.click]

execution.allowedRoots is mandatory in effect: it defaults to the DSH process working directory and cannot be empty. Firmware, ELF, OpenOCD config, and script parameters must resolve inside one of those roots. Tool and MCP executable paths are exact profile-time allowlists; HTTP callers cannot replace them.

When desktopMcp.enabled is true, desktopMcp.tools must be non-empty. Each name becomes a global DSH tool via ctx.tools.register(). The server process is still lazy: an explicit Start action or the first tool call performs MCP initialize and tools/list; startup fails closed unless the server advertises every configured name. Calls then use tools/call, preserve the caller's abort signal, bound every protocol message, and tear down the owned process before a cancelled call settles. Input schemas are intentionally open objects because tools must be visible before the external server is started; the profile allowlist and the server's discovery response are both enforced.

Opening the same endpoint twice reports the owning Luban channel. For esptool serial templates, the service also performs an immediate exclusive open/close probe before launching the flasher. Keep serial monitors and vendor debug tools closed; Windows/SerialPort cannot reliably identify an arbitrary external PID, so the stable error names the likely owner class instead. OpenOCD/GDB and flash templates hold an in-process target lease until their process completes.

The service is available to other Cordis plugins as ctx.lubanWinDebug. Desktop-MCP consumers can read its local configured stdio descriptor, while DSH agents invoke the registered tools directly. The HTTP API deliberately does not return the configured command or arguments.