@remcp/remcp 0.2.223 → 0.2.224
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
CHANGED
|
@@ -21,14 +21,21 @@ export function spawnWindowsOwnedJob(application, args, { cwd, log, env = proces
|
|
|
21
21
|
Buffer.from(windowsOwnedJobScript, 'utf16le').toString('base64')], {
|
|
22
22
|
cwd:path.dirname(powershell), env, windowsHide:true, stdio:['pipe','pipe','pipe'],
|
|
23
23
|
});
|
|
24
|
-
let output = '', stderr = '', started = false, empty = false, settled = false;
|
|
24
|
+
let output = '', stderr = '', started = false, empty = false, settled = false, sawReady = false;
|
|
25
25
|
let resolveReady, rejectReady, resolveDone, rejectDone;
|
|
26
26
|
const ready = new Promise((resolve, reject) => { resolveReady=resolve; rejectReady=reject; });
|
|
27
27
|
const done = new Promise((resolve, reject) => { resolveDone=resolve; rejectDone=reject; });
|
|
28
28
|
// Callers may observe readiness and completion separately; suppress unhandled rejection noise.
|
|
29
29
|
ready.catch(() => {}); done.catch(() => {});
|
|
30
30
|
const fail = error => { rejectReady(error); rejectDone(error); };
|
|
31
|
-
|
|
31
|
+
// Windows PowerShell 5.1 compiles this P/Invoke helper via Add-Type on every launch.
|
|
32
|
+
// Resource-constrained ARM64 VMs can need more than 15 seconds. Keep one bounded
|
|
33
|
+
// deadline for the complete handshake, without weakening job ownership checks.
|
|
34
|
+
const timer = setTimeout(() => {
|
|
35
|
+
fail(new Error('Windows job startup timed out during ' +
|
|
36
|
+
(sawReady ? 'process creation' : 'PowerShell initialization')));
|
|
37
|
+
helper.kill();
|
|
38
|
+
}, 45000);
|
|
32
39
|
helper.stdin.on('error', () => {});
|
|
33
40
|
helper.stderr.on('data', chunk => { stderr = (stderr + chunk).slice(-2048); });
|
|
34
41
|
helper.stdout.on('data', chunk => {
|
|
@@ -39,6 +46,7 @@ export function spawnWindowsOwnedJob(application, args, { cwd, log, env = proces
|
|
|
39
46
|
try {
|
|
40
47
|
const message = JSON.parse(line);
|
|
41
48
|
if (message.ready === true && !started) {
|
|
49
|
+
sawReady = true;
|
|
42
50
|
// ASCII envelope survives Windows PowerShell 5.1's OEM console codepage.
|
|
43
51
|
helper.stdin.write(Buffer.from(JSON.stringify({application,command,cwd,log}),'utf8').toString('base64') + '\n');
|
|
44
52
|
} else if (message.started === true && Number.isSafeInteger(message.pid) && message.pid > 0 && !started) {
|