meldivo 1.0.0

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 (43) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +161 -0
  3. package/THIRD_PARTY_NOTICES.md +59 -0
  4. package/bin/meldivo.mjs +514 -0
  5. package/dist/server/harnesses/claude.js +407 -0
  6. package/dist/server/harnesses/claude.js.map +1 -0
  7. package/dist/server/harnesses/index.js +27 -0
  8. package/dist/server/harnesses/index.js.map +1 -0
  9. package/dist/server/harnesses/opencode.js +391 -0
  10. package/dist/server/harnesses/opencode.js.map +1 -0
  11. package/dist/server/harnesses/pi.js +364 -0
  12. package/dist/server/harnesses/pi.js.map +1 -0
  13. package/dist/server/harnesses/types.js +2 -0
  14. package/dist/server/harnesses/types.js.map +1 -0
  15. package/dist/server/hub.js +126 -0
  16. package/dist/server/hub.js.map +1 -0
  17. package/dist/server/index.js +515 -0
  18. package/dist/server/index.js.map +1 -0
  19. package/dist/server/logger.js +98 -0
  20. package/dist/server/logger.js.map +1 -0
  21. package/dist/server/qr.js +16 -0
  22. package/dist/server/qr.js.map +1 -0
  23. package/dist/server/remote.js +166 -0
  24. package/dist/server/remote.js.map +1 -0
  25. package/dist/server/speech.js +323 -0
  26. package/dist/server/speech.js.map +1 -0
  27. package/dist/server/state.js +91 -0
  28. package/dist/server/state.js.map +1 -0
  29. package/dist/web/apple-touch-icon.png +0 -0
  30. package/dist/web/assets/_commonjsHelpers-CqkleIqs.js +1 -0
  31. package/dist/web/assets/browser-CujOq0-h.js +8 -0
  32. package/dist/web/assets/index-B1UGHGdh.css +1 -0
  33. package/dist/web/assets/index-CNq_igvY.js +43 -0
  34. package/dist/web/assets/index-CeWj4ejR.js +2948 -0
  35. package/dist/web/favicon-32.png +0 -0
  36. package/dist/web/index.html +15 -0
  37. package/dist/web/logo-192.png +0 -0
  38. package/dist/web/logo-512.png +0 -0
  39. package/dist/web/voice-assets/ort-wasm-simd-threaded.mjs +59 -0
  40. package/dist/web/voice-assets/ort-wasm-simd-threaded.wasm +0 -0
  41. package/dist/web/voice-assets/silero_vad_v5.onnx +0 -0
  42. package/dist/web/voice-assets/vad.worklet.bundle.min.js +1 -0
  43. package/package.json +78 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Amir Rouhollahi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,161 @@
1
+ # meldivo
2
+
3
+ **Always-on local voice hub for coding agents.** Install it once, and talk by
4
+ voice to your [Pi](https://pi.dev), [OpenCode](https://opencode.ai), and
5
+ [Claude Code](https://claude.com/claude-code) sessions from any browser or
6
+ phone. Speech recognition and speech synthesis run locally on your machine:
7
+ no cloud speech API, no API keys for speech, no extra LLM.
8
+
9
+ ```bash
10
+ npm i -g meldivo
11
+ meldivo start
12
+ ```
13
+
14
+ `meldivo start` installs a user service that keeps the hub running in the
15
+ background, then prints a local link and a QR code:
16
+
17
+ ```text
18
+ http://127.0.0.1:4100/#token=...
19
+ ```
20
+
21
+ Open the link (or scan the QR code) to see every Pi, OpenCode, and Claude
22
+ Code session on the machine, plus a "new chat" tile for each installed agent.
23
+ Tap any tile to start talking.
24
+
25
+ ## Features
26
+
27
+ - **One hub for every session.** The hub page lists your Pi, OpenCode, and
28
+ Claude Code sessions automatically, found from their own session files —
29
+ no plugins or extensions to install in each agent.
30
+ - **Hands-free conversation.** Your speech becomes a turn in the chosen
31
+ session, run headlessly with that session's own model and credentials.
32
+ Replies are spoken back to you.
33
+ - **Safe alongside your terminal.** If a session is already open in a
34
+ terminal, talking to it by voice continues it as a fork, so the voice
35
+ copy never conflicts with what you're typing.
36
+ - **Local, private speech.** Speech-to-text uses NVIDIA Parakeet TDT 0.6B v3
37
+ and text-to-speech uses Kokoro v1.0, both running on the CPU through
38
+ [sherpa-onnx](https://github.com/k2-fsa/sherpa-onnx). Audio never leaves
39
+ your machine unless you turn on phone access.
40
+ - **Phone and tablet access.** `meldivo remote` (or the hub's "Phone access"
41
+ panel) publishes the hub over HTTPS through Tailscale, a Cloudflare
42
+ tunnel, or your own certificate, and shows a QR code to scan.
43
+ - **Runs in the background.** A user service (systemd on Linux, launchd on
44
+ macOS) starts the hub on login and keeps it running. Models download once
45
+ on first use.
46
+ - **Secure by default.** The server listens on `127.0.0.1` only, and the
47
+ whole hub is protected by a random token embedded in its link.
48
+
49
+ ## Requirements
50
+
51
+ - Node.js 22 or later
52
+ - macOS or Linux (x64 or arm64)
53
+ - At least one of: Pi, OpenCode, Claude Code
54
+ - About 650 MB of disk space for the speech models, downloaded on first use
55
+
56
+ ## Supported agents
57
+
58
+ | Agent | Sessions found from | "Open in terminal" | Tool approvals |
59
+ |---|---|---|---|
60
+ | Pi | Pi's own session files in the home folder | A voice turn continues the session as a fork, leaving the terminal session untouched | No approval step; a denied action is announced |
61
+ | OpenCode | OpenCode's session files | A voice turn continues the session as a fork, leaving the terminal session untouched | Headless runs auto-reject actions that need approval |
62
+ | Claude Code | Claude Code's session files | A voice turn continues the session as a fork, leaving the terminal session untouched | Runs with `--permission-mode acceptEdits` |
63
+
64
+ Pi is listed first on the hub page, since it's the reference agent for this
65
+ project.
66
+
67
+ ## Commands
68
+
69
+ | Command | Description |
70
+ |---|---|
71
+ | `meldivo start` | Install (if needed) and start the background service, then print the hub link and QR code. |
72
+ | `meldivo stop` | Stop the background service. |
73
+ | `meldivo status` | Show whether the service is running and its listening address. |
74
+ | `meldivo open [--browser]` | Print the hub link, optionally opening it in a browser. |
75
+ | `meldivo remote` | Set up phone/tablet access over HTTPS. |
76
+ | `meldivo remote tailscale` | Publish the hub over Tailscale. |
77
+ | `meldivo remote cloudflare` | Publish the hub through a Cloudflare quick tunnel. |
78
+ | `meldivo remote certificate` | Publish the hub over HTTPS using your own certificate. |
79
+ | `meldivo remote stop` | Turn remote access off. |
80
+ | `meldivo logs` | Show the service's recent log output. |
81
+ | `meldivo uninstall [--purge]` | Remove the background service. `--purge` also deletes configuration, models, and logs. |
82
+ | `meldivo --version` | Print the installed version. |
83
+
84
+ ## Using it from a phone or another computer
85
+
86
+ Browsers only allow microphone access on `localhost` or over HTTPS, so
87
+ another device needs an HTTPS link. Run `meldivo remote`, or open the hub's
88
+ "Phone access" panel, to set one up:
89
+
90
+ 1. **Tailscale**: private to your own devices, works from anywhere.
91
+ 2. **Cloudflare quick tunnel**: no account needed, produces a public link
92
+ protected by its token.
93
+ 3. **Your own certificate**: HTTPS on your local network or VPN, for example
94
+ with `mkcert`.
95
+
96
+ Whichever option you pick, the link is the same hub link — the whole hub
97
+ becomes reachable from that device, protected by its token. See the
98
+ [remote access guide](docs/remote-access.md) for setup details, including
99
+ how to trust a certificate on iPhone and Android.
100
+
101
+ ## How it works
102
+
103
+ `meldivo start` installs a user service that runs the hub server on
104
+ `127.0.0.1:4100`. The hub scans each installed agent's session files to list
105
+ recent sessions and shows a "new chat" tile for each installed agent. When
106
+ you talk to a session, the hub runs that agent headlessly for one turn, using
107
+ its own model and credentials; if the session is open in a terminal, the
108
+ turn runs against a fork instead, so the terminal session is never touched.
109
+ Your speech is transcribed locally, sent to the agent as a normal user
110
+ message, and the reply is read aloud with local text-to-speech.
111
+
112
+ ## Configuration
113
+
114
+ All settings are optional.
115
+
116
+ | Variable | Default | Purpose |
117
+ |---|---|---|
118
+ | `MELDIVO_PORT` | `4100` | Port of the local server (`127.0.0.1` only). |
119
+ | `MELDIVO_HTTPS_PORT` | `4443` | HTTPS port used by the "own certificate" remote option. |
120
+ | `MELDIVO_PUBLIC_URL` | unset | Base URL to print when you run your own reverse proxy. |
121
+ | `MELDIVO_MODELS_DIR` | `~/.cache/meldivo/models` | Location of the downloaded speech models. |
122
+
123
+ ## Files and locations
124
+
125
+ | Path | Contents |
126
+ |---|---|
127
+ | `~/.config/meldivo/secret` | The hub's shared secret, generated automatically. |
128
+ | `~/.cache/meldivo/models` | Downloaded speech models. |
129
+ | `~/.local/state/meldivo` | Service logs and runtime state. |
130
+
131
+ ## Security notes
132
+
133
+ The server listens on `127.0.0.1` only; it is never exposed on the network
134
+ unless you explicitly turn on phone access. Every hub link, local or remote,
135
+ embeds a random token, and requests without it are rejected. Treat the hub
136
+ link like a password: anyone who has it can use every session in the hub.
137
+
138
+ ## Uninstall
139
+
140
+ ```bash
141
+ meldivo uninstall --purge
142
+ npm rm -g meldivo
143
+ ```
144
+
145
+ `meldivo uninstall` alone removes the background service but keeps your
146
+ configuration, models, and logs; add `--purge` to remove those too.
147
+
148
+ ## Development
149
+
150
+ ```bash
151
+ npm install
152
+ npm test
153
+ ```
154
+
155
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for the project layout and
156
+ conventions.
157
+
158
+ ## License
159
+
160
+ MIT. See [LICENSE](LICENSE). Third-party software and model licenses are
161
+ listed in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
@@ -0,0 +1,59 @@
1
+ # Third-Party Notices
2
+
3
+ meldivo is MIT-licensed, but it uses and can interoperate with software and
4
+ models under their own terms. This file identifies the material dependencies
5
+ and optional components known to this source release. It is not a replacement
6
+ for the complete license text supplied by each dependency.
7
+
8
+ ## Speech runtime
9
+
10
+ Speech-to-text and text-to-speech run locally via
11
+ [sherpa-onnx](https://github.com/k2-fsa/sherpa-onnx) (`sherpa-onnx-node`).
12
+
13
+ - [sherpa-onnx](https://github.com/k2-fsa/sherpa-onnx/blob/master/LICENSE) — Apache-2.0
14
+
15
+ Model weights are downloaded on first use and cached under
16
+ `~/.cache/meldivo/models`; they are not committed to this repository.
17
+
18
+ Speech-to-text:
19
+
20
+ - [NVIDIA Parakeet TDT 0.6B v3](https://huggingface.co/nvidia/parakeet-tdt-0.6b-v3) — CC-BY-4.0
21
+
22
+ Text-to-speech:
23
+
24
+ - [Kokoro v1.0](https://huggingface.co/hexgrad/Kokoro-82M) — Apache-2.0
25
+
26
+ ## Included web runtime components
27
+
28
+ The web application uses voice-activity detection assets copied at build time
29
+ from `@ricky0123/vad-web`, which bundles Silero VAD and runs on ONNX Runtime
30
+ Web.
31
+
32
+ - [@ricky0123/vad-web](https://www.npmjs.com/package/@ricky0123/vad-web) — ISC
33
+ - [Silero VAD](https://github.com/snakers4/silero-vad/blob/master/LICENSE) — MIT
34
+ - [ONNX Runtime Web](https://github.com/microsoft/onnxruntime/blob/main/LICENSE) — MIT
35
+
36
+ ## JavaScript and TypeScript dependencies
37
+
38
+ The exact dependency tree and resolved versions are recorded in
39
+ [`package-lock.json`](package-lock.json). License metadata and license files
40
+ are supplied by the respective npm packages. The main direct dependencies are:
41
+
42
+ - [Express](https://www.npmjs.com/package/express) — MIT
43
+ - [sherpa-onnx-node](https://www.npmjs.com/package/sherpa-onnx-node) — Apache-2.0
44
+ - [qrcode](https://www.npmjs.com/package/qrcode) — MIT
45
+ - [React](https://www.npmjs.com/package/react) and
46
+ [React DOM](https://www.npmjs.com/package/react-dom) — MIT
47
+ - [TypeScript](https://www.npmjs.com/package/typescript) — Apache-2.0
48
+ - [Vite](https://www.npmjs.com/package/vite) — MIT
49
+ - [tsx](https://www.npmjs.com/package/tsx) — MIT
50
+
51
+ Transitive dependencies remain under their original licenses.
52
+
53
+ ## External services and coding harnesses
54
+
55
+ meldivo drives [Pi](https://pi.dev), [OpenCode](https://opencode.ai), and
56
+ [Claude Code](https://claude.com/claude-code) headlessly, using each
57
+ session's own model, tools, and credentials. None of these agents are
58
+ bundled with meldivo; the user installs them separately, and their terms are
59
+ selected and operated by the user.