@supa-magic/spm 0.4.1 → 0.4.2

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.
Files changed (2) hide show
  1. package/dist/bin/spm.js +10 -6
  2. package/package.json +1 -1
package/dist/bin/spm.js CHANGED
@@ -963,6 +963,11 @@ var providerPrefixes = [
963
963
  ".codeium/",
964
964
  ".cody/"
965
965
  ];
966
+ var providerSkillPathPattern = /^\.?\/?(?:claude|cursor|copilot|aider|codeium|cody)\/skills\/[^/]+\/(.+)/;
967
+ var toRelativeSkillPath = (ref) => {
968
+ const normalized = ref.replace(/^\.\//, "");
969
+ return providerSkillPathPattern.exec(normalized)?.[1];
970
+ };
966
971
  var isExcluded = (ref) => {
967
972
  const normalized = ref.replace(/^\.\//, "");
968
973
  return ref.startsWith("http://") || ref.startsWith("https://") || ref.startsWith("/") || ref.includes("..") || /\{[^}]+\}/.test(ref) || providerPrefixes.some((prefix) => normalized.startsWith(prefix));
@@ -973,11 +978,10 @@ var parseSkillRefs = (content, fileDir) => {
973
978
  const stripped = stripCodeBlocks(content);
974
979
  const collect = (pattern) => {
975
980
  for (const match of stripped.matchAll(pattern)) {
976
- const ref = match[1];
977
- if (!isExcluded(ref)) {
978
- const resolved = posix.normalize(posix.join(fileDir, ref));
979
- refs.add(resolved);
980
- }
981
+ const raw = match[1];
982
+ const skillRelative = toRelativeSkillPath(raw);
983
+ if (skillRelative) refs.add(posix.normalize(posix.join(fileDir, skillRelative)));
984
+ else if (!isExcluded(raw)) refs.add(posix.normalize(posix.join(fileDir, raw)));
981
985
  }
982
986
  };
983
987
  collect(markdownLinkPattern);
@@ -1366,7 +1370,7 @@ var banner = (version) => [
1366
1370
  ].join("\n");
1367
1371
  //#endregion
1368
1372
  //#region src/bin/spm.ts
1369
- var version = "0.4.1";
1373
+ var version = "0.4.2";
1370
1374
  var program = new Command();
1371
1375
  var gray = "\x1B[90m";
1372
1376
  var reset = "\x1B[0m";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supa-magic/spm",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "CLI tool for managing AI skillsets",
5
5
  "license": "MIT",
6
6
  "contributors": [