@curio-data/mcp-intelli-search 0.15.0-alpha.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/LICENSE +199 -0
- package/NOTICE +41 -0
- package/README.md +260 -0
- package/dist/chunk-5I6PWQPA.js +254 -0
- package/dist/chunk-V6E7CJEW.js +2505 -0
- package/dist/chunk-ZTHYRKI2.js +23 -0
- package/dist/cli.js +88 -0
- package/dist/runtime.js +16 -0
- package/dist/server.js +281 -0
- package/package.json +44 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by the Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text to be enclosed should be included verbatim,
|
|
184
|
+
enclosed between triple backticks. The text should be
|
|
185
|
+
enclosed in the appropriate comment syntax for the file format.
|
|
186
|
+
|
|
187
|
+
Copyright 2026 Ashraf Miah, Curio Data Pro Ltd
|
|
188
|
+
|
|
189
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
190
|
+
you may not use this file except in compliance with the License.
|
|
191
|
+
You may obtain a copy of the License at
|
|
192
|
+
|
|
193
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
194
|
+
|
|
195
|
+
Unless required by applicable law or agreed to in writing, software
|
|
196
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
197
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
198
|
+
See the License for the specific language governing permissions and
|
|
199
|
+
limitations under the License.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
pi-intelli-search
|
|
2
|
+
Copyright 2026 Ashraf Miah, Curio Data Pro Ltd
|
|
3
|
+
|
|
4
|
+
This product includes software developed at
|
|
5
|
+
Curio Data Pro Ltd (https://github.com/Curio-Data).
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
This product includes/uses the following third-party software:
|
|
10
|
+
|
|
11
|
+
wreq-js (https://github.com/sqdshguy/wreq-js)
|
|
12
|
+
Copyright sqdshguy
|
|
13
|
+
License: MIT
|
|
14
|
+
|
|
15
|
+
defuddle (https://github.com/kepano/defuddle)
|
|
16
|
+
Copyright Kepano
|
|
17
|
+
License: MIT
|
|
18
|
+
|
|
19
|
+
linkedom (https://github.com/WebReflection/linkedom)
|
|
20
|
+
Copyright Andrea Giammarchi
|
|
21
|
+
License: ISC
|
|
22
|
+
|
|
23
|
+
typebox (https://github.com/sinclairzx81/typebox)
|
|
24
|
+
Copyright Sinclair
|
|
25
|
+
License: MIT
|
|
26
|
+
|
|
27
|
+
@modelcontextprotocol/server (https://github.com/modelcontextprotocol/typescript-sdk)
|
|
28
|
+
Copyright Anthropic, PBC and contributors
|
|
29
|
+
License: Apache-2.0
|
|
30
|
+
|
|
31
|
+
@earendil-works/pi-ai (https://github.com/earendil-works/pi)
|
|
32
|
+
Copyright Mario Zechner
|
|
33
|
+
License: Apache-2.0
|
|
34
|
+
|
|
35
|
+
@earendil-works/pi-coding-agent (https://github.com/earendil-works/pi)
|
|
36
|
+
Copyright Mario Zechner
|
|
37
|
+
License: Apache-2.0
|
|
38
|
+
|
|
39
|
+
@earendil-works/pi-tui (https://github.com/earendil-works/pi)
|
|
40
|
+
Copyright Mario Zechner
|
|
41
|
+
License: Apache-2.0
|
package/README.md
ADDED
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
# Standalone Research Runtime and MCP Server
|
|
2
|
+
|
|
3
|
+
`@curio-data/mcp-intelli-search` packages the shared `intelli-search` engine without a `Pi` installation. It serves the four research operations as a Model Context Protocol (MCP) server over standard input/output (stdio), with explicit configuration and an [_OpenRouter_](https://openrouter.ai) inference adapter. The runtime entrypoint also executes the operations directly for engine verification. This artifact is not published.
|
|
4
|
+
|
|
5
|
+
## Contents
|
|
6
|
+
|
|
7
|
+
- [Requirements](#requirements)
|
|
8
|
+
- [Direct Registration](#direct-registration)
|
|
9
|
+
- [Verification](#verification)
|
|
10
|
+
- [Serving the Protocol](#serving-the-protocol)
|
|
11
|
+
- [Configuration](#configuration)
|
|
12
|
+
- [Tuning](#tuning)
|
|
13
|
+
- [Direct Engine Verification](#direct-engine-verification)
|
|
14
|
+
- [Filesystem and Privacy Boundaries](#filesystem-and-privacy-boundaries)
|
|
15
|
+
- [Timeouts and Troubleshooting](#timeouts-and-troubleshooting)
|
|
16
|
+
- [Host Plugins](#host-plugins)
|
|
17
|
+
|
|
18
|
+
## Requirements
|
|
19
|
+
|
|
20
|
+
- [_Node.js_](https://nodejs.org/) satisfying the `engines` range in `package.json`.
|
|
21
|
+
- An existing, explicitly selected absolute workspace directory.
|
|
22
|
+
- An explicitly selected JSON (JavaScript Object Notation) configuration file.
|
|
23
|
+
- A separately billed OpenRouter API (application programming interface) key supplied through a named environment variable before constructing the runtime. Restart the runtime after changing credentials; it snapshots the environment.
|
|
24
|
+
- 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.
|
|
25
|
+
|
|
26
|
+
The package neither reads host credential stores nor loads project configuration automatically. Native `Pi` settings, authentication, providers and defaults remain independent.
|
|
27
|
+
|
|
28
|
+
## Direct Registration
|
|
29
|
+
|
|
30
|
+
Register the server directly with any MCP-compatible host that launches stdio processes. The executable is `mcp-intelli-search`. The following folder-scoped commands use [_Claude Code_](https://code.claude.com/docs/en/mcp).
|
|
31
|
+
|
|
32
|
+
Save the example in [Configuration](#configuration) as `.intelli-search.json` in the target folder. The file can instead live at any readable absolute path, either per-folder or shared; replace `INTELLI_SEARCH_CONFIG` in the commands accordingly. Keep `INTELLI_SEARCH_WORKSPACE` per-folder and point it to an existing absolute directory so each folder has its own research cache. The server does not discover either path automatically.
|
|
33
|
+
|
|
34
|
+
Supply `OPENROUTER_API_KEY` through the server process environment before using the tools. For _Claude Code_, export it in the environment that launches the host, rather than putting the key in a committed file. The configuration names the variable, not the credential; restart the host after changing credentials.
|
|
35
|
+
|
|
36
|
+
Run registration from the target folder. `local` is the default scope: private to the operator and active only in that folder. Add `--scope project` before `--` to write a shared `.mcp.json` into the folder. Project-scoped servers require approval in _Claude Code_ before connection; absolute paths in a shared file must also be valid on each operator's machine.
|
|
37
|
+
|
|
38
|
+
### Post-Publication Launcher
|
|
39
|
+
|
|
40
|
+
The package's first registry publication is pending. Use this launcher only after publication; `npx` downloads the package without a separate install step:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
claude mcp add intelli_search \
|
|
44
|
+
-e "INTELLI_SEARCH_CONFIG=$PWD/.intelli-search.json" \
|
|
45
|
+
-e "INTELLI_SEARCH_WORKSPACE=$PWD" \
|
|
46
|
+
-- npx -y --package @curio-data/mcp-intelli-search \
|
|
47
|
+
mcp-intelli-search
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Append `@<version>` to the package name to pin a release.
|
|
51
|
+
|
|
52
|
+
### Pre-Publication Source-Checkout Launcher
|
|
53
|
+
|
|
54
|
+
From the repository root, install dependencies if needed with `npm install`, then build:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npm run build:all
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Switch to the target folder and register the built server. Replace the checkout path with its actual absolute path:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
claude mcp add intelli_search \
|
|
64
|
+
-e "INTELLI_SEARCH_CONFIG=$PWD/.intelli-search.json" \
|
|
65
|
+
-e "INTELLI_SEARCH_WORKSPACE=$PWD" \
|
|
66
|
+
-- node /absolute/path/to/pi-intelli-search/packages/mcp/dist/cli.js
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Verification
|
|
70
|
+
|
|
71
|
+
From the target folder, check the registered server:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
claude mcp list
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Confirm `intelli_search` shows as connected. If a project-scoped server shows pending approval, open _Claude Code_ in that folder and approve it before checking again.
|
|
78
|
+
|
|
79
|
+
Validate the configuration separately without credentials or inference. After publication, use:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
INTELLI_SEARCH_CONFIG="$PWD/.intelli-search.json" \
|
|
83
|
+
INTELLI_SEARCH_WORKSPACE="$PWD" \
|
|
84
|
+
npx -y --package @curio-data/mcp-intelli-search \
|
|
85
|
+
mcp-intelli-search --check-config
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
For the source-checkout launcher, use:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
node /absolute/path/to/pi-intelli-search/packages/mcp/dist/cli.js \
|
|
92
|
+
--config "$PWD/.intelli-search.json" \
|
|
93
|
+
--workspace "$PWD" \
|
|
94
|
+
--check-config
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Use the same configuration path as the registered server if it is shared or stored elsewhere. A successful check prints `Configuration is valid.` and exits with status `0`. It validates configuration and workspace, not host connectivity, credentials or model access. `claude mcp list` checks the host connection; successful inference requires the separate provider key.
|
|
98
|
+
|
|
99
|
+
## Serving the Protocol
|
|
100
|
+
|
|
101
|
+
An invocation without `--check-config` validates the explicit configuration and workspace, then serves the four canonical tools (`intelli_search`, `intelli_extract`, `intelli_collate`, `intelli_research`) over stdio until the input stream closes. Serving performs no inference at startup; credentials are only required when an operation runs.
|
|
102
|
+
|
|
103
|
+
- **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 SDK (software development kit) distinction between malformed protocol requests and invalid arguments.
|
|
104
|
+
- **Results.** Successful calls return the concise summary as text content plus structured content with `outcome` and `details`. Degraded research (`no-links`, `fetch-failed`, `extraction-failed`) remains a normal result. Execution failures return `isError` results tagged with the safe `StandaloneError` category rather than raw provider causes.
|
|
105
|
+
- **Queueing.** One operation runs at a time and up to eight further requests queue; requests beyond the bound settle immediately with a busy tool error. A queued request whose client cancels settles without starting its operation.
|
|
106
|
+
- **Progress and Cancellation.** When the client supplies a progress token, stage progress is forwarded as `notifications/progress` (percentage of one hundred). Client cancellation aborts the running operation through the shared model policy and stage boundaries.
|
|
107
|
+
- **Shutdown.** Closing standard input aborts in-flight and queued work, closes the transport and exits. `SIGINT` and `SIGTERM` trigger the same drain with a bounded hard-exit backstop. No unanswered request or runaway child work remains.
|
|
108
|
+
- **Framing.** Standard output carries protocol messages only. Before the server module loads, a guard diverts `process.stdout.write` (including console output, import-time writes and direct dependency writes) to standard error; the transport writes frames through the original stream, so the SDK's own output is never corrupted. Adapter diagnostics use standard error.
|
|
109
|
+
- **Annotations.** `intelli_search` and `intelli_extract` are marked read-only; `intelli_collate` and `intelli_research` write cache files and are not read-only. No tool claims idempotence. Operations use external services; inference and search charges apply to the configured provider account. Invalid calls and startup validation do not perform inference.
|
|
110
|
+
|
|
111
|
+
Startup diagnostics go to standard error. The SDK version range is declared in `package.json` (the lockfile pins the verified release); the protocol implementation is the official split server package verified in the repository handoff.
|
|
112
|
+
|
|
113
|
+
## Configuration
|
|
114
|
+
|
|
115
|
+
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.
|
|
116
|
+
|
|
117
|
+
The following example explicitly selects OpenRouter for every role. These are example selections, not standalone defaults:
|
|
118
|
+
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"providers": {
|
|
122
|
+
"openrouter": {
|
|
123
|
+
"apiKeyEnv": "OPENROUTER_API_KEY"
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"models": {
|
|
127
|
+
"search": {
|
|
128
|
+
"provider": "openrouter",
|
|
129
|
+
"model": "perplexity/sonar"
|
|
130
|
+
},
|
|
131
|
+
"extract": {
|
|
132
|
+
"provider": "openrouter",
|
|
133
|
+
"model": "minimax/minimax-m3"
|
|
134
|
+
},
|
|
135
|
+
"collate": {
|
|
136
|
+
"provider": "openrouter",
|
|
137
|
+
"model": "minimax/minimax-m3"
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"tuning": {
|
|
141
|
+
"cacheDir": ".search"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Only `providers`, `models` and optional `tuning` are accepted at the top level. All three model roles are required. The provider object accepts only `apiKeyEnv`, an environment-variable name rather than a key value. 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.
|
|
147
|
+
|
|
148
|
+
Configuration loading does not require working credentials. Each operation validates its required model roles against OpenRouter's model catalogue before inference. Full research validates all three roles first. Validation checks exact identifiers, text input/output, advertised reasoning efforts when supplied, and tool support for an enabled search tool. Catalogue lookup is bounded and cancellable. It establishes advertised capabilities, not account credit, per-key model access or future provider availability; inference errors remain possible.
|
|
149
|
+
|
|
150
|
+
Search requires either `perplexity/sonar`, `perplexity/sonar-pro`, `perplexity/sonar-pro-search`, or an explicitly enabled `searchWebSearch` block with a chat model. Enabling `searchWebSearch` also requires the selected model to advertise `tools` support. Combining that block with a Sonar model that does not advertise tool support fails preflight; the adapter does not silently drop the configured tool. Search tools are model-decided; a valid response can still contain no usable links.
|
|
151
|
+
|
|
152
|
+
### Tuning
|
|
153
|
+
|
|
154
|
+
Unspecified tuning comes from the canonical [shared defaults](../../src/core/defaults.ts), also used by the native adapter. The table gives each default and its effect alongside standalone validation ranges. No provider or model selection is inherited from that module. Unknown keys, invalid types and out-of-range values are rejected rather than silently clamped.
|
|
155
|
+
|
|
156
|
+
| Setting | Default and Effect | Accepted Values |
|
|
157
|
+
|---|---|---|
|
|
158
|
+
| `defaultUrls` | `10`: fallback page budget and one-shot search source-list cap | Integer from 1 to 100; must not exceed `maxUrls` |
|
|
159
|
+
| `maxUrls` | `20`: hard cap on research pages | Integer from 1 to 100 |
|
|
160
|
+
| `extractMaxChars` | `150000`: per-page extraction input character limit | Integer from 1 to 2,000,000 |
|
|
161
|
+
| `fetchTimeoutMs` | `20000`: page-fetch timeout in milliseconds | Integer from 1 to 600,000 |
|
|
162
|
+
| `llmTimeoutMs` | `90000`: application timeout per model call in milliseconds | Integer from 1 to 600,000 |
|
|
163
|
+
| `fetchConcurrency` | `4`: simultaneous page fetches | Integer from 1 to 32 |
|
|
164
|
+
| `extractionConcurrency` | `4`: simultaneous per-page extractions | Integer from 1 to 32 |
|
|
165
|
+
| `extractionMaxTokens` | `3000`: per-page output-token limit | Integer from 16 to 128,000 |
|
|
166
|
+
| `collationMaxTokens` | `4000`: synthesis output-token limit | Integer from 16 to 128,000 |
|
|
167
|
+
| `llmRetryAttempts` | `3`: model-call attempts, including the first | Integer from 1 to 10 |
|
|
168
|
+
| `searchRetryAttempts` | `2`: search attempts after a valid response with no usable links, including the first | Integer from 1 to 10 |
|
|
169
|
+
| `retryBaseDelayMs` | `1500`: base exponential-backoff delay in milliseconds | Integer from 0 to 120,000; must not exceed `retryMaxDelayMs` |
|
|
170
|
+
| `retryMaxDelayMs` | `20000`: maximum backoff and Retry-After delay in milliseconds | Integer from 0 to 120,000 |
|
|
171
|
+
| `minRequestIntervalMs` | `0`: extraction-call spacing in milliseconds; zero disables pacing | Integer from 0 to 120,000 |
|
|
172
|
+
| `cacheDir` | `.search`: workspace-relative cache directory | Nonempty relative directory, without absolute paths, backslashes or traversal components |
|
|
173
|
+
| `browserFingerprint` | `chrome_145`: browser signature for fetching | `chrome_145`, the verified shared profile |
|
|
174
|
+
| `disableTelemetry` | `false`: write the local `meta.json` sidecar; `true` suppresses it | Boolean |
|
|
175
|
+
| `disableLlmsFullDiscovery` | `false`: probe for supplementary documentation; `true` skips probes and downloads | Boolean |
|
|
176
|
+
| `searchWebSearch` | Disabled; engine `auto`, `maxResults: 8`, reasoning `minimal`. Enables the search server tool when configured | Validated block described below; replaces the entire shared default block |
|
|
177
|
+
|
|
178
|
+
`searchWebSearch` requires a boolean `enabled`. Optional fields are `engine` (`auto`, `native`, `exa`, `parallel`, `perplexity`, `firecrawl`), `maxResults` (1 to 25, capped at 20 for `perplexity`), `searchContextSize` (`low`, `medium`, `high`), `allowedDomains`, `excludedDomains`, and `reasoning` (`minimal`, `low`, `medium`, `high`). Domain lists contain hostnames, not URLs (uniform resource locators), and have at most 100 entries. The `perplexity` and `firecrawl` engines cannot combine nonempty allowed and excluded lists. Per-call domains also guide search; they are not a network allowlist for fetched pages.
|
|
179
|
+
|
|
180
|
+
**Retry Policy:** Every standalone model call, including one-shot search, extract and collate, receives configured retry and application-timeout defaults. The shared policy owns retries once; there is no underlying SDK retry loop. Retry-After delays are bounded by `retryMaxDelayMs`. Native one-shot policy remains unchanged.
|
|
181
|
+
|
|
182
|
+
**Provider Errors:** HTTP (Hypertext Transfer Protocol) errors and error-bearing successful responses, including `choices[].error`, preserve retry classification without exposing provider bodies or headers. The adapter treats a `402` with a valid Retry-After header as transient in-flight budget pressure. Ordinary credit exhaustion and permanent credential errors do not retry.
|
|
183
|
+
|
|
184
|
+
**Reasoning:** The adapter sends reasoning fields only when the catalogue advertises reasoning support; non-reasoning models receive neither effort nor exclusion fields.
|
|
185
|
+
|
|
186
|
+
**Output Budget:** Empty output after token-budget exhaustion is an error, not a successful extraction. Increase the output-token limit or lower reasoning effort when this diagnostic occurs.
|
|
187
|
+
|
|
188
|
+
## Direct Engine Verification
|
|
189
|
+
|
|
190
|
+
From the repository root:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
npm run build:all
|
|
194
|
+
npm run test:all
|
|
195
|
+
npm run test:mcp:install
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
The installation gate packs the artifact, installs production dependencies into an isolated directory and denies all ancestor dependency resolution in both module systems. It runs the installed executable's `--help` and `--version`, all four operations with synthetic inference, and actual page fetching against a loopback fixture through the installed native fetch assets. A raw protocol exchange against the installed server verifies initialization, tool listing, invalid-argument rejection without inference and clean shutdown, and asserts that standard output carries only protocol frames. The deterministic installation gate uses no provider credentials and does not establish live MCP interoperability.
|
|
199
|
+
|
|
200
|
+
The recorded live scenario `test/e2e/11_mcp_stdio.sh` exercises a real research call through the MCP client of an isolated `Pi` profile. Its evidence is recorded separately in the [compatibility matrix](../../docs/COMPATIBILITY.md), not supplied by the installation gate.
|
|
201
|
+
|
|
202
|
+
The experimental runtime entrypoint supports direct engine verification after installation:
|
|
203
|
+
|
|
204
|
+
```javascript
|
|
205
|
+
import {
|
|
206
|
+
createRuntime,
|
|
207
|
+
loadConfig,
|
|
208
|
+
} from "@curio-data/mcp-intelli-search/runtime";
|
|
209
|
+
|
|
210
|
+
const config = await loadConfig(
|
|
211
|
+
"/absolute/path/config.json",
|
|
212
|
+
"/absolute/path/workspace",
|
|
213
|
+
);
|
|
214
|
+
const runtime = await createRuntime(config);
|
|
215
|
+
const result = await runtime.execute("intelli_research", {
|
|
216
|
+
query: "Research question",
|
|
217
|
+
focusPrompt: "Specific facts and signatures to retain",
|
|
218
|
+
maxUrls: 3,
|
|
219
|
+
});
|
|
220
|
+
console.log(result.text);
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
This example incurs inference and search charges when run with a real credential. `execute()` also accepts `intelli_search`, `intelli_extract` and `intelli_collate`, with the canonical tool parameters. Its optional third argument supplies `signal` and `onProgress`. Results contain `text`, `details` and `outcome`; execution failures throw. Degraded research remains a result. Standalone validation rejects unknown argument keys, empty queries, nonpositive or fractional `maxUrls`, arrays exceeding 100 entries, strings exceeding 2,000,000 characters and unsupported extraction statuses. Native schemas are unchanged. For manual extraction followed by collation, construct each collation item from the original `url` and `title`, `result.details.extraction` and `result.details.sourceType`, plus an explicit `status` such as `success`. Do not forward the entire extraction `details` object: its `currentness` field is not a collation input.
|
|
224
|
+
|
|
225
|
+
`mcp-intelli-search --help` and `--version` need no configuration. `--check-config` validates explicit configuration and workspace syntax without credentials or inference, returning exit status 0 for valid configuration and 1 for invalid input. Neither starts a protocol connection. The runtime entrypoint is experimental and has no published TypeScript declaration contract. Execution failures expose a safe `StandaloneError.code`: `INVALID_ARGUMENTS`, `CONFIGURATION`, `WORKSPACE`, `PROVIDER`, `OPERATION` or `CANCELLED`. Cancellation uses the `AbortError` name. Raw provider causes are deliberately not retained. Some shared operations wrap provider exceptions, which become `OPERATION` errors; protocol mapping must not depend on exact diagnostic strings.
|
|
226
|
+
|
|
227
|
+
## Filesystem and Privacy Boundaries
|
|
228
|
+
|
|
229
|
+
All cache paths returned by the standalone adapter are absolute and anchored to the selected workspace. Cache and staging content stay beneath the configured cache directory. Existing symlinks, dangling links and hardlinked files in cache ancestors or artifact subtrees are rejected before an operation; checks repeat after model preflight. Special filesystem entries and an oversized safety scan are rejected. The full scan runs at runtime construction and twice per operation, so its cost grows with cache size; queued requests wait behind that scan. At 100,000 inspected entries, select a smaller cache directory or archive old entries after stopping all processes using that cache. Same-query runs on the same Coordinated Universal Time (UTC) date refresh one cache directory and do not promise separate histories; another UTC date produces a different directory.
|
|
230
|
+
|
|
231
|
+
These checks prevent pre-existing path escapes, not malicious concurrent filesystem replacement by another process with write access. Use a workspace controlled by the same trusted local operator. No operating-system sandbox or protection against hostile same-user mutation is claimed. Fetched URLs are not constrained to public addresses; the runtime is not a hosted service or an unrestricted remote execution endpoint.
|
|
232
|
+
|
|
233
|
+
The host must be able to read the returned paths. Summaries advise using the host's file-reading capability rather than requiring a tool named `read`. Cache formats and local telemetry retain the shared semantics; standalone telemetry adds package and adapter identity. Credentials are never inserted into prompts, cache metadata or generated launch configuration. Adapter diagnostics use standard error and omit raw provider errors, headers and transport exceptions. During operation execution, async-scoped interception replaces dependency stdout console output with a generic logger warning; a regression drives Defuddle's actual conversion-failure handler, which otherwise prints page content. While serving, the startup stdout guard also diverts import-time output and direct dependency writes to standard error; protocol tests assert clean framing with a deliberately noisy fixture.
|
|
234
|
+
|
|
235
|
+
## Timeouts and Troubleshooting
|
|
236
|
+
|
|
237
|
+
A full research call runs a search stage, up to `maxUrls` dual fetches, up to `maxUrls` extractions, a collation and an optional cache suggestion. Retries can add model calls. Progress notifications are not a guarantee against a host's total request deadline.
|
|
238
|
+
|
|
239
|
+
**Host Deadline:** If the host aborts a long tool call, reduce work with a lower per-call `maxUrls` (or lower `defaultUrls` and the configured cap), or adjust the host's own request deadline where supported. Changing `llmTimeoutMs` does not extend a host deadline.
|
|
240
|
+
|
|
241
|
+
**Model-Call Timeout:** Raise `llmTimeoutMs` only when the adapter's model-call timer expires and the host allows the longer duration. Client cancellation still aborts the running operation through the shared policy and stage boundaries; a cancelled queued request settles without starting.
|
|
242
|
+
|
|
243
|
+
Every startup failure is diagnostic-only and lands on standard error; standard output carries protocol frames only. The frequent cases:
|
|
244
|
+
|
|
245
|
+
| Symptom | Cause and Remedy |
|
|
246
|
+
|---|---|
|
|
247
|
+
| `Explicit --config and --workspace are required` | The server started without both selections. Supply `--config`/`--workspace` or the `INTELLI_SEARCH_CONFIG`/`INTELLI_SEARCH_WORKSPACE` environment variables, then restart the host. |
|
|
248
|
+
| `workspace must be an explicit absolute directory` | The workspace selection is relative or a host placeholder was not expanded. Use a literal absolute path; on hosts with placeholder expansion, verify the expansion on your host version. |
|
|
249
|
+
| `Cannot read configuration: provide an explicit readable JSON file` | The configuration path does not exist or is not readable. Create the file (the guides show a minimal valid document) and restart. |
|
|
250
|
+
| Configuration rejected with an unknown-key or range error | The loader is strict: unknown keys, invalid types and out-of-range values fail validation. Remove or correct the named key; the [Tuning](#tuning) table lists every accepted key and range. |
|
|
251
|
+
| Tools never appear in the host | The server exited during startup. Read the host's MCP server logs for the standard-error diagnostic; `mcp-intelli-search --check-config` reproduces configuration and workspace failures without a host. |
|
|
252
|
+
| Operations fail with `CONFIGURATION` or `PROVIDER` | The named credential environment variable is missing or the key was rejected. The server snapshots the environment at startup: restart it after changing credentials. Catalogue preflight failures name the offending model role. |
|
|
253
|
+
| Repeated 429 retries on a free-tier or shared key | Free-tier OpenRouter keys share a tight rate bucket. Set `minRequestIntervalMs` to approximately `3000`, lower `extractionConcurrency` to `2`, and raise `llmRetryAttempts`; raise `llmTimeoutMs` only when the model-call timer is expiring. |
|
|
254
|
+
| 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. |
|
|
255
|
+
|
|
256
|
+
## Host Plugins
|
|
257
|
+
|
|
258
|
+
Thin plugin bundles for [_Claude Code_](https://code.claude.com/docs/en/plugins) and [_Codex_](https://developers.openai.com/codex/plugins) live in `plugins/` at the repository root, with repository marketplace catalogs at `.claude-plugin/marketplace.json` and `.agents/plugins/marketplace.json`. The bundles are generated from the shared guidance source in `guidance/` and the version pinned in this package's manifest; run `npm run generate:plugins` after a version change and `npm run check:plugins` to detect drift. Launchers pin the exact package version through `npx`; until the package is published, `scripts/generate-plugin-bundles.mjs --mode tarball` generates equivalent local-tarball launchers for installation tests. Host setup, including each host's environment forwarding rules, is in the generated skills.
|
|
259
|
+
|
|
260
|
+
**Publication Status:** The standalone package is not published. Use the source-checkout launcher until publication. Recorded host checks and unverified routes are listed in the [compatibility matrix](../../docs/COMPATIBILITY.md).
|