helixmind 0.5.6 → 0.5.8

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.
@@ -1 +1 @@
1
- {"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/chat.ts"],"names":[],"mappings":"AAsFA,UAAU,WAAW;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAqND,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA0iHrE"}
1
+ {"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/chat.ts"],"names":[],"mappings":"AAsFA,UAAU,WAAW;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAqND,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA4jHrE"}
@@ -392,7 +392,11 @@ export async function chatCommand(options) {
392
392
  let visionProcessor;
393
393
  // Terminal + Screen (replaces BottomChrome with framed input area)
394
394
  const terminal = new Terminal();
395
- const screen = new Screen(terminal);
395
+ // Live cursor getter — set once InputManager is created (after rl exists)
396
+ let _liveReadlineCursor = null;
397
+ const screen = new Screen(terminal, {
398
+ getLiveInputCursor: () => _liveReadlineCursor?.() ?? 0,
399
+ });
396
400
  // Alias for backward compat with code that references 'chrome'
397
401
  const chrome = screen;
398
402
  // Activity indicator (renders on chrome row 0 during agent work)
@@ -1927,6 +1931,8 @@ export async function chatCommand(options) {
1927
1931
  });
1928
1932
  // Expose readline for legacy code (PermissionManager, rl.question, etc.)
1929
1933
  const rl = inputMgr.readline;
1934
+ // Connect live cursor getter now that readline exists
1935
+ _liveReadlineCursor = () => inputMgr.cursorPos;
1930
1936
  // Load persistent prompt history into readline
1931
1937
  const promptHistory = new PromptHistory(configDir);
1932
1938
  const savedHistory = await promptHistory.load();
@@ -2456,15 +2462,18 @@ export async function chatCommand(options) {
2456
2462
  // Suppress readline 'line' events from the same paste data — readline also
2457
2463
  // receives the raw bytes and fires duplicate line events for each \n.
2458
2464
  drainUntil = Date.now() + 150;
2459
- // Save the user's already-typed input before clearing leaked paste bytes
2465
+ // Save the user's already-typed input AND cursor position before clearing leaked paste bytes
2460
2466
  const existingInput = inputMgr.currentLine;
2467
+ const existingCursor = inputMgr.cursorPos;
2461
2468
  // Clear any characters that leaked into readline buffer before suppression kicked in
2462
2469
  replaceReadlineInput('');
2463
2470
  const trimmed = text.trim();
2464
2471
  if (!trimmed) {
2465
2472
  // Restore existing input if paste was empty
2466
- if (existingInput)
2473
+ if (existingInput) {
2467
2474
  replaceReadlineInput(existingInput);
2475
+ rl.cursor = Math.min(existingCursor, existingInput.length);
2476
+ }
2468
2477
  return;
2469
2478
  }
2470
2479
  if (agentRunning) {
@@ -2478,11 +2487,14 @@ export async function chatCommand(options) {
2478
2487
  inputMgr.prompt();
2479
2488
  }
2480
2489
  else {
2481
- // Restore existing input, then set paste block
2482
- if (existingInput)
2490
+ // Restore existing input at original cursor position, then set paste block
2491
+ if (existingInput) {
2483
2492
  replaceReadlineInput(existingInput);
2493
+ rl.cursor = Math.min(existingCursor, existingInput.length);
2494
+ }
2484
2495
  inputMgr.setPasteBlock(trimmed);
2485
2496
  pendingPasteText = inputMgr.pendingPaste;
2497
+ inputMgr.prompt();
2486
2498
  }
2487
2499
  }
2488
2500
  // Build Jarvis identity context for system prompt injection (when daemon is active)
@@ -3432,9 +3444,12 @@ export async function chatCommand(options) {
3432
3444
  inputMgr.prompt();
3433
3445
  }
3434
3446
  else {
3435
- // Use InputManager's paste block system
3447
+ // Use InputManager's paste block system — restore prompt state first
3448
+ isAtPrompt = true;
3449
+ chrome.promptActive = true;
3436
3450
  inputMgr.setPasteBlock(assembled);
3437
3451
  pendingPasteText = inputMgr.pendingPaste;
3452
+ inputMgr.prompt();
3438
3453
  }
3439
3454
  }, PASTE_THRESHOLD_MS);
3440
3455
  return;