rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:zxsimple/dsh-revive
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
中文 | English
DSH 会话视图切换器里新增「回放」视图(与「对话」「轨迹」并列):
uiWorkspace.connectWorkspace + session.prompt),工具由新会话重新执行——真正的"重跑";MediaRecorder 录成 .webm(VP9),可自动下载;不依赖窗口/屏幕录制权限。复用宿主自带的 UI 组件库渲染,尽量贴近原生观感并在此之上做信息分层:
bash 后面直接是命令),点一下展开看全文;✓ 已完成 / ✕ 失败 / 运行中,折叠时显示输出首行预览;如果宿主的组件库不可用(例如换到其它 DSH 版本),会自动降级为纯文本渲染,不会白屏。
代价预算时钟(分类变速):一轮内所有文本被拍平成 segments(用户/思考/正文/工具调用/工具输出),共享一个「代价预算」游标;每类内容每个字符消耗的代价不同,于是同一时钟下快慢不同:
| 内容 | 权重(代价/字符) | 效果 |
|---|---|---|
用户输入 user / steer |
1.00 | 基准阅读速度(60cps ≈ 每秒 60 字) |
助手正文 assistant |
1.00 | 基准阅读速度 |
思考 reasoning |
0.06 | ≈16 倍速刷过 |
工具调用 toolCall |
0.04 | ≈25 倍速 |
工具输出 toolResult |
0.12 | ≈8 倍速 |
输入后停顿:用户/steer 内容播完后,时钟在边界上冻结 1 秒(期间显示「⋯ 思考中」),再开始出思考/正文——模拟真实的"发出去后等首字",避免输入一结束就立刻刷屏;
skim 封顶:思考/工具类内容即使超长也只占最多 3.5 秒/段(权重按当前速度自动抬高),避免一轮几万字的思考把观众晾在那里;而输入与正文永远保持完整阅读节奏。
视口跟随:内容不再撑高容器,而是沿用宿主的会话滚动容器;流式期间自动 scrollTop = scrollHeight,用户手动上滚超过 64px 即暂停跟随,滚回底部自动恢复。
速度档:慢 25 / 标准 60 / 快 160 / 极速 400 字符/秒(localStorage 记忆)。
默认可见:打开视图即完整显示当前轮;按 ▶ 播放才从该轮开头重新流式播放并跨轮连续推进。
canvas.captureStream() + MediaRecorder(桌面版 rc.3 实测可用,video/webm;codecs=vp9)。纯 client 插件,但必须以 bundle 形式声明(见「安装」——这是 0.1.1 的关键修复):
lib/index.js 只有空 apply(),仅作为 loader 行的挂载点;slots.inject("conversation.view", () => slots.register(def, Component))(与官方 ui-chat / ui-trajectory 同款);uiConversation.binding(sessionId).target("chat") 投影 + session.loadOlder() 补全历史;uiWorkspace.connectWorkspace(workspaceId) + sessions.binding(sid).session.prompt([...], "queue")。已收录到 DSH 插件目录(分类 Sessions & Messages),在 dsh 的插件市场里搜 dsh-revive 即可安装;目录条目页:https://awesome-dsh-plugin.com/p/zxsimple/dsh-revive/
也可以一条命令从仓库装:
dsh plugin --profile web add github:zxsimple/dsh-revive
手工挂载(本地开发)则改 profile 的 package.json:
"dependencies": { "dsh-revive": "link:/path/to/dsh-revive" },
"dsh": { "profile": { "bundles": [ /* ... */, "dsh-revive" ] } }
然后 pnpm install(link 依赖会建符号链接)+ 完全重启应用(boot 时才会重新组装 loader 行与 client 模块)。
也可以直接从仓库安装:
git clone https://github.com/zxsimple/dsh-revive.git
# 然后把上面的 link: 指向 clone 下来的目录
关键点:纯 client 插件也必须声明
dsh.bundle.patch并出现在dsh.profile.bundles里,否则宿主不会为它生成 loader 行(详见下一节)。
纯 client 插件,运行在 DSH 的 Web 前端里,不含任何与操作系统相关的代码:没有 fs / path / child_process,没有 process / __dirname,没有绝对路径拼接,也没有构建脚本与原生依赖(pnpm install 对它只是建一个符号链接)。所以平台跟随 DSH 的 Web 客户端。
| 平台 | 状态 |
|---|---|
| macOS(DSH 桌面版 0.2.1-rc.3) | 已实测:视图注册、流式变速、输入后停顿、canvas 录制全部验证通过 |
| Windows | 预期可用(未实测)。DSH 随包提供 node.cmd 与 command-path.ps1,插件市场也有完整的 win32 分支(link: 依赖走 junction、npm.cmd / pnpm.cmd);插件侧没有需要移植的部分 |
| Linux | 同理,未实测 |
用到的浏览器能力都是 Chromium 内置的,Windows 上的 Electron / Chromium 同样具备:
MediaRecorder + canvas.captureStream() —— 录制走 VP9/VP8 WebM,Windows 的 Chromium 支持;产物用系统播放器或浏览器都能播;localStorage(速度与时长记忆)、navigator.language(中英文案);Microsoft YaHei,中文在 Windows 上不会掉字;getComputedStyle 向上查找,不依赖任何平台布局常量。Windows 上唯一的注意点:link: 依赖建的是 junction,如果手改过 profile 的 package.json,重启前先确认 node_modules/dsh-revive 指向正确。
如果你在 Windows 上跑出了问题(比如录制拿不到 video/webm,只剩 video/mp4),把控制台报错贴到 issue 里即可。
dsh.bundle.patch。插件目录里虽然有 cordis.patch.yml,但没有声明它,宿主就永远不会把这条 insert 行并入 loader 树 → 没有 loader 行 → 没有 Node 半边 fiber → plugins/?? 里根本没有 dsh-revive/client.js → 视图切换器自然没有「回放」。dshmarket 自己的校验也会报同一句话:bundle declares no dsh.bundle.patch — the profile will fail to boot。dsh.client 但无 dsh.bundle)在 market 里只能热挂载一个 shim,重启即失效——所以它曾经"装上了"却重启后消失。require("react/jsx-runtime") 返回的是命名空间对象,不能直接当函数调用(应取 .jsx / .jsxs);chat 快照不是 {timeline, byId},而是 { order: string[], nodes: { get(key) }, timeline: { turnOrder, turns: Map } },节点形如 { key, kind, location, data };用户文本在 data.content 的分片里,助手文本在 data.blocks 里(kind:"text" | "reasoning" | "tool-call")。slots.register({name:"conversation.view",...}, Component) ✓(ui-chat 的 id=chat order=0、ui-trajectory 的 id=trajectory order=10 同款)slots.entries("conversation.view") 会收集所有注册项并渲染成切换器标签(label 经 resolveSlotLabel)✓uiConversation.binding(source) 接受 sessionId 或 session binding ✓;.target("chat") → { getSnapshot, subscribe } ✓ctx.locale.register(ns, { zh, en }) ✓(值可以是函数,服务端不校验字符串)session.loadOlder() ✓uiWorkspace.connectWorkspace(workspaceId) → Promise<SessionId> ✓(服务名 uiWorkspace)session.prompt([{type:"text",text}], "queue") → { ok } ✓["slots","sessions","uiSession","uiConversation","locale"](与 ui-trajectory 一致);workspaces/uiWorkspace 用 ctx.get(...) 兜底读取。Adds a Replay view to the DSH conversation view switcher, alongside Chat and Trajectory:
uiWorkspace.connectWorkspace + session.prompt path, so tools execute again for real;MediaRecorder into a .webm (VP9), downloaded automatically — no window or screen-recording permission involved.Rendered with the host's own UI kit so it reads like the native surface, with clearer information layering on top:
● Reasoning · N chars · first line, a tool call shows ⚒ tool · the arguments it actually ran (e.g. bash followed by the command); click to expand;✓ done / ✕ failed / running — with a one-line preview of the output;If the host kit is unavailable (a different DSH version), rendering falls back to plain text instead of going blank.
Cost-budget clock (per-kind speed): every text in a turn is flattened into segments (user / reasoning / prose / tool call / tool output) that share one "cost budget" cursor. Each kind spends a different amount of cost per character, so one clock produces different speeds:
| Content | Weight (cost per character) | Effect |
|---|---|---|
User input user / steer |
1.00 | Base reading speed (60cps ≈ 60 characters per second) |
Assistant prose assistant |
1.00 | Base reading speed |
Reasoning reasoning |
0.06 | ≈16× |
Tool call toolCall |
0.04 | ≈25× |
Tool output toolResult |
0.12 | ≈8× |
Pause after input: when the user/steer content finishes, the clock freezes at that boundary for one second (showing "⋯ thinking"), then reasoning and prose begin — the real "sent it, waiting for the first token" beat, instead of flooding the screen the moment the prompt ends;
Skim cap: reasoning and tool content occupy at most 3.5 s per segment however long it is (its weight is raised to fit the current speed), so one huge reasoning block cannot strand the viewer; input and prose always keep the full reading pace;
Viewport follows: content no longer stretches its container — it uses the host's conversation scroller. While streaming, scrollTop = scrollHeight; scrolling up more than 64px stops following, returning to the bottom resumes it;
Speed presets: Slow 25 / Normal 60 / Fast 160 / Turbo 400 characters per second (remembered in localStorage);
Visible on open: opening the view shows the current turn in full; pressing ▶ replays it as a stream from that turn's start and continues across turns.
canvas.captureStream() + MediaRecorder (verified on desktop rc.3 with video/webm;codecs=vp9).A pure client plugin, but it must be declared as a bundle (see Install — this is the 0.1.1 fix):
lib/index.js is an empty apply(), existing only as a loader-row anchor;slots.inject("conversation.view", () => slots.register(def, Component)) (the same shape as the official ui-chat / ui-trajectory);uiConversation.binding(sessionId).target("chat") projection plus session.loadOlder() to page in history;uiWorkspace.connectWorkspace(workspaceId) + sessions.binding(sid).session.prompt([...], "queue").Listed in the DSH plugin catalog (category Sessions & Messages) — search dsh-revive in dsh's plugin market, or open the catalog entry: https://awesome-dsh-plugin.com/p/zxsimple/dsh-revive/
One command from the repository:
dsh plugin --profile web add github:zxsimple/dsh-revive
Manual mount (local development) — edit the profile's package.json:
"dependencies": { "dsh-revive": "link:/path/to/dsh-revive" },
"dsh": { "profile": { "bundles": [ /* ... */, "dsh-revive" ] } }
Then pnpm install (the link: dependency is just a symlink) and restart the app completely (loader rows and client modules are only assembled at boot).
Or clone first and point the link: at the clone:
git clone https://github.com/zxsimple/dsh-revive.git
# then point the link: above at the cloned directory
Key point: even a pure client plugin must declare
dsh.bundle.patchand appear indsh.profile.bundles, otherwise the host never emits a loader row for it (see the next section).
A pure client plugin running inside DSH's web front end, with no OS-specific code: no fs / path / child_process, no process / __dirname, no absolute path joining, and no build scripts or native dependencies (pnpm install merely creates a symlink for it). Platforms therefore follow DSH's web client.
| Platform | Status |
|---|---|
| macOS (DSH desktop 0.2.1-rc.3) | Verified: view registration, per-kind pacing, pause after input, canvas recording all exercised |
| Windows | Expected to work (not tested). DSH ships node.cmd and command-path.ps1, and the plugin market has full win32 handling (link: dependencies become junctions, npm.cmd / pnpm.cmd); nothing on the plugin side needs porting |
| Linux | Same reasoning, not tested |
Every browser capability used is built into Chromium, which Electron / Chromium on Windows provides as well:
MediaRecorder + canvas.captureStream() — recording produces VP9/VP8 WebM, supported by Chromium on Windows and playable in system players or browsers;localStorage (speed and length memory) and navigator.language (Chinese/English copy);Microsoft YaHei, so Chinese text does not fall back to tofu on Windows;getComputedStyle, relying on no platform layout constants.One Windows caveat: a link: dependency is a junction there — if you hand-edited the profile's package.json, confirm node_modules/dsh-revive points at the right place before restarting.
If something breaks on Windows (for example recording only offers video/mp4 instead of video/webm), paste the console error into an issue.
package.json was missing dsh.bundle.patch. The plugin shipped a cordis.patch.yml but never declared it, so the host never merged that insert row into the loader tree → no loader row → no Node-side fiber → plugins/?? never served dsh-revive/client.js → the view switcher had no "Replay". dshmarket's own validation reports the same thing: bundle declares no dsh.bundle.patch — the profile will fail to boot.dsh.client without dsh.bundle) can only be hot-mounted as a shim by the market, which is lost on restart — that is why it once "installed fine" and then vanished.require("react/jsx-runtime") returns a namespace object, not a function (use .jsx / .jsxs);chat snapshot is not {timeline, byId} but { order: string[], nodes: { get(key) }, timeline: { turnOrder, turns: Map } }, with nodes shaped { key, kind, location, data }; user text lives in the parts of data.content, assistant text in data.blocks (kind:"text" | "reasoning" | "tool-call").slots.register({name:"conversation.view",...}, Component) ✓ (same shape as ui-chat's id=chat order=0 and ui-trajectory's id=trajectory order=10)slots.entries("conversation.view") collects every registration and renders it as a switcher tab (the label goes through resolveSlotLabel) ✓uiConversation.binding(source) accepts a sessionId or a session binding ✓; .target("chat") → { getSnapshot, subscribe } ✓ctx.locale.register(ns, { zh, en }) ✓ (values may be functions; the service does not require strings)session.loadOlder() ✓uiWorkspace.connectWorkspace(workspaceId) → Promise<SessionId> ✓ (service name uiWorkspace)session.prompt([{type:"text",text}], "queue") → { ok } ✓["slots","sessions","uiSession","uiConversation","locale"] (same as ui-trajectory); workspaces / uiWorkspace are read defensively through ctx.get(...).CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。