@objectivex666/dsh-settings-search 1.12.0 → 1.13.1
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/README.en.md +9 -7
- package/README.md +9 -7
- package/lib/client.js +598 -91
- package/lib/index.js +448 -11
- package/package.json +5 -4
- package/scripts/ai.test.mjs +311 -2
- package/scripts/check.mjs +28 -0
- package/scripts/log.test.mjs +345 -0
package/README.en.md
CHANGED
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
- 🔍 **Live search** — a search box in the settings panel filters every registered settings page (`settings.section`) and general item (`settings.general.item`) as you type.
|
|
18
18
|
- 🧩 **Three search styles** — choose the classic sidebar, window top bar, or popup search page. The choice is saved in the current browser.
|
|
19
19
|
- ⌨️ **Search shortcut (v1.10.0)** — focus the search box with `Ctrl+F` or `⌘F` inside the settings panel. You can enable or disable it from the "Settings Search" page; disabling keeps the browser's default find behavior.
|
|
20
|
-
- 🤝 **Import DSH model config (v1.9.0)** — import the Base URL and model name from DSH's current default model in the AI config section. For credential safety, the API key is never imported.
|
|
20
|
+
- 🤝 **Import DSH model config (v1.9.0)** — import the Base URL and model name from DSH's current default model in the AI config section. When that default is a built-in DeepSeek route (whose settings carry no Base URL), the import uses DeepSeek's own endpoint, `https://api.deepseek.com/anthropic`. For credential safety, the API key is never imported.
|
|
21
21
|
- 🎯 **First-run onboarding (v1.9.0)** — a welcome modal appears only the first time the settings panel opens after installation. It introduces the four search styles, pinyin/intent/AI hints, click-to-jump, and auto-indexing; there are no "Don't show again" or manual reopen buttons.
|
|
22
|
-
- 📂 **In-page option search (v1.2.0)** — search beyond pages and reach the specific options inside them: Plugins-page tabs (`settings.plugins.tab`),
|
|
22
|
+
- 📂 **In-page option search (v1.2.0)** — search beyond pages and reach the specific options inside them: Plugins-page tabs (`settings.plugins.tab`), the pre-0.2 plugin-card seats (`settings.plugin.item` / `web-ui.plugin.item`, both gone in 0.2), general rows, and more, each shown with a "page › option" breadcrumb.
|
|
23
23
|
- 🔤 **Pinyin association search (v1.5.0)** — type initials (`sz`) or full pinyin (`shezhi`) to surface Chinese settings items; navigate with `↑`/`↓`, confirm with `Enter`, dismiss with `Esc`, and matched text is highlighted.
|
|
24
24
|
- 🧠 **Intent search (v1.6.0)** — describe the goal in Chinese (e.g. 「太亮了」 "too bright", 「字太小」 "text too small") to surface matching settings without knowing their names, shown in a "You may want" group.
|
|
25
25
|
- 🤖 **AI-assisted search** — when nothing matches locally, your OpenAI-compatible, Anthropic, or local Ollama model understands your search intent and suggests settings. Off by default; configure it on the plugin's settings page. Ollama needs no API key.
|
|
26
26
|
- 💾 **Persistent settings index (v1.12.0)** — the first harvested settings index is stored locally. It rebuilds only on first use or after another plugin is installed or updated, and can be rebuilt manually from the Settings Search page.
|
|
27
|
-
- 🧾 **Logging &
|
|
27
|
+
- 🧾 **Logging & viewing (v1.13.0 / v1.7.0)** — records key plugin actions, searches, and AI requests. Logs are written per local day as `$DSH_HOME/logs/dsh-settings-search/settings-search-YYYY-MM-DD.log`: one dated file per day, capped at 100 MB (the day then continues in numbered parts, `.1`, `.2`, …), with the whole folder held at 100 MB by deleting the oldest files — never the one being written. The plugin's page can **view logs**, **open the log folder**, copy, export, or clear them; the badge beside the "Logs" title counts today's file. API keys are never logged.
|
|
28
28
|
- 🧭 **Click-to-jump** — selecting a result clicks the matching left-nav entry to open its section; for tab options it also opens the tab and flashes the target row. A manual-path hint appears if automatic navigation is not possible.
|
|
29
29
|
- 🌱 **Auto-index on startup (v1.8.0)** — the first time the settings panel opens, the plugin automatically visits every settings section, silently reads in-page options (e.g. "Enable Workshop card") into the search index, then restores your current section, so all section options are searchable without having to open each page manually. A "Importing section options…" hint shows under the search box and clears when done.
|
|
30
30
|
- 🛠 **Built-in settings page (v1.4.0)** — a "Settings Search" page in the left navigation shows the current version and checks npm for a newer release on demand; when one exists it hands you a copy-ready `dsh plugin update` command.
|
|
@@ -41,7 +41,7 @@ This plugin is a standard **DSH profile bundle**: once installed it wires itself
|
|
|
41
41
|
|
|
42
42
|
### Prerequisites
|
|
43
43
|
|
|
44
|
-
- **DeepSeek Harness (DSH)** —
|
|
44
|
+
- **DeepSeek Harness (DSH)** — DSH 0.2 stable (desktop and `dsh web`) and earlier 0.1 builds; the plugin picks the API the running release offers.
|
|
45
45
|
- **Node.js** >= 18 (LTS recommended).
|
|
46
46
|
|
|
47
47
|
### From npm (recommended)
|
|
@@ -104,11 +104,12 @@ For connection failures, check the service URL. For cross-origin failures, add t
|
|
|
104
104
|
## Package layout
|
|
105
105
|
|
|
106
106
|
```
|
|
107
|
-
lib/index.js Host half (
|
|
107
|
+
lib/index.js Host half (log file + the `/api/settings-search-log` route)
|
|
108
108
|
lib/client.js Browser half (search UI, __ModuleLoader__ format)
|
|
109
109
|
cordis.patch.yml Composition patch: inserts the settings-search plugin row
|
|
110
110
|
scripts/check.mjs Structural self-checks (npm test)
|
|
111
|
-
scripts/ai.test.mjs Mock AI regression tests (no model execution)
|
|
111
|
+
scripts/ai.test.mjs Mock AI and settings-index regression tests (no model execution)
|
|
112
|
+
scripts/log.test.mjs Host log file and route regression tests (temp dirs; never your own log folder)
|
|
112
113
|
```
|
|
113
114
|
|
|
114
115
|
## Development
|
|
@@ -127,7 +128,8 @@ npm test # structural checks and mocked Ollama / OpenAI / Anthropic regression
|
|
|
127
128
|
Issues are welcome — please report bugs, suggest features, or ask questions in
|
|
128
129
|
[GitHub Issues](https://github.com/objectivex666/dsh-settings-search/issues).
|
|
129
130
|
Pull requests are equally welcome via
|
|
130
|
-
[GitHub Pull Requests](https://github.com/objectivex666/dsh-settings-search/pulls)
|
|
131
|
+
[GitHub Pull Requests](https://github.com/objectivex666/dsh-settings-search/pulls) —
|
|
132
|
+
please read [CONTRIBUTING.en.md](./CONTRIBUTING.en.md) first (layout, conventions, tests, and the release flow).
|
|
131
133
|
|
|
132
134
|
When submitting an issue, please include as much of the following as possible so we can locate and reproduce it:
|
|
133
135
|
|
package/README.md
CHANGED
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
- 🔍 **实时搜索**:在设置面板中嵌入搜索框,输入关键词立即过滤所有已注册的设置页(`settings.section`)与通用设置项(`settings.general.item`)。
|
|
18
18
|
- 🧩 **三种搜索样式**:可选择经典侧栏、窗口顶栏或弹出搜索页;选择会保存在当前浏览器。
|
|
19
19
|
- ⌨️ **搜索快捷键(v1.10.0)**:在设置面板内按 `Ctrl+F` 或 `⌘F` 聚焦搜索框;可在「设置搜索」页启用或关闭,关闭后保留浏览器默认查找。
|
|
20
|
-
- 🤝 **导入 DSH 模型配置(v1.9.0)**:在 AI 配置区一键读取 DSH 当前默认模型的 Base URL
|
|
20
|
+
- 🤝 **导入 DSH 模型配置(v1.9.0)**:在 AI 配置区一键读取 DSH 当前默认模型的 Base URL 与模型名;默认模型是 DSH 内置的 DeepSeek 路由时(设置里不含 Base URL),导入 DeepSeek 的接口地址 `https://api.deepseek.com/anthropic`。为避免凭据扩散,导入始终不包含 API Key。
|
|
21
21
|
- 🎯 **新用户引导(v1.9.0)**:仅在安装后首次打开设置面板时弹出引导弹窗,介绍四种搜索样式、拼音/意图/AI 联想、点击即达与自动导入索引等核心功能;不再提供“不再显示”和手动重开按钮。
|
|
22
|
-
- 📂 **页内选项搜索(v1.2.0)**:不只搜页面,还能直达每个设置页内部的具体选项——插件页的标签页(`settings.plugins.tab
|
|
22
|
+
- 📂 **页内选项搜索(v1.2.0)**:不只搜页面,还能直达每个设置页内部的具体选项——插件页的标签页(`settings.plugins.tab`)、旧版的插件卡片座位(`settings.plugin.item` / `web-ui.plugin.item`,0.2 已移除)、通用设置行等,结果以「页面 › 选项」面包屑展示。
|
|
23
23
|
- 🔤 **拼音联想搜索(v1.5.0)**:输入拼音首字母(如 `sz`)或全拼(如 `shezhi`)即可联想中文设置项;支持 `↑`/`↓` 选择、`Enter` 跳转、`Esc` 关闭,命中的文字自动高亮。
|
|
24
24
|
- 🧠 **意图联想搜索(v1.6.0)**:直接描述想做的事(如「太亮了」「字太小」「忘记密码」),无需知道选项名即可联想真实设置项,结果在「猜你想找」分组展示。
|
|
25
25
|
- 🤖 **AI 联想搜索**:没有本地匹配时,用你配置的 OpenAI 兼容、Anthropic 或本机 Ollama 模型理解搜索意图并推荐设置项。默认关闭,可在「设置搜索」页开启并配置;Ollama 无需 API Key。
|
|
26
26
|
- 💾 **持久设置索引(v1.12.0)**:首次采集后的设置索引保存在本机浏览器;只在首次安装、其它插件安装或更新时重建,也可在「设置搜索」页手动重建。
|
|
27
|
-
- 🧾
|
|
27
|
+
- 🧾 **日志与查看(v1.13.0 / v1.7.0)**:记录插件运行、搜索与 AI 请求的关键动作。日志按天写入 DSH 日志目录(`$DSH_HOME/logs/dsh-settings-search/settings-search-YYYY-MM-DD.log`,文件名带日期,每天一个文件);单个文件上限 100 MB,超出则同日续写编号分片(`.1`、`.2`…),整个日志目录上限 100 MB,超出时删除最旧的文件(正在写的文件永不删除)。「设置搜索」页可直接**查看日志**、**打开日志文件夹**、复制、导出或清空;「日志」标题旁的计数显示当天文件的条目数。不会记录 API Key。
|
|
28
28
|
- 🧭 **点击即达**:选中结果后自动点击对应的左侧导航项打开所在分区;若是页内标签页会继续点开对应标签,并高亮闪烁目标选项行。无法自动跳转时显示手动路径提示。
|
|
29
29
|
- 🌱 **启动自动索引(v1.8.0)**:首次打开设置面板时自动遍历各设置分区,静默读取分区内选项(如「启用创意工坊卡片」)并导入搜索索引;此后分区选项无需逐页手动打开即可直接搜索,读取完成后自动恢复当前所在分区,导入过程搜索框下方会显示提示,完成后自动消失。
|
|
30
30
|
- 🛠 **自带设置页(v1.4.0)**:左侧导航新增「设置搜索」页——展示当前版本,一键检查 npm 注册表上的最新版本;有更新时直接给出复制就用的 `dsh plugin update` 命令。
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
|
|
43
43
|
### 前置要求
|
|
44
44
|
|
|
45
|
-
- **DeepSeek Harness (DSH)
|
|
45
|
+
- **DeepSeek Harness (DSH)**:DSH 0.2 正式版(桌面版与 `dsh web`)以及更早的 0.1 版本;本插件会按运行中的版本自动选择对应接口。
|
|
46
46
|
- **Node.js** >= 18(推荐 LTS)。
|
|
47
47
|
|
|
48
48
|
### 通过 npm 安装(推荐)
|
|
@@ -105,11 +105,12 @@ dsh plugin --profile web add /path/to/dsh-settings-search
|
|
|
105
105
|
## 包结构
|
|
106
106
|
|
|
107
107
|
```
|
|
108
|
-
lib/index.js Host half
|
|
108
|
+
lib/index.js Host half(日志文件 + `/api/settings-search-log` 路由)
|
|
109
109
|
lib/client.js Browser half(搜索框 UI,__ModuleLoader__ 格式)
|
|
110
110
|
cordis.patch.yml 组合补丁:插入 settings-search 插件行
|
|
111
111
|
scripts/check.mjs 结构自检(npm test)
|
|
112
|
-
scripts/ai.test.mjs AI
|
|
112
|
+
scripts/ai.test.mjs AI 接口与设置索引回归测试(模拟请求,不运行模型)
|
|
113
|
+
scripts/log.test.mjs 宿主日志文件与路由回归测试(临时目录,不写用户目录)
|
|
113
114
|
```
|
|
114
115
|
|
|
115
116
|
## 开发
|
|
@@ -126,7 +127,8 @@ npm test # 结构检查及 Ollama / OpenAI / Anthropic 模拟接口回归测
|
|
|
126
127
|
|
|
127
128
|
欢迎提交 **Issue** 反馈 Bug、功能建议或使用疑问:
|
|
128
129
|
[GitHub Issues](https://github.com/objectivex666/dsh-settings-search/issues),
|
|
129
|
-
也欢迎直接发起 [Pull Request](https://github.com/objectivex666/dsh-settings-search/pulls)
|
|
130
|
+
也欢迎直接发起 [Pull Request](https://github.com/objectivex666/dsh-settings-search/pulls)——
|
|
131
|
+
动手前请先读一遍 [贡献指南](./CONTRIBUTING.md)(结构、代码约定、测试与发布流程)。
|
|
130
132
|
|
|
131
133
|
提交 Issue 时,请尽量完整地提供以下信息,便于定位与复现:
|
|
132
134
|
|