@curio-data/mcp-intelli-search 0.24.0 → 0.25.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.md +209 -21
- package/dist/{chunk-JIW7J65N.js → chunk-67MPZQF2.js} +198 -21
- package/dist/{chunk-VYV3EUCW.js → chunk-GNQNWFYE.js} +2 -2
- package/dist/cli.js +21 -16
- package/dist/runtime.js +2 -2
- package/dist/server.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
[](https://www.npmjs.com/package/@curio-data/mcp-intelli-search)
|
|
7
7
|
[](https://nodejs.org/)
|
|
8
8
|
[](https://github.com/Curio-Data/pi-intelli-search/blob/main/LICENSE)
|
|
9
|
-

|
|
10
10
|
|
|
11
11
|
Intelligent web research for coding agents: search, extract, collate, and cache grounded web context in one tool call.
|
|
12
12
|
|
|
@@ -21,6 +21,7 @@ Intelligent web research for coding agents: search, extract, collate, and cache
|
|
|
21
21
|
- 🌐 **Fetch:** Dual-fetch each page (Hypertext Markup Language (HTML) → [_Defuddle_](https://github.com/kepano/defuddle) versus Markdown endpoint), compare quality, pick the cleaner version.
|
|
22
22
|
- 📄 **Extract:** Per-page large language model (LLM) extraction guided by a _focused prompt_. Compresses ≈50K to ≈3-5K chars of query-relevant content.
|
|
23
23
|
- 🔗 **Collate:** Cross-source deduplication, inconsistency detection, and synthesis into a focused ≈5K-character summary.
|
|
24
|
+
- 📚 **Batch Research:** One `intelli_research` call accepts two or more questions known at launch (up to ten by default) and returns either a separate answer for each (independent mode) or one merged report on a common topic (expansion mode). The entries run concurrently, four at a time by default, and the agent receives every answer in one result instead of making one call per question. In one paired benchmark on the native `Pi` host, a session that submitted five questions on one topic as one expansion batch used ≈74% less main-model input and finished ≈63% sooner than a session making five separate calls. The main-model charge fell ≈25%, because most of the separate calls' input was cached context billed below the full input price. That is one pair on one topic, not a general result. Batching follows observed use: in a survey of one host's agent transcripts, 39% of `Pi` messages calling `intelli_research` issued two to five calls, and 15 of 30 sampled follow-up calls made within five minutes were steps the agent had already planned. See [Planned Research Questions](#planned-research-questions), the [benchmark](https://github.com/Curio-Data/pi-intelli-search/blob/main/docs/BENCHMARKS.md#batch-research-on-the-native-host) and the [survey](https://github.com/Curio-Data/pi-intelli-search/blob/main/docs/proposals/BATCH-RESEARCH.md#evidence).
|
|
24
25
|
- 🧠 **Reasoning-Aware Output Budget:** When a reasoning model spends its output cap on hidden reasoning, research retries at a doubled cap (8,000, then 16,000, then 32,000 tokens by default) before reporting a failure. See [Output Budget Retry](#output-budget-retry).
|
|
25
26
|
- 📏 **Long Pages, Bounded Collation:** Extraction reads up to 400,000 characters of each page. When the extractions exceed the [collation input budget](#collation-input-budget), the longest are trimmed at clean boundaries, and the result gives the path of each trimmed extraction's full saved file.
|
|
26
27
|
- 🧾 **Recoverable Failures:** When no extraction succeeds, research saves the fetched pages and a failure report; when synthesis fails, it saves the pages and extractions as well. The result names the saved files, so the agent can read them rather than repeat the paid stages. See [Extraction Diagnostics](#extraction-diagnostics).
|
|
@@ -35,7 +36,7 @@ For [`Pi`](https://github.com/earendil-works/pi), the sibling `@curio-data/pi-in
|
|
|
35
36
|
|
|
36
37
|
The shared pipeline searches via a search-grounded model ([_Perplexity Sonar_](https://docs.perplexity.ai), the native default) and merges prose links with harvested citations before selecting pages. It fetches pages through a dual-fetch comparison ([_Defuddle_](https://github.com/kepano/defuddle) versus Markdown endpoint), then extracts query-relevant content per page with a dedicated large language model (LLM) guided by a _focused prompt_. Collation deduplicates findings, flags inconsistencies, and synthesises a concise summary. Reports, extractions and fetched content are cached for offline reuse in `.search/` by default. Cache suggest surfaces related previous searches on each query.
|
|
37
38
|
|
|
38
|
-
##
|
|
39
|
+
## Three Packages, One Engine
|
|
39
40
|
|
|
40
41
|
Choose the installation route for the host:
|
|
41
42
|
|
|
@@ -44,22 +45,24 @@ Choose the installation route for the host:
|
|
|
44
45
|
| Native `Pi` Extension | `Pi` | `@curio-data/pi-intelli-search` |
|
|
45
46
|
| Direct MCP Registration | Any MCP-compatible host | `@curio-data/mcp-intelli-search` |
|
|
46
47
|
| Host Plugin | Claude Code or Codex | Repository marketplace launching the pinned MCP package |
|
|
48
|
+
| Host Plugin | DeepSeek Harness | Profile bundle `@curio-data/dsh-intelli-search`; installation by name requires its matching MCP release. |
|
|
47
49
|
|
|
48
|
-
The install branches: [`Pi` Native Extension](https://github.com/Curio-Data/pi-intelli-search/blob/main/README.md#pi-native-extension) and [MCP Server](#mcp-server), with host instructions for [Claude Code](#claude-code), [Codex](#codex) and any [Generic MCP Host](#generic-mcp-host).
|
|
50
|
+
The install branches: [`Pi` Native Extension](https://github.com/Curio-Data/pi-intelli-search/blob/main/README.md#pi-native-extension) and [MCP Server](#mcp-server), with host instructions for [Claude Code](#claude-code), [Codex](#codex), [DeepSeek Harness](#deepseek-harness) and any [Generic MCP Host](#generic-mcp-host).
|
|
49
51
|
|
|
50
|
-
The native extension uses `Pi` settings and authentication. Generic MCP registration requires explicit configuration and a workspace; the Codex
|
|
52
|
+
The native extension uses `Pi` settings and authentication. Generic MCP registration requires explicit configuration and a workspace; the Codex and DeepSeek Harness launchers take the workspace from the host working directory and use built-in defaults unless a per-user configuration is supplied. Inference uses an OpenRouter key supplied through the configured environment variable or credential file. The MCP server does not read `Pi` settings or credentials.
|
|
51
53
|
|
|
52
54
|
## Contents
|
|
53
55
|
|
|
54
56
|
<!-- TOC:START -->
|
|
55
57
|
|
|
56
|
-
- [
|
|
58
|
+
- [Three Packages, One Engine](#three-packages-one-engine)
|
|
57
59
|
- [Install](#install)
|
|
58
60
|
- [MCP Server](#mcp-server)
|
|
59
61
|
- [MCP Prerequisites](#mcp-prerequisites)
|
|
60
62
|
- [Claude Code](#claude-code)
|
|
61
63
|
- [Claude Code Plugin](#claude-code-plugin)
|
|
62
64
|
- [Codex](#codex)
|
|
65
|
+
- [DeepSeek Harness](#deepseek-harness)
|
|
63
66
|
- [Generic MCP Host](#generic-mcp-host)
|
|
64
67
|
- [Tools](#tools)
|
|
65
68
|
- [Evidence and Provenance](#evidence-and-provenance)
|
|
@@ -104,12 +107,12 @@ The native extension uses `Pi` settings and authentication. Generic MCP registra
|
|
|
104
107
|
|
|
105
108
|
#### MCP Prerequisites
|
|
106
109
|
|
|
107
|
-
- [_Node.js_](https://nodejs.org/) 22 or later, with `node` and `npx` on `PATH`.
|
|
110
|
+
- [_Node.js_](https://nodejs.org/) 22 or later for the standalone package, with `node` and `npx` on `PATH`. The [DeepSeek Harness](#deepseek-harness) bundle follows that host's own floor, Node.js 24.9 or later.
|
|
108
111
|
- [_Claude Code_](https://code.claude.com/docs/en/overview) installed for the example below.
|
|
109
112
|
- An [OpenRouter API key](https://openrouter.ai/keys) with credit for inference. One key covers all three model roles; charges are separate from the host subscription.
|
|
110
113
|
- An existing project folder for the research cache. The server and host must be able to read the same filesystem.
|
|
111
114
|
|
|
112
|
-
Generic registration requires an explicit JavaScript Object Notation (JSON) configuration and absolute workspace path. The Codex
|
|
115
|
+
Generic registration requires an explicit JavaScript Object Notation (JSON) configuration and absolute workspace path. The Codex and DeepSeek Harness launchers use the host working directory and built-in model defaults when no per-user configuration exists. The server reads no host credential stores, `Pi` settings or discovered project configuration. Native fetch assets are verified on _Linux_ x86-64; _macOS_ and _Windows_ are not verified. See [Compatibility](#mcp-server-compatibility) for the recorded scope.
|
|
113
116
|
|
|
114
117
|
#### Claude Code
|
|
115
118
|
|
|
@@ -250,6 +253,190 @@ In the session, ask: “Use intelli_search to find the current TypeScript releas
|
|
|
250
253
|
|
|
251
254
|
The installed `intelli-search` skill covers configuration and unattended tool approval; see the [compatibility matrix](https://github.com/Curio-Data/pi-intelli-search/blob/main/docs/COMPATIBILITY.md#host-plugins) for verified host behaviour.
|
|
252
255
|
|
|
256
|
+
#### DeepSeek Harness
|
|
257
|
+
|
|
258
|
+
[_DeepSeek Harness_](https://github.com/deepseek-ai/deepseek-harness) (`dsh`) ships a Model Context Protocol client bridge, so this route is a generated configuration bundle, `@curio-data/dsh-intelli-search`, rather than an extension: one inserted bridge row starts the pinned `@curio-data/mcp-intelli-search` package through `npx` with `--host dsh`, and one registrar registers the `intelli-search` skill with the harness. Neither carries pipeline code. The harness names the server `intelli`, so the tools are `mcp__intelli__intelli_search`, `mcp__intelli__intelli_extract`, `mcp__intelli__intelli_collate` and `mcp__intelli__intelli_research`. The bundle's own [package page](https://www.npmjs.com/package/@curio-data/dsh-intelli-search) is generated from these instructions with the exact server version filled in.
|
|
259
|
+
|
|
260
|
+
##### Bundle Prerequisites
|
|
261
|
+
|
|
262
|
+
- `dsh` within the bundle's declared range, `>=0.2.2-rc.1 <0.3.0`. The range is a compatibility declaration; Evidence and Limits names the versions tested.
|
|
263
|
+
- Node.js 24.9 or later, the harness's own floor, with `node` and `npx` on `PATH`. The bridge row starts the server through `npx`.
|
|
264
|
+
- For the `dsh plugin` commands below, put `pnpm` on `PATH` unless the launcher supplies its own package manager. The `pnpmCommand` setting configures the in-harness plugin manager, not these commands.
|
|
265
|
+
- Network access on the first start, when `npx` downloads the MCP server package. Later starts reuse the `npx` cache.
|
|
266
|
+
- An OpenRouter API key on an account with credit. Every search and research call bills that account, separately from any harness subscription.
|
|
267
|
+
- Linux for verified operation. The server's native fetch assets are verified on Linux x86-64 only, and every recorded check of this bundle ran on Linux; _macOS_ and _Windows_ are not verified.
|
|
268
|
+
|
|
269
|
+
##### Install the Bundle
|
|
270
|
+
|
|
271
|
+
The bundle installs into one harness profile, and only that profile loads it. Install it into the profile the harness is started with, the name given to `--profile`. The examples set `profile=web`, one of the profiles the harness ships; change that value to the profile in use. A misspelt profile name leaves the tools absent from the profile in use.
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
profile=web
|
|
275
|
+
dsh plugin --profile "$profile" add @curio-data/dsh-intelli-search
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
In the Web interface, the harness documents an equivalent route: open **Plugins**, select **Add plugin** and enter `@curio-data/dsh-intelli-search`, the text that follows `add` in the command. This project's checks use the command line only.
|
|
279
|
+
|
|
280
|
+
After installation, start the profile from the project directory, or restart it if it is running:
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
profile=web
|
|
284
|
+
dsh --profile "$profile"
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
##### Upgrade, Restart and Remove the Bundle
|
|
288
|
+
|
|
289
|
+
Each bundle version launches one exact MCP server version, so the server changes only when the bundle is updated. For a bundle installed by name, the Web **Plugins** page documents **Versions** and **Update** controls; restart the profile after updating. That route follows the harness's documentation and has not been exercised in this project's checks. From the command line, remove the bundle and add it again, then restart the profile:
|
|
290
|
+
|
|
291
|
+
```bash
|
|
292
|
+
profile=web
|
|
293
|
+
dsh plugin --profile "$profile" remove @curio-data/dsh-intelli-search
|
|
294
|
+
dsh plugin --profile "$profile" add @curio-data/dsh-intelli-search
|
|
295
|
+
dsh --profile "$profile"
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
Removal and reinstallation are verified; an update between two published versions by either route is not. A row override that sets `cwd` (see Workspace) keeps launching the server version written in it until the override is edited.
|
|
299
|
+
|
|
300
|
+
Restart the profile from the project directory after installing, updating or removing the bundle, after changing a key in an environment layer and after editing a configuration file the server has already loaded. The harness composes bundle rows and reads environment files at launch, and the server keeps a loaded configuration for its lifetime.
|
|
301
|
+
|
|
302
|
+
To remove the bundle and confirm that both of its rows are gone from the composed profile:
|
|
303
|
+
|
|
304
|
+
```bash
|
|
305
|
+
profile=web
|
|
306
|
+
dsh plugin --profile "$profile" remove @curio-data/dsh-intelli-search
|
|
307
|
+
dsh --profile "$profile" --dump-config
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
The dump no longer lists the rows `mcp-intelli-search` and `intelli-search-skill`. Restart the profile to stop a server that is still running. Removal deletes no data: the per-user configuration and stored key under `${XDG_CONFIG_HOME:-$HOME/.config}/mcp-intelli-search/`, any `OPENROUTER_API_KEY` line in a `.env` file, each project's `.search/` cache and the `npx` cache remain until deleted separately. The per-user directory is shared with the Codex launcher. Delete any `mcp-intelli-search` override from the profile's `cordis.patch.yml` as well.
|
|
311
|
+
|
|
312
|
+
##### Bundle Credentials
|
|
313
|
+
|
|
314
|
+
The server reads its OpenRouter key from the `OPENROUTER_API_KEY` environment variable or from a credential file. A nonempty environment value takes precedence over the file. Without either, the four tools still start and each call returns an actionable `CONFIGURATION` error. A key saved on the harness model-settings page does not reach this server: the harness resolves that credential through a service a child process cannot read.
|
|
315
|
+
|
|
316
|
+
**Environment Route.** The bridge row forwards `OPENROUTER_API_KEY` from the harness environment layer, which takes the first value it finds in the environment that launches the harness, then a `.env` file in the launch directory, then `$DSH_HOME/.env`. The harness reads these once at launch, so restart the profile after changing a key. The server treats an empty value as absent, so the row loads before a key is supplied. To keep the key in the harness-home file, create the file with user-only permissions before entering the key:
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
(umask 077; touch "${DSH_HOME:-$HOME/.dsh}/.env") && chmod 600 "${DSH_HOME:-$HOME/.dsh}/.env"
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
After the command succeeds, open the file in an editor, so the key stays out of shell history, and put `OPENROUTER_API_KEY=` followed by the key on its own line, replacing any earlier definition.
|
|
323
|
+
|
|
324
|
+
**Credential-File Route.** The server's `setup` command reads the key from standard input and stores it in a user-only file. It refuses a terminal as its input. Run the following block in _Bash_; if the current shell is not Bash, start `bash` first:
|
|
325
|
+
|
|
326
|
+
```bash
|
|
327
|
+
(
|
|
328
|
+
set +x
|
|
329
|
+
set +a
|
|
330
|
+
unset key || exit 1
|
|
331
|
+
IFS= read -r -s -p 'OpenRouter API key: ' key || exit 1
|
|
332
|
+
printf '\n'
|
|
333
|
+
printf '%s\n' "$key" | \
|
|
334
|
+
npx -y --package @curio-data/mcp-intelli-search \
|
|
335
|
+
mcp-intelli-search setup
|
|
336
|
+
)
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
Add `@` and the version the bundle pins, shown in its row by `--dump-config`, after the package name to run the same server version.
|
|
340
|
+
|
|
341
|
+
Paste and run the whole block. Wait for the `OpenRouter API key:` prompt before entering the key; input is hidden. The parentheses run the commands in a subshell with tracing and automatic export turned off. Setup receives the key on standard input, and the calling shell's variables remain unchanged. Confirm that setup prints `Setup complete.` followed by the configuration and credential paths. If that shell exports a nonempty `OPENROUTER_API_KEY`, setup also warns that the environment value takes precedence over the stored key.
|
|
342
|
+
|
|
343
|
+
Setup creates `${XDG_CONFIG_HOME:-$HOME/.config}/mcp-intelli-search/config.json` with the default models when it is absent, adds a missing `apiKeyFile` selection to an existing file and keeps existing model and tuning selections. It writes the key to `openrouter.key` beside that file. When the file already names a custom `apiKeyFile`, setup writes the key to that path and leaves the configuration file unchanged. Only an absolute `XDG_CONFIG_HOME` is honoured; an unset or relative value means `$HOME/.config`. Run setup with the same `XDG_CONFIG_HOME` as the harness, so both use one directory.
|
|
344
|
+
|
|
345
|
+
The server rereads the credential file on every call, so a new or replaced key takes effect on the next call without a restart. The file must be a regular file, owned by the current user, with no group or other access; setup creates it that way. To use the file while a key is also set in an environment layer, remove `OPENROUTER_API_KEY` from all three layers and restart the profile.
|
|
346
|
+
|
|
347
|
+
##### Bundle Workspace
|
|
348
|
+
|
|
349
|
+
The server uses the harness working directory as its workspace and writes the research cache, `.search/` by default, below it. Start the harness from the project directory: changing directory later in the session does not move the cache. A home or filesystem-root working directory is rejected, by each tool call with an actionable `WORKSPACE` error and by the configuration check, instead of creating one cache shared across projects. The four tools still appear.
|
|
350
|
+
|
|
351
|
+
For a fixed project root, override the row with id `mcp-intelli-search` in the profile's `cordis.patch.yml` under `$DSH_HOME/profiles/`, and set `cwd` to the absolute project path. Every session of that profile then caches in that directory, wherever the harness starts. The override replaces the row's entire `config`: copy its other `config` fields from the `--dump-config` output, keep the `OPENROUTER_API_KEY` expression exactly as shown there, and update the pinned server version after each bundle update. The home and filesystem-root rejection still applies to the `cwd` value.
|
|
352
|
+
|
|
353
|
+
##### Bundle Configuration
|
|
354
|
+
|
|
355
|
+
With no per-user configuration file, the server uses built-in defaults: OpenRouter for every role, `perplexity/sonar` for search, `minimax/minimax-m3` for extraction and collation, and the shared tuning defaults, including a default budget of ten search-result pages per query (`defaultUrls`) and a cap of 20 per query (`maxUrls`). The defaults need no file.
|
|
356
|
+
|
|
357
|
+
The per-user file is `${XDG_CONFIG_HOME:-$HOME/.config}/mcp-intelli-search/config.json`, shared with the Codex launcher. It is strict: only `providers`, `models` and an optional `tuning` object are accepted, all three model roles are required, and unknown keys, wrong types and out-of-range values are rejected rather than ignored. `defaultUrls` must not exceed `maxUrls`, and search needs a Sonar model unless the `searchWebSearch` tool is enabled. A file without `apiKeyFile` still uses the default credential path, which the launcher supplies. Custom models must appear in OpenRouter's catalogue with the capabilities their role needs, and be available to the account.
|
|
358
|
+
|
|
359
|
+
The file takes the same document as the [minimal configuration](#create-the-configuration), with an optional [`tuning` object](#tuning).
|
|
360
|
+
|
|
361
|
+
Validate the file with the configuration check before restarting. The server reads the file when it starts:
|
|
362
|
+
|
|
363
|
+
- With no file at start-up, the built-in defaults stay in force until the profile restarts. Restart after creating the file.
|
|
364
|
+
- A file that exists but fails validation does not stop the server. Each tool call returns a `CONFIGURATION` error naming the file and reads it again, until a call finds it valid. A file selected with `--config` in a row override behaves the same way while it is missing.
|
|
365
|
+
- Once a file loads, its selections stay fixed until the profile restarts. Restart after every later edit.
|
|
366
|
+
|
|
367
|
+
##### Verify the Bundle
|
|
368
|
+
|
|
369
|
+
**Configuration Check.** From the project directory, run the server's configuration check. It reads the per-user file, or the built-in defaults when there is none, and applies the server's home and filesystem-root rejection. It needs no key and makes no model call. Its first run also downloads the server into the `npx` cache.
|
|
370
|
+
|
|
371
|
+
```bash
|
|
372
|
+
npx -y --package @curio-data/mcp-intelli-search \
|
|
373
|
+
mcp-intelli-search --host dsh --check-config
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
As with setup, add `@` and the version the bundle pins to check with the server version the bundle launches.
|
|
377
|
+
|
|
378
|
+
A valid configuration prints one of two lines and exits with status `0`:
|
|
379
|
+
|
|
380
|
+
- `Configuration is valid.` when the per-user file loads.
|
|
381
|
+
- `Configuration is valid (built-in DeepSeek Harness defaults; no per-user file found).` when there is no per-user file.
|
|
382
|
+
|
|
383
|
+
An invalid server configuration produces a diagnostic and exit status `1`. If `npx` fails to start the server, the check has not run. The check does not test the key, account credit or model access.
|
|
384
|
+
|
|
385
|
+
**Bundle Rows.** The composed profile must list both bundle rows, `mcp-intelli-search` and `intelli-search-skill`:
|
|
386
|
+
|
|
387
|
+
```bash
|
|
388
|
+
profile=web
|
|
389
|
+
dsh --profile "$profile" --dump-config
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
**Inference Check (Billed).** Start the profile from the project directory with a key in place and ask: “Use mcp__intelli__intelli_search to find the current TypeScript release and cite the official source.” A completed tool call and an answer with sources show that the key, the search model and the bridge work. A tool list alone does not show provider access, and a quick search does not exercise page fetching, extraction or collation. To check the full pipeline, request research with a small page budget, for example: “Use mcp__intelli__intelli_research with maxUrls 3 to compare the two most recent Node.js long-term support releases.” A completed call returns a report and writes it under `.search/`; it costs more than a search.
|
|
393
|
+
|
|
394
|
+
##### Bundle Timeouts
|
|
395
|
+
|
|
396
|
+
Two clocks limit a research call. The bundle raises the bridge's limit for one tool call to ten minutes (`toolCallTimeoutMs: 600000`); when it expires, the call fails in the harness. Inside the server, each model call has its own timeout, `llmTimeoutMs` (120 seconds by default). `llmRetryAttempts` (three attempts by default) repeats a timed-out or transient failure, and `outputBudgetRetries` (two by default) repeats an empty output-capped extraction, or any output-capped synthesis, at a doubled cap, with a timeout that grows with the cap up to four times `llmTimeoutMs`. With the defaults, one page's budget attempts alone can take up to 14 minutes, so a research call can outlast the bridge limit. Raising `llmTimeoutMs` lengthens calls; it never extends the bridge limit.
|
|
397
|
+
|
|
398
|
+
Server startup and tool discovery use a separate bridge request timeout, 60 seconds on `0.2.2-rc.1`. A slow first `npx` download can exceed it and leave the profile without the four tools on its first start.
|
|
399
|
+
|
|
400
|
+
To keep a call within ten minutes:
|
|
401
|
+
|
|
402
|
+
- Ask for fewer pages, for example `maxUrls` 3 in the request, or set lower `defaultUrls` and `maxUrls` in the per-user configuration.
|
|
403
|
+
- Put fewer questions in one batch, or fewer pages in each entry: a batch is one tool call, so all its entries share the limit.
|
|
404
|
+
- Set `outputBudgetRetries` to `0`, and lower `llmRetryAttempts`, when the limit is reached repeatedly.
|
|
405
|
+
- Use a quick search when a cited answer is enough.
|
|
406
|
+
|
|
407
|
+
A longer bridge limit needs a row override setting `toolCallTimeoutMs`, with the same version upkeep as a `cwd` override.
|
|
408
|
+
|
|
409
|
+
##### Bundle Troubleshooting
|
|
410
|
+
|
|
411
|
+
| Symptom | Cause | Remedy |
|
|
412
|
+
|---|---|---|
|
|
413
|
+
| The four `mcp__intelli__*` tools are absent | The bridge row did not start. The bundle sets `failOnStartupError: false`, so the harness logs the failure and keeps running. Common causes: the bundle is in another profile; `node` or `npx` is missing or older than the floor; no network on the first start; or the first download outlasted the 60-second discovery timeout | Confirm both bundle rows with `--dump-config` for the profile in use. Run the configuration check from the project directory, which also fills the `npx` cache, then restart the profile. If the tools are still absent, read the harness log for the `mcp-intelli-search` row |
|
|
414
|
+
| `WORKSPACE` error naming the home or filesystem root | The harness started in the home directory or `/` | Restart the profile from the project directory, or set `cwd` in a row override |
|
|
415
|
+
| `CONFIGURATION` error naming `config.json` | The per-user file is invalid JSON or fails validation | Run the configuration check, correct the file and call again; the server reads it again on each call until it loads |
|
|
416
|
+
| Edits to `config.json` have no effect | The file had already loaded, or it was created after the profile started | Restart the profile |
|
|
417
|
+
| `CONFIGURATION` error for a missing key | No nonempty `OPENROUTER_API_KEY` reached the server and no credential file exists | Supply the key through either route; restart after an environment change |
|
|
418
|
+
| `CONFIGURATION` error about the credential file | The file is linked, owned by another user, or readable by group or others | Run setup again, or restrict the file to its owner with `chmod 600` |
|
|
419
|
+
| Setup stops with `Setup requires the key on standard input` | Setup was run with the terminal as input | Use the setup pipeline |
|
|
420
|
+
| A stored key is not used | A nonempty environment key takes precedence, or setup and the harness used different `XDG_CONFIG_HOME` values | Remove `OPENROUTER_API_KEY` from all three environment layers and restart, or run setup again with the harness's `XDG_CONFIG_HOME` |
|
|
421
|
+
| A research call fails after ten minutes | The bridge limit expired | Reduce the work as described under timeouts |
|
|
422
|
+
| `PROVIDER` error | Authentication, model access, account credit or connectivity failed; the category alone does not identify a rejected key | Check the account and its model access. Replace a stored key with setup, which applies on the next call, or an environment key, which needs a restart |
|
|
423
|
+
| Preflight names a model role or capability | A configured model is not in OpenRouter's catalogue or lacks a capability its role needs | Correct the model in `config.json` and restart |
|
|
424
|
+
| Repeated `429` retries | Provider rate limits | Set `minRequestIntervalMs` to `3000` and `extractionConcurrency` to `2` in `tuning`, then restart |
|
|
425
|
+
| The `intelli-search` skill differs in one project | On `0.2.2-rc.1`, a project skill with the same name outranks the bundle's registration; a user-level skill does not | Rename or remove the project skill |
|
|
426
|
+
|
|
427
|
+
The [MCP troubleshooting reference](#timeouts-and-troubleshooting) gives the full list of diagnostics.
|
|
428
|
+
|
|
429
|
+
##### Bundle Evidence and Limits
|
|
430
|
+
|
|
431
|
+
Every check below ran on Linux in an isolated profile created from the harness's headless template. Each is a separate class of evidence; none stands in for another.
|
|
432
|
+
|
|
433
|
+
- **Local bundle, credential-free:** a locally generated bundle installed, composed both rows, registered the four tools and the skill, rejected home and filesystem-root workspaces, delivered a dummy key, and was removed and reinstalled on `dsh` `0.2.2-rc.1` and `0.2.2-rc.5`, without a provider call.
|
|
434
|
+
- **Pre-bootstrap launcher:** before the bundle was public, the packed 0.25.0 bundle started the public 0.25.0 MCP server on `0.2.2-rc.1`, discovered the four tools, loaded the skill and passed the configuration check.
|
|
435
|
+
- **Public installation by name:** the public 0.25.0 bundle installed by name on `0.2.2-rc.1`, with four tools, the skill, the configuration check, removal and reinstallation, and no model call.
|
|
436
|
+
- **Credentialed research:** with a local bundle on `0.2.2-rc.1` only, a quick search, a three-page research call and the credential-file route completed through real OpenRouter calls.
|
|
437
|
+
|
|
438
|
+
Other versions in the declared range `>=0.2.2-rc.1 <0.3.0`, the shipped `web` profile, the Web **Add plugin**, **Versions** and **Update** routes, and macOS and Windows hosts are untested. The [compatibility record](https://github.com/Curio-Data/pi-intelli-search/blob/main/docs/COMPATIBILITY.md#deepseek-harness-evidence-and-limits) gives dates and details, including [public installation by name](https://github.com/Curio-Data/pi-intelli-search/blob/main/docs/COMPATIBILITY.md#public-dsh-profile-installation-2026-11-22).
|
|
439
|
+
|
|
253
440
|
<a id="route-a-direct-mcp-configuration"></a>
|
|
254
441
|
#### Generic MCP Host
|
|
255
442
|
|
|
@@ -285,7 +472,7 @@ Both packages expose these four operations. Start with `intelli_search` for fact
|
|
|
285
472
|
|
|
286
473
|
| Tool | Description |
|
|
287
474
|
| ------------------ | --------------------------------------------------------------------------------------------------- |
|
|
288
|
-
| `intelli_search` | Search the web and return a concise answer with a source list (
|
|
475
|
+
| `intelli_search` | Search the web and return a concise answer with a source list numbered to the answer's citation markers where they can be matched (see [Source Harvesting from Citations](https://github.com/Curio-Data/pi-intelli-search/blob/main/README.md#source-harvesting-from-citations)). |
|
|
289
476
|
| `intelli_extract` | Extract query-relevant content from a web page, preserving code and technical detail verbatim. |
|
|
290
477
|
| `intelli_collate` | Deduplicate and synthesise multiple extractions into a summary. Writes cache. |
|
|
291
478
|
| `intelli_research` | Search, fetch, extract, collate and cache multi-page research in one call. |
|
|
@@ -476,11 +663,11 @@ This reference applies to `@curio-data/mcp-intelli-search` only. Installation ro
|
|
|
476
663
|
### Requirements
|
|
477
664
|
|
|
478
665
|
- [_Node.js_](https://nodejs.org/) satisfying the `engines` range in the [standalone manifest](https://github.com/Curio-Data/pi-intelli-search/blob/main/packages/mcp/package.json).
|
|
479
|
-
- An existing absolute workspace directory and JSON configuration file for generic registration or direct runtime use. Codex
|
|
666
|
+
- An existing absolute workspace directory and JSON configuration file for generic registration or direct runtime use. Codex and DeepSeek Harness modes use the launch directory and supply model defaults.
|
|
480
667
|
- A separately billed OpenRouter API key supplied through a named environment variable before constructing the runtime, or through `setup` and a user-only credential file. Environment changes require a runtime restart; each operation rereads the selected credential file, so a new or replacement key takes effect on the next operation.
|
|
481
668
|
- A platform supported by [_wreq-js_](https://github.com/sqdshguy/wreq-js), the browser-fingerprint fetch dependency. The installation gate exercises its native assets on the running platform; it does not establish support for other platforms.
|
|
482
669
|
|
|
483
|
-
The package neither reads host credential stores nor loads project configuration automatically. Codex
|
|
670
|
+
The package neither reads host credential stores nor loads project configuration automatically. Codex and DeepSeek Harness modes share per-user configuration and credential paths. Native `Pi` settings, authentication, providers and defaults remain independent.
|
|
484
671
|
|
|
485
672
|
### Verification
|
|
486
673
|
|
|
@@ -496,7 +683,7 @@ Use the same configuration and workspace as the registered server. If a project-
|
|
|
496
683
|
|
|
497
684
|
### Serving the Protocol
|
|
498
685
|
|
|
499
|
-
An invocation without `--check-config` validates the selected workspace, then serves the four canonical tools (`intelli_search`, `intelli_extract`, `intelli_collate`, `intelli_research`) over stdio until the input stream closes. An explicitly selected missing, unreadable or invalid configuration file does not prevent connection: each tool call returns an actionable `CONFIGURATION` error, and the server rereads the file on each call until it loads. Repair the file and call again. Once loaded, configuration remains fixed until restart. Generic registration rejects missing launcher arguments and invalid workspaces at startup; `--check-config` remains strict.
|
|
686
|
+
An invocation without `--check-config` validates the selected workspace, then serves the four canonical tools (`intelli_search`, `intelli_extract`, `intelli_collate`, `intelli_research`) over stdio until the input stream closes. An explicitly selected missing, unreadable or invalid configuration file does not prevent connection: each tool call returns an actionable `CONFIGURATION` error, and the server rereads the file on each call until it loads. Repair the file and call again. Once loaded, configuration remains fixed until restart. Generic registration rejects missing launcher arguments and invalid workspaces at startup; `--check-config` remains strict. Each host mode uses its working directory and built-in defaults when its per-user configuration is absent. Serving performs no inference at startup; credentials are only required when an operation runs.
|
|
500
687
|
|
|
501
688
|
- **Registration and Schemas.** Tool names and JSON input schemas mirror the native `Pi` tools verbatim; descriptions adapt the native guidance for protocol clients (host-neutral cache wording, embedded `focusPrompt` and breadth guidance), because the protocol offers no separate guidance channel. Invalid tool arguments are reported as tool errors (`isError` results), matching the software development kit (SDK) distinction between malformed protocol requests and invalid arguments.
|
|
502
689
|
- **Results.** Successful calls return the complete operation text both as text content and as `structuredContent.text`, alongside `outcome` and `details`. Hosts that prefer the structured representation receive the same answer, sources and cache suggestions. The duplication is intentional for host compatibility; a host that forwards both representations can consume extra context. Degraded research (`no-links`, `fetch-failed`, `extraction-failed`, `collate-failed`) remains a normal result. Execution failures return `isError` results tagged with the safe `StandaloneError` category rather than raw provider causes.
|
|
@@ -510,9 +697,9 @@ Startup diagnostics go to standard error. The SDK version range is declared in `
|
|
|
510
697
|
|
|
511
698
|
### Configuration
|
|
512
699
|
|
|
513
|
-
Select the configuration with `--config FILE` or `INTELLI_SEARCH_CONFIG`. Select the workspace with `--workspace ABSOLUTE_DIRECTORY` or `INTELLI_SEARCH_WORKSPACE`. Command-line values take precedence. Relative workspace paths are rejected; existing workspace symlinks are canonicalised. `--host codex` instead selects the working root and `${XDG_CONFIG_HOME:-$HOME/.config}/mcp-intelli-search/config.json`; explicit selections still take precedence.
|
|
700
|
+
Select the configuration with `--config FILE` or `INTELLI_SEARCH_CONFIG`. Select the workspace with `--workspace ABSOLUTE_DIRECTORY` or `INTELLI_SEARCH_WORKSPACE`. Command-line values take precedence. Relative workspace paths are rejected; existing workspace symlinks are canonicalised. Either `--host codex` or `--host dsh` instead selects the working root and `${XDG_CONFIG_HOME:-$HOME/.config}/mcp-intelli-search/config.json`; explicit selections still take precedence.
|
|
514
701
|
|
|
515
|
-
The [minimal configuration](#create-the-configuration) explicitly selects OpenRouter for every role; add an optional `tuning` object (for example `"cacheDir": ".search"`) beside `providers` and `models`. Generic registration has no model defaults.
|
|
702
|
+
The [minimal configuration](#create-the-configuration) explicitly selects OpenRouter for every role; add an optional `tuning` object (for example `"cacheDir": ".search"`) beside `providers` and `models`. Generic registration has no model defaults. Both host modes use `perplexity/sonar` for search and `minimax/minimax-m3` for extraction and collation when no per-user file exists.
|
|
516
703
|
|
|
517
704
|
Only `providers`, `models` and optional `tuning` are accepted at the top level. All three model roles are required in a configuration file. The provider object accepts `apiKeyEnv`, an environment-variable name rather than a key value, and optional `apiKeyFile`, an absolute path to a separately stored key. The environment variable takes precedence. Setup writes the key with user-only permissions; each file read rejects symbolic links, hard links, other owners and group or world access on platforms with POSIX permissions. Setup manages the default per-user configuration. For a separately selected generic configuration, set `providers.openrouter.apiKeyFile` to the credential path printed by setup and restart after changing loaded configuration. The initial provider scope is OpenRouter at its fixed `https://openrouter.ai/api/v1` endpoint; custom endpoints, proxy settings, provider fallback and dynamic router model identifiers are not accepted.
|
|
518
705
|
|
|
@@ -526,7 +713,7 @@ Unspecified tuning comes from the canonical [shared defaults](https://github.com
|
|
|
526
713
|
|
|
527
714
|
| Setting | Default and Effect | Accepted Values |
|
|
528
715
|
|---|---|---|
|
|
529
|
-
| `defaultUrls` | `10`: fallback page budget and one-shot search source-list
|
|
716
|
+
| `defaultUrls` | `10`: fallback page budget and one-shot search source-list size (a cited higher-numbered entry can exceed it) | Integer from 1 to 100; must not exceed `maxUrls` |
|
|
530
717
|
| `maxUrls` | `20`: hard cap on research pages | Integer from 1 to 100 |
|
|
531
718
|
| `extractMaxChars` | `400000`: per-page extraction input character limit (≈100,000 tokens) | Integer from 1 to 2,000,000 |
|
|
532
719
|
| `fetchTimeoutMs` | `20000`: page-fetch timeout in milliseconds | Integer from 1 to 600,000 |
|
|
@@ -646,9 +833,9 @@ Every startup failure is diagnostic-only and lands on standard error; standard o
|
|
|
646
833
|
| Configuration rejected with an unknown-key or range error | The loader is strict: unknown keys, invalid types and out-of-range values fail validation. Correct the configuration and call again if it has not yet loaded. The [Tuning](#tuning) table lists accepted keys and ranges. |
|
|
647
834
|
| Tools never appear in the host | Check absent launcher arguments, an unusable workspace or an unsafe cache. Read the host's MCP server logs for the standard-error diagnostic. Claude Code can cache a startup failure from an older server: try `/mcp` reconnect, then restart ([evidence and limits](https://github.com/Curio-Data/pi-intelli-search/blob/main/docs/COMPATIBILITY.md#claude-code-evidence-and-limits)). A connected server still needs a successful tool call to verify inference. |
|
|
648
835
|
| `CONFIGURATION` persists after the file is repaired | A file that has not yet loaded is reread on the next call; once loaded, configuration changes require a restart. |
|
|
649
|
-
| Diagnostic names a missing credential environment variable | Supply the named variable before host launch. Codex users can instead run
|
|
836
|
+
| Diagnostic names a missing credential environment variable | Supply the named variable before host launch. Codex and DeepSeek Harness users can instead run the setup command for [Codex](#codex) or [DeepSeek Harness](#bundle-credentials) with the key on standard input. For a separately selected configuration, set `providers.openrouter.apiKeyFile` to the printed credential path. Environment or loaded-configuration changes require restart; file credentials are reread on each call. |
|
|
650
837
|
| Catalogue preflight names a model role or capability | Correct the model identifier or required capabilities using [Configuration](#configuration). Read the diagnostic; catalogue lookup failures are not proof of invalid credentials. Restart after changing loaded model selections. |
|
|
651
|
-
| `PROVIDER` reports authentication, access, credit or transport failure | Follow the specific diagnostic: check credentials, model access, account credit or connectivity. Restart after changing an environment credential. For the default Codex
|
|
838
|
+
| `PROVIDER` reports authentication, access, credit or transport failure | Follow the specific diagnostic: check credentials, model access, account credit or connectivity. Restart after changing an environment credential. For the default per-user configuration shared by Codex and DeepSeek Harness, replace a stored key with `setup` and call again. For a separately selected configuration, replace the file named by `providers.openrouter.apiKeyFile`, or select setup's printed path and restart. The category alone does not identify a rejected key. |
|
|
652
839
|
| Repeated `429` retries | Tune pacing to observed account/provider limits. For an observed limit of approximately 0.33 requests per second, try `minRequestIntervalMs: 3000` and `extractionConcurrency: 2`; adjust retry attempts as needed. Raise `llmTimeoutMs` only when its model-call timer expires. |
|
|
653
840
|
| Cache paths unreadable from the host | The host must share the server's filesystem. Sandboxed or remote hosts cannot read local cache paths; run the server where the host can read the workspace. |
|
|
654
841
|
|
|
@@ -704,12 +891,13 @@ To suppress both telemetry files in the MCP server, set `"disableTelemetry": tru
|
|
|
704
891
|
|
|
705
892
|
### MCP Server Compatibility
|
|
706
893
|
|
|
707
|
-
- Direct stdio registration serves MCP-compatible hosts; repository plugin routes serve Claude Code and Codex. Recorded live research clients include `Pi
|
|
894
|
+
- Direct stdio registration serves MCP-compatible hosts; repository plugin routes serve Claude Code and Codex, and the [DeepSeek Harness](#deepseek-harness) bundle launches the same server from a named profile. Recorded live research clients include `Pi`, Claude Code, Codex and DeepSeek Harness.
|
|
708
895
|
- The runtime must satisfy the Node.js `engines` range in the [standalone manifest](https://github.com/Curio-Data/pi-intelli-search/blob/main/packages/mcp/package.json). The server uses the [`@modelcontextprotocol/server` SDK](https://github.com/modelcontextprotocol/typescript-sdk), with its dependency range declared in that manifest and the verified release pinned in [package-lock.json](https://github.com/Curio-Data/pi-intelli-search/blob/main/package-lock.json).
|
|
709
896
|
- Standalone fetch assets are verified on _Linux_ x86-64 only; _macOS_ and _Windows_ are not verified.
|
|
710
|
-
- Full research through local-tarball plugins and registry-pin installation checks are separate evidence classes
|
|
897
|
+
- Full research through local-tarball plugins and registry-pin installation checks are separate evidence classes, and the compatibility matrix records these checks for the standalone MCP package and the Claude Code and Codex plugins. Publication alone does not establish host compatibility.
|
|
898
|
+
- For DeepSeek Harness, the matrix keeps four classes apart: credential-free local-bundle checks on dsh `0.2.2-rc.1` and `0.2.2-rc.5`; the pre-bootstrap launcher check, in which a packed bundle launched the public server on `0.2.2-rc.1`; installation by name of the public 0.25.0 packages, with cold discovery, removal and reinstallation, on `0.2.2-rc.1` without an inference call; and credentialed local-bundle search and research on `0.2.2-rc.1` only. See [DeepSeek Harness Evidence and Limits](https://github.com/Curio-Data/pi-intelli-search/blob/main/docs/COMPATIBILITY.md#deepseek-harness-evidence-and-limits).
|
|
711
899
|
|
|
712
|
-
For the standalone MCP server and host plugins, including exact tested versions of _Claude Code_, _Codex_, Node.js and the MCP SDK, see [docs/COMPATIBILITY.md](https://github.com/Curio-Data/pi-intelli-search/blob/main/docs/COMPATIBILITY.md).
|
|
900
|
+
For the standalone MCP server and host plugins, including exact tested versions of _Claude Code_, _Codex_, DeepSeek Harness, Node.js and the MCP SDK, see [docs/COMPATIBILITY.md](https://github.com/Curio-Data/pi-intelli-search/blob/main/docs/COMPATIBILITY.md).
|
|
713
901
|
|
|
714
902
|
## Documentation
|
|
715
903
|
|
|
@@ -718,12 +906,12 @@ For the standalone MCP server and host plugins, including exact tested versions
|
|
|
718
906
|
- [Architecture](https://github.com/Curio-Data/pi-intelli-search/blob/main/docs/ARCHITECTURE.md): Detailed design decisions and pipeline internals.
|
|
719
907
|
- [Compatibility](https://github.com/Curio-Data/pi-intelli-search/blob/main/docs/COMPATIBILITY.md): Tested host versions and artefacts for the native extension, MCP server and plugins.
|
|
720
908
|
- [Components](https://github.com/Curio-Data/pi-intelli-search/blob/main/docs/COMPONENTS.md): Third-party dependencies and licence attribution.
|
|
721
|
-
- [Claude Code skill](https://github.com/Curio-Data/pi-intelli-search/blob/main/plugins/claude-code/skills/intelli-search/SKILL.md)
|
|
909
|
+
- [Claude Code skill](https://github.com/Curio-Data/pi-intelli-search/blob/main/plugins/claude-code/skills/intelli-search/SKILL.md), [Codex skill](https://github.com/Curio-Data/pi-intelli-search/blob/main/plugins/codex/skills/intelli-search/SKILL.md) and [DeepSeek Harness skill](https://github.com/Curio-Data/pi-intelli-search/blob/main/plugins/dsh/skills/intelli-search/SKILL.md): Host-specific setup and agent-facing usage instructions.
|
|
722
910
|
- [Contributor guide](https://github.com/Curio-Data/pi-intelli-search/blob/main/AGENTS.md): Coding conventions and project structure.
|
|
723
911
|
|
|
724
912
|
## Downloads
|
|
725
913
|
|
|
726
|
-
Weekly npm downloads for
|
|
914
|
+
Weekly npm downloads for the native extension and MCP server packages, stacked by package and refreshed every Monday by a scheduled GitHub Action. The native extension is the lower segment of each bar and the MCP server is the upper segment; a DeepSeek Harness series is deferred until that package has download history. The chart is rendered with [rough.js](https://roughjs.com) from daily caches in `data/downloads.json` and `data/downloads-mcp.json` (see [`scripts/plot-downloads.mts`](https://github.com/Curio-Data/pi-intelli-search/blob/main/scripts/plot-downloads.mts)); the caches are append-only with a short trailing re-fetch window so npm's revisions of recent days are picked up. Only complete Monday-to-Sunday weeks are drawn, so a package's segment appears from the first refresh after its first complete week.
|
|
727
915
|
|
|
728
916
|
Daily counts come from npm's downloads API and are summed into weeks without additional filtering. [npm's counting documentation](https://blog.npmjs.org/post/92574016600/numeric-precision-matters-how-npm-download-counts-work.html) describes these totals as naïve by design: every served package tarball counts, including automation and mirrors, so read the bars as relative uptake, not unique-user counts. Verification runs that fetch the published tarballs from the registry, such as the registry-pin plugin checks, also count toward release-week totals.
|
|
729
917
|
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
resolveCredential,
|
|
7
7
|
validateCacheDir,
|
|
8
8
|
validateDomains
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-GNQNWFYE.js";
|
|
10
10
|
|
|
11
11
|
// packages/mcp/src/runtime.ts
|
|
12
12
|
import { Check } from "typebox/value";
|
|
@@ -29,6 +29,17 @@ function displayCachePath(paths, physicalPath) {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
// src/core/annotations.ts
|
|
32
|
+
function dedupeCitations(list) {
|
|
33
|
+
const seen = /* @__PURE__ */ new Set();
|
|
34
|
+
const out = [];
|
|
35
|
+
for (const citation of list) {
|
|
36
|
+
if (!/^https?:\/\//.test(citation.url)) continue;
|
|
37
|
+
if (seen.has(citation.url)) continue;
|
|
38
|
+
seen.add(citation.url);
|
|
39
|
+
out.push(citation);
|
|
40
|
+
}
|
|
41
|
+
return out;
|
|
42
|
+
}
|
|
32
43
|
function citationsFromChunk(parsed) {
|
|
33
44
|
if (typeof parsed !== "object" || parsed === null) return [];
|
|
34
45
|
const choices = parsed.choices;
|
|
@@ -55,14 +66,8 @@ function citationsFromChunk(parsed) {
|
|
|
55
66
|
}
|
|
56
67
|
function parseCitations(bodyText2) {
|
|
57
68
|
const out = [];
|
|
58
|
-
const seen = /* @__PURE__ */ new Set();
|
|
59
69
|
const add = (list) => {
|
|
60
|
-
|
|
61
|
-
if (!seen.has(c.url)) {
|
|
62
|
-
seen.add(c.url);
|
|
63
|
-
out.push(c);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
70
|
+
out.push(...list);
|
|
66
71
|
};
|
|
67
72
|
const trimmed = bodyText2.trim();
|
|
68
73
|
if (trimmed.startsWith("{")) {
|
|
@@ -414,12 +419,19 @@ var RETRYABLE_PATTERNS = [
|
|
|
414
419
|
"connection.?error",
|
|
415
420
|
"connection.?refused",
|
|
416
421
|
"connection.?lost",
|
|
422
|
+
// Gateway mid-stream drop relayed as an Anthropic-style api_error event
|
|
423
|
+
// (pi #12064; upstream since pi-ai 1.6.0).
|
|
424
|
+
"connection.?closed",
|
|
417
425
|
"other side closed",
|
|
418
426
|
"fetch failed",
|
|
419
427
|
// node-fetch system errors, e.g. the Google ADC OAuth token refresh used by
|
|
420
428
|
// google-vertex. The reason is often empty (pi #10996).
|
|
421
429
|
"request to \\S+ failed, reason:",
|
|
422
430
|
"getaddrinfo",
|
|
431
|
+
// Bare Node socket error codes, bounded so they do not match inside a longer
|
|
432
|
+
// identifier (pi #12128; upstream since pi-ai 1.6.0).
|
|
433
|
+
"(?<![a-z0-9_])(?:ECONNRESET|ECONNABORTED|ECONNREFUSED|ETIMEDOUT|EPIPE)(?![a-z0-9_])",
|
|
434
|
+
"connection reset by peer",
|
|
423
435
|
"ENOTFOUND",
|
|
424
436
|
"EAI_AGAIN",
|
|
425
437
|
"upstream.?connect",
|
|
@@ -429,8 +441,9 @@ var RETRYABLE_PATTERNS = [
|
|
|
429
441
|
"timed? out",
|
|
430
442
|
"timeout",
|
|
431
443
|
"terminated",
|
|
432
|
-
//
|
|
433
|
-
//
|
|
444
|
+
// Unbounded raw Node transport codes retained from the pre-alignment
|
|
445
|
+
// classifier. Upstream 1.6.0 covers these in the bounded group above; the
|
|
446
|
+
// extras avoid narrowing the extension's existing matches.
|
|
434
447
|
"ETIMEDOUT",
|
|
435
448
|
"ECONNRESET",
|
|
436
449
|
"ECONNREFUSED",
|
|
@@ -446,6 +459,9 @@ var RETRYABLE_PATTERNS = [
|
|
|
446
459
|
// WebSocket transports can report close/error text instead of HTTP/fetch text.
|
|
447
460
|
"websocket.?closed",
|
|
448
461
|
"websocket.?error",
|
|
462
|
+
// Codex's 60-minute WebSocket lifetime limit; retrying opens a fresh
|
|
463
|
+
// connection (pi #12124; upstream since pi-ai 1.6.0).
|
|
464
|
+
"websocket.?connection.?limit.?reached",
|
|
449
465
|
// Premature stream endings from SDKs and transports (pi #4433, #3594).
|
|
450
466
|
"ended without",
|
|
451
467
|
"stream ended before message_stop",
|
|
@@ -592,16 +608,47 @@ function inferCurrentness(line) {
|
|
|
592
608
|
if (lower.includes("outdated") || lower.includes("old")) return "possibly outdated";
|
|
593
609
|
return "undated";
|
|
594
610
|
}
|
|
595
|
-
function
|
|
611
|
+
function matchTrailingSourcesSection(text) {
|
|
596
612
|
const trimmedEnd = text.replace(/[ \t]+$/g, "");
|
|
597
613
|
const match = trimmedEnd.match(
|
|
598
614
|
/\n[ \t]*(?:#{1,6}[ \t]*)?\*{0,2}Sources\*{0,2}[ \t]*:?[ \t]*\n[\s\S]*$/i
|
|
599
615
|
);
|
|
616
|
+
if (!match) return void 0;
|
|
617
|
+
if (!/https?:\/\/|\bwww\./.test(match[0])) return void 0;
|
|
618
|
+
return { start: match.index ?? 0, section: match[0] };
|
|
619
|
+
}
|
|
620
|
+
function stripTrailingSourcesSection(text) {
|
|
621
|
+
const match = matchTrailingSourcesSection(text);
|
|
600
622
|
if (!match) return text;
|
|
601
|
-
|
|
602
|
-
const cut = trimmedEnd.slice(0, match.index).replace(/\s+$/g, "");
|
|
623
|
+
const cut = text.slice(0, match.start).replace(/\s+$/g, "");
|
|
603
624
|
return cut + "\n";
|
|
604
625
|
}
|
|
626
|
+
function titleFromUrl(url) {
|
|
627
|
+
try {
|
|
628
|
+
const u = new URL(url);
|
|
629
|
+
const parts = u.pathname.split("/").filter(Boolean);
|
|
630
|
+
return parts.length > 0 ? parts[parts.length - 1].replace(/\.[^.]+$/, "") : u.hostname;
|
|
631
|
+
} catch {
|
|
632
|
+
return url;
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
function hostOf(url) {
|
|
636
|
+
try {
|
|
637
|
+
return new URL(url).hostname;
|
|
638
|
+
} catch {
|
|
639
|
+
return void 0;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
function labelCandidateOk(label) {
|
|
643
|
+
return label.length > 0 && !/[\][\r\n\t]/.test(label) && !label.endsWith("\\") && label.trim().length > 0;
|
|
644
|
+
}
|
|
645
|
+
function safeLinkLabel(title, url) {
|
|
646
|
+
if (title !== void 0 && labelCandidateOk(title)) return title;
|
|
647
|
+
const derived = titleFromUrl(url);
|
|
648
|
+
if (labelCandidateOk(derived)) return derived;
|
|
649
|
+
const host = hostOf(url);
|
|
650
|
+
return host !== void 0 && labelCandidateOk(host) ? host : "source";
|
|
651
|
+
}
|
|
605
652
|
|
|
606
653
|
// src/core/llm.ts
|
|
607
654
|
async function runModelWithPolicy(attempt, request, logger, testing) {
|
|
@@ -765,6 +812,119 @@ help someone researching the current query.
|
|
|
765
812
|
Response format:
|
|
766
813
|
[{"index": 1, "relevance": "one-line note"}]`;
|
|
767
814
|
|
|
815
|
+
// src/core/citation-numbering.ts
|
|
816
|
+
function usedNumbers(text) {
|
|
817
|
+
const used = /* @__PURE__ */ new Set();
|
|
818
|
+
for (const m of text.matchAll(/\[(\d{1,3})\]/g)) used.add(Number(m[1]));
|
|
819
|
+
return used;
|
|
820
|
+
}
|
|
821
|
+
function bareMarkerNumbers(text) {
|
|
822
|
+
const used = /* @__PURE__ */ new Set();
|
|
823
|
+
for (const m of text.matchAll(/\[(\d{1,3})\](?![:(])/g)) used.add(Number(m[1]));
|
|
824
|
+
return used;
|
|
825
|
+
}
|
|
826
|
+
function hasBareMarkers(text) {
|
|
827
|
+
return /\[(\d{1,3})\](?![:(])/.test(text);
|
|
828
|
+
}
|
|
829
|
+
function numberedSectionBase(text) {
|
|
830
|
+
const match = matchTrailingSourcesSection(text);
|
|
831
|
+
if (!match) return void 0;
|
|
832
|
+
const parsed = [];
|
|
833
|
+
const blocked = /* @__PURE__ */ new Set();
|
|
834
|
+
const pattern = /^\s*(\d{1,3})[.)][ \t]*(?:\[([^\]]*)\]\((https?:\/\/(?:[^()\s]|\([^()\s]*\))+)\)|(https?:\/\/(?:[^()\s]|\([^()\s]*\))+))/gm;
|
|
835
|
+
for (const m of match.section.matchAll(pattern)) {
|
|
836
|
+
const number = Number(m[1]);
|
|
837
|
+
const url = m[3] ?? m[4].replace(/[.,;:!]+$/, "");
|
|
838
|
+
parsed.push({ number, url, ...m[2] ? { title: m[2] } : {} });
|
|
839
|
+
}
|
|
840
|
+
const counts = /* @__PURE__ */ new Map();
|
|
841
|
+
for (const e of parsed) counts.set(e.number, (counts.get(e.number) ?? 0) + 1);
|
|
842
|
+
const usable = parsed.filter((e) => e.number >= 1 && counts.get(e.number) === 1);
|
|
843
|
+
for (const [number, count] of counts) {
|
|
844
|
+
if (number < 1 || count > 1) blocked.add(number);
|
|
845
|
+
}
|
|
846
|
+
return { usable, blocked };
|
|
847
|
+
}
|
|
848
|
+
function numberSources(text, merged, citations, citationOrder, cap) {
|
|
849
|
+
const sectionMatch = matchTrailingSourcesSection(text);
|
|
850
|
+
const answerText = sectionMatch ? text.slice(0, sectionMatch.start) : text;
|
|
851
|
+
const used = usedNumbers(answerText);
|
|
852
|
+
const order = citationOrder && citationOrder.length > 0 ? citationOrder : citations;
|
|
853
|
+
let base;
|
|
854
|
+
let blocked = /* @__PURE__ */ new Set();
|
|
855
|
+
let numberingIncomplete = false;
|
|
856
|
+
if (order.length > 0) {
|
|
857
|
+
base = order.map((c, i) => ({
|
|
858
|
+
number: i + 1,
|
|
859
|
+
url: c.url,
|
|
860
|
+
...c.title ? { title: c.title } : {}
|
|
861
|
+
}));
|
|
862
|
+
} else if (hasBareMarkers(answerText)) {
|
|
863
|
+
const section = numberedSectionBase(text);
|
|
864
|
+
if (section) {
|
|
865
|
+
base = [...section.usable].sort((a, b) => a.number - b.number);
|
|
866
|
+
blocked = section.blocked;
|
|
867
|
+
if (base.length === 0) {
|
|
868
|
+
return {
|
|
869
|
+
entries: numberPositional(merged.slice(0, cap)),
|
|
870
|
+
unmatchedMarkers: 0,
|
|
871
|
+
numberingIncomplete: true
|
|
872
|
+
};
|
|
873
|
+
}
|
|
874
|
+
numberingIncomplete = blocked.size > 0;
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
if (!base) {
|
|
878
|
+
return {
|
|
879
|
+
entries: numberPositional(merged.slice(0, cap)),
|
|
880
|
+
unmatchedMarkers: 0,
|
|
881
|
+
numberingIncomplete: hasBareMarkers(answerText)
|
|
882
|
+
};
|
|
883
|
+
}
|
|
884
|
+
const proseTitle = /* @__PURE__ */ new Map();
|
|
885
|
+
for (const m of merged) if (!proseTitle.has(m.url)) proseTitle.set(m.url, m.title);
|
|
886
|
+
const titleFor = (url, baseTitle) => {
|
|
887
|
+
if (baseTitle && baseTitle.length > 0) return baseTitle;
|
|
888
|
+
return proseTitle.get(url) ?? url;
|
|
889
|
+
};
|
|
890
|
+
const baseUrls = new Set(base.map((e) => e.url));
|
|
891
|
+
const firstNumberForUrl = /* @__PURE__ */ new Map();
|
|
892
|
+
const entries = [];
|
|
893
|
+
for (const e of base) {
|
|
894
|
+
if (e.number > cap && !used.has(e.number)) continue;
|
|
895
|
+
const repeats = firstNumberForUrl.get(e.url);
|
|
896
|
+
if (repeats === void 0) firstNumberForUrl.set(e.url, e.number);
|
|
897
|
+
entries.push({
|
|
898
|
+
number: e.number,
|
|
899
|
+
url: e.url,
|
|
900
|
+
title: titleFor(e.url, e.title),
|
|
901
|
+
...repeats !== void 0 ? { repeats } : {}
|
|
902
|
+
});
|
|
903
|
+
}
|
|
904
|
+
const baseSize = base[base.length - 1].number;
|
|
905
|
+
let next = baseSize + 1;
|
|
906
|
+
for (const m of merged) {
|
|
907
|
+
if (entries.length >= cap) break;
|
|
908
|
+
if (baseUrls.has(m.url)) continue;
|
|
909
|
+
while (used.has(next) || blocked.has(next)) next++;
|
|
910
|
+
entries.push({
|
|
911
|
+
number: next++,
|
|
912
|
+
url: m.url,
|
|
913
|
+
// The merged label (including inferred-from-text derivations) is what
|
|
914
|
+
// the historical display showed; keep it before falling back to the URL.
|
|
915
|
+
title: m.title || titleFor(m.url),
|
|
916
|
+
...m.inferred ? { inferred: true, originalReference: m.originalReference } : {}
|
|
917
|
+
});
|
|
918
|
+
baseUrls.add(m.url);
|
|
919
|
+
}
|
|
920
|
+
const present = new Set(entries.map((e) => e.number));
|
|
921
|
+
const unmatchedMarkers = [...bareMarkerNumbers(answerText)].filter((n) => !present.has(n)).length;
|
|
922
|
+
return { entries, unmatchedMarkers, numberingIncomplete };
|
|
923
|
+
}
|
|
924
|
+
function numberPositional(sources) {
|
|
925
|
+
return sources.map((s, i) => ({ ...s, number: i + 1 }));
|
|
926
|
+
}
|
|
927
|
+
|
|
768
928
|
// src/core/provenance.ts
|
|
769
929
|
function evidenceExtractions(extractions) {
|
|
770
930
|
const evidence = extractions.filter(
|
|
@@ -1448,7 +1608,7 @@ async function search(params, context) {
|
|
|
1448
1608
|
const searchQuery = appendDomainFilter(params.query, params.domains);
|
|
1449
1609
|
const payloadPatch = buildSearchPayloadPatch(settings, searchConfig.provider, params.domains);
|
|
1450
1610
|
try {
|
|
1451
|
-
const { text: responseText, citations } = await models.complete({
|
|
1611
|
+
const { text: responseText, citations, citationOrder } = await models.complete({
|
|
1452
1612
|
model: searchConfig,
|
|
1453
1613
|
systemPrompt: SEARCH_SYSTEM_PROMPT,
|
|
1454
1614
|
userMessage: searchQuery,
|
|
@@ -1459,10 +1619,15 @@ async function search(params, context) {
|
|
|
1459
1619
|
reasoning: payloadPatch ? settings.searchWebSearch.reasoning ?? "low" : void 0
|
|
1460
1620
|
});
|
|
1461
1621
|
throwIfAborted(signal);
|
|
1462
|
-
const
|
|
1463
|
-
|
|
1622
|
+
const merged = mergeCitations(extractSourceUrls(responseText), { citations });
|
|
1623
|
+
const numbering = numberSources(
|
|
1624
|
+
responseText,
|
|
1625
|
+
merged,
|
|
1626
|
+
citations,
|
|
1627
|
+
citationOrder,
|
|
1464
1628
|
Math.max(1, settings.defaultUrls)
|
|
1465
1629
|
);
|
|
1630
|
+
const sources = numbering.entries;
|
|
1466
1631
|
const result = {
|
|
1467
1632
|
summary: stripTrailingSourcesSection(responseText),
|
|
1468
1633
|
sources,
|
|
@@ -1470,7 +1635,7 @@ async function search(params, context) {
|
|
|
1470
1635
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1471
1636
|
};
|
|
1472
1637
|
return {
|
|
1473
|
-
text: formatSearchResult(result),
|
|
1638
|
+
text: formatSearchResult(result, numbering.unmatchedMarkers, numbering.numberingIncomplete),
|
|
1474
1639
|
outcome: "completed",
|
|
1475
1640
|
details: { sources, query: params.query }
|
|
1476
1641
|
};
|
|
@@ -1479,7 +1644,7 @@ async function search(params, context) {
|
|
|
1479
1644
|
throw new Error(`Search failed: ${err?.message ?? String(err)}`);
|
|
1480
1645
|
}
|
|
1481
1646
|
}
|
|
1482
|
-
function formatSearchResult(result) {
|
|
1647
|
+
function formatSearchResult(result, unmatchedMarkers = 0, numberingIncomplete = false) {
|
|
1483
1648
|
let output = `## Search results for: "${result.query}"
|
|
1484
1649
|
|
|
1485
1650
|
`;
|
|
@@ -1487,11 +1652,21 @@ function formatSearchResult(result) {
|
|
|
1487
1652
|
output += `### Sources (${result.sources.length})
|
|
1488
1653
|
|
|
1489
1654
|
`;
|
|
1490
|
-
for (const
|
|
1655
|
+
for (const source of result.sources) {
|
|
1491
1656
|
const inferred = source.inferred ? ` (inferred from text, not a citation${source.originalReference ? `; original token: ${source.originalReference}` : ""})` : "";
|
|
1492
|
-
|
|
1657
|
+
const repeats = source.repeats !== void 0 ? ` (same source as entry ${source.repeats})` : "";
|
|
1658
|
+
const label = source.title ? safeLinkLabel(source.title, source.url) : source.url;
|
|
1659
|
+
output += `${source.number}. [${label}](${source.url})${repeats}${inferred}
|
|
1493
1660
|
`;
|
|
1494
1661
|
}
|
|
1662
|
+
if (unmatchedMarkers > 0) {
|
|
1663
|
+
output += `
|
|
1664
|
+
> Note: ${unmatchedMarkers} cited number${unmatchedMarkers === 1 ? "" : "s"} in the answer ${unmatchedMarkers === 1 ? "has" : "have"} no entry in the list above.
|
|
1665
|
+
`;
|
|
1666
|
+
}
|
|
1667
|
+
if (numberingIncomplete) {
|
|
1668
|
+
output += "\n> Note: the answer's citation markers could not be matched to numbered sources, so they may not match the list.\n";
|
|
1669
|
+
}
|
|
1495
1670
|
return output;
|
|
1496
1671
|
}
|
|
1497
1672
|
|
|
@@ -4964,10 +5139,12 @@ function createOpenRouterClient(config, options) {
|
|
|
4964
5139
|
}
|
|
4965
5140
|
if (typeof content !== "string")
|
|
4966
5141
|
throw new Error("OpenRouter returned no text completion");
|
|
5142
|
+
const citationOccurrences = request.collectCitations ? parseCitations(raw) : [];
|
|
4967
5143
|
return {
|
|
4968
5144
|
value: {
|
|
4969
5145
|
text: content,
|
|
4970
|
-
citations:
|
|
5146
|
+
citations: dedupeCitations(citationOccurrences),
|
|
5147
|
+
...citationOccurrences.length > 0 ? { citationOrder: citationOccurrences } : {},
|
|
4971
5148
|
usage: usage(data.usage),
|
|
4972
5149
|
...typeof choice.finish_reason === "string" ? {
|
|
4973
5150
|
finishReason: choice.finish_reason === "length" || choice.finish_reason === "stop" ? choice.finish_reason : "other"
|
|
@@ -426,7 +426,7 @@ function defaultDocument(credential) {
|
|
|
426
426
|
}
|
|
427
427
|
};
|
|
428
428
|
}
|
|
429
|
-
function
|
|
429
|
+
function defaultHostConfig(_host, workspace, paths) {
|
|
430
430
|
return parseConfig(defaultDocument(paths.credential), workspace);
|
|
431
431
|
}
|
|
432
432
|
function credentialText(source) {
|
|
@@ -547,7 +547,7 @@ export {
|
|
|
547
547
|
loadConfig,
|
|
548
548
|
StandaloneError,
|
|
549
549
|
hostPaths,
|
|
550
|
-
|
|
550
|
+
defaultHostConfig,
|
|
551
551
|
resolveCredential,
|
|
552
552
|
setupHost
|
|
553
553
|
};
|
package/dist/cli.js
CHANGED
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
} from "./chunk-ZTHYRKI2.js";
|
|
5
5
|
import {
|
|
6
6
|
ConfigurationError,
|
|
7
|
-
|
|
7
|
+
defaultHostConfig,
|
|
8
8
|
hostPaths,
|
|
9
9
|
identity,
|
|
10
10
|
loadConfig,
|
|
11
11
|
resolveWorkspace,
|
|
12
12
|
setupHost
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-GNQNWFYE.js";
|
|
14
14
|
|
|
15
15
|
// packages/mcp/src/cli.ts
|
|
16
16
|
import { parseArgs } from "node:util";
|
|
@@ -31,16 +31,17 @@ function cliOptions(argv, env = process.env) {
|
|
|
31
31
|
"check-config": { type: "boolean" }
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
|
-
if (values.host !== void 0 && values.host !== "codex")
|
|
34
|
+
if (values.host !== void 0 && values.host !== "codex" && values.host !== "dsh")
|
|
35
35
|
throw new Error("Unsupported host");
|
|
36
36
|
if (positionals.length > 1 || positionals.length === 1 && positionals[0] !== "setup")
|
|
37
37
|
throw new Error("Unsupported command");
|
|
38
38
|
const setup = positionals[0] === "setup";
|
|
39
|
+
const host = values.host === "codex" || values.host === "dsh";
|
|
39
40
|
return {
|
|
40
41
|
...values,
|
|
41
42
|
setup,
|
|
42
|
-
config: values.config ?? (setup ||
|
|
43
|
-
workspace: values.workspace ?? (setup ||
|
|
43
|
+
config: values.config ?? (setup || host ? void 0 : env.INTELLI_SEARCH_CONFIG),
|
|
44
|
+
workspace: values.workspace ?? (setup || host ? void 0 : env.INTELLI_SEARCH_WORKSPACE)
|
|
44
45
|
};
|
|
45
46
|
}
|
|
46
47
|
async function credentialInput() {
|
|
@@ -70,13 +71,15 @@ async function main() {
|
|
|
70
71
|
process.stdout.write(
|
|
71
72
|
`Usage: mcp-intelli-search setup
|
|
72
73
|
mcp-intelli-search --host codex [--config FILE] [--workspace ABSOLUTE_DIRECTORY]
|
|
74
|
+
mcp-intelli-search --host dsh [--config FILE] [--workspace ABSOLUTE_DIRECTORY]
|
|
73
75
|
mcp-intelli-search --config FILE --workspace ABSOLUTE_DIRECTORY
|
|
74
76
|
|
|
75
77
|
Commands:
|
|
76
78
|
setup Store an OpenRouter key read from standard input and create or connect per-user configuration; accepts no path selections
|
|
77
79
|
|
|
78
80
|
Options:
|
|
79
|
-
--host codex
|
|
81
|
+
--host codex Use the Codex working root and per-user defaults
|
|
82
|
+
--host dsh Use the DeepSeek Harness working directory and per-user defaults
|
|
80
83
|
--config FILE Explicit generic configuration (or INTELLI_SEARCH_CONFIG)
|
|
81
84
|
--workspace DIR Existing absolute generic workspace (or INTELLI_SEARCH_WORKSPACE)
|
|
82
85
|
--check-config Validate configuration without inference or serving
|
|
@@ -84,7 +87,7 @@ Options:
|
|
|
84
87
|
--version Show package version
|
|
85
88
|
|
|
86
89
|
Generic MCP serving requires explicit configuration and workspace paths.
|
|
87
|
-
Codex
|
|
90
|
+
Codex and DeepSeek Harness modes supply both from their launchers and work without path exports.
|
|
88
91
|
Standard output carries protocol messages only while serving.
|
|
89
92
|
`
|
|
90
93
|
);
|
|
@@ -116,36 +119,38 @@ Restart after changing loaded configuration.
|
|
|
116
119
|
);
|
|
117
120
|
return;
|
|
118
121
|
}
|
|
119
|
-
const
|
|
122
|
+
const host = args.host === "codex" || args.host === "dsh" ? args.host : void 0;
|
|
123
|
+
const paths = host ? hostPaths() : void 0;
|
|
120
124
|
const file = args.config ?? paths?.config;
|
|
121
|
-
const workspace = args.workspace ?? (
|
|
125
|
+
const workspace = args.workspace ?? (host ? process.cwd() : void 0);
|
|
122
126
|
if (!file || !workspace)
|
|
123
127
|
throw new Error(
|
|
124
128
|
"Explicit --config and --workspace are required (or their INTELLI_SEARCH_* environment equivalents)"
|
|
125
129
|
);
|
|
126
130
|
const canonicalWorkspace = await resolveWorkspace(workspace);
|
|
127
131
|
let workspaceDefect;
|
|
128
|
-
if (
|
|
132
|
+
if (host && !args.workspace) {
|
|
129
133
|
const home = await realpath(homedir()).catch(() => homedir());
|
|
130
134
|
if (canonicalWorkspace === parsePath(canonicalWorkspace).root || canonicalWorkspace === home)
|
|
131
|
-
workspaceDefect = "Codex working root must be a project directory, not the home or filesystem root; restart Codex from the project or with --cd <project>";
|
|
135
|
+
workspaceDefect = host === "codex" ? "Codex working root must be a project directory, not the home or filesystem root; restart Codex from the project or with --cd <project>" : "DeepSeek Harness working directory must be a project directory, not the home or filesystem root; start the harness from the project or set cwd on the bridge row";
|
|
132
136
|
}
|
|
133
137
|
if (args["check-config"]) {
|
|
134
138
|
if (workspaceDefect) throw new Error(workspaceDefect);
|
|
135
139
|
let builtInDefaults = false;
|
|
136
|
-
if (paths && !args.config) {
|
|
140
|
+
if (host && paths && !args.config) {
|
|
137
141
|
try {
|
|
138
142
|
await loadConfig(file, workspace);
|
|
139
143
|
} catch (error) {
|
|
140
144
|
if (!(error instanceof ConfigurationError) || error.reason !== "missing") throw error;
|
|
141
|
-
await
|
|
145
|
+
await defaultHostConfig(host, workspace, paths);
|
|
142
146
|
builtInDefaults = true;
|
|
143
147
|
}
|
|
144
148
|
} else {
|
|
145
149
|
await loadConfig(file, workspace);
|
|
146
150
|
}
|
|
147
151
|
process.stdout.write(
|
|
148
|
-
builtInDefaults ?
|
|
152
|
+
builtInDefaults ? `Configuration is valid (built-in ${host === "codex" ? "Codex" : "DeepSeek Harness"} defaults; no per-user file found).
|
|
153
|
+
` : "Configuration is valid.\n"
|
|
149
154
|
);
|
|
150
155
|
return;
|
|
151
156
|
}
|
|
@@ -162,8 +167,8 @@ Restart after changing loaded configuration.
|
|
|
162
167
|
config = await loadSelected();
|
|
163
168
|
} catch (error) {
|
|
164
169
|
if (!(error instanceof ConfigurationError)) throw error;
|
|
165
|
-
if (paths && !args.config && error.reason === "missing") {
|
|
166
|
-
config = await
|
|
170
|
+
if (host && paths && !args.config && error.reason === "missing") {
|
|
171
|
+
config = await defaultHostConfig(host, workspace, paths);
|
|
167
172
|
} else {
|
|
168
173
|
process.stderr.write(
|
|
169
174
|
`[mcp-intelli-search] ${error.message}. Serving anyway: each tool call reports this and rereads the file until it loads
|
package/dist/runtime.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRuntime
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-67MPZQF2.js";
|
|
4
4
|
import {
|
|
5
5
|
ConfigurationError,
|
|
6
6
|
StandaloneError,
|
|
7
7
|
identity,
|
|
8
8
|
loadConfig,
|
|
9
9
|
parseConfig
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-GNQNWFYE.js";
|
|
11
11
|
export {
|
|
12
12
|
ConfigurationError,
|
|
13
13
|
StandaloneError,
|
package/dist/server.js
CHANGED
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
extractSchema,
|
|
8
8
|
researchSchema,
|
|
9
9
|
searchSchema
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-67MPZQF2.js";
|
|
11
11
|
import {
|
|
12
12
|
ConfigurationError,
|
|
13
13
|
StandaloneError,
|
|
14
14
|
identity
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-GNQNWFYE.js";
|
|
16
16
|
|
|
17
17
|
// packages/mcp/src/server.ts
|
|
18
18
|
import { McpServer, fromJsonSchema } from "@modelcontextprotocol/server";
|
package/package.json
CHANGED