@wipcomputer/wip-ldm-os 0.3.6 → 0.4.0

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/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.6"
8
+ version: "0.4.0"
9
9
  homepage: "https://github.com/wipcomputer/wip-ldm-os"
10
10
  author: "Parker Todd Brooks"
11
11
  category: infrastructure
package/bin/ldm.js CHANGED
@@ -1056,6 +1056,235 @@ async function cmdUpdates() {
1056
1056
  console.log('');
1057
1057
  }
1058
1058
 
1059
+ // ── ldm stack ──
1060
+
1061
+ async function cmdStack() {
1062
+ const subcommand = args[1];
1063
+
1064
+ if (!subcommand || subcommand === 'list') {
1065
+ return cmdStackList();
1066
+ }
1067
+ if (subcommand === 'install') {
1068
+ return cmdStackInstall();
1069
+ }
1070
+
1071
+ console.error(` Unknown stack subcommand: ${subcommand}`);
1072
+ console.error(' Usage: ldm stack [list | install <name>]');
1073
+ process.exit(1);
1074
+ }
1075
+
1076
+ function loadStacks() {
1077
+ return CATALOG.stacks || {};
1078
+ }
1079
+
1080
+ function resolveStack(name) {
1081
+ const stacks = loadStacks();
1082
+ const stack = stacks[name];
1083
+ if (!stack) return null;
1084
+
1085
+ // Resolve "includes" (compose stacks from other stacks)
1086
+ let components = [...(stack.components || [])];
1087
+ let mcpServers = [...(stack.mcpServers || [])];
1088
+
1089
+ if (stack.includes) {
1090
+ for (const inc of stack.includes) {
1091
+ const sub = stacks[inc];
1092
+ if (sub) {
1093
+ components = [...(sub.components || []), ...components];
1094
+ mcpServers = [...(sub.mcpServers || []), ...mcpServers];
1095
+ }
1096
+ }
1097
+ }
1098
+
1099
+ // Deduplicate
1100
+ components = [...new Set(components)];
1101
+ const seenMcp = new Set();
1102
+ mcpServers = mcpServers.filter(m => {
1103
+ if (seenMcp.has(m.name)) return false;
1104
+ seenMcp.add(m.name);
1105
+ return true;
1106
+ });
1107
+
1108
+ return { ...stack, components, mcpServers };
1109
+ }
1110
+
1111
+ function cmdStackList() {
1112
+ const stacks = loadStacks();
1113
+
1114
+ console.log('');
1115
+ console.log(' Available Stacks');
1116
+ console.log(' ────────────────────────────────────');
1117
+
1118
+ if (Object.keys(stacks).length === 0) {
1119
+ console.log(' No stacks defined in catalog.');
1120
+ console.log('');
1121
+ return;
1122
+ }
1123
+
1124
+ for (const [id, stack] of Object.entries(stacks)) {
1125
+ const resolved = resolveStack(id);
1126
+ const compCount = resolved.components.length;
1127
+ const mcpCount = resolved.mcpServers.length;
1128
+ console.log(` ${id}: ${stack.name}`);
1129
+ console.log(` ${stack.description}`);
1130
+ console.log(` ${compCount} component(s), ${mcpCount} MCP server(s)`);
1131
+ console.log('');
1132
+ }
1133
+
1134
+ console.log(' Install: ldm stack install <name>');
1135
+ console.log(' Preview: ldm stack install <name> --dry-run');
1136
+ console.log('');
1137
+ }
1138
+
1139
+ async function cmdStackInstall() {
1140
+ const stackName = args.slice(2).find(a => !a.startsWith('--'));
1141
+
1142
+ if (!stackName) {
1143
+ console.error(' Usage: ldm stack install <name> [--dry-run]');
1144
+ console.error(' Run: ldm stack list');
1145
+ process.exit(1);
1146
+ }
1147
+
1148
+ const stack = resolveStack(stackName);
1149
+ if (!stack) {
1150
+ console.error(` Unknown stack: "${stackName}"`);
1151
+ console.error(' Run: ldm stack list');
1152
+ process.exit(1);
1153
+ }
1154
+
1155
+ console.log('');
1156
+ console.log(` Stack: ${stack.name}`);
1157
+ console.log(` ────────────────────────────────────`);
1158
+ console.log(` ${stack.description}`);
1159
+ console.log('');
1160
+
1161
+ // Check what's already installed
1162
+ const registry = readJSON(REGISTRY_PATH);
1163
+ const registeredNames = Object.keys(registry?.extensions || {});
1164
+
1165
+ const ccUserPath = join(HOME, '.claude.json');
1166
+ const ccUser = readJSON(ccUserPath);
1167
+ const registeredMcp = Object.keys(ccUser?.mcpServers || {});
1168
+
1169
+ // Components
1170
+ const componentsToInstall = [];
1171
+ const componentsInstalled = [];
1172
+ for (const compId of stack.components) {
1173
+ const entry = findInCatalog(compId);
1174
+ if (!entry) continue;
1175
+
1176
+ // Check if already installed
1177
+ const matches = entry.registryMatches || [compId];
1178
+ const installed = matches.some(m => registeredNames.includes(m));
1179
+ if (installed) {
1180
+ componentsInstalled.push(entry);
1181
+ } else {
1182
+ componentsToInstall.push(entry);
1183
+ }
1184
+ }
1185
+
1186
+ // MCP servers
1187
+ const mcpToInstall = [];
1188
+ const mcpInstalled = [];
1189
+ for (const mcp of stack.mcpServers) {
1190
+ if (registeredMcp.includes(mcp.name)) {
1191
+ mcpInstalled.push(mcp);
1192
+ } else {
1193
+ mcpToInstall.push(mcp);
1194
+ }
1195
+ }
1196
+
1197
+ // Show status
1198
+ if (componentsInstalled.length > 0) {
1199
+ console.log(` Already installed (${componentsInstalled.length}):`);
1200
+ for (const c of componentsInstalled) {
1201
+ console.log(` [x] ${c.name}`);
1202
+ }
1203
+ console.log('');
1204
+ }
1205
+
1206
+ if (mcpInstalled.length > 0) {
1207
+ console.log(` MCP servers already registered (${mcpInstalled.length}):`);
1208
+ for (const m of mcpInstalled) {
1209
+ console.log(` [x] ${m.name}`);
1210
+ }
1211
+ console.log('');
1212
+ }
1213
+
1214
+ if (componentsToInstall.length > 0) {
1215
+ console.log(` Components to install (${componentsToInstall.length}):`);
1216
+ for (const c of componentsToInstall) {
1217
+ console.log(` [ ] ${c.name} (${c.repo})`);
1218
+ }
1219
+ console.log('');
1220
+ }
1221
+
1222
+ if (mcpToInstall.length > 0) {
1223
+ console.log(` MCP servers to add (${mcpToInstall.length}):`);
1224
+ for (const m of mcpToInstall) {
1225
+ console.log(` [ ] ${m.name} (${m.command} ${m.args.join(' ')})`);
1226
+ }
1227
+ console.log('');
1228
+ }
1229
+
1230
+ if (componentsToInstall.length === 0 && mcpToInstall.length === 0) {
1231
+ console.log(' Everything in this stack is already installed.');
1232
+ console.log('');
1233
+ return;
1234
+ }
1235
+
1236
+ if (DRY_RUN) {
1237
+ console.log(` Would install ${componentsToInstall.length} component(s) and ${mcpToInstall.length} MCP server(s).`);
1238
+ console.log(' Dry run complete. No changes made.');
1239
+ console.log('');
1240
+ return;
1241
+ }
1242
+
1243
+ // Install components via ldm install
1244
+ let installed = 0;
1245
+ for (const c of componentsToInstall) {
1246
+ console.log(` Installing ${c.name}...`);
1247
+ try {
1248
+ execSync(`ldm install ${c.repo}`, { stdio: 'inherit' });
1249
+ installed++;
1250
+ } catch (e) {
1251
+ console.error(` x Failed to install ${c.name}: ${e.message}`);
1252
+ }
1253
+ }
1254
+
1255
+ // Register MCP servers
1256
+ let mcpAdded = 0;
1257
+ for (const mcp of mcpToInstall) {
1258
+ console.log(` Adding MCP: ${mcp.name}...`);
1259
+ try {
1260
+ const mcpArgs = mcp.args.map(a => `"${a}"`).join(' ');
1261
+ execSync(`claude mcp add --scope user ${mcp.name} -- ${mcp.command} ${mcpArgs}`, { stdio: 'pipe' });
1262
+ console.log(` + MCP: ${mcp.name} registered (user scope)`);
1263
+ mcpAdded++;
1264
+ } catch (e) {
1265
+ // Fallback: write directly to ~/.claude.json
1266
+ try {
1267
+ const config = readJSON(ccUserPath) || {};
1268
+ if (!config.mcpServers) config.mcpServers = {};
1269
+ config.mcpServers[mcp.name] = {
1270
+ command: mcp.command,
1271
+ args: mcp.args,
1272
+ };
1273
+ writeJSON(ccUserPath, config);
1274
+ console.log(` + MCP: ${mcp.name} registered in ~/.claude.json (fallback)`);
1275
+ mcpAdded++;
1276
+ } catch (e2) {
1277
+ console.error(` x MCP: ${mcp.name} failed: ${e2.message}`);
1278
+ }
1279
+ }
1280
+ }
1281
+
1282
+ console.log('');
1283
+ console.log(` Done. ${installed} component(s) installed, ${mcpAdded} MCP server(s) added.`);
1284
+ console.log(' Restart your session to load new MCP servers.');
1285
+ console.log('');
1286
+ }
1287
+
1059
1288
  // ── Main ──
1060
1289
 
1061
1290
  async function main() {
@@ -1075,6 +1304,8 @@ async function main() {
1075
1304
  console.log(' ldm msg send <to> <body> Send a message to a session');
1076
1305
  console.log(' ldm msg list List pending messages');
1077
1306
  console.log(' ldm msg broadcast <body> Send to all sessions');
1307
+ console.log(' ldm stack list Show available stacks');
1308
+ console.log(' ldm stack install <name> Install a stack (core, web, all)');
1078
1309
  console.log(' ldm updates Show available updates from cache');
1079
1310
  console.log(' ldm updates --check Re-check npm registry for updates');
1080
1311
  console.log('');
@@ -1125,6 +1356,9 @@ async function main() {
1125
1356
  case 'msg':
1126
1357
  await cmdMsg();
1127
1358
  break;
1359
+ case 'stack':
1360
+ await cmdStack();
1361
+ break;
1128
1362
  case 'updates':
1129
1363
  await cmdUpdates();
1130
1364
  break;
package/catalog.json CHANGED
@@ -1,5 +1,31 @@
1
1
  {
2
- "version": "0.2.0",
2
+ "version": "0.3.0",
3
+ "stacks": {
4
+ "core": {
5
+ "name": "WIP Core",
6
+ "description": "Essential tools for all WIP.computer team members.",
7
+ "components": ["memory-crystal", "wip-ai-devops-toolbox", "wip-1password", "wip-markdown-viewer"],
8
+ "mcpServers": []
9
+ },
10
+ "web": {
11
+ "name": "Web Development",
12
+ "description": "Frontend tools for Next.js, React, Tailwind projects.",
13
+ "components": [],
14
+ "mcpServers": [
15
+ { "name": "playwright", "command": "npx", "args": ["-y", "@playwright/mcp@latest", "--browser", "chromium"] },
16
+ { "name": "next-devtools", "command": "npx", "args": ["-y", "next-devtools-mcp@latest"] },
17
+ { "name": "shadcn", "command": "npx", "args": ["-y", "shadcn@latest", "mcp"] },
18
+ { "name": "tailwindcss-docs", "command": "npx", "args": ["-y", "tailwindcss-docs-mcp"] }
19
+ ]
20
+ },
21
+ "all": {
22
+ "name": "Everything",
23
+ "description": "All WIP tools + web dev stack.",
24
+ "includes": ["core", "web"],
25
+ "components": ["wip-xai-grok", "wip-xai-x"],
26
+ "mcpServers": []
27
+ }
28
+ },
3
29
  "components": [
4
30
  {
5
31
  "id": "memory-crystal",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wipcomputer/wip-ldm-os",
3
- "version": "0.3.6",
3
+ "version": "0.4.0",
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",
File without changes
File without changes
File without changes