DSH HUB
HomePlugin StorePlugin PacksCommunityRankingsResourcesPublish Guide
Plugin source
Back to catalog

CJYLZS /

CJYLZS/dsh-task-inbox

Verified

Turn a DeepSeek Harness conversation into a file-driven worker for another agent: tasks arrive as files, the harness does the work, and only the summary goes back.

★ 1 Stars0 Forks0 IssuesN/A Community rating0 Confirmed installs
View on GitHub
READMESource: master@2f88615f

dsh-task-inbox

English | 中文

Overview

Turn DeepSeek Harness into a file-driven autonomous worker for another AI agent (Antigravity, Claude Code, Codex) or automation script.

An upstream orchestrator writes a task file into an inbox directory and waits with zero token cost. Broad codebase exploration, multi-file edits, and iterative test-fix loops all happen inside a Harness conversation, and only a concise summary comes back — your orchestrator's context window and token budget stay small no matter how much work the worker does. Every task runs in a real workspace session inside DSH, so you can watch it live, step in, or take over at any time.

Key Features

  • Protect orchestrator context & budget. Execution is decoupled over plain files with zero-token waiting; heavy tool traffic stays in Harness while only the distilled summary returns.
  • Observable & take-over ready. New sessions attach to the workspace matching the task's cwd, making every worker turn visible and interactive in the DSH GUI instead of an opaque background job.
  • Ready-to-use cross-agent Skill. Ships with skills/dsh-worker/ (SKILL.md + zero-dependency Node 22+ client dsh-inbox.mjs) for Antigravity, Claude Code, Codex, and other skill-enabled agents.
  • Full asynchronous control plane. Supports cross-session concurrency with per-session FIFO queueing, read-only live progress sampling, timeout-free checkpointing, permission approval forwarding (so tasks do not stall waiting for a human at the DSH window), and cancellation with reason.

Table of Contents

  • Key Features
  • Installation
  • Quick Start
  • Upstream Agent Integration (Skill)
  • Compatibility
  • How It Works & Scheduling
  • File Protocol
  • Configuration & Archiving
  • Known Limitations
  • Development

Installation

Desktop (Recommended)

Open the plugin manager in DeepSeek Harness Desktop and paste this repository's GitHub URL:

https://github.com/CJYLZS/dsh-task-inbox

Restart the app after installing. The built lib/ artifacts are committed to the repository, so no local build step is required.

Web / CLI (Alternative)

If you manage a standalone Web / CLI profile:

dsh plugin --profile web add github:CJYLZS/dsh-task-inbox

Update to the latest commit on the default branch or remove the plugin:

dsh plugin --profile web update dsh-task-inbox
dsh plugin --profile web remove dsh-task-inbox

Restart Harness after installing or updating.


Quick Start

Get your first delegated task running in three steps:

1. Start watching an inbox

Run the slash command in any Harness conversation:

/inbox on                   # watch the default inbox directory
/inbox on D:\work\inbox     # or watch an explicit absolute directory
/inbox status               # show watched dir, running & queued tasks
/inbox off                  # stop watching (cancels running tasks)

Recommended for dedicated workers: enable autoWatch: true in plugin settings (or set inboxDir / export DSH_INBOX_DIR). The watcher then starts automatically on every launch and resumes seamlessly across restarts.

2. Install the bundled Skill in your orchestrator

Copy or symlink skills/dsh-worker/ into your upstream agent's skills directory:

  • Antigravity: ~/.gemini/config/skills/dsh-worker (or .agents/skills/dsh-worker in your project)
  • Claude Code: ~/.claude/skills/dsh-worker
  • Codex / other skill-enabled tools: your tool's skills folder

3. Probe liveness and dispatch a task

# 1) Verify the worker is watching
node skills/dsh-worker/scripts/dsh-inbox.mjs status

# 2) Dispatch a read-only investigation
node skills/dsh-worker/scripts/dsh-inbox.mjs dispatch \
  --cwd "/abs/path/to/your-repo" \
  --mode read-only \
  --checkpoint 300 \
  --body "Trace the auth token refresh flow and report key file paths and concurrency risks."

DSH opens a session under the matching workspace, runs the turn, and returns the concise summary along with session_id. Pass --session <session_id> on follow-up dispatches to keep the warm conversation context.


Upstream Agent Integration (Skill)

skills/dsh-worker/scripts/dsh-inbox.mjs is a zero-dependency Node 22+ CLI wrapping atomic writes, liveness probes, checkpoint polling, permission approvals, and cancellation:

# Check worker liveness, running/queued tasks, and query response bound
node skills/dsh-worker/scripts/dsh-inbox.mjs status

# Dispatch a task (--body / --body-file / stdin; --mode read-only|edit|full-access)
node skills/dsh-worker/scripts/dsh-inbox.mjs dispatch \
  --cwd "/abs/path/to/repo" \
  --mode edit \
  --checkpoint 300 \
  --body-file task.txt

# Wait on an already-dispatched task (after --no-wait or a checkpoint exit)
node skills/dsh-worker/scripts/dsh-inbox.mjs wait <task-id> --checkpoint 300

# Read-only status and live progress query for one task
node skills/dsh-worker/scripts/dsh-inbox.mjs task <task-id> [--limit 5] [--window-sec 0]

# Answer a forwarded permission request (--wait resumes waiting for the task result)
node skills/dsh-worker/scripts/dsh-inbox.mjs approve <approval-id> --wait
node skills/dsh-worker/scripts/dsh-inbox.mjs reject <approval-id> --wait --reason "out of scope"

# Cancel a queued or running task
node skills/dsh-worker/scripts/dsh-inbox.mjs cancel <task-id> --reason "plan changed"

Inbox directory resolution matches the plugin: --dir > $DSH_INBOX_DIR > $DSH_HOME/inbox > ~/.dsh/inbox.

Exit Codes

Code dispatch / wait / approve --wait / reject --wait approve / reject (no --wait) cancel
0 Task finished (done) Decision accepted Cancel acknowledged
1 Task failed (error, e.g. session-busy) Decision refused or expired Cancel refused
2 Worker not watching or CLI usage error Worker not watching or CLI error Worker not watching or CLI error
3 Checkpoint reached (task still running; live progress printed) Receipt timed out Ack timed out
4 Approval required (paused on permission; details + progress printed) — —

Compatibility

  • DeepSeek Harness: >= 0.2.2-rc.1 (developed and verified against 0.2.2-rc.5).
  • Node.js: >= 22.19 (also required by the bundled dsh-inbox.mjs script).
  • Coexistence: Registers only /inbox and one directory watcher. It takes over no official service rows and adds no model tools, so it works cleanly alongside plugins such as dsh-remote-development.

How It Works & Scheduling

Upstream agent                          inbox/                         This plugin
   |                                      |                              |
   |-- 1. write task-<id>.tmp.md          |                              |
   |-- 2. rename -> task-<id>.md -------> | -- 3. atomic claim (.running)|
   |                                      |                              |-- 4. run turn
   |   [optional] query/cancel/approval   | <======= live control =====> |
   |-- 5. wait (0 tokens)                 | <-- 6. result-<id>.md -------|
   |<-- 7. read concise summary           |                              |
  • Concurrent across sessions, FIFO within a session. Tasks without session_id each get their own ephemeral lane and run concurrently; tasks targeting the same session_id queue FIFO in that session's lane.
  • Immediate reject on external busy sessions. If a targeted session_id is currently busy outside the inbox (e.g. an active GUI turn), the plugin immediately publishes an error (session-busy) result rather than interleaving prompts.
  • Workspace attachment. New sessions attach to the workspace for cwd (creating it if needed) so every worker session appears grouped and controllable in the GUI.
  • mode drives both prompt and sandbox. read-only → read-only, edit → workspace-write (confined to cwd), full-access → danger-full-access (unrestricted machine writes; use only with explicit user approval).
  • No hard task timeout. The plugin never kills a healthy long turn on a timer. The client's --checkpoint (default 300s) simply queries progress and exits 3, leaving the continue-vs-cancel decision to the orchestrator.
  • Approval forwarding. When an inbox-dispatched turn hits a permission check, the plugin intercepts approval/request only for that task's session and forwards it to the upstream via approval-<id>.md. Other GUI sessions continue prompting normally.
  • Scan order & durability. Each scan processes cancel → approval decision → query → task, so control traffic never waits behind long turns. Claims use atomic cross-process rename, outputs publish via .tmp + rename, and .running leftovers after a crash/restart settle as error instead of silently re-running an edit task on a half-modified tree.

File Protocol

All upstream writes must be atomic: write <prefix>-<id>.tmp.md first, then rename to <prefix>-<id>.md (any filename containing .tmp. is ignored).

IDs must start with an ASCII letter or digit, contain no path separators or whitespace, and never end with .tmp or .running. cancel_id must not start with ack-; approval_id reserves the decision- and ack- prefixes.

1. Tasks: task-<id>.md → result-<id>.md

Task file (upstream writes):

---
task_id: "20261201-152001"
cwd: "d:/code/my-project"
session_id: ""
mode: "edit"
---

Find and fix the concurrent token refresh bug under src/auth/, then run the auth tests.
Report only: root cause, changed files, test results.
Field Required Meaning
task_id No If present, must match the filename.
cwd Yes Absolute working directory and sandbox boundary for read-only / edit.
session_id No Empty opens a new session; non-empty continues that session.
mode No read-only (default), edit, or full-access.

Result file (plugin writes):

---
task_id: "20261201-152001"
status: "done"
session_id: "session-3f2a91c4"
cwd: "d:/code/my-project"
duration_sec: 42
---

Root cause: both callers cleared the in-flight promise before it settled.
Edited `src/auth/refresh.ts`. `npm test auth` 12/12 passing.

status is done or error; error results include an error field explaining why.

2. Queries: query-<id>.md → answer-<id>.md

Answered directly from the plugin's in-memory state — no model call, no queueing behind active turns — within worst_case_ms (default ~1150 ms).

Field Required Meaning
query_id No If present, must match the filename.
kind Yes status (inbox overview) or task (single task state).
target For task Task ID to inspect.
progress_limit No Max progress samples when running (default 5, clamped to 20).
progress_window_sec No Limit samples to the last N seconds (0 or omitted = whole turn).

Answer bodies are always a single JSON object:

  • kind: "status" reports watched directory, earliest active running task (plus running_ids when multiple tasks run concurrently), aggregated queued IDs, and last.
  • kind: "task" reports state (unknown / queued / running / finished).
    • When finished, includes the result fields and body.
    • When running, includes progress: session_id, elapsed_sec, last_activity_sec_ago, tool_calls, last_tool, window_sec, omitted_entries, and recent (assistant text only, capped at 300 chars/entry; no reasoning or tool payloads). While paused on a permission prompt, progress also includes pending_approval: { approval_id, tool_name, reason }.

Malformed queries still receive an answer (ok: "false" + error). Silence past worst_case_ms means the plugin is not loaded or not watching that directory.

3. Permission Approvals: approval-<id>.md → approval-decision-<id>.md → approval-ack-<id>.md

When forwardApprovals: true (default) and a worker turn hits a permission check:

  1. Plugin writes approval-<id>.md (<id> is <task_id>-<6-hex>): frontmatter carries approval_id, task_id, session_id, tool_name (and optional call_id, reason); JSON body carries display_reason, tool_arguments (capped at 2000 chars), and a progress snapshot.
  2. Upstream writes approval-decision-<id>.md: frontmatter requires decision: "allow" | "reject" and accepts optional approval_id, task_id, reason.
  3. Plugin writes approval-ack-<id>.md: reports ok and outcome (allowed / rejected / expired / unknown). allow grants a single call (allowed-once); reject denies that call while letting the turn continue and adapt.

4. Cancellation: cancel-<id>.md → cancel-ack-<id>.md

Requires target and accepts optional cancel_id and reason. Answered in the same scan pass with outcome:

  • cancelled_queued: removed from its lane; result-<target>.md is immediately written as error / cancelled.
  • cancelling_running: active turn aborted; result publishes via the normal path (error: "cancelled").
  • already_finished: existing result left untouched.
  • unknown: task ID not found.

When reason is non-empty, Reason: <reason> is appended to the cancelled result body.


Configuration & Archiving

All options are optional and configurable via the DSH plugin settings page or cordis.patch.yml:

Option Default When it takes effect Description
inboxDir "" On load or next /inbox on Explicit absolute inbox path; empty falls back to default resolution.
autoWatch false On load only Start watching the default inbox automatically when the plugin loads.
archiveAfterHours 0 Immediately Move spent output files older than N hours into archive/YYYY-MM/ (0 disables).
forwardApprovals true Immediately Forward permission prompts for inbox sessions to upstream; false delegates to GUI.
maxResultChars 20000 Immediately Maximum model output characters kept in result-*.md.
maxProgressChars 2000 Immediately Total character budget for progress.recent; oldest entries drop first.
sweepIntervalMs 1000 On watcher start Fallback directory scan interval in ms (min 50); fs.watch is the fast path.

Archiving

Two independent options:

  • Consumer-driven (recommended): pass --archive (or set DSH_INBOX_ARCHIVE=1) to dsh-inbox.mjs so each read result/answer/receipt is moved into <inboxDir>/archive/.
  • Age-based: set archiveAfterHours > 0 to move aged output files (result-*, answer-*, cancel-ack-*, approval-ack-*) into archive/YYYY-MM/. Pending requests (task-*, query-*, cancel-*, approval-*, approval-decision-*), .running claims, and .tmp files are never moved.

Note: once a result file is archived, task queries for that ID answer unknown.


Known Limitations

  • full-access has no directory boundary. It sets danger-full-access; use only when the user explicitly authorizes machine-wide writes.
  • IDs must be unique per request. Reusing an already-settled task_id, query_id, cancel_id, or approval_id will not re-run the request.
  • Approval boundaries. allow applies once per call; reject does not abort the turn; the plugin retains the most recent 200 settled approval IDs in memory to distinguish expired from unknown; restarting or stopping the watcher withdraws pending approval-*.md files.
  • Progress is in-memory only. Visible only while a task is running; cleared on restart.
  • Stopped watcher does not answer. Requests written while /inbox off wait until /inbox on.
  • Creating or resuming cold sessions requires sessionController. Provided by Web / Desktop bundles; stripped profiles without it return error on new/cold sessions.
  • No dedicated status panel UI yet. Options are editable in the DSH plugin settings page; live status is inspected via /inbox status or dsh-inbox.mjs status.

Development

pnpm install
pnpm run typecheck
pnpm test          # Node 24 native type stripping (node --test); no tsx, no enums or parameter properties
pnpm run build     # emits lib/, which is committed to the repository

Licensed under MIT. This repository is authorized for listing and display on DSH Plugin (https://dsh-plugin.org/).

—/ 5

No ratings yet

Verified DSH bundle

Commit 2f88615fcd1c

Community comments

No comments yet. Be the first to write one.

DSH HUB

A community index for DSH plugins. Not an official GitHub or DeepSeek AI product.

CommunityResourcesAPIAbout