@zbruceli/openclaw-dchat 0.1.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Zheng "Bruce" Li
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,75 @@
1
+ # openclaw-dchat
2
+
3
+ OpenClaw channel plugin for **D-Chat / nMobile** — decentralized end-to-end encrypted messaging over the [NKN](https://nkn.org) relay network.
4
+
5
+ ## Features
6
+
7
+ - Direct messages (DM) with NKN addresses
8
+ - Topic-based group chat (NKN pub/sub)
9
+ - Private group messaging
10
+ - IPFS media placeholders (image, audio, file)
11
+ - Delivery receipts
12
+ - AES-128-GCM encryption (nMobile wire format compatible)
13
+ - Multi-account support
14
+ - DM policy enforcement (pairing, allowlist, open, disabled)
15
+
16
+ ## Installation
17
+
18
+ ```bash
19
+ openclaw plugins install @zbruceli/openclaw-dchat
20
+ ```
21
+
22
+ ## Configuration
23
+
24
+ After installing, add the D-Chat channel:
25
+
26
+ ```bash
27
+ openclaw channels add dchat
28
+ ```
29
+
30
+ The onboarding wizard will prompt you for:
31
+
32
+ 1. **NKN wallet seed** — a 64-character hex string. Generate one with `nkn-sdk` or use an existing seed from D-Chat Desktop / nMobile.
33
+ 2. **DM policy** — controls who can send you direct messages:
34
+ - `pairing` (default) — new senders must be approved via pairing code
35
+ - `allowlist` — only explicitly allowed NKN addresses
36
+ - `open` — accept DMs from anyone
37
+ - `disabled` — no DMs
38
+
39
+ You can also configure via environment variables:
40
+
41
+ ```bash
42
+ export DCHAT_SEED="your-64-char-hex-wallet-seed"
43
+ ```
44
+
45
+ Or set directly in your OpenClaw config:
46
+
47
+ ```yaml
48
+ channels:
49
+ dchat:
50
+ enabled: true
51
+ seed: "your-64-char-hex-wallet-seed"
52
+ dm:
53
+ policy: pairing
54
+ ```
55
+
56
+ ## Development
57
+
58
+ ```bash
59
+ # Install dependencies
60
+ npm install
61
+
62
+ # Run tests
63
+ npm test
64
+
65
+ # Watch mode
66
+ npm run test:watch
67
+ ```
68
+
69
+ ## How it works
70
+
71
+ The plugin connects to the NKN relay network as a MultiClient node, enabling peer-to-peer messaging without centralized servers. Messages use the same wire format as D-Chat Desktop and nMobile, so you can chat between OpenClaw and any D-Chat/nMobile client.
72
+
73
+ ## License
74
+
75
+ MIT
package/index.ts ADDED
@@ -0,0 +1,17 @@
1
+ import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
2
+ import { emptyPluginConfigSchema } from "openclaw/plugin-sdk";
3
+ import { dchatPlugin } from "./src/channel.js";
4
+ import { setDchatRuntime } from "./src/runtime.js";
5
+
6
+ const plugin = {
7
+ id: "dchat",
8
+ name: "D-Chat / nMobile",
9
+ description: "D-Chat/nMobile channel plugin (NKN relay network)",
10
+ configSchema: emptyPluginConfigSchema(),
11
+ register(api: OpenClawPluginApi) {
12
+ setDchatRuntime(api.runtime);
13
+ api.registerChannel({ plugin: dchatPlugin });
14
+ },
15
+ };
16
+
17
+ export default plugin;
@@ -0,0 +1,9 @@
1
+ {
2
+ "id": "dchat",
3
+ "channels": ["dchat"],
4
+ "configSchema": {
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "properties": {}
8
+ }
9
+ }
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@zbruceli/openclaw-dchat",
3
+ "version": "0.1.0",
4
+ "description": "OpenClaw D-Chat/nMobile channel plugin — decentralized E2E encrypted messaging over the NKN relay network",
5
+ "type": "module",
6
+ "main": "index.ts",
7
+ "dependencies": {
8
+ "nkn-sdk": "^1.3.6",
9
+ "zod": "^3.24.0"
10
+ },
11
+ "peerDependencies": {
12
+ "openclaw": "*"
13
+ },
14
+ "devDependencies": {
15
+ "openclaw": "*",
16
+ "vitest": "^3.0.0",
17
+ "typescript": "^5.8.0"
18
+ },
19
+ "scripts": {
20
+ "test": "vitest run",
21
+ "test:watch": "vitest"
22
+ },
23
+ "openclaw": {
24
+ "extensions": [
25
+ "./index.ts"
26
+ ],
27
+ "channel": {
28
+ "id": "dchat",
29
+ "label": "D-Chat / nMobile",
30
+ "selectionLabel": "D-Chat (plugin)",
31
+ "docsPath": "/channels/dchat",
32
+ "docsLabel": "dchat",
33
+ "blurb": "decentralized E2E encrypted messaging over the NKN relay network.",
34
+ "order": 80,
35
+ "quickstartAllowFrom": true
36
+ },
37
+ "install": {
38
+ "npmSpec": "@zbruceli/openclaw-dchat"
39
+ }
40
+ },
41
+ "keywords": [
42
+ "openclaw",
43
+ "openclaw-plugin",
44
+ "dchat",
45
+ "nmobile",
46
+ "nkn",
47
+ "decentralized",
48
+ "e2e",
49
+ "encrypted",
50
+ "messaging"
51
+ ],
52
+ "license": "MIT",
53
+ "repository": {
54
+ "type": "git",
55
+ "url": "https://github.com/zbruceli/openclaw-dchat.git"
56
+ },
57
+ "homepage": "https://github.com/zbruceli/openclaw-dchat"
58
+ }