@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,232 @@
1
+ /**
2
+ * Tests for the global + local lessons store.
3
+ *
4
+ * Uses `fs.mkdtempSync` for isolation. The global store is redirected via
5
+ * `NAVGATOR_GLOBAL_LESSONS_DIR` so the user's real `~/.navgator/` is never touched.
6
+ */
7
+ import { describe, it, expect, beforeEach, afterEach } from 'vitest';
8
+ import * as fs from 'fs';
9
+ import * as os from 'os';
10
+ import * as path from 'path';
11
+ import { globalLessonsPath, localLessonsPath, readLessons, writeLessons, listLessons, searchLessons, findLessonById, promoteLesson, demoteLesson, } from '../lessons-store.js';
12
+ let projectRoot = '';
13
+ let globalDir = '';
14
+ let prevEnv;
15
+ function sampleLesson(overrides = {}) {
16
+ return {
17
+ id: 'lesson-api-contract-missing-field',
18
+ category: 'api-contract',
19
+ pattern: 'API response missing expected field',
20
+ signature: ['res\\.json\\(\\{[^}]*\\}\\)'],
21
+ severity: 'important',
22
+ context: {
23
+ first_seen: '2026-01-01T00:00:00Z',
24
+ occurrences: 1,
25
+ files_affected: ['src/api/users.ts'],
26
+ resolution: 'Include field in serializer',
27
+ },
28
+ example: {
29
+ bad: 'res.json({ id })',
30
+ good: 'res.json({ id, name })',
31
+ },
32
+ ...overrides,
33
+ };
34
+ }
35
+ function seedLocal(lessons, project = 'test-project') {
36
+ const file = {
37
+ schema_version: '1.0.0',
38
+ project,
39
+ lessons,
40
+ };
41
+ writeLessons(localLessonsPath(projectRoot), file);
42
+ }
43
+ beforeEach(() => {
44
+ projectRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'navgator-lessons-proj-'));
45
+ globalDir = fs.mkdtempSync(path.join(os.tmpdir(), 'navgator-lessons-global-'));
46
+ prevEnv = process.env.NAVGATOR_GLOBAL_LESSONS_DIR;
47
+ process.env.NAVGATOR_GLOBAL_LESSONS_DIR = globalDir;
48
+ });
49
+ afterEach(() => {
50
+ if (prevEnv === undefined)
51
+ delete process.env.NAVGATOR_GLOBAL_LESSONS_DIR;
52
+ else
53
+ process.env.NAVGATOR_GLOBAL_LESSONS_DIR = prevEnv;
54
+ try {
55
+ fs.rmSync(projectRoot, { recursive: true, force: true });
56
+ }
57
+ catch { /* ignore */ }
58
+ try {
59
+ fs.rmSync(globalDir, { recursive: true, force: true });
60
+ }
61
+ catch { /* ignore */ }
62
+ });
63
+ // ---------------------------------------------------------------------------
64
+ describe('paths', () => {
65
+ it('globalLessonsPath honors NAVGATOR_GLOBAL_LESSONS_DIR', () => {
66
+ expect(globalLessonsPath()).toBe(path.join(globalDir, 'global-lessons.json'));
67
+ });
68
+ it('localLessonsPath joins project root', () => {
69
+ expect(localLessonsPath('/tmp/x')).toBe(path.join('/tmp/x', '.navgator', 'lessons', 'lessons.json'));
70
+ });
71
+ });
72
+ describe('read/write', () => {
73
+ it('readLessons returns empty default when file missing', () => {
74
+ const file = readLessons(localLessonsPath(projectRoot));
75
+ expect(file.schema_version).toBe('1.0.0');
76
+ expect(file.project).toBe('');
77
+ expect(file.lessons).toEqual([]);
78
+ });
79
+ it('write then read roundtrip (local)', () => {
80
+ const original = {
81
+ schema_version: '1.0.0',
82
+ project: 'p',
83
+ lessons: [sampleLesson()],
84
+ };
85
+ writeLessons(localLessonsPath(projectRoot), original);
86
+ const round = readLessons(localLessonsPath(projectRoot));
87
+ expect(round.project).toBe('p');
88
+ expect(round.lessons).toHaveLength(1);
89
+ expect(round.lessons[0].id).toBe('lesson-api-contract-missing-field');
90
+ });
91
+ it('write then read roundtrip (global)', () => {
92
+ const original = {
93
+ schema_version: '1.0.0',
94
+ project: '',
95
+ lessons: [],
96
+ };
97
+ writeLessons(globalLessonsPath(), original);
98
+ const round = readLessons(globalLessonsPath());
99
+ expect(round.project).toBe('');
100
+ expect(round.lessons).toEqual([]);
101
+ });
102
+ });
103
+ describe('listLessons', () => {
104
+ it('lists local lessons', () => {
105
+ seedLocal([sampleLesson()]);
106
+ const list = listLessons({ scope: 'local', projectRoot });
107
+ expect(list).toHaveLength(1);
108
+ });
109
+ it('lists global lessons (empty by default)', () => {
110
+ const list = listLessons({ scope: 'global' });
111
+ expect(list).toEqual([]);
112
+ });
113
+ });
114
+ describe('promoteLesson', () => {
115
+ it('copies the lesson into global and marks local as promoted', () => {
116
+ seedLocal([sampleLesson()]);
117
+ const result = promoteLesson('lesson-api-contract-missing-field', projectRoot, { applies_to: ['nextjs', 'prisma'], project_name: 'my-app' });
118
+ expect(result.promoted).toBe(true);
119
+ expect(result.reason).toBe('ok');
120
+ expect(result.globalLesson).toBeTruthy();
121
+ expect(result.globalLesson?.source_project).toBe('my-app');
122
+ expect(result.globalLesson?.applies_to).toEqual(['nextjs', 'prisma']);
123
+ expect(result.globalLesson?.promoted_at).toBeTruthy();
124
+ expect(result.globalLesson?.promoted_from).toBe(localLessonsPath(projectRoot));
125
+ // Global lesson does NOT carry the `promoted: true` local marker
126
+ expect(result.globalLesson.promoted).toBeUndefined();
127
+ // Local: marked promoted, otherwise unchanged
128
+ const local = readLessons(localLessonsPath(projectRoot));
129
+ expect(local.lessons[0].promoted).toBe(true);
130
+ expect(local.lessons[0].pattern).toBe('API response missing expected field');
131
+ expect(local.lessons).toHaveLength(1);
132
+ // Global: exactly one lesson present
133
+ const global = readLessons(globalLessonsPath());
134
+ expect(global.lessons).toHaveLength(1);
135
+ });
136
+ it('returns already-global when re-promoting', () => {
137
+ seedLocal([sampleLesson()]);
138
+ promoteLesson('lesson-api-contract-missing-field', projectRoot);
139
+ const again = promoteLesson('lesson-api-contract-missing-field', projectRoot);
140
+ expect(again.promoted).toBe(false);
141
+ expect(again.reason).toBe('already-global');
142
+ expect(again.globalLesson).toBeNull();
143
+ });
144
+ it('returns not-found when id missing locally', () => {
145
+ seedLocal([sampleLesson()]);
146
+ const res = promoteLesson('lesson-data-flow-nope', projectRoot);
147
+ expect(res.promoted).toBe(false);
148
+ expect(res.reason).toBe('not-found');
149
+ });
150
+ it('rejects invalid ids', () => {
151
+ seedLocal([sampleLesson()]);
152
+ expect(() => promoteLesson('not_a_valid_id', projectRoot)).toThrow(/Invalid lesson id/);
153
+ });
154
+ });
155
+ describe('demoteLesson', () => {
156
+ it('removes from global but leaves local untouched', () => {
157
+ seedLocal([sampleLesson()]);
158
+ promoteLesson('lesson-api-contract-missing-field', projectRoot);
159
+ const res = demoteLesson('lesson-api-contract-missing-field');
160
+ expect(res.demoted).toBe(true);
161
+ expect(readLessons(globalLessonsPath()).lessons).toHaveLength(0);
162
+ // Local still has the lesson (still marked promoted — we don't revert it)
163
+ const local = readLessons(localLessonsPath(projectRoot));
164
+ expect(local.lessons).toHaveLength(1);
165
+ });
166
+ it('is idempotent — returns not-found when lesson absent', () => {
167
+ const res = demoteLesson('lesson-infrastructure-ghost');
168
+ expect(res.demoted).toBe(false);
169
+ expect(res.reason).toBe('not-found');
170
+ });
171
+ });
172
+ describe('searchLessons', () => {
173
+ it('searches by regex across pattern', () => {
174
+ seedLocal([
175
+ sampleLesson(),
176
+ sampleLesson({ id: 'lesson-data-flow-stale-cache', category: 'data-flow', pattern: 'Stale cache read after write' }),
177
+ ]);
178
+ const res = searchLessons('cache', { scope: 'local', projectRoot });
179
+ expect(res).toHaveLength(1);
180
+ expect(res[0].id).toBe('lesson-data-flow-stale-cache');
181
+ });
182
+ it('searches by tag on global lessons only', () => {
183
+ seedLocal([sampleLesson()]);
184
+ promoteLesson('lesson-api-contract-missing-field', projectRoot, {
185
+ applies_to: ['nextjs'],
186
+ });
187
+ const res = searchLessons('', { scope: 'all', projectRoot, tags: ['nextjs'] });
188
+ // Tag filter excludes the local (no applies_to), keeps the global
189
+ expect(res).toHaveLength(1);
190
+ expect(res[0].applies_to).toContain('nextjs');
191
+ });
192
+ it('stacks category + severity + tag filters', () => {
193
+ seedLocal([
194
+ sampleLesson(),
195
+ sampleLesson({
196
+ id: 'lesson-data-flow-other',
197
+ category: 'data-flow',
198
+ severity: 'critical',
199
+ pattern: 'Different lesson',
200
+ }),
201
+ ]);
202
+ // Promote both so tags are available
203
+ promoteLesson('lesson-api-contract-missing-field', projectRoot, { applies_to: ['nextjs'] });
204
+ promoteLesson('lesson-data-flow-other', projectRoot, { applies_to: ['nextjs'] });
205
+ const res = searchLessons('', {
206
+ scope: 'global',
207
+ category: 'data-flow',
208
+ severity: 'critical',
209
+ tags: ['nextjs'],
210
+ });
211
+ expect(res).toHaveLength(1);
212
+ expect(res[0].id).toBe('lesson-data-flow-other');
213
+ });
214
+ });
215
+ describe('findLessonById', () => {
216
+ it('returns the matching lesson or null', () => {
217
+ seedLocal([sampleLesson()]);
218
+ expect(findLessonById('lesson-api-contract-missing-field', { scope: 'local', projectRoot })).toBeTruthy();
219
+ expect(findLessonById('lesson-nope', { scope: 'local', projectRoot })).toBeNull();
220
+ });
221
+ });
222
+ describe('atomic write', () => {
223
+ it('surfaces a sensible error when the target dir cannot be created', () => {
224
+ // Point at a path under a regular file — mkdirSync will fail.
225
+ const blocker = path.join(projectRoot, 'blocker');
226
+ fs.writeFileSync(blocker, 'not-a-dir');
227
+ const bad = path.join(blocker, 'lessons.json');
228
+ expect(() => writeLessons(bad, { schema_version: '1.0.0', project: '', lessons: [] }))
229
+ .toThrow();
230
+ });
231
+ });
232
+ //# sourceMappingURL=lessons-store.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lessons-store.test.js","sourceRoot":"","sources":["../../src/__tests__/lessons-store.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,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AE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;aACnF,OAAO,EAAE,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=llm-dedup.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llm-dedup.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/llm-dedup.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,155 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { deduplicateLLMUseCases } from '../llm-dedup.js';
3
+ import { createMockComponent, createMockConnection } from './helpers.js';
4
+ // ---------------------------------------------------------------------------
5
+ // Helpers
6
+ // ---------------------------------------------------------------------------
7
+ function llmComp(name) {
8
+ return createMockComponent({
9
+ name,
10
+ type: 'llm',
11
+ component_id: `COMP_llm_${name.toLowerCase()}_test`,
12
+ role: { purpose: `${name} AI API`, layer: 'external', critical: true },
13
+ });
14
+ }
15
+ function llmConn(fromFile, symbol, toId, opts = {}) {
16
+ return createMockConnection(`FILE:${fromFile}`, toId, {
17
+ connection_type: 'service-call',
18
+ from: { component_id: `FILE:${fromFile}`, location: { file: fromFile, line: opts.lineStart || 10 } },
19
+ code_reference: {
20
+ file: fromFile,
21
+ symbol,
22
+ symbol_type: opts.symbolType || 'function',
23
+ line_start: opts.lineStart || 10,
24
+ },
25
+ semantic: opts.classification
26
+ ? { classification: opts.classification, confidence: 0.9 }
27
+ : undefined,
28
+ description: opts.description,
29
+ });
30
+ }
31
+ function minimalPrompt(name, file, lineStart, opts = {}) {
32
+ return {
33
+ id: `PROMPT_${name}`,
34
+ name,
35
+ location: { file, lineStart, lineEnd: lineStart + 5 },
36
+ messages: [{ role: 'system', content: 'test' }],
37
+ rawContent: 'test',
38
+ isTemplate: false,
39
+ variables: [],
40
+ usedBy: [],
41
+ tags: [],
42
+ category: opts.category,
43
+ confidence: 0.9,
44
+ detectionMethod: 'regex',
45
+ timestamp: Date.now(),
46
+ };
47
+ }
48
+ // ---------------------------------------------------------------------------
49
+ // Tests
50
+ // ---------------------------------------------------------------------------
51
+ describe('deduplicateLLMUseCases', () => {
52
+ const openai = llmComp('OpenAI');
53
+ const groq = llmComp('Groq');
54
+ // Layer 1: Filtering
55
+ it('filters out test-classified connections', () => {
56
+ const conns = [
57
+ llmConn('src/api.ts', 'callAI', openai.component_id),
58
+ llmConn('src/test.ts', 'callAI', openai.component_id, { classification: 'test' }),
59
+ llmConn('src/dev.ts', 'callAI', openai.component_id, { classification: 'dev-only' }),
60
+ ];
61
+ const result = deduplicateLLMUseCases([openai], conns);
62
+ expect(result.totalCallSites).toBe(3);
63
+ expect(result.productionCallSites).toBe(1);
64
+ expect(result.useCases).toHaveLength(1);
65
+ });
66
+ it('filters out import-only connections without sibling call', () => {
67
+ const conns = [
68
+ // Import only — no call from this file → should be removed
69
+ llmConn('src/unused.ts', 'openai', openai.component_id, { symbolType: 'import' }),
70
+ // Import + call from same file → import filtered, call kept
71
+ llmConn('src/used.ts', 'openai', openai.component_id, { symbolType: 'import' }),
72
+ llmConn('src/used.ts', 'generateText', openai.component_id),
73
+ ];
74
+ const result = deduplicateLLMUseCases([openai], conns);
75
+ expect(result.productionCallSites).toBe(2); // import kept (has sibling) + call
76
+ expect(result.useCases.length).toBeGreaterThanOrEqual(1);
77
+ });
78
+ it('deduplicates same file+symbol+provider', () => {
79
+ const conns = [
80
+ llmConn('src/ai.ts', 'summarize', openai.component_id),
81
+ llmConn('src/ai.ts', 'summarize', openai.component_id), // exact duplicate
82
+ ];
83
+ const result = deduplicateLLMUseCases([openai], conns);
84
+ expect(result.totalCallSites).toBe(2);
85
+ expect(result.productionCallSites).toBe(1);
86
+ });
87
+ // Layer 2: Grouping
88
+ it('classifies by prompt when prompt matches file', () => {
89
+ const conns = [
90
+ llmConn('src/services/summarize.ts', 'x', openai.component_id, { lineStart: 50 }),
91
+ ];
92
+ const prompt1 = minimalPrompt('summarize_article', 'src/services/summarize.ts', 45, { category: 'summarization' });
93
+ const result = deduplicateLLMUseCases([openai], conns, [prompt1]);
94
+ expect(result.useCases).toHaveLength(1);
95
+ expect(result.useCases[0].name).toBe('summarize_article');
96
+ expect(result.useCases[0].groupedBy).toBe('prompt');
97
+ expect(result.useCases[0].category).toBe('summarization');
98
+ });
99
+ it('classifies by function name when meaningful symbol found', () => {
100
+ const conns = [
101
+ llmConn('src/api/route1.ts', 'extractEntities', openai.component_id),
102
+ ];
103
+ const result = deduplicateLLMUseCases([openai], conns);
104
+ expect(result.useCases).toHaveLength(1);
105
+ expect(result.useCases[0].name).toBe('extractEntities');
106
+ expect(result.useCases[0].groupedBy).toBe('function');
107
+ });
108
+ it('creates one use case per file (file-first grouping)', () => {
109
+ const conns = [
110
+ llmConn('src/lib/ai.ts', 'x', openai.component_id),
111
+ llmConn('src/lib/other.ts', 'y', openai.component_id),
112
+ ];
113
+ const result = deduplicateLLMUseCases([openai], conns);
114
+ // File-first: each file = one use case
115
+ expect(result.useCases).toHaveLength(2);
116
+ });
117
+ // Edge cases
118
+ it('handles 0 LLM connections', () => {
119
+ const result = deduplicateLLMUseCases([openai], []);
120
+ expect(result.useCases).toHaveLength(0);
121
+ expect(result.totalCallSites).toBe(0);
122
+ expect(result.productionCallSites).toBe(0);
123
+ });
124
+ it('handles connections with no LLM components', () => {
125
+ const nonLLM = createMockComponent({ name: 'react', type: 'npm' });
126
+ const conns = [llmConn('src/app.ts', 'render', nonLLM.component_id)];
127
+ const result = deduplicateLLMUseCases([nonLLM], conns);
128
+ expect(result.useCases).toHaveLength(0);
129
+ });
130
+ it('returns correct totalCallSites vs productionCallSites', () => {
131
+ const conns = [
132
+ llmConn('src/a.ts', 'callA', openai.component_id),
133
+ llmConn('src/b.ts', 'callB', openai.component_id),
134
+ llmConn('src/c.ts', 'callC', openai.component_id, { classification: 'test' }),
135
+ llmConn('src/d.ts', 'callD', openai.component_id, { classification: 'dev-only' }),
136
+ ];
137
+ const result = deduplicateLLMUseCases([openai], conns);
138
+ expect(result.totalCallSites).toBe(4);
139
+ expect(result.productionCallSites).toBe(2);
140
+ });
141
+ it('sorts use cases by productionCallSites descending', () => {
142
+ // File with 3 connections should rank higher than file with 1
143
+ const conns = [
144
+ llmConn('src/a.ts', 'smallUseCase', openai.component_id),
145
+ llmConn('src/b.ts', 'bigUseCase1', groq.component_id),
146
+ llmConn('src/b.ts', 'bigUseCase2', groq.component_id),
147
+ llmConn('src/b.ts', 'bigUseCase3', groq.component_id),
148
+ ];
149
+ const result = deduplicateLLMUseCases([openai, groq], conns);
150
+ expect(result.useCases.length).toBe(2); // 2 files = 2 use cases
151
+ expect(result.useCases[0].productionCallSites).toBe(3); // b.ts has 3
152
+ expect(result.useCases[1].productionCallSites).toBe(1); // a.ts has 1
153
+ });
154
+ });
155
+ //# sourceMappingURL=llm-dedup.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llm-dedup.test.js","sourceRoot":"","sources":["../../src/__tests__/llm-dedup.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAGzE,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E,SAAS,OAAO,CAAC,IAAY;IAC3B,OAAO,mBAAmB,CAAC;QACzB,IAAI;QACJ,IAAI,EAAE,KAAK;QACX,YAAY,EAAE,YAAY,IAAI,CAAC,WAAW,EAAE,OAAO;QACnD,IAAI,EAAE,EAAE,OAAO,EAAE,GAAG,IAAI,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE;KACvE,CAAC,CAAC;AACL,CAAC;AAED,SAAS,OAAO,CACd,QAAgB,EAChB,MAAc,EACd,IAAY,EACZ,OAKI,EAAE;IAEN,OAAO,oB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AAI,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa;IACvE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Regression tests for two scanner blind spots discovered in agent-studio
3
+ * (NavGator lessons navg-mjs-skip + navg-fetch-miss).
4
+ *
5
+ * 1. The main file glob in `scanner.ts` and `import-scanner.ts` skipped
6
+ * `.mjs` and `.cjs` files entirely, so anything in `app/lib/*.mjs` was
7
+ * invisible to the architecture graph.
8
+ *
9
+ * 2. The fetch('/api/...') second pass in `import-scanner.ts` filtered with
10
+ * `file.includes('/app/')`, which never matches top-level `app/page.js`
11
+ * or `app/canvas/page.js` (no leading slash). Frontend pages at the
12
+ * project root were silently excluded from API-call detection,
13
+ * surfacing as false-positive orphan endpoints in `navgator dead`.
14
+ *
15
+ * 3. `resolveApiRoute` only considered `route.{ts,tsx,js}` route files,
16
+ * missing Next.js App Router routes authored as `route.mjs` / `route.cjs`.
17
+ */
18
+ export {};
19
+ //# sourceMappingURL=mjs-frontend-fetch.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mjs-frontend-fetch.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/mjs-frontend-fetch.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG"}
@@ -0,0 +1,179 @@
1
+ /**
2
+ * Regression tests for two scanner blind spots discovered in agent-studio
3
+ * (NavGator lessons navg-mjs-skip + navg-fetch-miss).
4
+ *
5
+ * 1. The main file glob in `scanner.ts` and `import-scanner.ts` skipped
6
+ * `.mjs` and `.cjs` files entirely, so anything in `app/lib/*.mjs` was
7
+ * invisible to the architecture graph.
8
+ *
9
+ * 2. The fetch('/api/...') second pass in `import-scanner.ts` filtered with
10
+ * `file.includes('/app/')`, which never matches top-level `app/page.js`
11
+ * or `app/canvas/page.js` (no leading slash). Frontend pages at the
12
+ * project root were silently excluded from API-call detection,
13
+ * surfacing as false-positive orphan endpoints in `navgator dead`.
14
+ *
15
+ * 3. `resolveApiRoute` only considered `route.{ts,tsx,js}` route files,
16
+ * missing Next.js App Router routes authored as `route.mjs` / `route.cjs`.
17
+ */
18
+ import { describe, it, expect, afterAll } from 'vitest';
19
+ import * as fs from 'fs';
20
+ import * as os from 'os';
21
+ import * as path from 'path';
22
+ import { scanImports } from '../scanners/connections/import-scanner.js';
23
+ import { scanServiceCalls } from '../scanners/connections/service-calls.js';
24
+ async function runScan(files) {
25
+ const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'navgator-mjs-'));
26
+ for (const [relPath, content] of Object.entries(files)) {
27
+ const abs = path.join(tmpRoot, relPath);
28
+ fs.mkdirSync(path.dirname(abs), { recursive: true });
29
+ fs.writeFileSync(abs, content, 'utf-8');
30
+ }
31
+ const sourceFiles = Object.keys(files);
32
+ const result = await scanImports(tmpRoot, sourceFiles);
33
+ return {
34
+ connections: result.connections,
35
+ cleanup: () => fs.rmSync(tmpRoot, { recursive: true, force: true }),
36
+ };
37
+ }
38
+ const cleanups = [];
39
+ afterAll(() => {
40
+ for (const c of cleanups)
41
+ c();
42
+ });
43
+ describe('top-level Next.js app/ pages emit frontend-calls-api edges', () => {
44
+ it('app/canvas/page.js fetch("/api/agent/infer-edges") wires to route.js', async () => {
45
+ const pageContent = `
46
+ 'use client';
47
+ export default function Canvas() {
48
+ async function infer() {
49
+ const res = await fetch("/api/agent/infer-edges", {
50
+ method: "POST",
51
+ body: JSON.stringify({}),
52
+ });
53
+ return res.json();
54
+ }
55
+ return null;
56
+ }
57
+ `;
58
+ const routeContent = `
59
+ export async function POST(req) {
60
+ return new Response(JSON.stringify({ ok: true }));
61
+ }
62
+ `;
63
+ const { connections, cleanup } = await runScan({
64
+ 'app/canvas/page.js': pageContent,
65
+ 'app/api/agent/infer-edges/route.js': routeContent,
66
+ });
67
+ cleanups.push(cleanup);
68
+ const fetchEdges = connections.filter((c) => c.connection_type === 'frontend-calls-api');
69
+ expect(fetchEdges, 'top-level app/canvas/page.js should produce a frontend-calls-api edge').toHaveLength(1);
70
+ expect(fetchEdges[0].from.component_id).toContain('canvas');
71
+ expect(fetchEdges[0].to.component_id).toContain('infer_edge');
72
+ });
73
+ it('top-level app/page.js fetch wires to route', async () => {
74
+ const { connections, cleanup } = await runScan({
75
+ 'app/page.js': `export default function P() { fetch("/api/health"); return null; }`,
76
+ 'app/api/health/route.js': `export async function GET() { return new Response("ok"); }`,
77
+ });
78
+ cleanups.push(cleanup);
79
+ const fetchEdges = connections.filter((c) => c.connection_type === 'frontend-calls-api');
80
+ expect(fetchEdges).toHaveLength(1);
81
+ });
82
+ it('survives in a 2500-line file (no AST or content cap)', async () => {
83
+ // Reproduce the canvas/page.js scale: ~2.5K lines of filler around the fetch.
84
+ const pad = Array.from({ length: 1200 }, (_, i) => `// filler line ${i}`).join('\n');
85
+ const fetchSite = `
86
+ async function writeSpec() {
87
+ const res = await fetch("/api/fs/write-spec", { method: "POST" });
88
+ return res.json();
89
+ }
90
+ `;
91
+ const morePad = Array.from({ length: 1200 }, (_, i) => `// trailing line ${i}`).join('\n');
92
+ const big = `'use client';\n${pad}\n${fetchSite}\n${morePad}\n`;
93
+ expect(big.split('\n').length).toBeGreaterThan(2400);
94
+ const { connections, cleanup } = await runScan({
95
+ 'app/canvas/page.js': big,
96
+ 'app/api/fs/write-spec/route.js': `export async function POST() { return new Response("ok"); }`,
97
+ });
98
+ cleanups.push(cleanup);
99
+ const fetchEdges = connections.filter((c) => c.connection_type === 'frontend-calls-api');
100
+ expect(fetchEdges, 'fetch in a 2.5K-line file must still be detected').toHaveLength(1);
101
+ });
102
+ });
103
+ describe('resolveApiRoute supports route.mjs / route.cjs', () => {
104
+ it('detects fetch → app/api/foo/route.mjs', async () => {
105
+ const { connections, cleanup } = await runScan({
106
+ 'app/components/Caller.js': `export default function C() { fetch("/api/foo"); return null; }`,
107
+ 'app/api/foo/route.mjs': `export async function GET() { return new Response("ok"); }`,
108
+ });
109
+ cleanups.push(cleanup);
110
+ const fetchEdges = connections.filter((c) => c.connection_type === 'frontend-calls-api');
111
+ expect(fetchEdges).toHaveLength(1);
112
+ });
113
+ it('detects fetch → app/api/bar/route.cjs', async () => {
114
+ const { connections, cleanup } = await runScan({
115
+ 'app/components/Caller.js': `export default function C() { fetch("/api/bar"); return null; }`,
116
+ 'app/api/bar/route.cjs': `module.exports.GET = async () => new Response("ok");`,
117
+ });
118
+ cleanups.push(cleanup);
119
+ const fetchEdges = connections.filter((c) => c.connection_type === 'frontend-calls-api');
120
+ expect(fetchEdges).toHaveLength(1);
121
+ });
122
+ });
123
+ describe('Ollama service detection (lesson navg-llm-blind)', () => {
124
+ async function runServiceScan(files) {
125
+ const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'navgator-ollama-'));
126
+ for (const [relPath, content] of Object.entries(files)) {
127
+ const abs = path.join(tmpRoot, relPath);
128
+ fs.mkdirSync(path.dirname(abs), { recursive: true });
129
+ fs.writeFileSync(abs, content, 'utf-8');
130
+ }
131
+ const result = await scanServiceCalls(tmpRoot);
132
+ cleanups.push(() => fs.rmSync(tmpRoot, { recursive: true, force: true }));
133
+ return result;
134
+ }
135
+ it('detects Ollama in a .mjs file using OLLAMA_BASE_URL + fetch', async () => {
136
+ const runtime = `
137
+ const baseUrl = process.env.OLLAMA_BASE_URL || "http://localhost:11434";
138
+ export async function chat(messages) {
139
+ const res = await fetch(\`\${baseUrl}/api/chat\`, {
140
+ method: "POST",
141
+ body: JSON.stringify({ model: "gpt-oss:20b", messages, stream: false }),
142
+ });
143
+ return res.json();
144
+ }
145
+ `;
146
+ const result = await runServiceScan({ 'app/lib/agent-runtime.mjs': runtime });
147
+ const ollamaConn = result.connections.find((c) => result.components.some((cc) => cc.component_id === c.to.component_id && /ollama/i.test(cc.name)));
148
+ expect(ollamaConn, 'Ollama call from .mjs runtime should produce a service-call edge').toBeTruthy();
149
+ });
150
+ it('detects Ollama in a .js route handler using OLLAMA_MODEL', async () => {
151
+ const route = `
152
+ const DEFAULT_BASE_URL = process.env.OLLAMA_BASE_URL || "http://localhost:11434";
153
+ const DEFAULT_MODEL = process.env.OLLAMA_MODEL || "gpt-oss:20b";
154
+ export async function POST(req) {
155
+ const res = await fetch(\`\${DEFAULT_BASE_URL}/api/chat\`, {
156
+ method: "POST",
157
+ body: JSON.stringify({ model: DEFAULT_MODEL, messages: [], format: "json" }),
158
+ });
159
+ return res;
160
+ }
161
+ `;
162
+ const result = await runServiceScan({ 'app/api/agent/infer-edges/route.js': route });
163
+ const ollamaCount = result.connections.filter((c) => result.components.some((cc) => cc.component_id === c.to.component_id && /ollama/i.test(cc.name))).length;
164
+ expect(ollamaCount).toBeGreaterThanOrEqual(1);
165
+ });
166
+ });
167
+ describe('relative imports of .mjs files resolve', () => {
168
+ it('app/canvas/page.js → import "../lib/storage-config" finds storage-config.mjs', async () => {
169
+ const { connections, cleanup } = await runScan({
170
+ 'app/canvas/page.js': `import { cfg } from '../lib/storage-config';\nexport default () => cfg;\n`,
171
+ 'app/lib/storage-config.mjs': `export const cfg = { mode: 'local' };\n`,
172
+ });
173
+ cleanups.push(cleanup);
174
+ const importEdges = connections.filter((c) => c.connection_type === 'imports');
175
+ expect(importEdges, 'import of bare-name should resolve to .mjs sibling').toHaveLength(1);
176
+ expect(importEdges[0].to.component_id).toContain('storage_config');
177
+ });
178
+ });
179
+ //# sourceMappingURL=mjs-frontend-fetch.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mjs-frontend-fetch.test.js","sourceRoot":"","sources":["../../src/__tests__/mjs-frontend-fetch.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,W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