dsh-codex-cua: Reusing Codex Native Computer Use Runtime in DSH

Preface

When building agents in DeepSeek Harness, a common requirement is enabling the model to operate browsers or local applications. Common approaches involve connecting another set of Playwright, Selenium, or a standalone RPA stack, where environment, permissions, and invocation specifications all need to be maintained manually. If the ChatGPT / Codex desktop app is already installed on the local machine, it comes with a computer use runtime (cua-repl, Chrome extension, and Sky native accessibility channel), but the DSH agent does not automatically connect to this chain by default.

Below is an introduction to the community plugin dsh-codex-cua (maintainer: 16601134718, category: workflow): after installation, the codex-cua skill and client are written to DSH’s skills directory, allowing the agent to drive Chrome and macOS native applications via cuad.py, using the existing local runtime. It does not launch the ChatGPT app, nor does it send requests to OpenAI (cua-repl is a local process).

What Is This

dsh-codex-cua is a bundle plugin for DeepSeek Harness (npm package name dsh-codex-cua, current version 0.1.0, MIT license). When mounted, apply(ctx) in lib/index.js reads assets/ from the package and idempotently writes to ~/.dsh/skills/codex-cua/ (including SKILL.md, cuad.py, and docs/). Uninstalling the plugin does not delete the already-written skill files; to thoroughly clean up, you can manually delete this directory.

The plugin is not affiliated with OpenAI; it depends heavily on the internal implementation of the desktop app, and only supports macOS. Before use, you need to legally install and authorize the ChatGPT / Codex desktop app yourself. See the repository disclaimer for related risks.

Core Features

  1. Browser automation: Read pages, click elements, and fill forms via cua.getBrowser, createBrowserTab, getTab, and other APIs; can be combined with Playwright-style evaluate.
  2. Native app operation: Obtain application objects via bundle IDs (such as com.apple.finder), read accessibility trees, click, and input.
  3. Persistent session and low latency: cuad.py communicates with the local cua-repl daemon; after the daemon is persistently running, hot invocation latency is approximately 0.09–0.14 s (measured in README), and node_repl context preserves variables across multiple send calls.
  4. Self-check and troubleshooting: python3 ~/.dsh/skills/codex-cua/cuad.py doctor checks the runtime directory, extension services, Sky services, state directory, and extension connection.

The skill file SKILL.md already specifies invocation conventions, a pitfalls checklist, and latency baselines. After loading the skill, the agent can invoke directly according to the documentation, without additional verbal guidance.

Installation and Activation

Environment requirements: macOS; ChatGPT / Codex desktop app installed and the corresponding extension installed in Chrome; Python 3.9+. Node engine requirement is >=20 (for the plugin package itself). If requirements are not met, doctor will explain item by item what is missing.

Via plugin marketplace: Search for dsh-codex-cua in the DSH plugin marketplace to install; the corresponding command in the documentation table is dsh plugin add dsh-codex-cua (writes to the skills directory).

Install from GitHub (no need to wait for npm release):

dsh plugin --profile <your profile> add github:16601134718/dsh-codex-cua

You can pin to a specific commit: github:16601134718/dsh-codex-cua#<sha>.

Install from npm (available after release):

dsh plugin --profile <your profile> add dsh-codex-cua

After installation, confirm with:

python3 ~/.dsh/skills/codex-cua/cuad.py doctor

Typical Usage

Set the client path as an environment variable for reuse:

CUAD=~/.dsh/skills/codex-cua/cuad.py

Browser: read title

python3 $CUAD send --ms 90000 '
  const b = await cua.getBrowser("1");
  const t = await cua.createBrowserTab("1", "https://example.com");
  globalThis.CUATAB = await cua.getTab(t.id, { browser: "1" });
  nodeRepl.write(await CUATAB.playwright.evaluate(() => document.title));
'

Native app: read accessibility tree fragment

python3 $CUAD send --ms 90000 '
  const app = await cua.getApp("com.apple.finder");
  nodeRepl.write((await app.getAXState()).slice(0, 400));
'

Bindings established in one send (such as CUATAB) remain available in subsequent send calls. If the timeout --ms does not return, the result will be unknown, and it will not automatically resend.

How It Works (Brief Overview)

The DSH agent loads the codex-cua skill and calls cuad.py; the stateless client communicates with the persistent node cua-repl.mjs via req.jsonl / res.jsonl under ~/.cuad/, and the daemon then connects to the Chrome extension host and Sky service. After the ChatGPT desktop app exits, the extension host and Sky may still be hosted by the system and continue running. After a crash, the next send will attempt to restart the daemon.

Commonly used environment variables (from the source documentation): DSH_HOME (default ~/.dsh), CUA_RUNTIME_DIR, CUA_BROWSER_SERVICE_DIR, CUAD_STATE_DIR (default ~/.cuad).

Usage Guidelines and Notes

Conventions within the skill include: use differential output for observation by default; do not call setTimeout before getAXState / getScreenshot; when results are unknown, re-observe instead of resending write operations; prioritize element indices, and use coordinates as a fallback. See docs/pitfalls.md in the installation directory for details.

Permissions and security: The plugin’s capabilities are equivalent to the current user’s permissions; send executes arbitrary JavaScript locally. After DSH loads the skill, the agent will invoke it autonomously. Before installing, please read the source code and MIT license, and confirm acceptance of this behavior. Under the default policy manual, server-side approval requires an explicit response; policy auto-safe is not a complete security mode.

Who it is for: Developers who need to uniformly drive Chrome and macOS native UI in DSH workflows and already have the Codex desktop runtime on their local machines. Not suitable for non-macOS environments or scenarios where the official desktop app and extension cannot be installed.

In case of failure, first run doctor and check .cuad/daemon.log; the README troubleshooting table has corresponding explanations for extension: 0, unknown, Debugger unattached, and so on.

Conclusion

dsh-codex-cua packages “install skill + persistent client” into a single DSH plugin installation path, allowing the agent to reuse the local Codex computer use stack, rather than building another parallel automation environment within the Harness.

  • Community directory page: https://www.skillhub.cn/plugins/16601134718/dsh-codex-cua
  • Source code and full documentation: https://github.com/16601134718/dsh-codex-cua

The community plugin directory is an independent site with no official affiliation to DeepSeek / 幻方 (Hunyuan); star count and version are based on the current information in the repository.

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

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

Xiaoye