deepseek-web-retrieval 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/README.md +95 -42
- package/dist/cli.js +397 -307
- package/docs/agents/codex.md +15 -8
- package/docs/agents/opencode-v2.md +12 -6
- package/docs/agents/pi.md +14 -6
- package/docs/design/installer-design.md +25 -20
- package/docs/integration.md +38 -7
- package/docs/research/control-matrix.md +2 -2
- package/docs/research/mcp-compatibility.md +5 -1
- package/package.json +1 -1
- package/src/installer/apply.ts +5 -3
- package/src/installer/cli.ts +43 -10
- package/src/installer/state.ts +1 -0
- package/src/installer/types.ts +2 -0
- package/src/mcp/cli.ts +8 -51
- package/src/mcp/serve.ts +51 -0
- package/src/version.ts +12 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented here, with one sentence per item.
|
|
4
4
|
|
|
5
|
+
## 0.6.0
|
|
6
|
+
|
|
7
|
+
- Return distinct CLI exit codes — 2 for invalid command lines and 3 when a failed apply could not roll back — and document the codes in the usage text.
|
|
8
|
+
- Add a `version` subcommand, record the installer version in install records, and show it in `list` output.
|
|
9
|
+
- Route any command-line argument to the installer before the MCP server loads, so installer commands never depend on the server's dependency graph and a mistyped command no longer starts a server.
|
|
10
|
+
- Reject duplicate flags instead of silently keeping the last value, and print usage to stderr on a bare invocation.
|
|
11
|
+
- Wait up to five minutes for npm's post-upload processing before finalizing automated releases, with retry guidance if processing takes longer.
|
|
12
|
+
- Clarify OpenCode and Pi native integration and Codex MCP support across setup, upgrade, security, release, and issue-reporting documentation.
|
|
13
|
+
|
|
5
14
|
## 0.5.1
|
|
6
15
|
|
|
7
16
|
- Publish npm packages through GitHub Actions trusted publishing and create GitHub Releases automatically from version tags.
|
package/README.md
CHANGED
|
@@ -1,50 +1,101 @@
|
|
|
1
1
|
# DeepSeek Web Retrieval
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**DeepSeek Search and Fetch for OpenCode, Pi, and Codex.**
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
native extension
|
|
8
|
-
|
|
5
|
+
Search the web and fetch pages as Markdown through
|
|
6
|
+
[DeepSeek's APIs](https://api-docs.deepseek.com/guides/search), using a **native OpenCode
|
|
7
|
+
plugin**, a **native Pi extension**, or **MCP for Codex**. All three share the same retrieval
|
|
8
|
+
core, with results formatted for each host.
|
|
9
9
|
|
|
10
|
-
This is an unofficial community project
|
|
10
|
+
This is an unofficial community project, not affiliated with DeepSeek or the supported
|
|
11
|
+
host projects.
|
|
11
12
|
|
|
12
13
|
## Features
|
|
13
14
|
|
|
14
|
-
- **One
|
|
15
|
-
stdio MCP server for
|
|
16
|
-
- **
|
|
17
|
-
forced
|
|
18
|
-
- **
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
- **
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
localhost and private URLs blocked before they leave the machine
|
|
15
|
+
- **One package, three hosts** — a native OpenCode v2 plugin, a native Pi extension,
|
|
16
|
+
and a stdio MCP server for Codex, all sharing one retrieval core
|
|
17
|
+
- **Routing control per tool** — search and fetch are set independently to optional,
|
|
18
|
+
preferred, forced, or off; the tier table in Usage explains each
|
|
19
|
+
- **Review before anything is written** — `init` prints the full plan and writes only
|
|
20
|
+
with `--apply`; uninstall restores from snapshots while preserving edits you made
|
|
21
|
+
afterwards
|
|
22
|
+
- **Knows the host's web landscape** — detects conflicting web tools and rules,
|
|
23
|
+
configures Pi's MCP fallback for direct tool exposure, and reports Codex version
|
|
24
|
+
drift
|
|
25
|
+
- **Your key never enters a config file** — installs reference the environment
|
|
26
|
+
(`${DEEPSEEK_API_KEY}` indirection or `env_vars`), so a project-scope install
|
|
27
|
+
commits clean
|
|
28
|
+
- **Fails loudly, never switches silently** — no fallback to another provider, and
|
|
29
|
+
localhost/private URLs are blocked before a request leaves the machine
|
|
30
30
|
|
|
31
31
|
## Usage
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
Choose your host:
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
| Host | Default integration | Setup |
|
|
36
|
+
| --- | --- | --- |
|
|
37
|
+
| OpenCode v2 | Native plugin: search provider and Fetch tools | [OpenCode guide](docs/agents/opencode-v2.md) |
|
|
38
|
+
| Pi | Native extension: Search and Fetch tools; MCP also available | [Pi guide](docs/agents/pi.md) |
|
|
39
|
+
| Codex | MCP server over stdio, with readable text results | [Codex guide](docs/agents/codex.md) |
|
|
38
40
|
|
|
39
|
-
The
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
The installer CLI requires Node.js 20+ and npm. Retrieval requires a DeepSeek API key
|
|
42
|
+
with access to Search and Fetch and sufficient account balance. Set `DEEPSEEK_API_KEY`
|
|
43
|
+
in the environment that launches your host; OpenCode can also use its stored DeepSeek key.
|
|
44
|
+
|
|
45
|
+
Run the command for your host to preview a configuration:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# OpenCode: select DeepSeek as the search provider and prefer its Fetch tool.
|
|
49
|
+
npx deepseek-web-retrieval init --host opencode --scope project --search forced --fetch preferred
|
|
50
|
+
|
|
51
|
+
# Pi: use the native extension and prefer both tools.
|
|
52
|
+
npx deepseek-web-retrieval init --host pi --scope project --search preferred --fetch preferred
|
|
53
|
+
|
|
54
|
+
# Codex: register the MCP server and prefer both tools.
|
|
55
|
+
npx deepseek-web-retrieval init --host codex --scope global --search preferred --fetch preferred
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
`--search` and `--fetch` each pick a tier — how strongly the host steers toward the
|
|
59
|
+
DeepSeek tool, chosen independently per capability:
|
|
60
|
+
|
|
61
|
+
| Tier | Effect |
|
|
62
|
+
| --- | --- |
|
|
63
|
+
| `optional` | The tool is declared; the model picks freely among its web tools |
|
|
64
|
+
| `preferred` | Rules files steer the model toward the DeepSeek tool — probable, not guaranteed |
|
|
65
|
+
| `forced` | Built-in competitors are disabled or replaced so routing is deterministic; the installer refuses rather than pretend when a host cannot guarantee it |
|
|
66
|
+
| `off` | The capability is not installed |
|
|
67
|
+
|
|
68
|
+
A preview run writes nothing. It prints the complete plan — every file it would touch
|
|
69
|
+
and every old value → new value:
|
|
70
|
+
|
|
71
|
+
```console
|
|
72
|
+
$ npx deepseek-web-retrieval init --host codex --scope global --search preferred --fetch preferred
|
|
73
|
+
Install plan: codex (global scope)
|
|
74
|
+
Tiers: search=preferred, fetch=preferred
|
|
75
|
+
|
|
76
|
+
Files:
|
|
77
|
+
~/.codex/config.toml
|
|
78
|
+
set mcp_servers.deepseek = {"command":"npx","args":["-y","deepseek-web-retrieval"],"env_vars":["DEEPSEEK_API_KEY"]} (was (absent))
|
|
79
|
+
~/.codex/AGENTS.md
|
|
80
|
+
upsert marked rules block
|
|
81
|
+
|
|
82
|
+
Notes:
|
|
83
|
+
- Codex stdio children do not inherit the parent environment, so the entry forwards DEEPSEEK_API_KEY explicitly via env_vars; the key must be set in the shell that launches Codex.
|
|
84
|
+
- Rules block upserted in ~/.codex/AGENTS.md; Codex reads ~/.codex/AGENTS.md plus every AGENTS.md from the project root to the cwd.
|
|
85
|
+
- Shared config ownership is recorded in ~/.codex/.config.toml.deepseek-web-retrieval.codex.owner.json; uninstall releases it. Keep this local metadata with the config.
|
|
86
|
+
|
|
87
|
+
Plan only — re-run with --apply to write these changes.
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Repeat your chosen command with `--apply` to write the plan. The host guides explain
|
|
91
|
+
activation steps and per-host tier limits. Pi defaults to the extension path; add
|
|
92
|
+
`--path mcp` to use its MCP fallback.
|
|
93
|
+
|
|
94
|
+
Other stdio MCP hosts may use the server, but the supported setup guides and installer
|
|
95
|
+
currently cover the three hosts above. See the [integration model](docs/integration.md)
|
|
96
|
+
for tested versions and the [control tiers](docs/research/control-matrix.md) for routing
|
|
97
|
+
limits. For an existing installation, follow the
|
|
98
|
+
[upgrade instructions](docs/integration.md#upgrading-existing-installs).
|
|
48
99
|
|
|
49
100
|
For shared search, fetch, retry, and privacy behavior, see below.
|
|
50
101
|
|
|
@@ -60,8 +111,8 @@ binary files, per-request billing) are documented there.
|
|
|
60
111
|
- Requests summaries only (`need_content: false`, `summary` falling back to `snippet`);
|
|
61
112
|
full page content never enters the results.
|
|
62
113
|
- Returns at most ten results by default (matching the API's `count` default and the
|
|
63
|
-
industry norm for AI-native search APIs), deduplicating URLs.
|
|
64
|
-
|
|
114
|
+
industry norm for AI-native search APIs), deduplicating URLs.
|
|
115
|
+
- Optional `rerank_score` and `authority` thresholds are off by default — the default
|
|
65
116
|
returns exactly what DeepSeek ranked, including results without a score;
|
|
66
117
|
when a positive threshold is set, results below it (or without a score to
|
|
67
118
|
compare) are dropped.
|
|
@@ -83,9 +134,10 @@ binary files, per-request billing) are documented there.
|
|
|
83
134
|
|
|
84
135
|
### Timeouts and retries
|
|
85
136
|
|
|
86
|
-
Request timeouts include reading the response body.
|
|
87
|
-
and 5xx
|
|
88
|
-
and network errors, fail
|
|
137
|
+
Request timeouts include reading the response body. Retries are disabled by default;
|
|
138
|
+
when enabled, retryable responses are 408, 425, 429, and 5xx, and `Retry-After` is honored
|
|
139
|
+
up to 10 seconds. Other failures, including 401, timeouts, and network errors, fail
|
|
140
|
+
without retrying.
|
|
89
141
|
|
|
90
142
|
### No automatic fallback
|
|
91
143
|
|
|
@@ -107,9 +159,10 @@ bun run check
|
|
|
107
159
|
```
|
|
108
160
|
|
|
109
161
|
Use `bun run lint:fix` to apply Biome's safe lint fixes and formatting. See
|
|
110
|
-
[CONTRIBUTING.md](CONTRIBUTING.md) for
|
|
162
|
+
[CONTRIBUTING.md](CONTRIBUTING.md) for development checks, e2e scenarios, and
|
|
163
|
+
[automated tag releases](CONTRIBUTING.md#automated-releases).
|
|
111
164
|
|
|
112
|
-
The test suite mocks the DeepSeek HTTP API and the OpenCode
|
|
165
|
+
The test suite mocks the DeepSeek HTTP API and the OpenCode and Pi host APIs, and drives the
|
|
113
166
|
MCP server with SDK clients pinned to each supported protocol revision. Real API calls
|
|
114
167
|
require a funded DeepSeek account. Shared retrieval logic lives in `src/core/`; adapters
|
|
115
168
|
live in `src/<agent>/` (the cross-host MCP server lives in `src/mcp/`). Adapter docs live
|