rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:cenbonew/dsh-ctx-visualizer
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
English | 简体中文
See exactly what context DeepSeek Harness assembles for every model call — system vs user content, tool schemas, parsed tool calls, tool executions and the follow-up calls — as a per-turn timeline and a dynamic architecture view.
A community plugin for DeepSeek Harness (tagged dsh-plugin), not an official package. It is for anyone who wants to study the agent loop in detail: inside one multi-turn exchange — call the model → parse tool calls → execute tools → feed results back → call the model again — what exactly was sent to the model at each step, what was added compared with the previous step, and which part is growing.
After installing, the conversation header gains a Context Lens tab:
Step 1 · model call → runs bash / results fed back → Step 2 …. Click any node to switch.user → model call → tool result chains per user input, with messages new to this step highlighted and compaction summaries called out. On the right, this step's flow: request → model → each tool call's outcome/duration/result size → fed back into the next request.~/.dsh/ctx-visualizer/captures/ and restored after a plugin reload or a Harness restart.Bearer …, sk-…, tos_…, ghp_…, xoxb-… are masked before storage.| Item | Version |
|---|---|
| Developed and verified on | DeepSeek Harness Desktop 0.2.0-rc.2, @deepseek-ai/dsh-* 0.2.2-rc.1 (Web GUI) |
| Node.js (to run the tests) | ≥ 20 |
DeepSeek Harness is still in Developer Preview, so the events and interfaces this plugin relies on may change incompatibly. If something breaks, check the version first and open an issue.
The plugin has no npm dependencies, so cloning is enough:
git clone https://github.com/cenbonew/dsh-ctx-visualizer.git
Then install that local bundle in DeepSeek Harness, either way:
/absolute/path/dsh-ctx-visualizer with the Plugin Manager”.dsh.bundle.patch in package.json is what makes it installable as a bundle; the frontend half is declared by dsh.client and joins the Web GUI automatically.
After installing, refresh the page and switch to “Context Lens” at the top of any conversation. Model calls made after the plugin was enabled are captured live; earlier steps are backfilled from the session log automatically.
To update: git pull, then toggle the bundle off and on in the Plugin Manager (or restart Harness) and refresh the page.
Read-only observation built on first-class Harness events; the agent loop is never modified:
| Event / service | Purpose |
|---|---|
llm/stream (waterfall) |
Receives the full GenerateOptions of every model request (messages, tools, model, …) and collects text, reasoning, tool calls and usage while passing the response stream through unchanged |
agent/request |
Associates turn / step numbers |
tools/execute, tools/result |
Tool arguments, results, duration and outcome, correlated back to their step by callId |
agent/error |
Records failed steps |
sessionQuery.readSession |
Backfill: replays the surfaceOp (append / replace over a seq range) of system/message, user/message, assistant/message and tool/result to reconstruct the context each call received |
The frontend is a conversation.view slot plugin that reads the host-side ctxVisualizer service over typert Remote. An Inspect Provider named CtxVisualizer is also registered so an agent can query capture status with cordis_inspect_query.
Every listener is wrapped in try/catch, so a capture failure never affects the agent itself.
There is no settings form yet. Pass config to the ctx-visualizer row in the profile's cordis.patch.yml, or edit DEFAULTS at the top of lib/index.js:
| Key | Default | Meaning |
|---|---|---|
capture |
true |
Master switch |
persist |
true |
Write captures to disk |
persistDir |
~/.dsh/ctx-visualizer/captures |
Capture directory (0700, files 0600) |
backfill |
true |
Rebuild earlier steps from the session log |
backfillIntervalMs |
30000 |
Minimum gap between two backfills of one session |
maxStepsPerSession |
80 |
Live steps kept per session (rebuilt steps do not count) |
maxSessions |
40 |
Sessions kept |
maxCharsPerText / maxCharsPerToolResult |
400000 / 120000 |
Truncation bound per stored text block |
redactSecrets |
true |
Redact before storage |
npm test # self-contained; needs no Harness install and never writes to ~/.dsh
lib/index.js — host half (zero npm dependencies, Node built-ins only)lib/client.js — frontend, hand-written in Harness's ModuleLoader format; no build stepcordis.patch.yml — bundle patch that inserts the ctx-visualizer rowCLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: llm-observability、deepseek-harness。