spawn-skill 1.2.5 → 1.3.0
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/CLAUDE.md +6 -0
- package/bin/cli.js +10 -67
- package/package.json +1 -1
package/bin/CLAUDE.md
CHANGED
|
@@ -8,4 +8,10 @@
|
|
|
8
8
|
| ID | Time | T | Title | Read |
|
|
9
9
|
|----|------|---|-------|------|
|
|
10
10
|
| #913 | 10:14 PM | 🔵 | Spawn-skill CLI tool provides Python SDK implementation | ~343 |
|
|
11
|
+
|
|
12
|
+
### Jan 30, 2026
|
|
13
|
+
|
|
14
|
+
| ID | Time | T | Title | Read |
|
|
15
|
+
|----|------|---|-------|------|
|
|
16
|
+
| #984 | 1:56 AM | 🟣 | Added Moltbot Agent Name Configuration Prompt | ~402 |
|
|
11
17
|
</claude-mem-context>
|
package/bin/cli.js
CHANGED
|
@@ -473,7 +473,8 @@ class SpawnAgent:
|
|
|
473
473
|
`;
|
|
474
474
|
}
|
|
475
475
|
|
|
476
|
-
function getMoltbotBridge(token, agentName) {
|
|
476
|
+
function getMoltbotBridge(token, agentName, moltbotAgent = '') {
|
|
477
|
+
const agentFlag = moltbotAgent ? `, '--agent', '${moltbotAgent}'` : '';
|
|
477
478
|
return `/**
|
|
478
479
|
* Spawn.wtf → Moltbot Bridge
|
|
479
480
|
* Routes messages from Spawn iOS app to your Moltbot backend
|
|
@@ -569,15 +570,17 @@ async function askMoltbot(message) {
|
|
|
569
570
|
|
|
570
571
|
// Build command based on whether we're using npx or direct path
|
|
571
572
|
let proc;
|
|
573
|
+
const baseArgs = ['agent', '--message', message, '--thinking', 'high'${agentFlag}];
|
|
574
|
+
|
|
572
575
|
if (cmd.startsWith('npx ')) {
|
|
573
576
|
// npx moltbot or npx clawdbot
|
|
574
577
|
const pkgName = cmd.split(' ')[1];
|
|
575
|
-
proc = spawn('npx', [pkgName,
|
|
578
|
+
proc = spawn('npx', [pkgName, ...baseArgs], {
|
|
576
579
|
shell: true,
|
|
577
580
|
env: { ...process.env }
|
|
578
581
|
});
|
|
579
582
|
} else {
|
|
580
|
-
proc = spawn(cmd,
|
|
583
|
+
proc = spawn(cmd, baseArgs, {
|
|
581
584
|
shell: true,
|
|
582
585
|
env: { ...process.env }
|
|
583
586
|
});
|
|
@@ -653,7 +656,7 @@ process.on('SIGINT', () => { ws?.close(); process.exit(0); });
|
|
|
653
656
|
`;
|
|
654
657
|
}
|
|
655
658
|
|
|
656
|
-
async function createSkillFiles(token, agentName, language
|
|
659
|
+
async function createSkillFiles(token, agentName, language) {
|
|
657
660
|
const skillDir = path.join(process.cwd(), 'spawn');
|
|
658
661
|
|
|
659
662
|
// Create spawn directory
|
|
@@ -675,11 +678,7 @@ async function createSkillFiles(token, agentName, language, useMoltbot = false)
|
|
|
675
678
|
|
|
676
679
|
if (language === 'typescript') {
|
|
677
680
|
// TypeScript/Node setup
|
|
678
|
-
|
|
679
|
-
fs.writeFileSync(path.join(skillDir, 'connect.js'), getMoltbotBridge(token, agentName));
|
|
680
|
-
} else {
|
|
681
|
-
fs.writeFileSync(path.join(skillDir, 'connect.js'), getTypeScriptConnector(token, agentName));
|
|
682
|
-
}
|
|
681
|
+
fs.writeFileSync(path.join(skillDir, 'connect.js'), getTypeScriptConnector(token, agentName));
|
|
683
682
|
|
|
684
683
|
const packageJson = {
|
|
685
684
|
name: "spawn-agent",
|
|
@@ -698,7 +697,7 @@ async function createSkillFiles(token, agentName, language, useMoltbot = false)
|
|
|
698
697
|
fs.writeFileSync(path.join(skillDir, 'requirements.txt'), 'websockets>=12.0\n');
|
|
699
698
|
}
|
|
700
699
|
|
|
701
|
-
return { skillDir, language
|
|
700
|
+
return { skillDir, language };
|
|
702
701
|
}
|
|
703
702
|
|
|
704
703
|
async function main() {
|
|
@@ -762,74 +761,18 @@ async function main() {
|
|
|
762
761
|
});
|
|
763
762
|
}
|
|
764
763
|
|
|
765
|
-
questions.push({
|
|
766
|
-
type: 'confirm',
|
|
767
|
-
name: 'useMoltbot',
|
|
768
|
-
message: 'Use Moltbot as your AI backend? (recommended)',
|
|
769
|
-
default: false
|
|
770
|
-
});
|
|
771
|
-
|
|
772
764
|
const answers = await inquirer.prompt(questions);
|
|
773
765
|
|
|
774
766
|
token = token || answers.token;
|
|
775
767
|
agentName = answers.agentName || agentName;
|
|
776
768
|
language = language || answers.language;
|
|
777
|
-
const useMoltbot = answers.useMoltbot || false;
|
|
778
769
|
|
|
779
770
|
console.log('');
|
|
780
771
|
|
|
781
|
-
// Check for Moltbot if needed (also check old name 'clawdbot')
|
|
782
|
-
if (useMoltbot) {
|
|
783
|
-
const moltbotCheck = ora('Checking for Moltbot...').start();
|
|
784
|
-
let moltbotFound = false;
|
|
785
|
-
let foundName = null;
|
|
786
|
-
const { execSync } = await import('child_process');
|
|
787
|
-
const os = await import('os');
|
|
788
|
-
|
|
789
|
-
// Try both names
|
|
790
|
-
const names = ['moltbot', 'clawdbot'];
|
|
791
|
-
|
|
792
|
-
for (const name of names) {
|
|
793
|
-
if (moltbotFound) break;
|
|
794
|
-
|
|
795
|
-
const candidates = [
|
|
796
|
-
`${name} --version`,
|
|
797
|
-
`npx ${name} --version`,
|
|
798
|
-
`"${path.join(os.homedir(), '.npm-global', 'bin', name)}" --version`,
|
|
799
|
-
`/usr/local/bin/${name} --version`,
|
|
800
|
-
`/opt/homebrew/bin/${name} --version`,
|
|
801
|
-
];
|
|
802
|
-
|
|
803
|
-
// Also try npm prefix
|
|
804
|
-
try {
|
|
805
|
-
const npmPrefix = execSync('npm config get prefix', { encoding: 'utf8', shell: true }).trim();
|
|
806
|
-
candidates.push(`"${path.join(npmPrefix, 'bin', name)}" --version`);
|
|
807
|
-
} catch {}
|
|
808
|
-
|
|
809
|
-
for (const cmd of candidates) {
|
|
810
|
-
try {
|
|
811
|
-
execSync(cmd, { stdio: 'pipe', shell: true });
|
|
812
|
-
moltbotFound = true;
|
|
813
|
-
foundName = name;
|
|
814
|
-
break;
|
|
815
|
-
} catch {}
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
|
-
|
|
819
|
-
if (moltbotFound) {
|
|
820
|
-
moltbotCheck.succeed(foundName === 'clawdbot' ? 'Found clawdbot (old name for Moltbot)' : 'Moltbot found');
|
|
821
|
-
} else {
|
|
822
|
-
moltbotCheck.warn('Moltbot not found');
|
|
823
|
-
console.log(dim(' Install with: npm install -g moltbot@latest'));
|
|
824
|
-
console.log(dim(' Then run: moltbot onboard'));
|
|
825
|
-
console.log('');
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
|
|
829
772
|
// Create files
|
|
830
773
|
const createSpinner = ora('Creating skill files...').start();
|
|
831
774
|
try {
|
|
832
|
-
const { skillDir } = await createSkillFiles(token, agentName, language
|
|
775
|
+
const { skillDir } = await createSkillFiles(token, agentName, language);
|
|
833
776
|
createSpinner.succeed('Created skill files');
|
|
834
777
|
} catch (err) {
|
|
835
778
|
createSpinner.fail('Failed to create skill files');
|