@hapyp/dsh-session-search 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +134 -3
- package/client.js +1211 -0
- package/cordis.patch.yml +5 -0
- package/docs/DETAIL.md +42 -0
- package/docs/DETAIL.zh.md +32 -0
- package/icon.svg +9 -0
- package/index.js +482 -0
- package/locale/en.json +7 -0
- package/locale/zh.json +7 -0
- package/package.json +86 -6
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 HapYP
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,134 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# @hapyp/dsh-session-search
|
|
2
|
+
|
|
3
|
+
[中文](#中文) | English
|
|
4
|
+
|
|
5
|
+
Search **session content** across every DSH workspace, and find inside the
|
|
6
|
+
current conversation with `Ctrl+F`.
|
|
7
|
+
|
|
8
|
+
The built-in sidebar search matches session titles. This plugin adds content
|
|
9
|
+
search: user messages, assistant replies, tool calls (name + arguments), tool
|
|
10
|
+
results, and todo entries — from **all workspaces at once**.
|
|
11
|
+
|
|
12
|
+
## Features
|
|
13
|
+
|
|
14
|
+
- **Cross-workspace content palette** — `Ctrl+Shift+F`, or the enlarged
|
|
15
|
+
*Search all sessions* entry at the sidebar foot. Results show a highlighted
|
|
16
|
+
excerpt, the event type, the session title, its workspace, and the time.
|
|
17
|
+
`Enter` opens the session, `↑`/`↓` select, `Esc` closes, and *Scan older
|
|
18
|
+
sessions* pages back through history.
|
|
19
|
+
- **In-conversation find bar** — `Ctrl+F` opens a floating bar that highlights
|
|
20
|
+
every match in the rendered conversation, with match counting, previous/next
|
|
21
|
+
navigation, and scroll-to-match. Selecting text first prefills the query and
|
|
22
|
+
waits for `Enter`. Every search also counts matches in the **complete session
|
|
23
|
+
log**, including turns the page has not rendered yet.
|
|
24
|
+
- **Edge feedback** — stepping past the last or first match stops and reports
|
|
25
|
+
the edge instead of silently wrapping.
|
|
26
|
+
- Dark and light themes are inherited from DSH; all copy is localised (en/zh).
|
|
27
|
+
|
|
28
|
+
## Install
|
|
29
|
+
|
|
30
|
+
In DSH: **Plugins → Add plugin**, then install:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
@hapyp/dsh-session-search@1.0.0
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Or from a terminal, into a profile:
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
dsh plugin add @hapyp/dsh-session-search
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
After installing, reload the DSH page (`Ctrl+R`).
|
|
43
|
+
|
|
44
|
+
## Requirements
|
|
45
|
+
|
|
46
|
+
- DSH `0.2.2-rc.5` or newer within the `0.2.x` line.
|
|
47
|
+
- The built-in `@deepseek-ai/dsh-session-query` service must be mounted. It ships
|
|
48
|
+
with DSH's base composition; the plugin explains the situation in the palette
|
|
49
|
+
when it is absent instead of failing silently.
|
|
50
|
+
|
|
51
|
+
## Privacy and disk usage
|
|
52
|
+
|
|
53
|
+
- By default **nothing is written to disk**. Search reads session logs and keeps
|
|
54
|
+
an in-memory cache for the lifetime of the Host process.
|
|
55
|
+
- With *Disk cache* enabled in the palette (or `cache: true` in the request), the
|
|
56
|
+
plugin writes a **plain-text copy of scanned session text** to
|
|
57
|
+
`<system temp>/session-content-search-cache.v1.json`, capped at 48 MB. This
|
|
58
|
+
makes the first search after each DSH start near-instant. Delete the file at
|
|
59
|
+
any time to remove it; it is never authoritative — deleting it costs only
|
|
60
|
+
speed.
|
|
61
|
+
- Diagnostics are off unless the Host process is started with
|
|
62
|
+
`SESSION_CONTENT_SEARCH_DEBUG=1`.
|
|
63
|
+
- The plugin never modifies session storage. It calls the read-only
|
|
64
|
+
`listSessions` / `filterEvents` faces of `ctx.sessionQuery`; it does not open
|
|
65
|
+
or build a SQLite index.
|
|
66
|
+
|
|
67
|
+
## Known limitations
|
|
68
|
+
|
|
69
|
+
- Matching is a **literal, case-insensitive, whitespace-flexible substring
|
|
70
|
+
scan** (`AI` finds `BRAID`), not token or phrase matching.
|
|
71
|
+
- Reasoning ("thinking") text is not indexed by DSH and cannot be searched.
|
|
72
|
+
- The find bar scrolls to matches that are already rendered; matches in
|
|
73
|
+
unloaded history are counted but load when you scroll up.
|
|
74
|
+
- A search request visits at most ~40 sessions per page; use *Scan older
|
|
75
|
+
sessions* for deeper history.
|
|
76
|
+
- The first search of a Host process reads session logs; expect a few seconds
|
|
77
|
+
on large histories unless disk caching is enabled.
|
|
78
|
+
|
|
79
|
+
## License
|
|
80
|
+
|
|
81
|
+
MIT
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 中文
|
|
86
|
+
|
|
87
|
+
在**所有工作区**中搜索会话内容,并在当前会话内用 `Ctrl+F` 查找。
|
|
88
|
+
|
|
89
|
+
DSH 内置的侧栏搜索只匹配会话标题。本插件补上内容搜索:用户消息、助手回复、
|
|
90
|
+
工具调用(名称 + 参数)、工具结果、任务清单条目——**一次搜遍全部工作区**。
|
|
91
|
+
|
|
92
|
+
### 功能
|
|
93
|
+
|
|
94
|
+
- **跨工作区内容面板** — `Ctrl+Shift+F`,或侧栏底部的「搜索全部会话」入口。
|
|
95
|
+
结果显示高亮摘录、事件类型、会话标题、所属工作区与时间。`Enter` 打开会话,
|
|
96
|
+
`↑`/`↓` 选择,`Esc` 关闭;命中不足时点「继续扫描更早的会话」向后翻页。
|
|
97
|
+
- **会话内查找栏** — `Ctrl+F` 浮出查找栏,高亮当前已渲染对话中的全部匹配,
|
|
98
|
+
带命中计数、上一个/下一个与滚动定位。先选中文字再按 `Ctrl+F` 会自动填入并
|
|
99
|
+
等待回车。每次搜索还会统计**完整会话日志**中的命中数(含尚未渲染的回合)。
|
|
100
|
+
- **边界反馈** — 走到最后或第一个匹配时停住并提示,再次同向操作才回卷。
|
|
101
|
+
- 明暗主题自动继承 DSH;界面文案支持中英文。
|
|
102
|
+
|
|
103
|
+
### 安装
|
|
104
|
+
|
|
105
|
+
在 DSH 中:**插件 → 添加插件**,安装:
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
@hapyp/dsh-session-search@1.0.0
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
安装后按 `Ctrl+R` 刷新页面。
|
|
112
|
+
|
|
113
|
+
### 隐私与磁盘占用
|
|
114
|
+
|
|
115
|
+
- 默认**不向磁盘写入任何内容**,只在 Host 进程内存中缓存扫描结果。
|
|
116
|
+
- 在面板中勾选「磁盘缓存」后(或请求带 `cache: true`),插件会把**扫描过的
|
|
117
|
+
会话文本明文副本**写入 `<系统临时目录>/session-content-search-cache.v1.json`,
|
|
118
|
+
上限 48 MB,使每次 DSH 启动后的首次搜索接近即时。该文件可随时删除,删除只
|
|
119
|
+
影响速度,不影响数据。
|
|
120
|
+
- 除非以 `SESSION_CONTENT_SEARCH_DEBUG=1` 启动 Host,否则不写诊断日志。
|
|
121
|
+
- 本插件**从不修改会话存储**,只调用 `ctx.sessionQuery` 的只读
|
|
122
|
+
`listSessions` / `filterEvents`;不打开也不建 SQLite 索引。
|
|
123
|
+
|
|
124
|
+
### 已知限制
|
|
125
|
+
|
|
126
|
+
- 匹配为**字面、大小写不敏感、空白灵活的子串扫描**(`AI` 能命中 `BRAID`),
|
|
127
|
+
不是词元/短语匹配。
|
|
128
|
+
- 思考过程(reasoning)文本 DSH 不索引,无法搜索。
|
|
129
|
+
- 查找栏只滚动到已渲染的匹配;未加载历史中的命中会被计数,向上滚动加载后即可定位。
|
|
130
|
+
- 单次搜索最多访问约 40 个会话,更早的历史用「继续扫描更早的会话」。
|
|
131
|
+
|
|
132
|
+
### 协议
|
|
133
|
+
|
|
134
|
+
MIT
|