@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/tools.js +11 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tritard/waterbrother",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "Waterbrother: Grok-powered coding CLI with local tools, sessions, operator modes, and approval controls",
5
5
  "type": "module",
6
6
  "bin": {
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 = String(value || "").replace(/^\.\//, "");
398
- const normalizedPattern = String(pattern || "").replace(/^\.\//, "");
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.replace(/^\.\//, "").replace(/\\/g, "/"));
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) {