@tritard/waterbrother 0.8.2 → 0.8.3
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/package.json +1 -1
- package/src/tools.js +11 -4
package/package.json
CHANGED
package/src/tools.js
CHANGED
|
@@ -5,7 +5,7 @@ import crypto from "node:crypto";
|
|
|
5
5
|
import { exec } from "node:child_process";
|
|
6
6
|
import { promisify } from "node:util";
|
|
7
7
|
import { normalizeAutonomyMode, normalizeExperienceMode } from "./modes.js";
|
|
8
|
-
import { resolveSandboxPath } from "./path-utils.js";
|
|
8
|
+
import { expandHomePath, resolveSandboxPath } from "./path-utils.js";
|
|
9
9
|
import { promptKeyChoice, promptLine } from "./prompt.js";
|
|
10
10
|
import { McpManager } from "./mcp.js";
|
|
11
11
|
|
|
@@ -394,8 +394,8 @@ function globToRegExp(glob) {
|
|
|
394
394
|
}
|
|
395
395
|
|
|
396
396
|
function matchesPattern(value, pattern) {
|
|
397
|
-
const normalizedValue =
|
|
398
|
-
const normalizedPattern =
|
|
397
|
+
const normalizedValue = normalizePathPattern(value);
|
|
398
|
+
const normalizedPattern = normalizePathPattern(pattern);
|
|
399
399
|
return globToRegExp(normalizedPattern).test(normalizedValue);
|
|
400
400
|
}
|
|
401
401
|
|
|
@@ -409,7 +409,14 @@ function extractPatchPaths(patchText) {
|
|
|
409
409
|
}
|
|
410
410
|
|
|
411
411
|
function normalizePathList(values = []) {
|
|
412
|
-
return uniqueStrings(values).map((item) => item
|
|
412
|
+
return uniqueStrings(values).map((item) => normalizePathPattern(item));
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
function normalizePathPattern(value) {
|
|
416
|
+
const raw = String(value || "").trim();
|
|
417
|
+
if (!raw) return "";
|
|
418
|
+
const expanded = expandHomePath(raw);
|
|
419
|
+
return String(expanded).replace(/^\.\//, "").replace(/\\/g, "/");
|
|
413
420
|
}
|
|
414
421
|
|
|
415
422
|
function looksLikeMutatingShellCommand(command) {
|