openclaw-overlay-plugin 0.7.64 → 0.7.66
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.js +2 -1
- package/dist/src/compatibility.test.d.ts +4 -0
- package/dist/src/compatibility.test.js +52 -0
- package/index.ts +2 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +2 -2
- package/src/compatibility.test.ts +57 -0
package/dist/index.js
CHANGED
|
@@ -339,6 +339,7 @@ export default function register(api) {
|
|
|
339
339
|
name: "overlay",
|
|
340
340
|
description: "BSV Overlay Marketplace commands",
|
|
341
341
|
acceptsArgs: true,
|
|
342
|
+
requireAuth: true,
|
|
342
343
|
handler: async (ctx) => {
|
|
343
344
|
try {
|
|
344
345
|
const action = ctx.args?.[0] || 'status';
|
|
@@ -377,7 +378,7 @@ export default function register(api) {
|
|
|
377
378
|
const result = await handleBalance(buildEnvironment(pluginConfig), getCliPath());
|
|
378
379
|
console.log(JSON.stringify(result, null, 2));
|
|
379
380
|
});
|
|
380
|
-
}, {
|
|
381
|
+
}, { descriptors: [{ name: "overlay", description: "BSV Overlay Network management" }] });
|
|
381
382
|
}
|
|
382
383
|
async function executeOverlayAction(params, config, api) {
|
|
383
384
|
await ensureCp();
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compatibility Test for Node 24 and OpenClaw SDK
|
|
3
|
+
*/
|
|
4
|
+
import sqlite3 from 'sqlite3';
|
|
5
|
+
import register from '../index.js';
|
|
6
|
+
async function testCompatibility() {
|
|
7
|
+
console.log('--- Overlay Compatibility Test ---');
|
|
8
|
+
// 1. Verify SQLite3 Native Bindings
|
|
9
|
+
try {
|
|
10
|
+
const db = new sqlite3.Database(':memory:');
|
|
11
|
+
console.log('✓ SQLite3 native bindings loaded successfully.');
|
|
12
|
+
db.close();
|
|
13
|
+
}
|
|
14
|
+
catch (err) {
|
|
15
|
+
console.error('✗ SQLite3 failed to load bindings:', err.message);
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
// 2. Verify Plugin Registration (SDK Descriptors)
|
|
19
|
+
let registeredCli = false;
|
|
20
|
+
let hasDescriptors = false;
|
|
21
|
+
const mockApi = {
|
|
22
|
+
logger: { info: () => { }, warn: () => { }, error: () => { } },
|
|
23
|
+
registerTool: () => { },
|
|
24
|
+
registerCommand: () => { },
|
|
25
|
+
registerService: () => { },
|
|
26
|
+
registerCli: (fn, options) => {
|
|
27
|
+
registeredCli = true;
|
|
28
|
+
if (options && options.descriptors && options.descriptors[0].name === 'overlay') {
|
|
29
|
+
hasDescriptors = true;
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
getConfig: () => ({ plugins: { entries: {} } })
|
|
33
|
+
};
|
|
34
|
+
try {
|
|
35
|
+
register(mockApi);
|
|
36
|
+
if (registeredCli && hasDescriptors) {
|
|
37
|
+
console.log('✓ CLI descriptors registered correctly for Phase 1 discovery.');
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
throw new Error(`CLI registration missing or using old 'commands' array format.`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
console.error('✗ Plugin registration failed:', err.message);
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
console.log('--- All Compatibility Tests Passed ---\n');
|
|
48
|
+
}
|
|
49
|
+
testCompatibility().catch(err => {
|
|
50
|
+
console.error(err);
|
|
51
|
+
process.exit(1);
|
|
52
|
+
});
|
package/index.ts
CHANGED
|
@@ -351,6 +351,7 @@ export default function register(api: any) {
|
|
|
351
351
|
name: "overlay",
|
|
352
352
|
description: "BSV Overlay Marketplace commands",
|
|
353
353
|
acceptsArgs: true,
|
|
354
|
+
requireAuth: true,
|
|
354
355
|
handler: async (ctx: any) => {
|
|
355
356
|
try {
|
|
356
357
|
const action = ctx.args?.[0] || 'status';
|
|
@@ -392,7 +393,7 @@ export default function register(api: any) {
|
|
|
392
393
|
const result = await handleBalance(buildEnvironment(pluginConfig), getCliPath());
|
|
393
394
|
console.log(JSON.stringify(result, null, 2));
|
|
394
395
|
});
|
|
395
|
-
}, {
|
|
396
|
+
}, { descriptors: [{ name: "overlay", description: "BSV Overlay Network management" }] });
|
|
396
397
|
}
|
|
397
398
|
|
|
398
399
|
async function executeOverlayAction(params: any, config: any, api: any) {
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openclaw-overlay-plugin",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.66",
|
|
4
4
|
"description": "Openclaw BSV Overlay — agent discovery, service marketplace, and micropayments on the BSV blockchain",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@bsv/sdk": "^2.0.13",
|
|
29
29
|
"@bsv/wallet-toolbox": "^2.1.17",
|
|
30
|
-
"sqlite3": "^
|
|
30
|
+
"sqlite3": "^6.0.1",
|
|
31
31
|
"dotenv": "^17.3.1",
|
|
32
32
|
"knex": "^3.2.8"
|
|
33
33
|
},
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compatibility Test for Node 24 and OpenClaw SDK
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import sqlite3 from 'sqlite3';
|
|
6
|
+
import register from '../index.js';
|
|
7
|
+
|
|
8
|
+
async function testCompatibility() {
|
|
9
|
+
console.log('--- Overlay Compatibility Test ---');
|
|
10
|
+
|
|
11
|
+
// 1. Verify SQLite3 Native Bindings
|
|
12
|
+
try {
|
|
13
|
+
const db = new sqlite3.Database(':memory:');
|
|
14
|
+
console.log('✓ SQLite3 native bindings loaded successfully.');
|
|
15
|
+
db.close();
|
|
16
|
+
} catch (err: any) {
|
|
17
|
+
console.error('✗ SQLite3 failed to load bindings:', err.message);
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// 2. Verify Plugin Registration (SDK Descriptors)
|
|
22
|
+
let registeredCli = false;
|
|
23
|
+
let hasDescriptors = false;
|
|
24
|
+
|
|
25
|
+
const mockApi = {
|
|
26
|
+
logger: { info: () => {}, warn: () => {}, error: () => {} },
|
|
27
|
+
registerTool: () => {},
|
|
28
|
+
registerCommand: () => {},
|
|
29
|
+
registerService: () => {},
|
|
30
|
+
registerCli: (fn: any, options: any) => {
|
|
31
|
+
registeredCli = true;
|
|
32
|
+
if (options && options.descriptors && options.descriptors[0].name === 'overlay') {
|
|
33
|
+
hasDescriptors = true;
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
getConfig: () => ({ plugins: { entries: {} } })
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
try {
|
|
40
|
+
register(mockApi);
|
|
41
|
+
if (registeredCli && hasDescriptors) {
|
|
42
|
+
console.log('✓ CLI descriptors registered correctly for Phase 1 discovery.');
|
|
43
|
+
} else {
|
|
44
|
+
throw new Error(`CLI registration missing or using old 'commands' array format.`);
|
|
45
|
+
}
|
|
46
|
+
} catch (err: any) {
|
|
47
|
+
console.error('✗ Plugin registration failed:', err.message);
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
console.log('--- All Compatibility Tests Passed ---\n');
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
testCompatibility().catch(err => {
|
|
55
|
+
console.error(err);
|
|
56
|
+
process.exit(1);
|
|
57
|
+
});
|