openclaw-threema 0.4.5

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 aza
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,126 @@
1
+ # @openclaw/threema
2
+
3
+ Threema Gateway channel plugin for [OpenClaw](https://github.com/openclaw/openclaw) — privacy-focused E2E encrypted messaging via the [Threema Gateway API](https://gateway.threema.ch/).
4
+
5
+ ## Features
6
+
7
+ - **End-to-end encrypted** text messaging (NaCl box)
8
+ - **Media send/receive** — images, files, audio (E2E encrypted blobs)
9
+ - **Voice transcription** — automatic speech-to-text via local Whisper
10
+ - **Instant wake** — webhook-based message delivery (no polling)
11
+ - **CLI tools** — `openclaw threema send|send-file|status|keygen`
12
+
13
+ ## Requirements
14
+
15
+ - A [Threema Gateway](https://gateway.threema.ch/) account (E2E mode)
16
+ - OpenClaw v0.30+ with channel plugin support
17
+ - For voice transcription: [OpenAI Whisper](https://github.com/openai/whisper) installed locally
18
+
19
+ Please keep in mind that the use of the Threema Gateway is not for free.
20
+ At the time of writing these lines you have to pay 1.600 "Credits" to get an ID.
21
+ Every Message costs another Credit (roughly EUR 0,02).
22
+ 2.500 Credits are about EUR 55,00
23
+
24
+ ## Installation
25
+
26
+ ```bash
27
+ # From npm (when published)
28
+ npm install @openclaw/threema
29
+
30
+ # Or as a local extension
31
+ cp -r . ~/.openclaw/extensions/threema/
32
+ cd ~/.openclaw/extensions/threema && npm install
33
+ ```
34
+
35
+ Then add to your `openclaw.json`:
36
+
37
+ ```json
38
+ {
39
+ "plugins": {
40
+ "entries": {
41
+ "threema": {
42
+ "enabled": true,
43
+ "source": "~/.openclaw/extensions/threema/index.ts"
44
+ }
45
+ }
46
+ },
47
+ "channels": {
48
+ "threema": {
49
+ "enabled": true,
50
+ "gatewayId": "*YOUR_ID",
51
+ "secretKey": "your-gateway-secret",
52
+ "privateKey": "your-nacl-private-key-hex",
53
+ "dmPolicy": "allowlist",
54
+ "allowFrom": ["ABCD1234"]
55
+ }
56
+ }
57
+ }
58
+ ```
59
+
60
+ ## Setup
61
+
62
+ ### 1. Generate a key pair
63
+
64
+ ```bash
65
+ openclaw threema keygen
66
+ ```
67
+
68
+ This outputs a NaCl key pair. Add the private key to your config and upload the public key to the [Threema Gateway admin panel](https://gateway.threema.ch/).
69
+
70
+ ### 2. Configure webhook
71
+
72
+ Set your Threema Gateway webhook URL to:
73
+
74
+ ```
75
+ https://your-host:18789/threema/webhook
76
+ ```
77
+
78
+ The default port is `18789` (OpenClaw Gateway). The path matches `webhookPath` in your config (default: `/threema/webhook`).
79
+
80
+ **Note:** If you're behind a reverse proxy, adjust the URL accordingly. The plugin registers the endpoint at the configured `webhookPath`.
81
+
82
+ ### 3. Restart OpenClaw
83
+
84
+ ```bash
85
+ openclaw gateway restart
86
+ ```
87
+
88
+ ### 4. Test
89
+
90
+ ```bash
91
+ openclaw threema status
92
+ openclaw threema send ABCD1234 "Hello from OpenClaw!"
93
+ ```
94
+
95
+ ## DM Policies
96
+
97
+ | Policy | Description |
98
+ |--------|-------------|
99
+ | `allowlist` | Only IDs in `allowFrom` array (default) |
100
+ | `open` | Accept from anyone |
101
+ | `disabled` | Reject all DMs |
102
+
103
+ ## Voice Transcription
104
+
105
+ When a voice message is received, the plugin automatically transcribes it using local Whisper (no API key needed). The transcription is included in the message delivered to the agent.
106
+
107
+ Whisper must be installed and accessible in PATH (e.g., via `pip install openai-whisper` or Homebrew).
108
+
109
+ ## Message Types Supported
110
+
111
+ - **Text** (type 0x01) — bidirectional
112
+ - **File** (type 0x17) — bidirectional (images, audio, documents)
113
+ - **Delivery receipts** (type 0x80) — inbound only
114
+
115
+ ## Security
116
+
117
+ - All messages are end-to-end encrypted using NaCl (Curve25519 + XSalsa20-Poly1305)
118
+ - File blobs are encrypted with random symmetric keys (XSalsa20-Poly1305 secretbox)
119
+ - Private keys never leave the host
120
+ - Webhook verification via HMAC-SHA256 (mandatory, verified before decryption)
121
+ - SSRF protection: redirect blocking, DNS rebinding checks, private IP filtering
122
+
123
+ ## License
124
+
125
+ MIT
126
+