openclaw-messagebox-plugin 0.1.1 → 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.
@@ -0,0 +1,6 @@
1
+ /**
2
+ * OpenClaw MessageBox Plugin
3
+ * Enables secure P2P encrypted messaging and payments.
4
+ */
5
+ export default function register(api: any): void;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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,QA2ExC"}
package/dist/index.js ADDED
@@ -0,0 +1,81 @@
1
+ import path from "node:path";
2
+ import os from "node:os";
3
+ /**
4
+ * OpenClaw MessageBox Plugin
5
+ * Enables secure P2P encrypted messaging and payments.
6
+ */
7
+ export default function register(api) {
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 || {}) };
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 || '';
15
+ const walletDir = pluginConfig.walletDir || path.join(os.homedir(), '.openclaw', 'bsv-wallet');
16
+ api.logger.info(`[messagebox] Initializing MessageBox Plugin (network: ${network}, host: ${host}, chaintracks: ${chaintracksUrl}, arc: ${arcUrl || 'default'})`);
17
+ // Register the messagebox tool
18
+ api.registerTool({
19
+ name: "messagebox",
20
+ description: "Access secure P2P encrypted messaging and direct BSV payments",
21
+ parameters: {
22
+ type: "object",
23
+ properties: {
24
+ action: {
25
+ type: "string",
26
+ enum: ["send", "inbox", "pay", "acknowledge", "status"],
27
+ description: "Action to perform"
28
+ },
29
+ recipientKey: {
30
+ type: "string",
31
+ description: "Target identity public key (hex string)"
32
+ },
33
+ body: {
34
+ type: "string",
35
+ description: "Message content (will be encrypted client-side)"
36
+ },
37
+ sats: {
38
+ type: "number",
39
+ description: "Amount in satoshis for direct P2P payment"
40
+ },
41
+ messageIds: {
42
+ type: "array",
43
+ items: { type: "string" },
44
+ description: "List of message IDs to acknowledge/clear from server"
45
+ }
46
+ },
47
+ required: ["action"]
48
+ },
49
+ async execute(_id, params) {
50
+ try {
51
+ // Implementation logic will go here
52
+ return {
53
+ content: [{
54
+ type: "text",
55
+ text: `MessageBox action '${params.action}' received. (Logic implementation pending)`
56
+ }]
57
+ };
58
+ }
59
+ catch (error) {
60
+ return {
61
+ content: [{
62
+ type: "text",
63
+ text: `Error: ${error.message || String(error)}`
64
+ }]
65
+ };
66
+ }
67
+ }
68
+ });
69
+ // Register background service for live message listening
70
+ api.registerService({
71
+ id: "messagebox-listener",
72
+ start: async () => {
73
+ api.logger.info("[messagebox] Starting WebSocket listener...");
74
+ // Logic for client.listenForLiveMessages goes here
75
+ },
76
+ stop: async () => {
77
+ api.logger.info("[messagebox] Stopping MessageBox WebSocket listener...");
78
+ }
79
+ });
80
+ }
81
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,9 @@
1
+ import { MessageBoxConfig, MessageRecord } from './types.js';
2
+ export declare class MessageBoxManager {
3
+ private client;
4
+ constructor(_config: MessageBoxConfig);
5
+ send(_recipientKey: string, _body: string, _box?: string): Promise<string>;
6
+ poll(_box?: string): Promise<MessageRecord[]>;
7
+ acknowledge(_messageIds: string[]): Promise<void>;
8
+ }
9
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE7D,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,MAAM,CAAoB;gBAEtB,OAAO,EAAE,gBAAgB;IAK/B,IAAI,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,MAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAMrF,IAAI,CAAC,IAAI,GAAE,MAAkB,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAMxD,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE;CAGxC"}
@@ -0,0 +1,21 @@
1
+ export class MessageBoxManager {
2
+ client;
3
+ constructor(_config) {
4
+ // Note: MessageBoxClient requires a WalletClient/Identity
5
+ // This will be initialized in an async init method or similar
6
+ }
7
+ async send(_recipientKey, _body, _box = 'default') {
8
+ // 1. Encrypt body for recipient
9
+ // 2. Call client.sendMessage
10
+ return "msg_id";
11
+ }
12
+ async poll(_box = 'default') {
13
+ // 1. Call client.listMessages
14
+ // 2. Decrypt and format
15
+ return [];
16
+ }
17
+ async acknowledge(_messageIds) {
18
+ // Call client.acknowledgeMessage
19
+ }
20
+ }
21
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,iBAAiB;IACpB,MAAM,CAAoB;IAElC,YAAY,OAAyB;QACnC,0DAA0D;QAC1D,8DAA8D;IAChE,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,aAAqB,EAAE,KAAa,EAAE,OAAe,SAAS;QACvE,gCAAgC;QAChC,6BAA6B;QAC7B,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAAe,SAAS;QACjC,8BAA8B;QAC9B,wBAAwB;QACxB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,WAAqB;QACrC,iCAAiC;IACnC,CAAC;CACF"}
@@ -0,0 +1,10 @@
1
+ import { MessageRecord } from './types.js';
2
+ export declare class MessageStore {
3
+ private db;
4
+ constructor(dbPath: string);
5
+ init(): Promise<void>;
6
+ saveMessage(msg: MessageRecord): Promise<void>;
7
+ getInbox(limit?: number): Promise<any[]>;
8
+ markAcknowledged(ids: string[]): Promise<void>;
9
+ }
10
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/store.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,qBAAa,YAAY;IACvB,OAAO,CAAC,EAAE,CAAO;gBAEL,MAAM,EAAE,MAAM;IAWpB,IAAI;IAcJ,WAAW,CAAC,GAAG,EAAE,aAAa;IAI9B,QAAQ,CAAC,KAAK,GAAE,MAAW;IAI3B,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE;CAGrC"}
@@ -0,0 +1,39 @@
1
+ import knex from 'knex';
2
+ import path from 'path';
3
+ import fs from 'fs';
4
+ export class MessageStore {
5
+ db;
6
+ constructor(dbPath) {
7
+ const dir = path.dirname(dbPath);
8
+ if (!fs.existsSync(dir))
9
+ fs.mkdirSync(dir, { recursive: true });
10
+ this.db = knex({
11
+ client: 'better-sqlite3',
12
+ connection: { filename: dbPath },
13
+ useNullAsDefault: true
14
+ });
15
+ }
16
+ async init() {
17
+ if (!(await this.db.schema.hasTable('messages'))) {
18
+ await this.db.schema.createTable('messages', (table) => {
19
+ table.string('id').primary();
20
+ table.string('senderKey');
21
+ table.string('recipientKey');
22
+ table.text('body');
23
+ table.string('box');
24
+ table.integer('ts');
25
+ table.boolean('acknowledged').defaultTo(false);
26
+ });
27
+ }
28
+ }
29
+ async saveMessage(msg) {
30
+ await this.db('messages').insert(msg).onConflict('id').ignore();
31
+ }
32
+ async getInbox(limit = 50) {
33
+ return this.db('messages').orderBy('ts', 'desc').limit(limit);
34
+ }
35
+ async markAcknowledged(ids) {
36
+ await this.db('messages').whereIn('id', ids).update({ acknowledged: true });
37
+ }
38
+ }
39
+ //# sourceMappingURL=store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/store.ts"],"names":[],"mappings":"AAAA,OAAO,IAAc,MAAM,MAAM,CAAC;AAClC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AAGpB,MAAM,OAAO,YAAY;IACf,EAAE,CAAO;IAEjB,YAAY,MAAc;QACxB,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACjC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAEhE,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC;YACb,MAAM,EAAE,gBAAgB;YACxB,UAAU,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE;YAChC,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;YACjD,MAAM,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE;gBACrD,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;gBAC7B,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;gBAC1B,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;gBAC7B,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBACnB,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACpB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;gBACpB,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YACjD,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,GAAkB;QAClC,MAAM,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;IAClE,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,QAAgB,EAAE;QAC/B,OAAO,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAChE,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,GAAa;QAClC,MAAM,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9E,CAAC;CACF"}
@@ -0,0 +1,15 @@
1
+ export interface MessageRecord {
2
+ id: string;
3
+ senderKey: string;
4
+ recipientKey: string;
5
+ body: string;
6
+ box: string;
7
+ ts: number;
8
+ acknowledged: boolean;
9
+ }
10
+ export interface MessageBoxConfig {
11
+ host: string;
12
+ walletDir: string;
13
+ dbPath?: string;
14
+ }
15
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
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
- export default function register(api) {
10
- // Capture configuration from the gateway
11
- const pluginConfig = api.getConfig?.()?.plugins?.entries?.['openclaw-messagebox-plugin']?.config || api.config || {};
9
+ export default function register(api: any) {
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({
@@ -46,7 +50,7 @@ export default function register(api) {
46
50
  },
47
51
  required: ["action"]
48
52
  },
49
- async execute(id, params) {
53
+ async execute(_id: string, params: any) {
50
54
  try {
51
55
  // Implementation logic will go here
52
56
  return {
@@ -55,11 +59,11 @@ export default function register(api) {
55
59
  text: `MessageBox action '${params.action}' received. (Logic implementation pending)`
56
60
  }]
57
61
  };
58
- } catch (error) {
62
+ } catch (error: any) {
59
63
  return {
60
64
  content: [{
61
65
  type: "text",
62
- text: `Error: ${error.message}`
66
+ text: `Error: ${error.message || String(error)}`
63
67
  }]
64
68
  };
65
69
  }
@@ -74,7 +78,7 @@ export default function register(api) {
74
78
  // Logic for client.listenForLiveMessages goes here
75
79
  },
76
80
  stop: async () => {
77
- api.logger.info("[messagebox] Stopping WebSocket listener...");
81
+ api.logger.info("[messagebox] Stopping MessageBox WebSocket listener...");
78
82
  }
79
83
  });
80
84
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "id": "openclaw-messagebox-plugin",
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.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",
@@ -14,18 +14,19 @@
14
14
  ],
15
15
  "scripts": {
16
16
  "build": "tsc",
17
+ "prepublishOnly": "npm run build",
17
18
  "lint": "eslint src/**/*.ts",
18
19
  "test": "npx tsx src/**/*.test.ts"
19
20
  },
20
21
  "dependencies": {
21
22
  "@bsv/sdk": "^2.0.13",
22
- "@bsv/message-box-client": "^1.0.0",
23
+ "@bsv/message-box-client": "^2.0.4",
23
24
  "better-sqlite3": "^12.8.0",
24
25
  "knex": "^3.2.8",
25
26
  "dotenv": "^17.3.1"
26
27
  },
27
28
  "devDependencies": {
28
- "@types/node": "^25.5.0",
29
+ "@types/node": "^22.10.0",
29
30
  "typescript": "^6.0.2",
30
31
  "eslint": "^10.1.0"
31
32
  },
package/src/client.ts CHANGED
@@ -2,26 +2,26 @@ import { MessageBoxClient } from '@bsv/message-box-client';
2
2
  import { MessageBoxConfig, MessageRecord } from './types.js';
3
3
 
4
4
  export class MessageBoxManager {
5
- private client: MessageBoxClient;
5
+ private client!: MessageBoxClient;
6
6
 
7
- constructor(config: MessageBoxConfig) {
7
+ constructor(_config: MessageBoxConfig) {
8
8
  // Note: MessageBoxClient requires a WalletClient/Identity
9
- // This will be initialized in the setup method
9
+ // This will be initialized in an async init method or similar
10
10
  }
11
11
 
12
- async send(recipientKey: string, body: string, box: string = 'default'): Promise<string> {
12
+ async send(_recipientKey: string, _body: string, _box: string = 'default'): Promise<string> {
13
13
  // 1. Encrypt body for recipient
14
14
  // 2. Call client.sendMessage
15
15
  return "msg_id";
16
16
  }
17
17
 
18
- async poll(box: string = 'default'): Promise<MessageRecord[]> {
18
+ async poll(_box: string = 'default'): Promise<MessageRecord[]> {
19
19
  // 1. Call client.listMessages
20
20
  // 2. Decrypt and format
21
21
  return [];
22
22
  }
23
23
 
24
- async acknowledge(messageIds: string[]) {
24
+ async acknowledge(_messageIds: string[]) {
25
25
  // Call client.acknowledgeMessage
26
26
  }
27
27
  }