spawn-skill 1.2.4 → 1.2.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/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
@@ -492,41 +493,46 @@ const RELAY = 'wss://spawn-relay.ngvsqdjj5r.workers.dev/v1/agent';
492
493
  let ws;
493
494
  let moltbotPath = null;
494
495
 
495
- // Find moltbot executable
496
+ // Find moltbot executable (also check for old name 'clawdbot')
496
497
  function findMoltbot() {
497
498
  if (moltbotPath) return moltbotPath;
498
499
 
499
- // Try common locations
500
- const candidates = [
501
- 'moltbot', // In PATH
502
- path.join(os.homedir(), '.npm-global', 'bin', 'moltbot'),
503
- path.join(os.homedir(), '.nvm', 'versions', 'node', process.version, 'bin', 'moltbot'),
504
- '/usr/local/bin/moltbot',
505
- '/opt/homebrew/bin/moltbot',
506
- ];
500
+ // Try both names - moltbot and clawdbot (old name)
501
+ const names = ['moltbot', 'clawdbot'];
507
502
 
508
- // Also try to get npm prefix
509
- try {
510
- const npmPrefix = execSync('npm config get prefix', { encoding: 'utf8', shell: true }).trim();
511
- candidates.push(path.join(npmPrefix, 'bin', 'moltbot'));
512
- } catch {}
503
+ for (const name of names) {
504
+ // Try common locations
505
+ const candidates = [
506
+ name, // In PATH
507
+ path.join(os.homedir(), '.npm-global', 'bin', name),
508
+ path.join(os.homedir(), '.nvm', 'versions', 'node', process.version, 'bin', name),
509
+ '/usr/local/bin/' + name,
510
+ '/opt/homebrew/bin/' + name,
511
+ ];
513
512
 
514
- for (const cmd of candidates) {
513
+ // Also try to get npm prefix
515
514
  try {
516
- execSync(\`"\${cmd}" --version\`, { stdio: 'pipe', shell: true });
517
- console.log('✓ Found moltbot at:', cmd);
518
- moltbotPath = cmd;
519
- return cmd;
515
+ const npmPrefix = execSync('npm config get prefix', { encoding: 'utf8', shell: true }).trim();
516
+ candidates.push(path.join(npmPrefix, 'bin', name));
520
517
  } catch {}
521
- }
522
518
 
523
- // Last resort: npx
524
- try {
525
- execSync('npx moltbot --version', { stdio: 'pipe', shell: true });
526
- console.log('✓ Found moltbot via npx');
527
- moltbotPath = 'npx moltbot';
528
- return 'npx moltbot';
529
- } catch {}
519
+ for (const cmd of candidates) {
520
+ try {
521
+ execSync(\`"\${cmd}" --version\`, { stdio: 'pipe', shell: true });
522
+ console.log(\`✓ Found \${name} at:\`, cmd);
523
+ moltbotPath = cmd;
524
+ return cmd;
525
+ } catch {}
526
+ }
527
+
528
+ // Try npx
529
+ try {
530
+ execSync(\`npx \${name} --version\`, { stdio: 'pipe', shell: true });
531
+ console.log(\`✓ Found \${name} via npx\`);
532
+ moltbotPath = \`npx \${name}\`;
533
+ return \`npx \${name}\`;
534
+ } catch {}
535
+ }
530
536
 
531
537
  return null;
532
538
  }
@@ -564,13 +570,17 @@ async function askMoltbot(message) {
564
570
 
565
571
  // Build command based on whether we're using npx or direct path
566
572
  let proc;
567
- if (cmd === 'npx moltbot') {
568
- proc = spawn('npx', ['moltbot', 'agent', '--message', message, '--thinking', 'high'], {
573
+ const baseArgs = ['agent', '--message', message, '--thinking', 'high'${agentFlag}];
574
+
575
+ if (cmd.startsWith('npx ')) {
576
+ // npx moltbot or npx clawdbot
577
+ const pkgName = cmd.split(' ')[1];
578
+ proc = spawn('npx', [pkgName, ...baseArgs], {
569
579
  shell: true,
570
580
  env: { ...process.env }
571
581
  });
572
582
  } else {
573
- proc = spawn(cmd, ['agent', '--message', message, '--thinking', 'high'], {
583
+ proc = spawn(cmd, baseArgs, {
574
584
  shell: true,
575
585
  env: { ...process.env }
576
586
  });
@@ -646,7 +656,7 @@ process.on('SIGINT', () => { ws?.close(); process.exit(0); });
646
656
  `;
647
657
  }
648
658
 
649
- async function createSkillFiles(token, agentName, language, useMoltbot = false) {
659
+ async function createSkillFiles(token, agentName, language, useMoltbot = false, moltbotAgent = '') {
650
660
  const skillDir = path.join(process.cwd(), 'spawn');
651
661
 
652
662
  // Create spawn directory
@@ -669,7 +679,7 @@ async function createSkillFiles(token, agentName, language, useMoltbot = false)
669
679
  if (language === 'typescript') {
670
680
  // TypeScript/Node setup
671
681
  if (useMoltbot) {
672
- fs.writeFileSync(path.join(skillDir, 'connect.js'), getMoltbotBridge(token, agentName));
682
+ fs.writeFileSync(path.join(skillDir, 'connect.js'), getMoltbotBridge(token, agentName, moltbotAgent));
673
683
  } else {
674
684
  fs.writeFileSync(path.join(skillDir, 'connect.js'), getTypeScriptConnector(token, agentName));
675
685
  }
@@ -758,7 +768,7 @@ async function main() {
758
768
  questions.push({
759
769
  type: 'confirm',
760
770
  name: 'useMoltbot',
761
- message: 'Use Moltbot as your AI backend? (recommended)',
771
+ message: 'Use Moltbot/Clawdbot as your AI backend?',
762
772
  default: false
763
773
  });
764
774
 
@@ -769,40 +779,66 @@ async function main() {
769
779
  language = language || answers.language;
770
780
  const useMoltbot = answers.useMoltbot || false;
771
781
 
782
+ // If using Moltbot, ask for the agent name
783
+ let moltbotAgent = '';
784
+ if (useMoltbot) {
785
+ const moltbotAnswers = await inquirer.prompt([{
786
+ type: 'input',
787
+ name: 'moltbotAgent',
788
+ message: 'Moltbot/Clawdbot agent name (from your config):',
789
+ default: '',
790
+ validate: (input) => {
791
+ if (!input.trim()) {
792
+ return 'Agent name is required. Check your moltbot/clawdbot config.';
793
+ }
794
+ return true;
795
+ }
796
+ }]);
797
+ moltbotAgent = moltbotAnswers.moltbotAgent;
798
+ }
799
+
772
800
  console.log('');
773
801
 
774
- // Check for Moltbot if needed
802
+ // Check for Moltbot if needed (also check old name 'clawdbot')
775
803
  if (useMoltbot) {
776
804
  const moltbotCheck = ora('Checking for Moltbot...').start();
777
805
  let moltbotFound = false;
806
+ let foundName = null;
778
807
  const { execSync } = await import('child_process');
779
808
  const os = await import('os');
780
809
 
781
- // Try multiple locations
782
- const candidates = [
783
- 'moltbot --version',
784
- 'npx moltbot --version',
785
- `"${path.join(os.homedir(), '.npm-global', 'bin', 'moltbot')}" --version`,
786
- '/usr/local/bin/moltbot --version',
787
- '/opt/homebrew/bin/moltbot --version',
788
- ];
810
+ // Try both names
811
+ const names = ['moltbot', 'clawdbot'];
789
812
 
790
- // Also try npm prefix
791
- try {
792
- const npmPrefix = execSync('npm config get prefix', { encoding: 'utf8', shell: true }).trim();
793
- candidates.push(`"${path.join(npmPrefix, 'bin', 'moltbot')}" --version`);
794
- } catch {}
813
+ for (const name of names) {
814
+ if (moltbotFound) break;
795
815
 
796
- for (const cmd of candidates) {
816
+ const candidates = [
817
+ `${name} --version`,
818
+ `npx ${name} --version`,
819
+ `"${path.join(os.homedir(), '.npm-global', 'bin', name)}" --version`,
820
+ `/usr/local/bin/${name} --version`,
821
+ `/opt/homebrew/bin/${name} --version`,
822
+ ];
823
+
824
+ // Also try npm prefix
797
825
  try {
798
- execSync(cmd, { stdio: 'pipe', shell: true });
799
- moltbotFound = true;
800
- break;
826
+ const npmPrefix = execSync('npm config get prefix', { encoding: 'utf8', shell: true }).trim();
827
+ candidates.push(`"${path.join(npmPrefix, 'bin', name)}" --version`);
801
828
  } catch {}
829
+
830
+ for (const cmd of candidates) {
831
+ try {
832
+ execSync(cmd, { stdio: 'pipe', shell: true });
833
+ moltbotFound = true;
834
+ foundName = name;
835
+ break;
836
+ } catch {}
837
+ }
802
838
  }
803
839
 
804
840
  if (moltbotFound) {
805
- moltbotCheck.succeed('Moltbot found');
841
+ moltbotCheck.succeed(foundName === 'clawdbot' ? 'Found clawdbot (old name for Moltbot)' : 'Moltbot found');
806
842
  } else {
807
843
  moltbotCheck.warn('Moltbot not found');
808
844
  console.log(dim(' Install with: npm install -g moltbot@latest'));
@@ -814,7 +850,7 @@ async function main() {
814
850
  // Create files
815
851
  const createSpinner = ora('Creating skill files...').start();
816
852
  try {
817
- const { skillDir } = await createSkillFiles(token, agentName, language, useMoltbot);
853
+ const { skillDir } = await createSkillFiles(token, agentName, language, useMoltbot, moltbotAgent);
818
854
  createSpinner.succeed('Created skill files');
819
855
  } catch (err) {
820
856
  createSpinner.fail('Failed to create skill files');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spawn-skill",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "description": "Connect your AI agent to Spawn.wtf",
5
5
  "bin": {
6
6
  "spawn-skill": "./bin/cli.js"