rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:yuan-xin-9997/dsh-global-session-search
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Search every session you have ever had in DeepSeek Harness — messages, tool output, commands, compaction summaries and titles — from one panel, then open the session that matters.
A plugin for DeepSeek Harness (DSH) that adds a search entry to the sidebar and a dialog over the whole app.
License: MIT · Version: 1.0.0 · Tested with: DSH 0.2.2-rc.3 (Desktop, Windows 11) · Platforms: Windows, macOS, Linux
DSH ships a session search box, but on a stock profile it only matches session titles and workspace names. Two separate reasons cause that:
session-query-sqlite row is configured with openAt: never, so content hits are disabled until a deployment changes it.unicode61 tokenizer. That tokenizer treats a whole run of Chinese characters as a single token, so 会议 does not match 今天开了会议讨论项目进度 — the exact query a Chinese-speaking user types first.This plugin takes the other route. It scans the durable session logs literally, so a keyword matches anywhere inside the text, including CJK substrings, without a tokenizer or query syntax. It also reaches what the built-in path deliberately skips: archived sessions, subagent sessions, sessions from other workspaces, tool results, commands and compaction summaries.
| Feature | What it does |
|---|---|
| Literal substring search | Case-insensitive for ASCII, exact for CJK. No phrase syntax, no wildcards to escape. |
| Whole corpus | Every stored session under the sessions root: archived, subagent, and cross-workspace sessions included. |
| Grouped results | Up to three snippets per session with the query highlighted, plus match count, title, folder and relative time. |
| Readable ranking | Within a session, user and assistant messages come before tool output; sessions are ordered by their most recent matching activity. |
| Jump to session | Click a row, or press ↑/↓ then Enter, to open that session through the Workspace navigation service. |
| Keyboard and IME safe | Esc closes, Tab stays inside the dialog, and Enter/arrow keys never steal an IME candidate from the input method. |
| Native look | Host theme tokens (light and dark), host modal geometry, and the same 42 px row metrics as the Settings entry above it. |
| Local only | No network calls, no telemetry, no writes: the Host route only reads the session logs. |
Requirements: DeepSeek Harness 0.2.x, Web or Desktop. No separate Node.js installation is needed — the plugin runs inside the Harness.
Clone or download this repository:
git clone https://github.com/yuan-xin-9997/dsh-global-session-search.git
In DSH open Plugins → Add plugin and choose the cloned directory. The plugin manager installs the bundle into the current profile.
Enable the bundle when prompted, then reload the page (Ctrl+R / Cmd+R) so the browser half joins the module graph.
The entry appears at the bottom of the left sidebar, just above Settings.
From a source checkout the same step is plugin_manager install_bundle with the directory as target; the bundle then appears in dsh.profile.bundles of the profile's package.json.
Click Search session content at the sidebar foot (a magnifier icon when the column is collapsed). The panel opens with the input focused.
Enter.↑ / ↓ moves the selection, Enter opens it, Esc or a click on the mask closes the panel. Clicking a row opens it directly.Each row shows the session title, its workspace folder, the time of the most recent matching event, the number of matches, and up to three snippets. When a session has more matches than shown, the row says so.
Browser (client.js) Host (index.js)
───────────────────── ────────────────
sidebar.footer.action ── click ──┐
shell.overlay dialog ◄──────────┘
│ GET api/global-session-search.search?q=…&limit=…
▼
list $DSH_HOME/sessions/**/session.v*.jsonl.zstd
walk Zstandard frame headers, decompress one
frame at a time, match, drop, yield every 24
┌─────────────────────────────── frames so the event loop stays free
└──► JSON { items[], hits[], counts, timing }
"type" prefix before parsing, and the human text is collected from the parsed event, so JSON escapes never reach a snippet.budgetMs deadline (8 s by default) stops the scan and returns partial results with a notice instead of blocking forever.The Host row accepts two optional settings. Override them in the profile's cordis.patch.yml:
| Key | Default | Meaning |
|---|---|---|
root |
$DSH_HOME/sessions |
Sessions directory. Set it only if the JSONL persistence backend was pointed elsewhere. |
budgetMs |
8000 |
Deadline for one search, clamped to 1000–60000. When it is reached the response is marked as partial. |
- id: global-session-search
config:
root: D:/custom/dsh-sessions
budgetMs: 12000
Everything stays on the machine. The panel calls one same-origin route served by this bundle's Host half; that route is authenticated by the page's own session and only reads files under the sessions root. The plugin makes no outbound network request, collects no telemetry and writes nothing to disk.
dsh-session-persistence-jsonl v4 container (session.v4.jsonl.zstd, concatenated Zstandard frames). A future DSH storage format would need a matching update. Files that do not match the pattern are skipped, not treated as errors.budgetMs then returns partial results with a notice..
├── index.js Host half: registers the read-only search route
├── client.js Browser half: sidebar entry + overlay dialog
├── cordis.patch.yml Inserts the Host row
├── package.json Bundle manifest (`dsh.bundle` + `dsh.client`)
├── locale/{en,zh}.json Display metadata and UI strings
├── icon.svg Plugin icon
├── README.md This file
└── README.zh.md Chinese README
Local checks, no dependencies required:
node --check index.js
node --check client.js
node -e "for (const f of ['package.json','locale/en.json','locale/zh.json']) JSON.parse(require('fs').readFileSync(f,'utf8'))"
To iterate on the Host half without the UI, import apply with a fake context whose connection.fetch.register captures the route, then call it with a Request — the search logic, the scan and the response shape are all exercised without a browser.
The GitHub Actions workflow runs the same checks on every push and pull request.
DSH also ships an opt-in bundle, @deepseek-ai/dsh-experimental-session-search, which exposes five model-facing read tools over the full-text index. It is agent-facing rather than UI-facing, its search is workspace-scoped, and with the index disabled it cannot find content either. The two are complementary: the experimental bundle gives the model tools, this plugin gives the user a panel.
MIT © 2026 Yuan Xin
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek、deepseek-harness。