@remcp/remcp 0.2.118 → 0.2.120
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/service.mjs +28 -4
package/package.json
CHANGED
package/src/cli/service.mjs
CHANGED
|
@@ -460,7 +460,10 @@ export function writeWindowsServiceLauncher(cliPath = globalCliPath(), nodePath
|
|
|
460
460
|
export function installWindowsService(cliPath = globalCliPath(), { nodePath = process.execPath } = {}) {
|
|
461
461
|
const launcherFile = writeWindowsServiceLauncher(cliPath, nodePath);
|
|
462
462
|
const command = `"${launcherFile}"`;
|
|
463
|
-
|
|
463
|
+
// Computer-use needs the signed-in interactive desktop. Create the task with /IT from the start
|
|
464
|
+
// instead of changing it afterwards: schtasks /Change can request the account password even when
|
|
465
|
+
// the task already belongs to the current user, which turns a one-command install into a prompt.
|
|
466
|
+
run('schtasks.exe', ['/Create', '/TN', windowsTaskName, '/TR', command, '/SC', 'ONLOGON', '/RL', 'HIGHEST', '/IT', '/F']);
|
|
464
467
|
run('schtasks.exe', ['/Run', '/TN', windowsTaskName]);
|
|
465
468
|
}
|
|
466
469
|
|
|
@@ -569,6 +572,23 @@ function packageVersionForCli(cliPath, packageName) {
|
|
|
569
572
|
return versionFromPackageJson(path.join(prefix, 'node_modules', ...String(packageName).split('/'), 'package.json'));
|
|
570
573
|
}
|
|
571
574
|
|
|
575
|
+
function exactPackageSpecVersion(packageName, packageSpec) {
|
|
576
|
+
const prefix = `${String(packageName || '')}@`;
|
|
577
|
+
const spec = String(packageSpec || '');
|
|
578
|
+
return prefix !== '@' && spec.startsWith(prefix) ? spec.slice(prefix.length) : '';
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
// A PowerShell bootstrap already installs the exact client/runtime pair before it starts pairing.
|
|
582
|
+
// Reusing that verified pair avoids a second registry mutation during `connect --install` while
|
|
583
|
+
// preserving the normal npm path for partial, stale, custom-runtime and non-bootstrap installs.
|
|
584
|
+
export function releasePairPresentAtCli(cliPath, config) {
|
|
585
|
+
const runtimePackageName = String(config?.runtime?.packageName || '');
|
|
586
|
+
const expectedRuntimeVersion = exactPackageSpecVersion(runtimePackageName, config?.runtime?.packageSpec);
|
|
587
|
+
if (!cliPath || !runtimePackageName || !expectedRuntimeVersion) return false;
|
|
588
|
+
return packageVersionForCli(cliPath, PACKAGE_NAME) === VERSION
|
|
589
|
+
&& packageVersionForCli(cliPath, runtimePackageName) === expectedRuntimeVersion;
|
|
590
|
+
}
|
|
591
|
+
|
|
572
592
|
export function installationVersionsAtCliPath(cliPath, runtimePackageName) {
|
|
573
593
|
if (!cliPath) return { cliVersion:null, runtimeVersion:null, cliPath:null };
|
|
574
594
|
let resolvedCliPath = cliPath;
|
|
@@ -685,12 +705,13 @@ export function configureMacWriteAccess() {
|
|
|
685
705
|
}
|
|
686
706
|
|
|
687
707
|
export function configureWindowsWriteAccess() {
|
|
688
|
-
|
|
708
|
+
// installWindowsService already creates the task as HighestAvailable + InteractiveToken. Keep
|
|
709
|
+
// post-install access setup non-interactive so a fresh install never asks for the Windows password.
|
|
689
710
|
try {
|
|
690
711
|
const workspaceDir = path.join(process.env.LOCALAPPDATA || path.join(home, 'AppData', 'Local'), 'ReMCP');
|
|
691
712
|
fs.mkdirSync(workspaceDir, { recursive: true });
|
|
692
713
|
} catch {}
|
|
693
|
-
console.log('ReMCP configured with
|
|
714
|
+
console.log('ReMCP configured with the highest available user privileges for interactive desktop access.');
|
|
694
715
|
}
|
|
695
716
|
|
|
696
717
|
export function configureLinuxWriteAccess() {
|
|
@@ -710,7 +731,10 @@ export function installPersistentAgent(config) {
|
|
|
710
731
|
const platform = servicePlatform();
|
|
711
732
|
if (!['linux', 'darwin', 'win32'].includes(platform)) throw new Error(`Automatic background service installation is not supported on ${platform}`);
|
|
712
733
|
console.log(`Installing ReMCP ${VERSION}…`);
|
|
713
|
-
|
|
734
|
+
const runningCli = process.argv[1] || '';
|
|
735
|
+
if (!releasePairPresentAtCli(runningCli, config)) {
|
|
736
|
+
npmGlobalInstall(`${PACKAGE_NAME}@${VERSION}`, config.runtime.packageSpec);
|
|
737
|
+
}
|
|
714
738
|
const cliPath = globalCliPath();
|
|
715
739
|
const cliScript = resolvedCliScript(cliPath);
|
|
716
740
|
const nodePath = process.execPath;
|