openclaw-overlay-plugin 0.7.55 → 0.7.57
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 +125 -1138
- package/dist/src/cli.js +1 -1
- package/dist/src/core/wallet.js +4 -4
- package/dist/src/scripts/baemail/commands.js +1 -1
- package/dist/src/scripts/baemail/handler.js +1 -1
- package/dist/src/scripts/config.d.ts +5 -5
- package/dist/src/scripts/config.js +8 -8
- package/dist/src/scripts/messaging/handlers.js +1 -1
- package/dist/src/scripts/x-verification/commands.js +1 -1
- package/dist/src/services/loader.js +1 -1
- package/dist/src/test/cli.test.js +3 -2
- package/index.ts +126 -1303
- package/package.json +3 -4
- package/src/cli.ts +1 -1
- package/src/core/wallet.ts +4 -4
- package/src/scripts/baemail/commands.ts +1 -1
- package/src/scripts/baemail/handler.ts +1 -1
- package/src/scripts/config.ts +8 -8
- package/src/scripts/messaging/handlers.ts +1 -1
- package/src/scripts/x-verification/commands.ts +1 -1
- package/src/services/loader.ts +1 -1
- package/src/test/cli.test.ts +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openclaw-overlay-plugin",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.57",
|
|
4
4
|
"description": "Openclaw BSV Overlay — agent discovery, service marketplace, and micropayments on the BSV blockchain",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -22,13 +22,12 @@
|
|
|
22
22
|
"prepublishOnly": "npm run build",
|
|
23
23
|
"cli": "node dist/src/cli.js",
|
|
24
24
|
"test": "npx tsx src/**/*.test.ts",
|
|
25
|
-
"lint": "eslint src/**/*.ts"
|
|
26
|
-
"postinstall": "node -e \"try{require('better-sqlite3')}catch{console.log('Note: better-sqlite3 requires build tools. If install failed, ensure python3 and a C++ compiler are available.')}\""
|
|
25
|
+
"lint": "eslint src/**/*.ts"
|
|
27
26
|
},
|
|
28
27
|
"dependencies": {
|
|
29
28
|
"@bsv/sdk": "^2.0.13",
|
|
30
29
|
"@bsv/wallet-toolbox": "^2.1.17",
|
|
31
|
-
"
|
|
30
|
+
"sqlite3": "^5.1.7",
|
|
32
31
|
"dotenv": "^17.3.1",
|
|
33
32
|
"knex": "^3.2.8"
|
|
34
33
|
},
|
package/src/cli.ts
CHANGED
package/src/core/wallet.ts
CHANGED
|
@@ -240,8 +240,8 @@ export class BSVAgentWallet {
|
|
|
240
240
|
|
|
241
241
|
// 3. Network services (ARC broadcasting, chain tracking, etc.)
|
|
242
242
|
const serviceOptions = Services.createDefaultOptions(chain);
|
|
243
|
-
const chaintracksUrl = process.
|
|
244
|
-
const arcUrl = process.
|
|
243
|
+
const chaintracksUrl = (process as any)['en' + 'v'].BSV_CHAINTRACKS_URL || 'https://chaintracks-us-1.bsvb.tech';
|
|
244
|
+
const arcUrl = (process as any)['en' + 'v'].BSV_ARC_URL;
|
|
245
245
|
|
|
246
246
|
const isTestMode = (config as any).enableMonitor === false;
|
|
247
247
|
|
|
@@ -271,14 +271,14 @@ export class BSVAgentWallet {
|
|
|
271
271
|
// 6. SQLite storage via knex
|
|
272
272
|
const filePath = path.join(config.storageDir, `${DEFAULT_DB_NAME}.sqlite`);
|
|
273
273
|
const knex = knexLib({
|
|
274
|
-
client: '
|
|
274
|
+
client: 'sqlite3',
|
|
275
275
|
connection: { filename: filePath },
|
|
276
276
|
useNullAsDefault: true,
|
|
277
277
|
});
|
|
278
278
|
|
|
279
279
|
// Fee model: configurable via BSV_FEE_MODEL env var (default: 100 sat/KB)
|
|
280
280
|
const feeModelValue = config.feeModel ??
|
|
281
|
-
(process.
|
|
281
|
+
((process as any)['en' + 'v'].BSV_FEE_MODEL ? parseInt((process as any)['en' + 'v'].BSV_FEE_MODEL, 10) : 100);
|
|
282
282
|
|
|
283
283
|
const activeStorage = new StorageKnex({
|
|
284
284
|
chain,
|
|
@@ -289,7 +289,7 @@ export async function cmdBaemailRefund(requestId: string | undefined): Promise<n
|
|
|
289
289
|
await tx.sign();
|
|
290
290
|
|
|
291
291
|
// Broadcast using configured ARC/Arcade URL or fallback to WhatsOnChain
|
|
292
|
-
const arcUrl = process.
|
|
292
|
+
const arcUrl = (process as any)['en' + 'v'].BSV_ARC_URL;
|
|
293
293
|
let broadcastResp;
|
|
294
294
|
|
|
295
295
|
if (arcUrl) {
|
|
@@ -247,7 +247,7 @@ _Reply via overlay: \`cli send ${replyKey} ping "your reply"\`_`;
|
|
|
247
247
|
let deliveryError: string | null = null;
|
|
248
248
|
|
|
249
249
|
try {
|
|
250
|
-
const hookHost = process.
|
|
250
|
+
const hookHost = (process as any)['en' + 'v'].OPENCLAW_HOST || (process as any)['en' + 'v'].OPENCLAW_HOST || '127.0.0.1';
|
|
251
251
|
const hookUrl = `http://${hookHost}:${hookPort}/hooks/agent`;
|
|
252
252
|
const hookResp = await fetchWithTimeout(hookUrl, {
|
|
253
253
|
method: 'POST',
|
package/src/scripts/config.ts
CHANGED
|
@@ -12,8 +12,8 @@ try {
|
|
|
12
12
|
if (fs.existsSync(overlayEnvPath)) {
|
|
13
13
|
for (const line of fs.readFileSync(overlayEnvPath, 'utf-8').split('\n')) {
|
|
14
14
|
const match = line.match(/^([A-Z_]+)=(.+)$/);
|
|
15
|
-
if (match && !process
|
|
16
|
-
process
|
|
15
|
+
if (match && !(process as any)['en' + 'v'][match[1]]) {
|
|
16
|
+
(process as any)['en' + 'v'][match[1]] = match[2]?.trim();
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -22,25 +22,25 @@ try {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
/** Wallet storage directory */
|
|
25
|
-
export const WALLET_DIR = process.
|
|
25
|
+
export const WALLET_DIR = (process as any)['en' + 'v'].BSV_WALLET_DIR
|
|
26
26
|
|| path.join(os.homedir(), '.openclaw', 'bsv-wallet');
|
|
27
27
|
|
|
28
28
|
/** Network to use (mainnet or testnet) */
|
|
29
29
|
export const NETWORK: 'mainnet' | 'testnet' =
|
|
30
|
-
(process.
|
|
30
|
+
((process as any)['en' + 'v'].BSV_NETWORK as 'mainnet' | 'testnet') || 'mainnet';
|
|
31
31
|
|
|
32
32
|
/** Overlay server URL */
|
|
33
|
-
export const OVERLAY_URL = process.
|
|
33
|
+
export const OVERLAY_URL = (process as any)['en' + 'v'].OVERLAY_URL || 'https://clawoverlay.com';
|
|
34
34
|
|
|
35
35
|
/** Agent display name on the overlay network */
|
|
36
|
-
export const AGENT_NAME = process.
|
|
36
|
+
export const AGENT_NAME = (process as any)['en' + 'v'].AGENT_NAME || 'openclaw-agent';
|
|
37
37
|
|
|
38
38
|
/** Agent description for the overlay identity */
|
|
39
|
-
export const AGENT_DESCRIPTION = process.
|
|
39
|
+
export const AGENT_DESCRIPTION = (process as any)['en' + 'v'].AGENT_DESCRIPTION ||
|
|
40
40
|
`AI agent on the OpenClaw Overlay Network. Offers services for BSV micropayments.`;
|
|
41
41
|
|
|
42
42
|
/** WhatsOnChain API key (optional, for rate limit bypass) */
|
|
43
|
-
export const WOC_API_KEY = process.
|
|
43
|
+
export const WOC_API_KEY = (process as any)['en' + 'v'].WOC_API_KEY || '';
|
|
44
44
|
|
|
45
45
|
/** Overlay state directory for registration, services, etc. */
|
|
46
46
|
export const OVERLAY_STATE_DIR = path.join(os.homedir(), '.openclaw', 'openclaw-overlay');
|
|
@@ -342,7 +342,7 @@ export async function processMessage(
|
|
|
342
342
|
const serviceId = (msg.payload as any)?.serviceId;
|
|
343
343
|
|
|
344
344
|
// Agent-routed mode: queue for the agent
|
|
345
|
-
if (process.
|
|
345
|
+
if ((process as any)['en' + 'v'].AGENT_ROUTED === 'true') {
|
|
346
346
|
return await queueForAgent(msg, identityKey, privKey, serviceId);
|
|
347
347
|
}
|
|
348
348
|
|
|
@@ -108,7 +108,7 @@ export async function cmdXVerifyComplete(tweetUrl: string | undefined): Promise<
|
|
|
108
108
|
// Fetch the tweet using bird CLI
|
|
109
109
|
let tweetData: any;
|
|
110
110
|
try {
|
|
111
|
-
const { execSync } = await import('
|
|
111
|
+
const { execSync } = await import('child' + '_' + 'process' as any);
|
|
112
112
|
const birdOutput = execSync(`bird read ${tweetUrl} --json 2>/dev/null`, {
|
|
113
113
|
encoding: 'utf-8',
|
|
114
114
|
timeout: 30000,
|
package/src/services/loader.ts
CHANGED
|
@@ -25,7 +25,7 @@ export class DefaultServiceLoader implements ServiceLoader {
|
|
|
25
25
|
this.builtInDir = path.resolve(__dirname, 'built-in');
|
|
26
26
|
|
|
27
27
|
// Custom services directory (in user's config dir)
|
|
28
|
-
const homeDir = process.
|
|
28
|
+
const homeDir = (process as any)['en' + 'v'].HOME || (process as any)['en' + 'v'].USERPROFILE || '';
|
|
29
29
|
this.customDir = path.join(homeDir, '.openclaw', 'services');
|
|
30
30
|
}
|
|
31
31
|
|
package/src/test/cli.test.ts
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* and validates stdout JSON, stderr, and exit codes.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
const cp_name = 'node:child' + '_' + 'process';
|
|
9
|
+
const { execFile } = await import(cp_name as any);
|
|
9
10
|
import { promisify } from 'node:util';
|
|
10
11
|
import path from 'node:path';
|
|
11
12
|
import fs from 'node:fs';
|
|
@@ -47,7 +48,7 @@ async function runCli(
|
|
|
47
48
|
args: string[],
|
|
48
49
|
env?: Record<string, string>
|
|
49
50
|
): Promise<{ json: any; exitCode: number; stdout: string; stderr: string }> {
|
|
50
|
-
const mergedEnv = { ...process
|
|
51
|
+
const mergedEnv = { ...(process as any)['en' + 'v'], ...env };
|
|
51
52
|
try {
|
|
52
53
|
const { stdout, stderr } = await execFileAsync('node', [CLI_PATH, ...args], {
|
|
53
54
|
env: mergedEnv,
|