trybeacon 0.1.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 (994) hide show
  1. package/.next/BUILD_ID +1 -0
  2. package/.next/app-path-routes-manifest.json +59 -0
  3. package/.next/build/56416d4ae4ce586f.js +6 -0
  4. package/.next/build/56416d4ae4ce586f.js.map +5 -0
  5. package/.next/build/chunks/[root-of-the-server]__0oj80bi._.js +206 -0
  6. package/.next/build/chunks/[root-of-the-server]__0oj80bi._.js.map +8 -0
  7. package/.next/build/chunks/[root-of-the-server]__1f933tp._.js +500 -0
  8. package/.next/build/chunks/[root-of-the-server]__1f933tp._.js.map +11 -0
  9. package/.next/build/chunks/[turbopack-node]_transforms_postcss_ts_0b7xl6g._.js +13 -0
  10. package/.next/build/chunks/[turbopack-node]_transforms_postcss_ts_0b7xl6g._.js.map +5 -0
  11. package/.next/build/chunks/[turbopack]_runtime.js +890 -0
  12. package/.next/build/chunks/[turbopack]_runtime.js.map +11 -0
  13. package/.next/build/chunks/node_modules_20v-8wl._.js +6824 -0
  14. package/.next/build/chunks/node_modules_20v-8wl._.js.map +47 -0
  15. package/.next/build/package.json +1 -0
  16. package/.next/build-manifest.json +21 -0
  17. package/.next/diagnostics/build-diagnostics.json +6 -0
  18. package/.next/diagnostics/framework.json +1 -0
  19. package/.next/diagnostics/route-bundle-stats.json +100 -0
  20. package/.next/export-marker.json +6 -0
  21. package/.next/fallback-build-manifest.json +13 -0
  22. package/.next/images-manifest.json +68 -0
  23. package/.next/next-minimal-server.js.nft.json +1 -0
  24. package/.next/next-server.js.nft.json +1 -0
  25. package/.next/package.json +1 -0
  26. package/.next/prerender-manifest.json +167 -0
  27. package/.next/required-server-files.js +338 -0
  28. package/.next/required-server-files.json +338 -0
  29. package/.next/routes-manifest.json +402 -0
  30. package/.next/server/app/_global-error/page/app-paths-manifest.json +3 -0
  31. package/.next/server/app/_global-error/page/build-manifest.json +17 -0
  32. package/.next/server/app/_global-error/page/next-font-manifest.json +6 -0
  33. package/.next/server/app/_global-error/page/react-loadable-manifest.json +1 -0
  34. package/.next/server/app/_global-error/page/server-reference-manifest.json +4 -0
  35. package/.next/server/app/_global-error/page.js +10 -0
  36. package/.next/server/app/_global-error/page.js.map +5 -0
  37. package/.next/server/app/_global-error/page.js.nft.json +1 -0
  38. package/.next/server/app/_global-error/page_client-reference-manifest.js +3 -0
  39. package/.next/server/app/_global-error.html +1 -0
  40. package/.next/server/app/_global-error.meta +15 -0
  41. package/.next/server/app/_global-error.rsc +14 -0
  42. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +5 -0
  43. package/.next/server/app/_global-error.segments/_full.segment.rsc +14 -0
  44. package/.next/server/app/_global-error.segments/_head.segment.rsc +5 -0
  45. package/.next/server/app/_global-error.segments/_index.segment.rsc +5 -0
  46. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -0
  47. package/.next/server/app/_not-found/page/app-paths-manifest.json +3 -0
  48. package/.next/server/app/_not-found/page/build-manifest.json +17 -0
  49. package/.next/server/app/_not-found/page/next-font-manifest.json +11 -0
  50. package/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -0
  51. package/.next/server/app/_not-found/page/server-reference-manifest.json +4 -0
  52. package/.next/server/app/_not-found/page.js +15 -0
  53. package/.next/server/app/_not-found/page.js.map +5 -0
  54. package/.next/server/app/_not-found/page.js.nft.json +1 -0
  55. package/.next/server/app/_not-found/page_client-reference-manifest.js +3 -0
  56. package/.next/server/app/_not-found.html +1 -0
  57. package/.next/server/app/_not-found.meta +16 -0
  58. package/.next/server/app/_not-found.rsc +24 -0
  59. package/.next/server/app/_not-found.segments/_full.segment.rsc +24 -0
  60. package/.next/server/app/_not-found.segments/_head.segment.rsc +6 -0
  61. package/.next/server/app/_not-found.segments/_index.segment.rsc +13 -0
  62. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -0
  63. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +5 -0
  64. package/.next/server/app/_not-found.segments/_tree.segment.rsc +3 -0
  65. package/.next/server/app/api/code-graph/position/route/app-paths-manifest.json +3 -0
  66. package/.next/server/app/api/code-graph/position/route/build-manifest.json +9 -0
  67. package/.next/server/app/api/code-graph/position/route/server-reference-manifest.json +4 -0
  68. package/.next/server/app/api/code-graph/position/route.js +12 -0
  69. package/.next/server/app/api/code-graph/position/route.js.map +5 -0
  70. package/.next/server/app/api/code-graph/position/route.js.nft.json +1 -0
  71. package/.next/server/app/api/code-graph/position/route_client-reference-manifest.js +3 -0
  72. package/.next/server/app/api/code-graph/route/app-paths-manifest.json +3 -0
  73. package/.next/server/app/api/code-graph/route/build-manifest.json +9 -0
  74. package/.next/server/app/api/code-graph/route/server-reference-manifest.json +4 -0
  75. package/.next/server/app/api/code-graph/route.js +12 -0
  76. package/.next/server/app/api/code-graph/route.js.map +5 -0
  77. package/.next/server/app/api/code-graph/route.js.nft.json +1 -0
  78. package/.next/server/app/api/code-graph/route_client-reference-manifest.js +3 -0
  79. package/.next/server/app/api/context/embed-backfill/route/app-paths-manifest.json +3 -0
  80. package/.next/server/app/api/context/embed-backfill/route/build-manifest.json +9 -0
  81. package/.next/server/app/api/context/embed-backfill/route/server-reference-manifest.json +4 -0
  82. package/.next/server/app/api/context/embed-backfill/route.js +11 -0
  83. package/.next/server/app/api/context/embed-backfill/route.js.map +5 -0
  84. package/.next/server/app/api/context/embed-backfill/route.js.nft.json +1 -0
  85. package/.next/server/app/api/context/embed-backfill/route_client-reference-manifest.js +3 -0
  86. package/.next/server/app/api/context/feature/route/app-paths-manifest.json +3 -0
  87. package/.next/server/app/api/context/feature/route/build-manifest.json +9 -0
  88. package/.next/server/app/api/context/feature/route/server-reference-manifest.json +4 -0
  89. package/.next/server/app/api/context/feature/route.js +15 -0
  90. package/.next/server/app/api/context/feature/route.js.map +5 -0
  91. package/.next/server/app/api/context/feature/route.js.nft.json +1 -0
  92. package/.next/server/app/api/context/feature/route_client-reference-manifest.js +3 -0
  93. package/.next/server/app/api/context/file/route/app-paths-manifest.json +3 -0
  94. package/.next/server/app/api/context/file/route/build-manifest.json +9 -0
  95. package/.next/server/app/api/context/file/route/server-reference-manifest.json +4 -0
  96. package/.next/server/app/api/context/file/route.js +13 -0
  97. package/.next/server/app/api/context/file/route.js.map +5 -0
  98. package/.next/server/app/api/context/file/route.js.nft.json +1 -0
  99. package/.next/server/app/api/context/file/route_client-reference-manifest.js +3 -0
  100. package/.next/server/app/api/context/route/app-paths-manifest.json +3 -0
  101. package/.next/server/app/api/context/route/build-manifest.json +9 -0
  102. package/.next/server/app/api/context/route/server-reference-manifest.json +4 -0
  103. package/.next/server/app/api/context/route.js +11 -0
  104. package/.next/server/app/api/context/route.js.map +5 -0
  105. package/.next/server/app/api/context/route.js.nft.json +1 -0
  106. package/.next/server/app/api/context/route_client-reference-manifest.js +3 -0
  107. package/.next/server/app/api/db/backfill-access/route/app-paths-manifest.json +3 -0
  108. package/.next/server/app/api/db/backfill-access/route/build-manifest.json +9 -0
  109. package/.next/server/app/api/db/backfill-access/route/server-reference-manifest.json +4 -0
  110. package/.next/server/app/api/db/backfill-access/route.js +13 -0
  111. package/.next/server/app/api/db/backfill-access/route.js.map +5 -0
  112. package/.next/server/app/api/db/backfill-access/route.js.nft.json +1 -0
  113. package/.next/server/app/api/db/backfill-access/route_client-reference-manifest.js +3 -0
  114. package/.next/server/app/api/db/position/route/app-paths-manifest.json +3 -0
  115. package/.next/server/app/api/db/position/route/build-manifest.json +9 -0
  116. package/.next/server/app/api/db/position/route/server-reference-manifest.json +4 -0
  117. package/.next/server/app/api/db/position/route.js +15 -0
  118. package/.next/server/app/api/db/position/route.js.map +5 -0
  119. package/.next/server/app/api/db/position/route.js.nft.json +1 -0
  120. package/.next/server/app/api/db/position/route_client-reference-manifest.js +3 -0
  121. package/.next/server/app/api/db/reconcile-endpoints/route/app-paths-manifest.json +3 -0
  122. package/.next/server/app/api/db/reconcile-endpoints/route/build-manifest.json +9 -0
  123. package/.next/server/app/api/db/reconcile-endpoints/route/server-reference-manifest.json +4 -0
  124. package/.next/server/app/api/db/reconcile-endpoints/route.js +12 -0
  125. package/.next/server/app/api/db/reconcile-endpoints/route.js.map +5 -0
  126. package/.next/server/app/api/db/reconcile-endpoints/route.js.nft.json +1 -0
  127. package/.next/server/app/api/db/reconcile-endpoints/route_client-reference-manifest.js +3 -0
  128. package/.next/server/app/api/db/relations/[id]/route/app-paths-manifest.json +3 -0
  129. package/.next/server/app/api/db/relations/[id]/route/build-manifest.json +9 -0
  130. package/.next/server/app/api/db/relations/[id]/route/server-reference-manifest.json +4 -0
  131. package/.next/server/app/api/db/relations/[id]/route.js +12 -0
  132. package/.next/server/app/api/db/relations/[id]/route.js.map +5 -0
  133. package/.next/server/app/api/db/relations/[id]/route.js.nft.json +1 -0
  134. package/.next/server/app/api/db/relations/[id]/route_client-reference-manifest.js +3 -0
  135. package/.next/server/app/api/db/tables/[id]/route/app-paths-manifest.json +3 -0
  136. package/.next/server/app/api/db/tables/[id]/route/build-manifest.json +9 -0
  137. package/.next/server/app/api/db/tables/[id]/route/server-reference-manifest.json +4 -0
  138. package/.next/server/app/api/db/tables/[id]/route.js +12 -0
  139. package/.next/server/app/api/db/tables/[id]/route.js.map +5 -0
  140. package/.next/server/app/api/db/tables/[id]/route.js.nft.json +1 -0
  141. package/.next/server/app/api/db/tables/[id]/route_client-reference-manifest.js +3 -0
  142. package/.next/server/app/api/draft/approve/route/app-paths-manifest.json +3 -0
  143. package/.next/server/app/api/draft/approve/route/build-manifest.json +9 -0
  144. package/.next/server/app/api/draft/approve/route/server-reference-manifest.json +4 -0
  145. package/.next/server/app/api/draft/approve/route.js +16 -0
  146. package/.next/server/app/api/draft/approve/route.js.map +5 -0
  147. package/.next/server/app/api/draft/approve/route.js.nft.json +1 -0
  148. package/.next/server/app/api/draft/approve/route_client-reference-manifest.js +3 -0
  149. package/.next/server/app/api/draft/route/app-paths-manifest.json +3 -0
  150. package/.next/server/app/api/draft/route/build-manifest.json +9 -0
  151. package/.next/server/app/api/draft/route/server-reference-manifest.json +4 -0
  152. package/.next/server/app/api/draft/route.js +16 -0
  153. package/.next/server/app/api/draft/route.js.map +5 -0
  154. package/.next/server/app/api/draft/route.js.nft.json +1 -0
  155. package/.next/server/app/api/draft/route_client-reference-manifest.js +3 -0
  156. package/.next/server/app/api/draft/status/route/app-paths-manifest.json +3 -0
  157. package/.next/server/app/api/draft/status/route/build-manifest.json +9 -0
  158. package/.next/server/app/api/draft/status/route/server-reference-manifest.json +4 -0
  159. package/.next/server/app/api/draft/status/route.js +13 -0
  160. package/.next/server/app/api/draft/status/route.js.map +5 -0
  161. package/.next/server/app/api/draft/status/route.js.nft.json +1 -0
  162. package/.next/server/app/api/draft/status/route_client-reference-manifest.js +3 -0
  163. package/.next/server/app/api/edges/[id]/route/app-paths-manifest.json +3 -0
  164. package/.next/server/app/api/edges/[id]/route/build-manifest.json +9 -0
  165. package/.next/server/app/api/edges/[id]/route/server-reference-manifest.json +4 -0
  166. package/.next/server/app/api/edges/[id]/route.js +11 -0
  167. package/.next/server/app/api/edges/[id]/route.js.map +5 -0
  168. package/.next/server/app/api/edges/[id]/route.js.nft.json +1 -0
  169. package/.next/server/app/api/edges/[id]/route_client-reference-manifest.js +3 -0
  170. package/.next/server/app/api/edges/route/app-paths-manifest.json +3 -0
  171. package/.next/server/app/api/edges/route/build-manifest.json +9 -0
  172. package/.next/server/app/api/edges/route/server-reference-manifest.json +4 -0
  173. package/.next/server/app/api/edges/route.js +15 -0
  174. package/.next/server/app/api/edges/route.js.map +5 -0
  175. package/.next/server/app/api/edges/route.js.nft.json +1 -0
  176. package/.next/server/app/api/edges/route_client-reference-manifest.js +3 -0
  177. package/.next/server/app/api/endpoints/[id]/route/app-paths-manifest.json +3 -0
  178. package/.next/server/app/api/endpoints/[id]/route/build-manifest.json +9 -0
  179. package/.next/server/app/api/endpoints/[id]/route/server-reference-manifest.json +4 -0
  180. package/.next/server/app/api/endpoints/[id]/route.js +12 -0
  181. package/.next/server/app/api/endpoints/[id]/route.js.map +5 -0
  182. package/.next/server/app/api/endpoints/[id]/route.js.nft.json +1 -0
  183. package/.next/server/app/api/endpoints/[id]/route_client-reference-manifest.js +3 -0
  184. package/.next/server/app/api/entities/route/app-paths-manifest.json +3 -0
  185. package/.next/server/app/api/entities/route/build-manifest.json +9 -0
  186. package/.next/server/app/api/entities/route/server-reference-manifest.json +4 -0
  187. package/.next/server/app/api/entities/route.js +11 -0
  188. package/.next/server/app/api/entities/route.js.map +5 -0
  189. package/.next/server/app/api/entities/route.js.nft.json +1 -0
  190. package/.next/server/app/api/entities/route_client-reference-manifest.js +3 -0
  191. package/.next/server/app/api/ingest/route/app-paths-manifest.json +3 -0
  192. package/.next/server/app/api/ingest/route/build-manifest.json +9 -0
  193. package/.next/server/app/api/ingest/route/server-reference-manifest.json +4 -0
  194. package/.next/server/app/api/ingest/route.js +12 -0
  195. package/.next/server/app/api/ingest/route.js.map +5 -0
  196. package/.next/server/app/api/ingest/route.js.nft.json +1 -0
  197. package/.next/server/app/api/ingest/route_client-reference-manifest.js +3 -0
  198. package/.next/server/app/api/init/route/app-paths-manifest.json +3 -0
  199. package/.next/server/app/api/init/route/build-manifest.json +9 -0
  200. package/.next/server/app/api/init/route/server-reference-manifest.json +4 -0
  201. package/.next/server/app/api/init/route.js +15 -0
  202. package/.next/server/app/api/init/route.js.map +5 -0
  203. package/.next/server/app/api/init/route.js.nft.json +1 -0
  204. package/.next/server/app/api/init/route_client-reference-manifest.js +3 -0
  205. package/.next/server/app/api/map/describe/route/app-paths-manifest.json +3 -0
  206. package/.next/server/app/api/map/describe/route/build-manifest.json +9 -0
  207. package/.next/server/app/api/map/describe/route/server-reference-manifest.json +4 -0
  208. package/.next/server/app/api/map/describe/route.js +15 -0
  209. package/.next/server/app/api/map/describe/route.js.map +5 -0
  210. package/.next/server/app/api/map/describe/route.js.nft.json +1 -0
  211. package/.next/server/app/api/map/describe/route_client-reference-manifest.js +3 -0
  212. package/.next/server/app/api/map/files/route/app-paths-manifest.json +3 -0
  213. package/.next/server/app/api/map/files/route/build-manifest.json +9 -0
  214. package/.next/server/app/api/map/files/route/server-reference-manifest.json +4 -0
  215. package/.next/server/app/api/map/files/route.js +15 -0
  216. package/.next/server/app/api/map/files/route.js.map +5 -0
  217. package/.next/server/app/api/map/files/route.js.nft.json +1 -0
  218. package/.next/server/app/api/map/files/route_client-reference-manifest.js +3 -0
  219. package/.next/server/app/api/map/finish/route/app-paths-manifest.json +3 -0
  220. package/.next/server/app/api/map/finish/route/build-manifest.json +9 -0
  221. package/.next/server/app/api/map/finish/route/server-reference-manifest.json +4 -0
  222. package/.next/server/app/api/map/finish/route.js +15 -0
  223. package/.next/server/app/api/map/finish/route.js.map +5 -0
  224. package/.next/server/app/api/map/finish/route.js.nft.json +1 -0
  225. package/.next/server/app/api/map/finish/route_client-reference-manifest.js +3 -0
  226. package/.next/server/app/api/map/route/app-paths-manifest.json +3 -0
  227. package/.next/server/app/api/map/route/build-manifest.json +9 -0
  228. package/.next/server/app/api/map/route/server-reference-manifest.json +4 -0
  229. package/.next/server/app/api/map/route.js +15 -0
  230. package/.next/server/app/api/map/route.js.map +5 -0
  231. package/.next/server/app/api/map/route.js.nft.json +1 -0
  232. package/.next/server/app/api/map/route_client-reference-manifest.js +3 -0
  233. package/.next/server/app/api/map/start/route/app-paths-manifest.json +3 -0
  234. package/.next/server/app/api/map/start/route/build-manifest.json +9 -0
  235. package/.next/server/app/api/map/start/route/server-reference-manifest.json +4 -0
  236. package/.next/server/app/api/map/start/route.js +15 -0
  237. package/.next/server/app/api/map/start/route.js.map +5 -0
  238. package/.next/server/app/api/map/start/route.js.nft.json +1 -0
  239. package/.next/server/app/api/map/start/route_client-reference-manifest.js +3 -0
  240. package/.next/server/app/api/map/touch-active/route/app-paths-manifest.json +3 -0
  241. package/.next/server/app/api/map/touch-active/route/build-manifest.json +9 -0
  242. package/.next/server/app/api/map/touch-active/route/server-reference-manifest.json +4 -0
  243. package/.next/server/app/api/map/touch-active/route.js +15 -0
  244. package/.next/server/app/api/map/touch-active/route.js.map +5 -0
  245. package/.next/server/app/api/map/touch-active/route.js.nft.json +1 -0
  246. package/.next/server/app/api/map/touch-active/route_client-reference-manifest.js +3 -0
  247. package/.next/server/app/api/nodes/[id]/position/route/app-paths-manifest.json +3 -0
  248. package/.next/server/app/api/nodes/[id]/position/route/build-manifest.json +9 -0
  249. package/.next/server/app/api/nodes/[id]/position/route/server-reference-manifest.json +4 -0
  250. package/.next/server/app/api/nodes/[id]/position/route.js +15 -0
  251. package/.next/server/app/api/nodes/[id]/position/route.js.map +5 -0
  252. package/.next/server/app/api/nodes/[id]/position/route.js.nft.json +1 -0
  253. package/.next/server/app/api/nodes/[id]/position/route_client-reference-manifest.js +3 -0
  254. package/.next/server/app/api/nodes/[id]/route/app-paths-manifest.json +3 -0
  255. package/.next/server/app/api/nodes/[id]/route/build-manifest.json +9 -0
  256. package/.next/server/app/api/nodes/[id]/route/server-reference-manifest.json +4 -0
  257. package/.next/server/app/api/nodes/[id]/route.js +15 -0
  258. package/.next/server/app/api/nodes/[id]/route.js.map +5 -0
  259. package/.next/server/app/api/nodes/[id]/route.js.nft.json +1 -0
  260. package/.next/server/app/api/nodes/[id]/route_client-reference-manifest.js +3 -0
  261. package/.next/server/app/api/nodes/positions/route/app-paths-manifest.json +3 -0
  262. package/.next/server/app/api/nodes/positions/route/build-manifest.json +9 -0
  263. package/.next/server/app/api/nodes/positions/route/server-reference-manifest.json +4 -0
  264. package/.next/server/app/api/nodes/positions/route.js +15 -0
  265. package/.next/server/app/api/nodes/positions/route.js.map +5 -0
  266. package/.next/server/app/api/nodes/positions/route.js.nft.json +1 -0
  267. package/.next/server/app/api/nodes/positions/route_client-reference-manifest.js +3 -0
  268. package/.next/server/app/api/nodes/route/app-paths-manifest.json +3 -0
  269. package/.next/server/app/api/nodes/route/build-manifest.json +9 -0
  270. package/.next/server/app/api/nodes/route/server-reference-manifest.json +4 -0
  271. package/.next/server/app/api/nodes/route.js +15 -0
  272. package/.next/server/app/api/nodes/route.js.map +5 -0
  273. package/.next/server/app/api/nodes/route.js.nft.json +1 -0
  274. package/.next/server/app/api/nodes/route_client-reference-manifest.js +3 -0
  275. package/.next/server/app/api/nodes/subtasks/route/app-paths-manifest.json +3 -0
  276. package/.next/server/app/api/nodes/subtasks/route/build-manifest.json +9 -0
  277. package/.next/server/app/api/nodes/subtasks/route/server-reference-manifest.json +4 -0
  278. package/.next/server/app/api/nodes/subtasks/route.js +15 -0
  279. package/.next/server/app/api/nodes/subtasks/route.js.map +5 -0
  280. package/.next/server/app/api/nodes/subtasks/route.js.nft.json +1 -0
  281. package/.next/server/app/api/nodes/subtasks/route_client-reference-manifest.js +3 -0
  282. package/.next/server/app/api/notes/[id]/route/app-paths-manifest.json +3 -0
  283. package/.next/server/app/api/notes/[id]/route/build-manifest.json +9 -0
  284. package/.next/server/app/api/notes/[id]/route/server-reference-manifest.json +4 -0
  285. package/.next/server/app/api/notes/[id]/route.js +12 -0
  286. package/.next/server/app/api/notes/[id]/route.js.map +5 -0
  287. package/.next/server/app/api/notes/[id]/route.js.nft.json +1 -0
  288. package/.next/server/app/api/notes/[id]/route_client-reference-manifest.js +3 -0
  289. package/.next/server/app/api/notes/route/app-paths-manifest.json +3 -0
  290. package/.next/server/app/api/notes/route/build-manifest.json +9 -0
  291. package/.next/server/app/api/notes/route/server-reference-manifest.json +4 -0
  292. package/.next/server/app/api/notes/route.js +12 -0
  293. package/.next/server/app/api/notes/route.js.map +5 -0
  294. package/.next/server/app/api/notes/route.js.nft.json +1 -0
  295. package/.next/server/app/api/notes/route_client-reference-manifest.js +3 -0
  296. package/.next/server/app/api/open/route/app-paths-manifest.json +3 -0
  297. package/.next/server/app/api/open/route/build-manifest.json +9 -0
  298. package/.next/server/app/api/open/route/server-reference-manifest.json +4 -0
  299. package/.next/server/app/api/open/route.js +11 -0
  300. package/.next/server/app/api/open/route.js.map +5 -0
  301. package/.next/server/app/api/open/route.js.nft.json +1 -0
  302. package/.next/server/app/api/open/route_client-reference-manifest.js +3 -0
  303. package/.next/server/app/api/plan/annotations/route/app-paths-manifest.json +3 -0
  304. package/.next/server/app/api/plan/annotations/route/build-manifest.json +9 -0
  305. package/.next/server/app/api/plan/annotations/route/server-reference-manifest.json +4 -0
  306. package/.next/server/app/api/plan/annotations/route.js +15 -0
  307. package/.next/server/app/api/plan/annotations/route.js.map +5 -0
  308. package/.next/server/app/api/plan/annotations/route.js.nft.json +1 -0
  309. package/.next/server/app/api/plan/annotations/route_client-reference-manifest.js +3 -0
  310. package/.next/server/app/api/plan/approve/route/app-paths-manifest.json +3 -0
  311. package/.next/server/app/api/plan/approve/route/build-manifest.json +9 -0
  312. package/.next/server/app/api/plan/approve/route/server-reference-manifest.json +4 -0
  313. package/.next/server/app/api/plan/approve/route.js +16 -0
  314. package/.next/server/app/api/plan/approve/route.js.map +5 -0
  315. package/.next/server/app/api/plan/approve/route.js.nft.json +1 -0
  316. package/.next/server/app/api/plan/approve/route_client-reference-manifest.js +3 -0
  317. package/.next/server/app/api/plan/history/route/app-paths-manifest.json +3 -0
  318. package/.next/server/app/api/plan/history/route/build-manifest.json +9 -0
  319. package/.next/server/app/api/plan/history/route/server-reference-manifest.json +4 -0
  320. package/.next/server/app/api/plan/history/route.js +11 -0
  321. package/.next/server/app/api/plan/history/route.js.map +5 -0
  322. package/.next/server/app/api/plan/history/route.js.nft.json +1 -0
  323. package/.next/server/app/api/plan/history/route_client-reference-manifest.js +3 -0
  324. package/.next/server/app/api/plan/markdown/route/app-paths-manifest.json +3 -0
  325. package/.next/server/app/api/plan/markdown/route/build-manifest.json +9 -0
  326. package/.next/server/app/api/plan/markdown/route/server-reference-manifest.json +4 -0
  327. package/.next/server/app/api/plan/markdown/route.js +16 -0
  328. package/.next/server/app/api/plan/markdown/route.js.map +5 -0
  329. package/.next/server/app/api/plan/markdown/route.js.nft.json +1 -0
  330. package/.next/server/app/api/plan/markdown/route_client-reference-manifest.js +3 -0
  331. package/.next/server/app/api/plan/presence/route/app-paths-manifest.json +3 -0
  332. package/.next/server/app/api/plan/presence/route/build-manifest.json +9 -0
  333. package/.next/server/app/api/plan/presence/route/server-reference-manifest.json +4 -0
  334. package/.next/server/app/api/plan/presence/route.js +11 -0
  335. package/.next/server/app/api/plan/presence/route.js.map +5 -0
  336. package/.next/server/app/api/plan/presence/route.js.nft.json +1 -0
  337. package/.next/server/app/api/plan/presence/route_client-reference-manifest.js +3 -0
  338. package/.next/server/app/api/plan/route/app-paths-manifest.json +3 -0
  339. package/.next/server/app/api/plan/route/build-manifest.json +9 -0
  340. package/.next/server/app/api/plan/route/server-reference-manifest.json +4 -0
  341. package/.next/server/app/api/plan/route.js +16 -0
  342. package/.next/server/app/api/plan/route.js.map +5 -0
  343. package/.next/server/app/api/plan/route.js.nft.json +1 -0
  344. package/.next/server/app/api/plan/route_client-reference-manifest.js +3 -0
  345. package/.next/server/app/api/plan/verdict/route/app-paths-manifest.json +3 -0
  346. package/.next/server/app/api/plan/verdict/route/build-manifest.json +9 -0
  347. package/.next/server/app/api/plan/verdict/route/server-reference-manifest.json +4 -0
  348. package/.next/server/app/api/plan/verdict/route.js +16 -0
  349. package/.next/server/app/api/plan/verdict/route.js.map +5 -0
  350. package/.next/server/app/api/plan/verdict/route.js.nft.json +1 -0
  351. package/.next/server/app/api/plan/verdict/route_client-reference-manifest.js +3 -0
  352. package/.next/server/app/api/preferences/route/app-paths-manifest.json +3 -0
  353. package/.next/server/app/api/preferences/route/build-manifest.json +9 -0
  354. package/.next/server/app/api/preferences/route/server-reference-manifest.json +4 -0
  355. package/.next/server/app/api/preferences/route.js +7 -0
  356. package/.next/server/app/api/preferences/route.js.map +5 -0
  357. package/.next/server/app/api/preferences/route.js.nft.json +1 -0
  358. package/.next/server/app/api/preferences/route_client-reference-manifest.js +3 -0
  359. package/.next/server/app/api/reset/route/app-paths-manifest.json +3 -0
  360. package/.next/server/app/api/reset/route/build-manifest.json +9 -0
  361. package/.next/server/app/api/reset/route/server-reference-manifest.json +4 -0
  362. package/.next/server/app/api/reset/route.js +13 -0
  363. package/.next/server/app/api/reset/route.js.map +5 -0
  364. package/.next/server/app/api/reset/route.js.nft.json +1 -0
  365. package/.next/server/app/api/reset/route_client-reference-manifest.js +3 -0
  366. package/.next/server/app/api/settings/route/app-paths-manifest.json +3 -0
  367. package/.next/server/app/api/settings/route/build-manifest.json +9 -0
  368. package/.next/server/app/api/settings/route/server-reference-manifest.json +4 -0
  369. package/.next/server/app/api/settings/route.js +11 -0
  370. package/.next/server/app/api/settings/route.js.map +5 -0
  371. package/.next/server/app/api/settings/route.js.nft.json +1 -0
  372. package/.next/server/app/api/settings/route_client-reference-manifest.js +3 -0
  373. package/.next/server/app/api/stream/route/app-paths-manifest.json +3 -0
  374. package/.next/server/app/api/stream/route/build-manifest.json +9 -0
  375. package/.next/server/app/api/stream/route/server-reference-manifest.json +4 -0
  376. package/.next/server/app/api/stream/route.js +12 -0
  377. package/.next/server/app/api/stream/route.js.map +5 -0
  378. package/.next/server/app/api/stream/route.js.nft.json +1 -0
  379. package/.next/server/app/api/stream/route_client-reference-manifest.js +3 -0
  380. package/.next/server/app/api/version/route/app-paths-manifest.json +3 -0
  381. package/.next/server/app/api/version/route/build-manifest.json +9 -0
  382. package/.next/server/app/api/version/route/server-reference-manifest.json +4 -0
  383. package/.next/server/app/api/version/route.js +12 -0
  384. package/.next/server/app/api/version/route.js.map +5 -0
  385. package/.next/server/app/api/version/route.js.nft.json +1 -0
  386. package/.next/server/app/api/version/route_client-reference-manifest.js +3 -0
  387. package/.next/server/app/api/workspace/activate/route/app-paths-manifest.json +3 -0
  388. package/.next/server/app/api/workspace/activate/route/build-manifest.json +9 -0
  389. package/.next/server/app/api/workspace/activate/route/server-reference-manifest.json +4 -0
  390. package/.next/server/app/api/workspace/activate/route.js +14 -0
  391. package/.next/server/app/api/workspace/activate/route.js.map +5 -0
  392. package/.next/server/app/api/workspace/activate/route.js.nft.json +1 -0
  393. package/.next/server/app/api/workspace/activate/route_client-reference-manifest.js +3 -0
  394. package/.next/server/app/api/workspace/route/app-paths-manifest.json +3 -0
  395. package/.next/server/app/api/workspace/route/build-manifest.json +9 -0
  396. package/.next/server/app/api/workspace/route/server-reference-manifest.json +4 -0
  397. package/.next/server/app/api/workspace/route.js +11 -0
  398. package/.next/server/app/api/workspace/route.js.map +5 -0
  399. package/.next/server/app/api/workspace/route.js.nft.json +1 -0
  400. package/.next/server/app/api/workspace/route_client-reference-manifest.js +3 -0
  401. package/.next/server/app/apple-icon.png/route/app-paths-manifest.json +3 -0
  402. package/.next/server/app/apple-icon.png/route/build-manifest.json +9 -0
  403. package/.next/server/app/apple-icon.png/route.js +8 -0
  404. package/.next/server/app/apple-icon.png/route.js.map +5 -0
  405. package/.next/server/app/apple-icon.png/route.js.nft.json +1 -0
  406. package/.next/server/app/apple-icon.png.body +0 -0
  407. package/.next/server/app/apple-icon.png.meta +1 -0
  408. package/.next/server/app/help/page/app-paths-manifest.json +3 -0
  409. package/.next/server/app/help/page/build-manifest.json +17 -0
  410. package/.next/server/app/help/page/next-font-manifest.json +11 -0
  411. package/.next/server/app/help/page/react-loadable-manifest.json +1 -0
  412. package/.next/server/app/help/page/server-reference-manifest.json +4 -0
  413. package/.next/server/app/help/page.js +16 -0
  414. package/.next/server/app/help/page.js.map +5 -0
  415. package/.next/server/app/help/page.js.nft.json +1 -0
  416. package/.next/server/app/help/page_client-reference-manifest.js +3 -0
  417. package/.next/server/app/help.html +1 -0
  418. package/.next/server/app/help.meta +15 -0
  419. package/.next/server/app/help.rsc +36 -0
  420. package/.next/server/app/help.segments/_full.segment.rsc +36 -0
  421. package/.next/server/app/help.segments/_head.segment.rsc +6 -0
  422. package/.next/server/app/help.segments/_index.segment.rsc +13 -0
  423. package/.next/server/app/help.segments/_tree.segment.rsc +5 -0
  424. package/.next/server/app/help.segments/help/__PAGE__.segment.rsc +17 -0
  425. package/.next/server/app/help.segments/help.segment.rsc +5 -0
  426. package/.next/server/app/icon.svg/route/app-paths-manifest.json +3 -0
  427. package/.next/server/app/icon.svg/route/build-manifest.json +9 -0
  428. package/.next/server/app/icon.svg/route.js +7 -0
  429. package/.next/server/app/icon.svg/route.js.map +5 -0
  430. package/.next/server/app/icon.svg/route.js.nft.json +1 -0
  431. package/.next/server/app/icon.svg.body +4 -0
  432. package/.next/server/app/icon.svg.meta +1 -0
  433. package/.next/server/app/index.html +1 -0
  434. package/.next/server/app/index.meta +14 -0
  435. package/.next/server/app/index.rsc +26 -0
  436. package/.next/server/app/index.segments/__PAGE__.segment.rsc +7 -0
  437. package/.next/server/app/index.segments/_full.segment.rsc +26 -0
  438. package/.next/server/app/index.segments/_head.segment.rsc +6 -0
  439. package/.next/server/app/index.segments/_index.segment.rsc +13 -0
  440. package/.next/server/app/index.segments/_tree.segment.rsc +6 -0
  441. package/.next/server/app/map/page/app-paths-manifest.json +3 -0
  442. package/.next/server/app/map/page/build-manifest.json +17 -0
  443. package/.next/server/app/map/page/next-font-manifest.json +11 -0
  444. package/.next/server/app/map/page/react-loadable-manifest.json +1 -0
  445. package/.next/server/app/map/page/server-reference-manifest.json +89 -0
  446. package/.next/server/app/map/page.js +25 -0
  447. package/.next/server/app/map/page.js.map +5 -0
  448. package/.next/server/app/map/page.js.nft.json +1 -0
  449. package/.next/server/app/map/page_client-reference-manifest.js +3 -0
  450. package/.next/server/app/page/app-paths-manifest.json +3 -0
  451. package/.next/server/app/page/build-manifest.json +17 -0
  452. package/.next/server/app/page/next-font-manifest.json +11 -0
  453. package/.next/server/app/page/react-loadable-manifest.json +1 -0
  454. package/.next/server/app/page/server-reference-manifest.json +4 -0
  455. package/.next/server/app/page.js +16 -0
  456. package/.next/server/app/page.js.map +5 -0
  457. package/.next/server/app/page.js.nft.json +1 -0
  458. package/.next/server/app/page_client-reference-manifest.js +3 -0
  459. package/.next/server/app/plan/page/app-paths-manifest.json +3 -0
  460. package/.next/server/app/plan/page/build-manifest.json +17 -0
  461. package/.next/server/app/plan/page/next-font-manifest.json +11 -0
  462. package/.next/server/app/plan/page/react-loadable-manifest.json +1 -0
  463. package/.next/server/app/plan/page/server-reference-manifest.json +89 -0
  464. package/.next/server/app/plan/page.js +26 -0
  465. package/.next/server/app/plan/page.js.map +5 -0
  466. package/.next/server/app/plan/page.js.nft.json +1 -0
  467. package/.next/server/app/plan/page_client-reference-manifest.js +3 -0
  468. package/.next/server/app/settings/page/app-paths-manifest.json +3 -0
  469. package/.next/server/app/settings/page/build-manifest.json +17 -0
  470. package/.next/server/app/settings/page/next-font-manifest.json +11 -0
  471. package/.next/server/app/settings/page/react-loadable-manifest.json +1 -0
  472. package/.next/server/app/settings/page/server-reference-manifest.json +4 -0
  473. package/.next/server/app/settings/page.js +17 -0
  474. package/.next/server/app/settings/page.js.map +5 -0
  475. package/.next/server/app/settings/page.js.nft.json +1 -0
  476. package/.next/server/app/settings/page_client-reference-manifest.js +3 -0
  477. package/.next/server/app-paths-manifest.json +59 -0
  478. package/.next/server/chunks/[externals]_@huggingface_transformers_05bd-zz._.js +3 -0
  479. package/.next/server/chunks/[externals]_@huggingface_transformers_05bd-zz._.js.map +1 -0
  480. package/.next/server/chunks/[externals]__1m_jh08._.js +3 -0
  481. package/.next/server/chunks/[externals]__1m_jh08._.js.map +1 -0
  482. package/.next/server/chunks/[externals]_next_dist_1081pat._.js +3 -0
  483. package/.next/server/chunks/[externals]_next_dist_1081pat._.js.map +1 -0
  484. package/.next/server/chunks/[root-of-the-server]__0--8e0y._.js +3 -0
  485. package/.next/server/chunks/[root-of-the-server]__0--8e0y._.js.map +1 -0
  486. package/.next/server/chunks/[root-of-the-server]__0-68r22._.js +3 -0
  487. package/.next/server/chunks/[root-of-the-server]__0-68r22._.js.map +1 -0
  488. package/.next/server/chunks/[root-of-the-server]__008acf8._.js +3 -0
  489. package/.next/server/chunks/[root-of-the-server]__008acf8._.js.map +1 -0
  490. package/.next/server/chunks/[root-of-the-server]__00rostp._.js +3 -0
  491. package/.next/server/chunks/[root-of-the-server]__00rostp._.js.map +1 -0
  492. package/.next/server/chunks/[root-of-the-server]__04deymo._.js +3 -0
  493. package/.next/server/chunks/[root-of-the-server]__04deymo._.js.map +1 -0
  494. package/.next/server/chunks/[root-of-the-server]__05_ckr9._.js +3 -0
  495. package/.next/server/chunks/[root-of-the-server]__05_ckr9._.js.map +1 -0
  496. package/.next/server/chunks/[root-of-the-server]__08b769e._.js +3 -0
  497. package/.next/server/chunks/[root-of-the-server]__08b769e._.js.map +1 -0
  498. package/.next/server/chunks/[root-of-the-server]__0935gge._.js +3 -0
  499. package/.next/server/chunks/[root-of-the-server]__0935gge._.js.map +1 -0
  500. package/.next/server/chunks/[root-of-the-server]__0b04f4n._.js +3 -0
  501. package/.next/server/chunks/[root-of-the-server]__0b04f4n._.js.map +1 -0
  502. package/.next/server/chunks/[root-of-the-server]__0bule95._.js +11 -0
  503. package/.next/server/chunks/[root-of-the-server]__0bule95._.js.map +1 -0
  504. package/.next/server/chunks/[root-of-the-server]__0dgnobj._.js +3 -0
  505. package/.next/server/chunks/[root-of-the-server]__0dgnobj._.js.map +1 -0
  506. package/.next/server/chunks/[root-of-the-server]__0fnoun8._.js +3 -0
  507. package/.next/server/chunks/[root-of-the-server]__0fnoun8._.js.map +1 -0
  508. package/.next/server/chunks/[root-of-the-server]__0gcvcx_._.js +3 -0
  509. package/.next/server/chunks/[root-of-the-server]__0gcvcx_._.js.map +1 -0
  510. package/.next/server/chunks/[root-of-the-server]__0gnu9c5._.js +11 -0
  511. package/.next/server/chunks/[root-of-the-server]__0gnu9c5._.js.map +1 -0
  512. package/.next/server/chunks/[root-of-the-server]__0imrhoi._.js +3 -0
  513. package/.next/server/chunks/[root-of-the-server]__0imrhoi._.js.map +1 -0
  514. package/.next/server/chunks/[root-of-the-server]__0iq9oau._.js +3 -0
  515. package/.next/server/chunks/[root-of-the-server]__0iq9oau._.js.map +1 -0
  516. package/.next/server/chunks/[root-of-the-server]__0k_e0ex._.js +3 -0
  517. package/.next/server/chunks/[root-of-the-server]__0k_e0ex._.js.map +1 -0
  518. package/.next/server/chunks/[root-of-the-server]__0kj4pte._.js +3 -0
  519. package/.next/server/chunks/[root-of-the-server]__0kj4pte._.js.map +1 -0
  520. package/.next/server/chunks/[root-of-the-server]__0muvnnv._.js +11 -0
  521. package/.next/server/chunks/[root-of-the-server]__0muvnnv._.js.map +1 -0
  522. package/.next/server/chunks/[root-of-the-server]__0olqs85._.js +3 -0
  523. package/.next/server/chunks/[root-of-the-server]__0olqs85._.js.map +1 -0
  524. package/.next/server/chunks/[root-of-the-server]__0r4ba8s._.js +3 -0
  525. package/.next/server/chunks/[root-of-the-server]__0r4ba8s._.js.map +1 -0
  526. package/.next/server/chunks/[root-of-the-server]__0sb_5m8._.js +20 -0
  527. package/.next/server/chunks/[root-of-the-server]__0sb_5m8._.js.map +1 -0
  528. package/.next/server/chunks/[root-of-the-server]__0y6kb2t._.js +3 -0
  529. package/.next/server/chunks/[root-of-the-server]__0y6kb2t._.js.map +1 -0
  530. package/.next/server/chunks/[root-of-the-server]__0zfwiuh._.js +11 -0
  531. package/.next/server/chunks/[root-of-the-server]__0zfwiuh._.js.map +1 -0
  532. package/.next/server/chunks/[root-of-the-server]__11037f1._.js +3 -0
  533. package/.next/server/chunks/[root-of-the-server]__11037f1._.js.map +1 -0
  534. package/.next/server/chunks/[root-of-the-server]__1197yfd._.js +3 -0
  535. package/.next/server/chunks/[root-of-the-server]__1197yfd._.js.map +1 -0
  536. package/.next/server/chunks/[root-of-the-server]__138pbmp._.js +3 -0
  537. package/.next/server/chunks/[root-of-the-server]__138pbmp._.js.map +1 -0
  538. package/.next/server/chunks/[root-of-the-server]__166th-t._.js +3 -0
  539. package/.next/server/chunks/[root-of-the-server]__166th-t._.js.map +1 -0
  540. package/.next/server/chunks/[root-of-the-server]__190_wb7._.js +3 -0
  541. package/.next/server/chunks/[root-of-the-server]__190_wb7._.js.map +1 -0
  542. package/.next/server/chunks/[root-of-the-server]__190zu98._.js +3 -0
  543. package/.next/server/chunks/[root-of-the-server]__190zu98._.js.map +1 -0
  544. package/.next/server/chunks/[root-of-the-server]__1_7ntsu._.js +3 -0
  545. package/.next/server/chunks/[root-of-the-server]__1_7ntsu._.js.map +1 -0
  546. package/.next/server/chunks/[root-of-the-server]__1bwqb44._.js +3 -0
  547. package/.next/server/chunks/[root-of-the-server]__1bwqb44._.js.map +1 -0
  548. package/.next/server/chunks/[root-of-the-server]__1d6w22k._.js +3 -0
  549. package/.next/server/chunks/[root-of-the-server]__1d6w22k._.js.map +1 -0
  550. package/.next/server/chunks/[root-of-the-server]__1d9wmd_._.js +3 -0
  551. package/.next/server/chunks/[root-of-the-server]__1d9wmd_._.js.map +1 -0
  552. package/.next/server/chunks/[root-of-the-server]__1j25n4-._.js +5 -0
  553. package/.next/server/chunks/[root-of-the-server]__1j25n4-._.js.map +1 -0
  554. package/.next/server/chunks/[root-of-the-server]__1jtw_i1._.js +3 -0
  555. package/.next/server/chunks/[root-of-the-server]__1jtw_i1._.js.map +1 -0
  556. package/.next/server/chunks/[root-of-the-server]__1lv6sqm._.js +3 -0
  557. package/.next/server/chunks/[root-of-the-server]__1lv6sqm._.js.map +1 -0
  558. package/.next/server/chunks/[root-of-the-server]__1m2v05v._.js +3 -0
  559. package/.next/server/chunks/[root-of-the-server]__1m2v05v._.js.map +1 -0
  560. package/.next/server/chunks/[root-of-the-server]__1n-kcwj._.js +3 -0
  561. package/.next/server/chunks/[root-of-the-server]__1n-kcwj._.js.map +1 -0
  562. package/.next/server/chunks/[root-of-the-server]__1nn9crd._.js +3 -0
  563. package/.next/server/chunks/[root-of-the-server]__1nn9crd._.js.map +1 -0
  564. package/.next/server/chunks/[root-of-the-server]__1rimo-u._.js +3 -0
  565. package/.next/server/chunks/[root-of-the-server]__1rimo-u._.js.map +1 -0
  566. package/.next/server/chunks/[root-of-the-server]__1sb7b9b._.js +9 -0
  567. package/.next/server/chunks/[root-of-the-server]__1sb7b9b._.js.map +1 -0
  568. package/.next/server/chunks/[root-of-the-server]__1t2egm-._.js +9 -0
  569. package/.next/server/chunks/[root-of-the-server]__1t2egm-._.js.map +1 -0
  570. package/.next/server/chunks/[root-of-the-server]__1t3s3-y._.js +3 -0
  571. package/.next/server/chunks/[root-of-the-server]__1t3s3-y._.js.map +1 -0
  572. package/.next/server/chunks/[root-of-the-server]__1tab6-_._.js +3 -0
  573. package/.next/server/chunks/[root-of-the-server]__1tab6-_._.js.map +1 -0
  574. package/.next/server/chunks/[root-of-the-server]__1v3_x0a._.js +3 -0
  575. package/.next/server/chunks/[root-of-the-server]__1v3_x0a._.js.map +1 -0
  576. package/.next/server/chunks/[root-of-the-server]__1vq6_bb._.js +3 -0
  577. package/.next/server/chunks/[root-of-the-server]__1vq6_bb._.js.map +1 -0
  578. package/.next/server/chunks/[root-of-the-server]__1xfg6n4._.js +3 -0
  579. package/.next/server/chunks/[root-of-the-server]__1xfg6n4._.js.map +1 -0
  580. package/.next/server/chunks/[root-of-the-server]__1y_g68p._.js +3 -0
  581. package/.next/server/chunks/[root-of-the-server]__1y_g68p._.js.map +1 -0
  582. package/.next/server/chunks/[turbopack]_runtime.js +903 -0
  583. package/.next/server/chunks/[turbopack]_runtime.js.map +11 -0
  584. package/.next/server/chunks/_0-k8r4o._.js +3 -0
  585. package/.next/server/chunks/_0-k8r4o._.js.map +1 -0
  586. package/.next/server/chunks/_00drqg3._.js +3 -0
  587. package/.next/server/chunks/_00drqg3._.js.map +1 -0
  588. package/.next/server/chunks/_04_hx58._.js +3 -0
  589. package/.next/server/chunks/_04_hx58._.js.map +1 -0
  590. package/.next/server/chunks/_0bj_zep._.js +3 -0
  591. package/.next/server/chunks/_0bj_zep._.js.map +1 -0
  592. package/.next/server/chunks/_0d9p87n._.js +3 -0
  593. package/.next/server/chunks/_0d9p87n._.js.map +1 -0
  594. package/.next/server/chunks/_0uzzk4s._.js +3 -0
  595. package/.next/server/chunks/_0uzzk4s._.js.map +1 -0
  596. package/.next/server/chunks/_0x--pb9._.js +3 -0
  597. package/.next/server/chunks/_0x--pb9._.js.map +1 -0
  598. package/.next/server/chunks/_1-006gs._.js +11 -0
  599. package/.next/server/chunks/_1-006gs._.js.map +1 -0
  600. package/.next/server/chunks/_1gmut2r._.js +3 -0
  601. package/.next/server/chunks/_1gmut2r._.js.map +1 -0
  602. package/.next/server/chunks/_1h7jba5._.js +3 -0
  603. package/.next/server/chunks/_1h7jba5._.js.map +1 -0
  604. package/.next/server/chunks/_1p13_nj._.js +3 -0
  605. package/.next/server/chunks/_1p13_nj._.js.map +1 -0
  606. package/.next/server/chunks/_1v92m46._.js +11 -0
  607. package/.next/server/chunks/_1v92m46._.js.map +1 -0
  608. package/.next/server/chunks/_next-internal_server_app_api_code-graph_position_route_actions_0ddmfq8.js +3 -0
  609. package/.next/server/chunks/_next-internal_server_app_api_code-graph_position_route_actions_0ddmfq8.js.map +1 -0
  610. package/.next/server/chunks/_next-internal_server_app_api_code-graph_route_actions_107oiy1.js +3 -0
  611. package/.next/server/chunks/_next-internal_server_app_api_code-graph_route_actions_107oiy1.js.map +1 -0
  612. package/.next/server/chunks/_next-internal_server_app_api_context_embed-backfill_route_actions_0fddf11.js +3 -0
  613. package/.next/server/chunks/_next-internal_server_app_api_context_embed-backfill_route_actions_0fddf11.js.map +1 -0
  614. package/.next/server/chunks/_next-internal_server_app_api_context_feature_route_actions_0g4_r0t.js +3 -0
  615. package/.next/server/chunks/_next-internal_server_app_api_context_feature_route_actions_0g4_r0t.js.map +1 -0
  616. package/.next/server/chunks/_next-internal_server_app_api_context_file_route_actions_1v15k33.js +3 -0
  617. package/.next/server/chunks/_next-internal_server_app_api_context_file_route_actions_1v15k33.js.map +1 -0
  618. package/.next/server/chunks/_next-internal_server_app_api_context_route_actions_066vuc0.js +3 -0
  619. package/.next/server/chunks/_next-internal_server_app_api_context_route_actions_066vuc0.js.map +1 -0
  620. package/.next/server/chunks/_next-internal_server_app_api_db_backfill-access_route_actions_0krkam5.js +3 -0
  621. package/.next/server/chunks/_next-internal_server_app_api_db_backfill-access_route_actions_0krkam5.js.map +1 -0
  622. package/.next/server/chunks/_next-internal_server_app_api_db_position_route_actions_0y81s5h.js +3 -0
  623. package/.next/server/chunks/_next-internal_server_app_api_db_position_route_actions_0y81s5h.js.map +1 -0
  624. package/.next/server/chunks/_next-internal_server_app_api_db_reconcile-endpoints_route_actions_11wjo3_.js +3 -0
  625. package/.next/server/chunks/_next-internal_server_app_api_db_reconcile-endpoints_route_actions_11wjo3_.js.map +1 -0
  626. package/.next/server/chunks/_next-internal_server_app_api_db_relations_[id]_route_actions_0ok7b-c.js +3 -0
  627. package/.next/server/chunks/_next-internal_server_app_api_db_relations_[id]_route_actions_0ok7b-c.js.map +1 -0
  628. package/.next/server/chunks/_next-internal_server_app_api_db_tables_[id]_route_actions_17b6_8p.js +3 -0
  629. package/.next/server/chunks/_next-internal_server_app_api_db_tables_[id]_route_actions_17b6_8p.js.map +1 -0
  630. package/.next/server/chunks/_next-internal_server_app_api_draft_approve_route_actions_12l1gql.js +3 -0
  631. package/.next/server/chunks/_next-internal_server_app_api_draft_approve_route_actions_12l1gql.js.map +1 -0
  632. package/.next/server/chunks/_next-internal_server_app_api_draft_route_actions_1y2euqt.js +3 -0
  633. package/.next/server/chunks/_next-internal_server_app_api_draft_route_actions_1y2euqt.js.map +1 -0
  634. package/.next/server/chunks/_next-internal_server_app_api_draft_status_route_actions_0imc7yr.js +3 -0
  635. package/.next/server/chunks/_next-internal_server_app_api_draft_status_route_actions_0imc7yr.js.map +1 -0
  636. package/.next/server/chunks/_next-internal_server_app_api_edges_[id]_route_actions_1rx28dy.js +3 -0
  637. package/.next/server/chunks/_next-internal_server_app_api_edges_[id]_route_actions_1rx28dy.js.map +1 -0
  638. package/.next/server/chunks/_next-internal_server_app_api_edges_route_actions_1i6-f0p.js +3 -0
  639. package/.next/server/chunks/_next-internal_server_app_api_edges_route_actions_1i6-f0p.js.map +1 -0
  640. package/.next/server/chunks/_next-internal_server_app_api_endpoints_[id]_route_actions_1hynl36.js +3 -0
  641. package/.next/server/chunks/_next-internal_server_app_api_endpoints_[id]_route_actions_1hynl36.js.map +1 -0
  642. package/.next/server/chunks/_next-internal_server_app_api_entities_route_actions_1jx0-vm.js +3 -0
  643. package/.next/server/chunks/_next-internal_server_app_api_entities_route_actions_1jx0-vm.js.map +1 -0
  644. package/.next/server/chunks/_next-internal_server_app_api_ingest_route_actions_1oz_9xc.js +3 -0
  645. package/.next/server/chunks/_next-internal_server_app_api_ingest_route_actions_1oz_9xc.js.map +1 -0
  646. package/.next/server/chunks/_next-internal_server_app_api_init_route_actions_00i08o0.js +3 -0
  647. package/.next/server/chunks/_next-internal_server_app_api_init_route_actions_00i08o0.js.map +1 -0
  648. package/.next/server/chunks/_next-internal_server_app_api_map_describe_route_actions_04m22-e.js +3 -0
  649. package/.next/server/chunks/_next-internal_server_app_api_map_describe_route_actions_04m22-e.js.map +1 -0
  650. package/.next/server/chunks/_next-internal_server_app_api_map_files_route_actions_1gsvfd9.js +3 -0
  651. package/.next/server/chunks/_next-internal_server_app_api_map_files_route_actions_1gsvfd9.js.map +1 -0
  652. package/.next/server/chunks/_next-internal_server_app_api_map_finish_route_actions_130bs5b.js +3 -0
  653. package/.next/server/chunks/_next-internal_server_app_api_map_finish_route_actions_130bs5b.js.map +1 -0
  654. package/.next/server/chunks/_next-internal_server_app_api_map_route_actions_1ylt-yg.js +3 -0
  655. package/.next/server/chunks/_next-internal_server_app_api_map_route_actions_1ylt-yg.js.map +1 -0
  656. package/.next/server/chunks/_next-internal_server_app_api_map_start_route_actions_1n4zdon.js +3 -0
  657. package/.next/server/chunks/_next-internal_server_app_api_map_start_route_actions_1n4zdon.js.map +1 -0
  658. package/.next/server/chunks/_next-internal_server_app_api_map_touch-active_route_actions_0wvoq-h.js +3 -0
  659. package/.next/server/chunks/_next-internal_server_app_api_map_touch-active_route_actions_0wvoq-h.js.map +1 -0
  660. package/.next/server/chunks/_next-internal_server_app_api_nodes_[id]_position_route_actions_0_695u2.js +3 -0
  661. package/.next/server/chunks/_next-internal_server_app_api_nodes_[id]_position_route_actions_0_695u2.js.map +1 -0
  662. package/.next/server/chunks/_next-internal_server_app_api_nodes_[id]_route_actions_017e_f3.js +3 -0
  663. package/.next/server/chunks/_next-internal_server_app_api_nodes_[id]_route_actions_017e_f3.js.map +1 -0
  664. package/.next/server/chunks/_next-internal_server_app_api_nodes_positions_route_actions_1pz3o9o.js +3 -0
  665. package/.next/server/chunks/_next-internal_server_app_api_nodes_positions_route_actions_1pz3o9o.js.map +1 -0
  666. package/.next/server/chunks/_next-internal_server_app_api_nodes_route_actions_0iuxxdu.js +3 -0
  667. package/.next/server/chunks/_next-internal_server_app_api_nodes_route_actions_0iuxxdu.js.map +1 -0
  668. package/.next/server/chunks/_next-internal_server_app_api_nodes_subtasks_route_actions_0uw715o.js +3 -0
  669. package/.next/server/chunks/_next-internal_server_app_api_nodes_subtasks_route_actions_0uw715o.js.map +1 -0
  670. package/.next/server/chunks/_next-internal_server_app_api_notes_[id]_route_actions_1kpl381.js +3 -0
  671. package/.next/server/chunks/_next-internal_server_app_api_notes_[id]_route_actions_1kpl381.js.map +1 -0
  672. package/.next/server/chunks/_next-internal_server_app_api_notes_route_actions_0mm_p_3.js +3 -0
  673. package/.next/server/chunks/_next-internal_server_app_api_notes_route_actions_0mm_p_3.js.map +1 -0
  674. package/.next/server/chunks/_next-internal_server_app_api_open_route_actions_1x77eq1.js +3 -0
  675. package/.next/server/chunks/_next-internal_server_app_api_open_route_actions_1x77eq1.js.map +1 -0
  676. package/.next/server/chunks/_next-internal_server_app_api_plan_annotations_route_actions_11aui44.js +3 -0
  677. package/.next/server/chunks/_next-internal_server_app_api_plan_annotations_route_actions_11aui44.js.map +1 -0
  678. package/.next/server/chunks/_next-internal_server_app_api_plan_approve_route_actions_06jkmnf.js +3 -0
  679. package/.next/server/chunks/_next-internal_server_app_api_plan_approve_route_actions_06jkmnf.js.map +1 -0
  680. package/.next/server/chunks/_next-internal_server_app_api_plan_history_route_actions_17hqx0m.js +3 -0
  681. package/.next/server/chunks/_next-internal_server_app_api_plan_history_route_actions_17hqx0m.js.map +1 -0
  682. package/.next/server/chunks/_next-internal_server_app_api_plan_markdown_route_actions_1qb1-9r.js +3 -0
  683. package/.next/server/chunks/_next-internal_server_app_api_plan_markdown_route_actions_1qb1-9r.js.map +1 -0
  684. package/.next/server/chunks/_next-internal_server_app_api_plan_presence_route_actions_1r91k5c.js +3 -0
  685. package/.next/server/chunks/_next-internal_server_app_api_plan_presence_route_actions_1r91k5c.js.map +1 -0
  686. package/.next/server/chunks/_next-internal_server_app_api_plan_route_actions_1_nzr8r.js +3 -0
  687. package/.next/server/chunks/_next-internal_server_app_api_plan_route_actions_1_nzr8r.js.map +1 -0
  688. package/.next/server/chunks/_next-internal_server_app_api_plan_verdict_route_actions_10xm0j8.js +3 -0
  689. package/.next/server/chunks/_next-internal_server_app_api_plan_verdict_route_actions_10xm0j8.js.map +1 -0
  690. package/.next/server/chunks/_next-internal_server_app_api_preferences_route_actions_14__a0r.js +3 -0
  691. package/.next/server/chunks/_next-internal_server_app_api_preferences_route_actions_14__a0r.js.map +1 -0
  692. package/.next/server/chunks/_next-internal_server_app_api_reset_route_actions_1tcp2ms.js +3 -0
  693. package/.next/server/chunks/_next-internal_server_app_api_reset_route_actions_1tcp2ms.js.map +1 -0
  694. package/.next/server/chunks/_next-internal_server_app_api_settings_route_actions_1bpm9ac.js +3 -0
  695. package/.next/server/chunks/_next-internal_server_app_api_settings_route_actions_1bpm9ac.js.map +1 -0
  696. package/.next/server/chunks/_next-internal_server_app_api_stream_route_actions_0oy6g75.js +3 -0
  697. package/.next/server/chunks/_next-internal_server_app_api_stream_route_actions_0oy6g75.js.map +1 -0
  698. package/.next/server/chunks/_next-internal_server_app_api_version_route_actions_0kbx30h.js +3 -0
  699. package/.next/server/chunks/_next-internal_server_app_api_version_route_actions_0kbx30h.js.map +1 -0
  700. package/.next/server/chunks/_next-internal_server_app_api_workspace_activate_route_actions_1hv2y82.js +3 -0
  701. package/.next/server/chunks/_next-internal_server_app_api_workspace_activate_route_actions_1hv2y82.js.map +1 -0
  702. package/.next/server/chunks/_next-internal_server_app_api_workspace_route_actions_19-xkal.js +3 -0
  703. package/.next/server/chunks/_next-internal_server_app_api_workspace_route_actions_19-xkal.js.map +1 -0
  704. package/.next/server/chunks/_next-internal_server_app_apple-icon_png_route_actions_0jcl8au.js +3 -0
  705. package/.next/server/chunks/_next-internal_server_app_apple-icon_png_route_actions_0jcl8au.js.map +1 -0
  706. package/.next/server/chunks/_next-internal_server_app_icon_svg_route_actions_1r2h_ub.js +3 -0
  707. package/.next/server/chunks/_next-internal_server_app_icon_svg_route_actions_1r2h_ub.js.map +1 -0
  708. package/.next/server/chunks/instrumentation_ts_1oq3o45._.js +3 -0
  709. package/.next/server/chunks/instrumentation_ts_1oq3o45._.js.map +1 -0
  710. package/.next/server/chunks/lib_04zrdtl._.js +3 -0
  711. package/.next/server/chunks/lib_04zrdtl._.js.map +1 -0
  712. package/.next/server/chunks/lib_0rad2y6._.js +3 -0
  713. package/.next/server/chunks/lib_0rad2y6._.js.map +1 -0
  714. package/.next/server/chunks/lib_10tibe8._.js +7 -0
  715. package/.next/server/chunks/lib_10tibe8._.js.map +1 -0
  716. package/.next/server/chunks/lib_1upr0dj._.js +3 -0
  717. package/.next/server/chunks/lib_1upr0dj._.js.map +1 -0
  718. package/.next/server/chunks/lib_1wz-3od._.js +3 -0
  719. package/.next/server/chunks/lib_1wz-3od._.js.map +1 -0
  720. package/.next/server/chunks/lib_1xzwro7._.js +3 -0
  721. package/.next/server/chunks/lib_1xzwro7._.js.map +1 -0
  722. package/.next/server/chunks/lib_db_ts_0h_yn5m._.js +3 -0
  723. package/.next/server/chunks/lib_db_ts_0h_yn5m._.js.map +1 -0
  724. package/.next/server/chunks/lib_drizzle_provision_ts_1po9dyo._.js +3 -0
  725. package/.next/server/chunks/lib_drizzle_provision_ts_1po9dyo._.js.map +1 -0
  726. package/.next/server/chunks/lib_drizzle_schema_ts_0ixydnz._.js +3 -0
  727. package/.next/server/chunks/lib_drizzle_schema_ts_0ixydnz._.js.map +1 -0
  728. package/.next/server/chunks/lib_roadmap-force-layout_ts_0e5r3g2._.js +3 -0
  729. package/.next/server/chunks/lib_roadmap-force-layout_ts_0e5r3g2._.js.map +1 -0
  730. package/.next/server/chunks/node_modules_drizzle-orm_05n3ooz._.js +3 -0
  731. package/.next/server/chunks/node_modules_drizzle-orm_05n3ooz._.js.map +1 -0
  732. package/.next/server/chunks/node_modules_drizzle-orm_0cht0an._.js +3 -0
  733. package/.next/server/chunks/node_modules_drizzle-orm_0cht0an._.js.map +1 -0
  734. package/.next/server/chunks/node_modules_drizzle-orm_0ma7f2e._.js +4 -0
  735. package/.next/server/chunks/node_modules_drizzle-orm_0ma7f2e._.js.map +1 -0
  736. package/.next/server/chunks/node_modules_drizzle-orm_0q0hg2u._.js +4 -0
  737. package/.next/server/chunks/node_modules_drizzle-orm_0q0hg2u._.js.map +1 -0
  738. package/.next/server/chunks/node_modules_drizzle-orm_0rs3wbv._.js +3 -0
  739. package/.next/server/chunks/node_modules_drizzle-orm_0rs3wbv._.js.map +1 -0
  740. package/.next/server/chunks/node_modules_drizzle-orm_index_1qnscv7.js +3 -0
  741. package/.next/server/chunks/node_modules_drizzle-orm_index_1qnscv7.js.map +1 -0
  742. package/.next/server/chunks/node_modules_drizzle-orm_libsql_0yabams._.js +15 -0
  743. package/.next/server/chunks/node_modules_drizzle-orm_libsql_0yabams._.js.map +1 -0
  744. package/.next/server/chunks/node_modules_next_08s853w._.js +13 -0
  745. package/.next/server/chunks/node_modules_next_08s853w._.js.map +1 -0
  746. package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0qz67ql.js +3 -0
  747. package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0qz67ql.js.map +1 -0
  748. package/.next/server/chunks/node_modules_zod_v4_classic_external_1-pw2v2.js +64 -0
  749. package/.next/server/chunks/node_modules_zod_v4_classic_external_1-pw2v2.js.map +1 -0
  750. package/.next/server/chunks/ssr/[externals]_@huggingface_transformers_05bd-zz._.js +3 -0
  751. package/.next/server/chunks/ssr/[externals]_@huggingface_transformers_05bd-zz._.js.map +1 -0
  752. package/.next/server/chunks/ssr/[root-of-the-server]__00vz2sw._.js +3 -0
  753. package/.next/server/chunks/ssr/[root-of-the-server]__00vz2sw._.js.map +1 -0
  754. package/.next/server/chunks/ssr/[root-of-the-server]__07b655z._.js +3 -0
  755. package/.next/server/chunks/ssr/[root-of-the-server]__07b655z._.js.map +1 -0
  756. package/.next/server/chunks/ssr/[root-of-the-server]__0dr0a32._.js +3 -0
  757. package/.next/server/chunks/ssr/[root-of-the-server]__0dr0a32._.js.map +1 -0
  758. package/.next/server/chunks/ssr/[root-of-the-server]__0jx25ik._.js +3 -0
  759. package/.next/server/chunks/ssr/[root-of-the-server]__0jx25ik._.js.map +1 -0
  760. package/.next/server/chunks/ssr/[root-of-the-server]__0nqskgw._.js +19 -0
  761. package/.next/server/chunks/ssr/[root-of-the-server]__0nqskgw._.js.map +1 -0
  762. package/.next/server/chunks/ssr/[root-of-the-server]__0pkeb0m._.js +9 -0
  763. package/.next/server/chunks/ssr/[root-of-the-server]__0pkeb0m._.js.map +1 -0
  764. package/.next/server/chunks/ssr/[root-of-the-server]__0s74gvr._.js +3 -0
  765. package/.next/server/chunks/ssr/[root-of-the-server]__0s74gvr._.js.map +1 -0
  766. package/.next/server/chunks/ssr/[root-of-the-server]__0v7a-e-._.js +3 -0
  767. package/.next/server/chunks/ssr/[root-of-the-server]__0v7a-e-._.js.map +1 -0
  768. package/.next/server/chunks/ssr/[root-of-the-server]__0x4-71n._.js +3 -0
  769. package/.next/server/chunks/ssr/[root-of-the-server]__0x4-71n._.js.map +1 -0
  770. package/.next/server/chunks/ssr/[root-of-the-server]__0xqf488._.js +3 -0
  771. package/.next/server/chunks/ssr/[root-of-the-server]__0xqf488._.js.map +1 -0
  772. package/.next/server/chunks/ssr/[root-of-the-server]__0y_88xg._.js +33 -0
  773. package/.next/server/chunks/ssr/[root-of-the-server]__0y_88xg._.js.map +1 -0
  774. package/.next/server/chunks/ssr/[root-of-the-server]__1-yyv5l._.js +3 -0
  775. package/.next/server/chunks/ssr/[root-of-the-server]__1-yyv5l._.js.map +1 -0
  776. package/.next/server/chunks/ssr/[root-of-the-server]__1366qju._.js +3 -0
  777. package/.next/server/chunks/ssr/[root-of-the-server]__1366qju._.js.map +1 -0
  778. package/.next/server/chunks/ssr/[root-of-the-server]__1_ustu7._.js +3 -0
  779. package/.next/server/chunks/ssr/[root-of-the-server]__1_ustu7._.js.map +1 -0
  780. package/.next/server/chunks/ssr/[root-of-the-server]__1dky4g0._.js +33 -0
  781. package/.next/server/chunks/ssr/[root-of-the-server]__1dky4g0._.js.map +1 -0
  782. package/.next/server/chunks/ssr/[turbopack]_runtime.js +903 -0
  783. package/.next/server/chunks/ssr/[turbopack]_runtime.js.map +11 -0
  784. package/.next/server/chunks/ssr/_0eabx1f._.js +3 -0
  785. package/.next/server/chunks/ssr/_0eabx1f._.js.map +1 -0
  786. package/.next/server/chunks/ssr/_0ni84yi._.js +3 -0
  787. package/.next/server/chunks/ssr/_0ni84yi._.js.map +1 -0
  788. package/.next/server/chunks/ssr/_0pgw716._.js +67 -0
  789. package/.next/server/chunks/ssr/_0pgw716._.js.map +1 -0
  790. package/.next/server/chunks/ssr/_0r84jcg._.js +6 -0
  791. package/.next/server/chunks/ssr/_0r84jcg._.js.map +1 -0
  792. package/.next/server/chunks/ssr/_15if8ma._.js +3 -0
  793. package/.next/server/chunks/ssr/_15if8ma._.js.map +1 -0
  794. package/.next/server/chunks/ssr/_176djsq._.js +4 -0
  795. package/.next/server/chunks/ssr/_176djsq._.js.map +1 -0
  796. package/.next/server/chunks/ssr/_179xsho._.js +3 -0
  797. package/.next/server/chunks/ssr/_179xsho._.js.map +1 -0
  798. package/.next/server/chunks/ssr/_1_n8arv._.js +3 -0
  799. package/.next/server/chunks/ssr/_1_n8arv._.js.map +1 -0
  800. package/.next/server/chunks/ssr/_1suxp_q._.js +3 -0
  801. package/.next/server/chunks/ssr/_1suxp_q._.js.map +1 -0
  802. package/.next/server/chunks/ssr/_1vt70iy._.js +18 -0
  803. package/.next/server/chunks/ssr/_1vt70iy._.js.map +1 -0
  804. package/.next/server/chunks/ssr/_1w2komx._.js +3 -0
  805. package/.next/server/chunks/ssr/_1w2komx._.js.map +1 -0
  806. package/.next/server/chunks/ssr/_1w73gpg._.js +4 -0
  807. package/.next/server/chunks/ssr/_1w73gpg._.js.map +1 -0
  808. package/.next/server/chunks/ssr/_next-internal_server_app__global-error_page_actions_0zi5s8-.js +3 -0
  809. package/.next/server/chunks/ssr/_next-internal_server_app__global-error_page_actions_0zi5s8-.js.map +1 -0
  810. package/.next/server/chunks/ssr/_next-internal_server_app__not-found_page_actions_0pt47yr.js +3 -0
  811. package/.next/server/chunks/ssr/_next-internal_server_app__not-found_page_actions_0pt47yr.js.map +1 -0
  812. package/.next/server/chunks/ssr/_next-internal_server_app_help_page_actions_04daq_g.js +3 -0
  813. package/.next/server/chunks/ssr/_next-internal_server_app_help_page_actions_04daq_g.js.map +1 -0
  814. package/.next/server/chunks/ssr/_next-internal_server_app_page_actions_0hhsz1j.js +3 -0
  815. package/.next/server/chunks/ssr/_next-internal_server_app_page_actions_0hhsz1j.js.map +1 -0
  816. package/.next/server/chunks/ssr/_next-internal_server_app_settings_page_actions_11x4dq5.js +3 -0
  817. package/.next/server/chunks/ssr/_next-internal_server_app_settings_page_actions_11x4dq5.js.map +1 -0
  818. package/.next/server/chunks/ssr/components_1wolv70._.js +157 -0
  819. package/.next/server/chunks/ssr/components_1wolv70._.js.map +1 -0
  820. package/.next/server/chunks/ssr/components_graph_files-map-client_tsx_10bha9z._.js +3 -0
  821. package/.next/server/chunks/ssr/components_graph_files-map-client_tsx_10bha9z._.js.map +1 -0
  822. package/.next/server/chunks/ssr/components_landing_landing_tsx_1_9k5z7._.js +3 -0
  823. package/.next/server/chunks/ssr/components_landing_landing_tsx_1_9k5z7._.js.map +1 -0
  824. package/.next/server/chunks/ssr/components_plan_plan-workspace_tsx_0t1topu._.js +3 -0
  825. package/.next/server/chunks/ssr/components_plan_plan-workspace_tsx_0t1topu._.js.map +1 -0
  826. package/.next/server/chunks/ssr/lib_13g58ln._.js +3 -0
  827. package/.next/server/chunks/ssr/lib_13g58ln._.js.map +1 -0
  828. package/.next/server/chunks/ssr/lib_db_ts_0bo045t._.js +3 -0
  829. package/.next/server/chunks/ssr/lib_db_ts_0bo045t._.js.map +1 -0
  830. package/.next/server/chunks/ssr/lib_drizzle_schema_ts_0oz5uob._.js +3 -0
  831. package/.next/server/chunks/ssr/lib_drizzle_schema_ts_0oz5uob._.js.map +1 -0
  832. package/.next/server/chunks/ssr/node_modules_0h91jdk._.js +33 -0
  833. package/.next/server/chunks/ssr/node_modules_0h91jdk._.js.map +1 -0
  834. package/.next/server/chunks/ssr/node_modules_0vtauab._.js +3 -0
  835. package/.next/server/chunks/ssr/node_modules_0vtauab._.js.map +1 -0
  836. package/.next/server/chunks/ssr/node_modules_drizzle-orm_0txo559._.js +4 -0
  837. package/.next/server/chunks/ssr/node_modules_drizzle-orm_0txo559._.js.map +1 -0
  838. package/.next/server/chunks/ssr/node_modules_drizzle-orm_1d7zgzr._.js +4 -0
  839. package/.next/server/chunks/ssr/node_modules_drizzle-orm_1d7zgzr._.js.map +1 -0
  840. package/.next/server/chunks/ssr/node_modules_drizzle-orm_1zqkwdy._.js +3 -0
  841. package/.next/server/chunks/ssr/node_modules_drizzle-orm_1zqkwdy._.js.map +1 -0
  842. package/.next/server/chunks/ssr/node_modules_drizzle-orm_202ujxv._.js +3 -0
  843. package/.next/server/chunks/ssr/node_modules_drizzle-orm_202ujxv._.js.map +1 -0
  844. package/.next/server/chunks/ssr/node_modules_drizzle-orm_index_0ji3_g8.js +3 -0
  845. package/.next/server/chunks/ssr/node_modules_drizzle-orm_index_0ji3_g8.js.map +1 -0
  846. package/.next/server/chunks/ssr/node_modules_drizzle-orm_libsql_06opikx._.js +15 -0
  847. package/.next/server/chunks/ssr/node_modules_drizzle-orm_libsql_06opikx._.js.map +1 -0
  848. package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_shield-check_mjs_1cccgdy._.js +3 -0
  849. package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_shield-check_mjs_1cccgdy._.js.map +1 -0
  850. package/.next/server/chunks/ssr/node_modules_next_dist_0890nbp._.js +3 -0
  851. package/.next/server/chunks/ssr/node_modules_next_dist_0890nbp._.js.map +1 -0
  852. package/.next/server/chunks/ssr/node_modules_next_dist_0airgni._.js +3 -0
  853. package/.next/server/chunks/ssr/node_modules_next_dist_0airgni._.js.map +1 -0
  854. package/.next/server/chunks/ssr/node_modules_next_dist_0alesp5._.js +3 -0
  855. package/.next/server/chunks/ssr/node_modules_next_dist_0alesp5._.js.map +1 -0
  856. package/.next/server/chunks/ssr/node_modules_next_dist_0uboya6._.js +6 -0
  857. package/.next/server/chunks/ssr/node_modules_next_dist_0uboya6._.js.map +1 -0
  858. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_0wpq8j3._.js +3 -0
  859. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_0wpq8j3._.js.map +1 -0
  860. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_forbidden_0symwr9.js +3 -0
  861. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_forbidden_0symwr9.js.map +1 -0
  862. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_0-o-goa.js +3 -0
  863. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_0-o-goa.js.map +1 -0
  864. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_unauthorized_0l_sp0x.js +3 -0
  865. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_unauthorized_0l_sp0x.js.map +1 -0
  866. package/.next/server/chunks/ssr/node_modules_next_dist_compiled_@opentelemetry_api_index_1oy1nwh.js +3 -0
  867. package/.next/server/chunks/ssr/node_modules_next_dist_compiled_@opentelemetry_api_index_1oy1nwh.js.map +1 -0
  868. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0d7qbqa.js +4 -0
  869. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0d7qbqa.js.map +1 -0
  870. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0s87tpk.js +4 -0
  871. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0s87tpk.js.map +1 -0
  872. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_114qdo2.js +4 -0
  873. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_114qdo2.js.map +1 -0
  874. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_19--w_z.js +4 -0
  875. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_19--w_z.js.map +1 -0
  876. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_19_kztz.js +4 -0
  877. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_19_kztz.js.map +1 -0
  878. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_19qzf81.js +4 -0
  879. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_19qzf81.js.map +1 -0
  880. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1wge0av.js +4 -0
  881. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1wge0av.js.map +1 -0
  882. package/.next/server/edge/chunks/_0o_tvsk._.js +3 -0
  883. package/.next/server/edge/chunks/_0o_tvsk._.js.map +1 -0
  884. package/.next/server/edge/chunks/node_modules_next_dist_esm_build_templates_edge-wrapper_1ipl-lx.js.map +1 -0
  885. package/.next/server/edge/chunks/turbopack-node_modules_next_dist_esm_build_templates_edge-wrapper_1ipl-lx.js +3 -0
  886. package/.next/server/functions-config-manifest.json +14 -0
  887. package/.next/server/instrumentation/middleware-manifest.json +12 -0
  888. package/.next/server/instrumentation.js +4 -0
  889. package/.next/server/instrumentation.js.map +5 -0
  890. package/.next/server/instrumentation.js.nft.json +1 -0
  891. package/.next/server/interception-route-rewrite-manifest.js +1 -0
  892. package/.next/server/middleware/middleware-manifest.json +6 -0
  893. package/.next/server/middleware-build-manifest.js +21 -0
  894. package/.next/server/middleware-manifest.json +6 -0
  895. package/.next/server/middleware.js +5 -0
  896. package/.next/server/middleware.js.map +5 -0
  897. package/.next/server/middleware.js.nft.json +1 -0
  898. package/.next/server/next-font-manifest.js +1 -0
  899. package/.next/server/next-font-manifest.json +31 -0
  900. package/.next/server/pages/404.html +1 -0
  901. package/.next/server/pages/500.html +1 -0
  902. package/.next/server/pages-manifest.json +4 -0
  903. package/.next/server/prefetch-hints.json +1 -0
  904. package/.next/server/server-reference-manifest.js +1 -0
  905. package/.next/server/server-reference-manifest.json +132 -0
  906. package/.next/static/_wmO3ZSrpuwty88NNlnrH/_buildManifest.js +11 -0
  907. package/.next/static/_wmO3ZSrpuwty88NNlnrH/_clientMiddlewareManifest.js +6 -0
  908. package/.next/static/_wmO3ZSrpuwty88NNlnrH/_ssgManifest.js +1 -0
  909. package/.next/static/chunks/01dkdyukbdpqq.js +31 -0
  910. package/.next/static/chunks/05-c3ty_6dwfk.js +1 -0
  911. package/.next/static/chunks/07u_h6i539_wj.js +2 -0
  912. package/.next/static/chunks/09wlenlnsbkl7.js +2 -0
  913. package/.next/static/chunks/0_9p121-4am0a.js +1 -0
  914. package/.next/static/chunks/0cz1d0mv5g_q7.js +1 -0
  915. package/.next/static/chunks/19cl65vz3pos0.js +1 -0
  916. package/.next/static/chunks/19hoowcssv0w1.css +1 -0
  917. package/.next/static/chunks/1bk_i_akra521.css +2 -0
  918. package/.next/static/chunks/1pp98vred9isg.js +1 -0
  919. package/.next/static/chunks/2-t6-hz_de2nr.js +155 -0
  920. package/.next/static/chunks/203o948823s96.css +1 -0
  921. package/.next/static/chunks/245vq4i7_x7tm.js +1 -0
  922. package/.next/static/chunks/27jktro2p5rq9.js +4 -0
  923. package/.next/static/chunks/2hpdskhtooxl4.js +1 -0
  924. package/.next/static/chunks/368etk_9oovhj.js +1 -0
  925. package/.next/static/chunks/3n7dm2ojtyzwn.js +1 -0
  926. package/.next/static/chunks/3oc95d6bep78a.css +1 -0
  927. package/.next/static/chunks/3qp8f4catg9zw.js +2 -0
  928. package/.next/static/chunks/3ywpldblg905c.js +1 -0
  929. package/.next/static/chunks/4397avi9yar6d.js +1 -0
  930. package/.next/static/chunks/44_nvrzzjs0pv.js +1 -0
  931. package/.next/static/chunks/turbopack-0rldyqi2kcq2j.js +1 -0
  932. package/.next/static/media/4fa387ec64143e14-s.2tuy5pz7dlieh.woff2 +0 -0
  933. package/.next/static/media/53b9e256198e5412-s.390ncx5urfkfu.woff2 +0 -0
  934. package/.next/static/media/5ce348bf30bf5439-s.31988l_ccedte.woff2 +0 -0
  935. package/.next/static/media/6306c77e7c8268e4-s.2dbetqa9o8jxf.woff2 +0 -0
  936. package/.next/static/media/7178b3e590c64307-s.21jp631_3pja2.woff2 +0 -0
  937. package/.next/static/media/797e433ab948586e-s.p.0r6juujl39pe6.woff2 +0 -0
  938. package/.next/static/media/7d817b4c03b0c5f1-s.1uyisp29ctx0d.woff2 +0 -0
  939. package/.next/static/media/8a480f0b521d4e75-s.1qq4vpdcun5oj.woff2 +0 -0
  940. package/.next/static/media/apple-icon.0qbqv4vpdxdo0.png +0 -0
  941. package/.next/static/media/bbc41e54d2fcbd21-s.1rgnod-3esatf.woff2 +0 -0
  942. package/.next/static/media/caa3a2e1cccd8315-s.p.0wgildi0cnwt9.woff2 +0 -0
  943. package/.next/static/media/fef07dbb0973bf53-s.3p2_lha1f2xer.woff2 +0 -0
  944. package/.next/static/media/icon.23_qbw6oy1xqy.svg +4 -0
  945. package/.next/trace +2 -0
  946. package/.next/trace-build +1 -0
  947. package/.next/turbopack +0 -0
  948. package/.next/types/cache-life.d.ts +145 -0
  949. package/.next/types/routes.d.ts +124 -0
  950. package/.next/types/validator.ts +538 -0
  951. package/README.md +94 -0
  952. package/dist/bin/beacon.js +10 -0
  953. package/dist/bin/doctor.js +227 -0
  954. package/dist/bin/hook.js +225 -0
  955. package/dist/bin/mcp.js +247 -0
  956. package/dist/bin/plan.js +228 -0
  957. package/dist/bin/prompt.js +4 -0
  958. package/dist/bin/stop-hook.js +5 -0
  959. package/dist/bin/uninstall.js +228 -0
  960. package/dist/lib/assets.js +192 -0
  961. package/dist/lib/global-install.js +224 -0
  962. package/dist/lib/workspaces.js +2 -0
  963. package/drizzle/0000_bitter_network.sql +230 -0
  964. package/drizzle/meta/0000_snapshot.json +1589 -0
  965. package/drizzle/meta/_journal.json +13 -0
  966. package/next.config.ts +15 -0
  967. package/package.json +90 -0
  968. package/public/brand/beacon-apple.svg +30 -0
  969. package/public/brand/beacon-glyph-128.png +0 -0
  970. package/public/brand/beacon-glyph-512.png +0 -0
  971. package/public/brand/beacon-glyph-mono-128.png +0 -0
  972. package/public/brand/beacon-glyph-mono-512.png +0 -0
  973. package/public/brand/beacon-glyph-mono.svg +4 -0
  974. package/public/brand/beacon-glyph.svg +21 -0
  975. package/public/brand/beacon-icon-1024.png +0 -0
  976. package/public/brand/beacon-icon-192.png +0 -0
  977. package/public/brand/beacon-icon-256.png +0 -0
  978. package/public/brand/beacon-icon-32.png +0 -0
  979. package/public/brand/beacon-icon-512.png +0 -0
  980. package/public/brand/beacon-icon-64.png +0 -0
  981. package/public/brand/beacon-icon-light-192.png +0 -0
  982. package/public/brand/beacon-icon-light-512.png +0 -0
  983. package/public/brand/beacon-icon-light.svg +31 -0
  984. package/public/brand/beacon-icon.svg +33 -0
  985. package/public/brand/beacon-wordmark-1200.png +0 -0
  986. package/public/brand/beacon-wordmark.svg +38 -0
  987. package/public/brand/favicon-16.png +0 -0
  988. package/public/brand/favicon-32.png +0 -0
  989. package/public/file.svg +1 -0
  990. package/public/globe.svg +1 -0
  991. package/public/install.sh +55 -0
  992. package/public/next.svg +1 -0
  993. package/public/vercel.svg +1 -0
  994. package/public/window.svg +1 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../node_modules/chokidar/index.js","../../../node_modules/readdirp/index.js","../../../node_modules/chokidar/handler.js","../../../intel/extractors/code-graph.ts","../../../intel/extractors/languages/ts.ts","../../../intel/extractors/languages/python.ts","../../../intel/extractors/languages/go.ts","../../../intel/extractors/languages/rust.ts","../../../intel/extractors/languages/fallback.ts","../../../intel/extractors/languages/index.ts","../../../intel/watch-inline.ts","../../../intel/watch-manager.ts"],"sourcesContent":["/*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */\nimport { EventEmitter } from 'node:events';\nimport { stat as statcb, Stats } from 'node:fs';\nimport { readdir, stat } from 'node:fs/promises';\nimport * as sp from 'node:path';\nimport { readdirp, ReaddirpStream } from 'readdirp';\nimport { EMPTY_FN, EVENTS as EV, isIBMi, isWindows, NodeFsHandler, STR_CLOSE, STR_END, } from './handler.js';\nconst SLASH = '/';\nconst SLASH_SLASH = '//';\nconst ONE_DOT = '.';\nconst TWO_DOTS = '..';\nconst STRING_TYPE = 'string';\nconst BACK_SLASH_RE = /\\\\/g;\nconst DOUBLE_SLASH_RE = /\\/\\//g;\nconst DOT_RE = /\\..*\\.(sw[px])$|~$|\\.subl.*\\.tmp/;\nconst REPLACER_RE = /^\\.[/\\\\]/;\nfunction arrify(item) {\n return Array.isArray(item) ? item : [item];\n}\nconst isMatcherObject = (matcher) => typeof matcher === 'object' && matcher !== null && !(matcher instanceof RegExp);\nfunction createPattern(matcher) {\n if (typeof matcher === 'function')\n return matcher;\n if (typeof matcher === 'string')\n return (string) => matcher === string;\n if (matcher instanceof RegExp)\n return (string) => matcher.test(string);\n if (typeof matcher === 'object' && matcher !== null) {\n return (string) => {\n if (matcher.path === string)\n return true;\n if (matcher.recursive) {\n const relative = sp.relative(matcher.path, string);\n if (!relative) {\n return false;\n }\n return !relative.startsWith('..') && !sp.isAbsolute(relative);\n }\n return false;\n };\n }\n return () => false;\n}\nfunction normalizePath(path) {\n if (typeof path !== 'string')\n throw new Error('string expected');\n path = sp.normalize(path);\n path = path.replace(/\\\\/g, '/');\n let prepend = false;\n if (path.startsWith('//'))\n prepend = true;\n path = path.replace(DOUBLE_SLASH_RE, '/');\n if (prepend)\n path = '/' + path;\n return path;\n}\nfunction matchPatterns(patterns, testString, stats) {\n const path = normalizePath(testString);\n for (let index = 0; index < patterns.length; index++) {\n const pattern = patterns[index];\n if (pattern(path, stats)) {\n return true;\n }\n }\n return false;\n}\nfunction anymatch(matchers, testString) {\n if (matchers == null) {\n throw new TypeError('anymatch: specify first argument');\n }\n // Early cache for matchers.\n const matchersArray = arrify(matchers);\n const patterns = matchersArray.map((matcher) => createPattern(matcher));\n if (testString == null) {\n return (testString, stats) => {\n return matchPatterns(patterns, testString, stats);\n };\n }\n return matchPatterns(patterns, testString);\n}\nconst unifyPaths = (paths_) => {\n const paths = arrify(paths_).flat();\n if (!paths.every((p) => typeof p === STRING_TYPE)) {\n throw new TypeError(`Non-string provided as watch path: ${paths}`);\n }\n return paths.map(normalizePathToUnix);\n};\n// If SLASH_SLASH occurs at the beginning of path, it is not replaced\n// because \"//StoragePC/DrivePool/Movies\" is a valid network path\nconst toUnix = (string) => {\n let str = string.replace(BACK_SLASH_RE, SLASH);\n let prepend = false;\n if (str.startsWith(SLASH_SLASH)) {\n prepend = true;\n }\n str = str.replace(DOUBLE_SLASH_RE, SLASH);\n if (prepend) {\n str = SLASH + str;\n }\n return str;\n};\n// Our version of upath.normalize\n// TODO: this is not equal to path-normalize module - investigate why\nconst normalizePathToUnix = (path) => toUnix(sp.normalize(toUnix(path)));\n// TODO: refactor\nconst normalizeIgnored = (cwd = '') => (path) => {\n if (typeof path === 'string') {\n return normalizePathToUnix(sp.isAbsolute(path) ? path : sp.join(cwd, path));\n }\n else {\n return path;\n }\n};\nconst getAbsolutePath = (path, cwd) => {\n if (sp.isAbsolute(path)) {\n return path;\n }\n return sp.join(cwd, path);\n};\nconst EMPTY_SET = Object.freeze(new Set());\n/**\n * Directory entry.\n */\nclass DirEntry {\n path;\n _removeWatcher;\n items;\n constructor(dir, removeWatcher) {\n this.path = dir;\n this._removeWatcher = removeWatcher;\n this.items = new Set();\n }\n add(item) {\n const { items } = this;\n if (!items)\n return;\n if (item !== ONE_DOT && item !== TWO_DOTS)\n items.add(item);\n }\n async remove(item) {\n const { items } = this;\n if (!items)\n return;\n items.delete(item);\n if (items.size > 0)\n return;\n const dir = this.path;\n try {\n await readdir(dir);\n }\n catch (err) {\n if (this._removeWatcher) {\n this._removeWatcher(sp.dirname(dir), sp.basename(dir));\n }\n }\n }\n has(item) {\n const { items } = this;\n if (!items)\n return;\n return items.has(item);\n }\n getChildren() {\n const { items } = this;\n if (!items)\n return [];\n return [...items.values()];\n }\n dispose() {\n this.items.clear();\n this.path = '';\n this._removeWatcher = EMPTY_FN;\n this.items = EMPTY_SET;\n Object.freeze(this);\n }\n}\nconst STAT_METHOD_F = 'stat';\nconst STAT_METHOD_L = 'lstat';\nexport class WatchHelper {\n fsw;\n path;\n watchPath;\n fullWatchPath;\n dirParts;\n followSymlinks;\n statMethod;\n constructor(path, follow, fsw) {\n this.fsw = fsw;\n const watchPath = path;\n this.path = path = path.replace(REPLACER_RE, '');\n this.watchPath = watchPath;\n this.fullWatchPath = sp.resolve(watchPath);\n this.dirParts = [];\n this.dirParts.forEach((parts) => {\n if (parts.length > 1)\n parts.pop();\n });\n this.followSymlinks = follow;\n this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L;\n }\n entryPath(entry) {\n return sp.join(this.watchPath, sp.relative(this.watchPath, entry.fullPath));\n }\n filterPath(entry) {\n const { stats } = entry;\n if (stats && stats.isSymbolicLink())\n return this.filterDir(entry);\n const resolvedPath = this.entryPath(entry);\n // TODO: what if stats is undefined? remove !\n return this.fsw._isntIgnored(resolvedPath, stats) && this.fsw._hasReadPermissions(stats);\n }\n filterDir(entry) {\n return this.fsw._isntIgnored(this.entryPath(entry), entry.stats);\n }\n}\n/**\n * Watches files & directories for changes. Emitted events:\n * `add`, `addDir`, `change`, `unlink`, `unlinkDir`, `all`, `error`\n *\n * new FSWatcher()\n * .add(directories)\n * .on('add', path => log('File', path, 'was added'))\n */\nexport class FSWatcher extends EventEmitter {\n closed;\n options;\n _closers;\n _ignoredPaths;\n _throttled;\n _streams;\n _symlinkPaths;\n _watched;\n _pendingWrites;\n _pendingUnlinks;\n _readyCount;\n _emitReady;\n _closePromise;\n _userIgnored;\n _readyEmitted;\n _emitRaw;\n _boundRemove;\n _nodeFsHandler;\n // Not indenting methods for history sake; for now.\n constructor(_opts = {}) {\n super();\n this.closed = false;\n this._closers = new Map();\n this._ignoredPaths = new Set();\n this._throttled = new Map();\n this._streams = new Set();\n this._symlinkPaths = new Map();\n this._watched = new Map();\n this._pendingWrites = new Map();\n this._pendingUnlinks = new Map();\n this._readyCount = 0;\n this._readyEmitted = false;\n const awf = _opts.awaitWriteFinish;\n const DEF_AWF = { stabilityThreshold: 2000, pollInterval: 100 };\n const opts = {\n // Defaults\n persistent: true,\n ignoreInitial: false,\n ignorePermissionErrors: false,\n interval: 100,\n binaryInterval: 300,\n followSymlinks: true,\n usePolling: false,\n // useAsync: false,\n atomic: true, // NOTE: overwritten later (depends on usePolling)\n ..._opts,\n // Change format\n ignored: _opts.ignored ? arrify(_opts.ignored) : arrify([]),\n awaitWriteFinish: awf === true ? DEF_AWF : typeof awf === 'object' ? { ...DEF_AWF, ...awf } : false,\n };\n // Always default to polling on IBM i because fs.watch() is not available on IBM i.\n if (isIBMi)\n opts.usePolling = true;\n // Editor atomic write normalization enabled by default with fs.watch\n if (opts.atomic === undefined)\n opts.atomic = !opts.usePolling;\n // opts.atomic = typeof _opts.atomic === 'number' ? _opts.atomic : 100;\n // Global override. Useful for developers, who need to force polling for all\n // instances of chokidar, regardless of usage / dependency depth\n const envPoll = process.env.CHOKIDAR_USEPOLLING;\n if (envPoll !== undefined) {\n const envLower = envPoll.toLowerCase();\n if (envLower === 'false' || envLower === '0')\n opts.usePolling = false;\n else if (envLower === 'true' || envLower === '1')\n opts.usePolling = true;\n else\n opts.usePolling = !!envLower;\n }\n const envInterval = process.env.CHOKIDAR_INTERVAL;\n if (envInterval)\n opts.interval = Number.parseInt(envInterval, 10);\n // This is done to emit ready only once, but each 'add' will increase that?\n let readyCalls = 0;\n this._emitReady = () => {\n readyCalls++;\n if (readyCalls >= this._readyCount) {\n this._emitReady = EMPTY_FN;\n this._readyEmitted = true;\n // use process.nextTick to allow time for listener to be bound\n process.nextTick(() => this.emit(EV.READY));\n }\n };\n this._emitRaw = (...args) => this.emit(EV.RAW, ...args);\n this._boundRemove = this._remove.bind(this);\n this.options = opts;\n this._nodeFsHandler = new NodeFsHandler(this);\n // You’re frozen when your heart’s not open.\n Object.freeze(opts);\n }\n _addIgnoredPath(matcher) {\n if (isMatcherObject(matcher)) {\n // return early if we already have a deeply equal matcher object\n for (const ignored of this._ignoredPaths) {\n if (isMatcherObject(ignored) &&\n ignored.path === matcher.path &&\n ignored.recursive === matcher.recursive) {\n return;\n }\n }\n }\n this._ignoredPaths.add(matcher);\n }\n _removeIgnoredPath(matcher) {\n this._ignoredPaths.delete(matcher);\n // now find any matcher objects with the matcher as path\n if (typeof matcher === 'string') {\n for (const ignored of this._ignoredPaths) {\n // TODO (43081j): make this more efficient.\n // probably just make a `this._ignoredDirectories` or some\n // such thing.\n if (isMatcherObject(ignored) && ignored.path === matcher) {\n this._ignoredPaths.delete(ignored);\n }\n }\n }\n }\n // Public methods\n /**\n * Adds paths to be watched on an existing FSWatcher instance.\n * @param paths_ file or file list. Other arguments are unused\n */\n add(paths_, _origAdd, _internal) {\n const { cwd } = this.options;\n this.closed = false;\n this._closePromise = undefined;\n let paths = unifyPaths(paths_);\n if (cwd) {\n paths = paths.map((path) => {\n const absPath = getAbsolutePath(path, cwd);\n // Check `path` instead of `absPath` because the cwd portion can't be a glob\n return absPath;\n });\n }\n paths.forEach((path) => {\n this._removeIgnoredPath(path);\n });\n this._userIgnored = undefined;\n if (!this._readyCount)\n this._readyCount = 0;\n this._readyCount += paths.length;\n Promise.all(paths.map(async (path) => {\n const res = await this._nodeFsHandler._addToNodeFs(path, !_internal, undefined, 0, _origAdd);\n if (res)\n this._emitReady();\n return res;\n })).then((results) => {\n if (this.closed)\n return;\n results.forEach((item) => {\n if (item)\n this.add(sp.dirname(item), sp.basename(_origAdd || item));\n });\n });\n return this;\n }\n /**\n * Close watchers or start ignoring events from specified paths.\n */\n unwatch(paths_) {\n if (this.closed)\n return this;\n const paths = unifyPaths(paths_);\n const { cwd } = this.options;\n paths.forEach((path) => {\n // convert to absolute path unless relative path already matches\n if (!sp.isAbsolute(path) && !this._closers.has(path)) {\n if (cwd)\n path = sp.join(cwd, path);\n path = sp.resolve(path);\n }\n this._closePath(path);\n this._addIgnoredPath(path);\n if (this._watched.has(path)) {\n this._addIgnoredPath({\n path,\n recursive: true,\n });\n }\n // reset the cached userIgnored anymatch fn\n // to make ignoredPaths changes effective\n this._userIgnored = undefined;\n });\n return this;\n }\n /**\n * Close watchers and remove all listeners from watched paths.\n */\n close() {\n if (this._closePromise) {\n return this._closePromise;\n }\n this.closed = true;\n // Memory management.\n this.removeAllListeners();\n const closers = [];\n this._closers.forEach((closerList) => closerList.forEach((closer) => {\n const promise = closer();\n if (promise instanceof Promise)\n closers.push(promise);\n }));\n this._streams.forEach((stream) => stream.destroy());\n this._userIgnored = undefined;\n this._readyCount = 0;\n this._readyEmitted = false;\n this._watched.forEach((dirent) => dirent.dispose());\n this._closers.clear();\n this._watched.clear();\n this._streams.clear();\n this._symlinkPaths.clear();\n this._throttled.clear();\n this._closePromise = closers.length\n ? Promise.all(closers).then(() => undefined)\n : Promise.resolve();\n return this._closePromise;\n }\n /**\n * Expose list of watched paths\n * @returns for chaining\n */\n getWatched() {\n const watchList = {};\n this._watched.forEach((entry, dir) => {\n const key = this.options.cwd ? sp.relative(this.options.cwd, dir) : dir;\n const index = key || ONE_DOT;\n watchList[index] = entry.getChildren().sort();\n });\n return watchList;\n }\n emitWithAll(event, args) {\n this.emit(event, ...args);\n if (event !== EV.ERROR)\n this.emit(EV.ALL, event, ...args);\n }\n // Common helpers\n // --------------\n /**\n * Normalize and emit events.\n * Calling _emit DOES NOT MEAN emit() would be called!\n * @param event Type of event\n * @param path File or directory path\n * @param stats arguments to be passed with event\n * @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag\n */\n async _emit(event, path, stats) {\n if (this.closed)\n return;\n const opts = this.options;\n if (isWindows)\n path = sp.normalize(path);\n if (opts.cwd)\n path = sp.relative(opts.cwd, path);\n const args = [path];\n if (stats != null)\n args.push(stats);\n const awf = opts.awaitWriteFinish;\n let pw;\n if (awf && (pw = this._pendingWrites.get(path))) {\n pw.lastChange = new Date();\n return this;\n }\n if (opts.atomic) {\n if (event === EV.UNLINK) {\n this._pendingUnlinks.set(path, [event, ...args]);\n setTimeout(() => {\n this._pendingUnlinks.forEach((entry, path) => {\n this.emit(...entry);\n this.emit(EV.ALL, ...entry);\n this._pendingUnlinks.delete(path);\n });\n }, typeof opts.atomic === 'number' ? opts.atomic : 100);\n return this;\n }\n if (event === EV.ADD && this._pendingUnlinks.has(path)) {\n event = EV.CHANGE;\n this._pendingUnlinks.delete(path);\n }\n }\n if (awf && (event === EV.ADD || event === EV.CHANGE) && this._readyEmitted) {\n const awfEmit = (err, stats) => {\n if (err) {\n event = EV.ERROR;\n args[0] = err;\n this.emitWithAll(event, args);\n }\n else if (stats) {\n // if stats doesn't exist the file must have been deleted\n if (args.length > 1) {\n args[1] = stats;\n }\n else {\n args.push(stats);\n }\n this.emitWithAll(event, args);\n }\n };\n this._awaitWriteFinish(path, awf.stabilityThreshold, event, awfEmit);\n return this;\n }\n if (event === EV.CHANGE) {\n const isThrottled = !this._throttle(EV.CHANGE, path, 50);\n if (isThrottled)\n return this;\n }\n if (opts.alwaysStat &&\n stats === undefined &&\n (event === EV.ADD || event === EV.ADD_DIR || event === EV.CHANGE)) {\n const fullPath = opts.cwd ? sp.join(opts.cwd, path) : path;\n let stats;\n try {\n stats = await stat(fullPath);\n }\n catch (err) {\n // do nothing\n }\n // Suppress event when fs_stat fails, to avoid sending undefined 'stat'\n if (!stats || this.closed)\n return;\n args.push(stats);\n }\n this.emitWithAll(event, args);\n return this;\n }\n /**\n * Common handler for errors\n * @returns The error if defined, otherwise the value of the FSWatcher instance's `closed` flag\n */\n _handleError(error) {\n const code = error && error.code;\n if (error &&\n code !== 'ENOENT' &&\n code !== 'ENOTDIR' &&\n (!this.options.ignorePermissionErrors || (code !== 'EPERM' && code !== 'EACCES'))) {\n this.emit(EV.ERROR, error);\n }\n return error || this.closed;\n }\n /**\n * Helper utility for throttling\n * @param actionType type being throttled\n * @param path being acted upon\n * @param timeout duration of time to suppress duplicate actions\n * @returns tracking object or false if action should be suppressed\n */\n _throttle(actionType, path, timeout) {\n if (!this._throttled.has(actionType)) {\n this._throttled.set(actionType, new Map());\n }\n const action = this._throttled.get(actionType);\n if (!action)\n throw new Error('invalid throttle');\n const actionPath = action.get(path);\n if (actionPath) {\n actionPath.count++;\n return false;\n }\n // eslint-disable-next-line prefer-const\n let timeoutObject;\n const clear = () => {\n const item = action.get(path);\n const count = item ? item.count : 0;\n action.delete(path);\n clearTimeout(timeoutObject);\n if (item)\n clearTimeout(item.timeoutObject);\n return count;\n };\n timeoutObject = setTimeout(clear, timeout);\n const thr = { timeoutObject, clear, count: 0 };\n action.set(path, thr);\n return thr;\n }\n _incrReadyCount() {\n return this._readyCount++;\n }\n /**\n * Awaits write operation to finish.\n * Polls a newly created file for size variations. When files size does not change for 'threshold' milliseconds calls callback.\n * @param path being acted upon\n * @param threshold Time in milliseconds a file size must be fixed before acknowledging write OP is finished\n * @param event\n * @param awfEmit Callback to be called when ready for event to be emitted.\n */\n _awaitWriteFinish(path, threshold, event, awfEmit) {\n const awf = this.options.awaitWriteFinish;\n if (typeof awf !== 'object')\n return;\n const pollInterval = awf.pollInterval;\n let timeoutHandler;\n let fullPath = path;\n if (this.options.cwd && !sp.isAbsolute(path)) {\n fullPath = sp.join(this.options.cwd, path);\n }\n const now = new Date();\n const writes = this._pendingWrites;\n function awaitWriteFinishFn(prevStat) {\n statcb(fullPath, (err, curStat) => {\n if (err || !writes.has(path)) {\n if (err && err.code !== 'ENOENT')\n awfEmit(err);\n return;\n }\n const now = Number(new Date());\n if (prevStat && curStat.size !== prevStat.size) {\n writes.get(path).lastChange = now;\n }\n const pw = writes.get(path);\n const df = now - pw.lastChange;\n if (df >= threshold) {\n writes.delete(path);\n awfEmit(undefined, curStat);\n }\n else {\n timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval, curStat);\n }\n });\n }\n if (!writes.has(path)) {\n writes.set(path, {\n lastChange: now,\n cancelWait: () => {\n writes.delete(path);\n clearTimeout(timeoutHandler);\n return event;\n },\n });\n timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval);\n }\n }\n /**\n * Determines whether user has asked to ignore this path.\n */\n _isIgnored(path, stats) {\n if (this.options.atomic && DOT_RE.test(path))\n return true;\n if (!this._userIgnored) {\n const { cwd } = this.options;\n const ign = this.options.ignored;\n const ignored = (ign || []).map(normalizeIgnored(cwd));\n const ignoredPaths = [...this._ignoredPaths];\n const list = [...ignoredPaths.map(normalizeIgnored(cwd)), ...ignored];\n this._userIgnored = anymatch(list, undefined);\n }\n return this._userIgnored(path, stats);\n }\n _isntIgnored(path, stat) {\n return !this._isIgnored(path, stat);\n }\n /**\n * Provides a set of common helpers and properties relating to symlink handling.\n * @param path file or directory pattern being watched\n */\n _getWatchHelpers(path) {\n return new WatchHelper(path, this.options.followSymlinks, this);\n }\n // Directory helpers\n // -----------------\n /**\n * Provides directory tracking objects\n * @param directory path of the directory\n */\n _getWatchedDir(directory) {\n const dir = sp.resolve(directory);\n if (!this._watched.has(dir))\n this._watched.set(dir, new DirEntry(dir, this._boundRemove));\n return this._watched.get(dir);\n }\n // File helpers\n // ------------\n /**\n * Check for read permissions: https://stackoverflow.com/a/11781404/1358405\n */\n _hasReadPermissions(stats) {\n if (this.options.ignorePermissionErrors)\n return true;\n return Boolean(Number(stats.mode) & 0o400);\n }\n /**\n * Handles emitting unlink events for\n * files and directories, and via recursion, for\n * files and directories within directories that are unlinked\n * @param directory within which the following item is located\n * @param item base path of item/directory\n */\n _remove(directory, item, isDirectory) {\n // if what is being deleted is a directory, get that directory's paths\n // for recursive deleting and cleaning of watched object\n // if it is not a directory, nestedDirectoryChildren will be empty array\n const path = sp.join(directory, item);\n const fullPath = sp.resolve(path);\n isDirectory =\n isDirectory != null ? isDirectory : this._watched.has(path) || this._watched.has(fullPath);\n // prevent duplicate handling in case of arriving here nearly simultaneously\n // via multiple paths (such as _handleFile and _handleDir)\n if (!this._throttle('remove', path, 100))\n return;\n // if the only watched file is removed, watch for its return\n if (!isDirectory && this._watched.size === 1) {\n this.add(directory, item, true);\n }\n // This will create a new entry in the watched object in either case\n // so we got to do the directory check beforehand\n const wp = this._getWatchedDir(path);\n const nestedDirectoryChildren = wp.getChildren();\n // Recursively remove children directories / files.\n nestedDirectoryChildren.forEach((nested) => this._remove(path, nested));\n // Check if item was on the watched list and remove it\n const parent = this._getWatchedDir(directory);\n const wasTracked = parent.has(item);\n parent.remove(item);\n // Fixes issue #1042 -> Relative paths were detected and added as symlinks\n // (https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L612),\n // but never removed from the map in case the path was deleted.\n // This leads to an incorrect state if the path was recreated:\n // https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L553\n if (this._symlinkPaths.has(fullPath)) {\n this._symlinkPaths.delete(fullPath);\n }\n // If we wait for this file to be fully written, cancel the wait.\n let relPath = path;\n if (this.options.cwd)\n relPath = sp.relative(this.options.cwd, path);\n if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {\n const event = this._pendingWrites.get(relPath).cancelWait();\n if (event === EV.ADD)\n return;\n }\n // The Entry will either be a directory that just got removed\n // or a bogus entry to a file, in either case we have to remove it\n this._watched.delete(path);\n this._watched.delete(fullPath);\n const eventName = isDirectory ? EV.UNLINK_DIR : EV.UNLINK;\n if (wasTracked && !this._isIgnored(path))\n this._emit(eventName, path);\n // Avoid conflicts if we later create another file with the same name\n this._closePath(path);\n }\n /**\n * Closes all watchers for a path\n */\n _closePath(path) {\n this._closeFile(path);\n const dir = sp.dirname(path);\n this._getWatchedDir(dir).remove(sp.basename(path));\n }\n /**\n * Closes only file-specific watchers\n */\n _closeFile(path) {\n const closers = this._closers.get(path);\n if (!closers)\n return;\n closers.forEach((closer) => closer());\n this._closers.delete(path);\n }\n _addPathCloser(path, closer) {\n if (!closer)\n return;\n let list = this._closers.get(path);\n if (!list) {\n list = [];\n this._closers.set(path, list);\n }\n list.push(closer);\n }\n _readdirp(root, opts) {\n if (this.closed)\n return;\n const options = { type: EV.ALL, alwaysStat: true, lstat: true, ...opts, depth: 0 };\n let stream = readdirp(root, options);\n this._streams.add(stream);\n stream.once(STR_CLOSE, () => {\n stream = undefined;\n });\n stream.once(STR_END, () => {\n if (stream) {\n this._streams.delete(stream);\n stream = undefined;\n }\n });\n return stream;\n }\n}\n/**\n * Instantiates watcher with paths to be tracked.\n * @param paths file / directory paths\n * @param options opts, such as `atomic`, `awaitWriteFinish`, `ignored`, and others\n * @returns an instance of FSWatcher for chaining.\n * @example\n * const watcher = watch('.').on('all', (event, path) => { console.log(event, path); });\n * watch('.', { atomic: true, awaitWriteFinish: true, ignored: (f, stats) => stats?.isFile() && !f.endsWith('.js') })\n */\nexport function watch(paths, options = {}) {\n const watcher = new FSWatcher(options);\n watcher.add(paths);\n return watcher;\n}\nexport default { watch: watch, FSWatcher: FSWatcher };\n","import { lstat, readdir, realpath, stat } from 'node:fs/promises';\nimport { join as pjoin, relative as prelative, resolve as presolve, sep as psep } from 'node:path';\nimport { Readable } from 'node:stream';\nexport const EntryTypes = {\n FILE_TYPE: 'files',\n DIR_TYPE: 'directories',\n FILE_DIR_TYPE: 'files_directories',\n EVERYTHING_TYPE: 'all',\n};\nconst defaultOptions = {\n root: '.',\n fileFilter: (_entryInfo) => true,\n directoryFilter: (_entryInfo) => true,\n type: EntryTypes.FILE_TYPE,\n lstat: false,\n depth: 2147483648,\n alwaysStat: false,\n highWaterMark: 4096,\n};\nObject.freeze(defaultOptions);\nconst RECURSIVE_ERROR_CODE = 'READDIRP_RECURSIVE_ERROR';\nconst NORMAL_FLOW_ERRORS = new Set(['ENOENT', 'EPERM', 'EACCES', 'ELOOP', RECURSIVE_ERROR_CODE]);\nconst ALL_TYPES = [\n EntryTypes.DIR_TYPE,\n EntryTypes.EVERYTHING_TYPE,\n EntryTypes.FILE_DIR_TYPE,\n EntryTypes.FILE_TYPE,\n];\nconst DIR_TYPES = new Set([\n EntryTypes.DIR_TYPE,\n EntryTypes.EVERYTHING_TYPE,\n EntryTypes.FILE_DIR_TYPE,\n]);\nconst FILE_TYPES = new Set([\n EntryTypes.EVERYTHING_TYPE,\n EntryTypes.FILE_DIR_TYPE,\n EntryTypes.FILE_TYPE,\n]);\nconst isNormalFlowError = (error) => NORMAL_FLOW_ERRORS.has(error.code);\nconst wantBigintFsStats = process.platform === 'win32';\nconst emptyFn = (_entryInfo) => true;\nconst normalizeFilter = (filter) => {\n if (filter === undefined)\n return emptyFn;\n if (typeof filter === 'function')\n return filter;\n if (typeof filter === 'string') {\n const fl = filter.trim();\n return (entry) => entry.basename === fl;\n }\n if (Array.isArray(filter)) {\n const trItems = filter.map((item) => item.trim());\n return (entry) => trItems.some((f) => entry.basename === f);\n }\n return emptyFn;\n};\n/** Readable readdir stream, emitting new files as they're being listed. */\nexport class ReaddirpStream extends Readable {\n parents;\n reading;\n parent;\n _stat;\n _maxDepth;\n _wantsDir;\n _wantsFile;\n _wantsEverything;\n _root;\n _isDirent;\n _statsProp;\n _rdOptions;\n _fileFilter;\n _directoryFilter;\n constructor(options = {}) {\n super({\n objectMode: true,\n autoDestroy: true,\n highWaterMark: options.highWaterMark,\n });\n const opts = { ...defaultOptions, ...options };\n const { root, type } = opts;\n this._fileFilter = normalizeFilter(opts.fileFilter);\n this._directoryFilter = normalizeFilter(opts.directoryFilter);\n const statMethod = opts.lstat ? lstat : stat;\n // Use bigint stats if it's windows and stat() supports options (node 10+).\n if (wantBigintFsStats) {\n this._stat = (path) => statMethod(path, { bigint: true });\n }\n else {\n this._stat = statMethod;\n }\n this._maxDepth =\n opts.depth != null && Number.isSafeInteger(opts.depth) ? opts.depth : defaultOptions.depth;\n this._wantsDir = type ? DIR_TYPES.has(type) : false;\n this._wantsFile = type ? FILE_TYPES.has(type) : false;\n this._wantsEverything = type === EntryTypes.EVERYTHING_TYPE;\n this._root = presolve(root);\n this._isDirent = !opts.alwaysStat;\n this._statsProp = this._isDirent ? 'dirent' : 'stats';\n this._rdOptions = { encoding: 'utf8', withFileTypes: this._isDirent };\n // Launch stream with one parent, the root dir.\n this.parents = [this._exploreDir(root, 1)];\n this.reading = false;\n this.parent = undefined;\n }\n async _read(batch) {\n if (this.reading)\n return;\n this.reading = true;\n try {\n while (!this.destroyed && batch > 0) {\n const par = this.parent;\n const fil = par && par.files;\n if (fil && fil.length > 0) {\n const { path, depth } = par;\n const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path));\n const awaited = await Promise.all(slice);\n for (const entry of awaited) {\n if (!entry)\n continue;\n if (this.destroyed)\n return;\n const entryType = await this._getEntryType(entry);\n if (entryType === 'directory' && this._directoryFilter(entry)) {\n if (depth <= this._maxDepth) {\n this.parents.push(this._exploreDir(entry.fullPath, depth + 1));\n }\n if (this._wantsDir) {\n this.push(entry);\n batch--;\n }\n }\n else if ((entryType === 'file' || this._includeAsFile(entry)) &&\n this._fileFilter(entry)) {\n if (this._wantsFile) {\n this.push(entry);\n batch--;\n }\n }\n }\n }\n else {\n const parent = this.parents.pop();\n if (!parent) {\n this.push(null);\n break;\n }\n this.parent = await parent;\n if (this.destroyed)\n return;\n }\n }\n }\n catch (error) {\n this.destroy(error);\n }\n finally {\n this.reading = false;\n }\n }\n async _exploreDir(path, depth) {\n let files;\n try {\n files = await readdir(path, this._rdOptions);\n }\n catch (error) {\n this._onError(error);\n }\n return { files, depth, path };\n }\n async _formatEntry(dirent, path) {\n let entry;\n const basename = this._isDirent ? dirent.name : dirent;\n try {\n const fullPath = presolve(pjoin(path, basename));\n entry = { path: prelative(this._root, fullPath), fullPath, basename };\n entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);\n }\n catch (err) {\n this._onError(err);\n return;\n }\n return entry;\n }\n _onError(err) {\n if (isNormalFlowError(err) && !this.destroyed) {\n this.emit('warn', err);\n }\n else {\n this.destroy(err);\n }\n }\n async _getEntryType(entry) {\n // entry may be undefined, because a warning or an error were emitted\n // and the statsProp is undefined\n if (!entry && this._statsProp in entry) {\n return '';\n }\n const stats = entry[this._statsProp];\n if (stats.isFile())\n return 'file';\n if (stats.isDirectory())\n return 'directory';\n if (stats && stats.isSymbolicLink()) {\n const full = entry.fullPath;\n try {\n const entryRealPath = await realpath(full);\n const entryRealPathStats = await lstat(entryRealPath);\n if (entryRealPathStats.isFile()) {\n return 'file';\n }\n if (entryRealPathStats.isDirectory()) {\n const len = entryRealPath.length;\n if (full.startsWith(entryRealPath) && full.substr(len, 1) === psep) {\n const recursiveError = new Error(`Circular symlink detected: \"${full}\" points to \"${entryRealPath}\"`);\n // @ts-ignore\n recursiveError.code = RECURSIVE_ERROR_CODE;\n return this._onError(recursiveError);\n }\n return 'directory';\n }\n }\n catch (error) {\n this._onError(error);\n return '';\n }\n }\n }\n _includeAsFile(entry) {\n const stats = entry && entry[this._statsProp];\n return stats && this._wantsEverything && !stats.isDirectory();\n }\n}\n/**\n * Streaming version: Reads all files and directories in given root recursively.\n * Consumes ~constant small amount of RAM.\n * @param root Root directory\n * @param options Options to specify root (start directory), filters and recursion depth\n */\nexport function readdirp(root, options = {}) {\n // @ts-ignore\n let type = options.entryType || options.type;\n if (type === 'both')\n type = EntryTypes.FILE_DIR_TYPE; // backwards-compatibility\n if (type)\n options.type = type;\n if (!root) {\n throw new Error('readdirp: root argument is required. Usage: readdirp(root, options)');\n }\n else if (typeof root !== 'string') {\n throw new TypeError('readdirp: root argument must be a string. Usage: readdirp(root, options)');\n }\n else if (type && !ALL_TYPES.includes(type)) {\n throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(', ')}`);\n }\n options.root = root;\n return new ReaddirpStream(options);\n}\n/**\n * Promise version: Reads all files and directories in given root recursively.\n * Compared to streaming version, will consume a lot of RAM e.g. when 1 million files are listed.\n * @returns array of paths and their entry infos\n */\nexport function readdirpPromise(root, options = {}) {\n return new Promise((resolve, reject) => {\n const files = [];\n readdirp(root, options)\n .on('data', (entry) => files.push(entry))\n .on('end', () => resolve(files))\n .on('error', (error) => reject(error));\n });\n}\nexport default readdirp;\n","import { watch as fs_watch, unwatchFile, watchFile } from 'node:fs';\nimport { realpath as fsrealpath, lstat, open, stat } from 'node:fs/promises';\nimport { type as osType } from 'node:os';\nimport * as sp from 'node:path';\nexport const STR_DATA = 'data';\nexport const STR_END = 'end';\nexport const STR_CLOSE = 'close';\nexport const EMPTY_FN = () => { };\nexport const IDENTITY_FN = (val) => val;\nconst pl = process.platform;\nexport const isWindows = pl === 'win32';\nexport const isMacos = pl === 'darwin';\nexport const isLinux = pl === 'linux';\nexport const isFreeBSD = pl === 'freebsd';\nexport const isIBMi = osType() === 'OS400';\nexport const EVENTS = {\n ALL: 'all',\n READY: 'ready',\n ADD: 'add',\n CHANGE: 'change',\n ADD_DIR: 'addDir',\n UNLINK: 'unlink',\n UNLINK_DIR: 'unlinkDir',\n RAW: 'raw',\n ERROR: 'error',\n};\nconst EV = EVENTS;\nconst THROTTLE_MODE_WATCH = 'watch';\nconst statMethods = { lstat, stat };\nconst KEY_LISTENERS = 'listeners';\nconst KEY_ERR = 'errHandlers';\nconst KEY_RAW = 'rawEmitters';\nconst HANDLER_KEYS = [KEY_LISTENERS, KEY_ERR, KEY_RAW];\n// prettier-ignore\nconst binaryExtensions = new Set([\n '3dm', '3ds', '3g2', '3gp', '7z', 'a', 'aac', 'adp', 'afdesign', 'afphoto', 'afpub', 'ai',\n 'aif', 'aiff', 'alz', 'ape', 'apk', 'appimage', 'ar', 'arj', 'asf', 'au', 'avi',\n 'bak', 'baml', 'bh', 'bin', 'bk', 'bmp', 'btif', 'bz2', 'bzip2',\n 'cab', 'caf', 'cgm', 'class', 'cmx', 'cpio', 'cr2', 'cur', 'dat', 'dcm', 'deb', 'dex', 'djvu',\n 'dll', 'dmg', 'dng', 'doc', 'docm', 'docx', 'dot', 'dotm', 'dra', 'DS_Store', 'dsk', 'dts',\n 'dtshd', 'dvb', 'dwg', 'dxf',\n 'ecelp4800', 'ecelp7470', 'ecelp9600', 'egg', 'eol', 'eot', 'epub', 'exe',\n 'f4v', 'fbs', 'fh', 'fla', 'flac', 'flatpak', 'fli', 'flv', 'fpx', 'fst', 'fvt',\n 'g3', 'gh', 'gif', 'graffle', 'gz', 'gzip',\n 'h261', 'h263', 'h264', 'icns', 'ico', 'ief', 'img', 'ipa', 'iso',\n 'jar', 'jpeg', 'jpg', 'jpgv', 'jpm', 'jxr', 'key', 'ktx',\n 'lha', 'lib', 'lvp', 'lz', 'lzh', 'lzma', 'lzo',\n 'm3u', 'm4a', 'm4v', 'mar', 'mdi', 'mht', 'mid', 'midi', 'mj2', 'mka', 'mkv', 'mmr', 'mng',\n 'mobi', 'mov', 'movie', 'mp3',\n 'mp4', 'mp4a', 'mpeg', 'mpg', 'mpga', 'mxu',\n 'nef', 'npx', 'numbers', 'nupkg',\n 'o', 'odp', 'ods', 'odt', 'oga', 'ogg', 'ogv', 'otf', 'ott',\n 'pages', 'pbm', 'pcx', 'pdb', 'pdf', 'pea', 'pgm', 'pic', 'png', 'pnm', 'pot', 'potm',\n 'potx', 'ppa', 'ppam',\n 'ppm', 'pps', 'ppsm', 'ppsx', 'ppt', 'pptm', 'pptx', 'psd', 'pya', 'pyc', 'pyo', 'pyv',\n 'qt',\n 'rar', 'ras', 'raw', 'resources', 'rgb', 'rip', 'rlc', 'rmf', 'rmvb', 'rpm', 'rtf', 'rz',\n 's3m', 's7z', 'scpt', 'sgi', 'shar', 'snap', 'sil', 'sketch', 'slk', 'smv', 'snk', 'so',\n 'stl', 'suo', 'sub', 'swf',\n 'tar', 'tbz', 'tbz2', 'tga', 'tgz', 'thmx', 'tif', 'tiff', 'tlz', 'ttc', 'ttf', 'txz',\n 'udf', 'uvh', 'uvi', 'uvm', 'uvp', 'uvs', 'uvu',\n 'viv', 'vob',\n 'war', 'wav', 'wax', 'wbmp', 'wdp', 'weba', 'webm', 'webp', 'whl', 'wim', 'wm', 'wma',\n 'wmv', 'wmx', 'woff', 'woff2', 'wrm', 'wvx',\n 'xbm', 'xif', 'xla', 'xlam', 'xls', 'xlsb', 'xlsm', 'xlsx', 'xlt', 'xltm', 'xltx', 'xm',\n 'xmind', 'xpi', 'xpm', 'xwd', 'xz',\n 'z', 'zip', 'zipx',\n]);\nconst isBinaryPath = (filePath) => binaryExtensions.has(sp.extname(filePath).slice(1).toLowerCase());\n// TODO: emit errors properly. Example: EMFILE on Macos.\nconst foreach = (val, fn) => {\n if (val instanceof Set) {\n val.forEach(fn);\n }\n else {\n fn(val);\n }\n};\nconst addAndConvert = (main, prop, item) => {\n let container = main[prop];\n if (!(container instanceof Set)) {\n main[prop] = container = new Set([container]);\n }\n container.add(item);\n};\nconst clearItem = (cont) => (key) => {\n const set = cont[key];\n if (set instanceof Set) {\n set.clear();\n }\n else {\n delete cont[key];\n }\n};\nconst delFromSet = (main, prop, item) => {\n const container = main[prop];\n if (container instanceof Set) {\n container.delete(item);\n }\n else if (container === item) {\n delete main[prop];\n }\n};\nconst isEmptySet = (val) => (val instanceof Set ? val.size === 0 : !val);\nconst FsWatchInstances = new Map();\n/**\n * Instantiates the fs_watch interface\n * @param path to be watched\n * @param options to be passed to fs_watch\n * @param listener main event handler\n * @param errHandler emits info about errors\n * @param emitRaw emits raw event data\n * @returns {NativeFsWatcher}\n */\nfunction createFsWatchInstance(path, options, listener, errHandler, emitRaw) {\n const handleEvent = (rawEvent, evPath) => {\n listener(path);\n emitRaw(rawEvent, evPath, { watchedPath: path });\n // emit based on events occurring for files from a directory's watcher in\n // case the file's watcher misses it (and rely on throttling to de-dupe)\n if (evPath && path !== evPath) {\n fsWatchBroadcast(sp.resolve(path, evPath), KEY_LISTENERS, sp.join(path, evPath));\n }\n };\n try {\n return fs_watch(path, {\n persistent: options.persistent,\n }, handleEvent);\n }\n catch (error) {\n errHandler(error);\n return undefined;\n }\n}\n/**\n * Helper for passing fs_watch event data to a collection of listeners\n * @param fullPath absolute path bound to fs_watch instance\n */\nconst fsWatchBroadcast = (fullPath, listenerType, val1, val2, val3) => {\n const cont = FsWatchInstances.get(fullPath);\n if (!cont)\n return;\n foreach(cont[listenerType], (listener) => {\n listener(val1, val2, val3);\n });\n};\n/**\n * Instantiates the fs_watch interface or binds listeners\n * to an existing one covering the same file system entry\n * @param path\n * @param fullPath absolute path\n * @param options to be passed to fs_watch\n * @param handlers container for event listener functions\n */\nconst setFsWatchListener = (path, fullPath, options, handlers) => {\n const { listener, errHandler, rawEmitter } = handlers;\n let cont = FsWatchInstances.get(fullPath);\n let watcher;\n if (!options.persistent) {\n watcher = createFsWatchInstance(path, options, listener, errHandler, rawEmitter);\n if (!watcher)\n return;\n return watcher.close.bind(watcher);\n }\n if (cont) {\n addAndConvert(cont, KEY_LISTENERS, listener);\n addAndConvert(cont, KEY_ERR, errHandler);\n addAndConvert(cont, KEY_RAW, rawEmitter);\n }\n else {\n watcher = createFsWatchInstance(path, options, fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS), errHandler, // no need to use broadcast here\n fsWatchBroadcast.bind(null, fullPath, KEY_RAW));\n if (!watcher)\n return;\n watcher.on(EV.ERROR, async (error) => {\n const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR);\n if (cont)\n cont.watcherUnusable = true; // documented since Node 10.4.1\n // Workaround for https://github.com/joyent/node/issues/4337\n if (isWindows && error.code === 'EPERM') {\n try {\n const fd = await open(path, 'r');\n await fd.close();\n broadcastErr(error);\n }\n catch (err) {\n // do nothing\n }\n }\n else {\n broadcastErr(error);\n }\n });\n cont = {\n listeners: listener,\n errHandlers: errHandler,\n rawEmitters: rawEmitter,\n watcher,\n };\n FsWatchInstances.set(fullPath, cont);\n }\n // const index = cont.listeners.indexOf(listener);\n // removes this instance's listeners and closes the underlying fs_watch\n // instance if there are no more listeners left\n return () => {\n delFromSet(cont, KEY_LISTENERS, listener);\n delFromSet(cont, KEY_ERR, errHandler);\n delFromSet(cont, KEY_RAW, rawEmitter);\n if (isEmptySet(cont.listeners)) {\n // Check to protect against issue gh-730.\n // if (cont.watcherUnusable) {\n cont.watcher.close();\n // }\n FsWatchInstances.delete(fullPath);\n HANDLER_KEYS.forEach(clearItem(cont));\n // @ts-ignore\n cont.watcher = undefined;\n Object.freeze(cont);\n }\n };\n};\n// fs_watchFile helpers\n// object to hold per-process fs_watchFile instances\n// (may be shared across chokidar FSWatcher instances)\nconst FsWatchFileInstances = new Map();\n/**\n * Instantiates the fs_watchFile interface or binds listeners\n * to an existing one covering the same file system entry\n * @param path to be watched\n * @param fullPath absolute path\n * @param options options to be passed to fs_watchFile\n * @param handlers container for event listener functions\n * @returns closer\n */\nconst setFsWatchFileListener = (path, fullPath, options, handlers) => {\n const { listener, rawEmitter } = handlers;\n let cont = FsWatchFileInstances.get(fullPath);\n // let listeners = new Set();\n // let rawEmitters = new Set();\n const copts = cont && cont.options;\n if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) {\n // \"Upgrade\" the watcher to persistence or a quicker interval.\n // This creates some unlikely edge case issues if the user mixes\n // settings in a very weird way, but solving for those cases\n // doesn't seem worthwhile for the added complexity.\n // listeners = cont.listeners;\n // rawEmitters = cont.rawEmitters;\n unwatchFile(fullPath);\n cont = undefined;\n }\n if (cont) {\n addAndConvert(cont, KEY_LISTENERS, listener);\n addAndConvert(cont, KEY_RAW, rawEmitter);\n }\n else {\n // TODO\n // listeners.add(listener);\n // rawEmitters.add(rawEmitter);\n cont = {\n listeners: listener,\n rawEmitters: rawEmitter,\n options,\n watcher: watchFile(fullPath, options, (curr, prev) => {\n foreach(cont.rawEmitters, (rawEmitter) => {\n rawEmitter(EV.CHANGE, fullPath, { curr, prev });\n });\n const currmtime = curr.mtimeMs;\n if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {\n foreach(cont.listeners, (listener) => listener(path, curr));\n }\n }),\n };\n FsWatchFileInstances.set(fullPath, cont);\n }\n // const index = cont.listeners.indexOf(listener);\n // Removes this instance's listeners and closes the underlying fs_watchFile\n // instance if there are no more listeners left.\n return () => {\n delFromSet(cont, KEY_LISTENERS, listener);\n delFromSet(cont, KEY_RAW, rawEmitter);\n if (isEmptySet(cont.listeners)) {\n FsWatchFileInstances.delete(fullPath);\n unwatchFile(fullPath);\n cont.options = cont.watcher = undefined;\n Object.freeze(cont);\n }\n };\n};\n/**\n * @mixin\n */\nexport class NodeFsHandler {\n fsw;\n _boundHandleError;\n constructor(fsW) {\n this.fsw = fsW;\n this._boundHandleError = (error) => fsW._handleError(error);\n }\n /**\n * Watch file for changes with fs_watchFile or fs_watch.\n * @param path to file or dir\n * @param listener on fs change\n * @returns closer for the watcher instance\n */\n _watchWithNodeFs(path, listener) {\n const opts = this.fsw.options;\n const directory = sp.dirname(path);\n const basename = sp.basename(path);\n const parent = this.fsw._getWatchedDir(directory);\n parent.add(basename);\n const absolutePath = sp.resolve(path);\n const options = {\n persistent: opts.persistent,\n };\n if (!listener)\n listener = EMPTY_FN;\n let closer;\n if (opts.usePolling) {\n const enableBin = opts.interval !== opts.binaryInterval;\n options.interval = enableBin && isBinaryPath(basename) ? opts.binaryInterval : opts.interval;\n closer = setFsWatchFileListener(path, absolutePath, options, {\n listener,\n rawEmitter: this.fsw._emitRaw,\n });\n }\n else {\n closer = setFsWatchListener(path, absolutePath, options, {\n listener,\n errHandler: this._boundHandleError,\n rawEmitter: this.fsw._emitRaw,\n });\n }\n return closer;\n }\n /**\n * Watch a file and emit add event if warranted.\n * @returns closer for the watcher instance\n */\n _handleFile(file, stats, initialAdd) {\n if (this.fsw.closed) {\n return;\n }\n const dirname = sp.dirname(file);\n const basename = sp.basename(file);\n const parent = this.fsw._getWatchedDir(dirname);\n // stats is always present\n let prevStats = stats;\n // if the file is already being watched, do nothing\n if (parent.has(basename))\n return;\n const listener = async (path, newStats) => {\n if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5))\n return;\n if (!newStats || newStats.mtimeMs === 0) {\n try {\n const newStats = await stat(file);\n if (this.fsw.closed)\n return;\n // Check that change event was not fired because of changed only accessTime.\n const at = newStats.atimeMs;\n const mt = newStats.mtimeMs;\n if (!at || at <= mt || mt !== prevStats.mtimeMs) {\n this.fsw._emit(EV.CHANGE, file, newStats);\n }\n if ((isMacos || isLinux || isFreeBSD) && prevStats.ino !== newStats.ino) {\n this.fsw._closeFile(path);\n prevStats = newStats;\n const closer = this._watchWithNodeFs(file, listener);\n if (closer)\n this.fsw._addPathCloser(path, closer);\n }\n else {\n prevStats = newStats;\n }\n }\n catch (error) {\n // Fix issues where mtime is null but file is still present\n this.fsw._remove(dirname, basename);\n }\n // add is about to be emitted if file not already tracked in parent\n }\n else if (parent.has(basename)) {\n // Check that change event was not fired because of changed only accessTime.\n const at = newStats.atimeMs;\n const mt = newStats.mtimeMs;\n if (!at || at <= mt || mt !== prevStats.mtimeMs) {\n this.fsw._emit(EV.CHANGE, file, newStats);\n }\n prevStats = newStats;\n }\n };\n // kick off the watcher\n const closer = this._watchWithNodeFs(file, listener);\n // emit an add event if we're supposed to\n if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file)) {\n if (!this.fsw._throttle(EV.ADD, file, 0))\n return;\n this.fsw._emit(EV.ADD, file, stats);\n }\n return closer;\n }\n /**\n * Handle symlinks encountered while reading a dir.\n * @param entry returned by readdirp\n * @param directory path of dir being read\n * @param path of this item\n * @param item basename of this item\n * @returns true if no more processing is needed for this entry.\n */\n async _handleSymlink(entry, directory, path, item) {\n if (this.fsw.closed) {\n return;\n }\n const full = entry.fullPath;\n const dir = this.fsw._getWatchedDir(directory);\n if (!this.fsw.options.followSymlinks) {\n // watch symlink directly (don't follow) and detect changes\n this.fsw._incrReadyCount();\n let linkPath;\n try {\n linkPath = await fsrealpath(path);\n }\n catch (e) {\n this.fsw._emitReady();\n return true;\n }\n if (this.fsw.closed)\n return;\n if (dir.has(item)) {\n if (this.fsw._symlinkPaths.get(full) !== linkPath) {\n this.fsw._symlinkPaths.set(full, linkPath);\n this.fsw._emit(EV.CHANGE, path, entry.stats);\n }\n }\n else {\n dir.add(item);\n this.fsw._symlinkPaths.set(full, linkPath);\n this.fsw._emit(EV.ADD, path, entry.stats);\n }\n this.fsw._emitReady();\n return true;\n }\n // don't follow the same symlink more than once\n if (this.fsw._symlinkPaths.has(full)) {\n return true;\n }\n this.fsw._symlinkPaths.set(full, true);\n }\n _handleRead(directory, initialAdd, wh, target, dir, depth, throttler) {\n // Normalize the directory name on Windows\n directory = sp.join(directory, '');\n const throttleKey = target ? `${directory}:${target}` : directory;\n throttler = this.fsw._throttle('readdir', throttleKey, 1000);\n if (!throttler)\n return;\n const previous = this.fsw._getWatchedDir(wh.path);\n const current = new Set();\n let stream = this.fsw._readdirp(directory, {\n fileFilter: (entry) => wh.filterPath(entry),\n directoryFilter: (entry) => wh.filterDir(entry),\n });\n if (!stream)\n return;\n stream\n .on(STR_DATA, async (entry) => {\n if (this.fsw.closed) {\n stream = undefined;\n return;\n }\n const item = entry.path;\n let path = sp.join(directory, item);\n current.add(item);\n if (entry.stats.isSymbolicLink() &&\n (await this._handleSymlink(entry, directory, path, item))) {\n return;\n }\n if (this.fsw.closed) {\n stream = undefined;\n return;\n }\n // Files that present in current directory snapshot\n // but absent in previous are added to watch list and\n // emit `add` event.\n if (item === target || (!target && !previous.has(item))) {\n this.fsw._incrReadyCount();\n // ensure relativeness of path is preserved in case of watcher reuse\n path = sp.join(dir, sp.relative(dir, path));\n this._addToNodeFs(path, initialAdd, wh, depth + 1);\n }\n })\n .on(EV.ERROR, this._boundHandleError);\n return new Promise((resolve, reject) => {\n if (!stream)\n return reject();\n stream.once(STR_END, () => {\n if (this.fsw.closed) {\n stream = undefined;\n return;\n }\n const wasThrottled = throttler ? throttler.clear() : false;\n resolve(undefined);\n // Files that absent in current directory snapshot\n // but present in previous emit `remove` event\n // and are removed from @watched[directory].\n previous\n .getChildren()\n .filter((item) => {\n return item !== directory && !current.has(item);\n })\n .forEach((item) => {\n this.fsw._remove(directory, item);\n });\n stream = undefined;\n // one more time for any missed in case changes came in extremely quickly\n if (wasThrottled)\n this._handleRead(directory, false, wh, target, dir, depth, throttler);\n });\n });\n }\n /**\n * Read directory to add / remove files from `@watched` list and re-read it on change.\n * @param dir fs path\n * @param stats\n * @param initialAdd\n * @param depth relative to user-supplied path\n * @param target child path targeted for watch\n * @param wh Common watch helpers for this path\n * @param realpath\n * @returns closer for the watcher instance.\n */\n async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath) {\n const parentDir = this.fsw._getWatchedDir(sp.dirname(dir));\n const tracked = parentDir.has(sp.basename(dir));\n if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) {\n this.fsw._emit(EV.ADD_DIR, dir, stats);\n }\n // ensure dir is tracked (harmless if redundant)\n parentDir.add(sp.basename(dir));\n this.fsw._getWatchedDir(dir);\n let throttler;\n let closer;\n const oDepth = this.fsw.options.depth;\n if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath)) {\n if (!target) {\n await this._handleRead(dir, initialAdd, wh, target, dir, depth, throttler);\n if (this.fsw.closed)\n return;\n }\n closer = this._watchWithNodeFs(dir, (dirPath, stats) => {\n // if current directory is removed, do nothing\n if (stats && stats.mtimeMs === 0)\n return;\n this._handleRead(dirPath, false, wh, target, dir, depth, throttler);\n });\n }\n return closer;\n }\n /**\n * Handle added file, directory, or glob pattern.\n * Delegates call to _handleFile / _handleDir after checks.\n * @param path to file or ir\n * @param initialAdd was the file added at watch instantiation?\n * @param priorWh depth relative to user-supplied path\n * @param depth Child path actually targeted for watch\n * @param target Child path actually targeted for watch\n */\n async _addToNodeFs(path, initialAdd, priorWh, depth, target) {\n const ready = this.fsw._emitReady;\n if (this.fsw._isIgnored(path) || this.fsw.closed) {\n ready();\n return false;\n }\n const wh = this.fsw._getWatchHelpers(path);\n if (priorWh) {\n wh.filterPath = (entry) => priorWh.filterPath(entry);\n wh.filterDir = (entry) => priorWh.filterDir(entry);\n }\n // evaluate what is at the path we're being asked to watch\n try {\n const stats = await statMethods[wh.statMethod](wh.watchPath);\n if (this.fsw.closed)\n return;\n if (this.fsw._isIgnored(wh.watchPath, stats)) {\n ready();\n return false;\n }\n const follow = this.fsw.options.followSymlinks;\n let closer;\n if (stats.isDirectory()) {\n const absPath = sp.resolve(path);\n const targetPath = follow ? await fsrealpath(path) : path;\n if (this.fsw.closed)\n return;\n closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);\n if (this.fsw.closed)\n return;\n // preserve this symlink's target path\n if (absPath !== targetPath && targetPath !== undefined) {\n this.fsw._symlinkPaths.set(absPath, targetPath);\n }\n }\n else if (stats.isSymbolicLink()) {\n const targetPath = follow ? await fsrealpath(path) : path;\n if (this.fsw.closed)\n return;\n const parent = sp.dirname(wh.watchPath);\n this.fsw._getWatchedDir(parent).add(wh.watchPath);\n this.fsw._emit(EV.ADD, wh.watchPath, stats);\n closer = await this._handleDir(parent, stats, initialAdd, depth, path, wh, targetPath);\n if (this.fsw.closed)\n return;\n // preserve this symlink's target path\n if (targetPath !== undefined) {\n this.fsw._symlinkPaths.set(sp.resolve(path), targetPath);\n }\n }\n else {\n closer = this._handleFile(wh.watchPath, stats, initialAdd);\n }\n ready();\n if (closer)\n this.fsw._addPathCloser(path, closer);\n return false;\n }\n catch (error) {\n if (this.fsw._handleError(error)) {\n ready();\n return path;\n }\n }\n }\n}\n","import { existsSync, readdirSync, readFileSync, statSync } from \"node:fs\";\nimport { extname, join, relative, resolve } from \"node:path\";\nimport {\n allExtensions,\n detectLang,\n resolverForPath,\n type Alias,\n type ResolveCtx,\n} from \"./languages\";\n\n// Code graph: walk every source file in the configured root(s), dispatch each file to\n// its language resolver (see ./languages), resolve import specifiers to internal file\n// paths, and return a forward-link snapshot the watcher POSTs to /api/code-graph. The\n// shape mirrors Obsidian's MetadataCache.resolvedLinks but boolean (a top-of-file\n// import dedupes to one (from, to) edge).\n//\n// Multi-root: paths are computed relative to a common base so they stay globally\n// unique and human-readable; each file is tagged with its `root` (package) and `lang`.\n\n// Directories we never want in the graph.\nconst SKIP_DIRS = new Set([\n \"node_modules\",\n \".git\",\n \".next\",\n \"dist\",\n \"build\",\n \"__pycache__\",\n \"target\",\n \".venv\",\n \"venv\",\n \"env\",\n \".turbo\",\n \"coverage\",\n \".beacon\",\n \".playwright-mcp\",\n \"generated\",\n]);\n\nexport interface CodeGraphFile {\n path: string;\n lang: string | null;\n root: string | null;\n mtimeMs?: number;\n size?: number;\n}\n\nexport interface CodeGraphSnapshot {\n files: CodeGraphFile[];\n edges: { from: string; to: string }[];\n /** Per-build extraction counters — how many files were re-read vs. served from cache. */\n stats?: { read: number; reused: number };\n}\n\n// ── Walk ──────────────────────────────────────────────────────────────────────\n\nfunction walk(root: string, dir: string, exts: Set<string>, out: string[]) {\n let entries;\n try {\n entries = readdirSync(dir, { withFileTypes: true });\n } catch {\n return;\n }\n for (const e of entries) {\n if (e.name.startsWith(\".\")) continue;\n if (SKIP_DIRS.has(e.name)) continue;\n const full = join(dir, e.name);\n if (e.isDirectory()) {\n walk(root, full, exts, out);\n continue;\n }\n if (!e.isFile()) continue;\n if (e.name.endsWith(\".d.ts\")) continue;\n if (!exts.has(extname(e.name).toLowerCase())) continue;\n out.push(relative(root, full));\n }\n}\n\n/** Walk one root for indexable source files. Returns POSIX, root-relative, sorted. */\nexport function scanCodeFiles(root: string): string[] {\n const out: string[] = [];\n walk(root, root, allExtensions(), out);\n return out.map((p) => p.split(/[\\\\/]/).join(\"/\")).sort();\n}\n\n// ── tsconfig paths ────────────────────────────────────────────────────────────\n\nfunction parseTsconfig(src: string): unknown {\n // Most repos (incl. this one) use plain JSON. Try plain first — a naive comment\n // stripper would eat across unrelated string literals and corrupt the file.\n try {\n return JSON.parse(src);\n } catch {\n /* fall through to strip */\n }\n const stripped = src\n .replace(/\\/\\*[^\"]*?\\*\\//g, \"\")\n .replace(/(^|[^:\"])\\/\\/.*$/gm, \"$1\")\n .replace(/,\\s*([}\\]])/g, \"$1\");\n return JSON.parse(stripped);\n}\n\nfunction normalizeRel(p: string): string {\n return p.replace(/^\\.\\/?/, \"\").replace(/\\/$/, \"\");\n}\n\n/** tsconfig `paths` aliases for a root, repo-relative to THAT root (to = \"\" or \"src\"). */\nexport function loadTsAliases(root: string): Alias[] {\n const path = join(root, \"tsconfig.json\");\n if (!existsSync(path)) return [];\n let cfg: { compilerOptions?: { paths?: Record<string, string[]>; baseUrl?: string } };\n try {\n cfg = parseTsconfig(readFileSync(path, \"utf8\")) as typeof cfg;\n } catch {\n return [];\n }\n const paths = cfg.compilerOptions?.paths ?? {};\n const baseRel = normalizeRel(cfg.compilerOptions?.baseUrl ?? \".\");\n const out: Alias[] = [];\n for (const [pattern, targets] of Object.entries(paths)) {\n if (!pattern.endsWith(\"/*\") || !targets.length) continue;\n const target = targets[0];\n if (!target.endsWith(\"/*\")) continue;\n const from = pattern.slice(0, -1); // \"@/\"\n const targetRel = normalizeRel(target.slice(0, -1)); // \"\" or \"src\"\n const to = [baseRel, targetRel].filter(Boolean).join(\"/\");\n out.push({ from, to });\n }\n return out;\n}\n\n/** Module path declared in a go.mod, e.g. \"example.com/app\", or null. */\nexport function loadGoModule(dir: string): string | null {\n const path = join(dir, \"go.mod\");\n if (!existsSync(path)) return null;\n try {\n const m = /^\\s*module\\s+(\\S+)/m.exec(readFileSync(path, \"utf8\"));\n return m ? m[1] : null;\n } catch {\n return null;\n }\n}\n\n// ── Build ───────────────────────────────────────────────────────────────────\n\nfunction toPosix(p: string): string {\n return p.split(/[\\\\/]/).join(\"/\");\n}\n\n/** Longest common directory prefix of absolute paths (POSIX-normalized). */\nfunction commonAncestor(paths: string[]): string {\n if (paths.length === 1) return paths[0];\n const split = paths.map((p) => toPosix(p).split(\"/\"));\n const first = split[0];\n let i = 0;\n for (; i < first.length; i++) {\n if (!split.every((s) => s[i] === first[i])) break;\n }\n return first.slice(0, i).join(\"/\") || \"/\";\n}\n\ninterface FileMeta {\n path: string; // base-relative POSIX\n abs: string;\n root: string | null;\n mtimeMs: number;\n size: number;\n}\n\n/** Scan + stat all roots (cheap, no file reads). Resolves the base + ResolveCtx. */\nfunction scanRoots(rootOrRoots: string | string[], base?: string): { metas: FileMeta[]; ctx: ResolveCtx } {\n const roots = (Array.isArray(rootOrRoots) ? rootOrRoots : [rootOrRoots]).map((r) => toPosix(resolve(r)));\n const baseDir = toPosix(base ? resolve(base) : roots.length === 1 ? roots[0] : commonAncestor(roots));\n\n const byPath = new Map<string, FileMeta>();\n const aliases: Alias[] = [];\n for (const root of roots) {\n const rootRel = toPosix(relative(baseDir, root)); // \"\" for the base root, \"packages/api\" for a sub-root\n for (const a of loadTsAliases(root)) {\n aliases.push({ from: a.from, to: [rootRel, a.to].filter(Boolean).join(\"/\") });\n }\n for (const rel of scanCodeFiles(root)) {\n const abs = toPosix(join(root, rel));\n const path = toPosix(relative(baseDir, abs));\n if (byPath.has(path)) continue; // overlapping roots — keep first\n try {\n const st = statSync(abs);\n byPath.set(path, { path, abs, root: rootRel || null, mtimeMs: st.mtimeMs, size: st.size });\n } catch {\n /* vanished between readdir and stat — skip */\n }\n }\n }\n\n const goModulePath = roots.map(loadGoModule).find(Boolean) ?? loadGoModule(baseDir);\n const metas = [...byPath.values()].sort((a, b) => a.path.localeCompare(b.path));\n return { metas, ctx: { fileSet: new Set(byPath.keys()), tsAliases: aliases, goModulePath } };\n}\n\n/** Read + extract one file's import specifiers. Giant/unreadable files contribute none. */\nfunction extractSpecifiers(meta: FileMeta): Set<string> {\n const resolver = resolverForPath(meta.path);\n if (!resolver || meta.size > 200_000) return new Set();\n try {\n return resolver.specifiers(readFileSync(meta.abs, \"utf8\"));\n } catch {\n return new Set();\n }\n}\n\n/**\n * Stateful, incremental code-graph builder. Caches each file's extracted import\n * specifiers keyed by (mtimeMs, size); a rebuild re-reads ONLY files whose stat\n * changed and reuses cached specifiers for the rest — so a save in a large repo\n * re-parses one file, not thousands. Resolution still runs every build against the\n * fresh file set, so adding a file correctly lights up edges from unchanged importers.\n */\nexport function createCodeGraphBuilder(rootOrRoots: string | string[], base?: string) {\n const cache = new Map<string, { mtimeMs: number; size: number; specifiers: Set<string> }>();\n\n function build(): CodeGraphSnapshot {\n const { metas, ctx } = scanRoots(rootOrRoots, base);\n const present = new Set(metas.map((m) => m.path));\n for (const k of [...cache.keys()]) if (!present.has(k)) cache.delete(k);\n\n let read = 0;\n let reused = 0;\n const edges: { from: string; to: string }[] = [];\n for (const m of metas) {\n const cached = cache.get(m.path);\n let specs: Set<string>;\n if (cached && cached.mtimeMs === m.mtimeMs && cached.size === m.size) {\n specs = cached.specifiers;\n reused++;\n } else {\n specs = extractSpecifiers(m);\n cache.set(m.path, { mtimeMs: m.mtimeMs, size: m.size, specifiers: specs });\n read++;\n }\n const resolver = resolverForPath(m.path);\n if (!resolver) continue;\n const seen = new Set<string>();\n for (const spec of specs) {\n for (const hit of resolver.resolve(spec, m.path, ctx)) {\n if (!hit || hit === m.path || seen.has(hit)) continue;\n seen.add(hit);\n edges.push({ from: m.path, to: hit });\n }\n }\n }\n\n const files: CodeGraphFile[] = metas.map((m) => ({\n path: m.path,\n lang: detectLang(m.path),\n root: m.root,\n mtimeMs: m.mtimeMs,\n size: m.size,\n }));\n return { files, edges, stats: { read, reused } };\n }\n\n return { build };\n}\n\n/**\n * One-shot code-graph snapshot (no caching across calls). Accepts a single root\n * (back-compat) or many; with many, every path is computed relative to their common\n * base so paths stay unique + readable.\n */\nexport function buildCodeGraph(rootOrRoots: string | string[], base?: string): CodeGraphSnapshot {\n return createCodeGraphBuilder(rootOrRoots, base).build();\n}\n","import { dirname, resolve as resolvePath } from \"node:path\";\nimport type { Alias, LanguageResolver, ResolveCtx } from \"./types\";\n\n// TS/JS resolver. This is the precise path that understands `tsconfig` `paths`\n// aliases, index files, and every import form (static, dynamic, bare side-effect,\n// require). Patterns and resolution match the original intel/extractors/code-graph.ts\n// behavior exactly — the code-graph build now delegates here.\n\nexport const TS_EXTENSIONS = [\".ts\", \".tsx\", \".js\", \".jsx\", \".mjs\", \".cjs\"];\n\nconst IMPORT_PATTERNS = [\n /(?:^|[\\n;])\\s*(?:import|export)[^'\"`\\n]*?from\\s*['\"]([^'\"`]+)['\"]/g,\n /(?:^|[\\n;])\\s*import\\s*['\"]([^'\"`]+)['\"]/g, // bare side-effect import\n /\\brequire\\(\\s*['\"]([^'\"`]+)['\"]\\s*\\)/g,\n /\\bimport\\(\\s*['\"]([^'\"`]+)['\"]\\s*\\)/g,\n];\n\nfunction toPosix(p: string): string {\n return p.split(/[\\\\/]/).join(\"/\");\n}\n\n/** Try a repo-relative base against the file set: exact, +ext, /index+ext. */\nfunction probe(repoRel: string, fileSet: Set<string>): string | null {\n if (fileSet.has(repoRel)) return repoRel;\n for (const ext of TS_EXTENSIONS) {\n const p = `${repoRel}${ext}`;\n if (fileSet.has(p)) return p;\n }\n for (const ext of TS_EXTENSIONS) {\n const p = `${repoRel}/index${ext}`;\n if (fileSet.has(p)) return p;\n }\n return null;\n}\n\nfunction specifiers(content: string): Set<string> {\n const out = new Set<string>();\n for (const re of IMPORT_PATTERNS) {\n re.lastIndex = 0;\n let m: RegExpExecArray | null;\n while ((m = re.exec(content))) out.add(m[1]);\n }\n return out;\n}\n\nfunction resolveSpec(\n spec: string,\n fromFile: string,\n fileSet: Set<string>,\n aliases: Alias[],\n): string | null {\n if (spec.startsWith(\".\")) {\n const abs = resolvePath(\"/\", dirname(fromFile), spec); // \"/\"-rooted, harmless\n const repoRel = toPosix(abs).replace(/^\\//, \"\");\n return probe(repoRel, fileSet);\n }\n // Try every alias whose prefix matches and return the first that hits a real file.\n // (Single-root: one alias. Monorepo: two roots may both define `@/`, so we must not\n // stop at the first prefix match — only at the first that actually resolves.)\n for (const a of aliases) {\n if (spec.startsWith(a.from)) {\n const rest = spec.slice(a.from.length);\n const repoRel = a.to ? `${a.to}/${rest}` : rest;\n const hit = probe(repoRel, fileSet);\n if (hit) return hit;\n }\n }\n return null; // bare package — external\n}\n\nexport const tsResolver: LanguageResolver = {\n id: \"ts\",\n extensions: TS_EXTENSIONS,\n specifiers,\n resolve(spec, fromFile, ctx: ResolveCtx) {\n const hit = resolveSpec(spec, fromFile, ctx.fileSet, ctx.tsAliases ?? []);\n return hit ? [hit] : [];\n },\n};\n","import { dirname, join, normalize } from \"node:path\";\nimport type { LanguageResolver, ResolveCtx } from \"./types\";\n\n// Python resolver. Handles the two real import shapes:\n// import pkg.mod / from pkg.mod import x → absolute dotted module\n// from .mod import x / from ..pkg import y → package-relative (leading dots)\n// Resolves to a `.py`/`.pyi` file or a package `__init__.py`. Absolute imports are\n// probed repo-relative (a source-root prefix like `src/` is handled at build time by\n// the base-relative path scheme); unresolved → external (stdlib / third-party).\n\nexport const PY_EXTENSIONS = [\".py\", \".pyi\"];\n\nconst PATTERNS = [\n /(?:^|[\\n;])\\s*from\\s+(\\.*[\\w.]*)\\s+import\\b/g, // from .mod import x | from pkg.mod import x\n /(?:^|[\\n;])\\s*import\\s+([\\w.]+(?:\\s*,\\s*[\\w.]+)*)/g, // import a.b, c.d\n];\n\nfunction probe(base: string, fileSet: Set<string>): string[] {\n for (const cand of [`${base}.py`, `${base}/__init__.py`, `${base}.pyi`]) {\n if (fileSet.has(cand)) return [cand];\n }\n return [];\n}\n\nfunction specifiers(content: string): Set<string> {\n const out = new Set<string>();\n // from ... import\n PATTERNS[0].lastIndex = 0;\n let m: RegExpExecArray | null;\n while ((m = PATTERNS[0].exec(content))) {\n const s = m[1].trim();\n if (s) out.add(s);\n }\n // import a.b, c.d → split the comma list\n PATTERNS[1].lastIndex = 0;\n while ((m = PATTERNS[1].exec(content))) {\n for (const tok of m[1].split(/\\s*,\\s*/)) {\n const t = tok.trim().split(/\\s+as\\s+/)[0].trim();\n if (t) out.add(t);\n }\n }\n return out;\n}\n\nexport const pythonResolver: LanguageResolver = {\n id: \"python\",\n extensions: PY_EXTENSIONS,\n specifiers,\n resolve(spec, fromFile, ctx: ResolveCtx) {\n if (spec.startsWith(\".\")) {\n // Leading dots: 1 = current package, each extra = one level up.\n const dots = spec.length - spec.replace(/^\\.+/, \"\").length;\n const rest = spec.slice(dots); // module path after the dots (may be \"\")\n let dir = dirname(fromFile);\n for (let i = 1; i < dots; i++) dir = dirname(dir);\n // \"from . import x\" loses x — best-effort resolves to the package itself.\n const base = rest ? join(dir, rest.replace(/\\./g, \"/\")) : dir;\n return probe(normalize(base).replace(/\\\\/g, \"/\"), ctx.fileSet);\n }\n // Absolute dotted module, probed repo-relative.\n return probe(spec.replace(/\\./g, \"/\"), ctx.fileSet);\n },\n};\n","import { dirname } from \"node:path\";\nimport type { LanguageResolver, ResolveCtx } from \"./types\";\n\n// Go resolver. Go imports are package paths (\"example.com/app/util\"), not file paths.\n// With the module path from go.mod, an import under that prefix maps to a package\n// directory; the package is every .go file directly in that dir. We emit an edge to\n// each of them (a file-level approximation of \"this file depends on that package\").\n// Imports outside the module (stdlib, third-party) are external → [].\n\nexport const GO_EXTENSIONS = [\".go\"];\n\nconst SINGLE = /(?:^|[\\n;])\\s*import\\s+(?:[\\w.]+\\s+)?\"([^\"]+)\"/g; // import \"x\" | import alias \"x\"\nconst BLOCK = /(?:^|[\\n;])\\s*import\\s*\\(([\\s\\S]*?)\\)/g; // import ( \"a\" \\n \"b\" )\nconst QUOTED = /\"([^\"]+)\"/g;\n\nfunction specifiers(content: string): Set<string> {\n const out = new Set<string>();\n SINGLE.lastIndex = 0;\n let m: RegExpExecArray | null;\n while ((m = SINGLE.exec(content))) out.add(m[1]);\n BLOCK.lastIndex = 0;\n while ((m = BLOCK.exec(content))) {\n QUOTED.lastIndex = 0;\n let q: RegExpExecArray | null;\n while ((q = QUOTED.exec(m[1]))) out.add(q[1]);\n }\n return out;\n}\n\nexport const goResolver: LanguageResolver = {\n id: \"go\",\n extensions: GO_EXTENSIONS,\n resolve(spec, _fromFile, ctx: ResolveCtx) {\n const mod = ctx.goModulePath;\n if (!mod) return [];\n let dir: string | null = null;\n if (spec === mod) dir = \"\";\n else if (spec.startsWith(`${mod}/`)) dir = spec.slice(mod.length + 1);\n if (dir === null) return []; // stdlib / third-party\n const out: string[] = [];\n for (const p of ctx.fileSet) {\n if (!p.endsWith(\".go\")) continue;\n const d = dirname(p);\n if ((dir === \"\" && d === \".\") || d === dir) out.push(p);\n }\n return out.sort();\n },\n specifiers,\n};\n","import { basename, dirname, join, normalize } from \"node:path\";\nimport type { LanguageResolver, ResolveCtx } from \"./types\";\n\n// Rust resolver. The module tree is declared structurally, so we key off:\n// mod foo; → submodule foo (foo.rs | foo/mod.rs, sibling or owner-dir)\n// use crate::a::b; → crate-root-relative\n// use super::x; / use self::y; → relative\n// Best-effort and deterministic; symbol-level precision is out of scope.\n\nexport const RS_EXTENSIONS = [\".rs\"];\n\nconst MOD = /(?:^|[\\n;])\\s*(?:pub\\s+)?mod\\s+(\\w+)\\s*;/g;\nconst USE = /(?:^|[\\n;])\\s*(?:pub\\s+)?use\\s+([\\w:]+)/g;\n\nfunction normalizeUse(path: string): string {\n const segs = path.split(\"::\").filter((s) => s && s !== \"*\");\n if (!segs.length) return \"\";\n if (segs[0] === \"crate\") return [\"crate\", ...segs.slice(1)].join(\"/\");\n if (segs[0] === \"super\") return [\"..\", ...segs.slice(1)].join(\"/\");\n if (segs[0] === \"self\") return [\".\", ...segs.slice(1)].join(\"/\");\n return segs.join(\"/\"); // external crate (std, serde, …)\n}\n\nfunction probeRs(base: string, fileSet: Set<string>): string[] {\n for (const cand of [`${base}.rs`, `${base}/mod.rs`]) {\n if (fileSet.has(cand)) return [cand];\n }\n return [];\n}\n\nconst ROOT_FILES = new Set([\"mod.rs\", \"lib.rs\", \"main.rs\"]);\n\nfunction specifiers(content: string): Set<string> {\n const out = new Set<string>();\n MOD.lastIndex = 0;\n let m: RegExpExecArray | null;\n while ((m = MOD.exec(content))) out.add(`./${m[1]}`);\n USE.lastIndex = 0;\n while ((m = USE.exec(content))) {\n const n = normalizeUse(m[1]);\n if (n) out.add(n);\n }\n return out;\n}\n\nexport const rustResolver: LanguageResolver = {\n id: \"rust\",\n extensions: RS_EXTENSIONS,\n specifiers,\n resolve(spec, fromFile, ctx: ResolveCtx) {\n const fileSet = ctx.fileSet;\n if (spec.startsWith(\"./\") || spec.startsWith(\"../\")) {\n const name = spec.replace(/^\\.\\//, \"\");\n // Candidate 1: sibling of the current file.\n const sibling = normalize(join(dirname(fromFile), spec)).replace(/\\\\/g, \"/\");\n let hit = probeRs(sibling, fileSet);\n if (hit.length) return hit;\n // Candidate 2: owner-directory rule — `mod x;` in `foo.rs` lives in `foo/x.rs`.\n if (spec.startsWith(\"./\") && !ROOT_FILES.has(basename(fromFile))) {\n const owner = join(dirname(fromFile), basename(fromFile, \".rs\"), name);\n hit = probeRs(normalize(owner).replace(/\\\\/g, \"/\"), fileSet);\n if (hit.length) return hit;\n }\n return [];\n }\n if (spec.startsWith(\"crate/\")) {\n // Resolve against the nearest `src/` ancestor of the importing file.\n const parts = fromFile.split(\"/\");\n const srcIdx = parts.lastIndexOf(\"src\");\n const srcRoot = srcIdx >= 0 ? parts.slice(0, srcIdx + 1).join(\"/\") : dirname(fromFile);\n const rest = spec.slice(\"crate/\".length).split(\"/\");\n // Try full path, then drop the trailing segment (often an item, not a module).\n for (const r of [rest.join(\"/\"), rest.slice(0, -1).join(\"/\")]) {\n if (!r) continue;\n const hit = probeRs(`${srcRoot}/${r}`, fileSet);\n if (hit.length) return hit;\n }\n return [];\n }\n return []; // external crate\n },\n};\n","import { dirname, extname, join, normalize } from \"node:path\";\nimport type { LanguageResolver, ResolveCtx } from \"./types\";\n\n// Heuristic fallback for every recognized source extension without a precise\n// resolver (Swift, Java, Ruby, Kotlin, C#, PHP, C/C++, …). Best-effort and\n// deterministic: extract common import/require/include/using forms, then resolve\n// path-like specifiers relative to the importing file (preferring its own\n// extension) or repo-relative. Module-only specifiers that map to no file\n// (e.g. Swift `import Foo`) stay unresolved — that's the documented tradeoff.\n\nexport const FALLBACK_EXTENSIONS = [\n \".swift\", \".java\", \".rb\", \".kt\", \".kts\", \".cs\", \".php\", \".scala\",\n \".c\", \".h\", \".cpp\", \".hpp\", \".cc\", \".hh\", \".m\", \".mm\",\n \".ex\", \".exs\", \".lua\", \".dart\", \".vue\", \".svelte\",\n];\n\nconst PATTERNS = [\n /\\b(?:require_relative|require|include|import|use|using|from)\\s*\\(?\\s*['\"]([^'\"`\\n]+)['\"]/g,\n /(?:^|[\\n;])\\s*import\\s+([\\w.]+)/g, // java/swift: import a.b.C\n /(?:^|[\\n;])\\s*from\\s+([\\w.]+)\\s+import\\b/g, // python-like\n /(?:^|[\\n;])\\s*using\\s+([\\w.]+)\\s*;/g, // C#: using A.B;\n /(?:^|[\\n;])\\s*use\\s+([\\w\\\\]+)/g, // php: use A\\B\\C;\n /#\\s*include\\s*[<\"]([^>\"\\n]+)[>\"]/g, // C/C++: #include \"x\"\n];\n\nfunction specifiers(content: string): Set<string> {\n const out = new Set<string>();\n for (const re of PATTERNS) {\n re.lastIndex = 0;\n let m: RegExpExecArray | null;\n while ((m = re.exec(content))) {\n const s = m[1].trim();\n if (s) out.add(s);\n }\n }\n return out;\n}\n\nexport const fallbackResolver: LanguageResolver = {\n id: \"fallback\",\n extensions: FALLBACK_EXTENSIONS,\n specifiers,\n resolve(spec, fromFile, ctx: ResolveCtx) {\n const own = extname(fromFile).toLowerCase();\n const exts = [own, ...FALLBACK_EXTENSIONS].filter((e, i, a) => e && a.indexOf(e) === i);\n\n const hasSep = spec.includes(\"/\") || spec.includes(\"\\\\\");\n // Path-like (relative or already slashed) → keep; dotted/`::` module → slashes.\n const path = spec.startsWith(\".\") || hasSep\n ? spec.replace(/\\\\/g, \"/\")\n : spec.replace(/[.:]+/g, \"/\");\n\n const bases = [\n normalize(join(dirname(fromFile), path)).replace(/\\\\/g, \"/\"), // relative to file\n path.replace(/^\\.\\//, \"\"), // repo-relative\n ];\n for (const b of bases) {\n if (ctx.fileSet.has(b)) return [b]; // spec already had an extension\n for (const e of exts) {\n const cand = b.endsWith(e) ? b : `${b}${e}`;\n if (ctx.fileSet.has(cand)) return [cand];\n if (ctx.fileSet.has(`${b}/index${e}`)) return [`${b}/index${e}`];\n }\n }\n return [];\n },\n};\n","import { extname } from \"node:path\";\nimport type { LanguageResolver } from \"./types\";\nimport { tsResolver } from \"./ts\";\nimport { pythonResolver } from \"./python\";\nimport { goResolver } from \"./go\";\nimport { rustResolver } from \"./rust\";\nimport { fallbackResolver } from \"./fallback\";\n\nexport type { Alias, LanguageResolver, ResolveCtx } from \"./types\";\n\n// The registry: precise resolvers first, the heuristic fallback last. Extensions are\n// disjoint, so dispatch is unambiguous; the order only documents intent.\nexport const RESOLVERS: LanguageResolver[] = [\n tsResolver,\n pythonResolver,\n goResolver,\n rustResolver,\n fallbackResolver,\n];\n\nconst RESOLVER_BY_EXT = new Map<string, LanguageResolver>();\nfor (const r of RESOLVERS) for (const e of r.extensions) RESOLVER_BY_EXT.set(e, r);\n\n// Extension → clean, groupable language id (for the CodeFile.lang tag + canvas color).\n// Extensions present in the registry but absent here fall back to the bare extension.\nconst LANG_BY_EXT: Record<string, string> = {\n \".ts\": \"ts\", \".tsx\": \"ts\",\n \".js\": \"js\", \".jsx\": \"js\", \".mjs\": \"js\", \".cjs\": \"js\",\n \".py\": \"py\", \".pyi\": \"py\",\n \".go\": \"go\",\n \".rs\": \"rs\",\n \".swift\": \"swift\",\n \".java\": \"java\",\n \".rb\": \"ruby\",\n \".kt\": \"kotlin\", \".kts\": \"kotlin\",\n \".cs\": \"csharp\",\n \".php\": \"php\",\n \".scala\": \"scala\",\n \".c\": \"c\", \".h\": \"c\",\n \".cpp\": \"cpp\", \".hpp\": \"cpp\", \".cc\": \"cpp\", \".hh\": \"cpp\",\n \".m\": \"objc\", \".mm\": \"objc\",\n \".ex\": \"elixir\", \".exs\": \"elixir\",\n \".lua\": \"lua\", \".dart\": \"dart\", \".vue\": \"vue\", \".svelte\": \"svelte\",\n};\n\n/** The resolver that handles this file's extension, or null if not a source file. */\nexport function resolverForPath(path: string): LanguageResolver | null {\n return RESOLVER_BY_EXT.get(extname(path).toLowerCase()) ?? null;\n}\n\n/** Clean language id for a path (by extension), or null if not graphed. */\nexport function detectLang(path: string): string | null {\n const ext = extname(path).toLowerCase();\n if (!RESOLVER_BY_EXT.has(ext)) return null;\n return LANG_BY_EXT[ext] ?? ext.slice(1);\n}\n\n/** Every extension any resolver claims — the scanner's allow-list. */\nexport function allExtensions(): Set<string> {\n return new Set(RESOLVER_BY_EXT.keys());\n}\n","import { existsSync, readFileSync } from \"node:fs\";\nimport { join, resolve } from \"node:path\";\nimport chokidar from \"chokidar\";\nimport { createCodeGraphBuilder } from \"@/intel/extractors/code-graph\";\nimport { ingestCodeGraph } from \"@/lib/code-graph\";\nimport { getDb } from \"@/lib/db-drizzle\";\nimport { dbUrlFor, ensureWorkspaceDb } from \"@/lib/workspaces\";\n\n// Per-workspace in-process code-graph watcher. The manager (intel/watch-manager.ts)\n// starts one of these per active repo. Each pins its writes to its OWN workspace DB —\n// never the dropdown-active one — so a save in repo A can never corrupt repo B's graph.\n// Code-graph only (cheap, deterministic, no AI); the standalone intel/watch.ts still\n// owns the AI DB/endpoints pipeline. Both writers are idempotent so co-running is safe.\n\nconst IGNORE =\n /[/\\\\](node_modules|\\.git|\\.next|dist|build|__pycache__|target|\\.venv|venv|\\.beacon|\\.playwright-mcp|generated|coverage)[/\\\\]/;\n\ninterface WatchTarget {\n id: string;\n path: string;\n name: string;\n}\n\n/** Configured roots for a repo: beacon.config.json `roots` if present, else the repo itself. */\nfunction rootsForRepo(repoPath: string): string[] {\n try {\n const cfgPath = join(repoPath, \"beacon.config.json\");\n if (existsSync(cfgPath)) {\n const cfg = JSON.parse(readFileSync(cfgPath, \"utf8\"));\n if (Array.isArray(cfg.roots) && cfg.roots.length) {\n return cfg.roots.map((r: string) => resolve(repoPath, r));\n }\n }\n } catch {\n /* malformed config — fall back to the repo root */\n }\n return [repoPath];\n}\n\n/** Start a live, incremental code-graph watcher for one workspace. */\nexport function startWatcherForWorkspace(ws: WatchTarget): { stop: () => Promise<void> } {\n const roots = rootsForRepo(ws.path);\n // Provision/migrate in the background and await it before the first ingest (below) so a brand-new\n // or migration-behind db is ready when the watcher's first tick writes. Cached per process → cheap.\n const dbReady = ensureWorkspaceDb(ws.id);\n const targetDb = getDb(dbUrlFor(ws.id));\n\n // One builder for the watcher's lifetime — its specifier cache makes each tick\n // incremental (only changed files are re-read). Base = repo path → repo-relative paths.\n const builder = createCodeGraphBuilder(roots, ws.path);\n let debounce: ReturnType<typeof setTimeout> | null = null;\n let running = false;\n\n async function run() {\n if (running) {\n schedule();\n return;\n }\n running = true;\n try {\n await dbReady;\n const graph = builder.build();\n const r = await ingestCodeGraph(graph, targetDb);\n console.log(\n `[beacon-inline] code-graph synced (${ws.name}): ${r.files} files / ${r.edges} imports${\n r.circular > 0 ? ` (${r.circular} circular)` : \"\"\n }`,\n );\n } catch (e) {\n console.error(`[beacon-inline] error (${ws.name}):`, e instanceof Error ? e.message : e);\n } finally {\n running = false;\n }\n }\n\n function schedule() {\n if (debounce) clearTimeout(debounce);\n debounce = setTimeout(run, 600);\n }\n\n const watcher = chokidar.watch(roots, {\n ignored: (p: string) => IGNORE.test(p),\n ignoreInitial: true,\n persistent: true,\n });\n\n watcher.on(\"ready\", () => {\n console.log(`[beacon-inline] watching ${ws.name} (${roots.join(\", \")}) — initial extract…`);\n void run();\n });\n watcher.on(\"all\", () => schedule());\n watcher.on(\"error\", (e) => console.error(`[beacon-inline] watcher error (${ws.name}):`, e));\n\n return {\n async stop() {\n if (debounce) clearTimeout(debounce);\n await watcher.close();\n },\n };\n}\n","import { existsSync } from \"node:fs\";\nimport { getWorkspace, listWorkspaces } from \"@/lib/workspaces\";\nimport { startWatcherForWorkspace } from \"@/intel/watch-inline\";\n\n// Manages one code-graph watcher per ACTIVE workspace. The Beacon daemon serves every\n// registered repo, but watching all of them would be N chokidar instances + N scans for\n// repos you aren't using. So we watch the recently-opened subset (top-N by lastOpenedAt)\n// and lazily warm a watcher for any repo the moment it's queried (ensureWatcher). The\n// active-watcher set doubles as the staleness signal's \"is this repo being watched?\".\n\nexport interface WatchableWorkspace {\n id: string;\n path: string;\n name: string;\n}\n\nexport interface WatcherHandle {\n stop: () => Promise<void>;\n}\n\nexport interface WatcherManagerDeps {\n list: () => WatchableWorkspace[]; // registry, most-recently-opened first\n get: (id: string) => WatchableWorkspace | null;\n exists: (path: string) => boolean;\n start: (ws: WatchableWorkspace) => WatcherHandle;\n /** How many top workspaces get an auto-started watcher on boot/reconcile. */\n limit?: number;\n /** Absolute cap on concurrent watchers (auto + lazy) before LRU eviction kicks in. */\n hardCap?: number;\n}\n\nexport function createWatcherManager(deps: WatcherManagerDeps) {\n const limit = deps.limit ?? 6;\n const hardCap = deps.hardCap ?? 12;\n const active = new Map<string, { handle: WatcherHandle; seq: number }>();\n let seq = 0;\n let topIds = new Set<string>();\n\n function touch(id: string): void {\n const e = active.get(id);\n if (e) e.seq = ++seq;\n }\n\n function startFor(ws: WatchableWorkspace): void {\n if (active.has(ws.id)) return touch(ws.id);\n if (!deps.exists(ws.path)) return;\n active.set(ws.id, { handle: deps.start(ws), seq: ++seq });\n }\n\n /** Stop the oldest watcher that isn't in the current top-N (protected) set. */\n function evictLruNonTop(): void {\n let victim: string | null = null;\n let min = Infinity;\n for (const [id, e] of active) {\n if (topIds.has(id)) continue;\n if (e.seq < min) {\n min = e.seq;\n victim = id;\n }\n }\n if (victim) {\n void active.get(victim)!.handle.stop();\n active.delete(victim);\n }\n }\n\n /** Start watchers for the top-N existing workspaces; stop any whose repo vanished. */\n function reconcile(): void {\n const top = deps.list().filter((w) => deps.exists(w.path)).slice(0, limit);\n topIds = new Set(top.map((w) => w.id));\n for (const ws of top) startFor(ws);\n for (const [id, e] of [...active]) {\n const ws = deps.get(id);\n if (!ws || !deps.exists(ws.path)) {\n void e.handle.stop();\n active.delete(id);\n }\n }\n }\n\n /** Lazily warm a watcher for a repo being queried (no-op if already watching). */\n function ensureWatcher(id: string): void {\n if (active.has(id)) return touch(id);\n const ws = deps.get(id);\n if (!ws || !deps.exists(ws.path)) return;\n if (active.size >= hardCap) evictLruNonTop();\n if (active.size >= hardCap) return; // every watcher is top-N protected — refuse\n active.set(id, { handle: deps.start(ws), seq: ++seq });\n }\n\n function isWatching(id: string): boolean {\n return active.has(id);\n }\n\n function activeIds(): string[] {\n return [...active.keys()];\n }\n\n async function stopAll(): Promise<void> {\n await Promise.all([...active.values()].map((e) => e.handle.stop()));\n active.clear();\n }\n\n return { reconcile, ensureWatcher, isWatching, activeIds, stopAll };\n}\n\n// ── Process-wide singleton, wired to the real registry + watcher factory ──────────\n\nconst manager = createWatcherManager({\n list: listWorkspaces,\n get: getWorkspace,\n exists: existsSync,\n start: (ws) => startWatcherForWorkspace(ws),\n});\n\nlet timer: ReturnType<typeof setInterval> | null = null;\n\n/** Boot watchers for the active workspaces and keep reconciling as the registry changes. */\nexport function startWorkspaceWatchers(): void {\n manager.reconcile();\n if (!timer) {\n timer = setInterval(() => manager.reconcile(), 30_000);\n timer.unref?.();\n }\n}\n\n/** Lazily ensure a queried repo has a live watcher (called by the context/blast-radius routes). */\nexport function ensureWatcher(id: string): void {\n manager.ensureWatcher(id);\n}\n\n/** Whether a workspace's code graph is being kept live right now (staleness signal). */\nexport function isWatching(id: string): boolean {\n return manager.isWatching(id);\n}\n\nexport async function stopWorkspaceWatchers(): Promise<void> {\n if (timer) {\n clearInterval(timer);\n timer = null;\n }\n await manager.stopAll();\n}\n"],"names":["EntryTypes","FILE_TYPE","DIR_TYPE","FILE_DIR_TYPE","EVERYTHING_TYPE","defaultOptions","root","fileFilter","_entryInfo","directoryFilter","type","lstat","depth","alwaysStat","highWaterMark","Object","freeze","RECURSIVE_ERROR_CODE","NORMAL_FLOW_ERRORS","Set","ALL_TYPES","DIR_TYPES","FILE_TYPES","isNormalFlowError","error","has","code","wantBigintFsStats","process","platform","emptyFn","normalizeFilter","filter","undefined","fl","trim","entry","basename","Array","isArray","trItems","map","item","some","f","ReaddirpStream","parents","reading","parent","_stat","_maxDepth","_wantsDir","_wantsFile","_wantsEverything","_root","_isDirent","_statsProp","_rdOptions","_fileFilter","_directoryFilter","options","objectMode","autoDestroy","opts","statMethod","Number","isSafeInteger","encoding","withFileTypes","_exploreDir","_read","batch","destroyed","par","fil","files","length","path","slice","splice","dirent","_formatEntry","awaited","Promise","all","entryType","_getEntryType","push","fullPath","_includeAsFile","pop","destroy","_onError","name","err","emit","stats","isFile","isDirectory","isSymbolicLink","full","entryRealPath","entryRealPathStats","len","startsWith","substr","recursiveError","Error","readdirp","TypeError","includes","join","readdirpPromise","resolve","reject","on","TS_EXTENSIONS","IMPORT_PATTERNS","toPosix","p","split","probe","repoRel","fileSet","ext","specifiers","content","out","re","lastIndex","m","exec","add","resolveSpec","spec","fromFile","aliases","abs","replace","a","from","rest","to","hit","tsResolver","id","extensions","ctx","tsAliases","IGNORE","rootsForRepo","repoPath","cfgPath","cfg","JSON","parse","roots","r","startWatcherForWorkspace","ws","dbReady","targetDb","builder","debounce","running","run","schedule","graph","build","console","log","edges","circular","e","message","clearTimeout","setTimeout","watcher","watch","ignored","test","ignoreInitial","persistent","stop","close","createWatcherManager","deps","limit","hardCap","active","Map","seq","topIds","touch","get","startFor","exists","set","handle","start","evictLruNonTop","victim","min","Infinity","delete","reconcile","top","list","w","ensureWatcher","size","isWatching","activeIds","keys","stopAll","values","clear","manager","timer","startWorkspaceWatchers","setInterval","unref","stopWorkspaceWatchers","clearInter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AchE,CAAU,EACtCwE,EAAQR,aAAa,CAAChE,EACxB,iBAGO,SAASkE,AAAWlE,CAAU,EACnC,OAAOwE,EAAQN,UAAU,CAAClE,EAC5B","ignoreList":[0,1,2]}
@@ -0,0 +1,3 @@
1
+ module.exports=[18622,(e,t,n)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,n)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,n)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},70406,(e,t,n)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},93695,(e,t,n)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},60338,e=>{"use strict";var t=e.i(56325),n=e.i(44988),r=e.i(18899);e.s(["avg",0,function(e){return r.sql`avg(${e})`.mapWith(String)},"avgDistinct",0,function(e){return r.sql`avg(distinct ${e})`.mapWith(String)},"count",0,function(e){return r.sql`count(${e||r.sql.raw("*")})`.mapWith(Number)},"countDistinct",0,function(e){return r.sql`count(distinct ${e})`.mapWith(Number)},"max",0,function(e){return r.sql`max(${e})`.mapWith((0,n.is)(e,t.Column)?e:String)},"min",0,function(e){return r.sql`min(${e})`.mapWith((0,n.is)(e,t.Column)?e:String)},"sum",0,function(e){return r.sql`sum(${e})`.mapWith(String)},"sumDistinct",0,function(e){return r.sql`sum(distinct ${e})`.mapWith(String)}])},3723,e=>e.a(async(t,n)=>{try{var r=e.i(75225),a=e.i(91426),i=e.i(34700),o=t([a]);function l(e){let t=Math.floor(e/12);return{x:-300-280*t,y:e%12*60}}async function s(e=a.db){let t=await e.query.endpoint.findMany({orderBy:(e,{asc:t,desc:n})=>[t(e.y),n(e.x),t(e.id)]});if(0===t.length)return 0;let n=0;for(let a=0;a<t.length;a++){let{x:o,y:s}=l(a),u=t[a];(u.x!==o||u.y!==s)&&(await e.update(i.endpoint).set({x:o,y:s}).where((0,r.eq)(i.endpoint.id,u.id)),n++)}return n}async function u(e=a.db){let[t,n]=await Promise.all([e.query.dbTable.findFirst({orderBy:(e,{desc:t})=>t(e.y)}),e.query.endpoint.findFirst({orderBy:(e,{desc:t})=>t(e.y)})]),r=Math.max(t?.y??0,n?.y??0);return r>0?r+280:0}[a]=o.then?(await o)():o,e.s(["computeDraftOriginY",0,u,"endpointsOverlap",0,function(e){for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++){let r=e[t],a=e[n];if(r.x<a.x+240&&r.x+240>a.x&&r.y<a.y+50&&r.y+50>a.y)return!0}return!1},"gridPositionForEndpoint",0,l,"relayoutEndpoints",0,s]),n()}catch(e){n(e)}},!1),46409,e=>e.a(async(t,n)=>{try{var r=e.i(75225),a=e.i(91426),i=e.i(34700),o=t([a]);async function l(e=a.db){let[t,n]=await Promise.all([e.query.endpoint.findMany({where:(e,{ne:t})=>t(e.source,"INTROSPECTION")}),e.query.endpoint.findMany({where:(e,{eq:t})=>t(e.source,"INTROSPECTION")})]),o={collapsed:0,mappings:[]};for(let a of t){let t=n.find(e=>(function(e,t){if(e.method.toUpperCase()!==t.method.toUpperCase())return!1;let n=e.path.replace(/\{[^}]*\}/g,"{}"),r=t.path.replace(/\{[^}]*\}/g,"{}");return r===n||r.endsWith(n)})(a,e));t&&(await e.delete(i.endpoint).where((0,r.eq)(i.endpoint.id,a.id)),o.collapsed++,o.mappings.push({planned:`${a.method} ${a.path}`,code:`${t.method} ${t.path}`}))}return o}[a]=o.then?(await o)():o,e.s(["reconcilePlannedEndpoints",0,l]),n()}catch(e){n(e)}},!1),96902,e=>e.a(async(t,n)=>{try{var r=e.i(75225),a=e.i(91426),i=e.i(34700),o=t([a]);function l(e){return 36+30*Math.max(0,e)+16}function s(e,t=[]){let n=[,,,,].fill(0);for(let e of t){let t=Math.max(0,Math.min(3,Math.round(e.x/320))),r=e.y+l(e.columnCount)+50;r>n[t]&&(n[t]=r)}let r=new Map;for(let t of e){let e=0;for(let t=1;t<4;t++)n[t]<n[e]&&(e=t);let a=320*e,i=n[e];r.set(t.key,{x:a,y:i}),n[e]=i+l(t.columnCount)+50}return r}async function u(e=a.db){let t=await e.query.dbTable.findMany({where:(e,{eq:t})=>t(e.source,"INTROSPECTION"),with:{columns:{columns:{id:!0}}},orderBy:(e,{asc:t})=>t(e.name)});if(0===t.length)return 0;let n=s(t.map(e=>({key:e.id,columnCount:e.columns.length}))),o=0;for(let a of t){let t=n.get(a.id);t&&(Math.round(t.x)!==Math.round(a.x)||Math.round(t.y)!==Math.round(a.y))&&(await e.update(i.dbTable).set({x:t.x,y:t.y}).where((0,r.eq)(i.dbTable.id,a.id)),o++)}return o}[a]=o.then?(await o)():o,e.s(["estimateTableHeight",0,l,"packTablesMasonry",0,s,"relayoutTables",0,u,"tablesOverlap",0,function(e){for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++){let r=e[t],a=e[n],i=l(r.columnCount),o=l(a.columnCount);if(r.x<a.x+300&&r.x+300>a.x&&r.y<a.y+o&&r.y+i>a.y)return!0}return!1}]),n()}catch(e){n(e)}},!1),6659,e=>e.a(async(t,n)=>{try{var r=e.i(69719),a=e.i(75225),i=e.i(60338),o=e.i(18899),l=e.i(91426),s=e.i(34700),u=e.i(3723),d=e.i(46409),c=e.i(96902),m=t([l,u,d,c]);[l,u,d,c]=m.then?(await m)():m;let h=r.z.object({tables:r.z.array(r.z.object({name:r.z.string().trim().min(1),domain:r.z.string().nullish(),description:r.z.string().nullish(),columns:r.z.array(r.z.object({name:r.z.string().trim().min(1),type:r.z.string().trim().min(1),isPk:r.z.boolean().optional(),isFk:r.z.boolean().optional(),nullable:r.z.boolean().optional(),note:r.z.string().nullish()})).default([])})).default([]),relations:r.z.array(r.z.object({fromTable:r.z.string(),fromColumn:r.z.string(),toTable:r.z.string(),toColumn:r.z.string(),label:r.z.string().nullish()})).default([]),endpoints:r.z.array(r.z.object({method:r.z.string().trim().min(1),path:r.z.string().trim().min(1),domain:r.z.string().nullish(),description:r.z.string().nullish(),uses:r.z.array(r.z.object({table:r.z.string(),access:r.z.string().default("read")})).default([])})).default([])});async function p(e=l.db){let t=await e.query.syncState.findFirst({where:(e,{eq:t})=>t(e.id,"singleton")});return t?.version??0}async function y(e=l.db){let[t]=await e.insert(s.syncState).values({id:"singleton",version:1}).onConflictDoUpdate({target:s.syncState.id,set:{version:o.sql`${s.syncState.version} + 1`}}).returning();return t.version}async function f(e,t=l.db){let n=h.parse(e),r=n.tables.map(e=>e.name);await t.delete(s.dbTable).where(r.length?(0,a.and)((0,a.eq)(s.dbTable.source,"INTROSPECTION"),(0,a.notInArray)(s.dbTable.name,r)):(0,a.eq)(s.dbTable.source,"INTROSPECTION"));let o=await t.query.dbTable.findMany({columns:{name:!0,x:!0,y:!0},with:{columns:{columns:{id:!0}}}}),m=new Map(o.map(e=>[e.name,e])),p=(0,c.packTablesMasonry)(n.tables.filter(e=>!m.has(e.name)).map(e=>({key:e.name,columnCount:e.columns.length})),o.map(e=>({x:e.x,y:e.y,columnCount:e.columns.length}))),b=new Map;for(let e of n.tables){let n=m.get(e.name),r=p.get(e.name),i=n?.x??r?.x??0,o=n?.y??r?.y??0,[l]=await t.insert(s.dbTable).values({name:e.name,domain:e.domain??null,description:e.description??null,source:"INTROSPECTION",x:i,y:o}).onConflictDoUpdate({target:s.dbTable.name,set:{domain:e.domain??null,description:e.description??null,source:"INTROSPECTION"}}).returning();b.set(e.name,l.id),await t.delete(s.dbColumn).where((0,a.eq)(s.dbColumn.tableId,l.id)),e.columns.length&&await t.insert(s.dbColumn).values(e.columns.map((e,t)=>({tableId:l.id,name:e.name,type:e.type,isPk:e.isPk??!1,isFk:e.isFk??!1,nullable:e.nullable??!0,note:e.note??null,ord:t})))}let g=[...b.values()];for(let e of(g.length&&await t.delete(s.dbRelation).where((0,a.or)((0,a.inArray)(s.dbRelation.fromTableId,g),(0,a.inArray)(s.dbRelation.toTableId,g))),n.relations)){let n=b.get(e.fromTable),r=b.get(e.toTable);n&&r&&await t.insert(s.dbRelation).values({fromTableId:n,toTableId:r,fromColumn:e.fromColumn,toColumn:e.toColumn,label:e.label??`${e.fromColumn} → ${e.toTable}.${e.toColumn}`})}let w=new Set(n.endpoints.map(e=>`${e.method} ${e.path}`)),x=(await t.query.endpoint.findMany({where:(e,{eq:t})=>t(e.source,"INTROSPECTION")})).filter(e=>!w.has(`${e.method} ${e.path}`)).map(e=>e.id);x.length&&await t.delete(s.endpoint).where((0,a.inArray)(s.endpoint.id,x));let T=(await t.select({n:(0,i.count)()}).from(s.endpoint))[0].n;for(let e of n.endpoints){let n,r,i=await t.query.endpoint.findFirst({where:(t,{and:n,eq:r})=>n(r(t.method,e.method),r(t.path,e.path))});if(i)n=i.x,r=i.y;else{let e=(0,u.gridPositionForEndpoint)(T);n=e.x,r=e.y,T++}let[o]=await t.insert(s.endpoint).values({method:e.method,path:e.path,domain:e.domain??null,description:e.description??null,source:"INTROSPECTION",x:n,y:r}).onConflictDoUpdate({target:[s.endpoint.method,s.endpoint.path],set:{domain:e.domain??null,description:e.description??null,source:"INTROSPECTION"}}).returning();for(let n of(await t.delete(s.endpointTable).where((0,a.eq)(s.endpointTable.endpointId,o.id)),e.uses)){let e=b.get(n.table)??(await t.query.dbTable.findFirst({where:(e,{eq:t})=>t(e.name,n.table)}))?.id;e&&await t.insert(s.endpointTable).values({endpointId:o.id,tableId:e,access:n.access})}}await (0,d.reconcilePlannedEndpoints)(t);let q=await t.query.dbTable.findMany({where:(e,{eq:t})=>t(e.source,"INTROSPECTION"),columns:{x:!0,y:!0},with:{columns:{columns:{id:!0}}}});(0,c.tablesOverlap)(q.map(e=>({x:e.x,y:e.y,columnCount:e.columns.length})))&&await (0,c.relayoutTables)(t);let C=await t.select({x:s.endpoint.x,y:s.endpoint.y}).from(s.endpoint);(0,u.endpointsOverlap)(C)&&await (0,u.relayoutEndpoints)(t);let v=await y(t);return{tables:n.tables.length,relations:n.relations.length,endpoints:n.endpoints.length,version:v}}e.s(["bumpVersion",0,y,"getVersion",0,p,"ingestSnapshot",0,f,"snapshotSchema",0,h]),n()}catch(e){n(e)}},!1),58708,e=>{"use strict";let t=null;async function n(){return t||(t=(async()=>{let{pipeline:t}=await e.A(46128);return await t("feature-extraction","Xenova/all-MiniLM-L6-v2")})().catch(e=>{throw t=null,e})),t}async function r(e){let t=e.trim();if(!t)return null;try{let e=await n(),r=await e(t,{pooling:"mean",normalize:!0});return Array.from(r.data)}catch(e){return console.error("[embeddings] failed:",e instanceof Error?e.message:e),null}}function a(e){return[e.title,e.role,e.plain,e.cluster].filter(Boolean).join(". ")}function i(e){return JSON.stringify(e)}async function o(t){try{let{db:n}=await e.A(35914),{node:o}=await e.A(29363),{eq:l}=await e.A(96359),s=await n.query.node.findFirst({where:(e,{eq:n})=>n(e.id,t),columns:{title:!0,role:!0,plain:!0,cluster:!0}});if(!s)return;let u=await r(a(s));if(!u)return;await n.update(o).set({embedding:i(u)}).where(l(o.id,t))}catch(e){console.error("[embeddings] reembed failed:",t,e instanceof Error?e.message:e)}}async function l(e,t){let n=await r(e);if(!n)return null;let a=[];for(let e of t){let t=function(e){if(!e)return null;try{let t=JSON.parse(e);if(!Array.isArray(t)||t.some(e=>"number"!=typeof e||!Number.isFinite(e)))return null;return t}catch{return null}}(e.embedding);t&&a.push({item:e,score:function(e,t){if(e.length!==t.length)return 0;let n=0,r=0,a=0;for(let i=0;i<e.length;i++)n+=e[i]*t[i],r+=e[i]*e[i],a+=t[i]*t[i];return 0===r||0===a?0:n/(Math.sqrt(r)*Math.sqrt(a))}(n,t)})}return a.sort((e,t)=>t.score-e.score),a}e.s(["embedText",0,r,"encodeVector",0,i,"nodeEmbeddingInput",0,a,"rankByQuery",0,l,"reembedNode",0,o])}];
2
+
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__0-68r22._.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../node_modules/src/sql/functions/aggregate.ts","../../../lib/endpoint-layout.ts","../../../lib/endpoint-reconcile.ts","../../../lib/table-layout.ts","../../../lib/ingest.ts","../../../lib/embeddings.ts"],"sourcesContent":["import { type AnyColumn, Column } from '~/column.ts';\nimport { is } from '~/entity.ts';\nimport { type SQL, sql, type SQLWrapper } from '../sql.ts';\n\n/**\n * Returns the number of values in `expression`.\n *\n * ## Examples\n *\n * ```ts\n * // Number employees with null values\n * db.select({ value: count() }).from(employees)\n * // Number of employees where `name` is not null\n * db.select({ value: count(employees.name) }).from(employees)\n * ```\n *\n * @see countDistinct to get the number of non-duplicate values in `expression`\n */\nexport function count(expression?: SQLWrapper): SQL<number> {\n\treturn sql`count(${expression || sql.raw('*')})`.mapWith(Number);\n}\n\n/**\n * Returns the number of non-duplicate values in `expression`.\n *\n * ## Examples\n *\n * ```ts\n * // Number of employees where `name` is distinct\n * db.select({ value: countDistinct(employees.name) }).from(employees)\n * ```\n *\n * @see count to get the number of values in `expression`, including duplicates\n */\nexport function countDistinct(expression: SQLWrapper): SQL<number> {\n\treturn sql`count(distinct ${expression})`.mapWith(Number);\n}\n\n/**\n * Returns the average (arithmetic mean) of all non-null values in `expression`.\n *\n * ## Examples\n *\n * ```ts\n * // Average salary of an employee\n * db.select({ value: avg(employees.salary) }).from(employees)\n * ```\n *\n * @see avgDistinct to get the average of all non-null and non-duplicate values in `expression`\n */\nexport function avg(expression: SQLWrapper): SQL<string | null> {\n\treturn sql`avg(${expression})`.mapWith(String);\n}\n\n/**\n * Returns the average (arithmetic mean) of all non-null and non-duplicate values in `expression`.\n *\n * ## Examples\n *\n * ```ts\n * // Average salary of an employee where `salary` is distinct\n * db.select({ value: avgDistinct(employees.salary) }).from(employees)\n * ```\n *\n * @see avg to get the average of all non-null values in `expression`, including duplicates\n */\nexport function avgDistinct(expression: SQLWrapper): SQL<string | null> {\n\treturn sql`avg(distinct ${expression})`.mapWith(String);\n}\n\n/**\n * Returns the sum of all non-null values in `expression`.\n *\n * ## Examples\n *\n * ```ts\n * // Sum of every employee's salary\n * db.select({ value: sum(employees.salary) }).from(employees)\n * ```\n *\n * @see sumDistinct to get the sum of all non-null and non-duplicate values in `expression`\n */\nexport function sum(expression: SQLWrapper): SQL<string | null> {\n\treturn sql`sum(${expression})`.mapWith(String);\n}\n\n/**\n * Returns the sum of all non-null and non-duplicate values in `expression`.\n *\n * ## Examples\n *\n * ```ts\n * // Sum of every employee's salary where `salary` is distinct (no duplicates)\n * db.select({ value: sumDistinct(employees.salary) }).from(employees)\n * ```\n *\n * @see sum to get the sum of all non-null values in `expression`, including duplicates\n */\nexport function sumDistinct(expression: SQLWrapper): SQL<string | null> {\n\treturn sql`sum(distinct ${expression})`.mapWith(String);\n}\n\n/**\n * Returns the maximum value in `expression`.\n *\n * ## Examples\n *\n * ```ts\n * // The employee with the highest salary\n * db.select({ value: max(employees.salary) }).from(employees)\n * ```\n */\nexport function max<T extends SQLWrapper>(expression: T): SQL<(T extends AnyColumn ? T['_']['data'] : string) | null> {\n\treturn sql`max(${expression})`.mapWith(is(expression, Column) ? expression : String) as any;\n}\n\n/**\n * Returns the minimum value in `expression`.\n *\n * ## Examples\n *\n * ```ts\n * // The employee with the lowest salary\n * db.select({ value: min(employees.salary) }).from(employees)\n * ```\n */\nexport function min<T extends SQLWrapper>(expression: T): SQL<(T extends AnyColumn ? T['_']['data'] : string) | null> {\n\treturn sql`min(${expression})`.mapWith(is(expression, Column) ? expression : String) as any;\n}\n","import { count, eq } from \"drizzle-orm\";\nimport { db, type DB } from \"@/lib/db-drizzle\";\nimport { endpoint } from \"@/lib/drizzle/schema\";\n\n// Endpoints are uniform 240px-wide pill cards on /db, kept to the left of the table\n// gutter (negative x). The previous layout stacked every endpoint in one column at\n// y = i * 110, so a real backend like Beacon ended up with a 4000px-tall stack the\n// user had to scroll past. We now wrap into a multi-column grid that grows leftward,\n// so the canvas reads as a compact block instead of a fence.\n\nconst EP_ROW_HEIGHT = 60;\nconst EP_COL_WIDTH = 280;\nconst EP_BASE_X = -300; // closest column to the tables on the right\nconst EP_ROWS_PER_COL = 12;\nconst EP_CARD_WIDTH = 240;\nconst EP_CARD_HEIGHT = 50;\n\n/**\n * Bounding-box overlap check ingest uses to decide whether to self-heal the column.\n * Endpoint cards are uniform 240px wide × ~40px tall pills — anything overlapping\n * means an old single-column ingest left a stack behind, or two ingest runs collided.\n */\nexport function endpointsOverlap(\n eps: ReadonlyArray<{ x: number; y: number }>,\n): boolean {\n for (let i = 0; i < eps.length; i++) {\n for (let j = i + 1; j < eps.length; j++) {\n const a = eps[i];\n const b = eps[j];\n if (\n a.x < b.x + EP_CARD_WIDTH &&\n a.x + EP_CARD_WIDTH > b.x &&\n a.y < b.y + EP_CARD_HEIGHT &&\n a.y + EP_CARD_HEIGHT > b.y\n ) {\n return true;\n }\n }\n }\n return false;\n}\n\nexport function gridPositionForEndpoint(index: number): { x: number; y: number } {\n const col = Math.floor(index / EP_ROWS_PER_COL);\n const row = index % EP_ROWS_PER_COL;\n return { x: EP_BASE_X - col * EP_COL_WIDTH, y: row * EP_ROW_HEIGHT };\n}\n\n/**\n * One-off repair: re-pack every endpoint into a clean grid. Stable order — sorts by\n * current (y, x) so the user's visual ordering carries over across the change, then by\n * id as a tiebreaker.\n */\nexport async function relayoutEndpoints(prisma: DB = db): Promise<number> {\n const eps = await prisma.query.endpoint.findMany({\n orderBy: (t, { asc, desc }) => [asc(t.y), desc(t.x), asc(t.id)],\n });\n if (eps.length === 0) return 0;\n let moved = 0;\n for (let i = 0; i < eps.length; i++) {\n const { x, y } = gridPositionForEndpoint(i);\n const e = eps[i];\n if (e.x === x && e.y === y) continue;\n await prisma.update(endpoint).set({ x, y }).where(eq(endpoint.id, e.id));\n moved++;\n }\n return moved;\n}\n\n/**\n * Where to drop the next NEW endpoint so it lands in the first unfilled grid slot.\n * Used by ingest to keep code-derived endpoints from re-stacking the old single column.\n */\nexport async function nextEndpointSlot(prisma: DB = db): Promise<{ x: number; y: number }> {\n const [{ n }] = await prisma.select({ n: count() }).from(endpoint);\n return gridPositionForEndpoint(n);\n}\n\n/**\n * Where to drop a freshly-proposed draft on the /db canvas so it doesn't land on top of\n * the existing tables/endpoints. Returns the largest y in use plus a margin, or 0 if the\n * canvas is empty.\n */\nconst DRAFT_MARGIN = 280;\nexport async function computeDraftOriginY(prisma: DB = db): Promise<number> {\n const [topTbl, topEp] = await Promise.all([\n prisma.query.dbTable.findFirst({ orderBy: (t, { desc }) => desc(t.y) }),\n prisma.query.endpoint.findFirst({ orderBy: (t, { desc }) => desc(t.y) }),\n ]);\n const maxY = Math.max(topTbl?.y ?? 0, topEp?.y ?? 0);\n return maxY > 0 ? maxY + DRAFT_MARGIN : 0;\n}\n","import { eq } from \"drizzle-orm\";\nimport { db, type DB } from \"@/lib/db-drizzle\";\nimport { endpoint } from \"@/lib/drizzle/schema\";\n\n// Plans and code rarely share a path prefix: a feature designed as `/orgs` ships at\n// `/api/v1/orgs`. We collapse a planned (MANUAL) endpoint into its code-derived\n// (INTROSPECTION) twin when the verbs match and the code path ends with the planned path\n// on a segment boundary, ignoring path-param names.\n\nconst normalize = (path: string) => path.replace(/\\{[^}]*\\}/g, \"{}\");\n\nexport function isImplementedBy(\n planned: { method: string; path: string },\n code: { method: string; path: string },\n): boolean {\n if (planned.method.toUpperCase() !== code.method.toUpperCase()) return false;\n const p = normalize(planned.path);\n const c = normalize(code.path);\n // planned paths start with \"/\", so endsWith() already lands on a segment boundary.\n return c === p || c.endsWith(p);\n}\n\nexport interface ReconcileReport {\n collapsed: number;\n mappings: { planned: string; code: string }[];\n}\n\n/**\n * Deletes planned endpoints (anything not code-derived — drafts approved as MANUAL, init/\n * session scaffolds) once they have an INTROSPECTION twin, so the canvas shows reality\n * instead of duplicates. Unbuilt plans are left intact. Returns what was collapsed (also\n * surfaces the planned→code path discrepancy to the caller).\n */\nexport async function reconcilePlannedEndpoints(prisma: DB = db): Promise<ReconcileReport> {\n const [planned, code] = await Promise.all([\n prisma.query.endpoint.findMany({ where: (t, { ne }) => ne(t.source, \"INTROSPECTION\") }),\n prisma.query.endpoint.findMany({ where: (t, { eq }) => eq(t.source, \"INTROSPECTION\") }),\n ]);\n\n const report: ReconcileReport = { collapsed: 0, mappings: [] };\n for (const m of planned) {\n const twin = code.find((c) => isImplementedBy(m, c));\n if (!twin) continue;\n await prisma.delete(endpoint).where(eq(endpoint.id, m.id));\n report.collapsed++;\n report.mappings.push({ planned: `${m.method} ${m.path}`, code: `${twin.method} ${twin.path}` });\n }\n return report;\n}\n","import { eq } from \"drizzle-orm\";\nimport { db, type DB } from \"@/lib/db-drizzle\";\nimport { dbTable } from \"@/lib/drizzle/schema\";\n\n// Layout constants for /db. Tables are 232px wide cards whose height is dominated by\n// their column count; the previous fixed grid (`y = floor(i/4) * 260`) silently stacked\n// tall tables on top of their neighbours. We pack into four columns masonry-style: each\n// column tracks its cumulative bottom and the next table goes into whichever column has\n// the most room. Same shape ingest seeds use, same shape `relayoutTables` uses to repair.\n\nexport const TABLE_COL_WIDTH = 320;\nexport const TABLE_COL_COUNT = 4;\nexport const TABLE_GAP_PX = 50;\nconst TABLE_HEADER_PX = 36;\nconst TABLE_ROW_PX = 30;\nconst TABLE_PADDING_PX = 16;\n\nexport function estimateTableHeight(columnCount: number): number {\n return TABLE_HEADER_PX + Math.max(0, columnCount) * TABLE_ROW_PX + TABLE_PADDING_PX;\n}\n\nexport interface NewTable {\n key: string;\n columnCount: number;\n}\nexport interface PlacedTable {\n x: number;\n y: number;\n columnCount: number;\n}\n\n/**\n * Assigns (x, y) to each `newTables` entry using a masonry pack across `TABLE_COL_COUNT`\n * columns, treating `existing` as already-occupied slots so we never land on top of a\n * persisted table. Returns a Map keyed by the entry's `key` (id or name — caller's choice).\n */\nexport function packTablesMasonry(\n newTables: NewTable[],\n existing: PlacedTable[] = [],\n): Map<string, { x: number; y: number }> {\n const bottoms = new Array<number>(TABLE_COL_COUNT).fill(0);\n for (const e of existing) {\n const col = Math.max(\n 0,\n Math.min(TABLE_COL_COUNT - 1, Math.round(e.x / TABLE_COL_WIDTH)),\n );\n const bottom = e.y + estimateTableHeight(e.columnCount) + TABLE_GAP_PX;\n if (bottom > bottoms[col]) bottoms[col] = bottom;\n }\n const out = new Map<string, { x: number; y: number }>();\n for (const t of newTables) {\n let col = 0;\n for (let i = 1; i < TABLE_COL_COUNT; i++) if (bottoms[i] < bottoms[col]) col = i;\n const x = col * TABLE_COL_WIDTH;\n const y = bottoms[col];\n out.set(t.key, { x, y });\n bottoms[col] = y + estimateTableHeight(t.columnCount) + TABLE_GAP_PX;\n }\n return out;\n}\n\n/**\n * Bounding-box overlap check used by ingest to decide whether to self-heal the layout.\n * Card width is `TABLE_COL_WIDTH - 20` (the visible card sits inside its column slot).\n */\nexport function tablesOverlap(\n placed: ReadonlyArray<{ x: number; y: number; columnCount: number }>,\n): boolean {\n const w = TABLE_COL_WIDTH - 20;\n for (let i = 0; i < placed.length; i++) {\n for (let j = i + 1; j < placed.length; j++) {\n const a = placed[i];\n const b = placed[j];\n const ah = estimateTableHeight(a.columnCount);\n const bh = estimateTableHeight(b.columnCount);\n if (a.x < b.x + w && a.x + w > b.x && a.y < b.y + bh && a.y + ah > b.y) {\n return true;\n }\n }\n }\n return false;\n}\n\n/**\n * Self-heal for the /db canvas: re-packs all INTROSPECTION tables into a masonry\n * layout sized to each table's actual column count. Called automatically by ingest\n * when the post-upsert positions still overlap (a stale layout from before the\n * masonry formula, or a hand-placement that drifted into a neighbour). Manual\n * (non-introspection) tables keep their positions — they're drafts the user is\n * composing or hand-placed. Ordering by name keeps the result stable across re-syncs.\n */\nexport async function relayoutTables(prisma: DB = db): Promise<number> {\n const tables = await prisma.query.dbTable.findMany({\n where: (t, { eq }) => eq(t.source, \"INTROSPECTION\"),\n with: { columns: { columns: { id: true } } },\n orderBy: (t, { asc }) => asc(t.name),\n });\n if (tables.length === 0) return 0;\n const positions = packTablesMasonry(\n tables.map((t) => ({ key: t.id, columnCount: t.columns.length })),\n );\n let moved = 0;\n for (const t of tables) {\n const p = positions.get(t.id);\n if (!p) continue;\n if (Math.round(p.x) === Math.round(t.x) && Math.round(p.y) === Math.round(t.y)) continue;\n await prisma.update(dbTable).set({ x: p.x, y: p.y }).where(eq(dbTable.id, t.id));\n moved++;\n }\n return moved;\n}\n","import { z } from \"zod\";\nimport { and, count, eq, inArray, notInArray, or, sql } from \"drizzle-orm\";\nimport { db, type DB } from \"@/lib/db-drizzle\";\nimport { dbTable, dbColumn, dbRelation, endpoint, endpointTable, syncState } from \"@/lib/drizzle/schema\";\nimport {\n endpointsOverlap,\n gridPositionForEndpoint,\n relayoutEndpoints,\n} from \"@/lib/endpoint-layout\";\nimport { reconcilePlannedEndpoints } from \"@/lib/endpoint-reconcile\";\nimport { packTablesMasonry, relayoutTables, tablesOverlap } from \"@/lib/table-layout\";\n\n// ── Snapshot contract (what the intel daemon POSTs) ─────────────────────────\n\nexport const snapshotSchema = z.object({\n tables: z\n .array(\n z.object({\n name: z.string().trim().min(1),\n domain: z.string().nullish(),\n description: z.string().nullish(),\n columns: z\n .array(\n z.object({\n name: z.string().trim().min(1),\n type: z.string().trim().min(1),\n isPk: z.boolean().optional(),\n isFk: z.boolean().optional(),\n nullable: z.boolean().optional(),\n note: z.string().nullish(),\n }),\n )\n .default([]),\n }),\n )\n .default([]),\n relations: z\n .array(\n z.object({\n fromTable: z.string(),\n fromColumn: z.string(),\n toTable: z.string(),\n toColumn: z.string(),\n label: z.string().nullish(),\n }),\n )\n .default([]),\n endpoints: z\n .array(\n z.object({\n method: z.string().trim().min(1),\n path: z.string().trim().min(1),\n domain: z.string().nullish(),\n description: z.string().nullish(),\n uses: z\n .array(\n z.object({\n table: z.string(),\n access: z.string().default(\"read\"),\n }),\n )\n .default([]),\n }),\n )\n .default([]),\n});\nexport type Snapshot = z.input<typeof snapshotSchema>;\n\ntype Prisma = DB;\n\nexport async function getVersion(prisma: Prisma = db): Promise<number> {\n const s = await prisma.query.syncState.findFirst({ where: (t, { eq }) => eq(t.id, \"singleton\") });\n return s?.version ?? 0;\n}\n\nexport async function bumpVersion(prisma: Prisma = db): Promise<number> {\n const [s] = await prisma\n .insert(syncState)\n .values({ id: \"singleton\", version: 1 })\n .onConflictDoUpdate({\n target: syncState.id,\n set: { version: sql`${syncState.version} + 1` },\n })\n .returning();\n return s.version;\n}\n\n/**\n * Upserts a code-derived snapshot. Full-replace of `source=INTROSPECTION`\n * entities: upsert by stable key (name / method+path) preserving manual x/y,\n * delete introspected entities absent from the snapshot. Manual entities and\n * the roadmap are never touched. Bumps the sync version.\n */\nexport async function ingestSnapshot(input: unknown, prisma: Prisma = db) {\n const snap = snapshotSchema.parse(input);\n\n // tables ----------------------------------------------------------------\n const keepTables = snap.tables.map((t) => t.name);\n await prisma\n .delete(dbTable)\n .where(\n keepTables.length\n ? and(eq(dbTable.source, \"INTROSPECTION\"), notInArray(dbTable.name, keepTables))\n : eq(dbTable.source, \"INTROSPECTION\"),\n );\n\n // Position NEW tables with a masonry pack sized to each table's column count, anchored\n // against whatever tables are already on the canvas. The old `(i%4)*320, floor(i/4)*260`\n // grid silently stacked tall tables (Node, DbColumn) on top of their neighbours.\n const allExisting = await prisma.query.dbTable.findMany({\n columns: { name: true, x: true, y: true },\n with: { columns: { columns: { id: true } } },\n });\n const existingByName = new Map(allExisting.map((t) => [t.name, t]));\n const newTablePositions = packTablesMasonry(\n snap.tables\n .filter((t) => !existingByName.has(t.name))\n .map((t) => ({ key: t.name, columnCount: t.columns.length })),\n allExisting.map((t) => ({ x: t.x, y: t.y, columnCount: t.columns.length })),\n );\n\n const tableIdByName = new Map<string, string>();\n for (const t of snap.tables) {\n const existing = existingByName.get(t.name);\n const pos = newTablePositions.get(t.name);\n const x = existing?.x ?? pos?.x ?? 0;\n const y = existing?.y ?? pos?.y ?? 0;\n const [saved] = await prisma\n .insert(dbTable)\n .values({\n name: t.name,\n domain: t.domain ?? null,\n description: t.description ?? null,\n source: \"INTROSPECTION\",\n x,\n y,\n })\n .onConflictDoUpdate({\n target: dbTable.name,\n set: {\n domain: t.domain ?? null,\n description: t.description ?? null,\n source: \"INTROSPECTION\",\n },\n })\n .returning();\n tableIdByName.set(t.name, saved.id);\n await prisma.delete(dbColumn).where(eq(dbColumn.tableId, saved.id));\n if (t.columns.length) {\n await prisma.insert(dbColumn).values(\n t.columns.map((c, i) => ({\n tableId: saved.id,\n name: c.name,\n type: c.type,\n isPk: c.isPk ?? false,\n isFk: c.isFk ?? false,\n nullable: c.nullable ?? true,\n note: c.note ?? null,\n ord: i,\n })),\n );\n }\n }\n\n // relations (rebuild those touching an introspected table) ---------------\n const introTableIds = [...tableIdByName.values()];\n if (introTableIds.length) {\n await prisma\n .delete(dbRelation)\n .where(\n or(\n inArray(dbRelation.fromTableId, introTableIds),\n inArray(dbRelation.toTableId, introTableIds),\n ),\n );\n }\n for (const r of snap.relations) {\n const fromId = tableIdByName.get(r.fromTable);\n const toId = tableIdByName.get(r.toTable);\n if (!fromId || !toId) continue;\n await prisma.insert(dbRelation).values({\n fromTableId: fromId,\n toTableId: toId,\n fromColumn: r.fromColumn,\n toColumn: r.toColumn,\n label: r.label ?? `${r.fromColumn} → ${r.toTable}.${r.toColumn}`,\n });\n }\n\n // endpoints --------------------------------------------------------------\n const keepEp = new Set(snap.endpoints.map((e) => `${e.method} ${e.path}`));\n const introEps = await prisma.query.endpoint.findMany({\n where: (t, { eq }) => eq(t.source, \"INTROSPECTION\"),\n });\n const stale = introEps.filter((e) => !keepEp.has(`${e.method} ${e.path}`)).map((e) => e.id);\n if (stale.length) await prisma.delete(endpoint).where(inArray(endpoint.id, stale));\n\n // For NEW endpoints we drop into the next free slot of the multi-column grid (the\n // single-column stack made a real backend's endpoints into a 4000px-tall fence).\n let nextSlotIndex = (await prisma.select({ n: count() }).from(endpoint))[0].n;\n for (const e of snap.endpoints) {\n const existing = await prisma.query.endpoint.findFirst({\n where: (t, { and, eq }) => and(eq(t.method, e.method), eq(t.path, e.path)),\n });\n let x: number, y: number;\n if (existing) {\n x = existing.x;\n y = existing.y;\n } else {\n const slot = gridPositionForEndpoint(nextSlotIndex);\n x = slot.x;\n y = slot.y;\n nextSlotIndex++;\n }\n const [saved] = await prisma\n .insert(endpoint)\n .values({\n method: e.method,\n path: e.path,\n domain: e.domain ?? null,\n description: e.description ?? null,\n source: \"INTROSPECTION\",\n x,\n y,\n })\n .onConflictDoUpdate({\n target: [endpoint.method, endpoint.path],\n set: {\n domain: e.domain ?? null,\n description: e.description ?? null,\n source: \"INTROSPECTION\",\n },\n })\n .returning();\n await prisma.delete(endpointTable).where(eq(endpointTable.endpointId, saved.id));\n for (const u of e.uses) {\n const tid =\n tableIdByName.get(u.table) ??\n (\n await prisma.query.dbTable.findFirst({ where: (t, { eq }) => eq(t.name, u.table) })\n )?.id;\n if (!tid) continue;\n await prisma.insert(endpointTable).values({\n endpointId: saved.id,\n tableId: tid,\n access: u.access,\n });\n }\n }\n\n // Collapse planned endpoints that this scan just proved are implemented in code.\n await reconcilePlannedEndpoints(prisma);\n\n // Self-heal layout: if any pair of tables or endpoints overlaps after the upserts\n // (a stale layout from before the masonry/grid formulas, or a hand-placement that\n // drifted into a neighbour), repack them. Drag-and-drop positions that don't\n // collide are preserved — the heal only fires when the canvas is actually broken.\n const placedTables = await prisma.query.dbTable.findMany({\n where: (t, { eq }) => eq(t.source, \"INTROSPECTION\"),\n columns: { x: true, y: true },\n with: { columns: { columns: { id: true } } },\n });\n if (\n tablesOverlap(\n placedTables.map((t) => ({ x: t.x, y: t.y, columnCount: t.columns.length })),\n )\n ) {\n await relayoutTables(prisma);\n }\n const placedEps = await prisma.select({ x: endpoint.x, y: endpoint.y }).from(endpoint);\n if (endpointsOverlap(placedEps)) await relayoutEndpoints(prisma);\n\n const version = await bumpVersion(prisma);\n return {\n tables: snap.tables.length,\n relations: snap.relations.length,\n endpoints: snap.endpoints.length,\n version,\n };\n}\n","// Local semantic-search embedder. Loads Xenova/all-MiniLM-L6-v2 in-process\n// (~22MB cached on first use, ~50-100ms per text after that). Stays local so\n// the Beacon panel has no API-key dependency and no per-query network hop.\n// Vectors live in `Node.embedding` as JSON strings; cosine is computed in JS\n// at query time — at hundreds of nodes per workspace, sqlite-vec is overkill.\n\ntype FeatureExtractionPipeline = (\n text: string | string[],\n opts?: { pooling?: \"mean\" | \"cls\"; normalize?: boolean },\n) => Promise<{ data: Float32Array | number[] }>;\n\nlet pipelinePromise: Promise<FeatureExtractionPipeline> | null = null;\n\nasync function getEmbedder(): Promise<FeatureExtractionPipeline> {\n if (!pipelinePromise) {\n pipelinePromise = (async () => {\n const { pipeline } = await import(\"@huggingface/transformers\");\n // 384-dim sentence embeddings. The \"feature-extraction\" task with\n // mean-pooled + normalized output is the canonical sentence-encoder shape.\n return (await pipeline(\n \"feature-extraction\",\n \"Xenova/all-MiniLM-L6-v2\",\n )) as unknown as FeatureExtractionPipeline;\n })().catch((e) => {\n pipelinePromise = null; // let the next call retry on transient failure\n throw e;\n });\n }\n return pipelinePromise;\n}\n\n/** Compute a 384-dim sentence embedding. Returns null on failure (caller falls back to lexical). */\nexport async function embedText(text: string): Promise<number[] | null> {\n const trimmed = text.trim();\n if (!trimmed) return null;\n try {\n const embedder = await getEmbedder();\n const out = await embedder(trimmed, { pooling: \"mean\", normalize: true });\n return Array.from(out.data);\n } catch (e) {\n console.error(\"[embeddings] failed:\", e instanceof Error ? e.message : e);\n return null;\n }\n}\n\n/** Build the embedding input text from a node's queryable fields. */\nexport function nodeEmbeddingInput(node: {\n title: string;\n role?: string | null;\n plain?: string | null;\n cluster?: string | null;\n}): string {\n return [node.title, node.role, node.plain, node.cluster].filter(Boolean).join(\". \");\n}\n\n/** Cosine similarity, defensive against zero vectors and dimension mismatch. */\nexport function cosineSimilarity(a: number[], b: number[]): number {\n if (a.length !== b.length) return 0;\n let dot = 0;\n let normA = 0;\n let normB = 0;\n for (let i = 0; i < a.length; i++) {\n dot += a[i] * b[i];\n normA += a[i] * a[i];\n normB += b[i] * b[i];\n }\n if (normA === 0 || normB === 0) return 0;\n return dot / (Math.sqrt(normA) * Math.sqrt(normB));\n}\n\nexport function encodeVector(v: number[]): string {\n return JSON.stringify(v);\n}\n\nexport function decodeVector(raw: string | null | undefined): number[] | null {\n if (!raw) return null;\n try {\n const parsed = JSON.parse(raw);\n if (!Array.isArray(parsed)) return null;\n if (parsed.some((x) => typeof x !== \"number\" || !Number.isFinite(x))) return null;\n return parsed as number[];\n } catch {\n return null;\n }\n}\n\n/**\n * Re-embed a Node from its current title/plain/role/cluster. Idempotent; swallows\n * errors so a failed embed never breaks the write that triggered it.\n */\nexport async function reembedNode(id: string): Promise<void> {\n try {\n const { db } = await import(\"@/lib/db\");\n const { node } = await import(\"@/lib/drizzle/schema\");\n const { eq } = await import(\"drizzle-orm\");\n const row = await db.query.node.findFirst({\n where: (t, { eq: eqf }) => eqf(t.id, id),\n columns: { title: true, role: true, plain: true, cluster: true },\n });\n if (!row) return;\n const vec = await embedText(nodeEmbeddingInput(row));\n if (!vec) return;\n await db.update(node).set({ embedding: encodeVector(vec) }).where(eq(node.id, id));\n } catch (e) {\n console.error(\"[embeddings] reembed failed:\", id, e instanceof Error ? e.message : e);\n }\n}\n\n/** Rank candidates by cosine. Returns null when the query embedding fails. */\nexport async function rankByQuery<T extends { embedding: string | null }>(\n query: string,\n candidates: T[],\n): Promise<Array<{ item: T; score: number }> | null> {\n const queryVec = await embedText(query);\n if (!queryVec) return null;\n const scored: Array<{ item: T; score: number }> = [];\n for (const item of candidates) {\n const v = decodeVector(item.embedding);\n if (!v) continue;\n scored.push({ item, score: cosineSimilarity(queryVec, v) });\n }\n scored.sort((a, b) => b.score - a.score);\n return scored;\n}\n"],"names":["EP_ROW_HEIGHT","EP_COL_WIDTH","EP_BASE_X","EP_ROWS_PER_COL","EP_CARD_WIDTH","EP_CARD_HEIGHT","endpointsOverlap","eps","i","length","j","a","b","x","y","gridPositionForEndpoint","index","col","Math","floor","row","relayoutEndpoints","prisma","query","endpoint","findMany","orderBy","t","asc","desc","id","moved","e","update","set","where","nextEndpointSlot","n","select","from","DRAFT_MARGIN","computeDraftOriginY","topTbl","topEp","Promise","all","dbTable","findFirst","maxY","max","normalize","path","replace","isImplementedBy","planned","code","method","toUpperCase","p","c","endsWith","reconcilePlannedEndpoints","ne","source","eq","report","collapsed","mappings","m","twin","find","delete","push","TABLE_COL_WIDTH","TABLE_COL_COUNT","TABLE_GAP_PX","TABLE_HEADER_PX","TABLE_ROW_PX","TABLE_PADDING_PX","estimateTableHeight","columnCount","packTablesMasonry","newTables","existing","bottoms","Array","fill","min","round","bottom","out","Map","key","tablesOverlap","placed","w","ah","bh","relayoutTables","tables","with","columns","name","positions","map","get","snapshotSchema","object","array","string","trim","domain","nullish","description","type","isPk","boolean","optional","isFk","nullable","note","default","relations","fromTable","fromColumn","toTable","toColumn","label","endpoints","uses","table","access","getVersion","s","syncState","version","bumpVersion","insert","values","onConflictDoUpdate","target","returning","ingestSnapshot","input","snap","parse","keepTables","allExisting","existingByName","newTablePositions","filter","has","tableIdByName","pos","saved","tableId","ord","introTableIds","fromTableId","toTableId","r","fromId","toId","keepEp","Set","introEps","stale","nextSlotIndex","and","slot","endpointId","u","tid","placedTables","placedEps","pipelinePromise","getEmbedder","pipeline","catch","embedText","text","trimmed","embedder","pooling","data","console","error","Error","message","nodeEmbeddingInput","node","title","role","plain","cluster","Boolean","join","cosineSimilarity","dot","normA","normB","sqrt","encodeVector","v","JSON","stringify","decodeVector","raw","parsed","isArray","some","Number","isFinite","reembedNode","db","eqf","vec","embedding","rankByQuery","candidates","queryVec","scored","item","score","sort"],"mappings":"g0BAAA,IAAA,EAAuC,EAAA,CAAA,AAAd,CAAc,OACvC,EAAmB,EAAA,CAAV,AAAU,CADoB,AACpB,OACnB,EADmB,AAC4B,EAAA,CAAA,AAA5B,CAA4B,UAAA,UAgDxC,SAAS,AAAI,CAAA,EAA4C,AAC/D,OAAO,EAAA,GAAA,CAAA,IAAA,EAAU,EAAU,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AE,CAAGG,CAAC,CAACH,EAAE,CACpBgM,GAAS5L,CAAC,CAACJ,EAAE,CAAGI,CAAC,CAACJ,EAAE,QAEtB,AAAc,IAAV+L,GAAyB,GAAG,CAAbC,EAAoB,EAChCF,GAAOpL,GAAD,EAAMuL,IAAI,CAACF,GAASrL,KAAKuL,IAAI,CAACD,EAAAA,CAC7C,AADmD,EAoDHoB,EAAUjB,EAAG,EAC3D,CAEA,OADAkB,EAAOG,IAAI,CAAC,CAACrN,EAAGC,IAAMA,EAAEmN,KAAK,CAAGpN,EAAEoN,KAAK,EAChCF,CACT"}
@@ -0,0 +1,3 @@
1
+ module.exports=[58708,e=>{"use strict";let t=null;async function r(){return t||(t=(async()=>{let{pipeline:t}=await e.A(46128);return await t("feature-extraction","Xenova/all-MiniLM-L6-v2")})().catch(e=>{throw t=null,e})),t}async function a(e){let t=e.trim();if(!t)return null;try{let e=await r(),a=await e(t,{pooling:"mean",normalize:!0});return Array.from(a.data)}catch(e){return console.error("[embeddings] failed:",e instanceof Error?e.message:e),null}}function n(e){return[e.title,e.role,e.plain,e.cluster].filter(Boolean).join(". ")}function i(e){return JSON.stringify(e)}async function s(t){try{let{db:r}=await e.A(35914),{node:s}=await e.A(29363),{eq:o}=await e.A(96359),l=await r.query.node.findFirst({where:(e,{eq:r})=>r(e.id,t),columns:{title:!0,role:!0,plain:!0,cluster:!0}});if(!l)return;let u=await a(n(l));if(!u)return;await r.update(s).set({embedding:i(u)}).where(o(s.id,t))}catch(e){console.error("[embeddings] reembed failed:",t,e instanceof Error?e.message:e)}}async function o(e,t){let r=await a(e);if(!r)return null;let n=[];for(let e of t){let t=function(e){if(!e)return null;try{let t=JSON.parse(e);if(!Array.isArray(t)||t.some(e=>"number"!=typeof e||!Number.isFinite(e)))return null;return t}catch{return null}}(e.embedding);t&&n.push({item:e,score:function(e,t){if(e.length!==t.length)return 0;let r=0,a=0,n=0;for(let i=0;i<e.length;i++)r+=e[i]*t[i],a+=e[i]*e[i],n+=t[i]*t[i];return 0===a||0===n?0:r/(Math.sqrt(a)*Math.sqrt(n))}(r,t)})}return n.sort((e,t)=>t.score-e.score),n}e.s(["embedText",0,a,"encodeVector",0,i,"nodeEmbeddingInput",0,n,"rankByQuery",0,o,"reembedNode",0,s])},53828,e=>e.a(async(t,r)=>{try{var a=e.i(91426),n=e.i(34700),i=t([a]);async function s(e=a.db){let[t]=await e.insert(n.appSetting).values({id:"singleton"}).onConflictDoUpdate({target:n.appSetting.id,set:{id:"singleton"}}).returning();return t}async function o(e,t=a.db){let[r]=await t.insert(n.appSetting).values({id:"singleton",...e}).onConflictDoUpdate({target:n.appSetting.id,set:e}).returning();return r}[a]=i.then?(await i)():i,e.s(["getAppSettings",0,s,"setAppSettings",0,o]),r()}catch(e){r(e)}},!1),91153,e=>{"use strict";let t=new Set(["a","an","the","of","for","to","and","or","in","on","with","via","by","using","use","add","adds","support","implement","implementation","feature","new","build","create","o","os","as","um","uma","de","da","do","das","dos","para","por","com","e","ou","no","na","nos","nas","ao","aos","adicionar","implementar","suporte","suportar","nova","novo","funcionalidade","usar","usando","criar"]);function r(e){return e.normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g," ").trim().replace(/\s+/g," ")}function a(e){return r(e).split(" ").filter(e=>e&&!t.has(e))}function n(e,t){if(!e.size||!t.size)return 0;let r=0;for(let a of e)t.has(a)&&r++;return 2*r/(e.size+t.size)}function i(e){let t=r(e).replace(/ /g,""),a=new Set;for(let e=0;e<t.length-1;e++)a.add(t.slice(e,e+2));return a}e.s(["matchFeature",0,function(e,t,s={}){let o=s.confident??.72,l=s.consider??.5,u=s.margin??.1,d=t.map(t=>{var s,o;let l,u;return{...t,score:Math.round(100*(s=e,o=t.title,l=r(s),u=r(o),l&&u?l===u?1:Math.min(1,.7*n(new Set(a(s)),new Set(a(o)))+.4*n(i(s),i(o))):0))/100}}).sort((e,t)=>t.score-e.score),c=d[0];if(!c||c.score<l)return{best:null,candidates:[]};let p=d[1]?.score??0,f=1===d.length||c.score-p>=u;return c.score>=o&&f?{best:c,candidates:[]}:{best:null,candidates:d.filter(e=>e.score>=l).slice(0,4)}}])},32665,e=>{"use strict";var t=e.i(91153);e.s(["validateFeatureCreation",0,function(e){let r=(e.title??"").trim();if(!r)return"⛔ A feature needs a non-empty title.";if(!(e.category??"").trim()){let t=function(e){let t=new Set;for(let r of e){let e=(r.cluster??"").trim();e&&t.add(e)}return[...t].sort()}(e.existing),a=t.length?` Reuse an existing category where it fits: ${t.join(", ")}.`:"";return`⛔ Feature "${r}" has no category. Every roadmap feature needs one — it drives grouping and color on the board.${a} Pass it as \`category\` (e.g. AUTH, SEARCH, DATA, INTEL, BILLING, INFRA …); don't rely on a default.`}let a=(0,t.matchFeature)(r,e.existing.map(e=>({id:e.id,title:e.title})));if(a.best){let t=e.existing.find(e=>e.id===a.best.id),n=t?.status?` (${t.status})`:"";return`⛔ "${r}" already exists as the feature "${t?.title??a.best.title}"${n}. Don't create a duplicate — mark progress on it with \`beacon_start_feature({ id })\`, add sub-tasks with \`beacon_add_subtasks\`, or finish it with \`beacon_describe_feature\`.`}return null},"validateFront",0,function(e,r){let a=(e??"").trim();if(!a)return null;let n=(0,t.matchFeature)(a,r);if(n.best)return null;let i=n.candidates.length?` Did you mean: ${n.candidates.map(e=>`"${e.title}"`).join(", ")}?`:"";return`⛔ front "${a}" doesn't match an existing feature.${i} \`front\` nests a feature UNDER an existing parent feature — it is NOT a domain tag. If "${a}" is a domain, pass it as \`category\` instead. If it's a real umbrella feature, create it first via beacon_propose_plan.`},"validateNoDuplicateFeatures",0,function(e,r){let a=r.map(e=>({id:e.id,title:e.title})),n=e.map(e=>{let n=(0,t.matchFeature)(e.title??"",a);return n.best?{title:e.title,hit:r.find(e=>e.id===n.best.id)}:null}).filter(e=>null!==e);return n.length?"⛔ These proposed features already exist on the roadmap — reuse them instead of creating duplicates:\n"+n.map(e=>` • "${e.title}" → existing "${e.hit.title}"${e.hit.status?` (${e.hit.status})`:""}`).join("\n")+"\n\nDrop the duplicate(s) from the plan; to add work to an existing feature, ship sub-tasks or update it via beacon_describe_feature. Keep only genuinely new features in the proposal.":null},"validateProposedFeatures",0,function(e){let t=e.map(e=>{let t=[],r=e.cluster??e.category??e.domain??null;return r&&r.trim()||t.push("category"),null==e.priority&&t.push("priority"),t.length?` • "${e.title?.trim()||"(untitled)"}" — missing ${t.join(" + ")}`:null}).filter(e=>null!==e);return 0===t.length?null:"⛔ Every roadmap feature needs a category AND a priority — they drive grouping and ordering on the board, and the user shouldn't have to add them by hand. Missing:\n"+t.join("\n")+"\n\nRe-present with each feature carrying its category as `category` (or `cluster` — both work; e.g. AUTH, SEARCH, DATA, INTEL, BILLING …) and `priority` (0 = P0 critical, 1 = P1 high, 2 = P2 medium, 3 = P3 low). Set BOTH on EVERY feature; don't rely on defaults."}])},36357,e=>e.a(async(t,r)=>{try{var a=e.i(46260),n=e.i(91426),i=e.i(14859),s=t([a,n]);async function o(e){try{let t=await e.json();if("string"!=typeof t.title||!t.title.trim())return new Response("title required",{status:400});return await (0,i.runWithWorkspace)((0,i.workspaceIdFromRequest)(e),async()=>{let e=await (0,a.startFeature)({title:t.title,id:"string"==typeof t.id?t.id:null,front:"string"==typeof t.front?t.front:null,detail:"string"==typeof t.detail?t.detail:null,cluster:"string"==typeof t.cluster?t.cluster:"string"==typeof t.category?t.category:"string"==typeof t.domain?t.domain:null});return"rejected"===e.action?Response.json({error:e.message},{status:422}):(Array.isArray(t.files)&&("flagged"===e.action||"created"===e.action)&&await (0,a.touchFiles)({id:e.id,files:t.files.filter(e=>"string"==typeof e)}),Response.json(e))})}catch(e){return new Response(`start failed: ${e instanceof Error?e.message:"error"}`,{status:500})}}[a,n]=s.then?(await s)():s,e.s(["POST",0,o,"dynamic",0,"force-dynamic"]),r()}catch(e){r(e)}},!1),64300,e=>e.a(async(t,r)=>{try{var a=e.i(47909),n=e.i(74017),i=e.i(96250),s=e.i(59756),o=e.i(61916),l=e.i(74677),u=e.i(69741),d=e.i(16795),c=e.i(87718),p=e.i(95169),f=e.i(47587),h=e.i(66012),g=e.i(70101),m=e.i(26937),y=e.i(10372),v=e.i(93695);e.i(20232);var w=e.i(220),R=e.i(36357),b=t([R]);[R]=b.then?(await b)():b;let A=new a.AppRouteRouteModule({definition:{kind:n.RouteKind.APP_ROUTE,page:"/api/map/start/route",pathname:"/api/map/start",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/map/start/route.ts",nextConfigOutput:"",userland:R,...{}}),{workAsyncStorage:_,workUnitAsyncStorage:x,serverHooks:C}=A;async function E(e,t,r){r.requestMeta&&(0,s.setRequestMeta)(e,r.requestMeta),A.isDev&&(0,s.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let a="/api/map/start/route";a=a.replace(/\/index$/,"")||"/";let i=await A.prepare(e,t,{srcPage:a,multiZoneDraftMode:!1});if(!i)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:R,deploymentId:b,params:E,nextConfig:_,parsedUrl:x,isDraftMode:C,prerenderManifest:N,routerServerContext:S,isOnDemandRevalidate:P,revalidateOnlyGenerated:T,resolvedPathname:$,clientReferenceManifest:I,serverActionsManifest:k}=i,O=(0,u.normalizeAppPath)(a),q=!!(N.dynamicRoutes[O]||N.routes[$]),D=async()=>((null==S?void 0:S.render404)?await S.render404(e,t,x,!1):t.end("This page could not be found"),null);if(q&&!C){let e=!!N.routes[$],t=N.dynamicRoutes[O];if(t&&!1===t.fallback&&!e){if(_.adapterPath)return await D();throw new v.NoFallbackError}}let F=null;!q||A.isDev||C||(F=$,F="/index"===F?"/":F);let H=!0===A.isDev||!q,M=q&&!H;k&&I&&(0,l.setManifestsSingleton)({page:a,clientReferenceManifest:I,serverActionsManifest:k});let j=e.method||"GET",U=(0,o.getTracer)(),L=U.getActiveScopeSpan(),z=!!(null==S?void 0:S.isWrappedByNextServer),B=!!(0,s.getRequestMeta)(e,"minimalMode"),K=(0,s.getRequestMeta)(e,"incrementalCache")||await A.getIncrementalCache(e,_,N,B);null==K||K.resetRequestCache(),globalThis.__incrementalCache=K;let G={params:E,previewProps:N.preview,renderOpts:{experimental:{authInterrupts:!!_.experimental.authInterrupts},cacheComponents:!!_.cacheComponents,supportsDynamicResponse:H,incrementalCache:K,cacheLifeProfiles:_.cacheLife,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>A.onRequestError(e,t,a,n,S)},sharedContext:{buildId:R,deploymentId:b}},V=new d.NodeNextRequest(e),W=new d.NodeNextResponse(t),X=c.NextRequestAdapter.fromNodeNextRequest(V,(0,c.signalFromNodeResponse)(t));try{let i,s=async e=>A.handle(X,G).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=U.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==p.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route");if(n){let t=`${j} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t),i&&i!==e&&(i.setAttribute("http.route",n),i.updateName(t))}else e.updateName(`${j} ${a}`)}),l=async i=>{var o,l;let u=async({previousCacheEntry:n})=>{try{if(!B&&P&&T&&!n)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await s(i);e.fetchMetrics=G.renderOpts.fetchMetrics;let o=G.renderOpts.pendingWaitUntil;o&&r.waitUntil&&(r.waitUntil(o),o=void 0);let l=G.renderOpts.collectedTags;if(!q)return await (0,h.sendResponse)(V,W,a,G.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,g.toNodeOutgoingHttpHeaders)(a.headers);l&&(t[y.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==G.renderOpts.collectedRevalidate&&!(G.renderOpts.collectedRevalidate>=y.INFINITE_CACHE)&&G.renderOpts.collectedRevalidate,n=void 0===G.renderOpts.collectedExpire||G.renderOpts.collectedExpire>=y.INFINITE_CACHE?void 0:G.renderOpts.collectedExpire;return{value:{kind:w.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==n?void 0:n.isStale)&&await A.onRequestError(e,t,{routerKind:"App Router",routePath:a,routeType:"route",revalidateReason:(0,f.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:P})},!1,S),t}},d=await A.handleResponse({req:e,nextConfig:_,cacheKey:F,routeKind:n.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:N,isRoutePPREnabled:!1,isOnDemandRevalidate:P,revalidateOnlyGenerated:T,responseGenerator:u,waitUntil:r.waitUntil,isMinimalMode:B});if(!q)return null;if((null==d||null==(o=d.value)?void 0:o.kind)!==w.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(l=d.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});B||t.setHeader("x-nextjs-cache",P?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),C&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let c=(0,g.fromNodeOutgoingHttpHeaders)(d.value.headers);return B&&q||c.delete(y.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||c.get("Cache-Control")||c.set("Cache-Control",(0,m.getCacheControlHeader)(d.cacheControl)),await (0,h.sendResponse)(V,W,new Response(d.value.body,{headers:c,status:d.value.status||200})),null};z&&L?await l(L):(i=U.getActiveScopeSpan(),await U.withPropagatedContext(e.headers,()=>U.trace(p.BaseServerSpan.handleRequest,{spanName:`${j} ${a}`,kind:o.SpanKind.SERVER,attributes:{"http.method":j,"http.target":e.url}},l),void 0,!z))}catch(t){if(t instanceof v.NoFallbackError||await A.onRequestError(e,t,{routerKind:"App Router",routePath:O,routeType:"route",revalidateReason:(0,f.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:P})},!1,S),q)throw t;return await (0,h.sendResponse)(V,W,new Response(null,{status:500})),null}}e.s(["handler",0,E,"patchFetch",0,function(){return(0,i.patchFetch)({workAsyncStorage:_,workUnitAsyncStorage:x})},"routeModule",0,A,"serverHooks",0,C,"workAsyncStorage",0,_,"workUnitAsyncStorage",0,x]),r()}catch(e){r(e)}},!1),58502,e=>{e.v(t=>Promise.all(["server/chunks/[root-of-the-server]__1t2egm-._.js"].map(t=>e.l(t))).then(()=>t(51514)))},46128,e=>{e.v(t=>Promise.all(["server/chunks/[externals]_@huggingface_transformers_05bd-zz._.js"].map(t=>e.l(t))).then(()=>t(99732)))},35914,e=>{e.v(t=>Promise.all(["server/chunks/lib_db_ts_0h_yn5m._.js"].map(t=>e.l(t))).then(()=>t(62294)))},29363,e=>{e.v(e=>Promise.resolve().then(()=>e(34700)))},96359,e=>{e.v(t=>Promise.all(["server/chunks/node_modules_drizzle-orm_index_1qnscv7.js"].map(t=>e.l(t))).then(()=>t(32628)))}];
2
+
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__008acf8._.js.map