@wipcomputer/wip-ldm-os 0.3.4 → 0.3.6

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 +14 -3
  2. package/lib/deploy.mjs +31 -11
  3. package/package.json +1 -1
package/SKILL.md CHANGED
@@ -5,7 +5,7 @@ license: MIT
5
5
  interface: [cli, skill]
6
6
  metadata:
7
7
  display-name: "LDM OS"
8
- version: "0.3.4"
8
+ version: "0.3.6"
9
9
  homepage: "https://github.com/wipcomputer/wip-ldm-os"
10
10
  author: "Parker Todd Brooks"
11
11
  category: infrastructure
@@ -149,10 +149,21 @@ No manual configuration needed. Point it at a repo and it figures out the rest.
149
149
 
150
150
  ## Update
151
151
 
152
- If LDM OS is already installed:
152
+ If LDM OS is already installed, check for updates BEFORE presenting the summary to the user:
153
153
 
154
154
  ```bash
155
- ldm status # show current version and extensions
155
+ ldm --version # CLI version
156
+ ldm install --dry-run 2>&1 # shows extension update count
157
+ ```
158
+
159
+ Parse the dry-run output to count how many extensions would update. Include this in your summary:
160
+ - "22 extensions registered. 13 have updates available." (if updates exist)
161
+ - "22 extensions registered. All up to date." (if no updates)
162
+
163
+ **Do not say "up to date" if extensions have pending updates.** The CLI version can be current while extensions are behind. Always check both.
164
+
165
+ When the user wants to update:
166
+ ```bash
156
167
  ldm install # update all registered extensions
157
168
  ldm doctor # verify everything works
158
169
  ```
package/lib/deploy.mjs CHANGED
@@ -340,10 +340,37 @@ function installCLI(repoPath, door) {
340
340
  // Build if needed (fix #6)
341
341
  runBuildIfNeeded(repoPath);
342
342
 
343
+ // Prefer registry install over local install (#37).
344
+ // npm install -g . creates symlinks back to the source dir (often /tmp/).
345
+ // npm install -g @scope/pkg copies files. Only fall back to local for unpublished packages.
346
+ const packageName = pkg?.name;
347
+ const packageVersion = pkg?.version;
348
+
349
+ if (packageName && packageVersion) {
350
+ try {
351
+ // Check if this version exists on npm
352
+ const npmVersion = execSync(`npm view ${packageName}@${packageVersion} version 2>/dev/null`, {
353
+ encoding: 'utf8',
354
+ timeout: 15000,
355
+ }).trim();
356
+
357
+ if (npmVersion === packageVersion) {
358
+ // Install from registry (copies files, no symlinks)
359
+ execSync(`npm install -g ${packageName}@${packageVersion}`, { stdio: 'pipe', timeout: 60000 });
360
+ ensureBinExecutable(binNames);
361
+ ok(`CLI: ${binNames.join(', ')} installed from registry (v${packageVersion})`);
362
+ return true;
363
+ }
364
+ } catch {
365
+ // Registry check failed, fall through to local install
366
+ }
367
+ }
368
+
369
+ // Fallback: local install (creates symlinks, but better than nothing)
343
370
  try {
344
371
  execSync('npm install -g .', { cwd: repoPath, stdio: 'pipe' });
345
372
  ensureBinExecutable(binNames);
346
- ok(`CLI: ${binNames.join(', ')} installed globally`);
373
+ ok(`CLI: ${binNames.join(', ')} installed locally (symlinked)`);
347
374
  return true;
348
375
  } catch (e) {
349
376
  const stderr = e.stderr?.toString() || '';
@@ -362,19 +389,12 @@ function installCLI(repoPath, door) {
362
389
  try {
363
390
  execSync('npm install -g .', { cwd: repoPath, stdio: 'pipe' });
364
391
  ensureBinExecutable(binNames);
365
- ok(`CLI: ${binNames.join(', ')} installed globally (replaced stale symlink)`);
392
+ ok(`CLI: ${binNames.join(', ')} installed locally (replaced stale symlink)`);
366
393
  return true;
367
394
  } catch {}
368
395
  }
369
- try {
370
- execSync('npm link', { cwd: repoPath, stdio: 'pipe' });
371
- ensureBinExecutable(binNames);
372
- ok(`CLI: linked globally via npm link`);
373
- return true;
374
- } catch {
375
- fail(`CLI: install failed. Run manually: cd "${repoPath}" && npm install -g .`);
376
- return false;
377
- }
396
+ fail(`CLI: install failed. Run manually: npm install -g ${packageName || '.'}`);
397
+ return false;
378
398
  }
379
399
  }
380
400
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wipcomputer/wip-ldm-os",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
4
4
  "type": "module",
5
5
  "description": "LDM OS: identity, memory, and sovereignty infrastructure for AI agents",
6
6
  "main": "src/boot/boot-hook.mjs",