@lumerahq/cli 0.32.5 → 0.32.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.
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
|
|
8
8
|
// src/lib/skills.ts
|
|
9
9
|
import { createHash } from "crypto";
|
|
10
|
-
import { existsSync, mkdirSync, readdirSync, readFileSync, symlinkSync, lstatSync, statSync, writeFileSync } from "fs";
|
|
10
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, realpathSync, symlinkSync, lstatSync, statSync, writeFileSync } from "fs";
|
|
11
11
|
import { join, relative } from "path";
|
|
12
12
|
import pc from "picocolors";
|
|
13
13
|
function slugToDirName(slug) {
|
|
@@ -161,19 +161,23 @@ async function installAllSkills(targetDir, options) {
|
|
|
161
161
|
}
|
|
162
162
|
var SKILLS_START_MARKER = "<!-- LUMERA_SKILLS_START -->";
|
|
163
163
|
var SKILLS_END_MARKER = "<!-- LUMERA_SKILLS_END -->";
|
|
164
|
-
function
|
|
165
|
-
const claudeMdPath = join(projectRoot, "CLAUDE.md");
|
|
164
|
+
function syncSkillDescriptions(projectRoot) {
|
|
166
165
|
const skillsDir = join(projectRoot, ".agents", "skills");
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
166
|
+
const seen = /* @__PURE__ */ new Set();
|
|
167
|
+
const files = [];
|
|
168
|
+
for (const filename of ["AGENTS.md", "CLAUDE.md"]) {
|
|
169
|
+
const filePath = join(projectRoot, filename);
|
|
170
|
+
if (!existsSync(filePath)) continue;
|
|
171
|
+
const resolvedPath = realpathSync(filePath);
|
|
172
|
+
if (seen.has(resolvedPath)) continue;
|
|
173
|
+
seen.add(resolvedPath);
|
|
174
|
+
const content = readFileSync(filePath, "utf-8");
|
|
175
|
+
const startIdx = content.indexOf(SKILLS_START_MARKER);
|
|
176
|
+
const endIdx = content.indexOf(SKILLS_END_MARKER);
|
|
177
|
+
if (startIdx === -1 || endIdx < startIdx + SKILLS_START_MARKER.length) continue;
|
|
178
|
+
files.push({ filePath, content, startIdx, endIdx });
|
|
176
179
|
}
|
|
180
|
+
if (files.length === 0) return;
|
|
177
181
|
const skillEntries = [];
|
|
178
182
|
if (existsSync(skillsDir)) {
|
|
179
183
|
for (const entry of readdirSync(skillsDir).sort()) {
|
|
@@ -205,12 +209,13 @@ function syncClaudeMd(projectRoot) {
|
|
|
205
209
|
} else {
|
|
206
210
|
generated = skillEntries.map((s) => `**${s.slug}** \u2014 ${s.summary}`).join("\n\n");
|
|
207
211
|
}
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
|
|
212
|
+
for (const { filePath, content, startIdx, endIdx } of files) {
|
|
213
|
+
const before = content.slice(0, startIdx + SKILLS_START_MARKER.length);
|
|
214
|
+
const after = content.slice(endIdx);
|
|
215
|
+
writeFileSync(filePath, `${before}
|
|
211
216
|
${generated}
|
|
212
|
-
${after}
|
|
213
|
-
|
|
217
|
+
${after}`);
|
|
218
|
+
}
|
|
214
219
|
}
|
|
215
220
|
|
|
216
221
|
export {
|
|
@@ -222,5 +227,5 @@ export {
|
|
|
222
227
|
getLocalSkills,
|
|
223
228
|
ensureSkillSymlinks,
|
|
224
229
|
installAllSkills,
|
|
225
|
-
|
|
230
|
+
syncSkillDescriptions
|
|
226
231
|
};
|
package/dist/index.js
CHANGED
|
@@ -281,7 +281,7 @@ async function main() {
|
|
|
281
281
|
break;
|
|
282
282
|
// Project
|
|
283
283
|
case "init":
|
|
284
|
-
await import("./init-
|
|
284
|
+
await import("./init-KACYHD23.js").then((m) => m.init(args.slice(1)));
|
|
285
285
|
break;
|
|
286
286
|
case "register":
|
|
287
287
|
await import("./register-ZXNNU3NJ.js").then((m) => m.register(args.slice(1)));
|
|
@@ -297,7 +297,7 @@ async function main() {
|
|
|
297
297
|
break;
|
|
298
298
|
// Skills
|
|
299
299
|
case "skills":
|
|
300
|
-
await import("./skills-
|
|
300
|
+
await import("./skills-LWOZFY5X.js").then((m) => m.skills(subcommand, args.slice(2)));
|
|
301
301
|
break;
|
|
302
302
|
// Dependencies
|
|
303
303
|
case "deps":
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
} from "./chunk-H357NP7T.js";
|
|
8
8
|
import {
|
|
9
9
|
installAllSkills,
|
|
10
|
-
|
|
11
|
-
} from "./chunk-
|
|
10
|
+
syncSkillDescriptions
|
|
11
|
+
} from "./chunk-XT3G4EDM.js";
|
|
12
12
|
import {
|
|
13
13
|
createApiClient,
|
|
14
14
|
validateProjectNameLength
|
|
@@ -72,16 +72,6 @@ function copyDir(src, dest, replacements, isRoot = true) {
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
function ensureClaudeInstructionsLink(projectRoot) {
|
|
76
|
-
const agentsMdPath = join(projectRoot, "AGENTS.md");
|
|
77
|
-
const claudeMdPath = join(projectRoot, "CLAUDE.md");
|
|
78
|
-
if (!existsSync(agentsMdPath) || existsSync(claudeMdPath)) return;
|
|
79
|
-
try {
|
|
80
|
-
symlinkSync("AGENTS.md", claudeMdPath);
|
|
81
|
-
} catch {
|
|
82
|
-
writeFileSync(claudeMdPath, readFileSync(agentsMdPath, "utf-8"));
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
75
|
function isGitInstalled() {
|
|
86
76
|
try {
|
|
87
77
|
execSync("git --version", { stdio: "ignore" });
|
|
@@ -372,7 +362,6 @@ async function init(args) {
|
|
|
372
362
|
[sourceTitle, projectTitle]
|
|
373
363
|
];
|
|
374
364
|
copyDir(templateDir, targetDir, replacements);
|
|
375
|
-
ensureClaudeInstructionsLink(targetDir);
|
|
376
365
|
const installCommand = existsSync(join(targetDir, "pnpm-lock.yaml")) ? "pnpm install --frozen-lockfile" : "pnpm install";
|
|
377
366
|
const hasPythonProject = existsSync(join(targetDir, "pyproject.toml"));
|
|
378
367
|
function listFiles(dir, prefix = "") {
|
|
@@ -438,7 +427,7 @@ async function init(args) {
|
|
|
438
427
|
} else {
|
|
439
428
|
stopSkills(pc.green("\u2713") + pc.dim(` ${installed} Lumera skills installed`));
|
|
440
429
|
}
|
|
441
|
-
|
|
430
|
+
syncSkillDescriptions(targetDir);
|
|
442
431
|
if (isGitInstalled()) {
|
|
443
432
|
try {
|
|
444
433
|
execSync('git add -A && git commit -m "chore: install lumera skills"', {
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
installAllSkills,
|
|
8
8
|
slugToDirName,
|
|
9
9
|
slugToFilename,
|
|
10
|
-
|
|
11
|
-
} from "./chunk-
|
|
10
|
+
syncSkillDescriptions
|
|
11
|
+
} from "./chunk-XT3G4EDM.js";
|
|
12
12
|
import "./chunk-JLVVHTBY.js";
|
|
13
13
|
import "./chunk-FJFIWC7G.js";
|
|
14
14
|
import "./chunk-PNKVD2UK.js";
|
|
@@ -234,7 +234,7 @@ async function install(flags) {
|
|
|
234
234
|
console.log(pc.green(" \u2713"), `Installed ${installed} skills`);
|
|
235
235
|
}
|
|
236
236
|
console.log(pc.dim(` Location: .agents/skills/`));
|
|
237
|
-
|
|
237
|
+
syncSkillDescriptions(projectRoot);
|
|
238
238
|
console.log();
|
|
239
239
|
} catch (err) {
|
|
240
240
|
console.log(pc.red(" Error:"), String(err));
|
|
@@ -282,7 +282,7 @@ async function update(args, flags) {
|
|
|
282
282
|
if (verbose && diff.unchanged.length > 0) {
|
|
283
283
|
console.log(pc.dim(` ${diff.unchanged.length} skills unchanged`));
|
|
284
284
|
}
|
|
285
|
-
|
|
285
|
+
syncSkillDescriptions(projectRoot);
|
|
286
286
|
console.log();
|
|
287
287
|
return;
|
|
288
288
|
}
|
|
@@ -369,7 +369,7 @@ async function update(args, flags) {
|
|
|
369
369
|
}
|
|
370
370
|
console.log();
|
|
371
371
|
console.log(pc.green(" \u2713"), `Update complete (${changes.join(", ")})`);
|
|
372
|
-
|
|
372
|
+
syncSkillDescriptions(projectRoot);
|
|
373
373
|
ensureSkillSymlinks(projectRoot);
|
|
374
374
|
console.log();
|
|
375
375
|
} catch (err) {
|
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@AGENTS.md
|