spawn-skill 1.2.0 → 1.2.2
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 +16 -6
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -513,14 +513,23 @@ async function askMoltbot(message) {
|
|
|
513
513
|
return new Promise((resolve, reject) => {
|
|
514
514
|
console.log('📨 Forwarding to Moltbot:', message);
|
|
515
515
|
updateStatus('thinking', 'Asking Moltbot...');
|
|
516
|
-
|
|
517
|
-
|
|
516
|
+
|
|
517
|
+
// Use shell: true to inherit PATH and find globally installed moltbot
|
|
518
|
+
const moltbot = spawn('moltbot', ['agent', '--message', message, '--thinking', 'high'], {
|
|
519
|
+
shell: true,
|
|
520
|
+
env: { ...process.env }
|
|
521
|
+
});
|
|
518
522
|
let response = '';
|
|
519
523
|
let error = '';
|
|
520
|
-
|
|
524
|
+
|
|
521
525
|
moltbot.stdout.on('data', (data) => response += data.toString());
|
|
522
526
|
moltbot.stderr.on('data', (data) => error += data.toString());
|
|
523
|
-
|
|
527
|
+
|
|
528
|
+
moltbot.on('error', (err) => {
|
|
529
|
+
console.error('✗ Failed to start Moltbot:', err.message);
|
|
530
|
+
reject(new Error('Moltbot not found. Install with: npm install -g moltbot@latest'));
|
|
531
|
+
});
|
|
532
|
+
|
|
524
533
|
moltbot.on('close', (code) => {
|
|
525
534
|
if (code === 0) {
|
|
526
535
|
console.log('✓ Moltbot responded');
|
|
@@ -709,10 +718,11 @@ async function main() {
|
|
|
709
718
|
const moltbotCheck = ora('Checking for Moltbot...').start();
|
|
710
719
|
try {
|
|
711
720
|
const { execSync } = await import('child_process');
|
|
712
|
-
|
|
721
|
+
// Use moltbot --version instead of 'which' for cross-platform support
|
|
722
|
+
execSync('moltbot --version', { stdio: 'pipe', shell: true });
|
|
713
723
|
moltbotCheck.succeed('Moltbot found');
|
|
714
724
|
} catch {
|
|
715
|
-
moltbotCheck.warn('Moltbot not
|
|
725
|
+
moltbotCheck.warn('Moltbot not found in PATH');
|
|
716
726
|
console.log(dim(' Install with: npm install -g moltbot@latest'));
|
|
717
727
|
console.log(dim(' Then run: moltbot onboard'));
|
|
718
728
|
console.log('');
|