@remcp/remcp 0.2.208 → 0.2.209
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/package.json +1 -1
- package/src/cli/config.mjs +6 -8
- package/src/cli.mjs +29 -4
package/package.json
CHANGED
package/src/cli/config.mjs
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// the server uses to recognise this computer across pairings.
|
|
3
3
|
import fs from 'node:fs';
|
|
4
4
|
import path from 'node:path';
|
|
5
|
-
import process from 'node:process';
|
|
6
5
|
import { randomUUID } from 'node:crypto';
|
|
7
6
|
import { normalizeRuntime } from '../runtime.mjs';
|
|
8
7
|
|
|
@@ -79,13 +78,12 @@ export function writeJsonFile(file, value) {
|
|
|
79
78
|
fs.chmodSync(file, 0o600);
|
|
80
79
|
}
|
|
81
80
|
|
|
82
|
-
export function autoUpdateEnabled(config
|
|
83
|
-
//
|
|
84
|
-
//
|
|
85
|
-
//
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
return platform !== 'linux';
|
|
81
|
+
export function autoUpdateEnabled(config) {
|
|
82
|
+
// This preference controls the two first-party ReMCP npm packages only. It never
|
|
83
|
+
// upgrades the Node.js interpreter or npm itself. All supported OSes keep the
|
|
84
|
+
// historical default of automatic ReMCP releases unless the owner opts out.
|
|
85
|
+
// Updates use the verified managed service prefix, not a shared global prefix.
|
|
86
|
+
return config?.autoUpdate !== false;
|
|
89
87
|
}
|
|
90
88
|
|
|
91
89
|
export function flagEnabled(value) {
|
package/src/cli.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
1
2
|
import os from 'node:os';
|
|
2
3
|
import path from 'node:path';
|
|
3
4
|
import process from 'node:process';
|
|
@@ -36,7 +37,20 @@ function parse(argv) {
|
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
function printHelp() {
|
|
39
|
-
console.log(`ReMCP ${VERSION}\n\nCommands:\n remcp connect [--no-qr]\n remcp start\n remcp status\n remcp doctor\n remcp update\n remcp install\n remcp uninstall\n remcp uninstall --purge\n remcp telemetry [status|on|off]\n remcp godmode [status|on|off]\n remcp --version\n\nPairing commands are generated in the ReMCP workspace.\n\nUsage metrics are opt-out (tool names, timings, outcomes only, sent to your own ReMCP\naccount through the paired agent). Disable them at any time with: remcp telemetry off\n\nUnrestricted mode (remcp godmode on) lifts the access roots and the command guardrails for this\ncomputer only. The MCP configuration tool cannot enable it; protect remote terminal access.`);
|
|
40
|
+
console.log(`ReMCP ${VERSION}\n\nCommands:\n remcp connect [--no-qr]\n remcp start\n remcp status\n remcp doctor\n remcp update\n remcp auto-update [status|on|off]\n remcp install\n remcp uninstall\n remcp uninstall --purge\n remcp telemetry [status|on|off]\n remcp godmode [status|on|off]\n remcp --version\n\nPairing commands are generated in the ReMCP workspace.\n\nUsage metrics are opt-out (tool names, timings, outcomes only, sent to your own ReMCP\naccount through the paired agent). Disable them at any time with: remcp telemetry off\n\nUnrestricted mode (remcp godmode on) lifts the access roots and the command guardrails for this\ncomputer only. The MCP configuration tool cannot enable it; protect remote terminal access.`);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// The running agent snapshots update policy at startup. A saved toggle alone does not
|
|
44
|
+
// change its six-hour polling loop, so reload a managed service after a policy change.
|
|
45
|
+
// Defer Linux handoff to avoid terminating a remote command before it returns.
|
|
46
|
+
export function applyAutoUpdatePreference(cfg, enabled, {
|
|
47
|
+
persist = saveConfig,
|
|
48
|
+
restart = restartPersistentServiceIfInstalled,
|
|
49
|
+
} = {}) {
|
|
50
|
+
const changed = autoUpdateEnabled(cfg) !== enabled;
|
|
51
|
+
const updated = { ...cfg, autoUpdate: enabled };
|
|
52
|
+
persist(updated);
|
|
53
|
+
return changed ? restart(updated, { deferLinux:true }) : null;
|
|
40
54
|
}
|
|
41
55
|
|
|
42
56
|
export async function main(argv = process.argv.slice(2)) {
|
|
@@ -201,8 +215,15 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
201
215
|
console.log(JSON.stringify({ autoUpdate: autoUpdateEnabled(cfg), checkIntervalHours: 6 }, null, 2));
|
|
202
216
|
return;
|
|
203
217
|
}
|
|
204
|
-
if (
|
|
205
|
-
|
|
218
|
+
if (['on', 'enable', 'off', 'disable'].includes(action)) {
|
|
219
|
+
const enabled = action === 'on' || action === 'enable';
|
|
220
|
+
const changed = autoUpdateEnabled(cfg) !== enabled;
|
|
221
|
+
const restarted = applyAutoUpdatePreference(cfg, enabled);
|
|
222
|
+
console.log(enabled ? 'Auto-update enabled.' : 'Auto-update disabled. Run `remcp update` yourself when you want a new version.');
|
|
223
|
+
if (restarted) console.log(`ReMCP agent ${restarted} to apply the update policy.`);
|
|
224
|
+
else if (changed) console.log('Restart any manually managed ReMCP agent to apply the update policy.');
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
206
227
|
throw new Error('Usage: remcp auto-update [status|on|off]');
|
|
207
228
|
}
|
|
208
229
|
|
|
@@ -284,11 +305,15 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
284
305
|
const targetClient = String(advertised?.cliVersion || '').trim() || null;
|
|
285
306
|
const targetRuntime = String(advertised?.runtime || '').trim() || null;
|
|
286
307
|
const configuredRuntime = String(cfg.runtime.packageSpec || '');
|
|
308
|
+
// The history also records CLI paths from old Node.js environments. An entry for
|
|
309
|
+
// a no-longer-existing path is not an additional installed package or agent.
|
|
287
310
|
const installationPaths = new Set([
|
|
288
311
|
currentInstall.cliPath,
|
|
289
312
|
serviceInstall.cliPath,
|
|
290
313
|
...(Array.isArray(cfg.installations) ? cfg.installations.map(item => item?.cliPath) : []),
|
|
291
|
-
].filter(
|
|
314
|
+
].filter(file => typeof file === 'string' && fs.existsSync(file)).map(file => {
|
|
315
|
+
try { return fs.realpathSync(file); } catch { return file; }
|
|
316
|
+
}));
|
|
292
317
|
const multipleInstallations = installationPaths.size > 1;
|
|
293
318
|
const knownCliVersions = [VERSION, serviceInstall.cliVersion].filter(Boolean);
|
|
294
319
|
const knownRuntimeVersions = [installedRuntime, serviceInstall.runtimeVersion].filter(Boolean);
|