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.
Files changed (2) hide show
  1. package/bin/cli.js +23 -10
  2. 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'${agentFlag}];
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 response = '';
591
- let error = '';
591
+ let stdout = '';
592
+ let stderr = '';
592
593
 
593
- proc.stdout.on('data', (data) => response += data.toString());
594
- proc.stderr.on('data', (data) => error += data.toString());
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; // Reset so we try finding again
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
- if (code === 0) {
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.trim());
619
+ resolve(response);
606
620
  } else {
607
- console.error(' Moltbot error:', error);
608
- reject(new Error(error || \`Exit code \${code}\`));
621
+ reject(new Error('No response from Moltbot'));
609
622
  }
610
623
  });
611
624
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spawn-skill",
3
- "version": "1.3.3",
3
+ "version": "1.3.5",
4
4
  "description": "Connect your AI agent to Spawn.wtf",
5
5
  "bin": {
6
6
  "spawn-skill": "./bin/cli.js"