locus-product-planning 1.2.8 → 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 CHANGED
@@ -12615,6 +12615,9 @@ function getLocusAgentsDir() {
12615
12615
  return root + sep + "agents";
12616
12616
  }
12617
12617
  function extractFrontmatter(filePath) {
12618
+ if (typeof filePath !== "string" || !filePath) {
12619
+ return { name: "", description: "" };
12620
+ }
12618
12621
  try {
12619
12622
  const content = (0, import_fs.readFileSync)(filePath, "utf-8");
12620
12623
  const lines = content.replace(/\r\n/g, "\n").split("\n");
@@ -12699,6 +12702,9 @@ function extractFrontmatter(filePath) {
12699
12702
  }
12700
12703
  }
12701
12704
  function stripFrontmatter(content) {
12705
+ if (typeof content !== "string") {
12706
+ return "";
12707
+ }
12702
12708
  const lines = content.split("\n");
12703
12709
  let inFrontmatter = false;
12704
12710
  let frontmatterEnded = false;
@@ -12720,6 +12726,7 @@ function stripFrontmatter(content) {
12720
12726
  }
12721
12727
  function findSkillsInDir(dir, sourceType, maxDepth = 4) {
12722
12728
  const skills = [];
12729
+ if (typeof dir !== "string" || !dir) return skills;
12723
12730
  if (!(0, import_fs.existsSync)(dir)) return skills;
12724
12731
  function recurse(currentDir, depth) {
12725
12732
  if (depth > maxDepth) return;
@@ -12757,6 +12764,7 @@ function findSkillsInDir(dir, sourceType, maxDepth = 4) {
12757
12764
  }
12758
12765
  function findAgentsInDir(dir, maxDepth = 3) {
12759
12766
  const agents = [];
12767
+ if (typeof dir !== "string" || !dir) return agents;
12760
12768
  if (!(0, import_fs.existsSync)(dir)) return agents;
12761
12769
  function recurse(currentDir, depth, category) {
12762
12770
  if (depth > maxDepth) return;