@rvry/mcp 0.4.1 → 0.4.2

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/dist/client.js CHANGED
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * RVRY MCP Client -- HTTP client for the RVRY engine /api/v1/think endpoint.
3
3
  */
4
+ import { fetch } from './fetch.js';
4
5
  const DEFAULT_ENGINE_URL = 'https://engine.rvry.ai';
5
6
  /**
6
7
  * Call the RVRY engine /api/v1/think endpoint with a specific tool.
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Portable fetch — uses globalThis.fetch if available, falls back to
3
+ * Node's bundled undici (ships with Node 18+, no extra install).
4
+ *
5
+ * Delegates at call time (not import time) so globalThis.fetch can be
6
+ * overridden in tests.
7
+ */
8
+ /**
9
+ * Portable fetch that delegates to globalThis.fetch (checked at call time)
10
+ * or the undici fallback resolved at import time.
11
+ */
12
+ export declare function fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
package/dist/fetch.js ADDED
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Portable fetch — uses globalThis.fetch if available, falls back to
3
+ * Node's bundled undici (ships with Node 18+, no extra install).
4
+ *
5
+ * Delegates at call time (not import time) so globalThis.fetch can be
6
+ * overridden in tests.
7
+ */
8
+ let _undiciFetch = null;
9
+ if (typeof globalThis.fetch !== 'function') {
10
+ try {
11
+ // @ts-ignore -- undici has no type declarations in this package; runtime-only fallback
12
+ const mod = await import('undici');
13
+ _undiciFetch = mod.fetch;
14
+ }
15
+ catch {
16
+ throw new Error('[rvry-mcp] fetch is not available and undici import failed. ' +
17
+ 'Node.js 18.13.0+ or Bun is required. Current version: ' + process.version);
18
+ }
19
+ }
20
+ /**
21
+ * Portable fetch that delegates to globalThis.fetch (checked at call time)
22
+ * or the undici fallback resolved at import time.
23
+ */
24
+ export function fetch(input, init) {
25
+ const fn = globalThis.fetch ?? _undiciFetch;
26
+ if (!fn) {
27
+ throw new Error('[rvry-mcp] No fetch implementation available.');
28
+ }
29
+ return fn(input, init);
30
+ }
package/dist/setup.js CHANGED
@@ -16,6 +16,7 @@ import { createInterface } from 'readline';
16
16
  import { execSync } from 'child_process';
17
17
  import { platform } from 'os';
18
18
  import { createRequire } from 'module';
19
+ import { fetch } from './fetch.js';
19
20
  const require = createRequire(import.meta.url);
20
21
  const PKG_VERSION = require('../package.json').version;
21
22
  const ENGINE_URL = 'https://engine.rvry.ai';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rvry/mcp",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "RVRY reasoning depth enforcement (RDE) engine client.",
5
5
  "type": "module",
6
6
  "bin": {