@lizimin/dsh-session-search 0.0.0-stage → 1.3.6
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/CHANGELOG.md +116 -0
- package/LICENSE +21 -0
- package/README.md +155 -2
- package/README.zh-CN.md +154 -0
- package/client.js +1013 -0
- package/cordis.patch.yml +3 -0
- package/docs/community-listing.yml +6 -0
- package/icon.svg +1 -0
- package/index.js +111 -0
- package/locale/en.json +1 -0
- package/locale/zh.json +1 -0
- package/package.json +65 -3
- package/search.js +454 -0
- package/session-catalog.js +136 -0
- package/settings.js +42 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Changelog / 更新日志
|
|
2
|
+
|
|
3
|
+
All package version changes must have an entry here before release. Entries are newest first and describe user-visible changes; GitHub releases link back to this file. / 每次插件包版本变更都必须先在此添加条目,按新到旧排列,记录面向用户的变化;GitHub Release 链接回此文件。
|
|
4
|
+
|
|
5
|
+
Versions 1.2.0–1.2.2 were initially installed only locally and their changes first reached GitHub in **1.2.3**. They are now backfilled as separate historical tags/releases from recovered development snapshots; the existing 1.2.3 tag is unchanged. Each 1.3.x version also has its own tag and release. Earlier private-bundle version numbers are not public-package releases. / 1.2.0–1.2.2 最初仅在本地安装,其改动首次随 **1.2.3** 上传 GitHub;现已从开发快照恢复并补发独立历史标签与 Release,原 1.2.3 标签保持不变。1.3.x 各版本也分别发布,不合并成单一版本。更早的私有包版本号不属于本公开包的发布历史。
|
|
6
|
+
|
|
7
|
+
## [1.3.6] - 2026-10-28
|
|
8
|
+
|
|
9
|
+
### Added / 新增
|
|
10
|
+
- Add a localized **Settings** shortcut to the search panel’s top-right corner. It opens the existing Session Search bundle settings through Plugin Manager’s supported navigation API without changing the selected conversation; unavailable navigation displays a fallback instruction instead of failing silently. / 搜索面板右上角新增中英文**设置**快捷入口,通过插件管理器公开导航 API 打开现有会话搜索设置页,不改变当前选中的对话;无法导航时显示备用进入方式,不再静默失败。
|
|
11
|
+
|
|
12
|
+
## [1.3.5] - 2026-10-28
|
|
13
|
+
|
|
14
|
+
### Fixed / 修复
|
|
15
|
+
- Keep workspace/session multiselects open when clicking nonfocusable row text or padding, allowing native label activation to toggle the checkbox exactly once. Previously, blur from the filter could dismiss the list before selection. Direct checkbox clicks and keyboard Space retain their native behavior; outside clicks, outside focus and Escape still dismiss the picker. / 点击工作区或会话多选列表的文字、行内留白时不再因筛选框失焦提前关闭,原生 label 激活可正常且仅切换一次复选框;直接点击复选框及键盘空格操作保持不变,外部点击、明确移出焦点和 Esc 仍可关闭列表。
|
|
16
|
+
|
|
17
|
+
## [1.3.4] - 2026-10-28
|
|
18
|
+
|
|
19
|
+
### Fixed / 修复
|
|
20
|
+
- Keep search-opened highlighted conversations in native Conversation mode instead of a custom main panel. This preserves the selected-session surface used by DSH’s file and link viewers. / 从搜索结果打开高亮对话时保持原生 Conversation 模式,不再切换到自定义主面板,保留 DSH 文件与链接查看器依赖的已选会话界面。
|
|
21
|
+
- Clear highlights and return with `selectPanel(null)`, not the visually equivalent but non-native `"conversation"` panel value. Esc and the clear/back buttons restore normal session-bound actions without reselecting the session in the sidebar. / 清除高亮时使用 `selectPanel(null)`,而非外观相同但非原生模式的 `"conversation"` 值;Esc 及清除/返回按钮恢复正常会话操作,无需重新点击侧边栏会话。
|
|
22
|
+
- Temporarily replace only the Conversation shell while highlighting, with a uniquely owned session child; clearing or navigating to another session disposes the replacement and restores the resident shell without redeclaring its slots. / 仅在高亮期间临时替换对话外壳,并拥有独立的会话子插槽;清除或切换会话时释放替换项、恢复原有外壳,不重复声明原有插槽。
|
|
23
|
+
|
|
24
|
+
## [1.3.3] - 2026-10-28
|
|
25
|
+
|
|
26
|
+
### Fixed / 修复
|
|
27
|
+
- Preserve the selected search event sequence and load history through that event before opening the highlighted conversation; stale navigation and load failures no longer silently open the latest page. / 保留选中搜索结果的事件序号,打开高亮对话前加载至该事件;过期导航或加载失败不会静默打开最新一页。
|
|
28
|
+
- Prioritize the selected Chat message within the bounded highlight scan and scroll its matching rendered text into view. An exact-row compatibility adapter never guesses at nearby messages; collapsed/unavailable content is explicitly reported, and user interaction stops automatic scrolling. / 在有限高亮扫描中优先处理选定 Chat 消息,并滚动至其中已渲染的匹配;精确行兼容适配器不会猜测附近消息,折叠/不可显示内容会明确提示,用户操作后停止自动滚动。
|
|
29
|
+
- Explain that highlight limits (200,000 UTF-16 units / 500 blocks / 2,048 marks) constrain display painting only, not search outcomes; make status text wrap instead of hiding the explanation behind an ellipsis. / 明确高亮上限(20 万 UTF-16 单元 / 500 文本块 / 2,048 区域)仅限制显示标黄,不减少搜索结果;状态文字换行显示,不再省略说明。
|
|
30
|
+
|
|
31
|
+
## [1.3.2] - 2026-10-28
|
|
32
|
+
|
|
33
|
+
### Fixed / 修复
|
|
34
|
+
- Register the highlighted conversation as a separate plugin-owned panel with an explicitly retained Session reference, rather than replacing or redeclaring the resident Conversation shell. This avoids a duplicate-slot startup failure that could hide the search UI. / 将高亮对话注册为插件独立面板,并显式持有会话引用,不再替换或重复声明原有对话外壳,避免重复插槽导致搜索界面无法启动。
|
|
35
|
+
- Reuse the shared Conversation content factory for Chat rendering and input; Esc or Clear returns to the ordinary conversation and releases the highlight panel's reference. / 复用共享对话内容工厂渲染 Chat 与输入区域;Esc 或清除按钮返回普通对话,并释放高亮面板持有的引用。
|
|
36
|
+
- Throttle updates so streaming cannot indefinitely postpone highlights in settled text; exclude hidden/editor/control gaps, and report zero-width regex matches without counting them as painted text. / 节流刷新,避免流式输出持续推迟已稳定文本的高亮;排除隐藏、编辑器与控件间隔,零宽正则匹配不计作已标黄文本。
|
|
37
|
+
|
|
38
|
+
## [1.3.1] - 2026-10-28
|
|
39
|
+
|
|
40
|
+
### Known issue / 已知问题
|
|
41
|
+
- This historical version redeclares a resident Conversation slot and can prevent the search UI from starting. Fixed in **1.3.2**; **1.3.3** is recommended. / 此历史版本重复声明原有对话插槽,可能导致搜索界面无法启动;已在 **1.3.2** 修复,建议使用 **1.3.3**。
|
|
42
|
+
|
|
43
|
+
### Added / 新增
|
|
44
|
+
- Opening a search result carries its matching mode into the conversation and temporarily paints matching displayed text yellow. Press **Esc**, or use the header's clear button, to remove the highlights. Saved messages are unchanged. / 从搜索结果打开对话时,沿用匹配模式,将显示文本中的匹配临时标黄。按 **Esc** 或点击标题栏清除按钮即可移除,不修改已保存消息。
|
|
45
|
+
- Reapply highlights as older messages load or collapsed content is expanded; matching stays on the Host under the same hard deadline, including regex and fuzzy modes. / 加载更早消息或展开折叠内容时重新高亮;正则及模糊匹配均在 Host 中受硬超时约束执行。
|
|
46
|
+
- Preserve the original conversation shell, Chat renderers, composer and width controls through a slot-owned wrapper; use CSS Custom Highlights without rewriting message DOM. / 通过插槽拥有的外层保留原有对话布局、Chat 渲染器、输入框及宽度控制,使用 CSS Custom Highlights,不改写消息 DOM。
|
|
47
|
+
|
|
48
|
+
## [1.3.0] - 2026-10-28
|
|
49
|
+
|
|
50
|
+
### Added / 新增
|
|
51
|
+
- Select multiple workspaces and multiple sessions, with searchable checkbox lists and explicit All choices; workspace selection restricts eligible sessions. / 工作区和会话均支持多选,提供可筛选的复选列表和明确的“全部”选项;工作区选择会限定可选会话。
|
|
52
|
+
- Filter matching messages by time using Today, Last 24 hours, Last 7 days, This month or custom local calendar dates. The end date includes the whole selected day (an exclusive next-midnight API bound). Filtering precedes matching, counts and pagination. / 支持今天、最近 24 小时、最近 7 天、本月及自定义本地日期;结束日期包含所选整天(API 截止为次日零点且不包含),在匹配、计数和分页前过滤消息。
|
|
53
|
+
- Save a profile-wide **Live / Enter or Search** search timing preference in the plugin's settings page, exposed through the same Host operation as the `session_search_settings` agent tool. / 可在插件设置页保存配置档级的**实时搜索 / 按 Enter 或搜索**触发方式,与 `session_search_settings` 代理工具共享同一 Host 操作。
|
|
54
|
+
- Extend the search API/tool with `workspaceIds`, `sessionIds`, `after` and `before`, preserving legacy singular scope fields. / 搜索 API 和工具新增 `workspaceIds`、`sessionIds`、`after` 和 `before`,保留旧版单范围字段兼容。
|
|
55
|
+
|
|
56
|
+
### Changed / 调整
|
|
57
|
+
- Use theme-aware yellow match backgrounds in snippets rather than blue/brand-only highlighting. / 摘要中的匹配改用主题适配的黄色背景,而不是仅使用蓝色或品牌色。
|
|
58
|
+
|
|
59
|
+
## [1.2.3] - 2026-10-28
|
|
60
|
+
|
|
61
|
+
### Fixed / 修复
|
|
62
|
+
- Replace the native **Newest first / Oldest first** dropdown with theme-token segmented buttons, including an explicit selected state and keyboard focus styling. / 将**最新优先 / 最早优先**原生下拉框改为使用主题颜色的分段按钮,提供明确选中状态和键盘焦点样式。
|
|
63
|
+
- Give the remaining dropdown options explicit theme-aware foreground/background colors instead of relying on native white popup defaults. / 为其余下拉选项明确设置主题前景与背景颜色,避免依赖原生白色弹层默认值。
|
|
64
|
+
|
|
65
|
+
### Documentation & maintenance / 文档与维护
|
|
66
|
+
- Backfill per-version changelog entries and require a current-version entry in package checks. / 补齐各版本更新日志,并在包检查中强制要求当前版本条目。
|
|
67
|
+
- Update English/Chinese plugin descriptions and document a ready-to-copy community listing entry with an accurate functional description and `session` category. / 更新中英文插件描述,提供可直接复制的社区收录条目,使用属实的功能说明和 `session` 分类。
|
|
68
|
+
|
|
69
|
+
## 1.2.2 - 2026-10-28
|
|
70
|
+
|
|
71
|
+
### Changed / 调整
|
|
72
|
+
- Redesign the search panel with a compact search card, grouped workspace/session filters, collapsible matching tips, and result-local view/order controls. / 重整搜索面板,采用紧凑搜索卡片、分组的工作区/会话筛选、可折叠匹配提示,以及靠近结果的视图与排序控件。
|
|
73
|
+
- Refine result cards, metadata badges, empty states, spacing and responsive layouts using DSH theme tokens; respect reduced-motion preferences. / 使用 DSH 主题变量优化结果卡片、信息标签、空状态、间距及响应式布局,并尊重减少动画的系统设置。
|
|
74
|
+
|
|
75
|
+
## 1.2.1 - 2026-10-28
|
|
76
|
+
|
|
77
|
+
### Added / 新增
|
|
78
|
+
- Show **“No exact matches found. Below are the fuzzy matches.”** only when a fuzzy search has results and no exact match exists anywhere in the selected scope. / 仅在模糊搜索有结果且整个所选范围没有精确匹配时提示**“未找到精确匹配。以下为模糊匹配结果。”**
|
|
79
|
+
- Compute exact-match presence from full eligible messages before pagination, respecting case, whole-word, scope and content settings; suppress the notice during loading, errors or incomplete reads. / 分页前检查符合范围的完整消息,遵循大小写、全字、范围和内容设置;加载中、出错或读取不完整时不显示提示。
|
|
80
|
+
- Separate settings/explanations from outcomes with a horizontal divider in both result views. / 两种结果视图都以水平分隔线区分设置说明与结果。
|
|
81
|
+
|
|
82
|
+
## 1.2.0 - 2026-10-28
|
|
83
|
+
|
|
84
|
+
### Added / 新增
|
|
85
|
+
- Add **Typo-tolerant** and **Subsequence** fuzzy search modes alongside default **Exact** matching, with English/Chinese controls and explanations. / 在默认**精确**匹配之外新增**拼写容错**和**子序列**两种模糊模式,提供中英文控件和说明。
|
|
86
|
+
- Typo matching supports insertion, deletion, substitution and adjacent letter transposition, with per-word edit limits; subsequence matching highlights ordered characters within candidate words. / 拼写容错支持插入、删除、替换及相邻字母交换,并限制每词编辑次数;子序列模式高亮候选词内依序出现的字符。
|
|
87
|
+
- Share fuzzy options across the UI, read-only agent tool and HTTP endpoint, preserving workspace/session/archive/subagent/content filters, chronological ordering and grouped results. / 界面、只读代理工具和 HTTP 接口共享模糊选项,保留工作区、会话、归档、子代理及内容筛选、时间排序和分组结果。
|
|
88
|
+
- Validate fuzzy/regex conflicts and query limits before reading history; bound matching work with a hard per-session deadline and bind pagination cursors to the fuzzy mode. / 读取历史前验证模糊/正则冲突及查询限制,以每会话硬超时限制匹配工作,并将分页游标绑定模糊模式。
|
|
89
|
+
|
|
90
|
+
## [1.1.0]
|
|
91
|
+
|
|
92
|
+
### Added / 新增
|
|
93
|
+
- Add **All workspaces / specific workspace** filtering and a workspace-dependent session picker; changing workspace clears the selected session. / 新增**所有工作区 / 指定工作区**筛选和联动会话选择器;切换工作区清除已选会话。
|
|
94
|
+
- Show workspace labels in cross-workspace choices and results; keep ungrouped conversations searchable and inherit parent workspace membership for subagents where applicable. / 跨工作区选项及结果显示工作区标签;保留未分组会话,并在适用时让子代理继承父会话工作区。
|
|
95
|
+
- Add the optional `workspaceId` tool/API parameter, validate conflicting scopes and bind cursors to workspace membership. / 工具和 API 新增可选 `workspaceId` 参数,验证范围冲突并将游标绑定工作区归属。
|
|
96
|
+
|
|
97
|
+
## [1.0.0]
|
|
98
|
+
|
|
99
|
+
### Added / 新增
|
|
100
|
+
- Initial public release of **Session Search**, opened from the sidebar or **Ctrl+F / ⌘F**. / 首个公开版本,可通过侧边栏或 **Ctrl+F / ⌘F** 打开**会话搜索**。
|
|
101
|
+
- Search all eligible sessions or one conversation; filter the titled session picker; optionally include archived and subagent conversations. / 搜索所有符合范围的会话或指定对话;按标题筛选会话选择器,可选包含归档及子代理。
|
|
102
|
+
- Case-sensitive, Unicode whole-word and regular-expression options; final replies by default or stored process text when enabled. / 支持区分大小写、Unicode 全字和正则匹配;默认搜索最终回复,也可启用已存储的过程文本。
|
|
103
|
+
- Timeline and collapsible session-group views, chronological ordering, highlighted snippets, pagination and conversation navigation. / 提供时间线、可折叠会话分组、时间排序、高亮摘要、分页和对话跳转。
|
|
104
|
+
- English/Chinese UI, exported plugin metadata and icon, MIT license, and a shared read-only agent tool without third-party dependencies or a build step. / 提供中英文界面、导出的插件元信息和图标、MIT 许可证及共享只读代理工具,不依赖第三方包或构建步骤。
|
|
105
|
+
|
|
106
|
+
[1.3.4]: https://github.com/Ziminli/dsh-session-search/compare/v1.3.3...v1.3.4
|
|
107
|
+
[1.3.3]: https://github.com/Ziminli/dsh-session-search/compare/v1.3.2...v1.3.3
|
|
108
|
+
[1.3.2]: https://github.com/Ziminli/dsh-session-search/compare/v1.3.1...v1.3.2
|
|
109
|
+
[1.3.1]: https://github.com/Ziminli/dsh-session-search/compare/v1.3.0...v1.3.1
|
|
110
|
+
[1.3.0]: https://github.com/Ziminli/dsh-session-search/compare/v1.2.3...v1.3.0
|
|
111
|
+
[1.2.2]: https://github.com/Ziminli/dsh-session-search/compare/v1.2.1...v1.2.2
|
|
112
|
+
[1.2.1]: https://github.com/Ziminli/dsh-session-search/compare/v1.2.0...v1.2.1
|
|
113
|
+
[1.2.0]: https://github.com/Ziminli/dsh-session-search/compare/v1.1.0...v1.2.0
|
|
114
|
+
[1.2.3]: https://github.com/Ziminli/dsh-session-search/compare/v1.1.0...v1.2.3
|
|
115
|
+
[1.1.0]: https://github.com/Ziminli/dsh-session-search/compare/v1.0.0...v1.1.0
|
|
116
|
+
[1.0.0]: https://github.com/Ziminli/dsh-session-search/releases/tag/v1.0.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Zimin Li
|
|
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,156 @@
|
|
|
1
|
-
#
|
|
1
|
+
# DSH Session Search
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
English | [简体中文](<README.zh-CN.md>)
|
|
4
|
+
|
|
5
|
+
Search stored DeepSeek Harness (DSH) conversation text across all or selected workspaces and sessions, with exact, regular-expression, typo-tolerant or word-internal subsequence matching. Open the search panel from the sidebar or with **Ctrl+F / ⌘F**.
|
|
6
|
+
|
|
7
|
+
See the bilingual [Changelog](<CHANGELOG.md>) for changes in every package version.
|
|
8
|
+
|
|
9
|
+
An independent community plugin, not an official DSH package. **Package version: 1.3.6.**
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- **All or multiple workspaces and sessions**, with searchable checkbox pickers and a latest-user-activity-first conversation list. Workspace and session scopes intersect; empty selection means all.
|
|
14
|
+
- **Message-time filters**: Today, Last 24 hours, Last 7 days, This month, or custom local calendar dates.
|
|
15
|
+
- Profile-persistent **Live / Enter or Search** search timing, configurable on the plugin's settings page.
|
|
16
|
+
- VS Code-style **Aa (Match Case)**, **ab (Whole Word)** and **.* (Regular Expression)** toggles, combinable with one another.
|
|
17
|
+
- Optional **Typo-tolerant** and **Subsequence** fuzzy modes alongside default **Exact** matching.
|
|
18
|
+
- **Timeline** results or collapsible **By session** groups with complete matching-message counts.
|
|
19
|
+
- **Newest first / Oldest first**, ordered by matching-message time rather than unrelated session activity.
|
|
20
|
+
- Optional **subagent conversations** and **archived sessions**, clearly labeled.
|
|
21
|
+
- **Final model replies only** by default; optionally search stored inputs, intermediate replies, tool calls/results and reasoning too.
|
|
22
|
+
- A compact, theme-aware search card, grouped workspace/session filters, collapsible search tips, and result-local view/order controls.
|
|
23
|
+
- Highlighted snippets, pagination, conversation-opening buttons, English/Chinese UI and DSH theme support. Narrow panels stack controls automatically; reduced-motion preferences are respected.
|
|
24
|
+
- A read-only **`search_session_text`** agent tool backed by the same engine as the UI.
|
|
25
|
+
- Local operation without a separate search service, FTS index, third-party dependencies or build step.
|
|
26
|
+
|
|
27
|
+
## Requirements and compatibility
|
|
28
|
+
|
|
29
|
+
Development reference: **DSH Desktop runtime 0.2.1-rc.3**. This is not a guaranteed minimum version or a promise of compatibility with every DSH release. The bundle requires DSH's session-query/controller services, plugin management and Web UI plugin APIs; these may change between releases.
|
|
30
|
+
|
|
31
|
+
**Node.js 22+** is required for development checks and tests. DSH Desktop uses its bundled runtime; installing a separate Node version does not change that runtime.
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
### Scoped npm distribution
|
|
36
|
+
|
|
37
|
+
This npm distribution is **`@lizimin/dsh-session-search`**, from the same Ziminli/dsh-session-search repository. In DSH's **Plugins → Add plugin**, enter:
|
|
38
|
+
|
|
39
|
+
```text
|
|
40
|
+
@lizimin/dsh-session-search
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
For DSH CLI profiles: `dsh plugin --profile <your-profile> add @lizimin/dsh-session-search`. This package is a DSH bundle, not a standalone search command. Do not activate it alongside the unscoped GitHub/local variant: they share routes, tools, service and UI slots. The scope-specific package, Cordis row, client module and settings targets are aligned; search behavior is unchanged from v1.3.6.
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
### DSH Desktop
|
|
47
|
+
|
|
48
|
+
1. Open **Plugins → Add plugin** (or **Install a third-party plugin**).
|
|
49
|
+
2. Enter the repository URL:
|
|
50
|
+
```text
|
|
51
|
+
https://github.com/Ziminli/dsh-session-search
|
|
52
|
+
```
|
|
53
|
+
3. Review the source/trust prompt, install, and enable the bundle if needed. Follow any restart/reload instructions returned by Plugin Manager.
|
|
54
|
+
|
|
55
|
+
### Local checkout / agent tool
|
|
56
|
+
|
|
57
|
+
Clone or download this repository, then install its **absolute package directory** through DSH's Plugin Manager. An agent with the required permission can call the `plugin_manager` tool with:
|
|
58
|
+
|
|
59
|
+
```json
|
|
60
|
+
{
|
|
61
|
+
"action": "install_bundle",
|
|
62
|
+
"target": "/absolute/path/to/dsh-session-search"
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
This is tool input, not a shell command. Replace the target with the actual absolute directory, including the Windows drive when applicable. Use Plugin Manager instead of editing profile manifests or composition files by hand. Installation affects the current DSH profile, not only the current conversation.
|
|
67
|
+
|
|
68
|
+
**Do not enable multiple Session Search copies at the same time.** Disable an existing local `@local/dsh-session-search` bundle first. The public package does not automatically migrate/remove it; overlapping shortcuts, UI registrations, routes, services and tool names can conflict. The repository name is not a claim of npm availability.
|
|
69
|
+
|
|
70
|
+
## Usage
|
|
71
|
+
|
|
72
|
+
1. Click the sidebar magnifying glass or press **Ctrl+F / ⌘F**. By default, typing searches after a 300 ms debounce. Use the top-right **Settings** shortcut to open **Plugins → Session Search** without changing the selected conversation. There, set **When to search → Only on Enter / Search** and Save to require explicit submission. In that mode, text and filter changes wait together; stale outcomes are hidden until you submit.
|
|
73
|
+
2. **All workspaces** is the default. Open the workspace picker to select one or more workspaces; changing selection clears selected sessions. **Clear selection (all)** restores all-workspace scope. **Ungrouped / no workspace** includes conversations outside registered workspaces. Session choices and cross-workspace results show workspace names; hover a label to see its path.
|
|
74
|
+
3. Keep **All sessions**, select multiple conversations using checkboxes, or click **Search this session** on a result. Filter picker options by title or ID; **Select all listed** adds the currently filtered choices. Each choice is a whole conversation, latest user activity first. Forks and unnamed conversations remain available. Workspace and session selections intersect.
|
|
75
|
+
4. Adjust matching, scope and **Message time** options. Presets include Today, Last 24 hours, Last 7 days and This month. Custom start/end dates use your browser's local timezone; an end date includes that entire calendar day. Either bound may be omitted. Time uses individual message timestamps, not session activity, and relative windows stay fixed while loading more. **Final model replies only** starts on; subagents and archived sessions start off.
|
|
76
|
+
5. Choose result order and, for all-session scope, **Timeline / By session**. Groups are ordered by their newest matching message, or oldest matching message when reversed. A message counts once even when the query occurs repeatedly in it.
|
|
77
|
+
6. Expand groups and use **Load more results / Load more sessions** (40 entries per page). Group counts include all matching events, not just loaded pages.
|
|
78
|
+
7. Click **Refresh sessions** after activity, rename, deletion or archival elsewhere. **Open conversation** navigates to an unarchived conversation and temporarily highlights matching displayed text in yellow, using that result's exact/regex/fuzzy options. Press **Esc** or the header's **Clear highlights** button to remove it. Restore archived sessions in DSH's sidebar/archive manager before opening; search never restores them.
|
|
79
|
+
|
|
80
|
+
Highlighted results remain in native Conversation mode so DSH’s selected-session file/link viewers stay available. Only during highlighting, the plugin temporarily replaces the Conversation shell using its own uniquely declared session child and the shared content factory. Clearing highlights, pressing Esc or switching to another session disposes that replacement and restores the resident shell; the resident slot declarations are not recreated.
|
|
81
|
+
|
|
82
|
+
Conversation highlights are view-only: saved messages, selection/copying and original Chat renderers are unchanged. They apply to currently rendered, non-hidden text blocks, not unloaded history or collapsed content; loading older messages or expanding content refreshes them. The result's time/final-only filters select search outcomes, not which text is painted after opening. Markdown rendering can change whitespace or remove syntax, so highlights follow displayed text and cannot span separate block elements. Opening a result preserves its event sequence and loads history through that event before mounting Chat. A compatibility adapter identifies an exact matching Chat row (never a nearby unrelated event), scrolls that row and its first rendered match into view, and spends the highlight budget on it first. It stops automatic scrolling after user interaction. Shipped Chat has no public selected-event reveal API, so collapsed reasoning/tool content or changed Chat markup can prevent the jump; the header reports this rather than jumping to another message. Expand the relevant content to reveal its highlights. Highlighting uses the browser CSS Custom Highlight API, with an explicit unsupported-browser notice, a 100 ms Host deadline, and bounded scans (500 blocks / 200,000 UTF-16 units / 2,048 ranges); partial coverage and errors are shown in the header. “Highlighting is capped” refers only to this bounded display pass, not missing search results or changed messages. The query is temporary, not saved or added to the URL.
|
|
83
|
+
|
|
84
|
+
Escape or the close button returns to the conversation. Query/options survive while the client module stays loaded; loaded pages and expansion state survive view switches while the panel stays mounted. These are not permanent settings across application restarts; the saved search-timing preference is profile-persistent. For native browser page-find while the plugin owns Ctrl+F/⌘F, use the browser menu.
|
|
85
|
+
|
|
86
|
+
## Matching rules and searchable content
|
|
87
|
+
|
|
88
|
+
| Toggle | Meaning |
|
|
89
|
+
| --- | --- |
|
|
90
|
+
| **Aa — Match Case** | Case-sensitive; otherwise Unicode case-insensitive. |
|
|
91
|
+
| **ab — Whole Word** | The complete match must not touch a Unicode letter, number or underscore. This is not language-aware word segmentation. |
|
|
92
|
+
| **.* — Regular Expression** | JavaScript Unicode pattern source, without `/` delimiters or trailing flags. Aa controls case sensitivity. |
|
|
93
|
+
|
|
94
|
+
All toggles start off: punctuation is literal, and whitespace between query terms is flexible. Query length is limited to 1,024 UTF-16 code units. Invalid patterns and matching that exceeds **100 ms per session** fail the whole search explicitly rather than silently omitting matches. Zero-width matches use a small vertical highlight. Matching runs on complete stored message text; snippets/highlights are bounded previews, not every occurrence in a long message.
|
|
95
|
+
|
|
96
|
+
### Fuzzy modes
|
|
97
|
+
|
|
98
|
+
Use **Text matching → Typo-tolerant / Subsequence**; **Exact** stays the default. Choosing a fuzzy mode turns Regex off; turning Regex on restores Exact. The HTTP/tool API rejects requests combining `useRegex: true` with a non-`off` `fuzzy` value.
|
|
99
|
+
|
|
100
|
+
When a fuzzy search has results but no exact matches anywhere in the selected scope, a notice above the outcomes says **“No exact matches found. Below are the fuzzy matches.”** Exact detection respects case, whole-word and scope/content settings and scans complete messages before pagination. The notice is suppressed while loading, on errors or incomplete reads, and when no fuzzy results exist. A horizontal divider separates settings/explanations from results in both views.
|
|
101
|
+
|
|
102
|
+
- **Typo-tolerant**: `wrokspace` or `workspce` finds `workspace`. Compares complete Unicode letter/number/underscore words using insertion, deletion, substitution and adjacent transposition (optimal string alignment). Query words of 1–3 Unicode characters allow 0 edits, 4–7 allow 1, and 8+ allow 2. The matched word is highlighted.
|
|
103
|
+
- **Subsequence**: `wrkspc` finds `workspace`. Characters stay in order **inside a single word**, not across arbitrary message text; highlights mark the selected characters. Candidate words may have at most `4 × query-word length + 8` Unicode characters to limit noisy matches.
|
|
104
|
+
- Multiple query words form a **contiguous phrase**, in query order, with flexible whitespace. Punctuation stays literal. Words are maximal Unicode letter/number/underscore runs, not language-aware segmentation; fuzzy search is not semantic or synonym search.
|
|
105
|
+
- Match Case and Whole Word remain available. Fuzzy word tokens already compare full words; Whole Word additionally guards the complete phrase's outer edges, including punctuation-led/trailing phrases.
|
|
106
|
+
- Fuzzy queries are limited to **128 Unicode code points / 16 word terms**, within the general 1,024 UTF-16-unit limit. Both modes keep chronological ordering, complete group counts, scope filtering and the same hard per-session matching deadline. Fuzzy results are not relevance-ranked.
|
|
107
|
+
|
|
108
|
+
**Final replies** are text blocks from the last non-interrupted assistant message of a successfully completed turn, provided that message contains no tool call. Progress text, reasoning, tool calls/results, open/interrupted turns and tool-only endings are excluded. This is inferred from durable events, not a stored final/commentary channel label.
|
|
109
|
+
|
|
110
|
+
Turn **Final model replies only** off to include stored user/system/developer inputs, intermediate assistant text, reasoning, tool calls/results and recorded failed-attempt text. Search does not retrieve hidden provider data, OCR images or open attachment files. Raw provider envelopes and stream duplicates of committed messages are not separately indexed.
|
|
111
|
+
|
|
112
|
+
Every eligible session is scanned before pagination so chronological ordering and group counts are complete for readable sessions. Large histories may be slow; later pages read history again. Unreadable sessions are reported as partial results, while a failed single-session read is an error. Changes to matching results or relevant metadata invalidate continuation cursors: search again to refresh.
|
|
113
|
+
|
|
114
|
+
## Agent tool
|
|
115
|
+
|
|
116
|
+
`search_session_text` supports:
|
|
117
|
+
|
|
118
|
+
- `action: "search"` (default): matching reply/event snippets, event numbers and UTF-16 highlight ranges.
|
|
119
|
+
- `action: "groups"`: paged conversation groups; `total` counts groups and `totalMatches` counts matching events.
|
|
120
|
+
- `action: "sessions"`: eligible session catalog without text matching.
|
|
121
|
+
|
|
122
|
+
`workspaceId` restricts all three actions to one workspace; omit it for all workspaces. Discover IDs from the `sessions` response's `workspaces` catalog, including `__ungrouped__`. Responses include workspace scope metadata, and each session, hit and group carries `workspaceId`, `workspaceTitle` and `workspacePath`. An unknown workspace or a session outside the selected workspace is rejected instead of broadening the search. Registered sidebar membership takes priority; an exact, unambiguous cwd-root match is the fallback. Ambiguous or unmatched conversations remain Ungrouped; subagents inherit their parent's workspace. Continuation cursors bind the workspace scope.
|
|
123
|
+
|
|
124
|
+
Options: `query`, `workspaceIds` (up to 200 IDs), `sessionIds` (up to 1,000 IDs), `after` / `before` (inclusive/exclusive Unix epoch milliseconds), `includeSubagents`, `includeArchived`, `content` (`final` or `all`), `order` (`newest` or `oldest`), `matchCase`, `wholeWord`, `useRegex` and `fuzzy` (`off`, `typo` or `subsequence`). Empty/omitted arrays mean all; selections are OR within a list and AND between lists. Legacy `workspaceId` / `sessionId` remain supported, but cannot be combined with a nonempty corresponding plural field. Invalid/unavailable selections are errors, never silently broadened. Time bounds exclude messages with missing timestamps, apply before matching/group counts/pagination and do not filter the session catalog. Pass `nextCursor` back as `cursor` with unchanged action/query/options to continue. Defaults match the panel. Tool availability depends on the active agent and DSH policy.
|
|
125
|
+
|
|
126
|
+
`session_search_settings` reads the saved timing preference when called with `{}`; `{ "searchMode": "live" }` or `{ "searchMode": "submit" }` saves it through the same operation used by the plugin settings UI. This changes configuration, not conversations. The settings HTTP endpoint accepts owner-authenticated GET/POST; writes require JSON and failures are explicit.
|
|
127
|
+
|
|
128
|
+
## Privacy and safety
|
|
129
|
+
|
|
130
|
+
Search operates locally in the current DSH profile. It does not edit, resume, restore or delete conversations. The HTTP endpoint requires DSH owner authentication and disables response caching. Snippets render as text, not session-supplied HTML; regex matching is bounded on the Host rather than executed in the browser.
|
|
131
|
+
|
|
132
|
+
Results can contain sensitive titles, IDs, paths, prompts, tool output and stored reasoning. **Agent-tool results may enter model context and be sent to the configured provider.** Queries may appear in request logs. Review results before sharing; never put private histories or credentials in issue reports.
|
|
133
|
+
|
|
134
|
+
## Development
|
|
135
|
+
|
|
136
|
+
```sh
|
|
137
|
+
npm run check
|
|
138
|
+
npm test
|
|
139
|
+
npm pack --dry-run
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
No dependency installation or build step is needed. Syntax checks and synthetic tests do not establish visual correctness or compatibility with another DSH version. Verify installation, representative searches, keyboard behavior and light/dark rendering in the target application.
|
|
143
|
+
|
|
144
|
+
Runtime files: [index.js](<index.js>) (Host/HTTP/tool), [settings.js](<settings.js>) (validated, persisted timing preference), [search.js](<search.js>) (matching/sorting/grouping/pagination), [session-catalog.js](<session-catalog.js>) (catalog/event extraction), [client.js](<client.js>) (UI/shortcut). Display resources include the bundle patch, localized metadata and an original SVG icon. Historical internal cursor/VM version markers are implementation identifiers, not the public package version.
|
|
145
|
+
|
|
146
|
+
[Report an issue](https://github.com/Ziminli/dsh-session-search/issues) with your DSH/runtime version and a minimal synthetic example, not a private conversation export.
|
|
147
|
+
|
|
148
|
+
## Releases and community listing
|
|
149
|
+
|
|
150
|
+
Every package-version change must add a user-visible entry to [CHANGELOG.md](<CHANGELOG.md>); `npm run check` verifies the current version has one. Publish the matching `vX.Y.Z` Git tag and GitHub Release with notes referring to that entry. Local-only development versions are identified explicitly in the history.
|
|
151
|
+
|
|
152
|
+
A ready-to-copy [community listing entry](<docs/community-listing.yml>) follows the [community contribution guide](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin/blob/main/contributing.md): accurate one-line English/Chinese descriptions ending in a period, canonical repository URL and the `session` category. To submit it, open a separate PR to that community repository adding only `data/plugins/Ziminli__dsh-session-search.yml` with this entry. Do not edit their generated READMEs. This file in our repository is a template, **not a submitted or accepted listing**. The community also checks repository age (at least one day), the `dsh-plugin` topic, the installable `dsh.bundle` manifest and working code. Our exported SVG is for the DSH UI; the optional community `icon` field is omitted because that field requires a GitHub-hosted raster image.
|
|
153
|
+
|
|
154
|
+
## License
|
|
155
|
+
|
|
156
|
+
[MIT](<LICENSE>) © 2026 Zimin Li. The included original SVG icon is covered by the same license.
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# DSH 会话搜索
|
|
2
|
+
|
|
3
|
+
[English](<README.md>) | 简体中文
|
|
4
|
+
|
|
5
|
+
在所有或指定工作区、会话中搜索已存储的 DeepSeek Harness(DSH)对话文本,支持精确、正则表达式、拼写容错及词内子序列匹配。通过侧边栏放大镜或 **Ctrl+F / ⌘F** 打开。
|
|
6
|
+
|
|
7
|
+
每个插件包版本的改动见双语[更新日志](<CHANGELOG.md>)。
|
|
8
|
+
|
|
9
|
+
本项目为独立社区插件,并非 DSH 官方插件。**插件包版本:1.3.6。**
|
|
10
|
+
|
|
11
|
+
## 功能
|
|
12
|
+
|
|
13
|
+
- **全部或多个工作区与会话**;可筛选的复选选择器按最近用户活动展示完整对话。工作区与会话范围取交集,未选表示全部。
|
|
14
|
+
- **消息时间筛选**:今天、最近 24 小时、最近 7 天、本月或自定义本地日期。
|
|
15
|
+
- 可在插件设置页保存配置档级的**实时搜索 / 按回车或点击搜索**触发方式。
|
|
16
|
+
- 类似 VS Code 的 **Aa(区分大小写)**、**ab(全字匹配)**、**.*(正则表达式)**,可组合使用。
|
|
17
|
+
- 默认**精确匹配**,也可选择**拼写容错**或**子序列**两种模糊模式。
|
|
18
|
+
- **时间线**与可折叠的**按会话**视图;会话分组显示完整匹配消息数。
|
|
19
|
+
- **最新优先 / 最早优先**,按匹配消息时间而非无关的会话活动排序。
|
|
20
|
+
- 可选包含**子代理对话**和**已归档会话**,并显示相应标记。
|
|
21
|
+
- 默认**仅搜索模型最终回复**;也可包含已存储的输入、中间回复、工具调用/结果及推理。
|
|
22
|
+
- 紧凑的主题适配搜索卡片、分组的工作区/会话筛选、可折叠搜索提示,以及靠近结果的视图与排序控件。
|
|
23
|
+
- 高亮摘要、分页、打开对话按钮、中英文界面与 DSH 主题支持。窄面板下控件自动堆叠,并尊重减少动画的系统设置。
|
|
24
|
+
- 提供与界面共享引擎的只读代理工具 **`search_session_text`**。
|
|
25
|
+
- 本地运行,不依赖独立搜索服务、全文索引、第三方依赖或构建步骤。
|
|
26
|
+
|
|
27
|
+
## 环境要求与兼容性
|
|
28
|
+
|
|
29
|
+
开发参考环境:**DSH Desktop runtime 0.2.1-rc.3**。这并不表示最低兼容版本,也不保证兼容所有 DSH 版本。插件需要 DSH 的会话查询/控制服务、插件管理及 Web UI 插件接口;这些接口可能随版本变化。
|
|
30
|
+
|
|
31
|
+
开发检查和测试需要 **Node.js 22+**。DSH 桌面版使用自带运行时,单独安装 Node 不会更改桌面版运行时。
|
|
32
|
+
|
|
33
|
+
## 安装
|
|
34
|
+
|
|
35
|
+
### npm 作用域发行包
|
|
36
|
+
|
|
37
|
+
本 npm 发行包为 **`@lizimin/dsh-session-search`**,源码仓库仍为 Ziminli/dsh-session-search。在 DSH 的**插件 → 添加插件**中输入:
|
|
38
|
+
|
|
39
|
+
```text
|
|
40
|
+
@lizimin/dsh-session-search
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
使用 DSH CLI 时可运行 `dsh plugin --profile <你的配置档> add @lizimin/dsh-session-search`。这是 DSH 插件包,不是独立搜索命令。不要与无作用域 GitHub/本地副本同时启用;它们共享路由、工具、服务及界面槽位。本发行包已同步作用域包名、Cordis 行、客户端模块和设置目标,搜索行为与 v1.3.6 相同。
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
### DSH 桌面版
|
|
47
|
+
|
|
48
|
+
1. 打开**插件 → 添加插件**(或**安装第三方插件**)。
|
|
49
|
+
2. 输入仓库地址:
|
|
50
|
+
```text
|
|
51
|
+
https://github.com/Ziminli/dsh-session-search
|
|
52
|
+
```
|
|
53
|
+
3. 检查来源和信任提示后安装;如有需要,启用插件包。按照插件管理器返回的说明重启或重新加载。
|
|
54
|
+
|
|
55
|
+
### 本地目录 / 代理工具
|
|
56
|
+
|
|
57
|
+
克隆或下载仓库,通过 DSH 插件管理器安装该**插件包目录的绝对路径**。具备相应权限的代理可调用 `plugin_manager` 工具:
|
|
58
|
+
|
|
59
|
+
```json
|
|
60
|
+
{
|
|
61
|
+
"action": "install_bundle",
|
|
62
|
+
"target": "/absolute/path/to/dsh-session-search"
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
这是工具输入,不是终端命令。请替换为实际绝对路径;Windows 环境需包含盘符。请使用插件管理器,不要手动修改配置档清单或组合配置文件。安装影响当前 DSH 配置档,而非仅当前对话。
|
|
67
|
+
|
|
68
|
+
**不要同时启用多个会话搜索副本。** 请先禁用现有本地 `@local/dsh-session-search` 插件包。公开包不会自动迁移或删除旧包;重复的快捷键、界面注册、路由、服务及工具名可能冲突。仓库名称不表示本包已在 npm 发布。
|
|
69
|
+
|
|
70
|
+
## 使用
|
|
71
|
+
|
|
72
|
+
1. 点击侧边栏放大镜或按 **Ctrl+F / ⌘F**。默认输入后防抖 300 毫秒自动搜索。点击右上角**设置**可直接打开**插件 → 会话搜索**,不改变当前选中的对话。在该页将**搜索触发方式**改为**仅按回车 / 点击搜索时**并保存,可要求手动提交。此模式下文本与所有筛选条件一起等待提交,旧结果在修改后隐藏。
|
|
73
|
+
2. 默认**所有工作区**。打开工作区选择器,通过复选框选择一个或多个工作区;更改后清空已选会话。**清除选择(全部)**恢复所有工作区。**未分组 / 无工作区**包含不属于注册工作区的对话。会话选项及跨工作区结果显示工作区名称,悬停可查看路径。
|
|
74
|
+
3. 保持**所有会话**、复选多个对话,或点击结果中的**搜索此会话**。按标题或 ID 筛选选项,**全选当前列表**可追加当前筛选出的项。每项代表完整对话,按最近用户活动排序;分叉和未命名对话仍可选择。工作区与会话范围取交集。
|
|
75
|
+
4. 调整匹配、范围及**消息时间**。提供今天、最近 24 小时、最近 7 天、本月等预设。自定义起止日期采用浏览器本地时区,结束日期包含当地整天,也可仅设单侧边界。按消息自身时间戳筛选,而非会话活动时间;加载更多时相对时间窗口保持固定。默认启用**仅搜索模型最终回复**,默认不包含子代理及归档会话。
|
|
76
|
+
5. 选择结果顺序;搜索所有会话时可切换**时间线 / 按会话**。分组按最新匹配消息排序,选择最早优先时按最早匹配消息排序。同一消息内文本重复出现只计一次。
|
|
77
|
+
6. 展开分组,通过**加载更多结果 / 加载更多会话**分页(每页 40 条)。分组计数包含全部匹配事件,而不仅是已加载页面。
|
|
78
|
+
7. 其他位置发生新活动、重命名、删除或归档后,点击**刷新会话**。**打开对话**跳转到未归档对话,并沿用该结果的精确/正则/模糊匹配选项,将显示文本中的匹配临时标黄。按 **Esc** 或标题栏的**清除高亮**按钮移除。已归档对话需先在 DSH 侧边栏或归档管理中恢复;搜索本身不会恢复会话。
|
|
79
|
+
|
|
80
|
+
高亮对话保持原生 Conversation 模式与已选会话界面,因此文件、链接等会话操作仍可使用。插件仅在高亮期间临时替换对话外壳,通过独立的会话子插槽复用共享内容工厂;清除高亮、按 Esc 或切换到另一会话时释放替换项并恢复原有外壳,不重复声明原有插槽。高亮仅影响显示,不修改已保存消息、选中/复制行为或原有 Chat 渲染器。只处理当前渲染且未隐藏的文本块,不包括尚未加载的历史或折叠内容;加载更早消息或展开内容后会刷新。时间及最终回复筛选用于选择搜索结果,不限制打开后标黄的显示文本。Markdown 渲染可能改变空白或移除语法,因此按显示文本匹配且不能跨不同块级元素。打开结果时保留事件序号,并在挂载 Chat 前加载至该事件。兼容适配器识别精确对应的 Chat 消息行(不会选择附近但无关的事件),滚动至消息行及其首个已渲染匹配,并优先将高亮预算用于该消息;用户开始操作后停止自动滚动。目前 Chat 没有公开的选定事件展开/定位 API,折叠的思考/工具结果或 Chat 标记变化仍可能阻止定位,此时标题栏会明确提示,而不是跳到其他消息;展开相关内容后可显示匹配。依赖浏览器 CSS Custom Highlight API,不支持时明确提示;Host 匹配限时 100 毫秒,扫描上限为 500 文本块 / 200,000 UTF-16 单元 / 2,048 高亮区域,部分覆盖及错误在标题栏提示。“高亮已达上限”仅指本轮显示扫描的性能预算,不表示搜索结果缺失或消息被修改。查询仅临时保留,不保存或加入 URL。
|
|
81
|
+
|
|
82
|
+
按 Escape 或关闭按钮返回对话。查询及选项在客户端模块仍加载时保留;面板保持挂载时切换视图会保留已加载页面和展开状态。这些状态不保证在应用重启后保留;保存的搜索触发方式会持久化到配置档。插件接管 Ctrl+F/⌘F 期间,如需浏览器原生页面查找,请使用浏览器菜单。
|
|
83
|
+
|
|
84
|
+
## 匹配规则与搜索内容
|
|
85
|
+
|
|
86
|
+
| 开关 | 含义 |
|
|
87
|
+
| --- | --- |
|
|
88
|
+
| **Aa — 区分大小写** | 精确区分大小写;关闭时使用 Unicode 不区分大小写匹配。 |
|
|
89
|
+
| **ab — 全字匹配** | 完整匹配两侧不能紧邻 Unicode 字母、数字或下划线;不是自然语言分词。 |
|
|
90
|
+
| **.* — 正则表达式** | JavaScript Unicode 正则源码,不加 `/` 分隔符或末尾标志;大小写由 Aa 控制。 |
|
|
91
|
+
|
|
92
|
+
默认全部关闭:标点按字面匹配,查询词之间的空白可灵活匹配。查询最多 1,024 个 UTF-16 代码单元。表达式无效或超过**每会话 100 毫秒**匹配时限时,整个搜索会明确报错,不会静默遗漏匹配。零宽匹配显示为细竖线。匹配针对完整存储消息执行;摘要和高亮只是有限预览,不表示长消息中每一次出现。
|
|
93
|
+
|
|
94
|
+
### 模糊模式
|
|
95
|
+
|
|
96
|
+
在**文本匹配**中选择**拼写容错 / 子序列**;默认仍是**精确**。选择模糊模式会关闭正则,启用正则会恢复精确模式。HTTP/工具接口会拒绝同时启用 `useRegex: true` 与非 `off` 的 `fuzzy`。
|
|
97
|
+
|
|
98
|
+
模糊搜索有结果、但所选范围内没有任何精确匹配时,结果上方会提示**“未找到精确匹配。以下为模糊匹配结果。”**精确检查遵循大小写、全字、范围及内容设置,在分页前检查完整消息。加载中、发生错误、部分会话无法读取或没有模糊结果时不显示该提示。两种视图都以水平分隔线区分设置/说明与搜索结果。
|
|
99
|
+
|
|
100
|
+
- **拼写容错**:`wrokspace` 或 `workspce` 可找到 `workspace`。对完整 Unicode 字母/数字/下划线词进行插入、删除、替换及相邻字符交换匹配(optimal string alignment)。查询词长度 1–3 个 Unicode 字符允许 0 次编辑,4–7 允许 1 次,8 字符以上允许 2 次;高亮完整匹配词。
|
|
101
|
+
- **子序列**:`wrkspc` 可找到 `workspace`。字符必须在**同一个词内**依序出现,不跨整条消息任意散布匹配;高亮实际选中的字符。候选词长度不超过 `4 × 查询词长度 + 8` 个 Unicode 字符,以减少噪声。
|
|
102
|
+
- 多个查询词按顺序形成**连续短语**,空白灵活匹配,标点按字面匹配。词是连续的 Unicode 字母/数字/下划线,不是自然语言分词;模糊搜索不提供语义或同义词检索。
|
|
103
|
+
- 可继续使用区分大小写和全字匹配。模糊词本身已匹配完整词;全字开关另外检查完整短语的外部边界,包括以标点开头或结尾的短语。
|
|
104
|
+
- 模糊查询最多 **128 个 Unicode 码点 / 16 个词**,同时受通用 1,024 UTF-16 单元限制。两种模式保留时间排序、完整分组计数、范围筛选及相同的每会话硬性匹配时限,不按相关性排序。
|
|
105
|
+
|
|
106
|
+
**最终回复**指成功完成轮次中,最后一条未中断且不包含工具调用的助手消息里的文本块;不包含进度文本、推理、工具调用/结果、未完成或中断轮次及仅以工具结束的情况。分类依据持久化事件推断,而非存储的 final/commentary 通道标记。
|
|
107
|
+
|
|
108
|
+
取消**仅搜索模型最终回复**后,可搜索已存储的用户/系统/开发者输入、中间助手文本、推理、工具调用/结果及失败尝试文本。插件不会获取未存储的供应商隐藏数据、识别图片文字或打开附件,也不会单独索引原始供应商封装及已提交消息的重复流式片段。
|
|
109
|
+
|
|
110
|
+
分页前会扫描全部符合条件的会话,以保证可读会话的全局时间排序与分组计数完整。大型历史可能较慢,后续分页也会重新读取历史。无法读取的会话会明确提示结果不完整;单会话读取失败会直接报错。匹配结果或相关元数据变化会使续页游标失效,请重新搜索。
|
|
111
|
+
|
|
112
|
+
## 代理工具
|
|
113
|
+
|
|
114
|
+
`search_session_text` 支持:
|
|
115
|
+
|
|
116
|
+
- `action: "search"`(默认):返回匹配回复/事件的摘要、事件序号及 UTF-16 高亮范围。
|
|
117
|
+
- `action: "groups"`:分页返回会话分组;`total` 为分组数,`totalMatches` 为匹配事件总数。
|
|
118
|
+
- `action: "sessions"`:返回符合条件的会话目录,不执行文本匹配。
|
|
119
|
+
|
|
120
|
+
`workspaceId` 可将上述三个动作限定在指定工作区;省略即搜索所有工作区。通过 `sessions` 响应的 `workspaces` 目录获取 ID,其中 `__ungrouped__` 表示未分组。响应包含工作区范围信息,每个会话、匹配和分组均携带 `workspaceId`、`workspaceTitle`、`workspacePath`。无效工作区及不属于所选工作区的会话会直接报错,不会静默扩大搜索范围。优先使用侧边栏注册的工作区归属,回退规则为 cwd 与唯一工作区根目录精确匹配;有歧义或不匹配的对话保留为未分组,子代理继承父会话的工作区。续页游标与工作区范围绑定。
|
|
121
|
+
|
|
122
|
+
选项包括 `query`、`workspaceIds`(最多 200 项)、`sessionIds`(最多 1,000 项)、`after` / `before`(Unix 毫秒时间戳,起始包含、截止不包含)、`includeSubagents`、`includeArchived`、`content`(`final` 或 `all`)、`order`(`newest` 或 `oldest`)、`matchCase`、`wholeWord`、`useRegex`、`fuzzy`(`off`、`typo` 或 `subsequence`)。数组为空或省略表示全部;同一列表内取并集,两类范围间取交集。兼容旧 `workspaceId` / `sessionId`,但不能与对应非空复数字段同时使用。无效或不可用的选择会报错,绝不静默扩大范围。时间筛选排除时间戳缺失的消息,在匹配、分组计数及分页前执行,不过滤会话目录。续页时将 `nextCursor` 作为 `cursor`,并保持动作、查询和选项不变。工具是否可用取决于当前代理和 DSH 策略。
|
|
123
|
+
|
|
124
|
+
`session_search_settings` 传 `{}` 读取已保存的触发方式;传 `{ "searchMode": "live" }` 或 `{ "searchMode": "submit" }` 保存,通过与插件设置界面相同的操作完成。这只更改配置,不更改对话。设置 HTTP 接口支持所有者身份验证后的 GET/POST,写入要求 JSON,失败会明确返回。
|
|
125
|
+
|
|
126
|
+
## 隐私与安全
|
|
127
|
+
|
|
128
|
+
搜索在当前 DSH 配置档内本地运行,不会修改、继续运行、恢复或删除会话。HTTP 接口要求 DSH 所有者身份认证并禁用响应缓存;摘要按纯文本渲染,不会执行会话提供的 HTML。正则匹配在 Host 端限时运行,不在浏览器执行。
|
|
129
|
+
|
|
130
|
+
结果可能包含敏感标题、ID、路径、提示词、工具输出和存储的推理。**代理工具结果可能进入模型上下文并发送给所配置的模型供应商。** 查询也可能出现在请求日志中。分享前请检查内容,不要在问题报告中上传私人历史或凭据。
|
|
131
|
+
|
|
132
|
+
## 开发
|
|
133
|
+
|
|
134
|
+
```sh
|
|
135
|
+
npm run check
|
|
136
|
+
npm test
|
|
137
|
+
npm pack --dry-run
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
无需安装依赖或构建。语法检查及合成数据测试不等于视觉正确或兼容其他 DSH 版本;请在目标应用中验证安装、代表性搜索、快捷键及明暗主题显示。
|
|
141
|
+
|
|
142
|
+
运行时文件:[index.js](<index.js>)(Host/HTTP/工具)、[settings.js](<settings.js>)(验证及持久化触发方式)、[search.js](<search.js>)(匹配/排序/分组/分页)、[session-catalog.js](<session-catalog.js>)(目录/事件提取)、[client.js](<client.js>)(界面/快捷键)。展示资源包括插件包补丁、本地化元信息和原创 SVG 图标。内部历史游标/VM 版本标记是实现标识,不是公开包版本。
|
|
143
|
+
|
|
144
|
+
[反馈问题](https://github.com/Ziminli/dsh-session-search/issues)时请提供 DSH/运行时版本及最小合成示例,不要提交私人对话导出。
|
|
145
|
+
|
|
146
|
+
## 发版与社区收录
|
|
147
|
+
|
|
148
|
+
每次插件包版本变化都必须在 [CHANGELOG.md](<CHANGELOG.md>) 添加面向用户的更新条目;`npm run check` 会检查当前版本是否已有条目。发布相应的 `vX.Y.Z` Git 标签和 GitHub Release,发布说明引用该条目。仅本地使用的开发版本在历史中明确标注。
|
|
149
|
+
|
|
150
|
+
可直接复制的[社区收录条目](<docs/community-listing.yml>) 遵循[社区贡献指南](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin/blob/main/contributing.md):中英文各一句、句号结尾、功能描述属实、仓库地址准确,并使用 `session` 分类。投稿时需另向社区仓库提交 PR,仅新增 `data/plugins/Ziminli__dsh-session-search.yml`,内容复制自该模板;不要手改其自动生成的 README。本仓库内的文件只是模板,**不表示已投稿或已收录**。社区还会检查仓库是否满一天、`dsh-plugin` topic、可安装的 `dsh.bundle` manifest 及真实可用代码。导出的 SVG 用于 DSH 界面;社区的可选 `icon` 字段要求 GitHub 托管位图,因此本模板省略该字段。
|
|
151
|
+
|
|
152
|
+
## 许可证
|
|
153
|
+
|
|
154
|
+
[MIT](<LICENSE>) © 2026 Zimin Li。所含原创 SVG 图标使用同一许可证。
|