import * as n from "path";
import { URI as i } from "vscode-uri";
class m extends Error {
  constructor(e) {
    super("Cannot use this tool to write Remote JSON Schema in Supervised mode"), this.filePath = e, this.name = "RemoteJsonSchemaError";
  }
}
const d = [
  "vscode~",
  ".vscode/",
  ".vscode./",
  ".vscode /",
  ".git/",
  ".git./",
  ".git /",
  "git~",
  ".code-workspace"
], l = [".git", "mcp.json", ".kiroignore"], s = /[\x00-\x1f\x7f-\x9f]/g, u = "$schema";
function p() {
  return u.length;
}
function r(o) {
  let e = o.replace(s, "");
  e = e.normalize("NFC"), e = e.normalize("NFKC");
  try {
    e = decodeURIComponent(e), e = decodeURIComponent(e);
  } catch {
  }
  return e = e.replace(s, ""), e = e.toLowerCase(), e = e.replace(/[. ]+$/g, ""), e = e.replace(/\\/g, "/"), e = n.normalize(e), e = e.replace(/\\/g, "/"), e;
}
function f(o) {
  const e = r(o), t = r(i.file(o).path);
  for (const a of [e, t]) {
    if (l.includes(n.basename(a)))
      return !0;
    for (const c of d)
      if (a.includes(c))
        return !0;
  }
  return !1;
}
function g(o, e) {
  const t = r(o);
  if (n.extname(t).includes("json") && e.includes("$schema"))
    throw new m(o);
}
export {
  l as P,
  m as R,
  d as a,
  p as g,
  f as i,
  r as s,
  g as v
};
//# sourceMappingURL=validate-file-modification-C1Q82kWv.js.map
