@tonydua/dsh-web-search-exa 0.1.4 → 0.2.1
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.i18n.yaml +2 -2
- package/README.md +246 -194
- package/README.zh.md +237 -104
- package/lib/index.d.ts +437 -0
- package/lib/index.js +509 -236
- package/package.json +33 -12
- package/lib/types/index.d.ts +0 -70
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tonydua/dsh-web-search-exa",
|
|
3
3
|
"description": "Zero-config Exa web search provider for DeepSeek Harness (dsh): keyless anonymous MCP fallback (mcp.exa.ai/mcp) plus keyed REST search — a drop-in WebSearchProvider for the ctx.web seam, no API key required.",
|
|
4
|
-
"version": "0.1
|
|
4
|
+
"version": "0.2.1",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|
|
7
7
|
"dsh",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
},
|
|
28
28
|
"type": "module",
|
|
29
29
|
"main": "lib/index.js",
|
|
30
|
-
"types": "lib/
|
|
30
|
+
"types": "lib/index.d.ts",
|
|
31
31
|
"exports": {
|
|
32
32
|
".": {
|
|
33
|
-
"types": "./lib/
|
|
33
|
+
"types": "./lib/index.d.ts",
|
|
34
34
|
"default": "./lib/index.js"
|
|
35
35
|
},
|
|
36
36
|
"./package.json": "./package.json"
|
|
@@ -42,30 +42,51 @@
|
|
|
42
42
|
"dsh": {
|
|
43
43
|
"bundle": {
|
|
44
44
|
"patch": "./cordis.patch.yml"
|
|
45
|
+
},
|
|
46
|
+
"compatibility": {
|
|
47
|
+
"dshReleases": {
|
|
48
|
+
"0.2.0-rc.1": "compatible",
|
|
49
|
+
"0.2.0-rc.2": "compatible",
|
|
50
|
+
"0.2.1-alpha.1": "compatible"
|
|
51
|
+
}
|
|
45
52
|
}
|
|
46
53
|
},
|
|
47
54
|
"publishConfig": {
|
|
48
55
|
"access": "public"
|
|
49
56
|
},
|
|
50
57
|
"scripts": {
|
|
51
|
-
"
|
|
58
|
+
"build": "tsdown",
|
|
59
|
+
"typecheck": "tsc --noEmit",
|
|
60
|
+
"pretest": "pnpm run build",
|
|
61
|
+
"test": "node --test test/index.test.js",
|
|
62
|
+
"test:only": "node --test test/index.test.js",
|
|
63
|
+
"prepublishOnly": "pnpm run build",
|
|
64
|
+
"compat": "bash scripts/compat-matrix.sh"
|
|
52
65
|
},
|
|
53
66
|
"peerDependencies": {
|
|
54
|
-
"@deepseek-ai/cordis": "
|
|
55
|
-
"@deepseek-ai/dsh-launch-environment": "
|
|
56
|
-
"@deepseek-ai/dsh-settings": "
|
|
57
|
-
"@deepseek-ai/dsh-web": "
|
|
67
|
+
"@deepseek-ai/cordis": ">=4.0.2 || >=4.0.5-alpha.1",
|
|
68
|
+
"@deepseek-ai/dsh-launch-environment": ">=0.1.2-alpha.2 || >=0.1.3-alpha.2 || >=0.1.4-0 || >=0.1.5-alpha.1 || >=0.1.6-alpha.1 || >=0.1.7-alpha.1 || >=0.1.8 || >=0.2.0-rc.1 || >=0.2.1-alpha.1",
|
|
69
|
+
"@deepseek-ai/dsh-settings": ">=0.1.2-alpha.2 || >=0.1.3-alpha.2 || >=0.1.4-0 || >=0.1.5-alpha.1 || >=0.1.6-alpha.1 || >=0.1.7-alpha.1 || >=0.1.8 || >=0.2.0-rc.1 || >=0.2.1-alpha.1",
|
|
70
|
+
"@deepseek-ai/dsh-web": ">=0.1.2-alpha.2 || >=0.1.3-alpha.2 || >=0.1.4-0 || >=0.1.5-alpha.1 || >=0.1.6-alpha.1 || >=0.1.7-alpha.1 || >=0.1.8 || >=0.2.0-rc.1 || >=0.2.1-alpha.1"
|
|
71
|
+
},
|
|
72
|
+
"peerDependenciesMeta": {
|
|
73
|
+
"@deepseek-ai/dsh-settings": {
|
|
74
|
+
"optional": true
|
|
75
|
+
}
|
|
58
76
|
},
|
|
59
77
|
"dependencies": {
|
|
60
78
|
"@deepseek-ai/schemastery": "^3.18.2"
|
|
61
79
|
},
|
|
62
80
|
"devDependencies": {
|
|
63
81
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
64
|
-
"@deepseek-ai/dsh-launch-environment": "^0.1.
|
|
65
|
-
"@deepseek-ai/dsh-settings": "^0.1.
|
|
66
|
-
"@deepseek-ai/dsh-web": "^0.1.
|
|
82
|
+
"@deepseek-ai/dsh-launch-environment": "^0.1.5-rc.3",
|
|
83
|
+
"@deepseek-ai/dsh-settings": "^0.1.5-rc.3",
|
|
84
|
+
"@deepseek-ai/dsh-web": "^0.1.5-rc.3",
|
|
85
|
+
"@types/node": "^22.19.0",
|
|
86
|
+
"tsdown": "^0.23.0",
|
|
87
|
+
"typescript": "^5.9.0"
|
|
67
88
|
},
|
|
68
89
|
"engines": {
|
|
69
|
-
"node": ">=
|
|
90
|
+
"node": ">=22.19.0"
|
|
70
91
|
}
|
|
71
92
|
}
|
package/lib/types/index.d.ts
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type declarations for `@tonydua/dsh-web-search-exa`.
|
|
3
|
-
* @module @tonydua/dsh-web-search-exa
|
|
4
|
-
*/
|
|
5
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
6
|
-
import type { WebSearchProvider } from '@deepseek-ai/dsh-web';
|
|
7
|
-
|
|
8
|
-
/** Config schema type (fields are optional at the load boundary). */
|
|
9
|
-
export interface ExaSearchProviderConfig {
|
|
10
|
-
/** Provider id registered into `ctx.web`; defaults to `exa`. */
|
|
11
|
-
providerId?: string;
|
|
12
|
-
/** Literal Exa API key; empty/missing enables the anonymous MCP path. */
|
|
13
|
-
apiKey?: string;
|
|
14
|
-
/** Environment variable consulted when no literal `apiKey` is configured. */
|
|
15
|
-
apiKeyEnv?: string;
|
|
16
|
-
/** Exa API base URL; `/search` is appended for the keyed REST path. */
|
|
17
|
-
baseURL?: string;
|
|
18
|
-
/** @deprecated Use `baseURL`; this full endpoint remains supported for compatibility. */
|
|
19
|
-
apiURL?: string;
|
|
20
|
-
/** Exa hosted MCP endpoint, used by the anonymous fallback. */
|
|
21
|
-
mcpURL?: string;
|
|
22
|
-
/** REST retrieval mode: `auto`, `keyword`, or `neural`. */
|
|
23
|
-
searchType?: 'auto' | 'keyword' | 'neural';
|
|
24
|
-
/** Default result count when the request carries no `maxResults`. */
|
|
25
|
-
numResults?: number;
|
|
26
|
-
/** Highlight sentences requested per result on the REST path. */
|
|
27
|
-
highlightsPerResult?: number;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/** Fully resolved options accepted by the provider constructor. */
|
|
31
|
-
export interface ExaSearchProviderOptions {
|
|
32
|
-
providerId?: string;
|
|
33
|
-
apiKey: string;
|
|
34
|
-
apiKeyEnv: string;
|
|
35
|
-
baseURL: string;
|
|
36
|
-
apiURL?: string;
|
|
37
|
-
mcpURL: string;
|
|
38
|
-
searchType: 'auto' | 'keyword' | 'neural';
|
|
39
|
-
numResults?: number;
|
|
40
|
-
highlightsPerResult: number;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/** The Exa-backed provider with anonymous MCP fallback. */
|
|
44
|
-
export class ExaSearchProvider implements WebSearchProvider {
|
|
45
|
-
readonly id: string;
|
|
46
|
-
constructor(
|
|
47
|
-
resolveOptions: () => ExaSearchProviderOptions,
|
|
48
|
-
resolveApiKey?: (options: ExaSearchProviderOptions) => string | undefined,
|
|
49
|
-
);
|
|
50
|
-
available(): boolean;
|
|
51
|
-
search(request: { query: string; maxResults?: number }, signal?: AbortSignal): Promise<{
|
|
52
|
-
sources: ReadonlyArray<{ url: string; title?: string; snippet?: string; publishedAt?: string }>;
|
|
53
|
-
truncated: boolean;
|
|
54
|
-
}>;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/** Cordis plugin name used by loader diagnostics. */
|
|
58
|
-
export const name: string;
|
|
59
|
-
/** The web seam this provider registers into. */
|
|
60
|
-
export const inject: readonly ['web'];
|
|
61
|
-
/** Config schema (schemastery). */
|
|
62
|
-
export const Config: import('@deepseek-ai/schemastery').Schema<ExaSearchProviderConfig>;
|
|
63
|
-
/** Settings namespace for the Web panel section. */
|
|
64
|
-
export const SETTINGS_NAMESPACE: string;
|
|
65
|
-
/** Default Exa API base URL; `/search` is appended. */
|
|
66
|
-
export const DEFAULT_BASE_URL: string;
|
|
67
|
-
/** Legacy default full REST endpoint. */
|
|
68
|
-
export const DEFAULT_API_URL: string;
|
|
69
|
-
/** Register the Exa search provider with `ctx.web` and install its Settings section. */
|
|
70
|
-
export function apply(ctx: Context, config: ExaSearchProviderConfig): void;
|