dsh-all-search 0.1.0 → 0.1.2
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 -9
- package/README.zh.md +6 -8
- package/cordis.patch.yml +2 -2
- package/dist/index.d.ts +3 -5
- package/dist/index.js +10 -25
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -17,30 +17,28 @@ dsh ships Exa / Perplexity / DeepSeek search. This plugin adds AnySearch: one ke
|
|
|
17
17
|
## Quick start
|
|
18
18
|
|
|
19
19
|
```sh
|
|
20
|
-
dsh plugin add dsh-all-search
|
|
20
|
+
dsh plugin --profile web add dsh-all-search
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
The provider registers as `anysearch` on `ctx.web` — the built-in `web_search` tool picks it up alongside the stock providers.
|
|
24
24
|
|
|
25
25
|
```yaml
|
|
26
|
-
- id: search
|
|
26
|
+
- id: all-search
|
|
27
27
|
name: dsh-all-search
|
|
28
28
|
config:
|
|
29
|
-
|
|
30
|
-
# api_key: <direct value>
|
|
29
|
+
api_key: <your anysearch key>
|
|
31
30
|
```
|
|
32
31
|
|
|
33
32
|
| key | required | meaning |
|
|
34
33
|
|---|---|---|
|
|
35
|
-
| `
|
|
36
|
-
| `api_key` | * | direct key value (fallback) |
|
|
34
|
+
| `api_key` | ✅ | your AnySearch key |
|
|
37
35
|
| `base_url` | – | MCP endpoint override |
|
|
38
36
|
|
|
39
|
-
|
|
37
|
+
Without a key the provider reports `available() = false` and the seam skips it.
|
|
40
38
|
|
|
41
39
|
## Privacy
|
|
42
40
|
|
|
43
|
-
- The key
|
|
41
|
+
- The key lives only in your config file — never logged.
|
|
44
42
|
- Only your query and result count go to the AnySearch gateway.
|
|
45
43
|
|
|
46
44
|
## Development
|
|
@@ -55,7 +53,7 @@ npm run build
|
|
|
55
53
|
Live search test:
|
|
56
54
|
|
|
57
55
|
```bash
|
|
58
|
-
|
|
56
|
+
node --import tsx tests/real/real-search.mjs
|
|
59
57
|
```
|
|
60
58
|
|
|
61
59
|
## License
|
package/README.zh.md
CHANGED
|
@@ -17,30 +17,28 @@ dsh 自带 Exa / Perplexity / DeepSeek 搜索。本插件补 AnySearch:一把 ke
|
|
|
17
17
|
## 快速开始
|
|
18
18
|
|
|
19
19
|
```sh
|
|
20
|
-
dsh plugin add dsh-all-search
|
|
20
|
+
dsh plugin --profile web add dsh-all-search
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
provider 以 `anysearch` 注册到 `ctx.web`,内置的 `web_search` 工具会自动识别,与自带 provider 并存。
|
|
24
24
|
|
|
25
25
|
```yaml
|
|
26
|
-
- id: search
|
|
26
|
+
- id: all-search
|
|
27
27
|
name: dsh-all-search
|
|
28
28
|
config:
|
|
29
|
-
|
|
30
|
-
# api_key: <直接填 key>
|
|
29
|
+
api_key: <你的 anysearch key>
|
|
31
30
|
```
|
|
32
31
|
|
|
33
32
|
| 键 | 必填 | 说明 |
|
|
34
33
|
|---|---|---|
|
|
35
|
-
| `
|
|
36
|
-
| `api_key` | * | 直接填 key(备用) |
|
|
34
|
+
| `api_key` | ✅ | 你的 AnySearch key |
|
|
37
35
|
| `base_url` | – | MCP 端点覆盖 |
|
|
38
36
|
|
|
39
37
|
\* 两个 key 键填其一。没有 key 时 provider `available() = false`,seam 自动跳过。
|
|
40
38
|
|
|
41
39
|
## 隐私
|
|
42
40
|
|
|
43
|
-
- key
|
|
41
|
+
- key 只存在于你的配置文件——不写日志
|
|
44
42
|
- 只向 AnySearch 网关发送查询词和结果数量
|
|
45
43
|
|
|
46
44
|
## 开发
|
|
@@ -55,7 +53,7 @@ npm run build
|
|
|
55
53
|
真实搜索测试:
|
|
56
54
|
|
|
57
55
|
```bash
|
|
58
|
-
|
|
56
|
+
node --import tsx tests/real/real-search.mjs
|
|
59
57
|
```
|
|
60
58
|
|
|
61
59
|
## License
|
package/cordis.patch.yml
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
# Registers the AnySearch search provider into ctx.web. Configure the API key
|
|
3
3
|
# via a credential ref (recommended) or a direct value:
|
|
4
4
|
#
|
|
5
|
-
# - id: search
|
|
5
|
+
# - id: all-search
|
|
6
6
|
# name: 'dsh-all-search'
|
|
7
7
|
# config:
|
|
8
8
|
# api_key_ref: ANYSEARCH_API_KEY # env var name (recommended)
|
|
9
9
|
- insert:
|
|
10
|
-
- id: search
|
|
10
|
+
- id: all-search
|
|
11
11
|
name: 'dsh-all-search'
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { Context } from '@deepseek-ai/cordis';
|
|
2
2
|
import z from '@deepseek-ai/schemastery';
|
|
3
3
|
import type { WebSearchProvider, WebSearchRequest, WebSearchResult } from '@deepseek-ai/dsh-web';
|
|
4
|
-
export declare const name = "
|
|
4
|
+
export declare const name = "all-search";
|
|
5
5
|
export declare const inject: string[];
|
|
6
6
|
export interface Config {
|
|
7
|
-
/**
|
|
8
|
-
|
|
9
|
-
/** Direct API key value (fallback when no ref is set). */
|
|
10
|
-
api_key?: string;
|
|
7
|
+
/** AnySearch API key. */
|
|
8
|
+
api_key: string;
|
|
11
9
|
/** AnySearch MCP endpoint override. */
|
|
12
10
|
base_url?: string;
|
|
13
11
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// dsh-search — DeepSeek Harness (Cordis) plugin.
|
|
1
|
+
// dsh-all-search — DeepSeek Harness (Cordis) plugin.
|
|
2
2
|
//
|
|
3
3
|
// Registers an AnySearch-backed WebSearchProvider with ctx.web. AnySearch is
|
|
4
4
|
// a single MCP gateway that aggregates exa / tavily / firecrawl / context7
|
|
@@ -7,15 +7,12 @@
|
|
|
7
7
|
// Ported from pi-all-search (providers/anysearch.ts) with the pi UI/typebox
|
|
8
8
|
// surface replaced by the dsh WebSearchProvider seam.
|
|
9
9
|
//
|
|
10
|
-
// Privacy: the API key
|
|
11
|
-
// (recommended) or a direct config value; it is never logged.
|
|
10
|
+
// Privacy: the API key lives in the plugin config only; it is never logged.
|
|
12
11
|
import z from '@deepseek-ai/schemastery';
|
|
13
|
-
|
|
14
|
-
export const
|
|
15
|
-
export const inject = ['web', 'credentials'];
|
|
12
|
+
export const name = 'all-search';
|
|
13
|
+
export const inject = ['web'];
|
|
16
14
|
export const Config = z.object({
|
|
17
|
-
|
|
18
|
-
api_key: z.string().description('Direct API key value (fallback when no ref is set)'),
|
|
15
|
+
api_key: z.string().required().description('AnySearch API key'),
|
|
19
16
|
base_url: z.string().description('AnySearch MCP endpoint override (default https://api.anysearch.com/mcp)'),
|
|
20
17
|
});
|
|
21
18
|
const DEFAULT_BASE_URL = 'https://api.anysearch.com/mcp';
|
|
@@ -76,26 +73,14 @@ export class AnysearchProvider {
|
|
|
76
73
|
}
|
|
77
74
|
}
|
|
78
75
|
export function apply(ctx, config) {
|
|
79
|
-
//
|
|
80
|
-
// reaches the next search without a restart, and the key never lands in
|
|
81
|
-
// config/logs. `available()` is a cheap local check — no network.
|
|
76
|
+
// `available()` is a cheap local check — no network.
|
|
82
77
|
const wrapper = {
|
|
83
78
|
id: 'anysearch',
|
|
84
|
-
available: () => Boolean(config.
|
|
79
|
+
available: () => Boolean(config.api_key),
|
|
85
80
|
async search(request, signal) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
const resolved = await ctx.credentials.resolve(credentialRef(config.api_key_ref));
|
|
90
|
-
key = resolved.value;
|
|
91
|
-
}
|
|
92
|
-
catch (e) {
|
|
93
|
-
throw new Error(`api_key_ref '${config.api_key_ref}' unresolvable: ${String(e).slice(0, 120)}`);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
if (!key)
|
|
97
|
-
throw new Error('AnySearch API key not configured (set api_key_ref or api_key)');
|
|
98
|
-
return new AnysearchProvider(key, config.base_url ?? DEFAULT_BASE_URL).search(request, signal);
|
|
81
|
+
if (!config.api_key)
|
|
82
|
+
throw new Error('AnySearch API key not configured (set api_key in the plugin config)');
|
|
83
|
+
return new AnysearchProvider(config.api_key, config.base_url ?? DEFAULT_BASE_URL).search(request, signal);
|
|
99
84
|
},
|
|
100
85
|
};
|
|
101
86
|
ctx.web.registerSearchProvider(wrapper);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-all-search",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "DeepSeek Harness plugin: AnySearch-backed web search provider (aggregates exa/tavily/firecrawl via one MCP gateway) registered into ctx.web.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -29,8 +29,7 @@
|
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
32
|
-
"@deepseek-ai/dsh-
|
|
33
|
-
"@deepseek-ai/dsh-web": "^0.0.1-rc.1",
|
|
32
|
+
"@deepseek-ai/dsh-web": "^0.1.0-rc.7",
|
|
34
33
|
"@deepseek-ai/schemastery": "^3.18.0"
|
|
35
34
|
},
|
|
36
35
|
"devDependencies": {
|
|
@@ -46,5 +45,8 @@
|
|
|
46
45
|
"repository": {
|
|
47
46
|
"type": "git",
|
|
48
47
|
"url": "https://github.com/RealAlexandreAI/dsh-all-search"
|
|
48
|
+
},
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">=20.0.0"
|
|
49
51
|
}
|
|
50
52
|
}
|