- Início
- Plugins
- Sessões e mensagens
- dsh-content-search-ad
dsh-content-search-ad
zmq6931/dsh-content-search-ad
DeepSeek Harness (DSH) plugin: full-text search over every conversation's prose from a right sidebar tab, with a jump-to-match detail view.
Instalar
dsh plugin --profile web add github:zmq6931/dsh-content-search-adREADME
Content search
A DeepSeek Harness (DSH) plugin. It registers a right-sidebar tab and a Host route inside DSH; outside DSH it does nothing.
A right-sidebar tab that searches what was said in every conversation — prose only, Chinese included — and jumps to the match you pick. One row per conversation with a hit count; picking a row opens a detail view that steps through that conversation's matches and marks each one red in the transcript.
Package: dsh-content-search-ad · tab kind contentsearch · page id
dsh-content-search-ad/panel · shortcut command content-search.open
Where it lives
Right sidebar → the guide card Content search, or the pane's add control. The first time the plugin runs in a browser it opens this tab once.
Alt+F (macOS ⌥F) is a toggle: it opens the page and focuses the field, and
pressing it again puts the page away (closes the tab, which also collapses the
column). Ctrl+Alt+K is kept as a spare binding.
What it searches
Only user/message and assistant/message events, and only their prose:
| Excluded | Why |
|---|---|
fenced code blocks (```, ~~~) | code is not conversation |
| indented code blocks (four spaces or a tab, two or more lines) | markdown's other code form |
drive paths, UNC paths, POSIX home paths, dsh-resource:// addresses | a folder name is not a sentence |
tool-call blocks inside assistant messages | their payload is file contents, patches and JSON |
reasoning blocks | not shown as chat |
| tool results, command output, context injections | machine data, not something anyone said |
Markdown markers that the renderer consumes (**, backticks, link syntax,
heading and quote prefixes, table pipes) are also dropped before indexing, but a
lone *, _ or # stays: snake_case_name, C# and *.py must remain searchable.
Query syntax
| Written as | Matches |
|---|---|
word | any message containing that substring, case-insensitive, anywhere in the sentence |
word another | messages containing both terms, in any order |
"an exact phrase" | that phrase, with any whitespace between the words |
word -excluded | messages containing word but not excluded |
revti (typo) | one adjacent transposition is tolerated for 4–12 characters, plus one dropped letter from 7 characters; such rows are labelled Fuzzy match |
Not done on purpose: character-subsequence matching (an abbreviation like rvt
for a longer word). Over a two thousand character message almost any short query
is a subsequence, which turns the list into match-everything noise.
The results
- One row per conversation: title, hit count (
12 hits), best excerpt, time, workspace. - Scope lives under the search field: This chat / Workspace / All. The choice is remembered in local storage.
- Rows are grouped into Starting conversation (the one the query was typed in; it never moves when you jump) and Other conversations.
- Ordering is legible: more hits first, then the most recent match. Title-only matches come last.
- Recent searches appear in the empty state; one click re-runs one.
Two frames
The panel is split in two, and the lower frame never moves:
┌ search field + scope ──────────────────────────┐
│ results │ ← search output, scrolls
├ This chat list · 24 ────────────────────────────┤
│ every question you asked, oldest first │ ← fixed frame, scrolls alone
│ … │
├──────────────── [A−] [A+] ──────── v0.29.x ─────┤
- The lower frame is titled This chat list and holds every question you asked in the current conversation (injected context and tool output are filtered out by the message source).
- Each question is one bordered block and shows its full text (rows wrap and grow; up to 4000 characters are carried for display), so a prompt that starts with pasted code is readable instead of clipped.
- It reads the raw session log once per conversation, so a conversation that was compacted still lists its older prompts; a cache plus the cheap surface read keep later refreshes fast.
- A prompt you send appears within about a second (a document observer watches for the new chat node), and the frame keeps the newest question in view unless you have scrolled up to read older ones. A 20 s poll is the fallback.
- Typing a query does not filter or reorder that list: matching rows are highlighted in place.
- Clicking a row jumps to that question and paints the whole message red. The jump is resolved by the question's ordinal among the conversation's prompts (the transcript renders user messages as bubbles in the same order), which keeps two near-identical prompts apart; text anchors are only the fallback, and history is paged first when the message is outside the rendered window. When nothing can be found the frame says so instead of doing nothing.
- A− / A+ in the footer change the panel's text size between 12 and 24 px and
the choice is remembered per browser. Every size in the panel is in
em, so text, padding and control heights scale together. - The running version is printed in the footer of both the list and the detail view, so a build can be identified (and rolled back) without opening the plugin's files.
The detail view
← Project notes 12 hits
‹ Previous 3 / 12 Next ›
…the build script now runs from the project root…
C:\Work · Content match
Marked 41 · showing 12
- ‹ Previous / Next › (or
←/→) step through that conversation's matches. Each step switches the main column to the conversation if needed, scrolls the occurrence into view and paints it red; every other occurrence of the query in that conversation stays yellow. - Matching runs on each chat node's concatenated text, so a query the renderer split across bold / code / link runs is still found.
- The Host sends a whitespace-collapsed anchor window around each hit. The browser turns it into a whitespace-flexible pattern and looks for that exact window, so a match is pinned by its own text rather than by an ordinal that tool cards and code blocks would shift. The ordinal is only the fallback.
- When the target message sits in a history page the transcript has not loaded,
the plugin pages to the hit's event first (
loadThrough(seq)), then marks it. - The status line reports which path was taken:
Marked 41 · showing 12(anchor),… · by position(ordinal fallback),… · after loading history, orNot in the loaded transcript yet. - ← (or
Esc) returns to the results.
How it works
This build ships the session-content index switched off
(session-query-sqlite → openAt: never), and even when enabled its FTS5
unicode61 tokenizer treats a run of Chinese characters as one token, so
sessions.search can never match 搜索 inside 全文搜索功能.
| Half | Job |
|---|---|
index.js (Host) | /content-search/query?q=…&focus=…&scope=… — extracts prose once per conversation and caches it, then scans it literally. anchor/snippet are computed from that prose. /content-search/questions?focus=… — the raw-log question list for one conversation. |
client.js (Browser) | The tab: field, scope switch, list, detail view, anchors, highlights, jumps, shortcut, recents. |
Cache lifetimes: a quiet conversation 10 min, one still attached to a live agent 3 min, the conversation you are looking at 4 s. The cache is warmed 2.5 s after activation so the first query is usually not the one paying for it. Eight conversation reads run concurrently.
Reference timings on a machine with ~60 conversations (warm cache, prose only after filtering; query terms are placeholders, no real content is reproduced here):
| Query shape | Result | Server |
|---|---|---|
| one common term | ~30 conversations / ~400 matches | ~25–40 ms |
| one rare term | ~4 conversations / ~10 matches | ~25 ms |
| an exact phrase | 1–2 matches | ~40 ms |
a term with -excluded | 3 conversations, ~34 matches | ~22 ms |
an identifier with _ and . | ~4 matches | ~30 ms |
Cold start (cache empty) reads every conversation once and takes a few seconds; that happens after a restart and before the warm-up finishes.
Limits
- Only rendered nodes can be marked. A match inside a history page that paging cannot reach still opens the conversation, without a mark.
- Up to 200 conversation rows and 1200 excerpts per query, inside a 20 s budget; the footer says when the answer was truncated.
- Code the user or the model typed as plain text in a message is prose, not a code block: it stays searchable by design.
- Search reads the current model surface, so a conversation that was compacted may not return matches from its folded-away history. The question list does not have this limit: it reads the raw log of the conversation the panel belongs to.
- No semantic search: there is no embedding model in this build, so synonyms and meaning-level matches are out of scope.
Install and roll back
Install as a DeepSeek Harness plugin, three ways:
Plugins → Add plugin → dsh-content-search-ad # npm
Plugins → Add plugin → github:zmq6931/dsh-content-search-ad
Plugins → Add plugin → <absolute path to this directory>
Or add dsh-content-search-ad to dsh.profile.bundles in the target profile.
To roll back, check out a previous tag (git checkout v0.22.0) and reload the
plugin: the profile links this directory, so the running Host loads whatever is
checked out.
Plugins relacionados
billion-context
ranxianglei/billion-context
dsh-web-ui (dsh-chat-recovery)
zhu1090093659/dsh-web-ui
dsh-synapse
liangmianya/dsh-synapse
EduWork (dsh-message-edit)
ecnu/eduwork