@codeyam/codeyam-cli 0.1.0-staging.b8a55ba → 0.1.0-staging.d0ad4ae

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 (340) hide show
  1. package/analyzer-template/.build-info.json +7 -7
  2. package/analyzer-template/common/execAsync.ts +1 -1
  3. package/analyzer-template/log.txt +3 -3
  4. package/analyzer-template/package.json +7 -4
  5. package/analyzer-template/packages/ai/package.json +1 -1
  6. package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +14 -1
  7. package/analyzer-template/packages/ai/src/lib/checkAllAttributes.ts +29 -10
  8. package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +120 -19
  9. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.ts +2 -1
  10. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.ts +91 -35
  11. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.ts +110 -74
  12. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.ts +11 -0
  13. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertNullToUndefinedBySchema.ts +98 -0
  14. package/analyzer-template/packages/ai/src/lib/deepEqual.ts +30 -0
  15. package/analyzer-template/packages/ai/src/lib/findMatchingAttribute.ts +24 -17
  16. package/analyzer-template/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.ts +214 -39
  17. package/analyzer-template/packages/ai/src/lib/generateChangesEntityKeyAttributes.ts +54 -1
  18. package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarioData.ts +72 -6
  19. package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarios.ts +12 -5
  20. package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +39 -23
  21. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.ts +32 -0
  22. package/analyzer-template/packages/analyze/src/lib/FileAnalyzer.ts +14 -0
  23. package/analyzer-template/packages/analyze/src/lib/asts/nodes/index.ts +1 -0
  24. package/analyzer-template/packages/analyze/src/lib/asts/nodes/isAsyncFunction.ts +67 -0
  25. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +73 -69
  26. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +6 -0
  27. package/analyzer-template/packages/analyze/src/lib/files/analyze/findOrCreateEntity.ts +3 -0
  28. package/analyzer-template/packages/analyze/src/lib/files/analyzeChange.ts +22 -6
  29. package/analyzer-template/packages/analyze/src/lib/files/analyzeEntity.ts +9 -5
  30. package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.ts +49 -11
  31. package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichUnknownTypesFromSourceEquivalencies.ts +102 -0
  32. package/analyzer-template/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.ts +399 -52
  33. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.ts +128 -2
  34. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +114 -70
  35. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarioData.ts +34 -129
  36. package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +155 -79
  37. package/analyzer-template/packages/aws/codebuild/index.ts +1 -0
  38. package/analyzer-template/packages/aws/dist/src/lib/codebuild/waitForBuild.d.ts +11 -1
  39. package/analyzer-template/packages/aws/dist/src/lib/codebuild/waitForBuild.d.ts.map +1 -1
  40. package/analyzer-template/packages/aws/dist/src/lib/codebuild/waitForBuild.js +29 -18
  41. package/analyzer-template/packages/aws/dist/src/lib/codebuild/waitForBuild.js.map +1 -1
  42. package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsDefineContainer.d.ts +2 -2
  43. package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsDefineContainer.d.ts.map +1 -1
  44. package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsDefineContainer.js +2 -2
  45. package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsDefineContainer.js.map +1 -1
  46. package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsTaskFactory.d.ts +8 -18
  47. package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsTaskFactory.d.ts.map +1 -1
  48. package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsTaskFactory.js +17 -61
  49. package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsTaskFactory.js.map +1 -1
  50. package/analyzer-template/packages/aws/dist/src/lib/s3/uploadFileToS3.d.ts.map +1 -1
  51. package/analyzer-template/packages/aws/dist/src/lib/s3/uploadFileToS3.js +8 -1
  52. package/analyzer-template/packages/aws/dist/src/lib/s3/uploadFileToS3.js.map +1 -1
  53. package/analyzer-template/packages/aws/package.json +1 -1
  54. package/analyzer-template/packages/aws/src/lib/codebuild/waitForBuild.ts +43 -19
  55. package/analyzer-template/packages/aws/src/lib/ecs/ecsDefineContainer.ts +3 -3
  56. package/analyzer-template/packages/aws/src/lib/ecs/ecsTaskFactory.ts +17 -69
  57. package/analyzer-template/packages/aws/src/lib/s3/uploadFileToS3.ts +8 -1
  58. package/analyzer-template/packages/generate/index.ts +3 -0
  59. package/analyzer-template/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.ts +17 -1
  60. package/analyzer-template/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.ts +193 -0
  61. package/analyzer-template/packages/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.ts +73 -0
  62. package/analyzer-template/packages/generate/src/lib/scenarioComponentForServer.ts +114 -0
  63. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/entitiesTable.d.ts +1 -0
  64. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/entitiesTable.d.ts.map +1 -1
  65. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts +1 -0
  66. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts.map +1 -1
  67. package/analyzer-template/packages/github/dist/generate/index.d.ts +3 -0
  68. package/analyzer-template/packages/github/dist/generate/index.d.ts.map +1 -1
  69. package/analyzer-template/packages/github/dist/generate/index.js +3 -0
  70. package/analyzer-template/packages/github/dist/generate/index.js.map +1 -1
  71. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.d.ts.map +1 -1
  72. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js +16 -1
  73. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js.map +1 -1
  74. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.d.ts +9 -0
  75. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.d.ts.map +1 -0
  76. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +189 -0
  77. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -0
  78. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.d.ts +20 -0
  79. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.d.ts.map +1 -0
  80. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.js +53 -0
  81. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.js.map +1 -0
  82. package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponentForServer.d.ts +8 -0
  83. package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponentForServer.d.ts.map +1 -0
  84. package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponentForServer.js +89 -0
  85. package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponentForServer.js.map +1 -0
  86. package/analyzer-template/packages/github/dist/github/src/lib/loadOrCreateCommit.d.ts.map +1 -1
  87. package/analyzer-template/packages/github/dist/github/src/lib/loadOrCreateCommit.js +10 -0
  88. package/analyzer-template/packages/github/dist/github/src/lib/loadOrCreateCommit.js.map +1 -1
  89. package/analyzer-template/packages/github/dist/github/src/lib/syncPrimaryBranch.d.ts.map +1 -1
  90. package/analyzer-template/packages/github/dist/github/src/lib/syncPrimaryBranch.js +3 -0
  91. package/analyzer-template/packages/github/dist/github/src/lib/syncPrimaryBranch.js.map +1 -1
  92. package/analyzer-template/packages/github/dist/types/src/types/Entity.d.ts +2 -0
  93. package/analyzer-template/packages/github/dist/types/src/types/Entity.d.ts.map +1 -1
  94. package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts +6 -0
  95. package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts.map +1 -1
  96. package/analyzer-template/packages/github/src/lib/loadOrCreateCommit.ts +14 -0
  97. package/analyzer-template/packages/github/src/lib/syncPrimaryBranch.ts +2 -0
  98. package/analyzer-template/packages/process/index.ts +2 -0
  99. package/analyzer-template/packages/process/package.json +12 -0
  100. package/analyzer-template/packages/process/tsconfig.json +8 -0
  101. package/analyzer-template/packages/types/src/types/Entity.ts +2 -0
  102. package/analyzer-template/packages/types/src/types/Scenario.ts +6 -0
  103. package/analyzer-template/packages/utils/dist/types/src/types/Entity.d.ts +2 -0
  104. package/analyzer-template/packages/utils/dist/types/src/types/Entity.d.ts.map +1 -1
  105. package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts +6 -0
  106. package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts.map +1 -1
  107. package/analyzer-template/playwright/capture.ts +37 -18
  108. package/analyzer-template/playwright/waitForServer.ts +21 -6
  109. package/analyzer-template/project/constructMockCode.ts +781 -140
  110. package/analyzer-template/project/orchestrateCapture/KyselyAnalysisLoader.ts +3 -6
  111. package/analyzer-template/project/orchestrateCapture.ts +10 -3
  112. package/analyzer-template/project/reconcileMockDataKeys.ts +28 -100
  113. package/analyzer-template/project/runAnalysis.ts +5 -0
  114. package/analyzer-template/project/serverOnlyModules.ts +127 -2
  115. package/analyzer-template/project/start.ts +5 -3
  116. package/analyzer-template/project/startScenarioCapture.ts +6 -0
  117. package/analyzer-template/project/writeMockDataTsx.ts +50 -22
  118. package/analyzer-template/project/writeScenarioClientWrapper.ts +21 -0
  119. package/analyzer-template/project/writeScenarioComponents.ts +162 -100
  120. package/analyzer-template/project/writeScenarioFiles.ts +26 -0
  121. package/analyzer-template/project/writeSimpleRoot.ts +11 -35
  122. package/analyzer-template/scripts/comboWorkerLoop.cjs +1 -0
  123. package/analyzer-template/scripts/defaultCmd.sh +9 -0
  124. package/background/src/lib/local/createLocalAnalyzer.js +1 -29
  125. package/background/src/lib/local/createLocalAnalyzer.js.map +1 -1
  126. package/background/src/lib/local/execAsync.js +1 -1
  127. package/background/src/lib/local/execAsync.js.map +1 -1
  128. package/background/src/lib/virtualized/common/execAsync.js +1 -1
  129. package/background/src/lib/virtualized/common/execAsync.js.map +1 -1
  130. package/background/src/lib/virtualized/project/constructMockCode.js +718 -127
  131. package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
  132. package/background/src/lib/virtualized/project/orchestrateCapture/KyselyAnalysisLoader.js +3 -2
  133. package/background/src/lib/virtualized/project/orchestrateCapture/KyselyAnalysisLoader.js.map +1 -1
  134. package/background/src/lib/virtualized/project/orchestrateCapture.js +7 -4
  135. package/background/src/lib/virtualized/project/orchestrateCapture.js.map +1 -1
  136. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js +25 -61
  137. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js.map +1 -1
  138. package/background/src/lib/virtualized/project/runAnalysis.js +4 -0
  139. package/background/src/lib/virtualized/project/runAnalysis.js.map +1 -1
  140. package/background/src/lib/virtualized/project/serverOnlyModules.js +106 -3
  141. package/background/src/lib/virtualized/project/serverOnlyModules.js.map +1 -1
  142. package/background/src/lib/virtualized/project/start.js +5 -3
  143. package/background/src/lib/virtualized/project/start.js.map +1 -1
  144. package/background/src/lib/virtualized/project/startScenarioCapture.js +7 -0
  145. package/background/src/lib/virtualized/project/startScenarioCapture.js.map +1 -1
  146. package/background/src/lib/virtualized/project/writeMockDataTsx.js +52 -23
  147. package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
  148. package/background/src/lib/virtualized/project/writeScenarioClientWrapper.js +15 -0
  149. package/background/src/lib/virtualized/project/writeScenarioClientWrapper.js.map +1 -0
  150. package/background/src/lib/virtualized/project/writeScenarioComponents.js +136 -83
  151. package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
  152. package/background/src/lib/virtualized/project/writeScenarioFiles.js +19 -0
  153. package/background/src/lib/virtualized/project/writeScenarioFiles.js.map +1 -1
  154. package/background/src/lib/virtualized/project/writeSimpleRoot.js +11 -34
  155. package/background/src/lib/virtualized/project/writeSimpleRoot.js.map +1 -1
  156. package/codeyam-cli/src/cli.js +5 -1
  157. package/codeyam-cli/src/cli.js.map +1 -1
  158. package/codeyam-cli/src/commands/analyze.js +1 -1
  159. package/codeyam-cli/src/commands/analyze.js.map +1 -1
  160. package/codeyam-cli/src/commands/baseline.js +177 -0
  161. package/codeyam-cli/src/commands/baseline.js.map +1 -0
  162. package/codeyam-cli/src/commands/status.js +23 -1
  163. package/codeyam-cli/src/commands/status.js.map +1 -1
  164. package/codeyam-cli/src/commands/test-startup.js +1 -1
  165. package/codeyam-cli/src/commands/test-startup.js.map +1 -1
  166. package/codeyam-cli/src/commands/wipe.js +108 -0
  167. package/codeyam-cli/src/commands/wipe.js.map +1 -0
  168. package/codeyam-cli/src/utils/database.js +91 -5
  169. package/codeyam-cli/src/utils/database.js.map +1 -1
  170. package/codeyam-cli/src/utils/git.js +79 -0
  171. package/codeyam-cli/src/utils/git.js.map +1 -0
  172. package/codeyam-cli/src/utils/queue/job.js +104 -0
  173. package/codeyam-cli/src/utils/queue/job.js.map +1 -1
  174. package/codeyam-cli/src/utils/queue/persistence.js.map +1 -1
  175. package/codeyam-cli/src/utils/wipe.js +128 -0
  176. package/codeyam-cli/src/utils/wipe.js.map +1 -0
  177. package/codeyam-cli/src/webserver/app/lib/database.js +66 -17
  178. package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
  179. package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-wXL1Z2Aq.js → EntityItem-Cmysw5OP.js} +1 -1
  180. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-CzGX-miz.js → EntityTypeBadge-DLqD3qNt.js} +1 -1
  181. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-CXFKsCOD.js → EntityTypeIcon-CAneekK2.js} +1 -1
  182. package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-D-9pXIaY.js → InteractivePreview-Cu16OUmx.js} +2 -2
  183. package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-CBQPrpT0.js → LibraryFunctionPreview-CVtiBnY5.js} +1 -1
  184. package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-D1CdlbrV.js → LoadingDots-B0GLXMsr.js} +1 -1
  185. package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-wDPcZNKx.js → LogViewer-xgeCVgSM.js} +1 -1
  186. package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-4lcOlid-.js → ReportIssueModal-DcAUIpD_.js} +1 -1
  187. package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-BfmDgXxG.js → SafeScreenshot-DuDvi0jm.js} +1 -1
  188. package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-BMKg0SAF.js +15 -0
  189. package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-6J7zDUD5.js → TruncatedFilePath-DyFZkK0l.js} +1 -1
  190. package/codeyam-cli/src/webserver/build/client/assets/_index-DSmTpjmK.js +11 -0
  191. package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-BF_aK4y6.js +32 -0
  192. package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-BYimnrHg.js → chevron-down-Cx24_aWc.js} +1 -1
  193. package/codeyam-cli/src/webserver/build/client/assets/chunk-EPOLDU6W-CXRTFQ3F.js +51 -0
  194. package/codeyam-cli/src/webserver/build/client/assets/{circle-check-CaVsIRxt.js → circle-check-BOARzkeR.js} +1 -1
  195. package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-CgUsG7ib.js → createLucideIcon-BdhJEx6B.js} +1 -1
  196. package/codeyam-cli/src/webserver/build/client/assets/{dev.empty-DW_hdGUc.js → dev.empty-RJCf3Tvw.js} +1 -1
  197. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-zUEpfPsu.js → entity._sha._-D0-YwkBh.js} +12 -12
  198. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-EylcgScH.js +1 -0
  199. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.create-scenario-D_3ero5o.js → entity._sha_.create-scenario-DMe7kvgo.js} +1 -1
  200. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-CfLCUi9S.js → entity._sha_.edit._scenarioId-C1H_a_Y3.js} +1 -1
  201. package/codeyam-cli/src/webserver/build/client/assets/{entry.client-DKJyZfAY.js → entry.client-CS2cb_eZ.js} +6 -6
  202. package/codeyam-cli/src/webserver/build/client/assets/{fileTableUtils-DAtOlaWE.js → fileTableUtils-DMJ7zii9.js} +1 -1
  203. package/codeyam-cli/src/webserver/build/client/assets/{files-ClR0d32A.js → files-BW7Cyeyi.js} +1 -1
  204. package/codeyam-cli/src/webserver/build/client/assets/{git-D62Lxxmv.js → git-CZu4fif0.js} +2 -2
  205. package/codeyam-cli/src/webserver/build/client/assets/globals-wHVy_II5.css +1 -0
  206. package/codeyam-cli/src/webserver/build/client/assets/{index-CzNNiTkw.js → index-B1h680n5.js} +1 -1
  207. package/codeyam-cli/src/webserver/build/client/assets/{index-BosqDOlH.js → index-lzqtyFU8.js} +1 -1
  208. package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-CNp9QFCX.js → loader-circle-B7B9V-bu.js} +1 -1
  209. package/codeyam-cli/src/webserver/build/client/assets/{manifest-09d684be.js → manifest-2d191949.js} +1 -1
  210. package/codeyam-cli/src/webserver/build/client/assets/root-FHgpM6gc.js +56 -0
  211. package/codeyam-cli/src/webserver/build/client/assets/{search-DDGjYAMJ.js → search-CxXUmBSd.js} +1 -1
  212. package/codeyam-cli/src/webserver/build/client/assets/{settings-DgTyB-Wg.js → settings-6D8k8Jp5.js} +1 -1
  213. package/codeyam-cli/src/webserver/build/client/assets/simulations-CDJZnWhN.js +1 -0
  214. package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-CBc5dE1s.js → triangle-alert-B6LgvRJg.js} +1 -1
  215. package/codeyam-cli/src/webserver/build/client/assets/{useCustomSizes-BMIGFP-m.js → useCustomSizes-Dv18q8LD.js} +1 -1
  216. package/codeyam-cli/src/webserver/build/client/assets/{useInteractiveMode-Dk_FQqWJ.js → useInteractiveMode-0ToGk4K3.js} +1 -1
  217. package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-BqPPNjAl.js → useLastLogLine-aSv48UbS.js} +1 -1
  218. package/codeyam-cli/src/webserver/build/client/assets/{useReportContext-DsJbgMY9.js → useReportContext-1BX144Eg.js} +1 -1
  219. package/codeyam-cli/src/webserver/build/client/assets/{useToast-DWHcCcl1.js → useToast-mBRpZPiu.js} +1 -1
  220. package/codeyam-cli/src/webserver/build/server/assets/{index-CV6i1S1A.js → index-pU0o5t1o.js} +1 -1
  221. package/codeyam-cli/src/webserver/build/server/assets/server-build-YzfkRwdn.js +178 -0
  222. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  223. package/codeyam-cli/src/webserver/build-info.json +5 -5
  224. package/codeyam-cli/templates/codeyam-setup-skill.md +138 -3
  225. package/codeyam-cli/templates/debug-codeyam.md +7 -2
  226. package/package.json +5 -5
  227. package/packages/ai/src/lib/astScopes/processExpression.js +13 -1
  228. package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
  229. package/packages/ai/src/lib/checkAllAttributes.js +24 -9
  230. package/packages/ai/src/lib/checkAllAttributes.js.map +1 -1
  231. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +94 -18
  232. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
  233. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js +2 -1
  234. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js.map +1 -1
  235. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.js +51 -23
  236. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.js.map +1 -1
  237. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js +70 -54
  238. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js.map +1 -1
  239. package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js +11 -0
  240. package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js.map +1 -1
  241. package/packages/ai/src/lib/dataStructure/helpers/convertNullToUndefinedBySchema.js +86 -0
  242. package/packages/ai/src/lib/dataStructure/helpers/convertNullToUndefinedBySchema.js.map +1 -0
  243. package/packages/ai/src/lib/deepEqual.js +32 -0
  244. package/packages/ai/src/lib/deepEqual.js.map +1 -0
  245. package/packages/ai/src/lib/findMatchingAttribute.js +20 -16
  246. package/packages/ai/src/lib/findMatchingAttribute.js.map +1 -1
  247. package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js +168 -41
  248. package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js.map +1 -1
  249. package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js +42 -1
  250. package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js.map +1 -1
  251. package/packages/ai/src/lib/generateChangesEntityScenarioData.js +59 -3
  252. package/packages/ai/src/lib/generateChangesEntityScenarioData.js.map +1 -1
  253. package/packages/ai/src/lib/generateChangesEntityScenarios.js +6 -6
  254. package/packages/ai/src/lib/generateChangesEntityScenarios.js.map +1 -1
  255. package/packages/ai/src/lib/generateEntityScenarioData.js +32 -23
  256. package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
  257. package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js +20 -1
  258. package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js.map +1 -1
  259. package/packages/analyze/src/lib/FileAnalyzer.js +15 -0
  260. package/packages/analyze/src/lib/FileAnalyzer.js.map +1 -1
  261. package/packages/analyze/src/lib/asts/nodes/index.js +1 -0
  262. package/packages/analyze/src/lib/asts/nodes/index.js.map +1 -1
  263. package/packages/analyze/src/lib/asts/nodes/isAsyncFunction.js +52 -0
  264. package/packages/analyze/src/lib/asts/nodes/isAsyncFunction.js.map +1 -0
  265. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +59 -50
  266. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
  267. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +6 -0
  268. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
  269. package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js +2 -0
  270. package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js.map +1 -1
  271. package/packages/analyze/src/lib/files/analyzeChange.js +14 -4
  272. package/packages/analyze/src/lib/files/analyzeChange.js.map +1 -1
  273. package/packages/analyze/src/lib/files/analyzeEntity.js +7 -6
  274. package/packages/analyze/src/lib/files/analyzeEntity.js.map +1 -1
  275. package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js +44 -10
  276. package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js.map +1 -1
  277. package/packages/analyze/src/lib/files/scenarios/enrichUnknownTypesFromSourceEquivalencies.js +85 -0
  278. package/packages/analyze/src/lib/files/scenarios/enrichUnknownTypesFromSourceEquivalencies.js.map +1 -0
  279. package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js +314 -52
  280. package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js.map +1 -1
  281. package/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.js +97 -2
  282. package/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.js.map +1 -1
  283. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +88 -52
  284. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
  285. package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js +26 -98
  286. package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js.map +1 -1
  287. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +141 -75
  288. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
  289. package/packages/aws/src/lib/ecs/ecsDefineContainer.js +2 -2
  290. package/packages/aws/src/lib/ecs/ecsDefineContainer.js.map +1 -1
  291. package/packages/aws/src/lib/ecs/ecsTaskFactory.js +17 -61
  292. package/packages/aws/src/lib/ecs/ecsTaskFactory.js.map +1 -1
  293. package/packages/generate/index.js +3 -0
  294. package/packages/generate/index.js.map +1 -1
  295. package/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js +16 -1
  296. package/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js.map +1 -1
  297. package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +189 -0
  298. package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -0
  299. package/packages/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.js +53 -0
  300. package/packages/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.js.map +1 -0
  301. package/packages/generate/src/lib/scenarioComponentForServer.js +89 -0
  302. package/packages/generate/src/lib/scenarioComponentForServer.js.map +1 -0
  303. package/packages/github/src/lib/loadOrCreateCommit.js +10 -0
  304. package/packages/github/src/lib/loadOrCreateCommit.js.map +1 -1
  305. package/packages/github/src/lib/syncPrimaryBranch.js +3 -0
  306. package/packages/github/src/lib/syncPrimaryBranch.js.map +1 -1
  307. package/packages/process/index.js +3 -0
  308. package/packages/process/index.js.map +1 -0
  309. package/packages/process/src/GlobalProcessManager.js.map +1 -0
  310. package/{background/src/lib/process → packages/process/src}/ProcessManager.js +1 -1
  311. package/packages/process/src/ProcessManager.js.map +1 -0
  312. package/packages/process/src/index.js.map +1 -0
  313. package/packages/process/src/managedExecAsync.js.map +1 -0
  314. package/analyzer-template/process/INTEGRATION_COMPLETE.md +0 -333
  315. package/analyzer-template/process/INTEGRATION_EXAMPLE.md +0 -525
  316. package/analyzer-template/process/README.md +0 -507
  317. package/background/src/lib/process/GlobalProcessManager.js.map +0 -1
  318. package/background/src/lib/process/ProcessManager.js.map +0 -1
  319. package/background/src/lib/process/index.js.map +0 -1
  320. package/background/src/lib/process/managedExecAsync.js.map +0 -1
  321. package/codeyam-cli/scripts/fixtures/cal.com/universal-mocks/packages/prisma/index.js +0 -238
  322. package/codeyam-cli/scripts/fixtures/cal.com/universal-mocks/packages/prisma/index.js.map +0 -1
  323. package/codeyam-cli/scripts/fixtures/formbricks/universal-mocks/apps/web/lib/instance/service.js +0 -7
  324. package/codeyam-cli/scripts/fixtures/formbricks/universal-mocks/apps/web/lib/instance/service.js.map +0 -1
  325. package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-CUxUNEEC.js +0 -15
  326. package/codeyam-cli/src/webserver/build/client/assets/_index-DHImXdXq.js +0 -11
  327. package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-2mG6mjVb.js +0 -32
  328. package/codeyam-cli/src/webserver/build/client/assets/chunk-JMJ3UQ3L-BambyYE_.js +0 -51
  329. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-DyB90fWk.js +0 -1
  330. package/codeyam-cli/src/webserver/build/client/assets/globals-C6vQASxy.css +0 -1
  331. package/codeyam-cli/src/webserver/build/client/assets/root-BxJUvKau.js +0 -56
  332. package/codeyam-cli/src/webserver/build/client/assets/simulations-CoNWGt0K.js +0 -1
  333. package/codeyam-cli/src/webserver/build/server/assets/server-build-BDlyhfrv.js +0 -175
  334. /package/analyzer-template/{process → packages/process/src}/GlobalProcessManager.ts +0 -0
  335. /package/analyzer-template/{process → packages/process/src}/ProcessManager.ts +0 -0
  336. /package/analyzer-template/{process → packages/process/src}/index.ts +0 -0
  337. /package/analyzer-template/{process → packages/process/src}/managedExecAsync.ts +0 -0
  338. /package/{background/src/lib/process → packages/process/src}/GlobalProcessManager.js +0 -0
  339. /package/{background/src/lib/process → packages/process/src}/index.js +0 -0
  340. /package/{background/src/lib/process → packages/process/src}/managedExecAsync.js +0 -0
@@ -1,238 +0,0 @@
1
- /* eslint-disable @typescript-eslint/require-await */
2
- export const prisma = {
3
- $connect: async () => { },
4
- $disconnect: async () => { },
5
- $on: () => { },
6
- $use: () => { },
7
- $transaction: async (fn) => typeof fn === 'function' ? fn(prisma) : [],
8
- $extends: () => prisma,
9
- user: {
10
- findFirst: async () => null,
11
- findUnique: async () => null,
12
- findMany: async () => [],
13
- create: async () => ({}),
14
- createMany: async () => ({ count: 0 }),
15
- update: async () => ({}),
16
- updateMany: async () => ({ count: 0 }),
17
- upsert: async () => ({}),
18
- delete: async () => ({}),
19
- deleteMany: async () => ({ count: 0 }),
20
- count: async () => 0,
21
- aggregate: async () => ({}),
22
- groupBy: async () => [],
23
- },
24
- booking: {
25
- findFirst: async () => null,
26
- findUnique: async () => null,
27
- findMany: async () => [],
28
- create: async () => ({}),
29
- createMany: async () => ({ count: 0 }),
30
- update: async () => ({}),
31
- updateMany: async () => ({ count: 0 }),
32
- upsert: async () => ({}),
33
- delete: async () => ({}),
34
- deleteMany: async () => ({ count: 0 }),
35
- count: async () => 0,
36
- aggregate: async () => ({}),
37
- groupBy: async () => [],
38
- },
39
- eventType: {
40
- findFirst: async () => null,
41
- findUnique: async () => null,
42
- findMany: async () => [],
43
- create: async () => ({}),
44
- createMany: async () => ({ count: 0 }),
45
- update: async () => ({}),
46
- updateMany: async () => ({ count: 0 }),
47
- upsert: async () => ({}),
48
- delete: async () => ({}),
49
- deleteMany: async () => ({ count: 0 }),
50
- count: async () => 0,
51
- aggregate: async () => ({}),
52
- groupBy: async () => [],
53
- },
54
- credential: {
55
- findFirst: async () => null,
56
- findUnique: async () => null,
57
- findMany: async () => [],
58
- create: async () => ({}),
59
- createMany: async () => ({ count: 0 }),
60
- update: async () => ({}),
61
- updateMany: async () => ({ count: 0 }),
62
- upsert: async () => ({}),
63
- delete: async () => ({}),
64
- deleteMany: async () => ({ count: 0 }),
65
- count: async () => 0,
66
- aggregate: async () => ({}),
67
- groupBy: async () => [],
68
- },
69
- app: {
70
- findFirst: async () => null,
71
- findUnique: async () => null,
72
- findMany: async () => [],
73
- create: async () => ({}),
74
- createMany: async () => ({ count: 0 }),
75
- update: async () => ({}),
76
- updateMany: async () => ({ count: 0 }),
77
- upsert: async () => ({}),
78
- delete: async () => ({}),
79
- deleteMany: async () => ({ count: 0 }),
80
- count: async () => 0,
81
- aggregate: async () => ({}),
82
- groupBy: async () => [],
83
- },
84
- team: {
85
- findFirst: async () => null,
86
- findUnique: async () => null,
87
- findMany: async () => [],
88
- create: async () => ({}),
89
- createMany: async () => ({ count: 0 }),
90
- update: async () => ({}),
91
- updateMany: async () => ({ count: 0 }),
92
- upsert: async () => ({}),
93
- delete: async () => ({}),
94
- deleteMany: async () => ({ count: 0 }),
95
- count: async () => 0,
96
- aggregate: async () => ({}),
97
- groupBy: async () => [],
98
- },
99
- membership: {
100
- findFirst: async () => null,
101
- findUnique: async () => null,
102
- findMany: async () => [],
103
- create: async () => ({}),
104
- createMany: async () => ({ count: 0 }),
105
- update: async () => ({}),
106
- updateMany: async () => ({ count: 0 }),
107
- upsert: async () => ({}),
108
- delete: async () => ({}),
109
- deleteMany: async () => ({ count: 0 }),
110
- count: async () => 0,
111
- aggregate: async () => ({}),
112
- groupBy: async () => [],
113
- },
114
- schedule: {
115
- findFirst: async () => null,
116
- findUnique: async () => null,
117
- findMany: async () => [],
118
- create: async () => ({}),
119
- createMany: async () => ({ count: 0 }),
120
- update: async () => ({}),
121
- updateMany: async () => ({ count: 0 }),
122
- upsert: async () => ({}),
123
- delete: async () => ({}),
124
- deleteMany: async () => ({ count: 0 }),
125
- count: async () => 0,
126
- aggregate: async () => ({}),
127
- groupBy: async () => [],
128
- },
129
- availability: {
130
- findFirst: async () => null,
131
- findUnique: async () => null,
132
- findMany: async () => [],
133
- create: async () => ({}),
134
- createMany: async () => ({ count: 0 }),
135
- update: async () => ({}),
136
- updateMany: async () => ({ count: 0 }),
137
- upsert: async () => ({}),
138
- delete: async () => ({}),
139
- deleteMany: async () => ({ count: 0 }),
140
- count: async () => 0,
141
- aggregate: async () => ({}),
142
- groupBy: async () => [],
143
- },
144
- selectedCalendar: {
145
- findFirst: async () => null,
146
- findUnique: async () => null,
147
- findMany: async () => [],
148
- create: async () => ({}),
149
- createMany: async () => ({ count: 0 }),
150
- update: async () => ({}),
151
- updateMany: async () => ({ count: 0 }),
152
- upsert: async () => ({}),
153
- delete: async () => ({}),
154
- deleteMany: async () => ({ count: 0 }),
155
- count: async () => 0,
156
- aggregate: async () => ({}),
157
- groupBy: async () => [],
158
- },
159
- webhook: {
160
- findFirst: async () => null,
161
- findUnique: async () => null,
162
- findMany: async () => [],
163
- create: async () => ({}),
164
- createMany: async () => ({ count: 0 }),
165
- update: async () => ({}),
166
- updateMany: async () => ({ count: 0 }),
167
- upsert: async () => ({}),
168
- delete: async () => ({}),
169
- deleteMany: async () => ({ count: 0 }),
170
- count: async () => 0,
171
- aggregate: async () => ({}),
172
- groupBy: async () => [],
173
- },
174
- workflow: {
175
- findFirst: async () => null,
176
- findUnique: async () => null,
177
- findMany: async () => [],
178
- create: async () => ({}),
179
- createMany: async () => ({ count: 0 }),
180
- update: async () => ({}),
181
- updateMany: async () => ({ count: 0 }),
182
- upsert: async () => ({}),
183
- delete: async () => ({}),
184
- deleteMany: async () => ({ count: 0 }),
185
- count: async () => 0,
186
- aggregate: async () => ({}),
187
- groupBy: async () => [],
188
- },
189
- attendee: {
190
- findFirst: async () => null,
191
- findUnique: async () => null,
192
- findMany: async () => [],
193
- create: async () => ({}),
194
- createMany: async () => ({ count: 0 }),
195
- update: async () => ({}),
196
- updateMany: async () => ({ count: 0 }),
197
- upsert: async () => ({}),
198
- delete: async () => ({}),
199
- deleteMany: async () => ({ count: 0 }),
200
- count: async () => 0,
201
- aggregate: async () => ({}),
202
- groupBy: async () => [],
203
- },
204
- feature: {
205
- findFirst: async () => null,
206
- findUnique: async () => null,
207
- findMany: async () => [],
208
- create: async () => ({}),
209
- createMany: async () => ({ count: 0 }),
210
- update: async () => ({}),
211
- updateMany: async () => ({ count: 0 }),
212
- upsert: async () => ({}),
213
- delete: async () => ({}),
214
- deleteMany: async () => ({ count: 0 }),
215
- count: async () => 0,
216
- aggregate: async () => ({}),
217
- groupBy: async () => [],
218
- },
219
- deployment: {
220
- findFirst: async () => null,
221
- findUnique: async () => null,
222
- findMany: async () => [],
223
- create: async () => ({}),
224
- createMany: async () => ({ count: 0 }),
225
- update: async () => ({}),
226
- updateMany: async () => ({ count: 0 }),
227
- upsert: async () => ({}),
228
- delete: async () => ({}),
229
- deleteMany: async () => ({ count: 0 }),
230
- count: async () => 0,
231
- aggregate: async () => ({}),
232
- groupBy: async () => [],
233
- },
234
- };
235
- export const readonlyPrisma = prisma;
236
- export const customPrisma = () => prisma;
237
- export default prisma;
238
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../scripts/fixtures/cal.com/universal-mocks/packages/prisma/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,MAAM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C,EAAE,CAAC;QACtC,UAAU,EAAE,KAAK,IAAgC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QAClE,MAAM,EAAE,KAAK,IAAkB,EAAE,CAAC,CAAC,EAAE,CAAC;QACtC,UAAU,EAAE,KAAK,IAAgC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QAClE,MAAM,EAAE,KAAK,IAAkB,EAAE,CAAC,CAAC,EAAE,CAAC;QACtC,MAAM,EAAE,KAAK,IAAkB,EAAE,CAAC,CAAC,EAAE,CAAC;QACtC,UAAU,EAAE,KAAK,IAAgC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QAClE,KAAK,EAAE,KAAK,IAAqB,EAAE,CAAC,CAAC;QACrC,SAAS,EAAE,KAAK,IAAkB,EAAE,CAAC,CAAC,EAAE,CAAC;QACzC,OAAO,EAAE,KAAK,IAAoB,EAAE,CAAC,EAAE;KACxC;CACK,CAAC;AAET,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC;AAErC,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC;AAEzC,eAAe,MAAM,CAAC"}
@@ -1,7 +0,0 @@
1
- export const getIsFreshInstance = () => {
2
- return Promise.resolve(true);
3
- };
4
- export const gethasNoOrganizations = () => {
5
- return Promise.resolve(true);
6
- };
7
- //# sourceMappingURL=service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"service.js","sourceRoot":"","sources":["../../../../../../../../../../scripts/fixtures/formbricks/universal-mocks/apps/web/lib/instance/service.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAqB,EAAE;IACvD,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAqB,EAAE;IAC1D,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- import{r as i,j as e,c as fe,L as oe}from"./chunk-JMJ3UQ3L-BambyYE_.js";import{I as pe}from"./InteractivePreview-D-9pXIaY.js";import{u as ge,V as be,S as je}from"./useCustomSizes-BMIGFP-m.js";import{L as we}from"./LogViewer-wDPcZNKx.js";import{S as Ne}from"./SafeScreenshot-BfmDgXxG.js";import{u as ve}from"./useLastLogLine-BqPPNjAl.js";import{u as ke}from"./useInteractiveMode-Dk_FQqWJ.js";import{_ as ye}from"./preload-helper-ckwbz45p.js";import{R as Ce}from"./ReportIssueModal-4lcOlid-.js";import{c as ie}from"./createLucideIcon-CgUsG7ib.js";import{g as Ie}from"./scenarioStatus-B_8jpV3e.js";/**
2
- * @license lucide-react v0.556.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const Le=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ee=ie("check",Le);/**
7
- * @license lucide-react v0.556.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const $e=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Pe=ie("copy",$e);function _e({presets:s,customSizes:t,currentWidth:n,currentHeight:o,scale:v,onSizeChange:j,onSaveCustomSize:g,onRemoveCustomSize:m,className:k=""}){const[h,u]=i.useState(!1),[f,w]=i.useState(String(n)),[b,c]=i.useState(String(o)),[N,y]=i.useState(!1),[l,M]=i.useState(!1),S=i.useRef(null);i.useEffect(()=>{N||w(String(n))},[n,N]),i.useEffect(()=>{l||c(String(o))},[o,l]),i.useEffect(()=>{const r=x=>{S.current&&!S.current.contains(x.target)&&u(!1)};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[]);const I=i.useMemo(()=>{const r=s.find(d=>d.width===n&&d.height===o);if(r)return r.name;const x=t.find(d=>d.width===n&&d.height===o);return x?x.name:"Custom"},[s,t,n,o]),T=I==="Custom",R=r=>{j(r.width,r.height),u(!1)},B=r=>{const x=r.target.value;w(x);const d=parseInt(x,10);!isNaN(d)&&d>0&&j(d,o)},H=r=>{const x=r.target.value;c(x);const d=parseInt(x,10);!isNaN(d)&&d>0&&j(n,d)},O=()=>{y(!1);const r=parseInt(f,10);(isNaN(r)||r<=0)&&w(String(n))},W=()=>{M(!1);const r=parseInt(b,10);(isNaN(r)||r<=0)&&c(String(o))},A=r=>{(r.key==="Enter"||r.key==="Escape")&&r.target.blur()};return e.jsxs("div",{className:`flex items-center gap-3 ${k}`,children:[e.jsxs("div",{className:"relative",ref:S,children:[e.jsxs("button",{onClick:()=>u(!h),className:"flex items-center gap-2 px-3 py-1.5 bg-white border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:ring-offset-1 min-w-[120px] justify-between",children:[e.jsx("span",{children:I}),e.jsx("svg",{className:`w-4 h-4 transition-transform ${h?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),h&&e.jsx("div",{className:"absolute top-full left-0 mt-1 min-w-full bg-white border border-gray-200 rounded-md shadow-lg z-50",children:e.jsxs("div",{className:"py-1",children:[s.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-3 py-1 text-xs font-semibold text-gray-500 uppercase tracking-wider whitespace-nowrap",children:"Presets"}),s.map(r=>e.jsxs("button",{onClick:()=>R(r),className:`w-full text-left px-3 py-2 text-sm hover:bg-gray-100 flex justify-between items-center gap-4 whitespace-nowrap ${I===r.name?"bg-[#f0f7f9] text-[#005c75]":"text-gray-700"}`,children:[e.jsx("span",{children:r.name}),e.jsxs("span",{className:"text-xs text-gray-500",children:[r.width," x ",r.height]})]},r.name))]}),t.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t border-gray-100 my-1"}),e.jsx("div",{className:"px-3 py-1 text-xs font-semibold text-gray-500 uppercase tracking-wider whitespace-nowrap",children:"Custom"}),[...t].sort((r,x)=>r.width-x.width).map(r=>e.jsxs("div",{className:`flex items-center gap-1 hover:bg-gray-100 ${I===r.name?"bg-[#f0f7f9] text-[#005c75]":"text-gray-700"}`,children:[e.jsxs("button",{onClick:()=>R(r),className:"flex-1 text-left px-3 py-2 text-sm flex justify-between items-center gap-4 whitespace-nowrap cursor-pointer",children:[e.jsx("span",{children:r.name}),e.jsxs("span",{className:"text-xs text-gray-500",children:[r.width," x ",r.height]})]}),m&&e.jsx("button",{onClick:x=>{x.stopPropagation(),I===r.name&&s.length>0&&j(s[0].width,s[0].height),m(r.name)},className:"p-1.5 mr-1 text-gray-400 hover:text-red-500 hover:bg-red-50 rounded cursor-pointer transition-colors",title:"Remove custom size",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},r.name))]})]})})]}),e.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("input",{type:"text",value:f,onChange:B,onFocus:()=>y(!0),onBlur:O,onKeyDown:A,className:"w-16 px-2 py-1 text-right border border-gray-300 rounded-l-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75]"}),e.jsx("span",{className:"px-2 py-1 bg-gray-100 border border-l-0 border-gray-300 rounded-r-md text-gray-500 text-sm",children:"px"})]}),e.jsx("span",{className:"text-gray-400 mx-1",children:"×"}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("input",{type:"text",value:b,onChange:H,onFocus:()=>M(!0),onBlur:W,onKeyDown:A,className:"w-16 px-2 py-1 text-right border border-gray-300 rounded-l-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75]"}),e.jsx("span",{className:"px-2 py-1 bg-gray-100 border border-l-0 border-gray-300 rounded-r-md text-gray-500 text-sm",children:"px"})]}),v!==void 0&&v<1&&e.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",Math.round(v*100),"%)"]})]}),T&&e.jsx("button",{onClick:g,className:"px-3 py-1.5 bg-[#005c75] text-white text-sm font-medium rounded-md hover:bg-[#004a5c] focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:ring-offset-1 transition-colors",children:"Save Custom Size"})]})}function ae({size:s=24,className:t=""}){return e.jsxs("svg",{width:s,height:s,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:[e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z",fill:"#ef4444",stroke:"none"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13",stroke:"#FFFFFF",strokeWidth:"2",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"17",r:"1",fill:"#FFFFFF"})]})}function Se({scenario:s,analysis:t,entity:n}){var g,m,k;const o=((g=s.metadata)==null?void 0:g.executionResult)||null,v=((k=(m=s.metadata)==null?void 0:m.data)==null?void 0:k.argumentsData)||[],j=h=>{var c,N,y;if(!h)return"No execution results available yet. Run the function to capture side effects including console output, file operations, and API calls.";const u=[],f=((c=h.sideEffects)==null?void 0:c.consoleOutput)||[];f.length>0&&(u.push(`Console Output: ${f.length} log ${f.length===1?"entry":"entries"} captured`),f.forEach(l=>{u.push(` [${l.level.toUpperCase()}] ${l.args.join(" ")}`)}));const w=((N=h.sideEffects)==null?void 0:N.fileWrites)||[];w.length>0&&(u.push(`
12
- File System Operations: ${w.length} ${w.length===1?"operation":"operations"} detected`),w.forEach(l=>{u.push(` ${l.operation}: ${l.path}${l.size?` (${l.size} bytes)`:""}`)}));const b=((y=h.sideEffects)==null?void 0:y.apiCalls)||[];return b.length>0&&(u.push(`
13
- API Calls: ${b.length} ${b.length===1?"call":"calls"} made`),b.forEach(l=>{u.push(` ${l.method} ${l.url}${l.status?` → ${l.status}`:""}${l.duration?` (${l.duration}ms)`:""}`)})),h.error&&u.push(`
14
- Error: ${h.error.name||"Error"}: ${h.error.message}`),u.length===0?"No side effects detected. The function executed without console output, file operations, or API calls.":u.join(`
15
- `)};return e.jsxs("div",{className:"flex w-full h-full gap-0",children:[e.jsxs("div",{className:"flex-1 border border-gray-200 bg-white rounded flex flex-col",children:[e.jsx("div",{className:"px-4 pt-3.5 pb-2.5",children:e.jsx("h3",{className:"text-[9px] font-semibold text-[#005c75] uppercase tracking-wide text-center m-0",children:"Input Data"})}),e.jsx("div",{className:"flex-1 overflow-auto px-4 pb-0",children:e.jsx("pre",{className:"text-xs font-mono text-gray-800 whitespace-pre-wrap break-words m-0",children:JSON.stringify(v,null,2)})})]}),e.jsxs("div",{className:"flex-1 border border-gray-200 bg-white rounded flex flex-col ml-[-1px]",children:[e.jsx("div",{className:"px-4 pt-3.5 pb-2.5",children:e.jsx("h3",{className:"text-[9px] font-semibold text-[#005c75] uppercase tracking-wide text-center m-0",children:"Returned Data"})}),e.jsx("div",{className:"flex-1 overflow-auto px-4 pb-0",children:o?e.jsx("pre",{className:"text-xs font-mono text-gray-800 whitespace-pre-wrap break-words m-0",children:o.returnValue!==void 0?JSON.stringify(o.returnValue,null,2):"undefined"}):e.jsx("div",{className:"text-sm text-gray-500 italic",children:"No execution results yet"})})]}),e.jsxs("div",{className:"flex-1 border border-gray-200 bg-white rounded flex flex-col ml-[-1px]",children:[e.jsx("div",{className:"px-4 pt-3.5 pb-2.5",children:e.jsx("h3",{className:"text-[9px] font-semibold text-[#005c75] uppercase tracking-wide text-center m-0",children:"Side Effects"})}),e.jsx("div",{className:"flex-1 overflow-auto px-4 pb-4",children:e.jsx("p",{className:"text-sm text-gray-700 leading-[22px] m-0 whitespace-pre-wrap",children:j(o)})})]})]})}const _={commandBoxBg:"#f6f9fc",commandBoxBorder:"#e1e1e1",commandBoxText:"#005c75",heading:"#000",subtext:"#646464",link:"#005c75"};function D({scenarioId:s,analysisId:t}){const[n,o]=i.useState(!1),[v,j]=i.useState(!1),[g,m]=i.useState(null),[k,h]=i.useState(!1),u=s||t;if(!u)return null;const f=`/debug-codeyam ${u}`,w=async()=>{j(!0);try{const{default:c}=await ye(async()=>{const{default:l}=await import("./html2canvas-pro.esm-fmIEn3Bc.js");return{default:l}},[]),y=(await c(document.body,{scale:.5})).toDataURL("image/jpeg",.8);m(y),o(!0)}catch(c){console.error("Screenshot capture failed:",c),o(!0)}finally{j(!1)}},b=()=>{o(!1),m(null)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-center p-6 bg-cywhite-100 rounded-lg border-cygray-30 border",children:[e.jsx("h3",{className:"font-semibold font-['IBM_Plex_Sans']",style:{fontSize:"18px",lineHeight:"26px",color:_.heading},children:"Claude can help debug this error."}),e.jsx("p",{className:"m-0 mb-4 font-['IBM_Plex_Sans']",style:{fontSize:"14px",lineHeight:"18px",color:_.subtext},children:"Simply run this command in Claude Code:"}),e.jsxs("div",{className:"flex items-center justify-between rounded mx-auto mb-3 border",style:{backgroundColor:_.commandBoxBg,borderColor:_.commandBoxBorder,maxWidth:"505px",height:"35px",paddingLeft:"13px",paddingRight:"13px",paddingTop:"6px",paddingBottom:"6px"},children:[e.jsx("code",{className:"font-mono font-['IBM_Plex_Mono'] flex-1 text-left",style:{fontSize:"12px",lineHeight:"20px",color:_.commandBoxText},children:f}),e.jsx("button",{onClick:c=>{c.stopPropagation(),navigator.clipboard.writeText(f),h(!0),setTimeout(()=>h(!1),2e3)},className:"ml-3 cursor-pointer p-0 bg-transparent border-none hover:opacity-80 transition-opacity",style:{width:"14px",height:"14px",color:k?"#22c55e":_.commandBoxText},title:k?"Copied!":"Copy command","aria-label":"Copy command to clipboard",children:k?e.jsx(Ee,{size:14}):e.jsx(Pe,{size:14})})]}),e.jsxs("p",{className:"m-0 font-['IBM_Plex_Sans']",style:{fontSize:"12px",lineHeight:"15px",color:"#005c75"},children:["If Claude is unable to address this issue or suggests reporting it,"," ",e.jsx("button",{onClick:()=>void w(),disabled:v,className:"underline cursor-pointer bg-transparent border-none p-0 font-normal hover:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed font-['IBM_Plex_Sans']",style:{fontSize:"12px",lineHeight:"15px",color:_.link},children:v?"capturing...":"please do so here"}),"."]})]}),e.jsx(Ce,{isOpen:n,onClose:b,context:{source:s?"scenario-page":"entity-page",entitySha:void 0,scenarioId:s,analysisId:t,currentUrl:typeof window<"u"?window.location.pathname:"/"},screenshotDataUrl:g??void 0})]})}const le=1440,V=[{name:"Mobile",width:375,height:667},{name:"Tablet",width:768,height:1024},{name:"Laptop",width:1024,height:768},{name:"Desktop",width:1440,height:900}],E={background:"#ffdcd9",border:"#fda4a4",text:"#ef4444",link:"#991b1b"};function We({selectedScenario:s,analysis:t,entity:n,viewMode:o,cacheBuster:v,hasScenarios:j,isAnalyzing:g=!1,projectSlug:m,hasAnApiKey:k=!0}){var J,Y,G,Q,X,Z,ee,te,se,re,ne;const h=fe(),[u,f]=i.useState(!1),[w,b]=i.useState(!1),[c,N]=i.useState({name:"Desktop",width:le,height:900}),[y,l]=i.useState(le),[M,S]=i.useState(1),{customSizes:I,addCustomSize:T,removeCustomSize:R}=ge(m),B=i.useMemo(()=>[...V,...I],[I]),H=(a,L)=>{l(a);const C=B.find(p=>p.width===a&&p.height===L);N({name:(C==null?void 0:C.name)||"Custom",width:a,height:L})},O=a=>{l(a.width),N({name:a.name,width:a.width,height:a.height})},W=a=>{T(a,c.width,c.height??900),b(!1),N(L=>({...L,name:a}))},A=(a,L)=>{l(a);const C=B.find(p=>p.width===a&&p.height===L);N(p=>({name:(C==null?void 0:C.name)||"Custom",width:a,height:p.height}))},r=(Y=(J=s==null?void 0:s.metadata)==null?void 0:J.screenshotPaths)==null?void 0:Y[0],x=i.useMemo(()=>s?Ie(s,t==null?void 0:t.status,void 0,n==null?void 0:n.sha,void 0):null,[s,t==null?void 0:t.status,n==null?void 0:n.sha]),d=i.useMemo(()=>{var L,C;const a=[];if((L=t==null?void 0:t.status)!=null&&L.errors&&t.status.errors.length>0)for(const p of t.status.errors)a.push({source:`${p.phase} phase`,message:p.message,stack:p.stack});if((C=t==null?void 0:t.status)!=null&&C.steps)for(const p of t.status.steps)p.error&&a.push({source:p.name,message:p.error,stack:p.errorStack});return a},[(G=t==null?void 0:t.status)==null?void 0:G.errors,(Q=t==null?void 0:t.status)==null?void 0:Q.steps]),$=(x==null?void 0:x.errorMessage)||null,U=(x==null?void 0:x.errorStack)||null,{interactiveServerUrl:K,isStarting:q,isLoading:ce,showIframe:de,iframeKey:xe,onIframeLoad:me}=ke({analysisId:t==null?void 0:t.id,scenarioId:s==null?void 0:s.id,scenarioName:s==null?void 0:s.name,projectSlug:m,enabled:o==="interactive"}),z=i.useMemo(()=>K||null,[K]),F=!g&&j&&s&&!((Z=(X=s.metadata)==null?void 0:X.screenshotPaths)!=null&&Z[0])&&((te=(ee=t==null?void 0:t.status)==null?void 0:ee.scenarios)==null?void 0:te.some(a=>a.name===s.name&&a.screenshotStartedAt&&!a.screenshotFinishedAt)),{lastLine:P}=ve(m,g||o==="interactive"||F||!1);if(!s){if(g&&n)return e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-12 text-center bg-[#f6f9fc]",children:e.jsxs("div",{className:"flex flex-col items-center gap-6 max-w-2xl",children:[e.jsx("div",{className:"w-12 h-12 mb-2",children:e.jsx("svg",{className:"animate-spin",viewBox:"0 0 50 50",children:e.jsx("circle",{cx:"25",cy:"25",r:"20",fill:"none",stroke:"#005c75",strokeWidth:"4",strokeDasharray:"31.4 31.4",strokeLinecap:"round"})})}),e.jsx("h2",{className:"text-2xl font-semibold text-[#005c75] leading-[30px] m-0 font-['IBM_Plex_Sans']",children:F?"Capturing screenshots...":"Analyzing..."}),e.jsx("p",{className:"text-xs text-[#8e8e8e] text-center leading-5 m-0 font-['IBM_Plex_Mono']",children:"This may take a few minutes."}),P&&e.jsx("p",{className:"text-xs font-mono text-[#005c75] text-center leading-5 m-0 max-w-xl",children:P}),m&&e.jsx("button",{onClick:()=>f(!0),className:"w-[148px] px-2.5 py-[5px] bg-[#005c75] text-white border-none rounded-sm text-xs font-medium cursor-pointer transition-colors hover:bg-[#004a5c] font-['IBM_Plex_Sans']",children:"View full logs"})]})});if(!j&&n&&!g){if(d.length>0){const a=d.length===1?((se=d[0])==null?void 0:se.message)||"An error occurred during analysis.":`${d.length} errors occurred during analysis.`;return e.jsx("div",{className:"flex-1 flex flex-col justify-center items-center px-5",style:{minHeight:"75vh"},children:e.jsxs("div",{className:"w-full flex flex-col gap-4",style:{maxWidth:"600px"},children:[e.jsx("div",{className:"p-4 rounded",style:{backgroundColor:E.background,border:`2px solid ${E.border}`},role:"alert",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ae,{size:24,className:"shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("p",{className:"m-0 font-['IBM_Plex_Sans']",style:{fontSize:"14px",lineHeight:"20px",color:E.text},children:[e.jsx("span",{className:"font-semibold",children:"Analysis Error."})," ",a," ",e.jsx("button",{onClick:()=>f(!0),className:"underline cursor-pointer bg-transparent border-none p-0 font-medium hover:opacity-80",style:{color:E.link},children:"See logs"})," ","for details."]})})]})}),e.jsx("div",{className:"bg-white border rounded-lg",style:{borderColor:"#e1e1e1"},children:e.jsx(D,{analysisId:t==null?void 0:t.id})})]})})}return e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center bg-[#f6f9fc]",children:e.jsxs("div",{className:"max-w-[600px]",children:[e.jsx("h2",{className:"text-[28px] font-semibold text-[#343434] mb-4 m-0 leading-10",children:"No simulations yet"}),e.jsx("p",{className:"text-base font-normal text-[#3e3e3e] mb-8 leading-6 m-0",children:"Analyze the code to create simulations and create test scenarios automatically."}),n.filePath&&e.jsx("button",{onClick:()=>{h.submit({entitySha:n.sha,filePath:n.filePath},{method:"post",action:"/api/analyze"})},disabled:h.state!=="idle",className:"h-[54px] w-[183px] px-2.5 py-[5px] bg-[#005c75] text-white border-none rounded-lg text-base font-medium cursor-pointer transition-all hover:bg-[#004a5e] disabled:bg-gray-400 disabled:cursor-not-allowed",children:h.state!=="idle"?"Analyzing...":"Analyze"})]})})}return e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center",children:e.jsx("p",{className:"text-base text-gray-500 m-0",children:"Select a scenario to view its screenshot"})})}const he=o==="screenshot"&&(r||$)||o==="interactive"&&(z||q)||o==="data",ue=(g||F)&&!r&&!$&&o==="screenshot";return e.jsxs(e.Fragment,{children:[e.jsx("main",{className:"flex-1 bg-[#f9f9f9] overflow-auto flex flex-col min-w-0",children:ue?e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center bg-linear-to-br from-blue-50 to-indigo-50",children:e.jsxs("div",{className:"max-w-2xl w-full bg-white rounded-t-2xl shadow-xl p-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-24 h-24 bg-blue-100 rounded-full mb-6",children:e.jsx("span",{className:"text-5xl animate-spin",children:"⚙️"})}),e.jsx("h2",{className:"text-3xl font-bold text-gray-900 mb-4 m-0",children:F?`Capturing ${n==null?void 0:n.name}`:`Analyzing ${n==null?void 0:n.name}`}),e.jsx("p",{className:"text-base text-gray-600 leading-relaxed m-0 mb-2",children:F?`Taking screenshots for ${((re=t==null?void 0:t.scenarios)==null?void 0:re.length)||0} scenario${((ne=t==null?void 0:t.scenarios)==null?void 0:ne.length)!==1?"s":""}...`:`Generating simulations and scenarios for this ${n==null?void 0:n.entityType} entity...`}),s&&e.jsxs("p",{className:"text-sm text-blue-600 font-semibold m-0",children:["Currently processing: ",s.name]})]}),P&&e.jsx("div",{className:"bg-[#f6f9fc] border-2 border-[#e1e1e1] rounded-lg p-6 mb-6",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("span",{className:"text-xl shrink-0",children:"📝"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-xs font-semibold text-gray-700 uppercase tracking-wide mb-2 m-0",children:"Current Progress"}),e.jsx("p",{className:"text-sm text-gray-900 font-mono wrap-break-word m-0",title:P,children:P})]})]})}),m&&e.jsx("button",{onClick:()=>f(!0),className:"px-6 py-3 bg-[#005c75] text-white border-none rounded-lg text-base font-semibold cursor-pointer transition-all hover:bg-[#004a5e] hover:shadow-lg",children:"📋 View Full Logs"}),e.jsx("p",{className:"text-xs text-gray-500 mt-8 m-0",children:"Screenshots will appear here as they are captured. This may take a few minutes."})]})}):he?e.jsxs(e.Fragment,{children:[$&&!r&&e.jsx("div",{className:"flex-1 flex flex-col justify-center items-center p-6",children:e.jsxs("div",{className:"w-full flex flex-col gap-4",style:{maxWidth:"600px"},children:[e.jsx("div",{className:"p-4 rounded overflow-auto",style:{backgroundColor:E.background,border:`2px solid ${E.border}`,maxHeight:"50vh"},role:"alert",children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2 font-bold",style:{color:E.text},children:[e.jsx(ae,{size:24,className:"shrink-0"}),e.jsx("div",{children:"Capture Error"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("button",{onClick:()=>f(!0),className:"underline cursor-pointer bg-transparent border-none p-0 font-medium hover:opacity-80",style:{color:E.link},children:"See logs"})," ","for details."]}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx("div",{className:"m-0 font-['IBM_Plex_Sans']",style:{fontSize:"14px",lineHeight:"20px",color:E.text},children:$})})]})}),e.jsx("div",{className:"bg-white border rounded-lg",style:{borderColor:"#e1e1e1"},children:e.jsx(D,{scenarioId:s==null?void 0:s.id,analysisId:t==null?void 0:t.id})})]})}),o==="interactive"?e.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[z&&e.jsxs("div",{className:"bg-gray-50 border-b border-gray-200 px-6 py-3 shrink-0 flex justify-center items-center gap-4",children:[e.jsx(_e,{presets:[...V],customSizes:I,currentWidth:c.width,currentHeight:c.height??900,scale:M,onSizeChange:H,onSaveCustomSize:()=>b(!0),onRemoveCustomSize:R}),s&&n&&e.jsxs(oe,{to:`/entity/${n.sha}/scenarios/${s.id}/fullscreen?from=${encodeURIComponent(`/entity/${n.sha}/scenarios/${s.id}/interactive`)}`,className:"flex items-center gap-2 px-4 py-2 bg-[#005c75] text-white rounded hover:bg-[#004a5c] transition-colors text-sm font-medium no-underline",title:"Open in fullscreen",children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M2 5V2H5M11 2H14V5M14 11V14H11M5 14H2V11",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),"Fullscreen"]})]}),z&&e.jsx("div",{className:"bg-[#f6f9fc] border-b border-[rgba(0,92,117,0.25)] flex justify-center",children:e.jsx("div",{style:{maxWidth:`${V[V.length-1].width}px`,width:"100%"},children:e.jsx(be,{currentViewportWidth:y,currentPresetName:c.name,onDevicePresetClick:O,devicePresets:B})})}),e.jsx(pe,{scenarioId:s.id,scenarioName:s.name,iframeUrl:z,isStarting:q,isLoading:ce,showIframe:de,iframeKey:xe,onIframeLoad:me,onScaleChange:S,onDimensionChange:A,projectSlug:m,defaultWidth:c.width,defaultHeight:c.height})]}):o==="data"?e.jsx("div",{className:"flex-1 min-h-0",children:e.jsx(Se,{scenario:s,analysis:t,entity:n})}):e.jsx("div",{className:"flex-1 flex flex-col",children:e.jsx("div",{className:"flex-1 p-6 flex items-center justify-center",children:e.jsx("div",{className:"transition-all duration-300",style:{maxWidth:`${y}px`},children:(r||!$)&&e.jsx(Ne,{screenshotPath:r,cacheBuster:v,alt:s.name,className:"w-full rounded-lg shadow-[0_10px_25px_rgba(0,0,0,0.1)] bg-white"})})})})]}):e.jsx("div",{className:"flex-1 flex flex-col",children:e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 overflow-auto w-full",children:g&&!r?e.jsx("div",{className:"w-full h-full flex items-center justify-center",children:e.jsx("div",{className:"bg-blue-50 border-2 border-blue-200 rounded-lg p-8",children:e.jsxs("div",{className:"flex items-start gap-4 mb-6",children:[e.jsx("span",{className:"animate-spin text-4xl shrink-0",children:"⚙️"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-xl font-semibold text-blue-900 m-0 mb-3",children:"Capturing Screenshot"}),e.jsxs("p",{className:"text-sm text-blue-800 m-0 mb-4",children:["Analysis is in progress for"," ",e.jsx("strong",{children:s.name}),". The screenshot will appear here once capture is complete."]}),P&&e.jsxs("div",{className:"bg-white border border-blue-200 rounded p-4 mt-4",children:[e.jsx("h4",{className:"text-xs font-semibold text-blue-800 m-0 mb-2 uppercase tracking-wide",children:"Current Progress"}),e.jsx("p",{className:"text-sm text-blue-900 m-0 font-mono wrap-break-word",children:P})]}),m&&e.jsx("button",{onClick:()=>f(!0),className:"mt-4 px-4 py-2 bg-[#005c75] text-white border-none rounded-md text-sm font-semibold cursor-pointer transition-colors hover:bg-[#004a5e]",children:"📋 View Full Logs"})]})]})})}):$?e.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center overflow-auto gap-6",children:[!k&&e.jsx("div",{className:"bg-blue-50 border-2 border-blue-300 rounded-lg p-8",children:e.jsxs("div",{className:"flex-1 flex flex-col gap-4 items-center justify-center",children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("span",{className:"text-blue-600 text-2xl shrink-0",children:"🔑"}),e.jsx("h3",{className:"text-xl font-semibold text-blue-900 m-0 mb-3",children:"Improve Analysis Quality with an API Key"})]}),e.jsxs("div",{className:"bg-white border border-blue-200 rounded p-4",children:[e.jsx("h4",{className:"text-xs font-semibold text-blue-900 m-0 mb-2 uppercase tracking-wide",children:"CodeYam requires an AI API key for reliable analysis."}),e.jsxs("ul",{className:"text-sm text-blue-800 m-0 space-y-1 pl-5 list-disc",children:[e.jsx("li",{children:"You can use API keys for a variety of models"}),e.jsx("li",{children:"Faster analysis processing"}),e.jsx("li",{children:"Better handling of complex code structures"}),e.jsx("li",{children:"Improved scenario generation quality"})]})]}),e.jsx(oe,{to:"/settings",className:"inline-block px-4 py-2 bg-blue-600 text-white border-none rounded-md text-sm font-semibold cursor-pointer transition-colors hover:bg-blue-700",children:"🔐 Configure API Keys"})]})}),e.jsx("div",{className:"bg-red-50 border-2 border-red-300 rounded-lg p-8 w-full max-w-4xl my-auto",children:e.jsxs("div",{className:"flex items-start gap-4 mb-6",children:[e.jsx("span",{className:"text-red-500 text-4xl shrink-0",children:"⚠️"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-xl font-semibold text-red-800 m-0 mb-3",children:"Capture Failed"}),e.jsx("p",{className:"text-sm text-red-700 m-0 mb-4",children:"An error occurred while capturing this scenario. No screenshot is available."}),e.jsxs("div",{className:"bg-white border border-red-200 rounded p-4",children:[e.jsx("h4",{className:"text-xs font-semibold text-red-800 m-0 mb-2 uppercase tracking-wide",children:"Error Message"}),e.jsx("div",{className:"max-h-[300px] overflow-auto",children:e.jsx("p",{className:"text-sm text-red-900 m-0 font-mono whitespace-pre-wrap wrap-break-word",children:$})})]}),U&&e.jsxs("details",{className:"mt-4",children:[e.jsx("summary",{className:"text-sm text-red-700 cursor-pointer hover:text-red-900 font-semibold",children:"📋 View full stack trace"}),e.jsx("div",{className:"mt-3 bg-white border border-red-200 rounded p-4 overflow-auto",children:e.jsx("pre",{className:"text-xs text-red-900 font-mono whitespace-pre-wrap wrap-break-word m-0",children:U})})]}),e.jsx("div",{className:"mt-4 bg-white border rounded-lg",style:{borderColor:"#e1e1e1"},children:e.jsx(D,{scenarioId:s==null?void 0:s.id,analysisId:t==null?void 0:t.id})})]})]})})]}):d.length>0?e.jsx("div",{className:"w-full h-full flex items-center justify-center overflow-auto",children:e.jsx("div",{className:"bg-red-50 border-2 border-red-300 rounded-lg p-8 w-full max-w-4xl my-auto",children:e.jsxs("div",{className:"flex items-start gap-4 mb-6",children:[e.jsx("span",{className:"text-red-500 text-4xl shrink-0",children:"⚠️"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx(AnalysisErrorDisplay,{errors:d,title:"Analysis Error",description:d.length===1?"An error occurred during analysis. Screenshot capture was not completed.":`${d.length} errors occurred during analysis. Screenshot capture was not completed.`}),e.jsx("div",{className:"mt-4 bg-white border rounded-lg",style:{borderColor:"#e1e1e1"},children:e.jsx(D,{scenarioId:s==null?void 0:s.id,analysisId:t==null?void 0:t.id})})]})]})})}):e.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[e.jsx("span",{className:"text-6xl text-gray-300",children:"📷"}),e.jsx("p",{className:"text-lg text-gray-500 m-0",children:"No screenshot available for this scenario"}),e.jsx("p",{className:"text-sm text-gray-400 m-0",children:"Try recapturing or debugging this scenario"})]})})})}),u&&m&&e.jsx(we,{projectSlug:m,onClose:()=>f(!1)}),w&&e.jsx(je,{width:c.width,height:c.height??900,onSave:W,onCancel:()=>b(!1)})]})}export{D as C,ae as E,We as S};
@@ -1,11 +0,0 @@
1
- import{w as le,u as ae,c as ne,f as re,r as d,j as e,L as h}from"./chunk-JMJ3UQ3L-BambyYE_.js";import{u as oe}from"./useLastLogLine-BqPPNjAl.js";import{u as ie}from"./useToast-DWHcCcl1.js";import{u as ce}from"./useReportContext-DsJbgMY9.js";import{L as de}from"./LogViewer-wDPcZNKx.js";import{I as j,C as R,E as xe}from"./EntityTypeIcon-CXFKsCOD.js";import{S as U}from"./SafeScreenshot-BfmDgXxG.js";import{c as Z}from"./createLucideIcon-CgUsG7ib.js";import{C as me}from"./circle-check-CaVsIRxt.js";import{L as C}from"./loader-circle-CNp9QFCX.js";/**
2
- * @license lucide-react v0.556.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const he=[["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"}]],pe=Z("folder-open",he);/**
7
- * @license lucide-react v0.556.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const ue=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],ge=Z("zap",ue),ye="/assets/codeyam-name-logo-CvKwUgHo.svg",Te=()=>[{title:"Dashboard - CodeYam"},{name:"description",content:"CodeYam project dashboard"}],Le=le(function(){var W,I;const{stats:v,uncommittedFiles:y,uncommittedEntitiesList:k,recentSimulations:p,visualEntitiesForSimulation:i,projectSlug:u,queueState:A,currentCommit:S}=ae(),o=ne(),q=re(),{showToast:x}=ie();ce({source:"dashboard"});const[Q,Y]=d.useState(new Set),[c,$]=d.useState(null),[O,M]=d.useState(!1),[B,E]=d.useState(!1),{lastLine:F,isCompleted:D,resetLogs:G}=oe(u,!!c),{simulatingEntity:f,scenarios:N,scenarioStatuses:K,allScenariosCaptured:T}=d.useMemo(()=>{var r,w;const s={simulatingEntity:null,scenarios:[],scenarioStatuses:[],allScenariosCaptured:!1};if(!c)return s;const t=i==null?void 0:i.find(z=>z.sha===c);if(!t)return s;const l=(r=t.analyses)==null?void 0:r[0],n=(l==null?void 0:l.scenarios)||[],a=((w=l==null?void 0:l.status)==null?void 0:w.scenarios)||[],g=a.filter(z=>z.screenshotFinishedAt).length,m=n.length>0&&g===n.length;return{simulatingEntity:t,scenarios:n,scenarioStatuses:a,allScenariosCaptured:m}},[c,i]);d.useEffect(()=>{(D||T)&&$(null)},[D,T]);const L=(W=S==null?void 0:S.metadata)==null?void 0:W.currentRun,V=new Set((L==null?void 0:L.currentEntityShas)||[]),_=new Set(A.jobs.flatMap(s=>s.entityShas||[])),H=new Set(((I=A.currentlyExecuting)==null?void 0:I.entityShas)||[]),P=k.filter(s=>s.entityType==="visual"||s.entityType==="library"),b=P.filter(s=>!V.has(s.sha)&&!_.has(s.sha)&&!H.has(s.sha)),X=()=>{if(b.length===0){x("All entities are already queued or analyzing","info",3e3);return}const s=b.map(t=>t.sha);E(!0),x(`Starting analysis for ${b.length} entities...`,"info",3e3),o.submit({entityShas:s.join(",")},{method:"post",action:"/api/analyze"})};d.useEffect(()=>{if(o.state==="idle"&&o.data){const s=o.data;s.success?(console.log("[Analyze All] Success:",s.message),x(`Analysis started for ${s.entityCount} entities in ${s.fileCount} files. Watch the logs for progress.`,"success",6e3),E(!1)):s.error&&(console.error("[Analyze All] Error:",s.error),x(`Error: ${s.error}`,"error",8e3),E(!1))}},[o.state,o.data,x]);const J=(s,t)=>{console.log("Simulating entity:",s);const l=i==null?void 0:i.find(n=>n.sha===s);$(s),G(),x(`Starting analysis for ${(l==null?void 0:l.name)||"entity"}...`,"info",3e3),o.submit({entitySha:s,filePath:t},{method:"post",action:"/api/analyze"})},ee=s=>{Y(t=>{const l=new Set(t);return l.has(s)?l.delete(s):l.add(s),l})},se=d.useMemo(()=>{const s=new Map;return p.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}))},[p]),te=[{label:"Total Entities",value:v.totalEntities,iconType:"folder",link:"/files",color:"#F59E0B"},{label:"Analyzed Entities",value:v.entitiesWithAnalyses,iconType:"check",link:"/simulations",color:"#10B981"},{label:"Visual Components",value:v.visualEntities,iconType:"image",link:"/files?entityType=visual",color:"#8B5CF6"},{label:"Library Functions",value:v.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:"px-20 py-12",children:[e.jsxs("header",{className:"mb-8 flex justify-between items-center",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("img",{src:ye,alt:"CodeYam",className:"h-3.5"}),e.jsx("span",{className:"text-gray-400 text-sm",children:"|"}),e.jsxs("h1",{className:"text-sm font-normal text-gray-600 m-0",children:["Overview of"," ",e.jsx("span",{className:"font-semibold",children:u?u.replace(/-/g," ").replace(/\b\w/g,s=>s.toUpperCase()):"Project"})]})]}),q.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:te.map((s,t)=>e.jsx(h,{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 cursor-pointer",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 sm: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 shrink-0",style:{backgroundColor:`${s.color}15`},children:[s.iconType==="folder"&&e.jsx(pe,{size:20,style:{color:s.color}}),s.iconType==="check"&&e.jsx(me,{size:20,style:{color:s.color}}),s.iconType==="image"&&e.jsx(j,{size:20,style:{color:s.color}}),s.iconType==="code-xml"&&e.jsx(R,{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:y.length>0?`${y.length} file${y.length!==1?"s":""} with ${k.length} uncommitted entit${k.length!==1?"ies":"y"}`:"No uncommitted changes detected"})]}),P.length>0&&e.jsx("button",{onClick:X,disabled:o.state!=="idle"||B||b.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:o.state!=="idle"||B?"Starting analysis...":b.length===0?"All Queued":"Analyze All"})]}),y.length>0?e.jsx("div",{className:"flex flex-col gap-3",children:y.map(([s,t])=>{const l=Q.has(s),n=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:()=>ee(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:[n.length," entit",n.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:n.length>0?n.map(a=>{const g=V.has(a.sha),m=_.has(a.sha)||H.has(a.sha);return e.jsxs(h,{to:`/entity/${a.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:a.entityType==="visual"?"#8B5CF615":a.entityType==="library"?"#6366F1":"#EC4899"},children:[a.entityType==="visual"&&e.jsx(j,{size:16,style:{color:"#8B5CF6"}}),a.entityType==="library"&&e.jsx(R,{size:16,className:"text-white"}),a.entityType==="other"&&e.jsx(ge,{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:a.name}),a.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"}),a.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"}),a.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"})]}),a.description&&e.jsx("div",{className:"text-sm text-gray-500 mt-1 overflow-hidden text-ellipsis whitespace-nowrap",children:a.description})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[g&&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(C,{size:14,className:"animate-spin"}),"Analyzing..."]}),!g&&m&&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"}),!g&&!m&&e.jsx("button",{onClick:r=>{r.preventDefault(),r.stopPropagation(),x(`Starting analysis for ${a.name}...`,"info",3e3),o.submit({entityShas:a.sha},{method:"post",action:"/api/analyze"})},disabled:o.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"})]})]},a.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-50 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:p.length>0?`Latest ${p.length} captured screenshot${p.length!==1?"s":""}`:"No simulations captured yet"})]})}),p.length>0&&!c?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-6 mb-5",children:se.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(j,{size:16,style:{color:"#8B5CF6"}})}),e.jsx(h,{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(h,{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:n=>{n.currentTarget.style.borderColor="#005C75",n.currentTarget.style.boxShadow="0 4px 12px rgba(0, 92, 117, 0.2)"},onMouseLeave:n=>{n.currentTarget.style.borderColor="#E5E7EB",n.currentTarget.style.boxShadow="none"},title:`${t.scenarioName}`,children:e.jsx(U,{screenshotPath:t.screenshotPath,alt:t.scenarioName,className:"max-w-full max-h-full object-contain object-center"})},l))})]},s.entitySha))}),e.jsx(h,{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 →"})]}):c?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(xe,{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})]})]})}),T?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":"",")"]})]}):F?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(C,{size:18,className:"animate-spin shrink-0"}),e.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap font-mono text-xs",title:F,children:F}),u&&e.jsx("button",{onClick:()=>M(!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"})]}):o.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(C,{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(C,{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)=>{var m,r;const l=(r=(m=s.metadata)==null?void 0:m.screenshotPaths)==null?void 0:r[0],n=K.find(w=>w.name===s.name),a=(n==null?void 0:n.screenshotStartedAt)&&!(n!=null&&n.screenshotFinishedAt);return l?e.jsx(h,{to:`/entity/${c}`,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(U,{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:a?"animate-pulse":"text-gray-400",children:a?"⋯":"⏹️"})},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-50",children:[e.jsx("div",{className:"mb-4 bg-[#efefef] rounded-lg p-3",children:e.jsx(j,{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."})]}),((i==null?void 0:i.length)??0)>0?e.jsx(e.Fragment,{children:e.jsx("div",{className:"flex flex-col gap-3 mt-6 w-full",children:(c&&f?[f]:i||[]).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(h,{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(j,{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:()=>J(s.sha,s.filePath||""),disabled:o.state!=="idle"||c!==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:c?"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"})]})]})]}),O&&u&&e.jsx(de,{projectSlug:u,onClose:()=>M(!1)})]})})});export{Le as default,Te as meta};
@@ -1,32 +0,0 @@
1
- import{j as e,w as G,u as X,h as Z,r as L,L as v,f as R}from"./chunk-JMJ3UQ3L-BambyYE_.js";import{L as ee}from"./LogViewer-wDPcZNKx.js";import{u as te}from"./useLastLogLine-BqPPNjAl.js";import{u as se}from"./useReportContext-DsJbgMY9.js";import{E as I}from"./EntityTypeIcon-CXFKsCOD.js";import{E as Q}from"./EntityTypeBadge-CzGX-miz.js";import{S as K}from"./SafeScreenshot-BfmDgXxG.js";import{L as ie}from"./LoadingDots-D1CdlbrV.js";import{L as le}from"./loader-circle-CNp9QFCX.js";import{c as O}from"./createLucideIcon-CgUsG7ib.js";/**
2
- * @license lucide-react v0.556.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const oe=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ae=O("ban",oe);/**
7
- * @license lucide-react v0.556.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const re=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]],J=O("circle-pause",re);/**
12
- * @license lucide-react v0.556.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */const ne=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],ce=O("file-code",ne);/**
17
- * @license lucide-react v0.556.0 - ISC
18
- *
19
- * This source code is licensed under the ISC license.
20
- * See the LICENSE file in the root directory of this source tree.
21
- */const de=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],xe=O("grip-vertical",de);/**
22
- * @license lucide-react v0.556.0 - ISC
23
- *
24
- * This source code is licensed under the ISC license.
25
- * See the LICENSE file in the root directory of this source tree.
26
- */const he=[["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"}]],pe=O("list-todo",he),fe={analyzer:{bgColor:"#e1e1e1",textColor:"#3e3e3e",borderColor:"#e1e1e1"},capture:{bgColor:"#e1e1e1",textColor:"#3e3e3e",borderColor:"#e1e1e1"},running:{bgColor:"#e8ffe6",textColor:"#00925d",borderColor:"#c3f3bf"},error:{bgColor:"#fee2e2",textColor:"#991b1b",borderColor:"#fecaca"}};function F({variant:a,pid:t,label:b,className:n=""}){const c=fe[a],l=b||(a==="analyzer"&&t?`Analyzer: ${t}`:a==="capture"&&t?`Capture: ${t}`:a==="running"?"Running":a==="error"?"Error":"");return e.jsx("div",{className:`inline-flex items-center justify-center px-[8px] rounded-[4px] ${n}`,style:{backgroundColor:c.bgColor,borderWidth:"1px",borderStyle:"solid",borderColor:c.borderColor,height:"20px"},children:e.jsx("span",{className:"font-['IBM_Plex_Sans']",style:{fontSize:"10px",fontWeight:400,lineHeight:"15px",color:c.textColor},children:l})})}function ge({activeTab:a,hasCurrentActivity:t,queuedCount:b,historicCount:n}){const c=[{id:"current",label:"Current Activity",hasContent:t,count:t?1:null},{id:"queued",label:"Queued Activity",hasContent:b>0,count:b},{id:"historic",label:"Historic Activity",hasContent:n>0,count:n}];return e.jsx("div",{className:"border-b border-gray-200 mb-6",children:e.jsx("nav",{className:"flex gap-8",children:c.map(l=>{const d=a===l.id;return e.jsx(v,{to:l.id==="current"?"/activity":`/activity/${l.id}`,className:`
27
- relative pb-4 px-2 text-sm font-medium transition-colors cursor-pointer
28
- ${d?"border-b-2":"text-gray-500 hover:text-gray-700"}
29
- `,style:d?{color:"#005C75",borderColor:"#005C75"}:{},children:e.jsxs("span",{className:"flex items-center gap-2",children:[l.label,l.count!==null&&l.count>0&&e.jsx("span",{className:`inline-flex items-center justify-center px-2 py-0.5 text-xs font-semibold rounded-full ${d?"bg-[#cbf3fa] text-[#005c75]":"bg-[#e1e1e1] text-[#3e3e3e]"}`,children:l.count}),l.count===null&&l.hasContent&&e.jsx("span",{className:`
30
- inline-block w-2 h-2 rounded-full
31
- ${d?"":"bg-gray-400"}
32
- `,style:d?{backgroundColor:"#005C75"}:{}})]})},l.id)})})})}function me({currentlyExecuting:a,currentRun:t,state:b,projectSlug:n,commitSha:c,onShowLogs:l,recentCompletedEntities:d,hasMoreCompletedRuns:x,currentEntityScenarios:y,currentEntityForScenarios:N,currentAnalysisStatus:m}){var V,q,B,U;const[u,j]=L.useState({}),[T,H]=L.useState({isKilling:!1,current:0,total:0}),s=R(),r=!!a,h=(a==null?void 0:a.entities)||[],S=!!(t!=null&&t.analysisCompletedAt),A=S&&!!(t!=null&&t.capturePid),w=!S,E=r,$=y||[],{lastLine:M}=te(n,E);L.useEffect(()=>{if(!t)return;const i=[t.analyzerPid,t.capturePid].filter(o=>!!o);if(i.length===0)return;let f=!0;const C=async()=>{try{const k=await(await fetch(`/api/process-status?pids=${i.join(",")}`)).json();if(k.processes&&f){const z={};k.processes.forEach(P=>{z[P.pid]={isRunning:P.isRunning,processName:P.processName}}),j(z)}}catch(o){f&&console.error("Failed to fetch process statuses:",o)}};C();const p=setInterval(()=>void C(),5e3);return()=>{f=!1,clearInterval(p)}},[t==null?void 0:t.analyzerPid,t==null?void 0:t.capturePid]);const g=h==null?void 0:h[0];return e.jsxs("div",{className:"flex flex-col gap-[45px]",children:[E?e.jsxs("div",{className:"rounded-[10px] p-[15px]",style:{backgroundColor:"#f6f9fc",border:"2px solid #e0e9ec"},children:[e.jsxs("div",{className:"flex items-center gap-2 mb-[15px]",children:[e.jsx(le,{size:14,strokeWidth:2.5,className:"animate-spin",style:{color:"#005c75"}}),e.jsx("span",{className:"font-medium",style:{fontSize:"14px",lineHeight:"18px",color:"#005c75"},children:A?"Capturing...":"Analyzing..."})]}),g&&e.jsxs("div",{className:"bg-white border border-[#e1e1e1] rounded-[4px] mb-[15px]",style:{height:"60px",padding:"0 15px",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs("div",{className:"inline-grid place-items-start relative",style:{gridTemplateColumns:"max-content",gridTemplateRows:"max-content",lineHeight:0},children:[e.jsx("div",{className:"relative",style:{gridArea:"1 / 1",marginLeft:"10px",marginTop:"8.97px"},children:e.jsx("div",{style:{transform:"scale(1.33)"},children:e.jsx(I,{type:g.entityType||"other"})})}),e.jsxs("div",{className:"flex flex-col gap-[1px] relative",style:{gridArea:"1 / 1",marginLeft:"49px",marginTop:"0"},children:[e.jsxs("div",{className:"flex items-center gap-[14px]",children:[e.jsx(v,{to:`/entity/${g.sha}`,className:"hover:underline cursor-pointer",style:{fontSize:"14px",lineHeight:"18px",fontWeight:500,color:"#000"},children:g.name}),g.entityType&&e.jsx(Q,{type:g.entityType})]}),e.jsx("div",{className:"truncate",style:{fontSize:"12px",lineHeight:"15px",color:"#8e8e8e",width:"422px"},title:g.filePath,children:g.filePath})]})]}),e.jsx("button",{onClick:l,className:"px-[10px] rounded-[4px] transition-colors whitespace-nowrap cursor-pointer",style:{backgroundColor:"#e0e9ec",color:"#005c75",fontSize:"10px",lineHeight:"22px",fontWeight:600},children:"View Logs"})]}),A&&$&&$.length>0&&N&&e.jsx("div",{className:"flex gap-[10px] overflow-x-auto mb-[15px]",children:$.map(i=>{var P,W,D,_;if(!i.id)return null;const f=(W=(P=i.metadata)==null?void 0:P.screenshotPaths)==null?void 0:W[0],C=(D=i.metadata)==null?void 0:D.noScreenshotSaved,p=f&&!C,o=(_=m==null?void 0:m.scenarios)==null?void 0:_.find(Y=>Y.name===i.name),z=o&&o.screenshotStartedAt&&!o.screenshotFinishedAt||!p&&!C;return e.jsx(v,{to:`/entity/${N.sha}/scenarios/${i.id}`,className:"border border-solid rounded-[6px] overflow-hidden flex-shrink-0 cursor-pointer",style:{width:"160px",height:"90px",backgroundColor:z?"#f9f9f9":void 0,borderColor:z?"#efefef":"#ccc"},children:p?e.jsx(K,{screenshotPath:f,alt:i.name,className:"w-full h-full object-contain bg-gray-100"}):z?e.jsx("div",{className:"w-full h-full flex items-center justify-center",children:e.jsx(ie,{size:"medium"})}):e.jsx("div",{className:"w-full h-full bg-gray-100 flex items-center justify-center text-xs text-gray-400",children:"No preview"})},i.id)})}),M&&e.jsx("div",{className:"mb-[15px] font-['IBM_Plex_Mono']",style:{fontSize:"12px",lineHeight:"20px",fontWeight:500,color:"#005c75"},children:M}),e.jsx("div",{className:"mb-[15px]",style:{height:"1px",backgroundColor:"#e0e9ec"}}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{style:{fontSize:"12px",lineHeight:"15px",fontWeight:400,color:"#000"},children:["Running Processes:"," "]}),(t==null?void 0:t.analyzerPid)&&e.jsx(F,{variant:"analyzer",pid:t.analyzerPid}),(t==null?void 0:t.analyzerPid)&&(w||((V=u[t.analyzerPid])==null?void 0:V.isRunning))&&e.jsx(F,{variant:"running"}),(t==null?void 0:t.capturePid)&&e.jsx(F,{variant:"capture",pid:t.capturePid}),(t==null?void 0:t.capturePid)&&(A||((q=u[t.capturePid])==null?void 0:q.isRunning))&&e.jsx(F,{variant:"running"})]}),(((B=u[t==null?void 0:t.analyzerPid])==null?void 0:B.isRunning)||((U=u[t==null?void 0:t.capturePid])==null?void 0:U.isRunning))&&e.jsx("button",{onClick:()=>{const i=[t==null?void 0:t.analyzerPid,t==null?void 0:t.capturePid].filter(p=>{var o;return!!p&&((o=u[p])==null?void 0:o.isRunning)});if(i.length===0)return;const f=i.join(", ");if(!confirm(`Are you sure you want to kill all running processes (${f})?`))return;H({isKilling:!0,current:1,total:i.length}),(async()=>{for(let p=0;p<i.length;p++){const o=i[p];try{await fetch("/api/kill-process",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pid:o,commitSha:c||""})})}catch(k){console.error(`Failed to kill process ${o}:`,k)}p<i.length-1&&H({isKilling:!0,current:p+2,total:i.length})}H({isKilling:!1,current:0,total:0}),s.revalidate()})()},disabled:T.isKilling,className:"px-[8px] rounded-[4px] transition-colors whitespace-nowrap cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",style:{backgroundColor:"#991b1b",color:"white",fontSize:"12px",lineHeight:"15px",fontWeight:500,height:"27px",width:"114px"},children:T.isKilling?"Killing...":"Kill All Processes"})]})]}):e.jsxs("div",{className:"bg-[#efefef] rounded-xl p-8 text-center",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("div",{className:"p-[10px] bg-gray-200 rounded",children:e.jsx(J,{size:24,className:"text-gray-600"})})}),e.jsx("h3",{className:"font-semibold text-gray-700 mb-2",style:{fontSize:"16px",lineHeight:"24px"},children:"No Current Activity"}),e.jsxs("p",{className:"text-gray-500",style:{fontSize:"14px",lineHeight:"18px"},children:["There are no analyses currently running. Trigger an analysis from the"," ",e.jsx(v,{to:"/git",className:"text-[#005C75] underline hover:text-[#004a5e] font-medium cursor-pointer",children:"Git"})," ","or"," ",e.jsx(v,{to:"/files",className:"text-[#005C75] underline hover:text-[#004a5e] font-medium cursor-pointer",children:"Files"})," ","page."]})]}),d&&d.length>0&&e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold",style:{fontSize:"16px",lineHeight:"24px",color:"#343434",marginBottom:"16px"},children:"Recently Completed Analyses"}),e.jsx("div",{className:"flex flex-col gap-4",children:d.map(i=>{var p;const f=(p=i.analyses)==null?void 0:p[0],C=(f==null?void 0:f.scenarios)||[];return f==null||f.status,e.jsx("div",{className:"rounded-[8px] p-[15px]",style:{backgroundColor:"#f2fcf9",border:"2px solid #aff1a9"},children:e.jsxs("div",{className:"flex flex-col gap-[15px]",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"flex-shrink-0",style:{transform:"scale(1.33)",marginLeft:"10px"},children:e.jsx(I,{type:i.entityType||"other"})}),e.jsxs("div",{className:"flex flex-col flex-shrink-0",style:{marginLeft:"15px",gap:"4px"},children:[e.jsxs("div",{className:"flex items-center gap-[5px]",children:[e.jsx(v,{to:`/entity/${i.sha}`,className:"hover:underline cursor-pointer",title:i.name,style:{fontSize:"14px",lineHeight:"18px",color:"#343434",fontWeight:500},children:i.name}),e.jsx("div",{className:"flex items-center justify-center px-2 rounded",style:{height:"20px",backgroundColor:"#e8ffe6",color:"#00925d",fontSize:"12px",lineHeight:"16px",fontWeight:400},children:i.isUncommitted?"Modified":"Up to date"})]}),e.jsx("div",{style:{fontSize:"13px",lineHeight:"18px",color:"#646464",fontWeight:400,width:"422px"},className:"truncate",title:i.filePath,children:i.filePath})]}),e.jsx("div",{className:"flex-1"}),e.jsx("div",{className:"flex-shrink-0",children:e.jsx("button",{onClick:l,className:"px-[10px] rounded transition-colors whitespace-nowrap",style:{backgroundColor:"#e0e9ec",color:"#005c75",fontSize:"10px",lineHeight:"22px",fontWeight:600},onMouseEnter:o=>{o.currentTarget.style.backgroundColor="#d0dfe3"},onMouseLeave:o=>{o.currentTarget.style.backgroundColor="#e0e9ec"},children:"View Logs"})})]}),C.length>0?e.jsx("div",{className:"flex gap-[10px] overflow-x-auto",children:C.map(o=>{var W,D,_;if(!o.id)return null;const k=(D=(W=o.metadata)==null?void 0:W.screenshotPaths)==null?void 0:D[0],z=(_=o.metadata)==null?void 0:_.noScreenshotSaved,P=k&&!z;return e.jsx(v,{to:`/entity/${i.sha}/scenarios/${o.id}`,className:"border border-[#ccc] border-solid rounded-[6px] overflow-hidden flex-shrink-0 cursor-pointer",style:{width:"144px",height:"96px"},children:P?e.jsx(K,{screenshotPath:k,alt:o.name,className:"w-full h-full object-contain bg-gray-100"}):e.jsx("div",{className:"w-full h-full bg-gray-100 flex items-center justify-center text-xs text-gray-400",children:"No preview"})},o.id)})}):e.jsx("div",{className:"italic",style:{fontSize:"12px",color:"#646464"},children:"No scenarios available"})]})},i.sha)})})]})]})}function ye({queueJobs:a,state:t,currentRun:b}){if(!a||a.length===0)return e.jsxs("div",{className:"rounded-xl p-12 text-center",style:{backgroundColor:"#f3f3f3"},children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("div",{className:"p-[10px] rounded",style:{backgroundColor:"#e5e5e5"},children:e.jsx(pe,{size:24,style:{color:"#646464"}})})}),e.jsx("h3",{className:"font-semibold mb-2",style:{fontSize:"16px",lineHeight:"24px",color:"#343434"},children:"No Queued Jobs"}),e.jsx("p",{style:{fontSize:"14px",lineHeight:"18px",color:"#646464"},children:"Analysis jobs will appear here when they are queued but not yet started."})]});const[n,c]=L.useState(null),[l,d]=L.useState(null),[x,y]=L.useState(null),N=s=>{c(s)},m=(s,r)=>{s.preventDefault(),d(r)},u=async(s,r)=>{if(s.preventDefault(),n===null||n===r){c(null),d(null);return}const h=a[n],S=n<r?"down":"up",A=Math.abs(r-n);try{for(let w=0;w<A;w++)await fetch("/api/queue",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"reorder",jobId:h.id,direction:S})})}catch(w){console.error("Failed to reorder job:",w)}c(null),d(null)},j=()=>{c(null),d(null)},T=async s=>{if(confirm("Are you sure you want to cancel this job?"))try{await fetch("/api/queue",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"remove",jobId:s})}),window.location.reload()}catch(r){console.error("Failed to cancel job:",r)}},H=async()=>{if(confirm(`Are you sure you want to cancel all ${a.length} queued jobs?`))try{await fetch("/api/queue",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clear"})}),window.location.reload()}catch(s){console.error("Failed to cancel jobs:",s)}};return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h3",{className:"font-semibold",style:{fontSize:"16px",lineHeight:"24px",color:"#343434"},children:[a.length," Queued Job",a.length!==1?"s":""]}),a.length>0&&e.jsx("button",{onClick:()=>void H(),className:"px-[10px] py-0 rounded transition-colors cursor-pointer hover:bg-red-300",style:{backgroundColor:"#ffdcd9",color:"#ef4444",fontSize:"12px",fontWeight:500,height:"29px"},children:"Cancel All"})]}),e.jsx("div",{className:"flex flex-col gap-3",children:a.map((s,r)=>{var E,$,M;const h=(E=s.entities)==null?void 0:E[0],S=x===r,A=n===r,w=l===r;return e.jsxs("div",{className:"rounded-lg p-4 relative",style:{backgroundColor:"#f6f9fc",border:"2px solid #005C75",opacity:A?.5:1,transform:w&&n!==null&&n!==r?"translateY(-2px)":"translateY(0)",transition:"transform 0.2s ease, opacity 0.2s ease"},onMouseEnter:()=>y(r),onMouseLeave:()=>y(null),draggable:!0,onDragStart:g=>{N(r),g.dataTransfer.effectAllowed="move"},onDragOver:g=>m(g,r),onDrop:g=>void u(g,r),onDragEnd:j,children:[e.jsxs("div",{className:"absolute left-4 top-4 flex items-center gap-1.5 flex-shrink-0",children:[e.jsx(J,{size:16,style:{color:"#005C75"}}),e.jsxs("span",{style:{fontSize:"14px",fontWeight:500,lineHeight:"18px",color:"#005C75"},children:["Job ",r+1]})]}),e.jsx("div",{className:"bg-white rounded cursor-pointer mt-8",style:{border:"1px solid #e1e1e1",height:"60px"},children:e.jsxs("div",{className:"flex items-center justify-between h-full px-[15px]",children:[h?e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[e.jsx("div",{style:{transform:"scale(1.0)"},children:e.jsx(I,{type:h.entityType||"other"})}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(v,{to:`/entity/${h.sha}`,className:"hover:underline cursor-pointer",style:{fontSize:"14px",lineHeight:"18px",fontWeight:500,color:"#000"},children:h.name}),h.entityType&&e.jsx(Q,{type:h.entityType})]}),e.jsx("div",{style:{fontSize:"12px",lineHeight:"15px",color:"#8e8e8e"},children:h.filePath})]})]}):e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[e.jsx("div",{style:{transform:"scale(1.0)"},children:e.jsx(ce,{size:18,style:{color:"#8e8e8e"}})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{style:{fontSize:"14px",lineHeight:"18px",fontWeight:500,color:"#000"},children:(($=s.entityNames)==null?void 0:$[0])||(s.type==="analysis"?"Analysis Job":s.type==="recapture"?"Recapture Job":s.type==="debug-setup"?"Debug Setup":s.type.charAt(0).toUpperCase()+s.type.slice(1))}),e.jsx("div",{style:{fontSize:"12px",lineHeight:"15px",color:"#8e8e8e"},children:((M=s.filePaths)==null?void 0:M[0])||(s.filePaths&&s.filePaths.length>1?`${s.filePaths.length} files`:s.entityShas&&s.entityShas.length>0?`${s.entityShas.length} ${s.entityShas.length===1?"entity":"entities"}`:"Queued for processing")})]})]}),S&&e.jsx("div",{className:"mr-2 cursor-grab active:cursor-grabbing",style:{color:"#8e8e8e"},title:"Drag to reorder",children:e.jsx(xe,{size:20})}),e.jsx("button",{onClick:()=>void T(s.id),className:"transition-colors cursor-pointer hover:bg-red-100 rounded flex items-center justify-center",style:{fontSize:"10px",fontWeight:600,lineHeight:"22px",color:"#ef4444",backgroundColor:"#fef6f6",padding:"0 10px",height:"22px"},children:"Cancel"})]})})]},s.id)})})]})}function ue({historicalRuns:a,totalHistoricalRuns:t,currentPage:b,totalPages:n,tab:c,onShowLogs:l}){if(t===0)return e.jsxs("div",{className:"rounded-xl p-12 text-center",style:{backgroundColor:"#EFEFEF"},children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx(ae,{size:24,style:{color:"#646464"}})}),e.jsx("h3",{className:"font-semibold mb-2",style:{fontSize:"16px",lineHeight:"24px",color:"#343434"},children:"No Historic Activity"}),e.jsx("p",{style:{fontSize:"14px",lineHeight:"18px",color:"#646464"},children:"Completed analyses will appear here for historical reference."})]});const d=[];return a.forEach(x=>{x.entities&&x.entities.length>0&&x.entities.forEach(y=>{d.push({...y,runCreatedAt:x.createdAt})})}),e.jsx("div",{className:"flex flex-col gap-4",children:d.slice(0,20).map(x=>{var u;const y=(u=x.analyses)==null?void 0:u[0],N=(y==null?void 0:y.scenarios)||[],m=!x.isUncommitted;return e.jsxs("div",{className:"rounded-lg p-4",style:{backgroundColor:m?"#f2fcf9":"#fef9e7",border:"2px solid",borderColor:m?"#aff1a9":"#f9d689"},children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[e.jsx("div",{style:{transform:"scale(1.0)",marginTop:"2px"},children:e.jsx(I,{type:x.entityType||"other"})}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(v,{to:`/entity/${x.sha}`,className:"hover:underline cursor-pointer",style:{fontSize:"14px",lineHeight:"18px",fontWeight:500,color:"#343434"},children:x.name}),e.jsx("div",{className:"px-2 py-0.5 rounded",style:{backgroundColor:m?"#e8ffe6":"#fef3cd",color:m?"#00925d":"#a16207",fontSize:"12px",fontWeight:400},children:m?"Up to date":"Out of date"})]}),e.jsx("div",{style:{fontSize:"12px",lineHeight:"15px",color:"#646464"},children:x.filePath})]})]}),e.jsx("button",{onClick:l,className:"px-3 py-1 rounded transition-colors whitespace-nowrap cursor-pointer",style:{backgroundColor:"#e0e9ec",color:"#005c75",fontSize:"10px",fontWeight:600},children:"View Logs"})]}),N.length>0&&e.jsxs("div",{className:"flex gap-2 overflow-x-auto",children:[N.slice(0,8).map(j=>{var r,h,S;if(!j.id)return null;const T=(h=(r=j.metadata)==null?void 0:r.screenshotPaths)==null?void 0:h[0],H=(S=j.metadata)==null?void 0:S.noScreenshotSaved,s=T&&!H;return e.jsx(v,{to:`/entity/${x.sha}/scenarios/${j.id}`,className:"border border-gray-300 rounded overflow-hidden flex-shrink-0 cursor-pointer",style:{width:"120px",height:"80px"},children:s?e.jsx(K,{screenshotPath:T,alt:j.name,className:"w-full h-full object-cover bg-gray-100"}):e.jsx("div",{className:"w-full h-full bg-gray-100 flex items-center justify-center text-xs text-gray-400",children:"No preview"})},j.id)}),N.length>8&&e.jsxs("div",{className:"flex items-center justify-center flex-shrink-0",style:{width:"120px",height:"80px",fontSize:"12px",color:"#646464"},children:["+",N.length-8," more"]})]})]},`${x.sha}-${x.runCreatedAt}`)})})}const Te=G(function(){const t=X(),b=Z(),[n,c]=L.useState(!1);se({source:"activity-page"});const l=b.tab||"current";return t?e.jsxs("div",{className:"px-20 py-12",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-3xl font-semibold text-gray-900 mb-2",children:"Activity"}),e.jsx("p",{className:"text-gray-600",children:"View queued, current, and historical analysis activity."})]}),e.jsx(ge,{activeTab:l,hasCurrentActivity:t.hasCurrentActivity,queuedCount:t.queuedCount,historicCount:t.totalHistoricalRuns}),l==="current"&&e.jsx(me,{currentlyExecuting:t.currentlyExecuting,currentRun:t.currentRun,state:t.state,projectSlug:t.projectSlug,commitSha:t.commitSha,onShowLogs:()=>c(!0),recentCompletedEntities:t.recentCompletedEntities||[],hasMoreCompletedRuns:t.hasMoreCompletedRuns||!1,currentEntityScenarios:t.currentEntityScenarios||[],currentEntityForScenarios:t.currentEntityForScenarios,currentAnalysisStatus:t.currentAnalysisStatus}),l==="queued"&&e.jsx(ye,{queueJobs:t.queueJobs,state:t.state,currentRun:t.currentRun}),l==="historic"&&e.jsx(ue,{historicalRuns:t.historicalRuns,totalHistoricalRuns:t.totalHistoricalRuns,currentPage:t.currentPage,totalPages:t.totalPages,tab:l,onShowLogs:()=>c(!0)}),n&&t.projectSlug&&e.jsx(ee,{projectSlug:t.projectSlug,onClose:()=>c(!1)})]}):e.jsx("div",{className:"px-20 py-12",children:e.jsx("div",{className:"text-center",children:e.jsx("p",{className:"text-gray-600",children:"Loading..."})})})});export{Te as default};