@objectivex666/dsh-settings-search 1.11.0 → 1.13.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/README.en.md +8 -6
- package/README.md +8 -6
- package/lib/client.js +970 -95
- package/lib/index.js +448 -11
- package/package.json +5 -4
- package/scripts/ai.test.mjs +390 -5
- package/scripts/check.mjs +28 -0
- package/scripts/log.test.mjs +345 -0
package/README.en.md
CHANGED
|
@@ -19,11 +19,12 @@
|
|
|
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
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.
|
|
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 & 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.
|
|
27
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.
|
|
28
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.
|
|
29
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.
|
|
@@ -40,7 +41,7 @@ This plugin is a standard **DSH profile bundle**: once installed it wires itself
|
|
|
40
41
|
|
|
41
42
|
### Prerequisites
|
|
42
43
|
|
|
43
|
-
- **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.
|
|
44
45
|
- **Node.js** >= 18 (LTS recommended).
|
|
45
46
|
|
|
46
47
|
### From npm (recommended)
|
|
@@ -89,7 +90,7 @@ The package ships its own `cordis.patch.yml` (that exact content), which `dsh pl
|
|
|
89
90
|
Enable "AI-assisted search" on the Settings Search page and select "Ollama (local)" as the API type:
|
|
90
91
|
|
|
91
92
|
- **Base URL**: defaults to `http://127.0.0.1:11434`; custom ports are supported. Accepts the root URL, `/api`, `/api/chat`, or `/v1`.
|
|
92
|
-
- **Model**: enter the full name, including its tag, of an installed model. Use `ollama list` to see installed models.
|
|
93
|
+
- **Model**: choose one returned by "Get models", or enter the full name, including its tag, of an installed model. Use `ollama list` to see installed models.
|
|
93
94
|
- **API key**: not required. Ollama requests never send an existing cloud API key.
|
|
94
95
|
|
|
95
96
|
Save the configuration and use "Test API" to check connectivity. Ollama requests allow 120 seconds for cold starts; cancelling a search aborts the request.
|
|
@@ -103,11 +104,12 @@ For connection failures, check the service URL. For cross-origin failures, add t
|
|
|
103
104
|
## Package layout
|
|
104
105
|
|
|
105
106
|
```
|
|
106
|
-
lib/index.js Host half (
|
|
107
|
+
lib/index.js Host half (log file + the `/api/settings-search-log` route)
|
|
107
108
|
lib/client.js Browser half (search UI, __ModuleLoader__ format)
|
|
108
109
|
cordis.patch.yml Composition patch: inserts the settings-search plugin row
|
|
109
110
|
scripts/check.mjs Structural self-checks (npm test)
|
|
110
|
-
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)
|
|
111
113
|
```
|
|
112
114
|
|
|
113
115
|
## Development
|
package/README.md
CHANGED
|
@@ -19,11 +19,12 @@
|
|
|
19
19
|
- ⌨️ **搜索快捷键(v1.10.0)**:在设置面板内按 `Ctrl+F` 或 `⌘F` 聚焦搜索框;可在「设置搜索」页启用或关闭,关闭后保留浏览器默认查找。
|
|
20
20
|
- 🤝 **导入 DSH 模型配置(v1.9.0)**:在 AI 配置区一键读取 DSH 当前默认模型的 Base URL 与模型名;为避免凭据扩散,导入始终不包含 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
|
+
- 🧾 **日志与查看(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。
|
|
27
28
|
- 🧭 **点击即达**:选中结果后自动点击对应的左侧导航项打开所在分区;若是页内标签页会继续点开对应标签,并高亮闪烁目标选项行。无法自动跳转时显示手动路径提示。
|
|
28
29
|
- 🌱 **启动自动索引(v1.8.0)**:首次打开设置面板时自动遍历各设置分区,静默读取分区内选项(如「启用创意工坊卡片」)并导入搜索索引;此后分区选项无需逐页手动打开即可直接搜索,读取完成后自动恢复当前所在分区,导入过程搜索框下方会显示提示,完成后自动消失。
|
|
29
30
|
- 🛠 **自带设置页(v1.4.0)**:左侧导航新增「设置搜索」页——展示当前版本,一键检查 npm 注册表上的最新版本;有更新时直接给出复制就用的 `dsh plugin update` 命令。
|
|
@@ -41,7 +42,7 @@
|
|
|
41
42
|
|
|
42
43
|
### 前置要求
|
|
43
44
|
|
|
44
|
-
- **DeepSeek Harness (DSH)
|
|
45
|
+
- **DeepSeek Harness (DSH)**:DSH 0.2 正式版(桌面版与 `dsh web`)以及更早的 0.1 版本;本插件会按运行中的版本自动选择对应接口。
|
|
45
46
|
- **Node.js** >= 18(推荐 LTS)。
|
|
46
47
|
|
|
47
48
|
### 通过 npm 安装(推荐)
|
|
@@ -89,7 +90,7 @@ dsh plugin --profile web add /path/to/dsh-settings-search
|
|
|
89
90
|
在「设置搜索」页开启「AI 联想搜索」,将「接口类型」选为「Ollama(本机)」:
|
|
90
91
|
|
|
91
92
|
- **Base URL**:默认 `http://127.0.0.1:11434`,也可填写自定义端口;支持根地址、`/api`、`/api/chat` 和 `/v1`。
|
|
92
|
-
-
|
|
93
|
+
- **模型名**:点「获取模型」从服务返回的模型中选择,或手动输入完整模型名(包括标签),可用 `ollama list` 查看。
|
|
93
94
|
- **API Key**:无需填写,Ollama 请求不会携带原有云端密钥。
|
|
94
95
|
|
|
95
96
|
保存后可用「测试接口」检查连接。本地模型首次加载可能较慢,Ollama 请求的超时时间为 120 秒;取消搜索会中止请求。
|
|
@@ -104,11 +105,12 @@ dsh plugin --profile web add /path/to/dsh-settings-search
|
|
|
104
105
|
## 包结构
|
|
105
106
|
|
|
106
107
|
```
|
|
107
|
-
lib/index.js Host half
|
|
108
|
+
lib/index.js Host half(日志文件 + `/api/settings-search-log` 路由)
|
|
108
109
|
lib/client.js Browser half(搜索框 UI,__ModuleLoader__ 格式)
|
|
109
110
|
cordis.patch.yml 组合补丁:插入 settings-search 插件行
|
|
110
111
|
scripts/check.mjs 结构自检(npm test)
|
|
111
|
-
scripts/ai.test.mjs AI
|
|
112
|
+
scripts/ai.test.mjs AI 接口与设置索引回归测试(模拟请求,不运行模型)
|
|
113
|
+
scripts/log.test.mjs 宿主日志文件与路由回归测试(临时目录,不写用户目录)
|
|
112
114
|
```
|
|
113
115
|
|
|
114
116
|
## 开发
|