deepseek-web-retrieval 0.5.0 → 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 CHANGED
@@ -2,6 +2,21 @@
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
+
14
+ ## 0.5.1
15
+
16
+ - Publish npm packages through GitHub Actions trusted publishing and create GitHub Releases automatically from version tags.
17
+ - Gate releases on matching versions and changelog entries, the existing CI matrix, and installation tests of the exact release tarball.
18
+ - Resume interrupted releases safely by verifying published package integrity and preserving existing GitHub Releases.
19
+
5
20
  ## 0.5.0
6
21
 
7
22
  - Add a native Pi extension as the default integration, with shared environment configuration and settings-based capability switches.
package/README.md CHANGED
@@ -1,50 +1,101 @@
1
1
  # DeepSeek Web Retrieval
2
2
 
3
- **Bringing [DeepSeek's in-house Search and Fetch APIs](https://api-docs.deepseek.com/guides/search) to coding agents.**
3
+ **DeepSeek Search and Fetch for OpenCode, Pi, and Codex.**
4
4
 
5
- An adapter layer for coding agents. The core is agent-agnostic; each adapter exposes the
6
- same retrieval behavior to a specific agent. OpenCode v2 has a native plugin adapter, Pi a
7
- native extension adapter, and an MCP server covers every other MCP-capable host. Guides for
8
- other coding agents are in progress.
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. It is not affiliated with OpenCode or DeepSeek.
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 core, every host** — a native OpenCode v2 plugin, a native Pi extension, plus a
15
- stdio MCP server for everything else; identical retrieval behavior on each
16
- - **Tiered routing** — optional, preferred, forced, or off, per capability;
17
- forced refuses when exclusivity is impossible
18
- - **Plan-then-apply installer** — every write previewed as old → new before
19
- touching disk; arrays merge instead of replacing; uninstall reverses
20
- exactly what was applied
21
- - **Trap-aware detection** — catches what the agents' own docs don't warn
22
- about: Codex's silent `[tools] web_search` no-op, Pi's codemode hiding MCP
23
- tools; conflicting rules and web-capable servers surface in the plan, and
24
- `init` notes a Codex release that drifts from the tested lock
25
- - **Git-safe installs** — the key never enters config files
26
- (`${DEEPSEEK_API_KEY}` indirection or `env_vars`), so a project-scope
27
- install commits clean
28
- - **Fails loudly, never falls back** — no silent provider switches;
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
- Shipped adapters:
33
+ Choose your host:
34
34
 
35
- - [OpenCode v2 setup and usage](docs/agents/opencode-v2.md) — native plugin API
36
- - [Pi setup and usage](docs/agents/pi.md) — native extension API (MCP fallback)
37
- - [Codex setup and usage](docs/agents/codex.md) — MCP server over stdio
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 MCP server works with any host that supports MCP tools over stdio. The
40
- `deepseek-web-retrieval init` CLI installs it with plan-then-apply semantics — search and
41
- fetch tiers chosen per capability, project or global scope, snapshots for rollback. For
42
- how coding agents integrate—native websearch providers, native fetch tools, MCP, or
43
- wrappers—see the
44
- [integration model](docs/integration.md) with its version-locked host support matrix, the
45
- [control-level research](docs/research/control-matrix.md), and the
46
- [MCP compatibility research](docs/research/mcp-compatibility.md). A host is listed as supported
47
- only after an adapter and guide exist.
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. Optional
64
- `rerank_score` and `authority` thresholds are off by default — the default
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. Retryable responses are 408, 425, 429,
87
- and 5xx; `Retry-After` is honored up to 10 seconds. Other failures, including 401, timeouts,
88
- and network errors, fail without retrying.
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 the development checks and e2e scenarios.
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 plugin host, and drives the
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