Preface¶
Running agent sessions in DeepSeek Harness (DSH) allows logs and Trajectories to reconstruct “what happened.” However, in long turns, user messages, assistant replies, tool calls, approvals, and parallel sub-agents often interleave, making pure text scanning costly. If you are already using dsh web to manage sessions and wish to “draw the graph as execution proceeds”—distinguishing context injection from real user input and drilling down into sub-agent sub-flows—the following community plugin @weibaohui/dsh-flow (Maintainer: weibaohui, Category: Workflow) is introduced.
What is this¶
@weibaohui/dsh-flow is a web-side plugin for DSH: it subscribes to the current session’s event stream, maps turns, users, assistants, tools, approvals, retries, and other steps into flowchart nodes, and pushes them to the browser via SSE for real-time growth. The default is a four-swimlane (Context | User | Assistant | Tool) flowchart; sub-agent delegations are drawn as divergent-convergent fans, and double-clicking allows entry into that sub-agent’s complete flowchart. A compact list view is also provided for one-click switching. It operates in a strictly read-only manner on ctx.sessions and does not write events.
Core Features¶
Four-Swimlane Flowchart & Tool Railroad¶
Four vertical swimlanes are arranged by transfer frequency, with the turn progressing monotonically from left to right; ellipses represent turn start/end (including duration), diamonds represent approval decisions, and rectangles represent messages and actions. Connections are single-curve arrows, with styles switchable between quad, line, and bezier. Tool group members are connected vertically in series within the tool swimlane; the group frame introduces the flow, and the last member merges back into the main chain to avoid horizontal crossings. Tool groups are expanded by default, and clicking the group frame collapses them.
Sub-Agent Fan & Drill-Down¶
For delegation calls such as subagent, spawn_teammate, and lead, nodes are arranged horizontally below the main chain: divergent edges go down, and convergent edges merge back into the next node of the main chain. After pairing with a sub-session via the subagent/catalog roster, double-clicking a delegation node switches to that sub-agent’s complete flowchart (member boxes display task labels). The breadcrumb “← Back to Main Flow” or the Esc key allows returning, supporting hierarchical drill-down. For historical sub-sessions not in memory, the plugin reads and decompresses multi-frame zstd logs from ~/.dsh/sessions (cached by mtime), marking the status as “Static (Historical)”.
Real-time, Filtering & Resumable Streams¶
The host side subscribes to session/event; every log append is pushed to the browser via SSE, avoiding polling. Running tool nodes pulse, and when a turn is not yet closed, a “Model working…” ghost node may appear at the end of the main chain. Six types of chips (User / Context / Assistant / Tool / Todo / Event) support orthogonal filtering by type; injected messages with source.kind ≠ 'user' are categorized as “Context” to avoid confusion with real user input. SSE frames carry id: <seq>; upon reconnection, playback is resumed via Last-Event-ID followed by live streaming, with client-side deduplication by seq. New nodes automatically scroll into view when staying at the bottom; scrolling up does not interrupt, with a prompt to return to the bottom.
Details & List View¶
Double-clicking any node pops up a detail window (seq, time, turn/step, duration, callId, token usage, todo, etc.); for body text exceeding 400 characters, the full text can be loaded via a key press (GET /dsh-flow/api/event?seq=). A one-click switch to a compact list view is available, suitable for scanning text.
Installation & Activation¶
In an environment where @deepseek-ai/dsh is installed and the Web profile is used, follow the README for the installation command:
dsh plugin --profile web add @weibaohui/dsh-flow -w
Restart dsh web after installation. Open any session and enter the “Execution Flow” tab on the right side of the top Trajectory to lock onto the current session.
Version Compatibility (from README release table): Plugin 0.1.0 is verified under @deepseek-ai/dsh@0.1.7-rc.2; engines.dsh in package.json is >=0.1.7-rc.2, and the current npm package version is 0.1.7. Node requires >=22.5. License: MIT.
Typical Usage¶
- Install via the command above and restart
dsh web. - Open a running or existing session and switch to “Execution Flow”.
- Observe the four-swimlane main chain growing as execution proceeds; expand/collapse group frames in the tool swimlane when details are needed.
- When sub-agent delegations occur, view the fans below the main chain; double-click to drill down into the sub-flow, and use breadcrumbs or Esc to return.
- Switch to list view for text scanning; double-click nodes for field-level information.
- Use type chips to filter users, context, assistants, tools, etc., independently of chronological order.
Node to Event Mapping (Excerpt, see GitHub README for full table):
| Node | Source Event | Display Highlights |
|---|---|---|
| Turn Separator | turn/start, turn/end |
Full-width pill, includes end reason |
| User | user/message |
Text preview; injection type marked with “Injected” chip |
| Assistant | assistant/message |
Preview + thinking char count / tool count / token / interrupt badge |
| Tool | tool/call + tool/result |
Tool name + parameter summary; running → completed/failed + duration |
| Approval | approval/asked, approval/decided |
Waiting / Result |
| Retry | llm/retry, llm/retry-started |
Dashed orange card + reason |
Structural/background events like request/header and system/message do not enter the flowchart.
Scenarios & Notes¶
Suitable for: Debugging complex agent sessions in dsh web, troubleshooting tool chains and approval bottlenecks, and comparing sub-agent parallel dispatch behavior with sub-flows. Not suitable for replacing full-text search or offline batch analysis of Trajectories—this plugin focuses on visualizing execution topology and real-time following.
The plugin runs with the permissions of the current DSH process. API calls utilize the Host/Origin of the connection service and browser authentication barriers. It is recommended to review the source code and MIT license on GitHub before installation to ensure compatibility with your local DSH version. The community directory page is indexed by sites such as SkillHub and has no official affiliation with DeepSeek or Hifive (幻方).
Conclusion¶
@weibaohui/dsh-flow maps session logs into an interactive four-swimlane flowchart, driven by SSE for real-time growth, and supports sub-agent drill-down and list views, making it easy to “see” how an agent turn runs within the Web interface.
- Directory Page: https://www.skillhub.cn/plugins/weibaohui/dsh-flow
- Repository: https://github.com/weibaohui/dsh-flow