@pixelbyte-software/pixcode 1.49.11 → 1.50.1

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.
Binary file
package/dist/index.html CHANGED
@@ -35,11 +35,11 @@
35
35
 
36
36
  <!-- Prevent zoom on iOS -->
37
37
  <meta name="format-detection" content="telephone=no" />
38
- <script type="module" crossorigin src="/assets/index-Q-GU9EZQ.js"></script>
38
+ <script type="module" crossorigin src="/assets/index-BPu5Zp17.js"></script>
39
39
  <link rel="modulepreload" crossorigin href="/assets/vendor-react-DB6V5Fl1.js">
40
40
  <link rel="modulepreload" crossorigin href="/assets/vendor-codemirror-CIYNS698.js">
41
41
  <link rel="modulepreload" crossorigin href="/assets/vendor-xterm-C7tpxJl7.js">
42
- <link rel="stylesheet" crossorigin href="/assets/index-DjKDBqln.css">
42
+ <link rel="stylesheet" crossorigin href="/assets/index-DMz0zv6T.css">
43
43
  </head>
44
44
  <body>
45
45
  <div id="root"></div>
@@ -331,15 +331,17 @@ function quoteBashArg(value) {
331
331
  function quotePowerShellArg(value) {
332
332
  return `"${String(value).replace(/`/g, '``').replace(/\$/g, '`$').replace(/"/g, '`"')}"`;
333
333
  }
334
+ const HERMES_CLI_COMMAND_PATTERN = /^hermes(?:\s+[A-Za-z0-9._:/=@+-]+)*\s*$/;
334
335
  function isHermesCliCommand(command) {
335
- return typeof command === 'string' && command.trim() === 'hermes';
336
+ return typeof command === 'string' && HERMES_CLI_COMMAND_PATTERN.test(command.trim());
336
337
  }
337
338
  function buildHermesCliCommand(command) {
339
+ const hermesCommand = typeof command === 'string' && command.trim() ? command.trim() : 'hermes';
338
340
  const configureScript = path.join(APP_ROOT, 'scripts', 'hermes', 'configure-pixcode-mcp.mjs');
339
341
  if (os.platform() === 'win32') {
340
- return `& ${quotePowerShellArg(process.execPath)} ${quotePowerShellArg(configureScript)} *> $null; ${command}`;
342
+ return `& ${quotePowerShellArg(process.execPath)} ${quotePowerShellArg(configureScript)} *> $null; ${hermesCommand}`;
341
343
  }
342
- return `${quoteBashArg(process.execPath)} ${quoteBashArg(configureScript)} >/dev/null 2>&1; exec ${command}`;
344
+ return `${quoteBashArg(process.execPath)} ${quoteBashArg(configureScript)} >/dev/null 2>&1; exec ${hermesCommand}`;
343
345
  }
344
346
  function getOrCreateHermesApiKey(userId) {
345
347
  if (!userId)
@@ -429,6 +431,45 @@ app.post('/api/shell/sessions/terminate', authenticateToken, (req, res) => {
429
431
  const killedSessions = killProviderPtySessions(projectPath, provider);
430
432
  res.json({ success: true, killedSessions });
431
433
  });
434
+ app.get('/api/shell/sessions/provider-output', authenticateToken, (req, res) => {
435
+ const provider = String(req.query.provider || 'claude');
436
+ const projectPath = typeof req.query.projectPath === 'string' && req.query.projectPath.trim()
437
+ ? req.query.projectPath.trim()
438
+ : null;
439
+ const maxChars = Math.min(20000, Math.max(1000, Number.parseInt(String(req.query.maxChars || '12000'), 10) || 12000));
440
+ if (!SHELL_CLI_PROVIDERS.has(provider)) {
441
+ return res.status(400).json({ error: 'Unsupported provider' });
442
+ }
443
+ const requestedProjectPath = projectPath ? path.resolve(projectPath) : null;
444
+ let matchedSession = null;
445
+ for (const session of ptySessionsMap.values()) {
446
+ if (session?.provider === provider &&
447
+ !session?.isPlainShell &&
448
+ (!requestedProjectPath || path.resolve(session.projectPath || os.homedir()) === requestedProjectPath)) {
449
+ if (!matchedSession || (session.updatedAt || 0) > (matchedSession.updatedAt || 0)) {
450
+ matchedSession = session;
451
+ }
452
+ }
453
+ }
454
+ if (!matchedSession) {
455
+ return res.json({
456
+ active: false,
457
+ provider,
458
+ projectPath: requestedProjectPath,
459
+ output: '',
460
+ message: 'No active provider terminal session found for this project.',
461
+ });
462
+ }
463
+ const rawOutput = matchedSession.buffer.join('').slice(-maxChars);
464
+ res.json({
465
+ active: true,
466
+ provider,
467
+ projectPath: path.resolve(matchedSession.projectPath || os.homedir()),
468
+ sessionId: matchedSession.sessionId || null,
469
+ updatedAt: matchedSession.updatedAt || null,
470
+ output: stripAnsiSequences(rawOutput),
471
+ });
472
+ });
432
473
  // Authentication routes (public)
433
474
  app.use('/api/auth', authRoutes);
434
475
  // Projects API Routes (protected)
@@ -2309,12 +2350,14 @@ function handleShellConnection(ws, request) {
2309
2350
  provider,
2310
2351
  isPlainShell,
2311
2352
  keepAliveUntilExit: false,
2353
+ updatedAt: Date.now(),
2312
2354
  });
2313
2355
  // Handle data output
2314
2356
  shellProcess.onData((data) => {
2315
2357
  const session = ptySessionsMap.get(ptySessionKey);
2316
2358
  if (!session)
2317
2359
  return;
2360
+ session.updatedAt = Date.now();
2318
2361
  if (session.buffer.length < 5000) {
2319
2362
  session.buffer.push(data);
2320
2363
  }