locus-product-planning 1.2.7 → 1.2.9
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.cjs +13 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12579,6 +12579,9 @@ function getLocusAgentsDir() {
|
|
|
12579
12579
|
return root + sep + "agents";
|
|
12580
12580
|
}
|
|
12581
12581
|
function extractFrontmatter(filePath) {
|
|
12582
|
+
if (typeof filePath !== "string" || !filePath) {
|
|
12583
|
+
return { name: "", description: "" };
|
|
12584
|
+
}
|
|
12582
12585
|
try {
|
|
12583
12586
|
const content = readFileSync(filePath, "utf-8");
|
|
12584
12587
|
const lines = content.replace(/\r\n/g, "\n").split("\n");
|
|
@@ -12663,6 +12666,9 @@ function extractFrontmatter(filePath) {
|
|
|
12663
12666
|
}
|
|
12664
12667
|
}
|
|
12665
12668
|
function stripFrontmatter(content) {
|
|
12669
|
+
if (typeof content !== "string") {
|
|
12670
|
+
return "";
|
|
12671
|
+
}
|
|
12666
12672
|
const lines = content.split("\n");
|
|
12667
12673
|
let inFrontmatter = false;
|
|
12668
12674
|
let frontmatterEnded = false;
|
|
@@ -12684,6 +12690,7 @@ function stripFrontmatter(content) {
|
|
|
12684
12690
|
}
|
|
12685
12691
|
function findSkillsInDir(dir, sourceType, maxDepth = 4) {
|
|
12686
12692
|
const skills = [];
|
|
12693
|
+
if (typeof dir !== "string" || !dir) return skills;
|
|
12687
12694
|
if (!existsSync(dir)) return skills;
|
|
12688
12695
|
function recurse(currentDir, depth) {
|
|
12689
12696
|
if (depth > maxDepth) return;
|
|
@@ -12721,6 +12728,7 @@ function findSkillsInDir(dir, sourceType, maxDepth = 4) {
|
|
|
12721
12728
|
}
|
|
12722
12729
|
function findAgentsInDir(dir, maxDepth = 3) {
|
|
12723
12730
|
const agents = [];
|
|
12731
|
+
if (typeof dir !== "string" || !dir) return agents;
|
|
12724
12732
|
if (!existsSync(dir)) return agents;
|
|
12725
12733
|
function recurse(currentDir, depth, category) {
|
|
12726
12734
|
if (depth > maxDepth) return;
|
|
@@ -12751,6 +12759,9 @@ function findAgentsInDir(dir, maxDepth = 3) {
|
|
|
12751
12759
|
return agents;
|
|
12752
12760
|
}
|
|
12753
12761
|
function resolveSkillPath(skillName, locusSkillsDir, personalSkillsDir, projectSkillsDir) {
|
|
12762
|
+
if (typeof skillName !== "string" || !skillName) {
|
|
12763
|
+
return null;
|
|
12764
|
+
}
|
|
12754
12765
|
const forceProject = skillName.startsWith("project:");
|
|
12755
12766
|
const forceLocus = skillName.startsWith("locus:");
|
|
12756
12767
|
const actualSkillName = skillName.replace(/^project:/, "").replace(/^locus:/, "");
|
|
@@ -12768,6 +12779,8 @@ function resolveSkillPath(skillName, locusSkillsDir, personalSkillsDir, projectS
|
|
|
12768
12779
|
return null;
|
|
12769
12780
|
}
|
|
12770
12781
|
function findSkillByName(baseDir, skillName, sourceType) {
|
|
12782
|
+
if (typeof baseDir !== "string" || !baseDir) return null;
|
|
12783
|
+
if (typeof skillName !== "string" || !skillName) return null;
|
|
12771
12784
|
if (!existsSync(baseDir)) return null;
|
|
12772
12785
|
const directPath = safeJoin(baseDir, skillName);
|
|
12773
12786
|
const directSkillFile = safeJoin(directPath, "SKILL.md");
|