@colbymchenry/codegraph-darwin-x64 0.9.9 → 1.0.0

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 (296) hide show
  1. package/lib/dist/bin/codegraph.d.ts +1 -0
  2. package/lib/dist/bin/codegraph.d.ts.map +1 -1
  3. package/lib/dist/bin/codegraph.js +246 -3
  4. package/lib/dist/bin/codegraph.js.map +1 -1
  5. package/lib/dist/context/index.d.ts.map +1 -1
  6. package/lib/dist/context/index.js +7 -0
  7. package/lib/dist/context/index.js.map +1 -1
  8. package/lib/dist/db/index.d.ts.map +1 -1
  9. package/lib/dist/db/index.js +2 -1
  10. package/lib/dist/db/index.js.map +1 -1
  11. package/lib/dist/db/migrations.d.ts +1 -1
  12. package/lib/dist/db/migrations.d.ts.map +1 -1
  13. package/lib/dist/db/migrations.js +10 -1
  14. package/lib/dist/db/migrations.js.map +1 -1
  15. package/lib/dist/db/queries.d.ts +43 -0
  16. package/lib/dist/db/queries.d.ts.map +1 -1
  17. package/lib/dist/db/queries.js +103 -7
  18. package/lib/dist/db/queries.js.map +1 -1
  19. package/lib/dist/db/schema.sql +1 -0
  20. package/lib/dist/db/sqlite-adapter.d.ts +7 -0
  21. package/lib/dist/db/sqlite-adapter.d.ts.map +1 -1
  22. package/lib/dist/db/sqlite-adapter.js +3 -0
  23. package/lib/dist/db/sqlite-adapter.js.map +1 -1
  24. package/lib/dist/directory.d.ts +34 -2
  25. package/lib/dist/directory.d.ts.map +1 -1
  26. package/lib/dist/directory.js +129 -35
  27. package/lib/dist/directory.js.map +1 -1
  28. package/lib/dist/extraction/astro-extractor.d.ts +79 -0
  29. package/lib/dist/extraction/astro-extractor.d.ts.map +1 -0
  30. package/lib/dist/extraction/astro-extractor.js +320 -0
  31. package/lib/dist/extraction/astro-extractor.js.map +1 -0
  32. package/lib/dist/extraction/extraction-version.d.ts +25 -0
  33. package/lib/dist/extraction/extraction-version.d.ts.map +1 -0
  34. package/lib/dist/extraction/extraction-version.js +28 -0
  35. package/lib/dist/extraction/extraction-version.js.map +1 -0
  36. package/lib/dist/extraction/function-ref.d.ts +118 -0
  37. package/lib/dist/extraction/function-ref.d.ts.map +1 -0
  38. package/lib/dist/extraction/function-ref.js +727 -0
  39. package/lib/dist/extraction/function-ref.js.map +1 -0
  40. package/lib/dist/extraction/generated-detection.d.ts.map +1 -1
  41. package/lib/dist/extraction/generated-detection.js +3 -0
  42. package/lib/dist/extraction/generated-detection.js.map +1 -1
  43. package/lib/dist/extraction/grammars.d.ts +7 -1
  44. package/lib/dist/extraction/grammars.d.ts.map +1 -1
  45. package/lib/dist/extraction/grammars.js +52 -4
  46. package/lib/dist/extraction/grammars.js.map +1 -1
  47. package/lib/dist/extraction/index.d.ts +34 -0
  48. package/lib/dist/extraction/index.d.ts.map +1 -1
  49. package/lib/dist/extraction/index.js +346 -62
  50. package/lib/dist/extraction/index.js.map +1 -1
  51. package/lib/dist/extraction/languages/c-cpp.d.ts +8 -0
  52. package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -1
  53. package/lib/dist/extraction/languages/c-cpp.js +87 -28
  54. package/lib/dist/extraction/languages/c-cpp.js.map +1 -1
  55. package/lib/dist/extraction/languages/csharp.d.ts +22 -0
  56. package/lib/dist/extraction/languages/csharp.d.ts.map +1 -1
  57. package/lib/dist/extraction/languages/csharp.js +84 -2
  58. package/lib/dist/extraction/languages/csharp.js.map +1 -1
  59. package/lib/dist/extraction/languages/dart.d.ts.map +1 -1
  60. package/lib/dist/extraction/languages/dart.js +161 -1
  61. package/lib/dist/extraction/languages/dart.js.map +1 -1
  62. package/lib/dist/extraction/languages/go.d.ts.map +1 -1
  63. package/lib/dist/extraction/languages/go.js +43 -2
  64. package/lib/dist/extraction/languages/go.js.map +1 -1
  65. package/lib/dist/extraction/languages/index.d.ts.map +1 -1
  66. package/lib/dist/extraction/languages/index.js +2 -0
  67. package/lib/dist/extraction/languages/index.js.map +1 -1
  68. package/lib/dist/extraction/languages/java.d.ts.map +1 -1
  69. package/lib/dist/extraction/languages/java.js +42 -1
  70. package/lib/dist/extraction/languages/java.js.map +1 -1
  71. package/lib/dist/extraction/languages/javascript.d.ts.map +1 -1
  72. package/lib/dist/extraction/languages/javascript.js +16 -0
  73. package/lib/dist/extraction/languages/javascript.js.map +1 -1
  74. package/lib/dist/extraction/languages/kotlin.d.ts.map +1 -1
  75. package/lib/dist/extraction/languages/kotlin.js +69 -0
  76. package/lib/dist/extraction/languages/kotlin.js.map +1 -1
  77. package/lib/dist/extraction/languages/objc.d.ts.map +1 -1
  78. package/lib/dist/extraction/languages/objc.js +42 -0
  79. package/lib/dist/extraction/languages/objc.js.map +1 -1
  80. package/lib/dist/extraction/languages/pascal.d.ts.map +1 -1
  81. package/lib/dist/extraction/languages/pascal.js +11 -0
  82. package/lib/dist/extraction/languages/pascal.js.map +1 -1
  83. package/lib/dist/extraction/languages/php.d.ts.map +1 -1
  84. package/lib/dist/extraction/languages/php.js +90 -1
  85. package/lib/dist/extraction/languages/php.js.map +1 -1
  86. package/lib/dist/extraction/languages/r.d.ts +3 -0
  87. package/lib/dist/extraction/languages/r.d.ts.map +1 -0
  88. package/lib/dist/extraction/languages/r.js +314 -0
  89. package/lib/dist/extraction/languages/r.js.map +1 -0
  90. package/lib/dist/extraction/languages/ruby.d.ts.map +1 -1
  91. package/lib/dist/extraction/languages/ruby.js +35 -0
  92. package/lib/dist/extraction/languages/ruby.js.map +1 -1
  93. package/lib/dist/extraction/languages/rust.d.ts.map +1 -1
  94. package/lib/dist/extraction/languages/rust.js +35 -2
  95. package/lib/dist/extraction/languages/rust.js.map +1 -1
  96. package/lib/dist/extraction/languages/scala.d.ts.map +1 -1
  97. package/lib/dist/extraction/languages/scala.js +61 -1
  98. package/lib/dist/extraction/languages/scala.js.map +1 -1
  99. package/lib/dist/extraction/languages/swift.d.ts.map +1 -1
  100. package/lib/dist/extraction/languages/swift.js +61 -0
  101. package/lib/dist/extraction/languages/swift.js.map +1 -1
  102. package/lib/dist/extraction/languages/typescript.d.ts +13 -0
  103. package/lib/dist/extraction/languages/typescript.d.ts.map +1 -1
  104. package/lib/dist/extraction/languages/typescript.js +38 -0
  105. package/lib/dist/extraction/languages/typescript.js.map +1 -1
  106. package/lib/dist/extraction/liquid-extractor.d.ts +7 -0
  107. package/lib/dist/extraction/liquid-extractor.d.ts.map +1 -1
  108. package/lib/dist/extraction/liquid-extractor.js +53 -9
  109. package/lib/dist/extraction/liquid-extractor.js.map +1 -1
  110. package/lib/dist/extraction/razor-extractor.d.ts +42 -0
  111. package/lib/dist/extraction/razor-extractor.d.ts.map +1 -0
  112. package/lib/dist/extraction/razor-extractor.js +285 -0
  113. package/lib/dist/extraction/razor-extractor.js.map +1 -0
  114. package/lib/dist/extraction/svelte-extractor.d.ts.map +1 -1
  115. package/lib/dist/extraction/svelte-extractor.js +6 -3
  116. package/lib/dist/extraction/svelte-extractor.js.map +1 -1
  117. package/lib/dist/extraction/tree-sitter-helpers.d.ts.map +1 -1
  118. package/lib/dist/extraction/tree-sitter-helpers.js +59 -10
  119. package/lib/dist/extraction/tree-sitter-helpers.js.map +1 -1
  120. package/lib/dist/extraction/tree-sitter-types.d.ts +33 -0
  121. package/lib/dist/extraction/tree-sitter-types.d.ts.map +1 -1
  122. package/lib/dist/extraction/tree-sitter.d.ts +211 -0
  123. package/lib/dist/extraction/tree-sitter.d.ts.map +1 -1
  124. package/lib/dist/extraction/tree-sitter.js +1681 -49
  125. package/lib/dist/extraction/tree-sitter.js.map +1 -1
  126. package/lib/dist/extraction/vue-extractor.d.ts +15 -0
  127. package/lib/dist/extraction/vue-extractor.d.ts.map +1 -1
  128. package/lib/dist/extraction/vue-extractor.js +94 -3
  129. package/lib/dist/extraction/vue-extractor.js.map +1 -1
  130. package/lib/dist/extraction/wasm/tree-sitter-c_sharp.wasm +0 -0
  131. package/lib/dist/extraction/wasm/tree-sitter-r.wasm +0 -0
  132. package/lib/dist/graph/queries.d.ts.map +1 -1
  133. package/lib/dist/graph/queries.js +13 -40
  134. package/lib/dist/graph/queries.js.map +1 -1
  135. package/lib/dist/graph/traversal.d.ts.map +1 -1
  136. package/lib/dist/graph/traversal.js +16 -4
  137. package/lib/dist/graph/traversal.js.map +1 -1
  138. package/lib/dist/index.d.ts +34 -2
  139. package/lib/dist/index.d.ts.map +1 -1
  140. package/lib/dist/index.js +90 -8
  141. package/lib/dist/index.js.map +1 -1
  142. package/lib/dist/installer/index.d.ts.map +1 -1
  143. package/lib/dist/installer/index.js +52 -2
  144. package/lib/dist/installer/index.js.map +1 -1
  145. package/lib/dist/installer/instructions-template.d.ts +34 -11
  146. package/lib/dist/installer/instructions-template.d.ts.map +1 -1
  147. package/lib/dist/installer/instructions-template.js +44 -12
  148. package/lib/dist/installer/instructions-template.js.map +1 -1
  149. package/lib/dist/installer/targets/claude.d.ts.map +1 -1
  150. package/lib/dist/installer/targets/claude.js +6 -10
  151. package/lib/dist/installer/targets/claude.js.map +1 -1
  152. package/lib/dist/installer/targets/codex.js +4 -6
  153. package/lib/dist/installer/targets/codex.js.map +1 -1
  154. package/lib/dist/installer/targets/gemini.js +4 -6
  155. package/lib/dist/installer/targets/gemini.js.map +1 -1
  156. package/lib/dist/installer/targets/opencode.d.ts +9 -1
  157. package/lib/dist/installer/targets/opencode.d.ts.map +1 -1
  158. package/lib/dist/installer/targets/opencode.js +91 -40
  159. package/lib/dist/installer/targets/opencode.js.map +1 -1
  160. package/lib/dist/installer/targets/shared.d.ts +14 -0
  161. package/lib/dist/installer/targets/shared.d.ts.map +1 -1
  162. package/lib/dist/installer/targets/shared.js +16 -0
  163. package/lib/dist/installer/targets/shared.js.map +1 -1
  164. package/lib/dist/mcp/daemon.d.ts +60 -1
  165. package/lib/dist/mcp/daemon.d.ts.map +1 -1
  166. package/lib/dist/mcp/daemon.js +221 -8
  167. package/lib/dist/mcp/daemon.js.map +1 -1
  168. package/lib/dist/mcp/dynamic-boundaries.d.ts +41 -0
  169. package/lib/dist/mcp/dynamic-boundaries.d.ts.map +1 -0
  170. package/lib/dist/mcp/dynamic-boundaries.js +359 -0
  171. package/lib/dist/mcp/dynamic-boundaries.js.map +1 -0
  172. package/lib/dist/mcp/index.d.ts.map +1 -1
  173. package/lib/dist/mcp/index.js +18 -9
  174. package/lib/dist/mcp/index.js.map +1 -1
  175. package/lib/dist/mcp/ppid-watchdog.d.ts +44 -0
  176. package/lib/dist/mcp/ppid-watchdog.d.ts.map +1 -0
  177. package/lib/dist/mcp/ppid-watchdog.js +27 -0
  178. package/lib/dist/mcp/ppid-watchdog.js.map +1 -0
  179. package/lib/dist/mcp/proxy.d.ts +6 -0
  180. package/lib/dist/mcp/proxy.d.ts.map +1 -1
  181. package/lib/dist/mcp/proxy.js +153 -24
  182. package/lib/dist/mcp/proxy.js.map +1 -1
  183. package/lib/dist/mcp/server-instructions.d.ts +12 -1
  184. package/lib/dist/mcp/server-instructions.d.ts.map +1 -1
  185. package/lib/dist/mcp/server-instructions.js +43 -16
  186. package/lib/dist/mcp/server-instructions.js.map +1 -1
  187. package/lib/dist/mcp/session.d.ts +2 -0
  188. package/lib/dist/mcp/session.d.ts.map +1 -1
  189. package/lib/dist/mcp/session.js +49 -2
  190. package/lib/dist/mcp/session.js.map +1 -1
  191. package/lib/dist/mcp/stdin-teardown.d.ts +27 -0
  192. package/lib/dist/mcp/stdin-teardown.d.ts.map +1 -0
  193. package/lib/dist/mcp/stdin-teardown.js +49 -0
  194. package/lib/dist/mcp/stdin-teardown.js.map +1 -0
  195. package/lib/dist/mcp/tools.d.ts +71 -0
  196. package/lib/dist/mcp/tools.d.ts.map +1 -1
  197. package/lib/dist/mcp/tools.js +703 -85
  198. package/lib/dist/mcp/tools.js.map +1 -1
  199. package/lib/dist/mcp/transport.d.ts.map +1 -1
  200. package/lib/dist/mcp/transport.js +18 -2
  201. package/lib/dist/mcp/transport.js.map +1 -1
  202. package/lib/dist/resolution/callback-synthesizer.d.ts +3 -3
  203. package/lib/dist/resolution/callback-synthesizer.d.ts.map +1 -1
  204. package/lib/dist/resolution/callback-synthesizer.js +549 -21
  205. package/lib/dist/resolution/callback-synthesizer.js.map +1 -1
  206. package/lib/dist/resolution/frameworks/astro.d.ts +9 -0
  207. package/lib/dist/resolution/frameworks/astro.d.ts.map +1 -0
  208. package/lib/dist/resolution/frameworks/astro.js +169 -0
  209. package/lib/dist/resolution/frameworks/astro.js.map +1 -0
  210. package/lib/dist/resolution/frameworks/expo-modules.d.ts.map +1 -1
  211. package/lib/dist/resolution/frameworks/expo-modules.js +6 -1
  212. package/lib/dist/resolution/frameworks/expo-modules.js.map +1 -1
  213. package/lib/dist/resolution/frameworks/index.d.ts +1 -0
  214. package/lib/dist/resolution/frameworks/index.d.ts.map +1 -1
  215. package/lib/dist/resolution/frameworks/index.js +5 -1
  216. package/lib/dist/resolution/frameworks/index.js.map +1 -1
  217. package/lib/dist/resolution/frameworks/java.js +6 -1
  218. package/lib/dist/resolution/frameworks/java.js.map +1 -1
  219. package/lib/dist/resolution/frameworks/python.d.ts.map +1 -1
  220. package/lib/dist/resolution/frameworks/python.js +7 -3
  221. package/lib/dist/resolution/frameworks/python.js.map +1 -1
  222. package/lib/dist/resolution/frameworks/react-native.d.ts.map +1 -1
  223. package/lib/dist/resolution/frameworks/react-native.js +53 -3
  224. package/lib/dist/resolution/frameworks/react-native.js.map +1 -1
  225. package/lib/dist/resolution/frameworks/react.d.ts.map +1 -1
  226. package/lib/dist/resolution/frameworks/react.js +15 -3
  227. package/lib/dist/resolution/frameworks/react.js.map +1 -1
  228. package/lib/dist/resolution/frameworks/svelte.js +5 -1
  229. package/lib/dist/resolution/frameworks/svelte.js.map +1 -1
  230. package/lib/dist/resolution/frameworks/vue.js +24 -27
  231. package/lib/dist/resolution/frameworks/vue.js.map +1 -1
  232. package/lib/dist/resolution/import-resolver.d.ts +10 -0
  233. package/lib/dist/resolution/import-resolver.d.ts.map +1 -1
  234. package/lib/dist/resolution/import-resolver.js +564 -2
  235. package/lib/dist/resolution/import-resolver.js.map +1 -1
  236. package/lib/dist/resolution/index.d.ts +80 -0
  237. package/lib/dist/resolution/index.d.ts.map +1 -1
  238. package/lib/dist/resolution/index.js +457 -7
  239. package/lib/dist/resolution/index.js.map +1 -1
  240. package/lib/dist/resolution/name-matcher.d.ts +61 -0
  241. package/lib/dist/resolution/name-matcher.d.ts.map +1 -1
  242. package/lib/dist/resolution/name-matcher.js +590 -14
  243. package/lib/dist/resolution/name-matcher.js.map +1 -1
  244. package/lib/dist/resolution/types.d.ts +27 -3
  245. package/lib/dist/resolution/types.d.ts.map +1 -1
  246. package/lib/dist/resolution/workspace-packages.d.ts +48 -0
  247. package/lib/dist/resolution/workspace-packages.d.ts.map +1 -0
  248. package/lib/dist/resolution/workspace-packages.js +208 -0
  249. package/lib/dist/resolution/workspace-packages.js.map +1 -0
  250. package/lib/dist/search/query-utils.d.ts +17 -1
  251. package/lib/dist/search/query-utils.d.ts.map +1 -1
  252. package/lib/dist/search/query-utils.js +79 -10
  253. package/lib/dist/search/query-utils.js.map +1 -1
  254. package/lib/dist/sync/watcher.d.ts +124 -32
  255. package/lib/dist/sync/watcher.d.ts.map +1 -1
  256. package/lib/dist/sync/watcher.js +326 -111
  257. package/lib/dist/sync/watcher.js.map +1 -1
  258. package/lib/dist/telemetry/index.d.ts +146 -0
  259. package/lib/dist/telemetry/index.d.ts.map +1 -0
  260. package/lib/dist/telemetry/index.js +544 -0
  261. package/lib/dist/telemetry/index.js.map +1 -0
  262. package/lib/dist/types.d.ts +17 -2
  263. package/lib/dist/types.d.ts.map +1 -1
  264. package/lib/dist/types.js +3 -0
  265. package/lib/dist/types.js.map +1 -1
  266. package/lib/dist/upgrade/index.d.ts +132 -0
  267. package/lib/dist/upgrade/index.d.ts.map +1 -0
  268. package/lib/dist/upgrade/index.js +462 -0
  269. package/lib/dist/upgrade/index.js.map +1 -0
  270. package/lib/dist/utils.d.ts +30 -24
  271. package/lib/dist/utils.d.ts.map +1 -1
  272. package/lib/dist/utils.js +64 -48
  273. package/lib/dist/utils.js.map +1 -1
  274. package/lib/node_modules/.package-lock.json +1 -29
  275. package/lib/package.json +1 -2
  276. package/package.json +1 -1
  277. package/lib/node_modules/chokidar/LICENSE +0 -21
  278. package/lib/node_modules/chokidar/README.md +0 -305
  279. package/lib/node_modules/chokidar/esm/handler.d.ts +0 -90
  280. package/lib/node_modules/chokidar/esm/handler.js +0 -629
  281. package/lib/node_modules/chokidar/esm/index.d.ts +0 -215
  282. package/lib/node_modules/chokidar/esm/index.js +0 -798
  283. package/lib/node_modules/chokidar/esm/package.json +0 -1
  284. package/lib/node_modules/chokidar/handler.d.ts +0 -90
  285. package/lib/node_modules/chokidar/handler.js +0 -635
  286. package/lib/node_modules/chokidar/index.d.ts +0 -215
  287. package/lib/node_modules/chokidar/index.js +0 -804
  288. package/lib/node_modules/chokidar/package.json +0 -69
  289. package/lib/node_modules/readdirp/LICENSE +0 -21
  290. package/lib/node_modules/readdirp/README.md +0 -120
  291. package/lib/node_modules/readdirp/esm/index.d.ts +0 -108
  292. package/lib/node_modules/readdirp/esm/index.js +0 -257
  293. package/lib/node_modules/readdirp/esm/package.json +0 -1
  294. package/lib/node_modules/readdirp/index.d.ts +0 -108
  295. package/lib/node_modules/readdirp/index.js +0 -263
  296. package/lib/node_modules/readdirp/package.json +0 -70
@@ -5,14 +5,31 @@
5
5
  * Watches the project directory for file changes and triggers debounced sync
6
6
  * operations to keep the code graph up-to-date.
7
7
  *
8
- * Uses chokidar, whose `ignored` callback filters directories BEFORE they are
9
- * watched so we never register inotify watches on excluded trees like
10
- * node_modules/, dist/, .git/ (fixes #276: recursive fs.watch exhausted the
11
- * kernel watch budget on large repos). The ignore decision reuses the indexer's
12
- * `buildDefaultIgnore` (built-in default-ignore dirs + the project's .gitignore)
13
- * so the watcher watches exactly the set the indexer indexes — in particular,
14
- * node_modules/build/cache dirs are excluded even when the repo has no
15
- * .gitignore (#407), which a .gitignore-only filter would miss.
8
+ * Uses Node's built-in `fs.watch` directly (no third-party watcher, no native
9
+ * addon) with a per-platform strategy chosen to keep the open-descriptor /
10
+ * kernel-watch cost BOUNDED rather than growing with the number of files:
11
+ *
12
+ * - macOS / Windows: a SINGLE recursive `fs.watch(root, {recursive:true})`.
13
+ * libuv maps this to one FSEvents stream (macOS) / one
14
+ * ReadDirectoryChangesW handle (Windows), so it costs O(1) descriptors no
15
+ * matter how large the tree. This is the fix for the macOS file-table
16
+ * exhaustion (#644 / #496 / #555 / #628): the previous watcher held one
17
+ * open fd PER WATCHED FILE on macOS (tens of thousands of REG fds), which
18
+ * exhausted `kern.maxfiles` and crashed unrelated processes system-wide.
19
+ *
20
+ * - Linux: recursive `fs.watch` is unsupported, so we watch each (non-ignored)
21
+ * DIRECTORY with one inotify watch — O(directories), NOT O(files). New
22
+ * directories are picked up dynamically and an overall watch cap bounds
23
+ * inotify usage on pathological monorepos (#579). A single inotify watch on
24
+ * a directory already reports create/modify/delete for its children, so
25
+ * per-file watches are never needed.
26
+ *
27
+ * Excluded trees (node_modules/, dist/, .git/, …) are filtered via the
28
+ * indexer's `buildScopeIgnore` (built-in default-ignore dirs + the project's
29
+ * .gitignore) — on Linux they're never descended into (so they cost no watch),
30
+ * and on macOS/Windows the single recursive stream still covers them but their
31
+ * events are dropped before any sync is scheduled. Either way the watcher's
32
+ * scope matches the indexer's (#276 / #407).
16
33
  */
17
34
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
35
  if (k2 === undefined) k2 = k;
@@ -47,17 +64,51 @@ var __importStar = (this && this.__importStar) || (function () {
47
64
  return result;
48
65
  };
49
66
  })();
50
- var __importDefault = (this && this.__importDefault) || function (mod) {
51
- return (mod && mod.__esModule) ? mod : { "default": mod };
52
- };
53
67
  Object.defineProperty(exports, "__esModule", { value: true });
54
68
  exports.FileWatcher = exports.LockUnavailableError = void 0;
69
+ exports.__emitWatchEventForTests = __emitWatchEventForTests;
70
+ const fs = __importStar(require("fs"));
55
71
  const path = __importStar(require("path"));
56
- const chokidar_1 = __importDefault(require("chokidar"));
57
72
  const extraction_1 = require("../extraction");
58
73
  const errors_1 = require("../errors");
59
74
  const utils_1 = require("../utils");
75
+ const directory_1 = require("../directory");
60
76
  const watch_policy_1 = require("./watch-policy");
77
+ /**
78
+ * Native recursive `fs.watch` is only reliable on macOS and Windows; on Linux
79
+ * (and AIX) it throws `ERR_FEATURE_UNAVAILABLE_ON_PLATFORM`. We branch on this
80
+ * to pick the recursive vs per-directory strategy.
81
+ */
82
+ function supportsRecursiveWatch() {
83
+ return process.platform === 'darwin' || process.platform === 'win32';
84
+ }
85
+ /**
86
+ * Upper bound on simultaneously-watched directories on the Linux per-directory
87
+ * path. Each is one inotify watch; the kernel's `fs.inotify.max_user_watches`
88
+ * is the hard limit (commonly 8k–128k). We stop adding watches past this and
89
+ * log once — partial live-watch (with `codegraph sync` as the backstop) is far
90
+ * better than exhausting the user's inotify budget and breaking watching
91
+ * system-wide (#579). Tunable via CODEGRAPH_MAX_DIR_WATCHES.
92
+ */
93
+ const DEFAULT_MAX_DIR_WATCHES = 50_000;
94
+ function maxDirWatches() {
95
+ const raw = process.env.CODEGRAPH_MAX_DIR_WATCHES;
96
+ if (raw && /^\d+$/.test(raw)) {
97
+ const n = Number(raw);
98
+ if (n > 0)
99
+ return n;
100
+ }
101
+ return DEFAULT_MAX_DIR_WATCHES;
102
+ }
103
+ /**
104
+ * Test seam (see {@link __emitWatchEventForTests}). Maps a watcher's project
105
+ * root to its live instance so tests can synthesize a change event
106
+ * deterministically — real fs.watch delivery latency races under parallel
107
+ * vitest (the reason the previous chokidar mock existed). Only populated under
108
+ * a test runner, so production carries no bookkeeping or retained references.
109
+ */
110
+ const liveWatchersForTests = new Map();
111
+ const IS_TEST_RUNTIME = !!(process.env.VITEST || process.env.NODE_ENV === 'test');
61
112
  /**
62
113
  * Thrown by a `syncFn` to signal that the underlying sync couldn't acquire
63
114
  * the cross-process write lock (#449). The watcher treats this as "no
@@ -77,8 +128,9 @@ exports.LockUnavailableError = LockUnavailableError;
77
128
  * debounced sync operations via a provided callback.
78
129
  *
79
130
  * Design goals:
80
- * - Minimal resource usage (chokidar filters excluded directories before
81
- * registering an inotify watch see module docs / #276)
131
+ * - Bounded resource usage: O(1) descriptors on macOS/Windows (one recursive
132
+ * watch), O(directories) inotify watches on Linux never O(files), which
133
+ * was the system-crashing fd leak on macOS (#644/#496/#555/#628).
82
134
  * - Debounced to avoid thrashing on rapid saves
83
135
  * - Filters to supported source files by extension
84
136
  * - Ignores .codegraph/ and .git/ regardless of .gitignore
@@ -86,11 +138,18 @@ exports.LockUnavailableError = LockUnavailableError;
86
138
  * without blocking on a sync (issue #403)
87
139
  */
88
140
  class FileWatcher {
89
- watcher = null;
141
+ /** macOS/Windows: the single recursive watcher. Null on Linux. */
142
+ recursiveWatcher = null;
143
+ /** Linux: one watcher per watched directory (keyed by absolute path). */
144
+ dirWatchers = new Map();
145
+ /** Set once the per-directory watch cap is hit, so we log only once. */
146
+ dirCapWarned = false;
147
+ /** Test-only inert mode: started, but with no OS watcher installed. */
148
+ inert = false;
90
149
  debounceTimer = null;
91
150
  /**
92
151
  * Files seen by the watcher since the last successful sync — populated on
93
- * every chokidar event, cleared at the start of a sync, and re-populated by
152
+ * every change event, cleared at the start of a sync, and re-populated by
94
153
  * events that arrive mid-sync (or restored on sync failure). Keyed by the
95
154
  * same project-relative POSIX path the rest of the codebase uses, so a
96
155
  * caller can intersect tool-response file paths against this map cheaply.
@@ -106,41 +165,46 @@ class FileWatcher {
106
165
  syncing = false;
107
166
  stopped = false;
108
167
  /**
109
- * False until chokidar fires its `ready` event. Gates `pendingFiles`
110
- * insertion so the initial crawl's `add` events (one per pre-existing
111
- * source file) don't pollute the per-file staleness signal. The events
112
- * still flow into `scheduleSync()` to preserve the previous "initial
113
- * scan triggers a reconciling sync" behavior.
168
+ * True once the initial watch set is established. Unlike the previous
169
+ * chokidar implementation there is no asynchronous initial "crawl" emitting
170
+ * an `add` per existing file `fs.watch` only reports changes from the
171
+ * moment it's installed so this flips to true synchronously at the end of
172
+ * `start()`. The startup reconcile against on-disk state is handled
173
+ * separately by the engine's catch-up sync, not by the watcher.
114
174
  */
115
- chokidarReady = false;
175
+ ready = false;
116
176
  /**
117
- * Callbacks that resolve when chokidar fires `ready`. Used by tests (and
118
- * any production caller that cares about a clean baseline) to deterministically
119
- * gate on the end of the initial scan instead of guessing at a sleep duration.
177
+ * Callbacks that resolve when the watch set is established. Used by tests
178
+ * (and any production caller that cares about a clean baseline) to
179
+ * deterministically gate on watcher readiness.
120
180
  */
121
181
  readyWaiters = [];
122
- // The shared ignore matcher (built-in defaults + project .gitignore), built
123
- // once at start(). Same source of truth the indexer uses, so watcher scope
124
- // can never diverge from index scope.
182
+ // The shared scope matcher (built-in defaults + project .gitignore, with
183
+ // embedded child repos matched by their OWN rules #514), built once at
184
+ // start(). Same source of truth the indexer uses, so watcher scope can
185
+ // never diverge from index scope. An embedded repo created after start()
186
+ // joins the scope on the next watcher restart / re-index.
125
187
  ignoreMatcher = null;
126
188
  projectRoot;
127
189
  debounceMs;
128
190
  syncFn;
129
191
  onSyncComplete;
130
192
  onSyncError;
193
+ inertForTests;
131
194
  constructor(projectRoot, syncFn, options = {}) {
132
195
  this.projectRoot = projectRoot;
133
196
  this.syncFn = syncFn;
134
197
  this.debounceMs = options.debounceMs ?? 2000;
135
198
  this.onSyncComplete = options.onSyncComplete;
136
199
  this.onSyncError = options.onSyncError;
200
+ this.inertForTests = options.inertForTests ?? false;
137
201
  }
138
202
  /**
139
203
  * Start watching for file changes.
140
204
  * Returns true if watching started successfully, false otherwise.
141
205
  */
142
206
  start() {
143
- if (this.watcher)
207
+ if (this.recursiveWatcher || this.dirWatchers.size > 0 || this.inert)
144
208
  return true; // Already watching
145
209
  this.stopped = false;
146
210
  // Some environments make filesystem watching unusable — most notably
@@ -153,97 +217,207 @@ class FileWatcher {
153
217
  return false;
154
218
  }
155
219
  // Reuse the indexer's ignore set so the watcher and indexer agree on scope.
156
- // chokidar only registers an inotify watch on directories that pass this
157
- // filter — that's the #276 fix.
158
- this.ignoreMatcher = (0, extraction_1.buildDefaultIgnore)(this.projectRoot);
220
+ this.ignoreMatcher = (0, extraction_1.buildScopeIgnore)(this.projectRoot);
159
221
  try {
160
- this.watcher = chokidar_1.default.watch(this.projectRoot, {
161
- // chokidar calls this for every path it encounters and only watches
162
- // those that pass — so excluded trees (node_modules/, dist/, .git/, …)
163
- // never get an inotify watch in the first place.
164
- ignored: (testPath, stats) => this.shouldIgnore(testPath, stats),
165
- });
166
- // Chokidar emits `add` for every pre-existing source file during its
167
- // initial scan. Those events should still trigger the post-startup
168
- // reconciling sync (preserving prior behavior), but they must NOT land
169
- // in pendingFiles — otherwise every file in the project shows up as
170
- // "edited but not indexed" on startup, which is the opposite of the
171
- // signal #403 is supposed to provide. Flip the flag on chokidar's
172
- // `ready` event; from then on, real edits populate pendingFiles.
173
- //
174
- // We also clear `pendingFiles` here as defense-in-depth: chokidar can
175
- // emit late initial-scan `add` events via setImmediate AFTER the
176
- // `ready` callback runs (observed under test-parallelism load).
177
- // Clearing once at ready guarantees a clean baseline; real subsequent
178
- // edits repopulate the set normally.
179
- this.watcher.on('ready', () => {
180
- this.chokidarReady = true;
181
- this.pendingFiles.clear();
182
- for (const cb of this.readyWaiters)
183
- cb();
184
- this.readyWaiters.length = 0;
185
- });
186
- // chokidar emits 'all' for every event type; we only sync source files.
187
- this.watcher.on('all', (_event, filePath) => {
188
- if (this.stopped)
189
- return;
190
- const normalized = (0, utils_1.normalizePath)(path.relative(this.projectRoot, filePath));
191
- // Defense in depth: `ignored` should already keep these out, but events
192
- // can still arrive during setup or via symlink traversal.
193
- if (this.isAlwaysIgnored(normalized))
194
- return;
195
- if (!(0, extraction_1.isSourceFile)(normalized))
196
- return;
197
- (0, errors_1.logDebug)('File change detected', { file: normalized });
198
- // Only track events from after chokidar's initial scan as pending
199
- // edits — pre-existing files on disk are already represented by
200
- // (or about to be reconciled by) the index, not a user edit.
201
- if (this.chokidarReady) {
202
- const now = Date.now();
203
- const existing = this.pendingFiles.get(normalized);
204
- this.pendingFiles.set(normalized, {
205
- firstSeenMs: existing?.firstSeenMs ?? now,
206
- lastSeenMs: now,
207
- });
208
- }
209
- this.scheduleSync();
210
- });
211
- // Handle watcher errors gracefully — don't crash, the user can restart.
212
- this.watcher.on('error', (err) => {
213
- (0, errors_1.logWarn)('File watcher error', { error: String(err) });
222
+ if (this.inertForTests) {
223
+ // Test-only: install no OS watcher; the seam drives events instead.
224
+ this.inert = true;
225
+ }
226
+ else if (supportsRecursiveWatch()) {
227
+ this.startRecursive();
228
+ }
229
+ else {
230
+ this.startPerDirectory();
231
+ }
232
+ // No async crawl to wait on: as soon as the watch set is installed we
233
+ // have a clean baseline (pendingFiles is only populated by post-start
234
+ // events). Clear defensively and flip ready.
235
+ this.pendingFiles.clear();
236
+ this.ready = true;
237
+ for (const cb of this.readyWaiters)
238
+ cb();
239
+ this.readyWaiters.length = 0;
240
+ if (IS_TEST_RUNTIME)
241
+ liveWatchersForTests.set(this.projectRoot, this);
242
+ (0, errors_1.logDebug)('File watcher started', {
243
+ projectRoot: this.projectRoot,
244
+ debounceMs: this.debounceMs,
245
+ mode: this.inertForTests ? 'inert' : supportsRecursiveWatch() ? 'recursive' : 'per-directory',
246
+ watchedDirs: this.dirWatchers.size || undefined,
214
247
  });
215
- (0, errors_1.logDebug)('File watcher started', { projectRoot: this.projectRoot, debounceMs: this.debounceMs });
216
248
  return true;
217
249
  }
218
250
  catch (err) {
219
251
  // Watcher setup failed (e.g., permission denied, missing directory).
220
252
  (0, errors_1.logWarn)('Could not start file watcher', { error: String(err) });
253
+ this.stop();
221
254
  return false;
222
255
  }
223
256
  }
257
+ /**
258
+ * macOS/Windows: one recursive watcher for the whole tree. O(1) descriptors.
259
+ * `filename` arrives relative to the project root (with subdirectories), so
260
+ * it maps straight to a project-relative path.
261
+ */
262
+ startRecursive() {
263
+ this.recursiveWatcher = fs.watch(this.projectRoot, { recursive: true, persistent: true }, (_event, filename) => {
264
+ if (this.stopped || filename == null)
265
+ return;
266
+ this.handleChange((0, utils_1.normalizePath)(String(filename)));
267
+ });
268
+ this.recursiveWatcher.on('error', (err) => {
269
+ (0, errors_1.logWarn)('File watcher error', { error: String(err) });
270
+ });
271
+ }
272
+ /**
273
+ * Linux: walk the (non-ignored) tree and watch each directory. One inotify
274
+ * watch per directory reports create/modify/delete for that directory's
275
+ * direct children, so we never watch individual files.
276
+ */
277
+ startPerDirectory() {
278
+ this.watchTree(this.projectRoot, /* markExisting */ false);
279
+ }
280
+ /**
281
+ * Add an inotify watch for `dir` and recurse into its non-ignored
282
+ * subdirectories. When `markExisting` is true (a directory that appeared
283
+ * AFTER startup), the source files already inside it are recorded as pending
284
+ * — this closes the `mkdir + write` race where files created before the new
285
+ * directory's watch is installed would otherwise be missed until the next
286
+ * full sync. The initial startup walk passes false (the engine's catch-up
287
+ * sync owns the baseline).
288
+ */
289
+ watchTree(dir, markExisting) {
290
+ if (this.dirWatchers.has(dir))
291
+ return;
292
+ if (this.dirWatchers.size >= maxDirWatches()) {
293
+ if (!this.dirCapWarned) {
294
+ this.dirCapWarned = true;
295
+ (0, errors_1.logWarn)('File watcher hit directory-watch cap; remaining subtrees rely on manual/periodic sync', {
296
+ cap: maxDirWatches(),
297
+ });
298
+ }
299
+ return;
300
+ }
301
+ let w;
302
+ try {
303
+ w = fs.watch(dir, { persistent: true }, (_event, filename) => this.handleDirEvent(dir, filename));
304
+ }
305
+ catch {
306
+ // ENOENT / EACCES / too-many-open-files — skip this directory quietly.
307
+ return;
308
+ }
309
+ w.on('error', () => this.unwatchDir(dir));
310
+ this.dirWatchers.set(dir, w);
311
+ let entries;
312
+ try {
313
+ entries = fs.readdirSync(dir, { withFileTypes: true });
314
+ }
315
+ catch {
316
+ return;
317
+ }
318
+ for (const entry of entries) {
319
+ const child = path.join(dir, entry.name);
320
+ if (entry.isDirectory()) {
321
+ if (this.shouldIgnoreDir(child))
322
+ continue;
323
+ this.watchTree(child, markExisting);
324
+ }
325
+ else if (markExisting && entry.isFile()) {
326
+ this.handleChange((0, utils_1.normalizePath)(path.relative(this.projectRoot, child)));
327
+ }
328
+ }
329
+ }
330
+ /**
331
+ * Linux per-directory event handler. `filename` is relative to `dir`. A new
332
+ * sub-directory is picked up by extending the watch tree; everything else is
333
+ * routed through the shared change handler.
334
+ */
335
+ handleDirEvent(dir, filename) {
336
+ if (this.stopped || filename == null)
337
+ return;
338
+ const full = path.join(dir, String(filename));
339
+ // A newly-created directory needs its own watch (recursive isn't available
340
+ // on Linux). statSync is cheap and these events are rare relative to file
341
+ // edits. If the path vanished (rapid create/delete) the stat throws and we
342
+ // fall through to the change handler, which no-ops on a non-source path.
343
+ try {
344
+ if (fs.statSync(full).isDirectory()) {
345
+ if (!this.shouldIgnoreDir(full))
346
+ this.watchTree(full, /* markExisting */ true);
347
+ return;
348
+ }
349
+ }
350
+ catch {
351
+ // deleted/inaccessible — treat as a normal change below
352
+ }
353
+ this.handleChange((0, utils_1.normalizePath)(path.relative(this.projectRoot, full)));
354
+ }
355
+ /**
356
+ * Shared change handler for both watch strategies. `rel` is a
357
+ * project-relative POSIX path. Applies the ignore + source-file filters and,
358
+ * for a real source change, records it as pending (#403) and schedules a
359
+ * debounced sync.
360
+ *
361
+ * The recursive (macOS/Windows) watcher reports events for ignored trees too
362
+ * (one stream covers the whole repo), so the ignore check here is load-bearing
363
+ * — it drops node_modules/dist/.git churn before any sync is scheduled.
364
+ */
365
+ handleChange(rel) {
366
+ if (!rel || rel === '.' || rel.startsWith('..'))
367
+ return;
368
+ if (this.isAlwaysIgnored(rel))
369
+ return;
370
+ if (this.ignoreMatcher && this.ignoreMatcher.ignores(rel))
371
+ return;
372
+ if (!(0, extraction_1.isSourceFile)(rel))
373
+ return;
374
+ (0, errors_1.logDebug)('File change detected', { file: rel });
375
+ if (this.ready) {
376
+ const now = Date.now();
377
+ const existing = this.pendingFiles.get(rel);
378
+ this.pendingFiles.set(rel, {
379
+ firstSeenMs: existing?.firstSeenMs ?? now,
380
+ lastSeenMs: now,
381
+ });
382
+ }
383
+ this.scheduleSync();
384
+ }
385
+ /** Close and forget the watch for a directory that errored/was removed. */
386
+ unwatchDir(dir) {
387
+ const w = this.dirWatchers.get(dir);
388
+ if (w) {
389
+ try {
390
+ w.close();
391
+ }
392
+ catch {
393
+ /* already closed */
394
+ }
395
+ this.dirWatchers.delete(dir);
396
+ }
397
+ }
224
398
  /** Our own dirs are always ignored, regardless of .gitignore. */
225
399
  isAlwaysIgnored(rel) {
226
- return (rel === '.codegraph' || rel.startsWith('.codegraph/') ||
400
+ // First path segment. Ignore any CodeGraph data dir — the active one AND a
401
+ // sibling like `.codegraph-win` a second environment (Windows/WSL) created
402
+ // in the same tree, so neither side watches the other's index (#636).
403
+ const top = rel.split('/')[0] ?? rel;
404
+ return ((0, directory_1.isCodeGraphDataDir)(top) ||
227
405
  rel === '.git' || rel.startsWith('.git/'));
228
406
  }
229
407
  /**
230
- * chokidar `ignored` predicate — true for any path that should NOT be watched.
231
- * Uses chokidar's provided `stats` to decide directory-vs-file so a dir-only
232
- * rule like `build/` matches, without an extra `statSync` per path.
408
+ * True for any directory that should NOT be watched (used while building the
409
+ * Linux per-directory watch tree). Tests the directory form of the path so a
410
+ * dir-only ignore rule like `build/` matches.
233
411
  */
234
- shouldIgnore(testPath, stats) {
235
- const rel = (0, utils_1.normalizePath)(path.relative(this.projectRoot, testPath));
412
+ shouldIgnoreDir(dirPath) {
413
+ const rel = (0, utils_1.normalizePath)(path.relative(this.projectRoot, dirPath));
236
414
  if (!rel || rel === '.' || rel.startsWith('..'))
237
415
  return false; // root / outside
238
416
  if (this.isAlwaysIgnored(rel))
239
417
  return true;
240
418
  if (!this.ignoreMatcher)
241
419
  return false;
242
- if (stats) {
243
- return this.ignoreMatcher.ignores(stats.isDirectory() ? rel + '/' : rel);
244
- }
245
- // Stats unknown: test both forms so a directory match isn't missed.
246
- return this.ignoreMatcher.ignores(rel) || this.ignoreMatcher.ignores(rel + '/');
420
+ return this.ignoreMatcher.ignores(rel + '/');
247
421
  }
248
422
  /**
249
423
  * Stop watching for file changes.
@@ -254,34 +428,60 @@ class FileWatcher {
254
428
  clearTimeout(this.debounceTimer);
255
429
  this.debounceTimer = null;
256
430
  }
257
- if (this.watcher) {
258
- this.watcher.close();
259
- this.watcher = null;
431
+ if (this.recursiveWatcher) {
432
+ try {
433
+ this.recursiveWatcher.close();
434
+ }
435
+ catch {
436
+ /* already closed */
437
+ }
438
+ this.recursiveWatcher = null;
260
439
  }
440
+ for (const w of this.dirWatchers.values()) {
441
+ try {
442
+ w.close();
443
+ }
444
+ catch {
445
+ /* already closed */
446
+ }
447
+ }
448
+ this.dirWatchers.clear();
449
+ this.dirCapWarned = false;
450
+ this.inert = false;
261
451
  this.pendingFiles.clear();
262
- this.chokidarReady = false;
452
+ this.ready = false;
263
453
  this.ignoreMatcher = null;
454
+ if (IS_TEST_RUNTIME)
455
+ liveWatchersForTests.delete(this.projectRoot);
264
456
  (0, errors_1.logDebug)('File watcher stopped');
265
457
  }
458
+ /**
459
+ * @internal Test-only: feed a synthetic project-relative change through the
460
+ * same filter → pendingFiles → debounced-sync path a real fs.watch event
461
+ * takes. Lets the watcher / staleness-banner suites stay deterministic
462
+ * instead of racing on OS watch-delivery latency. See
463
+ * {@link __emitWatchEventForTests}.
464
+ */
465
+ ingestEventForTests(relPath) {
466
+ this.handleChange((0, utils_1.normalizePath)(relPath));
467
+ }
266
468
  /**
267
469
  * Whether the watcher is currently active.
268
470
  */
269
471
  isActive() {
270
- return this.watcher !== null && !this.stopped;
472
+ return (this.recursiveWatcher !== null || this.dirWatchers.size > 0 || this.inert) && !this.stopped;
271
473
  }
272
474
  /**
273
- * Resolves once chokidar has fired its `ready` event (or immediately if
274
- * it has already done so). Useful for tests that need a deterministic
275
- * boundary before asserting on `pendingFiles` — guessing a sleep duration
276
- * is flaky under load because chokidar can take longer than expected to
277
- * finish its initial crawl on slow filesystems / parallel test runs.
475
+ * Resolves once the watch set has been installed (or immediately if it
476
+ * already has). Useful for tests that need a deterministic boundary before
477
+ * asserting on `pendingFiles`.
278
478
  *
279
479
  * Production callers don't need this: `pendingFiles` is read continuously,
280
- * the staleness banner is always correct (empty or populated), and the
281
- * initial-scan window is a small one-time startup cost.
480
+ * the staleness banner is always correct (empty or populated), and there is
481
+ * no asynchronous initial-scan window with `fs.watch`.
282
482
  */
283
483
  waitUntilReady(timeoutMs = 10000) {
284
- if (this.chokidarReady)
484
+ if (this.ready)
285
485
  return Promise.resolve();
286
486
  return new Promise((resolve, reject) => {
287
487
  const t = setTimeout(() => {
@@ -395,4 +595,19 @@ class FileWatcher {
395
595
  }
396
596
  }
397
597
  exports.FileWatcher = FileWatcher;
598
+ /**
599
+ * Test-only: synthesize a source-file change for the live watcher running at
600
+ * `projectRoot`, exercising the real filter → pendingFiles → debounced-sync
601
+ * logic without depending on fs.watch delivery timing (which races under
602
+ * parallel vitest). `relPath` is project-relative POSIX (e.g. "src/foo.ts").
603
+ * Returns false if no live watcher is registered for that root (e.g. outside a
604
+ * test runtime, where the registry is intentionally not populated).
605
+ */
606
+ function __emitWatchEventForTests(projectRoot, relPath) {
607
+ const w = liveWatchersForTests.get(projectRoot);
608
+ if (!w)
609
+ return false;
610
+ w.ingestEventForTests(relPath);
611
+ return true;
612
+ }
398
613
  //# sourceMappingURL=watcher.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"watcher.js","sourceRoot":"","sources":["../../src/sync/watcher.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,2CAA6B;AAE7B,wDAA+C;AAE/C,8CAAiE;AACjE,sCAA8C;AAC9C,oCAAyC;AACzC,iDAAqD;AAwBrD;;;;;;GAMG;AACH,MAAa,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,OAAO,GAAG,6DAA6D;QACjF,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AALD,o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