@eve-horizon/cli 0.2.42 → 0.2.43
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/index.js +37 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -73475,6 +73475,7 @@ function parseSkillsManifest(manifestPath) {
|
|
|
73475
73475
|
}
|
|
73476
73476
|
const content = fs4.readFileSync(manifestPath, "utf-8");
|
|
73477
73477
|
const sources = [];
|
|
73478
|
+
const manifestDir = path6.dirname(manifestPath);
|
|
73478
73479
|
for (const rawLine of content.split("\n")) {
|
|
73479
73480
|
const line = rawLine.split("#")[0].trim();
|
|
73480
73481
|
if (!line) continue;
|
|
@@ -73483,11 +73484,46 @@ function parseSkillsManifest(manifestPath) {
|
|
|
73483
73484
|
const expanded = expandGlobPattern(line, manifestPath, explicitPrivateTarget);
|
|
73484
73485
|
sources.push(...expanded);
|
|
73485
73486
|
} else {
|
|
73486
|
-
|
|
73487
|
+
const parsed = parseSkillSource(line);
|
|
73488
|
+
if (parsed.type === "local") {
|
|
73489
|
+
const expanded = tryExpandLocalDirectory(parsed, manifestDir);
|
|
73490
|
+
if (expanded) {
|
|
73491
|
+
sources.push(...expanded);
|
|
73492
|
+
continue;
|
|
73493
|
+
}
|
|
73494
|
+
}
|
|
73495
|
+
sources.push(parsed);
|
|
73487
73496
|
}
|
|
73488
73497
|
}
|
|
73489
73498
|
return sources;
|
|
73490
73499
|
}
|
|
73500
|
+
function tryExpandLocalDirectory(skill, manifestDir) {
|
|
73501
|
+
let source = skill.source;
|
|
73502
|
+
if (source.startsWith("~")) {
|
|
73503
|
+
source = source.replace(/^~/, process.env.HOME || "~");
|
|
73504
|
+
}
|
|
73505
|
+
const abs = path6.isAbsolute(source) ? source : path6.resolve(manifestDir, source);
|
|
73506
|
+
try {
|
|
73507
|
+
if (!fs4.existsSync(abs) || !fs4.statSync(abs).isDirectory()) return null;
|
|
73508
|
+
} catch {
|
|
73509
|
+
return null;
|
|
73510
|
+
}
|
|
73511
|
+
if (fs4.existsSync(path6.join(abs, "SKILL.md"))) return null;
|
|
73512
|
+
const explicitPrivate = sourcePathExplicitlyTargetsPrivate(skill.source);
|
|
73513
|
+
const skillDirs = findSkillDirs(abs, { fullDepth: true, excludePrivate: !explicitPrivate });
|
|
73514
|
+
if (skillDirs.length === 0) return null;
|
|
73515
|
+
return skillDirs.map((dir) => {
|
|
73516
|
+
const name = path6.basename(dir);
|
|
73517
|
+
const relativePath = path6.relative(manifestDir, dir);
|
|
73518
|
+
const resolvedSource = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
73519
|
+
return {
|
|
73520
|
+
raw: skill.raw,
|
|
73521
|
+
source: resolvedSource,
|
|
73522
|
+
type: "local",
|
|
73523
|
+
name
|
|
73524
|
+
};
|
|
73525
|
+
});
|
|
73526
|
+
}
|
|
73491
73527
|
function parseSkillSource(line) {
|
|
73492
73528
|
if (line.startsWith("https://") || line.startsWith("http://")) {
|
|
73493
73529
|
const name2 = extractNameFromUrl(line);
|