@mingozhou/dsh-replay 0.3.3 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +225 -164
  2. package/README.zh.md +225 -164
  3. package/assets/icon.png +0 -0
  4. package/lib/client.js +955 -2419
  5. package/lib/core.js +557 -86
  6. package/lib/index.js +1043 -51
  7. package/lib/types/src/client/api.d.ts +44 -0
  8. package/lib/types/src/client/components/AuditView.d.ts +2 -1
  9. package/lib/types/src/client/components/CompareView.d.ts +2 -1
  10. package/lib/types/src/client/components/DashboardView.d.ts +8 -0
  11. package/lib/types/src/client/components/ExportDialog.d.ts +9 -0
  12. package/lib/types/src/client/components/ReplayApp.d.ts +4 -2
  13. package/lib/types/src/client/components/ReplayModal.d.ts +1 -1
  14. package/lib/types/src/client/components/SessionPicker.d.ts +4 -3
  15. package/lib/types/src/client/components/TimelineView.d.ts +2 -1
  16. package/lib/types/src/client/export.d.ts +6 -1
  17. package/lib/types/src/client/i18n.d.ts +8 -1
  18. package/lib/types/src/client/pricing.d.ts +6 -0
  19. package/lib/types/src/core/audit.d.ts +18 -0
  20. package/lib/types/src/core/compare.d.ts +8 -3
  21. package/lib/types/src/core/cost.d.ts +21 -3
  22. package/lib/types/src/core/index.d.ts +1 -0
  23. package/lib/types/src/core/redact.d.ts +40 -0
  24. package/lib/types/src/core/timeline.d.ts +9 -0
  25. package/lib/types/src/index.d.ts +52 -1
  26. package/lib/viewer.js +282 -29
  27. package/package.json +118 -107
  28. package/scripts/build.mjs +8 -2
  29. package/src/client/api.ts +114 -10
  30. package/src/client/components/AuditView.tsx +89 -10
  31. package/src/client/components/CompareView.tsx +89 -13
  32. package/src/client/components/DashboardView.tsx +232 -0
  33. package/src/client/components/ExportDialog.tsx +136 -0
  34. package/src/client/components/ItemDetail.tsx +36 -4
  35. package/src/client/components/OverviewView.tsx +150 -34
  36. package/src/client/components/ReplayApp.tsx +207 -60
  37. package/src/client/components/ReplayModal.tsx +41 -6
  38. package/src/client/components/SessionPicker.tsx +55 -27
  39. package/src/client/components/TimelineView.tsx +106 -41
  40. package/src/client/export.ts +20 -4
  41. package/src/client/i18n.ts +266 -45
  42. package/src/client/index.ts +7 -5
  43. package/src/client/mascot-image.ts +1 -1
  44. package/src/client/pricing.ts +90 -0
  45. package/src/client/styles.css +250 -1
  46. package/src/client/viewer-entry.tsx +25 -4
  47. package/src/core/audit.ts +274 -67
  48. package/src/core/compare.ts +0 -0
  49. package/src/core/cost.ts +94 -16
  50. package/src/core/index.ts +1 -0
  51. package/src/core/redact.ts +182 -0
  52. package/src/core/timeline.ts +107 -12
  53. package/src/index.ts +290 -54
package/README.md CHANGED
@@ -1,164 +1,225 @@
1
- <div align="center">
2
-
3
- <img src="./assets/jingxiaoshen.png" width="150" alt="Jing Xiaoshen (鲸小深), the dsh-replay mascot" />
4
-
5
- # dsh-replay
6
-
7
- **Time machine for your agent sessions.**<br/>
8
- Replay · Audit · Cost · Fork tree · Compare — inside the DeepSeek Harness web UI.
9
-
10
- [![ci](https://github.com/MingoZhou/dsh-replay/actions/workflows/ci.yml/badge.svg)](https://github.com/MingoZhou/dsh-replay/actions/workflows/ci.yml)
11
- [![license](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
12
- [![dsh-plugin](https://img.shields.io/badge/dsh-plugin-4d6bfe.svg)](https://github.com/topics/dsh-plugin)
13
- [![PRs welcome](https://img.shields.io/badge/PRs-welcome-1baf7a.svg)](https://github.com/MingoZhou/dsh-replay/pulls)
14
-
15
- **[🎮 Live demo](https://mingozhou.github.io/dsh-replay/)** · [中文文档](./README.zh.md) · [Install](#-quick-start) · [FAQ](#-faq--troubleshooting)
16
-
17
- <img src="./assets/start.png" width="880" alt="overview dashboard" />
18
- <img src="./assets/demo.gif" width="880" alt="dsh‑replay operation demo" />
19
-
20
- </div>
21
-
22
- ## 😫 Sound familiar?
23
-
24
- You kick off an agent task, come back after dinner, and:
25
-
26
- - *"It ran for **5 hours** and burned **18M tokens** — on WHAT?"*
27
- - *"Which tool call ate all that wall-clock time? Was it stuck?"*
28
- - *"Did it touch my `.env`? Did it `rm -rf` anything? Who approved that?"*
29
- - *"How much did this session actually **cost** me?"*
30
- - *"I forked the session yesterday — where exactly did the two histories diverge?"*
31
- - *"I want to show a teammate this hilarious failure — do they need to install the whole harness?"*
32
-
33
- DeepSeek Harness keeps a beautiful append-only log where *everything that reached the model is reconstructible* — but ships no viewer for it. **dsh-replay is that viewer.** One plugin, and every question above becomes one click.
34
-
35
- ## ✨ What you get
36
-
37
- | | |
38
- |---|---|
39
- | ⏪ **Timeline replay** | Scrub through every turn, step, message and tool call; play back at 1–16×; click any event for raw prompt/args/results/durations |
40
- | 📊 **Overview dashboard** | Hero stats, cumulative token chart with crosshair, tool-time ranking — where the time and tokens actually went |
41
- | 💰 **Cost estimate** | ≈ dollar cost from disjoint token accounting (cache-aware); editable pricing table, DeepSeek / Claude / OpenAI / Gemini defaults |
42
- | 🛡️ **Security audit** | Rules-based scan: dangerous shell (`rm -rf`, `sudo`, curl-pipe…), sensitive paths (`.env`, `~/.ssh`…), sandbox/permission changes, denied approvals — ranked, clickable, extensible |
43
- | 🌿 **Fork tree** | The whole session lineage as a clickable tree, fork boundaries labeled, subagents marked |
44
- | ⚖️ **Compare** | Any two sessions side by side: stats, tool mix, token deltas, exact divergence seq for forks |
45
- | 📤 **One-click HTML export** | Bake a session into a single offline `.html` — attach it to a bug report or send to a teammate; they get the full interactive replay with **zero installs** |
46
- | 🔍 **Filter & search** | Free-text search across messages/args/results + kind filters, right in the playback bar |
47
- | 🌏 **EN / 中文** | Whole UI switches language (findings and meta labels included); auto-detected, one-click toggle |
48
-
49
- <div align="center">
50
- <img src="./assets/overview-light.png" width="880" alt="overview dashboard" />
51
- <img src="./assets/timeline-light.png" width="880" alt="timeline replay" />
52
- <img src="./assets/audit-light.png" width="880" alt="security audit" />
53
- </div>
54
-
55
- Dark mode follows the harness theme. Loading and empty states are hosted by **Jing Xiaoshen (鲸小深)**, our original whale-catgirl mascot (hide her with `.dshr-mascot { display: none }`).
56
-
57
- ## 🚀 Quick start
58
-
59
- ### Try it first (zero install)
60
-
61
- **Online demo:** https://mingozhou.github.io/dsh-replay/ — or locally:
62
-
63
- ```sh
64
- git clone https://github.com/MingoZhou/dsh-replay.git
65
- cd dsh-replay
66
- npm install && npm run build
67
- npm run demo # → http://localhost:4173
68
- ```
69
-
70
- ### Install into DeepSeek Harness
71
-
72
- **Case A — you use the released CLI** (`npm i -g @deepseek-ai/dsh`):
73
-
74
- ```sh
75
- # build the plugin once
76
- cd <path-to>/dsh-replay && npm install && npm run build
77
-
78
- # add it to the profile you actually use (list them: ls ~/.dsh/profiles)
79
- dsh plugin --profile <your-profile> add <absolute-path-to>/dsh-replay
80
- dsh --profile <your-profile> --dump-config # expect a "# == dsh-replay" section
81
- dsh web --profile <your-profile>
82
- ```
83
-
84
- **Case B — you run the harness from a source checkout** (`pnpm dsh web`):
85
-
86
- ```sh
87
- # build the plugin once
88
- cd <path-to>/dsh-replay && npm install && npm run build
89
-
90
- # note: `pnpm dsh web` boots the profile named "web"
91
- cd <path-to>/deepseek-harness
92
- pnpm dsh plugin --profile web add <absolute-path-to>/dsh-replay
93
- pnpm dsh --profile web --dump-config # expect a "# == dsh-replay" section
94
- pnpm dsh web
95
- ```
96
-
97
- Open http://127.0.0.1:3080 — you now have **two entries**:
98
-
99
- 1. the **Session Replay** button at the bottom-left of the sidebar (opens a full-screen modal with a session picker), and
100
- 2. a **Replay** tab inside every open conversation.
101
-
102
- Installing from npm (`dsh plugin --profile <p> add dsh-replay`, once published) or from a git URL also works; git installs run the package's `prepare` build, which the harness requires you to allowlist in the profile's `pnpm-workspace.yaml`:
103
-
104
- ```yaml
105
- allowBuilds:
106
- dsh-replay: true
107
- ```
108
-
109
- ## 🧹 Uninstall
110
-
111
- The official way (works **even when the harness fails to boot**, since it only runs pnpm in the profile directory):
112
-
113
- ```sh
114
- dsh plugin --profile <your-profile> remove dsh-replay # released CLI
115
- # or, from a harness source checkout:
116
- pnpm dsh plugin --profile web remove dsh-replay
117
- ```
118
-
119
- Then restart the harness. Manual fallback if the command itself misbehaves: open the profile directory (`~/.dsh/profiles/<your-profile>` — on Windows `C:\Users\<you>\.dsh\profiles\<your-profile>`), remove `dsh-replay` from `package.json` → `dependencies` **and** from `dsh.profile.bundles`, run `pnpm install` there, restart. Nothing else is written anywhere — the plugin keeps no state outside its own package.
120
-
121
- ## 🔧 FAQ / Troubleshooting
122
-
123
- **`GET /replay/api/sessions` returns 404** — the config layer didn't land. The harness fails *silently* on an unresolvable plugin name: re-run the `dsh plugin add` step and check `--dump-config` for the `# == dsh-replay` section.
124
-
125
- **`Cannot find module '…\dsh-replay\lib\index.js'` at boot** — the profile links to your plugin folder, and `lib/` is a build artifact that ships neither in git nor in release archives. Run `npm install && npm run build` inside the plugin folder (required after every fresh clone/unzip), then start the harness again.
126
-
127
- **API works but no sidebar button / Replay tab** — the browser half didn't load. Confirm `lib/client.js` exists (run `npm run build` in the plugin), then fully restart the harness: client plugin sets are only scanned at boot, and negative results are cached.
128
-
129
- **`EADDRINUSE: 127.0.0.1:3080`** — a previous harness instance is still running; stop it first.
130
-
131
- **`npm install` fails on `@deepseek-ai/*` packages** — you're on an old checkout of this plugin. All harness packages are optional peers since v0.2.0; pull the latest.
132
-
133
- **The harness updated and something broke** — the preview-phase plugin API moves. Everything hard lives in the dependency-free `core/`; fixes land in two thin adapter files. `npm run demo` always works.
134
-
135
- ## 🏗️ Architecture
136
-
137
- ```
138
- src/core dependency-free analysis: JSONL + chunk-row decoding, timeline
139
- folding, audit rules, fork forest, cost model, session diff ← 27 unit tests
140
- src/index.ts host half: read-only HTTP API on the harness web server
141
- (GET /replay/api/sessions | /session/<id> | /viewer.js)
142
- src/client browser half: React components + three slot registrations
143
- (conversation.view · sidebar.footer.action · shell.overlay)
144
- demo/ the same components over sample logs, zero harness deps
145
- ```
146
-
147
- The split is deliberate: a preview-phase API break means fixing an adapter, not the product. `core` is importable on its own (`dsh-replay/core`) if you want to build your own tooling over session logs — it understands the wire format including packed chunk rows, torn crash tails, seed boundaries, and compaction shadowing.
148
-
149
- <details>
150
- <summary><b>Wire-format notes (for fellow plugin authors)</b></summary>
151
-
152
- `seq` is contiguous and gapless; streaming chunks may arrive packed as `text-chunks` / `reasoning-chunks` / `tool-call-chunks` rows (`seq0` + `dt[]` deltas); token usage rides `assistant/message` (and early `usage` chunks) and **replaces** rather than accumulates per turn/step; cache token counts are disjoint from `inputTokens` (billed input = input + cacheRead + cacheWrite); session titles are log-only `session/title` events — take the *last*; `session/end-seed` marks the fork/resume boundary; a final line without a newline is an uncommitted crash tail, not corruption.
153
-
154
- </details>
155
-
156
- ## 🗺️ Roadmap
157
-
158
- Live mode (follow a running session over the events websocket) · file-diff reconstruction from edit-tool calls · audit rule packs · replay annotations & sharing links.
159
-
160
- Issues and PRs welcome. If you build something on `dsh-replay/core`, open a discussion — happy to link it here.
161
-
162
- ## 📜 License & credits
163
-
164
- MIT. Jing Xiaoshen (鲸小深) is an original character created for this project — she is not the official DeepSeek logo nor third-party fan art. Mascot artwork lives at `assets/jingxiaoshen.png`; replace it (≤400 KB) and `npm run build` embeds your version everywhere in the UI.
1
+ <div align="center">
2
+
3
+ <img src="https://raw.githubusercontent.com/MingoZhou/dsh-replay/main/assets/jingxiaoshen.png" width="120" alt="Jing Xiaoshen, the dsh-replay mascot" />
4
+
5
+ # dsh-replay
6
+
7
+ **Read-only session review for DeepSeek Harness.**<br/>
8
+ Cost · Audit · Fork tree · Compare · Shareable HTML — **no model calls, no token spend.**
9
+
10
+ [简体中文](README.zh.md) · [Live demo](https://mingozhou.github.io/dsh-replay/) · [Install](#install) · [Why not Trajectory?](#why-not-trajectory) · [Privacy](PRIVACY.md)
11
+
12
+ [![npm](https://img.shields.io/npm/v/@mingozhou/dsh-replay)](https://www.npmjs.com/package/@mingozhou/dsh-replay)
13
+ [![downloads](https://img.shields.io/npm/dm/@mingozhou/dsh-replay)](https://www.npmjs.com/package/@mingozhou/dsh-replay)
14
+ [![ci](https://github.com/MingoZhou/dsh-replay/actions/workflows/ci.yml/badge.svg)](https://github.com/MingoZhou/dsh-replay/actions/workflows/ci.yml)
15
+ [![license](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
16
+ [![dsh](https://img.shields.io/badge/DSH-0.2.1--rc.2-4d6bfe.svg)](https://github.com/MingoZhou/dsh-replay#compatibility)
17
+
18
+ > **Desktop one-click install:** **Plugins → Add plugin → `@mingozhou/dsh-replay` → Install** → restart.
19
+ > Web/source: [`dsh plugin --profile <profile> add …`](#install).
20
+
21
+ <img src="https://raw.githubusercontent.com/MingoZhou/dsh-replay/main/assets/demo.webp" width="880" alt="15-second dsh-replay demo: archive, cost, audit, export" />
22
+
23
+ <sub>15-second demo · sample sessions · the exported HTML is offline and read-only<br/>[GIF fallback](https://raw.githubusercontent.com/MingoZhou/dsh-replay/main/assets/demo.gif) · [full demo](https://mingozhou.github.io/dsh-replay/)</sub>
24
+
25
+ </div>
26
+
27
+ > **“Replay” here means read-only.** dsh-replay never re-sends a session to a model, never writes the log, and never spends tokens. It parses the append-only session log and renders it. See [FAQ](#faq).
28
+ >
29
+ > **Historical note (preserving the original claim).** ~~DeepSeek Harness keeps a beautiful append-only log where everything that reached the model is reconstructible — but ships no viewer for it. **dsh-replay is that viewer.**~~
30
+ > That was true when this project started in **2026-08**. Since **DSH 0.2.1-rc.2**, the official Web UI ships the **Trajectory (轨迹)** view, which covers the current session's event ledger. dsh-replay is now the viewer for the **archive**: every session, cost, Windows-aware audit, fork/compare, and redacted standalone export. [Details below](#why-not-trajectory).
31
+
32
+ ---
33
+
34
+ ## Install
35
+
36
+ ### DeepSeek Harness Desktop (recommended)
37
+
38
+ 1. Open **Plugins** in the left sidebar.
39
+ 2. Click **Add plugin**.
40
+ 3. Enter `@mingozhou/dsh-replay` and click **Install**.
41
+ 4. Restart Harness.
42
+
43
+ > Desktop profiles are managed by the Electron app. `dsh plugin --profile desktop …` is refused by design (`profile "desktop" is managed exclusively by the Electron application`). Use the Plugins page instead.
44
+
45
+ <img src="https://raw.githubusercontent.com/MingoZhou/dsh-replay/main/assets/plugins-installed.png" width="720" alt="DeepSeek Harness Plugins page with dsh-replay installed" />
46
+
47
+ <sub>Plugins → Installed plugins. This is the 0.4.1 row; 0.4.2 uses the new description.</sub>
48
+
49
+ ### Web UI / source checkout
50
+
51
+ ```sh
52
+ # released CLI (npm i -g @deepseek-ai/dsh)
53
+ dsh plugin --profile <your-profile> add @mingozhou/dsh-replay
54
+
55
+ # source checkout
56
+ cd deepseek-harness
57
+ pnpm dsh plugin --profile web add @mingozhou/dsh-replay
58
+ ```
59
+
60
+ Verify with `dsh --profile <your-profile> --dump-config` (look for the `@mingozhou/dsh-replay` / `replay` row), then restart Harness.
61
+
62
+ ### From source (development / unreleased changes)
63
+
64
+ ```sh
65
+ git clone https://github.com/MingoZhou/dsh-replay.git
66
+ cd dsh-replay
67
+ npm install && npm run build # lib/ is a build artifact
68
+ npm run demo # http://localhost:4173 — no harness needed
69
+ ```
70
+
71
+ Point a profile at the folder:
72
+
73
+ ```sh
74
+ dsh plugin --profile <your-profile> add <absolute-path>/dsh-replay
75
+ ```
76
+
77
+ ### Uninstall
78
+
79
+ - **Desktop:** Plugins → dsh-replay → **Remove**.
80
+ - **Web:** `dsh plugin --profile <your-profile> remove @mingozhou/dsh-replay`
81
+ - **Manual fallback:** remove `@mingozhou/dsh-replay` from both `dependencies` and `dsh.profile.bundles` in the profile's `package.json`, then `pnpm install` in the profile directory.
82
+
83
+ ---
84
+
85
+ ## Why not Trajectory?
86
+
87
+ Trajectory is excellent for **the session you are in**: a live ledger, timing overview, per-record tokens, thinking, system prompt, virtual scrolling. If that is all you need, use it. dsh-replay is for **after the session ends**, and for the questions Trajectory does not answer:
88
+
89
+ | | Official Trajectory | dsh-replay |
90
+ | --- | --- | --- |
91
+ | Scope | current session | **all sessions + archive dashboard** |
92
+ | Timeline | native, live, virtualized | playback, reasoning, system prompt, tool summaries |
93
+ | Cost | token counts | **per-model cost, USD/CNY, editable price table** |
94
+ | Risk | — | **Windows-aware audit, baseline suppression, secret redaction** |
95
+ | Lineage | — | **fork tree + exact divergence + cost/risk deltas** |
96
+ | Sharing | raw session ZIP | **redacted, standalone, interactive HTML** |
97
+ | Data | in the session | **local archive; no telemetry** |
98
+
99
+ The two coexist. dsh-replay does not replace Trajectory; it answers “what happened across all of this, what did it cost, what was risky, and how do I show someone?”
100
+
101
+ ---
102
+
103
+ ## What you get
104
+
105
+ | | |
106
+ | --- | --- |
107
+ | 📊 **Archive dashboard** | Every session on this machine: month/all-time tokens, estimated cost, high-risk findings, search by title/id/workspace. |
108
+ | 💰 **Per-model cost** | Cache-aware totals, a per-model breakdown, USD/CNY, and an editable price table. No more charging every token at one model's rate. |
109
+ | 🛡️ **Windows-aware audit** | `pwsh`/PowerShell/`cmd` as well as bash; destructive deletes, credential reads, exfil, persistence and policy changes. Initial permission/sandbox state is treated as baseline, not a finding. |
110
+ | 🔐 **Secret redaction** | Common API keys, `.env` assignments, private keys, home paths. The export dialog shows the redaction count before you share. |
111
+ | 📤 **Shareable HTML** | One session baked into a single offline `.html`: no install, no network, no model. Ideal for bug reports and post-mortems. |
112
+ | 🌿 **Fork tree** | Full lineage, subagents, fork boundaries, click-through. |
113
+ | ⚖️ **Compare** | Any two sessions: stats, tool mix, cost/risk deltas, full-lineage relation, and the first differing event on each side. |
114
+ | ⏪ **Timeline** | 1–16× playback, reasoning, system prompt, search, type filters, keyboard navigation, tool summaries instead of raw JSON. |
115
+ | 🌏 **English / 中文** | The app UI switches language; DSH-injected view labels remain whatever the host provides. |
116
+
117
+ ### Dashboard, cost, audit, export
118
+
119
+ <div align="center">
120
+ <img src="https://raw.githubusercontent.com/MingoZhou/dsh-replay/main/assets/overview-light.png" width="880" alt="Overview dashboard and cost estimate" />
121
+ <img src="https://raw.githubusercontent.com/MingoZhou/dsh-replay/main/assets/audit-light.png" width="880" alt="Security audit with baseline suppression and redacted details" />
122
+ <img src="https://raw.githubusercontent.com/MingoZhou/dsh-replay/main/assets/export-light.png" width="880" alt="Redacted standalone HTML export dialog" />
123
+ </div>
124
+
125
+ More: [dashboard](https://raw.githubusercontent.com/MingoZhou/dsh-replay/main/assets/dashboard-light.png) · [timeline](https://raw.githubusercontent.com/MingoZhou/dsh-replay/main/assets/timeline-light.png) · [forks](https://raw.githubusercontent.com/MingoZhou/dsh-replay/main/assets/forks-light.png) · [compare](https://raw.githubusercontent.com/MingoZhou/dsh-replay/main/assets/compare-light.png)
126
+
127
+ ---
128
+
129
+ ## What changed in 0.4.2
130
+
131
+ This is the “still alive” maintenance release, focused on trust and first-run:
132
+
133
+ - **Audit correctness:** `pwsh`/PowerShell/`cmd`, Windows destructive commands, credential reads and exfiltration; initial `permission/preset` / `sandbox/mode` no longer raises a finding; routine writes/network reads no longer flood the list.
134
+ - **Cost correctness:** per-model totals; mixed-model sessions are priced separately; editable price table; USD/CNY.
135
+ - **Share safely:** redaction preview + count + size estimate; unredacted export is an explicit opt-in; exported viewer has no empty Forks/Compare tabs.
136
+ - **Actually smaller:** client bundle **2.0 MB → 232 KB**; mascot **1.4 MB → 73 KB**; README GIF **28.8 MB → 164 KB**; 15-second WebP **116 KB**.
137
+ - **More useful timeline:** reasoning, system prompt, model selection, tool summaries, keyboard navigation, selected-event preservation under filters.
138
+ - **Archive dashboard:** every session, month/all-time, tokens, cost, risk, search, workspace filter.
139
+ - **Privacy/security:** loopback-only API by default; secret redaction; [PRIVACY.md](PRIVACY.md) and [SECURITY.md](SECURITY.md).
140
+ - **Compatibility:** `engines.dsh`; targeted at DSH Desktop 0.2.1-rc.2 (the `sessionQuery` contract was checked against the running app; the UI was verified in demo mode).
141
+
142
+ ---
143
+
144
+ ## Compatibility
145
+
146
+ | Component | Tested / required |
147
+ | --- | --- |
148
+ | DSH Desktop | **0.2.1-rc.2** — target / API contract checked |
149
+ | DSH Web | 0.2.x expected (same `sessionQuery` / webServer contract) |
150
+ | Node | **22+** |
151
+ | Package | `@mingozhou/dsh-replay@0.4.2` |
152
+ | Plugin API range | `engines.dsh >= 0.2.0-rc.8` |
153
+
154
+ DSH moves fast. If a future release breaks the adapter, `npm run demo` still works because the analysis/UI layers are independent of the host. Open an issue with the DSH version and the failing route.
155
+
156
+ ---
157
+
158
+ ## Privacy and security
159
+
160
+ - The plugin reads session logs through `ctx.sessionQuery`; it writes **no session data**.
161
+ - The UI calls the **local DSH origin only**; no telemetry, no cloud parser.
162
+ - The host API is **loopback-only by default** and read-only. `allowRemote` is an explicit opt-in and remains unauthenticated — do not expose it to a network.
163
+ - Exported HTML is self-contained and offline. **Session logs are raw data**: the export redacts common credentials, but review the file before sharing.
164
+ - Read [PRIVACY.md](PRIVACY.md) and [SECURITY.md](SECURITY.md).
165
+
166
+ ---
167
+
168
+ ## FAQ
169
+
170
+ **Does “replay” re-run the session or call the model?**
171
+ No. It is a read-only projection of the append-only log. No model request, no token spend, no writes. This is also [issue #2](https://github.com/MingoZhou/dsh-replay/issues/2), now in the FAQ.
172
+
173
+ **Then why is it called replay?**
174
+ The project started before the official view existed; “replay” meant “play back the recording”, like a match recording, not “replay the match”. The UI now says **Session Review / 会话复盘** and the README says read-only up front.
175
+
176
+ **Trajectory already exists. Why install this?**
177
+ Trajectory is per-session and live. dsh-replay is archive-wide (all sessions), adds money/risk/lineage/share, and exports a file a teammate can open with zero install. See [the table](#why-not-trajectory).
178
+
179
+ **Does it work on Windows?**
180
+ Yes — 0.4.2 added `pwsh`/PowerShell/`cmd` rules and Windows path handling. The old audit missed `Remove-Item` entirely; that is fixed.
181
+
182
+ **Why is the bundle smaller now?**
183
+ The 1.4 MB mascot was embedded into every client bundle. It is now a 73 KB 256px asset; the sidebar still uses the colorful mascot (not a monochrome glyph), and the base client bundle is ~232 KB.
184
+
185
+ **The Plugins page says the plugin is installed, but there is no entry.**
186
+ Fully restart Harness; client plugin sets are scanned at boot. If the API works but the UI does not, confirm `lib/client.js` exists (source install: `npm run build`).
187
+
188
+ **`GET /replay/api/sessions` returns 404.**
189
+ The profile did not compose the bundle. Re-add it and check the configuration; on Desktop use the Plugins page, on Web use `dsh --profile <profile> --dump-config`.
190
+
191
+ **I'm on Desktop and `dsh plugin --profile desktop …` fails.**
192
+ Expected: the Desktop app owns that profile. Use **Plugins → Add plugin**.
193
+
194
+ **Is redaction guaranteed?**
195
+ No. It is pattern-based and best-effort. The dialog shows how many values will be masked; unredacted export is opt-in. Never share a real session without reviewing it.
196
+
197
+ ---
198
+
199
+ ## Roadmap
200
+
201
+ - **File diff reconstruction** from `edit`/`write` calls (the next big differentiator over a raw ledger).
202
+ - **Annotations + share links** for exported reviews.
203
+ - **Deeper audit packs** (supply chain, network egress, CI credentials) with a rule editor.
204
+ - **More archive analytics**: per-workspace spend, weekly digest, budget alerts.
205
+ - **Native Trajectory deep links** from audit findings, instead of a second timeline.
206
+
207
+ Live-follow is intentionally not the focus: Trajectory already does it well. dsh-replay invests in the archive, money, risk, and sharing.
208
+
209
+ ---
210
+
211
+ ## Star
212
+
213
+ If dsh-replay saved you an afternoon of log spelunking, a ⭐ helps other DSH users find it:
214
+
215
+ **[github.com/MingoZhou/dsh-replay](https://github.com/MingoZhou/dsh-replay)** · [Live demo](https://mingozhou.github.io/dsh-replay/) · [Issues](https://github.com/MingoZhou/dsh-replay/issues) · [Discussions](https://github.com/MingoZhou/dsh-replay/discussions)
216
+
217
+ Writing about it? A ready-to-edit launch/content pack is in [docs/content](docs/content/README.md).
218
+
219
+ ---
220
+
221
+ ## License & credits
222
+
223
+ MIT. Jing Xiaoshen (鲸小深) is an original character created for this project — not the official DeepSeek logo and not third-party fan art. Mascot artwork lives at `assets/jingxiaoshen.png`; replace it and rebuild to embed your own version.
224
+
225
+ The `core/` layer is dependency-free and importable as `dsh-replay/core` if you want to build your own tooling over session logs. It understands packed chunk rows, torn crash tails, seed boundaries, compaction shadowing, reasoning blocks, and per-model usage.