@lichao0223/lobehub-cli 0.0.92 → 0.0.94

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 CHANGED
@@ -268604,19 +268604,21 @@ const parseSkillFrontmatter = (raw) => {
268604
268604
  * `SKILL.md`. Once a directory contains `SKILL.md`, treat it as a skill root
268605
268605
  * and do not recurse into its subdirectories (`scripts/`, `references/`, etc.).
268606
268606
  * Returns `[]` when the source directory is absent or unreadable.
268607
- * Unsorted — callers sort/merge.
268607
+ * Candidates are ordered by directory name to make alias precedence stable.
268608
268608
  */
268609
- const scanSkillsInSource = async ({ previewRoot, scope, source, sourceRoot }) => {
268609
+ const scanSkillsInSource = async ({ previewRoot, scope, source, sourceRoot }, seenRealPaths) => {
268610
268610
  let entries;
268611
268611
  try {
268612
268612
  entries = await readdir(sourceRoot, { withFileTypes: true });
268613
268613
  } catch {
268614
268614
  return [];
268615
268615
  }
268616
- return (await Promise.all(entries.filter((entry) => !entry.name.startsWith(".") && (entry.isDirectory() || entry.isSymbolicLink())).map(async (entry) => {
268616
+ return Promise.all(entries.filter((entry) => !entry.name.startsWith(".") && (entry.isDirectory() || entry.isSymbolicLink())).sort((a, b) => a.name.localeCompare(b.name)).map(async (entry) => {
268617
268617
  const skillDir = path.join(sourceRoot, entry.name);
268618
268618
  const skillFile = path.join(skillDir, "SKILL.md");
268619
268619
  try {
268620
+ const realPath = await realpath(skillFile);
268621
+ if (seenRealPaths.has(realPath)) return null;
268620
268622
  const fields = parseSkillFrontmatter(await readFile(skillFile, "utf8"));
268621
268623
  return {
268622
268624
  description: fields.description || void 0,
@@ -268624,6 +268626,7 @@ const scanSkillsInSource = async ({ previewRoot, scope, source, sourceRoot }) =>
268624
268626
  name: fields.name || entry.name,
268625
268627
  path: skillFile,
268626
268628
  previewRoot,
268629
+ realPath,
268627
268630
  scope,
268628
268631
  skillDir,
268629
268632
  source
@@ -268631,15 +268634,18 @@ const scanSkillsInSource = async ({ previewRoot, scope, source, sourceRoot }) =>
268631
268634
  } catch {
268632
268635
  return null;
268633
268636
  }
268634
- }))).filter((skill) => skill !== null);
268637
+ }));
268635
268638
  };
268636
268639
  const collectSkills = async (roots) => {
268637
- const seen = /* @__PURE__ */ new Set();
268640
+ const seenNames = /* @__PURE__ */ new Set();
268641
+ const seenRealPaths = /* @__PURE__ */ new Set();
268638
268642
  const skills = [];
268639
- for (const root of roots) for (const skill of await scanSkillsInSource(root)) {
268640
- if (seen.has(skill.name)) continue;
268641
- seen.add(skill.name);
268642
- skills.push(skill);
268643
+ for (const root of roots) for (const skill of await scanSkillsInSource(root, seenRealPaths)) {
268644
+ if (!skill || seenNames.has(skill.name) || seenRealPaths.has(skill.realPath)) continue;
268645
+ const { realPath, ...item } = skill;
268646
+ seenNames.add(item.name);
268647
+ seenRealPaths.add(realPath);
268648
+ skills.push(item);
268643
268649
  }
268644
268650
  return skills.sort((a, b) => a.name.localeCompare(b.name));
268645
268651
  };
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 "" "@lichao0223/lobehub\-cli 0.0.92" "User Commands"
3
+ .TH LH 1 "" "@lichao0223/lobehub\-cli 0.0.94" "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": "@lichao0223/lobehub-cli",
3
- "version": "0.0.92",
3
+ "version": "0.0.94",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/lichao0223/lobehub",
@@ -83,5 +83,5 @@
83
83
  "access": "public",
84
84
  "registry": "https://registry.npmjs.org"
85
85
  },
86
- "gitHead": "e81e0dab619e33ad54ffbae97bbee2b7bf57bb0d"
86
+ "gitHead": "d10fa580f374f97de75089424a6440236dcc4827"
87
87
  }