Files
deepseek-harness/packages/ui/stdio
kingwl 1f38b211be Merge origin/master (generic task runtime #219, single-exe closure, package renames)
Semantic resolutions beyond line merges:
- The bash seam keeps resolveMode + the bash/resolve-mode waterfall on
  master's task-free BashExecutor (run/start/resolve only; BashProcess
  handles); tool-bash consults it at its stamping site and escalation
  baseline on master's render/background split, with a waterfall test on
  the recording executor.
- dsh-mode's BASH_FAMILY narrows to ['bash']: bash_output/bash_kill are
  replaced by the kind-generic task_output/task_kill, which span every
  task kind and only observe or stop work, so the access cap withholds
  only the starter it can reason about.
- The plan-mode snapshot suite adopts master's pin grammar (tool-schema
  sidecars; the expectedHeaderSnapshots extension is gone — the exit
  transition deltas, and entering-before-turn-1 needs no second
  snapshot); modes-advertise joins the plan header class (no-model, so
  membership is vacuous). Fixtures re-recorded on the acp-demo bin;
  the replay overlay gains the passthrough sandbox runner.
- examples/plan-acp-agent rewires to @deepseek-ai/dsh-acp-demo and drops
  its tool-bash entry (the spine bundle now composes it); dsh-stdio (the
  renamed stdio-chat home) keeps its /mode command and gains the dsh-mode
  peer edge; the acp bridge keeps the modes surface beside master's
  permission presets.
- mode README gains the Model Experience / Known Limitations sections the
  new README gates require; AGENTS.md ceiling 1370 → 1440 for the kept
  mode/ layout line and Agent efficiency section.
2026-07-15 23:17:18 +08:00
..
2026-07-15 11:20:48 +08:00

@deepseek-ai/dsh-stdio

The terminal readline front door for DeepSeek Harness agents. It reads prompts from stdin, sends or steers them through ctx.agents, renders the durable session/event transcript to stdout, and answers ctx.userInteraction requests in the same terminal.

This package owns the terminal channel only. It injects agents and userInteraction, then drives an agent created or resumed by app or developer code. The agent spine, agent lifecycle, console logger, and model-facing ask_user_question tool remain separate composition entries.

Config

Key Default Meaning
welcome ready. Banner printed before the first prompt
agent main Agent id driven by stdin and observed for EOF shutdown

The plugin seeds display labels from the live agent registry, then tracks agent/created and agent/disposed so HMR and externally managed agents render consistently. Disposal closes readline and unregisters every listener/provider through Cordis effects.

- id: stdio
  name: '@deepseek-ai/dsh-stdio'
  config:
    welcome: 'agent REPL ready. Give it a coding task.'
    agent: main

Model Experience

Readline prompt input

What the model sees: Each non-empty terminal line outside an active question becomes one text block, sent with agent.send() while the target agent is idle and agent.steer() while it is running.

Token effect: Submitted text is retained under the agent loop's normal session-history and compaction rules. The welcome banner, > prompt, rendered transcript, and [tool call] / [tool result] terminal lines add no tokens.

Terminal user-interaction answers

What the model sees: When a consumer calls ctx.userInteraction.ask(), this provider renders the question in the terminal and returns selected option labels or custom text. Through dsh-tool-ask-user, closed stdin becomes Error: ask_user_question cannot be answered because stdin is closed; disposal or abort becomes Error: ask_user_question was interrupted before the user answered.

Token effect: Waiting and terminal prompts add no tokens; the resolved answer or error is model-visible only through the calling tool or plugin's result.

Known Limitations and Deferred Work

  • One configured agent receives stdin — the session/event renderer can print output from any session, but input lines always drive the configured agent id rather than routing by the visible label.
  • Terminal questions are text-only and sequential — the provider queues asks, supports option labels plus custom text, and has no richer UI shapes such as file pickers or diff previews.
  • Closed stdin ends the terminal channel — EOF rejects active or queued questions and exits after submitted work reaches idle; there is no reconnect path for a long-lived process.