@flareum/mcp 0.2.5 → 0.2.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.
package/dist/skill.d.ts CHANGED
@@ -7,5 +7,6 @@ export type SkillInstall = {
7
7
  reason: string;
8
8
  };
9
9
  export declare const installSkill: (cwd: string) => Promise<SkillInstall>;
10
+ export declare const installSkillFrom: (source: string, cwd: string) => Promise<SkillInstall>;
10
11
  /** Reported on stderr — stdout carries the JSON-RPC stream and must never be written to. */
11
12
  export declare const skillInstallReport: (result: SkillInstall) => string;
package/dist/skill.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { existsSync } from 'node:fs';
1
2
  import { mkdir, readdir, readFile, writeFile } from 'node:fs/promises';
2
3
  import { dirname, join } from 'node:path';
3
4
  import { fileURLToPath } from 'node:url';
@@ -14,11 +15,16 @@ const copyTree = async (from, to) => {
14
15
  };
15
16
  // Written on every start, not once: a stale copy of the rules is worse than none, and the files are
16
17
  // generated rather than hand-edited.
17
- export const installSkill = async (cwd) => {
18
- const source = join(dirname(fileURLToPath(import.meta.url)), '..', 'skill');
18
+ export const installSkill = (cwd) => installSkillFrom(join(dirname(fileURLToPath(import.meta.url)), '..', 'skill'), cwd);
19
+ // The source is a parameter so the "wrote nothing" case can be driven, not just reasoned about.
20
+ export const installSkillFrom = async (source, cwd) => {
19
21
  const path = join(cwd, ...SKILL_DIR, 'SKILL.md');
20
22
  try {
21
23
  await copyTree(source, join(cwd, ...SKILL_DIR));
24
+ // copyTree makes directories before it writes, so a source that carries none of the files still
25
+ // leaves a tree that LOOKS installed. Success is the router being on disk, not the walk ending.
26
+ if (!existsSync(path))
27
+ return { ok: false, path, reason: `nothing was written — no SKILL.md under ${source}` };
22
28
  return { ok: true, path };
23
29
  }
24
30
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flareum/mcp",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "Connect a coding agent to a Flareum project's design tokens.",
5
5
  "license": "MIT",
6
6
  "author": "Flareum",