@pixelbyte-software/pixcode 1.50.6 → 1.50.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.
@@ -13,6 +13,7 @@ const serverIndex = read('server/index.js');
13
13
  const shellTypes = read('src/components/shell/types/types.ts');
14
14
  const shellRuntime = read('src/components/shell/hooks/useShellRuntime.ts');
15
15
  const shellConnection = read('src/components/shell/hooks/useShellConnection.ts');
16
+ const shellTerminal = read('src/components/shell/hooks/useShellTerminal.ts');
16
17
  const shellView = read('src/components/shell/view/Shell.tsx');
17
18
  const standaloneShell = read('src/components/standalone-shell/view/StandaloneShell.tsx');
18
19
  const hermesRoutes = read('server/modules/orchestration/hermes/hermes.routes.ts');
@@ -215,8 +216,8 @@ assert.match(
215
216
  );
216
217
  assert.match(
217
218
  shellConnection,
218
- /normalizeStartupInput\(input: string, provider: LLMProvider\)/,
219
- 'Startup input normalization should be provider-aware.',
219
+ /startupInputDelivery/,
220
+ 'Startup input should be delivered through an explicit command-or-terminal mode.',
220
221
  );
221
222
  assert.match(
222
223
  shellConnection,
@@ -225,8 +226,28 @@ assert.match(
225
226
  );
226
227
  assert.match(
227
228
  shellConnection,
228
- /startupInput:\s*handlesStartupInputInCommand \? startupInputForCommand : null/,
229
- 'Shell websocket init should send Codex startup input to the backend command builder.',
229
+ /startupInputDelivery:\s*handlesStartupInputInCommand \? 'command' : 'terminal'/,
230
+ 'Shell websocket init should tell the backend whether startup input belongs in the command or visible terminal.',
231
+ );
232
+ assert.match(
233
+ shellTerminal,
234
+ /sanitizeTerminalInputData/,
235
+ 'Terminal input should filter xterm color-query reports before sending data to the PTY.',
236
+ );
237
+ assert.match(
238
+ shellTerminal,
239
+ /OSC_COLOR_REPORT_REGEX/,
240
+ 'Terminal input should drop OSC 10/11/12 color reports so resize/theme probes do not corrupt CLI prompts.',
241
+ );
242
+ assert.match(
243
+ serverIndex,
244
+ /writeTerminalStartupInput/,
245
+ 'Shell backend should submit Hermes startup input directly into reused visible PTYs.',
246
+ );
247
+ assert.match(
248
+ serverIndex,
249
+ /startupInputDelivery === 'terminal'[\s\S]+writeTerminalStartupInput/,
250
+ 'Existing visible provider sessions should receive terminal-delivered startup input before reconnect returns.',
230
251
  );
231
252
  assert.match(
232
253
  workbench,
@@ -253,6 +274,11 @@ assert.match(
253
274
  /startupInput\?: string \| null/,
254
275
  'Shell init messages should carry launch-time startup input for providers that accept an initial prompt.',
255
276
  );
277
+ assert.match(
278
+ shellTypes,
279
+ /startupInputDelivery\?: 'command' \| 'terminal'/,
280
+ 'Shell init messages should carry startup input delivery mode.',
281
+ );
256
282
  assert.match(
257
283
  serverIndex,
258
284
  /const startupInput = typeof data\.startupInput === 'string'/,
@@ -260,7 +286,7 @@ assert.match(
260
286
  );
261
287
  assert.match(
262
288
  serverIndex,
263
- /provider === 'codex'[\s\S]+startupInput[\s\S]+quoteShellArgForPlatform\(startupInput\)/,
289
+ /provider === 'codex'[\s\S]+commandStartupInput[\s\S]+quoteShellArgForPlatform\(commandStartupInput\)/,
264
290
  'Codex provider terminals should start with the requested prompt as a CLI argument so banners/update notices cannot swallow Enter.',
265
291
  );
266
292
  assert.match(
@@ -62,7 +62,8 @@ assert.match(workbench, /vscodeWorkbench\.cli\.closeTerminal/, 'CLI terminal clo
62
62
  assert.match(workbench, /WORKBENCH_CLI_STATE_STORAGE_KEY/, 'CLI terminal should remember per-project open state across workspace switches.');
63
63
  assert.match(workbench, /function WorkbenchBottomTerminal/, 'Terminal activity should render as a bottom plain-shell panel.');
64
64
  assert.match(workbench, /BOTTOM_TERMINAL_MIN_HEIGHT/, 'Bottom terminal should support height resizing.');
65
- assert.match(workbench, /isBottomTerminalMinimized/, 'Bottom terminal should support minimizing without closing.');
65
+ assert.match(workbench, /WorkbenchBottomTerminalViewMode/, 'Bottom terminal should support explicit half and full-screen modes.');
66
+ assert.doesNotMatch(workbench, /BOTTOM_TERMINAL_MINIMIZED_HEIGHT|Minimize terminal/, 'Bottom terminal should not expose the old minimized strip behavior.');
66
67
  assert.match(workbench, /bottomTerminalProject/, 'Bottom terminal should stay bound to the project it was opened for.');
67
68
  assert.match(workbench, /setBottomTerminalProject/, 'Opening a bottom terminal should capture its project instead of following workspace selection changes.');
68
69
  assert.match(workbench, /terminalProject = bottomTerminalProject \?\? selectedProject/, 'Workbench should render bottom terminals against their captured project binding.');
@@ -135,9 +136,9 @@ assert.match(hermesRoutes, /router\.post\('\/install'/, 'Hermes should install t
135
136
  assert.match(read('scripts/smoke/hermes-api-install.mjs'), /hermes API install smoke passed/, 'Hermes API install behavior should have a focused smoke test.');
136
137
  assert.match(workbench, /terminalStartupInput/, 'Hermes terminal launch prompts should be passed into the selected CLI.');
137
138
  assert.match(read('src/components/shell/hooks/useShellConnection.ts'), /startupInputRef/, 'Shell connections should support one-shot startup input for Hermes-triggered CLI work.');
138
- assert.match(read('src/components/shell/hooks/useShellConnection.ts'), /isCliReadyForStartupInput/, 'Hermes-triggered CLI input should wait until the provider TUI is ready.');
139
+ assert.match(read('src/components/shell/hooks/useShellTerminal.ts'), /sanitizeTerminalInputData/, 'Terminal should filter xterm color-query replies before forwarding input to provider CLIs.');
139
140
  assert.match(read('src/components/shell/hooks/useShellConnection.ts'), /forceNewSessionRef\.current[\s\S]+startupInputForCommand/, 'Codex startup input should only be sent as a CLI argument for explicit fresh sessions.');
140
- assert.doesNotMatch(read('src/components/shell/hooks/useShellConnection.ts'), /TERMINAL_INIT_DELAY_MS \* 3/, 'Hermes-triggered CLI input should not be sent on a blind fixed delay.');
141
+ assert.match(read('src/components/shell/hooks/useShellConnection.ts'), /startupInputDelivery:\s*handlesStartupInputInCommand \? 'command' : 'terminal'/, 'Reused visible sessions should submit startup input through the backend terminal path.');
141
142
  assert.match(shellTerminal, /handleTerminalPaste/, 'Terminal should support browser paste events.');
142
143
  assert.match(shellTerminal, /handleCopyPasteShortcut/, 'Terminal should normalize Ctrl/Cmd copy and paste shortcuts.');
143
144
  assert.match(shellTerminal, /event\.shiftKey/, 'Terminal should support Ctrl+Shift+C/V style shortcuts.');
@@ -284,9 +284,19 @@ assert.match(
284
284
  'Terminal activity should open a VS Code-style bottom terminal instead of the provider CLI picker.',
285
285
  );
286
286
 
287
- for (const token of ['BOTTOM_TERMINAL_MIN_HEIGHT', 'isBottomTerminalMinimized', 'shrinkCliPanel', 'expandCliPanel']) {
287
+ for (const token of ['BOTTOM_TERMINAL_MIN_HEIGHT', 'bottomTerminalViewMode', 'shrinkCliPanel', 'expandCliPanel']) {
288
288
  assert.match(workbench, new RegExp(token), `Workbench should include ${token}.`);
289
289
  }
290
+ assert.match(
291
+ workbench,
292
+ /WorkbenchBottomTerminalViewMode/,
293
+ 'Bottom terminal should expose half/full display modes instead of minimize/restore.',
294
+ );
295
+ assert.doesNotMatch(
296
+ workbench,
297
+ /BOTTOM_TERMINAL_MINIMIZED_HEIGHT|Minimize terminal|isBottomTerminalMinimized/,
298
+ 'Bottom terminal should not keep the old minimized strip UI.',
299
+ );
290
300
 
291
301
  assert.match(
292
302
  workbench,
package/server/index.js CHANGED
@@ -435,6 +435,26 @@ function appendPtySessionBuffer(session, data) {
435
435
  }
436
436
  }
437
437
 
438
+ function normalizeTerminalStartupInput(input) {
439
+ return `${String(input || '').replace(/(?:\r\n|\r|\n)+$/u, '')}\r`;
440
+ }
441
+
442
+ function writeTerminalStartupInput(session, startupInput, reason, delayMs = 500) {
443
+ if (!session?.pty || !startupInput) return;
444
+ const submittedInput = normalizeTerminalStartupInput(startupInput);
445
+ setTimeout(() => {
446
+ try {
447
+ if (session.pty && session.lifecycleState === 'running') {
448
+ session.pty.write(submittedInput);
449
+ session.updatedAt = Date.now();
450
+ console.log(`⌨️ Submitted startup input to visible PTY (${reason})`);
451
+ }
452
+ } catch (error) {
453
+ console.warn('Failed to submit startup input to visible PTY:', error?.message || error);
454
+ }
455
+ }, delayMs);
456
+ }
457
+
438
458
  function normalizeShellPermissionMode(value) {
439
459
  return typeof value === 'string' ? value.trim() : '';
440
460
  }
@@ -2387,6 +2407,9 @@ function handleShellConnection(ws, request) {
2387
2407
  const startupInput = typeof data.startupInput === 'string' && data.startupInput.trim()
2388
2408
  ? data.startupInput.trim()
2389
2409
  : null;
2410
+ const startupInputDelivery = data.startupInputDelivery === 'terminal' ? 'terminal' : 'command';
2411
+ const commandStartupInput = startupInputDelivery === 'command' ? startupInput : null;
2412
+ const terminalStartupInput = startupInputDelivery === 'terminal' ? startupInput : null;
2390
2413
  const hermesLaunchId = Number.isFinite(Number(data.hermesLaunchId)) && Number(data.hermesLaunchId) > 0
2391
2414
  ? Number(data.hermesLaunchId)
2392
2415
  : null;
@@ -2474,6 +2497,9 @@ function handleShellConnection(ws, request) {
2474
2497
  }
2475
2498
 
2476
2499
  existingSession.ws = ws;
2500
+ if (terminalStartupInput && !isPlainShell) {
2501
+ writeTerminalStartupInput(existingSession, terminalStartupInput, 'reused provider session', 350);
2502
+ }
2477
2503
 
2478
2504
  return;
2479
2505
  }
@@ -2551,8 +2577,8 @@ function handleShellConnection(ws, request) {
2551
2577
  } else {
2552
2578
  shellCommand = `${command} resume "${sessionId}" || ${command}`;
2553
2579
  }
2554
- } else if (startupInput) {
2555
- shellCommand = `${command} ${quoteShellArgForPlatform(startupInput)}`;
2580
+ } else if (commandStartupInput) {
2581
+ shellCommand = `${command} ${quoteShellArgForPlatform(commandStartupInput)}`;
2556
2582
  } else {
2557
2583
  shellCommand = command;
2558
2584
  }
@@ -2684,6 +2710,10 @@ function handleShellConnection(ws, request) {
2684
2710
  keepAliveUntilExit: false,
2685
2711
  updatedAt: Date.now(),
2686
2712
  });
2713
+ const createdSession = ptySessionsMap.get(ptySessionKey);
2714
+ if (terminalStartupInput && !isPlainShell) {
2715
+ writeTerminalStartupInput(createdSession, terminalStartupInput, 'new provider session', 4500);
2716
+ }
2687
2717
 
2688
2718
  // Handle data output
2689
2719
  shellProcess.onData((data) => {