@nite07/dsh-search 0.1.1 → 0.1.3
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.md +24 -7
- package/README.zh.md +24 -7
- package/dist/client.js +78 -37
- package/dist/index.js +1573 -54
- package/dist/index.js.map +4 -4
- package/docs/BACKENDS.md +80 -0
- package/docs/VERIFICATION.md +11 -0
- package/locale/en.json +18 -7
- package/locale/zh.json +18 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
English | [中文](README.zh.md)
|
|
4
4
|
|
|
5
|
-
Multi-backend web search for DeepSeek Harness:
|
|
5
|
+
Multi-backend web search for DeepSeek Harness: 23 search providers you turn on one by one, each with an explicit access mode and a visible cost tier.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -18,20 +18,33 @@ Then make it the search source: open **Settings → Web search**. If the page sa
|
|
|
18
18
|
## Quick start
|
|
19
19
|
|
|
20
20
|
1. Open **Settings → Web search**.
|
|
21
|
-
2. In the **Backends** tab, pick the providers you want, choose
|
|
21
|
+
2. In the **Backends** tab, pick the providers you want, choose the access mode for each, and check the cost line before enabling.
|
|
22
22
|
3. Press **Save settings**. Every backend starts disabled, so nothing is called until you save.
|
|
23
23
|
|
|
24
24
|
The **Test & diagnostics** tab runs one explicit search against a saved backend and shows the exact request outcome.
|
|
25
25
|
|
|
26
26
|
## Backends and cost
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
The list is grouped by the cheapest path a backend offers, so anything with a free option always leads. Each row carries a chip per access mode with that mode's own tier, and the selected one is highlighted.
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
| Group | Backends | Notes |
|
|
31
|
+
| --- | --- | --- |
|
|
32
|
+
| **Free path available** | Keenable, AnySearch, Exa, Parallel, You.com, DuckDuckGo, Reddit | No signup, no key, works immediately |
|
|
33
|
+
| **Own account** | X | Your own X browser cookies: no fee, but it breaks when X changes its request signing |
|
|
34
|
+
| **Self-hosted** | SearXNG, open-websearch | You run the service and set your own limits |
|
|
35
|
+
| **Free allowance** | Linkup, Tavily, Brave, Zhihu (web and site), Baidu, Doubao | Sign up for a key, free within the quota |
|
|
36
|
+
| **Trial credits** | Serpex | One-off trial credits, then paid |
|
|
37
|
+
| **Paid** | Mojeek, Anthropic, OpenAI, DeepSeek, Tencent WSA | Billed per use; check the price before enabling |
|
|
33
38
|
|
|
34
|
-
|
|
39
|
+
- Every backend is **disabled by default**; nothing is enabled automatically.
|
|
40
|
+
- Per-backend quotas, prices, sources and the date they were checked: [docs/BACKENDS.md](docs/BACKENDS.md).
|
|
41
|
+
|
|
42
|
+
## Tools
|
|
43
|
+
|
|
44
|
+
- `web_search` — the backend fan-out described above.
|
|
45
|
+
- `web_search_plus` — search with a strategy for this call only: (can be switched off in settings, which stops registering it) `mode` (single or parallel), `backends` (a subset of the enabled ones), `allBackends` + `exclude` (everything except a few, cheaper to write than listing ids), `compact` (links and titles only, no snippets, which is the biggest lever on result size; can be made the default in settings) and `maxResults`. Saved configuration is untouched, a backend that is not enabled is reported rather than silently dropped, and the result names the backends that actually ran.
|
|
46
|
+
- `reddit_thread` — read one Reddit post with its comment tree, so a model can quote the discussion instead of guessing. Capped by depth, comment count and character budget.
|
|
47
|
+
- `search_manage` — inspect or change this plugin's settings from the agent side.
|
|
35
48
|
|
|
36
49
|
## Development
|
|
37
50
|
|
|
@@ -45,3 +58,7 @@ Design notes: [docs/PLAN.md](docs/PLAN.md). Verification status: [docs/VERIFICAT
|
|
|
45
58
|
## License
|
|
46
59
|
|
|
47
60
|
MIT.
|
|
61
|
+
|
|
62
|
+
## Friends
|
|
63
|
+
|
|
64
|
+
- [LINUX DO](https://linux.do) — the community where this plugin's backend survey started.
|
package/README.zh.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[English](README.md) | 中文
|
|
4
4
|
|
|
5
|
-
给 DeepSeek Harness 用的多后端网页搜索:
|
|
5
|
+
给 DeepSeek Harness 用的多后端网页搜索:23 家搜索服务,逐个开关,每个都明确选定接入模式、标明费用档。
|
|
6
6
|
|
|
7
7
|
## 安装
|
|
8
8
|
|
|
@@ -18,20 +18,33 @@ dsh --profile web # 或者用你自己的方式重启 dsh web
|
|
|
18
18
|
## 快速开始
|
|
19
19
|
|
|
20
20
|
1. 打开 **设置 → 网页搜索**
|
|
21
|
-
2.
|
|
21
|
+
2. 在「搜索后端」页签里挑后端,逐家选择接入模式(匿名、Key、OAuth、会话等),先看费用说明再启用
|
|
22
22
|
3. 点「保存设置」。所有后端默认关闭,不保存就一个请求都不会发出
|
|
23
23
|
|
|
24
24
|
想先验一下某家通不通,用「试搜与诊断」页签:它会明确发一次搜索,并把结果和失败原因原样显示出来。
|
|
25
25
|
|
|
26
26
|
## 后端与费用
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
列表按**每家最便宜的用法**分组,所以有完全免费路径的永远排在最前面。每行用 chip 标出**所有**模式各自的费用档,当前选中的那个高亮。
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
| 分组 | 有哪些 | 说明 |
|
|
31
|
+
| --- | --- | --- |
|
|
32
|
+
| **有完全免费的用法** | Keenable、AnySearch、Exa、Parallel、You.com、DuckDuckGo、Reddit | 不用注册、不用 Key,开箱可用 |
|
|
33
|
+
| **自带账号** | X | 用你自己 X 网页端的 cookie,不花钱,但 X 改动请求签名时会失效 |
|
|
34
|
+
| **自托管** | SearXNG、open-websearch | 自己跑服务,额度由你自己定 |
|
|
35
|
+
| **免费额度** | Linkup、Tavily、Brave、知乎(网页/站内)、百度、豆包 | 注册拿 Key,额度内免费 |
|
|
36
|
+
| **试用额度** | Serpex | 一次性试用额度,用完转付费 |
|
|
37
|
+
| **付费** | Mojeek、Anthropic、OpenAI、DeepSeek、腾讯 WSA | 按量收费,开之前先看单价 |
|
|
33
38
|
|
|
34
|
-
|
|
39
|
+
- 默认**全部关闭**,一个都不会自动启用
|
|
40
|
+
- 各家的具体额度、单价、来源链接和核实日期见 [docs/BACKENDS.md](docs/BACKENDS.md)
|
|
41
|
+
|
|
42
|
+
## 工具
|
|
43
|
+
|
|
44
|
+
- `web_search` — 上面说的多后端搜索。
|
|
45
|
+
- `web_search_plus` — 按本次调用指定搜索策略:(可在设置里关闭:关闭后不注册该工具)`mode`(单后端/并行)、`backends`(从已启用里挑子集)、`allBackends` + `exclude`(全用但排掉几家,比列 id 省字符)、`compact`(只回标题和链接,丢掉摘要,省结果 token;可在设置里设为默认)、`maxResults`。只影响这一次调用,不改配置;没启用的后端会被明确告知而不是被悄悄忽略,实际用了哪些也会回显。
|
|
46
|
+
- `reddit_thread` — 读某个 Reddit 帖子的完整评论树,让模型能引用真实讨论而不是猜;按深度、评论条数和字符预算截断。
|
|
47
|
+
- `search_manage` — 从 agent 侧查看或修改本插件自己的设置。
|
|
35
48
|
|
|
36
49
|
## 开发
|
|
37
50
|
|
|
@@ -45,3 +58,7 @@ npm run check
|
|
|
45
58
|
## 许可
|
|
46
59
|
|
|
47
60
|
MIT。
|
|
61
|
+
|
|
62
|
+
## 友链
|
|
63
|
+
|
|
64
|
+
- [LINUX DO](https://linux.do) — 这个插件的后端调研起步于这个社区。
|
package/dist/client.js
CHANGED
|
@@ -29,7 +29,7 @@ var NiteSearchClient = (() => {
|
|
|
29
29
|
var client_default = ".ns-page{max-width:1120px;margin:0 auto;padding:24px;color:var(--dsw-alias-label-primary);font:inherit;line-height:1.55;overflow-wrap:anywhere}.ns-page *{box-sizing:border-box}.ns-page h2,.ns-page h3,.ns-page h4,.ns-page h5,.ns-page p{margin:0 0 12px}.ns-page h2{font-size:24px;line-height:1.3}.ns-page h3{font-size:17px}.ns-page h4{font-size:15px}.ns-page h5{font-size:14px}.ns-header{display:flex;justify-content:space-between;align-items:flex-start;gap:24px;margin-bottom:16px}.ns-header p,.ns-muted,.ns-page small{color:var(--dsw-alias-label-secondary)}.ns-eyebrow{font-size:12px;font-weight:600;letter-spacing:.08em}.ns-card{margin:16px 0;padding:20px;border:1px solid var(--dsw-alias-border-l1);border-radius:12px;background:var(--dsw-alias-bg-layer-1)}.ns-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 24px}.ns-field{display:flex;min-width:0;flex-direction:column;gap:6px}.ns-field label,.ns-credential label{font-size:13px;font-weight:600}.ns-field small{font-size:12px;line-height:1.5}.ns-page input:not([type=checkbox]),.ns-page select,.ns-page textarea{width:100%;min-height:40px;padding:8px 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px}.ns-page textarea{resize:vertical}.ns-check{display:grid;grid-template-columns:1fr auto;align-content:start;align-items:center}.ns-check small{grid-column:1/-1}.ns-page input[type=checkbox]{width:18px;height:18px;accent-color:var(--dsw-alias-brand-primary)}.ns-page button{min-height:40px;padding:8px 14px;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;cursor:pointer}.ns-page button:hover:not(:disabled){border-color:var(--dsw-alias-brand-primary)}.ns-page button:disabled,.ns-page input:disabled,.ns-page select:disabled{opacity:.55;cursor:not-allowed}.ns-page :is(button,input,select,textarea,a,summary):focus-visible,.ns-summary:focus{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:3px;scroll-margin-block:100px}.ns-page a{color:var(--dsw-alias-brand-primary);text-underline-offset:3px}.ns-status{display:flex;justify-content:space-between;gap:12px;min-height:44px;padding:10px 14px;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);border-radius:8px;font-size:13px}.ns-summary{margin:16px 0;padding:16px;border:1px solid var(--dsw-alias-state-error-primary);border-radius:8px}.ns-summary h3{margin:0}.ns-summary ul{padding-left:20px}.ns-error{color:var(--dsw-alias-state-error-primary)!important}.ns-success{color:var(--dsw-alias-state-success-primary)}.ns-warning{color:var(--dsw-alias-state-warn-primary)}.ns-backends{margin-top:28px}.ns-tier{margin-top:24px}.ns-tier>h4{color:var(--dsw-alias-label-secondary)}.ns-backend{padding:0}.ns-backend > summary{display:flex;gap:16px;align-items:center;justify-content:space-between;padding:16px 20px;cursor:pointer;list-style:revert;font-weight:600}.ns-backend > summary::before{content:'\u203A';font-size:20px}.ns-backend[open] > summary::before{transform:rotate(90deg)}.ns-backend summary>span:first-of-type{flex:1}.ns-badge{padding:3px 8px;border:1px solid var(--dsw-alias-border-l1);border-radius:5px;font-size:11px;font-weight:500;color:var(--dsw-alias-label-secondary)}.ns-backend-body{padding:0 20px 20px}.ns-quota{padding:12px;background:var(--dsw-alias-bg-layer-2);border-radius:6px;font-size:12px}.ns-credential{margin:20px 0;padding-top:16px;border-top:1px solid var(--dsw-alias-border-l1)}.ns-credential p{font-size:12px;color:var(--dsw-alias-label-secondary)}.ns-credential input{margin:6px 0 12px}.ns-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.ns-table-wrap{overflow:auto;margin-top:16px}.ns-page table{width:100%;border-collapse:collapse;font-size:12px;text-align:left}.ns-page th,.ns-page td{padding:10px;border-bottom:1px solid var(--dsw-alias-border-l1);white-space:nowrap}.ns-page th{color:var(--dsw-alias-label-secondary);font-weight:500}.ns-result pre{max-height:320px;overflow:auto;padding:12px;background:var(--dsw-alias-bg-base);border:1px solid var(--dsw-alias-border-l1);white-space:pre-wrap;font-size:12px}.ns-footer{position:sticky;bottom:0;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px;margin-top:24px;border:1px solid var(--dsw-alias-border-l2);border-radius:10px;background:var(--dsw-alias-bg-layer-1);font-size:12px}.ns-page .ns-primary{border-color:var(--dsw-alias-brand-primary);color:var(--dsw-alias-brand-primary);font-weight:600}.ns-page [aria-invalid=true]{border-color:var(--dsw-alias-state-error-primary)!important}.ns-card>.ns-field{margin-top:16px}@media(max-width:640px){.ns-page{padding:16px 12px}.ns-header{gap:12px}.ns-grid{grid-template-columns:1fr;gap:16px}.ns-card{padding:16px}.ns-backend{padding:0}.ns-backend-body{padding:0 16px 16px}.ns-backend > summary{padding:16px}.ns-footer{position:static;align-items:flex-start;flex-direction:column}.ns-header h2{font-size:21px}}@media(prefers-reduced-motion:reduce){.ns-page *{scroll-behavior:auto!important;transition:none!important}}\n";
|
|
30
30
|
|
|
31
31
|
// src/client.overrides.css
|
|
32
|
-
var client_overrides_default = '.ns-backends:focus{outline:none}.ns-backends h3{display:flex;flex-wrap:wrap;gap:8px;align-items:baseline}\n.ns-toolbar{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:16px;margin:12px 0 4px}\n.ns-backend > summary{display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer;list-style:none;min-height:28px}\n.ns-backend > summary::-webkit-details-marker{display:none}\n.ns-backend > summary::before{content:"\u25B8";color:var(--dsw-alias-label-secondary);font-size:11px}\n.ns-backend[open] > summary::before{content:"\u25BE"}\n.ns-backend-title{flex:1 1 auto;font-weight:600;font-size:14px}\n.ns-chips{display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end}\n.ns-chip{font-size:11px;line-height:1;padding:4px 7px;border-radius:999px;border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-secondary);white-space:nowrap}\n.ns-chip--ok{border-color:var(--dsw-alias-state-success-primary);color:var(--dsw-alias-state-success-primary)}\n.ns-chip--warn{border-color:var(--dsw-alias-state-warn-primary);color:var(--dsw-alias-state-warn-primary)}\n.ns-chip--risk{border-color:var(--dsw-alias-state-error-primary);color:var(--dsw-alias-state-error-primary)}\n.ns-chip--off{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-state-idle-primary)}\n.ns-dot{width:8px;height:8px;border-radius:50%;flex:0 0 auto}\n.ns-dot.is-on{background:var(--dsw-alias-state-success-primary)}\n.ns-dot.is-off{background:var(--dsw-alias-state-idle-primary);opacity:.6}\n.ns-badge.is-on{border-color:var(--dsw-alias-brand-primary);color:var(--dsw-alias-brand-primary)}\n.ns-advanced{margin:12px 0;border-top:1px solid var(--dsw-alias-border-l1);padding-top:10px}\n.ns-advanced summary{cursor:pointer;font-size:13px;font-weight:600;color:var(--dsw-alias-label-secondary);margin-bottom:10px}\n.ns-blockers{margin:16px 0;padding:16px 20px;border:1px solid var(--dsw-alias-state-warn-primary);border-radius:12px;background:var(--dsw-alias-bg-layer-1)}\n.ns-blockers h3{font-size:14px;margin-bottom:8px;color:var(--dsw-alias-state-warn-primary)}\n.ns-blockers ul{margin:0;padding-left:18px}\n.ns-blockers li{margin:4px 0}\n.ns-statuses{display:flex;flex-wrap:wrap;gap:8px 16px}\n.ns-status-choice{display:inline-flex;align-items:center;gap:6px;font-size:13px;padding:6px 4px;cursor:pointer}\n.ns-status-choice input{width:18px;height:18px;accent-color:var(--dsw-alias-brand-primary)}\n.ns-sources{margin:8px 0;padding-left:20px}\n.ns-sources li{margin:10px 0}\n.ns-sources p{margin:2px 0;font-size:12px}\n.ns-failure{margin-top:12px;padding:12px 14px;border:1px solid var(--dsw-alias-state-error-primary);border-radius:8px}\n.ns-failure h5{color:var(--dsw-alias-state-error-primary)}\n.ns-failure dl{display:grid;grid-template-columns:auto minmax(0,1fr);gap:4px 14px;margin:0;font-size:12px}\n.ns-failure dt{color:var(--dsw-alias-label-secondary)}\n.ns-failure dd{margin:0;overflow-wrap:anywhere}\n.ns-confirm{margin:10px 0;padding:12px 14px;border:1px solid var(--dsw-alias-state-error-primary);border-radius:8px;background:var(--dsw-alias-bg-layer-2)}\n.ns-confirm p{margin:0 0 10px;font-size:13px}\n.ns-danger{border-color:var(--dsw-alias-state-error-primary)!important;color:var(--dsw-alias-state-error-primary)}\n.ns-link{background:none;border:none;padding:0;margin-left:6px;min-height:0;font-size:12px;color:var(--dsw-alias-brand-primary);text-decoration:underline;cursor:pointer}\n.ns-link:hover{background:none;border:none}\n.ns-cell-message{max-width:320px;overflow-wrap:anywhere;font-size:12px;color:var(--dsw-alias-label-secondary)}\n.ns-footer{position:sticky;bottom:0;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin:16px -4px 0;padding:12px 16px;border:1px solid var(--dsw-alias-border-l1);border-radius:12px;background:var(--dsw-alias-bg-layer-1);box-shadow:0 -2px 12px rgba(0,0,0,.06)}\n.ns-footer>span{font-size:13px;color:var(--dsw-alias-label-secondary)}\n@media (max-width:720px){.ns-toolbar{grid-template-columns:minmax(0,1fr)}.ns-chips{justify-content:flex-start}.ns-footer>span{width:100%}}\n\n.ns-advanced summary{display:inline-flex;align-items:center;gap:6px;width:auto;min-height:32px;padding:0 2px;color:var(--dsw-alias-brand-primary);font-weight:600}\n.ns-advanced summary::marker{font-size:10px}\n.ns-advanced[open] summary{margin-bottom:12px}\n.ns-tabs{display:flex;flex-wrap:wrap;gap:4px;margin:18px 0 14px;padding:4px;border:1px solid var(--dsw-alias-border-l1);border-radius:10px;background:var(--dsw-alias-bg-layer-1)}\n.ns-tab{display:inline-flex;align-items:center;gap:8px;min-height:36px;padding:6px 14px;border:1px solid transparent;border-radius:7px;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:13px;cursor:pointer}\n.ns-tab:hover:not(.is-active){background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary)}\n.ns-tab.is-active{border-color:var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-primary);font-weight:600}\n.ns-tab-count{font-size:11px;font-weight:600;padding:2px 6px;border-radius:999px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary)}\n[role=tabpanel]{outline:none}\n.ns-test-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:16px}\n.ns-test-actions small{color:var(--dsw-alias-label-secondary)}\n@media (max-width:720px){.ns-tabs{gap:2px}.ns-tab{padding:6px 10px}}\n.ns-header{margin-bottom:8px}\n\n.ns-backend-body{padding:0 20px 20px}\n.ns-backend-body .ns-muted{font-size:12.5px;line-height:1.6;margin:10px 0}\n.ns-meta{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px;margin:14px 0 0;padding-top:12px;border-top:1px solid var(--dsw-alias-border-l1);font-size:12px;line-height:1.5;color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums}\n.ns-meta strong{font-weight:600;color:var(--dsw-alias-label-primary)}\n.ns-blockers--info{border-color:var(--dsw-alias-border-l2)}.ns-blockers--info h3{color:var(--dsw-alias-label-primary)}\n';
|
|
32
|
+
var client_overrides_default = '.ns-backends:focus{outline:none}.ns-backends h3{display:flex;flex-wrap:wrap;gap:8px;align-items:baseline}\n.ns-toolbar{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:16px;margin:12px 0 4px}\n.ns-backend > summary{display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer;list-style:none;min-height:28px}\n.ns-backend > summary::-webkit-details-marker{display:none}\n.ns-backend > summary::before{content:"\u25B8";color:var(--dsw-alias-label-secondary);font-size:11px}\n.ns-backend[open] > summary::before{content:"\u25BE"}\n.ns-backend-title{flex:1 1 auto;font-weight:600;font-size:14px}\n.ns-chips{display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end}\n.ns-chip{font-size:11px;line-height:1;padding:4px 7px;border-radius:999px;border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-secondary);white-space:nowrap}\n.ns-chip--ok{border-color:var(--dsw-alias-state-success-primary);color:var(--dsw-alias-state-success-primary)}\n.ns-chip--warn{border-color:var(--dsw-alias-state-warn-primary);color:var(--dsw-alias-state-warn-primary)}\n.ns-chip--risk{border-color:var(--dsw-alias-state-error-primary);color:var(--dsw-alias-state-error-primary)}\n.ns-chip.is-on{background:color-mix(in oklab,var(--dsw-alias-brand-primary) 14%,transparent);border-color:currentColor;font-weight:600}\n.ns-chip--off{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-state-idle-primary)}\n.ns-dot{width:8px;height:8px;border-radius:50%;flex:0 0 auto}\n.ns-dot.is-on{background:var(--dsw-alias-state-success-primary)}\n.ns-dot.is-off{background:var(--dsw-alias-state-idle-primary);opacity:.6}\n.ns-badge.is-on{border-color:var(--dsw-alias-brand-primary);color:var(--dsw-alias-brand-primary)}\n.ns-advanced{margin:12px 0;border-top:1px solid var(--dsw-alias-border-l1);padding-top:10px}\n.ns-advanced summary{cursor:pointer;font-size:13px;font-weight:600;color:var(--dsw-alias-label-secondary);margin-bottom:10px}\n.ns-blockers{margin:16px 0;padding:16px 20px;border:1px solid var(--dsw-alias-state-warn-primary);border-radius:12px;background:var(--dsw-alias-bg-layer-1)}\n.ns-blockers h3{font-size:14px;margin-bottom:8px;color:var(--dsw-alias-state-warn-primary)}\n.ns-blockers ul{margin:0;padding-left:18px}\n.ns-blockers li{margin:4px 0}\n.ns-statuses{display:flex;flex-wrap:wrap;gap:8px 16px}\n.ns-status-choice{display:inline-flex;align-items:center;gap:6px;font-size:13px;padding:6px 4px;cursor:pointer}\n.ns-status-choice input{width:18px;height:18px;accent-color:var(--dsw-alias-brand-primary)}\n.ns-sources{margin:8px 0;padding-left:20px}\n.ns-sources li{margin:10px 0}\n.ns-sources p{margin:2px 0;font-size:12px}\n.ns-failure{margin-top:12px;padding:12px 14px;border:1px solid var(--dsw-alias-state-error-primary);border-radius:8px}\n.ns-failure h5{color:var(--dsw-alias-state-error-primary)}\n.ns-failure dl{display:grid;grid-template-columns:auto minmax(0,1fr);gap:4px 14px;margin:0;font-size:12px}\n.ns-failure dt{color:var(--dsw-alias-label-secondary)}\n.ns-failure dd{margin:0;overflow-wrap:anywhere}\n.ns-confirm{margin:10px 0;padding:12px 14px;border:1px solid var(--dsw-alias-state-error-primary);border-radius:8px;background:var(--dsw-alias-bg-layer-2)}\n.ns-confirm p{margin:0 0 10px;font-size:13px}\n.ns-danger{border-color:var(--dsw-alias-state-error-primary)!important;color:var(--dsw-alias-state-error-primary)}\n.ns-link{background:none;border:none;padding:0;margin-left:6px;min-height:0;font-size:12px;color:var(--dsw-alias-brand-primary);text-decoration:underline;cursor:pointer}\n.ns-link:hover{background:none;border:none}\n.ns-cell-message{max-width:320px;overflow-wrap:anywhere;font-size:12px;color:var(--dsw-alias-label-secondary)}\n.ns-footer{position:sticky;bottom:0;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin:16px -4px 0;padding:12px 16px;border:1px solid var(--dsw-alias-border-l1);border-radius:12px;background:var(--dsw-alias-bg-layer-1);box-shadow:0 -2px 12px rgba(0,0,0,.06)}\n.ns-footer>span{font-size:13px;color:var(--dsw-alias-label-secondary)}\n@media (max-width:720px){.ns-toolbar{grid-template-columns:minmax(0,1fr)}.ns-chips{justify-content:flex-start}.ns-footer>span{width:100%}}\n\n.ns-advanced summary{display:inline-flex;align-items:center;gap:6px;width:auto;min-height:32px;padding:0 2px;color:var(--dsw-alias-brand-primary);font-weight:600}\n.ns-advanced summary::marker{font-size:10px}\n.ns-advanced[open] summary{margin-bottom:12px}\n.ns-tabs{display:flex;flex-wrap:wrap;gap:4px;margin:18px 0 14px;padding:4px;border:1px solid var(--dsw-alias-border-l1);border-radius:10px;background:var(--dsw-alias-bg-layer-1)}\n.ns-tab{display:inline-flex;align-items:center;gap:8px;min-height:36px;padding:6px 14px;border:1px solid transparent;border-radius:7px;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:13px;cursor:pointer}\n.ns-tab:hover:not(.is-active){background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary)}\n.ns-tab.is-active{border-color:var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-primary);font-weight:600}\n.ns-tab-count{font-size:11px;font-weight:600;padding:2px 6px;border-radius:999px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary)}\n[role=tabpanel]{outline:none}\n.ns-test-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:16px}\n.ns-test-actions small{color:var(--dsw-alias-label-secondary)}\n@media (max-width:720px){.ns-tabs{gap:2px}.ns-tab{padding:6px 10px}}\n.ns-header{margin-bottom:8px}\n\n.ns-backend-body{padding:0 20px 20px}\n.ns-backend-body .ns-muted{font-size:12.5px;line-height:1.6;margin:10px 0}\n.ns-meta{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px;margin:14px 0 0;padding-top:12px;border-top:1px solid var(--dsw-alias-border-l1);font-size:12px;line-height:1.5;color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums}\n.ns-meta strong{font-weight:600;color:var(--dsw-alias-label-primary)}\n.ns-blockers--info{border-color:var(--dsw-alias-border-l2)}.ns-blockers--info h3{color:var(--dsw-alias-label-primary)}\n\n.ns-credential-shape code{display:block;padding:8px 10px;border:1px solid var(--dsw-alias-border-l1);border-radius:6px;background:var(--dsw-alias-bg-base);font-size:11px;overflow-wrap:anywhere}\n';
|
|
33
33
|
|
|
34
34
|
// locale/en.json
|
|
35
35
|
var en_default = {
|
|
@@ -38,7 +38,7 @@ var NiteSearchClient = (() => {
|
|
|
38
38
|
description: "Multi-backend search with explicit anonymous or key access, cost tiers, bounded retries and complete Web settings. Backends start disabled; account-backed requests may incur charges."
|
|
39
39
|
},
|
|
40
40
|
title: "Web search",
|
|
41
|
-
intro: "{{enabled}} of {{total}} backends enabled.
|
|
41
|
+
intro: "{{enabled}} of {{total}} backends enabled.",
|
|
42
42
|
loading: "Loading saved settings\u2026",
|
|
43
43
|
loadFailed: "Could not load settings. Reload to try again.",
|
|
44
44
|
reload: "Reload settings",
|
|
@@ -86,10 +86,10 @@ var NiteSearchClient = (() => {
|
|
|
86
86
|
notVerified: "Not verified",
|
|
87
87
|
noData: "No data",
|
|
88
88
|
attemptsToday: "Attempts today",
|
|
89
|
-
"tier.free": "Free
|
|
90
|
-
"tier.allowance": "Free allowance
|
|
89
|
+
"tier.free": "Free",
|
|
90
|
+
"tier.allowance": "Free allowance",
|
|
91
91
|
"tier.trial": "Trial credits",
|
|
92
|
-
"tier.paid": "Paid
|
|
92
|
+
"tier.paid": "Paid",
|
|
93
93
|
"tier.self-hosted": "Self-hosted",
|
|
94
94
|
"tier.unverified": "Contract unverified \xB7 cannot enable",
|
|
95
95
|
credentialTitle: "Credential storage",
|
|
@@ -100,7 +100,6 @@ var NiteSearchClient = (() => {
|
|
|
100
100
|
replaceCredential: "Replace credential",
|
|
101
101
|
deleteCredential: "Delete credential",
|
|
102
102
|
deleteCredentialConfirm: "Delete this saved credential? This cannot be undone.",
|
|
103
|
-
saveBeforeCredential: "Save the configuration before changing credentials.",
|
|
104
103
|
credentialSaved: "Credential change confirmed.",
|
|
105
104
|
credentialFailed: "Credential change could not be confirmed. The input has been cleared; inspect the current state before trying again.",
|
|
106
105
|
testTitle: "Test a saved backend",
|
|
@@ -242,7 +241,6 @@ var NiteSearchClient = (() => {
|
|
|
242
241
|
"failure.budget": "Local budget exhausted",
|
|
243
242
|
"failure.circuit-open": "Circuit open",
|
|
244
243
|
"failure.unverified": "Unverified backend",
|
|
245
|
-
liveVerified: "Live-tested",
|
|
246
244
|
tabsLabel: "Search settings sections",
|
|
247
245
|
"tab.behavior": "Search behavior",
|
|
248
246
|
"tab.reliability": "Reliability",
|
|
@@ -253,7 +251,20 @@ var NiteSearchClient = (() => {
|
|
|
253
251
|
notSpecified: "Not specified",
|
|
254
252
|
activeTitle: "This plugin is not the active search provider",
|
|
255
253
|
activeOther: "The web seam currently selects \u201C{{provider}}\u201D. Searches keep going there until this plugin is selected.",
|
|
256
|
-
activateSelf: "Use this plugin for web search"
|
|
254
|
+
activateSelf: "Use this plugin for web search",
|
|
255
|
+
"choice.oauth": "OAuth",
|
|
256
|
+
"tier.account": "Own account",
|
|
257
|
+
"choice.session": "Browser session cookies",
|
|
258
|
+
colorLegend: "Green: free path, own account or self-hosted. Yellow: free allowance. Red: trial credits or paid. Sorted cheapest first.",
|
|
259
|
+
credentialPending: "Wait for the current action to finish.",
|
|
260
|
+
credentialRefRequired: "Set a credential reference name first.",
|
|
261
|
+
credentialReadOnly: "This reference is read-only: another source supplies its value, so the plugin cannot overwrite it. Pick a different reference name, such as DSH_SEARCH_X_SESSION.",
|
|
262
|
+
credentialPlainKey: "Paste the key itself.",
|
|
263
|
+
credentialShapeLabel: "Credential format",
|
|
264
|
+
"field.tools.webSearchPlus": "Allow web_search_plus",
|
|
265
|
+
"help.tools.webSearchPlus": "Off hides the tool entirely: the agent then searches only through the configured strategy.",
|
|
266
|
+
"field.tools.compactByDefault": "Compact results by default",
|
|
267
|
+
"help.tools.compactByDefault": "Sources carry only URL, title and date. Saves context when the agent only needs links; a call can still ask for full snippets."
|
|
257
268
|
};
|
|
258
269
|
|
|
259
270
|
// locale/zh.json
|
|
@@ -263,7 +274,7 @@ var NiteSearchClient = (() => {
|
|
|
263
274
|
description: "\u591A\u540E\u7AEF\u641C\u7D22\uFF0C\u56FA\u5B9A\u9009\u62E9\u533F\u540D\u6216\u5BC6\u94A5\u6A21\u5F0F\uFF0C\u63D0\u4F9B\u8D39\u7528\u5206\u6863\u3001\u6709\u9650\u91CD\u8BD5\u548C\u5B8C\u6574 Web \u8BBE\u7F6E\u3002\u540E\u7AEF\u9ED8\u8BA4\u5173\u95ED\uFF0C\u8D26\u6237\u8C03\u7528\u53EF\u80FD\u4EA7\u751F\u8D39\u7528\u3002"
|
|
264
275
|
},
|
|
265
276
|
title: "\u7F51\u9875\u641C\u7D22",
|
|
266
|
-
intro: "\u5DF2\u542F\u7528 {{enabled}}/{{total}} \u4E2A\u540E\u7AEF\u3002
|
|
277
|
+
intro: "\u5DF2\u542F\u7528 {{enabled}}/{{total}} \u4E2A\u540E\u7AEF\u3002",
|
|
267
278
|
loading: "\u6B63\u5728\u8BFB\u53D6\u5DF2\u4FDD\u5B58\u8BBE\u7F6E\u2026",
|
|
268
279
|
loadFailed: "\u8BFB\u53D6\u8BBE\u7F6E\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u52A0\u8F7D\u3002",
|
|
269
280
|
reload: "\u91CD\u65B0\u52A0\u8F7D\u8BBE\u7F6E",
|
|
@@ -311,10 +322,10 @@ var NiteSearchClient = (() => {
|
|
|
311
322
|
notVerified: "\u672A\u6838\u5B9E",
|
|
312
323
|
noData: "\u6682\u65E0\u6570\u636E",
|
|
313
324
|
attemptsToday: "\u4ECA\u65E5\u5C1D\u8BD5\u6B21\u6570",
|
|
314
|
-
"tier.free": "\u514D\u8D39
|
|
315
|
-
"tier.allowance": "\u514D\u8D39\u989D\u5EA6
|
|
325
|
+
"tier.free": "\u514D\u8D39",
|
|
326
|
+
"tier.allowance": "\u514D\u8D39\u989D\u5EA6",
|
|
316
327
|
"tier.trial": "\u8BD5\u7528\u989D\u5EA6",
|
|
317
|
-
"tier.paid": "\u4ED8\u8D39
|
|
328
|
+
"tier.paid": "\u4ED8\u8D39",
|
|
318
329
|
"tier.self-hosted": "\u81EA\u6258\u7BA1",
|
|
319
330
|
"tier.unverified": "\u534F\u8BAE\u672A\u6838\u5B9E \xB7 \u4E0D\u53EF\u542F\u7528",
|
|
320
331
|
credentialTitle: "\u51ED\u8BC1\u5B58\u50A8",
|
|
@@ -325,7 +336,6 @@ var NiteSearchClient = (() => {
|
|
|
325
336
|
replaceCredential: "\u66FF\u6362\u51ED\u8BC1",
|
|
326
337
|
deleteCredential: "\u5220\u9664\u51ED\u8BC1",
|
|
327
338
|
deleteCredentialConfirm: "\u786E\u5B9A\u5220\u9664\u5DF2\u4FDD\u5B58\u7684\u51ED\u8BC1\uFF1F\u6B64\u64CD\u4F5C\u65E0\u6CD5\u64A4\u9500\u3002",
|
|
328
|
-
saveBeforeCredential: "\u8BF7\u5148\u4FDD\u5B58\u914D\u7F6E\uFF0C\u518D\u4FEE\u6539\u51ED\u8BC1\u3002",
|
|
329
339
|
credentialSaved: "\u51ED\u8BC1\u66F4\u6539\u5DF2\u786E\u8BA4\u3002",
|
|
330
340
|
credentialFailed: "\u65E0\u6CD5\u786E\u8BA4\u51ED\u8BC1\u66F4\u6539\u7ED3\u679C\uFF0C\u8F93\u5165\u5185\u5BB9\u5DF2\u6E05\u7A7A\u3002\u8BF7\u5148\u6838\u5BF9\u5F53\u524D\u72B6\u6001\uFF0C\u518D\u51B3\u5B9A\u662F\u5426\u91CD\u65B0\u64CD\u4F5C\u3002",
|
|
331
341
|
testTitle: "\u6D4B\u8BD5\u5DF2\u4FDD\u5B58\u7684\u540E\u7AEF",
|
|
@@ -467,7 +477,6 @@ var NiteSearchClient = (() => {
|
|
|
467
477
|
"failure.budget": "\u672C\u5730\u989D\u5EA6\u8017\u5C3D",
|
|
468
478
|
"failure.circuit-open": "\u7194\u65AD\u4E2D",
|
|
469
479
|
"failure.unverified": "\u540E\u7AEF\u672A\u6838\u5B9E",
|
|
470
|
-
liveVerified: "\u5DF2\u5B9E\u6D4B",
|
|
471
480
|
tabsLabel: "\u641C\u7D22\u8BBE\u7F6E\u5206\u533A",
|
|
472
481
|
"tab.behavior": "\u641C\u7D22\u884C\u4E3A",
|
|
473
482
|
"tab.reliability": "\u7A33\u5B9A\u6027",
|
|
@@ -478,13 +487,26 @@ var NiteSearchClient = (() => {
|
|
|
478
487
|
notSpecified: "\u4E0D\u6307\u5B9A",
|
|
479
488
|
activeTitle: "\u5F53\u524D\u672A\u542F\u7528\u672C\u63D2\u4EF6\u4F5C\u4E3A\u641C\u7D22\u6E90",
|
|
480
489
|
activeOther: "\u5185\u7F6E\u641C\u7D22\u5F53\u524D\u9009\u62E9\u7684\u662F\u300C{{provider}}\u300D\u3002\u5728\u9009\u4E2D\u672C\u63D2\u4EF6\u4E4B\u524D\uFF0C\u641C\u7D22\u4ECD\u4F1A\u8D70\u5B83\u3002",
|
|
481
|
-
activateSelf: "\u8BBE\u4E3A\u7F51\u9875\u641C\u7D22\u6765\u6E90"
|
|
490
|
+
activateSelf: "\u8BBE\u4E3A\u7F51\u9875\u641C\u7D22\u6765\u6E90",
|
|
491
|
+
"choice.oauth": "OAuth \u6388\u6743",
|
|
492
|
+
"tier.account": "\u81EA\u5E26\u8D26\u53F7",
|
|
493
|
+
"choice.session": "\u6D4F\u89C8\u5668\u4F1A\u8BDD Cookie",
|
|
494
|
+
colorLegend: "\u7EFF\u8272\uFF1D\u514D\u8D39/\u81EA\u5E26\u8D26\u53F7/\u81EA\u6258\u7BA1\uFF0C\u9EC4\u8272\uFF1D\u514D\u8D39\u989D\u5EA6\uFF0C\u7EA2\u8272\uFF1D\u8BD5\u7528\u6216\u4ED8\u8D39\u3002\u7531\u4FBF\u5B9C\u5230\u8D35\u6392\u5E8F\u3002",
|
|
495
|
+
credentialPending: "\u5F53\u524D\u64CD\u4F5C\u8FD8\u6CA1\u7ED3\u675F\uFF0C\u7A0D\u7B49\u3002",
|
|
496
|
+
credentialRefRequired: "\u8BF7\u5148\u586B\u4E00\u4E2A\u51ED\u8BC1\u5F15\u7528\u540D\u3002",
|
|
497
|
+
credentialReadOnly: "\u8FD9\u4E2A\u51ED\u8BC1\u5F15\u7528\u662F\u53EA\u8BFB\u7684\uFF1A\u5B83\u7684\u503C\u7531\u5176\u5B83\u6765\u6E90\u63D0\u4F9B\uFF0C\u63D2\u4EF6\u65E0\u6CD5\u8986\u76D6\u3002\u6362\u4E00\u4E2A\u5F15\u7528\u540D\u8BD5\u8BD5\uFF0C\u4F8B\u5982 DSH_SEARCH_X_SESSION\u3002",
|
|
498
|
+
credentialPlainKey: "\u76F4\u63A5\u586B\u5BC6\u94A5\u5B57\u7B26\u4E32\u3002",
|
|
499
|
+
credentialShapeLabel: "\u51ED\u8BC1\u683C\u5F0F",
|
|
500
|
+
"field.tools.webSearchPlus": "\u5141\u8BB8\u4F7F\u7528 web_search_plus",
|
|
501
|
+
"help.tools.webSearchPlus": "\u5173\u95ED\u540E\u8FD9\u4E2A\u5DE5\u5177\u4E0D\u4F1A\u6CE8\u518C\uFF0Cagent \u53EA\u80FD\u7528\u914D\u7F6E\u91CC\u7684\u56FA\u5B9A\u7B56\u7565\u641C\u7D22\u3002",
|
|
502
|
+
"field.tools.compactByDefault": "\u9ED8\u8BA4\u8FD4\u56DE\u7CBE\u7B80\u7ED3\u679C",
|
|
503
|
+
"help.tools.compactByDefault": "\u7ED3\u679C\u53EA\u4FDD\u7559\u94FE\u63A5\u3001\u6807\u9898\u548C\u65E5\u671F\u3002agent \u53EA\u9700\u8981\u94FE\u63A5\u65F6\u80FD\u7701\u4E0B\u5927\u91CF\u4E0A\u4E0B\u6587\uFF1B\u5355\u6B21\u8C03\u7528\u4ECD\u53EF\u8981\u6C42\u5B8C\u6574\u6458\u8981\u3002"
|
|
482
504
|
};
|
|
483
505
|
|
|
484
506
|
// src/catalog.ts
|
|
485
507
|
var text = (en, zh) => ({ en, zh });
|
|
486
508
|
var option = (key, label, zh, value, choices) => ({ key, type: choices ? "select" : typeof value, label: text(label, zh), help: text(`Native ${key} parameter. See the backend documentation.`, `\u539F\u751F ${key} \u53C2\u6570\uFF0C\u8BE6\u89C1\u540E\u7AEF\u6587\u6863\u3002`), default: value, ...choices ? { choices } : {} });
|
|
487
|
-
var mode = (access, endpoint, tier, en, zh, pricingUrl) => ({ mode: access, endpoint, tier, limits: text(en, zh), pricingUrl });
|
|
509
|
+
var mode = (access, endpoint, tier, en, zh, pricingUrl, shape) => ({ mode: access, endpoint, tier, limits: text(en, zh), pricingUrl, ...shape ? { credentialShape: text(shape.en, shape.zh) } : {} });
|
|
488
510
|
var backend = (id, title, docs, modes, options = [], capabilities = [], status = "documented", evidence = "documented") => ({ id, title, docs, modes, options, capabilities, status, evidence, verifiedAt: "2026-11-17" });
|
|
489
511
|
var catalog = [
|
|
490
512
|
backend("keenable", "Keenable", "https://docs.keenable.ai/api-reference/search.md", [mode("anonymous", "https://api.keenable.ai/v1/search/public", "free", "1,000 requests/hour and 10/second per IP/endpoint; public title header required.", "\u6BCF IP\uFF0F\u7AEF\u70B9 1000 \u6B21/\u5C0F\u65F6\u300110 \u6B21/\u79D2\uFF1B\u9700\u8981\u516C\u5F00\u8C03\u7528\u6807\u8BC6\u3002", "https://docs.keenable.ai/pricing.md"), mode("key", "https://api.keenable.ai/v1/search", "allowance", "100,000 searches/month free; then $4/1,000. Confirm current account terms.", "\u6BCF\u6708 10 \u4E07\u6B21\u514D\u8D39\uFF0C\u5176\u540E $4/\u5343\u6B21\uFF1B\u4EE5\u8D26\u6237\u5F53\u524D\u6761\u6B3E\u4E3A\u51C6\u3002", "https://docs.keenable.ai/pricing.md")], [option("clientTitle", "Client title", "\u8C03\u7528\u65B9\u540D\u79F0", "dsh-search"), option("snippet_max_length", "Snippet maximum length", "\u6458\u8981\u6700\u5927\u957F\u5EA6", 2e3)], ["includeDomains"], "documented", "live"),
|
|
@@ -507,7 +529,9 @@ var NiteSearchClient = (() => {
|
|
|
507
529
|
backend("doubao", "Volcengine Doubao", "https://docs.volcengine.com/docs/networked-search/networked-search?lang=zh", [mode("key", "https://open.feedcoopapi.com/search_api/web_search", "allowance", "500/month shared free allowance, 10 QPS; usage-based web \xA50.020/request. Subscription keys have independent limits.", "\u6BCF\u6708\u5171\u4EAB 500 \u6B21\u514D\u8D39\uFF0C10 QPS\uFF1B\u6309\u91CF web \xA50.020/\u6B21\uFF1B\u8BA2\u9605 Key \u6709\u72EC\u7ACB\u9650\u5236\u3002", "https://docs.volcengine.com/docs/networked-search/online-search-product-billing?lang=zh")], [option("queryRewrite", "Provider query rewrite", "\u4F9B\u5E94\u5546\u6539\u5199\u67E5\u8BE2", false)]),
|
|
508
530
|
backend("open-websearch", "open-websearch", "https://github.com/Aas-ee/open-webSearch", [mode("anonymous", "http://127.0.0.1:3210/search", "self-hosted", "Self-hosted daemon; no guaranteed quota, engine blocking and infrastructure costs apply. Project personal-use restrictions apply.", "\u81EA\u5EFA daemon\uFF0C\u65E0\u4FDD\u8BC1\u989D\u5EA6\uFF1B\u6709\u5F15\u64CE\u9650\u6D41\u53CA\u8FD0\u884C\u6210\u672C\uFF0C\u6CE8\u610F\u9879\u76EE\u4E2A\u4EBA\u4F7F\u7528\u9650\u5236\u3002", "https://github.com/Aas-ee/open-webSearch")], [option("engine", "Fixed upstream engine", "\u56FA\u5B9A\u4E0A\u6E38\u5F15\u64CE", "duckduckgo"), option("searchMode", "Request strategy", "\u8BF7\u6C42\u65B9\u5F0F", "request", ["request", "playwright"])]),
|
|
509
531
|
backend("serpex", "Serpex", "https://serpex.dev/docs/api/search", [mode("key", "https://api.serpex.dev/api/search", "trial", "200 one-time credits; paid top-ups start around $0.80/1,000. Vendor routes internally; no fixed upstream engine.", "\u4E00\u6B21\u6027 200 credits\uFF1B\u5145\u503C\u7EA6 $0.80/\u5343\u6B21\u8D77\uFF1B\u4F9B\u5E94\u5546\u5185\u90E8\u8DEF\u7531\uFF0C\u4E0D\u80FD\u56FA\u5B9A\u5176\u4E0A\u6E38\u5F15\u64CE\u3002", "https://serpex.dev/docs/getting-started/pricing")]),
|
|
510
|
-
backend("
|
|
532
|
+
backend("x", "X (Twitter)", "https://docs.x.com/x-api/posts/search/quickstart/recent-search", [mode("session", "https://x.com/i/api/graphql", "account", "Uses the browser session cookies (auth_token, ct0) of your own X account. No fee, but X changes its request signing and query ids regularly, so this mode can break until the adapter is updated.", "\u4F7F\u7528\u4F60\u81EA\u5DF1 X \u8D26\u53F7\u7684\u7F51\u9875 cookie\uFF08auth_token\u3001ct0\uFF09\u3002\u4E0D\u4EA7\u751F\u8D39\u7528\uFF0C\u4F46 X \u4F1A\u4E0D\u5B9A\u671F\u6539\u52A8\u524D\u7AEF\u7B7E\u540D\u4E0E queryId\uFF0C\u5931\u6548\u540E\u9700\u8981\u7EF4\u62A4\u8005\u66F4\u65B0\u9002\u914D\u5668\u3002", "https://github.com/bestnite/x-mcp", { en: '{"authToken":"...","ct0":"..."}, or paste auth_token=...; ct0=... straight from DevTools', zh: '{"authToken":"...","ct0":"..."}\uFF0C\u4E5F\u53EF\u4EE5\u76F4\u63A5\u7C98\u8D34\u6D4F\u89C8\u5668\u91CC\u7684 auth_token=...; ct0=...' }), mode("key", "https://api.x.com/2/tweets/search/recent", "paid", "Official API with an app-only bearer token as the key. Pay per post read: about $0.005 each, so a 10-result search costs roughly $0.05. Recent search covers the last 7 days; reads are capped by the posts-per-search option.", "\u5B98\u65B9 API\uFF0C\u5BC6\u94A5\u586B app-only bearer token\u3002\u6309\u8BFB\u53D6\u5E16\u6570\u8BA1\u8D39\uFF1A\u7EA6 $0.005/\u6761\uFF0C\u53D6 10 \u6761\u7EA6 $0.05\u3002\u8FD1\u671F\u641C\u7D22\u53EA\u8986\u76D6\u6700\u8FD1 7 \u5929\uFF0C\u8BFB\u53D6\u6761\u6570\u53D7\u300C\u6BCF\u6B21\u641C\u7D22\u5E16\u6570\u300D\u53C2\u6570\u9650\u5236\u3002", "https://docs.x.com/x-api/getting-started/pricing", { en: '{"bearerToken":"<app-only bearer token>"}', zh: '{"bearerToken":"<app-only bearer \u4EE4\u724C>"}' })], [option("postsPerSearch", "Posts read per search", "\u6BCF\u6B21\u641C\u7D22\u8BFB\u53D6\u5E16\u6570", 10)], ["recency"]),
|
|
533
|
+
backend("reddit", "Reddit", "https://github.com/reddit-archive/reddit/wiki/API", [mode("anonymous", "https://gql-fed.reddit.com/", "free", "No credentials. Uses the Reddit Android app endpoint, because the public REST search and comments endpoints answer 403 to anonymous tokens since 2026-10. No published quota; shared rate limits.", "\u65E0\u9700\u51ED\u8BC1\u3002\u8D70 Reddit \u5B89\u5353\u5BA2\u6237\u7AEF\u7AEF\u70B9\u2014\u2014\u81EA 2026-10 \u8D77\u516C\u5F00 REST \u7684\u641C\u7D22\u4E0E\u8BC4\u8BBA\u5BF9\u533F\u540D token \u4E00\u5F8B\u8FD4\u56DE 403\u3002\u989D\u5EA6\u672A\u516C\u5E03\uFF0C\u5C5E\u5171\u4EAB\u9650\u6D41\u3002", "https://github.com/bestnite/reddit-readonly-mcp"), mode("oauth", "https://oauth.reddit.com/search", "allowance", "Official OAuth API: about 100 queries/minute per client for non-commercial use. client_credentials reads public data; add a username and password for a script grant.", "\u5B98\u65B9 OAuth API\uFF1A\u975E\u5546\u4E1A\u7528\u9014\u7EA6\u6BCF\u5BA2\u6237\u7AEF 100 \u6B21/\u5206\u949F\u3002client_credentials \u5373\u53EF\u8BFB\u516C\u5F00\u6570\u636E\uFF1B\u8865\u7528\u6237\u540D\u5BC6\u7801\u5219\u7528 script \u6388\u6743\u3002", "https://support.reddithelp.com/hc/en-us/articles/16160319875092-Reddit-Data-API-Wiki", { en: '{"clientId":"...","clientSecret":"..."}; add "username" and "password" for a script grant', zh: '{"clientId":"...","clientSecret":"..."}\uFF1B\u9700\u8981\u811A\u672C\u6388\u6743\u5C31\u518D\u52A0 "username" \u4E0E "password"' })], [option("sort", "Sort", "\u6392\u5E8F", "relevance", ["relevance", "hot", "top", "new", "comments"]), option("time", "Time window", "\u65F6\u95F4\u8303\u56F4", "all", ["all", "hour", "day", "week", "month", "year"]), option("subreddit", "Limit to subreddit", "\u9650\u5B9A\u7248\u5757", "")], ["recency"]),
|
|
534
|
+
backend("tencent-wsa", "Tencent Cloud WSA", "https://cloud.tencent.com/document/product/1806/121811", [mode("key", "https://wsa.tencentcloudapi.com/", "paid", "\xA514/\xA520/\xA526 per 1,000 by tier. Store a JSON credential {secretId,secretKey}; no free allowance verified.", "\u5206\u6863 \xA514\uFF0F\xA520\uFF0F\xA526 \u6BCF\u5343\u6B21\u3002\u51ED\u8BC1\u586B\u5199 JSON {secretId,secretKey}\uFF1B\u514D\u8D39\u989D\u5EA6\u672A\u6838\u5B9E\u3002", "https://cloud.tencent.com/product/wsa", { en: '{"secretId":"...","secretKey":"..."}', zh: '{"secretId":"...","secretKey":"..."}' })], [{ ...option("Mode", "Search mode", "\u641C\u7D22\u6A21\u5F0F", 0), min: 0, max: 2 }])
|
|
511
535
|
];
|
|
512
536
|
|
|
513
537
|
// src/locale-map.ts
|
|
@@ -534,6 +558,7 @@ var NiteSearchClient = (() => {
|
|
|
534
558
|
cache: { enabled: true, ttlSeconds: 900, maxEntries: 100 },
|
|
535
559
|
breaker: { enabled: false, threshold: 3, cooldownMs: 6e4 },
|
|
536
560
|
diagnostics: { enabled: true, maxEntries: 50 },
|
|
561
|
+
tools: { webSearchPlus: true, compactByDefault: false },
|
|
537
562
|
backends: Object.fromEntries(catalog.map((d) => [d.id, { enabled: false, mode: d.modes[0].mode, endpoint: d.modes[0].endpoint, credentialRef: `DSH_SEARCH_${d.id.replaceAll("-", "_").toUpperCase()}_KEY`, timeoutMs: 15e3, rateLimitPerMinute: 0, dailyAttemptLimit: 0, options: Object.fromEntries(d.options.map((o) => [o.key, o.default])) }]))
|
|
538
563
|
};
|
|
539
564
|
}
|
|
@@ -869,13 +894,13 @@ var NiteSearchClient = (() => {
|
|
|
869
894
|
}
|
|
870
895
|
}
|
|
871
896
|
async function credential(id, remove) {
|
|
872
|
-
if (!snapshot
|
|
873
|
-
const
|
|
897
|
+
if (!snapshot) return;
|
|
898
|
+
const reference = draft.backends[id]?.credentialRef;
|
|
874
899
|
setPending(`credential-${id}`);
|
|
875
900
|
setFailed(false);
|
|
876
901
|
setNotice("working");
|
|
877
902
|
try {
|
|
878
|
-
await request("credential", { backendId: id, ref:
|
|
903
|
+
await request("credential", { backendId: id, ref: reference, ...remove ? { remove: true } : { value: secrets[id] } });
|
|
879
904
|
setSecrets((previous) => ({ ...previous, [id]: "" }));
|
|
880
905
|
await refresh();
|
|
881
906
|
setNotice("credentialSaved");
|
|
@@ -927,9 +952,29 @@ var NiteSearchClient = (() => {
|
|
|
927
952
|
if (backendFilter === "configured" && !snapshot?.credentials[def.id]?.configured) return false;
|
|
928
953
|
return true;
|
|
929
954
|
};
|
|
930
|
-
const
|
|
955
|
+
const TIER_ORDER = ["free", "account", "self-hosted", "allowance", "trial", "paid", "unverified"];
|
|
956
|
+
const tierRank = (tier) => {
|
|
957
|
+
const index = TIER_ORDER.indexOf(tier);
|
|
958
|
+
return index < 0 ? TIER_ORDER.length : index;
|
|
959
|
+
};
|
|
960
|
+
const bestTier = (def) => def.status === "unverified" ? "unverified" : def.modes.reduce((best, mode2) => tierRank(mode2.tier) < tierRank(best) ? mode2.tier : best, def.modes[0]?.tier || "unverified");
|
|
961
|
+
const readyRank = (def) => {
|
|
962
|
+
const backend2 = draft.backends[def.id];
|
|
963
|
+
const selected = def.modes.find((mode2) => mode2.mode === backend2?.mode)?.tier;
|
|
964
|
+
return (backend2?.enabled ? 0 : 2) + (selected === "free" ? 0 : 1);
|
|
965
|
+
};
|
|
966
|
+
const ranked = definitions.slice().sort((left, right) => tierRank(bestTier(left)) - tierRank(bestTier(right)) || readyRank(left) - readyRank(right) || left.title.localeCompare(right.title));
|
|
931
967
|
const tierRisk = (tier) => tier === "paid" || tier === "trial" ? "ns-chip--risk" : tier === "unverified" ? "ns-chip--off" : tier === "allowance" ? "ns-chip--warn" : "ns-chip--ok";
|
|
932
968
|
const TABS = ["behavior", "reliability", "diagnostics", "backends"];
|
|
969
|
+
const credentialDisabledReason = (id) => {
|
|
970
|
+
if (pending) return t("credentialPending");
|
|
971
|
+
const reference = draft.backends[id]?.credentialRef;
|
|
972
|
+
if (!reference) return t("credentialRefRequired");
|
|
973
|
+
const savedReference = snapshot?.config.backends[id]?.credentialRef;
|
|
974
|
+
if (reference === savedReference && snapshot?.credentials[id] && !snapshot.credentials[id].writable) return t("credentialReadOnly");
|
|
975
|
+
return "";
|
|
976
|
+
};
|
|
977
|
+
const credentialDisabled = (id) => credentialDisabledReason(id) !== "";
|
|
933
978
|
return /* @__PURE__ */ React.createElement("div", { className: "ns-page", "aria-busy": !!pending }, /* @__PURE__ */ React.createElement("style", null, client_default, client_overrides_default), /* @__PURE__ */ React.createElement("header", { className: "ns-header" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("h2", null, t("title")), /* @__PURE__ */ React.createElement("p", null, tr("intro", { enabled: enabledCount, total: definitions.length })))), /* @__PURE__ */ React.createElement("div", { className: "ns-status", role: "status", "aria-live": "polite" }, /* @__PURE__ */ React.createElement("span", { className: failed ? "ns-error" : "" }, notice ? t(notice) : !snapshot ? t("loading") : dirty ? t("unsaved") : t("upToDate")), !!pending && /* @__PURE__ */ React.createElement("span", null, t("pending"))), !!issues.length && /* @__PURE__ */ React.createElement("div", { className: "ns-summary", role: "alert", tabIndex: -1, ref: summary }, /* @__PURE__ */ React.createElement("h3", null, t("validationTitle")), /* @__PURE__ */ React.createElement("ul", null, issues.map((issue, index) => /* @__PURE__ */ React.createElement("li", { key: `${issue.path}-${index}` }, /* @__PURE__ */ React.createElement("a", { href: `#${fieldId(issue.path)}`, onClick: (event) => {
|
|
934
979
|
event.preventDefault();
|
|
935
980
|
focusPath(issue.path);
|
|
@@ -946,7 +991,7 @@ var NiteSearchClient = (() => {
|
|
|
946
991
|
} finally {
|
|
947
992
|
setPending("");
|
|
948
993
|
}
|
|
949
|
-
} }, t("reload")) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "ns-tabs", role: "tablist", "aria-label": t("tabsLabel") }, TABS.map((id) => /* @__PURE__ */ React.createElement("button", { key: id, role: "tab", type: "button", id: `tab-${id}`, "aria-selected": tab === id, "aria-controls": `panel-${id}`, className: `ns-tab ${tab === id ? "is-active" : ""}`, onClick: () => setTab(id) }, t(`tab.${id}`), id === "backends" && /* @__PURE__ */ React.createElement("span", { className: "ns-tab-count" }, enabledCount, "/", definitions.length)))), tab === "behavior" && /* @__PURE__ */ React.createElement("div", { role: "tabpanel", id: "panel-behavior", "aria-labelledby": "tab-behavior" }, /* @__PURE__ */ React.createElement("section", { className: "ns-card", "aria-labelledby": "sec-behavior" }, /* @__PURE__ */ React.createElement("h3", { id: "sec-behavior" }, t("general")), /* @__PURE__ */ React.createElement("div", { className: "ns-grid" }, fields(["mode", "singleBackend", "maxResults", "concurrency", "overallTimeoutMs", "language", "region", "recency", "
|
|
994
|
+
} }, t("reload")) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "ns-tabs", role: "tablist", "aria-label": t("tabsLabel") }, TABS.map((id) => /* @__PURE__ */ React.createElement("button", { key: id, role: "tab", type: "button", id: `tab-${id}`, "aria-selected": tab === id, "aria-controls": `panel-${id}`, className: `ns-tab ${tab === id ? "is-active" : ""}`, onClick: () => setTab(id) }, t(`tab.${id}`), id === "backends" && /* @__PURE__ */ React.createElement("span", { className: "ns-tab-count" }, enabledCount, "/", definitions.length)))), tab === "behavior" && /* @__PURE__ */ React.createElement("div", { role: "tabpanel", id: "panel-behavior", "aria-labelledby": "tab-behavior" }, /* @__PURE__ */ React.createElement("section", { className: "ns-card", "aria-labelledby": "sec-behavior" }, /* @__PURE__ */ React.createElement("h3", { id: "sec-behavior" }, t("general")), /* @__PURE__ */ React.createElement("div", { className: "ns-grid" }, fields(["safeSearch", "tools.webSearchPlus", "tools.compactByDefault", "mode", "singleBackend", "maxResults", "concurrency", "overallTimeoutMs", "language", "region", "recency", "includeDomains", "excludeDomains", "dedup", "fusion"], { "tools.webSearchPlus": { type: "checkbox" }, "tools.compactByDefault": { type: "checkbox" }, mode: { choices: ["single", "parallel"] }, singleBackend: { choices: definitions.map((def) => def.id) }, maxResults: { type: "number" }, concurrency: { type: "number" }, overallTimeoutMs: { type: "number" }, language: { choices: [...LANGUAGES] }, region: { choices: [...REGIONS] }, recency: { choices: ["any", "day", "week", "month", "year"] }, safeSearch: { type: "checkbox" }, includeDomains: { type: "list" }, excludeDomains: { type: "list" }, dedup: { choices: ["url", "url-title"] }, fusion: { choices: ["rrf", "ordered"] } })))), tab === "reliability" && /* @__PURE__ */ React.createElement("div", { role: "tabpanel", id: "panel-reliability", "aria-labelledby": "tab-reliability" }, section("resilience", ["sec-resilience"], ["retry.enabled", "breaker.enabled", "retry.maxRetries", "retry.initialDelayMs", "retry.maxDelayMs", "retry.networkErrors", "retry.timeouts", "breaker.threshold", "breaker.cooldownMs"], { "retry.enabled": { type: "checkbox" }, "retry.maxRetries": { type: "number" }, "retry.initialDelayMs": { type: "number" }, "retry.maxDelayMs": { type: "number" }, "retry.networkErrors": { type: "checkbox" }, "retry.timeouts": { type: "checkbox" }, "breaker.enabled": { type: "checkbox" }, "breaker.threshold": { type: "number" }, "breaker.cooldownMs": { type: "number" } }), draft.retry.enabled && /* @__PURE__ */ React.createElement("section", { className: "ns-card", "aria-labelledby": "sec-retry-statuses" }, /* @__PURE__ */ React.createElement("h3", { id: "sec-retry-statuses" }, t("field.retry.statuses")), /* @__PURE__ */ React.createElement("p", { className: "ns-muted" }, t("help.retry.statuses")), /* @__PURE__ */ React.createElement("div", { className: "ns-statuses" }, RETRY_STATUSES.map((code) => /* @__PURE__ */ React.createElement("label", { key: code, className: "ns-status-choice" }, /* @__PURE__ */ React.createElement("input", { type: "checkbox", checked: draft.retry.statuses.includes(code), disabled: !!pending, onChange: (event) => update("retry.statuses", event.target.checked ? [...draft.retry.statuses, code].sort((a, b) => a - b) : draft.retry.statuses.filter((item) => item !== code)) }), /* @__PURE__ */ React.createElement("span", null, code)))), !!issues.filter((issue) => issue.path === "retry.statuses").length && /* @__PURE__ */ React.createElement("p", { className: "ns-error", role: "alert" }, t("invalidField"))), section("storage", ["sec-storage"], ["cache.enabled", "diagnostics.enabled", "cache.ttlSeconds", "cache.maxEntries", "diagnostics.maxEntries"], { "cache.enabled": { type: "checkbox" }, "cache.ttlSeconds": { type: "number" }, "cache.maxEntries": { type: "number" }, "diagnostics.enabled": { type: "checkbox" }, "diagnostics.maxEntries": { type: "number" } })), tab === "diagnostics" && /* @__PURE__ */ React.createElement("div", { role: "tabpanel", id: "panel-diagnostics", "aria-labelledby": "tab-diagnostics" }, /* @__PURE__ */ React.createElement("section", { className: "ns-card", "aria-labelledby": "sec-test" }, /* @__PURE__ */ React.createElement("h3", { id: "sec-test" }, t("testTitle")), /* @__PURE__ */ React.createElement("p", null, t("testHelp")), enabledSaved.length === 0 ? /* @__PURE__ */ React.createElement("p", { className: "ns-muted" }, t("testNeedsBackend")) : /* @__PURE__ */ React.createElement("div", { className: "ns-grid" }, /* @__PURE__ */ React.createElement("div", { className: "ns-field" }, /* @__PURE__ */ React.createElement("label", { htmlFor: "ns-test-backend" }, t("testBackend")), /* @__PURE__ */ React.createElement("select", { id: "ns-test-backend", disabled: !!pending || dirty, value: testBackend, onChange: (event) => setTestBackend(event.target.value) }, enabledSaved.map((def) => /* @__PURE__ */ React.createElement("option", { value: def.id, key: def.id }, def.title)))), /* @__PURE__ */ React.createElement("div", { className: "ns-field" }, /* @__PURE__ */ React.createElement("label", { htmlFor: "ns-test-query" }, t("testQuery")), /* @__PURE__ */ React.createElement("input", { id: "ns-test-query", value: query, disabled: !!pending || dirty, onChange: (event) => setQuery(event.target.value), placeholder: t("testQueryPlaceholder") }))), enabledSaved.length > 0 && /* @__PURE__ */ React.createElement("div", { className: "ns-test-actions" }, /* @__PURE__ */ React.createElement("button", { className: "ns-primary", disabled: !!pending || dirty || !query.trim() || !enabledSaved.some((def) => def.id === testBackend), onClick: () => action("test", { backendId: testBackend, query }) }, t("runTest")), dirty && /* @__PURE__ */ React.createElement("small", null, t("saveBeforeTest"))), testResult && /* @__PURE__ */ React.createElement("div", { className: "ns-result" }, /* @__PURE__ */ React.createElement("h4", null, t("testResult")), testResult.sources?.length ? /* @__PURE__ */ React.createElement("ol", { className: "ns-sources" }, testResult.sources.map((source, index) => /* @__PURE__ */ React.createElement("li", { key: `${source.url}-${index}` }, /* @__PURE__ */ React.createElement("a", { href: source.url, target: "_blank", rel: "noreferrer" }, source.title || source.url), /* @__PURE__ */ React.createElement("p", { className: "ns-muted" }, source.url), source.snippet && /* @__PURE__ */ React.createElement("p", null, source.snippet)))) : /* @__PURE__ */ React.createElement("p", { className: "ns-muted" }, t("noSources")), (testResult.outcomes || []).filter((outcome) => !outcome.ok).map((outcome) => /* @__PURE__ */ React.createElement("div", { className: "ns-failure", key: outcome.backend }, /* @__PURE__ */ React.createElement("h5", null, t("testFailure")), /* @__PURE__ */ React.createElement("dl", null, /* @__PURE__ */ React.createElement("dt", null, t("diagnostic.backend")), /* @__PURE__ */ React.createElement("dd", null, outcome.backend), /* @__PURE__ */ React.createElement("dt", null, t("diagnostic.mode")), /* @__PURE__ */ React.createElement("dd", null, t(`choice.${outcome.mode}`)), /* @__PURE__ */ React.createElement("dt", null, t("diagnostic.attempts")), /* @__PURE__ */ React.createElement("dd", null, outcome.attempts), /* @__PURE__ */ React.createElement("dt", null, t("diagnostic.reason")), /* @__PURE__ */ React.createElement("dd", null, t(`failure.${outcome.error?.kind || "protocol"}`), outcome.error?.status ? ` \xB7 HTTP ${outcome.error.status}` : ""), /* @__PURE__ */ React.createElement("dt", null, t("diagnostic.message")), /* @__PURE__ */ React.createElement("dd", null, outcome.error?.message)))), (testResult.outcomes || []).flatMap((outcome) => outcome.warnings.map((warning) => /* @__PURE__ */ React.createElement("p", { className: "ns-muted", key: `${outcome.backend}-${warning}` }, "[", outcome.backend, "] ", warning))))), /* @__PURE__ */ React.createElement("section", { className: "ns-card", "aria-labelledby": "sec-diagnostics" }, /* @__PURE__ */ React.createElement("h3", { id: "sec-diagnostics" }, t("diagnosticsTitle")), /* @__PURE__ */ React.createElement("p", null, t("diagnosticsHelp")), /* @__PURE__ */ React.createElement("div", { className: "ns-actions" }, /* @__PURE__ */ React.createElement("button", { disabled: !!pending, onClick: () => action("clear-cache") }, t("clearCache")), /* @__PURE__ */ React.createElement("button", { disabled: !!pending, onClick: () => setConfirming({ kind: "clear-diagnostics" }) }, t("clearDiagnostics")), /* @__PURE__ */ React.createElement("button", { disabled: !!pending, onClick: async () => {
|
|
950
995
|
setPending("refresh");
|
|
951
996
|
try {
|
|
952
997
|
await refresh();
|
|
@@ -964,21 +1009,17 @@ var NiteSearchClient = (() => {
|
|
|
964
1009
|
setDraft(clone(snapshot.defaults));
|
|
965
1010
|
setIssues([]);
|
|
966
1011
|
setNotice("defaultsRestored");
|
|
967
|
-
}), showTransfer && /* @__PURE__ */ React.createElement("div", { className: "ns-field" }, /* @__PURE__ */ React.createElement("label", { htmlFor: "ns-import" }, t("importLabel")), /* @__PURE__ */ React.createElement("textarea", { id: "ns-import", value: importText, disabled: !!pending, onChange: (event) => setImportText(event.target.value), rows: 8 }), /* @__PURE__ */ React.createElement("button", { disabled: !!pending || !importText.trim(), onClick: importConfig }, t("applyImport"))))), tab === "backends" && /* @__PURE__ */ React.createElement("div", { role: "tabpanel", id: "panel-backends", "aria-labelledby": "tab-backends" }, /* @__PURE__ */ React.createElement("section", { className: "ns-backends", id: "sec-backends", tabIndex: -1, "aria-labelledby": "sec-backends-title" }, /* @__PURE__ */ React.createElement("h3", { id: "sec-backends-title" }, t("backends"), " ", /* @__PURE__ */ React.createElement("span", { className: "ns-muted" }, tr("enabledSummary", { enabled: enabledCount, total: definitions.length }))), /* @__PURE__ */ React.createElement("p", { className: "ns-muted" }, t("backendIntro")), /* @__PURE__ */ React.createElement("div", { className: "ns-toolbar" }, /* @__PURE__ */ React.createElement("div", { className: "ns-field" }, /* @__PURE__ */ React.createElement("label", { htmlFor: "ns-backend-search" }, t("searchBackends")), /* @__PURE__ */ React.createElement("input", { id: "ns-backend-search", type: "search", value: backendQuery, onChange: (event) => setBackendQuery(event.target.value), placeholder: t("searchBackendsPlaceholder") })), /* @__PURE__ */ React.createElement("div", { className: "ns-field" }, /* @__PURE__ */ React.createElement("label", { htmlFor: "ns-backend-filter" }, t("filterBackends")), /* @__PURE__ */ React.createElement("select", { id: "ns-backend-filter", value: backendFilter, onChange: (event) => setBackendFilter(event.target.value) }, ["all", "enabled", "configured"].map((value) => /* @__PURE__ */ React.createElement("option", { key: value, value }, t(`filter.${value}`)))))),
|
|
968
|
-
const
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
return /* @__PURE__ */ React.createElement("details", { className: "ns-card ns-backend", key: def.id }, /* @__PURE__ */ React.createElement("summary", null, /* @__PURE__ */ React.createElement("span", { className: "ns-backend-title" }, def.title), /* @__PURE__ */ React.createElement("span", { className: "ns-chips" }, /* @__PURE__ */ React.createElement("span", { className: `ns-chip ${locked ? "ns-chip--off" : tierRisk(tier)}` }, locked ? t("unverified") : t(`tier.${tier}`)), /* @__PURE__ */ React.createElement("span", { className: "ns-chip" }, t(`choice.${backend2.mode}`)), def.evidence === "live" && /* @__PURE__ */ React.createElement("span", { className: "ns-chip ns-chip--ok" }, t("liveVerified")), /* @__PURE__ */ React.createElement("span", { className: `ns-dot ${credentialState?.configured ? "is-on" : "is-off"}`, "aria-hidden": "true" }), /* @__PURE__ */ React.createElement("span", { className: `ns-badge ${backend2.enabled ? "is-on" : ""}` }, backend2.enabled ? t("enabled") : t("disabled")))), /* @__PURE__ */ React.createElement("div", { className: "ns-backend-body" }, locked && /* @__PURE__ */ React.createElement("p", { className: "ns-warning" }, t("unverifiedHelp")), /* @__PURE__ */ React.createElement("p", { className: "ns-quota" }, mode2?.limits[lang], " ", /* @__PURE__ */ React.createElement("a", { href: mode2?.pricingUrl || def.docs, target: "_blank", rel: "noreferrer" }, t("source")), " \xB7 ", t("verifiedAt"), " ", def.verifiedAt || t("notVerified")), /* @__PURE__ */ React.createElement("div", { className: "ns-grid" }, fields([`${base}.enabled`, `${base}.mode`, `${base}.endpoint`, `${base}.credentialRef`, `${base}.timeoutMs`, `${base}.rateLimitPerMinute`, `${base}.dailyAttemptLimit`], { [`${base}.enabled`]: { type: "checkbox", disabled: locked }, [`${base}.mode`]: { choices: def.modes.map((item) => item.mode), disabled: locked }, [`${base}.timeoutMs`]: { type: "number" }, [`${base}.rateLimitPerMinute`]: { type: "number" }, [`${base}.dailyAttemptLimit`]: { type: "number" } }).filter((node) => !(anonymous && node.key === `${base}.credentialRef`))), anonymous && !locked && /* @__PURE__ */ React.createElement("p", { className: "ns-muted" }, t("anonymousNoCredential")), def.options.length > 0 && /* @__PURE__ */ React.createElement("details", { className: "ns-advanced" }, /* @__PURE__ */ React.createElement("summary", null, t("advancedOptions")), /* @__PURE__ */ React.createElement("div", { className: "ns-grid" }, def.options.map((option2) => field(`${base}.options.${option2.key}`, { type: option2.type === "boolean" ? "checkbox" : option2.type === "number" ? "number" : "text", choices: option2.choices, help: option2.help[lang], customLabel: option2.label[lang], disabled: locked, min: option2.min, max: option2.max })))), !anonymous && !locked && /* @__PURE__ */ React.createElement("div", { className: "ns-credential" }, /* @__PURE__ */ React.createElement("h5", null, t("credentialTitle")), /* @__PURE__ */ React.createElement("p", null, t(credentialState?.configured ? "credentialConfigured" : "credentialMissing"), " \xB7 ", t("credentialHelp")), /* @__PURE__ */ React.createElement("label", { htmlFor: `secret-${def.id}` }, t("credentialValue")), /* @__PURE__ */ React.createElement("input", { id: `secret-${def.id}`, type: "password", autoComplete: "new-password", value: secrets[def.id] || "", disabled: !!pending || dirty || !credentialState?.writable || !backend2.credentialRef, onChange: (event) => setSecrets((previous) => ({ ...previous, [def.id]: event.target.value })) }), dirty && /* @__PURE__ */ React.createElement("small", { id: `secret-${def.id}-why` }, t("saveBeforeCredential")), /* @__PURE__ */ React.createElement("div", { className: "ns-actions" }, /* @__PURE__ */ React.createElement("button", { disabled: !!pending || dirty || !credentialState?.writable || !secrets[def.id], onClick: () => credential(def.id, false) }, t("replaceCredential")), /* @__PURE__ */ React.createElement("button", { disabled: !!pending || dirty || !credentialState?.writable || !credentialState?.configured, onClick: () => setConfirming({ kind: `delete-credential-${def.id}`, backendId: def.id }) }, t("deleteCredential"))), confirmRow(`delete-credential-${def.id}`, "deleteCredentialConfirm", () => {
|
|
979
|
-
void credential(def.id, true);
|
|
980
|
-
})), /* @__PURE__ */ React.createElement("p", { className: "ns-meta" }, /* @__PURE__ */ React.createElement("span", null, t("attemptsToday"), " ", /* @__PURE__ */ React.createElement("strong", null, snapshot.counters[def.id]?.attempts ?? 0)), /* @__PURE__ */ React.createElement("span", { "aria-hidden": "true" }, "\xB7"), /* @__PURE__ */ React.createElement("span", null, snapshot.counters[def.id]?.day ?? t("noData")))));
|
|
981
|
-
})) : null;
|
|
1012
|
+
}), showTransfer && /* @__PURE__ */ React.createElement("div", { className: "ns-field" }, /* @__PURE__ */ React.createElement("label", { htmlFor: "ns-import" }, t("importLabel")), /* @__PURE__ */ React.createElement("textarea", { id: "ns-import", value: importText, disabled: !!pending, onChange: (event) => setImportText(event.target.value), rows: 8 }), /* @__PURE__ */ React.createElement("button", { disabled: !!pending || !importText.trim(), onClick: importConfig }, t("applyImport"))))), tab === "backends" && /* @__PURE__ */ React.createElement("div", { role: "tabpanel", id: "panel-backends", "aria-labelledby": "tab-backends" }, /* @__PURE__ */ React.createElement("section", { className: "ns-backends", id: "sec-backends", tabIndex: -1, "aria-labelledby": "sec-backends-title" }, /* @__PURE__ */ React.createElement("h3", { id: "sec-backends-title" }, t("backends"), " ", /* @__PURE__ */ React.createElement("span", { className: "ns-muted" }, tr("enabledSummary", { enabled: enabledCount, total: definitions.length }))), /* @__PURE__ */ React.createElement("p", { className: "ns-muted" }, t("backendIntro"), " ", t("colorLegend")), /* @__PURE__ */ React.createElement("div", { className: "ns-toolbar" }, /* @__PURE__ */ React.createElement("div", { className: "ns-field" }, /* @__PURE__ */ React.createElement("label", { htmlFor: "ns-backend-search" }, t("searchBackends")), /* @__PURE__ */ React.createElement("input", { id: "ns-backend-search", type: "search", value: backendQuery, onChange: (event) => setBackendQuery(event.target.value), placeholder: t("searchBackendsPlaceholder") })), /* @__PURE__ */ React.createElement("div", { className: "ns-field" }, /* @__PURE__ */ React.createElement("label", { htmlFor: "ns-backend-filter" }, t("filterBackends")), /* @__PURE__ */ React.createElement("select", { id: "ns-backend-filter", value: backendFilter, onChange: (event) => setBackendFilter(event.target.value) }, ["all", "enabled", "configured"].map((value) => /* @__PURE__ */ React.createElement("option", { key: value, value }, t(`filter.${value}`)))))), ranked.filter(matches).map((def) => {
|
|
1013
|
+
const backend2 = draft.backends[def.id];
|
|
1014
|
+
if (!backend2) return null;
|
|
1015
|
+
const mode2 = def.modes.find((item) => item.mode === backend2.mode);
|
|
1016
|
+
const base = `backends.${def.id}`;
|
|
1017
|
+
const credentialState = snapshot.credentials[def.id];
|
|
1018
|
+
const locked = def.status !== "documented";
|
|
1019
|
+
const anonymous = backend2.mode === "anonymous";
|
|
1020
|
+
return /* @__PURE__ */ React.createElement("details", { className: "ns-card ns-backend", key: def.id }, /* @__PURE__ */ React.createElement("summary", null, /* @__PURE__ */ React.createElement("span", { className: "ns-backend-title" }, def.title), /* @__PURE__ */ React.createElement("span", { className: "ns-chips" }, def.modes.map((item) => /* @__PURE__ */ React.createElement("span", { key: item.mode, className: `ns-chip ${item.mode === backend2.mode ? "is-on" : ""} ${item.tier === "unverified" ? "ns-chip--off" : tierRisk(item.tier)}`, "aria-current": item.mode === backend2.mode ? "true" : void 0, title: t(`choice.${item.mode}`) }, t(`choice.${item.mode}`), " \xB7 ", t(`tier.${item.tier}`))), locked && /* @__PURE__ */ React.createElement("span", { className: "ns-chip ns-chip--off" }, t("unverified")), /* @__PURE__ */ React.createElement("span", { className: `ns-dot ${credentialState?.configured ? "is-on" : "is-off"}`, "aria-hidden": "true" }), /* @__PURE__ */ React.createElement("span", { className: `ns-badge ${backend2.enabled ? "is-on" : ""}` }, backend2.enabled ? t("enabled") : t("disabled")))), /* @__PURE__ */ React.createElement("div", { className: "ns-backend-body" }, locked && /* @__PURE__ */ React.createElement("p", { className: "ns-warning" }, t("unverifiedHelp")), /* @__PURE__ */ React.createElement("p", { className: "ns-quota" }, mode2?.limits[lang], " ", /* @__PURE__ */ React.createElement("a", { href: mode2?.pricingUrl || def.docs, target: "_blank", rel: "noreferrer" }, t("source")), " \xB7 ", t("verifiedAt"), " ", def.verifiedAt || t("notVerified")), /* @__PURE__ */ React.createElement("div", { className: "ns-grid" }, fields([`${base}.enabled`, `${base}.mode`, `${base}.endpoint`, `${base}.credentialRef`, `${base}.timeoutMs`, `${base}.rateLimitPerMinute`, `${base}.dailyAttemptLimit`], { [`${base}.enabled`]: { type: "checkbox", disabled: locked }, [`${base}.mode`]: { choices: def.modes.map((item) => item.mode), disabled: locked }, [`${base}.timeoutMs`]: { type: "number" }, [`${base}.rateLimitPerMinute`]: { type: "number" }, [`${base}.dailyAttemptLimit`]: { type: "number" } }).filter((node) => !(anonymous && node.key === `${base}.credentialRef`))), anonymous && !locked && /* @__PURE__ */ React.createElement("p", { className: "ns-muted" }, t("anonymousNoCredential")), def.options.length > 0 && /* @__PURE__ */ React.createElement("details", { className: "ns-advanced" }, /* @__PURE__ */ React.createElement("summary", null, t("advancedOptions")), /* @__PURE__ */ React.createElement("div", { className: "ns-grid" }, def.options.map((option2) => field(`${base}.options.${option2.key}`, { type: option2.type === "boolean" ? "checkbox" : option2.type === "number" ? "number" : "text", choices: option2.choices, help: option2.help[lang], customLabel: option2.label[lang], disabled: locked, min: option2.min, max: option2.max })))), !anonymous && !locked && /* @__PURE__ */ React.createElement("div", { className: "ns-credential" }, /* @__PURE__ */ React.createElement("h5", null, t("credentialTitle")), /* @__PURE__ */ React.createElement("p", null, t(credentialState?.configured ? "credentialConfigured" : "credentialMissing"), " \xB7 ", t("credentialHelp")), /* @__PURE__ */ React.createElement("p", { className: "ns-credential-shape", "aria-label": t("credentialShapeLabel") }, /* @__PURE__ */ React.createElement("code", null, mode2?.credentialShape?.[lang] ?? t("credentialPlainKey"))), /* @__PURE__ */ React.createElement("label", { htmlFor: `secret-${def.id}` }, t("credentialValue")), /* @__PURE__ */ React.createElement("input", { id: `secret-${def.id}`, type: "password", autoComplete: "new-password", "aria-describedby": `secret-${def.id}-why`, value: secrets[def.id] || "", disabled: credentialDisabled(def.id), onChange: (event) => setSecrets((previous) => ({ ...previous, [def.id]: event.target.value })) }), credentialDisabledReason(def.id) && /* @__PURE__ */ React.createElement("small", { id: `secret-${def.id}-why`, className: "ns-warning" }, credentialDisabledReason(def.id)), /* @__PURE__ */ React.createElement("div", { className: "ns-actions" }, /* @__PURE__ */ React.createElement("button", { disabled: credentialDisabled(def.id) || !secrets[def.id], onClick: () => credential(def.id, false) }, t("replaceCredential")), /* @__PURE__ */ React.createElement("button", { disabled: credentialDisabled(def.id) || !credentialState?.configured, onClick: () => setConfirming({ kind: `delete-credential-${def.id}`, backendId: def.id }) }, t("deleteCredential"))), confirmRow(`delete-credential-${def.id}`, "deleteCredentialConfirm", () => {
|
|
1021
|
+
void credential(def.id, true);
|
|
1022
|
+
})), /* @__PURE__ */ React.createElement("p", { className: "ns-meta" }, /* @__PURE__ */ React.createElement("span", null, t("attemptsToday"), " ", /* @__PURE__ */ React.createElement("strong", null, snapshot.counters[def.id]?.attempts ?? 0)), /* @__PURE__ */ React.createElement("span", { "aria-hidden": "true" }, "\xB7"), /* @__PURE__ */ React.createElement("span", null, snapshot.counters[def.id]?.day ?? t("noData")))));
|
|
982
1023
|
}), !definitions.some(matches) && /* @__PURE__ */ React.createElement("p", { className: "ns-muted" }, t("noMatch")))), /* @__PURE__ */ React.createElement("footer", { className: "ns-footer" }, /* @__PURE__ */ React.createElement("span", { "aria-live": "polite" }, dirty ? tr("unsavedWithErrors", { errors: issues.length }) : t("upToDate")), /* @__PURE__ */ React.createElement("div", { className: "ns-actions" }, /* @__PURE__ */ React.createElement("button", { disabled: !!pending || !dirty, onClick: () => setConfirming({ kind: "discard" }) }, t("discard")), /* @__PURE__ */ React.createElement("button", { className: "ns-primary", disabled: !!pending || !dirty, onClick: save }, t(pending === "save" ? "saving" : "save"))), confirmRow("discard", "discardConfirm", () => {
|
|
983
1024
|
setDraft(clone(snapshot.config));
|
|
984
1025
|
setIssues([]);
|