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.
- package/bin/cli.js +13 -17
- 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
|
|
573
|
-
|
|
574
|
-
const
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
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 = '';
|