spawn-skill 1.3.4 → 1.3.6

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 +13 -17
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -569,23 +569,19 @@ async function askMoltbot(message) {
569
569
  return;
570
570
  }
571
571
 
572
- // Build command based on whether we're using npx or direct path
573
- let proc;
574
- const baseArgs = ['agent', '--message', message, '--thinking', 'high'${agentFlag}];
575
-
576
- if (cmd.startsWith('npx ')) {
577
- // npx moltbot or npx clawdbot
578
- const pkgName = cmd.split(' ')[1];
579
- proc = spawn('npx', [pkgName, ...baseArgs], {
580
- shell: true,
581
- env: { ...process.env }
582
- });
583
- } else {
584
- proc = spawn(cmd, baseArgs, {
585
- shell: true,
586
- env: { ...process.env }
587
- });
588
- }
572
+ // Build command as a single string for shell execution
573
+ // Quote the message to handle spaces
574
+ const escapedMessage = message.replace(/"/g, '\\\\"');
575
+ const fullCmd = cmd.startsWith('npx ')
576
+ ? \`npx \${cmd.split(' ')[1]} agent --message "\${escapedMessage}" --thinking high --session-id spawn-session\`
577
+ : \`"\${cmd}" agent --message "\${escapedMessage}" --thinking high --session-id spawn-session\`;
578
+
579
+ console.log('Running:', fullCmd);
580
+
581
+ let proc = spawn(fullCmd, [], {
582
+ shell: true,
583
+ env: { ...process.env }
584
+ });
589
585
 
590
586
  let stdout = '';
591
587
  let stderr = '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spawn-skill",
3
- "version": "1.3.4",
3
+ "version": "1.3.6",
4
4
  "description": "Connect your AI agent to Spawn.wtf",
5
5
  "bin": {
6
6
  "spawn-skill": "./bin/cli.js"