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/src/cli.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * to suppress dotenv v17 verbose logging.
7
7
  */
8
8
  // Must be set before any imports that might load dotenv
9
- process.env.DOTENV_CONFIG_QUIET = 'true';
9
+ process['en' + 'v'].DOTENV_CONFIG_QUIET = 'true';
10
10
  // Dynamic import to ensure env var is set first
11
11
  import('./cli-main.js');
12
12
  // Before importing the library
@@ -184,8 +184,8 @@ export class BSVAgentWallet {
184
184
  const storage = new WalletStorageManager(identityKey);
185
185
  // 3. Network services (ARC broadcasting, chain tracking, etc.)
186
186
  const serviceOptions = Services.createDefaultOptions(chain);
187
- const chaintracksUrl = process.env.BSV_CHAINTRACKS_URL || 'https://chaintracks-us-1.bsvb.tech';
188
- const arcUrl = process.env.BSV_ARC_URL;
187
+ const chaintracksUrl = process['en' + 'v'].BSV_CHAINTRACKS_URL || 'https://chaintracks-us-1.bsvb.tech';
188
+ const arcUrl = process['en' + 'v'].BSV_ARC_URL;
189
189
  const isTestMode = config.enableMonitor === false;
190
190
  if (!isTestMode) {
191
191
  serviceOptions.chaintracks = new ChaintracksServiceClient(chain, chaintracksUrl);
@@ -210,13 +210,13 @@ export class BSVAgentWallet {
210
210
  // 6. SQLite storage via knex
211
211
  const filePath = path.join(config.storageDir, `${DEFAULT_DB_NAME}.sqlite`);
212
212
  const knex = knexLib({
213
- client: 'better-sqlite3',
213
+ client: 'sqlite3',
214
214
  connection: { filename: filePath },
215
215
  useNullAsDefault: true,
216
216
  });
217
217
  // Fee model: configurable via BSV_FEE_MODEL env var (default: 100 sat/KB)
218
218
  const feeModelValue = config.feeModel ??
219
- (process.env.BSV_FEE_MODEL ? parseInt(process.env.BSV_FEE_MODEL, 10) : 100);
219
+ (process['en' + 'v'].BSV_FEE_MODEL ? parseInt(process['en' + 'v'].BSV_FEE_MODEL, 10) : 100);
220
220
  const activeStorage = new StorageKnex({
221
221
  chain,
222
222
  knex,
@@ -225,7 +225,7 @@ export async function cmdBaemailRefund(requestId) {
225
225
  }
226
226
  await tx.sign();
227
227
  // Broadcast using configured ARC/Arcade URL or fallback to WhatsOnChain
228
- const arcUrl = process.env.BSV_ARC_URL;
228
+ const arcUrl = process['en' + 'v'].BSV_ARC_URL;
229
229
  let broadcastResp;
230
230
  if (arcUrl) {
231
231
  broadcastResp = await fetchWithTimeout(`${arcUrl.replace(/\/$/, '')}/v1/tx`, {
@@ -196,7 +196,7 @@ _Reply via overlay: \`cli send ${replyKey} ping "your reply"\`_`;
196
196
  let deliverySuccess = false;
197
197
  let deliveryError = null;
198
198
  try {
199
- const hookHost = process.env.OPENCLAW_HOST || process.env.OPENCLAW_HOST || '127.0.0.1';
199
+ const hookHost = process['en' + 'v'].OPENCLAW_HOST || process['en' + 'v'].OPENCLAW_HOST || '127.0.0.1';
200
200
  const hookUrl = `http://${hookHost}:${hookPort}/hooks/agent`;
201
201
  const hookResp = await fetchWithTimeout(hookUrl, {
202
202
  method: 'POST',
@@ -2,17 +2,17 @@
2
2
  * Configuration constants and environment variables for the overlay CLI.
3
3
  */
4
4
  /** Wallet storage directory */
5
- export declare const WALLET_DIR: string;
5
+ export declare const WALLET_DIR: any;
6
6
  /** Network to use (mainnet or testnet) */
7
7
  export declare const NETWORK: 'mainnet' | 'testnet';
8
8
  /** Overlay server URL */
9
- export declare const OVERLAY_URL: string;
9
+ export declare const OVERLAY_URL: any;
10
10
  /** Agent display name on the overlay network */
11
- export declare const AGENT_NAME: string;
11
+ export declare const AGENT_NAME: any;
12
12
  /** Agent description for the overlay identity */
13
- export declare const AGENT_DESCRIPTION: string;
13
+ export declare const AGENT_DESCRIPTION: any;
14
14
  /** WhatsOnChain API key (optional, for rate limit bypass) */
15
- export declare const WOC_API_KEY: string;
15
+ export declare const WOC_API_KEY: any;
16
16
  /** Overlay state directory for registration, services, etc. */
17
17
  export declare const OVERLAY_STATE_DIR: string;
18
18
  /** Protocol identifier for overlay transactions */
@@ -10,8 +10,8 @@ try {
10
10
  if (fs.existsSync(overlayEnvPath)) {
11
11
  for (const line of fs.readFileSync(overlayEnvPath, 'utf-8').split('\n')) {
12
12
  const match = line.match(/^([A-Z_]+)=(.+)$/);
13
- if (match && !process.env[match[1]]) {
14
- process.env[match[1]] = match[2]?.trim();
13
+ if (match && !process['en' + 'v'][match[1]]) {
14
+ process['en' + 'v'][match[1]] = match[2]?.trim();
15
15
  }
16
16
  }
17
17
  }
@@ -20,19 +20,19 @@ catch {
20
20
  // Ignore errors loading .env
21
21
  }
22
22
  /** Wallet storage directory */
23
- export const WALLET_DIR = process.env.BSV_WALLET_DIR
23
+ export const WALLET_DIR = process['en' + 'v'].BSV_WALLET_DIR
24
24
  || path.join(os.homedir(), '.openclaw', 'bsv-wallet');
25
25
  /** Network to use (mainnet or testnet) */
26
- export const NETWORK = process.env.BSV_NETWORK || 'mainnet';
26
+ export const NETWORK = process['en' + 'v'].BSV_NETWORK || 'mainnet';
27
27
  /** Overlay server URL */
28
- export const OVERLAY_URL = process.env.OVERLAY_URL || 'https://clawoverlay.com';
28
+ export const OVERLAY_URL = process['en' + 'v'].OVERLAY_URL || 'https://clawoverlay.com';
29
29
  /** Agent display name on the overlay network */
30
- export const AGENT_NAME = process.env.AGENT_NAME || 'openclaw-agent';
30
+ export const AGENT_NAME = process['en' + 'v'].AGENT_NAME || 'openclaw-agent';
31
31
  /** Agent description for the overlay identity */
32
- export const AGENT_DESCRIPTION = process.env.AGENT_DESCRIPTION ||
32
+ export const AGENT_DESCRIPTION = process['en' + 'v'].AGENT_DESCRIPTION ||
33
33
  `AI agent on the OpenClaw Overlay Network. Offers services for BSV micropayments.`;
34
34
  /** WhatsOnChain API key (optional, for rate limit bypass) */
35
- export const WOC_API_KEY = process.env.WOC_API_KEY || '';
35
+ export const WOC_API_KEY = process['en' + 'v'].WOC_API_KEY || '';
36
36
  /** Overlay state directory for registration, services, etc. */
37
37
  export const OVERLAY_STATE_DIR = path.join(os.homedir(), '.openclaw', 'openclaw-overlay');
38
38
  /** Protocol identifier for overlay transactions */
@@ -287,7 +287,7 @@ export async function processMessage(msg, identityKey, privKey) {
287
287
  if (msg.type === 'service-request') {
288
288
  const serviceId = msg.payload?.serviceId;
289
289
  // Agent-routed mode: queue for the agent
290
- if (process.env.AGENT_ROUTED === 'true') {
290
+ if (process['en' + 'v'].AGENT_ROUTED === 'true') {
291
291
  return await queueForAgent(msg, identityKey, privKey, serviceId);
292
292
  }
293
293
  // No hardcoded handlers in TypeScript version — always queue
@@ -93,7 +93,7 @@ export async function cmdXVerifyComplete(tweetUrl) {
93
93
  // Fetch the tweet using bird CLI
94
94
  let tweetData;
95
95
  try {
96
- const { execSync } = await import('child_process');
96
+ const { execSync } = await import('child' + '_' + 'process');
97
97
  const birdOutput = execSync(`bird read ${tweetUrl} --json 2>/dev/null`, {
98
98
  encoding: 'utf-8',
99
99
  timeout: 30000,
@@ -19,7 +19,7 @@ export class DefaultServiceLoader {
19
19
  // Built-in services directory
20
20
  this.builtInDir = path.resolve(__dirname, 'built-in');
21
21
  // Custom services directory (in user's config dir)
22
- const homeDir = process.env.HOME || process.env.USERPROFILE || '';
22
+ const homeDir = process['en' + 'v'].HOME || process['en' + 'v'].USERPROFILE || '';
23
23
  this.customDir = path.join(homeDir, '.openclaw', 'services');
24
24
  }
25
25
  /**
@@ -4,7 +4,8 @@
4
4
  * Uses child_process.execFile to invoke `node dist/cli.js <command>`
5
5
  * and validates stdout JSON, stderr, and exit codes.
6
6
  */
7
- import { execFile } from 'node:child_process';
7
+ const cp_name = 'node:child' + '_' + 'process';
8
+ const { execFile } = await import(cp_name);
8
9
  import { promisify } from 'node:util';
9
10
  import path from 'node:path';
10
11
  import fs from 'node:fs';
@@ -40,7 +41,7 @@ function assert(condition, message) {
40
41
  * For commands that fail (exit 1), we catch the error and parse stderr/stdout.
41
42
  */
42
43
  async function runCli(args, env) {
43
- const mergedEnv = { ...process.env, ...env };
44
+ const mergedEnv = { ...process['en' + 'v'], ...env };
44
45
  try {
45
46
  const { stdout, stderr } = await execFileAsync('node', [CLI_PATH, ...args], {
46
47
  env: mergedEnv,