@fractary/codex 0.5.0 → 0.5.1

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
@@ -74,6 +74,9 @@ function matchFromCodexPattern(codexFilePath, patterns, targetProject) {
74
74
  return false;
75
75
  }
76
76
  return patterns.some((pattern) => {
77
+ if (pattern.startsWith("projects/")) {
78
+ return matchPattern(pattern, codexFilePath);
79
+ }
77
80
  const projectSeparatorIndex = pattern.indexOf("/");
78
81
  if (projectSeparatorIndex === -1) {
79
82
  const fullPattern = `${targetProject}/${pattern}`;
@@ -2918,6 +2921,14 @@ async function scanCodexWithRouting(options) {
2918
2921
  function extractProjectFromPath(filePath, org) {
2919
2922
  const normalizedPath = filePath.replace(/\\/g, "/");
2920
2923
  const withoutOrg = normalizedPath.startsWith(`${org}/`) ? normalizedPath.slice(org.length + 1) : normalizedPath;
2924
+ if (withoutOrg.startsWith("projects/")) {
2925
+ const afterProjects = withoutOrg.slice("projects/".length);
2926
+ const firstSlash2 = afterProjects.indexOf("/");
2927
+ if (firstSlash2 === -1) {
2928
+ return afterProjects;
2929
+ }
2930
+ return afterProjects.slice(0, firstSlash2);
2931
+ }
2921
2932
  const firstSlash = withoutOrg.indexOf("/");
2922
2933
  if (firstSlash === -1) {
2923
2934
  return withoutOrg;