callme-openclaw-plugin 1.0.0 → 1.0.1

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/package.json +1 -1
  2. package/setup.js +18 -39
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "callme-openclaw-plugin",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "OpenClaw plugin for callme.ai - hands-free voice calls with your AI assistant",
5
5
  "main": "index.js",
6
6
  "bin": {
package/setup.js CHANGED
@@ -1,20 +1,20 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
3
  * Interactive callme.ai setup for OpenClaw
4
- * Run: npx @callme/setup
4
+ * Run: npx callme-openclaw-plugin
5
5
  */
6
6
 
7
7
  const fs = require('fs');
8
8
  const path = require('path');
9
- const https = require('https');
10
- const readline = require('readline');
11
9
  const { exec } = require('child_process');
12
10
  const { promisify } = require('util');
11
+ const readline = require('readline');
13
12
 
14
13
  const execAsync = promisify(exec);
15
14
 
16
- const PLUGIN_DIR = path.join(process.env.HOME, '.openclaw', 'plugins', 'callme');
17
- const CONFIG_FILE = path.join(process.env.HOME, '.openclaw', 'config.yaml');
15
+ const OPENCLAW_DIR = path.join(process.env.HOME, '.openclaw');
16
+ const PLUGIN_DIR = path.join(OPENCLAW_DIR, 'plugins', 'callme');
17
+ const CONFIG_FILE = path.join(OPENCLAW_DIR, 'config.yaml');
18
18
 
19
19
  const rl = readline.createInterface({
20
20
  input: process.stdin,
@@ -25,22 +25,6 @@ function question(query) {
25
25
  return new Promise(resolve => rl.question(query, resolve));
26
26
  }
27
27
 
28
- function download(url, dest) {
29
- return new Promise((resolve, reject) => {
30
- const file = fs.createWriteStream(dest);
31
- https.get(url, (response) => {
32
- response.pipe(file);
33
- file.on('finish', () => {
34
- file.close();
35
- resolve();
36
- });
37
- }).on('error', (err) => {
38
- fs.unlink(dest, () => {});
39
- reject(err);
40
- });
41
- });
42
- }
43
-
44
28
  async function main() {
45
29
  console.log('\nšŸ“ž \x1b[1mcallme.ai Setup for OpenClaw\x1b[0m\n');
46
30
 
@@ -63,27 +47,22 @@ async function main() {
63
47
  process.exit(1);
64
48
  }
65
49
 
66
- // Step 3: Download plugin
67
- console.log('\nšŸ“„ Downloading plugin...');
50
+ // Step 3: Install plugin
51
+ console.log('\nšŸ“¦ Installing plugin to OpenClaw...');
68
52
  fs.mkdirSync(PLUGIN_DIR, { recursive: true });
69
53
 
70
- const files = [
71
- { name: 'package.json', url: 'https://raw.githubusercontent.com/Benedict-VC/openclaw-voice/main/plugin-callme/package.json' },
72
- { name: 'index.js', url: 'https://raw.githubusercontent.com/Benedict-VC/openclaw-voice/main/plugin-callme/index.js' }
73
- ];
74
-
75
- for (const file of files) {
76
- await download(file.url, path.join(PLUGIN_DIR, file.name));
54
+ // Install the package directly into the plugins directory
55
+ try {
56
+ process.chdir(PLUGIN_DIR);
57
+ await execAsync('npm init -y > /dev/null 2>&1');
58
+ await execAsync('npm install callme-openclaw-plugin --save');
59
+ console.log('āœ… Plugin installed');
60
+ } catch (error) {
61
+ console.error('āŒ Failed to install plugin:', error.message);
62
+ process.exit(1);
77
63
  }
78
- console.log('āœ… Plugin downloaded');
79
-
80
- // Step 4: Install dependencies
81
- console.log('\nšŸ“¦ Installing dependencies...');
82
- process.chdir(PLUGIN_DIR);
83
- await execAsync('npm install --silent');
84
- console.log('āœ… Dependencies installed');
85
64
 
86
- // Step 5: Update config
65
+ // Step 4: Update config
87
66
  console.log('\nāš™ļø Updating OpenClaw config...');
88
67
 
89
68
  const configContent = `
@@ -115,7 +94,7 @@ plugins:
115
94
  }
116
95
  console.log('āœ… Config updated');
117
96
 
118
- // Step 6: Done!
97
+ // Done!
119
98
  console.log('\n✨ \x1b[1;32mSetup complete!\x1b[0m\n');
120
99
  console.log('šŸ“‹ Next steps:');
121
100
  console.log(' 1. Reload OpenClaw: \x1b[36mopenclaw reload\x1b[0m');