grepmax 0.7.40 → 0.7.42

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.
@@ -89,17 +89,15 @@ function startWatcher(opts) {
89
89
  let currentBatchAc = null;
90
90
  let summarizationAc = null;
91
91
  const MAX_RETRIES = 5;
92
- const watcher = (0, chokidar_1.watch)(projectRoot, {
93
- ignored: exports.WATCHER_IGNORE_PATTERNS,
94
- ignoreInitial: true,
95
- persistent: true,
96
- // Use polling to avoid EMFILE in large monorepos.
97
- // fs.watch() uses one FD per directory (kqueue on macOS) and hits ulimit.
98
- // Polling 2-3k source files every 5s is negligible CPU.
99
- usePolling: true,
100
- interval: 5000,
101
- binaryInterval: 10000,
102
- });
92
+ // macOS: FSEvents is a single-FD kernel API — no EMFILE risk and no polling.
93
+ // Linux: inotify is event-driven but uses one FD per watch; fall back to
94
+ // polling for monorepos to avoid hitting ulimit.
95
+ // Override with GMAX_WATCH_POLL=1 to force polling on any platform.
96
+ const forcePoll = process.env.GMAX_WATCH_POLL === "1";
97
+ const usePoll = forcePoll || process.platform !== "darwin";
98
+ const watcher = (0, chokidar_1.watch)(projectRoot, Object.assign({ ignored: exports.WATCHER_IGNORE_PATTERNS, ignoreInitial: true, persistent: true }, (usePoll
99
+ ? { usePolling: true, interval: 5000, binaryInterval: 10000 }
100
+ : {})));
103
101
  watcher.on("error", (err) => {
104
102
  console.error(`[${wtag}] Watcher error:`, err);
105
103
  });
@@ -4,5 +4,8 @@ exports.isFileCached = isFileCached;
4
4
  function isFileCached(cached, stats) {
5
5
  if (!cached)
6
6
  return false;
7
- return cached.mtimeMs === stats.mtimeMs && cached.size === stats.size;
7
+ // Truncate to millisecond APFS returns sub-ms precision that can
8
+ // differ across stat calls or serialization round-trips.
9
+ return (Math.trunc(cached.mtimeMs) === Math.trunc(stats.mtimeMs) &&
10
+ cached.size === stats.size);
8
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grepmax",
3
- "version": "0.7.40",
3
+ "version": "0.7.42",
4
4
  "author": "Robert Owens <robowens@me.com>",
5
5
  "homepage": "https://github.com/reowens/grepmax",
6
6
  "bugs": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grepmax",
3
- "version": "0.7.40",
3
+ "version": "0.7.42",
4
4
  "description": "Semantic code search for Claude Code. Automatically indexes your project and provides intelligent search capabilities.",
5
5
  "author": {
6
6
  "name": "Robert Owens",