spawn-skill 1.3.3 → 1.3.4
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/bin/cli.js +21 -9
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -587,25 +587,37 @@ async function askMoltbot(message) {
|
|
|
587
587
|
});
|
|
588
588
|
}
|
|
589
589
|
|
|
590
|
-
let
|
|
591
|
-
let
|
|
590
|
+
let stdout = '';
|
|
591
|
+
let stderr = '';
|
|
592
592
|
|
|
593
|
-
proc.stdout.on('data', (data) =>
|
|
594
|
-
|
|
593
|
+
proc.stdout.on('data', (data) => {
|
|
594
|
+
stdout += data.toString();
|
|
595
|
+
console.log('stdout:', data.toString().substring(0, 100));
|
|
596
|
+
});
|
|
597
|
+
proc.stderr.on('data', (data) => {
|
|
598
|
+
stderr += data.toString();
|
|
599
|
+
console.log('stderr:', data.toString().substring(0, 100));
|
|
600
|
+
});
|
|
595
601
|
|
|
596
602
|
proc.on('error', (err) => {
|
|
597
603
|
console.error('✗ Failed to start Moltbot:', err.message);
|
|
598
|
-
moltbotPath = null;
|
|
604
|
+
moltbotPath = null;
|
|
599
605
|
reject(new Error('Moltbot not found. Install with: npm install -g moltbot@latest'));
|
|
600
606
|
});
|
|
601
607
|
|
|
602
608
|
proc.on('close', (code) => {
|
|
603
|
-
|
|
609
|
+
console.log('Exit code:', code);
|
|
610
|
+
console.log('Total stdout length:', stdout.length);
|
|
611
|
+
console.log('Total stderr length:', stderr.length);
|
|
612
|
+
|
|
613
|
+
// Try stdout first, fall back to stderr
|
|
614
|
+
const response = stdout.trim() || stderr.trim();
|
|
615
|
+
|
|
616
|
+
if (response) {
|
|
604
617
|
console.log('✓ Moltbot responded');
|
|
605
|
-
resolve(response
|
|
618
|
+
resolve(response);
|
|
606
619
|
} else {
|
|
607
|
-
|
|
608
|
-
reject(new Error(error || \`Exit code \${code}\`));
|
|
620
|
+
reject(new Error('No response from Moltbot'));
|
|
609
621
|
}
|
|
610
622
|
});
|
|
611
623
|
});
|