Skip to main content
S

dsh-opencode-compat

swcmb/dsh-opencode-compat

Registers OpenCode-style tool aliases (shell, todowrite, webfetch, websearch and read/glob/grep/bash/ls) that normalize arguments and delegate to native DSH tools.

Install

dsh plugin --profile web add github:swcmb/dsh-opencode-compat

README

dsh-opencode-compat

OpenCode tool-name compatibility for DeepSeek Harness (DSH).

Some models call tools using names learned from OpenCode even when the active DSH profile exposes different native tool names. This plugin registers compatibility aliases and delegates each call to DSH's real tool implementation. It uses the DSH invocation API when available and does not implement its own tool semantics.

  • Package: @swcmb/dsh-opencode-compat
  • Runtime: Node.js >=22.19.0
  • License: MIT

Features · Tool mappings · Requirements · Installation · Troubleshooting

Features

The plugin has two compatibility layers:

  1. Core DSH aliases: four profile-level aliases for commonly hallucinated OpenCode tool names.
  2. dsh-ops aliases: six aliases for file and shell operations provided by the dsh-ops tool family. These register in agent scope and as a global fallback.

Aliases are normal DSH tools. The plugin does not implement its own file reader, file search engine, or shell process runner; it resolves the real target and delegates to that target's execute function or the DSH tool invocation API.

Tool mappings

Core aliases

Model-facing aliasDSH targetArgument handling
shellpwshRequires command; forwards workdir; maps timeout to timeoutMs; synthesizes description when absent; clamps timeout to 600,000 ms
todowritetodo_writePasses the todos payload through
webfetchweb_fetchKeeps the url argument
websearchweb_searchConverts a single query into queries: [query]; preserves an existing queries array

The most important safety property is the shell mapping: it delegates to DSH's native pwsh tool. It does not spawn PowerShell itself. DSH's native command policy, sandbox, working-directory handling, timeout, and approval flow remain in the target tool's execution path.

dsh-ops aliases

Model-facing aliasdsh-ops targetArgument handling
readops_inspect_local_fileAccepts filePath, file_path, or path; normalizes 1-based offset and limit
globops_globConverts a string pattern to the target's pattern array and requests files
grepops_grepForwards the regex pattern and converts include into the target glob array
bashops_bashMaps command/cmd, cwd/workdir, and timeout; creates a required description when absent
lsops_globRequests all entry kinds with a wildcard pattern
listops_globSame listing behavior as ls

The bash alias delegates to the real ops_bash tool. It does not create a persistent shell process or execute a command outside DSH's tool implementation.

Scope and duplicate handling

The dsh-ops targets are published in an agent's tool scope. For that reason, this plugin registers the six aliases in two places:

  • Agent scope: when an agent is created, a child plugin injects the aliases beside the agent-scoped target tools.
  • Global scope: a fallback registration supports calls without an agent context and the short interval before some tools become available.

The DSH kernel may register its own read, glob, or grep names in an agent scope. When a same-scope name already exists, the registry rejects the duplicate. The plugin catches the registration error and logs the skipped alias; it does not overwrite the kernel tool, retry indefinitely, or change DSH's tool restrictions.

write and edit are not aliases provided by this package.

Requirements

Required

  • DeepSeek Harness with the Cordis tools service and agent lifecycle events.
  • Node.js 22.19.0 or newer.
  • DSH native tools pwsh, todo_write, web_fetch, and web_search for the four core aliases.

Required for the dsh-ops alias layer

Install and enable dsh-ops, which publishes the ops_* file and shell tools. The six aliases can be registered without their targets, but an invocation returns a readable target-unavailable result until the corresponding target tool is published in the active agent scope. With the current dsh-ops bundle, enable a file-tool preset such as Standard or Cordis for ops_inspect_local_file, ops_glob, and ops_grep, and enable its Bash publishing path for ops_bash.

AliasTarget dependency
readops_inspect_local_file
glob, ls, listops_glob
grepops_grep
bashops_bash

The package name is dsh-ops. Its installation and configuration details are maintained in the dsh-ops repository.

Package dependencies

The package has no third-party npm runtime dependencies and does not import DSH's private @deepseek-ai/* modules. It uses the public Cordis tools API and Node built-ins.

When using dsh plugin, pnpm must be available on PATH.

Installation

A. Install from the package registry

Install into the profile that runs the agent:

dsh plugin --profile <profile> add @swcmb/dsh-opencode-compat@latest

For example:

dsh plugin --profile web add @swcmb/dsh-opencode-compat@latest

Inspect the composed profile and start or restart it:

dsh --profile web --dump-config
dsh --profile web

Replace web with your profile name. Bundle membership is loaded at profile startup, so restart a running profile after adding or updating this plugin.

B. Install a local checkout

From the repository directory:

git clone https://github.com/Swcmb/dsh-opencode-compat.git
cd dsh-opencode-compat
dsh plugin --profile <profile> add .

DSH/pnpm links the checkout into the selected profile. Restart the profile after installation.

C. Install and enable the dsh-ops layer

Install dsh-ops into the same profile. You can install both packages in one command:

dsh plugin --profile <profile> add dsh-ops@latest @swcmb/dsh-opencode-compat@latest

Or install dsh-ops separately when the compatibility plugin is already present:

dsh plugin --profile <profile> add dsh-ops@latest

Ensure the dsh-ops Standard or Cordis file-tool preset is active and its Bash tool is published when you need the six additional aliases. The DSH Desktop application reserves its desktop profile from the standalone npm CLI; use the CLI bundled with that Desktop installation or its plugin manager for that profile. The bundled CLI is typically at <DSH_INSTALL>/resources/runtime/cli/bin/dsh.cmd:

& "<DSH_INSTALL>/resources/runtime/cli/bin/dsh.cmd" plugin --profile desktop add dsh-ops@latest @swcmb/dsh-opencode-compat@latest

Check the active profile's composed configuration:

dsh --profile <profile> --dump-config

The compatibility plugin does not enable or replace dsh-ops tools on your behalf. Core aliases can operate independently of the dsh-ops layer.

Configuration

There is no user-facing plugin configuration. The plugin registers its aliases when the bundle loads and resolves target tools at call time.

The core aliases are registered through the profile's global tools service. The dsh-ops aliases are registered per-agent and globally. A target can be missing at startup and become available later; the alias resolves the target again when it is invoked.

Execution and safety model

  • Delegation only: each alias calls the real target tool's execute function or the DSH tool invocation API.
  • Native shell policy: shell delegates to pwsh; bash delegates to ops_bash.
  • No independent filesystem access: this plugin does not read, write, or search files itself.
  • No independent process spawning: this plugin does not spawn PowerShell, Bash, or another shell.
  • Delegation details: core aliases prefer the DSH tools.invoke/tools.call API when available; otherwise they call the resolved target definition's execute method. The dsh-ops aliases call the resolved target definition's execute method directly. The plugin reuses target implementations and does not add an independent sandbox, policy engine, or approval UI. Exact hook and approval behavior for nested/direct delegation depends on the target implementation and the DSH runtime.
  • Readable fallback: when a target cannot be resolved, the alias returns the expected native tool name and a retry hint instead of failing with an opaque unknown-tool response.
  • No same-name overrides: duplicate registration is logged and skipped.

The delegated target remains responsible for its own security policy and execution semantics.

Troubleshooting

An alias returns a target-unavailable message

Confirm that the DSH profile enables the native target:

  • shell → pwsh
  • todowrite → todo_write
  • webfetch → web_fetch
  • websearch → web_search
  • dsh-ops aliases → the corresponding ops_* target in the table above

For dsh-ops aliases, confirm that dsh-ops is installed in the same profile and its tools are exposed to the current agent.

An alias is missing

Inspect the DSH startup log for [dsh-opencode-compat]. The plugin logs registered aliases, skipped duplicate registrations, and the targets it successfully captured. A same-scope duplicate is intentionally skipped.

shell fails although pwsh works

The shell schema requires a non-empty string command. The adapter derives a description when missing and maps timeout to timeoutMs; the maximum forwarded timeout is 600,000 ms. Use the target's native parameter shape when a model call omits required data.

glob/read/grep conflict with kernel tools

The kernel may register the same names in the agent scope. This plugin does not replace an existing same-scope tool. Use the DSH-native tool that is already present, or inspect the logs to see whether the compatibility alias was skipped.

Development and tests

npm test

The test suite covers core alias schemas and mappings, shell timeout normalization, delegation success and failure, readable missing-target hints, agent/global registration, dsh-ops argument mapping, and duplicate-registration behavior.

Source layout

PathPurpose
lib/index.jsCore aliases, target resolution, delegation, and plugin registration
lib/normalize.jsPure core alias mappings and argument normalizers
lib/ops-aliases.jsAgent/global dsh-ops alias registration and argument mapping
test/compat.test.mjsCore alias behavior and registration tests
test/ops-aliases.test.mjsdsh-ops mappings, delegation, and scope tests

License

MIT.

Related plugins