@pixelbyte-software/pixcode 1.49.5 → 1.49.7
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/assets/{index-77u-_XIT.js → index-BqgTbW4j.js} +144 -144
- package/dist/index.html +1 -1
- package/dist-server/server/index.js +3 -2
- package/dist-server/server/index.js.map +1 -1
- package/dist-server/server/modules/orchestration/hermes/hermes.routes.js +76 -0
- package/dist-server/server/modules/orchestration/hermes/hermes.routes.js.map +1 -1
- package/dist-server/server/services/hermes-gateway.js +362 -0
- package/dist-server/server/services/hermes-gateway.js.map +1 -0
- package/dist-server/server/services/hermes-install-jobs.js +45 -3
- package/dist-server/server/services/hermes-install-jobs.js.map +1 -1
- package/package.json +1 -1
- package/scripts/hermes/configure-pixcode-mcp.mjs +32 -1
- package/scripts/hermes/pixcode-mcp-server.mjs +56 -0
- package/scripts/smoke/hermes-api-install.mjs +12 -2
- package/scripts/smoke/hermes-mcp-pixcode-roundtrip.mjs +179 -0
- package/scripts/smoke/hermes-rest-codex-launch.mjs +186 -0
- package/scripts/smoke/hermes-rest-gateway.mjs +40 -0
- package/scripts/smoke/hermes-rest-live.mjs +42 -0
- package/scripts/smoke/pixcode-workbench-1-48.mjs +8 -0
- package/server/index.js +3 -2
- package/server/modules/orchestration/hermes/hermes.routes.ts +86 -0
- package/server/services/hermes-gateway.js +400 -0
- package/server/services/hermes-install-jobs.js +49 -3
|
@@ -455,7 +455,39 @@ function scheduleCleanup(job) {
|
|
|
455
455
|
}, FINISHED_TTL_MS);
|
|
456
456
|
}
|
|
457
457
|
|
|
458
|
-
function
|
|
458
|
+
function isWindowsEpermSpawnError(error) {
|
|
459
|
+
return process.platform === 'win32' && (
|
|
460
|
+
error?.code === 'EPERM' ||
|
|
461
|
+
/spawn\s+EPERM/i.test(String(error?.message || ''))
|
|
462
|
+
);
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
function isWindowsPowerShellCommand(command) {
|
|
466
|
+
if (process.platform !== 'win32') return false;
|
|
467
|
+
const name = path.basename(String(command || '')).toLowerCase();
|
|
468
|
+
return name === 'powershell.exe' || name === 'powershell' || name === 'pwsh.exe' || name === 'pwsh';
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
function quoteWindowsCmdArg(value) {
|
|
472
|
+
const text = String(value ?? '');
|
|
473
|
+
if (!text) return '""';
|
|
474
|
+
if (!/[\s"&|<>^()]/.test(text)) return text;
|
|
475
|
+
return `"${text.replace(/"/g, '\\"')}"`;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
function windowsCmdFallbackCommand(command, args) {
|
|
479
|
+
return {
|
|
480
|
+
command: process.env.ComSpec || 'cmd.exe',
|
|
481
|
+
args: [
|
|
482
|
+
'/d',
|
|
483
|
+
'/s',
|
|
484
|
+
'/c',
|
|
485
|
+
[command, ...args].map(quoteWindowsCmdArg).join(' '),
|
|
486
|
+
],
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
function spawnLoggedOnce(job, command, args, options) {
|
|
459
491
|
appendLog(job, 'meta', `$ ${command} ${args.join(' ')}\n`);
|
|
460
492
|
const child = spawn(command, args, {
|
|
461
493
|
...options,
|
|
@@ -463,8 +495,8 @@ function spawnLogged(job, command, args, options) {
|
|
|
463
495
|
windowsHide: true,
|
|
464
496
|
});
|
|
465
497
|
job.child = child;
|
|
466
|
-
child.stdout
|
|
467
|
-
child.stderr
|
|
498
|
+
child.stdout?.on('data', (buf) => appendLog(job, 'stdout', buf.toString()));
|
|
499
|
+
child.stderr?.on('data', (buf) => appendLog(job, 'stderr', buf.toString()));
|
|
468
500
|
return new Promise((resolve, reject) => {
|
|
469
501
|
child.on('error', reject);
|
|
470
502
|
child.on('close', (code, signal) => {
|
|
@@ -477,6 +509,20 @@ function spawnLogged(job, command, args, options) {
|
|
|
477
509
|
});
|
|
478
510
|
}
|
|
479
511
|
|
|
512
|
+
async function spawnLogged(job, command, args, options) {
|
|
513
|
+
try {
|
|
514
|
+
return await spawnLoggedOnce(job, command, args, options);
|
|
515
|
+
} catch (error) {
|
|
516
|
+
if (!isWindowsEpermSpawnError(error) || !isWindowsPowerShellCommand(command)) {
|
|
517
|
+
throw error;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
appendLog(job, 'stderr', 'PowerShell direct launch was blocked by Windows (EPERM); retrying through cmd.exe without elevation.\n');
|
|
521
|
+
const fallback = windowsCmdFallbackCommand(command, args);
|
|
522
|
+
return spawnLoggedOnce(job, fallback.command, fallback.args, options);
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
|
|
480
526
|
async function runConfigureScript(job, env, appRoot) {
|
|
481
527
|
const configureScript = path.join(appRoot, 'scripts', 'hermes', 'configure-pixcode-mcp.mjs');
|
|
482
528
|
if (!fs.existsSync(configureScript)) {
|