@heuresis/mcp 1.0.0-rc.2 → 1.0.0-rc.4

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/cli.js CHANGED
@@ -12,7 +12,7 @@
12
12
  // ----------------------------------------------------------
13
13
  // 1. POST to the `mcp-device-init` Edge Function with the chosen device name.
14
14
  // Receive a short XXXX-XXXX code + an expiry.
15
- // 2. Tell the user to open https://heuresis.pages.dev/device (overridable via
15
+ // 2. Tell the user to open https://heuresis.app/device (overridable via
16
16
  // HEURESIS_DEVICE_BASE_URL for staging / self-hosted setups) and enter
17
17
  // the code.
18
18
  // 3. Poll `mcp-device-poll` every 5s until status: ok (claim accepted) or
@@ -31,7 +31,7 @@ import { credentialsPath, defaultDeviceName, deleteCredentials, readCredentials,
31
31
  // for staging / self-hosted deploys via HEURESIS_DEVICE_BASE_URL. We also
32
32
  // allow HEURESIS_SUPABASE_URL to override which Supabase project the CLI
33
33
  // talks to (e.g. a staging instance). Both default to production.
34
- const DEFAULT_DEVICE_BASE_URL = 'https://heuresis.pages.dev';
34
+ const DEFAULT_DEVICE_BASE_URL = 'https://heuresis.app';
35
35
  const DEFAULT_SUPABASE_URL = 'https://wpgniquyuppljeqkedqh.supabase.co';
36
36
  const POLL_INTERVAL_MS = 5_000;
37
37
  const POLL_TIMEOUT_MS = 15 * 60 * 1_000;
@@ -56,7 +56,7 @@ function printHelp() {
56
56
  ` ${credentialsPath()}`,
57
57
  '',
58
58
  'Environment overrides:',
59
- ' HEURESIS_DEVICE_BASE_URL Webapp origin (default https://heuresis.pages.dev)',
59
+ ' HEURESIS_DEVICE_BASE_URL Webapp origin (default https://heuresis.app)',
60
60
  ' HEURESIS_SUPABASE_URL Supabase project URL (default the heuresis.app project)',
61
61
  '',
62
62
  'Legacy snapshot mode (deprecated, removed after 19.7):',
@@ -98,7 +98,34 @@ function parseLoginFlags(argv) {
98
98
  function sleep(ms) {
99
99
  return new Promise((resolve) => setTimeout(resolve, ms));
100
100
  }
101
+ // Wire HTTPS_PROXY / HTTP_PROXY env vars into Node's global fetch dispatcher.
102
+ // Node 18-22's undici does NOT auto-honor these vars (Node 24+ does). Without
103
+ // this, the CLI fails with "fetch failed" on corporate networks. Idempotent
104
+ // and a no-op when no proxy var is set.
105
+ let proxyAgentInstalled = false;
106
+ async function ensureProxyAgent() {
107
+ if (proxyAgentInstalled)
108
+ return;
109
+ proxyAgentInstalled = true;
110
+ const proxyUrl = process.env.HTTPS_PROXY ||
111
+ process.env.https_proxy ||
112
+ process.env.HTTP_PROXY ||
113
+ process.env.http_proxy;
114
+ if (!proxyUrl)
115
+ return;
116
+ try {
117
+ // Dynamic import keeps undici out of the cold-start path when no proxy
118
+ // is in play. Node ships undici as part of the runtime so this resolves.
119
+ const { ProxyAgent, setGlobalDispatcher } = await import('undici');
120
+ setGlobalDispatcher(new ProxyAgent(proxyUrl));
121
+ log(`(routing through proxy ${proxyUrl})`);
122
+ }
123
+ catch (err) {
124
+ log(`(could not configure proxy ${proxyUrl}: ${err instanceof Error ? err.message : String(err)})`);
125
+ }
126
+ }
101
127
  async function postJson(url, body) {
128
+ await ensureProxyAgent();
102
129
  const res = await fetch(url, {
103
130
  method: 'POST',
104
131
  headers: { 'Content-Type': 'application/json' },
package/dist/index.js CHANGED
@@ -146,7 +146,7 @@ async function runServer() {
146
146
  'To use legacy snapshot mode (deprecated, removed after 19.7):',
147
147
  ' HEURESIS_SNAPSHOT=/path/to/export.json npx @heuresis/mcp',
148
148
  '',
149
- 'See https://heuresis.pages.dev/mcp for setup details.',
149
+ 'See https://heuresis.app/mcp for setup details.',
150
150
  ].join('\n'));
151
151
  process.exit(1);
152
152
  }
@@ -106,7 +106,7 @@ async function callOpenRouter(config, input, maxTokens, temperature) {
106
106
  apiKey: config.apiKey,
107
107
  baseURL: 'https://openrouter.ai/api/v1',
108
108
  defaultHeaders: {
109
- 'HTTP-Referer': 'https://heuresis.pages.dev',
109
+ 'HTTP-Referer': 'https://heuresis.app',
110
110
  'X-Title': 'Heuresis MCP',
111
111
  },
112
112
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heuresis/mcp",
3
- "version": "1.0.0-rc.2",
3
+ "version": "1.0.0-rc.4",
4
4
  "description": "Cloud-authenticated Model Context Protocol server for a Heuresis workspace. Logs into the user's Heuresis account and lets any MCP client (Claude Desktop, Claude Code, Cursor, custom agents) read and write the same workspace the webapp uses. 31 data tools, 3 operator tools (Branch/Matrix/C-K/ASIT/TRIZ/Free/Combine/Explore), and live Realtime change subscriptions.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -19,7 +19,7 @@
19
19
  "publishConfig": {
20
20
  "access": "public"
21
21
  },
22
- "homepage": "https://heuresis.pages.dev/mcp",
22
+ "homepage": "https://heuresis.app/mcp",
23
23
  "repository": {
24
24
  "type": "git",
25
25
  "url": "git+https://github.com/ToremLabs/Heuresis.git",