Player-YN/dsh-agent-driver-writehere0

dsh-agent-driver-writehere

Hierarchical long-form writing for DeepSeek Harness — WriteHERE as an agent driver, not extra ReAct tools.

包名
dsh-agent-driver-writehere
版本
0.1.0
许可证
MIT
最近更新
2026年8月18日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Player-YN/dsh-agent-driver-writehere

dsh-agent-driver-writehere — WriteHERE as a DeepSeek Harness agent driver

dsh-agent-driver-writehere

English · 中文

GitHub stars

Last commit

dsh-plugin

WriteHERE driver

MIT

arXiv 2503.08275

TypeScript

DSH web profile

A DeepSeek Harness agent driver that runs the WriteHERE long-form loop as a second inference cycle — not as extra ReAct tools.

GetInfo → Update → Decide → typed execute · tools: [] · task cards start a standard worker

What it is · Install · Quick start · How a tick works · What it is not · Requirements · Credits

What it is

Long-form agents on a stock ReAct loop tend to flatten. The model outlines, then dumps; or it keeps calling tools until the transcript is the article. Mid-draft revision, “this paragraph still needs a fact,” and typed work (retrieve vs. reason vs. compose) have no first-class place to live.

WriteHERE treats writing as heterogeneous recursive planning: refine a node, then either execute it or split it into typed children. This package ports that loop onto DSH as a host-owned scheduler.

Stock ReAct sessionThis driver
ConstructorReactLoopAgentWriteHereAgent
Editor toolsNative function callingtools: []
Plan / retrieve / writeOne growing transcriptTyped cards: write / think / task
RetrievalSame session, more tool callsContinuable standard worker
DraftWhatever the model typedLeaf write nodes append article.md
Web UIChat onlyOptional Card tree sidebar

Schematic of the Card tree sidebar: write, think, and task cards growing from a What is ReAct? root

Schematic of the Web UI. Card colors match the live sidebar (write / think / task / needs-update). Not a live capture of a private session.

That is why this is an agent driver (AgentLoop.prepare can choose this constructor), not a bag of article_* tools on the default loop.

Install

Official install:

dsh plugin --profile web add github:Player-YN/dsh-agent-driver-writehere

Pin a commit so main cannot move under you:

dsh plugin --profile web add github:Player-YN/dsh-agent-driver-writehere#

Copy the shipped preset into the home presets directory (the wrappers below do this for you):

# default DSH_HOME is ~/.dsh
cp -R "$DSH_HOME/profiles/web/node_modules/dsh-agent-driver-writehere/presets/article-editor" \
      "$DSH_HOME/.agent-presets/article-editor"

Restart the profile, then confirm the layer:

dsh --profile web --dump-config   # look for "# == dsh-agent-driver-writehere"

An npm name would be dsh plugin --profile web add dsh-agent-driver-writehere. That package is not on the npm registry yet.

Optional remote wrappers

install-remote.sh and install-remote.ps1 only call the official dsh plugin add and then copy the preset. They are not a second loader. Pin a commit, and only pipe a script you have read.

# macOS / Linux
WRITEHERE_PLUGIN=github:Player-YN/dsh-agent-driver-writehere \
  curl -fsSL https://raw.githubusercontent.com/Player-YN/dsh-agent-driver-writehere/main/install-remote.sh | sh
# Windows
$env:WRITEHERE_PLUGIN = 'github:Player-YN/dsh-agent-driver-writehere'
irm https://raw.githubusercontent.com/Player-YN/dsh-agent-driver-writehere/main/install-remote.ps1 | iex

Local checkout

.\install.ps1
# optional: .\install.ps1 -Profile web -Harness /path/to/deepseek-harness
dsh plugin --profile web add .
# then copy presets/article-editor → $DSH_HOME/.agent-presets/article-editor

install.ps1 copies the preset and then runs the official dsh plugin add on this directory.

If a profile already composes this driver from another layer, do not add the bundle a second time. Registration of the same driver id is exclusive.

Quick start

Web is the intended path.

  1. Start the profile: dsh --profile web (or dsh web).
  2. New session → preset article-editor (技术博客博主).
  3. Send a topic, not a shell command.
  4. Open the sidebar Card tree. Nodes grow as the scheduler splits and executes.
  5. Leaf write nodes append to article.md. task nodes hand work to a standard worker and wait for the report.

The editor never opens a terminal. If you need a command, a repo read, or an external API, that is a task card’s job.

Headless, if the host forwards --preset onto session.header.agentPreset:

dsh --profile headless --preset article-editor "Why write-back is required"

A task card parks that process. Use Web when you need the worker to return.

How a tick works

One scheduler tick: GetInfo, Update, Decide, Execute

  1. The user topic becomes the root (a follow-up that is not a new topic continues the same tree).
  2. The host constructs WriteHereAgent, not ReactLoopAgent.
  3. GetInfo — selected node, ancestors, dependencies, current draft; planner ticks also include the structural graph.
  4. Update — the model returns only {"goal":"..."} for this node.
  5. Decide{"atomic":true} to execute now, or {"atomic":false,"children":[…]} to split.
  6. Executewrite is reader prose; think is a memo; task calls startContinuable with preset: 'standard'.

A later tick may find the node in needs-update after children finished. Update runs again before execute.

What the model may return

TickAllowed reply
Update{"goal":"..."} — this node only; no children; do not rewrite a parent
Decide{"atomic":true} or {"atomic":false,"children":[{"type":"task"|"think"|"write","goal":"...","atomic":true}]}
Write executeReader-facing paragraphs. Not JSON. Not a writer briefing.
Think executeA reasoning memo, not manuscript

Rules the scheduler enforces:

  • A write parent that splits must include at least one write child.
  • think and task stay atomic unless that child sets atomic: false.
  • Optional length is a composition budget for write children only.
  • Do not glue prose onto the decision JSON.

What it does

  • Hierarchical article tree: write (reader prose), think (reasoning memo), task (retrieval or experiment — the paper’s search)
  • Paper-style Update of the selected node before decide or execute
  • needs-update when dependencies just completed
  • Incremental workspace draft from leaf writes
  • Optional Web sidebar Card tree (ui-article-tree)
  • Shipped preset article-editor (display name: 技术博客博主)

What it is not

Skip this package if you want any of the following:

  • A coding or ops agent. The editor has no tools; workers are ordinary standard sessions.
  • A file-for-file clone of principia-ai/WriteHERE. This is a new TypeScript implementation of the algorithm.
  • Extra ReAct functions (article_decompose, article_write, …) bolted onto the default loop.
  • A headless one-shot that finishes retrieval in a single process. A task card parks; the worker does not complete inside that same dsh invocation. Web is the full interactive entry.
  • Drop-in WriteHERE on a stock AgentLoop that always constructs ReactLoopAgent. See Requirements.

Requirements

  • DeepSeek Harness with the dsh CLI
  • A host where AgentLoop.prepare resolves ctx.agentDrivers and constructs that class. Without the lookup, this bundle can load and the session still constructs ReactLoopAgent. The expected hook is in patches/agent-loop-prepare.snippet.ts.
  • A live model provider (the key your profile already uses)

dsh plugin --profile add forwards to pnpm inside $DSH_HOME/profiles/. That is the official plugin path; see Package and install a plugin.

If a new article-editor session still behaves like a tool-using coder, the host is missing that prepare hook. Loading the bundle is not enough.

How it works

This repository is a DSH bundle: package.json declares "dsh": { "bundle": { "patch": "./cordis.patch.yml" } }. Installing it appends a configuration layer that inserts three plugins:

  • agent-drivers — host-plane constructor registry (ctx.agentDrivers)
  • writehere — registers WriteHereAgent and binds preset article-editor
  • ui-article-tree — Web sidebar; a no-op on headless

register and bindPreset run on the host context before any session is created. They cannot live in the preset: the preset mounts after new Agent.

Each model call gets a fresh GetInfo envelope (). Methodology skills and short column memory sit outside that JSON. Update and decide use a JSON response format; think, write, and compose are prose-only. completeText keeps only the latest GetInfo on the model-visible surface.

Compared with the paper and Python runtime

Algorithm and node types follow WriteHERE §5 / Algorithm 1 and principia-ai/WriteHERE.

Paper / PythonThis package
Editor sideWriting tools in the Python enginetools: []; host scheduler
Retrieval type namesearchtask
GetInfoShared planner contextFresh snapshot per Update, decide, and execute
Retrieval / experimentsPython lab processDSH standard sessions via startContinuable
CodeReference PythonNew TypeScript implementation

Repository

docs/                      README banner, Card tree schematic, tick diagram
packages/agent-drivers     ctx.agentDrivers registry
packages/article-tree      tree, GetInfo, draft helpers
packages/writehere         WriteHereAgent and Algorithm 1 scheduler
packages/ui-article-tree   Web Card tree sidebar
presets/article-editor     persona and skills (no tools)
cordis.patch.yml           layer applied by `dsh plugin add`

See CONTRIBUTING.md if you are changing the loop. Keep the editor free of model-facing tools.

Credits

Attribution notes: NOTICE. Machine-readable citation: CITATION.cff.

@misc{xiong2025heterogeneousrecursiveplanning,
  title={Beyond Outlining: Heterogeneous Recursive Planning for Adaptive Long-form Writing with Language Models},
  author={Ruibin Xiong and Yimeng Chen and Dmitrii Khizbullin and Mingchen Zhuge and J{\"u}rgen Schmidhuber},
  year={2025},
  eprint={2503.08275},
  archivePrefix={arXiv},
  primaryClass={cs.AI},
  url={https://arxiv.org/abs/2503.08275}
}

License

MIT. The algorithm is the paper authors’. This TypeScript port is a new implementation.

Discoverability

DeepSeek Harness lists community plugins under the dsh-plugin topic. This repository is tagged:

dsh-plugin · dsh · deepseek-harness · writehere · agent-driver · long-form-writing · cordis

That topic is how awesome-dsh-plugin and marketplace indexes find new plugins. Being listed is not a security review — readers should read this README and the source before installing.