@codeyam/codeyam-cli 0.1.0-staging.09652b8 → 0.1.0-staging.28f73cf

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 (287) hide show
  1. package/analyzer-template/.build-info.json +7 -7
  2. package/analyzer-template/log.txt +3 -3
  3. package/analyzer-template/package.json +7 -6
  4. package/analyzer-template/packages/ai/index.ts +2 -0
  5. package/analyzer-template/packages/ai/package.json +2 -2
  6. package/analyzer-template/packages/ai/src/lib/analyzeScope.ts +24 -0
  7. package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +14 -0
  8. package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +1402 -546
  9. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/FunctionCallManager.ts +138 -0
  10. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.ts +1 -1
  11. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.ts +139 -0
  12. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/DebugTracer.ts +224 -0
  13. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/PathManager.ts +203 -0
  14. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/README.md +294 -0
  15. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.ts +161 -0
  16. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/VisitedTracker.ts +235 -0
  17. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.ts +2 -0
  18. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/selectBestValue.ts +70 -0
  19. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/uniqueIdUtils.ts +113 -0
  20. package/analyzer-template/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.ts +36 -0
  21. package/analyzer-template/packages/ai/src/lib/generateEntityKeyAttributes.ts +32 -8
  22. package/analyzer-template/packages/ai/src/lib/getConditionalUsagesFromCode.ts +27 -6
  23. package/analyzer-template/packages/ai/src/lib/promptGenerators/gatherAttributesMap.ts +42 -4
  24. package/analyzer-template/packages/ai/src/lib/worker/SerializableDataStructure.ts +39 -0
  25. package/analyzer-template/packages/analyze/src/lib/FileAnalyzer.ts +18 -6
  26. package/analyzer-template/packages/analyze/src/lib/asts/nodes/index.ts +2 -1
  27. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +8 -10
  28. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +6 -1
  29. package/analyzer-template/packages/analyze/src/lib/files/analyze/gatherEntityMap.ts +8 -6
  30. package/analyzer-template/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.ts +5 -13
  31. package/analyzer-template/packages/analyze/src/lib/files/analyzeChange.ts +34 -15
  32. package/analyzer-template/packages/analyze/src/lib/files/analyzeEntity.ts +17 -3
  33. package/analyzer-template/packages/analyze/src/lib/files/analyzeInitial.ts +35 -16
  34. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +7 -1
  35. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.ts +9 -1
  36. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarioData.ts +6 -1
  37. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarios.ts +9 -1
  38. package/analyzer-template/packages/aws/dist/src/lib/s3/getPresignedUrl.d.ts +23 -0
  39. package/analyzer-template/packages/aws/dist/src/lib/s3/getPresignedUrl.d.ts.map +1 -0
  40. package/analyzer-template/packages/aws/dist/src/lib/s3/getPresignedUrl.js +30 -0
  41. package/analyzer-template/packages/aws/dist/src/lib/s3/getPresignedUrl.js.map +1 -0
  42. package/analyzer-template/packages/aws/package.json +5 -4
  43. package/analyzer-template/packages/aws/s3/index.ts +4 -0
  44. package/analyzer-template/packages/aws/src/lib/s3/getPresignedUrl.ts +62 -0
  45. package/analyzer-template/packages/generate/src/lib/scenarioComponent.ts +6 -3
  46. package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponent.d.ts.map +1 -1
  47. package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponent.js +5 -3
  48. package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponent.js.map +1 -1
  49. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/db.d.ts +2 -0
  50. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/db.d.ts.map +1 -1
  51. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/db.js +3 -0
  52. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/db.js.map +1 -1
  53. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tableRelations.d.ts +2 -0
  54. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tableRelations.d.ts.map +1 -1
  55. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tables/debugReportsTable.d.ts +37 -0
  56. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tables/debugReportsTable.d.ts.map +1 -0
  57. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tables/debugReportsTable.js +27 -0
  58. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tables/debugReportsTable.js.map +1 -0
  59. package/analyzer-template/packages/github/dist/utils/index.d.ts +1 -0
  60. package/analyzer-template/packages/github/dist/utils/index.d.ts.map +1 -1
  61. package/analyzer-template/packages/github/dist/utils/index.js +1 -0
  62. package/analyzer-template/packages/github/dist/utils/index.js.map +1 -1
  63. package/analyzer-template/packages/github/dist/utils/src/lib/Semaphore.d.ts +25 -0
  64. package/analyzer-template/packages/github/dist/utils/src/lib/Semaphore.d.ts.map +1 -0
  65. package/analyzer-template/packages/github/dist/utils/src/lib/Semaphore.js +40 -0
  66. package/analyzer-template/packages/github/dist/utils/src/lib/Semaphore.js.map +1 -0
  67. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getRemixRoutePath.d.ts.map +1 -1
  68. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getRemixRoutePath.js +2 -1
  69. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getRemixRoutePath.js.map +1 -1
  70. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.d.ts.map +1 -1
  71. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.js +1 -0
  72. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.js.map +1 -1
  73. package/analyzer-template/packages/supabase/src/lib/kysely/db.ts +6 -0
  74. package/analyzer-template/packages/supabase/src/lib/kysely/tableRelations.ts +3 -0
  75. package/analyzer-template/packages/supabase/src/lib/kysely/tables/debugReportsTable.ts +61 -0
  76. package/analyzer-template/packages/utils/dist/utils/index.d.ts +1 -0
  77. package/analyzer-template/packages/utils/dist/utils/index.d.ts.map +1 -1
  78. package/analyzer-template/packages/utils/dist/utils/index.js +1 -0
  79. package/analyzer-template/packages/utils/dist/utils/index.js.map +1 -1
  80. package/analyzer-template/packages/utils/dist/utils/src/lib/Semaphore.d.ts +25 -0
  81. package/analyzer-template/packages/utils/dist/utils/src/lib/Semaphore.d.ts.map +1 -0
  82. package/analyzer-template/packages/utils/dist/utils/src/lib/Semaphore.js +40 -0
  83. package/analyzer-template/packages/utils/dist/utils/src/lib/Semaphore.js.map +1 -0
  84. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getRemixRoutePath.d.ts.map +1 -1
  85. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getRemixRoutePath.js +2 -1
  86. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getRemixRoutePath.js.map +1 -1
  87. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.d.ts.map +1 -1
  88. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.js +1 -0
  89. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.js.map +1 -1
  90. package/analyzer-template/packages/utils/index.ts +1 -0
  91. package/analyzer-template/packages/utils/src/lib/Semaphore.ts +42 -0
  92. package/analyzer-template/packages/utils/src/lib/frameworks/getRemixRoutePath.ts +2 -1
  93. package/analyzer-template/packages/utils/src/lib/frameworks/remixRouteFileNameToRoute.ts +1 -0
  94. package/analyzer-template/project/constructMockCode.ts +170 -6
  95. package/analyzer-template/project/reconcileMockDataKeys.ts +13 -0
  96. package/analyzer-template/project/start.ts +1 -11
  97. package/analyzer-template/project/writeMockDataTsx.ts +32 -1
  98. package/analyzer-template/project/writeScenarioComponents.ts +164 -18
  99. package/analyzer-template/project/writeUniversalMocks.ts +66 -8
  100. package/background/src/lib/virtualized/project/constructMockCode.js +158 -7
  101. package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
  102. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js +12 -0
  103. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js.map +1 -1
  104. package/background/src/lib/virtualized/project/start.js +1 -8
  105. package/background/src/lib/virtualized/project/start.js.map +1 -1
  106. package/background/src/lib/virtualized/project/writeMockDataTsx.js +25 -1
  107. package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
  108. package/background/src/lib/virtualized/project/writeScenarioComponents.js +129 -17
  109. package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
  110. package/background/src/lib/virtualized/project/writeUniversalMocks.js +56 -7
  111. package/background/src/lib/virtualized/project/writeUniversalMocks.js.map +1 -1
  112. package/codeyam-cli/src/cli.js +6 -0
  113. package/codeyam-cli/src/cli.js.map +1 -1
  114. package/codeyam-cli/src/codeyam-cli.js +0 -0
  115. package/codeyam-cli/src/commands/debug.js +221 -0
  116. package/codeyam-cli/src/commands/debug.js.map +1 -0
  117. package/codeyam-cli/src/commands/report.js +102 -0
  118. package/codeyam-cli/src/commands/report.js.map +1 -0
  119. package/codeyam-cli/src/commands/setup-sandbox.js +164 -0
  120. package/codeyam-cli/src/commands/setup-sandbox.js.map +1 -0
  121. package/codeyam-cli/src/utils/__tests__/cleanupAnalysisFiles.test.js +6 -6
  122. package/codeyam-cli/src/utils/__tests__/cleanupAnalysisFiles.test.js.map +1 -1
  123. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +8 -0
  124. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
  125. package/codeyam-cli/src/utils/analyzer.js +30 -0
  126. package/codeyam-cli/src/utils/analyzer.js.map +1 -1
  127. package/codeyam-cli/src/utils/cleanupAnalysisFiles.js +2 -2
  128. package/codeyam-cli/src/utils/cleanupAnalysisFiles.js.map +1 -1
  129. package/codeyam-cli/src/utils/generateReport.js +219 -0
  130. package/codeyam-cli/src/utils/generateReport.js.map +1 -0
  131. package/codeyam-cli/src/utils/install-skills.js +7 -0
  132. package/codeyam-cli/src/utils/install-skills.js.map +1 -1
  133. package/codeyam-cli/src/utils/queue/__tests__/job.pidTracking.test.js +1 -0
  134. package/codeyam-cli/src/utils/queue/__tests__/job.pidTracking.test.js.map +1 -1
  135. package/codeyam-cli/src/utils/queue/job.js +5 -1
  136. package/codeyam-cli/src/utils/queue/job.js.map +1 -1
  137. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +4 -0
  138. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
  139. package/codeyam-cli/src/webserver/app/lib/database.js +50 -2
  140. package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
  141. package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-D5ZHFomX.js +1 -0
  142. package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-CDnfNKKQ.js → InteractivePreview-XDSzQLOY.js} +2 -2
  143. package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-DUS-3h7I.js → LibraryFunctionPreview-BYVx9KFp.js} +1 -1
  144. package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-TJzDQku1.js → LogViewer-CRcT5fOZ.js} +1 -1
  145. package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-BORLgi0X.js +1 -0
  146. package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-BgdlWM6p.js → SafeScreenshot-Bual6h18.js} +1 -1
  147. package/codeyam-cli/src/webserver/build/client/assets/ScenarioPreview-Bi-YUMa-.js +6 -0
  148. package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-4D2vLLJz.js +5 -0
  149. package/codeyam-cli/src/webserver/build/client/assets/_index-BC200mfN.js +1 -0
  150. package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-CxvZPkCv.js +10 -0
  151. package/codeyam-cli/src/webserver/build/client/assets/api.generate-report-l0sNRNKZ.js +1 -0
  152. package/codeyam-cli/src/webserver/build/client/assets/chart-column-B8fb6wnw.js +1 -0
  153. package/codeyam-cli/src/webserver/build/client/assets/{chunk-WWGJGFF6-DvL0YqDJ.js → chunk-WWGJGFF6-De6i8FUT.js} +1 -1
  154. package/codeyam-cli/src/webserver/build/client/assets/circle-alert-IdsgAK39.js +1 -0
  155. package/codeyam-cli/src/webserver/build/client/assets/circle-check-BACUUf75.js +1 -0
  156. package/codeyam-cli/src/webserver/build/client/assets/clock-vWeoCemX.js +1 -0
  157. package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-CS7XDrKv.js +1 -0
  158. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-DIOEw_3i.js +1 -0
  159. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-3bYjyojg.js → entity._sha._-8Els_3Wb.js} +10 -10
  160. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.create-scenario-DtfwpN9J.js → entity._sha_.create-scenario-C3FZJx1w.js} +1 -1
  161. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.edit._scenarioId-YJz_igar.js +5 -0
  162. package/codeyam-cli/src/webserver/build/client/assets/entityStatus-BEqj2qBy.js +1 -0
  163. package/codeyam-cli/src/webserver/build/client/assets/entry.client-DiP0q291.js +5 -0
  164. package/codeyam-cli/src/webserver/build/client/assets/file-text-LM0mgxXE.js +1 -0
  165. package/codeyam-cli/src/webserver/build/client/assets/files-Dxh9CcaV.js +1 -0
  166. package/codeyam-cli/src/webserver/build/client/assets/{git-WoKohOtW.js → git-BXmqrWCH.js} +10 -10
  167. package/codeyam-cli/src/webserver/build/client/assets/globals-BGS74ED-.css +1 -0
  168. package/codeyam-cli/src/webserver/build/client/assets/html2canvas-pro.esm-XQCGvadH.js +5 -0
  169. package/codeyam-cli/src/webserver/build/client/assets/{index-Vvbl94Xc.js → index-D-zYbzFZ.js} +2 -2
  170. package/codeyam-cli/src/webserver/build/client/assets/loader-circle-BXPKbHEb.js +1 -0
  171. package/codeyam-cli/src/webserver/build/client/assets/manifest-1af162d4.js +1 -0
  172. package/codeyam-cli/src/webserver/build/client/assets/root-DB7VgjCY.js +16 -0
  173. package/codeyam-cli/src/webserver/build/client/assets/settings-5zF_GOcS.js +1 -0
  174. package/codeyam-cli/src/webserver/build/client/assets/{settings-LuiJ1UIm.js → settings-Dc4MlMpK.js} +1 -1
  175. package/codeyam-cli/src/webserver/build/client/assets/simulations-BQ-02-jB.js +1 -0
  176. package/codeyam-cli/src/webserver/build/client/assets/triangle-alert-D7k-ArFa.js +1 -0
  177. package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-CpUcCv1V.js → useLastLogLine-AlhS7g5F.js} +1 -1
  178. package/codeyam-cli/src/webserver/build/client/assets/useToast-Ddo4UQv7.js +1 -0
  179. package/codeyam-cli/src/webserver/build/client/assets/zap-_jw-9DCp.js +1 -0
  180. package/codeyam-cli/src/webserver/build/server/assets/{index-DzbqTxoN.js → index-D4JpXSIO.js} +1 -1
  181. package/codeyam-cli/src/webserver/build/server/assets/server-build-vwbN7n65.js +169 -0
  182. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  183. package/codeyam-cli/src/webserver/build-info.json +5 -5
  184. package/codeyam-cli/templates/codeyam-setup-skill.md +65 -85
  185. package/codeyam-cli/templates/debug-command.md +125 -0
  186. package/package.json +4 -6
  187. package/packages/ai/index.js +1 -1
  188. package/packages/ai/index.js.map +1 -1
  189. package/packages/ai/src/lib/analyzeScope.js +13 -0
  190. package/packages/ai/src/lib/analyzeScope.js.map +1 -1
  191. package/packages/ai/src/lib/astScopes/processExpression.js +12 -0
  192. package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
  193. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +1023 -405
  194. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
  195. package/packages/ai/src/lib/dataStructure/equivalencyManagers/FunctionCallManager.js +137 -1
  196. package/packages/ai/src/lib/dataStructure/equivalencyManagers/FunctionCallManager.js.map +1 -1
  197. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js +1 -1
  198. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js.map +1 -1
  199. package/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.js +112 -0
  200. package/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.js.map +1 -0
  201. package/packages/ai/src/lib/dataStructure/helpers/DebugTracer.js +176 -0
  202. package/packages/ai/src/lib/dataStructure/helpers/DebugTracer.js.map +1 -0
  203. package/packages/ai/src/lib/dataStructure/helpers/PathManager.js +178 -0
  204. package/packages/ai/src/lib/dataStructure/helpers/PathManager.js.map +1 -0
  205. package/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.js +138 -0
  206. package/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.js.map +1 -0
  207. package/packages/ai/src/lib/dataStructure/helpers/VisitedTracker.js +199 -0
  208. package/packages/ai/src/lib/dataStructure/helpers/VisitedTracker.js.map +1 -0
  209. package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js +2 -0
  210. package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js.map +1 -1
  211. package/packages/ai/src/lib/dataStructure/helpers/selectBestValue.js +62 -0
  212. package/packages/ai/src/lib/dataStructure/helpers/selectBestValue.js.map +1 -0
  213. package/packages/ai/src/lib/dataStructure/helpers/uniqueIdUtils.js +90 -0
  214. package/packages/ai/src/lib/dataStructure/helpers/uniqueIdUtils.js.map +1 -0
  215. package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js +22 -0
  216. package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js.map +1 -1
  217. package/packages/ai/src/lib/generateEntityKeyAttributes.js +32 -8
  218. package/packages/ai/src/lib/generateEntityKeyAttributes.js.map +1 -1
  219. package/packages/ai/src/lib/getConditionalUsagesFromCode.js +13 -8
  220. package/packages/ai/src/lib/getConditionalUsagesFromCode.js.map +1 -1
  221. package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js +36 -3
  222. package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js.map +1 -1
  223. package/packages/ai/src/lib/worker/SerializableDataStructure.js +7 -0
  224. package/packages/ai/src/lib/worker/SerializableDataStructure.js.map +1 -1
  225. package/packages/analyze/src/lib/FileAnalyzer.js +17 -5
  226. package/packages/analyze/src/lib/FileAnalyzer.js.map +1 -1
  227. package/packages/analyze/src/lib/asts/nodes/index.js +2 -1
  228. package/packages/analyze/src/lib/asts/nodes/index.js.map +1 -1
  229. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +6 -8
  230. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
  231. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +5 -1
  232. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
  233. package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js +8 -2
  234. package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js.map +1 -1
  235. package/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.js +5 -8
  236. package/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.js.map +1 -1
  237. package/packages/analyze/src/lib/files/analyzeChange.js +21 -9
  238. package/packages/analyze/src/lib/files/analyzeChange.js.map +1 -1
  239. package/packages/analyze/src/lib/files/analyzeEntity.js +10 -4
  240. package/packages/analyze/src/lib/files/analyzeEntity.js.map +1 -1
  241. package/packages/analyze/src/lib/files/analyzeInitial.js +21 -9
  242. package/packages/analyze/src/lib/files/analyzeInitial.js.map +1 -1
  243. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +6 -1
  244. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
  245. package/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.js +9 -1
  246. package/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.js.map +1 -1
  247. package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js +5 -1
  248. package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js.map +1 -1
  249. package/packages/analyze/src/lib/files/scenarios/generateScenarios.js +9 -1
  250. package/packages/analyze/src/lib/files/scenarios/generateScenarios.js.map +1 -1
  251. package/packages/generate/src/lib/scenarioComponent.js +5 -3
  252. package/packages/generate/src/lib/scenarioComponent.js.map +1 -1
  253. package/packages/supabase/src/lib/kysely/db.js +3 -0
  254. package/packages/supabase/src/lib/kysely/db.js.map +1 -1
  255. package/packages/supabase/src/lib/kysely/tables/debugReportsTable.js +27 -0
  256. package/packages/supabase/src/lib/kysely/tables/debugReportsTable.js.map +1 -0
  257. package/packages/utils/index.js +1 -0
  258. package/packages/utils/index.js.map +1 -1
  259. package/packages/utils/src/lib/Semaphore.js +40 -0
  260. package/packages/utils/src/lib/Semaphore.js.map +1 -0
  261. package/packages/utils/src/lib/frameworks/getRemixRoutePath.js +2 -1
  262. package/packages/utils/src/lib/frameworks/getRemixRoutePath.js.map +1 -1
  263. package/packages/utils/src/lib/frameworks/remixRouteFileNameToRoute.js +1 -0
  264. package/packages/utils/src/lib/frameworks/remixRouteFileNameToRoute.js.map +1 -1
  265. package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-B9Sf8e9w.js +0 -1
  266. package/codeyam-cli/src/webserver/build/client/assets/ScenarioPreview-Bl6GY-OE.js +0 -6
  267. package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-BDq8RX50.js +0 -5
  268. package/codeyam-cli/src/webserver/build/client/assets/_index-Bh3y3Wsl.js +0 -1
  269. package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-tq7Bl6-t.js +0 -10
  270. package/codeyam-cli/src/webserver/build/client/assets/chart-column-q9_nHfwv.js +0 -1
  271. package/codeyam-cli/src/webserver/build/client/assets/circle-alert-CKMpA1v_.js +0 -1
  272. package/codeyam-cli/src/webserver/build/client/assets/clock-Wnfog8Qw.js +0 -1
  273. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-C_ixaqqh.js +0 -1
  274. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.edit._scenarioId-QecTs_sq.js +0 -5
  275. package/codeyam-cli/src/webserver/build/client/assets/entry.client-hnkEgHrC.js +0 -5
  276. package/codeyam-cli/src/webserver/build/client/assets/file-text-CvCVdKLW.js +0 -1
  277. package/codeyam-cli/src/webserver/build/client/assets/files-DgUCYhbd.js +0 -1
  278. package/codeyam-cli/src/webserver/build/client/assets/globals-DZfbt0u5.css +0 -1
  279. package/codeyam-cli/src/webserver/build/client/assets/loader-circle-Bxm63UxG.js +0 -1
  280. package/codeyam-cli/src/webserver/build/client/assets/manifest-c90b8608.js +0 -1
  281. package/codeyam-cli/src/webserver/build/client/assets/root-DrVZQamX.js +0 -16
  282. package/codeyam-cli/src/webserver/build/client/assets/search-CJkk16Ct.js +0 -1
  283. package/codeyam-cli/src/webserver/build/client/assets/settings-ConzHeiL.js +0 -1
  284. package/codeyam-cli/src/webserver/build/client/assets/simulations-B9LRwAej.js +0 -1
  285. package/codeyam-cli/src/webserver/build/client/assets/useToast-DOxmMaSg.js +0 -1
  286. package/codeyam-cli/src/webserver/build/client/assets/zap-D5R1FAcH.js +0 -1
  287. package/codeyam-cli/src/webserver/build/server/assets/server-build-DGGis3OZ.js +0 -166
@@ -0,0 +1 @@
1
+ import{w as J,u as K,b as ee,d as se,r as d,j as e,L as x}from"./chunk-WWGJGFF6-De6i8FUT.js";import{u as te}from"./useLastLogLine-AlhS7g5F.js";import{u as le}from"./useToast-Ddo4UQv7.js";import{L as ne}from"./LogViewer-CRcT5fOZ.js";import{I as b,C as V,E as ae}from"./EntityTypeIcon-D5ZHFomX.js";import{S as _}from"./SafeScreenshot-Bual6h18.js";import{c as re}from"./createLucideIcon-CS7XDrKv.js";import{C as ie}from"./circle-check-BACUUf75.js";import{S as oe}from"./settings-5zF_GOcS.js";import{Z as ce}from"./zap-_jw-9DCp.js";import{L as w}from"./loader-circle-BXPKbHEb.js";import"./file-text-LM0mgxXE.js";import"./chart-column-B8fb6wnw.js";const de=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],me=re("folder-open",de),Se=()=>[{title:"Dashboard - CodeYam"},{name:"description",content:"CodeYam project dashboard"}],Ee=J(function(){const{stats:j,uncommittedFiles:g,uncommittedEntitiesList:C,recentSimulations:h,visualEntitiesForSimulation:y,projectSlug:v,queueState:F,currentCommit:H}=K(),i=ee(),P=se(),{showToast:m}=le(),[W,I]=d.useState(new Set),[o,T]=d.useState(null),[R,A]=d.useState(!1),[L,k]=d.useState(!1),{lastLine:S,isCompleted:z,resetLogs:Z}=te(v,!!o),{simulatingEntity:f,scenarios:N,scenarioStatuses:U,allScenariosCaptured:E}=d.useMemo(()=>{const s={simulatingEntity:null,scenarios:[],scenarioStatuses:[],allScenariosCaptured:!1};if(!o)return s;const t=y?.find(r=>r.sha===o);if(!t)return s;const l=t.analyses?.[0],a=l?.scenarios||[],n=l?.status?.scenarios||[],u=n.filter(r=>r.screenshotFinishedAt).length,p=a.length>0&&u===a.length;return{simulatingEntity:t,scenarios:a,scenarioStatuses:n,allScenariosCaptured:p}},[o,y]);d.useEffect(()=>{(z||E)&&T(null)},[z,E]);const q=H?.metadata?.currentRun,$=new Set(q?.currentEntityShas||[]),M=new Set(F.jobs.flatMap(s=>s.entityShas||[])),B=new Set(F.currentlyExecuting?.entityShas||[]),D=C.filter(s=>s.entityType==="visual"||s.entityType==="library"),c=D.filter(s=>!$.has(s.sha)&&!M.has(s.sha)&&!B.has(s.sha)),Q=()=>{if(c.length===0){m("All entities are already queued or analyzing","info",3e3);return}console.log("Analyzing uncommitted entities not yet queued:",c.length),console.log("Entity SHAs:",c.map(s=>s.sha)),k(!0),m(`Starting analysis for ${c.length} entities...`,"info",3e3),i.submit({entityShas:c.map(s=>s.sha).join(",")},{method:"post",action:"/api/analyze"})};d.useEffect(()=>{if(i.state==="idle"&&i.data){const s=i.data;s.success?(console.log("[Analyze All] Success:",s.message),m(`Analysis started for ${s.entityCount} entities in ${s.fileCount} files. Watch the logs for progress.`,"success",6e3),k(!1)):s.error&&(console.error("[Analyze All] Error:",s.error),m(`Error: ${s.error}`,"error",8e3),k(!1))}},[i.state,i.data,m]);const Y=(s,t)=>{console.log("Simulating entity:",s);const l=y?.find(a=>a.sha===s);T(s),Z(),m(`Starting analysis for ${l?.name||"entity"}...`,"info",3e3),i.submit({entitySha:s,filePath:t},{method:"post",action:"/api/analyze"})},O=s=>{I(t=>{const l=new Set(t);return l.has(s)?l.delete(s):l.add(s),l})},G=d.useMemo(()=>{const s=new Map;return h.forEach(t=>{const l=t.entitySha;s.has(l)||s.set(l,[]),s.get(l).push(t)}),Array.from(s.entries()).map(([t,l])=>({entitySha:t,entityName:l[0].entityName,scenarios:l}))},[h]),X=[{label:"Total Entities",value:j.totalEntities,iconType:"folder",link:"/files",color:"#F59E0B"},{label:"Analyzed Entities",value:j.entitiesWithAnalyses,iconType:"check",link:"/simulations",color:"#10B981"},{label:"Visual Components",value:j.visualEntities,iconType:"image",link:"/files?entityType=visual",color:"#8B5CF6"},{label:"Library Functions",value:j.libraryEntities,iconType:"code-xml",link:"/files?entityType=library",color:"#0DBFE9"}];return e.jsx("div",{className:"bg-cygray-10 min-h-screen",children:e.jsxs("div",{className:"py-6 px-12",children:[e.jsxs("header",{className:"mb-8 flex justify-between items-center",children:[e.jsx("div",{children:e.jsx("h1",{className:"text-3xl font-bold text-gray-900 m-0 mb-2",children:"CodeYam"})}),P.state==="loading"&&e.jsx("div",{className:"text-blue-600 text-sm font-medium animate-pulse",children:"🔄 Updating..."})]}),e.jsx("div",{className:"flex items-center justify-between gap-3",children:X.map((s,t)=>e.jsx(x,{to:s.link,className:"flex-1 bg-white rounded-xl border border-gray-200 overflow-hidden flex transition-all hover:shadow-lg hover:-translate-y-0.5 no-underline",style:{borderLeft:`4px solid ${s.color}`},children:e.jsxs("div",{className:"px-6 py-4 flex flex-col gap-3 flex-1",children:[e.jsxs("div",{className:"flex md:justify-between md:items-start md:flex-row flex-col",children:[e.jsx("div",{className:"text-xs text-gray-700 font-medium",children:s.label}),e.jsx("div",{className:"text-xs font-medium transition-colors flex items-center gap-1 hidden md:flex",style:{color:s.color},children:"View All →"})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"rounded-lg p-2 leading-none flex-shrink-0",style:{backgroundColor:`${s.color}15`},children:[s.iconType==="folder"&&e.jsx(me,{size:20,style:{color:s.color}}),s.iconType==="check"&&e.jsx(ie,{size:20,style:{color:s.color}}),s.iconType==="image"&&e.jsx(b,{size:20,style:{color:s.color}}),s.iconType==="gear"&&e.jsx(oe,{size:20,style:{color:s.color}}),s.iconType==="code-xml"&&e.jsx(V,{size:20,style:{color:s.color}})]}),e.jsx("div",{className:"text-2xl font-bold text-gray-900 leading-none",children:s.value})]}),e.jsx("div",{className:"text-xs font-medium transition-colors flex items-center gap-1 md:hidden",style:{color:s.color},children:"View All →"})]})]})},t))}),e.jsxs("div",{className:"mt-12 grid gap-8 items-start",style:{gridTemplateColumns:"repeat(auto-fit, minmax(500px, 1fr))"},children:[e.jsxs("section",{id:"uncommitted",className:"bg-white border border-gray-200 rounded-xl p-6",children:[e.jsxs("div",{className:"flex justify-between items-start mb-5",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-[22px] font-semibold text-gray-900 m-0 mb-1",children:"Uncommitted Changes"}),e.jsx("p",{className:"text-sm text-gray-500 m-0",children:g.length>0?`${g.length} file${g.length!==1?"s":""} with ${C.length} uncommitted entit${C.length!==1?"ies":"y"}`:"No uncommitted changes detected"})]}),D.length>0&&e.jsx("button",{onClick:Q,disabled:i.state!=="idle"||L||c.length===0,className:"px-5 py-2.5 text-white border-none rounded-lg text-sm font-semibold cursor-pointer transition-all hover:-translate-y-px disabled:bg-gray-400 disabled:cursor-not-allowed disabled:translate-y-0",style:{backgroundColor:"#005C75"},onMouseEnter:s=>s.currentTarget.style.backgroundColor="#004560",onMouseLeave:s=>s.currentTarget.style.backgroundColor="#005C75",children:i.state!=="idle"||L?"Starting analysis...":c.length===0?"All Queued":`Analyze All (${c.length})`})]}),g.length>0?e.jsx("div",{className:"flex flex-col gap-3",children:g.map(([s,t])=>{const l=W.has(s),a=t.editedEntities||[];return e.jsxs("div",{className:"bg-white border border-gray-200 border-l-4 rounded-lg overflow-hidden",style:{borderLeftColor:"#306AFF"},children:[e.jsx("div",{className:"p-4 cursor-pointer select-none transition-colors hover:bg-gray-50",onClick:()=>O(s),role:"button",tabIndex:0,children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-gray-500 text-xs w-4 shrink-0",children:l?"▼":"▶"}),e.jsxs("svg",{width:"16",height:"20",viewBox:"0 0 12 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"shrink-0",children:[e.jsxs("g",{clipPath:"url(#clip0_784_10666)",children:[e.jsx("path",{d:"M0 2.55857C0 1.14551 1.14551 0 2.55857 0H8.73194L12 3.3616V13.4414C12 14.8545 10.8545 16 9.44143 16H2.55857C1.14551 16 0 14.8545 0 13.4414V2.55857Z",fill:"#DDDDFE"}),e.jsx("path",{d:"M8.72656 3.3307H11.9906L8.72656 0V3.3307Z",fill:"#306AFF"}),e.jsx("line",{x1:"1.8125",y1:"5.94825",x2:"10.0235",y2:"5.94825",stroke:"#306AFF",strokeWidth:"1.27929"}),e.jsx("line",{x1:"1.8125",y1:"8.82715",x2:"6.01207",y2:"8.82715",stroke:"#306AFF",strokeWidth:"1.27929"}),e.jsx("line",{x1:"1.8125",y1:"11.7061",x2:"10.0235",y2:"11.7061",stroke:"#306AFF",strokeWidth:"1.27929"})]}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_784_10666",children:e.jsx("rect",{width:"12",height:"16",fill:"white"})})})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"font-normal text-gray-900 text-sm block truncate",children:s}),e.jsxs("span",{className:"text-xs text-gray-500",children:[a.length," entit",a.length!==1?"ies":"y"]})]})]})}),l&&e.jsx("div",{className:"border-t border-gray-200 bg-gray-50 p-3 flex flex-col gap-2",children:a.length>0?a.map(n=>{const u=$.has(n.sha),p=M.has(n.sha)||B.has(n.sha);return e.jsxs(x,{to:`/entity/${n.sha}`,className:"flex items-center gap-4 p-4 bg-white border border-gray-200 rounded-lg no-underline transition-all hover:shadow-md hover:-translate-y-0.5",style:{borderColor:"inherit"},onMouseEnter:r=>r.currentTarget.style.borderColor="#005C75",onMouseLeave:r=>r.currentTarget.style.borderColor="inherit",children:[e.jsxs("div",{className:"shrink-0 rounded-lg p-1.5 flex items-center justify-center",style:{backgroundColor:n.entityType==="visual"?"#8B5CF615":n.entityType==="library"?"#6366F1":"#EC4899"},children:[n.entityType==="visual"&&e.jsx(b,{size:16,style:{color:"#8B5CF6"}}),n.entityType==="library"&&e.jsx(V,{size:16,className:"text-white"}),n.entityType==="other"&&e.jsx(ce,{size:16,className:"text-white"})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[e.jsx("div",{className:"font-semibold text-gray-900 text-sm",children:n.name}),n.entityType==="visual"&&e.jsx("div",{className:"px-2 py-0.5 rounded-sm text-[10px] uppercase font-bold",style:{backgroundColor:"#8B5CF60D",color:"#8B5CF6"},children:"Visual"}),n.entityType==="library"&&e.jsx("div",{className:"px-2 py-0.5 rounded-sm text-[10px] uppercase font-bold",style:{backgroundColor:"#0DBFE90D",color:"#0DBFE9"},children:"Library"}),n.entityType==="other"&&e.jsx("div",{className:"px-2 py-0.5 rounded-sm text-[10px] uppercase font-bold",style:{backgroundColor:"#EC48990D",color:"#EC4899"},children:"Other"})]}),n.description&&e.jsx("div",{className:"text-sm text-gray-500 mt-1 overflow-hidden text-ellipsis whitespace-nowrap",children:n.description})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u&&e.jsxs("div",{className:"px-2 py-1 bg-pink-100 rounded text-xs text-pink-700 font-semibold flex items-center gap-1.5",children:[e.jsx(w,{size:14,className:"animate-spin"}),"Analyzing..."]}),!u&&p&&e.jsx("div",{className:"px-2 py-1 bg-purple-50 border border-purple-300 rounded text-xs text-purple-700 font-semibold",children:"⏳ Queued"}),!u&&!p&&e.jsx("button",{onClick:r=>{r.preventDefault(),r.stopPropagation(),m(`Starting analysis for ${n.name}...`,"info",3e3),i.submit({entityShas:n.sha},{method:"post",action:"/api/analyze"})},disabled:i.state!=="idle",className:"px-3 py-1.5 text-white border-none rounded text-xs font-medium cursor-pointer transition-all disabled:bg-gray-400 disabled:cursor-not-allowed",style:{backgroundColor:"#005C75"},onMouseEnter:r=>r.currentTarget.style.backgroundColor="#004560",onMouseLeave:r=>r.currentTarget.style.backgroundColor="#005C75",children:"Analyze"})]})]},n.sha)}):e.jsx("div",{className:"text-sm text-gray-500 italic p-2",children:"No entity changes detected in this file"})})]},s)})}):e.jsxs("div",{className:"py-12 px-6 text-center flex flex-col items-center bg-gray-50 rounded-lg min-h-[200px] justify-center",children:[e.jsxs("svg",{width:"52",height:"68",viewBox:"0 0 26 34",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"mb-4 opacity-40",children:[e.jsxs("g",{clipPath:"url(#clip0_784_10631)",children:[e.jsx("path",{d:"M0 2.55857C0 1.14551 1.14551 0 2.55857 0H18.9423L26.0318 7.14651V31.4562C26.0318 32.8693 24.8863 34.0148 23.4732 34.0148H2.55857C1.14551 34.0148 0 32.8693 0 31.4562V2.55857Z",fill:"#D9D9D9"}),e.jsx("path",{d:"M18.9453 7.08081H26.0261L18.9453 0V7.08081Z",fill:"#646464"}),e.jsx("line",{x1:"3.92188",y1:"13.3633",x2:"21.7341",y2:"13.3633",stroke:"#646464",strokeWidth:"1.27929"}),e.jsx("line",{x1:"3.92188",y1:"19.4863",x2:"13.0321",y2:"19.4863",stroke:"#646464",strokeWidth:"1.27929"}),e.jsx("line",{x1:"3.92188",y1:"25.6016",x2:"21.7341",y2:"25.6016",stroke:"#646464",strokeWidth:"1.27929"})]}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_784_10631",children:e.jsx("rect",{width:"26",height:"34",fill:"white"})})})]}),e.jsx("p",{className:"text-sm font-medium text-gray-400 m-0 mb-2",children:"No Uncommitted Changes."})]})]}),e.jsxs("section",{className:"bg-white border border-gray-200 rounded-xl p-6",children:[e.jsx("div",{className:"flex justify-between items-start mb-5",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-[22px] font-semibold text-gray-900 m-0 mb-1",children:"Recent Simulations"}),e.jsx("p",{className:"text-sm text-gray-500 m-0",children:h.length>0?`Latest ${h.length} captured screenshot${h.length!==1?"s":""}`:"No simulations captured yet"})]})}),h.length>0&&!o?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-6 mb-5",children:G.map(s=>e.jsxs("div",{children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx("div",{className:"shrink-0 rounded-lg p-1.5 flex items-center justify-center bg-purple-100",children:e.jsx(b,{size:16,style:{color:"#8B5CF6"}})}),e.jsx(x,{to:`/entity/${s.entitySha}`,className:"text-sm font-semibold text-gray-900 no-underline hover:text-gray-700 transition-colors",children:s.entityName})]}),e.jsx("div",{className:"grid grid-cols-4 gap-3",children:s.scenarios.map((t,l)=>e.jsx(x,{to:t.scenarioId?`/entity/${t.entitySha}/scenarios/${t.scenarioId}`:`/entity/${t.entitySha}`,className:"aspect-4/3 border border-gray-200 rounded-lg overflow-hidden bg-gray-50 transition-all flex items-center justify-center hover:scale-105",onMouseEnter:a=>{a.currentTarget.style.borderColor="#005C75",a.currentTarget.style.boxShadow="0 4px 12px rgba(0, 92, 117, 0.2)"},onMouseLeave:a=>{a.currentTarget.style.borderColor="#E5E7EB",a.currentTarget.style.boxShadow="none"},title:`${t.scenarioName}`,children:e.jsx(_,{screenshotPath:t.screenshotPath,alt:t.scenarioName,className:"max-w-full max-h-full object-contain object-center"})},l))})]},s.entitySha))}),e.jsx(x,{to:"/simulations",className:"block text-center p-3 rounded-lg no-underline font-semibold text-sm transition-all",style:{color:"#005C75",backgroundColor:"#F6F9FC"},onMouseEnter:s=>s.currentTarget.style.backgroundColor="#EEF4F8",onMouseLeave:s=>s.currentTarget.style.backgroundColor="#F6F9FC",children:"View All Recent Simulations →"})]}):o?e.jsxs("div",{className:"p-0 bg-white rounded-lg flex flex-col gap-0",children:[f&&e.jsx("div",{className:"p-4 rounded-t-lg",style:{backgroundColor:"#F0F5F8",borderBottom:"2px solid #005C75"},children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-[32px] leading-none",children:e.jsx(ae,{type:"visual"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"text-base font-bold mb-1",style:{color:"#005C75"},children:["Generating Simulations for ",f.name]}),e.jsx("div",{className:"text-[13px] text-gray-500 font-mono overflow-hidden text-ellipsis whitespace-nowrap",children:f.filePath})]})]})}),E?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-emerald-600 font-medium p-4 bg-emerald-50",children:[e.jsx("span",{className:"text-lg",children:"✅"}),e.jsxs("span",{children:["Complete (",N.length," scenario",N.length!==1?"s":"",")"]})]}):S?e.jsxs("div",{className:"flex items-center justify-between gap-1.5 text-sm font-medium p-4 bg-gray-50",style:{color:"#005C75"},children:[e.jsx(w,{size:18,className:"animate-spin shrink-0"}),e.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap font-mono text-xs",title:S,children:S}),v&&e.jsx("button",{onClick:()=>A(!0),className:"px-2 py-1.5 bg-gray-500 text-white border-none rounded-md text-[13px] font-medium cursor-pointer transition-all whitespace-nowrap self-start hover:bg-gray-600 hover:-translate-y-px",title:"View analysis logs",children:"📋 Logs"})]}):i.state!=="idle"?e.jsxs("div",{className:"flex items-center justify-between gap-1.5 text-sm font-medium p-4 bg-gray-50",style:{color:"#005C75"},children:[e.jsx(w,{size:18,className:"animate-spin shrink-0"}),e.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap",children:"Initializing analysis..."})]}):e.jsxs("div",{className:"flex items-center justify-between gap-1.5 text-sm font-medium p-4 bg-gray-50",style:{color:"#005C75"},children:[e.jsx(w,{size:18,className:"animate-spin shrink-0"}),e.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap",children:"Starting analysis..."})]}),N.length>0&&e.jsx("div",{className:"flex gap-2 flex-wrap p-4 bg-white border-t border-gray-200",children:N.slice(0,8).map((s,t)=>{const l=s.metadata?.screenshotPaths?.[0],a=U.find(p=>p.name===s.name),n=a?.screenshotStartedAt&&!a?.screenshotFinishedAt;return l?e.jsx(x,{to:`/entity/${o}`,className:"w-20 h-15 border-2 border-gray-200 rounded overflow-hidden bg-gray-50 cursor-pointer transition-all flex items-center justify-center no-underline hover:border-blue-600 hover:scale-105 hover:shadow-md",children:e.jsx(_,{screenshotPath:l,alt:s.name,title:s.name,className:"max-w-full max-h-full object-contain object-center"})},t):e.jsx("div",{className:"w-20 h-15 border-2 border-dashed border-gray-300 rounded bg-gray-50 flex items-center justify-center text-2xl",title:`Capturing ${s.name}...`,children:e.jsx("span",{className:n?"animate-pulse":"text-gray-400",children:n?"⋯":"⏹️"})},t)})})]}):e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsxs("div",{className:"py-12 px-6 text-center bg-gray-50 rounded-lg w-full flex flex-col items-center justify-center min-h-[200px]",children:[e.jsx("div",{className:"mb-4 bg-[#efefef] rounded-lg p-3",children:e.jsx(b,{size:28,style:{color:"#999999"},strokeWidth:1.5})}),e.jsx("p",{className:"text-gray-700 m-0 font-semibold",children:"Start by analyzing your first component below."})]}),(y?.length??0)>0?e.jsx(e.Fragment,{children:e.jsx("div",{className:"flex flex-col gap-3 mt-6 w-full",children:(o&&f?[f]:y||[]).map(s=>e.jsx("div",{className:"flex flex-col gap-3",children:e.jsxs("div",{className:"flex items-center gap-4 p-4 bg-white border border-gray-200 rounded-lg transition-colors",style:{borderLeft:"4px solid #8B5CF6"},onMouseEnter:t=>{t.currentTarget.style.backgroundColor="#F9FAFB"},onMouseLeave:t=>{t.currentTarget.style.backgroundColor="white"},children:[e.jsxs(x,{to:`/entity/${s.sha}`,className:"flex items-center gap-4 flex-1 min-w-0 no-underline",children:[e.jsx("div",{className:"shrink-0 rounded-lg p-1.5 flex items-center justify-center bg-purple-100",children:e.jsx(b,{size:16,style:{color:"#8B5CF6"}})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-semibold text-gray-900 text-sm mb-1",children:s.name}),e.jsx("div",{className:"text-xs text-gray-500 font-mono overflow-hidden text-ellipsis whitespace-nowrap",children:s.filePath})]})]}),e.jsx("button",{onClick:()=>Y(s.sha,s.filePath||""),disabled:i.state!=="idle"||o!==null,className:"px-4 py-2 text-white border-none rounded text-sm font-medium cursor-pointer transition-all whitespace-nowrap shrink-0 disabled:bg-gray-400 disabled:cursor-not-allowed disabled:translate-y-0",style:{backgroundColor:"#005C75"},onMouseEnter:t=>t.currentTarget.style.backgroundColor="#004560",onMouseLeave:t=>t.currentTarget.style.backgroundColor="#005C75",title:o?"Please wait for current analysis to complete":"Analyze this entity",children:"Analyze"})]})},s.sha))})}):e.jsx("p",{className:"text-base text-gray-600 m-0 mb-6 leading-relaxed mt-6",children:"Run analysis on your visual components to create simulations and capture screenshots"})]})]})]}),R&&v&&e.jsx(ne,{projectSlug:v,onClose:()=>A(!1)})]})})});export{Ee as default,Se as meta};
@@ -0,0 +1,10 @@
1
+ import{b as E,j as e,L as g,w as L,u as q,f as D,r as A,d as K}from"./chunk-WWGJGFF6-De6i8FUT.js";import{S as F}from"./settings-5zF_GOcS.js";import{F as C}from"./file-text-LM0mgxXE.js";import{L as _}from"./LogViewer-CRcT5fOZ.js";import{u as I}from"./useLastLogLine-AlhS7g5F.js";import{C as $,S as z}from"./ScenarioPreview-Bi-YUMa-.js";import{c as T}from"./createLucideIcon-CS7XDrKv.js";import{C as W}from"./chart-column-B8fb6wnw.js";import{C as B}from"./circle-alert-IdsgAK39.js";import"./SafeScreenshot-Bual6h18.js";import"./LibraryFunctionPreview-BYVx9KFp.js";const H=[["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["circle",{cx:"12",cy:"12",r:"8",key:"46899m"}]],Q=T("cog",H);const J=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],V=T("list-todo",J);const O=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],M=T("pause",O);function R(i){const s=Date.now(),c=new Date(i).getTime(),r=s-c,l=Math.floor(r/6e4),t=Math.floor(l/60);return l<1?"just now":l<60?`${l}m ago`:t<24?`${t}h ago`:`${Math.floor(t/24)}d ago`}function U({state:i,currentRun:s}){E();const c=s?.currentEntityShas&&s.currentEntityShas.length>0;return!i.currentlyExecuting&&(!i.jobs||i.jobs.length===0)?null:e.jsxs("div",{className:"bg-white border-2 rounded-xl shadow-lg p-5 mb-6",style:{borderColor:"#005C75"},children:[i.currentlyExecuting&&!c&&e.jsxs("div",{className:"mb-4 border-2 rounded-lg p-3",style:{backgroundColor:"#e8f1f5",borderColor:"#005C75"},children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(F,{size:20,className:"animate-spin",style:{color:"#005C75"}}),e.jsx("span",{className:"text-sm font-bold",style:{color:"#003d52"},children:"Starting analysis..."})]}),e.jsxs("p",{className:"text-xs mb-2",style:{color:"#004a5e"},children:["Booting analyzer for"," ",i.currentlyExecuting.entities?.length||i.currentlyExecuting.entityShas?.length||1," ",(i.currentlyExecuting.entities?.length||i.currentlyExecuting.entityShas?.length)===1?"entity":"entities"]}),i.currentlyExecuting.entities&&i.currentlyExecuting.entities.length>0&&e.jsxs("div",{className:"space-y-1 mt-2 max-h-[100px] overflow-y-auto bg-white rounded-md p-2 border",style:{borderColor:"#b3d9e6"},children:[i.currentlyExecuting.entities.slice(0,3).map(r=>e.jsxs(g,{to:`/entity/${r.sha}`,className:"flex items-center gap-1.5 text-xs hover:underline font-medium truncate",title:`${r.name} - ${r.filePath}`,style:{color:"#005C75"},onMouseEnter:l=>l.currentTarget.style.color="#003d52",onMouseLeave:l=>l.currentTarget.style.color="#005C75",children:[e.jsx(C,{size:12,style:{strokeWidth:1.5,flexShrink:0}}),e.jsxs("span",{className:"truncate",children:[r.name,e.jsxs("span",{className:"text-gray-400 ml-1",children:["(",r.filePath,")"]})]})]},r.sha)),i.currentlyExecuting.entities.length>3&&e.jsxs("div",{className:"text-xs italic",style:{color:"#005C75"},children:["+",i.currentlyExecuting.entities.length-3," more entities"]})]}),e.jsx("p",{className:"text-xs mt-2",style:{color:"#005C75"},children:"This may take 2-3 minutes for environment setup"})]}),i.jobs.length>0&&e.jsxs("div",{className:"space-y-2",children:[i.jobs.slice(0,5).map((r,l)=>{r.entities?.length||r.entityShas?.length,r.filePaths?.length,r.entityNames?.[0];const t=r.entities&&r.entities.length>0;return e.jsx("div",{className:"flex items-start gap-3",children:e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsxs("span",{className:"text-sm font-semibold text-gray-700",children:["Job ",l+1]}),e.jsx("span",{className:"text-xs text-gray-400",children:"•"}),e.jsx("span",{className:"text-xs text-gray-500",children:R(r.queuedAt)})]}),t&&e.jsxs("div",{className:"space-y-1 mt-2 max-h-[120px] overflow-y-auto bg-white rounded-md p-2 border border-gray-200",children:[r.entities.slice(0,5).map(n=>e.jsxs(g,{to:`/entity/${n.sha}`,className:"flex items-center gap-1.5 text-xs hover:underline font-medium truncate",title:`${n.name} - ${n.filePath}`,style:{color:"#005C75"},onMouseEnter:u=>u.currentTarget.style.color="#003d52",onMouseLeave:u=>u.currentTarget.style.color="#005C75",children:[e.jsx(C,{size:12,style:{strokeWidth:1.5,flexShrink:0}}),e.jsxs("span",{className:"truncate",children:[n.name,e.jsxs("span",{className:"text-gray-400 ml-1",children:["(",n.filePath,")"]})]})]},n.sha)),r.entities.length>5&&e.jsxs("div",{className:"text-xs text-gray-500 italic",children:["+",r.entities.length-5," more entities"]})]}),r.type==="recapture"&&r.scenarioId&&e.jsxs("div",{className:"text-xs text-gray-500 mt-1 font-mono",children:["Scenario: ",r.scenarioId]})]})},r.id)}),i.jobs.length>5&&e.jsxs("div",{className:"text-xs text-gray-500 text-center py-2",children:["+",i.jobs.length-5," more jobs in queue"]})]})]})}function G({activeTab:i,hasCurrentActivity:s,queuedCount:c,historicCount:r}){const l=[{id:"current",label:"Current Activity",hasContent:s,count:null},{id:"queued",label:"Queued Activity",hasContent:c>0,count:c},{id:"historic",label:"Historic Activity",hasContent:r>0,count:r}];return e.jsx("div",{className:"border-b border-gray-200 mb-6",children:e.jsx("nav",{className:"flex gap-8",children:l.map(t=>{const n=i===t.id;return e.jsx(g,{to:t.id==="current"?"/activity":`/activity/${t.id}`,className:`
2
+ relative pb-4 px-2 text-sm font-medium transition-colors
3
+ ${n?"border-b-2":"text-gray-500 hover:text-gray-700"}
4
+ `,style:n?{color:"#005C75",borderColor:"#005C75"}:{},children:e.jsxs("span",{className:"flex items-center gap-2",children:[t.label,t.count!==null&&t.count>0&&e.jsx("span",{className:`
5
+ inline-flex items-center justify-center px-2 py-0.5 text-xs font-semibold rounded-full
6
+ ${n?"":"bg-gray-200 text-gray-700"}
7
+ `,style:n?{backgroundColor:"#e8f1f5",color:"#005C75"}:{},children:t.count}),t.count===null&&t.hasContent&&e.jsx("span",{className:`
8
+ inline-block w-2 h-2 rounded-full
9
+ ${n?"":"bg-gray-400"}
10
+ `,style:n?{backgroundColor:"#005C75"}:{}})]})},t.id)})})})}function X(i){const s=new Date(i),r=Math.floor((new Date().getTime()-s.getTime())/1e3);if(r<60)return"just now";const l=Math.floor(r/60);if(l<60)return`${l}m ago`;const t=Math.floor(l/60);return t<24?`${t}h ago`:`${Math.floor(t/24)}d ago`}function Y({currentlyExecuting:i,currentRun:s,state:c,projectSlug:r,commitSha:l,onShowLogs:t,recentCompletedRuns:n,totalCompletedRuns:u}){const[h,P]=A.useState({}),[p,j]=A.useState({isKilling:!1,current:0,total:0}),w=K(),k=!!i,y=i?.entities||[],x=!!s?.analysisCompletedAt,N=k,{lastLine:v}=I(r,N);return A.useEffect(()=>{if(!s)return;const a=[s.analyzerPid,s.capturePid].filter(o=>!!o);if(a.length===0)return;const m=async()=>{try{const d=await(await fetch(`/api/process-status?pids=${a.join(",")}`)).json();if(d.processes){const b={};d.processes.forEach(S=>{b[S.pid]={isRunning:S.isRunning,processName:S.processName}}),P(b)}}catch(o){console.error("Failed to fetch process statuses:",o)}};m();const f=setInterval(()=>{m()},5e3);return()=>clearInterval(f)},[s?.analyzerPid,s?.capturePid]),N?e.jsxs("div",{className:"bg-white rounded-xl shadow-lg p-6",style:{borderWidth:"2px",borderColor:"#005C75"},children:[e.jsxs("div",{className:"flex items-start justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"p-2 bg-gray-100 rounded-full animate-spin",children:e.jsx(Q,{size:24,className:"text-gray-700"})}),e.jsx("h3",{className:"text-xl font-bold text-gray-900",children:x?"Capture in Progress":"Analysis in Progress"})]}),e.jsx("button",{onClick:t,className:"px-4 py-2 text-white rounded-md text-sm font-semibold transition-colors",style:{backgroundColor:"#005C75"},onMouseEnter:a=>a.currentTarget.style.backgroundColor="#003d52",onMouseLeave:a=>a.currentTarget.style.backgroundColor="#005C75",children:"View Logs"})]}),x&&(s?.readyToBeCaptured??0)>0&&e.jsxs("div",{className:"rounded-md p-4 mb-4",style:{backgroundColor:"#f0f5f8",borderColor:"#b3d9e8",borderWidth:"1px"},children:[e.jsx("p",{className:"text-sm font-semibold mb-1",style:{color:"#00263d"},children:"Capture Progress:"}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("p",{className:"text-sm",style:{color:"#004560"},children:[s?.capturesCompleted??0," of"," ",s?.readyToBeCaptured??0," entities captured"]}),e.jsx("div",{className:"flex-1 rounded-full h-2",style:{backgroundColor:"#b3d9e8"},children:e.jsx("div",{className:"h-2 rounded-full transition-all duration-300",style:{backgroundColor:"#005C75",width:`${(s?.capturesCompleted??0)/(s?.readyToBeCaptured??1)*100}%`}})})]})]}),y&&y.length>0&&e.jsxs("div",{className:"mb-4",children:[e.jsxs("p",{className:"text-sm font-semibold text-gray-700 mb-2",children:[x?"Capturing":"Analyzing"," ",y.length," ",y.length===1?"Entity":"Entities",":"]}),e.jsx("div",{className:"space-y-3",children:y.map(a=>{const m=a.analyses?.[0],f=m?.scenarios||[],o=m?.status;return e.jsxs("div",{className:"bg-gray-50 rounded-md p-3",children:[e.jsxs(g,{to:`/entity/${a.sha}`,className:"flex items-center gap-1.5 text-sm hover:underline font-medium truncate mb-2",title:`${a.name} - ${a.filePath}`,style:{color:"#005C75"},onMouseEnter:d=>d.currentTarget.style.color="#003d52",onMouseLeave:d=>d.currentTarget.style.color="#005C75",children:[e.jsx(C,{size:14,style:{strokeWidth:1.5,flexShrink:0}}),e.jsxs("span",{className:"truncate",children:[a.name,e.jsxs("span",{className:"text-gray-500 ml-2 text-xs",children:["(",a.filePath,")"]})]})]}),f.length>0&&e.jsx("div",{className:"flex gap-2 flex-wrap",children:f.slice(0,5).map((d,b)=>d.id?e.jsx(z,{scenario:d,entity:{sha:a.sha,entityType:a.entityType},analysisStatus:o,queueState:c,processIsRunning:N,size:"small"},b):null)})]},a.sha)})})]}),v&&e.jsxs("div",{className:"flex flex-col gap-2 mb-4",children:[e.jsx("p",{className:"text-sm font-semibold text-gray-700",children:"Current Step:"}),e.jsx("p",{className:"text-sm text-gray-600 font-mono",children:v})]}),(s?.analyzerPid||s?.capturePid)&&e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("p",{className:"text-sm font-semibold text-gray-700",children:"Running Processes:"}),e.jsxs("div",{className:"flex items-center justify-between bg-gray-50 rounded-md p-3",children:[e.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[s.analyzerPid&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-xs font-mono bg-gray-200 px-2 py-1 rounded",children:["Analyzer: ",s.analyzerPid]}),h[s.analyzerPid]&&e.jsx("span",{className:`text-xs px-2 py-1 rounded ${h[s.analyzerPid].isRunning?"bg-green-100 text-green-700":"bg-red-100 text-red-700"}`,children:h[s.analyzerPid].isRunning?"Running":"Stopped"})]}),s.capturePid&&e.jsxs(e.Fragment,{children:[s.analyzerPid&&e.jsx("span",{className:"text-gray-400",children:"|"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-xs font-mono bg-gray-200 px-2 py-1 rounded",children:["Capture: ",s.capturePid]}),h[s.capturePid]&&e.jsx("span",{className:`text-xs px-2 py-1 rounded ${h[s.capturePid].isRunning?"bg-green-100 text-green-700":"bg-red-100 text-red-700"}`,children:h[s.capturePid].isRunning?"Running":"Stopped"})]})]})]}),(h[s.analyzerPid]?.isRunning||h[s.capturePid]?.isRunning)&&e.jsxs("div",{className:"flex items-center gap-3",children:[p.isKilling&&e.jsxs("span",{className:"text-xs text-gray-600 font-medium",children:["Killing process ",p.current," of"," ",p.total,"..."]}),e.jsx("button",{onClick:()=>{const a=[s.analyzerPid,s.capturePid].filter(o=>!!o&&h[o]?.isRunning);if(a.length===0)return;const m=a.join(", ");if(!confirm(`Are you sure you want to kill all running processes (${m})?`))return;j({isKilling:!0,current:1,total:a.length}),(async()=>{for(let o=0;o<a.length;o++){const d=a[o];try{await fetch("/api/kill-process",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pid:d,commitSha:l||""})})}catch(b){console.error(`Failed to kill process ${d}:`,b)}o<a.length-1&&j({isKilling:!0,current:o+2,total:a.length})}j({isKilling:!1,current:0,total:0}),w.revalidate()})()},disabled:p.isKilling,className:"px-3 py-1 bg-red-600 text-white rounded-md text-xs font-semibold hover:bg-red-700 transition-colors whitespace-nowrap disabled:opacity-50 disabled:cursor-not-allowed",children:p.isKilling?"Killing...":"Kill All Processes"})]})]})]})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-gray-50 rounded-xl p-12 text-center",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("div",{className:"p-2 bg-gray-200 rounded-lg",children:e.jsx(M,{size:20,className:"text-gray-600"})})}),e.jsx("h3",{className:"text-xl font-semibold text-gray-700 mb-2",children:"No Current Activity"}),e.jsxs("p",{className:"text-gray-500",children:["There are no analyses currently running. Trigger an analysis from the"," ",e.jsx(g,{to:"/git",className:"text-[#005C75] underline hover:text-[#004a5e]",children:"Git"})," ","or"," ",e.jsx(g,{to:"/files",className:"text-[#005C75] underline hover:text-[#004a5e]",children:"Files"})," ","page."]})]}),n&&n.length>0&&e.jsxs("div",{className:"bg-white border border-gray-200 rounded-xl p-6",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Recent Completed Analyses"}),e.jsx("div",{className:"space-y-3",children:n.map(a=>{const m=a.analysisCompletedAt||a.archivedAt||a.createdAt,f=a.entities&&a.entities.length>0;return e.jsxs("div",{className:"bg-green-50 border border-green-200 rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx($,{size:18,className:"text-green-600"}),e.jsx("span",{className:"text-sm font-semibold text-gray-900",children:"Completed"}),e.jsx("span",{className:"text-xs text-gray-400",children:"•"}),e.jsx("span",{className:"text-xs text-gray-500",children:m?X(m):"Unknown"})]}),f&&e.jsxs("div",{className:"ml-7 space-y-1",children:[a.entities.slice(0,3).map(o=>e.jsxs(g,{to:`/entity/${o.sha}`,className:"flex items-center gap-1.5 text-sm hover:underline truncate",title:`${o.name} - ${o.filePath}`,style:{color:"#005C75"},onMouseEnter:d=>d.currentTarget.style.color="#003d52",onMouseLeave:d=>d.currentTarget.style.color="#005C75",children:[e.jsx(C,{size:14,style:{strokeWidth:1.5,flexShrink:0}}),e.jsxs("span",{className:"truncate",children:[o.name,e.jsxs("span",{className:"text-gray-400 ml-1 text-xs",children:["(",o.filePath,")"]})]})]},o.sha)),a.entities.length>3&&e.jsxs("div",{className:"text-xs text-gray-500 italic",children:["+",a.entities.length-3," more entities"]})]})]},a.id)})}),u>3&&e.jsx("div",{className:"mt-4 text-center",children:e.jsx(g,{to:"/activity/historic",className:"text-sm font-medium",style:{color:"#005C75"},onMouseEnter:a=>a.currentTarget.style.color="#003d52",onMouseLeave:a=>a.currentTarget.style.color="#005C75",children:"View All Historic Activity →"})})]})]})}function Z({queueJobs:i,state:s,currentRun:c}){return!i||i.length===0?e.jsxs("div",{className:"bg-gray-50 rounded-xl p-12 text-center",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("div",{className:"p-3 bg-gray-200 rounded-lg",children:e.jsx(V,{size:20,className:"text-gray-600"})})}),e.jsx("h3",{className:"text-xl font-semibold text-gray-700 mb-2",children:"No Queued Jobs"}),e.jsx("p",{className:"text-gray-500",children:"Analysis jobs will appear here when they are queued but not yet started."})]}):e.jsx("div",{children:e.jsx(U,{state:s,currentRun:c})})}function ee({historicalRuns:i,totalHistoricalRuns:s,currentPage:c,totalPages:r,tab:l}){return s===0?e.jsxs("div",{className:"bg-gray-50 rounded-xl p-12 text-center",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("div",{className:"p-3 bg-gray-200 rounded-lg",children:e.jsx(W,{size:20,className:"text-gray-600"})})}),e.jsx("h3",{className:"text-xl font-semibold text-gray-700 mb-2",children:"No Historic Activity"}),e.jsx("p",{className:"text-gray-500",children:"Completed analyses will appear here for historical reference."})]}):e.jsxs("div",{className:"bg-white border border-gray-200 rounded-xl p-6",children:[e.jsx("div",{className:"space-y-3",children:i.map(t=>{const n=!!t.failedAt,u=t.readyToBeCaptured,h=t.capturesCompleted??0,P=u===void 0?!0:u===0||h>=u,p=!n&&!!t.analysisCompletedAt&&P,j=t.createdAt?new Date(t.createdAt):null,w=t.failedAt?new Date(t.failedAt):t.analysisCompletedAt?new Date(t.analysisCompletedAt):null,k=j&&w?(w.getTime()-j.getTime())/1e3:null,y=t.entities&&t.entities.length>0;return e.jsx("div",{className:`border rounded-lg p-4 ${n?"bg-red-50 border-red-200":p?"bg-green-50 border-green-200":"bg-gray-50 border-gray-200"}`,children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n?e.jsx(B,{size:20,className:"text-red-500"}):p?e.jsx($,{size:20,className:"text-green-500"}):e.jsx(M,{size:20,className:"text-gray-400"}),e.jsx("span",{className:"text-sm font-semibold text-gray-900",children:n?"Failed":p?"Completed":"Incomplete"}),e.jsx("span",{className:"text-xs text-gray-400",children:"•"}),e.jsx("span",{className:"text-xs text-gray-500",children:t.archivedAt?new Date(t.archivedAt).toLocaleString():t.createdAt?new Date(t.createdAt).toLocaleString():"Unknown"})]}),y&&e.jsxs("div",{className:"ml-7 mt-2 space-y-2 max-h-[300px] overflow-y-auto bg-white rounded-md p-2 border border-gray-200",children:[t.entities.slice(0,5).map(x=>{const N=x.analyses?.[0],v=N?.scenarios||[];return e.jsxs("div",{className:"pb-2 border-b last:border-b-0 border-gray-100",children:[e.jsxs(g,{to:`/entity/${x.sha}`,className:"flex items-center gap-1.5 text-xs hover:underline font-medium truncate mb-1",title:`${x.name} - ${x.filePath}`,style:{color:"#005C75"},onMouseEnter:a=>a.currentTarget.style.color="#003d52",onMouseLeave:a=>a.currentTarget.style.color="#005C75",children:[e.jsx(C,{size:12,style:{strokeWidth:1.5,flexShrink:0}}),e.jsxs("span",{className:"truncate",children:[x.name,e.jsxs("span",{className:"text-gray-400 ml-1",children:["(",x.filePath,")"]})]})]}),v.length>0&&e.jsx("div",{className:"flex gap-1.5 flex-wrap mt-1.5",children:v.slice(0,5).map((a,m)=>a.id?e.jsx(z,{scenario:a,entity:{sha:x.sha,entityType:x.entityType},analysisStatus:N?.status,queueState:void 0,processIsRunning:!1,size:"small"},m):null)})]},x.sha)}),t.entities.length>5&&e.jsxs("div",{className:"text-xs text-gray-500 italic pt-1",children:["+",t.entities.length-5," more entities"]})]}),t.failureReason&&e.jsx("p",{className:"text-xs text-red-600 mt-2 font-mono ml-7",children:t.failureReason})]}),k!==null&&e.jsxs("div",{className:"text-xs text-gray-500",children:[k.toFixed(1),"s"]})]})},t.id)})}),r>1&&e.jsxs("div",{className:"mt-6 flex items-center justify-between border-t border-gray-200 pt-4",children:[e.jsxs("div",{className:"text-sm text-gray-600",children:["Showing ",(c-1)*20+1," -"," ",Math.min(c*20,s)," of"," ",s," runs"]}),e.jsxs("div",{className:"flex gap-2",children:[c>1&&e.jsx(g,{to:`/activity/${l}?page=${c-1}`,className:"px-3 py-1 bg-gray-100 text-gray-700 rounded-md text-sm font-medium hover:bg-gray-200 transition-colors",children:"Previous"}),c<r&&e.jsx(g,{to:`/activity/${l}?page=${c+1}`,className:"px-3 py-1 bg-gray-100 text-gray-700 rounded-md text-sm font-medium hover:bg-gray-200 transition-colors",children:"Next"})]})]})]})}const me=L(function(){const s=q(),c=D(),[r,l]=A.useState(!1),t=c.tab||"current";return e.jsxs("div",{className:"px-36 py-12",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-3xl font-bold text-gray-900 mb-2",children:"Activity"}),e.jsx("p",{className:"text-gray-600",children:"View queued, current, and historical analysis activity"})]}),e.jsx(G,{activeTab:t,hasCurrentActivity:s.hasCurrentActivity,queuedCount:s.queuedCount,historicCount:s.totalHistoricalRuns}),t==="current"&&e.jsx(Y,{currentlyExecuting:s.currentlyExecuting,currentRun:s.currentRun,state:s.state,projectSlug:s.projectSlug,commitSha:s.commitSha,onShowLogs:()=>l(!0),recentCompletedRuns:s.recentCompletedRuns,totalCompletedRuns:s.totalCompletedRuns}),t==="queued"&&e.jsx(Z,{queueJobs:s.queueJobs,state:s.state,currentRun:s.currentRun}),t==="historic"&&e.jsx(ee,{historicalRuns:s.historicalRuns,totalHistoricalRuns:s.totalHistoricalRuns,currentPage:s.currentPage,totalPages:s.totalPages,tab:t}),r&&s.projectSlug&&e.jsx(_,{projectSlug:s.projectSlug,onClose:()=>l(!1)})]})});export{me as default};
@@ -0,0 +1 @@
1
+ import{c as t}from"./createLucideIcon-CS7XDrKv.js";const a=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],o=t("chart-column",a);export{o as C};
@@ -23,4 +23,4 @@ import(${JSON.stringify(t.entry.module)});`:" ";return f.createElement(f.Fragmen
23
23
  console.log(
24
24
  "💿 Hey developer 👋. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."
25
25
  );
26
- `}});if(We(e))return f.createElement(fr,{title:"Unhandled Thrown Response!"},f.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),r);let n;if(e instanceof Error)n=e;else{let a=e==null?"Unknown Error":typeof e=="object"&&"toString"in e?e.toString():JSON.stringify(e);n=new Error(a)}return f.createElement(fr,{title:"Application Error!",isOutsideRemixApp:t},f.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),f.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},n.stack),r)}function fr({title:e,renderScripts:t,isOutsideRemixApp:r,children:n}){let{routeModules:a}=et();return a.root?.Layout&&!r?n:f.createElement("html",{lang:"en"},f.createElement("head",null,f.createElement("meta",{charSet:"utf-8"}),f.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),f.createElement("title",null,e)),f.createElement("body",null,f.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},n,t?f.createElement(jl,null):null)))}var da=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{da&&(window.__reactRouterVersion="7.10.1")}catch{}var fa=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ha=f.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:a,reloadDocument:o,replace:i,state:s,target:l,to:u,preventScrollReset:h,viewTransition:c,...m},g){let{basename:E,unstable_useTransitions:L}=f.useContext(be),R=typeof u=="string"&&fa.test(u),S,b=!1;if(typeof u=="string"&&R&&(S=u,da))try{let Y=new URL(window.location.href),U=u.startsWith("//")?new URL(Y.protocol+u):new URL(u),de=Re(U.pathname,E);U.origin===Y.origin&&de!=null?u=de+U.search+U.hash:b=!0}catch{se(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let D=ti(u,{relative:a}),[T,M,O]=kl(n,m),p=Wl(u,{replace:i,state:s,target:l,preventScrollReset:h,relative:a,viewTransition:c,unstable_useTransitions:L});function H(Y){t&&t(Y),Y.defaultPrevented||p(Y)}let B=f.createElement("a",{...m,...O,href:S||D,onClick:b||o?t:H,ref:zl(g,M),target:l,"data-discover":!R&&r==="render"?"true":void 0});return T&&!R?f.createElement(f.Fragment,null,B,f.createElement(ua,{page:D})):B});ha.displayName="Link";var Hl=f.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:a=!1,style:o,to:i,viewTransition:s,children:l,...u},h){let c=pt(i,{relative:u.relative}),m=Le(),g=f.useContext(Qe),{navigator:E,basename:L}=f.useContext(be),R=g!=null&&Xl(c)&&s===!0,S=E.encodeLocation?E.encodeLocation(c).pathname:c.pathname,b=m.pathname,D=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;r||(b=b.toLowerCase(),D=D?D.toLowerCase():null,S=S.toLowerCase()),D&&L&&(D=Re(D,L)||D);const T=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let M=b===S||!a&&b.startsWith(S)&&b.charAt(T)==="/",O=D!=null&&(D===S||!a&&D.startsWith(S)&&D.charAt(S.length)==="/"),p={isActive:M,isPending:O,isTransitioning:R},H=M?t:void 0,B;typeof n=="function"?B=n(p):B=[n,M?"active":null,O?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let Y=typeof o=="function"?o(p):o;return f.createElement(ha,{...u,"aria-current":H,className:B,ref:h,style:Y,to:i,viewTransition:s},typeof l=="function"?l(p):l)});Hl.displayName="NavLink";var ma=f.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:a,state:o,method:i=Tt,action:s,onSubmit:l,relative:u,preventScrollReset:h,viewTransition:c,...m},g)=>{let{unstable_useTransitions:E}=f.useContext(be),L=va(),R=Jl(s,{relative:u}),S=i.toLowerCase()==="get"?"get":"post",b=typeof s=="string"&&fa.test(s),D=T=>{if(l&&l(T),T.defaultPrevented)return;T.preventDefault();let M=T.nativeEvent.submitter,O=M?.getAttribute("formmethod")||i,p=()=>L(M||T.currentTarget,{fetcherKey:t,method:O,navigate:r,replace:a,state:o,relative:u,preventScrollReset:h,viewTransition:c});E&&r!==!1?f.startTransition(()=>p()):p()};return f.createElement("form",{ref:g,method:S,action:R,onSubmit:n?l:D,...m,"data-discover":!b&&e==="render"?"true":void 0})});ma.displayName="Form";function Bl({getKey:e,storageKey:t,...r}){let n=f.useContext(zt),{basename:a}=f.useContext(be),o=Le(),i=xr();Kl({getKey:e,storageKey:t});let s=f.useMemo(()=>{if(!n||!e)return null;let u=mr(o,i,a,e);return u!==o.key?u:null},[]);if(!n||n.isSpaMode)return null;let l=((u,h)=>{if(!window.history.state||!window.history.state.key){let c=Math.random().toString(32).slice(2);window.history.replaceState({key:c},"")}try{let m=JSON.parse(sessionStorage.getItem(u)||"{}")[h||window.history.state.key];typeof m=="number"&&window.scrollTo(0,m)}catch(c){console.error(c),sessionStorage.removeItem(u)}}).toString();return f.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${JSON.stringify(t||hr)}, ${JSON.stringify(s)})`}})}Bl.displayName="ScrollRestoration";function pa(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ht(e){let t=f.useContext(Ye);return z(t,pa(e)),t}function ya(e){let t=f.useContext(Qe);return z(t,pa(e)),t}function Wl(e,{target:t,replace:r,state:n,preventScrollReset:a,relative:o,viewTransition:i,unstable_useTransitions:s}={}){let l=Yn(),u=Le(),h=pt(e,{relative:o});return f.useCallback(c=>{if(Ti(c,t)){c.preventDefault();let m=r!==void 0?r:Me(u)===Me(h),g=()=>l(e,{replace:m,state:n,preventScrollReset:a,relative:o,viewTransition:i});s?f.startTransition(()=>g()):g()}},[u,l,h,r,n,t,e,a,o,i,s])}function ps(e){se(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=f.useRef(ur(e)),r=f.useRef(!1),n=Le(),a=f.useMemo(()=>Oi(n.search,r.current?null:t.current),[n.search]),o=Yn(),i=f.useCallback((s,l)=>{const u=ur(typeof s=="function"?s(new URLSearchParams(a)):s);r.current=!0,o("?"+u,l)},[o,a]);return[a,i]}var Vl=0,Yl=()=>`__${String(++Vl)}__`;function va(){let{router:e}=Ht("useSubmit"),{basename:t}=f.useContext(be),r=hi(),n=e.fetch,a=e.navigate;return f.useCallback(async(o,i={})=>{let{action:s,method:l,encType:u,formData:h,body:c}=ki(o,t);if(i.navigate===!1){let m=i.fetcherKey||Yl();await n(m,r,i.action||s,{preventScrollReset:i.preventScrollReset,formData:h,body:c,formMethod:i.method||l,formEncType:i.encType||u,flushSync:i.flushSync})}else await a(i.action||s,{preventScrollReset:i.preventScrollReset,formData:h,body:c,formMethod:i.method||l,formEncType:i.encType||u,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[n,a,t,r])}function Jl(e,{relative:t}={}){let{basename:r}=f.useContext(be),n=f.useContext(xe);z(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),o={...pt(e||".",{relative:t})},i=Le();if(e==null){o.search=i.search;let s=new URLSearchParams(o.search),l=s.getAll("index");if(l.some(h=>h==="")){s.delete("index"),l.filter(c=>c).forEach(c=>s.append("index",c));let h=s.toString();o.search=h?`?${h}`:""}}return(!e||e===".")&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:Ce([r,o.pathname])),Me(o)}function ys({key:e}={}){let{router:t}=Ht("useFetcher"),r=ya("useFetcher"),n=f.useContext(Rr),a=f.useContext(xe),o=a.matches[a.matches.length-1]?.route.id;z(n,"useFetcher must be used inside a FetchersContext"),z(a,"useFetcher must be used inside a RouteContext"),z(o!=null,'useFetcher can only be used on routes that contain a unique "id"');let i=f.useId(),[s,l]=f.useState(e||i);e&&e!==s&&l(e);let{deleteFetcher:u,getFetcher:h,resetFetcher:c,fetch:m}=t;f.useEffect(()=>(h(s),()=>u(s)),[u,h,s]);let g=f.useCallback(async(M,O)=>{z(o,"No routeId available for fetcher.load()"),await m(s,o,M,O)},[s,o,m]),E=va(),L=f.useCallback(async(M,O)=>{await E(M,{...O,navigate:!1,fetcherKey:s})},[s,E]),R=f.useCallback(M=>c(s,M),[c,s]),S=f.useMemo(()=>{let M=f.forwardRef((O,p)=>f.createElement(ma,{...O,navigate:!1,fetcherKey:s,ref:p}));return M.displayName="fetcher.Form",M},[s]),b=r.fetchers.get(s)||In,D=n.get(s);return f.useMemo(()=>({Form:S,submit:L,load:g,reset:R,...b,data:D}),[S,L,g,R,b,D])}var hr="react-router-scroll-positions",Mt={};function mr(e,t,r,n){let a=null;return n&&(r!=="/"?a=n({...e,pathname:Re(e.pathname,r)||e.pathname},t):a=n(e,t)),a==null&&(a=e.key),a}function Kl({getKey:e,storageKey:t}={}){let{router:r}=Ht("useScrollRestoration"),{restoreScrollPosition:n,preventScrollReset:a}=ya("useScrollRestoration"),{basename:o}=f.useContext(be),i=Le(),s=xr(),l=mi();f.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),Gl(f.useCallback(()=>{if(l.state==="idle"){let u=mr(i,s,o,e);Mt[u]=window.scrollY}try{sessionStorage.setItem(t||hr,JSON.stringify(Mt))}catch(u){se(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[l.state,e,o,i,s,t])),typeof document<"u"&&(f.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||hr);u&&(Mt=JSON.parse(u))}catch{}},[t]),f.useLayoutEffect(()=>{let u=r?.enableScrollRestoration(Mt,()=>window.scrollY,e?(h,c)=>mr(h,c,o,e):void 0);return()=>u&&u()},[r,o,e]),f.useLayoutEffect(()=>{if(n!==!1){if(typeof n=="number"){window.scrollTo(0,n);return}try{if(i.hash){let u=document.getElementById(decodeURIComponent(i.hash.slice(1)));if(u){u.scrollIntoView();return}}}catch{se(!1,`"${i.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}a!==!0&&window.scrollTo(0,0)}},[i,n,a]))}function Gl(e,t){let{capture:r}={};f.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,n),()=>{window.removeEventListener("pagehide",e,n)}},[e,r])}function Xl(e,{relative:t}={}){let r=f.useContext(Er);z(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=Ht("useViewTransitionState"),a=pt(e,{relative:t});if(!r.isTransitioning)return!1;let o=Re(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=Re(r.nextLocation.pathname,n)||r.nextLocation.pathname;return Ft(a.pathname,i)!=null||Ft(a.pathname,o)!=null}export{as as A,Le as B,fs as C,jl as D,Ve as E,zt as F,Ql as G,ja as H,Na as I,ql as J,ha as L,hs as M,il as N,is as O,Ua as R,Bl as S,Yn as a,ys as b,yi as c,rs as d,ps as e,oi as f,Ln as g,z as h,We as i,Zl as j,ds as k,ms as l,Fe as m,os as n,pl as o,Cr as p,ts as q,f as r,Cl as s,cs as t,pi as u,ss as v,ls as w,es as x,us as y,ns as z};
26
+ `}});if(We(e))return f.createElement(fr,{title:"Unhandled Thrown Response!"},f.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),r);let n;if(e instanceof Error)n=e;else{let a=e==null?"Unknown Error":typeof e=="object"&&"toString"in e?e.toString():JSON.stringify(e);n=new Error(a)}return f.createElement(fr,{title:"Application Error!",isOutsideRemixApp:t},f.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),f.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},n.stack),r)}function fr({title:e,renderScripts:t,isOutsideRemixApp:r,children:n}){let{routeModules:a}=et();return a.root?.Layout&&!r?n:f.createElement("html",{lang:"en"},f.createElement("head",null,f.createElement("meta",{charSet:"utf-8"}),f.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),f.createElement("title",null,e)),f.createElement("body",null,f.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},n,t?f.createElement(jl,null):null)))}var da=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{da&&(window.__reactRouterVersion="7.10.1")}catch{}var fa=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ha=f.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:a,reloadDocument:o,replace:i,state:s,target:l,to:u,preventScrollReset:h,viewTransition:c,...m},g){let{basename:E,unstable_useTransitions:L}=f.useContext(be),R=typeof u=="string"&&fa.test(u),S,b=!1;if(typeof u=="string"&&R&&(S=u,da))try{let Y=new URL(window.location.href),U=u.startsWith("//")?new URL(Y.protocol+u):new URL(u),de=Re(U.pathname,E);U.origin===Y.origin&&de!=null?u=de+U.search+U.hash:b=!0}catch{se(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let D=ti(u,{relative:a}),[T,M,O]=kl(n,m),p=Wl(u,{replace:i,state:s,target:l,preventScrollReset:h,relative:a,viewTransition:c,unstable_useTransitions:L});function H(Y){t&&t(Y),Y.defaultPrevented||p(Y)}let B=f.createElement("a",{...m,...O,href:S||D,onClick:b||o?t:H,ref:zl(g,M),target:l,"data-discover":!R&&r==="render"?"true":void 0});return T&&!R?f.createElement(f.Fragment,null,B,f.createElement(ua,{page:D})):B});ha.displayName="Link";var Hl=f.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:a=!1,style:o,to:i,viewTransition:s,children:l,...u},h){let c=pt(i,{relative:u.relative}),m=Le(),g=f.useContext(Qe),{navigator:E,basename:L}=f.useContext(be),R=g!=null&&Xl(c)&&s===!0,S=E.encodeLocation?E.encodeLocation(c).pathname:c.pathname,b=m.pathname,D=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;r||(b=b.toLowerCase(),D=D?D.toLowerCase():null,S=S.toLowerCase()),D&&L&&(D=Re(D,L)||D);const T=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let M=b===S||!a&&b.startsWith(S)&&b.charAt(T)==="/",O=D!=null&&(D===S||!a&&D.startsWith(S)&&D.charAt(S.length)==="/"),p={isActive:M,isPending:O,isTransitioning:R},H=M?t:void 0,B;typeof n=="function"?B=n(p):B=[n,M?"active":null,O?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let Y=typeof o=="function"?o(p):o;return f.createElement(ha,{...u,"aria-current":H,className:B,ref:h,style:Y,to:i,viewTransition:s},typeof l=="function"?l(p):l)});Hl.displayName="NavLink";var ma=f.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:a,state:o,method:i=Tt,action:s,onSubmit:l,relative:u,preventScrollReset:h,viewTransition:c,...m},g)=>{let{unstable_useTransitions:E}=f.useContext(be),L=va(),R=Jl(s,{relative:u}),S=i.toLowerCase()==="get"?"get":"post",b=typeof s=="string"&&fa.test(s),D=T=>{if(l&&l(T),T.defaultPrevented)return;T.preventDefault();let M=T.nativeEvent.submitter,O=M?.getAttribute("formmethod")||i,p=()=>L(M||T.currentTarget,{fetcherKey:t,method:O,navigate:r,replace:a,state:o,relative:u,preventScrollReset:h,viewTransition:c});E&&r!==!1?f.startTransition(()=>p()):p()};return f.createElement("form",{ref:g,method:S,action:R,onSubmit:n?l:D,...m,"data-discover":!b&&e==="render"?"true":void 0})});ma.displayName="Form";function Bl({getKey:e,storageKey:t,...r}){let n=f.useContext(zt),{basename:a}=f.useContext(be),o=Le(),i=xr();Kl({getKey:e,storageKey:t});let s=f.useMemo(()=>{if(!n||!e)return null;let u=mr(o,i,a,e);return u!==o.key?u:null},[]);if(!n||n.isSpaMode)return null;let l=((u,h)=>{if(!window.history.state||!window.history.state.key){let c=Math.random().toString(32).slice(2);window.history.replaceState({key:c},"")}try{let m=JSON.parse(sessionStorage.getItem(u)||"{}")[h||window.history.state.key];typeof m=="number"&&window.scrollTo(0,m)}catch(c){console.error(c),sessionStorage.removeItem(u)}}).toString();return f.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${JSON.stringify(t||hr)}, ${JSON.stringify(s)})`}})}Bl.displayName="ScrollRestoration";function pa(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ht(e){let t=f.useContext(Ye);return z(t,pa(e)),t}function ya(e){let t=f.useContext(Qe);return z(t,pa(e)),t}function Wl(e,{target:t,replace:r,state:n,preventScrollReset:a,relative:o,viewTransition:i,unstable_useTransitions:s}={}){let l=Yn(),u=Le(),h=pt(e,{relative:o});return f.useCallback(c=>{if(Ti(c,t)){c.preventDefault();let m=r!==void 0?r:Me(u)===Me(h),g=()=>l(e,{replace:m,state:n,preventScrollReset:a,relative:o,viewTransition:i});s?f.startTransition(()=>g()):g()}},[u,l,h,r,n,t,e,a,o,i,s])}function ps(e){se(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=f.useRef(ur(e)),r=f.useRef(!1),n=Le(),a=f.useMemo(()=>Oi(n.search,r.current?null:t.current),[n.search]),o=Yn(),i=f.useCallback((s,l)=>{const u=ur(typeof s=="function"?s(new URLSearchParams(a)):s);r.current=!0,o("?"+u,l)},[o,a]);return[a,i]}var Vl=0,Yl=()=>`__${String(++Vl)}__`;function va(){let{router:e}=Ht("useSubmit"),{basename:t}=f.useContext(be),r=hi(),n=e.fetch,a=e.navigate;return f.useCallback(async(o,i={})=>{let{action:s,method:l,encType:u,formData:h,body:c}=ki(o,t);if(i.navigate===!1){let m=i.fetcherKey||Yl();await n(m,r,i.action||s,{preventScrollReset:i.preventScrollReset,formData:h,body:c,formMethod:i.method||l,formEncType:i.encType||u,flushSync:i.flushSync})}else await a(i.action||s,{preventScrollReset:i.preventScrollReset,formData:h,body:c,formMethod:i.method||l,formEncType:i.encType||u,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[n,a,t,r])}function Jl(e,{relative:t}={}){let{basename:r}=f.useContext(be),n=f.useContext(xe);z(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),o={...pt(e||".",{relative:t})},i=Le();if(e==null){o.search=i.search;let s=new URLSearchParams(o.search),l=s.getAll("index");if(l.some(h=>h==="")){s.delete("index"),l.filter(c=>c).forEach(c=>s.append("index",c));let h=s.toString();o.search=h?`?${h}`:""}}return(!e||e===".")&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:Ce([r,o.pathname])),Me(o)}function ys({key:e}={}){let{router:t}=Ht("useFetcher"),r=ya("useFetcher"),n=f.useContext(Rr),a=f.useContext(xe),o=a.matches[a.matches.length-1]?.route.id;z(n,"useFetcher must be used inside a FetchersContext"),z(a,"useFetcher must be used inside a RouteContext"),z(o!=null,'useFetcher can only be used on routes that contain a unique "id"');let i=f.useId(),[s,l]=f.useState(e||i);e&&e!==s&&l(e);let{deleteFetcher:u,getFetcher:h,resetFetcher:c,fetch:m}=t;f.useEffect(()=>(h(s),()=>u(s)),[u,h,s]);let g=f.useCallback(async(M,O)=>{z(o,"No routeId available for fetcher.load()"),await m(s,o,M,O)},[s,o,m]),E=va(),L=f.useCallback(async(M,O)=>{await E(M,{...O,navigate:!1,fetcherKey:s})},[s,E]),R=f.useCallback(M=>c(s,M),[c,s]),S=f.useMemo(()=>{let M=f.forwardRef((O,p)=>f.createElement(ma,{...O,navigate:!1,fetcherKey:s,ref:p}));return M.displayName="fetcher.Form",M},[s]),b=r.fetchers.get(s)||In,D=n.get(s);return f.useMemo(()=>({Form:S,submit:L,load:g,reset:R,...b,data:D}),[S,L,g,R,b,D])}var hr="react-router-scroll-positions",Mt={};function mr(e,t,r,n){let a=null;return n&&(r!=="/"?a=n({...e,pathname:Re(e.pathname,r)||e.pathname},t):a=n(e,t)),a==null&&(a=e.key),a}function Kl({getKey:e,storageKey:t}={}){let{router:r}=Ht("useScrollRestoration"),{restoreScrollPosition:n,preventScrollReset:a}=ya("useScrollRestoration"),{basename:o}=f.useContext(be),i=Le(),s=xr(),l=mi();f.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),Gl(f.useCallback(()=>{if(l.state==="idle"){let u=mr(i,s,o,e);Mt[u]=window.scrollY}try{sessionStorage.setItem(t||hr,JSON.stringify(Mt))}catch(u){se(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[l.state,e,o,i,s,t])),typeof document<"u"&&(f.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||hr);u&&(Mt=JSON.parse(u))}catch{}},[t]),f.useLayoutEffect(()=>{let u=r?.enableScrollRestoration(Mt,()=>window.scrollY,e?(h,c)=>mr(h,c,o,e):void 0);return()=>u&&u()},[r,o,e]),f.useLayoutEffect(()=>{if(n!==!1){if(typeof n=="number"){window.scrollTo(0,n);return}try{if(i.hash){let u=document.getElementById(decodeURIComponent(i.hash.slice(1)));if(u){u.scrollIntoView();return}}}catch{se(!1,`"${i.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}a!==!0&&window.scrollTo(0,0)}},[i,n,a]))}function Gl(e,t){let{capture:r}={};f.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,n),()=>{window.removeEventListener("pagehide",e,n)}},[e,r])}function Xl(e,{relative:t}={}){let r=f.useContext(Er);z(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=Ht("useViewTransitionState"),a=pt(e,{relative:t});if(!r.isTransitioning)return!1;let o=Re(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=Re(r.nextLocation.pathname,n)||r.nextLocation.pathname;return Ft(a.pathname,i)!=null||Ft(a.pathname,o)!=null}export{Ln as A,Le as B,fs as C,jl as D,Ve as E,zt as F,Ql as G,ja as H,Na as I,ql as J,ha as L,hs as M,il as N,is as O,Ua as R,Bl as S,Yn as a,ys as b,yi as c,rs as d,ps as e,oi as f,z as g,ds as h,We as i,Zl as j,ms as k,os as l,Fe as m,pl as n,Cr as o,ts as p,cs as q,f as r,Cl as s,ss as t,pi as u,es as v,ls as w,us as x,ns as y,as as z};
@@ -0,0 +1 @@
1
+ import{c as e}from"./createLucideIcon-CS7XDrKv.js";const c=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],y=e("circle-alert",c);export{y as C};
@@ -0,0 +1 @@
1
+ import{c}from"./createLucideIcon-CS7XDrKv.js";const e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],r=c("circle-check",e);export{r as C};
@@ -0,0 +1 @@
1
+ import{c}from"./createLucideIcon-CS7XDrKv.js";const o=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],r=c("clock",o);export{r as C};
@@ -0,0 +1 @@
1
+ import{r as s}from"./chunk-WWGJGFF6-De6i8FUT.js";const C=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),w=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,o)=>o?o.toUpperCase():r.toLowerCase()),i=t=>{const e=w(t);return e.charAt(0).toUpperCase()+e.slice(1)},l=(...t)=>t.filter((e,r,o)=>!!e&&e.trim()!==""&&o.indexOf(e)===r).join(" ").trim(),f=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var h={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const g=s.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:n="",children:a,iconNode:u,...c},p)=>s.createElement("svg",{ref:p,...h,width:e,height:e,stroke:t,strokeWidth:o?Number(r)*24/Number(e):r,className:l("lucide",n),...!a&&!f(c)&&{"aria-hidden":"true"},...c},[...u.map(([m,d])=>s.createElement(m,d)),...Array.isArray(a)?a:[a]]));const b=(t,e)=>{const r=s.forwardRef(({className:o,...n},a)=>s.createElement(g,{ref:a,iconNode:e,className:l(`lucide-${C(i(t))}`,`lucide-${t}`,o),...n}));return r.displayName=i(t),r};export{b as c};
@@ -0,0 +1 @@
1
+ import{w as t,b as r,j as e}from"./chunk-WWGJGFF6-De6i8FUT.js";import{S as i}from"./ScenarioViewer-4D2vLLJz.js";import{W as n}from"./InteractivePreview-XDSzQLOY.js";import"./LogViewer-CRcT5fOZ.js";import"./SafeScreenshot-Bual6h18.js";import"./useLastLogLine-AlhS7g5F.js";import"./ReportIssueModal-BORLgi0X.js";import"./settings-5zF_GOcS.js";import"./createLucideIcon-CS7XDrKv.js";import"./circle-check-BACUUf75.js";import"./triangle-alert-D7k-ArFa.js";import"./index-D-zYbzFZ.js";const v=()=>[{title:"Empty State - CodeYam"},{name:"description",content:"Simulations empty state development view"}],g=t(function(){r();const s={sha:"mock-sha",name:"Dashboard",filePath:"codeyam-cli/src/webserver/app/routes/_index.tsx",entityType:"visual"};return e.jsx(n,{children:e.jsxs("div",{className:"h-screen bg-[#f9f9f9] flex flex-col overflow-hidden",children:[e.jsx("header",{className:"bg-white border-b border-gray-200 shrink-0 relative h-[54px]",children:e.jsxs("div",{className:"flex items-center h-full px-6 gap-6",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M13 8.5H4M4 8.5L8.5 4M4 8.5L8.5 13",stroke:"#005c75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("h1",{className:"text-lg font-semibold text-black m-0 leading-[26px] shrink-0",children:"Dashboard"}),e.jsx("span",{className:"text-xs text-[#626262] font-mono whitespace-nowrap overflow-hidden text-ellipsis min-w-0",children:"codeyam-cli/src/webserver/app/routes/_index.tsx"})]}),e.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2 px-[15px] py-0 h-[26px] bg-[#efefef] border border-[#e1e1e1] rounded",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-[#626262]"}),e.jsx("span",{className:"text-xs font-semibold text-[#626262]",children:"Not analyzed"})]}),e.jsx("button",{className:"px-[15px] py-0 h-[26px] bg-[#005c75] text-white rounded text-xs font-semibold border-none cursor-pointer hover:bg-[#004a5e] transition-colors",children:"Analyze"})]}),e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-[#626262] ml-auto",children:[e.jsx("span",{className:"leading-[22px]",children:"Next Entity"}),e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M4 8.5H13M13 8.5L8.5 4M13 8.5L8.5 13",stroke:"#005c75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})}),e.jsx("div",{className:"bg-[#efefef] border-b border-[#efefef] shrink-0",children:e.jsxs("div",{className:"flex items-center gap-3 h-11 px-[15px]",children:[e.jsxs("div",{className:"px-4 flex items-center justify-center gap-3 shrink-0 text-sm rounded bg-[#343434] text-[#efefef] font-semibold h-8",children:["Scenarios",e.jsx("span",{className:"px-2 py-0.5 rounded-[9px] text-xs font-semibold bg-[#cbf3fa] text-[#005c75] min-w-[25px] text-center",children:"0"})]}),e.jsxs("div",{className:"px-4 flex items-center justify-center gap-3 shrink-0 text-sm rounded-[9px] text-[#3e3e3e] font-normal",children:["Related Entities",e.jsx("span",{className:"px-2 py-0.5 rounded-[9px] text-xs font-semibold bg-[#e1e1e1] text-[#3e3e3e] min-w-[25px] text-center",children:"5"})]}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"Code"}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"Data Structure"}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"History"})]})}),e.jsxs("div",{className:"flex flex-1 gap-0 min-h-0",children:[e.jsx("div",{className:"w-[165px] bg-[#e1e1e1] border-r border-[#c7c7c7] flex items-center justify-center shrink-0",children:e.jsx("span",{className:"text-xs font-medium text-[#8e8e8e] leading-5",children:"No Scenarios"})}),e.jsx(i,{selectedScenario:null,analysis:void 0,entity:s,viewMode:"screenshot",cacheBuster:Date.now(),hasScenarios:!1,isAnalyzing:!1,projectSlug:null,hasAnApiKey:!0})]})]})})});export{g as default,v as meta};