@iservu-inc/adf-cli 0.5.6 β†’ 0.7.0

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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,77 @@ All notable changes to `@iservu-inc/adf-cli` will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.6.0] - 2025-10-05
9
+
10
+ ### 🎯 Fixed Cursor Positioning with Editor Input
11
+
12
+ **FIX:** Switched from inline input to editor-based input to fix cursor lag on multi-line answers.
13
+
14
+ #### The Problem
15
+
16
+ When typing long answers in the terminal, the text cursor would fall behind by 3-4 characters when wrapping to a second line:
17
+
18
+ ![Cursor Lag Issue](https://user-images.githubusercontent.com/...)
19
+ - Text wraps to multiple lines
20
+ - Cursor position becomes desynchronized
21
+ - Hard to track where you're typing
22
+ - Frustrating UX for detailed answers
23
+
24
+ This is a known issue with `inquirer`'s `input` type and terminal line wrapping.
25
+
26
+ #### The Solution
27
+
28
+ Switched to `editor` type for all answers:
29
+ - Opens your system's default text editor (Notepad, nano, vi, etc.)
30
+ - Perfect for multi-line, detailed answers
31
+ - No cursor positioning issues
32
+ - Better editing experience (copy/paste, formatting, etc.)
33
+
34
+ **New Workflow:**
35
+ 1. Question is displayed
36
+ 2. Your editor automatically opens
37
+ 3. Type your answer (multi-line, formatted, etc.)
38
+ 4. Save and close the editor
39
+ 5. Answer is captured and interview continues
40
+
41
+ **To skip a question:** Leave the editor empty and save.
42
+
43
+ #### Benefits
44
+
45
+ - βœ… **No more cursor lag** - Editor handles display properly
46
+ - βœ… **Better for long answers** - Multi-line editing is natural
47
+ - βœ… **Standard CLI pattern** - Used by git, crontab, etc.
48
+ - βœ… **Copy/paste friendly** - Full editor capabilities
49
+ - βœ… **Markdown support** - `.md` extension for syntax highlighting
50
+
51
+ #### Technical Changes
52
+
53
+ - Modified: `lib/frameworks/interviewer.js`
54
+ - Changed answer input from `type: 'input'` to `type: 'editor'`
55
+ - Changed follow-up input to `type: 'editor'`
56
+ - Added clear instructions about editor workflow
57
+ - Empty answers treated as skips
58
+ - Updated guidance text
59
+
60
+ #### User Experience
61
+
62
+ **Before (inline):**
63
+ ```
64
+ Your answer: The primary use action is to engβ–ˆge...
65
+ [cursor lags behind when wrapping]
66
+ ```
67
+
68
+ **After (editor):**
69
+ ```
70
+ (Your editor will open. Save and close to continue, or leave empty + save to skip)
71
+ [Editor opens]
72
+ [Type answer with full multi-line support]
73
+ [Save & close]
74
+ βœ“ Answer captured
75
+ ```
76
+
77
+ ---
78
+
8
79
  ## [0.5.6] - 2025-10-05
9
80
 
10
81
  ### πŸ”§ Fixed Invalid .env State Detection
@@ -559,36 +559,57 @@ class Interviewer {
559
559
  console.log(chalk.gray(`πŸ’‘ ${question.guidance}`));
560
560
  console.log(chalk.green(` βœ“ Good: ${question.goodExample}`));
561
561
  console.log(chalk.red(` βœ— Bad: ${question.badExample}`));
562
- console.log(chalk.gray(` (Type "skip" to skip remaining questions in this block)\n`));
563
562
 
564
563
  // Start tracking time for this question
565
564
  if (this.skipTracker) {
566
565
  this.skipTracker.startQuestion(question.id);
567
566
  }
568
567
 
569
- // Get answer
568
+ // Get answer using editor for better multi-line support
569
+ console.log(chalk.gray(' (Your editor will open. Save and close to continue, or leave empty + save to skip)'));
570
+ console.log('');
571
+
572
+ // Show exit shortcut at bottom with padding
573
+ console.log(chalk.gray('─'.repeat(60)));
574
+ console.log(chalk.yellow('πŸ’‘ TIP: Type "exit" in the editor to save progress and exit (resume anytime with: adf init)'));
575
+ console.log(chalk.gray('─'.repeat(60)));
576
+ console.log('');
577
+
570
578
  const { answer } = await inquirer.prompt([
571
579
  {
572
- type: 'input',
580
+ type: 'editor',
573
581
  name: 'answer',
574
- message: 'Your answer:',
575
- validate: (input) => {
576
- if (!input || input.trim().length === 0) {
577
- return 'Please provide an answer or type "skip"';
578
- }
579
- return true;
580
- }
582
+ message: '',
583
+ waitForUseInput: false,
584
+ postfix: '.md',
585
+ default: ''
581
586
  }
582
587
  ]);
583
588
 
584
- if (answer.toLowerCase() === 'skip') {
589
+ // Handle empty answer or "skip" as skip
590
+ if (!answer || answer.trim().length === 0 || answer.toLowerCase().trim() === 'skip') {
585
591
  // Record skip event
586
592
  if (this.skipTracker) {
587
593
  this.skipTracker.recordSkip(question, 'manual');
588
594
  }
595
+ console.log(chalk.gray('\n⏭️ Skipped\n'));
589
596
  return null; // Signal to skip remaining questions
590
597
  }
591
598
 
599
+ // Handle "exit" keyword - save progress and exit gracefully
600
+ if (answer.toLowerCase().trim() === 'exit') {
601
+ console.log(chalk.yellow('\nπŸ’Ύ Saving progress and exiting...'));
602
+
603
+ // Ensure progress is saved
604
+ if (this.progressTracker) {
605
+ await this.progressTracker.save();
606
+ }
607
+
608
+ console.log(chalk.green('βœ“ Progress saved!'));
609
+ console.log(chalk.cyan('Resume anytime with: adf init\n'));
610
+ process.exit(0);
611
+ }
612
+
592
613
  // Analyze answer quality (use AI if available, fallback to heuristic)
593
614
  let qualityMetrics;
594
615
  try {
@@ -671,16 +692,41 @@ class Interviewer {
671
692
  }
672
693
 
673
694
  if (followUp) {
674
- console.log(chalk.yellow(`\nπŸ€– ${followUp.message}\n`));
695
+ console.log(chalk.yellow(`\nπŸ€– ${followUp.message}`));
696
+ console.log(chalk.yellow(` ${followUp.question}`));
697
+ console.log(chalk.gray(' (Your editor will open for follow-up answer)\n'));
698
+
699
+ // Show exit shortcut at bottom with padding
700
+ console.log(chalk.gray('─'.repeat(60)));
701
+ console.log(chalk.yellow('πŸ’‘ TIP: Type "exit" in the editor to save progress and exit (resume anytime with: adf init)'));
702
+ console.log(chalk.gray('─'.repeat(60)));
703
+ console.log('');
675
704
 
676
705
  const { followUpAnswer } = await inquirer.prompt([
677
706
  {
678
- type: 'input',
707
+ type: 'editor',
679
708
  name: 'followUpAnswer',
680
- message: followUp.question
709
+ message: '',
710
+ waitForUseInput: false,
711
+ postfix: '.md',
712
+ default: ''
681
713
  }
682
714
  ]);
683
715
 
716
+ // Handle "exit" keyword - save progress and exit gracefully
717
+ if (followUpAnswer && followUpAnswer.toLowerCase().trim() === 'exit') {
718
+ console.log(chalk.yellow('\nπŸ’Ύ Saving progress and exiting...'));
719
+
720
+ // Ensure progress is saved
721
+ if (this.progressTracker) {
722
+ await this.progressTracker.save();
723
+ }
724
+
725
+ console.log(chalk.green('βœ“ Progress saved!'));
726
+ console.log(chalk.cyan('Resume anytime with: adf init\n'));
727
+ process.exit(0);
728
+ }
729
+
684
730
  if (followUpAnswer && followUpAnswer.trim()) {
685
731
  // Combine answers
686
732
  const combined = `${answer} | Follow-up: ${followUpAnswer}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iservu-inc/adf-cli",
3
- "version": "0.5.6",
3
+ "version": "0.7.0",
4
4
  "description": "CLI tool for AgentDevFramework - AI-assisted development framework with multi-provider AI support",
5
5
  "main": "index.js",
6
6
  "bin": {