rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:henrytunwang/dsh-plugin-session-fulltext
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
CJK-friendly full-text (literal substring) content search for the DSH sidebar.
DSH 侧边栏搜索其实由两部分组成(见 @deepseek-ai/dsh-client-ui-workspace):
sessions.search → @deepseek-ai/dsh-api-session-controller → ctx.sessionQuery.searchSessions。内容搜索要能工作,必须有 @deepseek-ai/dsh-session-query-sqlite 提供的全文索引,而 base / web bundle 默认把它设成:
- id: session-query-sqlite
config:
path: ':memory:'
openAt: never # 全文搜索被关闭
此时内容搜索会失败,客户端按设计静默忽略("a failed content search leaves metadata matches visible without an additional warning"),于是表现为“搜索只匹配会话名称”。
把 openAt 改成 first-search 能打开官方 FTS5 索引,但它使用 FTS5 的 unicode61 分词器:连续中文会被当成一个 token。
实测(SQLite 3.51):
-- 文档: 今天我们来讨论全文搜索的实现方案
MATCH '全文搜索' → 0 命中
MATCH '搜索' → 0 命中
也就是说,官方全文搜索对中文基本不可用。本插件因此不启用 FTS,而是在同一个 service 上只替换 searchSessions,用字面子串扫描(大小写不敏感)检索当前会话里的 user/assistant 消息:
合同、飞书、搜索);HUMAIN、session、Word 文档);filterEvents 等原 service 能力完全不动。user/message + assistant/message,只取当前 surface(与 api-session-controller 的过滤条件一致)。session.seq 判断失效,纯持久化会话只读一次。已安装到 Desktop profile(一个包同时提供 Host 半和浏览器半):
dsh plugin --profile desktop add link:/Users/le.su/wtdshwkspace/dsh-plugins/session-fulltext
package.json 里 dsh.bundle.patch 负责挂 Host 侧的行,dsh.client + exports["./client"] 负责让 Web 组合把 lib/client.js 送进浏览器 boot graph。
该命令会:
~/.dsh/profiles/desktop/package.json 的 dependencies 里记录 link:...;dsh-plugin-session-fulltext 追加到 dsh.profile.bundles;dsh.client 声明、把 lib/client.js 放进浏览器 boot graph。之后再改浏览器端代码由 dsh-client-hmr 自动热替换,无需重启。bundle 的 cordis.patch.yml 里给插件行传配置:
| 字段 | 默认 | 说明 |
|---|---|---|
debug |
false(本机 patch 里设为 true) |
往 $DSH_HOME/session-fulltext.log 追加激活/预热/搜索日志 |
warmupDelayMs |
2500 |
启动后多久开始后台预热 |
snippetChars |
240 |
snippet 长度上限 |
types |
['user/message','assistant/message'] |
建索引的事件类型 |
调试日志:~/.dsh/session-fulltext.log。
session-fulltext 行的 disabled: true,或从 dsh.profile.bundles 移除后删依赖:
dsh plugin --profile desktop remove dsh-plugin-session-fulltextsession-query-sqlite 保持 openAt: never 即可。浏览器半(lib/client.js)补上了官方侧边栏缺失的跳转能力:
n / m 上一个 下一个 × 胶囊,可在本会话所有命中之间循环跳转;Esc 或 × 关闭并清除高亮,切换会话/新搜索时自动收起;~/.dsh/session-fulltext.log 会出现一次 search "dsh-fulltext-client-probe"。浏览器端 bundle 由官方 dsh-client-hmr 每 500ms 轮询文件并在页面里热替换;新增/合并 dsh.client 声明时,Host 半会主动清掉 clientModules 的包元数据缓存并 flush() 一次,让新 graph 推到已打开的页面(日志里会有 client graph refresh requested),一般也不需要重启 App。
手动验证:控制台执行 __dshSessionFulltext.reveal('合同')。
listSessions(持久化目录列举),在会话数量极大时会线性变慢。CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。