@adaptic/maestro 1.5.1 → 1.5.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/bin/maestro.mjs +18 -16
  2. package/package.json +1 -1
package/bin/maestro.mjs CHANGED
@@ -762,26 +762,28 @@ function loadMaestroignore(cwd) {
762
762
  }
763
763
 
764
764
  function patternToRegex(pat) {
765
- // Directory prefix: `scripts/daemon/` matches scripts/daemon/* (recursive)
766
- if (pat.endsWith("/")) {
767
- const prefix = pat.replace(/[.+^${}()|[\]\\]/g, "\\$&");
768
- return new RegExp("^" + prefix);
769
- }
770
- // Glob with * and **.
771
- // Step order matters: ** must be captured before single * to preserve
772
- // recursive semantics. * is intentionally NOT in the regex-escape char
773
- // class so we can rewrite it after escaping the other specials.
774
- if (pat.includes("*")) {
775
- const escaped = pat
776
- .replace(/[.+^${}()|[\]\\]/g, "\\$&")
765
+ // Helper: convert a glob-aware pattern to its regex source.
766
+ // ** must be substituted before single * so we don't double-rewrite it.
767
+ // * is intentionally outside the regex-escape char class so the
768
+ // glob substitution can find unescaped `*` characters afterward.
769
+ const globToRe = (p) =>
770
+ p.replace(/[.+^${}()|[\]\\]/g, "\\$&")
777
771
  .replace(/\*\*/g, "<DBL>")
778
772
  .replace(/\*/g, "[^/]*")
779
773
  .replace(/<DBL>/g, ".*");
780
- return new RegExp("^" + escaped + "$");
774
+
775
+ // Directory prefix: `scripts/daemon/` or `agents/sophie-*/` match
776
+ // anything under that path (recursive).
777
+ if (pat.endsWith("/")) {
778
+ return new RegExp("^" + globToRe(pat));
779
+ }
780
+ // Single-line glob: must match in full (no trailing slash).
781
+ if (pat.includes("*")) {
782
+ return new RegExp("^" + globToRe(pat) + "$");
781
783
  }
782
- // Exact: also match anything underneath (a path like `scripts/daemon`
783
- // without trailing slash should still protect the whole directory if
784
- // it resolves to one — gitignore semantics).
784
+ // Exact: also matches anything underneath (gitignore semantics a
785
+ // pattern without trailing slash still protects a directory if it
786
+ // resolves to one).
785
787
  const escaped = pat.replace(/[.+^${}()|[\]\\]/g, "\\$&");
786
788
  return new RegExp("^" + escaped + "(/|$)");
787
789
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptic/maestro",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "description": "Maestro — Autonomous AI agent operating system. Deploy AI employees on dedicated Mac minis.",
5
5
  "type": "module",
6
6
  "bin": {