@infinitedusky/indusk-mcp 1.2.7 → 1.2.9

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.
@@ -204,6 +204,10 @@ export async function extensionsAdd(projectRoot, name, from) {
204
204
  catch {
205
205
  // leave as-is if parsing fails
206
206
  }
207
+ // If source is npm, install the underlying package
208
+ if (from.startsWith("npm:")) {
209
+ installNpmPackage(projectRoot, name, from.slice(4));
210
+ }
207
211
  const targetPath = join(extensionsDir(projectRoot), `${name}.json`);
208
212
  writeFileSync(targetPath, manifestContent);
209
213
  console.info(` ${name}: added from ${from}`);
@@ -230,6 +234,31 @@ export async function extensionsAdd(projectRoot, name, from) {
230
234
  // ignore parse errors
231
235
  }
232
236
  }
237
+ function installNpmPackage(projectRoot, extName, pkg) {
238
+ const pm = existsSync(join(projectRoot, "pnpm-lock.yaml"))
239
+ ? "pnpm"
240
+ : existsSync(join(projectRoot, "yarn.lock"))
241
+ ? "yarn"
242
+ : "npm";
243
+ const isWorkspace = existsSync(join(projectRoot, "pnpm-workspace.yaml"));
244
+ const addCmd = pm === "pnpm"
245
+ ? `pnpm add -D ${isWorkspace ? "-w " : ""}${pkg}@latest`
246
+ : pm === "yarn"
247
+ ? `yarn add -D ${pkg}@latest`
248
+ : `npm install -D ${pkg}@latest`;
249
+ console.info(` ${extName}: running ${addCmd}...`);
250
+ try {
251
+ execSync(addCmd, {
252
+ cwd: projectRoot,
253
+ timeout: 60000,
254
+ encoding: "utf-8",
255
+ });
256
+ console.info(` ${extName}: package installed`);
257
+ }
258
+ catch {
259
+ console.info(` ${extName}: auto-install failed. Run manually: ${addCmd}`);
260
+ }
261
+ }
233
262
  export async function extensionsRemove(projectRoot, names) {
234
263
  for (const name of names) {
235
264
  const enPath = join(extensionsDir(projectRoot), `${name}.json`);
@@ -278,30 +307,7 @@ export async function extensionsUpdate(projectRoot, names) {
278
307
  console.info(` ${name}: updating from ${source}...`);
279
308
  // If source is npm, update the installed package FIRST so we get the latest
280
309
  if (source.startsWith("npm:")) {
281
- const pkg = source.slice(4);
282
- // Detect package manager
283
- const pm = existsSync(join(projectRoot, "pnpm-lock.yaml"))
284
- ? "pnpm"
285
- : existsSync(join(projectRoot, "yarn.lock"))
286
- ? "yarn"
287
- : "npm";
288
- const addCmd = pm === "pnpm"
289
- ? `pnpm add -D ${pkg}@latest`
290
- : pm === "yarn"
291
- ? `yarn add -D ${pkg}@latest`
292
- : `npm install -D ${pkg}@latest`;
293
- console.info(` ${name}: running ${addCmd}...`);
294
- try {
295
- execSync(addCmd, {
296
- cwd: projectRoot,
297
- timeout: 60000,
298
- encoding: "utf-8",
299
- });
300
- console.info(` ${name}: package updated`);
301
- }
302
- catch {
303
- console.info(` ${name}: auto-update failed. Run manually: ${addCmd}`);
304
- }
310
+ installNpmPackage(projectRoot, name, source.slice(4));
305
311
  }
306
312
  // Then fetch the latest manifest (from the now-updated package)
307
313
  await extensionsAdd(projectRoot, name, source);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infinitedusky/indusk-mcp",
3
- "version": "1.2.7",
3
+ "version": "1.2.9",
4
4
  "description": "InDusk development system — skills, MCP tools, and CLI for structured AI-assisted development",
5
5
  "type": "module",
6
6
  "files": [