@wipcomputer/wip-ldm-os 0.4.63 → 0.4.64

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.
Files changed (3) hide show
  1. package/SKILL.md +1 -1
  2. package/bin/ldm.js +88 -0
  3. package/package.json +1 -1
package/SKILL.md CHANGED
@@ -9,7 +9,7 @@ license: MIT
9
9
  compatibility: Requires git, npm, node. Node.js 18+.
10
10
  metadata:
11
11
  display-name: "LDM OS"
12
- version: "0.4.63"
12
+ version: "0.4.64"
13
13
  homepage: "https://github.com/wipcomputer/wip-ldm-os"
14
14
  author: "Parker Todd Brooks"
15
15
  category: infrastructure
package/bin/ldm.js CHANGED
@@ -391,6 +391,86 @@ async function installCatalogComponent(c) {
391
391
  console.log(` ✓ Installed ${c.name}`);
392
392
  }
393
393
 
394
+ // ── Bridge deploy (#245) ──
395
+ // The bridge (src/bridge/) builds to dist/bridge/ and ships in the npm package.
396
+ // After `npm install -g`, the updated files live at the npm package location but
397
+ // never get copied to ~/.ldm/extensions/lesa-bridge/dist/. This function fixes that.
398
+
399
+ function deployBridge() {
400
+ const bridgeDest = join(LDM_EXTENSIONS, 'lesa-bridge', 'dist');
401
+
402
+ // Only deploy if the extension is installed
403
+ if (!existsSync(join(LDM_EXTENSIONS, 'lesa-bridge'))) return 0;
404
+
405
+ // Find the npm package bridge files. Try require.resolve first, fall back to known path.
406
+ let bridgeSrc = '';
407
+ try {
408
+ const pkgJson = join(__dirname, '..', 'dist', 'bridge');
409
+ if (existsSync(pkgJson)) {
410
+ bridgeSrc = pkgJson;
411
+ }
412
+ } catch {}
413
+
414
+ if (!bridgeSrc) {
415
+ // Fallback: check common global npm locations
416
+ const candidates = [
417
+ '/opt/homebrew/lib/node_modules/@wipcomputer/wip-ldm-os/dist/bridge',
418
+ join(HOME, '.npm-global/lib/node_modules/@wipcomputer/wip-ldm-os/dist/bridge'),
419
+ ];
420
+ for (const c of candidates) {
421
+ if (existsSync(c)) {
422
+ bridgeSrc = c;
423
+ break;
424
+ }
425
+ }
426
+ }
427
+
428
+ if (!bridgeSrc || !existsSync(bridgeSrc)) return 0;
429
+
430
+ // Check if files differ before copying
431
+ let changed = false;
432
+ try {
433
+ const srcFiles = readdirSync(bridgeSrc).filter(f => f.endsWith('.js') || f.endsWith('.d.ts'));
434
+ for (const file of srcFiles) {
435
+ const srcPath = join(bridgeSrc, file);
436
+ const destPath = join(bridgeDest, file);
437
+ if (!existsSync(destPath)) {
438
+ changed = true;
439
+ break;
440
+ }
441
+ const srcContent = readFileSync(srcPath);
442
+ const destContent = readFileSync(destPath);
443
+ if (!srcContent.equals(destContent)) {
444
+ changed = true;
445
+ break;
446
+ }
447
+ }
448
+ } catch {
449
+ changed = true; // if comparison fails, copy anyway
450
+ }
451
+
452
+ if (!changed) return 0;
453
+
454
+ if (DRY_RUN) {
455
+ console.log(` + would deploy bridge files to ~/.ldm/extensions/lesa-bridge/dist/`);
456
+ return 0;
457
+ }
458
+
459
+ try {
460
+ mkdirSync(bridgeDest, { recursive: true });
461
+ const files = readdirSync(bridgeSrc).filter(f => f.endsWith('.js') || f.endsWith('.d.ts'));
462
+ for (const file of files) {
463
+ cpSync(join(bridgeSrc, file), join(bridgeDest, file));
464
+ }
465
+ console.log(` + bridge deployed to ~/.ldm/extensions/lesa-bridge/dist/ (${files.length} files)`);
466
+ installLog(`Bridge deployed: ${files.length} files to ~/.ldm/extensions/lesa-bridge/dist/`);
467
+ return files.length;
468
+ } catch (e) {
469
+ console.log(` ! bridge deploy failed: ${e.message}`);
470
+ return 0;
471
+ }
472
+ }
473
+
394
474
  // ── ldm init ──
395
475
 
396
476
  async function cmdInit() {
@@ -812,6 +892,9 @@ async function cmdInit() {
812
892
  }
813
893
  }
814
894
 
895
+ // Deploy bridge files to ~/.ldm/extensions/lesa-bridge/dist/ (#245)
896
+ deployBridge();
897
+
815
898
  // Clean up dead backup triggers (#207)
816
899
  // Bug: three backup systems were competing. Only ai.openclaw.ldm-backup (3am) works.
817
900
  // The old cron entry (LDMDevTools.app) and com.wipcomputer.daily-backup are dead.
@@ -1183,6 +1266,11 @@ async function cmdInstallCatalog() {
1183
1266
 
1184
1267
  autoDetectExtensions();
1185
1268
 
1269
+ // Deploy bridge files after self-update or on every catalog install (#245)
1270
+ // After npm install -g, the new bridge files are in the npm package but not
1271
+ // in ~/.ldm/extensions/lesa-bridge/dist/. This copies them.
1272
+ deployBridge();
1273
+
1186
1274
  const { detectSystemState, reconcileState, formatReconciliation } = await import('../lib/state.mjs');
1187
1275
  const state = detectSystemState();
1188
1276
  const reconciled = reconcileState(state);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wipcomputer/wip-ldm-os",
3
- "version": "0.4.63",
3
+ "version": "0.4.64",
4
4
  "type": "module",
5
5
  "description": "LDM OS: identity, memory, and sovereignty infrastructure for AI agents",
6
6
  "engines": {