@tyroneross/navgator 0.2.2 → 0.9.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 (692) hide show
  1. package/.agents/plugins/marketplace.json +20 -0
  2. package/.claude-plugin/marketplace.json +21 -7
  3. package/.claude-plugin/plugin.json +16 -11
  4. package/.codex-plugin/plugin.json +31 -0
  5. package/.mcp.json +8 -0
  6. package/CLAUDE.md +197 -23
  7. package/LICENSE +202 -21
  8. package/README.md +220 -33
  9. package/agents/architecture-advisor.md +6 -2
  10. package/agents/architecture-investigator.md +163 -0
  11. package/agents/architecture-planner.md +160 -0
  12. package/agents/external-resolver.md +97 -0
  13. package/dist/__tests__/agent-output.test.d.ts +5 -0
  14. package/dist/__tests__/agent-output.test.d.ts.map +1 -0
  15. package/dist/__tests__/agent-output.test.js +233 -0
  16. package/dist/__tests__/agent-output.test.js.map +1 -0
  17. package/dist/__tests__/architecture-insights-stack.test.d.ts +21 -0
  18. package/dist/__tests__/architecture-insights-stack.test.d.ts.map +1 -0
  19. package/dist/__tests__/architecture-insights-stack.test.js +86 -0
  20. package/dist/__tests__/architecture-insights-stack.test.js.map +1 -0
  21. package/dist/__tests__/architecture-insights.test.d.ts +2 -0
  22. package/dist/__tests__/architecture-insights.test.d.ts.map +1 -0
  23. package/dist/__tests__/architecture-insights.test.js +46 -0
  24. package/dist/__tests__/architecture-insights.test.js.map +1 -0
  25. package/dist/__tests__/audit-sampler.test.d.ts +10 -0
  26. package/dist/__tests__/audit-sampler.test.d.ts.map +1 -0
  27. package/dist/__tests__/audit-sampler.test.js +172 -0
  28. package/dist/__tests__/audit-sampler.test.js.map +1 -0
  29. package/dist/__tests__/audit-spc.test.d.ts +5 -0
  30. package/dist/__tests__/audit-spc.test.d.ts.map +1 -0
  31. package/dist/__tests__/audit-spc.test.js +94 -0
  32. package/dist/__tests__/audit-spc.test.js.map +1 -0
  33. package/dist/__tests__/audit-verifiers.test.d.ts +5 -0
  34. package/dist/__tests__/audit-verifiers.test.d.ts.map +1 -0
  35. package/dist/__tests__/audit-verifiers.test.js +248 -0
  36. package/dist/__tests__/audit-verifiers.test.js.map +1 -0
  37. package/dist/__tests__/auto-refresh.test.d.ts +12 -0
  38. package/dist/__tests__/auto-refresh.test.d.ts.map +1 -0
  39. package/dist/__tests__/auto-refresh.test.js +236 -0
  40. package/dist/__tests__/auto-refresh.test.js.map +1 -0
  41. package/dist/__tests__/bare-imports.test.d.ts +8 -0
  42. package/dist/__tests__/bare-imports.test.d.ts.map +1 -0
  43. package/dist/__tests__/bare-imports.test.js +176 -0
  44. package/dist/__tests__/bare-imports.test.js.map +1 -0
  45. package/dist/__tests__/classify.test.d.ts +5 -0
  46. package/dist/__tests__/classify.test.d.ts.map +1 -0
  47. package/dist/__tests__/classify.test.js +158 -0
  48. package/dist/__tests__/classify.test.js.map +1 -0
  49. package/dist/__tests__/cli-commands.test.d.ts +8 -0
  50. package/dist/__tests__/cli-commands.test.d.ts.map +1 -0
  51. package/dist/__tests__/cli-commands.test.js +207 -0
  52. package/dist/__tests__/cli-commands.test.js.map +1 -0
  53. package/dist/__tests__/consolidated-readers.test.d.ts +23 -0
  54. package/dist/__tests__/consolidated-readers.test.d.ts.map +1 -0
  55. package/dist/__tests__/consolidated-readers.test.js +200 -0
  56. package/dist/__tests__/consolidated-readers.test.js.map +1 -0
  57. package/dist/__tests__/coverage.test.d.ts +5 -0
  58. package/dist/__tests__/coverage.test.d.ts.map +1 -0
  59. package/dist/__tests__/coverage.test.js +120 -0
  60. package/dist/__tests__/coverage.test.js.map +1 -0
  61. package/dist/__tests__/deploy-scanner-runtime.test.d.ts +6 -0
  62. package/dist/__tests__/deploy-scanner-runtime.test.d.ts.map +1 -0
  63. package/dist/__tests__/deploy-scanner-runtime.test.js +168 -0
  64. package/dist/__tests__/deploy-scanner-runtime.test.js.map +1 -0
  65. package/dist/__tests__/env-scanner.test.d.ts +2 -0
  66. package/dist/__tests__/env-scanner.test.d.ts.map +1 -0
  67. package/dist/__tests__/env-scanner.test.js +191 -0
  68. package/dist/__tests__/env-scanner.test.js.map +1 -0
  69. package/dist/__tests__/freshness/cli-freshness.test.d.ts +2 -0
  70. package/dist/__tests__/freshness/cli-freshness.test.d.ts.map +1 -0
  71. package/dist/__tests__/freshness/cli-freshness.test.js +26 -0
  72. package/dist/__tests__/freshness/cli-freshness.test.js.map +1 -0
  73. package/dist/__tests__/freshness/dirty-ledger.test.d.ts +2 -0
  74. package/dist/__tests__/freshness/dirty-ledger.test.d.ts.map +1 -0
  75. package/dist/__tests__/freshness/dirty-ledger.test.js +39 -0
  76. package/dist/__tests__/freshness/dirty-ledger.test.js.map +1 -0
  77. package/dist/__tests__/freshness/drainer.test.d.ts +2 -0
  78. package/dist/__tests__/freshness/drainer.test.d.ts.map +1 -0
  79. package/dist/__tests__/freshness/drainer.test.js +103 -0
  80. package/dist/__tests__/freshness/drainer.test.js.map +1 -0
  81. package/dist/__tests__/freshness/paths.test.d.ts +2 -0
  82. package/dist/__tests__/freshness/paths.test.d.ts.map +1 -0
  83. package/dist/__tests__/freshness/paths.test.js +19 -0
  84. package/dist/__tests__/freshness/paths.test.js.map +1 -0
  85. package/dist/__tests__/freshness/scan-lock.test.d.ts +2 -0
  86. package/dist/__tests__/freshness/scan-lock.test.d.ts.map +1 -0
  87. package/dist/__tests__/freshness/scan-lock.test.js +40 -0
  88. package/dist/__tests__/freshness/scan-lock.test.js.map +1 -0
  89. package/dist/__tests__/freshness/stamp.test.d.ts +2 -0
  90. package/dist/__tests__/freshness/stamp.test.d.ts.map +1 -0
  91. package/dist/__tests__/freshness/stamp.test.js +36 -0
  92. package/dist/__tests__/freshness/stamp.test.js.map +1 -0
  93. package/dist/__tests__/gitignore-safety.test.d.ts +2 -0
  94. package/dist/__tests__/gitignore-safety.test.d.ts.map +1 -0
  95. package/dist/__tests__/gitignore-safety.test.js +110 -0
  96. package/dist/__tests__/gitignore-safety.test.js.map +1 -0
  97. package/dist/__tests__/helpers.d.ts +37 -0
  98. package/dist/__tests__/helpers.d.ts.map +1 -0
  99. package/dist/__tests__/helpers.js +134 -0
  100. package/dist/__tests__/helpers.js.map +1 -0
  101. package/dist/__tests__/impact.test.d.ts +5 -0
  102. package/dist/__tests__/impact.test.d.ts.map +1 -0
  103. package/dist/__tests__/impact.test.js +221 -0
  104. package/dist/__tests__/impact.test.js.map +1 -0
  105. package/dist/__tests__/lessons-store.test.d.ts +8 -0
  106. package/dist/__tests__/lessons-store.test.d.ts.map +1 -0
  107. package/dist/__tests__/lessons-store.test.js +232 -0
  108. package/dist/__tests__/lessons-store.test.js.map +1 -0
  109. package/dist/__tests__/llm-dedup.test.d.ts +2 -0
  110. package/dist/__tests__/llm-dedup.test.d.ts.map +1 -0
  111. package/dist/__tests__/llm-dedup.test.js +155 -0
  112. package/dist/__tests__/llm-dedup.test.js.map +1 -0
  113. package/dist/__tests__/mjs-frontend-fetch.test.d.ts +19 -0
  114. package/dist/__tests__/mjs-frontend-fetch.test.d.ts.map +1 -0
  115. package/dist/__tests__/mjs-frontend-fetch.test.js +179 -0
  116. package/dist/__tests__/mjs-frontend-fetch.test.js.map +1 -0
  117. package/dist/__tests__/multi-stack-discovery.test.d.ts +11 -0
  118. package/dist/__tests__/multi-stack-discovery.test.d.ts.map +1 -0
  119. package/dist/__tests__/multi-stack-discovery.test.js +75 -0
  120. package/dist/__tests__/multi-stack-discovery.test.js.map +1 -0
  121. package/dist/__tests__/per-entity-files-gate.test.d.ts +22 -0
  122. package/dist/__tests__/per-entity-files-gate.test.d.ts.map +1 -0
  123. package/dist/__tests__/per-entity-files-gate.test.js +160 -0
  124. package/dist/__tests__/per-entity-files-gate.test.js.map +1 -0
  125. package/dist/__tests__/prisma-calls.test.d.ts +2 -0
  126. package/dist/__tests__/prisma-calls.test.d.ts.map +1 -0
  127. package/dist/__tests__/prisma-calls.test.js +125 -0
  128. package/dist/__tests__/prisma-calls.test.js.map +1 -0
  129. package/dist/__tests__/prisma-parser.test.d.ts +2 -0
  130. package/dist/__tests__/prisma-parser.test.d.ts.map +1 -0
  131. package/dist/__tests__/prisma-parser.test.js +252 -0
  132. package/dist/__tests__/prisma-parser.test.js.map +1 -0
  133. package/dist/__tests__/prompt-detector.test.d.ts +5 -0
  134. package/dist/__tests__/prompt-detector.test.d.ts.map +1 -0
  135. package/dist/__tests__/prompt-detector.test.js +75 -0
  136. package/dist/__tests__/prompt-detector.test.js.map +1 -0
  137. package/dist/__tests__/queue-scanner.test.d.ts +5 -0
  138. package/dist/__tests__/queue-scanner.test.d.ts.map +1 -0
  139. package/dist/__tests__/queue-scanner.test.js +85 -0
  140. package/dist/__tests__/queue-scanner.test.js.map +1 -0
  141. package/dist/__tests__/resolve.test.d.ts +5 -0
  142. package/dist/__tests__/resolve.test.d.ts.map +1 -0
  143. package/dist/__tests__/resolve.test.js +196 -0
  144. package/dist/__tests__/resolve.test.js.map +1 -0
  145. package/dist/__tests__/rules.test.d.ts +2 -0
  146. package/dist/__tests__/rules.test.d.ts.map +1 -0
  147. package/dist/__tests__/rules.test.js +343 -0
  148. package/dist/__tests__/rules.test.js.map +1 -0
  149. package/dist/__tests__/sandbox.test.d.ts +5 -0
  150. package/dist/__tests__/sandbox.test.d.ts.map +1 -0
  151. package/dist/__tests__/sandbox.test.js +189 -0
  152. package/dist/__tests__/sandbox.test.js.map +1 -0
  153. package/dist/__tests__/scanner-audit.test.d.ts +9 -0
  154. package/dist/__tests__/scanner-audit.test.d.ts.map +1 -0
  155. package/dist/__tests__/scanner-audit.test.js +64 -0
  156. package/dist/__tests__/scanner-audit.test.js.map +1 -0
  157. package/dist/__tests__/scanner-characterization.test.d.ts +16 -0
  158. package/dist/__tests__/scanner-characterization.test.d.ts.map +1 -0
  159. package/dist/__tests__/scanner-characterization.test.js +167 -0
  160. package/dist/__tests__/scanner-characterization.test.js.map +1 -0
  161. package/dist/__tests__/scanner-incremental.test.d.ts +13 -0
  162. package/dist/__tests__/scanner-incremental.test.d.ts.map +1 -0
  163. package/dist/__tests__/scanner-incremental.test.js +725 -0
  164. package/dist/__tests__/scanner-incremental.test.js.map +1 -0
  165. package/dist/__tests__/scanner-integration.test.d.ts +7 -0
  166. package/dist/__tests__/scanner-integration.test.d.ts.map +1 -0
  167. package/dist/__tests__/scanner-integration.test.js +211 -0
  168. package/dist/__tests__/scanner-integration.test.js.map +1 -0
  169. package/dist/__tests__/scip-new-catches.test.d.ts +19 -0
  170. package/dist/__tests__/scip-new-catches.test.d.ts.map +1 -0
  171. package/dist/__tests__/scip-new-catches.test.js +90 -0
  172. package/dist/__tests__/scip-new-catches.test.js.map +1 -0
  173. package/dist/__tests__/subgraph.test.d.ts +5 -0
  174. package/dist/__tests__/subgraph.test.d.ts.map +1 -0
  175. package/dist/__tests__/subgraph.test.js +145 -0
  176. package/dist/__tests__/subgraph.test.js.map +1 -0
  177. package/dist/__tests__/trace.test.d.ts +5 -0
  178. package/dist/__tests__/trace.test.d.ts.map +1 -0
  179. package/dist/__tests__/trace.test.js +221 -0
  180. package/dist/__tests__/trace.test.js.map +1 -0
  181. package/dist/agent-output.d.ts +16 -0
  182. package/dist/agent-output.d.ts.map +1 -0
  183. package/dist/agent-output.js +142 -0
  184. package/dist/agent-output.js.map +1 -0
  185. package/dist/architecture-insights.d.ts +17 -0
  186. package/dist/architecture-insights.d.ts.map +1 -0
  187. package/dist/architecture-insights.js +178 -0
  188. package/dist/architecture-insights.js.map +1 -0
  189. package/dist/audit/index.d.ts +69 -0
  190. package/dist/audit/index.d.ts.map +1 -0
  191. package/dist/audit/index.js +255 -0
  192. package/dist/audit/index.js.map +1 -0
  193. package/dist/audit/sampler.d.ts +98 -0
  194. package/dist/audit/sampler.d.ts.map +1 -0
  195. package/dist/audit/sampler.js +298 -0
  196. package/dist/audit/sampler.js.map +1 -0
  197. package/dist/audit/spc.d.ts +62 -0
  198. package/dist/audit/spc.d.ts.map +1 -0
  199. package/dist/audit/spc.js +81 -0
  200. package/dist/audit/spc.js.map +1 -0
  201. package/dist/audit/verifiers.d.ts +81 -0
  202. package/dist/audit/verifiers.d.ts.map +1 -0
  203. package/dist/audit/verifiers.js +366 -0
  204. package/dist/audit/verifiers.js.map +1 -0
  205. package/dist/classify.d.ts +19 -0
  206. package/dist/classify.d.ts.map +1 -0
  207. package/dist/classify.js +124 -0
  208. package/dist/classify.js.map +1 -0
  209. package/dist/cli/commands/connections.d.ts +3 -0
  210. package/dist/cli/commands/connections.d.ts.map +1 -0
  211. package/dist/cli/commands/connections.js +125 -0
  212. package/dist/cli/commands/connections.js.map +1 -0
  213. package/dist/cli/commands/coverage.d.ts +3 -0
  214. package/dist/cli/commands/coverage.d.ts.map +1 -0
  215. package/dist/cli/commands/coverage.js +94 -0
  216. package/dist/cli/commands/coverage.js.map +1 -0
  217. package/dist/cli/commands/dead.d.ts +3 -0
  218. package/dist/cli/commands/dead.d.ts.map +1 -0
  219. package/dist/cli/commands/dead.js +80 -0
  220. package/dist/cli/commands/dead.js.map +1 -0
  221. package/dist/cli/commands/diagram.d.ts +3 -0
  222. package/dist/cli/commands/diagram.d.ts.map +1 -0
  223. package/dist/cli/commands/diagram.js +102 -0
  224. package/dist/cli/commands/diagram.js.map +1 -0
  225. package/dist/cli/commands/find.d.ts +3 -0
  226. package/dist/cli/commands/find.d.ts.map +1 -0
  227. package/dist/cli/commands/find.js +128 -0
  228. package/dist/cli/commands/find.js.map +1 -0
  229. package/dist/cli/commands/freshness.d.ts +20 -0
  230. package/dist/cli/commands/freshness.d.ts.map +1 -0
  231. package/dist/cli/commands/freshness.js +90 -0
  232. package/dist/cli/commands/freshness.js.map +1 -0
  233. package/dist/cli/commands/helpers.d.ts +7 -0
  234. package/dist/cli/commands/helpers.d.ts.map +1 -0
  235. package/dist/cli/commands/helpers.js +30 -0
  236. package/dist/cli/commands/helpers.js.map +1 -0
  237. package/dist/cli/commands/impact.d.ts +3 -0
  238. package/dist/cli/commands/impact.d.ts.map +1 -0
  239. package/dist/cli/commands/impact.js +172 -0
  240. package/dist/cli/commands/impact.js.map +1 -0
  241. package/dist/cli/commands/lessons.d.ts +6 -0
  242. package/dist/cli/commands/lessons.d.ts.map +1 -0
  243. package/dist/cli/commands/lessons.js +279 -0
  244. package/dist/cli/commands/lessons.js.map +1 -0
  245. package/dist/cli/commands/list.d.ts +3 -0
  246. package/dist/cli/commands/list.d.ts.map +1 -0
  247. package/dist/cli/commands/list.js +91 -0
  248. package/dist/cli/commands/list.js.map +1 -0
  249. package/dist/cli/commands/llm-map.d.ts +3 -0
  250. package/dist/cli/commands/llm-map.d.ts.map +1 -0
  251. package/dist/cli/commands/llm-map.js +121 -0
  252. package/dist/cli/commands/llm-map.js.map +1 -0
  253. package/dist/cli/commands/misc.d.ts +17 -0
  254. package/dist/cli/commands/misc.d.ts.map +1 -0
  255. package/dist/cli/commands/misc.js +495 -0
  256. package/dist/cli/commands/misc.js.map +1 -0
  257. package/dist/cli/commands/prompts.d.ts +3 -0
  258. package/dist/cli/commands/prompts.d.ts.map +1 -0
  259. package/dist/cli/commands/prompts.js +74 -0
  260. package/dist/cli/commands/prompts.js.map +1 -0
  261. package/dist/cli/commands/rules.d.ts +3 -0
  262. package/dist/cli/commands/rules.d.ts.map +1 -0
  263. package/dist/cli/commands/rules.js +61 -0
  264. package/dist/cli/commands/rules.js.map +1 -0
  265. package/dist/cli/commands/scan.d.ts +3 -0
  266. package/dist/cli/commands/scan.d.ts.map +1 -0
  267. package/dist/cli/commands/scan.js +177 -0
  268. package/dist/cli/commands/scan.js.map +1 -0
  269. package/dist/cli/commands/schema.d.ts +3 -0
  270. package/dist/cli/commands/schema.d.ts.map +1 -0
  271. package/dist/cli/commands/schema.js +126 -0
  272. package/dist/cli/commands/schema.js.map +1 -0
  273. package/dist/cli/commands/status.d.ts +3 -0
  274. package/dist/cli/commands/status.d.ts.map +1 -0
  275. package/dist/cli/commands/status.js +340 -0
  276. package/dist/cli/commands/status.js.map +1 -0
  277. package/dist/cli/commands/subgraph.d.ts +3 -0
  278. package/dist/cli/commands/subgraph.d.ts.map +1 -0
  279. package/dist/cli/commands/subgraph.js +55 -0
  280. package/dist/cli/commands/subgraph.js.map +1 -0
  281. package/dist/cli/commands/temporal.d.ts +3 -0
  282. package/dist/cli/commands/temporal.d.ts.map +1 -0
  283. package/dist/cli/commands/temporal.js +112 -0
  284. package/dist/cli/commands/temporal.js.map +1 -0
  285. package/dist/cli/commands/trace.d.ts +3 -0
  286. package/dist/cli/commands/trace.d.ts.map +1 -0
  287. package/dist/cli/commands/trace.js +65 -0
  288. package/dist/cli/commands/trace.js.map +1 -0
  289. package/dist/cli/index.js +88 -825
  290. package/dist/cli/index.js.map +1 -1
  291. package/dist/config.d.ts +13 -2
  292. package/dist/config.d.ts.map +1 -1
  293. package/dist/config.js +106 -12
  294. package/dist/config.js.map +1 -1
  295. package/dist/coverage.d.ts +37 -0
  296. package/dist/coverage.d.ts.map +1 -0
  297. package/dist/coverage.js +177 -0
  298. package/dist/coverage.js.map +1 -0
  299. package/dist/diagram.d.ts.map +1 -1
  300. package/dist/diagram.js +41 -0
  301. package/dist/diagram.js.map +1 -1
  302. package/dist/diff.d.ts +57 -0
  303. package/dist/diff.d.ts.map +1 -0
  304. package/dist/diff.js +527 -0
  305. package/dist/diff.js.map +1 -0
  306. package/dist/enrich/cache.d.ts +41 -0
  307. package/dist/enrich/cache.d.ts.map +1 -0
  308. package/dist/enrich/cache.js +97 -0
  309. package/dist/enrich/cache.js.map +1 -0
  310. package/dist/enrich/external-enrichment.types.d.ts +91 -0
  311. package/dist/enrich/external-enrichment.types.d.ts.map +1 -0
  312. package/dist/enrich/external-enrichment.types.js +38 -0
  313. package/dist/enrich/external-enrichment.types.js.map +1 -0
  314. package/dist/enrich/external-resolver.d.ts +95 -0
  315. package/dist/enrich/external-resolver.d.ts.map +1 -0
  316. package/dist/enrich/external-resolver.js +222 -0
  317. package/dist/enrich/external-resolver.js.map +1 -0
  318. package/dist/enrich/fetchers.d.ts +30 -0
  319. package/dist/enrich/fetchers.d.ts.map +1 -0
  320. package/dist/enrich/fetchers.js +89 -0
  321. package/dist/enrich/fetchers.js.map +1 -0
  322. package/dist/file-resolve.d.ts +35 -0
  323. package/dist/file-resolve.d.ts.map +1 -0
  324. package/dist/file-resolve.js +159 -0
  325. package/dist/file-resolve.js.map +1 -0
  326. package/dist/freshness/dirty-ledger.d.ts +7 -0
  327. package/dist/freshness/dirty-ledger.d.ts.map +1 -0
  328. package/dist/freshness/dirty-ledger.js +56 -0
  329. package/dist/freshness/dirty-ledger.js.map +1 -0
  330. package/dist/freshness/drainer.d.ts +38 -0
  331. package/dist/freshness/drainer.d.ts.map +1 -0
  332. package/dist/freshness/drainer.js +88 -0
  333. package/dist/freshness/drainer.js.map +1 -0
  334. package/dist/freshness/paths.d.ts +9 -0
  335. package/dist/freshness/paths.d.ts.map +1 -0
  336. package/dist/freshness/paths.js +24 -0
  337. package/dist/freshness/paths.js.map +1 -0
  338. package/dist/freshness/scan-lock.d.ts +8 -0
  339. package/dist/freshness/scan-lock.d.ts.map +1 -0
  340. package/dist/freshness/scan-lock.js +68 -0
  341. package/dist/freshness/scan-lock.js.map +1 -0
  342. package/dist/freshness/stamp.d.ts +25 -0
  343. package/dist/freshness/stamp.d.ts.map +1 -0
  344. package/dist/freshness/stamp.js +50 -0
  345. package/dist/freshness/stamp.js.map +1 -0
  346. package/dist/git.d.ts +12 -0
  347. package/dist/git.d.ts.map +1 -0
  348. package/dist/git.js +42 -0
  349. package/dist/git.js.map +1 -0
  350. package/dist/gitignore-safety.d.ts +41 -0
  351. package/dist/gitignore-safety.d.ts.map +1 -0
  352. package/dist/gitignore-safety.js +107 -0
  353. package/dist/gitignore-safety.js.map +1 -0
  354. package/dist/impact.d.ts +20 -0
  355. package/dist/impact.d.ts.map +1 -0
  356. package/dist/impact.js +89 -0
  357. package/dist/impact.js.map +1 -0
  358. package/dist/index.d.ts +24 -2
  359. package/dist/index.d.ts.map +1 -1
  360. package/dist/index.js +31 -1
  361. package/dist/index.js.map +1 -1
  362. package/dist/lessons-store.d.ts +93 -0
  363. package/dist/lessons-store.d.ts.map +1 -0
  364. package/dist/lessons-store.js +265 -0
  365. package/dist/lessons-store.js.map +1 -0
  366. package/dist/llm-dedup.d.ts +40 -0
  367. package/dist/llm-dedup.d.ts.map +1 -0
  368. package/dist/llm-dedup.js +373 -0
  369. package/dist/llm-dedup.js.map +1 -0
  370. package/dist/mcp/server.d.ts +9 -0
  371. package/dist/mcp/server.d.ts.map +1 -0
  372. package/dist/mcp/server.js +87 -0
  373. package/dist/mcp/server.js.map +1 -0
  374. package/dist/mcp/tools.d.ts +198 -0
  375. package/dist/mcp/tools.d.ts.map +1 -0
  376. package/dist/mcp/tools.js +744 -0
  377. package/dist/mcp/tools.js.map +1 -0
  378. package/dist/metrics/pagerank-louvain.d.ts +44 -0
  379. package/dist/metrics/pagerank-louvain.d.ts.map +1 -0
  380. package/dist/metrics/pagerank-louvain.js +128 -0
  381. package/dist/metrics/pagerank-louvain.js.map +1 -0
  382. package/dist/parsers/scip-runner.d.ts +63 -0
  383. package/dist/parsers/scip-runner.d.ts.map +1 -0
  384. package/dist/parsers/scip-runner.js +179 -0
  385. package/dist/parsers/scip-runner.js.map +1 -0
  386. package/dist/projects.d.ts +54 -0
  387. package/dist/projects.d.ts.map +1 -0
  388. package/dist/projects.js +153 -0
  389. package/dist/projects.js.map +1 -0
  390. package/dist/resolve.d.ts +22 -0
  391. package/dist/resolve.d.ts.map +1 -0
  392. package/dist/resolve.js +128 -0
  393. package/dist/resolve.js.map +1 -0
  394. package/dist/rules.d.ts +36 -0
  395. package/dist/rules.d.ts.map +1 -0
  396. package/dist/rules.js +484 -0
  397. package/dist/rules.js.map +1 -0
  398. package/dist/sandbox.d.ts +33 -0
  399. package/dist/sandbox.d.ts.map +1 -0
  400. package/dist/sandbox.js +91 -0
  401. package/dist/sandbox.js.map +1 -0
  402. package/dist/scan-lock.d.ts +37 -0
  403. package/dist/scan-lock.d.ts.map +1 -0
  404. package/dist/scan-lock.js +145 -0
  405. package/dist/scan-lock.js.map +1 -0
  406. package/dist/scanner.d.ts +126 -1
  407. package/dist/scanner.d.ts.map +1 -1
  408. package/dist/scanner.js +1711 -235
  409. package/dist/scanner.js.map +1 -1
  410. package/dist/scanners/connections/ast-scanner.d.ts +9 -2
  411. package/dist/scanners/connections/ast-scanner.d.ts.map +1 -1
  412. package/dist/scanners/connections/ast-scanner.js +19 -4
  413. package/dist/scanners/connections/ast-scanner.js.map +1 -1
  414. package/dist/scanners/connections/import-scanner.d.ts +27 -0
  415. package/dist/scanners/connections/import-scanner.d.ts.map +1 -0
  416. package/dist/scanners/connections/import-scanner.js +537 -0
  417. package/dist/scanners/connections/import-scanner.js.map +1 -0
  418. package/dist/scanners/connections/llm-call-tracer.d.ts +1 -1
  419. package/dist/scanners/connections/llm-call-tracer.d.ts.map +1 -1
  420. package/dist/scanners/connections/llm-call-tracer.js +6 -2
  421. package/dist/scanners/connections/llm-call-tracer.js.map +1 -1
  422. package/dist/scanners/connections/prisma-calls.d.ts +11 -0
  423. package/dist/scanners/connections/prisma-calls.d.ts.map +1 -0
  424. package/dist/scanners/connections/prisma-calls.js +237 -0
  425. package/dist/scanners/connections/prisma-calls.js.map +1 -0
  426. package/dist/scanners/connections/service-calls.d.ts +1 -1
  427. package/dist/scanners/connections/service-calls.d.ts.map +1 -1
  428. package/dist/scanners/connections/service-calls.js +35 -3
  429. package/dist/scanners/connections/service-calls.js.map +1 -1
  430. package/dist/scanners/infrastructure/cron-scanner.d.ts +14 -0
  431. package/dist/scanners/infrastructure/cron-scanner.d.ts.map +1 -0
  432. package/dist/scanners/infrastructure/cron-scanner.js +383 -0
  433. package/dist/scanners/infrastructure/cron-scanner.js.map +1 -0
  434. package/dist/scanners/infrastructure/deploy-scanner.d.ts +11 -0
  435. package/dist/scanners/infrastructure/deploy-scanner.d.ts.map +1 -0
  436. package/dist/scanners/infrastructure/deploy-scanner.js +508 -0
  437. package/dist/scanners/infrastructure/deploy-scanner.js.map +1 -0
  438. package/dist/scanners/infrastructure/env-scanner.d.ts +55 -0
  439. package/dist/scanners/infrastructure/env-scanner.d.ts.map +1 -0
  440. package/dist/scanners/infrastructure/env-scanner.js +431 -0
  441. package/dist/scanners/infrastructure/env-scanner.js.map +1 -0
  442. package/dist/scanners/infrastructure/field-usage-analyzer.d.ts +52 -0
  443. package/dist/scanners/infrastructure/field-usage-analyzer.d.ts.map +1 -0
  444. package/dist/scanners/infrastructure/field-usage-analyzer.js +480 -0
  445. package/dist/scanners/infrastructure/field-usage-analyzer.js.map +1 -0
  446. package/dist/scanners/infrastructure/prisma-parser.d.ts +21 -0
  447. package/dist/scanners/infrastructure/prisma-parser.d.ts.map +1 -0
  448. package/dist/scanners/infrastructure/prisma-parser.js +58 -0
  449. package/dist/scanners/infrastructure/prisma-parser.js.map +1 -0
  450. package/dist/scanners/infrastructure/prisma-scanner.d.ts +30 -0
  451. package/dist/scanners/infrastructure/prisma-scanner.d.ts.map +1 -0
  452. package/dist/scanners/infrastructure/prisma-scanner.js +329 -0
  453. package/dist/scanners/infrastructure/prisma-scanner.js.map +1 -0
  454. package/dist/scanners/infrastructure/queue-scanner.d.ts +14 -0
  455. package/dist/scanners/infrastructure/queue-scanner.d.ts.map +1 -0
  456. package/dist/scanners/infrastructure/queue-scanner.js +455 -0
  457. package/dist/scanners/infrastructure/queue-scanner.js.map +1 -0
  458. package/dist/scanners/infrastructure/typespec-validator.d.ts +50 -0
  459. package/dist/scanners/infrastructure/typespec-validator.d.ts.map +1 -0
  460. package/dist/scanners/infrastructure/typespec-validator.js +407 -0
  461. package/dist/scanners/infrastructure/typespec-validator.js.map +1 -0
  462. package/dist/scanners/packages/swift.d.ts +5 -0
  463. package/dist/scanners/packages/swift.d.ts.map +1 -1
  464. package/dist/scanners/packages/swift.js +23 -0
  465. package/dist/scanners/packages/swift.js.map +1 -1
  466. package/dist/scanners/prompts/detector.d.ts +13 -2
  467. package/dist/scanners/prompts/detector.d.ts.map +1 -1
  468. package/dist/scanners/prompts/detector.js +97 -46
  469. package/dist/scanners/prompts/detector.js.map +1 -1
  470. package/dist/scanners/prompts/index.d.ts +1 -1
  471. package/dist/scanners/prompts/index.d.ts.map +1 -1
  472. package/dist/scanners/prompts/index.js +2 -2
  473. package/dist/scanners/prompts/index.js.map +1 -1
  474. package/dist/scanners/swift/code-scanner.d.ts +1 -1
  475. package/dist/scanners/swift/code-scanner.d.ts.map +1 -1
  476. package/dist/scanners/swift/code-scanner.js +216 -2
  477. package/dist/scanners/swift/code-scanner.js.map +1 -1
  478. package/dist/scanners/swift/swiftui-scanner.d.ts +45 -0
  479. package/dist/scanners/swift/swiftui-scanner.d.ts.map +1 -0
  480. package/dist/scanners/swift/swiftui-scanner.js +606 -0
  481. package/dist/scanners/swift/swiftui-scanner.js.map +1 -0
  482. package/dist/scanners/xcode/pbxproj-parser.d.ts +32 -0
  483. package/dist/scanners/xcode/pbxproj-parser.d.ts.map +1 -0
  484. package/dist/scanners/xcode/pbxproj-parser.js +407 -0
  485. package/dist/scanners/xcode/pbxproj-parser.js.map +1 -0
  486. package/dist/scanners/xcode/storyboard-scanner.d.ts +13 -0
  487. package/dist/scanners/xcode/storyboard-scanner.d.ts.map +1 -0
  488. package/dist/scanners/xcode/storyboard-scanner.js +236 -0
  489. package/dist/scanners/xcode/storyboard-scanner.js.map +1 -0
  490. package/dist/storage/markdown-view.d.ts +49 -0
  491. package/dist/storage/markdown-view.d.ts.map +1 -0
  492. package/dist/storage/markdown-view.js +233 -0
  493. package/dist/storage/markdown-view.js.map +1 -0
  494. package/dist/storage.d.ts +225 -9
  495. package/dist/storage.d.ts.map +1 -1
  496. package/dist/storage.js +945 -86
  497. package/dist/storage.js.map +1 -1
  498. package/dist/subgraph.d.ts +30 -0
  499. package/dist/subgraph.d.ts.map +1 -0
  500. package/dist/subgraph.js +106 -0
  501. package/dist/subgraph.js.map +1 -0
  502. package/dist/temporal/git-store.d.ts +65 -0
  503. package/dist/temporal/git-store.d.ts.map +1 -0
  504. package/dist/temporal/git-store.js +166 -0
  505. package/dist/temporal/git-store.js.map +1 -0
  506. package/dist/trace.d.ts +38 -0
  507. package/dist/trace.d.ts.map +1 -0
  508. package/dist/trace.js +292 -0
  509. package/dist/trace.js.map +1 -0
  510. package/dist/types.d.ts +322 -2
  511. package/dist/types.d.ts.map +1 -1
  512. package/dist/types.js +53 -0
  513. package/dist/types.js.map +1 -1
  514. package/hooks/hooks.json +1 -55
  515. package/hooks/mark-dirty.sh +20 -0
  516. package/hooks/post-bash-suggest.sh +30 -0
  517. package/hooks/post-edit-suggest.sh +29 -0
  518. package/hooks/pre-edit-warn.sh +28 -0
  519. package/hooks/session-start.sh +19 -0
  520. package/hooks/stop-suggest.sh +49 -0
  521. package/package.json +30 -11
  522. package/scripts/install-codex-plugin.sh +119 -0
  523. package/scripts/install-plugin.sh +29 -24
  524. package/skills/architecture-export/SKILL.md +79 -0
  525. package/skills/architecture-scan/SKILL.md +64 -0
  526. package/skills/code-review/SKILL.md +368 -0
  527. package/skills/impact-analysis/SKILL.md +80 -0
  528. package/skills/infrastructure-scanning.md +42 -0
  529. package/skills/navgator-setup/SKILL.md +108 -0
  530. package/web/.next/standalone/web/.next/BUILD_ID +1 -1
  531. package/web/.next/standalone/web/.next/app-path-routes-manifest.json +3 -0
  532. package/web/.next/standalone/web/.next/build-manifest.json +2 -2
  533. package/web/.next/standalone/web/.next/prerender-manifest.json +3 -3
  534. package/web/.next/standalone/web/.next/required-server-files.json +4 -4
  535. package/web/.next/standalone/web/.next/routes-manifest.json +18 -0
  536. package/web/.next/standalone/web/.next/server/app/_global-error.html +2 -2
  537. package/web/.next/standalone/web/.next/server/app/_global-error.rsc +1 -1
  538. package/web/.next/standalone/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  539. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  540. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  541. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  542. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  543. package/web/.next/standalone/web/.next/server/app/_not-found/page/next-font-manifest.json +2 -2
  544. package/web/.next/standalone/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  545. package/web/.next/standalone/web/.next/server/app/_not-found.html +1 -1
  546. package/web/.next/standalone/web/.next/server/app/_not-found.rsc +3 -3
  547. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  548. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  549. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  550. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  551. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  552. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_tree.segment.rsc +3 -3
  553. package/web/.next/standalone/web/.next/server/app/api/prompts/route.js.nft.json +1 -1
  554. package/web/.next/standalone/web/.next/server/app/api/rules/route/app-paths-manifest.json +3 -0
  555. package/web/.next/standalone/web/.next/server/app/api/rules/route/build-manifest.json +11 -0
  556. package/web/.next/standalone/web/.next/server/app/api/rules/route/server-reference-manifest.json +4 -0
  557. package/web/.next/standalone/web/.next/server/app/api/rules/route.js +6 -0
  558. package/web/.next/standalone/web/.next/server/app/api/rules/route.js.map +5 -0
  559. package/web/.next/standalone/web/.next/server/app/api/rules/route.js.nft.json +1 -0
  560. package/web/.next/standalone/web/.next/server/app/api/rules/route_client-reference-manifest.js +2 -0
  561. package/web/.next/standalone/web/.next/server/app/api/subgraph/route/app-paths-manifest.json +3 -0
  562. package/web/.next/standalone/web/.next/server/app/api/subgraph/route/build-manifest.json +11 -0
  563. package/web/.next/standalone/web/.next/server/app/api/subgraph/route/server-reference-manifest.json +4 -0
  564. package/web/.next/standalone/web/.next/server/app/api/subgraph/route.js +6 -0
  565. package/web/.next/standalone/web/.next/server/app/api/subgraph/route.js.map +5 -0
  566. package/web/.next/standalone/web/.next/server/app/api/subgraph/route.js.nft.json +1 -0
  567. package/web/.next/standalone/web/.next/server/app/api/subgraph/route_client-reference-manifest.js +2 -0
  568. package/web/.next/standalone/web/.next/server/app/api/trace/route/app-paths-manifest.json +3 -0
  569. package/web/.next/standalone/web/.next/server/app/api/trace/route/build-manifest.json +11 -0
  570. package/web/.next/standalone/web/.next/server/app/api/trace/route/server-reference-manifest.json +4 -0
  571. package/web/.next/standalone/web/.next/server/app/api/trace/route.js +6 -0
  572. package/web/.next/standalone/web/.next/server/app/api/trace/route.js.map +5 -0
  573. package/web/.next/standalone/web/.next/server/app/api/trace/route.js.nft.json +1 -0
  574. package/web/.next/standalone/web/.next/server/app/api/trace/route_client-reference-manifest.js +2 -0
  575. package/web/.next/standalone/web/.next/server/app/index.html +1 -1
  576. package/web/.next/standalone/web/.next/server/app/index.rsc +6 -6
  577. package/web/.next/standalone/web/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  578. package/web/.next/standalone/web/.next/server/app/index.segments/_full.segment.rsc +6 -6
  579. package/web/.next/standalone/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
  580. package/web/.next/standalone/web/.next/server/app/index.segments/_index.segment.rsc +3 -3
  581. package/web/.next/standalone/web/.next/server/app/index.segments/_tree.segment.rsc +5 -5
  582. package/web/.next/standalone/web/.next/server/app/page/next-font-manifest.json +2 -2
  583. package/web/.next/standalone/web/.next/server/app/page_client-reference-manifest.js +1 -1
  584. package/web/.next/standalone/web/.next/server/app-paths-manifest.json +3 -0
  585. package/web/.next/standalone/web/.next/server/chunks/2374f_next_dist_esm_build_templates_app-route_0bb4e66a.js +1 -1
  586. package/web/.next/standalone/web/.next/server/chunks/[root-of-the-server]__006b837d._.js +1 -1
  587. package/web/.next/standalone/web/.next/server/chunks/[root-of-the-server]__0426efe8._.js +3 -0
  588. package/web/.next/standalone/web/.next/server/chunks/[root-of-the-server]__2e09fec9._.js +1 -1
  589. package/web/.next/standalone/web/.next/server/chunks/[root-of-the-server]__38d0390f._.js +1 -1
  590. package/web/.next/standalone/web/.next/server/chunks/[root-of-the-server]__594bcf20._.js +1 -1
  591. package/web/.next/standalone/web/.next/server/chunks/[root-of-the-server]__b888fadf._.js +1 -1
  592. package/web/.next/standalone/web/.next/server/chunks/[root-of-the-server]__cd5f36ce._.js +3 -0
  593. package/web/.next/standalone/web/.next/server/chunks/[root-of-the-server]__ee6fc95f._.js +3 -0
  594. package/web/.next/standalone/web/.next/server/chunks/[root-of-the-server]__fa2ec862._.js +1 -1
  595. package/web/.next/standalone/web/.next/server/chunks/ssr/web_171de0df._.js +9 -4
  596. package/web/.next/standalone/web/.next/server/chunks/web__next-internal_server_app_api_rules_route_actions_3de01bd5.js +3 -0
  597. package/web/.next/standalone/web/.next/server/chunks/web__next-internal_server_app_api_subgraph_route_actions_d8b5a63f.js +3 -0
  598. package/web/.next/standalone/web/.next/server/chunks/web__next-internal_server_app_api_trace_route_actions_b0703ae2.js +3 -0
  599. package/web/.next/standalone/web/.next/server/next-font-manifest.js +1 -1
  600. package/web/.next/standalone/web/.next/server/next-font-manifest.json +4 -4
  601. package/web/.next/standalone/web/.next/server/pages/404.html +1 -1
  602. package/web/.next/standalone/web/.next/server/pages/500.html +2 -2
  603. package/web/.next/standalone/web/.next/server/server-reference-manifest.js +1 -1
  604. package/web/.next/standalone/web/.next/server/server-reference-manifest.json +1 -1
  605. package/web/.next/standalone/web/.next/static/chunks/22a09ecf6ba35cfd.js +17 -0
  606. package/web/.next/standalone/web/.next/static/chunks/9857ba86ce4e82d8.css +2 -0
  607. package/web/.next/standalone/web/.next/static/chunks/f899547f99ef4b76.css +1 -0
  608. package/web/.next/standalone/web/.next/static/media/4fa387ec64143e14-s.c36e1862.woff2 +0 -0
  609. package/web/.next/standalone/web/.next/static/media/53b9e256198e5412-s.853d50a3.woff2 +0 -0
  610. package/web/.next/standalone/web/.next/static/media/5ce348bf30bf5439-s.ebceb24d.woff2 +0 -0
  611. package/web/.next/standalone/web/.next/static/media/6306c77e7c8268e4-s.ff4a2084.woff2 +0 -0
  612. package/web/.next/standalone/web/.next/static/media/7178b3e590c64307-s.55554cd0.woff2 +0 -0
  613. package/web/.next/standalone/web/.next/static/media/797e433ab948586e-s.p.479bea2b.woff2 +0 -0
  614. package/web/.next/standalone/web/.next/static/media/7d817b4c03b0c5f1-s.f377b9c4.woff2 +0 -0
  615. package/web/.next/standalone/web/.next/static/media/8a480f0b521d4e75-s.ea323500.woff2 +0 -0
  616. package/web/.next/standalone/web/.next/static/media/bbc41e54d2fcbd21-s.d1207556.woff2 +0 -0
  617. package/web/.next/standalone/web/.next/static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2 +0 -0
  618. package/web/.next/standalone/web/.next/static/media/fef07dbb0973bf53-s.518e079e.woff2 +0 -0
  619. package/web/.next/standalone/web/app/api/components/route.ts +1 -1
  620. package/web/.next/standalone/web/app/api/connections/route.ts +3 -1
  621. package/web/.next/standalone/web/app/api/graph/route.ts +3 -3
  622. package/web/.next/standalone/web/app/api/projects/route.ts +1 -1
  623. package/web/.next/standalone/web/app/api/prompts/route.ts +2 -2
  624. package/web/.next/standalone/web/app/api/rules/route.ts +213 -0
  625. package/web/.next/standalone/web/app/api/settings/route.ts +2 -2
  626. package/web/.next/standalone/web/app/api/status/route.ts +1 -1
  627. package/web/.next/standalone/web/app/api/subgraph/route.ts +267 -0
  628. package/web/.next/standalone/web/app/api/trace/route.ts +321 -0
  629. package/web/.next/standalone/web/app/page.tsx +9 -1
  630. package/web/.next/standalone/web/components/connections-panel.tsx +23 -6
  631. package/web/.next/standalone/web/components/coverage-panel.tsx +309 -0
  632. package/web/.next/standalone/web/components/rules-panel.tsx +156 -0
  633. package/web/.next/standalone/web/components/sidebar.tsx +8 -0
  634. package/web/.next/standalone/web/components/status-overview.tsx +24 -1
  635. package/web/.next/standalone/web/components/subgraph-panel.tsx +382 -0
  636. package/web/.next/standalone/web/components/trace-panel.tsx +325 -0
  637. package/web/.next/standalone/web/lib/hooks/index.ts +3 -0
  638. package/web/.next/standalone/web/lib/hooks/use-coverage.ts +68 -0
  639. package/web/.next/standalone/web/lib/hooks/use-subgraph.ts +85 -0
  640. package/web/.next/standalone/web/lib/hooks/use-trace.ts +84 -0
  641. package/web/.next/standalone/web/lib/types.ts +108 -0
  642. package/web/.next/standalone/web/package-lock.json +218 -0
  643. package/web/.next/standalone/web/package.json +4 -2
  644. package/web/.next/standalone/web/server.js +1 -1
  645. package/web/.next/static/chunks/22a09ecf6ba35cfd.js +17 -0
  646. package/web/.next/static/chunks/9857ba86ce4e82d8.css +2 -0
  647. package/web/.next/static/chunks/f899547f99ef4b76.css +1 -0
  648. package/web/.next/static/media/4fa387ec64143e14-s.c36e1862.woff2 +0 -0
  649. package/web/.next/static/media/53b9e256198e5412-s.853d50a3.woff2 +0 -0
  650. package/web/.next/static/media/5ce348bf30bf5439-s.ebceb24d.woff2 +0 -0
  651. package/web/.next/static/media/6306c77e7c8268e4-s.ff4a2084.woff2 +0 -0
  652. package/web/.next/static/media/7178b3e590c64307-s.55554cd0.woff2 +0 -0
  653. package/web/.next/static/media/797e433ab948586e-s.p.479bea2b.woff2 +0 -0
  654. package/web/.next/static/media/7d817b4c03b0c5f1-s.f377b9c4.woff2 +0 -0
  655. package/web/.next/static/media/8a480f0b521d4e75-s.ea323500.woff2 +0 -0
  656. package/web/.next/static/media/bbc41e54d2fcbd21-s.d1207556.woff2 +0 -0
  657. package/web/.next/static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2 +0 -0
  658. package/web/.next/static/media/fef07dbb0973bf53-s.518e079e.woff2 +0 -0
  659. package/skills/check/SKILL.md +0 -64
  660. package/skills/connections/SKILL.md +0 -54
  661. package/skills/diagram/SKILL.md +0 -64
  662. package/skills/export/SKILL.md +0 -49
  663. package/skills/impact/SKILL.md +0 -58
  664. package/skills/install/SKILL.md +0 -94
  665. package/skills/scan/SKILL.md +0 -75
  666. package/skills/status/SKILL.md +0 -37
  667. package/skills/ui/SKILL.md +0 -43
  668. package/skills/update/SKILL.md +0 -43
  669. package/web/.next/standalone/web/.next/static/chunks/8a80e7184ad3a13f.css +0 -2
  670. package/web/.next/standalone/web/.next/static/chunks/c056475f5f4424b6.css +0 -1
  671. package/web/.next/standalone/web/.next/static/chunks/cb3513192b63e480.js +0 -12
  672. package/web/.next/standalone/web/.next/static/media/4fa387ec64143e14-s.c1fdd6c2.woff2 +0 -0
  673. package/web/.next/standalone/web/.next/static/media/7178b3e590c64307-s.b97b3418.woff2 +0 -0
  674. package/web/.next/standalone/web/.next/static/media/797e433ab948586e-s.p.dbea232f.woff2 +0 -0
  675. package/web/.next/standalone/web/.next/static/media/8a480f0b521d4e75-s.8e0177b5.woff2 +0 -0
  676. package/web/.next/standalone/web/.next/static/media/bbc41e54d2fcbd21-s.799d8ef8.woff2 +0 -0
  677. package/web/.next/standalone/web/.next/static/media/caa3a2e1cccd8315-s.p.853070df.woff2 +0 -0
  678. package/web/.next/static/chunks/8a80e7184ad3a13f.css +0 -2
  679. package/web/.next/static/chunks/c056475f5f4424b6.css +0 -1
  680. package/web/.next/static/chunks/cb3513192b63e480.js +0 -12
  681. package/web/.next/static/media/4fa387ec64143e14-s.c1fdd6c2.woff2 +0 -0
  682. package/web/.next/static/media/7178b3e590c64307-s.b97b3418.woff2 +0 -0
  683. package/web/.next/static/media/797e433ab948586e-s.p.dbea232f.woff2 +0 -0
  684. package/web/.next/static/media/8a480f0b521d4e75-s.8e0177b5.woff2 +0 -0
  685. package/web/.next/static/media/bbc41e54d2fcbd21-s.799d8ef8.woff2 +0 -0
  686. package/web/.next/static/media/caa3a2e1cccd8315-s.p.853070df.woff2 +0 -0
  687. /package/web/.next/standalone/web/.next/static/{P-ZMQO7_Wnj487ks3guqa → qZVrJ4kmwXfw4Ikgj1oXR}/_buildManifest.js +0 -0
  688. /package/web/.next/standalone/web/.next/static/{P-ZMQO7_Wnj487ks3guqa → qZVrJ4kmwXfw4Ikgj1oXR}/_clientMiddlewareManifest.json +0 -0
  689. /package/web/.next/standalone/web/.next/static/{P-ZMQO7_Wnj487ks3guqa → qZVrJ4kmwXfw4Ikgj1oXR}/_ssgManifest.js +0 -0
  690. /package/web/.next/static/{P-ZMQO7_Wnj487ks3guqa → qZVrJ4kmwXfw4Ikgj1oXR}/_buildManifest.js +0 -0
  691. /package/web/.next/static/{P-ZMQO7_Wnj487ks3guqa → qZVrJ4kmwXfw4Ikgj1oXR}/_clientMiddlewareManifest.json +0 -0
  692. /package/web/.next/static/{P-ZMQO7_Wnj487ks3guqa → qZVrJ4kmwXfw4Ikgj1oXR}/_ssgManifest.js +0 -0
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Vendored, dependency-free upstream version fetchers for NavGator.
3
+ *
4
+ * Self-contained: uses the global `fetch` (Node ≥18) — no axios, no api-registry
5
+ * import. These are the ONLY network calls in the enrichment fold, and they run
6
+ * exclusively on the freshness path (refreshExternal / the external-resolver
7
+ * agent), never inside scan(). The engine stays offline and deterministic.
8
+ *
9
+ * Equivalent to api-registry/src/http.ts's fetchers, re-implemented here so
10
+ * NavGator carries no cross-plugin dependency.
11
+ */
12
+ const UA = { 'User-Agent': 'navgator-external-resolver' };
13
+ const TIMEOUT_MS = 8000;
14
+ async function getJson(url, headers = {}) {
15
+ try {
16
+ const ctrl = new AbortController();
17
+ const t = setTimeout(() => ctrl.abort(), TIMEOUT_MS);
18
+ const res = await fetch(url, { headers: { ...UA, ...headers }, signal: ctrl.signal });
19
+ clearTimeout(t);
20
+ if (!res.ok)
21
+ return null;
22
+ return (await res.json());
23
+ }
24
+ catch {
25
+ return null; // network failure → caller marks node unresolved
26
+ }
27
+ }
28
+ /** npm: latest dist-tag + publish time. */
29
+ export async function fetchNpmLatest(pkg) {
30
+ const data = (await getJson(`https://registry.npmjs.org/${encodeURIComponent(pkg)}`));
31
+ if (!data?.['dist-tags']?.latest)
32
+ return null;
33
+ const version = data['dist-tags'].latest;
34
+ return {
35
+ version,
36
+ released_at: data.time?.[version],
37
+ docs_url: data.homepage,
38
+ repo_url: data.repository?.url?.replace(/^git\+/, '').replace(/\.git$/, ''),
39
+ };
40
+ }
41
+ /** PyPI: latest version + release date. */
42
+ export async function fetchPypiLatest(pkg) {
43
+ const data = (await getJson(`https://pypi.org/pypi/${encodeURIComponent(pkg)}/json`));
44
+ const version = data?.info?.version;
45
+ if (!version)
46
+ return null;
47
+ const files = data?.releases?.[version];
48
+ return {
49
+ version,
50
+ released_at: files?.[0]?.upload_time_iso_8601,
51
+ docs_url: data?.info?.project_urls?.['Documentation'] ??
52
+ data?.info?.project_urls?.['Homepage'] ??
53
+ data?.info?.home_page,
54
+ repo_url: data?.info?.project_urls?.['Source'] ?? data?.info?.project_urls?.['Repository'],
55
+ };
56
+ }
57
+ /**
58
+ * GitHub Releases: latest tag + publish date for `owner/repo`.
59
+ * Used for spm/cargo/go nodes that expose versions via tags, not a registry.
60
+ * Honors GITHUB_TOKEN when present to avoid the 60/hr unauthenticated limit.
61
+ */
62
+ export async function fetchGitHubLatest(ownerRepo) {
63
+ const headers = process.env['GITHUB_TOKEN']
64
+ ? { Authorization: `Bearer ${process.env['GITHUB_TOKEN']}` }
65
+ : {};
66
+ const data = (await getJson(`https://api.github.com/repos/${ownerRepo}/releases/latest`, headers));
67
+ if (!data?.tag_name)
68
+ return null;
69
+ return {
70
+ version: data.tag_name.replace(/^v/, ''),
71
+ released_at: data.published_at,
72
+ docs_url: data.html_url,
73
+ repo_url: `https://github.com/${ownerRepo}`,
74
+ };
75
+ }
76
+ /** Dispatch by ecosystem. `ref` is a package name, or owner/repo for github. */
77
+ export async function fetchLatest(registry, ref) {
78
+ switch (registry) {
79
+ case 'npm':
80
+ return fetchNpmLatest(ref);
81
+ case 'pypi':
82
+ return fetchPypiLatest(ref);
83
+ case 'github':
84
+ return fetchGitHubLatest(ref);
85
+ default:
86
+ return null;
87
+ }
88
+ }
89
+ //# sourceMappingURL=fetchers.js.map
@@ -0,0 +1 @@
1
+ {"version":3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G,CAAC,MAAM,OAAO,CACzB,gCAAgC,SAAS,kBAAkB,EAC3D,OAAO,CACR,CAA2E,CAAC;IAC7E,IAAI,CAAC,IAAI,EAAE,QAAQ;QAAE,OAAO,IAAI,CAAC;IACjC,OAAO;QACL,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;QACxC,WAAW,EAAE,IAAI,CAAC,YAAY;QAC9B,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,QAAQ,EAAE,sBAAsB,SAAS,EAAE;KAC5C,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,QAAmC,EACnC,GAAW;IAEX,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,KAAK;YACR,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;QAC7B,KAAK,MAAM;YACT,OAAO,eAAe,CAAC,GAAG,CAAC,CAAC;QAC9B,KAAK,QAAQ;YACX,OAAO,iBAAiB,CAAC,GAAG,CAAC,CAAC;QAChC;YACE,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * NavGator File-Level Resolution
3
+ * Resolves file paths to import connections when no component exists.
4
+ * Enables `navgator impact src/foo.ts` and `navgator connections src/foo.ts`.
5
+ */
6
+ import type { ArchitectureConnection } from './types.js';
7
+ export interface FileConnections {
8
+ filePath: string;
9
+ fileId: string;
10
+ /** Files that import this file */
11
+ importedBy: ArchitectureConnection[];
12
+ /** Files this file imports */
13
+ imports: ArchitectureConnection[];
14
+ /** Non-import connections (service calls, etc.) where this file appears */
15
+ otherFrom: ArchitectureConnection[];
16
+ otherTo: ArchitectureConnection[];
17
+ }
18
+ /**
19
+ * Check if a query looks like a file path.
20
+ */
21
+ export declare function looksLikeFilePath(query: string): boolean;
22
+ /**
23
+ * Resolve a file path to its import connections.
24
+ * Returns null if no connections found for this file.
25
+ */
26
+ export declare function resolveFileConnections(query: string, allConnections: ArchitectureConnection[]): FileConnections | null;
27
+ /**
28
+ * Format file-level impact analysis for CLI output.
29
+ */
30
+ export declare function formatFileImpact(fc: FileConnections): string;
31
+ /**
32
+ * Format file-level connections for CLI output.
33
+ */
34
+ export declare function formatFileConnections(fc: FileConnections): string;
35
+ //# sourceMappingURL=file-resolve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-resolve.d.ts","sourceRoot":"","sources":["../src/file-resolve.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,UAAU,EAAE,sBAAsB,EAAE,CAAC;IACrC,8BAA8B;IAC9B,OAAO,EAAE,sBAAsB,EAAE,CAAC;IAClC,2EAA2E;IAC3E,SAAS,EAAE,sBAAsB,EAAE,CAAC;IACpC,OAAO,EAAE,sBAAsB,EAAE,CAAC;CACnC;AAWD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAUxD;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,MAAM,EACb,cAAc,EAAE,sBAAsB,EAAE,GACvC,eAAe,GAAG,IAAI,CA8BxB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,eAAe,GAAG,MAAM,CAyD5D;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,eAAe,GAAG,MAAM,CA+CjE"}
@@ -0,0 +1,159 @@
1
+ /**
2
+ * NavGator File-Level Resolution
3
+ * Resolves file paths to import connections when no component exists.
4
+ * Enables `navgator impact src/foo.ts` and `navgator connections src/foo.ts`.
5
+ */
6
+ /**
7
+ * Normalize a query to match FILE: connection IDs.
8
+ * Strips leading ./ and normalizes separators.
9
+ */
10
+ function normalizeToFileId(query) {
11
+ const normalized = query.replace(/\\/g, '/').replace(/^\.\//, '');
12
+ return `FILE:${normalized}`;
13
+ }
14
+ /**
15
+ * Check if a query looks like a file path.
16
+ */
17
+ export function looksLikeFilePath(query) {
18
+ return (query.includes('/') ||
19
+ query.includes('.ts') ||
20
+ query.includes('.js') ||
21
+ query.includes('.tsx') ||
22
+ query.includes('.jsx') ||
23
+ query.includes('.py') ||
24
+ query.includes('.swift'));
25
+ }
26
+ /**
27
+ * Resolve a file path to its import connections.
28
+ * Returns null if no connections found for this file.
29
+ */
30
+ export function resolveFileConnections(query, allConnections) {
31
+ const fileId = normalizeToFileId(query);
32
+ const normalized = query.replace(/\\/g, '/').replace(/^\.\//, '');
33
+ // Find connections where this file is the source or target
34
+ const importedBy = [];
35
+ const imports = [];
36
+ const otherFrom = [];
37
+ const otherTo = [];
38
+ for (const conn of allConnections) {
39
+ const fromMatch = conn.from.component_id === fileId ||
40
+ conn.from.component_id === `FILE:${normalized}` ||
41
+ conn.code_reference?.file === normalized;
42
+ const toMatch = conn.to.component_id === fileId ||
43
+ conn.to.component_id === `FILE:${normalized}`;
44
+ if (conn.connection_type === 'imports') {
45
+ if (fromMatch)
46
+ imports.push(conn);
47
+ if (toMatch)
48
+ importedBy.push(conn);
49
+ }
50
+ else {
51
+ if (fromMatch)
52
+ otherFrom.push(conn);
53
+ if (toMatch)
54
+ otherTo.push(conn);
55
+ }
56
+ }
57
+ const total = importedBy.length + imports.length + otherFrom.length + otherTo.length;
58
+ if (total === 0)
59
+ return null;
60
+ return { filePath: normalized, fileId, importedBy, imports, otherFrom, otherTo };
61
+ }
62
+ /**
63
+ * Format file-level impact analysis for CLI output.
64
+ */
65
+ export function formatFileImpact(fc) {
66
+ const lines = [];
67
+ lines.push(`NavGator - File Impact: ${fc.filePath}\n`);
68
+ lines.push('========================================');
69
+ lines.push(`File: ${fc.filePath}`);
70
+ const directCount = fc.importedBy.length;
71
+ const severity = directCount > 5 ? 'CRITICAL' : directCount >= 3 ? 'HIGH' : directCount >= 1 ? 'MEDIUM' : 'LOW';
72
+ lines.push(`Impact: ${severity} (${directCount} file${directCount !== 1 ? 's' : ''} import this)`);
73
+ if (fc.importedBy.length > 0) {
74
+ lines.push(`\nIMPORTED BY (${fc.importedBy.length}):`);
75
+ lines.push('These files import this file:\n');
76
+ for (const conn of fc.importedBy) {
77
+ const fromFile = conn.from.component_id.replace('FILE:', '');
78
+ const lineInfo = conn.code_reference?.line_start ? `:${conn.code_reference.line_start}` : '';
79
+ lines.push(` ${fromFile}${lineInfo}`);
80
+ if (conn.code_reference?.symbol) {
81
+ lines.push(` import: ${conn.code_reference.symbol}`);
82
+ }
83
+ }
84
+ }
85
+ if (fc.imports.length > 0) {
86
+ lines.push(`\nIMPORTS (${fc.imports.length}):`);
87
+ lines.push('This file imports:\n');
88
+ for (const conn of fc.imports) {
89
+ const toFile = conn.to.component_id.replace('FILE:', '');
90
+ lines.push(` ${toFile}`);
91
+ }
92
+ }
93
+ if (fc.otherFrom.length > 0) {
94
+ lines.push(`\nOUTGOING SERVICE CALLS (${fc.otherFrom.length}):`);
95
+ for (const conn of fc.otherFrom) {
96
+ const target = conn.to.component_id;
97
+ lines.push(` → ${target} (${conn.connection_type})`);
98
+ }
99
+ }
100
+ if (fc.otherTo.length > 0) {
101
+ lines.push(`\nINCOMING REFERENCES (${fc.otherTo.length}):`);
102
+ for (const conn of fc.otherTo) {
103
+ const source = conn.from.component_id;
104
+ lines.push(` ← ${source} (${conn.connection_type})`);
105
+ }
106
+ }
107
+ lines.push('\n========================================');
108
+ lines.push('Files that may need changes:');
109
+ for (const conn of fc.importedBy) {
110
+ const fromFile = conn.from.component_id.replace('FILE:', '');
111
+ lines.push(` - ${fromFile}`);
112
+ }
113
+ return lines.join('\n');
114
+ }
115
+ /**
116
+ * Format file-level connections for CLI output.
117
+ */
118
+ export function formatFileConnections(fc) {
119
+ const lines = [];
120
+ lines.push(`NavGator - File Connections: ${fc.filePath}\n`);
121
+ lines.push('========================================');
122
+ lines.push(`File: ${fc.filePath}`);
123
+ if (fc.importedBy.length > 0) {
124
+ lines.push(`\nIMPORTED BY (${fc.importedBy.length}):`);
125
+ for (const conn of fc.importedBy) {
126
+ const fromFile = conn.from.component_id.replace('FILE:', '');
127
+ const lineInfo = conn.code_reference?.line_start ? `:${conn.code_reference.line_start}` : '';
128
+ lines.push(`├── ${fromFile}${lineInfo}`);
129
+ if (conn.code_reference?.symbol) {
130
+ lines.push(`│ └── import: ${conn.code_reference.symbol}`);
131
+ }
132
+ }
133
+ }
134
+ if (fc.imports.length > 0) {
135
+ lines.push(`\nIMPORTS (${fc.imports.length}):`);
136
+ for (const conn of fc.imports) {
137
+ const toFile = conn.to.component_id.replace('FILE:', '');
138
+ lines.push(`├── ${toFile}`);
139
+ }
140
+ }
141
+ if (fc.otherFrom.length > 0) {
142
+ lines.push(`\nOUTGOING (${fc.otherFrom.length}):`);
143
+ for (const conn of fc.otherFrom) {
144
+ lines.push(`├── ${conn.connection_type} → ${conn.to.component_id}`);
145
+ }
146
+ }
147
+ if (fc.otherTo.length > 0) {
148
+ lines.push(`\nINCOMING (${fc.otherTo.length}):`);
149
+ for (const conn of fc.otherTo) {
150
+ lines.push(`├── ${conn.connection_type} ← ${conn.from.component_id}`);
151
+ }
152
+ }
153
+ const total = fc.importedBy.length + fc.imports.length + fc.otherFrom.length + fc.otherTo.length;
154
+ if (total === 0) {
155
+ lines.push('\nNo connections found for this file.');
156
+ }
157
+ return lines.join('\n');
158
+ }
159
+ //# sourceMappingURL=file-resolve.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-resolve.js","sourceRoot":"","sources":["../src/file-resolve.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAgBH;;;GAGG;AACH,SAAS,iBAAiB,CAAC,KAAa;IACtC,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,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AI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,7 @@
1
+ /** Append paths to the dirty set (deduped, sorted). Safe to call concurrently-ish. */
2
+ export declare function markDirty(paths: string[], root: string): void;
3
+ /** Read the current dirty set (sorted). */
4
+ export declare function readDirty(root: string): string[];
5
+ /** Remove the given drained paths, leaving anything that arrived later. */
6
+ export declare function clearDirty(drained: string[], root: string): void;
7
+ //# sourceMappingURL=dirty-ledger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dirty-ledger.d.ts","sourceRoot":"","sources":["../../src/freshness/dirty-ledger.ts"],"names":[],"mappings":"AAoCA,sFAAsF;AACtF,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAQ7D;AAED,2CAA2C;AAC3C,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAEhD;AAED,2EAA2E;AAC3E,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAQhE"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * The dirty-set ledger: an append-only set of changed paths since the last clean
3
+ * drain. The PostToolUse hook appends here (fast, non-blocking); the drainer
4
+ * reads it, scans, and clears the drained subset. Late arrivals (marked while a
5
+ * scan is in flight) survive a partial clear and are picked up next drain.
6
+ */
7
+ import * as fs from 'fs';
8
+ import * as path from 'path';
9
+ import { dirtyLedgerPath } from './paths.js';
10
+ function load(root) {
11
+ const p = dirtyLedgerPath(root);
12
+ if (!fs.existsSync(p))
13
+ return { version: 1, paths: [], updated_at: 0 };
14
+ try {
15
+ const parsed = JSON.parse(fs.readFileSync(p, 'utf8'));
16
+ if (parsed?.version === 1 && Array.isArray(parsed.paths))
17
+ return parsed;
18
+ }
19
+ catch {
20
+ /* corrupt -> reset; never block the hook or drainer */
21
+ }
22
+ return { version: 1, paths: [], updated_at: 0 };
23
+ }
24
+ function save(root, data) {
25
+ const p = dirtyLedgerPath(root);
26
+ fs.mkdirSync(path.dirname(p), { recursive: true });
27
+ const tmp = `${p}.tmp`;
28
+ fs.writeFileSync(tmp, JSON.stringify(data, null, 2), 'utf8');
29
+ fs.renameSync(tmp, p); // atomic on same filesystem
30
+ }
31
+ /** Append paths to the dirty set (deduped, sorted). Safe to call concurrently-ish. */
32
+ export function markDirty(paths, root) {
33
+ const data = load(root);
34
+ const set = new Set(data.paths);
35
+ for (const raw of paths) {
36
+ const v = raw.trim();
37
+ if (v)
38
+ set.add(v);
39
+ }
40
+ save(root, { version: 1, paths: [...set].sort(), updated_at: Date.now() });
41
+ }
42
+ /** Read the current dirty set (sorted). */
43
+ export function readDirty(root) {
44
+ return load(root).paths;
45
+ }
46
+ /** Remove the given drained paths, leaving anything that arrived later. */
47
+ export function clearDirty(drained, root) {
48
+ const data = load(root);
49
+ const drop = new Set(drained);
50
+ save(root, {
51
+ version: 1,
52
+ paths: data.paths.filter((p) => !drop.has(p)),
53
+ updated_at: Date.now(),
54
+ });
55
+ }
56
+ //# sourceMappingURL=dirty-ledger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dirty-ledger.js","sourceRoot":"","sources":["../../src/freshness/dirty-ledger.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAQ7C,SAAS,IAAI,CAAC,IAAY;IACxB,MAAM,CAAC,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IAChC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;QAAE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;IACvE,IAAI,CAAC;QACH,MAAM,MAAM,GAA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,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AAC7E,CAAC;AAED,2CAA2C;AAC3C,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC;AAC1B,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,UAAU,CAAC,OAAiB,EAAE,IAAY;IACxD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;IACxB,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;IAC9B,IAAI,CAAC,IAAI,EAAE;QACT,OAAO,EAAE,CAAC;QACV,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC7C,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE;KACvB,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,38 @@
1
+ export type DrainStatus = 'busy' | 'debounced' | 'clean' | 'drained' | 'error';
2
+ export interface DrainResult {
3
+ status: DrainStatus;
4
+ scanned: number;
5
+ error?: string;
6
+ }
7
+ export interface DrainOptions {
8
+ /** Injected scanner. Production passes a wrapper over NavGator `scan()`. */
9
+ scanFn: (root: string, changed: string[]) => Promise<void>;
10
+ /** Skip if the last stamp was generated within this window (default 3000ms). */
11
+ minIntervalMs?: number;
12
+ }
13
+ export declare function drain(root: string, opts: DrainOptions): Promise<DrainResult>;
14
+ export interface DrainUntilCleanOptions extends DrainOptions {
15
+ /** Max drain attempts before giving up (default 12). Bounds worst-case time. */
16
+ maxAttempts?: number;
17
+ /** Override the post-attempt wait; defaults to minIntervalMs (busy waits less). */
18
+ waitMs?: number;
19
+ }
20
+ /**
21
+ * Trailing-edge guarantee. A single `drain()` can leave the *final* edits of a
22
+ * burst undrained (debounced) or skipped (busy). This loops past those states —
23
+ * sleeping out the debounce window between tries — until the ledger is actually
24
+ * empty, so the view self-heals within ~minIntervalMs of edits stopping instead
25
+ * of waiting for the 5-minute autoRefresh backstop. The hook spawns this
26
+ * detached, so the sleeps never block an edit. Returns every attempt's result.
27
+ */
28
+ export declare function drainUntilClean(root: string, opts: DrainUntilCleanOptions): Promise<DrainResult[]>;
29
+ /**
30
+ * Stamp coherence for out-of-band scans. NavGator's existing `autoRefreshIfStale`
31
+ * backstop runs an incremental scan WITHOUT going through the drainer, which
32
+ * would leave the dirty ledger and stamp stale — making the stamp lie (report
33
+ * dirty when the graph is actually current). Call this after any such scan to
34
+ * reconcile: the incremental scan already covered every changed file via hashes,
35
+ * so the whole ledger is safely cleared and a clean stamp written. Best-effort.
36
+ */
37
+ export declare function reconcileClean(root: string): Promise<void>;
38
+ //# sourceMappingURL=drainer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drainer.d.ts","sourceRoot":"","sources":["../../src/freshness/drainer.ts"],"names":[],"mappings":"AAcA,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,WAAW,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAE/E,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,4EAA4E;IAC5E,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3D,gFAAgF;IAChF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAsB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAuClF;AAID,MAAM,WAAW,sBAAuB,SAAQ,YAAY;IAC1D,gFAAgF;IAChF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mFAAmF;IACnF,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,sBAAsB,GAC3B,OAAO,CAAC,WAAW,EAAE,CAAC,CAaxB;AAED;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIhE"}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * The background drainer. Coalesces the dirty set and runs one incremental scan
3
+ * under the single-writer lock, then writes an honest stamp. Designed to be
4
+ * invoked repeatedly and cheaply (by the hook, the orchestrator, or a timer):
5
+ * - busy -> another drainer holds the lock; caller should not wait.
6
+ * - debounced -> a drain ran within minIntervalMs; skipped (dirty set kept).
7
+ * - clean -> nothing dirty; stamp refreshed only.
8
+ * - drained -> scanned, cleared the drained subset, stamp updated.
9
+ * - error -> scan threw; dirty set left intact for a retry.
10
+ */
11
+ import { readDirty, clearDirty } from './dirty-ledger.js';
12
+ import { acquireLock, releaseLock } from './scan-lock.js';
13
+ import { computeStamp, writeStamp, readStamp } from './stamp.js';
14
+ export async function drain(root, opts) {
15
+ const minInterval = opts.minIntervalMs ?? 3000;
16
+ // Debounce off the last stamp's generated_at (only when there IS prior state).
17
+ const prior = readStamp(root);
18
+ if (prior && Date.now() - prior.generated_at < minInterval) {
19
+ return { status: 'debounced', scanned: 0 };
20
+ }
21
+ if (!acquireLock(root)) {
22
+ return { status: 'busy', scanned: 0 };
23
+ }
24
+ try {
25
+ const dirty = readDirty(root);
26
+ if (dirty.length === 0) {
27
+ writeStamp(root, await computeStamp(root, { inFlight: false }));
28
+ return { status: 'clean', scanned: 0 };
29
+ }
30
+ // Mark in-flight so concurrent readers see the truth during the scan.
31
+ writeStamp(root, await computeStamp(root, { inFlight: true }));
32
+ try {
33
+ await opts.scanFn(root, dirty);
34
+ }
35
+ catch (e) {
36
+ // Leave the dirty set intact; clear the in-flight flag honestly.
37
+ writeStamp(root, await computeStamp(root, { inFlight: false }));
38
+ return { status: 'error', scanned: 0, error: e instanceof Error ? e.message : String(e) };
39
+ }
40
+ const completedAt = Date.now();
41
+ clearDirty(dirty, root); // clears only what we drained; late arrivals remain
42
+ writeStamp(root, await computeStamp(root, { inFlight: false, generatedAt: completedAt }));
43
+ return { status: 'drained', scanned: dirty.length };
44
+ }
45
+ finally {
46
+ releaseLock(root);
47
+ }
48
+ }
49
+ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
50
+ /**
51
+ * Trailing-edge guarantee. A single `drain()` can leave the *final* edits of a
52
+ * burst undrained (debounced) or skipped (busy). This loops past those states —
53
+ * sleeping out the debounce window between tries — until the ledger is actually
54
+ * empty, so the view self-heals within ~minIntervalMs of edits stopping instead
55
+ * of waiting for the 5-minute autoRefresh backstop. The hook spawns this
56
+ * detached, so the sleeps never block an edit. Returns every attempt's result.
57
+ */
58
+ export async function drainUntilClean(root, opts) {
59
+ const maxAttempts = opts.maxAttempts ?? 12;
60
+ const baseWait = opts.waitMs ?? opts.minIntervalMs ?? 3000;
61
+ const results = [];
62
+ for (let i = 0; i < maxAttempts; i++) {
63
+ const res = await drain(root, { scanFn: opts.scanFn, minIntervalMs: opts.minIntervalMs });
64
+ results.push(res);
65
+ const settled = res.status === 'drained' || res.status === 'clean';
66
+ if (settled && readDirty(root).length === 0)
67
+ break; // ledger truly empty → done
68
+ if (res.status === 'error')
69
+ break; // a scan that throws won't fix itself by retrying
70
+ await sleep(res.status === 'busy' ? Math.min(1000, baseWait) : baseWait);
71
+ }
72
+ return results;
73
+ }
74
+ /**
75
+ * Stamp coherence for out-of-band scans. NavGator's existing `autoRefreshIfStale`
76
+ * backstop runs an incremental scan WITHOUT going through the drainer, which
77
+ * would leave the dirty ledger and stamp stale — making the stamp lie (report
78
+ * dirty when the graph is actually current). Call this after any such scan to
79
+ * reconcile: the incremental scan already covered every changed file via hashes,
80
+ * so the whole ledger is safely cleared and a clean stamp written. Best-effort.
81
+ */
82
+ export async function reconcileClean(root) {
83
+ const all = readDirty(root);
84
+ if (all.length > 0)
85
+ clearDirty(all, root);
86
+ writeStamp(root, await computeStamp(root, { inFlight: false }));
87
+ }
88
+ //# sourceMappingURL=drainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drainer.js","sourceRoot":"","sources":["../../src/freshness/drainer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAiBjE,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,IAAY,EAAE,IAAkB;IAC1D,MAAM,WAAW,GAAG,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC;IAE/C,+EAA+E;IAC/E,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAI,KAAK,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,YAAY,GAAG,WAAW,EAAE,CAAC;QAC3D,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IAC7C,CAAC;IAED,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;QACvB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACxC,CAAC;IAED,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;QAE9B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,UAAU,CAAC,I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AAI,GAAG,CAAC,MAAM,GAAG,CAAC;QAAE,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC1C,UAAU,CAAC,IAAI,EAAE,MAAM,YAAY,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;AAClE,CAAC"}
@@ -0,0 +1,9 @@
1
+ /** The `.navgator` base dir for a project root (sibling of `architecture/`). */
2
+ export declare function navgatorBase(root: string): string;
3
+ /** Dirty-set ledger: append-only set of changed paths since the last clean drain. */
4
+ export declare function dirtyLedgerPath(root: string): string;
5
+ /** Single-writer scan lock. */
6
+ export declare function scanLockPath(root: string): string;
7
+ /** Freshness stamp, stored next to the graph it describes. */
8
+ export declare function stampPath(root: string): string;
9
+ //# sourceMappingURL=paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/freshness/paths.ts"],"names":[],"mappings":"AAQA,gFAAgF;AAChF,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,qFAAqF;AACrF,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,+BAA+B;AAC/B,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,8DAA8D;AAC9D,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9C"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Single source of truth for freshness-subsystem file locations.
3
+ * Derived from NavGator config so local vs shared storage mode is honored:
4
+ * getStoragePath() returns <base>/architecture, so its dirname is the base.
5
+ */
6
+ import * as path from 'path';
7
+ import { getConfig, getStoragePath } from '../config.js';
8
+ /** The `.navgator` base dir for a project root (sibling of `architecture/`). */
9
+ export function navgatorBase(root) {
10
+ return path.dirname(getStoragePath(getConfig(), root));
11
+ }
12
+ /** Dirty-set ledger: append-only set of changed paths since the last clean drain. */
13
+ export function dirtyLedgerPath(root) {
14
+ return path.join(navgatorBase(root), 'dirty.json');
15
+ }
16
+ /** Single-writer scan lock. */
17
+ export function scanLockPath(root) {
18
+ return path.join(navgatorBase(root), 'scan.lock');
19
+ }
20
+ /** Freshness stamp, stored next to the graph it describes. */
21
+ export function stampPath(root) {
22
+ return path.join(navgatorBase(root), 'architecture', 'freshness.json');
23
+ }
24
+ //# sourceMappingURL=paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/freshness/paths.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEzD,gFAAgF;AAChF,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,SAAS,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;AACzD,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC,CAAC;AACrD,CAAC;AAED,+BAA+B;AAC/B,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC;AACpD,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,cAAc,EAAE,gBAAgB,CAAC,CAAC;AACzE,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare const LOCK_TTL_MS = 60000;
2
+ /** Try to take the lock. Returns true on success, false if a live lock exists. */
3
+ export declare function acquireLock(root: string): boolean;
4
+ /** Refresh the heartbeat mid-scan (call periodically for long scans). */
5
+ export declare function touchLock(root: string): void;
6
+ /** Release the lock if we own it. */
7
+ export declare function releaseLock(root: string): void;
8
+ //# sourceMappingURL=scan-lock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scan-lock.d.ts","sourceRoot":"","sources":["../../src/freshness/scan-lock.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,WAAW,QAAS,CAAC;AA0BlC,kFAAkF;AAClF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAWjD;AAED,yEAAyE;AACzE,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAS5C;AAED,qCAAqC;AACrC,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAU9C"}