@awesomate/hosting-mcp 0.12.0 → 0.12.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awesomate/hosting-mcp",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "Awesomate MCP server — lets Claude manage your Awesomate WordPress hosting, plan, limits, n8n automations, and build Node/static apps + databases",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -28,9 +28,9 @@
28
28
  */
29
29
 
30
30
  import { execFileSync, spawnSync } from 'node:child_process';
31
- import { existsSync, mkdirSync, writeFileSync, chmodSync, readFileSync, cpSync, readdirSync, renameSync, statSync } from 'node:fs';
31
+ import { existsSync, mkdirSync, writeFileSync, chmodSync, readFileSync, cpSync, readdirSync, renameSync, statSync, realpathSync } from 'node:fs';
32
32
  import { homedir, hostname } from 'node:os';
33
- import { join, dirname, resolve } from 'node:path';
33
+ import { join, dirname, resolve, basename } from 'node:path';
34
34
  import { fileURLToPath } from 'node:url';
35
35
 
36
36
  function arg(name, fallback) {
@@ -273,19 +273,25 @@ function writePin(slug) {
273
273
  * failure here never aborts the rest of setup.
274
274
  */
275
275
  function installSkill() {
276
- const hostingSkill = dirname(dirname(fileURLToPath(import.meta.url)));
276
+ // realpathSync: npx runs the bin through a symlink (or a shim on Windows)
277
+ // resolve to the file's true location inside the package before walking up,
278
+ // or the walk lands in the npx cache's .bin dir. basename() (never
279
+ // endsWith('/skill')): Windows paths use '\', which broke the layout check
280
+ // and made every Windows bootstrap report "Skill files not found".
281
+ let selfPath = fileURLToPath(import.meta.url);
282
+ try { selfPath = realpathSync(selfPath); } catch { /* keep unresolved path */ }
283
+ const hostingSkill = dirname(dirname(selfPath));
277
284
  const skillRoot = dirname(hostingSkill);
285
+ const isPackageLayout = basename(skillRoot) === 'skill';
278
286
  // Only the package layout (skill/<name>/) has bundled siblings; from an
279
287
  // installed copy the parent is the user's skills folder full of unrelated
280
288
  // skills, so fall back to just this skill.
281
- const bundled = skillRoot.endsWith('/skill')
282
- ? readdirSync(skillRoot)
283
- : [hostingSkill.split('/').pop()];
289
+ const bundled = isPackageLayout ? readdirSync(skillRoot) : [basename(hostingSkill)];
284
290
  // Package version, stamped into each installed skill as .installed-version.
285
291
  // The MCP server (always latest via unpinned npx) compares it against its own
286
292
  // version and reports skill.updateAvailable in awesomate_get_context.
287
293
  let pkgVersion = null;
288
- if (skillRoot.endsWith('/skill')) {
294
+ if (isPackageLayout) {
289
295
  try {
290
296
  pkgVersion = JSON.parse(readFileSync(join(dirname(skillRoot), 'package.json'), 'utf8')).version ?? null;
291
297
  } catch { /* non-fatal — marker just won't be written */ }