Janus: Bidirectional Control Between DeepSeek Harness and Herdr

Introduction

When developing agents in DSH, a common scenario is: sessions, models, and tools are all on the Harness side; while the actual orchestration of multiple terminals, Spaces, and Agents is often completed in Herdr. Since each side manages its own domain, users have to switch between windows and manually copy commands, which is slow and prone to breaking context.

Janus connects both sides to a single local bridge: agents in DSH can read and write to Herdr’s Spaces, tabs, terminals, and Agents; the Herdr side can also list active DSH sessions, issue follow-up / steer / inject commands, cancel turns, or launch visible dsh headless tasks. The following sections explain this workflow plugin in terms of its positioning, capabilities, installation, and usage.

What is it

Janus includes both the DeepSeek Harness plugin bundle (npm package name dsh-janus, current version 0.1.0) and the Herdr mod. The maintainer is Wolfloiz (Luiz Henrique Ferreira Monteiro), the repository is Wolfloiz/plugin-janus, and the license is MIT. It is categorized as a workflow in SkillHub; GitHub stars are 0 (refer to the repository page).

In short: Two sides use a “face” each, with a bridge in the middle — control Herdr from DSH, and control DSH from Herdr.

How it works (Brief)

Agents inside the DSH web process call the local herdr-app / hc via the tool dsh-janus; the plugin starts an HTTP service on a loopback interface, and the Herdr mod reads the bearer token from ~/.dsh/janus/bridge.json, polling status approximately every 3 seconds. The bridge binds only to 127.0.0.1, and all routes require a token.

DSH agent ──tools──> dsh-janus ──> herdr-app / hc ──> Herdr
              │
              ├── HTTP 127.0.0.1:<port> + Bearer
              └── agent.followup / steer / cancel

Herdr mod: Sidebar 150px dock + 560×720 panel (ctrl-shift-j)

Every time the plugin starts, it writes a discovery file with a random token; the mod uses this file to connect to the bridge, and status changes are notified via Herdr toasts.

Core Features

DSH → Herdr (Tool janus_herdr)

Action Effect
status Herdr application status and hc terminal
list List Spaces, tabs, terminals, Agents
read Read terminal screen and history
send Paste text and press Enter
keys Send named keys (e.g., enter, esc, ctrl+c)
run Launch a program or Agent in a new terminal
open Create new Space/tab with optional first task
focus Focus Space, tab, or terminal
notify Display toast in Herdr via mod
kill / close Destructive operations, require confirm: true

Herdr → DSH (Tool janus_dsh and Mod Panel)

Action Effect
sessions List active sessions (title, status, cwd, model, recent text)
prompt Execute followup, steer, or inject on other sessions
cancel Cancel current turn
spawn Create a persistent session inside the DSH web process
job Run dsh headless visibly in a Herdr tab
job_continue Resume a task using dsh headless --session-id
notify Herdr toast

The Herdr panel also provides a dock, notifications, prompt input, Cancel with double-click confirmation, forms for creating sessions/new tasks, and a task list with Terminal and Continue support.

Requirements

  • DeepSeek Harness 0.2.2-rc.1 (or compatible 0.2.x), and using the web profile.
  • Herdr installed, with herdr-app and hc in PATH.
  • Node.js 22+ (DSH includes its own runtime; engines.node in package.json is >=22).

engines.dsh is declared as >=0.2.0-rc.1 <0.3.0.

Installation and Enabling

Plugins run with the current DSH process permissions. It is recommended to read the repository source code and the MIT license before installing. The following commands are from the project README.

Install DSH bundle only

After dsh-janus is published on npm:

dsh plugin --profile web add dsh-janus

Or install from the Git repository root (bundle declares dsh.bundle, main exports dsh-janus/lib/index.js) for a specific commit:

dsh plugin --profile web add \
  "git+https://github.com/Wolfloiz/plugin-janus.git#<sha>"

After installation, the DSH web process must be restarted (Ctrl+C in the terminal running dsh web, then run dsh web), re-open http://127.0.0.1:3080, and restore sessions before the module will load. The Herdr side mod can be hot-updated; the DSH side requires a restart.

Install Herdr mod only

Given that you have the plugin-janus directory, symlink the mod to the user configuration and verify:

ln -sfn "$PWD/mods/janus" ~/.config/herdr-app/mods/janus
herdr-app check ~/.config/herdr-app/mods/janus

A full one-click installation (including bundle, headless profile default model, janus-dock layout, shortcut ctrl-shift-j → janus.open, and janus CLI) is handled by bash scripts/install.sh in the repository; you must first obtain the repository files (e.g., via the dsh plugin add git+... command above or the directory where the npm package resides).

Typical Usage

Using natural language in DSH

Examples of intent from the README include:

  • List Herdr’s Spaces and Agents, and explain which one is blocked.
  • Read the last 80 lines of terminal t2j.
  • Open Codex agent in Herdr with a specific task in this repository.
  • Send run the tests to terminal t7.
  • List DSH sessions and send a follow-up to the session currently working.
  • Launch a headless task to run the test suite and notify upon completion.

In the Herdr Panel

  • The JANUS bar in the sidebar shows bridge status and up to three sessions; click open to open the panel.
  • ctrl-shift-j opens the panel, Esc closes it.
  • Select a session, enter a prompt, choose Send; chips can switch to Steer or Inject.
  • New session creates a persistent web session; New job opens a visible headless run; tasks support Terminal and Continue.
  • done / job_done / notice events become toasts.

Security and Usage Notes

  • The bridge listens only on 127.0.0.1 on a temporary port; a 32-byte random bearer token is stored in ~/.dsh/janus/bridge.json (file mode 0600, directory 0700), and requests must include Authorization: Bearer <token>.
  • Herdr’s kill, close, and the Cancel button on the panel all require explicit confirmation.
  • The plugin does not record prompts or terminal content. The Herdr mod is trusted code with network access; do not leak bridge.json.

Suitable for developers already orchestrating multi-terminal, multi-Agent stacks using the DSH web + Herdr setup. If you only use the DSH CLI or do not have Herdr, the bidirectional capabilities cannot be utilized.

The README records a live verification on 2026-11-11 in a DSH web environment (including DSH→Herdr, Herdr→DSH, spawn, notifications); unit tests are npm test (16/16).

Conclusion

Janus connects Harness agent tools and Herdr terminal orchestration via a local token bridge, reducing manual transfer between two interfaces. Directories and source code:

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

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

Xiaoye