@lumerahq/cli 0.16.0 → 0.17.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.
|
@@ -8,8 +8,7 @@ import { existsSync, mkdirSync, readdirSync, readFileSync, symlinkSync, lstatSyn
|
|
|
8
8
|
import { join, relative } from "path";
|
|
9
9
|
import pc from "picocolors";
|
|
10
10
|
function slugToFilename(slug) {
|
|
11
|
-
|
|
12
|
-
return `${normalizedSlug.replace(/-/g, "_")}.md`;
|
|
11
|
+
return `${slug.replace(/-/g, "_")}.md`;
|
|
13
12
|
}
|
|
14
13
|
function filenameToSlug(filename) {
|
|
15
14
|
return filename.replace(/\.md$/, "").replace(/_/g, "-");
|
|
@@ -70,7 +69,7 @@ function parseSkillSummary(content) {
|
|
|
70
69
|
return { title, summary: summaryLines.join(" ") };
|
|
71
70
|
}
|
|
72
71
|
function ensureSkillSymlinks(projectRoot) {
|
|
73
|
-
const canonicalDir = join(projectRoot, ".
|
|
72
|
+
const canonicalDir = join(projectRoot, ".agents", "skills");
|
|
74
73
|
if (!existsSync(canonicalDir)) return;
|
|
75
74
|
const symlinks = [
|
|
76
75
|
{
|
|
@@ -79,9 +78,9 @@ function ensureSkillSymlinks(projectRoot) {
|
|
|
79
78
|
target: relative(join(projectRoot, ".pi"), canonicalDir)
|
|
80
79
|
},
|
|
81
80
|
{
|
|
82
|
-
dir: join(projectRoot, ".
|
|
83
|
-
link: join(projectRoot, ".
|
|
84
|
-
target: relative(join(projectRoot, ".
|
|
81
|
+
dir: join(projectRoot, ".claude"),
|
|
82
|
+
link: join(projectRoot, ".claude", "skills"),
|
|
83
|
+
target: relative(join(projectRoot, ".claude"), canonicalDir)
|
|
85
84
|
}
|
|
86
85
|
];
|
|
87
86
|
for (const { dir, link, target } of symlinks) {
|
|
@@ -103,7 +102,7 @@ function ensureSkillSymlinks(projectRoot) {
|
|
|
103
102
|
async function installAllSkills(targetDir, options) {
|
|
104
103
|
const verbose = options?.verbose ?? false;
|
|
105
104
|
const skills = await fetchSkillsList();
|
|
106
|
-
const skillsDir = join(targetDir, ".
|
|
105
|
+
const skillsDir = join(targetDir, ".agents", "skills");
|
|
107
106
|
mkdirSync(skillsDir, { recursive: true });
|
|
108
107
|
const results = await Promise.allSettled(
|
|
109
108
|
skills.map(async (skill) => {
|
|
@@ -137,7 +136,7 @@ var SKILLS_START_MARKER = "<!-- LUMERA_SKILLS_START -->";
|
|
|
137
136
|
var SKILLS_END_MARKER = "<!-- LUMERA_SKILLS_END -->";
|
|
138
137
|
function syncClaudeMd(projectRoot) {
|
|
139
138
|
const claudeMdPath = join(projectRoot, "CLAUDE.md");
|
|
140
|
-
const skillsDir = join(projectRoot, ".
|
|
139
|
+
const skillsDir = join(projectRoot, ".agents", "skills");
|
|
141
140
|
if (!existsSync(claudeMdPath)) {
|
|
142
141
|
return;
|
|
143
142
|
}
|
package/dist/index.js
CHANGED
|
@@ -244,7 +244,7 @@ async function main() {
|
|
|
244
244
|
break;
|
|
245
245
|
// Project
|
|
246
246
|
case "init":
|
|
247
|
-
await import("./init-
|
|
247
|
+
await import("./init-YUZQ54HZ.js").then((m) => m.init(args.slice(1)));
|
|
248
248
|
break;
|
|
249
249
|
case "register":
|
|
250
250
|
await import("./register-MLXJNMNR.js").then((m) => m.register(args.slice(1)));
|
|
@@ -260,7 +260,7 @@ async function main() {
|
|
|
260
260
|
break;
|
|
261
261
|
// Skills
|
|
262
262
|
case "skills":
|
|
263
|
-
await import("./skills-
|
|
263
|
+
await import("./skills-VY42VAXX.js").then((m) => m.skills(subcommand, args.slice(2)));
|
|
264
264
|
break;
|
|
265
265
|
// Auth
|
|
266
266
|
case "login":
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
installAllSkills,
|
|
8
8
|
slugToFilename,
|
|
9
9
|
syncClaudeMd
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-W4XQ5TKC.js";
|
|
11
11
|
import "./chunk-ZH3NVYEQ.js";
|
|
12
12
|
import "./chunk-PNKVD2UK.js";
|
|
13
13
|
|
|
@@ -18,7 +18,7 @@ import { join, resolve } from "path";
|
|
|
18
18
|
function findProjectRoot() {
|
|
19
19
|
let dir = process.cwd();
|
|
20
20
|
while (dir !== "/") {
|
|
21
|
-
if (existsSync(join(dir, "lumera.json")) || existsSync(join(dir, ".claude"))) {
|
|
21
|
+
if (existsSync(join(dir, "lumera.json")) || existsSync(join(dir, ".agents")) || existsSync(join(dir, ".claude"))) {
|
|
22
22
|
return dir;
|
|
23
23
|
}
|
|
24
24
|
dir = resolve(dir, "..");
|
|
@@ -35,11 +35,7 @@ async function computeDiff(skillsDir, filterSlug) {
|
|
|
35
35
|
removed: [],
|
|
36
36
|
unchanged: []
|
|
37
37
|
};
|
|
38
|
-
const skillsToCheck = filterSlug ? skills2.filter((skill) =>
|
|
39
|
-
const normalizedFilter = filterSlug.startsWith("lumera-") ? filterSlug : `lumera-${filterSlug}`;
|
|
40
|
-
const normalizedSlug = skill.slug.startsWith("lumera-") ? skill.slug : `lumera-${skill.slug}`;
|
|
41
|
-
return normalizedSlug === normalizedFilter || skill.slug === filterSlug;
|
|
42
|
-
}) : skills2;
|
|
38
|
+
const skillsToCheck = filterSlug ? skills2.filter((skill) => skill.slug === filterSlug) : skills2;
|
|
43
39
|
const remoteResults = await Promise.allSettled(
|
|
44
40
|
skillsToCheck.map(async (skill) => {
|
|
45
41
|
const content = await fetchSkillContent(skill.slug);
|
|
@@ -49,9 +45,8 @@ async function computeDiff(skillsDir, filterSlug) {
|
|
|
49
45
|
for (const result of remoteResults) {
|
|
50
46
|
if (result.status !== "fulfilled" || !result.value.content) continue;
|
|
51
47
|
const { skill, content } = result.value;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const localHash = localSkills.get(normalizedSlug);
|
|
48
|
+
remoteSkillSlugs.add(skill.slug);
|
|
49
|
+
const localHash = localSkills.get(skill.slug);
|
|
55
50
|
if (!localHash) {
|
|
56
51
|
diff.added.push(skill);
|
|
57
52
|
} else {
|
|
@@ -131,7 +126,7 @@ ${pc.dim("Examples:")}
|
|
|
131
126
|
lumera skills install # First-time skill setup
|
|
132
127
|
lumera skills install --force # Overwrite existing skills
|
|
133
128
|
lumera skills update # Update all skills
|
|
134
|
-
lumera skills update lumera-sdk
|
|
129
|
+
lumera skills update using-lumera-sdk # Update a single skill
|
|
135
130
|
lumera skills update --dry-run # Preview changes
|
|
136
131
|
`);
|
|
137
132
|
}
|
|
@@ -202,10 +197,10 @@ async function install(flags) {
|
|
|
202
197
|
const projectRoot = findProjectRoot();
|
|
203
198
|
if (!projectRoot) {
|
|
204
199
|
console.log(pc.red(" Error: Not in a Lumera project directory"));
|
|
205
|
-
console.log(pc.dim(" Run this command from a directory containing lumera.json or .
|
|
200
|
+
console.log(pc.dim(" Run this command from a directory containing lumera.json or .agents/"));
|
|
206
201
|
process.exit(1);
|
|
207
202
|
}
|
|
208
|
-
const skillsDir = join(projectRoot, ".
|
|
203
|
+
const skillsDir = join(projectRoot, ".agents", "skills");
|
|
209
204
|
const existingSkills = getLocalSkills(skillsDir);
|
|
210
205
|
if (existingSkills.size > 0 && !force) {
|
|
211
206
|
console.log(pc.yellow(" \u26A0"), `Skills already installed (${existingSkills.size} skills found)`);
|
|
@@ -233,7 +228,7 @@ async function install(flags) {
|
|
|
233
228
|
} else {
|
|
234
229
|
console.log(pc.green(" \u2713"), `Installed ${installed} skills`);
|
|
235
230
|
}
|
|
236
|
-
console.log(pc.dim(` Location: .
|
|
231
|
+
console.log(pc.dim(` Location: .agents/skills/`));
|
|
237
232
|
syncClaudeMd(projectRoot);
|
|
238
233
|
console.log();
|
|
239
234
|
} catch (err) {
|
|
@@ -256,10 +251,10 @@ async function update(args, flags) {
|
|
|
256
251
|
const projectRoot = findProjectRoot();
|
|
257
252
|
if (!projectRoot) {
|
|
258
253
|
console.log(pc.red(" Error: Not in a Lumera project directory"));
|
|
259
|
-
console.log(pc.dim(" Run this command from a directory containing lumera.json or .
|
|
254
|
+
console.log(pc.dim(" Run this command from a directory containing lumera.json or .agents/"));
|
|
260
255
|
process.exit(1);
|
|
261
256
|
}
|
|
262
|
-
const skillsDir = join(projectRoot, ".
|
|
257
|
+
const skillsDir = join(projectRoot, ".agents", "skills");
|
|
263
258
|
if (!existsSync(skillsDir)) {
|
|
264
259
|
console.log(pc.yellow(" \u26A0"), "No skills installed yet");
|
|
265
260
|
console.log(pc.dim(' Run "lumera skills install" first'));
|