auto-mode 2.0.0 → 2.0.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.
- package/dist/{classify-edit-B10-ua5i.js → classify-edit-C-CQMndB.js} +14 -14
- package/dist/cli.js +2680 -81
- package/dist/index.d.ts +28 -18
- package/dist/index.js +13 -1
- package/dist/{parse-action-request-DtReuNOc.js → parse-action-request-CPpuEqFq.js} +1390 -1171
- package/dist/{schemas-Dc2424NY.js → schemas-B_w83Dze.js} +95 -48
- package/dist/{start-judge-server-Drj5c8js.js → start-judge-server-D-zcMyFZ.js} +2 -2
- package/dist/start-judge-session-DOkwKT_N.js +1 -0
- package/dist/{start-judge-session-9R_bGhxY.js → start-judge-session-DX3Oek85.js} +9243 -9111
- package/mods/auto-mode/hooks/register.ts +33 -33
- package/mods/auto-mode/hooks/testing.d.ts +3 -3
- package/package.json +20 -19
- package/dist/start-judge-session-Ws6eqDt4.js +0 -2
|
@@ -17740,7 +17740,7 @@ function classifyEdit(action, scope) {
|
|
|
17740
17740
|
kind: "jev",
|
|
17741
17741
|
reason: "target in a checkout outside the scope"
|
|
17742
17742
|
};
|
|
17743
|
-
const exclusion = [action.target, action.requested].some((each) => scope.protectedDirs.some((
|
|
17743
|
+
const exclusion = [action.target, action.requested].some((each) => scope.protectedDirs.some((directory) => isWithin(each, directory))) ? "auto-mode configuration or state" : findExclusion(path) ?? findExclusion(toWorktreePath(action.requested, scope.worktrees));
|
|
17744
17744
|
if (exclusion !== null) return {
|
|
17745
17745
|
kind: "jev",
|
|
17746
17746
|
reason: `target is ${exclusion}`
|
|
@@ -17809,10 +17809,10 @@ function toWorktreePath(path, worktrees) {
|
|
|
17809
17809
|
return worktree === null ? path : relative(worktree, path).split(sep).join("/");
|
|
17810
17810
|
}
|
|
17811
17811
|
function findWorktree(target, worktrees) {
|
|
17812
|
-
return worktrees.filter((worktree) => isWithin(target, worktree)).toSorted((
|
|
17812
|
+
return worktrees.filter((worktree) => isWithin(target, worktree)).toSorted((left, right) => right.length - left.length)[0] ?? null;
|
|
17813
17813
|
}
|
|
17814
|
-
function isWithin(path,
|
|
17815
|
-
const offset = relative(
|
|
17814
|
+
function isWithin(path, directory) {
|
|
17815
|
+
const offset = relative(directory, path);
|
|
17816
17816
|
return offset !== "" && !offset.startsWith("..") && !offset.startsWith(sep);
|
|
17817
17817
|
}
|
|
17818
17818
|
const EXCLUDED_PATHS = [
|
|
@@ -17832,16 +17832,16 @@ const EXCLUDED_PATHS = [
|
|
|
17832
17832
|
[".gnupg", "a credential file"]
|
|
17833
17833
|
];
|
|
17834
17834
|
const EXCLUDED_NAMES = [
|
|
17835
|
-
[/^(?:agents|claude)(?:\.[\w-]+)?\.md$/
|
|
17836
|
-
[/^\.mcp\.json$/
|
|
17837
|
-
[/^settings(?:\.[\w-]+)?\.json$/
|
|
17838
|
-
[/^(?:hooks\.json|\.?lefthook(?:-local)?\.ya?ml|\.pre-commit-config\.ya?ml)$/
|
|
17839
|
-
[/^(?:package\.json|\.?bunfig\.toml|\.gitattributes)$/
|
|
17840
|
-
[/^\.gitlab-ci\.ya?ml$/
|
|
17841
|
-
[/^\.env(?:\..*)?$|^\.envrc$/
|
|
17842
|
-
[/^(?:\.netrc|\.npmrc|\.pypirc|\.git-credentials|\.dockercfg|kubeconfig)$/
|
|
17843
|
-
[/^credentials(?:\.\w+)?$|^secrets?\.(?:json|ya?ml|toml|env)$/
|
|
17844
|
-
[/^id_(?:rsa|dsa|ecdsa|ed25519)|\.(?:pem|key|p12|pfx|jks|keystore|tfvars)$/
|
|
17835
|
+
[/^(?:agents|claude)(?:\.[\w-]+)?\.md$/iu, "agent configuration"],
|
|
17836
|
+
[/^\.mcp\.json$/iu, "agent configuration"],
|
|
17837
|
+
[/^settings(?:\.[\w-]+)?\.json$/iu, "a settings file"],
|
|
17838
|
+
[/^(?:hooks\.json|\.?lefthook(?:-local)?\.ya?ml|\.pre-commit-config\.ya?ml)$/iu, "a hook file"],
|
|
17839
|
+
[/^(?:package\.json|\.?bunfig\.toml|\.gitattributes)$/iu, "a hook file"],
|
|
17840
|
+
[/^\.gitlab-ci\.ya?ml$/iu, "a CI workflow"],
|
|
17841
|
+
[/^\.env(?:\..*)?$|^\.envrc$/iu, "an env file"],
|
|
17842
|
+
[/^(?:\.netrc|\.npmrc|\.pypirc|\.git-credentials|\.dockercfg|kubeconfig)$/iu, "a credential file"],
|
|
17843
|
+
[/^credentials(?:\.\w+)?$|^secrets?\.(?:json|ya?ml|toml|env)$/iu, "a credential file"],
|
|
17844
|
+
[/^id_(?:rsa|dsa|ecdsa|ed25519)|\.(?:pem|key|p12|pfx|jks|keystore|tfvars)$/iu, "a credential file"]
|
|
17845
17845
|
];
|
|
17846
17846
|
function findExclusion(path) {
|
|
17847
17847
|
const lower = path.toLowerCase();
|