dsh-all-search 0.2.14 → 0.2.17
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 +7 -4
- package/README.zh.md +7 -2
- package/dist/index.d.ts +29 -0
- package/dist/index.js +126 -14
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
# dsh-all-search
|
|
6
6
|
|
|
7
|
-
Adds a web-search provider to DeepSeek Harness, registered into `ctx.web`. AnySearch is a single MCP gateway that aggregates exa / tavily / firecrawl / context7 behind **one API key**. Optional **TinyFish** search adds free news and academic results, and its full-browser fetch can render JavaScript-heavy pages.
|
|
7
|
+
Adds a web-search provider to DeepSeek Harness, registered into `ctx.web`. AnySearch is a single MCP gateway that aggregates exa / tavily / firecrawl / context7 behind **one API key**. Optional **TinyFish** search adds free news and academic results, and its full-browser fetch can render JavaScript-heavy pages. Optional **DeepSeek** Search/Fetch (`deepseek_api_key`) uses the same Bearer key as the chat API and competes inside the wrapper (not as a second registered search provider).
|
|
8
8
|
|
|
9
9
|
When `api_key` is set, queries go to that gateway. When it is absent, the same `anysearch` provider stays available and searches via **Firecrawl** `POST /v1/search` with no `Authorization` header (keyless). Set optional `firecrawl_api_key` to send `Authorization: Bearer` and use your own quota. NAT/CI runners that share an egress IP share that keyless daily credit pool.
|
|
10
10
|
|
|
11
11
|
With `firecrawl_api_key` and an AnySearch key, developer-intent queries (repo / issue / PR / commit / skill) are answered by the **Firecrawl Developer Index** first -- a semantic artifact index over READMEs, issues, PRs, OpenAPI specs and skills -- falling back to AnySearch when it fails or returns nothing.
|
|
12
12
|
|
|
13
|
-
With `tinyfish_api_key`, news and academic queries route to TinyFish first (`domain_type=news` / `research_paper`), then
|
|
13
|
+
With `tinyfish_api_key`, news and academic queries route to TinyFish first (`domain_type=news` / `research_paper`), then DeepSeek (if configured), then AnySearch or Firecrawl. Set `tinyfish_fetch: true` / `deepseek_fetch: true` to register those as fetch providers (off by default — Harness already has local fetch, and DeepSeek Search is also built into Harness server-side; this plugin path keeps parity with pi-all-search).
|
|
14
14
|
|
|
15
15
|
> Port of [pi-all-search](https://github.com/RetiredPhysicist/pi-plugins/tree/main/packages/pi-all-search).
|
|
16
16
|
|
|
@@ -18,7 +18,7 @@ With `tinyfish_api_key`, news and academic queries route to TinyFish first (`dom
|
|
|
18
18
|
|
|
19
19
|
## Why
|
|
20
20
|
|
|
21
|
-
dsh ships Exa / Perplexity / DeepSeek search. This plugin adds AnySearch: one key, many backends, no per-backend credentials. Without an AnySearch key, Firecrawl still
|
|
21
|
+
dsh ships Exa / Perplexity / DeepSeek search. This plugin adds AnySearch: one key, many backends, no per-backend credentials. Without an AnySearch key, Firecrawl (and optional DeepSeek/TinyFish) still work so the provider is never a no-op.
|
|
22
22
|
|
|
23
23
|
## Quick start
|
|
24
24
|
|
|
@@ -42,10 +42,12 @@ The provider registers as `anysearch` on `ctx.web` -- the built-in `web_search`
|
|
|
42
42
|
| `firecrawl_api_key` | - | optional Firecrawl key (Bearer quota). Also enables the Developer Index branch for repo/issue/PR/skill queries when AnySearch is configured |
|
|
43
43
|
| `tinyfish_api_key` | - | optional TinyFish key. Enables free news/academic search and full-browser fetch. |
|
|
44
44
|
| `tinyfish_fetch` | - | register TinyFish as the fetch provider (default `false`; the host usually supplies a local fetch provider) |
|
|
45
|
+
| `deepseek_api_key` | - | optional DeepSeek key. Enables DeepSeek Search inside the `anysearch` wrapper (`POST /v1/tools/search`). |
|
|
46
|
+
| `deepseek_fetch` | - | register DeepSeek as a fetch provider (default `false`; same reason as `tinyfish_fetch`) |
|
|
45
47
|
|
|
46
48
|
Without an AnySearch key the provider still reports `available() = true` and searches Firecrawl keyless. Hosts that share an egress IP (NAT, CI) share those daily credits; set `firecrawl_api_key` for a private quota.
|
|
47
49
|
|
|
48
|
-
Search routing
|
|
50
|
+
Search routing: developer queries → Developer Index → TinyFish (news/academic) → DeepSeek → AnySearch → TinyFish → Firecrawl. Every key is optional, so any subset of providers still answers queries.
|
|
49
51
|
|
|
50
52
|
## Privacy
|
|
51
53
|
|
|
@@ -53,6 +55,7 @@ Search routing with a TinyFish key: developer queries → Developer Index → Ti
|
|
|
53
55
|
- With `api_key`, only your query and result count go to the AnySearch gateway.
|
|
54
56
|
- Without `api_key`, the query goes to Firecrawl `/v1/search`.
|
|
55
57
|
- With `tinyfish_api_key`, TinyFish keeps every query and fetched URL under its `/usage` endpoint. Treat it as a non-private retrieval layer.
|
|
58
|
+
- With `deepseek_api_key`, queries go to DeepSeek `tools/search` (and optionally `tools/fetch`); same privacy posture as the DeepSeek chat API.
|
|
56
59
|
|
|
57
60
|
## Development
|
|
58
61
|
|
package/README.zh.md
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
# dsh-all-search
|
|
6
6
|
|
|
7
|
-
给 DeepSeek Harness 加一个网页搜索 provider,注册进 `ctx.web`。AnySearch 是单 MCP 网关,一把 API key 聚合 exa / tavily / firecrawl / context7 等多家搜索。可选的 **TinyFish** 补充免费新闻与学术搜索,其全浏览器 Fetch 能渲染 JavaScript
|
|
7
|
+
给 DeepSeek Harness 加一个网页搜索 provider,注册进 `ctx.web`。AnySearch 是单 MCP 网关,一把 API key 聚合 exa / tavily / firecrawl / context7 等多家搜索。可选的 **TinyFish** 补充免费新闻与学术搜索,其全浏览器 Fetch 能渲染 JavaScript 重的页面。可选 **DeepSeek** Search/Fetch(`deepseek_api_key`)与聊天共用 Bearer key,在 wrapper 内竞争(不会再注册第二个 search provider)。
|
|
8
8
|
|
|
9
9
|
配置了 api_key 时查询走 AnySearch 网关。没有 AnySearch key 时,同一个 anysearch provider 仍可用,改走 Firecrawl POST /v1/search,不带 Authorization(keyless)。若设置可选的 firecrawl_api_key,则发送 Authorization: Bearer 并使用你自己的配额。共享出口 IP 的 NAT/CI 会共用这份无 key 日额度。
|
|
10
10
|
|
|
11
|
-
设置 tinyfish_api_key 后,新闻与学术查询优先走 TinyFish(`domain_type=news` / `research_paper`)
|
|
11
|
+
设置 tinyfish_api_key 后,新闻与学术查询优先走 TinyFish(`domain_type=news` / `research_paper`),再 DeepSeek(若配置),再 AnySearch 或 Firecrawl。设置 `tinyfish_fetch: true` / `deepseek_fetch: true` 会注册对应 fetch provider(默认关——宿主通常自带本地 fetch;Harness 服务端也已内置 DeepSeek Search,本插件路径与 pi-all-search 对齐)。
|
|
12
12
|
|
|
13
13
|
> 由 [pi-all-search](https://github.com/RetiredPhysicist/pi-plugins/tree/main/packages/pi-all-search) 移植。
|
|
14
14
|
|
|
@@ -40,15 +40,20 @@ provider 以 `anysearch` 注册到 `ctx.web`,内置的 `web_search` 工具会自
|
|
|
40
40
|
| `firecrawl_api_key` | – | 可选 Firecrawl key(Bearer 配额)。配置 AnySearch 时还启用 Developer Index 分支 |
|
|
41
41
|
| `tinyfish_api_key` | – | 可选 TinyFish key。启用免费新闻/学术搜索与全浏览器 Fetch |
|
|
42
42
|
| `tinyfish_fetch` | – | 把 TinyFish 注册为 fetch provider(默认 `false`,宿主通常自带本地 fetch provider) |
|
|
43
|
+
| `deepseek_api_key` | – | 可选 DeepSeek key。在 `anysearch` wrapper 内启用 DeepSeek Search(`POST /v1/tools/search`) |
|
|
44
|
+
| `deepseek_fetch` | – | 把 DeepSeek 注册为 fetch provider(默认 `false`,原因同 `tinyfish_fetch`) |
|
|
43
45
|
|
|
44
46
|
没有 AnySearch key 时 provider 仍 available() = true,走 Firecrawl keyless。共享出口 IP 的 NAT/CI 会共用日额度;需要独立配额时设置 firecrawl_api_key。
|
|
45
47
|
|
|
48
|
+
搜索路由:开发者查询 → Developer Index → TinyFish(新闻/学术)→ DeepSeek → AnySearch → TinyFish → Firecrawl。每把 key 都可选。
|
|
49
|
+
|
|
46
50
|
## 隐私
|
|
47
51
|
|
|
48
52
|
- key 只存在于你的配置文件——不写日志
|
|
49
53
|
- 有 api_key 时只向 AnySearch 网关发送查询词和结果数量
|
|
50
54
|
- 没有 api_key 时查询发往 Firecrawl /v1/search
|
|
51
55
|
- 配置 tinyfish_api_key 后,TinyFish 会在其 `/usage` 端点保留每次查询与抓取的 URL,按非私密检索层对待
|
|
56
|
+
- 配置 deepseek_api_key 后,查询发往 DeepSeek `tools/search`(以及可选的 `tools/fetch`),隐私面与 DeepSeek 聊天 API 相同
|
|
52
57
|
|
|
53
58
|
## 开发
|
|
54
59
|
|
package/dist/index.d.ts
CHANGED
|
@@ -19,11 +19,21 @@ export interface Config {
|
|
|
19
19
|
* or when `fetchProvider` is pinned to `tinyfish`.
|
|
20
20
|
*/
|
|
21
21
|
tinyfish_fetch?: boolean;
|
|
22
|
+
/** DeepSeek API key — enables DeepSeek Search inside the anysearch wrapper. */
|
|
23
|
+
deepseek_api_key?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Register DeepSeek as a fetch provider. Off by default for the same reason
|
|
26
|
+
* as `tinyfish_fetch` — the host usually already supplies a local fetch.
|
|
27
|
+
* Enable when you want DeepSeek tools/fetch (same key as search).
|
|
28
|
+
*/
|
|
29
|
+
deepseek_fetch?: boolean;
|
|
22
30
|
}
|
|
23
31
|
export declare const Config: z<Config>;
|
|
24
32
|
export declare const FIRECRAWL_SEARCH_URL = "https://api.firecrawl.dev/v1/search";
|
|
25
33
|
export declare const TINYFISH_SEARCH_URL = "https://api.search.tinyfish.ai";
|
|
26
34
|
export declare const TINYFISH_FETCH_URL = "https://api.fetch.tinyfish.ai";
|
|
35
|
+
export declare const DEEPSEEK_SEARCH_URL = "https://api.deepseek.com/v1/tools/search";
|
|
36
|
+
export declare const DEEPSEEK_FETCH_URL = "https://api.deepseek.com/v1/tools/fetch";
|
|
27
37
|
export declare function isDeveloperQuery(query: string): boolean;
|
|
28
38
|
export declare function isNewsQuery(query: string): boolean;
|
|
29
39
|
export declare function isAcademicQuery(query: string): boolean;
|
|
@@ -73,4 +83,23 @@ export declare class TinyFishFetchProvider implements WebFetchProvider {
|
|
|
73
83
|
available(): boolean;
|
|
74
84
|
fetch(request: WebFetchRequest, signal?: AbortSignal): Promise<WebFetchResult>;
|
|
75
85
|
}
|
|
86
|
+
/** DeepSeek Search — self-hosted search API (same Bearer key as chat). */
|
|
87
|
+
export declare class DeepSeekSearchProvider implements WebSearchProvider {
|
|
88
|
+
private readonly apiKey;
|
|
89
|
+
readonly id = "deepseek";
|
|
90
|
+
constructor(apiKey: string);
|
|
91
|
+
available(): boolean;
|
|
92
|
+
search(request: WebSearchRequest, signal?: AbortSignal): Promise<WebSearchResult>;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* DeepSeek fetch — single-URL markdown extraction via tools/fetch.
|
|
96
|
+
* Opt-in via `deepseek_fetch` so the host local fetch stays the default.
|
|
97
|
+
*/
|
|
98
|
+
export declare class DeepSeekFetchProvider implements WebFetchProvider {
|
|
99
|
+
private readonly apiKey;
|
|
100
|
+
readonly id = "deepseek";
|
|
101
|
+
constructor(apiKey: string);
|
|
102
|
+
available(): boolean;
|
|
103
|
+
fetch(request: WebFetchRequest, signal?: AbortSignal): Promise<WebFetchResult>;
|
|
104
|
+
}
|
|
76
105
|
export declare function apply(ctx: Context, config: Config): void;
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
// dsh-all-search — DeepSeek Harness (Cordis) plugin.
|
|
2
2
|
//
|
|
3
|
-
// Registers one WebSearchProvider (id anysearch) and
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
3
|
+
// Registers one WebSearchProvider (id anysearch) and optional WebFetchProviders
|
|
4
|
+
// with ctx.web. AnySearch is a MCP gateway that aggregates exa / tavily /
|
|
5
|
+
// firecrawl / context7 behind one API key. When that key is set, queries stay
|
|
6
|
+
// on the gateway (developer-intent queries may try the Firecrawl Developer
|
|
7
|
+
// Index first). When the AnySearch key is absent, the same wrapper stays
|
|
8
|
+
// available and searches via Firecrawl POST /v1/search — no Authorization
|
|
9
|
+
// header unless firecrawl_api_key is set (then Bearer, own quota).
|
|
10
|
+
//
|
|
11
|
+
// DeepSeek Search/Fetch (DEEPSEEK_API_KEY / deepseek_api_key) compete inside
|
|
12
|
+
// the same wrapper — never as a second registered search provider, because
|
|
13
|
+
// dsh-web errors on WEB_PROVIDER_AMBIGUOUS. Harness already exposes DeepSeek
|
|
14
|
+
// search server-side; this path keeps all-search consistent with pi-all-search.
|
|
11
15
|
//
|
|
12
16
|
// The dsh-web seam errors on multiple usable providers
|
|
13
17
|
// (WEB_PROVIDER_AMBIGUOUS) unless one is configured explicitly, so this plugin
|
|
14
|
-
// registers exactly one provider
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
+
// registers exactly one search provider (the anysearch wrapper). TinyFish and
|
|
19
|
+
// DeepSeek compete inside it. Fetch registers only when explicitly enabled
|
|
20
|
+
// (tinyfish_fetch / deepseek_fetch), because the host already supplies a local
|
|
21
|
+
// fetch provider.
|
|
18
22
|
//
|
|
19
23
|
// Privacy: API keys live in the plugin config only; they are never logged.
|
|
20
24
|
import z from '@deepseek-ai/schemastery';
|
|
@@ -26,11 +30,15 @@ export const Config = z.object({
|
|
|
26
30
|
firecrawl_api_key: z.string().description('Firecrawl API key (optional) — Bearer for Firecrawl quota; also enables Developer Index when AnySearch is configured'),
|
|
27
31
|
tinyfish_api_key: z.string().description('TinyFish API key (optional) — enables TinyFish search and full-browser fetch'),
|
|
28
32
|
tinyfish_fetch: z.boolean().description('Register TinyFish as the fetch provider (default false — the host usually supplies a local fetch provider)'),
|
|
33
|
+
deepseek_api_key: z.string().description('DeepSeek API key (optional) — enables DeepSeek Search inside the anysearch wrapper'),
|
|
34
|
+
deepseek_fetch: z.boolean().description('Register DeepSeek as a fetch provider (default false — the host usually supplies a local fetch provider)'),
|
|
29
35
|
});
|
|
30
36
|
const DEFAULT_BASE_URL = 'https://api.anysearch.com/mcp';
|
|
31
37
|
export const FIRECRAWL_SEARCH_URL = 'https://api.firecrawl.dev/v1/search';
|
|
32
38
|
export const TINYFISH_SEARCH_URL = 'https://api.search.tinyfish.ai';
|
|
33
39
|
export const TINYFISH_FETCH_URL = 'https://api.fetch.tinyfish.ai';
|
|
40
|
+
export const DEEPSEEK_SEARCH_URL = 'https://api.deepseek.com/v1/tools/search';
|
|
41
|
+
export const DEEPSEEK_FETCH_URL = 'https://api.deepseek.com/v1/tools/fetch';
|
|
34
42
|
const DEVELOPER_QUERY_RE = /\b(repo|repos|repository|repositories|github|issue|issues|pull request|pull requests|commit|commits|branch|merge|openapi|readme|skill|skills|library|framework)\b/i;
|
|
35
43
|
const NEWS_QUERY_RE = /\b(news|latest|today|breaking|announced|announcement|update|released|release|happened|current|recent)\b/i;
|
|
36
44
|
const ACADEMIC_QUERY_RE = /\b(paper|papers|research|journal|doi|arxiv|scholar|academic|study|thesis|citation|citations)\b/i;
|
|
@@ -246,17 +254,108 @@ export class TinyFishFetchProvider {
|
|
|
246
254
|
};
|
|
247
255
|
}
|
|
248
256
|
}
|
|
257
|
+
/** DeepSeek Search — self-hosted search API (same Bearer key as chat). */
|
|
258
|
+
export class DeepSeekSearchProvider {
|
|
259
|
+
apiKey;
|
|
260
|
+
id = 'deepseek';
|
|
261
|
+
constructor(apiKey) {
|
|
262
|
+
this.apiKey = apiKey;
|
|
263
|
+
}
|
|
264
|
+
available() {
|
|
265
|
+
return Boolean(this.apiKey);
|
|
266
|
+
}
|
|
267
|
+
async search(request, signal) {
|
|
268
|
+
const count = Math.min(Math.max(request.maxResults ?? 5, 1), 50);
|
|
269
|
+
const resp = await fetch(DEEPSEEK_SEARCH_URL, {
|
|
270
|
+
method: 'POST',
|
|
271
|
+
headers: {
|
|
272
|
+
'Content-Type': 'application/json',
|
|
273
|
+
Authorization: `Bearer ${this.apiKey}`,
|
|
274
|
+
},
|
|
275
|
+
signal,
|
|
276
|
+
body: JSON.stringify({ query: request.query, count, need_content: false }),
|
|
277
|
+
});
|
|
278
|
+
if (!resp.ok)
|
|
279
|
+
throw new Error(`DeepSeek search HTTP ${resp.status}`);
|
|
280
|
+
const data = (await resp.json());
|
|
281
|
+
const sources = (data.results ?? []).map((r) => ({
|
|
282
|
+
title: r.title ?? '',
|
|
283
|
+
url: r.url ?? '',
|
|
284
|
+
snippet: (r.summary || r.snippet || '').trim(),
|
|
285
|
+
...(r.date ? { publishedAt: String(r.date) } : {}),
|
|
286
|
+
}));
|
|
287
|
+
const truncated = request.maxResults !== undefined && sources.length > request.maxResults;
|
|
288
|
+
return {
|
|
289
|
+
sources: truncated ? sources.slice(0, request.maxResults) : sources,
|
|
290
|
+
truncated,
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* DeepSeek fetch — single-URL markdown extraction via tools/fetch.
|
|
296
|
+
* Opt-in via `deepseek_fetch` so the host local fetch stays the default.
|
|
297
|
+
*/
|
|
298
|
+
export class DeepSeekFetchProvider {
|
|
299
|
+
apiKey;
|
|
300
|
+
id = 'deepseek';
|
|
301
|
+
constructor(apiKey) {
|
|
302
|
+
this.apiKey = apiKey;
|
|
303
|
+
}
|
|
304
|
+
available() {
|
|
305
|
+
return Boolean(this.apiKey);
|
|
306
|
+
}
|
|
307
|
+
async fetch(request, signal) {
|
|
308
|
+
const resp = await fetch(DEEPSEEK_FETCH_URL, {
|
|
309
|
+
method: 'POST',
|
|
310
|
+
headers: {
|
|
311
|
+
'Content-Type': 'application/json',
|
|
312
|
+
Authorization: `Bearer ${this.apiKey}`,
|
|
313
|
+
},
|
|
314
|
+
signal,
|
|
315
|
+
body: JSON.stringify({ url: request.url }),
|
|
316
|
+
});
|
|
317
|
+
if (!resp.ok) {
|
|
318
|
+
return {
|
|
319
|
+
url: request.url,
|
|
320
|
+
statusCode: resp.status,
|
|
321
|
+
body: { kind: 'text', content: `DeepSeek fetch HTTP ${resp.status}` },
|
|
322
|
+
truncated: false,
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
const data = (await resp.json());
|
|
326
|
+
const content = (data.content ?? '').trim();
|
|
327
|
+
if (!content) {
|
|
328
|
+
return {
|
|
329
|
+
url: request.url,
|
|
330
|
+
statusCode: 404,
|
|
331
|
+
body: { kind: 'text', content: 'DeepSeek fetch returned no content' },
|
|
332
|
+
truncated: false,
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
const body = data.title ? `# ${data.title}\n\n${content}` : content;
|
|
336
|
+
return {
|
|
337
|
+
url: request.url,
|
|
338
|
+
statusCode: 200,
|
|
339
|
+
body: { kind: 'text', content: body },
|
|
340
|
+
truncated: false,
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
}
|
|
249
344
|
export function apply(ctx, config) {
|
|
250
345
|
const anysearch = new AnysearchProvider(config.api_key ?? '', config.base_url ?? DEFAULT_BASE_URL);
|
|
251
346
|
const firecrawl = new FirecrawlSearchProvider(config.firecrawl_api_key);
|
|
252
347
|
const devIndex = config.firecrawl_api_key ? new FirecrawlDevProvider(config.firecrawl_api_key) : null;
|
|
253
348
|
const tinyfish = config.tinyfish_api_key ? new TinyFishSearchProvider(config.tinyfish_api_key) : null;
|
|
349
|
+
const deepseek = config.deepseek_api_key ? new DeepSeekSearchProvider(config.deepseek_api_key) : null;
|
|
254
350
|
// Single provider to avoid dsh-web's WEB_PROVIDER_AMBIGUOUS on multiple
|
|
255
351
|
// usable providers. Priority: Dev Index (developer queries) → TinyFish
|
|
256
|
-
// (news/academic) → AnySearch gateway → TinyFish → Firecrawl
|
|
352
|
+
// (news/academic) → DeepSeek → AnySearch gateway → TinyFish → Firecrawl.
|
|
257
353
|
const wrapper = {
|
|
258
354
|
id: 'anysearch',
|
|
259
|
-
available: () => Boolean(config.api_key) ||
|
|
355
|
+
available: () => Boolean(config.api_key) ||
|
|
356
|
+
Boolean(config.tinyfish_api_key) ||
|
|
357
|
+
Boolean(config.deepseek_api_key) ||
|
|
358
|
+
firecrawl.available(),
|
|
260
359
|
async search(request, signal) {
|
|
261
360
|
if (devIndex && isDeveloperQuery(request.query)) {
|
|
262
361
|
try {
|
|
@@ -278,6 +377,16 @@ export function apply(ctx, config) {
|
|
|
278
377
|
// fall through to the next provider
|
|
279
378
|
}
|
|
280
379
|
}
|
|
380
|
+
if (deepseek) {
|
|
381
|
+
try {
|
|
382
|
+
const ds = await deepseek.search(request, signal);
|
|
383
|
+
if (ds.sources.length > 0)
|
|
384
|
+
return ds;
|
|
385
|
+
}
|
|
386
|
+
catch {
|
|
387
|
+
// fall through to the next provider
|
|
388
|
+
}
|
|
389
|
+
}
|
|
281
390
|
if (config.api_key) {
|
|
282
391
|
return anysearch.search(request, signal);
|
|
283
392
|
}
|
|
@@ -298,4 +407,7 @@ export function apply(ctx, config) {
|
|
|
298
407
|
if (config.tinyfish_fetch && config.tinyfish_api_key && typeof ctx.web.registerFetchProvider === 'function') {
|
|
299
408
|
ctx.web.registerFetchProvider(new TinyFishFetchProvider(config.tinyfish_api_key));
|
|
300
409
|
}
|
|
410
|
+
if (config.deepseek_fetch && config.deepseek_api_key && typeof ctx.web.registerFetchProvider === 'function') {
|
|
411
|
+
ctx.web.registerFetchProvider(new DeepSeekFetchProvider(config.deepseek_api_key));
|
|
412
|
+
}
|
|
301
413
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-all-search",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "DeepSeek Harness plugin: AnySearch-backed web search
|
|
3
|
+
"version": "0.2.17",
|
|
4
|
+
"description": "DeepSeek Harness plugin: AnySearch-backed web search with optional TinyFish and DeepSeek search/fetch, registered into ctx.web.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
],
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@deepseek-ai/cordis": "~4.0.5
|
|
34
|
-
"@deepseek-ai/dsh-web": "0.2.1-
|
|
35
|
-
"@deepseek-ai/schemastery": "~3.18.5
|
|
33
|
+
"@deepseek-ai/cordis": "~4.0.5",
|
|
34
|
+
"@deepseek-ai/dsh-web": "0.2.1-rc.2",
|
|
35
|
+
"@deepseek-ai/schemastery": "~3.18.5"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/node": "^22.0.0",
|