spawn-skill 1.3.3 → 1.3.5
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 +23 -10
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -570,8 +570,9 @@ async function askMoltbot(message) {
|
|
|
570
570
|
}
|
|
571
571
|
|
|
572
572
|
// Build command based on whether we're using npx or direct path
|
|
573
|
+
// Use --session-id for non-interactive mode
|
|
573
574
|
let proc;
|
|
574
|
-
const baseArgs = ['agent', '--message', message, '--thinking', 'high'
|
|
575
|
+
const baseArgs = ['agent', '--message', message, '--thinking', 'high', '--session-id', 'spawn-session'];
|
|
575
576
|
|
|
576
577
|
if (cmd.startsWith('npx ')) {
|
|
577
578
|
// npx moltbot or npx clawdbot
|
|
@@ -587,25 +588,37 @@ async function askMoltbot(message) {
|
|
|
587
588
|
});
|
|
588
589
|
}
|
|
589
590
|
|
|
590
|
-
let
|
|
591
|
-
let
|
|
591
|
+
let stdout = '';
|
|
592
|
+
let stderr = '';
|
|
592
593
|
|
|
593
|
-
proc.stdout.on('data', (data) =>
|
|
594
|
-
|
|
594
|
+
proc.stdout.on('data', (data) => {
|
|
595
|
+
stdout += data.toString();
|
|
596
|
+
console.log('stdout:', data.toString().substring(0, 100));
|
|
597
|
+
});
|
|
598
|
+
proc.stderr.on('data', (data) => {
|
|
599
|
+
stderr += data.toString();
|
|
600
|
+
console.log('stderr:', data.toString().substring(0, 100));
|
|
601
|
+
});
|
|
595
602
|
|
|
596
603
|
proc.on('error', (err) => {
|
|
597
604
|
console.error('✗ Failed to start Moltbot:', err.message);
|
|
598
|
-
moltbotPath = null;
|
|
605
|
+
moltbotPath = null;
|
|
599
606
|
reject(new Error('Moltbot not found. Install with: npm install -g moltbot@latest'));
|
|
600
607
|
});
|
|
601
608
|
|
|
602
609
|
proc.on('close', (code) => {
|
|
603
|
-
|
|
610
|
+
console.log('Exit code:', code);
|
|
611
|
+
console.log('Total stdout length:', stdout.length);
|
|
612
|
+
console.log('Total stderr length:', stderr.length);
|
|
613
|
+
|
|
614
|
+
// Try stdout first, fall back to stderr
|
|
615
|
+
const response = stdout.trim() || stderr.trim();
|
|
616
|
+
|
|
617
|
+
if (response) {
|
|
604
618
|
console.log('✓ Moltbot responded');
|
|
605
|
-
resolve(response
|
|
619
|
+
resolve(response);
|
|
606
620
|
} else {
|
|
607
|
-
|
|
608
|
-
reject(new Error(error || \`Exit code \${code}\`));
|
|
621
|
+
reject(new Error('No response from Moltbot'));
|
|
609
622
|
}
|
|
610
623
|
});
|
|
611
624
|
});
|