whazaa 0.6.41 → 0.6.43

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 (73) hide show
  1. package/dist/index.d.ts +42 -18
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +492 -342
  4. package/dist/index.js.map +1 -1
  5. package/dist/ipc-client.d.ts +6 -0
  6. package/dist/ipc-client.d.ts.map +1 -1
  7. package/dist/ipc-client.js +4 -0
  8. package/dist/ipc-client.js.map +1 -1
  9. package/dist/setup.d.ts +84 -0
  10. package/dist/setup.d.ts.map +1 -0
  11. package/dist/setup.js +269 -0
  12. package/dist/setup.js.map +1 -0
  13. package/dist/watcher/baileys.d.ts +66 -0
  14. package/dist/watcher/baileys.d.ts.map +1 -0
  15. package/dist/watcher/baileys.js +473 -0
  16. package/dist/watcher/baileys.js.map +1 -0
  17. package/dist/watcher/commands.d.ts +71 -0
  18. package/dist/watcher/commands.d.ts.map +1 -0
  19. package/dist/watcher/commands.js +459 -0
  20. package/dist/watcher/commands.js.map +1 -0
  21. package/dist/watcher/contacts.d.ts +98 -0
  22. package/dist/watcher/contacts.d.ts.map +1 -0
  23. package/dist/watcher/contacts.js +186 -0
  24. package/dist/watcher/contacts.js.map +1 -0
  25. package/dist/watcher/index.d.ts +62 -0
  26. package/dist/watcher/index.d.ts.map +1 -0
  27. package/dist/watcher/index.js +111 -0
  28. package/dist/watcher/index.js.map +1 -0
  29. package/dist/watcher/ipc-server.d.ts +69 -0
  30. package/dist/watcher/ipc-server.d.ts.map +1 -0
  31. package/dist/watcher/ipc-server.js +878 -0
  32. package/dist/watcher/ipc-server.js.map +1 -0
  33. package/dist/watcher/iterm-core.d.ts +144 -0
  34. package/dist/watcher/iterm-core.d.ts.map +1 -0
  35. package/dist/watcher/iterm-core.js +289 -0
  36. package/dist/watcher/iterm-core.js.map +1 -0
  37. package/dist/watcher/iterm-sessions.d.ts +312 -0
  38. package/dist/watcher/iterm-sessions.d.ts.map +1 -0
  39. package/dist/watcher/iterm-sessions.js +835 -0
  40. package/dist/watcher/iterm-sessions.js.map +1 -0
  41. package/dist/watcher/media.d.ts +67 -0
  42. package/dist/watcher/media.d.ts.map +1 -0
  43. package/dist/watcher/media.js +163 -0
  44. package/dist/watcher/media.js.map +1 -0
  45. package/dist/watcher/persistence.d.ts +91 -0
  46. package/dist/watcher/persistence.d.ts.map +1 -0
  47. package/dist/watcher/persistence.js +196 -0
  48. package/dist/watcher/persistence.js.map +1 -0
  49. package/dist/watcher/screenshot.d.ts +92 -0
  50. package/dist/watcher/screenshot.d.ts.map +1 -0
  51. package/dist/watcher/screenshot.js +349 -0
  52. package/dist/watcher/screenshot.js.map +1 -0
  53. package/dist/watcher/send.d.ts +49 -0
  54. package/dist/watcher/send.d.ts.map +1 -0
  55. package/dist/watcher/send.js +78 -0
  56. package/dist/watcher/send.js.map +1 -0
  57. package/dist/watcher/state.d.ts +241 -0
  58. package/dist/watcher/state.d.ts.map +1 -0
  59. package/dist/watcher/state.js +278 -0
  60. package/dist/watcher/state.js.map +1 -0
  61. package/dist/watcher/types.d.ts +138 -0
  62. package/dist/watcher/types.d.ts.map +1 -0
  63. package/dist/watcher/types.js +17 -0
  64. package/dist/watcher/types.js.map +1 -0
  65. package/dist/watcher/typing.d.ts +31 -0
  66. package/dist/watcher/typing.d.ts.map +1 -0
  67. package/dist/watcher/typing.js +65 -0
  68. package/dist/watcher/typing.js.map +1 -0
  69. package/package.json +1 -1
  70. package/dist/watch.d.ts +0 -40
  71. package/dist/watch.d.ts.map +0 -1
  72. package/dist/watch.js +0 -2968
  73. package/dist/watch.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,28 +1,52 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * index.ts — Whazaa MCP server entry point
3
+ * @module index
4
4
  *
5
- * Exposes tools over the Model Context Protocol (stdio transport):
5
+ * Whazaa MCP server entry point and tool registrations.
6
6
  *
7
- * whatsapp_status — Report connection state and phone number
8
- * whatsapp_send — Send a message to your own WhatsApp number (with optional TTS voice)
9
- * whatsapp_tts — Convert text to speech and send as a WhatsApp voice note
10
- * whatsapp_receive — Drain queued incoming messages from your phone
11
- * whatsapp_wait — Long-poll for the next incoming message
12
- * whatsapp_login — Trigger a new QR pairing flow
13
- * whatsapp_rename — Rename this Claude session (tab title + registry)
7
+ * This file is the executable that Claude Code (or any MCP host) launches to
8
+ * use Whazaa. It serves three distinct roles depending on the command-line
9
+ * argument supplied:
14
10
  *
15
- * Architecture: The MCP server is a thin IPC proxy. All WhatsApp operations
16
- * are forwarded to the watcher daemon (watch.ts) over a Unix Domain Socket
17
- * at /tmp/whazaa-watcher.sock. The watcher is the sole owner of the Baileys
18
- * connection. If the watcher is not running, tools return a clear error.
11
+ * - **MCP server mode** (default, no argument): Registers all WhatsApp tools
12
+ * over the stdio JSON-RPC transport and begins forwarding calls to the
13
+ * watcher daemon via IPC.
14
+ * - **Setup mode** (`setup`): Runs the interactive setup wizard from
15
+ * `setup.ts` (writes MCP config, installs the /name skill, pairs WhatsApp).
16
+ * - **Uninstall mode** (`uninstall`): Removes Whazaa config and credentials.
17
+ * - **Watcher mode** (`watch [sessionId]`): Starts the long-running watcher
18
+ * daemon that owns the Baileys WebSocket connection.
19
19
  *
20
- * CRITICAL: stdout is the MCP JSON-RPC transport.
21
- * - NEVER write non-JSON to stdout.
22
- * - All debug output, QR codes, and logs go to stderr.
20
+ * ### Architecture: thin IPC proxy
21
+ * The MCP server itself holds no WhatsApp state. Every tool call is forwarded
22
+ * via a Unix Domain Socket (`/tmp/whazaa-watcher.sock`) to the watcher
23
+ * daemon (`watch.ts`). The watcher is the sole owner of the Baileys connection
24
+ * and fan-out message queues. This design means multiple Claude Code tabs can
25
+ * share a single WhatsApp session without conflict.
23
26
  *
24
- * SETUP MODE: When invoked with "setup" argument, runs an interactive setup
25
- * wizard. In setup mode stdout is the terminal — console.log is safe.
27
+ * ### Tools registered
28
+ * | Tool name | Purpose |
29
+ * |------------------------|----------------------------------------------------------|
30
+ * | `whatsapp_status` | Report connection state and logged-in phone number |
31
+ * | `whatsapp_send` | Send a text or TTS voice note to self or any contact |
32
+ * | `whatsapp_tts` | Convert text to a Kokoro voice note and send it |
33
+ * | `whatsapp_send_file` | Send a file (PDF, image, video, etc.) via WhatsApp |
34
+ * | `whatsapp_receive` | Drain the queued incoming messages for this session |
35
+ * | `whatsapp_contacts` | List recently seen contacts, with optional search |
36
+ * | `whatsapp_chats` | List chat conversations (Desktop DB or Baileys fallback) |
37
+ * | `whatsapp_wait` | Long-poll for the next incoming message |
38
+ * | `whatsapp_login` | Trigger a new QR pairing flow |
39
+ * | `whatsapp_history` | Fetch message history for a chat |
40
+ * | `whatsapp_voice_config`| Get or set TTS voice mode configuration |
41
+ * | `whatsapp_speak` | Speak text aloud through the Mac's local speakers |
42
+ * | `whatsapp_rename` | Rename this Claude session (tab title + registry) |
43
+ * | `whatsapp_restart` | Restart the launchd-managed watcher service |
44
+ * | `whatsapp_discover` | Re-scan iTerm2 sessions and refresh the session registry |
45
+ *
46
+ * ### stdout constraint
47
+ * In MCP server mode, **stdout is the JSON-RPC transport**. Never write
48
+ * anything other than well-formed MCP JSON to stdout. All debug output,
49
+ * QR codes, and log lines must go to stderr.
26
50
  */
27
51
  export {};
28
52
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG"}