@iservu-inc/adf-cli 0.7.0 ā 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);
|
|
@@ -565,24 +599,17 @@ class Interviewer {
|
|
|
565
599
|
this.skipTracker.startQuestion(question.id);
|
|
566
600
|
}
|
|
567
601
|
|
|
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
602
|
console.log('');
|
|
571
|
-
|
|
572
|
-
// Show exit shortcut at bottom with padding
|
|
573
603
|
console.log(chalk.gray('ā'.repeat(60)));
|
|
574
|
-
console.log(chalk.yellow('š”
|
|
604
|
+
console.log(chalk.yellow('š” Type "skip" to skip ⢠Type "exit" or press Ctrl+C to save & exit (resume with: adf init)'));
|
|
575
605
|
console.log(chalk.gray('ā'.repeat(60)));
|
|
576
|
-
console.log('');
|
|
577
606
|
|
|
578
607
|
const { answer } = await inquirer.prompt([
|
|
579
608
|
{
|
|
580
|
-
type: '
|
|
609
|
+
type: 'input',
|
|
581
610
|
name: 'answer',
|
|
582
|
-
message: '',
|
|
583
|
-
|
|
584
|
-
postfix: '.md',
|
|
585
|
-
default: ''
|
|
611
|
+
message: 'Your answer:',
|
|
612
|
+
prefix: ''
|
|
586
613
|
}
|
|
587
614
|
]);
|
|
588
615
|
|
|
@@ -693,23 +720,18 @@ class Interviewer {
|
|
|
693
720
|
|
|
694
721
|
if (followUp) {
|
|
695
722
|
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'));
|
|
723
|
+
console.log(chalk.yellow(` ${followUp.question}\n`));
|
|
698
724
|
|
|
699
|
-
// Show exit shortcut at bottom with padding
|
|
700
725
|
console.log(chalk.gray('ā'.repeat(60)));
|
|
701
|
-
console.log(chalk.yellow('š”
|
|
726
|
+
console.log(chalk.yellow('š” Type "exit" or press Ctrl+C to save & exit (resume with: adf init)'));
|
|
702
727
|
console.log(chalk.gray('ā'.repeat(60)));
|
|
703
|
-
console.log('');
|
|
704
728
|
|
|
705
729
|
const { followUpAnswer } = await inquirer.prompt([
|
|
706
730
|
{
|
|
707
|
-
type: '
|
|
731
|
+
type: 'input',
|
|
708
732
|
name: 'followUpAnswer',
|
|
709
|
-
message: '',
|
|
710
|
-
|
|
711
|
-
postfix: '.md',
|
|
712
|
-
default: ''
|
|
733
|
+
message: 'Follow-up answer:',
|
|
734
|
+
prefix: ''
|
|
713
735
|
}
|
|
714
736
|
]);
|
|
715
737
|
|
package/package.json
CHANGED
|
Binary file
|