@iservu-inc/adf-cli 0.7.1 → 0.8.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.
@@ -63,6 +63,24 @@ class Interviewer {
63
63
  console.log(chalk.gray(`Session: ${this.sessionId}`));
64
64
  console.log(chalk.gray(`Files will be saved to: .adf/sessions/${this.sessionId}/\n`));
65
65
 
66
+ // Setup global Ctrl+C handler for graceful exit from anywhere
67
+ const exitHandler = async () => {
68
+ console.log(chalk.yellow('\n\nšŸ’¾ Saving progress and exiting...'));
69
+
70
+ // Ensure progress is saved
71
+ if (this.progressTracker) {
72
+ await this.progressTracker.save();
73
+ }
74
+
75
+ console.log(chalk.green('āœ“ Progress saved!'));
76
+ console.log(chalk.cyan('Resume anytime with: adf init\n'));
77
+ process.exit(0);
78
+ };
79
+
80
+ // Remove any existing SIGINT listeners to avoid duplicates
81
+ process.removeAllListeners('SIGINT');
82
+ process.on('SIGINT', exitHandler);
83
+
66
84
  // Configure AI if not already configured (new sessions only)
67
85
  if (!this.aiConfig && !this.isResuming) {
68
86
  // Check if user already configured AI via 'adf config'
@@ -496,6 +514,22 @@ class Interviewer {
496
514
  for (let i = 0; i < block.questions.length; i++) {
497
515
  const question = block.questions[i];
498
516
 
517
+ // Check if this question was already answered (resume functionality)
518
+ if (this.answers[question.id]) {
519
+ const answerText = typeof this.answers[question.id] === 'string'
520
+ ? this.answers[question.id]
521
+ : this.answers[question.id].text;
522
+
523
+ console.log(chalk.cyan(`Question ${i + 1}/${block.questions.length}`) + chalk.gray(` (Block ${currentBlock}/${totalBlocks})`) + '\n');
524
+ console.log(chalk.gray('━'.repeat(60)));
525
+ console.log(chalk.green(`\nāœ“ Already answered: ${question.text}`));
526
+ console.log(chalk.gray(` Answer: ${answerText.substring(0, 80)}${answerText.length > 80 ? '...' : ''}\n`));
527
+ console.log(chalk.gray('━'.repeat(60)) + '\n');
528
+
529
+ questionsAnswered++;
530
+ continue;
531
+ }
532
+
499
533
  // Check if we should skip this question based on knowledge graph
500
534
  if (this.dynamicPipeline) {
501
535
  const skipCheck = this.dynamicPipeline.shouldSkipQuestion(question);
@@ -567,7 +601,7 @@ class Interviewer {
567
601
 
568
602
  console.log('');
569
603
  console.log(chalk.gray('─'.repeat(60)));
570
- console.log(chalk.yellow('šŸ’” Type "skip" to skip • Type "exit" to save & exit (resume with: adf init)'));
604
+ console.log(chalk.yellow('šŸ’” Type "skip" to skip • Type "exit" or press Ctrl+C to save & exit (resume with: adf init)'));
571
605
  console.log(chalk.gray('─'.repeat(60)));
572
606
 
573
607
  const { answer } = await inquirer.prompt([
@@ -689,7 +723,7 @@ class Interviewer {
689
723
  console.log(chalk.yellow(` ${followUp.question}\n`));
690
724
 
691
725
  console.log(chalk.gray('─'.repeat(60)));
692
- console.log(chalk.yellow('šŸ’” Type "exit" to save & exit (resume with: adf init)'));
726
+ console.log(chalk.yellow('šŸ’” Type "exit" or press Ctrl+C to save & exit (resume with: adf init)'));
693
727
  console.log(chalk.gray('─'.repeat(60)));
694
728
 
695
729
  const { followUpAnswer } = await inquirer.prompt([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iservu-inc/adf-cli",
3
- "version": "0.7.1",
3
+ "version": "0.8.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": {