sapper-iq 1.1.17 → 1.1.18

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/sapper.mjs +12 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sapper-iq",
3
- "version": "1.1.17",
3
+ "version": "1.1.18",
4
4
  "description": "AI-powered development assistant that executes commands and builds projects",
5
5
  "main": "sapper.mjs",
6
6
  "bin": {
package/sapper.mjs CHANGED
@@ -27,10 +27,13 @@ process.on('SIGINT', () => {
27
27
  console.log(chalk.red('\nForce quitting...'));
28
28
  process.exit(1);
29
29
  }
30
+ // Set flag to abort current stream
31
+ abortStream = true;
32
+
30
33
  // Clear current line and move to new one - stops ghost output
31
34
  process.stdout.clearLine(0);
32
35
  process.stdout.cursorTo(0);
33
- console.log(chalk.yellow('\nStopping AI stream... (Ctrl+C again to force quit)'));
36
+ console.log(chalk.yellow('\n⏹️ Stopping response... (Ctrl+C again to force quit)'));
34
37
 
35
38
  // Reset terminal immediately
36
39
  resetTerminal();
@@ -104,6 +107,7 @@ function statusBadge(text, type = 'info') {
104
107
 
105
108
  let stepMode = false;
106
109
  let debugMode = false; // Toggle with /debug command
110
+ let abortStream = false; // Flag to interrupt AI response
107
111
  let rl = readline.createInterface({
108
112
  input: process.stdin,
109
113
  output: process.stdout,
@@ -624,10 +628,17 @@ Do NOT just display content. Actually WRITE files using the tool.`
624
628
 
625
629
  let msg = '';
626
630
  const MAX_RESPONSE_LENGTH = 29000; // Guard against infinite loops (increased for multi-file reads)
631
+ abortStream = false; // Reset abort flag before streaming
627
632
 
628
633
  console.log(chalk.magenta('┌─[') + chalk.white.bold('Sapper') + chalk.magenta(']'));
629
634
  process.stdout.write(chalk.magenta('│ '));
630
635
  for await (const chunk of response) {
636
+ // Check if user pressed Ctrl+C
637
+ if (abortStream) {
638
+ console.log(chalk.yellow('\n│ [Response interrupted]'));
639
+ break;
640
+ }
641
+
631
642
  const content = chunk.message.content;
632
643
  process.stdout.write(content);
633
644
  msg += content;