@lobehub/cli 0.0.144 → 0.0.145
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/acceptance-report.html +229 -229
- package/dist/index.js +15 -9
- package/man/man1/lh.1 +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -268599,19 +268599,21 @@ const parseSkillFrontmatter = (raw) => {
|
|
|
268599
268599
|
* `SKILL.md`. Once a directory contains `SKILL.md`, treat it as a skill root
|
|
268600
268600
|
* and do not recurse into its subdirectories (`scripts/`, `references/`, etc.).
|
|
268601
268601
|
* Returns `[]` when the source directory is absent or unreadable.
|
|
268602
|
-
*
|
|
268602
|
+
* Candidates are ordered by directory name to make alias precedence stable.
|
|
268603
268603
|
*/
|
|
268604
|
-
const scanSkillsInSource = async ({ previewRoot, scope, source, sourceRoot }) => {
|
|
268604
|
+
const scanSkillsInSource = async ({ previewRoot, scope, source, sourceRoot }, seenRealPaths) => {
|
|
268605
268605
|
let entries;
|
|
268606
268606
|
try {
|
|
268607
268607
|
entries = await readdir(sourceRoot, { withFileTypes: true });
|
|
268608
268608
|
} catch {
|
|
268609
268609
|
return [];
|
|
268610
268610
|
}
|
|
268611
|
-
return
|
|
268611
|
+
return Promise.all(entries.filter((entry) => !entry.name.startsWith(".") && (entry.isDirectory() || entry.isSymbolicLink())).sort((a, b) => a.name.localeCompare(b.name)).map(async (entry) => {
|
|
268612
268612
|
const skillDir = path.join(sourceRoot, entry.name);
|
|
268613
268613
|
const skillFile = path.join(skillDir, "SKILL.md");
|
|
268614
268614
|
try {
|
|
268615
|
+
const realPath = await realpath(skillFile);
|
|
268616
|
+
if (seenRealPaths.has(realPath)) return null;
|
|
268615
268617
|
const fields = parseSkillFrontmatter(await readFile(skillFile, "utf8"));
|
|
268616
268618
|
return {
|
|
268617
268619
|
description: fields.description || void 0,
|
|
@@ -268619,6 +268621,7 @@ const scanSkillsInSource = async ({ previewRoot, scope, source, sourceRoot }) =>
|
|
|
268619
268621
|
name: fields.name || entry.name,
|
|
268620
268622
|
path: skillFile,
|
|
268621
268623
|
previewRoot,
|
|
268624
|
+
realPath,
|
|
268622
268625
|
scope,
|
|
268623
268626
|
skillDir,
|
|
268624
268627
|
source
|
|
@@ -268626,15 +268629,18 @@ const scanSkillsInSource = async ({ previewRoot, scope, source, sourceRoot }) =>
|
|
|
268626
268629
|
} catch {
|
|
268627
268630
|
return null;
|
|
268628
268631
|
}
|
|
268629
|
-
}))
|
|
268632
|
+
}));
|
|
268630
268633
|
};
|
|
268631
268634
|
const collectSkills = async (roots) => {
|
|
268632
|
-
const
|
|
268635
|
+
const seenNames = /* @__PURE__ */ new Set();
|
|
268636
|
+
const seenRealPaths = /* @__PURE__ */ new Set();
|
|
268633
268637
|
const skills = [];
|
|
268634
|
-
for (const root of roots) for (const skill of await scanSkillsInSource(root)) {
|
|
268635
|
-
if (
|
|
268636
|
-
|
|
268637
|
-
|
|
268638
|
+
for (const root of roots) for (const skill of await scanSkillsInSource(root, seenRealPaths)) {
|
|
268639
|
+
if (!skill || seenNames.has(skill.name) || seenRealPaths.has(skill.realPath)) continue;
|
|
268640
|
+
const { realPath, ...item } = skill;
|
|
268641
|
+
seenNames.add(item.name);
|
|
268642
|
+
seenRealPaths.add(realPath);
|
|
268643
|
+
skills.push(item);
|
|
268638
268644
|
}
|
|
268639
268645
|
return skills.sort((a, b) => a.name.localeCompare(b.name));
|
|
268640
268646
|
};
|
package/man/man1/lh.1
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.\" Code generated by `npm run man:generate`; DO NOT EDIT.
|
|
2
2
|
.\" Manual command details come from the Commander command tree.
|
|
3
|
-
.TH LH 1 "" "@lobehub/cli 0.0.
|
|
3
|
+
.TH LH 1 "" "@lobehub/cli 0.0.145" "User Commands"
|
|
4
4
|
.SH NAME
|
|
5
5
|
lh \- LobeHub CLI \- manage and connect to LobeHub services
|
|
6
6
|
.SH SYNOPSIS
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.145",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/lobehub/lobehub",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"access": "public",
|
|
84
84
|
"registry": "https://registry.npmjs.org"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "585ae785c682ba9c3ce75d1f99b00d142e7a9eb5"
|
|
87
87
|
}
|