homegraph 1.0.0 → 1.1.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.
Files changed (669) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +243 -0
  3. package/dist/bin/fatal-handler.d.ts +20 -0
  4. package/dist/bin/fatal-handler.d.ts.map +1 -0
  5. package/dist/bin/fatal-handler.js +118 -0
  6. package/dist/bin/fatal-handler.js.map +1 -0
  7. package/dist/bin/homegraph.d.ts +26 -0
  8. package/dist/bin/homegraph.d.ts.map +1 -0
  9. package/dist/bin/homegraph.js +1995 -0
  10. package/dist/bin/homegraph.js.map +1 -0
  11. package/dist/bin/node-version-check.d.ts +37 -0
  12. package/dist/bin/node-version-check.d.ts.map +1 -0
  13. package/dist/bin/node-version-check.js +79 -0
  14. package/dist/bin/node-version-check.js.map +1 -0
  15. package/dist/bin/uninstall.d.ts +14 -0
  16. package/dist/bin/uninstall.d.ts.map +1 -0
  17. package/dist/bin/uninstall.js +36 -0
  18. package/dist/bin/uninstall.js.map +1 -0
  19. package/dist/context/formatter.d.ts +30 -0
  20. package/dist/context/formatter.d.ts.map +1 -0
  21. package/dist/context/formatter.js +263 -0
  22. package/dist/context/formatter.js.map +1 -0
  23. package/dist/context/index.d.ts +119 -0
  24. package/dist/context/index.d.ts.map +1 -0
  25. package/dist/context/index.js +1296 -0
  26. package/dist/context/index.js.map +1 -0
  27. package/dist/context/markers.d.ts +19 -0
  28. package/dist/context/markers.d.ts.map +1 -0
  29. package/dist/context/markers.js +22 -0
  30. package/dist/context/markers.js.map +1 -0
  31. package/dist/db/index.d.ts +122 -0
  32. package/dist/db/index.d.ts.map +1 -0
  33. package/dist/db/index.js +296 -0
  34. package/dist/db/index.js.map +1 -0
  35. package/dist/db/migrations.d.ts +44 -0
  36. package/dist/db/migrations.d.ts.map +1 -0
  37. package/dist/db/migrations.js +140 -0
  38. package/dist/db/migrations.js.map +1 -0
  39. package/dist/db/queries.d.ts +406 -0
  40. package/dist/db/queries.d.ts.map +1 -0
  41. package/dist/db/queries.js +1605 -0
  42. package/dist/db/queries.js.map +1 -0
  43. package/dist/db/schema.sql +152 -0
  44. package/dist/db/sqlite-adapter.d.ts +53 -0
  45. package/dist/db/sqlite-adapter.d.ts.map +1 -0
  46. package/dist/db/sqlite-adapter.js +117 -0
  47. package/dist/db/sqlite-adapter.js.map +1 -0
  48. package/dist/directory.d.ts +138 -0
  49. package/dist/directory.d.ts.map +1 -0
  50. package/dist/directory.js +515 -0
  51. package/dist/directory.js.map +1 -0
  52. package/dist/errors.d.ts +136 -0
  53. package/dist/errors.d.ts.map +1 -0
  54. package/dist/errors.js +219 -0
  55. package/dist/errors.js.map +1 -0
  56. package/dist/extraction/astro-extractor.d.ts +79 -0
  57. package/dist/extraction/astro-extractor.d.ts.map +1 -0
  58. package/dist/extraction/astro-extractor.js +320 -0
  59. package/dist/extraction/astro-extractor.js.map +1 -0
  60. package/dist/extraction/context.d.ts +12 -0
  61. package/dist/extraction/context.d.ts.map +1 -0
  62. package/dist/extraction/context.js +29 -0
  63. package/dist/extraction/context.js.map +1 -0
  64. package/dist/extraction/dfm-extractor.d.ts +31 -0
  65. package/dist/extraction/dfm-extractor.d.ts.map +1 -0
  66. package/dist/extraction/dfm-extractor.js +151 -0
  67. package/dist/extraction/dfm-extractor.js.map +1 -0
  68. package/dist/extraction/extraction-version.d.ts +25 -0
  69. package/dist/extraction/extraction-version.d.ts.map +1 -0
  70. package/dist/extraction/extraction-version.js +28 -0
  71. package/dist/extraction/extraction-version.js.map +1 -0
  72. package/dist/extraction/function-ref.d.ts +118 -0
  73. package/dist/extraction/function-ref.d.ts.map +1 -0
  74. package/dist/extraction/function-ref.js +727 -0
  75. package/dist/extraction/function-ref.js.map +1 -0
  76. package/dist/extraction/generated-detection.d.ts +30 -0
  77. package/dist/extraction/generated-detection.d.ts.map +1 -0
  78. package/dist/extraction/generated-detection.js +83 -0
  79. package/dist/extraction/generated-detection.js.map +1 -0
  80. package/dist/extraction/grammars.d.ts +118 -0
  81. package/dist/extraction/grammars.d.ts.map +1 -0
  82. package/dist/extraction/grammars.js +499 -0
  83. package/dist/extraction/grammars.js.map +1 -0
  84. package/dist/extraction/index.d.ts +175 -0
  85. package/dist/extraction/index.d.ts.map +1 -0
  86. package/dist/extraction/index.js +1888 -0
  87. package/dist/extraction/index.js.map +1 -0
  88. package/dist/extraction/languages/arkts-viewtree.d.ts +22 -0
  89. package/dist/extraction/languages/arkts-viewtree.d.ts.map +1 -0
  90. package/dist/extraction/languages/arkts-viewtree.js +133 -0
  91. package/dist/extraction/languages/arkts-viewtree.js.map +1 -0
  92. package/dist/extraction/languages/arkts.d.ts +18 -0
  93. package/dist/extraction/languages/arkts.d.ts.map +1 -0
  94. package/dist/extraction/languages/arkts.js +1069 -0
  95. package/dist/extraction/languages/arkts.js.map +1 -0
  96. package/dist/extraction/languages/c-cpp.d.ts +12 -0
  97. package/dist/extraction/languages/c-cpp.d.ts.map +1 -0
  98. package/dist/extraction/languages/c-cpp.js +275 -0
  99. package/dist/extraction/languages/c-cpp.js.map +1 -0
  100. package/dist/extraction/languages/csharp.d.ts +25 -0
  101. package/dist/extraction/languages/csharp.d.ts.map +1 -0
  102. package/dist/extraction/languages/csharp.js +175 -0
  103. package/dist/extraction/languages/csharp.js.map +1 -0
  104. package/dist/extraction/languages/dart.d.ts +3 -0
  105. package/dist/extraction/languages/dart.d.ts.map +1 -0
  106. package/dist/extraction/languages/dart.js +374 -0
  107. package/dist/extraction/languages/dart.js.map +1 -0
  108. package/dist/extraction/languages/go.d.ts +3 -0
  109. package/dist/extraction/languages/go.d.ts.map +1 -0
  110. package/dist/extraction/languages/go.js +111 -0
  111. package/dist/extraction/languages/go.js.map +1 -0
  112. package/dist/extraction/languages/index.d.ts +10 -0
  113. package/dist/extraction/languages/index.d.ts.map +1 -0
  114. package/dist/extraction/languages/index.js +53 -0
  115. package/dist/extraction/languages/index.js.map +1 -0
  116. package/dist/extraction/languages/java.d.ts +3 -0
  117. package/dist/extraction/languages/java.d.ts.map +1 -0
  118. package/dist/extraction/languages/java.js +315 -0
  119. package/dist/extraction/languages/java.js.map +1 -0
  120. package/dist/extraction/languages/javascript.d.ts +3 -0
  121. package/dist/extraction/languages/javascript.d.ts.map +1 -0
  122. package/dist/extraction/languages/javascript.js +106 -0
  123. package/dist/extraction/languages/javascript.js.map +1 -0
  124. package/dist/extraction/languages/kotlin.d.ts +3 -0
  125. package/dist/extraction/languages/kotlin.d.ts.map +1 -0
  126. package/dist/extraction/languages/kotlin.js +379 -0
  127. package/dist/extraction/languages/kotlin.js.map +1 -0
  128. package/dist/extraction/languages/lua.d.ts +3 -0
  129. package/dist/extraction/languages/lua.d.ts.map +1 -0
  130. package/dist/extraction/languages/lua.js +150 -0
  131. package/dist/extraction/languages/lua.js.map +1 -0
  132. package/dist/extraction/languages/luau.d.ts +3 -0
  133. package/dist/extraction/languages/luau.d.ts.map +1 -0
  134. package/dist/extraction/languages/luau.js +37 -0
  135. package/dist/extraction/languages/luau.js.map +1 -0
  136. package/dist/extraction/languages/objc.d.ts +3 -0
  137. package/dist/extraction/languages/objc.d.ts.map +1 -0
  138. package/dist/extraction/languages/objc.js +175 -0
  139. package/dist/extraction/languages/objc.js.map +1 -0
  140. package/dist/extraction/languages/pascal.d.ts +3 -0
  141. package/dist/extraction/languages/pascal.d.ts.map +1 -0
  142. package/dist/extraction/languages/pascal.js +77 -0
  143. package/dist/extraction/languages/pascal.js.map +1 -0
  144. package/dist/extraction/languages/php.d.ts +3 -0
  145. package/dist/extraction/languages/php.d.ts.map +1 -0
  146. package/dist/extraction/languages/php.js +196 -0
  147. package/dist/extraction/languages/php.js.map +1 -0
  148. package/dist/extraction/languages/python.d.ts +3 -0
  149. package/dist/extraction/languages/python.d.ts.map +1 -0
  150. package/dist/extraction/languages/python.js +56 -0
  151. package/dist/extraction/languages/python.js.map +1 -0
  152. package/dist/extraction/languages/r.d.ts +3 -0
  153. package/dist/extraction/languages/r.d.ts.map +1 -0
  154. package/dist/extraction/languages/r.js +314 -0
  155. package/dist/extraction/languages/r.js.map +1 -0
  156. package/dist/extraction/languages/ruby.d.ts +3 -0
  157. package/dist/extraction/languages/ruby.d.ts.map +1 -0
  158. package/dist/extraction/languages/ruby.js +149 -0
  159. package/dist/extraction/languages/ruby.js.map +1 -0
  160. package/dist/extraction/languages/rust.d.ts +3 -0
  161. package/dist/extraction/languages/rust.d.ts.map +1 -0
  162. package/dist/extraction/languages/rust.js +142 -0
  163. package/dist/extraction/languages/rust.js.map +1 -0
  164. package/dist/extraction/languages/scala.d.ts +3 -0
  165. package/dist/extraction/languages/scala.d.ts.map +1 -0
  166. package/dist/extraction/languages/scala.js +209 -0
  167. package/dist/extraction/languages/scala.js.map +1 -0
  168. package/dist/extraction/languages/swift.d.ts +3 -0
  169. package/dist/extraction/languages/swift.d.ts.map +1 -0
  170. package/dist/extraction/languages/swift.js +152 -0
  171. package/dist/extraction/languages/swift.js.map +1 -0
  172. package/dist/extraction/languages/typescript.d.ts +16 -0
  173. package/dist/extraction/languages/typescript.d.ts.map +1 -0
  174. package/dist/extraction/languages/typescript.js +167 -0
  175. package/dist/extraction/languages/typescript.js.map +1 -0
  176. package/dist/extraction/liquid-extractor.d.ts +59 -0
  177. package/dist/extraction/liquid-extractor.d.ts.map +1 -0
  178. package/dist/extraction/liquid-extractor.js +357 -0
  179. package/dist/extraction/liquid-extractor.js.map +1 -0
  180. package/dist/extraction/mybatis-extractor.d.ts +48 -0
  181. package/dist/extraction/mybatis-extractor.d.ts.map +1 -0
  182. package/dist/extraction/mybatis-extractor.js +198 -0
  183. package/dist/extraction/mybatis-extractor.js.map +1 -0
  184. package/dist/extraction/parse-worker.d.ts +8 -0
  185. package/dist/extraction/parse-worker.d.ts.map +1 -0
  186. package/dist/extraction/parse-worker.js +97 -0
  187. package/dist/extraction/parse-worker.js.map +1 -0
  188. package/dist/extraction/razor-extractor.d.ts +42 -0
  189. package/dist/extraction/razor-extractor.d.ts.map +1 -0
  190. package/dist/extraction/razor-extractor.js +285 -0
  191. package/dist/extraction/razor-extractor.js.map +1 -0
  192. package/dist/extraction/svelte-extractor.d.ts +56 -0
  193. package/dist/extraction/svelte-extractor.d.ts.map +1 -0
  194. package/dist/extraction/svelte-extractor.js +275 -0
  195. package/dist/extraction/svelte-extractor.js.map +1 -0
  196. package/dist/extraction/tree-sitter-helpers.d.ts +28 -0
  197. package/dist/extraction/tree-sitter-helpers.d.ts.map +1 -0
  198. package/dist/extraction/tree-sitter-helpers.js +152 -0
  199. package/dist/extraction/tree-sitter-helpers.js.map +1 -0
  200. package/dist/extraction/tree-sitter-types.d.ts +239 -0
  201. package/dist/extraction/tree-sitter-types.d.ts.map +1 -0
  202. package/dist/extraction/tree-sitter-types.js +10 -0
  203. package/dist/extraction/tree-sitter-types.js.map +1 -0
  204. package/dist/extraction/tree-sitter.d.ts +647 -0
  205. package/dist/extraction/tree-sitter.d.ts.map +1 -0
  206. package/dist/extraction/tree-sitter.js +5597 -0
  207. package/dist/extraction/tree-sitter.js.map +1 -0
  208. package/dist/extraction/vue-extractor.d.ts +51 -0
  209. package/dist/extraction/vue-extractor.d.ts.map +1 -0
  210. package/dist/extraction/vue-extractor.js +254 -0
  211. package/dist/extraction/vue-extractor.js.map +1 -0
  212. package/dist/extraction/wasm/tree-sitter-c_sharp.wasm +0 -0
  213. package/dist/extraction/wasm/tree-sitter-lua.wasm +0 -0
  214. package/dist/extraction/wasm/tree-sitter-luau.wasm +0 -0
  215. package/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
  216. package/dist/extraction/wasm/tree-sitter-r.wasm +0 -0
  217. package/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
  218. package/dist/extraction/wasm-runtime-flags.d.ts +38 -0
  219. package/dist/extraction/wasm-runtime-flags.d.ts.map +1 -0
  220. package/dist/extraction/wasm-runtime-flags.js +106 -0
  221. package/dist/extraction/wasm-runtime-flags.js.map +1 -0
  222. package/dist/graph/index.d.ts +8 -0
  223. package/dist/graph/index.d.ts.map +1 -0
  224. package/dist/graph/index.js +13 -0
  225. package/dist/graph/index.js.map +1 -0
  226. package/dist/graph/queries.d.ts +106 -0
  227. package/dist/graph/queries.d.ts.map +1 -0
  228. package/dist/graph/queries.js +339 -0
  229. package/dist/graph/queries.js.map +1 -0
  230. package/dist/graph/traversal.d.ts +127 -0
  231. package/dist/graph/traversal.d.ts.map +1 -0
  232. package/dist/graph/traversal.js +540 -0
  233. package/dist/graph/traversal.js.map +1 -0
  234. package/dist/index.d.ts +563 -0
  235. package/dist/index.d.ts.map +1 -0
  236. package/dist/index.js +1043 -0
  237. package/dist/index.js.map +1 -0
  238. package/dist/installer/config-writer.d.ts +28 -0
  239. package/dist/installer/config-writer.d.ts.map +1 -0
  240. package/dist/installer/config-writer.js +91 -0
  241. package/dist/installer/config-writer.js.map +1 -0
  242. package/dist/installer/index.d.ts +100 -0
  243. package/dist/installer/index.d.ts.map +1 -0
  244. package/dist/installer/index.js +524 -0
  245. package/dist/installer/index.js.map +1 -0
  246. package/dist/installer/instructions-template.d.ts +41 -0
  247. package/dist/installer/instructions-template.d.ts.map +1 -0
  248. package/dist/installer/instructions-template.js +53 -0
  249. package/dist/installer/instructions-template.js.map +1 -0
  250. package/dist/installer/targets/antigravity.d.ts +57 -0
  251. package/dist/installer/targets/antigravity.d.ts.map +1 -0
  252. package/dist/installer/targets/antigravity.js +308 -0
  253. package/dist/installer/targets/antigravity.js.map +1 -0
  254. package/dist/installer/targets/claude.d.ts +62 -0
  255. package/dist/installer/targets/claude.d.ts.map +1 -0
  256. package/dist/installer/targets/claude.js +456 -0
  257. package/dist/installer/targets/claude.js.map +1 -0
  258. package/dist/installer/targets/codebuddy.d.ts +17 -0
  259. package/dist/installer/targets/codebuddy.d.ts.map +1 -0
  260. package/dist/installer/targets/codebuddy.js +150 -0
  261. package/dist/installer/targets/codebuddy.js.map +1 -0
  262. package/dist/installer/targets/codex.d.ts +18 -0
  263. package/dist/installer/targets/codex.d.ts.map +1 -0
  264. package/dist/installer/targets/codex.js +185 -0
  265. package/dist/installer/targets/codex.js.map +1 -0
  266. package/dist/installer/targets/cursor.d.ts +35 -0
  267. package/dist/installer/targets/cursor.d.ts.map +1 -0
  268. package/dist/installer/targets/cursor.js +254 -0
  269. package/dist/installer/targets/cursor.js.map +1 -0
  270. package/dist/installer/targets/deveco.d.ts +28 -0
  271. package/dist/installer/targets/deveco.d.ts.map +1 -0
  272. package/dist/installer/targets/deveco.js +247 -0
  273. package/dist/installer/targets/deveco.js.map +1 -0
  274. package/dist/installer/targets/gemini.d.ts +26 -0
  275. package/dist/installer/targets/gemini.d.ts.map +1 -0
  276. package/dist/installer/targets/gemini.js +165 -0
  277. package/dist/installer/targets/gemini.js.map +1 -0
  278. package/dist/installer/targets/hermes.d.ts +18 -0
  279. package/dist/installer/targets/hermes.d.ts.map +1 -0
  280. package/dist/installer/targets/hermes.js +359 -0
  281. package/dist/installer/targets/hermes.js.map +1 -0
  282. package/dist/installer/targets/kiro.d.ts +27 -0
  283. package/dist/installer/targets/kiro.d.ts.map +1 -0
  284. package/dist/installer/targets/kiro.js +178 -0
  285. package/dist/installer/targets/kiro.js.map +1 -0
  286. package/dist/installer/targets/opencode.d.ts +38 -0
  287. package/dist/installer/targets/opencode.d.ts.map +1 -0
  288. package/dist/installer/targets/opencode.js +288 -0
  289. package/dist/installer/targets/opencode.js.map +1 -0
  290. package/dist/installer/targets/registry.d.ts +35 -0
  291. package/dist/installer/targets/registry.d.ts.map +1 -0
  292. package/dist/installer/targets/registry.js +95 -0
  293. package/dist/installer/targets/registry.js.map +1 -0
  294. package/dist/installer/targets/shared.d.ts +101 -0
  295. package/dist/installer/targets/shared.d.ts.map +1 -0
  296. package/dist/installer/targets/shared.js +264 -0
  297. package/dist/installer/targets/shared.js.map +1 -0
  298. package/dist/installer/targets/toml.d.ts +52 -0
  299. package/dist/installer/targets/toml.d.ts.map +1 -0
  300. package/dist/installer/targets/toml.js +147 -0
  301. package/dist/installer/targets/toml.js.map +1 -0
  302. package/dist/installer/targets/types.d.ts +108 -0
  303. package/dist/installer/targets/types.d.ts.map +1 -0
  304. package/dist/installer/targets/types.js +16 -0
  305. package/dist/installer/targets/types.js.map +1 -0
  306. package/dist/mcp/daemon-manager.d.ts +42 -0
  307. package/dist/mcp/daemon-manager.d.ts.map +1 -0
  308. package/dist/mcp/daemon-manager.js +129 -0
  309. package/dist/mcp/daemon-manager.js.map +1 -0
  310. package/dist/mcp/daemon-paths.d.ts +46 -0
  311. package/dist/mcp/daemon-paths.d.ts.map +1 -0
  312. package/dist/mcp/daemon-paths.js +125 -0
  313. package/dist/mcp/daemon-paths.js.map +1 -0
  314. package/dist/mcp/daemon-registry.d.ts +47 -0
  315. package/dist/mcp/daemon-registry.d.ts.map +1 -0
  316. package/dist/mcp/daemon-registry.js +229 -0
  317. package/dist/mcp/daemon-registry.js.map +1 -0
  318. package/dist/mcp/daemon.d.ts +220 -0
  319. package/dist/mcp/daemon.d.ts.map +1 -0
  320. package/dist/mcp/daemon.js +637 -0
  321. package/dist/mcp/daemon.js.map +1 -0
  322. package/dist/mcp/dynamic-boundaries.d.ts +41 -0
  323. package/dist/mcp/dynamic-boundaries.d.ts.map +1 -0
  324. package/dist/mcp/dynamic-boundaries.js +359 -0
  325. package/dist/mcp/dynamic-boundaries.js.map +1 -0
  326. package/dist/mcp/engine.d.ts +105 -0
  327. package/dist/mcp/engine.d.ts.map +1 -0
  328. package/dist/mcp/engine.js +278 -0
  329. package/dist/mcp/engine.js.map +1 -0
  330. package/dist/mcp/index.d.ts +113 -0
  331. package/dist/mcp/index.d.ts.map +1 -0
  332. package/dist/mcp/index.js +499 -0
  333. package/dist/mcp/index.js.map +1 -0
  334. package/dist/mcp/liveness-watchdog.d.ts +18 -0
  335. package/dist/mcp/liveness-watchdog.d.ts.map +1 -0
  336. package/dist/mcp/liveness-watchdog.js +207 -0
  337. package/dist/mcp/liveness-watchdog.js.map +1 -0
  338. package/dist/mcp/ppid-watchdog.d.ts +44 -0
  339. package/dist/mcp/ppid-watchdog.d.ts.map +1 -0
  340. package/dist/mcp/ppid-watchdog.js +27 -0
  341. package/dist/mcp/ppid-watchdog.js.map +1 -0
  342. package/dist/mcp/proxy.d.ts +87 -0
  343. package/dist/mcp/proxy.d.ts.map +1 -0
  344. package/dist/mcp/proxy.js +641 -0
  345. package/dist/mcp/proxy.js.map +1 -0
  346. package/dist/mcp/server-instructions.d.ts +34 -0
  347. package/dist/mcp/server-instructions.d.ts.map +1 -0
  348. package/dist/mcp/server-instructions.js +106 -0
  349. package/dist/mcp/server-instructions.js.map +1 -0
  350. package/dist/mcp/session.d.ts +79 -0
  351. package/dist/mcp/session.d.ts.map +1 -0
  352. package/dist/mcp/session.js +330 -0
  353. package/dist/mcp/session.js.map +1 -0
  354. package/dist/mcp/stdin-teardown.d.ts +27 -0
  355. package/dist/mcp/stdin-teardown.d.ts.map +1 -0
  356. package/dist/mcp/stdin-teardown.js +49 -0
  357. package/dist/mcp/stdin-teardown.js.map +1 -0
  358. package/dist/mcp/tools.d.ts +534 -0
  359. package/dist/mcp/tools.d.ts.map +1 -0
  360. package/dist/mcp/tools.js +4101 -0
  361. package/dist/mcp/tools.js.map +1 -0
  362. package/dist/mcp/transport.d.ts +188 -0
  363. package/dist/mcp/transport.d.ts.map +1 -0
  364. package/dist/mcp/transport.js +359 -0
  365. package/dist/mcp/transport.js.map +1 -0
  366. package/dist/mcp/version.d.ts +19 -0
  367. package/dist/mcp/version.d.ts.map +1 -0
  368. package/dist/mcp/version.js +71 -0
  369. package/dist/mcp/version.js.map +1 -0
  370. package/dist/project-config.d.ts +36 -0
  371. package/dist/project-config.d.ts.map +1 -0
  372. package/dist/project-config.js +235 -0
  373. package/dist/project-config.js.map +1 -0
  374. package/dist/reasoning/config.d.ts +45 -0
  375. package/dist/reasoning/config.d.ts.map +1 -0
  376. package/dist/reasoning/config.js +171 -0
  377. package/dist/reasoning/config.js.map +1 -0
  378. package/dist/reasoning/credentials.d.ts +5 -0
  379. package/dist/reasoning/credentials.d.ts.map +1 -0
  380. package/dist/reasoning/credentials.js +83 -0
  381. package/dist/reasoning/credentials.js.map +1 -0
  382. package/dist/reasoning/login.d.ts +21 -0
  383. package/dist/reasoning/login.d.ts.map +1 -0
  384. package/dist/reasoning/login.js +85 -0
  385. package/dist/reasoning/login.js.map +1 -0
  386. package/dist/reasoning/reasoner.d.ts +43 -0
  387. package/dist/reasoning/reasoner.d.ts.map +1 -0
  388. package/dist/reasoning/reasoner.js +308 -0
  389. package/dist/reasoning/reasoner.js.map +1 -0
  390. package/dist/resolution/c-fnptr-synthesizer.d.ts +33 -0
  391. package/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -0
  392. package/dist/resolution/c-fnptr-synthesizer.js +352 -0
  393. package/dist/resolution/c-fnptr-synthesizer.js.map +1 -0
  394. package/dist/resolution/callback-synthesizer.d.ts +15 -0
  395. package/dist/resolution/callback-synthesizer.d.ts.map +1 -0
  396. package/dist/resolution/callback-synthesizer.js +3014 -0
  397. package/dist/resolution/callback-synthesizer.js.map +1 -0
  398. package/dist/resolution/frameworks/arkts-entry.d.ts +12 -0
  399. package/dist/resolution/frameworks/arkts-entry.d.ts.map +1 -0
  400. package/dist/resolution/frameworks/arkts-entry.js +214 -0
  401. package/dist/resolution/frameworks/arkts-entry.js.map +1 -0
  402. package/dist/resolution/frameworks/arkts-napi.d.ts +3 -0
  403. package/dist/resolution/frameworks/arkts-napi.d.ts.map +1 -0
  404. package/dist/resolution/frameworks/arkts-napi.js +166 -0
  405. package/dist/resolution/frameworks/arkts-napi.js.map +1 -0
  406. package/dist/resolution/frameworks/astro.d.ts +9 -0
  407. package/dist/resolution/frameworks/astro.d.ts.map +1 -0
  408. package/dist/resolution/frameworks/astro.js +169 -0
  409. package/dist/resolution/frameworks/astro.js.map +1 -0
  410. package/dist/resolution/frameworks/cargo-workspace.d.ts +18 -0
  411. package/dist/resolution/frameworks/cargo-workspace.d.ts.map +1 -0
  412. package/dist/resolution/frameworks/cargo-workspace.js +225 -0
  413. package/dist/resolution/frameworks/cargo-workspace.js.map +1 -0
  414. package/dist/resolution/frameworks/csharp.d.ts +8 -0
  415. package/dist/resolution/frameworks/csharp.d.ts.map +1 -0
  416. package/dist/resolution/frameworks/csharp.js +241 -0
  417. package/dist/resolution/frameworks/csharp.js.map +1 -0
  418. package/dist/resolution/frameworks/drupal.d.ts +51 -0
  419. package/dist/resolution/frameworks/drupal.d.ts.map +1 -0
  420. package/dist/resolution/frameworks/drupal.js +367 -0
  421. package/dist/resolution/frameworks/drupal.js.map +1 -0
  422. package/dist/resolution/frameworks/expo-modules.d.ts +3 -0
  423. package/dist/resolution/frameworks/expo-modules.d.ts.map +1 -0
  424. package/dist/resolution/frameworks/expo-modules.js +148 -0
  425. package/dist/resolution/frameworks/expo-modules.js.map +1 -0
  426. package/dist/resolution/frameworks/express.d.ts +8 -0
  427. package/dist/resolution/frameworks/express.d.ts.map +1 -0
  428. package/dist/resolution/frameworks/express.js +308 -0
  429. package/dist/resolution/frameworks/express.js.map +1 -0
  430. package/dist/resolution/frameworks/fabric.d.ts +3 -0
  431. package/dist/resolution/frameworks/fabric.d.ts.map +1 -0
  432. package/dist/resolution/frameworks/fabric.js +354 -0
  433. package/dist/resolution/frameworks/fabric.js.map +1 -0
  434. package/dist/resolution/frameworks/go.d.ts +8 -0
  435. package/dist/resolution/frameworks/go.d.ts.map +1 -0
  436. package/dist/resolution/frameworks/go.js +161 -0
  437. package/dist/resolution/frameworks/go.js.map +1 -0
  438. package/dist/resolution/frameworks/goframe.d.ts +41 -0
  439. package/dist/resolution/frameworks/goframe.d.ts.map +1 -0
  440. package/dist/resolution/frameworks/goframe.js +112 -0
  441. package/dist/resolution/frameworks/goframe.js.map +1 -0
  442. package/dist/resolution/frameworks/index.d.ts +51 -0
  443. package/dist/resolution/frameworks/index.d.ts.map +1 -0
  444. package/dist/resolution/frameworks/index.js +177 -0
  445. package/dist/resolution/frameworks/index.js.map +1 -0
  446. package/dist/resolution/frameworks/java.d.ts +8 -0
  447. package/dist/resolution/frameworks/java.d.ts.map +1 -0
  448. package/dist/resolution/frameworks/java.js +509 -0
  449. package/dist/resolution/frameworks/java.js.map +1 -0
  450. package/dist/resolution/frameworks/laravel.d.ts +13 -0
  451. package/dist/resolution/frameworks/laravel.d.ts.map +1 -0
  452. package/dist/resolution/frameworks/laravel.js +257 -0
  453. package/dist/resolution/frameworks/laravel.js.map +1 -0
  454. package/dist/resolution/frameworks/nestjs.d.ts +26 -0
  455. package/dist/resolution/frameworks/nestjs.d.ts.map +1 -0
  456. package/dist/resolution/frameworks/nestjs.js +698 -0
  457. package/dist/resolution/frameworks/nestjs.js.map +1 -0
  458. package/dist/resolution/frameworks/play.d.ts +19 -0
  459. package/dist/resolution/frameworks/play.d.ts.map +1 -0
  460. package/dist/resolution/frameworks/play.js +111 -0
  461. package/dist/resolution/frameworks/play.js.map +1 -0
  462. package/dist/resolution/frameworks/python.d.ts +10 -0
  463. package/dist/resolution/frameworks/python.d.ts.map +1 -0
  464. package/dist/resolution/frameworks/python.js +400 -0
  465. package/dist/resolution/frameworks/python.js.map +1 -0
  466. package/dist/resolution/frameworks/react-native.d.ts +3 -0
  467. package/dist/resolution/frameworks/react-native.d.ts.map +1 -0
  468. package/dist/resolution/frameworks/react-native.js +410 -0
  469. package/dist/resolution/frameworks/react-native.js.map +1 -0
  470. package/dist/resolution/frameworks/react.d.ts +8 -0
  471. package/dist/resolution/frameworks/react.d.ts.map +1 -0
  472. package/dist/resolution/frameworks/react.js +334 -0
  473. package/dist/resolution/frameworks/react.js.map +1 -0
  474. package/dist/resolution/frameworks/ruby.d.ts +8 -0
  475. package/dist/resolution/frameworks/ruby.d.ts.map +1 -0
  476. package/dist/resolution/frameworks/ruby.js +302 -0
  477. package/dist/resolution/frameworks/ruby.js.map +1 -0
  478. package/dist/resolution/frameworks/rust.d.ts +8 -0
  479. package/dist/resolution/frameworks/rust.d.ts.map +1 -0
  480. package/dist/resolution/frameworks/rust.js +304 -0
  481. package/dist/resolution/frameworks/rust.js.map +1 -0
  482. package/dist/resolution/frameworks/svelte.d.ts +9 -0
  483. package/dist/resolution/frameworks/svelte.d.ts.map +1 -0
  484. package/dist/resolution/frameworks/svelte.js +253 -0
  485. package/dist/resolution/frameworks/svelte.js.map +1 -0
  486. package/dist/resolution/frameworks/swift-objc.d.ts +37 -0
  487. package/dist/resolution/frameworks/swift-objc.d.ts.map +1 -0
  488. package/dist/resolution/frameworks/swift-objc.js +252 -0
  489. package/dist/resolution/frameworks/swift-objc.js.map +1 -0
  490. package/dist/resolution/frameworks/swift.d.ts +10 -0
  491. package/dist/resolution/frameworks/swift.d.ts.map +1 -0
  492. package/dist/resolution/frameworks/swift.js +400 -0
  493. package/dist/resolution/frameworks/swift.js.map +1 -0
  494. package/dist/resolution/frameworks/vue.d.ts +9 -0
  495. package/dist/resolution/frameworks/vue.d.ts.map +1 -0
  496. package/dist/resolution/frameworks/vue.js +303 -0
  497. package/dist/resolution/frameworks/vue.js.map +1 -0
  498. package/dist/resolution/go-module.d.ts +26 -0
  499. package/dist/resolution/go-module.d.ts.map +1 -0
  500. package/dist/resolution/go-module.js +78 -0
  501. package/dist/resolution/go-module.js.map +1 -0
  502. package/dist/resolution/goframe-synthesizer.d.ts +28 -0
  503. package/dist/resolution/goframe-synthesizer.d.ts.map +1 -0
  504. package/dist/resolution/goframe-synthesizer.js +158 -0
  505. package/dist/resolution/goframe-synthesizer.js.map +1 -0
  506. package/dist/resolution/import-resolver.d.ts +78 -0
  507. package/dist/resolution/import-resolver.d.ts.map +1 -0
  508. package/dist/resolution/import-resolver.js +1849 -0
  509. package/dist/resolution/import-resolver.js.map +1 -0
  510. package/dist/resolution/index.d.ts +196 -0
  511. package/dist/resolution/index.d.ts.map +1 -0
  512. package/dist/resolution/index.js +1328 -0
  513. package/dist/resolution/index.js.map +1 -0
  514. package/dist/resolution/lru-cache.d.ts +24 -0
  515. package/dist/resolution/lru-cache.d.ts.map +1 -0
  516. package/dist/resolution/lru-cache.js +62 -0
  517. package/dist/resolution/lru-cache.js.map +1 -0
  518. package/dist/resolution/name-matcher.d.ts +93 -0
  519. package/dist/resolution/name-matcher.d.ts.map +1 -0
  520. package/dist/resolution/name-matcher.js +1212 -0
  521. package/dist/resolution/name-matcher.js.map +1 -0
  522. package/dist/resolution/path-aliases.d.ts +68 -0
  523. package/dist/resolution/path-aliases.d.ts.map +1 -0
  524. package/dist/resolution/path-aliases.js +238 -0
  525. package/dist/resolution/path-aliases.js.map +1 -0
  526. package/dist/resolution/strip-comments.d.ts +27 -0
  527. package/dist/resolution/strip-comments.d.ts.map +1 -0
  528. package/dist/resolution/strip-comments.js +443 -0
  529. package/dist/resolution/strip-comments.js.map +1 -0
  530. package/dist/resolution/swift-objc-bridge.d.ts +134 -0
  531. package/dist/resolution/swift-objc-bridge.d.ts.map +1 -0
  532. package/dist/resolution/swift-objc-bridge.js +256 -0
  533. package/dist/resolution/swift-objc-bridge.js.map +1 -0
  534. package/dist/resolution/types.d.ts +233 -0
  535. package/dist/resolution/types.d.ts.map +1 -0
  536. package/dist/resolution/types.js +8 -0
  537. package/dist/resolution/types.js.map +1 -0
  538. package/dist/resolution/workspace-packages.d.ts +48 -0
  539. package/dist/resolution/workspace-packages.d.ts.map +1 -0
  540. package/dist/resolution/workspace-packages.js +208 -0
  541. package/dist/resolution/workspace-packages.js.map +1 -0
  542. package/dist/search/query-parser.d.ts +57 -0
  543. package/dist/search/query-parser.d.ts.map +1 -0
  544. package/dist/search/query-parser.js +177 -0
  545. package/dist/search/query-parser.js.map +1 -0
  546. package/dist/search/query-utils.d.ts +87 -0
  547. package/dist/search/query-utils.d.ts.map +1 -0
  548. package/dist/search/query-utils.js +449 -0
  549. package/dist/search/query-utils.js.map +1 -0
  550. package/dist/sync/git-hooks.d.ts +45 -0
  551. package/dist/sync/git-hooks.d.ts.map +1 -0
  552. package/dist/sync/git-hooks.js +225 -0
  553. package/dist/sync/git-hooks.js.map +1 -0
  554. package/dist/sync/index.d.ts +19 -0
  555. package/dist/sync/index.d.ts.map +1 -0
  556. package/dist/sync/index.js +35 -0
  557. package/dist/sync/index.js.map +1 -0
  558. package/dist/sync/watch-policy.d.ts +48 -0
  559. package/dist/sync/watch-policy.d.ts.map +1 -0
  560. package/dist/sync/watch-policy.js +124 -0
  561. package/dist/sync/watch-policy.js.map +1 -0
  562. package/dist/sync/watcher.d.ts +350 -0
  563. package/dist/sync/watcher.d.ts.map +1 -0
  564. package/dist/sync/watcher.js +811 -0
  565. package/dist/sync/watcher.js.map +1 -0
  566. package/dist/sync/worktree.d.ts +54 -0
  567. package/dist/sync/worktree.d.ts.map +1 -0
  568. package/dist/sync/worktree.js +137 -0
  569. package/dist/sync/worktree.js.map +1 -0
  570. package/dist/telemetry/index.d.ts +143 -0
  571. package/dist/telemetry/index.d.ts.map +1 -0
  572. package/dist/telemetry/index.js +541 -0
  573. package/dist/telemetry/index.js.map +1 -0
  574. package/dist/types.d.ts +392 -0
  575. package/dist/types.d.ts.map +1 -0
  576. package/dist/types.js +82 -0
  577. package/dist/types.js.map +1 -0
  578. package/dist/ui/glyphs.d.ts +42 -0
  579. package/dist/ui/glyphs.d.ts.map +1 -0
  580. package/dist/ui/glyphs.js +78 -0
  581. package/dist/ui/glyphs.js.map +1 -0
  582. package/dist/ui/shimmer-progress.d.ts +11 -0
  583. package/dist/ui/shimmer-progress.d.ts.map +1 -0
  584. package/dist/ui/shimmer-progress.js +90 -0
  585. package/dist/ui/shimmer-progress.js.map +1 -0
  586. package/dist/ui/shimmer-worker.d.ts +2 -0
  587. package/dist/ui/shimmer-worker.d.ts.map +1 -0
  588. package/dist/ui/shimmer-worker.js +118 -0
  589. package/dist/ui/shimmer-worker.js.map +1 -0
  590. package/dist/ui/types.d.ts +17 -0
  591. package/dist/ui/types.d.ts.map +1 -0
  592. package/dist/ui/types.js +3 -0
  593. package/dist/ui/types.js.map +1 -0
  594. package/dist/upgrade/index.d.ts +132 -0
  595. package/dist/upgrade/index.d.ts.map +1 -0
  596. package/dist/upgrade/index.js +498 -0
  597. package/dist/upgrade/index.js.map +1 -0
  598. package/dist/utils.d.ts +224 -0
  599. package/dist/utils.d.ts.map +1 -0
  600. package/dist/utils.js +583 -0
  601. package/dist/utils.js.map +1 -0
  602. package/package.json +57 -5
  603. package/scripts/add-lang/bench.sh +60 -0
  604. package/scripts/add-lang/check-grammar.mjs +75 -0
  605. package/scripts/add-lang/dump-ast.mjs +103 -0
  606. package/scripts/add-lang/verify-extraction.mjs +70 -0
  607. package/scripts/agent-eval/ab-adoption.sh +91 -0
  608. package/scripts/agent-eval/ab-hook.sh +86 -0
  609. package/scripts/agent-eval/ab-impl.sh +78 -0
  610. package/scripts/agent-eval/ab-new-vs-baseline.sh +102 -0
  611. package/scripts/agent-eval/ab-sufficiency.sh +78 -0
  612. package/scripts/agent-eval/arms-F.sh +21 -0
  613. package/scripts/agent-eval/arms-matrix.sh +37 -0
  614. package/scripts/agent-eval/audit.sh +68 -0
  615. package/scripts/agent-eval/bench-readme.sh +28 -0
  616. package/scripts/agent-eval/bench-why-repo.sh +22 -0
  617. package/scripts/agent-eval/block-read-hook.sh +19 -0
  618. package/scripts/agent-eval/hook-settings.json +15 -0
  619. package/scripts/agent-eval/itrun.sh +120 -0
  620. package/scripts/agent-eval/offload-eval-3arm.sh +72 -0
  621. package/scripts/agent-eval/offload-eval-cost.mjs +133 -0
  622. package/scripts/agent-eval/offload-eval-effort.mjs +108 -0
  623. package/scripts/agent-eval/offload-eval-frontload-matrix.sh +25 -0
  624. package/scripts/agent-eval/offload-eval-frontload.sh +47 -0
  625. package/scripts/agent-eval/offload-eval-ground-truth.json +18 -0
  626. package/scripts/agent-eval/offload-eval-hook.mjs +84 -0
  627. package/scripts/agent-eval/offload-eval-judge.mjs +103 -0
  628. package/scripts/agent-eval/offload-eval-matrix.sh +20 -0
  629. package/scripts/agent-eval/offload-eval-metrics.mjs +94 -0
  630. package/scripts/agent-eval/offload-eval-refs1.sh +50 -0
  631. package/scripts/agent-eval/offload-eval-setup.sh +24 -0
  632. package/scripts/agent-eval/offload-eval-styles.sh +72 -0
  633. package/scripts/agent-eval/offload-eval-summarize.mjs +68 -0
  634. package/scripts/agent-eval/offload-eval.md +76 -0
  635. package/scripts/agent-eval/parse-arms.mjs +116 -0
  636. package/scripts/agent-eval/parse-bench-readme.mjs +84 -0
  637. package/scripts/agent-eval/parse-run.mjs +45 -0
  638. package/scripts/agent-eval/parse-session.mjs +93 -0
  639. package/scripts/agent-eval/probe-context.mjs +21 -0
  640. package/scripts/agent-eval/probe-explore.mjs +40 -0
  641. package/scripts/agent-eval/probe-node.mjs +20 -0
  642. package/scripts/agent-eval/probe-sweep.mjs +119 -0
  643. package/scripts/agent-eval/probe-trace.mjs +20 -0
  644. package/scripts/agent-eval/redirect-read-hook.sh +38 -0
  645. package/scripts/agent-eval/run-agent.sh +34 -0
  646. package/scripts/agent-eval/run-all.sh +69 -0
  647. package/scripts/agent-eval/run-arms.sh +56 -0
  648. package/scripts/agent-eval/seq-matrix.mjs +137 -0
  649. package/scripts/build-bundle.sh +118 -0
  650. package/scripts/extract-release-notes.mjs +130 -0
  651. package/scripts/local-install.sh +41 -0
  652. package/scripts/npm-sdk.js +75 -0
  653. package/scripts/npm-shim.js +246 -0
  654. package/scripts/pack-npm.sh +119 -0
  655. package/scripts/prepare-release.mjs +270 -0
  656. package/scripts/qa_eval/README.md +404 -0
  657. package/scripts/qa_eval/_test_deveco_probe.py +41 -0
  658. package/scripts/qa_eval/agent_runner.py +526 -0
  659. package/scripts/qa_eval/data/.gitignore +4 -0
  660. package/scripts/qa_eval/data/test-set.jsonl +22 -0
  661. package/scripts/qa_eval/eval_metrics.py +233 -0
  662. package/scripts/qa_eval/external_agent.py +671 -0
  663. package/scripts/qa_eval/llm_config.py +92 -0
  664. package/scripts/qa_eval/memory_monitor.py +132 -0
  665. package/scripts/qa_eval/my_answer_accuracy.py +187 -0
  666. package/scripts/qa_eval/requirements.txt +2 -0
  667. package/scripts/qa_eval/run_pipeline.py +711 -0
  668. package/scripts/qa_eval/stats_efficiency.py +279 -0
  669. package/scripts/qa_eval/stats_scores.py +207 -0
@@ -0,0 +1,515 @@
1
+ "use strict";
2
+ /**
3
+ * Directory Management
4
+ *
5
+ * Manages the .homegraph/ directory structure for HomeGraph data.
6
+ */
7
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
+ if (k2 === undefined) k2 = k;
9
+ var desc = Object.getOwnPropertyDescriptor(m, k);
10
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11
+ desc = { enumerable: true, get: function() { return m[k]; } };
12
+ }
13
+ Object.defineProperty(o, k2, desc);
14
+ }) : (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ o[k2] = m[k];
17
+ }));
18
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
19
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
20
+ }) : function(o, v) {
21
+ o["default"] = v;
22
+ });
23
+ var __importStar = (this && this.__importStar) || (function () {
24
+ var ownKeys = function(o) {
25
+ ownKeys = Object.getOwnPropertyNames || function (o) {
26
+ var ar = [];
27
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
28
+ return ar;
29
+ };
30
+ return ownKeys(o);
31
+ };
32
+ return function (mod) {
33
+ if (mod && mod.__esModule) return mod;
34
+ var result = {};
35
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
36
+ __setModuleDefault(result, mod);
37
+ return result;
38
+ };
39
+ })();
40
+ Object.defineProperty(exports, "__esModule", { value: true });
41
+ exports.HOMEGRAPH_DIR = void 0;
42
+ exports.homeGraphDirName = homeGraphDirName;
43
+ exports.isHomeGraphDataDir = isHomeGraphDataDir;
44
+ exports.getHomeGraphDir = getHomeGraphDir;
45
+ exports.isInitialized = isInitialized;
46
+ exports.unsafeIndexRootReason = unsafeIndexRootReason;
47
+ exports.findNearestHomeGraphRoot = findNearestHomeGraphRoot;
48
+ exports.findIndexedSubprojectRoots = findIndexedSubprojectRoots;
49
+ exports.planFrontload = planFrontload;
50
+ exports.createDirectory = createDirectory;
51
+ exports.removeDirectory = removeDirectory;
52
+ exports.listDirectoryContents = listDirectoryContents;
53
+ exports.getDirectorySize = getDirectorySize;
54
+ exports.ensureSubdirectory = ensureSubdirectory;
55
+ exports.validateDirectory = validateDirectory;
56
+ const fs = __importStar(require("fs"));
57
+ const os = __importStar(require("os"));
58
+ const path = __importStar(require("path"));
59
+ /** The default per-project data directory name. */
60
+ const DEFAULT_HOMEGRAPH_DIR = '.homegraph';
61
+ let warnedBadDirName = false;
62
+ /**
63
+ * Resolve the per-project data directory name, honoring the `HOMEGRAPH_DIR`
64
+ * environment override (default `.homegraph`). The override is a single path
65
+ * segment that lives in the project root.
66
+ *
67
+ * Why this exists: two environments that share one working tree must NOT share
68
+ * one `.homegraph/` — most concretely Windows-native and WSL (issue #636). The
69
+ * daemon lockfile (`.homegraph/daemon.pid`) records a platform-specific pid and
70
+ * socket path (a Windows named pipe vs a WSL Unix socket), and SQLite file
71
+ * locking across the WSL2 ↔ Windows filesystem boundary is unreliable, so two
72
+ * daemons sharing one index risks corruption. Setting `HOMEGRAPH_DIR=.homegraph-win`
73
+ * on one side gives each environment its own index in the same tree.
74
+ *
75
+ * Read live (not captured at load) so it is both process-accurate and testable.
76
+ * An override that isn't a plain directory name — empty, containing a path
77
+ * separator, `.`, `..`/traversal, or absolute — is ignored (we keep the
78
+ * default) rather than risk writing the index outside the project or into the
79
+ * project root itself; we warn once to stderr so the misconfiguration is seen.
80
+ */
81
+ function homeGraphDirName() {
82
+ const raw = process.env.HOMEGRAPH_DIR?.trim();
83
+ if (!raw)
84
+ return DEFAULT_HOMEGRAPH_DIR;
85
+ const invalid = raw === '.' ||
86
+ raw.includes('..') ||
87
+ raw.includes('/') ||
88
+ raw.includes('\\') ||
89
+ path.isAbsolute(raw);
90
+ if (invalid) {
91
+ if (!warnedBadDirName) {
92
+ warnedBadDirName = true;
93
+ // stderr only — stdout is the MCP protocol channel.
94
+ console.warn(`[homegraph] Ignoring invalid HOMEGRAPH_DIR="${raw}" — it must be a plain ` +
95
+ `directory name (no path separators, no "..", not absolute). Using "${DEFAULT_HOMEGRAPH_DIR}".`);
96
+ }
97
+ return DEFAULT_HOMEGRAPH_DIR;
98
+ }
99
+ return raw;
100
+ }
101
+ /** Default data directory name (also honors {@link homeGraphDirName} at runtime). */
102
+ exports.HOMEGRAPH_DIR = DEFAULT_HOMEGRAPH_DIR;
103
+ /**
104
+ * Is `name` (a single path segment) a HomeGraph data directory? Matches the
105
+ * default `.homegraph`, the active override, and any `.homegraph-*` sibling.
106
+ */
107
+ function isHomeGraphDataDir(name) {
108
+ const active = homeGraphDirName();
109
+ return (name === DEFAULT_HOMEGRAPH_DIR ||
110
+ name === active ||
111
+ name.startsWith(DEFAULT_HOMEGRAPH_DIR + '-'));
112
+ }
113
+ /**
114
+ * Get the .homegraph directory path for a project
115
+ */
116
+ function getHomeGraphDir(projectRoot) {
117
+ return path.join(projectRoot, homeGraphDirName());
118
+ }
119
+ /**
120
+ * Check if a project has been initialized with HomeGraph
121
+ * Requires both .homegraph/ directory AND homegraph.db to exist
122
+ */
123
+ function isInitialized(projectRoot) {
124
+ const homegraphDir = getHomeGraphDir(projectRoot);
125
+ if (!fs.existsSync(homegraphDir) || !fs.statSync(homegraphDir).isDirectory()) {
126
+ return false;
127
+ }
128
+ // Must have homegraph.db, not just .homegraph folder
129
+ const dbPath = path.join(homegraphDir, 'homegraph.db');
130
+ return fs.existsSync(dbPath);
131
+ }
132
+ /**
133
+ * Find the nearest parent directory containing .homegraph/
134
+ *
135
+ * Walks up from the given path to find a HomeGraph-initialized project,
136
+ * similar to how git finds .git/ directories.
137
+ *
138
+ * @param startPath - Directory to start searching from
139
+ * @returns The project root containing .homegraph/, or null if not found
140
+ */
141
+ /**
142
+ * Reason a directory is unsafe to use as an index ROOT, or null when it's fine.
143
+ *
144
+ * Indexing your home directory or a filesystem root drags in caches, `Library`,
145
+ * every other project, etc. — a multi-GB index, constant file-watcher churn, and
146
+ * (pre-1.0 on macOS) a file-descriptor blowup that exhausted `kern.maxfiles` and
147
+ * took unrelated apps / the whole machine down (#845). The classic trigger:
148
+ * running the installer or `homegraph init` from `$HOME`, which auto-indexes the
149
+ * current directory. These are never intended project roots, so the installer
150
+ * and `init`/`index` refuse them (overridable with `--force`).
151
+ *
152
+ * Pure-ish (reads only `os.homedir()` + realpath) so it's easy to unit-test.
153
+ * The returned string is a human phrase that slots into "… looks like {reason}".
154
+ */
155
+ function unsafeIndexRootReason(projectRoot) {
156
+ const resolve = (p) => {
157
+ try {
158
+ return fs.realpathSync(path.resolve(p));
159
+ }
160
+ catch {
161
+ return path.resolve(p);
162
+ }
163
+ };
164
+ const resolved = resolve(projectRoot);
165
+ // Filesystem root: `/` on POSIX, a drive root like `C:\` on Windows.
166
+ if (path.parse(resolved).root === resolved) {
167
+ return 'the filesystem root';
168
+ }
169
+ const home = resolve(os.homedir());
170
+ // Case-insensitive on macOS/Windows (case-preserving but case-insensitive FS).
171
+ const norm = (p) => process.platform === 'darwin' || process.platform === 'win32' ? p.toLowerCase() : p;
172
+ const r = norm(resolved);
173
+ const h = norm(home);
174
+ if (r === h) {
175
+ return 'your home directory';
176
+ }
177
+ // An ancestor of home (e.g. `/Users`, `/home`) — even broader than home.
178
+ if (h.startsWith(r + path.sep)) {
179
+ return 'a parent of your home directory';
180
+ }
181
+ return null;
182
+ }
183
+ function findNearestHomeGraphRoot(startPath) {
184
+ let current = path.resolve(startPath);
185
+ const root = path.parse(current).root;
186
+ while (current !== root) {
187
+ if (isInitialized(current)) {
188
+ return current;
189
+ }
190
+ const parent = path.dirname(current);
191
+ if (parent === current)
192
+ break; // Reached filesystem root
193
+ current = parent;
194
+ }
195
+ // Check root as well
196
+ if (isInitialized(current)) {
197
+ return current;
198
+ }
199
+ return null;
200
+ }
201
+ /** Heavy/irrelevant directory names the sub-project scan never descends into. */
202
+ const SUBPROJECT_SCAN_SKIP = new Set([
203
+ 'node_modules', '.git', '.svn', '.hg', 'dist', 'build', 'out', 'target',
204
+ 'vendor', 'bin', 'obj', '.next', '.nuxt', '.svelte-kit', '.cache', 'coverage',
205
+ '.venv', 'venv', '__pycache__', '.turbo', '.idea', '.vscode', 'tmp', 'temp',
206
+ ]);
207
+ /** Manifests that mark a directory as a project/workspace root. The down-scan
208
+ * is gated on one of these so a non-project cwd (e.g. `$HOME`) is a cheap
209
+ * no-op instead of a deep filesystem crawl. */
210
+ const WORKSPACE_ROOT_MANIFESTS = [
211
+ 'package.json', 'pnpm-workspace.yaml', 'lerna.json', 'nx.json', 'turbo.json',
212
+ 'go.work', 'go.mod', 'Cargo.toml', 'pom.xml', 'build.gradle', 'build.gradle.kts',
213
+ 'settings.gradle', 'pyproject.toml', 'composer.json', 'Gemfile', 'rush.json',
214
+ 'WORKSPACE', 'WORKSPACE.bazel',
215
+ ];
216
+ function looksLikeProjectRoot(dir) {
217
+ return WORKSPACE_ROOT_MANIFESTS.some((m) => fs.existsSync(path.join(dir, m)));
218
+ }
219
+ function escapeRegExp(s) {
220
+ return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
221
+ }
222
+ /**
223
+ * Indexed sub-project roots beneath `root` (bounded breadth-first scan). For
224
+ * the monorepo case behind #964: the index lives in a CHILD
225
+ * (`packages/x/.homegraph/`), not at the workspace root the agent's cwd points
226
+ * at. Descent stops at the first indexed directory on a branch (a project's
227
+ * own sub-dirs aren't separate projects) and is bounded by depth + count so it
228
+ * never turns into a full-tree crawl on a large repo.
229
+ */
230
+ function findIndexedSubprojectRoots(root, opts = {}) {
231
+ const maxDepth = opts.maxDepth ?? 4;
232
+ const max = opts.max ?? 64;
233
+ const out = [];
234
+ const walk = (dir, depth) => {
235
+ if (out.length >= max || depth > maxDepth)
236
+ return;
237
+ let entries;
238
+ try {
239
+ entries = fs.readdirSync(dir, { withFileTypes: true });
240
+ }
241
+ catch {
242
+ return;
243
+ }
244
+ for (const e of entries) {
245
+ if (out.length >= max)
246
+ return;
247
+ if (!e.isDirectory())
248
+ continue;
249
+ if (e.name.startsWith('.') || SUBPROJECT_SCAN_SKIP.has(e.name))
250
+ continue;
251
+ const child = path.join(dir, e.name);
252
+ if (isInitialized(child)) {
253
+ out.push(child);
254
+ continue;
255
+ } // don't descend into an indexed project
256
+ walk(child, depth + 1);
257
+ }
258
+ };
259
+ walk(root, 1);
260
+ return out;
261
+ }
262
+ /**
263
+ * Decide what the front-load hook injects for a `prompt` issued from `cwd`,
264
+ * shaped by where the `.homegraph/` index(es) actually are:
265
+ * 1. **cwd (or an ancestor) is indexed** → front-load that project. The
266
+ * normal single-project / nested-file case.
267
+ * 2. **cwd isn't indexed but looks like a workspace root** → the indexes live
268
+ * in sub-projects (the monorepo case behind #964). One indexed
269
+ * sub-project → front-load it; several → front-load the one the prompt
270
+ * names (by relative path like `packages/api`, or package directory name)
271
+ * and nudge about the rest; several with no match → nudge the full list so
272
+ * the agent passes `projectPath`, rather than guessing wrong.
273
+ * 3. **nothing indexed reachable** → do nothing (the agent's own tools apply).
274
+ */
275
+ function planFrontload(cwd, prompt) {
276
+ const none = { exploreRoot: null, nudgeProjects: [], viaSubScan: false };
277
+ // 1. up-walk — nearest indexed ancestor (incl. cwd). Cheap; covers the common
278
+ // single-project case without a down-scan.
279
+ let dir = path.resolve(cwd);
280
+ for (let i = 0; i < 6; i++) {
281
+ if (isInitialized(dir))
282
+ return { exploreRoot: dir, nudgeProjects: [], viaSubScan: false };
283
+ const parent = path.dirname(dir);
284
+ if (parent === dir)
285
+ break;
286
+ dir = parent;
287
+ }
288
+ // 2. down-scan — only from something that looks like a workspace root, so a
289
+ // non-project cwd (e.g. $HOME) is a cheap no-op, not a deep crawl.
290
+ const base = path.resolve(cwd);
291
+ if (!looksLikeProjectRoot(base))
292
+ return none;
293
+ const subs = findIndexedSubprojectRoots(base);
294
+ if (subs.length === 0)
295
+ return none;
296
+ if (subs.length === 1)
297
+ return { exploreRoot: subs[0], nudgeProjects: [], viaSubScan: true };
298
+ // Several indexed sub-projects — pick the one the prompt points at, if any.
299
+ const p = prompt.toLowerCase();
300
+ let best = null;
301
+ for (const s of subs) {
302
+ const rel = path.relative(base, s);
303
+ const relLc = rel.split(path.sep).join('/').toLowerCase();
304
+ const name = path.basename(s).toLowerCase();
305
+ let score = 0;
306
+ if (relLc && p.includes(relLc))
307
+ score = 10; // "packages/api"
308
+ else if (name.length >= 3 && new RegExp(`\\b${escapeRegExp(name)}\\b`).test(p))
309
+ score = 5; // "api"
310
+ if (score > 0 && (!best || score > best.score || (score === best.score && rel.length < best.relLen))) {
311
+ best = { root: s, score, relLen: rel.length };
312
+ }
313
+ }
314
+ if (best) {
315
+ return { exploreRoot: best.root, nudgeProjects: subs.filter((s) => s !== best.root), viaSubScan: true };
316
+ }
317
+ // No clear match — nudge the full list rather than front-load a guess.
318
+ return { exploreRoot: null, nudgeProjects: subs, viaSubScan: true };
319
+ }
320
+ /**
321
+ * Contents of `.homegraph/.gitignore`. A single wildcard ignore keeps every
322
+ * transient file in the index dir — the database, `daemon.pid`, the socket,
323
+ * logs, cache, and anything future versions add — out of git, without having
324
+ * to enumerate each name (issues #788, #492, #484). Older versions wrote an
325
+ * explicit allowlist that never listed `daemon.pid` or the socket, so those
326
+ * runtime files were silently committed.
327
+ */
328
+ const GITIGNORE_CONTENT = `# HomeGraph data files — local to each machine, not for committing.
329
+ # Ignore everything in .homegraph/ except this file itself, so transient
330
+ # files (the database, daemon.pid, sockets, logs) never show up in git.
331
+ *
332
+ !.gitignore
333
+ `;
334
+ /** Header line that prefixes every .gitignore HomeGraph has auto-generated. */
335
+ const GITIGNORE_MARKER = '# HomeGraph data files';
336
+ /**
337
+ * Is `content` a stale HomeGraph-generated `.gitignore` that should be
338
+ * regenerated in place? True when it carries our header but predates the
339
+ * wildcard ignore (it has no bare `*` line) — i.e. one of the old explicit
340
+ * allowlists (`*.db`, `cache/`, `.dirty`, …) that never ignored `daemon.pid`
341
+ * or the socket (issue #788). A file WITHOUT our header is user-authored and
342
+ * is left untouched; one that already has the wildcard is current. Matching
343
+ * on the header (not a byte-exact list of past defaults) heals every old
344
+ * variant — v0.7.x through 0.9.9 — and is idempotent once upgraded.
345
+ */
346
+ function isStaleDefaultGitignore(content) {
347
+ if (!content.trimStart().startsWith(GITIGNORE_MARKER))
348
+ return false;
349
+ return !content.split('\n').some((line) => line.trim() === '*');
350
+ }
351
+ /**
352
+ * Write `.homegraph/.gitignore` if it's absent, or upgrade a stale
353
+ * HomeGraph-generated default in place; a user-customized file is left alone.
354
+ * Best-effort — returns `false` only if a needed write failed.
355
+ */
356
+ function ensureGitignore(gitignorePath) {
357
+ let existing;
358
+ try {
359
+ existing = fs.readFileSync(gitignorePath, 'utf-8');
360
+ }
361
+ catch {
362
+ existing = null; // absent (ENOENT) or unreadable — (re)create below
363
+ }
364
+ // Current default or a user-authored file: nothing to do.
365
+ if (existing !== null && !isStaleDefaultGitignore(existing))
366
+ return true;
367
+ try {
368
+ fs.writeFileSync(gitignorePath, GITIGNORE_CONTENT, 'utf-8');
369
+ return true;
370
+ }
371
+ catch {
372
+ return false;
373
+ }
374
+ }
375
+ /**
376
+ * Create the .homegraph directory structure
377
+ * Note: Only throws if homegraph.db already exists, not just if .homegraph/ exists.
378
+ */
379
+ function createDirectory(projectRoot) {
380
+ const homegraphDir = getHomeGraphDir(projectRoot);
381
+ const dbPath = path.join(homegraphDir, 'homegraph.db');
382
+ // Only throw if HomeGraph is actually initialized (db exists)
383
+ // .homegraph/ folder alone is fine
384
+ if (fs.existsSync(dbPath)) {
385
+ throw new Error(`HomeGraph already initialized in ${projectRoot}`);
386
+ }
387
+ // Create main directory (if it doesn't exist)
388
+ fs.mkdirSync(homegraphDir, { recursive: true });
389
+ // Write .gitignore inside .homegraph (create if absent, upgrade a stale
390
+ // pre-wildcard default left by an older version — issue #788).
391
+ ensureGitignore(path.join(homegraphDir, '.gitignore'));
392
+ }
393
+ /**
394
+ * Remove the .homegraph directory
395
+ */
396
+ function removeDirectory(projectRoot) {
397
+ const homegraphDir = getHomeGraphDir(projectRoot);
398
+ if (!fs.existsSync(homegraphDir)) {
399
+ return;
400
+ }
401
+ // Verify .homegraph is a real directory, not a symlink pointing elsewhere
402
+ const lstat = fs.lstatSync(homegraphDir);
403
+ if (lstat.isSymbolicLink()) {
404
+ // Only remove the symlink itself, never follow it for recursive delete
405
+ fs.unlinkSync(homegraphDir);
406
+ return;
407
+ }
408
+ if (!lstat.isDirectory()) {
409
+ // Not a directory - remove the single file
410
+ fs.unlinkSync(homegraphDir);
411
+ return;
412
+ }
413
+ // Recursively remove directory
414
+ fs.rmSync(homegraphDir, { recursive: true, force: true });
415
+ }
416
+ /**
417
+ * Get all files in the .homegraph directory
418
+ */
419
+ function listDirectoryContents(projectRoot) {
420
+ const homegraphDir = getHomeGraphDir(projectRoot);
421
+ if (!fs.existsSync(homegraphDir)) {
422
+ return [];
423
+ }
424
+ const files = [];
425
+ function walkDir(dir, prefix = '') {
426
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
427
+ for (const entry of entries) {
428
+ const relativePath = prefix ? `${prefix}/${entry.name}` : entry.name;
429
+ // Skip symlinks to prevent following links outside .homegraph
430
+ if (entry.isSymbolicLink()) {
431
+ continue;
432
+ }
433
+ if (entry.isDirectory()) {
434
+ walkDir(path.join(dir, entry.name), relativePath);
435
+ }
436
+ else {
437
+ files.push(relativePath);
438
+ }
439
+ }
440
+ }
441
+ walkDir(homegraphDir);
442
+ return files;
443
+ }
444
+ /**
445
+ * Get the total size of the .homegraph directory in bytes
446
+ */
447
+ function getDirectorySize(projectRoot) {
448
+ const homegraphDir = getHomeGraphDir(projectRoot);
449
+ if (!fs.existsSync(homegraphDir)) {
450
+ return 0;
451
+ }
452
+ let totalSize = 0;
453
+ function walkDir(dir) {
454
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
455
+ for (const entry of entries) {
456
+ // Skip symlinks to prevent following links outside .homegraph
457
+ if (entry.isSymbolicLink()) {
458
+ continue;
459
+ }
460
+ const fullPath = path.join(dir, entry.name);
461
+ if (entry.isDirectory()) {
462
+ walkDir(fullPath);
463
+ }
464
+ else {
465
+ const stats = fs.statSync(fullPath);
466
+ totalSize += stats.size;
467
+ }
468
+ }
469
+ }
470
+ walkDir(homegraphDir);
471
+ return totalSize;
472
+ }
473
+ /**
474
+ * Ensure a subdirectory exists within .homegraph
475
+ */
476
+ function ensureSubdirectory(projectRoot, subdirName) {
477
+ if (subdirName.includes('..') || subdirName.includes(path.sep) || subdirName.includes('/')) {
478
+ throw new Error(`Invalid subdirectory name: ${subdirName}`);
479
+ }
480
+ const subdirPath = path.join(getHomeGraphDir(projectRoot), subdirName);
481
+ if (!fs.existsSync(subdirPath)) {
482
+ fs.mkdirSync(subdirPath, { recursive: true });
483
+ }
484
+ return subdirPath;
485
+ }
486
+ /**
487
+ * Check if the .homegraph directory has valid structure
488
+ */
489
+ function validateDirectory(projectRoot) {
490
+ const errors = [];
491
+ const homegraphDir = getHomeGraphDir(projectRoot);
492
+ if (!fs.existsSync(homegraphDir)) {
493
+ errors.push('HomeGraph directory does not exist');
494
+ return { valid: false, errors };
495
+ }
496
+ if (!fs.statSync(homegraphDir).isDirectory()) {
497
+ errors.push('.homegraph exists but is not a directory');
498
+ return { valid: false, errors };
499
+ }
500
+ // Auto-repair / upgrade .gitignore (non-critical file). A missing one is
501
+ // recreated; a stale pre-wildcard default that never ignored daemon.pid is
502
+ // regenerated in place (issue #788); a user-authored file is left alone.
503
+ const gitignorePath = path.join(homegraphDir, '.gitignore');
504
+ const existedBefore = fs.existsSync(gitignorePath);
505
+ if (!ensureGitignore(gitignorePath) && !existedBefore) {
506
+ // Only a missing-and-uncreatable file is surfaced; a failed in-place
507
+ // upgrade of an existing file is non-fatal — the index still works.
508
+ errors.push('.gitignore missing in .homegraph directory and could not be created');
509
+ }
510
+ return {
511
+ valid: errors.length === 0,
512
+ errors,
513
+ };
514
+ }
515
+ //# sourceMappingUR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,MAAM,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC;QAClD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAClC,CAAC;IAED,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;QAC7C,MAAM,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC;QACxD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAClC,CAAC;IAED,yEAAyE;IACzE,2EAA2E;IAC3E,yEAAyE;IACzE,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IAC5D,MAAM,aAAa,GAAG,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACnD,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;QACtD,qEAAqE;QACrE,oEAAoE;QACpE,MAAM,CAAC,IAAI,CAAC,qEAAqE,CAAC,CAAC;IACrF,CAAC;IAED,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC;QAC1B,MAAM;KACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,136 @@
1
+ /**
2
+ * HomeGraph Error Classes
3
+ *
4
+ * Custom error types for better error handling and debugging.
5
+ *
6
+ * @module errors
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * import { FileError, ParseError, setLogger, silentLogger } from 'homegraph';
11
+ *
12
+ * // Catch specific error types
13
+ * try {
14
+ * await cg.indexAll();
15
+ * } catch (error) {
16
+ * if (error instanceof FileError) {
17
+ * console.log(`File error at ${error.filePath}: ${error.message}`);
18
+ * } else if (error instanceof ParseError) {
19
+ * console.log(`Parse error at ${error.filePath}:${error.line}`);
20
+ * }
21
+ * }
22
+ *
23
+ * // Disable logging for tests
24
+ * setLogger(silentLogger);
25
+ * ```
26
+ */
27
+ /**
28
+ * Base error class for all HomeGraph errors.
29
+ *
30
+ * All HomeGraph-specific errors extend this class, allowing you to catch
31
+ * all HomeGraph errors with a single catch block.
32
+ *
33
+ * @example
34
+ * ```typescript
35
+ * try {
36
+ * await cg.indexAll();
37
+ * } catch (error) {
38
+ * if (error instanceof HomeGraphError) {
39
+ * console.log(`HomeGraph error [${error.code}]: ${error.message}`);
40
+ * }
41
+ * }
42
+ * ```
43
+ */
44
+ export declare class HomeGraphError extends Error {
45
+ /** Error code for categorization (e.g., 'FILE_ERROR', 'PARSE_ERROR') */
46
+ readonly code: string;
47
+ /** Additional context about the error */
48
+ readonly context?: Record<string, unknown>;
49
+ constructor(message: string, code: string, context?: Record<string, unknown>);
50
+ }
51
+ /**
52
+ * Error reading or accessing files
53
+ */
54
+ export declare class FileError extends HomeGraphError {
55
+ readonly filePath: string;
56
+ constructor(message: string, filePath: string, cause?: Error);
57
+ }
58
+ /**
59
+ * Error parsing source code
60
+ */
61
+ export declare class ParseError extends HomeGraphError {
62
+ readonly filePath: string;
63
+ readonly line?: number;
64
+ readonly column?: number;
65
+ constructor(message: string, filePath: string, options?: {
66
+ line?: number;
67
+ column?: number;
68
+ cause?: Error;
69
+ });
70
+ }
71
+ /**
72
+ * Error with database operations
73
+ */
74
+ export declare class DatabaseError extends HomeGraphError {
75
+ readonly operation: string;
76
+ constructor(message: string, operation: string, cause?: Error);
77
+ }
78
+ /**
79
+ * Error with search operations
80
+ */
81
+ export declare class SearchError extends HomeGraphError {
82
+ readonly query: string;
83
+ constructor(message: string, query: string, cause?: Error);
84
+ }
85
+ /**
86
+ * Error with vector/embedding operations
87
+ */
88
+ export declare class VectorError extends HomeGraphError {
89
+ constructor(message: string, operation: string, cause?: Error);
90
+ }
91
+ /**
92
+ * Error with configuration
93
+ */
94
+ export declare class ConfigError extends HomeGraphError {
95
+ constructor(message: string, details?: Record<string, unknown>);
96
+ }
97
+ /**
98
+ * Simple logger for HomeGraph operations
99
+ *
100
+ * By default, logs to console.warn for warnings and console.error for errors.
101
+ * Can be configured to use custom logging.
102
+ */
103
+ export interface Logger {
104
+ debug(message: string, context?: Record<string, unknown>): void;
105
+ warn(message: string, context?: Record<string, unknown>): void;
106
+ error(message: string, context?: Record<string, unknown>): void;
107
+ }
108
+ /**
109
+ * Default console-based logger
110
+ */
111
+ export declare const defaultLogger: Logger;
112
+ /**
113
+ * Silent logger (no output) - useful for tests
114
+ */
115
+ export declare const silentLogger: Logger;
116
+ /**
117
+ * Set the global logger
118
+ */
119
+ export declare function setLogger(logger: Logger): void;
120
+ /**
121
+ * Get the current logger
122
+ */
123
+ export declare function getLogger(): Logger;
124
+ /**
125
+ * Log a debug message
126
+ */
127
+ export declare function logDebug(message: string, context?: Record<string, unknown>): void;
128
+ /**
129
+ * Log a warning message
130
+ */
131
+ export declare function logWarn(message: string, context?: Record<string, unknown>): void;
132
+ /**
133
+ * Log an error message
134
+ */
135
+ export declare function logError(message: string, context?: Record<string, unknown>): void;
136
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC,wEAAwE;IACxE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,yCAAyC;IACzC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAE/B,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAW7E;AAED;;GAEG;AACH,qBAAa,SAAU,SAAQ,cAAc;IAC3C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;gBAEd,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,CAA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