whazaa 0.6.42 → 0.6.44

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