openclaw-overlay-plugin 0.7.41 → 0.7.42

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 CHANGED
@@ -1379,7 +1379,7 @@ function handleActivity() {
1379
1379
  const feedPath = path.join(process.env.HOME || '', '.openclaw', 'openclaw-overlay', 'activity-feed.jsonl');
1380
1380
  if (!fs.existsSync(feedPath))
1381
1381
  return { events: [], count: 0 };
1382
- const lines = fs.readFileSync(feedPath, 'utf-8').trim().split('\n').filter(Boolean);
1382
+ const lines = fs.readFileSync(feedPath, 'utf-8')?.trim().split('\n').filter(Boolean);
1383
1383
  const events = lines.map(l => { try {
1384
1384
  return JSON.parse(l);
1385
1385
  }
@@ -1448,7 +1448,7 @@ function buildEnvironment(config) {
1448
1448
  function parseCliOutput(stdout) {
1449
1449
  try {
1450
1450
  const str = typeof stdout === 'string' ? stdout : String(stdout || '');
1451
- return JSON.parse(str.trim());
1451
+ return JSON.parse(str?.trim());
1452
1452
  }
1453
1453
  catch (error) {
1454
1454
  throw new Error(`Failed to parse CLI output: ${error.message}`);
@@ -11,7 +11,7 @@ try {
11
11
  for (const line of fs.readFileSync(overlayEnvPath, 'utf-8').split('\n')) {
12
12
  const match = line.match(/^([A-Z_]+)=(.+)$/);
13
13
  if (match && !process.env[match[1]]) {
14
- process.env[match[1]] = match[2].trim();
14
+ process.env[match[1]] = match[2]?.trim();
15
15
  }
16
16
  }
17
17
  }
package/index.ts CHANGED
@@ -1560,7 +1560,7 @@ function handleActivity() {
1560
1560
  const feedPath = path.join(process.env.HOME || '', '.openclaw', 'openclaw-overlay', 'activity-feed.jsonl');
1561
1561
  if (!fs.existsSync(feedPath)) return { events: [], count: 0 };
1562
1562
 
1563
- const lines = fs.readFileSync(feedPath, 'utf-8').trim().split('\n').filter(Boolean);
1563
+ const lines = fs.readFileSync(feedPath, 'utf-8')?.trim().split('\n').filter(Boolean);
1564
1564
  const events = lines.map(l => { try { return JSON.parse(l); } catch { return null; } }).filter(Boolean);
1565
1565
 
1566
1566
  // Clear the feed after reading
@@ -1633,7 +1633,7 @@ function buildEnvironment(config: any) {
1633
1633
  function parseCliOutput(stdout: any) {
1634
1634
  try {
1635
1635
  const str = typeof stdout === 'string' ? stdout : String(stdout || '');
1636
- return JSON.parse(str.trim());
1636
+ return JSON.parse(str?.trim());
1637
1637
  } catch (error: any) {
1638
1638
  throw new Error(`Failed to parse CLI output: ${error.message}`);
1639
1639
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-overlay-plugin",
3
- "version": "0.7.41",
3
+ "version": "0.7.42",
4
4
  "description": "Openclaw BSV Overlay — agent discovery, service marketplace, and micropayments on the BSV blockchain",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -13,7 +13,7 @@ try {
13
13
  for (const line of fs.readFileSync(overlayEnvPath, 'utf-8').split('\n')) {
14
14
  const match = line.match(/^([A-Z_]+)=(.+)$/);
15
15
  if (match && !process.env[match[1]]) {
16
- process.env[match[1]] = match[2].trim();
16
+ process.env[match[1]] = match[2]?.trim();
17
17
  }
18
18
  }
19
19
  }