openclaw-messagebox-plugin 0.1.2 → 0.1.3
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/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -5
- package/dist/index.js.map +1 -1
- package/index.ts +10 -6
- package/openclaw.plugin.json +31 -1
- package/package.json +2 -2
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,GAAG,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,GAAG,EAAE,GAAG,QA2ExC"}
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import path from "path";
|
|
2
|
-
import os from "os";
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import os from "node:os";
|
|
3
3
|
/**
|
|
4
4
|
* OpenClaw MessageBox Plugin
|
|
5
5
|
* Enables secure P2P encrypted messaging and payments.
|
|
6
6
|
*/
|
|
7
7
|
export default function register(api) {
|
|
8
|
-
// Capture configuration from the gateway
|
|
9
|
-
const
|
|
8
|
+
// Capture configuration from the gateway (handle both flat and nested structures)
|
|
9
|
+
const entry = api.getConfig?.()?.plugins?.entries?.['openclaw-messagebox'] || {};
|
|
10
|
+
const pluginConfig = { ...entry, ...(entry.config || {}), ...(api.config || {}) };
|
|
10
11
|
const host = pluginConfig.host || 'https://msg.bsv.direct';
|
|
12
|
+
const network = pluginConfig.network || 'mainnet';
|
|
13
|
+
const chaintracksUrl = pluginConfig.chaintracksUrl || 'https://chaintracks-us-1.bsvb.tech';
|
|
14
|
+
const arcUrl = pluginConfig.arcUrl || '';
|
|
11
15
|
const walletDir = pluginConfig.walletDir || path.join(os.homedir(), '.openclaw', 'bsv-wallet');
|
|
12
|
-
api.logger.info(`[messagebox] Initializing MessageBox Plugin (host: ${host})`);
|
|
16
|
+
api.logger.info(`[messagebox] Initializing MessageBox Plugin (network: ${network}, host: ${host}, chaintracks: ${chaintracksUrl}, arc: ${arcUrl || 'default'})`);
|
|
13
17
|
// Register the messagebox tool
|
|
14
18
|
api.registerTool({
|
|
15
19
|
name: "messagebox",
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AAGzB;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,GAAQ;IACvC,kFAAkF;IAClF,MAAM,KAAK,GAAG,GAAG,CAAC,SAAS,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,qBAAqB,CAAC,IAAI,EAAE,CAAC;IACjF,MAAM,YAAY,GAAG,EAAE,GAAG,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE,CAAC;IAClF,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,IAAI,wBAAwB,CAAC;IAC3D,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,IAAI,SAAS,CAAC;IAClD,MAAM,cAAc,GAAG,YAAY,CAAC,cAAc,IAAI,oCAAoC,CAAC;IAC3F,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,IAAI,EAAE,CAAC;IACzC,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,IAAI,IAAI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AC;4BACR,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,UAAU,KAAK,CAAC,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE;yBACjD,CAAC;iBACH,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC,CAAC;IAEH,yDAAyD;IACzD,GAAG,CAAC,eAAe,CAAC;QAClB,EAAE,EAAE,qBAAqB;QACzB,KAAK,EAAE,KAAK,IAAI,EAAE;YAChB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAAC;YAC/D,mDAAmD;QACrD,CAAC;QACD,IAAI,EAAE,KAAK,IAAI,EAAE;YACf,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,wDAAwD,CAAC,CAAC;QAC5E,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
package/index.ts
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import path from "path";
|
|
2
|
-
import os from "os";
|
|
3
|
-
import fs from "fs";
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import os from "node:os";
|
|
3
|
+
import fs from "node:fs";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* OpenClaw MessageBox Plugin
|
|
7
7
|
* Enables secure P2P encrypted messaging and payments.
|
|
8
8
|
*/
|
|
9
9
|
export default function register(api: any) {
|
|
10
|
-
// Capture configuration from the gateway
|
|
11
|
-
const
|
|
10
|
+
// Capture configuration from the gateway (handle both flat and nested structures)
|
|
11
|
+
const entry = api.getConfig?.()?.plugins?.entries?.['openclaw-messagebox'] || {};
|
|
12
|
+
const pluginConfig = { ...entry, ...(entry.config || {}), ...(api.config || {}) };
|
|
12
13
|
const host = pluginConfig.host || 'https://msg.bsv.direct';
|
|
14
|
+
const network = pluginConfig.network || 'mainnet';
|
|
15
|
+
const chaintracksUrl = pluginConfig.chaintracksUrl || 'https://chaintracks-us-1.bsvb.tech';
|
|
16
|
+
const arcUrl = pluginConfig.arcUrl || '';
|
|
13
17
|
const walletDir = pluginConfig.walletDir || path.join(os.homedir(), '.openclaw', 'bsv-wallet');
|
|
14
18
|
|
|
15
|
-
api.logger.info(`[messagebox] Initializing MessageBox Plugin (host: ${host})`);
|
|
19
|
+
api.logger.info(`[messagebox] Initializing MessageBox Plugin (network: ${network}, host: ${host}, chaintracks: ${chaintracksUrl}, arc: ${arcUrl || 'default'})`);
|
|
16
20
|
|
|
17
21
|
// Register the messagebox tool
|
|
18
22
|
api.registerTool({
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"id": "openclaw-messagebox
|
|
2
|
+
"id": "openclaw-messagebox",
|
|
3
3
|
"name": "BSV MessageBox P2P",
|
|
4
4
|
"description": "Secure P2P encrypted messaging and payments for AI agents",
|
|
5
5
|
"version": "0.1.0",
|
|
@@ -15,6 +15,21 @@
|
|
|
15
15
|
"default": "https://msg.bsv.direct",
|
|
16
16
|
"description": "MessageBox server host URL"
|
|
17
17
|
},
|
|
18
|
+
"network": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"enum": ["mainnet", "testnet"],
|
|
21
|
+
"default": "mainnet",
|
|
22
|
+
"description": "BSV network to use"
|
|
23
|
+
},
|
|
24
|
+
"chaintracksUrl": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"default": "https://chaintracks-us-1.bsvb.tech",
|
|
27
|
+
"description": "Custom Chaintracks server URL for SPV header verification"
|
|
28
|
+
},
|
|
29
|
+
"arcUrl": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"description": "Custom ARC/Arcade server URL for transaction broadcasting"
|
|
32
|
+
},
|
|
18
33
|
"walletDir": {
|
|
19
34
|
"type": "string",
|
|
20
35
|
"description": "Path to BSV wallet storage (defaults to ~/.openclaw/bsv-wallet)"
|
|
@@ -30,6 +45,21 @@
|
|
|
30
45
|
"label": "MessageBox Host",
|
|
31
46
|
"placeholder": "https://msg.bsv.direct"
|
|
32
47
|
},
|
|
48
|
+
"network": {
|
|
49
|
+
"label": "BSV Network"
|
|
50
|
+
},
|
|
51
|
+
"chaintracksUrl": {
|
|
52
|
+
"label": "Chaintracks Server URL",
|
|
53
|
+
"placeholder": "https://chaintracks-us-1.bsvb.tech",
|
|
54
|
+
"help": "Custom server for SPV block header verification",
|
|
55
|
+
"advanced": true
|
|
56
|
+
},
|
|
57
|
+
"arcUrl": {
|
|
58
|
+
"label": "ARC/Arcade Server URL",
|
|
59
|
+
"placeholder": "https://arc.taal.com",
|
|
60
|
+
"help": "Custom server for transaction broadcasting",
|
|
61
|
+
"advanced": true
|
|
62
|
+
},
|
|
33
63
|
"walletDir": {
|
|
34
64
|
"label": "Wallet Directory",
|
|
35
65
|
"advanced": true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openclaw-messagebox-plugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "OpenClaw plugin for P2P encrypted messaging and payments via BSV MessageBox",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"dotenv": "^17.3.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@types/node": "^
|
|
29
|
+
"@types/node": "^22.10.0",
|
|
30
30
|
"typescript": "^6.0.2",
|
|
31
31
|
"eslint": "^10.1.0"
|
|
32
32
|
},
|