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.
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. |
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.
- 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.
No comments yet. Be the first to write one.