@tyroneross/navgator 0.2.0 → 0.2.1

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 (338) hide show
  1. package/dist/cli/index.js +1 -1
  2. package/package.json +1 -1
  3. package/web/.next/standalone/web/.next/BUILD_ID +1 -0
  4. package/web/.next/standalone/web/.next/app-path-routes-manifest.json +13 -0
  5. package/web/.next/standalone/web/.next/build-manifest.json +20 -0
  6. package/web/.next/standalone/web/.next/package.json +1 -0
  7. package/web/.next/standalone/web/.next/prerender-manifest.json +88 -0
  8. package/web/.next/standalone/web/.next/required-server-files.json +317 -0
  9. package/web/.next/standalone/web/.next/routes-manifest.json +110 -0
  10. package/web/.next/standalone/web/.next/server/app/_global-error/page/app-paths-manifest.json +3 -0
  11. package/web/.next/standalone/web/.next/server/app/_global-error/page/build-manifest.json +17 -0
  12. package/web/.next/standalone/web/.next/server/app/_global-error/page/next-font-manifest.json +6 -0
  13. package/web/.next/standalone/web/.next/server/app/_global-error/page/react-loadable-manifest.json +1 -0
  14. package/web/.next/standalone/web/.next/server/app/_global-error/page/server-reference-manifest.json +4 -0
  15. package/web/.next/standalone/web/.next/server/app/_global-error/page.js +10 -0
  16. package/web/.next/standalone/web/.next/server/app/_global-error/page.js.map +5 -0
  17. package/web/.next/standalone/web/.next/server/app/_global-error/page.js.nft.json +1 -0
  18. package/web/.next/standalone/web/.next/server/app/_global-error/page_client-reference-manifest.js +2 -0
  19. package/web/.next/standalone/web/.next/server/app/_global-error.html +2 -0
  20. package/web/.next/standalone/web/.next/server/app/_global-error.meta +15 -0
  21. package/web/.next/standalone/web/.next/server/app/_global-error.rsc +12 -0
  22. package/web/.next/standalone/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +5 -0
  23. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_full.segment.rsc +12 -0
  24. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_head.segment.rsc +7 -0
  25. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_index.segment.rsc +4 -0
  26. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -0
  27. package/web/.next/standalone/web/.next/server/app/_not-found/page/app-paths-manifest.json +3 -0
  28. package/web/.next/standalone/web/.next/server/app/_not-found/page/build-manifest.json +17 -0
  29. package/web/.next/standalone/web/.next/server/app/_not-found/page/next-font-manifest.json +11 -0
  30. package/web/.next/standalone/web/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -0
  31. package/web/.next/standalone/web/.next/server/app/_not-found/page/server-reference-manifest.json +4 -0
  32. package/web/.next/standalone/web/.next/server/app/_not-found/page.js +13 -0
  33. package/web/.next/standalone/web/.next/server/app/_not-found/page.js.map +5 -0
  34. package/web/.next/standalone/web/.next/server/app/_not-found/page.js.nft.json +1 -0
  35. package/web/.next/standalone/web/.next/server/app/_not-found/page_client-reference-manifest.js +2 -0
  36. package/web/.next/standalone/web/.next/server/app/_not-found.html +1 -0
  37. package/web/.next/standalone/web/.next/server/app/_not-found.meta +16 -0
  38. package/web/.next/standalone/web/.next/server/app/_not-found.rsc +17 -0
  39. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_full.segment.rsc +17 -0
  40. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_head.segment.rsc +8 -0
  41. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_index.segment.rsc +8 -0
  42. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -0
  43. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +4 -0
  44. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_tree.segment.rsc +3 -0
  45. package/web/.next/standalone/web/.next/server/app/api/components/route/app-paths-manifest.json +3 -0
  46. package/web/.next/standalone/web/.next/server/app/api/components/route/build-manifest.json +11 -0
  47. package/web/.next/standalone/web/.next/server/app/api/components/route/server-reference-manifest.json +4 -0
  48. package/web/.next/standalone/web/.next/server/app/api/components/route.js +6 -0
  49. package/web/.next/standalone/web/.next/server/app/api/components/route.js.map +5 -0
  50. package/web/.next/standalone/web/.next/server/app/api/components/route.js.nft.json +1 -0
  51. package/web/.next/standalone/web/.next/server/app/api/components/route_client-reference-manifest.js +2 -0
  52. package/web/.next/standalone/web/.next/server/app/api/connections/route/app-paths-manifest.json +3 -0
  53. package/web/.next/standalone/web/.next/server/app/api/connections/route/build-manifest.json +11 -0
  54. package/web/.next/standalone/web/.next/server/app/api/connections/route/server-reference-manifest.json +4 -0
  55. package/web/.next/standalone/web/.next/server/app/api/connections/route.js +6 -0
  56. package/web/.next/standalone/web/.next/server/app/api/connections/route.js.map +5 -0
  57. package/web/.next/standalone/web/.next/server/app/api/connections/route.js.nft.json +1 -0
  58. package/web/.next/standalone/web/.next/server/app/api/connections/route_client-reference-manifest.js +2 -0
  59. package/web/.next/standalone/web/.next/server/app/api/graph/route/app-paths-manifest.json +3 -0
  60. package/web/.next/standalone/web/.next/server/app/api/graph/route/build-manifest.json +11 -0
  61. package/web/.next/standalone/web/.next/server/app/api/graph/route/server-reference-manifest.json +4 -0
  62. package/web/.next/standalone/web/.next/server/app/api/graph/route.js +6 -0
  63. package/web/.next/standalone/web/.next/server/app/api/graph/route.js.map +5 -0
  64. package/web/.next/standalone/web/.next/server/app/api/graph/route.js.nft.json +1 -0
  65. package/web/.next/standalone/web/.next/server/app/api/graph/route_client-reference-manifest.js +2 -0
  66. package/web/.next/standalone/web/.next/server/app/api/projects/route/app-paths-manifest.json +3 -0
  67. package/web/.next/standalone/web/.next/server/app/api/projects/route/build-manifest.json +11 -0
  68. package/web/.next/standalone/web/.next/server/app/api/projects/route/server-reference-manifest.json +4 -0
  69. package/web/.next/standalone/web/.next/server/app/api/projects/route.js +6 -0
  70. package/web/.next/standalone/web/.next/server/app/api/projects/route.js.map +5 -0
  71. package/web/.next/standalone/web/.next/server/app/api/projects/route.js.nft.json +1 -0
  72. package/web/.next/standalone/web/.next/server/app/api/projects/route_client-reference-manifest.js +2 -0
  73. package/web/.next/standalone/web/.next/server/app/api/prompts/route/app-paths-manifest.json +3 -0
  74. package/web/.next/standalone/web/.next/server/app/api/prompts/route/build-manifest.json +11 -0
  75. package/web/.next/standalone/web/.next/server/app/api/prompts/route/server-reference-manifest.json +4 -0
  76. package/web/.next/standalone/web/.next/server/app/api/prompts/route.js +7 -0
  77. package/web/.next/standalone/web/.next/server/app/api/prompts/route.js.map +5 -0
  78. package/web/.next/standalone/web/.next/server/app/api/prompts/route.js.nft.json +1 -0
  79. package/web/.next/standalone/web/.next/server/app/api/prompts/route_client-reference-manifest.js +2 -0
  80. package/web/.next/standalone/web/.next/server/app/api/scan/route/app-paths-manifest.json +3 -0
  81. package/web/.next/standalone/web/.next/server/app/api/scan/route/build-manifest.json +11 -0
  82. package/web/.next/standalone/web/.next/server/app/api/scan/route/server-reference-manifest.json +4 -0
  83. package/web/.next/standalone/web/.next/server/app/api/scan/route.js +6 -0
  84. package/web/.next/standalone/web/.next/server/app/api/scan/route.js.map +5 -0
  85. package/web/.next/standalone/web/.next/server/app/api/scan/route.js.nft.json +1 -0
  86. package/web/.next/standalone/web/.next/server/app/api/scan/route_client-reference-manifest.js +2 -0
  87. package/web/.next/standalone/web/.next/server/app/api/settings/route/app-paths-manifest.json +3 -0
  88. package/web/.next/standalone/web/.next/server/app/api/settings/route/build-manifest.json +11 -0
  89. package/web/.next/standalone/web/.next/server/app/api/settings/route/server-reference-manifest.json +4 -0
  90. package/web/.next/standalone/web/.next/server/app/api/settings/route.js +6 -0
  91. package/web/.next/standalone/web/.next/server/app/api/settings/route.js.map +5 -0
  92. package/web/.next/standalone/web/.next/server/app/api/settings/route.js.nft.json +1 -0
  93. package/web/.next/standalone/web/.next/server/app/api/settings/route_client-reference-manifest.js +2 -0
  94. package/web/.next/standalone/web/.next/server/app/api/status/route/app-paths-manifest.json +3 -0
  95. package/web/.next/standalone/web/.next/server/app/api/status/route/build-manifest.json +11 -0
  96. package/web/.next/standalone/web/.next/server/app/api/status/route/server-reference-manifest.json +4 -0
  97. package/web/.next/standalone/web/.next/server/app/api/status/route.js +6 -0
  98. package/web/.next/standalone/web/.next/server/app/api/status/route.js.map +5 -0
  99. package/web/.next/standalone/web/.next/server/app/api/status/route.js.nft.json +1 -0
  100. package/web/.next/standalone/web/.next/server/app/api/status/route_client-reference-manifest.js +2 -0
  101. package/web/.next/standalone/web/.next/server/app/index.html +1 -0
  102. package/web/.next/standalone/web/.next/server/app/index.meta +14 -0
  103. package/web/.next/standalone/web/.next/server/app/index.rsc +23 -0
  104. package/web/.next/standalone/web/.next/server/app/index.segments/__PAGE__.segment.rsc +9 -0
  105. package/web/.next/standalone/web/.next/server/app/index.segments/_full.segment.rsc +23 -0
  106. package/web/.next/standalone/web/.next/server/app/index.segments/_head.segment.rsc +8 -0
  107. package/web/.next/standalone/web/.next/server/app/index.segments/_index.segment.rsc +8 -0
  108. package/web/.next/standalone/web/.next/server/app/index.segments/_tree.segment.rsc +5 -0
  109. package/web/.next/standalone/web/.next/server/app/page/app-paths-manifest.json +3 -0
  110. package/web/.next/standalone/web/.next/server/app/page/build-manifest.json +17 -0
  111. package/web/.next/standalone/web/.next/server/app/page/next-font-manifest.json +11 -0
  112. package/web/.next/standalone/web/.next/server/app/page/react-loadable-manifest.json +1 -0
  113. package/web/.next/standalone/web/.next/server/app/page/server-reference-manifest.json +4 -0
  114. package/web/.next/standalone/web/.next/server/app/page.js +15 -0
  115. package/web/.next/standalone/web/.next/server/app/page.js.map +5 -0
  116. package/web/.next/standalone/web/.next/server/app/page.js.nft.json +1 -0
  117. package/web/.next/standalone/web/.next/server/app/page_client-reference-manifest.js +2 -0
  118. package/web/.next/standalone/web/.next/server/app-paths-manifest.json +13 -0
  119. package/web/.next/standalone/web/.next/server/chunks/2374f_next_dist_esm_build_templates_app-route_0bb4e66a.js +19 -0
  120. package/web/.next/standalone/web/.next/server/chunks/[root-of-the-server]__006b837d._.js +3 -0
  121. package/web/.next/standalone/web/.next/server/chunks/[root-of-the-server]__1ab91221._.js +3 -0
  122. package/web/.next/standalone/web/.next/server/chunks/[root-of-the-server]__2e09fec9._.js +3 -0
  123. package/web/.next/standalone/web/.next/server/chunks/[root-of-the-server]__38d0390f._.js +3 -0
  124. package/web/.next/standalone/web/.next/server/chunks/[root-of-the-server]__539ef30d._.js +3 -0
  125. package/web/.next/standalone/web/.next/server/chunks/[root-of-the-server]__594bcf20._.js +3 -0
  126. package/web/.next/standalone/web/.next/server/chunks/[root-of-the-server]__b888fadf._.js +3 -0
  127. package/web/.next/standalone/web/.next/server/chunks/[root-of-the-server]__f3450c22._.js +21 -0
  128. package/web/.next/standalone/web/.next/server/chunks/[root-of-the-server]__fa2ec862._.js +3 -0
  129. package/web/.next/standalone/web/.next/server/chunks/[turbopack]_runtime.js +770 -0
  130. package/web/.next/standalone/web/.next/server/chunks/ssr/2374f_e6039567._.js +6 -0
  131. package/web/.next/standalone/web/.next/server/chunks/ssr/2374f_next_dist_09351209._.js +6 -0
  132. package/web/.next/standalone/web/.next/server/chunks/ssr/2374f_next_dist_222be7ae._.js +6 -0
  133. package/web/.next/standalone/web/.next/server/chunks/ssr/2374f_next_dist_2346e1b3._.js +3 -0
  134. package/web/.next/standalone/web/.next/server/chunks/ssr/2374f_next_dist_cec86455._.js +4 -0
  135. package/web/.next/standalone/web/.next/server/chunks/ssr/2374f_next_dist_client_components_9c5d1a14._.js +3 -0
  136. package/web/.next/standalone/web/.next/server/chunks/ssr/2374f_next_dist_client_components_builtin_forbidden_8eae0c85.js +3 -0
  137. package/web/.next/standalone/web/.next/server/chunks/ssr/2374f_next_dist_client_components_builtin_global-error_81159d60.js +3 -0
  138. package/web/.next/standalone/web/.next/server/chunks/ssr/2374f_next_dist_client_components_builtin_unauthorized_7d34a31c.js +3 -0
  139. package/web/.next/standalone/web/.next/server/chunks/ssr/2374f_next_dist_e03afa0e._.js +3 -0
  140. package/web/.next/standalone/web/.next/server/chunks/ssr/2374f_next_dist_esm_build_templates_app-page_2c8d71b9.js +4 -0
  141. package/web/.next/standalone/web/.next/server/chunks/ssr/2374f_next_dist_server_route-modules_app-page_vendored_ssr_react-dom_8910f04c.js +3 -0
  142. package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__1a0663e6._.js +3 -0
  143. package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__4306eafc._.js +3 -0
  144. package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__44903626._.js +3 -0
  145. package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__60278e3f._.js +3 -0
  146. package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__61942f24._.js +4 -0
  147. package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__8c45c3c9._.js +3 -0
  148. package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__9a2f110d._.js +3 -0
  149. package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__ed07bd88._.js +3 -0
  150. package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__f2db61af._.js +3 -0
  151. package/web/.next/standalone/web/.next/server/chunks/ssr/[turbopack]_runtime.js +770 -0
  152. package/web/.next/standalone/web/.next/server/chunks/ssr/web_0103e631._.js +4 -0
  153. package/web/.next/standalone/web/.next/server/chunks/ssr/web_171de0df._.js +14 -0
  154. package/web/.next/standalone/web/.next/server/chunks/ssr/web__next-internal_server_app__global-error_page_actions_2a1e94d4.js +3 -0
  155. package/web/.next/standalone/web/.next/server/chunks/ssr/web__next-internal_server_app__not-found_page_actions_9eaa9845.js +3 -0
  156. package/web/.next/standalone/web/.next/server/chunks/ssr/web__next-internal_server_app_page_actions_ec26bf28.js +3 -0
  157. package/web/.next/standalone/web/.next/server/chunks/web__next-internal_server_app_api_components_route_actions_c88bf2a6.js +3 -0
  158. package/web/.next/standalone/web/.next/server/chunks/web__next-internal_server_app_api_connections_route_actions_b1d5e95a.js +3 -0
  159. package/web/.next/standalone/web/.next/server/chunks/web__next-internal_server_app_api_graph_route_actions_e2dd052c.js +3 -0
  160. package/web/.next/standalone/web/.next/server/chunks/web__next-internal_server_app_api_projects_route_actions_3f671cbb.js +3 -0
  161. package/web/.next/standalone/web/.next/server/chunks/web__next-internal_server_app_api_prompts_route_actions_85b56166.js +3 -0
  162. package/web/.next/standalone/web/.next/server/chunks/web__next-internal_server_app_api_scan_route_actions_861cde8d.js +3 -0
  163. package/web/.next/standalone/web/.next/server/chunks/web__next-internal_server_app_api_settings_route_actions_e19026ae.js +3 -0
  164. package/web/.next/standalone/web/.next/server/chunks/web__next-internal_server_app_api_status_route_actions_8b8c6c89.js +3 -0
  165. package/web/.next/standalone/web/.next/server/functions-config-manifest.json +4 -0
  166. package/web/.next/standalone/web/.next/server/middleware-build-manifest.js +21 -0
  167. package/web/.next/standalone/web/.next/server/middleware-manifest.json +6 -0
  168. package/web/.next/standalone/web/.next/server/next-font-manifest.js +1 -0
  169. package/web/.next/standalone/web/.next/server/next-font-manifest.json +15 -0
  170. package/web/.next/standalone/web/.next/server/pages/404.html +1 -0
  171. package/web/.next/standalone/web/.next/server/pages/500.html +2 -0
  172. package/web/.next/standalone/web/.next/server/pages-manifest.json +4 -0
  173. package/web/.next/standalone/web/.next/server/server-reference-manifest.js +1 -0
  174. package/web/.next/standalone/web/.next/server/server-reference-manifest.json +5 -0
  175. package/web/.next/standalone/web/.next/static/WH0NvTGUEDs9QVUjcPJKx/_buildManifest.js +11 -0
  176. package/web/.next/standalone/web/.next/static/WH0NvTGUEDs9QVUjcPJKx/_clientMiddlewareManifest.json +1 -0
  177. package/web/.next/standalone/web/.next/static/WH0NvTGUEDs9QVUjcPJKx/_ssgManifest.js +1 -0
  178. package/web/.next/standalone/web/.next/static/chunks/062ae79751df2759.js +1 -0
  179. package/web/.next/standalone/web/.next/static/chunks/159889e17b2cf1f8.js +2 -0
  180. package/web/.next/standalone/web/.next/static/chunks/458d6f37339fc069.js +1 -0
  181. package/web/.next/standalone/web/.next/static/chunks/6d3d39425a878d7f.js +1 -0
  182. package/web/.next/standalone/web/.next/static/chunks/8a80e7184ad3a13f.css +2 -0
  183. package/web/.next/standalone/web/.next/static/chunks/a6dad97d9634a72d.js +1 -0
  184. package/web/.next/standalone/web/.next/static/chunks/c056475f5f4424b6.css +1 -0
  185. package/web/.next/standalone/web/.next/static/chunks/c57fee8cce8d7cb9.js +1 -0
  186. package/web/.next/standalone/web/.next/static/chunks/cb3513192b63e480.js +12 -0
  187. package/web/.next/standalone/web/.next/static/chunks/dd22b5f2beb2cc31.js +1 -0
  188. package/web/.next/standalone/web/.next/static/chunks/e0affeef0ddb9a97.js +4 -0
  189. package/web/.next/standalone/web/.next/static/chunks/f74a6859e1c4d5e3.js +1 -0
  190. package/web/.next/standalone/web/.next/static/chunks/turbopack-c0c89f9e6f0a38c4.js +3 -0
  191. package/web/.next/standalone/web/.next/static/media/4fa387ec64143e14-s.c1fdd6c2.woff2 +0 -0
  192. package/web/.next/standalone/web/.next/static/media/7178b3e590c64307-s.b97b3418.woff2 +0 -0
  193. package/web/.next/standalone/web/.next/static/media/797e433ab948586e-s.p.dbea232f.woff2 +0 -0
  194. package/web/.next/standalone/web/.next/static/media/8a480f0b521d4e75-s.8e0177b5.woff2 +0 -0
  195. package/web/.next/standalone/web/.next/static/media/bbc41e54d2fcbd21-s.799d8ef8.woff2 +0 -0
  196. package/web/.next/standalone/web/.next/static/media/caa3a2e1cccd8315-s.p.853070df.woff2 +0 -0
  197. package/web/.next/standalone/web/app/api/components/route.ts +252 -0
  198. package/web/.next/standalone/web/app/api/connections/route.ts +319 -0
  199. package/web/.next/standalone/web/app/api/graph/route.ts +235 -0
  200. package/web/.next/standalone/web/app/api/projects/route.ts +221 -0
  201. package/web/.next/standalone/web/app/api/prompts/route.ts +328 -0
  202. package/web/.next/standalone/web/app/api/scan/route.ts +108 -0
  203. package/web/.next/standalone/web/app/api/settings/route.ts +198 -0
  204. package/web/.next/standalone/web/app/api/status/route.ts +169 -0
  205. package/web/.next/standalone/web/app/globals.css +99 -0
  206. package/web/.next/standalone/web/app/layout.tsx +49 -0
  207. package/web/.next/standalone/web/app/page.tsx +94 -0
  208. package/web/.next/standalone/web/components/components-panel.tsx +240 -0
  209. package/web/.next/standalone/web/components/connections-panel.tsx +220 -0
  210. package/web/.next/standalone/web/components/diagram-view.tsx +735 -0
  211. package/web/.next/standalone/web/components/header.tsx +225 -0
  212. package/web/.next/standalone/web/components/impact-analysis.tsx +358 -0
  213. package/web/.next/standalone/web/components/llm-tracking-panel.tsx +1483 -0
  214. package/web/.next/standalone/web/components/settings-panel.tsx +671 -0
  215. package/web/.next/standalone/web/components/sidebar.tsx +74 -0
  216. package/web/.next/standalone/web/components/status-overview.tsx +326 -0
  217. package/web/.next/standalone/web/components/theme-provider.tsx +11 -0
  218. package/web/.next/standalone/web/components/ui/accordion.tsx +66 -0
  219. package/web/.next/standalone/web/components/ui/alert-dialog.tsx +157 -0
  220. package/web/.next/standalone/web/components/ui/alert.tsx +66 -0
  221. package/web/.next/standalone/web/components/ui/aspect-ratio.tsx +11 -0
  222. package/web/.next/standalone/web/components/ui/avatar.tsx +53 -0
  223. package/web/.next/standalone/web/components/ui/badge.tsx +46 -0
  224. package/web/.next/standalone/web/components/ui/breadcrumb.tsx +109 -0
  225. package/web/.next/standalone/web/components/ui/button-group.tsx +83 -0
  226. package/web/.next/standalone/web/components/ui/button.tsx +60 -0
  227. package/web/.next/standalone/web/components/ui/calendar.tsx +213 -0
  228. package/web/.next/standalone/web/components/ui/card.tsx +92 -0
  229. package/web/.next/standalone/web/components/ui/carousel.tsx +241 -0
  230. package/web/.next/standalone/web/components/ui/chart.tsx +353 -0
  231. package/web/.next/standalone/web/components/ui/checkbox.tsx +32 -0
  232. package/web/.next/standalone/web/components/ui/collapsible.tsx +33 -0
  233. package/web/.next/standalone/web/components/ui/command.tsx +184 -0
  234. package/web/.next/standalone/web/components/ui/context-menu.tsx +252 -0
  235. package/web/.next/standalone/web/components/ui/dialog.tsx +143 -0
  236. package/web/.next/standalone/web/components/ui/drawer.tsx +135 -0
  237. package/web/.next/standalone/web/components/ui/dropdown-menu.tsx +257 -0
  238. package/web/.next/standalone/web/components/ui/empty.tsx +104 -0
  239. package/web/.next/standalone/web/components/ui/field.tsx +244 -0
  240. package/web/.next/standalone/web/components/ui/form.tsx +167 -0
  241. package/web/.next/standalone/web/components/ui/hover-card.tsx +44 -0
  242. package/web/.next/standalone/web/components/ui/input-group.tsx +169 -0
  243. package/web/.next/standalone/web/components/ui/input-otp.tsx +77 -0
  244. package/web/.next/standalone/web/components/ui/input.tsx +21 -0
  245. package/web/.next/standalone/web/components/ui/item.tsx +193 -0
  246. package/web/.next/standalone/web/components/ui/kbd.tsx +28 -0
  247. package/web/.next/standalone/web/components/ui/label.tsx +24 -0
  248. package/web/.next/standalone/web/components/ui/menubar.tsx +276 -0
  249. package/web/.next/standalone/web/components/ui/navigation-menu.tsx +166 -0
  250. package/web/.next/standalone/web/components/ui/pagination.tsx +127 -0
  251. package/web/.next/standalone/web/components/ui/popover.tsx +48 -0
  252. package/web/.next/standalone/web/components/ui/progress.tsx +31 -0
  253. package/web/.next/standalone/web/components/ui/radio-group.tsx +45 -0
  254. package/web/.next/standalone/web/components/ui/resizable.tsx +56 -0
  255. package/web/.next/standalone/web/components/ui/scroll-area.tsx +58 -0
  256. package/web/.next/standalone/web/components/ui/select.tsx +185 -0
  257. package/web/.next/standalone/web/components/ui/separator.tsx +28 -0
  258. package/web/.next/standalone/web/components/ui/sheet.tsx +139 -0
  259. package/web/.next/standalone/web/components/ui/sidebar.tsx +726 -0
  260. package/web/.next/standalone/web/components/ui/skeleton.tsx +13 -0
  261. package/web/.next/standalone/web/components/ui/slider.tsx +63 -0
  262. package/web/.next/standalone/web/components/ui/sonner.tsx +25 -0
  263. package/web/.next/standalone/web/components/ui/spinner.tsx +16 -0
  264. package/web/.next/standalone/web/components/ui/switch.tsx +31 -0
  265. package/web/.next/standalone/web/components/ui/table.tsx +116 -0
  266. package/web/.next/standalone/web/components/ui/tabs.tsx +66 -0
  267. package/web/.next/standalone/web/components/ui/textarea.tsx +18 -0
  268. package/web/.next/standalone/web/components/ui/toast.tsx +129 -0
  269. package/web/.next/standalone/web/components/ui/toaster.tsx +35 -0
  270. package/web/.next/standalone/web/components/ui/toggle-group.tsx +73 -0
  271. package/web/.next/standalone/web/components/ui/toggle.tsx +47 -0
  272. package/web/.next/standalone/web/components/ui/tooltip.tsx +61 -0
  273. package/web/.next/standalone/web/components/ui/use-mobile.tsx +19 -0
  274. package/web/.next/standalone/web/components/ui/use-toast.ts +191 -0
  275. package/web/.next/standalone/web/components.json +21 -0
  276. package/web/.next/standalone/web/hooks/use-mobile.ts +19 -0
  277. package/web/.next/standalone/web/hooks/use-toast.ts +191 -0
  278. package/web/.next/standalone/web/lib/hooks/index.ts +8 -0
  279. package/web/.next/standalone/web/lib/hooks/use-components.ts +83 -0
  280. package/web/.next/standalone/web/lib/hooks/use-connections.ts +83 -0
  281. package/web/.next/standalone/web/lib/hooks/use-projects.ts +116 -0
  282. package/web/.next/standalone/web/lib/hooks/use-prompts.ts +122 -0
  283. package/web/.next/standalone/web/lib/hooks/use-settings.ts +135 -0
  284. package/web/.next/standalone/web/lib/hooks/use-status.ts +80 -0
  285. package/web/.next/standalone/web/lib/project-context.tsx +46 -0
  286. package/web/.next/standalone/web/lib/transform.ts +625 -0
  287. package/web/.next/standalone/web/lib/types.ts +198 -0
  288. package/web/.next/standalone/web/lib/utils.ts +6 -0
  289. package/web/.next/standalone/web/next.config.mjs +12 -0
  290. package/web/.next/standalone/web/package-lock.json +3987 -0
  291. package/web/.next/standalone/web/package.json +73 -0
  292. package/web/.next/standalone/web/pnpm-lock.yaml +5 -0
  293. package/web/.next/standalone/web/postcss.config.mjs +8 -0
  294. package/web/.next/standalone/web/public/apple-icon.png +0 -0
  295. package/web/.next/standalone/web/public/icon-dark-32x32.png +0 -0
  296. package/web/.next/standalone/web/public/icon-light-32x32.png +0 -0
  297. package/web/.next/standalone/web/public/icon.svg +26 -0
  298. package/web/.next/standalone/web/public/navgator-logo.png +0 -0
  299. package/web/.next/standalone/web/public/placeholder-logo.png +0 -0
  300. package/web/.next/standalone/web/public/placeholder-logo.svg +1 -0
  301. package/web/.next/standalone/web/public/placeholder-user.jpg +0 -0
  302. package/web/.next/standalone/web/public/placeholder.jpg +0 -0
  303. package/web/.next/standalone/web/public/placeholder.svg +1 -0
  304. package/web/.next/standalone/web/public/public/apple-icon.png +0 -0
  305. package/web/.next/standalone/web/public/public/icon-dark-32x32.png +0 -0
  306. package/web/.next/standalone/web/public/public/icon-light-32x32.png +0 -0
  307. package/web/.next/standalone/web/public/public/icon.svg +26 -0
  308. package/web/.next/standalone/web/public/public/navgator-logo.png +0 -0
  309. package/web/.next/standalone/web/public/public/placeholder-logo.png +0 -0
  310. package/web/.next/standalone/web/public/public/placeholder-logo.svg +1 -0
  311. package/web/.next/standalone/web/public/public/placeholder-user.jpg +0 -0
  312. package/web/.next/standalone/web/public/public/placeholder.jpg +0 -0
  313. package/web/.next/standalone/web/public/public/placeholder.svg +1 -0
  314. package/web/.next/standalone/web/server.js +38 -0
  315. package/web/.next/standalone/web/styles/globals.css +125 -0
  316. package/web/.next/standalone/web/tsconfig.json +41 -0
  317. package/web/.next/static/WH0NvTGUEDs9QVUjcPJKx/_buildManifest.js +11 -0
  318. package/web/.next/static/WH0NvTGUEDs9QVUjcPJKx/_clientMiddlewareManifest.json +1 -0
  319. package/web/.next/static/WH0NvTGUEDs9QVUjcPJKx/_ssgManifest.js +1 -0
  320. package/web/.next/static/chunks/062ae79751df2759.js +1 -0
  321. package/web/.next/static/chunks/159889e17b2cf1f8.js +2 -0
  322. package/web/.next/static/chunks/458d6f37339fc069.js +1 -0
  323. package/web/.next/static/chunks/6d3d39425a878d7f.js +1 -0
  324. package/web/.next/static/chunks/8a80e7184ad3a13f.css +2 -0
  325. package/web/.next/static/chunks/a6dad97d9634a72d.js +1 -0
  326. package/web/.next/static/chunks/c056475f5f4424b6.css +1 -0
  327. package/web/.next/static/chunks/c57fee8cce8d7cb9.js +1 -0
  328. package/web/.next/static/chunks/cb3513192b63e480.js +12 -0
  329. package/web/.next/static/chunks/dd22b5f2beb2cc31.js +1 -0
  330. package/web/.next/static/chunks/e0affeef0ddb9a97.js +4 -0
  331. package/web/.next/static/chunks/f74a6859e1c4d5e3.js +1 -0
  332. package/web/.next/static/chunks/turbopack-c0c89f9e6f0a38c4.js +3 -0
  333. package/web/.next/static/media/4fa387ec64143e14-s.c1fdd6c2.woff2 +0 -0
  334. package/web/.next/static/media/7178b3e590c64307-s.b97b3418.woff2 +0 -0
  335. package/web/.next/static/media/797e433ab948586e-s.p.dbea232f.woff2 +0 -0
  336. package/web/.next/static/media/8a480f0b521d4e75-s.8e0177b5.woff2 +0 -0
  337. package/web/.next/static/media/bbc41e54d2fcbd21-s.799d8ef8.woff2 +0 -0
  338. package/web/.next/static/media/caa3a2e1cccd8315-s.p.853070df.woff2 +0 -0
@@ -0,0 +1,221 @@
1
+ /**
2
+ * API Route: /api/projects
3
+ *
4
+ * Manages the project registry at ~/.navgator/projects.json
5
+ * GET - List all registered projects with validation
6
+ * POST - Register or remove a project
7
+ */
8
+
9
+ import { NextRequest, NextResponse } from "next/server";
10
+ import * as fs from "fs/promises";
11
+ import * as path from "path";
12
+ import * as os from "os";
13
+
14
+ // =============================================================================
15
+ // TYPES
16
+ // =============================================================================
17
+
18
+ interface RegisteredProject {
19
+ path: string;
20
+ name: string;
21
+ addedAt: number;
22
+ lastScan: number | null;
23
+ }
24
+
25
+ interface ProjectRegistry {
26
+ version: 1;
27
+ projects: RegisteredProject[];
28
+ }
29
+
30
+ interface ProjectWithStatus extends RegisteredProject {
31
+ hasArchitecture: boolean;
32
+ componentCount: number;
33
+ connectionCount: number;
34
+ lastScanFormatted: string | null;
35
+ }
36
+
37
+ // =============================================================================
38
+ // REGISTRY PATH
39
+ // =============================================================================
40
+
41
+ const REGISTRY_DIR = path.join(os.homedir(), ".navgator");
42
+ const REGISTRY_PATH = path.join(REGISTRY_DIR, "projects.json");
43
+
44
+ // =============================================================================
45
+ // HELPERS
46
+ // =============================================================================
47
+
48
+ async function loadRegistry(): Promise<ProjectRegistry> {
49
+ try {
50
+ const content = await fs.readFile(REGISTRY_PATH, "utf-8");
51
+ return JSON.parse(content);
52
+ } catch {
53
+ return { version: 1, projects: [] };
54
+ }
55
+ }
56
+
57
+ async function saveRegistry(registry: ProjectRegistry): Promise<void> {
58
+ await fs.mkdir(REGISTRY_DIR, { recursive: true });
59
+ await fs.writeFile(REGISTRY_PATH, JSON.stringify(registry, null, 2), "utf-8");
60
+ }
61
+
62
+ function extractProjectName(projectPath: string): string {
63
+ try {
64
+ const packageJsonPath = path.join(projectPath, "package.json");
65
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
66
+ const packageJson = require(packageJsonPath);
67
+ if (packageJson.name) {
68
+ return packageJson.name
69
+ .replace(/[-_]/g, " ")
70
+ .replace(/\b\w/g, (c: string) => c.toUpperCase())
71
+ .trim();
72
+ }
73
+ } catch {
74
+ // fall through
75
+ }
76
+ const segments = projectPath.split(path.sep).filter(Boolean);
77
+ return (segments[segments.length - 1] || "project")
78
+ .replace(/[-_]/g, " ")
79
+ .replace(/\b\w/g, (c: string) => c.toUpperCase())
80
+ .trim();
81
+ }
82
+
83
+ function formatRelativeTime(timestamp: number): string {
84
+ const diff = Date.now() - timestamp;
85
+ const minutes = Math.floor(diff / 60000);
86
+ const hours = Math.floor(diff / 3600000);
87
+ const days = Math.floor(diff / 86400000);
88
+
89
+ if (minutes < 1) return "just now";
90
+ if (minutes < 60) return `${minutes}m ago`;
91
+ if (hours < 24) return `${hours}h ago`;
92
+ if (days < 7) return `${days}d ago`;
93
+ return new Date(timestamp).toLocaleDateString();
94
+ }
95
+
96
+ async function enrichProject(project: RegisteredProject): Promise<ProjectWithStatus> {
97
+ const indexPath = path.join(project.path, ".claude", "architecture", "index.json");
98
+ try {
99
+ const content = await fs.readFile(indexPath, "utf-8");
100
+ const index = JSON.parse(content);
101
+ return {
102
+ ...project,
103
+ name: extractProjectName(project.path),
104
+ hasArchitecture: true,
105
+ componentCount: index.stats?.total_components || 0,
106
+ connectionCount: index.stats?.total_connections || 0,
107
+ lastScan: index.last_scan || project.lastScan,
108
+ lastScanFormatted: index.last_scan ? formatRelativeTime(index.last_scan) : null,
109
+ };
110
+ } catch {
111
+ return {
112
+ ...project,
113
+ hasArchitecture: false,
114
+ componentCount: 0,
115
+ connectionCount: 0,
116
+ lastScanFormatted: project.lastScan ? formatRelativeTime(project.lastScan) : null,
117
+ };
118
+ }
119
+ }
120
+
121
+ // =============================================================================
122
+ // GET /api/projects
123
+ // =============================================================================
124
+
125
+ export async function GET() {
126
+ try {
127
+ const registry = await loadRegistry();
128
+
129
+ // Enrich each project with live status
130
+ const projects = await Promise.all(
131
+ registry.projects.map((p) => enrichProject(p))
132
+ );
133
+
134
+ return NextResponse.json({
135
+ success: true,
136
+ data: { projects },
137
+ });
138
+ } catch (error) {
139
+ console.error("Error loading projects:", error);
140
+ return NextResponse.json(
141
+ { success: false, error: error instanceof Error ? error.message : "Unknown error" },
142
+ { status: 500 }
143
+ );
144
+ }
145
+ }
146
+
147
+ // =============================================================================
148
+ // POST /api/projects
149
+ // =============================================================================
150
+
151
+ export async function POST(request: NextRequest) {
152
+ try {
153
+ const body = await request.json();
154
+ const { action, path: projectPath } = body as { action: "add" | "remove"; path: string };
155
+
156
+ if (!projectPath) {
157
+ return NextResponse.json(
158
+ { success: false, error: "Missing project path" },
159
+ { status: 400 }
160
+ );
161
+ }
162
+
163
+ const resolvedPath = path.resolve(projectPath);
164
+ const registry = await loadRegistry();
165
+
166
+ if (action === "add") {
167
+ // Check if directory exists
168
+ try {
169
+ await fs.access(resolvedPath);
170
+ } catch {
171
+ return NextResponse.json(
172
+ { success: false, error: `Directory not found: ${resolvedPath}` },
173
+ { status: 400 }
174
+ );
175
+ }
176
+
177
+ // Don't add duplicates
178
+ if (registry.projects.some((p) => p.path === resolvedPath)) {
179
+ return NextResponse.json({
180
+ success: true,
181
+ message: "Project already registered",
182
+ });
183
+ }
184
+
185
+ registry.projects.push({
186
+ path: resolvedPath,
187
+ name: extractProjectName(resolvedPath),
188
+ addedAt: Date.now(),
189
+ lastScan: null,
190
+ });
191
+
192
+ await saveRegistry(registry);
193
+
194
+ return NextResponse.json({
195
+ success: true,
196
+ message: `Registered ${resolvedPath}`,
197
+ });
198
+ }
199
+
200
+ if (action === "remove") {
201
+ registry.projects = registry.projects.filter((p) => p.path !== resolvedPath);
202
+ await saveRegistry(registry);
203
+
204
+ return NextResponse.json({
205
+ success: true,
206
+ message: `Removed ${resolvedPath}`,
207
+ });
208
+ }
209
+
210
+ return NextResponse.json(
211
+ { success: false, error: `Unknown action: ${action}` },
212
+ { status: 400 }
213
+ );
214
+ } catch (error) {
215
+ console.error("Error updating projects:", error);
216
+ return NextResponse.json(
217
+ { success: false, error: error instanceof Error ? error.message : "Unknown error" },
218
+ { status: 500 }
219
+ );
220
+ }
221
+ }
@@ -0,0 +1,328 @@
1
+ /**
2
+ * API Route: /api/prompts
3
+ *
4
+ * Returns LLM call and prompt data from NavGator scans.
5
+ * Supports both real scan data and demo mode.
6
+ */
7
+
8
+ import { NextRequest, NextResponse } from "next/server";
9
+ import { exec } from "child_process";
10
+ import { promisify } from "util";
11
+ import * as fs from "fs/promises";
12
+ import * as path from "path";
13
+ import {
14
+ transformScanResultWithDefaults,
15
+ generateDemoData,
16
+ type PromptScanResult,
17
+ } from "@/lib/transform";
18
+ import type { PromptsApiResponse } from "@/lib/types";
19
+
20
+ const execAsync = promisify(exec);
21
+
22
+ // Cache for scan results (keyed by project path)
23
+ const promptsCache = new Map<string, { data: PromptsApiResponse["data"]; timestamp: number }>();
24
+ const CACHE_TTL = 60000; // 1 minute cache
25
+
26
+ /**
27
+ * GET /api/prompts
28
+ *
29
+ * Query params:
30
+ * - path: Project path to scan (optional, defaults to parent of web dir)
31
+ * - demo: If "true", returns demo data
32
+ * - refresh: If "true", bypasses cache
33
+ */
34
+ export async function GET(request: NextRequest) {
35
+ const searchParams = request.nextUrl.searchParams;
36
+ const demoMode = searchParams.get("demo") === "true";
37
+ const refresh = searchParams.get("refresh") === "true";
38
+ const projectPath = searchParams.get("path");
39
+
40
+ // Demo mode - return synthetic data
41
+ if (demoMode) {
42
+ const demoData = generateDemoData();
43
+ return NextResponse.json<PromptsApiResponse>({
44
+ success: true,
45
+ data: demoData,
46
+ source: "mock",
47
+ });
48
+ }
49
+
50
+ const cacheKey = projectPath || "__default__";
51
+ const cached = promptsCache.get(cacheKey);
52
+
53
+ // Check cache
54
+ if (!refresh && cached && Date.now() - cached.timestamp < CACHE_TTL) {
55
+ return NextResponse.json<PromptsApiResponse>({
56
+ success: true,
57
+ data: cached.data,
58
+ source: "cache",
59
+ });
60
+ }
61
+
62
+ try {
63
+ // Try to load scan results from NavGator storage
64
+ const data = await loadScanData(projectPath);
65
+
66
+ if (data) {
67
+ promptsCache.set(cacheKey, { data, timestamp: Date.now() });
68
+
69
+ return NextResponse.json<PromptsApiResponse>({
70
+ success: true,
71
+ data,
72
+ source: "scan",
73
+ });
74
+ }
75
+
76
+ // No scan data available - check if user explicitly wants demo
77
+ if (demoMode) {
78
+ const demoData = generateDemoData();
79
+ return NextResponse.json<PromptsApiResponse>({
80
+ success: true,
81
+ data: demoData,
82
+ source: "mock",
83
+ });
84
+ }
85
+
86
+ // Return empty state - prompt user to run setup
87
+ return NextResponse.json<PromptsApiResponse>({
88
+ success: true,
89
+ data: {
90
+ calls: [],
91
+ prompts: [],
92
+ summary: {
93
+ totalCalls: 0,
94
+ totalPrompts: 0,
95
+ byProvider: {},
96
+ byModel: {},
97
+ byCategory: {},
98
+ templatesCount: 0,
99
+ withToolsCount: 0,
100
+ },
101
+ },
102
+ source: "scan",
103
+ error: "No scan data found. Run `navgator setup` to scan your project.",
104
+ });
105
+ } catch (error) {
106
+ console.error("Error loading prompt data:", error);
107
+
108
+ // Return empty state on error
109
+ return NextResponse.json<PromptsApiResponse>({
110
+ success: false,
111
+ data: {
112
+ calls: [],
113
+ prompts: [],
114
+ summary: {
115
+ totalCalls: 0,
116
+ totalPrompts: 0,
117
+ byProvider: {},
118
+ byModel: {},
119
+ byCategory: {},
120
+ templatesCount: 0,
121
+ withToolsCount: 0,
122
+ },
123
+ },
124
+ source: "scan",
125
+ error: error instanceof Error ? error.message : "Unknown error",
126
+ });
127
+ }
128
+ }
129
+
130
+ /**
131
+ * POST /api/prompts
132
+ *
133
+ * Trigger a new scan and return results
134
+ */
135
+ export async function POST(request: NextRequest) {
136
+ try {
137
+ const body = await request.json();
138
+ const projectPath = body.path;
139
+
140
+ // Run NavGator scan
141
+ const scanResult = await runNavGatorScan(projectPath);
142
+
143
+ if (scanResult) {
144
+ const data = transformScanResultWithDefaults(scanResult);
145
+ const postCacheKey = projectPath || "__default__";
146
+ promptsCache.set(postCacheKey, { data, timestamp: Date.now() });
147
+
148
+ return NextResponse.json<PromptsApiResponse>({
149
+ success: true,
150
+ data,
151
+ source: "scan",
152
+ });
153
+ }
154
+
155
+ return NextResponse.json<PromptsApiResponse>(
156
+ {
157
+ success: false,
158
+ error: "Scan produced no results",
159
+ source: "scan",
160
+ },
161
+ { status: 500 }
162
+ );
163
+ } catch (error) {
164
+ console.error("Error running scan:", error);
165
+ return NextResponse.json<PromptsApiResponse>(
166
+ {
167
+ success: false,
168
+ error: error instanceof Error ? error.message : "Scan failed",
169
+ source: "scan",
170
+ },
171
+ { status: 500 }
172
+ );
173
+ }
174
+ }
175
+
176
+ // =============================================================================
177
+ // DATA LOADING
178
+ // =============================================================================
179
+
180
+ async function loadScanData(
181
+ projectPath?: string | null
182
+ ): Promise<PromptsApiResponse["data"] | null> {
183
+ // Priority: query param > env var > NavGator directory
184
+ const root = projectPath ||
185
+ process.env.NAVGATOR_PROJECT_PATH ||
186
+ process.cwd().replace(/\/web$/, "");
187
+
188
+ // Try to load from NavGator storage
189
+ const storagePaths = [
190
+ path.join(root, ".claude", "architecture", "prompts.json"),
191
+ path.join(root, ".navgator", "prompts.json"),
192
+ ];
193
+
194
+ for (const storagePath of storagePaths) {
195
+ try {
196
+ const content = await fs.readFile(storagePath, "utf-8");
197
+ const scanResult: PromptScanResult = JSON.parse(content);
198
+ return transformScanResultWithDefaults(scanResult);
199
+ } catch {
200
+ // File doesn't exist or isn't valid JSON
201
+ continue;
202
+ }
203
+ }
204
+
205
+ // Try to load from component files
206
+ const componentsDir = path.join(root, ".claude", "architecture", "components");
207
+ try {
208
+ const files = await fs.readdir(componentsDir);
209
+ const promptFiles = files.filter((f) => f.includes("prompt") && f.endsWith(".json"));
210
+
211
+ if (promptFiles.length > 0) {
212
+ const prompts = await Promise.all(
213
+ promptFiles.map(async (file) => {
214
+ const content = await fs.readFile(path.join(componentsDir, file), "utf-8");
215
+ return JSON.parse(content);
216
+ })
217
+ );
218
+
219
+ // Convert component format to prompt format
220
+ const scanResult = componentsToScanResult(prompts);
221
+ return transformScanResultWithDefaults(scanResult);
222
+ }
223
+ } catch {
224
+ // Directory doesn't exist
225
+ }
226
+
227
+ return null;
228
+ }
229
+
230
+ async function runNavGatorScan(
231
+ projectPath?: string
232
+ ): Promise<PromptScanResult | null> {
233
+ // Priority: query param > env var > NavGator directory
234
+ const root = projectPath ||
235
+ process.env.NAVGATOR_PROJECT_PATH ||
236
+ process.cwd().replace(/\/web$/, "");
237
+
238
+ // Validate path to prevent command injection
239
+ if (!/^[a-zA-Z0-9._\s\/~-]+$/.test(root)) {
240
+ console.warn("Invalid project path, skipping CLI scan");
241
+ return null;
242
+ }
243
+
244
+ try {
245
+ // Try running navgator CLI
246
+ const { stdout } = await execAsync(
247
+ `cd "${root}" && npx navgator prompts --json`,
248
+ { timeout: 30000 }
249
+ );
250
+
251
+ return JSON.parse(stdout);
252
+ } catch (error) {
253
+ console.warn("NavGator CLI not available, trying direct scan...");
254
+
255
+ // Direct scan via built scanner is not available in Next.js context
256
+ // The scanner must be run via CLI: `navgator scan --prompts`
257
+ console.warn("Direct scan not available in web context. Use CLI: navgator scan --prompts");
258
+ return null;
259
+ }
260
+ }
261
+
262
+ // =============================================================================
263
+ // CONVERSION HELPERS
264
+ // =============================================================================
265
+
266
+ interface ArchitectureComponent {
267
+ component_id: string;
268
+ name: string;
269
+ type: string;
270
+ metadata?: Record<string, unknown>;
271
+ source?: { config_files?: string[]; confidence?: number };
272
+ tags?: string[];
273
+ timestamp?: number;
274
+ }
275
+
276
+ function componentsToScanResult(
277
+ components: ArchitectureComponent[]
278
+ ): PromptScanResult {
279
+ const prompts = components
280
+ .filter((c) => c.type === "prompt")
281
+ .map((c) => ({
282
+ id: c.component_id,
283
+ name: c.name,
284
+ location: {
285
+ file: c.source?.config_files?.[0] || "unknown",
286
+ lineStart: 1,
287
+ lineEnd: 1,
288
+ functionName: c.name,
289
+ },
290
+ messages: [
291
+ {
292
+ role: "user" as const,
293
+ content: String(c.metadata?.userTemplate || c.metadata?.systemPrompt || ""),
294
+ },
295
+ ],
296
+ rawContent: String(c.metadata?.userTemplate || c.metadata?.systemPrompt || ""),
297
+ isTemplate: Boolean(c.metadata?.variables),
298
+ variables: ((c.metadata?.variables as string[]) || []).map((v) => ({
299
+ name: v,
300
+ pattern: `{{${v}}}`,
301
+ })),
302
+ provider: c.metadata?.provider
303
+ ? {
304
+ provider: c.metadata.provider as "openai" | "anthropic" | "unknown",
305
+ model: c.metadata.model as string | undefined,
306
+ }
307
+ : undefined,
308
+ usedBy: [],
309
+ purpose: c.metadata?.purpose as string | undefined,
310
+ tags: c.tags || [],
311
+ category: c.metadata?.category as PromptScanResult["prompts"][0]["category"],
312
+ confidence: c.source?.confidence || 0.8,
313
+ detectionMethod: "heuristic" as const,
314
+ timestamp: c.timestamp || Date.now(),
315
+ }));
316
+
317
+ return {
318
+ prompts,
319
+ summary: {
320
+ totalPrompts: prompts.length,
321
+ byProvider: {},
322
+ byCategory: {},
323
+ templatesCount: prompts.filter((p) => p.isTemplate).length,
324
+ withToolsCount: 0,
325
+ },
326
+ warnings: [],
327
+ };
328
+ }
@@ -0,0 +1,108 @@
1
+ /**
2
+ * API Route: /api/scan
3
+ *
4
+ * Triggers a NavGator scan and returns combined results.
5
+ */
6
+
7
+ import { NextRequest, NextResponse } from "next/server";
8
+ import { exec } from "child_process";
9
+ import { promisify } from "util";
10
+
11
+ const execAsync = promisify(exec);
12
+
13
+ interface ScanResponse {
14
+ success: boolean;
15
+ message: string;
16
+ timestamp: string;
17
+ results?: {
18
+ components?: number;
19
+ connections?: number;
20
+ prompts?: number;
21
+ };
22
+ error?: string;
23
+ }
24
+
25
+ /**
26
+ * POST /api/scan
27
+ *
28
+ * Triggers a full NavGator scan
29
+ */
30
+ export async function POST(request: NextRequest) {
31
+ try {
32
+ const body = await request.json().catch(() => ({}));
33
+ const projectPath = body.path || process.cwd().replace(/\/web$/, "");
34
+ const includePrompts = body.prompts !== false;
35
+
36
+ // Validate project path to prevent command injection
37
+ if (!/^[a-zA-Z0-9._\s\/~-]+$/.test(projectPath)) {
38
+ return NextResponse.json<ScanResponse>(
39
+ { success: false, message: "Invalid project path", timestamp: new Date().toISOString(), error: "Path contains invalid characters" },
40
+ { status: 400 }
41
+ );
42
+ }
43
+
44
+ // Build the scan command
45
+ let command = `cd "${projectPath}" && npx navgator scan`;
46
+ if (includePrompts) {
47
+ command += " --prompts";
48
+ }
49
+
50
+ // Run the scan
51
+ const { stdout, stderr } = await execAsync(command, { timeout: 60000 });
52
+
53
+ // Parse results from output
54
+ const componentMatch = stdout.match(/Components:\s*(\d+)/);
55
+ const connectionMatch = stdout.match(/Connections:\s*(\d+)/);
56
+ const promptMatch = stdout.match(/Prompts:\s*(\d+)/);
57
+
58
+ return NextResponse.json<ScanResponse>({
59
+ success: true,
60
+ message: "Scan completed successfully",
61
+ timestamp: new Date().toISOString(),
62
+ results: {
63
+ components: componentMatch ? parseInt(componentMatch[1]) : undefined,
64
+ connections: connectionMatch ? parseInt(connectionMatch[1]) : undefined,
65
+ prompts: promptMatch ? parseInt(promptMatch[1]) : undefined,
66
+ },
67
+ });
68
+ } catch (error) {
69
+ console.error("Scan error:", error);
70
+
71
+ return NextResponse.json<ScanResponse>(
72
+ {
73
+ success: false,
74
+ message: "Scan failed",
75
+ timestamp: new Date().toISOString(),
76
+ error: error instanceof Error ? error.message : "Unknown error",
77
+ },
78
+ { status: 500 }
79
+ );
80
+ }
81
+ }
82
+
83
+ /**
84
+ * GET /api/scan
85
+ *
86
+ * Returns scan status/health
87
+ */
88
+ export async function GET() {
89
+ try {
90
+ const projectPath = process.cwd().replace(/\/web$/, "");
91
+
92
+ // Check if NavGator is available
93
+ const { stdout } = await execAsync(`cd "${projectPath}" && npx navgator --version`, {
94
+ timeout: 10000,
95
+ });
96
+
97
+ return NextResponse.json({
98
+ available: true,
99
+ version: stdout.trim(),
100
+ projectPath,
101
+ });
102
+ } catch {
103
+ return NextResponse.json({
104
+ available: false,
105
+ message: "NavGator CLI not available. Install with: npm install -g navgator",
106
+ });
107
+ }
108
+ }