@objectivex666/dsh-settings-search 1.10.0 → 1.12.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 +20 -2
- package/README.md +19 -2
- package/lib/client.js +641 -166
- package/package.json +2 -2
- package/scripts/ai.test.mjs +379 -0
package/README.en.md
CHANGED
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
- 📂 **In-page option search (v1.2.0)** — search beyond pages and reach the specific options inside them: Plugins-page tabs (`settings.plugins.tab`), Web UI plugin cards (`web-ui.plugin.item`), 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
|
-
- 🤖 **AI-assisted search
|
|
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
|
+
- 💾 **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.
|
|
26
27
|
- 🧾 **Logging & export (v1.7.0)** — records key plugin actions, searches, and AI requests; export, copy, or clear them from the plugin's settings page for troubleshooting. 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.
|
|
@@ -84,6 +85,22 @@ The package ships its own `cordis.patch.yml` (that exact content), which `dsh pl
|
|
|
84
85
|
|
|
85
86
|
---
|
|
86
87
|
|
|
88
|
+
## Local Ollama (v1.11.0)
|
|
89
|
+
|
|
90
|
+
Enable "AI-assisted search" on the Settings Search page and select "Ollama (local)" as the API type:
|
|
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`.
|
|
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.
|
|
94
|
+
- **API key**: not required. Ollama requests never send an existing cloud API key.
|
|
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.
|
|
97
|
+
|
|
98
|
+
The plugin does not install or start Ollama, or download models. Prepare a running Ollama service and model yourself. Requests originate in the browser, so "local" means the browser's device, not a remote DSH server.
|
|
99
|
+
|
|
100
|
+
For connection failures, check the service URL. For cross-origin failures, add the exact DSH page origin (for example `http://127.0.0.1:3080`) to Ollama's `OLLAMA_ORIGINS` and restart Ollama. Avoid unnecessary wildcard origins. Non-local URLs still require HTTPS.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
87
104
|
## Package layout
|
|
88
105
|
|
|
89
106
|
```
|
|
@@ -91,12 +108,13 @@ lib/index.js Host half (no-op — makes the package a valid Cordis plugin
|
|
|
91
108
|
lib/client.js Browser half (search UI, __ModuleLoader__ format)
|
|
92
109
|
cordis.patch.yml Composition patch: inserts the settings-search plugin row
|
|
93
110
|
scripts/check.mjs Structural self-checks (npm test)
|
|
111
|
+
scripts/ai.test.mjs Mock AI regression tests (no model execution)
|
|
94
112
|
```
|
|
95
113
|
|
|
96
114
|
## Development
|
|
97
115
|
|
|
98
116
|
```bash
|
|
99
|
-
npm test #
|
|
117
|
+
npm test # structural checks and mocked Ollama / OpenAI / Anthropic regression tests
|
|
100
118
|
```
|
|
101
119
|
|
|
102
120
|
> Historical note: up to v1.1 the repo shipped `dsh-settings-search.js` (an
|
package/README.md
CHANGED
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
- 📂 **页内选项搜索(v1.2.0)**:不只搜页面,还能直达每个设置页内部的具体选项——插件页的标签页(`settings.plugins.tab`)、Web UI 插件的卡片(`web-ui.plugin.item`)、通用设置行等,结果以「页面 › 选项」面包屑展示。
|
|
23
23
|
- 🔤 **拼音联想搜索(v1.5.0)**:输入拼音首字母(如 `sz`)或全拼(如 `shezhi`)即可联想中文设置项;支持 `↑`/`↓` 选择、`Enter` 跳转、`Esc` 关闭,命中的文字自动高亮。
|
|
24
24
|
- 🧠 **意图联想搜索(v1.6.0)**:直接描述想做的事(如「太亮了」「字太小」「忘记密码」),无需知道选项名即可联想真实设置项,结果在「猜你想找」分组展示。
|
|
25
|
-
- 🤖 **AI
|
|
25
|
+
- 🤖 **AI 联想搜索**:没有本地匹配时,用你配置的 OpenAI 兼容、Anthropic 或本机 Ollama 模型理解搜索意图并推荐设置项。默认关闭,可在「设置搜索」页开启并配置;Ollama 无需 API Key。
|
|
26
|
+
- 💾 **持久设置索引(v1.12.0)**:首次采集后的设置索引保存在本机浏览器;只在首次安装、其它插件安装或更新时重建,也可在「设置搜索」页手动重建。
|
|
26
27
|
- 🧾 **日志与导出(v1.7.0)**:记录插件运行、搜索与 AI 请求的关键动作,可在「设置搜索」页一键导出、复制或清空,便于排查问题。不会记录 API Key。
|
|
27
28
|
- 🧭 **点击即达**:选中结果后自动点击对应的左侧导航项打开所在分区;若是页内标签页会继续点开对应标签,并高亮闪烁目标选项行。无法自动跳转时显示手动路径提示。
|
|
28
29
|
- 🌱 **启动自动索引(v1.8.0)**:首次打开设置面板时自动遍历各设置分区,静默读取分区内选项(如「启用创意工坊卡片」)并导入搜索索引;此后分区选项无需逐页手动打开即可直接搜索,读取完成后自动恢复当前所在分区,导入过程搜索框下方会显示提示,完成后自动消失。
|
|
@@ -84,6 +85,21 @@ dsh plugin --profile web add /path/to/dsh-settings-search
|
|
|
84
85
|
|
|
85
86
|
---
|
|
86
87
|
|
|
88
|
+
## 本机 Ollama(v1.11.0)
|
|
89
|
+
|
|
90
|
+
在「设置搜索」页开启「AI 联想搜索」,将「接口类型」选为「Ollama(本机)」:
|
|
91
|
+
|
|
92
|
+
- **Base URL**:默认 `http://127.0.0.1:11434`,也可填写自定义端口;支持根地址、`/api`、`/api/chat` 和 `/v1`。
|
|
93
|
+
- **模型名**:点「获取模型」从服务返回的模型中选择,或手动输入完整模型名(包括标签),可用 `ollama list` 查看。
|
|
94
|
+
- **API Key**:无需填写,Ollama 请求不会携带原有云端密钥。
|
|
95
|
+
|
|
96
|
+
保存后可用「测试接口」检查连接。本地模型首次加载可能较慢,Ollama 请求的超时时间为 120 秒;取消搜索会中止请求。
|
|
97
|
+
|
|
98
|
+
插件不会安装或启动 Ollama,也不会下载模型。使用时需自行准备已运行的 Ollama 服务和模型。请求由浏览器发出,因此「本机」指浏览器所在设备,而非远程 DSH 服务器。
|
|
99
|
+
|
|
100
|
+
连接被拒绝时检查服务地址;跨域访问失败时,将当前 DSH 页面的确切来源(如 `http://127.0.0.1:3080`)加入 Ollama 的 `OLLAMA_ORIGINS`,并重启 Ollama。不要使用不必要的通配符来源。非本机地址仍要求 HTTPS。
|
|
101
|
+
|
|
102
|
+
---
|
|
87
103
|
|
|
88
104
|
|
|
89
105
|
## 包结构
|
|
@@ -93,12 +109,13 @@ lib/index.js Host half(空实现,保证作为合法 Cordis 插件行
|
|
|
93
109
|
lib/client.js Browser half(搜索框 UI,__ModuleLoader__ 格式)
|
|
94
110
|
cordis.patch.yml 组合补丁:插入 settings-search 插件行
|
|
95
111
|
scripts/check.mjs 结构自检(npm test)
|
|
112
|
+
scripts/ai.test.mjs AI 接口回归测试(模拟请求,不运行模型)
|
|
96
113
|
```
|
|
97
114
|
|
|
98
115
|
## 开发
|
|
99
116
|
|
|
100
117
|
```bash
|
|
101
|
-
npm test #
|
|
118
|
+
npm test # 结构检查及 Ollama / OpenAI / Anthropic 模拟接口回归测试
|
|
102
119
|
```
|
|
103
120
|
|
|
104
121
|
> 历史说明:v1.1 及之前仓库曾附带 `dsh-settings-search.js`(会话内
|