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.
- package/package.json +1 -1
- package/setup.js +18 -39
package/package.json
CHANGED
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
|
|
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
|
|
17
|
-
const
|
|
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:
|
|
67
|
-
console.log('\n
|
|
50
|
+
// Step 3: Install plugin
|
|
51
|
+
console.log('\nš¦ Installing plugin to OpenClaw...');
|
|
68
52
|
fs.mkdirSync(PLUGIN_DIR, { recursive: true });
|
|
69
53
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
|
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
|
-
//
|
|
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');
|