whatsapp-pi 1.0.20 → 1.0.22

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/README.md CHANGED
@@ -19,6 +19,13 @@ Pi is a powerful agentic AI coding assistant that operates in your terminal. Thi
19
19
  - **Reliable Messaging**: Queue-based message sending with retry logic
20
20
  - **TUI Integration**: Menu-driven interface for managing connections and contacts
21
21
 
22
+ ## Prerequisites
23
+
24
+ To enable audio features, you need to install OpenAI Whisper:
25
+ ```bash
26
+ python -m pip install -U openai-whisper
27
+ ```
28
+
22
29
  ## Quick Start
23
30
 
24
31
  1. Install the extension:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whatsapp-pi",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "type": "module",
5
5
  "description": "WhatsApp integration extension for Pi",
6
6
  "main": "whatsapp-pi.ts",
@@ -4,12 +4,13 @@ import { promisify } from 'node:util';
4
4
  import { writeFile, mkdir } from 'node:fs/promises';
5
5
  import { join } from 'node:path';
6
6
  import { existsSync } from 'node:fs';
7
+ import { homedir } from 'node:os';
7
8
 
8
9
  const execAsync = promisify(exec);
9
10
 
10
11
  export class AudioService {
11
- private readonly mediaDir = '/home/opc/.pi/whatsapp-medias';
12
- private readonly whisperPath = '/home/opc/.local/bin/whisper';
12
+ private readonly mediaDir = join(homedir(), '.pi', 'whatsapp-medias');
13
+ private readonly whisperPath = process.platform === 'win32' ? 'python -m whisper' : join(homedir(), '.local', 'bin', 'whisper');
13
14
 
14
15
  constructor() {
15
16
  if (!existsSync(this.mediaDir)) {
@@ -1,19 +1,17 @@
1
1
  import { useMultiFileAuthState } from '@whiskeysockets/baileys';
2
- import { join, dirname } from 'path';
3
- import { fileURLToPath } from 'url';
4
- import { rm, readFile, writeFile, mkdir } from 'fs/promises';
2
+ import { join } from 'path';
3
+ import { readFile, writeFile, mkdir, rm } from 'fs/promises';
4
+ import { homedir } from 'os';
5
5
  import { SessionStatus } from '../models/whatsapp.types.js';
6
6
 
7
- const __dirname = dirname(fileURLToPath(import.meta.url));
8
-
9
7
  export interface Contact {
10
8
  number: string;
11
9
  name?: string;
12
10
  }
13
11
 
14
12
  export class SessionManager {
15
- // Data is stored in a fixed folder inside the extension project
16
- private readonly baseDir = join(__dirname, '..', '..', '.pi-data');
13
+ // Data is stored in the user's home directory to persist across updates
14
+ private readonly baseDir = join(homedir(), '.pi', 'whatsapp-pi');
17
15
  private readonly authDir = join(this.baseDir, 'auth');
18
16
  private readonly configPath = join(this.baseDir, 'config.json');
19
17