beecork 1.4.5 → 1.4.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.
Files changed (2) hide show
  1. package/dist/index.js +38 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -163,17 +163,48 @@ program
163
163
  });
164
164
  program
165
165
  .command('whatsapp')
166
- .description('Set up WhatsApp enter phone number, then scan QR code to pair')
167
- .action(async () => {
166
+ .description('Set up or disable WhatsApp')
167
+ .option('--disable', 'Disable WhatsApp and remove session')
168
+ .action(async (opts) => {
169
+ if (opts.disable) {
170
+ const { getConfig, saveConfig } = await import('./config.js');
171
+ const { getBeecorkHome } = await import('./util/paths.js');
172
+ const fs = await import('node:fs');
173
+ const config = getConfig();
174
+ if (config.whatsapp) {
175
+ config.whatsapp.enabled = false;
176
+ saveConfig(config);
177
+ }
178
+ // Remove session files
179
+ const sessionPath = `${getBeecorkHome()}/whatsapp-session`;
180
+ if (fs.existsSync(sessionPath)) {
181
+ fs.rmSync(sessionPath, { recursive: true, force: true });
182
+ }
183
+ console.log('✓ WhatsApp disabled and session removed.');
184
+ // Restart daemon if running
185
+ const { getDaemonPid } = await import('./cli/helpers.js');
186
+ if (getDaemonPid()) {
187
+ const { execSync } = await import('node:child_process');
188
+ try {
189
+ execSync('beecork stop', { stdio: 'ignore' });
190
+ execSync('beecork start', { stdio: 'ignore' });
191
+ console.log(' Daemon restarted.');
192
+ }
193
+ catch {
194
+ console.log(' Restart daemon: beecork stop && beecork start');
195
+ }
196
+ }
197
+ return;
198
+ }
168
199
  const readline = await import('node:readline');
169
200
  const fs = await import('node:fs');
170
201
  const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
171
202
  const ask = (q, def) => new Promise(r => rl.question(def ? `${q} [${def}]: ` : `${q}: `, a => r(a.trim() || def || '')));
172
203
  console.log('\nWhatsApp Setup\n');
173
- console.log(' WhatsApp connects via QR code scanning (like WhatsApp Web).');
174
- console.log(' After entering your phone number, a QR code will appear.');
175
- console.log(' Scan it with your phone to pair.\n');
176
- const number = await ask('Your WhatsApp phone number (e.g., 14155551234)');
204
+ console.log(' You need two WhatsApp accounts:');
205
+ console.log(' 1. A bot account (separate SIM) — will scan the QR code to pair');
206
+ console.log(' 2. Your personal number allowed to message the bot\n');
207
+ const number = await ask('Your personal WhatsApp number (the one that will message the bot, e.g., 14155551234)');
177
208
  if (!number) {
178
209
  console.log('No number provided. Cancelled.');
179
210
  rl.close();
@@ -212,7 +243,7 @@ program
212
243
  try {
213
244
  const qrcodeTerminal = await import('qrcode-terminal');
214
245
  (qrcodeTerminal.default || qrcodeTerminal).generate(update.qr, { small: true });
215
- console.log('Scan the QR code above with your phone (WhatsApp → Linked Devices → Link a Device)\n');
246
+ console.log('Scan with the BOT phone (WhatsApp → Linked Devices → Link a Device)\n');
216
247
  }
217
248
  catch {
218
249
  console.log('QR data:', update.qr);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "beecork",
3
- "version": "1.4.5",
3
+ "version": "1.4.6",
4
4
  "description": "Claude Code always-on infrastructure — a phone number, a memory, and an alarm clock",
5
5
  "type": "module",
6
6
  "bin": {