helixmind 0.5.18 → 0.5.20

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,CAwiHrE"}
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,CA8iHrE"}
@@ -2683,7 +2683,13 @@ export async function chatCommand(options) {
2683
2683
  }
2684
2684
  // Handle slash commands
2685
2685
  if (input.startsWith('/')) {
2686
- const handled = await handleSlashCommand(input, messages, agentHistory, config, spiralEngine, store, rl, permissions, undoStack, checkpointStore, sessionBuffer, { input: sessionTokensInput, output: sessionTokensOutput }, sessionToolCalls, (newProvider) => { provider = newProvider; config = store.getAll(); }, async (newScope) => {
2686
+ const handled = await handleSlashCommand(input, messages, agentHistory, config, spiralEngine, store, rl, permissions, undoStack, checkpointStore, sessionBuffer, { input: sessionTokensInput, output: sessionTokensOutput }, sessionToolCalls, (newProvider) => {
2687
+ provider = newProvider;
2688
+ config = store.getAll();
2689
+ // Clear type-ahead buffer on provider switch — prevents buffered
2690
+ // messages from being sent to the wrong model after switching.
2691
+ typeAheadBuffer.length = 0;
2692
+ }, async (newScope) => {
2687
2693
  // Switch brain scope
2688
2694
  if (spiralEngine) {
2689
2695
  try {
@@ -4005,6 +4011,13 @@ async function handleSlashCommand(input, messages, agentHistory, config, spiralE
4005
4011
  const configBefore = store.getAll();
4006
4012
  const result = await showModelSwitcher(store, rl);
4007
4013
  chrome?.activate();
4014
+ // Flush stale stdin bytes BEFORE resuming readline to prevent
4015
+ // phantom line events (API key leaking as chat message).
4016
+ // Pause stdin briefly to discard any buffered data from sub-menus.
4017
+ if (process.stdin.isTTY) {
4018
+ process.stdin.pause();
4019
+ process.stdin.resume();
4020
+ }
4008
4021
  rl.resume();
4009
4022
  // Always refresh provider if config changed (covers "Add new provider" path too)
4010
4023
  const newConfig = store.getAll();
@@ -4030,6 +4043,11 @@ async function handleSlashCommand(input, messages, agentHistory, config, spiralE
4030
4043
  chrome?.deactivate();
4031
4044
  await showKeyManagement(store, rl);
4032
4045
  chrome?.activate();
4046
+ // Flush stale stdin bytes BEFORE resuming readline
4047
+ if (process.stdin.isTTY) {
4048
+ process.stdin.pause();
4049
+ process.stdin.resume();
4050
+ }
4033
4051
  rl.resume();
4034
4052
  // Refresh provider after key changes
4035
4053
  const newConfig = store.getAll();