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

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 (1199) hide show
  1. package/analyzer-template/.build-info.json +8 -8
  2. package/analyzer-template/log.txt +3 -3
  3. package/analyzer-template/package.json +27 -27
  4. package/analyzer-template/packages/ai/index.ts +21 -5
  5. package/analyzer-template/packages/ai/package.json +3 -3
  6. package/analyzer-template/packages/ai/src/lib/__mocks__/completionCall.ts +122 -0
  7. package/analyzer-template/packages/ai/src/lib/analyzeScope.ts +226 -24
  8. package/analyzer-template/packages/ai/src/lib/astScopes/arrayDerivationDetector.ts +199 -0
  9. package/analyzer-template/packages/ai/src/lib/astScopes/astScopeAnalyzer.ts +217 -13
  10. package/analyzer-template/packages/ai/src/lib/astScopes/conditionalEffectsExtractor.ts +644 -0
  11. package/analyzer-template/packages/ai/src/lib/astScopes/methodSemantics.ts +181 -23
  12. package/analyzer-template/packages/ai/src/lib/astScopes/patterns/forInStatementHandler.ts +10 -17
  13. package/analyzer-template/packages/ai/src/lib/astScopes/patterns/ifStatementHandler.ts +18 -0
  14. package/analyzer-template/packages/ai/src/lib/astScopes/patterns/switchStatementHandler.ts +15 -0
  15. package/analyzer-template/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.ts +181 -1
  16. package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +1215 -29
  17. package/analyzer-template/packages/ai/src/lib/astScopes/sharedPatterns.ts +28 -0
  18. package/analyzer-template/packages/ai/src/lib/astScopes/types.ts +265 -6
  19. package/analyzer-template/packages/ai/src/lib/completionCall.ts +247 -66
  20. package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +2020 -334
  21. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.ts +5 -1
  22. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.ts +205 -0
  23. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.ts +10 -2
  24. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.ts +16 -3
  25. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.ts +6 -4
  26. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.ts +54 -3
  27. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.ts +129 -20
  28. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/coerceObjectsToPrimitivesBySchema.ts +70 -0
  29. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.ts +62 -0
  30. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.ts +140 -14
  31. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.ts +179 -0
  32. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.ts +40 -30
  33. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.ts +393 -90
  34. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fixNullIdsBySchema.ts +129 -0
  35. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.ts +35 -0
  36. package/analyzer-template/packages/ai/src/lib/dataStructureChunking.ts +183 -0
  37. package/analyzer-template/packages/ai/src/lib/e2eDataTracking.ts +334 -0
  38. package/analyzer-template/packages/ai/src/lib/extractCriticalDataKeys.ts +120 -0
  39. package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarioData.ts +4 -3
  40. package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarios.ts +86 -149
  41. package/analyzer-template/packages/ai/src/lib/generateEntityDataStructure.ts +59 -3
  42. package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +1458 -65
  43. package/analyzer-template/packages/ai/src/lib/generateEntityScenarios.ts +200 -196
  44. package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +677 -0
  45. package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.ts +528 -0
  46. package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionals.ts +2484 -0
  47. package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.ts +239 -0
  48. package/analyzer-template/packages/ai/src/lib/guessScenarioDataFromDescription.ts +5 -5
  49. package/analyzer-template/packages/ai/src/lib/isolateScopes.ts +328 -7
  50. package/analyzer-template/packages/ai/src/lib/mergeJsonTypeDefinitions.ts +5 -0
  51. package/analyzer-template/packages/ai/src/lib/mergeStatements.ts +111 -87
  52. package/analyzer-template/packages/ai/src/lib/promptGenerators/collapseNullableObjects.ts +118 -0
  53. package/analyzer-template/packages/ai/src/lib/promptGenerators/gatherAttributesMap.ts +10 -7
  54. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.ts +1 -1
  55. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.ts +28 -170
  56. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChunkPrompt.ts +82 -0
  57. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateCriticalKeysPrompt.ts +103 -0
  58. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.ts +110 -6
  59. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.ts +14 -89
  60. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateMissingKeysPrompt.ts +58 -0
  61. package/analyzer-template/packages/ai/src/lib/promptGenerators/guessNewScenarioDataFromDescriptionGenerator.ts +11 -11
  62. package/analyzer-template/packages/ai/src/lib/promptGenerators/simplifyKeysForLLM.ts +391 -0
  63. package/analyzer-template/packages/ai/src/lib/resolvePathToControllable.ts +824 -0
  64. package/analyzer-template/packages/ai/src/lib/splitOutsideParentheses.ts +5 -1
  65. package/analyzer-template/packages/ai/src/lib/validateExecutionFlowPaths.ts +531 -0
  66. package/analyzer-template/packages/ai/src/lib/worker/SerializableDataStructure.ts +122 -3
  67. package/analyzer-template/packages/ai/src/lib/worker/analyzeScopeWorker.ts +114 -2
  68. package/analyzer-template/packages/analyze/index.ts +2 -0
  69. package/analyzer-template/packages/analyze/src/lib/FileAnalyzer.ts +65 -59
  70. package/analyzer-template/packages/analyze/src/lib/ProjectAnalyzer.ts +132 -33
  71. package/analyzer-template/packages/analyze/src/lib/analysisContext.ts +44 -4
  72. package/analyzer-template/packages/analyze/src/lib/asts/index.ts +7 -2
  73. package/analyzer-template/packages/analyze/src/lib/asts/nodes/getNodeType.ts +1 -0
  74. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.ts +19 -0
  75. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllEntityNodes.ts +19 -0
  76. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllExports.ts +11 -0
  77. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getImportsAnalysis.ts +8 -0
  78. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getResolvedModule.ts +49 -1
  79. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getSourceFilesForAllImports.ts +2 -1
  80. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +447 -255
  81. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +39 -4
  82. package/analyzer-template/packages/analyze/src/lib/files/analyze/findOrCreateEntity.ts +12 -0
  83. package/analyzer-template/packages/analyze/src/lib/files/analyze/gatherEntityMap.ts +4 -2
  84. package/analyzer-template/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.ts +33 -10
  85. package/analyzer-template/packages/analyze/src/lib/files/analyzeChange.ts +14 -14
  86. package/analyzer-template/packages/analyze/src/lib/files/analyzeEntity.ts +4 -4
  87. package/analyzer-template/packages/analyze/src/lib/files/analyzeInitial.ts +11 -12
  88. package/analyzer-template/packages/analyze/src/lib/files/analyzeRemixRoute.ts +4 -5
  89. package/analyzer-template/packages/analyze/src/lib/files/enums/steps.ts +1 -1
  90. package/analyzer-template/packages/analyze/src/lib/files/getImportedExports.ts +14 -12
  91. package/analyzer-template/packages/analyze/src/lib/files/scenarios/TransformationTracer.ts +1352 -0
  92. package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.ts +193 -76
  93. package/analyzer-template/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.ts +203 -41
  94. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.ts +28 -188
  95. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +355 -23
  96. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.ts +166 -0
  97. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarioData.ts +1 -0
  98. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarios.ts +2 -3
  99. package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +845 -72
  100. package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.ts +56 -11
  101. package/analyzer-template/packages/analyze/src/lib/files/scenarios/propagateArrayItemSchemas.ts +474 -0
  102. package/analyzer-template/packages/analyze/src/lib/files/setImportedExports.ts +2 -1
  103. package/analyzer-template/packages/analyze/src/lib/index.ts +1 -0
  104. package/analyzer-template/packages/analyze/src/lib/utils/getFileByPath.ts +19 -0
  105. package/analyzer-template/packages/aws/package.json +10 -10
  106. package/analyzer-template/packages/database/index.ts +1 -0
  107. package/analyzer-template/packages/database/package.json +4 -4
  108. package/analyzer-template/packages/database/src/lib/analysisBranchToDb.ts +1 -1
  109. package/analyzer-template/packages/database/src/lib/analysisToDb.ts +1 -1
  110. package/analyzer-template/packages/database/src/lib/branchToDb.ts +1 -1
  111. package/analyzer-template/packages/database/src/lib/commitBranchToDb.ts +1 -1
  112. package/analyzer-template/packages/database/src/lib/commitToDb.ts +1 -1
  113. package/analyzer-template/packages/database/src/lib/fileToDb.ts +1 -1
  114. package/analyzer-template/packages/database/src/lib/kysely/db.ts +22 -1
  115. package/analyzer-template/packages/database/src/lib/kysely/tables/commitsTable.ts +6 -0
  116. package/analyzer-template/packages/database/src/lib/kysely/tables/debugReportsTable.ts +17 -1
  117. package/analyzer-template/packages/database/src/lib/kysely/tables/editorScenariosTable.ts +138 -0
  118. package/analyzer-template/packages/database/src/lib/kysely/tables/labsRequestsTable.ts +52 -0
  119. package/analyzer-template/packages/database/src/lib/loadAnalyses.ts +58 -1
  120. package/analyzer-template/packages/database/src/lib/loadAnalysis.ts +13 -0
  121. package/analyzer-template/packages/database/src/lib/loadBranch.ts +16 -1
  122. package/analyzer-template/packages/database/src/lib/loadCommit.ts +11 -0
  123. package/analyzer-template/packages/database/src/lib/loadCommits.ts +58 -19
  124. package/analyzer-template/packages/database/src/lib/loadEntities.ts +26 -9
  125. package/analyzer-template/packages/database/src/lib/loadEntityBranches.ts +12 -0
  126. package/analyzer-template/packages/database/src/lib/loadReadyToBeCapturedAnalyses.ts +5 -6
  127. package/analyzer-template/packages/database/src/lib/projectToDb.ts +1 -1
  128. package/analyzer-template/packages/database/src/lib/saveFiles.ts +1 -1
  129. package/analyzer-template/packages/database/src/lib/scenarioToDb.ts +1 -1
  130. package/analyzer-template/packages/database/src/lib/updateCommitMetadata.ts +96 -152
  131. package/analyzer-template/packages/database/src/lib/updateFreshAnalysisStatus.ts +58 -42
  132. package/analyzer-template/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.ts +81 -65
  133. package/analyzer-template/packages/database/src/lib/userScenarioToDb.ts +1 -1
  134. package/analyzer-template/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.ts +29 -1
  135. package/analyzer-template/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.ts +33 -5
  136. package/analyzer-template/packages/github/dist/database/index.d.ts +1 -0
  137. package/analyzer-template/packages/github/dist/database/index.d.ts.map +1 -1
  138. package/analyzer-template/packages/github/dist/database/index.js +1 -0
  139. package/analyzer-template/packages/github/dist/database/index.js.map +1 -1
  140. package/analyzer-template/packages/github/dist/database/src/lib/analysisBranchToDb.js +1 -1
  141. package/analyzer-template/packages/github/dist/database/src/lib/analysisBranchToDb.js.map +1 -1
  142. package/analyzer-template/packages/github/dist/database/src/lib/analysisToDb.js +1 -1
  143. package/analyzer-template/packages/github/dist/database/src/lib/analysisToDb.js.map +1 -1
  144. package/analyzer-template/packages/github/dist/database/src/lib/branchToDb.js +1 -1
  145. package/analyzer-template/packages/github/dist/database/src/lib/branchToDb.js.map +1 -1
  146. package/analyzer-template/packages/github/dist/database/src/lib/commitBranchToDb.js +1 -1
  147. package/analyzer-template/packages/github/dist/database/src/lib/commitBranchToDb.js.map +1 -1
  148. package/analyzer-template/packages/github/dist/database/src/lib/commitToDb.js +1 -1
  149. package/analyzer-template/packages/github/dist/database/src/lib/commitToDb.js.map +1 -1
  150. package/analyzer-template/packages/github/dist/database/src/lib/fileToDb.js +1 -1
  151. package/analyzer-template/packages/github/dist/database/src/lib/fileToDb.js.map +1 -1
  152. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts +4 -0
  153. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts.map +1 -1
  154. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js +16 -1
  155. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js.map +1 -1
  156. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/analysesTable.d.ts +1 -18
  157. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/analysesTable.d.ts.map +1 -1
  158. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.d.ts +1 -0
  159. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.d.ts.map +1 -1
  160. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.js +3 -0
  161. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.js.map +1 -1
  162. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.d.ts +17 -1
  163. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.d.ts.map +1 -1
  164. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.js.map +1 -1
  165. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts +27 -0
  166. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts.map +1 -0
  167. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js +121 -0
  168. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -0
  169. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.d.ts +23 -0
  170. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.d.ts.map +1 -0
  171. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.js +35 -0
  172. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.js.map +1 -0
  173. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts +6 -6
  174. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts.map +1 -1
  175. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalyses.d.ts +2 -0
  176. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalyses.d.ts.map +1 -1
  177. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalyses.js +45 -2
  178. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalyses.js.map +1 -1
  179. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.d.ts.map +1 -1
  180. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.js +8 -0
  181. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.js.map +1 -1
  182. package/analyzer-template/packages/github/dist/database/src/lib/loadBranch.js +11 -1
  183. package/analyzer-template/packages/github/dist/database/src/lib/loadBranch.js.map +1 -1
  184. package/analyzer-template/packages/github/dist/database/src/lib/loadCommit.d.ts.map +1 -1
  185. package/analyzer-template/packages/github/dist/database/src/lib/loadCommit.js +7 -0
  186. package/analyzer-template/packages/github/dist/database/src/lib/loadCommit.js.map +1 -1
  187. package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.d.ts +3 -1
  188. package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.d.ts.map +1 -1
  189. package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js +45 -14
  190. package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js.map +1 -1
  191. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.d.ts +3 -1
  192. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.d.ts.map +1 -1
  193. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js +23 -10
  194. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js.map +1 -1
  195. package/analyzer-template/packages/github/dist/database/src/lib/loadEntityBranches.d.ts.map +1 -1
  196. package/analyzer-template/packages/github/dist/database/src/lib/loadEntityBranches.js +9 -0
  197. package/analyzer-template/packages/github/dist/database/src/lib/loadEntityBranches.js.map +1 -1
  198. package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.d.ts.map +1 -1
  199. package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js +5 -5
  200. package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js.map +1 -1
  201. package/analyzer-template/packages/github/dist/database/src/lib/projectToDb.js +1 -1
  202. package/analyzer-template/packages/github/dist/database/src/lib/projectToDb.js.map +1 -1
  203. package/analyzer-template/packages/github/dist/database/src/lib/saveFiles.js +1 -1
  204. package/analyzer-template/packages/github/dist/database/src/lib/saveFiles.js.map +1 -1
  205. package/analyzer-template/packages/github/dist/database/src/lib/scenarioToDb.js +1 -1
  206. package/analyzer-template/packages/github/dist/database/src/lib/scenarioToDb.js.map +1 -1
  207. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.d.ts +2 -2
  208. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.d.ts.map +1 -1
  209. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js +76 -89
  210. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js.map +1 -1
  211. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.d.ts.map +1 -1
  212. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.js +41 -30
  213. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.js.map +1 -1
  214. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.d.ts.map +1 -1
  215. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.js +68 -57
  216. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.js.map +1 -1
  217. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.d.ts.map +1 -1
  218. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +29 -1
  219. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -1
  220. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.d.ts.map +1 -1
  221. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +33 -5
  222. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
  223. package/analyzer-template/packages/github/dist/types/index.d.ts +3 -4
  224. package/analyzer-template/packages/github/dist/types/index.d.ts.map +1 -1
  225. package/analyzer-template/packages/github/dist/types/index.js +0 -1
  226. package/analyzer-template/packages/github/dist/types/index.js.map +1 -1
  227. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.d.ts +2 -0
  228. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.d.ts.map +1 -1
  229. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.js +2 -0
  230. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.js.map +1 -1
  231. package/analyzer-template/packages/github/dist/types/src/types/Analysis.d.ts +71 -27
  232. package/analyzer-template/packages/github/dist/types/src/types/Analysis.d.ts.map +1 -1
  233. package/analyzer-template/packages/github/dist/types/src/types/Commit.d.ts +2 -0
  234. package/analyzer-template/packages/github/dist/types/src/types/Commit.d.ts.map +1 -1
  235. package/analyzer-template/packages/github/dist/types/src/types/ProjectMetadata.d.ts +8 -0
  236. package/analyzer-template/packages/github/dist/types/src/types/ProjectMetadata.d.ts.map +1 -1
  237. package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts +13 -54
  238. package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts.map +1 -1
  239. package/analyzer-template/packages/github/dist/types/src/types/Scenario.js +1 -21
  240. package/analyzer-template/packages/github/dist/types/src/types/Scenario.js.map +1 -1
  241. package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts +153 -5
  242. package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
  243. package/analyzer-template/packages/github/dist/types/src/types/ScopeAnalysis.d.ts +6 -1
  244. package/analyzer-template/packages/github/dist/types/src/types/ScopeAnalysis.d.ts.map +1 -1
  245. package/analyzer-template/packages/github/dist/types/src/types/StatementInfo.d.ts +2 -0
  246. package/analyzer-template/packages/github/dist/types/src/types/StatementInfo.d.ts.map +1 -1
  247. package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.d.ts +9 -1
  248. package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.d.ts.map +1 -1
  249. package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.js +29 -3
  250. package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.js.map +1 -1
  251. package/analyzer-template/packages/github/package.json +2 -2
  252. package/analyzer-template/packages/types/index.ts +3 -6
  253. package/analyzer-template/packages/types/src/enums/ProjectFramework.ts +2 -0
  254. package/analyzer-template/packages/types/src/types/Analysis.ts +87 -27
  255. package/analyzer-template/packages/types/src/types/Commit.ts +2 -0
  256. package/analyzer-template/packages/types/src/types/ProjectMetadata.ts +8 -0
  257. package/analyzer-template/packages/types/src/types/Scenario.ts +13 -77
  258. package/analyzer-template/packages/types/src/types/ScenariosDataStructure.ts +181 -5
  259. package/analyzer-template/packages/types/src/types/ScopeAnalysis.ts +6 -1
  260. package/analyzer-template/packages/types/src/types/StatementInfo.ts +2 -0
  261. package/analyzer-template/packages/ui-components/package.json +1 -1
  262. package/analyzer-template/packages/utils/dist/types/index.d.ts +3 -4
  263. package/analyzer-template/packages/utils/dist/types/index.d.ts.map +1 -1
  264. package/analyzer-template/packages/utils/dist/types/index.js +0 -1
  265. package/analyzer-template/packages/utils/dist/types/index.js.map +1 -1
  266. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.d.ts +2 -0
  267. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.d.ts.map +1 -1
  268. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.js +2 -0
  269. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.js.map +1 -1
  270. package/analyzer-template/packages/utils/dist/types/src/types/Analysis.d.ts +71 -27
  271. package/analyzer-template/packages/utils/dist/types/src/types/Analysis.d.ts.map +1 -1
  272. package/analyzer-template/packages/utils/dist/types/src/types/Commit.d.ts +2 -0
  273. package/analyzer-template/packages/utils/dist/types/src/types/Commit.d.ts.map +1 -1
  274. package/analyzer-template/packages/utils/dist/types/src/types/ProjectMetadata.d.ts +8 -0
  275. package/analyzer-template/packages/utils/dist/types/src/types/ProjectMetadata.d.ts.map +1 -1
  276. package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts +13 -54
  277. package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts.map +1 -1
  278. package/analyzer-template/packages/utils/dist/types/src/types/Scenario.js +1 -21
  279. package/analyzer-template/packages/utils/dist/types/src/types/Scenario.js.map +1 -1
  280. package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts +153 -5
  281. package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
  282. package/analyzer-template/packages/utils/dist/types/src/types/ScopeAnalysis.d.ts +6 -1
  283. package/analyzer-template/packages/utils/dist/types/src/types/ScopeAnalysis.d.ts.map +1 -1
  284. package/analyzer-template/packages/utils/dist/types/src/types/StatementInfo.d.ts +2 -0
  285. package/analyzer-template/packages/utils/dist/types/src/types/StatementInfo.d.ts.map +1 -1
  286. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.d.ts.map +1 -1
  287. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js +98 -3
  288. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js.map +1 -1
  289. package/analyzer-template/packages/utils/dist/utils/src/lib/safeFileName.d.ts +9 -1
  290. package/analyzer-template/packages/utils/dist/utils/src/lib/safeFileName.d.ts.map +1 -1
  291. package/analyzer-template/packages/utils/dist/utils/src/lib/safeFileName.js +29 -3
  292. package/analyzer-template/packages/utils/dist/utils/src/lib/safeFileName.js.map +1 -1
  293. package/analyzer-template/packages/utils/src/lib/fs/rsyncCopy.ts +121 -3
  294. package/analyzer-template/packages/utils/src/lib/safeFileName.ts +48 -3
  295. package/analyzer-template/playwright/capture.ts +20 -8
  296. package/analyzer-template/playwright/captureFromUrl.ts +89 -82
  297. package/analyzer-template/playwright/captureStatic.ts +1 -1
  298. package/analyzer-template/playwright/getCodeYamInfo.ts +12 -7
  299. package/analyzer-template/project/analyzeBaselineCommit.ts +9 -0
  300. package/analyzer-template/project/analyzeBranchCommit.ts +4 -0
  301. package/analyzer-template/project/analyzeFileEntities.ts +4 -0
  302. package/analyzer-template/project/analyzeRegularCommit.ts +9 -0
  303. package/analyzer-template/project/captureLibraryFunctionDirect.ts +29 -26
  304. package/analyzer-template/project/constructMockCode.ts +593 -91
  305. package/analyzer-template/project/controller/startController.ts +16 -1
  306. package/analyzer-template/project/createEntitiesAndSortFiles.ts +83 -0
  307. package/analyzer-template/project/executeLibraryFunctionDirect.ts +7 -3
  308. package/analyzer-template/project/loadReadyToBeCaptured.ts +65 -41
  309. package/analyzer-template/project/mocks/analyzeFileMock.ts +8 -7
  310. package/analyzer-template/project/orchestrateCapture/AwsCaptureTaskRunner.ts +12 -4
  311. package/analyzer-template/project/orchestrateCapture/SequentialCaptureTaskRunner.ts +18 -7
  312. package/analyzer-template/project/orchestrateCapture/taskRunner.ts +4 -2
  313. package/analyzer-template/project/orchestrateCapture.ts +75 -7
  314. package/analyzer-template/project/reconcileMockDataKeys.ts +220 -1
  315. package/analyzer-template/project/runAnalysis.ts +6 -0
  316. package/analyzer-template/project/start.ts +49 -12
  317. package/analyzer-template/project/startScenarioCapture.ts +9 -0
  318. package/analyzer-template/project/writeClientLogRoute.ts +125 -0
  319. package/analyzer-template/project/writeMockDataTsx.ts +312 -10
  320. package/analyzer-template/project/writeScenarioComponents.ts +314 -43
  321. package/analyzer-template/project/writeSimpleRoot.ts +21 -11
  322. package/analyzer-template/scripts/comboWorkerLoop.cjs +98 -50
  323. package/analyzer-template/tsconfig.json +14 -1
  324. package/background/src/lib/local/createLocalAnalyzer.js +1 -1
  325. package/background/src/lib/local/createLocalAnalyzer.js.map +1 -1
  326. package/background/src/lib/virtualized/project/analyzeBaselineCommit.js +7 -1
  327. package/background/src/lib/virtualized/project/analyzeBaselineCommit.js.map +1 -1
  328. package/background/src/lib/virtualized/project/analyzeBranchCommit.js +2 -1
  329. package/background/src/lib/virtualized/project/analyzeBranchCommit.js.map +1 -1
  330. package/background/src/lib/virtualized/project/analyzeFileEntities.js +2 -1
  331. package/background/src/lib/virtualized/project/analyzeFileEntities.js.map +1 -1
  332. package/background/src/lib/virtualized/project/analyzeRegularCommit.js +7 -1
  333. package/background/src/lib/virtualized/project/analyzeRegularCommit.js.map +1 -1
  334. package/background/src/lib/virtualized/project/captureLibraryFunctionDirect.js +3 -3
  335. package/background/src/lib/virtualized/project/captureLibraryFunctionDirect.js.map +1 -1
  336. package/background/src/lib/virtualized/project/constructMockCode.js +493 -52
  337. package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
  338. package/background/src/lib/virtualized/project/controller/startController.js +11 -1
  339. package/background/src/lib/virtualized/project/controller/startController.js.map +1 -1
  340. package/background/src/lib/virtualized/project/createEntitiesAndSortFiles.js +73 -1
  341. package/background/src/lib/virtualized/project/createEntitiesAndSortFiles.js.map +1 -1
  342. package/background/src/lib/virtualized/project/executeLibraryFunctionDirect.js +6 -3
  343. package/background/src/lib/virtualized/project/executeLibraryFunctionDirect.js.map +1 -1
  344. package/background/src/lib/virtualized/project/loadReadyToBeCaptured.js +19 -8
  345. package/background/src/lib/virtualized/project/loadReadyToBeCaptured.js.map +1 -1
  346. package/background/src/lib/virtualized/project/mocks/analyzeFileMock.js +7 -7
  347. package/background/src/lib/virtualized/project/mocks/analyzeFileMock.js.map +1 -1
  348. package/background/src/lib/virtualized/project/orchestrateCapture/AwsCaptureTaskRunner.js +2 -2
  349. package/background/src/lib/virtualized/project/orchestrateCapture/AwsCaptureTaskRunner.js.map +1 -1
  350. package/background/src/lib/virtualized/project/orchestrateCapture/SequentialCaptureTaskRunner.js +7 -5
  351. package/background/src/lib/virtualized/project/orchestrateCapture/SequentialCaptureTaskRunner.js.map +1 -1
  352. package/background/src/lib/virtualized/project/orchestrateCapture.js +62 -7
  353. package/background/src/lib/virtualized/project/orchestrateCapture.js.map +1 -1
  354. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js +184 -1
  355. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js.map +1 -1
  356. package/background/src/lib/virtualized/project/runAnalysis.js +5 -0
  357. package/background/src/lib/virtualized/project/runAnalysis.js.map +1 -1
  358. package/background/src/lib/virtualized/project/start.js +44 -12
  359. package/background/src/lib/virtualized/project/start.js.map +1 -1
  360. package/background/src/lib/virtualized/project/startScenarioCapture.js +5 -0
  361. package/background/src/lib/virtualized/project/startScenarioCapture.js.map +1 -1
  362. package/background/src/lib/virtualized/project/writeClientLogRoute.js +110 -0
  363. package/background/src/lib/virtualized/project/writeClientLogRoute.js.map +1 -0
  364. package/background/src/lib/virtualized/project/writeMockDataTsx.js +263 -6
  365. package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
  366. package/background/src/lib/virtualized/project/writeScenarioComponents.js +237 -41
  367. package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
  368. package/background/src/lib/virtualized/project/writeSimpleRoot.js +21 -11
  369. package/background/src/lib/virtualized/project/writeSimpleRoot.js.map +1 -1
  370. package/codeyam-cli/scripts/apply-setup.js +386 -9
  371. package/codeyam-cli/scripts/apply-setup.js.map +1 -1
  372. package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js +196 -0
  373. package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js.map +1 -0
  374. package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js +114 -0
  375. package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js.map +1 -0
  376. package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js +149 -0
  377. package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js.map +1 -0
  378. package/codeyam-cli/src/cli.js +35 -24
  379. package/codeyam-cli/src/cli.js.map +1 -1
  380. package/codeyam-cli/src/codeyam-cli.js +18 -2
  381. package/codeyam-cli/src/codeyam-cli.js.map +1 -1
  382. package/codeyam-cli/src/commands/__tests__/editor.stepDispatch.test.js +45 -0
  383. package/codeyam-cli/src/commands/__tests__/editor.stepDispatch.test.js.map +1 -0
  384. package/codeyam-cli/src/commands/__tests__/init.gitignore.test.js +101 -47
  385. package/codeyam-cli/src/commands/__tests__/init.gitignore.test.js.map +1 -1
  386. package/codeyam-cli/src/commands/analyze.js +21 -9
  387. package/codeyam-cli/src/commands/analyze.js.map +1 -1
  388. package/codeyam-cli/src/commands/baseline.js +10 -11
  389. package/codeyam-cli/src/commands/baseline.js.map +1 -1
  390. package/codeyam-cli/src/commands/debug.js +37 -23
  391. package/codeyam-cli/src/commands/debug.js.map +1 -1
  392. package/codeyam-cli/src/commands/default.js +43 -35
  393. package/codeyam-cli/src/commands/default.js.map +1 -1
  394. package/codeyam-cli/src/commands/editor.js +3375 -0
  395. package/codeyam-cli/src/commands/editor.js.map +1 -0
  396. package/codeyam-cli/src/commands/init.js +146 -292
  397. package/codeyam-cli/src/commands/init.js.map +1 -1
  398. package/codeyam-cli/src/commands/memory.js +278 -0
  399. package/codeyam-cli/src/commands/memory.js.map +1 -0
  400. package/codeyam-cli/src/commands/recapture.js +31 -18
  401. package/codeyam-cli/src/commands/recapture.js.map +1 -1
  402. package/codeyam-cli/src/commands/report.js +46 -1
  403. package/codeyam-cli/src/commands/report.js.map +1 -1
  404. package/codeyam-cli/src/commands/setup-sandbox.js +2 -0
  405. package/codeyam-cli/src/commands/setup-sandbox.js.map +1 -1
  406. package/codeyam-cli/src/commands/setup-simulations.js +284 -0
  407. package/codeyam-cli/src/commands/setup-simulations.js.map +1 -0
  408. package/codeyam-cli/src/commands/start.js +8 -12
  409. package/codeyam-cli/src/commands/start.js.map +1 -1
  410. package/codeyam-cli/src/commands/test-startup.js +2 -0
  411. package/codeyam-cli/src/commands/test-startup.js.map +1 -1
  412. package/codeyam-cli/src/commands/verify.js +14 -2
  413. package/codeyam-cli/src/commands/verify.js.map +1 -1
  414. package/codeyam-cli/src/data/techStacks.js +77 -0
  415. package/codeyam-cli/src/data/techStacks.js.map +1 -0
  416. package/codeyam-cli/src/utils/__tests__/analyzerFinalization.test.js +173 -0
  417. package/codeyam-cli/src/utils/__tests__/analyzerFinalization.test.js.map +1 -0
  418. package/codeyam-cli/src/utils/__tests__/backgroundServer.test.js +46 -0
  419. package/codeyam-cli/src/utils/__tests__/backgroundServer.test.js.map +1 -0
  420. package/codeyam-cli/src/utils/__tests__/devServerState.test.js +134 -0
  421. package/codeyam-cli/src/utils/__tests__/devServerState.test.js.map +1 -0
  422. package/codeyam-cli/src/utils/__tests__/editorApi.test.js +137 -0
  423. package/codeyam-cli/src/utils/__tests__/editorApi.test.js.map +1 -0
  424. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +987 -0
  425. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -0
  426. package/codeyam-cli/src/utils/__tests__/editorCapture.test.js +93 -0
  427. package/codeyam-cli/src/utils/__tests__/editorCapture.test.js.map +1 -0
  428. package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js +304 -0
  429. package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js.map +1 -0
  430. package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js +121 -0
  431. package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js.map +1 -0
  432. package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js +294 -0
  433. package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js.map +1 -0
  434. package/codeyam-cli/src/utils/__tests__/editorJournal.test.js +542 -0
  435. package/codeyam-cli/src/utils/__tests__/editorJournal.test.js.map +1 -0
  436. package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js +520 -0
  437. package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js.map +1 -0
  438. package/codeyam-cli/src/utils/__tests__/editorMockState.test.js +270 -0
  439. package/codeyam-cli/src/utils/__tests__/editorMockState.test.js.map +1 -0
  440. package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js +217 -0
  441. package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js.map +1 -0
  442. package/codeyam-cli/src/utils/__tests__/editorPreview.test.js +353 -0
  443. package/codeyam-cli/src/utils/__tests__/editorPreview.test.js.map +1 -0
  444. package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js +153 -0
  445. package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js.map +1 -0
  446. package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js +139 -0
  447. package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js.map +1 -0
  448. package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js +221 -0
  449. package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js.map +1 -0
  450. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js +1059 -0
  451. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js.map +1 -0
  452. package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js +213 -0
  453. package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js.map +1 -0
  454. package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js +1742 -0
  455. package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js.map +1 -0
  456. package/codeyam-cli/src/utils/__tests__/git.editor.test.js +134 -0
  457. package/codeyam-cli/src/utils/__tests__/git.editor.test.js.map +1 -0
  458. package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js +107 -0
  459. package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js.map +1 -0
  460. package/codeyam-cli/src/utils/__tests__/npmVersionCheck.test.js +185 -0
  461. package/codeyam-cli/src/utils/__tests__/npmVersionCheck.test.js.map +1 -0
  462. package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js +129 -0
  463. package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js.map +1 -0
  464. package/codeyam-cli/src/utils/__tests__/pathIgnoring.test.js +9 -0
  465. package/codeyam-cli/src/utils/__tests__/pathIgnoring.test.js.map +1 -1
  466. package/codeyam-cli/src/utils/__tests__/project.test.js +65 -0
  467. package/codeyam-cli/src/utils/__tests__/project.test.js.map +1 -0
  468. package/codeyam-cli/src/utils/__tests__/scenarioCoverage.test.js +227 -0
  469. package/codeyam-cli/src/utils/__tests__/scenarioCoverage.test.js.map +1 -0
  470. package/codeyam-cli/src/utils/__tests__/scenarioMarkers.test.js +121 -0
  471. package/codeyam-cli/src/utils/__tests__/scenarioMarkers.test.js.map +1 -0
  472. package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js +454 -0
  473. package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js.map +1 -0
  474. package/codeyam-cli/src/utils/__tests__/serverVersionStaleness.test.js +81 -0
  475. package/codeyam-cli/src/utils/__tests__/serverVersionStaleness.test.js.map +1 -0
  476. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +174 -82
  477. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
  478. package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js +51 -0
  479. package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js.map +1 -0
  480. package/codeyam-cli/src/utils/__tests__/webappDetection.test.js +142 -0
  481. package/codeyam-cli/src/utils/__tests__/webappDetection.test.js.map +1 -0
  482. package/codeyam-cli/src/utils/analysisRunner.js +29 -15
  483. package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
  484. package/codeyam-cli/src/utils/analyzer.js +16 -0
  485. package/codeyam-cli/src/utils/analyzer.js.map +1 -1
  486. package/codeyam-cli/src/utils/analyzerFinalization.js +100 -0
  487. package/codeyam-cli/src/utils/analyzerFinalization.js.map +1 -0
  488. package/codeyam-cli/src/utils/backgroundServer.js +202 -29
  489. package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
  490. package/codeyam-cli/src/utils/buildFlags.js +4 -0
  491. package/codeyam-cli/src/utils/buildFlags.js.map +1 -0
  492. package/codeyam-cli/src/utils/database.js +37 -2
  493. package/codeyam-cli/src/utils/database.js.map +1 -1
  494. package/codeyam-cli/src/utils/devModeEvents.js +40 -0
  495. package/codeyam-cli/src/utils/devModeEvents.js.map +1 -0
  496. package/codeyam-cli/src/utils/devServerState.js +71 -0
  497. package/codeyam-cli/src/utils/devServerState.js.map +1 -0
  498. package/codeyam-cli/src/utils/editorApi.js +79 -0
  499. package/codeyam-cli/src/utils/editorApi.js.map +1 -0
  500. package/codeyam-cli/src/utils/editorAudit.js +210 -0
  501. package/codeyam-cli/src/utils/editorAudit.js.map +1 -0
  502. package/codeyam-cli/src/utils/editorCapture.js +102 -0
  503. package/codeyam-cli/src/utils/editorCapture.js.map +1 -0
  504. package/codeyam-cli/src/utils/editorDevServer.js +197 -0
  505. package/codeyam-cli/src/utils/editorDevServer.js.map +1 -0
  506. package/codeyam-cli/src/utils/editorEntityChangeStatus.js +44 -0
  507. package/codeyam-cli/src/utils/editorEntityChangeStatus.js.map +1 -0
  508. package/codeyam-cli/src/utils/editorImageVerifier.js +155 -0
  509. package/codeyam-cli/src/utils/editorImageVerifier.js.map +1 -0
  510. package/codeyam-cli/src/utils/editorJournal.js +225 -0
  511. package/codeyam-cli/src/utils/editorJournal.js.map +1 -0
  512. package/codeyam-cli/src/utils/editorLoaderHelpers.js +113 -0
  513. package/codeyam-cli/src/utils/editorLoaderHelpers.js.map +1 -0
  514. package/codeyam-cli/src/utils/editorMockState.js +248 -0
  515. package/codeyam-cli/src/utils/editorMockState.js.map +1 -0
  516. package/codeyam-cli/src/utils/editorPreloadHelpers.js +135 -0
  517. package/codeyam-cli/src/utils/editorPreloadHelpers.js.map +1 -0
  518. package/codeyam-cli/src/utils/editorPreview.js +137 -0
  519. package/codeyam-cli/src/utils/editorPreview.js.map +1 -0
  520. package/codeyam-cli/src/utils/editorScenarioSwitch.js +112 -0
  521. package/codeyam-cli/src/utils/editorScenarioSwitch.js.map +1 -0
  522. package/codeyam-cli/src/utils/editorScenarios.js +387 -0
  523. package/codeyam-cli/src/utils/editorScenarios.js.map +1 -0
  524. package/codeyam-cli/src/utils/editorSeedAdapter.js +173 -0
  525. package/codeyam-cli/src/utils/editorSeedAdapter.js.map +1 -0
  526. package/codeyam-cli/src/utils/entityChangeStatus.js +349 -0
  527. package/codeyam-cli/src/utils/entityChangeStatus.js.map +1 -0
  528. package/codeyam-cli/src/utils/entityChangeStatus.server.js +158 -0
  529. package/codeyam-cli/src/utils/entityChangeStatus.server.js.map +1 -0
  530. package/codeyam-cli/src/utils/fileMetadata.js +5 -0
  531. package/codeyam-cli/src/utils/fileMetadata.js.map +1 -1
  532. package/codeyam-cli/src/utils/fileWatcher.js +25 -9
  533. package/codeyam-cli/src/utils/fileWatcher.js.map +1 -1
  534. package/codeyam-cli/src/utils/generateReport.js +4 -3
  535. package/codeyam-cli/src/utils/generateReport.js.map +1 -1
  536. package/codeyam-cli/src/utils/git.js +103 -0
  537. package/codeyam-cli/src/utils/git.js.map +1 -1
  538. package/codeyam-cli/src/utils/install-skills.js +120 -39
  539. package/codeyam-cli/src/utils/install-skills.js.map +1 -1
  540. package/codeyam-cli/src/utils/interactiveSyncWatcher.js +126 -0
  541. package/codeyam-cli/src/utils/interactiveSyncWatcher.js.map +1 -0
  542. package/codeyam-cli/src/utils/labsAutoCheck.js +19 -0
  543. package/codeyam-cli/src/utils/labsAutoCheck.js.map +1 -0
  544. package/codeyam-cli/src/utils/npmVersionCheck.js +76 -0
  545. package/codeyam-cli/src/utils/npmVersionCheck.js.map +1 -0
  546. package/codeyam-cli/src/utils/parseRegisterArg.js +31 -0
  547. package/codeyam-cli/src/utils/parseRegisterArg.js.map +1 -0
  548. package/codeyam-cli/src/utils/pathIgnoring.js +19 -7
  549. package/codeyam-cli/src/utils/pathIgnoring.js.map +1 -1
  550. package/codeyam-cli/src/utils/progress.js +8 -1
  551. package/codeyam-cli/src/utils/progress.js.map +1 -1
  552. package/codeyam-cli/src/utils/project.js +15 -5
  553. package/codeyam-cli/src/utils/project.js.map +1 -1
  554. package/codeyam-cli/src/utils/queue/__tests__/heartbeat.test.js +11 -11
  555. package/codeyam-cli/src/utils/queue/__tests__/heartbeat.test.js.map +1 -1
  556. package/codeyam-cli/src/utils/queue/__tests__/manager.test.js +22 -0
  557. package/codeyam-cli/src/utils/queue/__tests__/manager.test.js.map +1 -1
  558. package/codeyam-cli/src/utils/queue/heartbeat.js +13 -5
  559. package/codeyam-cli/src/utils/queue/heartbeat.js.map +1 -1
  560. package/codeyam-cli/src/utils/queue/job.js +75 -1
  561. package/codeyam-cli/src/utils/queue/job.js.map +1 -1
  562. package/codeyam-cli/src/utils/queue/manager.js +7 -0
  563. package/codeyam-cli/src/utils/queue/manager.js.map +1 -1
  564. package/codeyam-cli/src/utils/requireSimulations.js +10 -0
  565. package/codeyam-cli/src/utils/requireSimulations.js.map +1 -0
  566. package/codeyam-cli/src/utils/ruleReflection/__tests__/confusionDetector.test.js +82 -0
  567. package/codeyam-cli/src/utils/ruleReflection/__tests__/confusionDetector.test.js.map +1 -0
  568. package/codeyam-cli/src/utils/ruleReflection/__tests__/contextBuilder.test.js +229 -0
  569. package/codeyam-cli/src/utils/ruleReflection/__tests__/contextBuilder.test.js.map +1 -0
  570. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/assertRules.js +67 -0
  571. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/assertRules.js.map +1 -0
  572. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/captureFixture.js +105 -0
  573. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/captureFixture.js.map +1 -0
  574. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/loadCapturedFixture.js +34 -0
  575. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/loadCapturedFixture.js.map +1 -0
  576. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/runClaude.js +162 -0
  577. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/runClaude.js.map +1 -0
  578. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/setupTempProject.js +74 -0
  579. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/setupTempProject.js.map +1 -0
  580. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/ruleReflectionE2E.test.js +376 -0
  581. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/ruleReflectionE2E.test.js.map +1 -0
  582. package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.js +113 -0
  583. package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.js.map +1 -0
  584. package/codeyam-cli/src/utils/ruleReflection/__tests__/transcriptParser.test.js +127 -0
  585. package/codeyam-cli/src/utils/ruleReflection/__tests__/transcriptParser.test.js.map +1 -0
  586. package/codeyam-cli/src/utils/ruleReflection/confusionDetector.js +50 -0
  587. package/codeyam-cli/src/utils/ruleReflection/confusionDetector.js.map +1 -0
  588. package/codeyam-cli/src/utils/ruleReflection/contextBuilder.js +116 -0
  589. package/codeyam-cli/src/utils/ruleReflection/contextBuilder.js.map +1 -0
  590. package/codeyam-cli/src/utils/ruleReflection/index.js +5 -0
  591. package/codeyam-cli/src/utils/ruleReflection/index.js.map +1 -0
  592. package/codeyam-cli/src/utils/ruleReflection/promptBuilder.js +44 -0
  593. package/codeyam-cli/src/utils/ruleReflection/promptBuilder.js.map +1 -0
  594. package/codeyam-cli/src/utils/ruleReflection/transcriptParser.js +85 -0
  595. package/codeyam-cli/src/utils/ruleReflection/transcriptParser.js.map +1 -0
  596. package/codeyam-cli/src/utils/ruleReflection/types.js +5 -0
  597. package/codeyam-cli/src/utils/ruleReflection/types.js.map +1 -0
  598. package/codeyam-cli/src/utils/rules/__tests__/parser.test.js +83 -0
  599. package/codeyam-cli/src/utils/rules/__tests__/parser.test.js.map +1 -0
  600. package/codeyam-cli/src/utils/rules/__tests__/pathMatcher.test.js +118 -0
  601. package/codeyam-cli/src/utils/rules/__tests__/pathMatcher.test.js.map +1 -0
  602. package/codeyam-cli/src/utils/rules/__tests__/rulePlacement.test.js +72 -0
  603. package/codeyam-cli/src/utils/rules/__tests__/rulePlacement.test.js.map +1 -0
  604. package/codeyam-cli/src/utils/rules/__tests__/ruleState.test.js +293 -0
  605. package/codeyam-cli/src/utils/rules/__tests__/ruleState.test.js.map +1 -0
  606. package/codeyam-cli/src/utils/rules/__tests__/sourceFiles.test.js +76 -0
  607. package/codeyam-cli/src/utils/rules/__tests__/sourceFiles.test.js.map +1 -0
  608. package/codeyam-cli/src/utils/rules/index.js +7 -0
  609. package/codeyam-cli/src/utils/rules/index.js.map +1 -0
  610. package/codeyam-cli/src/utils/rules/parser.js +93 -0
  611. package/codeyam-cli/src/utils/rules/parser.js.map +1 -0
  612. package/codeyam-cli/src/utils/rules/pathMatcher.js +49 -0
  613. package/codeyam-cli/src/utils/rules/pathMatcher.js.map +1 -0
  614. package/codeyam-cli/src/utils/rules/rulePlacement.js +65 -0
  615. package/codeyam-cli/src/utils/rules/rulePlacement.js.map +1 -0
  616. package/codeyam-cli/src/utils/rules/ruleState.js +150 -0
  617. package/codeyam-cli/src/utils/rules/ruleState.js.map +1 -0
  618. package/codeyam-cli/src/utils/rules/sourceFiles.js +43 -0
  619. package/codeyam-cli/src/utils/rules/sourceFiles.js.map +1 -0
  620. package/codeyam-cli/src/utils/rules/staleness.js +137 -0
  621. package/codeyam-cli/src/utils/rules/staleness.js.map +1 -0
  622. package/codeyam-cli/src/utils/scenarioCoverage.js +75 -0
  623. package/codeyam-cli/src/utils/scenarioCoverage.js.map +1 -0
  624. package/codeyam-cli/src/utils/scenarioMarkers.js +134 -0
  625. package/codeyam-cli/src/utils/scenarioMarkers.js.map +1 -0
  626. package/codeyam-cli/src/utils/scenariosManifest.js +241 -0
  627. package/codeyam-cli/src/utils/scenariosManifest.js.map +1 -0
  628. package/codeyam-cli/src/utils/serverState.js +94 -12
  629. package/codeyam-cli/src/utils/serverState.js.map +1 -1
  630. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +95 -45
  631. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
  632. package/codeyam-cli/src/utils/simulationGateMiddleware.js +166 -0
  633. package/codeyam-cli/src/utils/simulationGateMiddleware.js.map +1 -0
  634. package/codeyam-cli/src/utils/slugUtils.js +25 -0
  635. package/codeyam-cli/src/utils/slugUtils.js.map +1 -0
  636. package/codeyam-cli/src/utils/syncMocksMiddleware.js +7 -26
  637. package/codeyam-cli/src/utils/syncMocksMiddleware.js.map +1 -1
  638. package/codeyam-cli/src/utils/testRunner.js +158 -0
  639. package/codeyam-cli/src/utils/testRunner.js.map +1 -0
  640. package/codeyam-cli/src/utils/transcriptPruning.js +67 -0
  641. package/codeyam-cli/src/utils/transcriptPruning.js.map +1 -0
  642. package/codeyam-cli/src/utils/versionInfo.js +67 -15
  643. package/codeyam-cli/src/utils/versionInfo.js.map +1 -1
  644. package/codeyam-cli/src/utils/webappDetection.js +35 -2
  645. package/codeyam-cli/src/utils/webappDetection.js.map +1 -1
  646. package/codeyam-cli/src/webserver/__tests__/clientErrors.test.js +40 -0
  647. package/codeyam-cli/src/webserver/__tests__/clientErrors.test.js.map +1 -0
  648. package/codeyam-cli/src/webserver/__tests__/dependency-smoke.test.js +66 -0
  649. package/codeyam-cli/src/webserver/__tests__/dependency-smoke.test.js.map +1 -0
  650. package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js +567 -0
  651. package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js.map +1 -0
  652. package/codeyam-cli/src/webserver/__tests__/idleDetector.test.js +146 -0
  653. package/codeyam-cli/src/webserver/__tests__/idleDetector.test.js.map +1 -0
  654. package/codeyam-cli/src/webserver/app/lib/clientErrors.js +65 -0
  655. package/codeyam-cli/src/webserver/app/lib/clientErrors.js.map +1 -0
  656. package/codeyam-cli/src/webserver/app/lib/database.js +63 -33
  657. package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
  658. package/codeyam-cli/src/webserver/app/lib/dbNotifier.js.map +1 -1
  659. package/codeyam-cli/src/webserver/app/lib/git.js +397 -0
  660. package/codeyam-cli/src/webserver/app/lib/git.js.map +1 -0
  661. package/codeyam-cli/src/webserver/backgroundServer.js +166 -16
  662. package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
  663. package/codeyam-cli/src/webserver/bootstrap.js +51 -0
  664. package/codeyam-cli/src/webserver/bootstrap.js.map +1 -1
  665. package/codeyam-cli/src/webserver/build/client/assets/CopyButton-BPXZwM4t.js +1 -0
  666. package/codeyam-cli/src/webserver/build/client/assets/EntityItem-BcgbViKV.js +11 -0
  667. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-DLqD3qNt.js → EntityTypeBadge-g3saevPb.js} +1 -1
  668. package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-CQIG2qda.js +41 -0
  669. package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-Bu6c6aDe.js +1 -0
  670. package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-DYFW3lDD.js +25 -0
  671. package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-CVtiBnY5.js → LibraryFunctionPreview-DLeucoVX.js} +1 -1
  672. package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-B0GLXMsr.js → LoadingDots-BU_OAEMP.js} +1 -1
  673. package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-xgeCVgSM.js → LogViewer-ceAyBX-H.js} +1 -1
  674. package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-BzHcG7SE.js +11 -0
  675. package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-DuDvi0jm.js → SafeScreenshot-BED4B6sP.js} +1 -1
  676. package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-TSD3C211.js +10 -0
  677. package/codeyam-cli/src/webserver/build/client/assets/Spinner-Bb5uFQ5V.js +34 -0
  678. package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-DyFZkK0l.js → TruncatedFilePath-C8OKAR5x.js} +1 -1
  679. package/codeyam-cli/src/webserver/build/client/assets/ViewportInspectBar-oAf2Kqsf.js +1 -0
  680. package/codeyam-cli/src/webserver/build/client/assets/_index-DLxKhri3.js +11 -0
  681. package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-BcY3q6nt.js +27 -0
  682. package/codeyam-cli/src/webserver/build/client/assets/addon-canvas-DpzMmAy5.js +1 -0
  683. package/codeyam-cli/src/webserver/build/client/assets/addon-fit-YJmn1quW.js +12 -0
  684. package/codeyam-cli/src/webserver/build/client/assets/addon-web-links-Duc5hnl7.js +1 -0
  685. package/codeyam-cli/src/webserver/build/client/assets/addon-webgl-DI8QOUvO.js +58 -0
  686. package/codeyam-cli/src/webserver/build/client/assets/agent-transcripts-Bni3iiUj.js +22 -0
  687. package/codeyam-cli/src/webserver/build/client/assets/api.editor-capture-scenario-l0sNRNKZ.js +1 -0
  688. package/codeyam-cli/src/webserver/build/client/assets/api.editor-client-errors-l0sNRNKZ.js +1 -0
  689. package/codeyam-cli/src/webserver/build/client/assets/api.editor-commit-l0sNRNKZ.js +1 -0
  690. package/codeyam-cli/src/webserver/build/client/assets/api.editor-dev-server-l0sNRNKZ.js +1 -0
  691. package/codeyam-cli/src/webserver/build/client/assets/api.editor-entity-status-l0sNRNKZ.js +1 -0
  692. package/codeyam-cli/src/webserver/build/client/assets/api.editor-file-diff-l0sNRNKZ.js +1 -0
  693. package/codeyam-cli/src/webserver/build/client/assets/api.editor-file-l0sNRNKZ.js +1 -0
  694. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-entry-l0sNRNKZ.js +1 -0
  695. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-image._-l0sNRNKZ.js +1 -0
  696. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-l0sNRNKZ.js +1 -0
  697. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-screenshot-l0sNRNKZ.js +1 -0
  698. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-update-l0sNRNKZ.js +1 -0
  699. package/codeyam-cli/src/webserver/build/client/assets/api.editor-load-commit-l0sNRNKZ.js +1 -0
  700. package/codeyam-cli/src/webserver/build/client/assets/api.editor-project-info-l0sNRNKZ.js +1 -0
  701. package/codeyam-cli/src/webserver/build/client/assets/api.editor-refresh-l0sNRNKZ.js +1 -0
  702. package/codeyam-cli/src/webserver/build/client/assets/api.editor-register-scenario-l0sNRNKZ.js +1 -0
  703. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-coverage-l0sNRNKZ.js +1 -0
  704. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-data-l0sNRNKZ.js +1 -0
  705. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-image._-l0sNRNKZ.js +1 -0
  706. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenarios-l0sNRNKZ.js +1 -0
  707. package/codeyam-cli/src/webserver/build/client/assets/api.editor-switch-scenario-l0sNRNKZ.js +1 -0
  708. package/codeyam-cli/src/webserver/build/client/assets/api.editor-test-results-l0sNRNKZ.js +1 -0
  709. package/codeyam-cli/src/webserver/build/client/assets/api.health-l0sNRNKZ.js +1 -0
  710. package/codeyam-cli/src/webserver/build/client/assets/api.labs-unlock-l0sNRNKZ.js +1 -0
  711. package/codeyam-cli/src/webserver/build/client/assets/api.memory-profile-l0sNRNKZ.js +1 -0
  712. package/codeyam-cli/src/webserver/build/client/assets/api.restart-server-l0sNRNKZ.js +1 -0
  713. package/codeyam-cli/src/webserver/build/client/assets/api.rule-path-l0sNRNKZ.js +1 -0
  714. package/codeyam-cli/src/webserver/build/client/assets/api.save-fixture-l0sNRNKZ.js +1 -0
  715. package/codeyam-cli/src/webserver/build/client/assets/book-open-BYOypzCa.js +6 -0
  716. package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-Cx24_aWc.js → chevron-down-C_Pmso5S.js} +2 -2
  717. package/codeyam-cli/src/webserver/build/client/assets/{chunk-EPOLDU6W-CXRTFQ3F.js → chunk-JZWAC4HX-C4pqxYJB.js} +12 -12
  718. package/codeyam-cli/src/webserver/build/client/assets/{circle-check-BOARzkeR.js → circle-check-BVMi9VA5.js} +2 -2
  719. package/codeyam-cli/src/webserver/build/client/assets/copy-n2FB0_Sw.js +11 -0
  720. package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-CC6AbExI.js +41 -0
  721. package/codeyam-cli/src/webserver/build/client/assets/{cy-logo-cli-C1gnJVOL.svg → cy-logo-cli-CCKUIm0S.svg} +2 -2
  722. package/codeyam-cli/src/webserver/build/client/assets/cy-logo-cli-DcX-ZS3p.js +1 -0
  723. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-Ii3inc0_.js +1 -0
  724. package/codeyam-cli/src/webserver/build/client/assets/editor-COWCNVyV.js +10 -0
  725. package/codeyam-cli/src/webserver/build/client/assets/editorPreview-CNB06EIa.js +41 -0
  726. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-D0-YwkBh.js → entity._sha._-DwCV5__E.js} +13 -13
  727. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-CXSi2aeZ.js +6 -0
  728. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-CHMiAog3.js +6 -0
  729. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-p9hhkjJM.js +6 -0
  730. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-C1H_a_Y3.js → entity._sha_.edit._scenarioId-BMvVHNXU.js} +2 -2
  731. package/codeyam-cli/src/webserver/build/client/assets/{entry.client-CS2cb_eZ.js → entry.client-DTvKq3TY.js} +1 -1
  732. package/codeyam-cli/src/webserver/build/client/assets/executionFlowCoverage-BWhdfn70.js +1 -0
  733. package/codeyam-cli/src/webserver/build/client/assets/{fileTableUtils-DMJ7zii9.js → fileTableUtils-cPo8LiG3.js} +1 -1
  734. package/codeyam-cli/src/webserver/build/client/assets/files-BZrlFE1F.js +1 -0
  735. package/codeyam-cli/src/webserver/build/client/assets/git-DdZcvjGh.js +1 -0
  736. package/codeyam-cli/src/webserver/build/client/assets/globals-phvmGvat.css +1 -0
  737. package/codeyam-cli/src/webserver/build/client/assets/{index-B1h680n5.js → index-10oVnAAH.js} +1 -1
  738. package/codeyam-cli/src/webserver/build/client/assets/{index-lzqtyFU8.js → index-BcvgDzbZ.js} +1 -1
  739. package/codeyam-cli/src/webserver/build/client/assets/index-yHOVb4rc.js +15 -0
  740. package/codeyam-cli/src/webserver/build/client/assets/labs-Zk7ryIM1.js +1 -0
  741. package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-B7B9V-bu.js → loader-circle-DaAZ_H2w.js} +2 -2
  742. package/codeyam-cli/src/webserver/build/client/assets/manifest-6134dc40.js +1 -0
  743. package/codeyam-cli/src/webserver/build/client/assets/memory-9gnxSZlb.js +101 -0
  744. package/codeyam-cli/src/webserver/build/client/assets/pause-f5-1lKBt.js +11 -0
  745. package/codeyam-cli/src/webserver/build/client/assets/root-BWAyuj0r.js +67 -0
  746. package/codeyam-cli/src/webserver/build/client/assets/{search-CxXUmBSd.js → search-Di64LWVb.js} +2 -2
  747. package/codeyam-cli/src/webserver/build/client/assets/settings-0OrEMU6J.js +1 -0
  748. package/codeyam-cli/src/webserver/build/client/assets/simulations-DWT-CvLy.js +1 -0
  749. package/codeyam-cli/src/webserver/build/client/assets/terminal-Br7MOqts.js +11 -0
  750. package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-B6LgvRJg.js → triangle-alert-BLdiCuG-.js} +2 -2
  751. package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-C-_hOl_g.js +1 -0
  752. package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-C14nCb1q.js +2 -0
  753. package/codeyam-cli/src/webserver/build/client/assets/useReportContext-O-jkvSPx.js +1 -0
  754. package/codeyam-cli/src/webserver/build/client/assets/{useToast-mBRpZPiu.js → useToast-9FIWuYfK.js} +1 -1
  755. package/codeyam-cli/src/webserver/build/client/assets/xterm-BqvuqXEL.js +27 -0
  756. package/codeyam-cli/src/webserver/build/client/sound-test.html +98 -0
  757. package/codeyam-cli/src/webserver/build/server/assets/index-ChX0hPcu.js +1 -0
  758. package/codeyam-cli/src/webserver/build/server/assets/init-kSNsMjj8.js +10 -0
  759. package/codeyam-cli/src/webserver/build/server/assets/server-build-Bm2xIhmh.js +439 -0
  760. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  761. package/codeyam-cli/src/webserver/build-info.json +5 -5
  762. package/codeyam-cli/src/webserver/devServer.js +39 -5
  763. package/codeyam-cli/src/webserver/devServer.js.map +1 -1
  764. package/codeyam-cli/src/webserver/editorProxy.js +877 -0
  765. package/codeyam-cli/src/webserver/editorProxy.js.map +1 -0
  766. package/codeyam-cli/src/webserver/idleDetector.js +73 -0
  767. package/codeyam-cli/src/webserver/idleDetector.js.map +1 -0
  768. package/codeyam-cli/src/webserver/public/sound-test.html +98 -0
  769. package/codeyam-cli/src/webserver/scripts/codeyam-preload.mjs +414 -0
  770. package/codeyam-cli/src/webserver/scripts/journalCapture.ts +230 -0
  771. package/codeyam-cli/src/webserver/server.js +335 -26
  772. package/codeyam-cli/src/webserver/server.js.map +1 -1
  773. package/codeyam-cli/src/webserver/terminalServer.js +735 -0
  774. package/codeyam-cli/src/webserver/terminalServer.js.map +1 -0
  775. package/codeyam-cli/templates/chrome-extension-react/EXTENSION_SETUP.md +75 -0
  776. package/codeyam-cli/templates/chrome-extension-react/README.md +46 -0
  777. package/codeyam-cli/templates/chrome-extension-react/gitignore +15 -0
  778. package/codeyam-cli/templates/chrome-extension-react/index.html +12 -0
  779. package/codeyam-cli/templates/chrome-extension-react/package.json +27 -0
  780. package/codeyam-cli/templates/chrome-extension-react/popup.html +12 -0
  781. package/codeyam-cli/templates/chrome-extension-react/public/manifest.json +15 -0
  782. package/codeyam-cli/templates/chrome-extension-react/src/background/service-worker.ts +7 -0
  783. package/codeyam-cli/templates/chrome-extension-react/src/globals.css +6 -0
  784. package/codeyam-cli/templates/chrome-extension-react/src/lib/storage.ts +37 -0
  785. package/codeyam-cli/templates/chrome-extension-react/src/popup/App.tsx +12 -0
  786. package/codeyam-cli/templates/chrome-extension-react/src/popup/main.tsx +10 -0
  787. package/codeyam-cli/templates/chrome-extension-react/tsconfig.json +24 -0
  788. package/codeyam-cli/templates/chrome-extension-react/vite.config.ts +41 -0
  789. package/codeyam-cli/templates/codeyam-editor-claude.md +147 -0
  790. package/codeyam-cli/templates/codeyam-memory-hook.sh +199 -0
  791. package/codeyam-cli/templates/commands/codeyam-diagnose.md +481 -0
  792. package/codeyam-cli/templates/editor-step-hook.py +237 -0
  793. package/codeyam-cli/templates/expo-react-native/MOBILE_SETUP.md +89 -0
  794. package/codeyam-cli/templates/expo-react-native/README.md +41 -0
  795. package/codeyam-cli/templates/expo-react-native/app/(tabs)/_layout.tsx +33 -0
  796. package/codeyam-cli/templates/expo-react-native/app/(tabs)/index.tsx +12 -0
  797. package/codeyam-cli/templates/expo-react-native/app/(tabs)/settings.tsx +12 -0
  798. package/codeyam-cli/templates/expo-react-native/app/_layout.tsx +12 -0
  799. package/codeyam-cli/templates/expo-react-native/app.json +18 -0
  800. package/codeyam-cli/templates/expo-react-native/babel.config.js +9 -0
  801. package/codeyam-cli/templates/expo-react-native/gitignore +12 -0
  802. package/codeyam-cli/templates/expo-react-native/global.css +3 -0
  803. package/codeyam-cli/templates/expo-react-native/lib/storage.ts +32 -0
  804. package/codeyam-cli/templates/expo-react-native/metro.config.js +6 -0
  805. package/codeyam-cli/templates/expo-react-native/nativewind-env.d.ts +1 -0
  806. package/codeyam-cli/templates/expo-react-native/package.json +38 -0
  807. package/codeyam-cli/templates/expo-react-native/tailwind.config.js +10 -0
  808. package/codeyam-cli/templates/expo-react-native/tsconfig.json +10 -0
  809. package/codeyam-cli/templates/hooks/staleness-check.sh +43 -0
  810. package/codeyam-cli/templates/isolation-route/next-app.tsx.template +80 -0
  811. package/codeyam-cli/templates/isolation-route/next-pages.tsx.template +79 -0
  812. package/codeyam-cli/templates/isolation-route/vite-react.tsx.template +78 -0
  813. package/codeyam-cli/templates/msw/browser-setup.ts.template +47 -0
  814. package/codeyam-cli/templates/msw/handler-router.ts.template +47 -0
  815. package/codeyam-cli/templates/msw/server-setup.ts.template +52 -0
  816. package/codeyam-cli/templates/nextjs-prisma-sqlite/AUTH_PATTERNS.md +308 -0
  817. package/codeyam-cli/templates/nextjs-prisma-sqlite/AUTH_UPGRADE.md +304 -0
  818. package/codeyam-cli/templates/nextjs-prisma-sqlite/DATABASE.md +126 -0
  819. package/codeyam-cli/templates/nextjs-prisma-sqlite/FEATURE_PATTERNS.md +37 -0
  820. package/codeyam-cli/templates/nextjs-prisma-sqlite/README.md +53 -0
  821. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/api/todos/route.ts +17 -0
  822. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/codeyam-isolate/layout.tsx +12 -0
  823. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/globals.css +26 -0
  824. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/layout.tsx +34 -0
  825. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/lib/prisma.ts +24 -0
  826. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/page.tsx +10 -0
  827. package/codeyam-cli/templates/nextjs-prisma-sqlite/env +4 -0
  828. package/codeyam-cli/templates/nextjs-prisma-sqlite/eslint.config.mjs +11 -0
  829. package/codeyam-cli/templates/nextjs-prisma-sqlite/gitignore +64 -0
  830. package/codeyam-cli/templates/nextjs-prisma-sqlite/next.config.ts +14 -0
  831. package/codeyam-cli/templates/nextjs-prisma-sqlite/package.json +39 -0
  832. package/codeyam-cli/templates/nextjs-prisma-sqlite/postcss.config.mjs +7 -0
  833. package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma/schema.prisma +27 -0
  834. package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma/seed.ts +40 -0
  835. package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma.config.ts +12 -0
  836. package/codeyam-cli/templates/nextjs-prisma-sqlite/seed-adapter.ts +92 -0
  837. package/codeyam-cli/templates/nextjs-prisma-sqlite/tsconfig.json +34 -0
  838. package/codeyam-cli/templates/nextjs-prisma-sqlite/vitest.config.ts +13 -0
  839. package/codeyam-cli/templates/nextjs-prisma-supabase/README.md +52 -0
  840. package/codeyam-cli/templates/nextjs-prisma-supabase/SUPABASE_SETUP.md +104 -0
  841. package/codeyam-cli/templates/nextjs-prisma-supabase/app/api/todos/route.ts +17 -0
  842. package/codeyam-cli/templates/nextjs-prisma-supabase/app/globals.css +26 -0
  843. package/codeyam-cli/templates/nextjs-prisma-supabase/app/layout.tsx +34 -0
  844. package/codeyam-cli/templates/nextjs-prisma-supabase/app/lib/prisma.ts +20 -0
  845. package/codeyam-cli/templates/nextjs-prisma-supabase/app/lib/supabase.ts +12 -0
  846. package/codeyam-cli/templates/nextjs-prisma-supabase/app/page.tsx +10 -0
  847. package/codeyam-cli/templates/nextjs-prisma-supabase/env +9 -0
  848. package/codeyam-cli/templates/nextjs-prisma-supabase/eslint.config.mjs +11 -0
  849. package/codeyam-cli/templates/nextjs-prisma-supabase/gitignore +40 -0
  850. package/codeyam-cli/templates/nextjs-prisma-supabase/next.config.ts +11 -0
  851. package/codeyam-cli/templates/nextjs-prisma-supabase/package.json +37 -0
  852. package/codeyam-cli/templates/nextjs-prisma-supabase/postcss.config.mjs +7 -0
  853. package/codeyam-cli/templates/nextjs-prisma-supabase/prisma/schema.prisma +27 -0
  854. package/codeyam-cli/templates/nextjs-prisma-supabase/prisma/seed.ts +39 -0
  855. package/codeyam-cli/templates/nextjs-prisma-supabase/prisma.config.ts +12 -0
  856. package/codeyam-cli/templates/nextjs-prisma-supabase/tsconfig.json +34 -0
  857. package/codeyam-cli/templates/prompts/conversation-guidance.txt +44 -0
  858. package/codeyam-cli/templates/prompts/conversation-prompt.txt +28 -0
  859. package/codeyam-cli/templates/prompts/interruption-prompt.txt +31 -0
  860. package/codeyam-cli/templates/prompts/stale-rules-prompt.txt +24 -0
  861. package/codeyam-cli/templates/rule-notification-hook.py +83 -0
  862. package/codeyam-cli/templates/rule-reflection-hook.py +647 -0
  863. package/codeyam-cli/templates/rules-instructions.md +78 -0
  864. package/codeyam-cli/templates/{codeyam-debug-skill.md → skills/codeyam-debug/SKILL.md} +48 -4
  865. package/codeyam-cli/templates/skills/codeyam-dev-mode/SKILL.md +237 -0
  866. package/codeyam-cli/templates/skills/codeyam-editor/SKILL.md +149 -0
  867. package/codeyam-cli/templates/skills/codeyam-memory/SKILL.md +611 -0
  868. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/deprecated-prompt.md +100 -0
  869. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/detect-deprecated-patterns.mjs +139 -0
  870. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/find-exports.mjs +52 -0
  871. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/misleading-api-prompt.md +117 -0
  872. package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/read-json-field.mjs +61 -0
  873. package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/ripgrep-fallback.mjs +155 -0
  874. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/analyze-prompt.md +46 -0
  875. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/cleanup.mjs +13 -0
  876. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/filter-session.mjs +95 -0
  877. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/preprocess.mjs +160 -0
  878. package/codeyam-cli/templates/skills/codeyam-new-rule/SKILL.md +11 -0
  879. package/codeyam-cli/templates/{codeyam-setup-skill.md → skills/codeyam-setup/SKILL.md} +13 -1
  880. package/codeyam-cli/templates/{codeyam-sim-skill.md → skills/codeyam-sim/SKILL.md} +1 -1
  881. package/codeyam-cli/templates/{codeyam-test-skill.md → skills/codeyam-test/SKILL.md} +1 -1
  882. package/codeyam-cli/templates/{codeyam-verify-skill.md → skills/codeyam-verify/SKILL.md} +1 -1
  883. package/package.json +32 -22
  884. package/packages/ai/index.js +8 -6
  885. package/packages/ai/index.js.map +1 -1
  886. package/packages/ai/src/lib/analyzeScope.js +179 -13
  887. package/packages/ai/src/lib/analyzeScope.js.map +1 -1
  888. package/packages/ai/src/lib/astScopes/arrayDerivationDetector.js +150 -0
  889. package/packages/ai/src/lib/astScopes/arrayDerivationDetector.js.map +1 -0
  890. package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js +160 -13
  891. package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js.map +1 -1
  892. package/packages/ai/src/lib/astScopes/conditionalEffectsExtractor.js +435 -0
  893. package/packages/ai/src/lib/astScopes/conditionalEffectsExtractor.js.map +1 -0
  894. package/packages/ai/src/lib/astScopes/methodSemantics.js +138 -23
  895. package/packages/ai/src/lib/astScopes/methodSemantics.js.map +1 -1
  896. package/packages/ai/src/lib/astScopes/patterns/forInStatementHandler.js +10 -14
  897. package/packages/ai/src/lib/astScopes/patterns/forInStatementHandler.js.map +1 -1
  898. package/packages/ai/src/lib/astScopes/patterns/ifStatementHandler.js +8 -0
  899. package/packages/ai/src/lib/astScopes/patterns/ifStatementHandler.js.map +1 -1
  900. package/packages/ai/src/lib/astScopes/patterns/switchStatementHandler.js +7 -0
  901. package/packages/ai/src/lib/astScopes/patterns/switchStatementHandler.js.map +1 -1
  902. package/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.js +138 -1
  903. package/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.js.map +1 -1
  904. package/packages/ai/src/lib/astScopes/processExpression.js +931 -29
  905. package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
  906. package/packages/ai/src/lib/astScopes/sharedPatterns.js +25 -0
  907. package/packages/ai/src/lib/astScopes/sharedPatterns.js.map +1 -1
  908. package/packages/ai/src/lib/completionCall.js +188 -38
  909. package/packages/ai/src/lib/completionCall.js.map +1 -1
  910. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +1600 -189
  911. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
  912. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js +5 -1
  913. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js.map +1 -1
  914. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.js +179 -0
  915. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.js.map +1 -1
  916. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js +7 -1
  917. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js.map +1 -1
  918. package/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.js +13 -3
  919. package/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.js.map +1 -1
  920. package/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.js +6 -4
  921. package/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.js.map +1 -1
  922. package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js +52 -3
  923. package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js.map +1 -1
  924. package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js +111 -14
  925. package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js.map +1 -1
  926. package/packages/ai/src/lib/dataStructure/helpers/coerceObjectsToPrimitivesBySchema.js +63 -0
  927. package/packages/ai/src/lib/dataStructure/helpers/coerceObjectsToPrimitivesBySchema.js.map +1 -0
  928. package/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.js +54 -0
  929. package/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.js.map +1 -0
  930. package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js +122 -12
  931. package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js.map +1 -1
  932. package/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.js +173 -0
  933. package/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.js.map +1 -0
  934. package/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.js +37 -20
  935. package/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.js.map +1 -1
  936. package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js +333 -81
  937. package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js.map +1 -1
  938. package/packages/ai/src/lib/dataStructure/helpers/fixNullIdsBySchema.js +107 -0
  939. package/packages/ai/src/lib/dataStructure/helpers/fixNullIdsBySchema.js.map +1 -0
  940. package/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.js +34 -0
  941. package/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.js.map +1 -0
  942. package/packages/ai/src/lib/dataStructureChunking.js +130 -0
  943. package/packages/ai/src/lib/dataStructureChunking.js.map +1 -0
  944. package/packages/ai/src/lib/e2eDataTracking.js +241 -0
  945. package/packages/ai/src/lib/e2eDataTracking.js.map +1 -0
  946. package/packages/ai/src/lib/extractCriticalDataKeys.js +96 -0
  947. package/packages/ai/src/lib/extractCriticalDataKeys.js.map +1 -0
  948. package/packages/ai/src/lib/generateChangesEntityScenarioData.js +4 -3
  949. package/packages/ai/src/lib/generateChangesEntityScenarioData.js.map +1 -1
  950. package/packages/ai/src/lib/generateChangesEntityScenarios.js +78 -120
  951. package/packages/ai/src/lib/generateChangesEntityScenarios.js.map +1 -1
  952. package/packages/ai/src/lib/generateEntityDataStructure.js +47 -2
  953. package/packages/ai/src/lib/generateEntityDataStructure.js.map +1 -1
  954. package/packages/ai/src/lib/generateEntityScenarioData.js +1153 -60
  955. package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
  956. package/packages/ai/src/lib/generateEntityScenarios.js +177 -163
  957. package/packages/ai/src/lib/generateEntityScenarios.js.map +1 -1
  958. package/packages/ai/src/lib/generateExecutionFlows.js +484 -0
  959. package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -0
  960. package/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.js +380 -0
  961. package/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.js.map +1 -0
  962. package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js +1807 -0
  963. package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js.map +1 -0
  964. package/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.js +194 -0
  965. package/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.js.map +1 -0
  966. package/packages/ai/src/lib/guessScenarioDataFromDescription.js +2 -2
  967. package/packages/ai/src/lib/guessScenarioDataFromDescription.js.map +1 -1
  968. package/packages/ai/src/lib/isolateScopes.js +270 -7
  969. package/packages/ai/src/lib/isolateScopes.js.map +1 -1
  970. package/packages/ai/src/lib/mergeJsonTypeDefinitions.js +5 -0
  971. package/packages/ai/src/lib/mergeJsonTypeDefinitions.js.map +1 -1
  972. package/packages/ai/src/lib/mergeStatements.js +88 -46
  973. package/packages/ai/src/lib/mergeStatements.js.map +1 -1
  974. package/packages/ai/src/lib/promptGenerators/collapseNullableObjects.js +97 -0
  975. package/packages/ai/src/lib/promptGenerators/collapseNullableObjects.js.map +1 -0
  976. package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js +10 -4
  977. package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js.map +1 -1
  978. package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.js +1 -1
  979. package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.js.map +1 -1
  980. package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js +21 -119
  981. package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js.map +1 -1
  982. package/packages/ai/src/lib/promptGenerators/generateChunkPrompt.js +54 -0
  983. package/packages/ai/src/lib/promptGenerators/generateChunkPrompt.js.map +1 -0
  984. package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js +83 -6
  985. package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js.map +1 -1
  986. package/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.js +10 -70
  987. package/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.js.map +1 -1
  988. package/packages/ai/src/lib/promptGenerators/generateMissingKeysPrompt.js +45 -0
  989. package/packages/ai/src/lib/promptGenerators/generateMissingKeysPrompt.js.map +1 -0
  990. package/packages/ai/src/lib/promptGenerators/guessNewScenarioDataFromDescriptionGenerator.js +9 -9
  991. package/packages/ai/src/lib/promptGenerators/guessNewScenarioDataFromDescriptionGenerator.js.map +1 -1
  992. package/packages/ai/src/lib/promptGenerators/simplifyKeysForLLM.js +335 -0
  993. package/packages/ai/src/lib/promptGenerators/simplifyKeysForLLM.js.map +1 -0
  994. package/packages/ai/src/lib/resolvePathToControllable.js +677 -0
  995. package/packages/ai/src/lib/resolvePathToControllable.js.map +1 -0
  996. package/packages/ai/src/lib/splitOutsideParentheses.js +3 -1
  997. package/packages/ai/src/lib/splitOutsideParentheses.js.map +1 -1
  998. package/packages/ai/src/lib/worker/SerializableDataStructure.js +29 -0
  999. package/packages/ai/src/lib/worker/SerializableDataStructure.js.map +1 -1
  1000. package/packages/ai/src/lib/worker/analyzeScopeWorker.js +94 -1
  1001. package/packages/ai/src/lib/worker/analyzeScopeWorker.js.map +1 -1
  1002. package/packages/analyze/index.js +1 -0
  1003. package/packages/analyze/index.js.map +1 -1
  1004. package/packages/analyze/src/lib/FileAnalyzer.js +60 -36
  1005. package/packages/analyze/src/lib/FileAnalyzer.js.map +1 -1
  1006. package/packages/analyze/src/lib/ProjectAnalyzer.js +109 -30
  1007. package/packages/analyze/src/lib/ProjectAnalyzer.js.map +1 -1
  1008. package/packages/analyze/src/lib/analysisContext.js +30 -5
  1009. package/packages/analyze/src/lib/analysisContext.js.map +1 -1
  1010. package/packages/analyze/src/lib/asts/index.js +4 -2
  1011. package/packages/analyze/src/lib/asts/index.js.map +1 -1
  1012. package/packages/analyze/src/lib/asts/nodes/getNodeType.js +1 -0
  1013. package/packages/analyze/src/lib/asts/nodes/getNodeType.js.map +1 -1
  1014. package/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.js +14 -0
  1015. package/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.js.map +1 -1
  1016. package/packages/analyze/src/lib/asts/sourceFiles/getAllEntityNodes.js +14 -0
  1017. package/packages/analyze/src/lib/asts/sourceFiles/getAllEntityNodes.js.map +1 -1
  1018. package/packages/analyze/src/lib/asts/sourceFiles/getAllExports.js +6 -0
  1019. package/packages/analyze/src/lib/asts/sourceFiles/getAllExports.js.map +1 -1
  1020. package/packages/analyze/src/lib/asts/sourceFiles/getImportsAnalysis.js +6 -0
  1021. package/packages/analyze/src/lib/asts/sourceFiles/getImportsAnalysis.js.map +1 -1
  1022. package/packages/analyze/src/lib/asts/sourceFiles/getResolvedModule.js +39 -1
  1023. package/packages/analyze/src/lib/asts/sourceFiles/getResolvedModule.js.map +1 -1
  1024. package/packages/analyze/src/lib/asts/sourceFiles/getSourceFilesForAllImports.js +2 -1
  1025. package/packages/analyze/src/lib/asts/sourceFiles/getSourceFilesForAllImports.js.map +1 -1
  1026. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +189 -41
  1027. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
  1028. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +28 -4
  1029. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
  1030. package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js +9 -0
  1031. package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js.map +1 -1
  1032. package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js +2 -1
  1033. package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js.map +1 -1
  1034. package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js +31 -10
  1035. package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js.map +1 -1
  1036. package/packages/analyze/src/lib/files/analyzeChange.js +10 -10
  1037. package/packages/analyze/src/lib/files/analyzeChange.js.map +1 -1
  1038. package/packages/analyze/src/lib/files/analyzeEntity.js +4 -4
  1039. package/packages/analyze/src/lib/files/analyzeEntity.js.map +1 -1
  1040. package/packages/analyze/src/lib/files/analyzeInitial.js +9 -10
  1041. package/packages/analyze/src/lib/files/analyzeInitial.js.map +1 -1
  1042. package/packages/analyze/src/lib/files/analyzeRemixRoute.js +3 -2
  1043. package/packages/analyze/src/lib/files/analyzeRemixRoute.js.map +1 -1
  1044. package/packages/analyze/src/lib/files/enums/steps.js +1 -1
  1045. package/packages/analyze/src/lib/files/enums/steps.js.map +1 -1
  1046. package/packages/analyze/src/lib/files/getImportedExports.js +11 -7
  1047. package/packages/analyze/src/lib/files/getImportedExports.js.map +1 -1
  1048. package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js +907 -0
  1049. package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js.map +1 -0
  1050. package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js +164 -68
  1051. package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js.map +1 -1
  1052. package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js +178 -31
  1053. package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js.map +1 -1
  1054. package/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.js +29 -129
  1055. package/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.js.map +1 -1
  1056. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +252 -21
  1057. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
  1058. package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js +104 -0
  1059. package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js.map +1 -0
  1060. package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js +1 -0
  1061. package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js.map +1 -1
  1062. package/packages/analyze/src/lib/files/scenarios/generateScenarios.js +2 -3
  1063. package/packages/analyze/src/lib/files/scenarios/generateScenarios.js.map +1 -1
  1064. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +686 -55
  1065. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
  1066. package/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.js +46 -9
  1067. package/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.js.map +1 -1
  1068. package/packages/analyze/src/lib/files/setImportedExports.js +2 -1
  1069. package/packages/analyze/src/lib/files/setImportedExports.js.map +1 -1
  1070. package/packages/analyze/src/lib/index.js +1 -0
  1071. package/packages/analyze/src/lib/index.js.map +1 -1
  1072. package/packages/analyze/src/lib/utils/getFileByPath.js +12 -0
  1073. package/packages/analyze/src/lib/utils/getFileByPath.js.map +1 -0
  1074. package/packages/database/index.js +1 -0
  1075. package/packages/database/index.js.map +1 -1
  1076. package/packages/database/src/lib/analysisBranchToDb.js +1 -1
  1077. package/packages/database/src/lib/analysisBranchToDb.js.map +1 -1
  1078. package/packages/database/src/lib/analysisToDb.js +1 -1
  1079. package/packages/database/src/lib/analysisToDb.js.map +1 -1
  1080. package/packages/database/src/lib/branchToDb.js +1 -1
  1081. package/packages/database/src/lib/branchToDb.js.map +1 -1
  1082. package/packages/database/src/lib/commitBranchToDb.js +1 -1
  1083. package/packages/database/src/lib/commitBranchToDb.js.map +1 -1
  1084. package/packages/database/src/lib/commitToDb.js +1 -1
  1085. package/packages/database/src/lib/commitToDb.js.map +1 -1
  1086. package/packages/database/src/lib/fileToDb.js +1 -1
  1087. package/packages/database/src/lib/fileToDb.js.map +1 -1
  1088. package/packages/database/src/lib/kysely/db.js +16 -1
  1089. package/packages/database/src/lib/kysely/db.js.map +1 -1
  1090. package/packages/database/src/lib/kysely/tables/commitsTable.js +3 -0
  1091. package/packages/database/src/lib/kysely/tables/commitsTable.js.map +1 -1
  1092. package/packages/database/src/lib/kysely/tables/debugReportsTable.js.map +1 -1
  1093. package/packages/database/src/lib/kysely/tables/editorScenariosTable.js +121 -0
  1094. package/packages/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -0
  1095. package/packages/database/src/lib/kysely/tables/labsRequestsTable.js +35 -0
  1096. package/packages/database/src/lib/kysely/tables/labsRequestsTable.js.map +1 -0
  1097. package/packages/database/src/lib/loadAnalyses.js +45 -2
  1098. package/packages/database/src/lib/loadAnalyses.js.map +1 -1
  1099. package/packages/database/src/lib/loadAnalysis.js +8 -0
  1100. package/packages/database/src/lib/loadAnalysis.js.map +1 -1
  1101. package/packages/database/src/lib/loadBranch.js +11 -1
  1102. package/packages/database/src/lib/loadBranch.js.map +1 -1
  1103. package/packages/database/src/lib/loadCommit.js +7 -0
  1104. package/packages/database/src/lib/loadCommit.js.map +1 -1
  1105. package/packages/database/src/lib/loadCommits.js +45 -14
  1106. package/packages/database/src/lib/loadCommits.js.map +1 -1
  1107. package/packages/database/src/lib/loadEntities.js +23 -10
  1108. package/packages/database/src/lib/loadEntities.js.map +1 -1
  1109. package/packages/database/src/lib/loadEntityBranches.js +9 -0
  1110. package/packages/database/src/lib/loadEntityBranches.js.map +1 -1
  1111. package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.js +5 -5
  1112. package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.js.map +1 -1
  1113. package/packages/database/src/lib/projectToDb.js +1 -1
  1114. package/packages/database/src/lib/projectToDb.js.map +1 -1
  1115. package/packages/database/src/lib/saveFiles.js +1 -1
  1116. package/packages/database/src/lib/saveFiles.js.map +1 -1
  1117. package/packages/database/src/lib/scenarioToDb.js +1 -1
  1118. package/packages/database/src/lib/scenarioToDb.js.map +1 -1
  1119. package/packages/database/src/lib/updateCommitMetadata.js +76 -89
  1120. package/packages/database/src/lib/updateCommitMetadata.js.map +1 -1
  1121. package/packages/database/src/lib/updateFreshAnalysisStatus.js +41 -30
  1122. package/packages/database/src/lib/updateFreshAnalysisStatus.js.map +1 -1
  1123. package/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.js +68 -57
  1124. package/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.js.map +1 -1
  1125. package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +29 -1
  1126. package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -1
  1127. package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +33 -5
  1128. package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
  1129. package/packages/types/index.js +0 -1
  1130. package/packages/types/index.js.map +1 -1
  1131. package/packages/types/src/enums/ProjectFramework.js +2 -0
  1132. package/packages/types/src/enums/ProjectFramework.js.map +1 -1
  1133. package/packages/types/src/types/Scenario.js +1 -21
  1134. package/packages/types/src/types/Scenario.js.map +1 -1
  1135. package/packages/utils/src/lib/fs/rsyncCopy.js +98 -3
  1136. package/packages/utils/src/lib/fs/rsyncCopy.js.map +1 -1
  1137. package/packages/utils/src/lib/safeFileName.js +29 -3
  1138. package/packages/utils/src/lib/safeFileName.js.map +1 -1
  1139. package/scripts/npm-post-install.cjs +34 -0
  1140. package/analyzer-template/packages/ai/src/lib/findMatchingAttribute.ts +0 -109
  1141. package/analyzer-template/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.ts +0 -584
  1142. package/analyzer-template/packages/ai/src/lib/generateChangesEntityKeyAttributes.ts +0 -341
  1143. package/analyzer-template/packages/ai/src/lib/generateEntityKeyAttributes.ts +0 -495
  1144. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityKeyAttributesGenerator.ts +0 -67
  1145. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.ts +0 -120
  1146. package/codeyam-cli/src/commands/detect-universal-mocks.js +0 -118
  1147. package/codeyam-cli/src/commands/detect-universal-mocks.js.map +0 -1
  1148. package/codeyam-cli/src/commands/list.js +0 -31
  1149. package/codeyam-cli/src/commands/list.js.map +0 -1
  1150. package/codeyam-cli/src/commands/webapp-info.js +0 -146
  1151. package/codeyam-cli/src/commands/webapp-info.js.map +0 -1
  1152. package/codeyam-cli/src/utils/universal-mocks.js +0 -152
  1153. package/codeyam-cli/src/utils/universal-mocks.js.map +0 -1
  1154. package/codeyam-cli/src/webserver/build/client/assets/EntityItem-Cmysw5OP.js +0 -1
  1155. package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-CAneekK2.js +0 -41
  1156. package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-Cu16OUmx.js +0 -25
  1157. package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-DcAUIpD_.js +0 -11
  1158. package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-BMKg0SAF.js +0 -15
  1159. package/codeyam-cli/src/webserver/build/client/assets/_index-DSmTpjmK.js +0 -11
  1160. package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-BF_aK4y6.js +0 -32
  1161. package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-BdhJEx6B.js +0 -21
  1162. package/codeyam-cli/src/webserver/build/client/assets/cy-logo-cli-CKnwPCDr.js +0 -1
  1163. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-RJCf3Tvw.js +0 -1
  1164. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-EylcgScH.js +0 -1
  1165. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-DMe7kvgo.js +0 -1
  1166. package/codeyam-cli/src/webserver/build/client/assets/files-BW7Cyeyi.js +0 -1
  1167. package/codeyam-cli/src/webserver/build/client/assets/git-CZu4fif0.js +0 -15
  1168. package/codeyam-cli/src/webserver/build/client/assets/globals-wHVy_II5.css +0 -1
  1169. package/codeyam-cli/src/webserver/build/client/assets/keyAttributeCoverage-CTlFMihX.js +0 -1
  1170. package/codeyam-cli/src/webserver/build/client/assets/manifest-2d191949.js +0 -1
  1171. package/codeyam-cli/src/webserver/build/client/assets/root-FHgpM6gc.js +0 -56
  1172. package/codeyam-cli/src/webserver/build/client/assets/settings-6D8k8Jp5.js +0 -1
  1173. package/codeyam-cli/src/webserver/build/client/assets/simulations-CDJZnWhN.js +0 -1
  1174. package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-Dv18q8LD.js +0 -1
  1175. package/codeyam-cli/src/webserver/build/client/assets/useInteractiveMode-0ToGk4K3.js +0 -1
  1176. package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-aSv48UbS.js +0 -2
  1177. package/codeyam-cli/src/webserver/build/client/assets/useReportContext-1BX144Eg.js +0 -1
  1178. package/codeyam-cli/src/webserver/build/server/assets/index-pU0o5t1o.js +0 -1
  1179. package/codeyam-cli/src/webserver/build/server/assets/server-build-YzfkRwdn.js +0 -178
  1180. package/codeyam-cli/templates/codeyam-stop-hook.sh +0 -284
  1181. package/codeyam-cli/templates/debug-codeyam.md +0 -625
  1182. package/packages/ai/src/lib/findMatchingAttribute.js +0 -81
  1183. package/packages/ai/src/lib/findMatchingAttribute.js.map +0 -1
  1184. package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js +0 -425
  1185. package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js.map +0 -1
  1186. package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js +0 -267
  1187. package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js.map +0 -1
  1188. package/packages/ai/src/lib/generateEntityKeyAttributes.js +0 -408
  1189. package/packages/ai/src/lib/generateEntityKeyAttributes.js.map +0 -1
  1190. package/packages/ai/src/lib/isFrontend.js +0 -5
  1191. package/packages/ai/src/lib/isFrontend.js.map +0 -1
  1192. package/packages/ai/src/lib/promptGenerators/generateEntityKeyAttributesGenerator.js +0 -40
  1193. package/packages/ai/src/lib/promptGenerators/generateEntityKeyAttributesGenerator.js.map +0 -1
  1194. package/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.js +0 -77
  1195. package/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.js.map +0 -1
  1196. package/scripts/finalize-analyzer.cjs +0 -81
  1197. /package/codeyam-cli/src/webserver/build/client/assets/{api.link-scenario-value-l0sNRNKZ.js → api.agent-transcripts-l0sNRNKZ.js} +0 -0
  1198. /package/codeyam-cli/src/webserver/build/client/assets/{api.update-key-attributes-l0sNRNKZ.js → api.dev-mode-events-l0sNRNKZ.js} +0 -0
  1199. /package/codeyam-cli/src/webserver/build/client/assets/{api.update-valid-values-l0sNRNKZ.js → api.editor-audit-l0sNRNKZ.js} +0 -0
@@ -1,11 +0,0 @@
1
- import{r as t,c as D,j as e}from"./chunk-EPOLDU6W-CXRTFQ3F.js";import{c as N}from"./createLucideIcon-BdhJEx6B.js";import{C as $}from"./circle-check-BOARzkeR.js";import{T as j}from"./triangle-alert-B6LgvRJg.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 R=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],E=N("bug",R);/**
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 T=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],v=N("settings",T);function F(a){return a.scenarioId?`Scenario: ${a.scenarioId.slice(0,8)}...`:a.entitySha?`Entity: ${a.entitySha.slice(0,8)}...`:"General feedback"}function Y({isOpen:a,onClose:k,context:r,defaultEmail:w="",screenshotDataUrl:d}){const[u,h]=t.useState(""),[x,S]=t.useState(w),[m,g]=t.useState(!1),[o,y]=t.useState(!1),[C,b]=t.useState(null),[l,p]=t.useState(null),i=D(),n=i.state!=="idle";if(i.data&&!o&&!l){const s=i.data;s.success&&s.reportId?(y(!0),b(s.reportId)):s.error&&p(s.error)}const I=async()=>{p(null);const s=new FormData;if(s.append("issueType","other"),s.append("description",u),s.append("email",x),s.append("source",r.source),s.append("entitySha",r.entitySha||""),s.append("scenarioId",r.scenarioId||""),s.append("analysisId",r.analysisId||""),s.append("currentUrl",r.currentUrl),d)try{const z=await(await fetch(d)).blob();s.append("screenshot",z,"screenshot.jpg")}catch(f){console.error("Failed to convert screenshot:",f)}i.submit(s,{method:"post",action:"/api/generate-report",encType:"multipart/form-data"})},c=()=>{h(""),g(!1),y(!1),b(null),p(null),k()},M=s=>{s.key==="Escape"&&c()};return a?e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center p-4 z-50",onKeyDown:M,children:e.jsxs("div",{className:"bg-white rounded-lg max-w-lg w-full p-6 shadow-xl",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[n?e.jsx("div",{className:"animate-spin",children:e.jsx(v,{size:24,style:{strokeWidth:1.5}})}):o?e.jsx($,{size:24,style:{color:"#10B981",strokeWidth:1.5}}):e.jsx(E,{size:24,style:{color:"#005C75",strokeWidth:1.5}}),e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:o?"Report Submitted":"Report Issue"})]}),e.jsx("button",{onClick:c,className:"text-gray-400 hover:text-gray-600 transition-colors cursor-pointer","aria-label":"Close",children:e.jsx("svg",{className:"w-5 h-5",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"})})})]}),o?e.jsxs("div",{children:[e.jsxs("div",{className:"mb-6 p-4 bg-green-50 rounded-lg border border-green-200",children:[e.jsx("p",{className:"text-sm text-green-800 font-medium mb-1",children:"Thank you for your feedback!"}),e.jsxs("p",{className:"text-xs text-green-700",children:["Report ID:"," ",e.jsx("code",{className:"bg-green-100 px-1 rounded",children:C})]})]}),e.jsx("p",{className:"text-sm text-gray-600 mb-6",children:"The CodeYam team will investigate and may reach out if you provided an email address."}),e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{onClick:c,className:"px-4 py-2 bg-[#005c75] text-white text-sm font-medium rounded-md hover:bg-[#004a5c] transition-colors cursor-pointer",children:"Done"})})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"mb-4 p-3 bg-gray-50 rounded-lg border border-gray-200",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-sm font-medium text-gray-900",title:`${r.source}${r.entitySha?` • Entity: ${r.entitySha}`:""}${r.scenarioId?` • Scenario: ${r.scenarioId}`:""}${r.analysisId?` • Analysis: ${r.analysisId}`:""}`,children:F(r)}),e.jsx("button",{type:"button",onClick:()=>g(!m),className:"text-xs text-gray-500 hover:text-gray-700 underline cursor-pointer",children:m?"Hide":"Details"})]}),m&&e.jsxs("div",{className:"mt-2 pt-2 border-t border-gray-200 text-xs text-gray-600 space-y-1",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400",children:"Source:"})," ",r.source]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400",children:"URL:"})," ",r.currentUrl]}),r.entitySha&&e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400",children:"Entity:"})," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:r.entitySha})]}),r.scenarioId&&e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400",children:"Scenario:"})," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:r.scenarioId})]}),r.analysisId&&e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400",children:"Analysis:"})," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:r.analysisId})]})]})]}),d&&e.jsxs("div",{className:"mb-4 p-3 bg-gray-50 rounded-lg border border-gray-200",children:[e.jsx("div",{className:"text-xs text-gray-500 mb-2",children:"Screenshot (will be included in report)"}),e.jsx("img",{src:d,alt:"Page screenshot",className:"w-full max-h-[150px] object-contain rounded border border-gray-300"})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{htmlFor:"description",className:"block text-sm font-medium text-gray-700 mb-2",children:"What happened?"}),e.jsx("textarea",{id:"description",value:u,onChange:s=>h(s.target.value),placeholder:"Describe what you expected vs what happened...",rows:4,className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75] resize-none"})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-2",children:"Your email"}),e.jsx("input",{id:"email",type:"email",value:x,onChange:s=>S(s.target.value),placeholder:"you@example.com",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75]"})]}),e.jsxs("div",{className:"mb-6 p-3 bg-amber-50 rounded-lg border border-amber-200 flex gap-2",children:[e.jsx(j,{size:16,className:"flex-shrink-0 mt-0.5",style:{color:"#D97706"}}),e.jsxs("div",{className:"text-xs text-amber-800",children:[e.jsx("p",{className:"font-medium mb-1",children:"Source code will be uploaded"}),e.jsx("p",{children:"This report includes your project source code, git history, and CodeYam logs. Only submit if you're comfortable sharing this with the CodeYam team."})]})]}),n&&e.jsx("div",{className:"mb-4 text-center",children:e.jsx("p",{className:"text-sm text-gray-600",children:i.formData?"Uploading report...":"Creating archive..."})}),l&&e.jsxs("div",{className:"mb-4 p-3 bg-red-50 rounded-lg border border-red-200 flex gap-2",children:[e.jsx(j,{size:16,className:"flex-shrink-0 mt-0.5",style:{color:"#DC2626"}}),e.jsxs("div",{className:"text-xs text-red-800",children:[e.jsx("p",{className:"font-medium mb-1",children:"Upload failed"}),e.jsx("p",{children:l})]})]}),e.jsxs("div",{className:"flex gap-3 justify-end",children:[e.jsx("button",{onClick:c,disabled:n,className:"px-4 py-2 bg-gray-100 text-gray-700 text-sm font-medium rounded-md hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-gray-300 transition-colors disabled:opacity-50 cursor-pointer",children:"Cancel"}),e.jsx("button",{onClick:()=>void I(),disabled:n,className:"px-4 py-2 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 disabled:bg-gray-300 disabled:cursor-not-allowed flex items-center gap-2 cursor-pointer",children:n?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"animate-spin",children:e.jsx(v,{size:16,style:{strokeWidth:1.5}})}),"Submitting..."]}):l?"Try Again":"Submit Report"})]})]})]})}):null}export{E as B,Y as R,v as S};
@@ -1,15 +0,0 @@
1
- import{r as i,j as e,c as ge,L as le}from"./chunk-EPOLDU6W-CXRTFQ3F.js";import{I as be}from"./InteractivePreview-Cu16OUmx.js";import{u as je,V as we,S as Ne}from"./useCustomSizes-Dv18q8LD.js";import{L as ve}from"./LogViewer-xgeCVgSM.js";import{S as ke}from"./SafeScreenshot-DuDvi0jm.js";import{u as ye}from"./useLastLogLine-aSv48UbS.js";import{u as Ce}from"./useInteractiveMode-0ToGk4K3.js";import{_ as Ie}from"./preload-helper-ckwbz45p.js";import{R as Le}from"./ReportIssueModal-DcAUIpD_.js";import{c as de}from"./createLucideIcon-BdhJEx6B.js";import{g as Ee}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 $e=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Pe=de("check",$e);/**
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"}]],Se=de("copy",_e);function Be({presets:s,customSizes:t,currentWidth:n,currentHeight:o,scale:v,onSizeChange:w,onSaveCustomSize:j,onRemoveCustomSize:x,className:k=""}){const[m,d]=i.useState(!1),[g,N]=i.useState(String(n)),[u,b]=i.useState(String(o)),[y,h]=i.useState(!1),[l,R]=i.useState(!1),$=i.useRef(null);i.useEffect(()=>{y||N(String(n))},[n,y]),i.useEffect(()=>{l||b(String(o))},[o,l]),i.useEffect(()=>{const r=f=>{$.current&&!$.current.contains(f.target)&&d(!1)};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[]);const P=i.useMemo(()=>{const r=s.find(c=>c.width===n&&c.height===o);if(r)return r.name;const f=t.find(c=>c.width===n&&c.height===o);return f?f.name:"Custom"},[s,t,n,o]),O=P==="Custom",F=r=>{w(r.width,r.height),d(!1)},W=r=>{const f=r.target.value;N(f);const c=parseInt(f,10);!isNaN(c)&&c>0&&w(c,o)},U=r=>{const f=r.target.value;b(f);const c=parseInt(f,10);!isNaN(c)&&c>0&&w(n,c)},A=()=>{h(!1);const r=parseInt(g,10);(isNaN(r)||r<=0)&&N(String(n))},K=()=>{R(!1);const r=parseInt(u,10);(isNaN(r)||r<=0)&&b(String(o))},D=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:$,children:[e.jsxs("button",{onClick:()=>d(!m),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:P}),e.jsx("svg",{className:`w-4 h-4 transition-transform ${m?"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"})})]}),m&&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:()=>F(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 ${P===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,f)=>r.width-f.width).map(r=>e.jsxs("div",{className:`flex items-center gap-1 hover:bg-gray-100 ${P===r.name?"bg-[#f0f7f9] text-[#005c75]":"text-gray-700"}`,children:[e.jsxs("button",{onClick:()=>F(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]})]}),x&&e.jsx("button",{onClick:f=>{f.stopPropagation(),P===r.name&&s.length>0&&w(s[0].width,s[0].height),x(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:g,onChange:W,onFocus:()=>h(!0),onBlur:A,onKeyDown:D,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:u,onChange:U,onFocus:()=>R(!0),onBlur:K,onKeyDown:D,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),"%)"]})]}),O&&e.jsx("button",{onClick:j,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 ie({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 Fe({scenario:s,analysis:t,entity:n}){var j,x,k;const o=((j=s.metadata)==null?void 0:j.executionResult)||null,v=((k=(x=s.metadata)==null?void 0:x.data)==null?void 0:k.argumentsData)||[],w=m=>{var b,y,h;if(!m)return"No execution results available yet. Run the function to capture side effects including console output, file operations, and API calls.";const d=[],g=((b=m.sideEffects)==null?void 0:b.consoleOutput)||[];g.length>0&&(d.push(`Console Output: ${g.length} log ${g.length===1?"entry":"entries"} captured`),g.forEach(l=>{d.push(` [${l.level.toUpperCase()}] ${l.args.join(" ")}`)}));const N=((y=m.sideEffects)==null?void 0:y.fileWrites)||[];N.length>0&&(d.push(`
12
- File System Operations: ${N.length} ${N.length===1?"operation":"operations"} detected`),N.forEach(l=>{d.push(` ${l.operation}: ${l.path}${l.size?` (${l.size} bytes)`:""}`)}));const u=((h=m.sideEffects)==null?void 0:h.apiCalls)||[];return u.length>0&&(d.push(`
13
- API Calls: ${u.length} ${u.length===1?"call":"calls"} made`),u.forEach(l=>{d.push(` ${l.method} ${l.url}${l.status?` → ${l.status}`:""}${l.duration?` (${l.duration}ms)`:""}`)})),m.error&&d.push(`
14
- Error: ${m.error.name||"Error"}: ${m.error.message}`),d.length===0?"No side effects detected. The function executed without console output, file operations, or API calls.":d.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:w(o)})})]})]})}const B={commandBoxBg:"#f6f9fc",commandBoxBorder:"#e1e1e1",commandBoxText:"#005c75",heading:"#000",subtext:"#646464",link:"#005c75"};function T({scenarioId:s,analysisId:t}){const[n,o]=i.useState(!1),[v,w]=i.useState(!1),[j,x]=i.useState(null),[k,m]=i.useState(!1),d=s||t;if(!d)return null;const g=`/debug-codeyam ${d}`,N=async()=>{w(!0);try{const{default:b}=await Ie(async()=>{const{default:l}=await import("./html2canvas-pro.esm-fmIEn3Bc.js");return{default:l}},[]),h=(await b(document.body,{scale:.5})).toDataURL("image/jpeg",.8);x(h),o(!0)}catch(b){console.error("Screenshot capture failed:",b),o(!0)}finally{w(!1)}},u=()=>{o(!1),x(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:B.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:B.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:B.commandBoxBg,borderColor:B.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:B.commandBoxText},children:g}),e.jsx("button",{onClick:b=>{b.stopPropagation(),navigator.clipboard.writeText(g),m(!0),setTimeout(()=>m(!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":B.commandBoxText},title:k?"Copied!":"Copy command","aria-label":"Copy command to clipboard",children:k?e.jsx(Pe,{size:14}):e.jsx(Se,{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 N(),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:B.link},children:v?"capturing...":"please do so here"}),"."]})]}),e.jsx(Le,{isOpen:n,onClose:u,context:{source:s?"scenario-page":"entity-page",entitySha:void 0,scenarioId:s,analysisId:t,currentUrl:typeof window<"u"?window.location.pathname:"/"},screenshotDataUrl:j??void 0})]})}const ce=1440,H=[{name:"Mobile",width:375,height:667},{name:"Tablet",width:768,height:1024},{name:"Laptop",width:1024,height:768},{name:"Desktop",width:1440,height:900}],L={background:"#ffdcd9",border:"#fda4a4",text:"#ef4444",link:"#991b1b"};function Ke({selectedScenario:s,analysis:t,entity:n,viewMode:o,cacheBuster:v,hasScenarios:w,isAnalyzing:j=!1,projectSlug:x,hasAnApiKey:k=!0,processIsRunning:m,queueState:d}){var G,Q,X,Z,ee,te,se,re,ne,oe,ae;const g=ge(),[N,u]=i.useState(!1),[b,y]=i.useState(!1),[h,l]=i.useState({name:"Desktop",width:ce,height:900}),[R,$]=i.useState(ce),[P,O]=i.useState(1),{customSizes:F,addCustomSize:W,removeCustomSize:U}=je(x),A=i.useMemo(()=>[...H,...F],[F]),K=(a,I)=>{$(a);const C=A.find(p=>p.width===a&&p.height===I);l({name:(C==null?void 0:C.name)||"Custom",width:a,height:I})},D=a=>{$(a.width),l({name:a.name,width:a.width,height:a.height})},r=a=>{W(a,h.width,h.height??900),y(!1),l(I=>({...I,name:a}))},f=(a,I)=>{$(a);const C=A.find(p=>p.width===a&&p.height===I);l(p=>({name:(C==null?void 0:C.name)||"Custom",width:a,height:p.height}))},c=(Q=(G=s==null?void 0:s.metadata)==null?void 0:G.screenshotPaths)==null?void 0:Q[0],M=i.useMemo(()=>s?Ee(s,t==null?void 0:t.status,m,n==null?void 0:n.sha,d):null,[s,t==null?void 0:t.status,m,n==null?void 0:n.sha,d]),E=i.useMemo(()=>{var I,C;const a=[];if((I=t==null?void 0:t.status)!=null&&I.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},[(X=t==null?void 0:t.status)==null?void 0:X.errors,(Z=t==null?void 0:t.status)==null?void 0:Z.steps]),_=(M==null?void 0:M.errorMessage)||null,J=(M==null?void 0:M.errorStack)||null,{interactiveServerUrl:Y,isStarting:q,isLoading:xe,showIframe:me,iframeKey:he,onIframeLoad:ue}=Ce({analysisId:t==null?void 0:t.id,scenarioId:s==null?void 0:s.id,scenarioName:s==null?void 0:s.name,projectSlug:x,enabled:o==="interactive"}),V=i.useMemo(()=>Y||null,[Y]),z=!j&&w&&s&&!((te=(ee=s.metadata)==null?void 0:ee.screenshotPaths)!=null&&te[0])&&((re=(se=t==null?void 0:t.status)==null?void 0:se.scenarios)==null?void 0:re.some(a=>a.name===s.name&&a.screenshotStartedAt&&!a.screenshotFinishedAt)),{lastLine:S}=ye(x,j||o==="interactive"||z||!1);if(!s){if(j&&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:z?"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."}),S&&e.jsx("p",{className:"text-xs font-mono text-[#005c75] text-center leading-5 m-0 max-w-xl",children:S}),x&&e.jsx("button",{onClick:()=>u(!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(!w&&n&&!j){if(E.length>0){const a=E.length===1?((ne=E[0])==null?void 0:ne.message)||"An error occurred during analysis.":`${E.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:L.background,border:`2px solid ${L.border}`},role:"alert",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ie,{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:L.text},children:[e.jsx("span",{className:"font-semibold",children:"Analysis Error."})," ",a," ",e.jsx("button",{onClick:()=>u(!0),className:"underline cursor-pointer bg-transparent border-none p-0 font-medium hover:opacity-80",style:{color:L.link},children:"See logs"})," ","for details."]})})]})}),e.jsx("div",{className:"bg-white border rounded-lg",style:{borderColor:"#e1e1e1"},children:e.jsx(T,{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:()=>{g.submit({entitySha:n.sha,filePath:n.filePath},{method:"post",action:"/api/analyze"})},disabled:g.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:g.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 fe=o==="screenshot"&&(c||_)||o==="interactive"&&(V||q)||o==="data",pe=(j||z&&!c)&&!_&&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:pe?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:z?`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:z?`Taking screenshots for ${((oe=t==null?void 0:t.scenarios)==null?void 0:oe.length)||0} scenario${((ae=t==null?void 0:t.scenarios)==null?void 0:ae.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]})]}),S&&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:S,children:S})]})]})}),x&&e.jsx("button",{onClick:()=>u(!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."})]})}):fe?e.jsxs(e.Fragment,{children:[_&&!c&&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:L.background,border:`2px solid ${L.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:L.text},children:[e.jsx(ie,{size:24,className:"shrink-0"}),e.jsx("div",{children:"Capture Error"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("button",{onClick:()=>u(!0),className:"underline cursor-pointer bg-transparent border-none p-0 font-medium hover:opacity-80",style:{color:L.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:L.text},children:_})})]})}),e.jsx("div",{className:"bg-white border rounded-lg",style:{borderColor:"#e1e1e1"},children:e.jsx(T,{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:[V&&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(Be,{presets:[...H],customSizes:F,currentWidth:h.width,currentHeight:h.height??900,scale:P,onSizeChange:K,onSaveCustomSize:()=>y(!0),onRemoveCustomSize:U}),s&&n&&e.jsxs(le,{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"]})]}),V&&e.jsx("div",{className:"bg-[#f6f9fc] border-b border-[rgba(0,92,117,0.25)] flex justify-center",children:e.jsx("div",{style:{maxWidth:`${H[H.length-1].width}px`,width:"100%"},children:e.jsx(we,{currentViewportWidth:R,currentPresetName:h.name,onDevicePresetClick:D,devicePresets:A})})}),e.jsx(be,{scenarioId:s.id,scenarioName:s.name,iframeUrl:V,isStarting:q,isLoading:xe,showIframe:me,iframeKey:he,onIframeLoad:ue,onScaleChange:O,onDimensionChange:f,projectSlug:x,defaultWidth:h.width,defaultHeight:h.height})]}):o==="data"?e.jsx("div",{className:"flex-1 min-h-0",children:e.jsx(Fe,{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:`${R}px`},children:(c||!_)&&e.jsx(ke,{screenshotPath:c,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:j&&!c?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."]}),S&&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:S})]}),x&&e.jsx("button",{onClick:()=>u(!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(le,{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:_})})]}),J&&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:J})})]}),e.jsx("div",{className:"mt-4 bg-white border rounded-lg",style:{borderColor:"#e1e1e1"},children:e.jsx(T,{scenarioId:s==null?void 0:s.id,analysisId:t==null?void 0:t.id})})]})]})})]}):E.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:E,title:"Analysis Error",description:E.length===1?"An error occurred during analysis. Screenshot capture was not completed.":`${E.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(T,{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"})]})})})}),N&&x&&e.jsx(ve,{projectSlug:x,onClose:()=>u(!1)}),b&&e.jsx(Ne,{width:h.width,height:h.height??900,onSave:r,onCancel:()=>y(!1)})]})}export{T as C,ie as E,Ke as S};
@@ -1,11 +0,0 @@
1
- import{r as h,j as e,L as j,w as se,u as te,c as ae,f as le}from"./chunk-EPOLDU6W-CXRTFQ3F.js";import{u as ne}from"./useLastLogLine-aSv48UbS.js";import{u as re}from"./useToast-mBRpZPiu.js";import{u as ie}from"./useReportContext-1BX144Eg.js";import{L as oe}from"./LogViewer-xgeCVgSM.js";import{I as k,C as P,E as ce}from"./EntityTypeIcon-CAneekK2.js";import{S as U}from"./SafeScreenshot-DuDvi0jm.js";import{c as Z}from"./createLucideIcon-BdhJEx6B.js";import{C as de}from"./circle-check-BOARzkeR.js";import{L as C}from"./loader-circle-B7B9V-bu.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 xe=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],me=Z("folder-open",xe);/**
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 he=[["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"}]],pe=Z("zap",he);function ue({recentSimulations:p}){const g=h.useMemo(()=>{const l=new Map;return p.forEach(a=>{const d=a.entitySha,c=l.get(d);c?c.push(a):l.set(d,[a])}),Array.from(l.entries()).map(([a,d])=>({entitySha:a,entityName:d[0].entityName,scenarios:d}))},[p]);return 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?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-6 mb-5",children:g.map(l=>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(k,{size:16,style:{color:"#8B5CF6"}})}),e.jsx(j,{to:`/entity/${l.entitySha}`,className:"text-sm font-semibold text-gray-900 no-underline hover:text-gray-700 transition-colors",children:l.entityName})]}),e.jsx("div",{className:"grid grid-cols-4 gap-3",children:l.scenarios.map((a,d)=>e.jsx(j,{to:a.scenarioId?`/entity/${a.entitySha}/scenarios/${a.scenarioId}`:`/entity/${a.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:c=>{c.currentTarget.style.borderColor="#005C75",c.currentTarget.style.boxShadow="0 4px 12px rgba(0, 92, 117, 0.2)"},onMouseLeave:c=>{c.currentTarget.style.borderColor="#E5E7EB",c.currentTarget.style.boxShadow="none"},title:a.scenarioName,children:e.jsx(U,{screenshotPath:a.screenshotPath,alt:a.scenarioName,className:"max-w-full max-h-full object-contain object-center"})},a.scenarioId||`${a.entitySha}-${d}`))})]},l.entitySha))}),e.jsx(j,{to:"/simulations",className:"block text-center p-3 rounded-lg no-underline font-semibold text-sm transition-all",style:{color:"#005C75",backgroundColor:"#F6F9FC"},onMouseEnter:l=>l.currentTarget.style.backgroundColor="#EEF4F8",onMouseLeave:l=>l.currentTarget.style.backgroundColor="#F6F9FC",children:"View All Recent Simulations →"})]}):e.jsx("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(k,{size:28,style:{color:"#999999"},strokeWidth:1.5})}),e.jsx("p",{className:"text-gray-700 m-0 font-semibold",children:"No simulations captured yet."}),e.jsx("p",{className:"text-sm text-gray-500 m-0 mt-2",children:"Run analysis on your visual components to create simulations and capture screenshots."})]})})]})}const ge="/assets/codeyam-name-logo-CvKwUgHo.svg",Ee=()=>[{title:"Dashboard - CodeYam"},{name:"description",content:"CodeYam project dashboard"}],Fe=se(function(){var R,W;const{stats:g,uncommittedFiles:l,uncommittedEntitiesList:a,recentSimulations:d,visualEntitiesForSimulation:c,projectSlug:y,queueState:$,currentCommit:S}=te(),x=ae(),q=le(),{showToast:f}=re();ie({source:"dashboard"});const[Q,Y]=h.useState(new Set),[m,O]=h.useState(null),[G,M]=h.useState(!1),[D,E]=h.useState(!1),{lastLine:F,isCompleted:B}=ne(y,!!m),{simulatingEntity:T,scenarios:N,scenarioStatuses:K,allScenariosCaptured:L}=h.useMemo(()=>{var r,w;const s={simulatingEntity:null,scenarios:[],scenarioStatuses:[],allScenariosCaptured:!1};if(!m)return s;const o=c==null?void 0:c.find(z=>z.sha===m);if(!o)return s;const n=(r=o.analyses)==null?void 0:r[0],i=(n==null?void 0:n.scenarios)||[],t=((w=n==null?void 0:n.status)==null?void 0:w.scenarios)||[],b=t.filter(z=>z.screenshotFinishedAt).length,u=i.length>0&&b===i.length;return{simulatingEntity:o,scenarios:i,scenarioStatuses:t,allScenariosCaptured:u}},[m,c]);h.useEffect(()=>{(B||L)&&O(null)},[B,L]);const A=(R=S==null?void 0:S.metadata)==null?void 0:R.currentRun,V=new Set((A==null?void 0:A.currentEntityShas)||[]),_=new Set($.jobs.flatMap(s=>s.entityShas||[])),H=new Set(((W=$.currentlyExecuting)==null?void 0:W.entityShas)||[]),I=a.filter(s=>s.entityType==="visual"||s.entityType==="library"),v=I.filter(s=>!V.has(s.sha)&&!_.has(s.sha)&&!H.has(s.sha)),X=()=>{if(v.length===0){f("All entities are already queued or analyzing","info",3e3);return}const s=v.map(o=>o.sha);E(!0),f(`Starting analysis for ${v.length} entities...`,"info",3e3),x.submit({entityShas:s.join(",")},{method:"post",action:"/api/analyze"})};h.useEffect(()=>{if(x.state==="idle"&&x.data){const s=x.data;s.success?(console.log("[Analyze All] Success:",s.message),f(`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),f(`Error: ${s.error}`,"error",8e3),E(!1))}},[x.state,x.data,f]);const J=s=>{Y(o=>{const n=new Set(o);return n.has(s)?n.delete(s):n.add(s),n})},ee=[{label:"Total Entities",value:g.totalEntities,iconType:"folder",link:"/files",color:"#F59E0B"},{label:"Analyzed Entities",value:g.entitiesWithAnalyses,iconType:"check",link:"/simulations",color:"#10B981"},{label:"Visual Components",value:g.visualEntities,iconType:"image",link:"/files?entityType=visual",color:"#8B5CF6"},{label:"Library Functions",value:g.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:ge,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:y?y.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:ee.map((s,o)=>e.jsx(j,{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(me,{size:20,style:{color:s.color}}),s.iconType==="check"&&e.jsx(de,{size:20,style:{color:s.color}}),s.iconType==="image"&&e.jsx(k,{size:20,style:{color:s.color}}),s.iconType==="code-xml"&&e.jsx(P,{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 →"})]})]})},o))}),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:l.length>0?`${l.length} file${l.length!==1?"s":""} with ${a.length} uncommitted entit${a.length!==1?"ies":"y"}`:"No uncommitted changes detected"})]}),I.length>0&&e.jsx("button",{onClick:X,disabled:x.state!=="idle"||D||v.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:x.state!=="idle"||D?"Starting analysis...":v.length===0?"All Queued":"Analyze All"})]}),l.length>0?e.jsx("div",{className:"flex flex-col gap-3",children:l.map(([s,o])=>{const n=Q.has(s),i=o.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:()=>J(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:n?"▼":"▶"}),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:[i.length," entit",i.length!==1?"ies":"y"]})]})]})}),n&&e.jsx("div",{className:"border-t border-gray-200 bg-gray-50 p-3 flex flex-col gap-2",children:i.length>0?i.map(t=>{const b=V.has(t.sha),u=_.has(t.sha)||H.has(t.sha);return e.jsxs(j,{to:`/entity/${t.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:t.entityType==="visual"?"#8B5CF615":t.entityType==="library"?"#6366F1":"#EC4899"},children:[t.entityType==="visual"&&e.jsx(k,{size:16,style:{color:"#8B5CF6"}}),t.entityType==="library"&&e.jsx(P,{size:16,className:"text-white"}),t.entityType==="other"&&e.jsx(pe,{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:t.name}),t.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"}),t.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"}),t.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"})]}),t.description&&e.jsx("div",{className:"text-sm text-gray-500 mt-1 overflow-hidden text-ellipsis whitespace-nowrap",children:t.description})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[b&&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..."]}),!b&&u&&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"}),!b&&!u&&e.jsx("button",{onClick:r=>{r.preventDefault(),r.stopPropagation(),f(`Starting analysis for ${t.name}...`,"info",3e3),x.submit({entityShas:t.sha},{method:"post",action:"/api/analyze"})},disabled:x.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"})]})]},t.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."})]})]}),!m&&e.jsx(ue,{recentSimulations:d}),m&&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:d.length>0?`Latest ${d.length} captured screenshot${d.length!==1?"s":""}`:"No simulations captured yet"})]})}),m&&e.jsxs("div",{className:"p-0 bg-white rounded-lg flex flex-col gap-0",children:[T&&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(ce,{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 ",T.name]}),e.jsx("div",{className:"text-[13px] text-gray-500 font-mono overflow-hidden text-ellipsis whitespace-nowrap",children:T.filePath})]})]})}),L?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}),y&&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"})]}):x.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,o)=>{var u,r;const n=(r=(u=s.metadata)==null?void 0:u.screenshotPaths)==null?void 0:r[0],i=K.find(w=>w.name===s.name),t=(i==null?void 0:i.screenshotStartedAt)&&!(i!=null&&i.screenshotFinishedAt);return n?e.jsx(j,{to:`/entity/${m}`,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:n,alt:s.name,title:s.name,className:"max-w-full max-h-full object-contain object-center"})},o):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:t?"animate-pulse":"text-gray-400",children:t?"⋯":"⏹️"})},o)})})]})]})]}),G&&y&&e.jsx(oe,{projectSlug:y,onClose:()=>M(!1)})]})})});export{Fe as default,Ee as meta};
@@ -1,32 +0,0 @@
1
- import{j as e,w as X,u as Z,h as R,r as A,L as N,f as U}from"./chunk-EPOLDU6W-CXRTFQ3F.js";import{L as ee}from"./LogViewer-xgeCVgSM.js";import{u as te}from"./useLastLogLine-aSv48UbS.js";import{u as se}from"./useReportContext-1BX144Eg.js";import{E as q}from"./EntityTypeIcon-CAneekK2.js";import{E as Q}from"./EntityTypeBadge-DLqD3qNt.js";import{S as B}from"./SafeScreenshot-DuDvi0jm.js";import{L as ie}from"./LoadingDots-B0GLXMsr.js";import{L as le}from"./loader-circle-B7B9V-bu.js";import{c as K}from"./createLucideIcon-BdhJEx6B.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=K("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"}]],Y=K("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=K("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=K("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=K("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 V({variant:a,pid:t,label:S,className:h=""}){const n=fe[a],l=S||(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] ${h}`,style:{backgroundColor:n.bgColor,borderWidth:"1px",borderStyle:"solid",borderColor:n.borderColor,height:"20px"},children:e.jsx("span",{className:"font-['IBM_Plex_Sans']",style:{fontSize:"10px",fontWeight:400,lineHeight:"15px",color:n.textColor},children:l})})}function ge({activeTab:a,hasCurrentActivity:t,queuedCount:S,historicCount:h}){const n=[{id:"current",label:"Current Activity",hasContent:t,count:t?1:null},{id:"queued",label:"Queued Activity",hasContent:S>0,count:S},{id:"historic",label:"Historic Activity",hasContent:h>0,count:h}];return e.jsx("div",{className:"border-b border-gray-200 mb-6",children:e.jsx("nav",{className:"flex gap-8",children:n.map(l=>{const r=a===l.id;return e.jsx(N,{to:l.id==="current"?"/activity":`/activity/${l.id}`,className:`
27
- relative pb-4 px-2 text-sm font-medium transition-colors cursor-pointer
28
- ${r?"border-b-2":"text-gray-500 hover:text-gray-700"}
29
- `,style:r?{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 ${r?"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
- ${r?"":"bg-gray-400"}
32
- `,style:r?{backgroundColor:"#005C75"}:{}})]})},l.id)})})})}function me({currentlyExecuting:a,currentRun:t,state:S,projectSlug:h,commitSha:n,onShowLogs:l,recentCompletedEntities:r,hasMoreCompletedRuns:d,currentEntityScenarios:v,currentEntityForScenarios:g,currentAnalysisStatus:m}){var D,_,z,J;const[j,b]=A.useState({}),[L,$]=A.useState({isKilling:!1,current:0,total:0}),W=U(),E=!!a,k=(a==null?void 0:a.entities)||[],s=!!(t!=null&&t.analysisCompletedAt),c=s&&!!(t!=null&&t.capturePid),f=!s,M=E,C=v||[],{lastLine:y}=te(h,M);A.useEffect(()=>{if(!t)return;const i=[t.analyzerPid,t.capturePid].filter(o=>!!o);if(i.length===0)return;let p=!0;const w=async()=>{try{const P=await(await fetch(`/api/process-status?pids=${i.join(",")}`)).json();if(P.processes&&p){const T={};P.processes.forEach(H=>{T[H.pid]={isRunning:H.isRunning,processName:H.processName}}),b(T)}}catch(o){p&&console.error("Failed to fetch process statuses:",o)}};w();const x=setInterval(()=>void w(),5e3);return()=>{p=!1,clearInterval(x)}},[t==null?void 0:t.analyzerPid,t==null?void 0:t.capturePid]);const u=k==null?void 0:k[0];return e.jsxs("div",{className:"flex flex-col gap-[45px]",children:[M?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:c?"Capturing...":"Analyzing..."})]}),u&&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(q,{type:u.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(N,{to:`/entity/${u.sha}`,className:"hover:underline cursor-pointer",style:{fontSize:"14px",lineHeight:"18px",fontWeight:500,color:"#000"},children:u.name}),u.entityType&&e.jsx(Q,{type:u.entityType})]}),e.jsx("div",{className:"truncate",style:{fontSize:"12px",lineHeight:"15px",color:"#8e8e8e",width:"422px"},title:u.filePath,children:u.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"})]}),c&&C&&C.length>0&&g&&e.jsx("div",{className:"flex gap-[10px] overflow-x-auto mb-[15px]",children:C.map(i=>{var H,I,O,F;if(!i.id)return null;const p=(I=(H=i.metadata)==null?void 0:H.screenshotPaths)==null?void 0:I[0],w=(O=i.metadata)==null?void 0:O.noScreenshotSaved,x=p&&!w,o=(F=m==null?void 0:m.scenarios)==null?void 0:F.find(G=>G.name===i.name),T=o&&o.screenshotStartedAt&&!o.screenshotFinishedAt||!x&&!w;return e.jsx(N,{to:`/entity/${g.sha}/scenarios/${i.id}`,className:"border border-solid rounded-[6px] overflow-hidden flex-shrink-0 cursor-pointer",style:{width:"160px",height:"90px",backgroundColor:T?"#f9f9f9":void 0,borderColor:T?"#efefef":"#ccc"},children:x?e.jsx(B,{screenshotPath:p,alt:i.name,className:"w-full h-full object-contain bg-gray-100"}):T?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)})}),y&&e.jsx("div",{className:"mb-[15px] font-['IBM_Plex_Mono']",style:{fontSize:"12px",lineHeight:"20px",fontWeight:500,color:"#005c75"},children:y}),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(V,{variant:"analyzer",pid:t.analyzerPid}),(t==null?void 0:t.analyzerPid)&&(f||((D=j[t.analyzerPid])==null?void 0:D.isRunning))&&e.jsx(V,{variant:"running"}),(t==null?void 0:t.capturePid)&&e.jsx(V,{variant:"capture",pid:t.capturePid}),(t==null?void 0:t.capturePid)&&(c||((_=j[t.capturePid])==null?void 0:_.isRunning))&&e.jsx(V,{variant:"running"})]}),(((z=j[t==null?void 0:t.analyzerPid])==null?void 0:z.isRunning)||((J=j[t==null?void 0:t.capturePid])==null?void 0:J.isRunning))&&e.jsx("button",{onClick:()=>{const i=[t==null?void 0:t.analyzerPid,t==null?void 0:t.capturePid].filter(x=>{var o;return!!x&&((o=j[x])==null?void 0:o.isRunning)});if(i.length===0)return;const p=i.join(", ");if(!confirm(`Are you sure you want to kill all running processes (${p})?`))return;$({isKilling:!0,current:1,total:i.length}),(async()=>{for(let x=0;x<i.length;x++){const o=i[x];try{await fetch("/api/kill-process",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pid:o,commitSha:n||""})})}catch(P){console.error(`Failed to kill process ${o}:`,P)}x<i.length-1&&$({isKilling:!0,current:x+2,total:i.length})}$({isKilling:!1,current:0,total:0}),W.revalidate()})()},disabled:L.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:L.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(Y,{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(N,{to:"/git",className:"text-[#005C75] underline hover:text-[#004a5e] font-medium cursor-pointer",children:"Git"})," ","or"," ",e.jsx(N,{to:"/files",className:"text-[#005C75] underline hover:text-[#004a5e] font-medium cursor-pointer",children:"Files"})," ","page."]})]}),r&&r.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:r.map(i=>{var x;const p=(x=i.analyses)==null?void 0:x[0],w=(p==null?void 0:p.scenarios)||[];return p==null||p.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(q,{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(N,{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"})})]}),w.length>0?e.jsx("div",{className:"flex gap-[10px] overflow-x-auto",children:w.map(o=>{var I,O,F;if(!o.id)return null;const P=(O=(I=o.metadata)==null?void 0:I.screenshotPaths)==null?void 0:O[0],T=(F=o.metadata)==null?void 0:F.noScreenshotSaved,H=P&&!T;return e.jsx(N,{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:H?e.jsx(B,{screenshotPath:P,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:S}){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[h,n]=A.useState(null),[l,r]=A.useState(null),[d,v]=A.useState(null),[g,m]=A.useState(!1),j=U(),b=s=>{n(s)},L=(s,c)=>{s.preventDefault(),r(c)},$=async(s,c)=>{if(s.preventDefault(),!h){r(null);return}const f=a.findIndex(y=>y.id===h);if(f===-1){n(null),r(null);return}if(f===c){n(null),r(null);return}const M=f<c?"down":"up",C=Math.abs(c-f);m(!0);try{for(let y=0;y<C;y++)await fetch("/api/queue",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"reorder",jobId:h,direction:M})});j.revalidate()}catch(y){console.error("Failed to reorder job:",y)}finally{m(!1),n(null),r(null)}},W=()=>{g||(n(null),r(null))},E=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(c){console.error("Failed to cancel job:",c)}},k=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 k(),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,c)=>{var u,D,_;const f=(u=s.entities)==null?void 0:u[0],M=d===c,C=h===s.id,y=l===c;return e.jsxs("div",{className:"rounded-lg p-4 relative",style:{backgroundColor:"#f6f9fc",border:"2px solid #005C75",opacity:C||g?.5:1,transform:y&&h!==null&&!C?"translateY(-2px)":"translateY(0)",transition:"transform 0.2s ease, opacity 0.2s ease",cursor:g?"not-allowed":C?"grabbing":"grab"},onMouseEnter:()=>v(c),onMouseLeave:()=>v(null),draggable:!g,onDragStart:z=>{b(s.id),z.dataTransfer.effectAllowed="move"},onDragOver:z=>L(z,c),onDrop:z=>void $(z,c),onDragEnd:W,children:[e.jsxs("div",{className:"absolute left-4 top-4 flex items-center gap-1.5 flex-shrink-0",children:[e.jsx(Y,{size:16,style:{color:"#005C75"}}),e.jsxs("span",{style:{fontSize:"14px",fontWeight:500,lineHeight:"18px",color:"#005C75"},children:["Job ",c+1]})]}),e.jsx("div",{className:"bg-white rounded mt-8",style:{border:"1px solid #e1e1e1",height:"60px"},children:e.jsxs("div",{className:"flex items-center justify-between h-full px-[15px]",children:[f?e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[e.jsx("div",{style:{transform:"scale(1.0)"},children:e.jsx(q,{type:f.entityType||"other"})}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(N,{to:`/entity/${f.sha}`,className:"hover:underline cursor-pointer",style:{fontSize:"14px",lineHeight:"18px",fontWeight:500,color:"#000"},children:f.name}),f.entityType&&e.jsx(Q,{type:f.entityType})]}),e.jsx("div",{style:{fontSize:"12px",lineHeight:"15px",color:"#8e8e8e"},children:f.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:((D=s.entityNames)==null?void 0:D[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:((_=s.filePaths)==null?void 0:_[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")})]})]}),M&&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 E(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:S,totalPages:h,tab:n,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 r=[];return a.forEach(d=>{d.entities&&d.entities.length>0&&d.entities.forEach(v=>{r.push({...v,runCreatedAt:d.createdAt})})}),e.jsx("div",{className:"flex flex-col gap-4",children:r.slice(0,20).map(d=>{var j;const v=(j=d.analyses)==null?void 0:j[0],g=(v==null?void 0:v.scenarios)||[],m=!d.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(q,{type:d.entityType||"other"})}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(N,{to:`/entity/${d.sha}`,className:"hover:underline cursor-pointer",style:{fontSize:"14px",lineHeight:"18px",fontWeight:500,color:"#343434"},children:d.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:d.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"})]}),g.length>0&&e.jsxs("div",{className:"flex gap-2 overflow-x-auto",children:[g.slice(0,8).map(b=>{var E,k,s;if(!b.id)return null;const L=(k=(E=b.metadata)==null?void 0:E.screenshotPaths)==null?void 0:k[0],$=(s=b.metadata)==null?void 0:s.noScreenshotSaved,W=L&&!$;return e.jsx(N,{to:`/entity/${d.sha}/scenarios/${b.id}`,className:"border border-gray-300 rounded overflow-hidden flex-shrink-0 cursor-pointer",style:{width:"120px",height:"80px"},children:W?e.jsx(B,{screenshotPath:L,alt:b.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"})},b.id)}),g.length>8&&e.jsxs("div",{className:"flex items-center justify-center flex-shrink-0",style:{width:"120px",height:"80px",fontSize:"12px",color:"#646464"},children:["+",g.length-8," more"]})]})]},`${d.sha}-${d.runCreatedAt}`)})})}const Te=X(function(){const t=Z(),S=R(),[h,n]=A.useState(!1);se({source:"activity-page"});const l=S.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:()=>n(!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:()=>n(!0)}),h&&t.projectSlug&&e.jsx(ee,{projectSlug:t.projectSlug,onClose:()=>n(!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};
@@ -1,21 +0,0 @@
1
- import{r as s}from"./chunk-EPOLDU6W-CXRTFQ3F.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 C=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),w=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,o)=>o?o.toUpperCase():r.toLowerCase()),i=t=>{const e=w(t);return e.charAt(0).toUpperCase()+e.slice(1)},l=(...t)=>t.filter((e,r,o)=>!!e&&e.trim()!==""&&o.indexOf(e)===r).join(" ").trim(),f=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};/**
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
- */var h={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
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 g=s.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:n="",children:a,iconNode:u,...c},p)=>s.createElement("svg",{ref:p,...h,width:e,height:e,stroke:t,strokeWidth:o?Number(r)*24/Number(e):r,className:l("lucide",n),...!a&&!f(c)&&{"aria-hidden":"true"},...c},[...u.map(([m,d])=>s.createElement(m,d)),...Array.isArray(a)?a:[a]]));/**
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 b=(t,e)=>{const r=s.forwardRef(({className:o,...n},a)=>s.createElement(g,{ref:a,iconNode:e,className:l(`lucide-${C(i(t))}`,`lucide-${t}`,o),...n}));return r.displayName=i(t),r};export{b as c};
@@ -1 +0,0 @@
1
- const o="/assets/cy-logo-cli-C1gnJVOL.svg";export{o as c};
@@ -1 +0,0 @@
1
- import{w as t,c as r,j as e}from"./chunk-EPOLDU6W-CXRTFQ3F.js";import{S as i}from"./ScenarioViewer-BMKg0SAF.js";import{W as n}from"./InteractivePreview-Cu16OUmx.js";import"./useCustomSizes-Dv18q8LD.js";import"./LogViewer-xgeCVgSM.js";import"./SafeScreenshot-DuDvi0jm.js";import"./useLastLogLine-aSv48UbS.js";import"./useInteractiveMode-0ToGk4K3.js";import"./preload-helper-ckwbz45p.js";import"./ReportIssueModal-DcAUIpD_.js";import"./createLucideIcon-BdhJEx6B.js";import"./circle-check-BOARzkeR.js";import"./triangle-alert-B6LgvRJg.js";import"./scenarioStatus-B_8jpV3e.js";const N=()=>[{title:"Empty State - CodeYam"},{name:"description",content:"Simulations empty state development view"}],y=t(function(){r();const s={sha:"mock-sha",name:"Dashboard",filePath:"codeyam-cli/src/webserver/app/routes/_index.tsx",entityType:"visual"};return e.jsx(n,{children:e.jsxs("div",{className:"h-screen bg-[#f9f9f9] flex flex-col overflow-hidden",children:[e.jsx("header",{className:"bg-white border-b border-gray-200 shrink-0 relative h-[54px]",children:e.jsxs("div",{className:"flex items-center h-full px-6 gap-6",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M13 8.5H4M4 8.5L8.5 4M4 8.5L8.5 13",stroke:"#005c75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("h1",{className:"text-lg font-semibold text-black m-0 leading-[26px] shrink-0",children:"Dashboard"}),e.jsx("span",{className:"text-xs text-[#626262] font-mono whitespace-nowrap overflow-hidden text-ellipsis min-w-0",children:"codeyam-cli/src/webserver/app/routes/_index.tsx"})]}),e.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2 px-[15px] py-0 h-[26px] bg-[#efefef] border border-[#e1e1e1] rounded",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-[#626262]"}),e.jsx("span",{className:"text-xs font-semibold text-[#626262]",children:"Not analyzed"})]}),e.jsx("button",{className:"px-[15px] py-0 h-[26px] bg-[#005c75] text-white rounded text-xs font-semibold border-none cursor-pointer hover:bg-[#004a5e] transition-colors",children:"Analyze"})]}),e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-[#626262] ml-auto",children:[e.jsx("span",{className:"leading-[22px]",children:"Next Entity"}),e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M4 8.5H13M13 8.5L8.5 4M13 8.5L8.5 13",stroke:"#005c75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})}),e.jsx("div",{className:"bg-[#efefef] border-b border-[#efefef] shrink-0",children:e.jsxs("div",{className:"flex items-center gap-3 h-11 px-[15px]",children:[e.jsxs("div",{className:"px-4 flex items-center justify-center gap-3 shrink-0 text-sm rounded bg-[#343434] text-[#efefef] font-semibold h-8",children:["Scenarios",e.jsx("span",{className:"px-2 py-0.5 rounded-[9px] text-xs font-semibold bg-[#cbf3fa] text-[#005c75] min-w-[25px] text-center",children:"0"})]}),e.jsxs("div",{className:"px-4 flex items-center justify-center gap-3 shrink-0 text-sm rounded-[9px] text-[#3e3e3e] font-normal",children:["Related Entities",e.jsx("span",{className:"px-2 py-0.5 rounded-[9px] text-xs font-semibold bg-[#e1e1e1] text-[#3e3e3e] min-w-[25px] text-center",children:"5"})]}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"Code"}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"Data Structure"}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"History"})]})}),e.jsxs("div",{className:"flex flex-1 gap-0 min-h-0",children:[e.jsx("div",{className:"w-[165px] bg-[#e1e1e1] border-r border-[#c7c7c7] flex items-center justify-center shrink-0",children:e.jsx("span",{className:"text-xs font-medium text-[#8e8e8e] leading-5",children:"No Scenarios"})}),e.jsx(i,{selectedScenario:null,analysis:void 0,entity:s,viewMode:"screenshot",cacheBuster:Date.now(),hasScenarios:!1,isAnalyzing:!1,projectSlug:null,hasAnApiKey:!0})]})]})})});export{y as default,N as meta};
@@ -1 +0,0 @@
1
- import{w as F,u as K,a as Y,b as q,r as l,j as e}from"./chunk-EPOLDU6W-CXRTFQ3F.js";import{u as G}from"./useInteractiveMode-0ToGk4K3.js";import{u as J}from"./useLastLogLine-aSv48UbS.js";import{u as O,V as Q,S as X}from"./useCustomSizes-Dv18q8LD.js";import{c as Z}from"./cy-logo-cli-CKnwPCDr.js";const b=[{name:"Mobile",width:375,height:667},{name:"Tablet",width:768,height:1024},{name:"Laptop",width:1024,height:768},{name:"Desktop",width:1440,height:900}],le=F(function(){const{entity:a,scenario:s,analysis:r,projectSlug:m}=K(),u=Y();q();const[te,S]=l.useState(null),[M,k]=l.useState(1440),[i,g]=l.useState({name:"Desktop",width:1440,height:900}),[P,v]=l.useState(!1),[f,z]=l.useState(null),{customSizes:y,addCustomSize:D}=O(m),h=l.useMemo(()=>[...b,...y],[y]),{interactiveServerUrl:p,isStarting:w,isLoading:x,showIframe:L,iframeKey:_,onIframeLoad:B}=G({analysisId:r==null?void 0:r.id,scenarioId:s==null?void 0:s.id,scenarioName:s==null?void 0:s.name,projectSlug:m,enabled:!0}),{lastLine:C}=J(m,w||x),W=()=>{u(`/entity/${a.sha}`)},E=(t,n)=>{k(t);const o=h.find($=>$.width===t&&$.height===n);S(o||null),g({name:(o==null?void 0:o.name)||"Custom",width:t,height:n})},I=t=>{S(t),k(t.width),g({name:t.name,width:t.width,height:t.height})},U=t=>{D(t,i.width,i.height??900),v(!1),g(n=>({...n,name:t}))},c=((r==null?void 0:r.scenarios)||[]).filter(t=>{var n;return!((n=t.metadata)!=null&&n.sameAsDefault)}),d=c.findIndex(t=>t.id===(s==null?void 0:s.id)),V=d+1,R=c.length,j=d>0,N=d<c.length-1,H=()=>{if(j){const t=c[d-1],n=encodeURIComponent(`/entity/${a.sha}/scenarios/${t.id}/fullscreen`);u(`/entity/${a.sha}/scenarios/${t.id}/fullscreen?from=${n}`)}},T=()=>{if(N){const t=c[d+1],n=encodeURIComponent(`/entity/${a.sha}/scenarios/${t.id}/fullscreen`);u(`/entity/${a.sha}/scenarios/${t.id}/fullscreen?from=${n}`)}},A=w||x||!L;return e.jsxs("div",{className:"fixed inset-0 bg-[#2d2d2d] flex flex-col",children:[e.jsxs("div",{className:"bg-[#3d3d3d] h-12 flex items-center px-4 gap-4 shrink-0 z-20",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsx("img",{src:Z,alt:"CodeYam",className:"h-6 brightness-0 invert"}),e.jsx("span",{className:"text-white font-medium text-sm whitespace-nowrap",children:a.name}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx("button",{onClick:H,disabled:!j,className:`${j?"text-white hover:text-gray-300":"text-gray-600 cursor-not-allowed"} transition-colors`,"aria-label":"Previous scenario",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsxs("span",{className:"text-gray-400 text-sm",children:[V,"/",R]}),e.jsx("button",{onClick:T,disabled:!N,className:`${N?"text-white hover:text-gray-300":"text-gray-600 cursor-not-allowed"} transition-colors`,"aria-label":"Next scenario",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M7.5 15L12.5 10L7.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"flex items-center gap-2 ml-2 min-w-0",children:[e.jsx("span",{className:"text-white font-semibold text-xs whitespace-nowrap shrink-0",children:s==null?void 0:s.name}),(s==null?void 0:s.description)&&e.jsxs("div",{className:"relative group min-w-0",children:[e.jsx("span",{className:"text-gray-400 text-xs truncate block",children:s.description}),e.jsx("div",{className:"absolute left-0 top-full mt-1 hidden group-hover:block z-50 bg-black text-white text-xs px-3 py-2 rounded shadow-lg max-w-md",children:s.description})]})]})]}),e.jsx("button",{onClick:W,className:"text-white hover:text-gray-300 transition-colors ml-4","aria-label":"Close fullscreen",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"bg-[#034456] border-b border-[rgba(0,92,117,0.25)] shrink-0 z-10 h-6 flex items-center justify-center relative",children:[e.jsx("div",{className:"absolute inset-0 flex justify-center",children:e.jsx("div",{style:{maxWidth:`${b[b.length-1].width}px`,width:"100%"},children:e.jsx(Q,{currentViewportWidth:M,currentPresetName:i.name,onDevicePresetClick:I,devicePresets:h,hideLabel:!0,onHoverChange:z})})}),e.jsxs("div",{className:"relative z-10 flex items-center gap-2",children:[e.jsxs("div",{className:"relative w-28 h-5",children:[e.jsxs("div",{className:"absolute inset-0 bg-[#007392] text-white text-xs px-2 rounded flex items-center justify-between pointer-events-none",children:[e.jsx("span",{className:"leading-none",children:(f==null?void 0:f.name)||i.name}),e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e.jsxs("select",{value:i.name,onChange:t=>{const n=h.find(o=>o.name===t.target.value);n&&I(n)},className:"relative w-full h-full opacity-0 cursor-pointer",children:[h.map(t=>e.jsx("option",{value:t.name,children:t.name},t.name)),i.name==="Custom"&&e.jsx("option",{value:"Custom",children:"Custom"})]})]}),e.jsx("input",{type:"number",value:i.width,onChange:t=>{const n=parseInt(t.target.value,10);!isNaN(n)&&n>0&&E(n,i.height??900)},className:"bg-white text-gray-900 text-xs px-1 rounded border border-gray-300 outline-none w-16 text-center h-5 leading-none",min:"200",max:"3840"}),e.jsx("span",{className:"text-gray-400 text-xs h-5 flex items-center leading-none",children:"×"}),e.jsx("span",{className:"bg-gray-100 text-gray-600 text-xs px-1 rounded w-14 text-center h-5 flex items-center justify-center leading-none",children:i.height??900}),i.name==="Custom"&&e.jsx("button",{onClick:()=>v(!0),className:"bg-[#007392] text-white text-xs px-2 rounded h-5 flex items-center leading-none hover:bg-[#005c75] transition-colors",children:"Save"})]})]}),e.jsx("div",{className:"flex-1 flex items-center justify-center overflow-auto p-8",children:p?e.jsxs("div",{className:"relative bg-white shadow-2xl w-full h-full",style:{maxWidth:`${i.width}px`,maxHeight:`${i.height}px`},children:[A&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-white z-10",children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx("div",{className:"w-12 h-12",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("p",{className:"text-base font-semibold text-[#005c75]",children:w&&!p?"Starting interactive mode...":"Loading interactive preview..."})]})}),e.jsx("iframe",{src:p,className:"w-full h-full border-none",title:`Interactive preview: ${s==null?void 0:s.name}`,onLoad:B,style:{opacity:L?1:0}},_)]}):e.jsxs("div",{className:"flex flex-col items-center gap-6 max-w-2xl",children:[e.jsx("div",{className:"w-12 h-12",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-white leading-[30px] m-0 font-['IBM_Plex_Sans']",children:x?"Interactive mode ready: launching...":"Starting Interactive Mode..."}),C&&e.jsx("p",{className:"text-xs font-mono text-gray-400 text-center leading-5 m-0 max-w-xl font-['IBM_Plex_Mono']",children:C}),e.jsx("p",{className:"text-xs text-gray-500 text-center leading-5 m-0 font-['IBM_Plex_Mono']",children:x?"Loading the page in the background...":"Setting up the dev server for this scenario..."})]})}),P&&e.jsx(X,{width:i.width,height:i.height??900,onSave:U,onCancel:()=>v(!1)})]})});export{le as default};
@@ -1 +0,0 @@
1
- import{r as d,j as e,w as F,u as G,a as _,L as H}from"./chunk-EPOLDU6W-CXRTFQ3F.js";import{W as Y,u as z,I as B}from"./InteractivePreview-Cu16OUmx.js";import{u as Q}from"./useInteractiveMode-0ToGk4K3.js";import{c as X}from"./keyAttributeCoverage-CTlFMihX.js";import"./preload-helper-ckwbz45p.js";import"./useLastLogLine-aSv48UbS.js";function Z(t,r=50){if(t===null)return"null";if(t===void 0)return"undefined";let o;if(typeof t=="object")try{o=JSON.stringify(t)}catch{o="[complex object]"}else o=String(t);return o.length>r?o.slice(0,r)+"...":o}function ee({keyAttributes:t,selections:r,onChange:o,disabled:m=!1}){const[x,f]=d.useState({}),S=d.useCallback(a=>r.some(i=>i.path===a),[r]),p=d.useCallback(a=>r.find(i=>i.path===a),[r]),P=d.useCallback(a=>{if(S(a.path))o(r.filter(i=>i.path!==a.path));else{const s=a.validValues.find(c=>c.usedInScenarios.length===0)||a.validValues[0];o(s?[...r,{path:a.path,value:s.value,valueOptionIndex:s.index,isCustom:!1}]:[...r,{path:a.path,value:"",isCustom:!0}])}},[r,o,S]),A=d.useCallback((a,i)=>{const s=t.find(n=>n.path===a);if(!s)return;const c=r.map(n=>{if(n.path!==a)return n;if(i==="custom")return{...n,value:x[a]||"",valueOptionIndex:void 0,isCustom:!0};const l=parseInt(i,10),u=s.validValues[l];return u?{...n,value:u.value,valueOptionIndex:l,isCustom:!1}:n});o(c)},[r,o,t,x]),j=d.useCallback((a,i)=>{f(c=>({...c,[a]:i}));const s=r.map(c=>c.path!==a||!c.isCustom?c:{...c,value:i});o(s)},[r,o]);return t.length===0?e.jsx("div",{className:"text-sm text-gray-500 py-2",children:"No key attributes found."}):e.jsx("div",{className:"space-y-3",children:t.map(a=>{const i=S(a.path),s=p(a.path),c=a.validValues.filter(n=>n.usedInScenarios.length===0).length;return e.jsxs("div",{className:"border-b border-gray-100 pb-3 last:border-0 last:pb-0",children:[e.jsxs("label",{className:"flex items-start gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:i,onChange:()=>P(a),disabled:m,className:"mt-0.5 h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"font-mono text-sm font-medium text-gray-900",children:a.localVariable}),c>0&&e.jsxs("span",{className:"text-xs px-1.5 py-0.5 bg-amber-100 text-amber-700 rounded",children:[c," uncovered"]})]}),a.description&&e.jsx("p",{className:"text-xs text-gray-500 mt-0.5 m-0",children:a.description})]})]}),i&&e.jsxs("div",{className:"ml-6 mt-2",children:[e.jsxs("select",{value:s!=null&&s.isCustom?"custom":String((s==null?void 0:s.valueOptionIndex)??0),onChange:n=>A(a.path,n.target.value),disabled:m,className:"w-full text-sm border border-gray-300 rounded px-2 py-1.5 focus:border-blue-400 focus:outline-none focus:ring-1 focus:ring-blue-400",children:[a.validValues.map((n,l)=>{const u=n.usedInScenarios.length>0;return e.jsxs("option",{value:l,children:[Z(n.value),!u&&" (uncovered)"]},l)}),e.jsx("option",{value:"custom",children:"Custom value..."})]}),(s==null?void 0:s.isCustom)&&e.jsx("input",{type:"text",placeholder:"Enter custom value",value:x[a.path]||(s==null?void 0:s.value)||"",onChange:n=>j(a.path,n.target.value),disabled:m,className:"w-full mt-2 text-sm border border-gray-300 rounded px-2 py-1.5 focus:border-blue-400 focus:outline-none focus:ring-1 focus:ring-blue-400"}),a.dependencies&&a.dependencies.length>0&&e.jsxs("div",{className:"mt-2 p-2 bg-amber-50 rounded text-xs",children:[e.jsx("span",{className:"text-amber-700 font-medium",children:"Requires:"}),e.jsx("ul",{className:"m-0 mt-1 pl-4 space-y-0.5",children:a.dependencies.map((n,l)=>e.jsxs("li",{className:"text-amber-600",children:[e.jsx("code",{className:"bg-amber-100 px-1 rounded",children:n.path})," = ",e.jsx("code",{className:"bg-amber-100 px-1 rounded",children:String(n.requiredValue)})]},l))})]})]})]},a.path)})})}const ce=({data:t})=>[{title:t!=null&&t.entity?`Create Scenario - ${t.entity.name} - CodeYam`:"Create Scenario - CodeYam"},{name:"description",content:"Create a new scenario"}];function te(){const{analysis:t,defaultScenario:r,entity:o,entitySha:m,projectSlug:x}=G(),f=_(),{iframeRef:S}=z(),[p,P]=d.useState(""),[A,j]=d.useState(!1),[a,i]=d.useState(!1),[s,c]=d.useState(null),[n,l]=d.useState(null),[u,D]=d.useState([]),E=d.useMemo(()=>{var v;return!((v=t==null?void 0:t.metadata)!=null&&v.keyAttributes)||!(t!=null&&t.scenarios)?[]:X(t.metadata.keyAttributes,t.scenarios).keyAttributes},[t]),{interactiveServerUrl:w,isStarting:L,isLoading:W,showIframe:$,iframeKey:J,onIframeLoad:K}=Q({analysisId:t==null?void 0:t.id,scenarioId:r==null?void 0:r.id,scenarioName:r==null?void 0:r.name,projectSlug:x,enabled:!0}),M=d.useCallback(async()=>{var b,v,O,R;if(!p.trim()&&u.length===0){c("Please describe how you want to change the scenario or select key attributes");return}j(!0),c(null),l("Generating scenario with AI...");try{const h=await fetch("/api/generate-scenario-data",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:p,existingScenarios:t.scenarios,scenariosDataStructure:(b=t.metadata)==null?void 0:b.scenariosDataStructure,keyAttributeSelections:u.length>0?u:void 0})}),C=await h.json();if(!h.ok||!C.success)throw new Error(C.error||"Failed to generate scenario data");console.log("[CreateScenario] AI generated scenario:",C.data);const g=C.data;if(!g.name||!g.data)throw new Error("AI response missing required fields (name or data)");l("Saving new scenario..."),i(!0);const U={name:g.name,description:g.description||p,metadata:{data:g.data,interactiveExamplePath:(v=r.metadata)==null?void 0:v.interactiveExamplePath}},q=[...t.scenarios||[],U],T=await fetch("/api/save-scenarios",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({analysis:t,scenarios:q})}),I=await T.json();if(!T.ok||!I.success)throw new Error(I.error||"Failed to save scenario");console.log("[CreateScenario] Scenario saved:",I);const y=(R=(O=I.analysis)==null?void 0:O.scenarios)==null?void 0:R.find(V=>V.name===g.name);if(!(y!=null&&y.id)){console.warn("[CreateScenario] Could not find saved scenario ID, navigating to entity page"),l("Scenario created! Redirecting..."),setTimeout(()=>void f(`/entity/${m}`),1e3);return}if(w){l("Capturing screenshot...");const V=await fetch("/api/capture-screenshot",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverUrl:w,scenarioId:y.id,projectId:t.projectId,viewportWidth:1440})}),k=await V.json();!V.ok||!k.success?(console.error("[CreateScenario] Capture failed:",k),l("Scenario created! (Screenshot capture failed)")):l("Scenario created and captured!")}else l("Scenario created!");setTimeout(()=>{f(`/entity/${m}/scenarios/${y.id}`)},1e3)}catch(h){console.error("[CreateScenario] Error:",h),c(h instanceof Error?h.message:String(h)),l(null)}finally{j(!1),i(!1)}},[p,u,t,r,m,w,f]),N=A||a;return e.jsxs("div",{className:"h-screen bg-gray-50 flex flex-col",children:[e.jsxs("header",{className:"bg-white border-b border-gray-200 px-8 py-6 shrink-0",children:[e.jsx("div",{className:"mb-4",children:e.jsxs(H,{to:`/entity/${m}`,className:"text-blue-600 no-underline text-sm font-medium transition-colors hover:text-blue-700 hover:underline",children:["← Back to ",o==null?void 0:o.name]})}),e.jsx("h1",{className:"text-[32px] font-bold text-gray-900 m-0 mb-3",children:"Create New Scenario"}),e.jsx("p",{className:"text-gray-600 text-[15px] leading-relaxed m-0",children:"Create a new scenario based on the Default Scenario"})]}),e.jsxs("div",{className:"flex flex-1 gap-0 min-h-0",children:[e.jsxs("aside",{className:"w-[400px] bg-white border-r border-gray-200 overflow-y-auto shrink-0 p-6 flex flex-col",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Default Scenario Preview"}),e.jsx("p",{className:"text-sm text-gray-600 leading-relaxed",children:"The preview on the right shows the Default Scenario. Select key attributes and/or describe how you'd like to change it."})]}),E.length>0&&e.jsxs("details",{className:"mb-4 border border-gray-200 rounded-lg",children:[e.jsxs("summary",{className:"px-3 py-2 text-sm font-medium text-gray-700 cursor-pointer hover:bg-gray-50 rounded-lg",children:["Select Key Attributes"," ",u.length>0&&e.jsxs("span",{className:"text-blue-600",children:["(",u.length," selected)"]})]}),e.jsx("div",{className:"px-3 pb-3 pt-1 border-t border-gray-100",children:e.jsx(ee,{keyAttributes:E,selections:u,onChange:D,disabled:N})})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx("label",{htmlFor:"prompt",className:"block text-sm font-medium text-gray-700 mb-2",children:"How would you like to change it for your new scenario?"}),e.jsx("textarea",{id:"prompt",value:p,onChange:b=>P(b.target.value),placeholder:"e.g., Show an empty state with no items in the list, or Display an error message when the API fails, or Show a user with admin privileges...",className:"w-full h-40 px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:ring-blue-500 focus:border-blue-500 text-sm resize-none",disabled:N})]}),e.jsxs("div",{className:"mt-6 space-y-3",children:[e.jsx("button",{onClick:()=>void M(),disabled:N||!p.trim()&&u.length===0,className:"w-full px-4 py-2 bg-[#005c75] text-white rounded-md text-sm font-medium hover:bg-[#004a5e] disabled:bg-gray-400 disabled:cursor-not-allowed transition-colors",children:N?"Creating...":"Create Scenario"}),n&&e.jsx("div",{className:"text-sm text-blue-600 bg-blue-50 px-3 py-2 rounded-md",children:n}),s&&e.jsx("div",{className:"text-sm text-red-600 bg-red-50 px-3 py-2 rounded-md",children:s})]})]}),e.jsx("main",{className:"flex-1 bg-gray-100 overflow-auto flex flex-col min-w-0",children:e.jsx(B,{scenarioId:r.id||r.name,scenarioName:r.name,iframeUrl:w,isStarting:L,isLoading:W,showIframe:$,iframeKey:J,onIframeLoad:K,projectSlug:x,defaultWidth:1440,defaultHeight:900})})]})]})}const le=F(function(){return e.jsx(Y,{children:e.jsx(te,{})})});export{le as default,ce as meta};
@@ -1 +0,0 @@
1
- import{b as ne,r as y,j as e,w as le,u as ce,f as de}from"./chunk-EPOLDU6W-CXRTFQ3F.js";import{u as me}from"./useReportContext-1BX144Eg.js";import{F as he,a as fe,E as pe,S as xe,u as ue}from"./EntityItem-Cmysw5OP.js";import{g as E}from"./fileTableUtils-DMJ7zii9.js";import{C as ae}from"./chevron-down-Cx24_aWc.js";import{S as ye}from"./search-CxXUmBSd.js";import"./useToast-mBRpZPiu.js";import"./TruncatedFilePath-DyFZkK0l.js";import"./SafeScreenshot-DuDvi0jm.js";import"./LibraryFunctionPreview-CVtiBnY5.js";import"./scenarioStatus-B_8jpV3e.js";import"./triangle-alert-B6LgvRJg.js";import"./createLucideIcon-BdhJEx6B.js";import"./EntityTypeIcon-CAneekK2.js";import"./EntityTypeBadge-DLqD3qNt.js";function ve({entities:G,page:h,itemsPerPage:g=50,currentRun:z,filter:T,entityType:Q,queueState:i,isEntityPending:j,pendingEntityKeys:F,onGenerateSimulation:M,onGenerateAllSimulations:k,totalFilesCount:Y,totalEntitiesCount:_,uncommittedFilesCount:L,showOnlyUncommitted:H,onToggleUncommitted:I}){const[U,O]=ne(),[R,x]=y.useState(new Set),[p,v]=y.useState(""),[J,D]=y.useState(!1),[A,V]=y.useState("all"),[C,B]=y.useState("desc"),W=Q||"all",ee=y.useMemo(()=>{let s=G;return W!=="all"&&(s=s.filter(o=>o.entityType===W)),T==="analyzed"&&(s=s.filter(o=>o.analyses&&o.analyses.length>0)),s},[G,W,T]),te=y.useMemo(()=>{const s=new Map,o=new Map,f=new Map;ee.forEach(a=>{var r,l;const t=`${a.filePath}::${a.name}`,n=o.get(t);if(!n)o.set(t,a),f.set(t,[]);else{const d=((r=n.metadata)==null?void 0:r.editedAt)||n.createdAt||"",c=((l=a.metadata)==null?void 0:l.editedAt)||a.createdAt||"";let m=!1;if(c>d)m=!0;else if(c===d){const u=n.createdAt||"";m=(a.createdAt||"")>u}m?(f.get(t).push(n),o.set(t,a)):f.get(t).push(a)}}),o.forEach((a,t)=>{var r;if(!(a.analyses&&a.analyses.length>0)&&((r=a.metadata)!=null&&r.previousVersionWithAnalyses)){const d=(f.get(t)||[]).find(c=>{var m;return c.sha===((m=a.metadata)==null?void 0:m.previousVersionWithAnalyses)});d&&d.analyses&&d.analyses.length>0&&(a.analyses=d.analyses)}}),Array.from(o.values()).sort((a,t)=>{var l,d,c,m;const n=!((l=a.metadata)!=null&&l.notExported)&&!((d=a.metadata)!=null&&d.namedExport),r=!((c=t.metadata)!=null&&c.notExported)&&!((m=t.metadata)!=null&&m.namedExport);return n&&!r?-1:!n&&r?1:0}).forEach(a=>{var d,c,m,u,b;const t=a.filePath??"No File Path";s.has(t)||s.set(t,{filePath:t,entities:[],totalCount:0,uncommittedCount:0,lastUpdated:null,previewScreenshots:[],previewScreenshotErrors:[],previewLibraryScenarios:[],state:"up-to-date",simulationCount:0});const n=s.get(t);n.entities.push(a),n.totalCount++,(d=a.metadata)!=null&&d.isUncommitted&&n.uncommittedCount++;const r=((u=(m=(c=a.analyses)==null?void 0:c[0])==null?void 0:m.scenarios)==null?void 0:u.length)||0;n.simulationCount+=r;const l=((b=a.metadata)==null?void 0:b.editedAt)||a.updatedAt;l&&(!n.lastUpdated||new Date(l)>new Date(n.lastUpdated))&&(n.lastUpdated=l)});const K=(i==null?void 0:i.jobs)||[],q=a=>{const t=`${a.filePath||""}::${a.name}`;return(F==null?void 0:F.includes(t))||!1};s.forEach(a=>{const t=a.entities.map(n=>q(n)?"queued":E(n,K));t.includes("analyzing")||t.includes("queued")?a.state="analyzing":t.includes("incomplete")?a.state="incomplete":t.includes("out-of-date")?a.state="out-of-date":t.includes("not-analyzed")?a.state="not-analyzed":a.state="up-to-date"}),s.forEach(a=>{var t,n,r,l,d;for(const c of a.entities){if(a.previewScreenshots.length+a.previewLibraryScenarios.length>=3)break;const u=((n=(t=c.analyses)==null?void 0:t[0])==null?void 0:n.scenarios)||[];if(c.entityType==="library"){const b=u.find(N=>{var P,S;return((P=N.metadata)==null?void 0:P.executionResult)||((S=N.metadata)==null?void 0:S.error)});b&&a.previewLibraryScenarios.push({scenario:b,entitySha:c.sha})}else{const b=u.find(N=>{var P,S;return(S=(P=N.metadata)==null?void 0:P.screenshotPaths)==null?void 0:S[0]});if(b){const N=(l=(r=b.metadata)==null?void 0:r.screenshotPaths)==null?void 0:l[0],P=!!((d=b.metadata)!=null&&d.error);N&&!a.previewScreenshots.includes(N)&&(a.previewScreenshots.push(N),a.previewScreenshotErrors.push(P))}}}});const $=Array.from(s.values());return $.sort((a,t)=>{if(T==="analyzed"){const l=Math.max(...a.entities.filter(c=>{var m,u;return(u=(m=c.analyses)==null?void 0:m[0])==null?void 0:u.createdAt}).map(c=>new Date(c.analyses[0].createdAt).getTime()),0),d=Math.max(...t.entities.filter(c=>{var m,u;return(u=(m=c.analyses)==null?void 0:m[0])==null?void 0:u.createdAt}).map(c=>new Date(c.analyses[0].createdAt).getTime()),0);return C==="desc"?d-l:l-d}if(a.uncommittedCount>0&&t.uncommittedCount===0)return-1;if(a.uncommittedCount===0&&t.uncommittedCount>0)return 1;const n=a.lastUpdated?new Date(a.lastUpdated).getTime():0,r=t.lastUpdated?new Date(t.lastUpdated).getTime():0;return C==="desc"?r-n:n-r}),$},[ee,T,C,i,F]),w=y.useMemo(()=>{let s=te;if(A!=="all"&&(s=s.filter(o=>o.state===A)),p.trim()){const o=p.toLowerCase();s=s.filter(f=>f.filePath.toLowerCase().includes(o))}return s},[te,p,A]),se=(h-1)*g,ie=se+g,X=w.slice(se,ie),Z=Math.ceil(w.length/g),re=s=>{x(o=>{const f=new Set(o);return f.has(s)?f.delete(s):f.add(s),f})},oe=()=>{B(s=>s==="desc"?"asc":"desc")};return e.jsxs("div",{children:[e.jsxs("div",{className:"bg-white border-b border-gray-200 rounded-t-lg px-5 py-4 mb-3",children:[e.jsx("div",{className:"text-[11px] text-gray-500 mb-2 uppercase",children:"Filters"}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("div",{className:"relative w-[130px]",children:[e.jsxs("select",{value:W,onChange:s=>{const o=s.target.value,f=new URLSearchParams(U);o==="all"?f.delete("entityType"):f.set("entityType",o),f.set("page","1"),O(f)},className:"appearance-none bg-gray-50 border border-gray-200 rounded px-[10px] pr-6 text-[13px] h-[39px] w-full cursor-pointer focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] hover:border-gray-300 transition-colors",children:[e.jsx("option",{value:"all",children:"All Types"}),e.jsx("option",{value:"visual",children:"Visual"}),e.jsx("option",{value:"library",children:"Library"})]}),e.jsx(ae,{className:"absolute right-2 top-1/2 -translate-y-1/2 w-3 h-3 text-gray-500 pointer-events-none"})]}),e.jsxs("div",{className:"relative w-[130px]",children:[e.jsxs("select",{value:A,onChange:s=>V(s.target.value),className:"appearance-none bg-gray-50 border border-gray-200 rounded px-[10px] pr-6 text-[13px] h-[39px] w-full cursor-pointer focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] hover:border-gray-300 transition-colors",children:[e.jsx("option",{value:"all",children:"All States"}),e.jsx("option",{value:"analyzing",children:"Analyzing..."}),e.jsx("option",{value:"up-to-date",children:"Up to date"}),e.jsx("option",{value:"incomplete",children:"Incomplete"}),e.jsx("option",{value:"out-of-date",children:"Out of date"}),e.jsx("option",{value:"not-analyzed",children:"Not analyzed"})]}),e.jsx(ae,{className:"absolute right-2 top-1/2 -translate-y-1/2 w-3 h-3 text-gray-500 pointer-events-none"})]}),e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(ye,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx("input",{type:"text",placeholder:"Search component",value:p,onChange:s=>v(s.target.value),className:"w-full bg-gray-50 border border-gray-200 rounded pl-9 pr-[10px] text-[13px] h-[39px] placeholder:text-gray-400 focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] transition-colors"})]})]})]}),Y!==void 0&&_!==void 0&&L!==void 0&&e.jsx("div",{className:"mb-3",children:e.jsxs("div",{className:"flex items-center justify-between text-[13px]",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-gray-900",children:[w.length," ",w.length===1?"file":"files"]}),e.jsx("span",{className:"text-gray-300",children:"|"}),e.jsxs("div",{className:"flex items-center gap-1 group relative",children:[e.jsxs("span",{className:"text-gray-900",children:[w.reduce((s,o)=>s+o.totalCount,0)," ",w.reduce((s,o)=>s+o.totalCount,0)===1?"entity":"entities"]}),e.jsxs("svg",{className:"w-3.5 h-3.5 text-[#001f3f]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",strokeWidth:"2"}),e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 16v-4m0-4h.01"})]}),e.jsx("div",{className:"absolute left-0 top-full mt-2 hidden group-hover:block z-50 w-80",children:e.jsxs("div",{className:"bg-gray-900 text-white text-xs rounded-lg px-3 py-2 shadow-lg",children:["In CodeYam, an entity is a discrete, analyzable unit of code that can be independently simulated and tested.",e.jsx("div",{className:"absolute -top-1 left-4 w-2 h-2 bg-gray-900 transform rotate-45"})]})})]}),e.jsx("span",{className:"text-gray-300",children:"|"}),H?e.jsxs("button",{onClick:I,className:"flex items-center gap-2 font-medium text-[#005c75] underline hover:text-[#004a5e] transition-colors",children:[w.filter(s=>s.uncommittedCount>0).length," ","uncommitted"," ",w.filter(s=>s.uncommittedCount>0).length===1?"file":"files",e.jsx("svg",{className:"w-3.5 h-3.5",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"})})]}):e.jsxs("button",{onClick:I,className:"font-medium text-[#005c75] underline hover:text-[#004a5e] transition-colors",children:[L," uncommitted"," ",L===1?"file":"files"]})]}),X.length>0&&e.jsxs("div",{className:"flex gap-6",children:[e.jsx("button",{onClick:()=>{x(new Set(X.map(s=>s.filePath))),D(!0)},className:"text-[#005c75] hover:bg-[#E6F5F8] hover:text-[#003d4f] font-medium transition-all cursor-pointer px-3 py-1 rounded",children:"Expand All"}),e.jsx("button",{onClick:()=>{x(new Set),D(!1)},className:"text-[#005c75] hover:bg-[#E6F5F8] hover:text-[#003d4f] font-medium transition-all cursor-pointer px-3 py-1 rounded",children:"Collapse All"})]})]})}),e.jsx(he,{showActions:!0,sortOrder:C,onSortChange:oe}),e.jsx("div",{className:"flex flex-col gap-[3px]",children:X.map(s=>{const o=R.has(s.filePath),K=s.entities.filter(t=>(t.entityType==="visual"||t.entityType==="library")&&(E(t,(i==null?void 0:i.jobs)||[])==="not-analyzed"||E(t,(i==null?void 0:i.jobs)||[])==="out-of-date"||E(t,(i==null?void 0:i.jobs)||[])==="incomplete")).length>0,q=t=>{var n;return((n=z==null?void 0:z.currentEntityShas)==null?void 0:n.includes(t))||!1},$=t=>{var n;return j!=null&&j(t)?!0:((n=i==null?void 0:i.jobs)==null?void 0:n.some(r=>{var l;return(l=r.entityShas)==null?void 0:l.includes(t.sha)}))||!1},a=t=>{M==null||M(t)};return e.jsx(fe,{filePath:s.filePath,isExpanded:o,onToggle:()=>re(s.filePath),simulationPreviews:e.jsx(xe,{entities:s.entities,maxPreviews:1}),entityCount:s.totalCount,state:s.state,lastModified:s.lastUpdated,uncommittedCount:s.uncommittedCount,isUncommitted:s.uncommittedCount>0,actionButton:K?e.jsx("button",{onClick:t=>{t.stopPropagation();const n=s.entities.filter(r=>(r.entityType==="visual"||r.entityType==="library")&&(E(r,(i==null?void 0:i.jobs)||[])==="not-analyzed"||E(r,(i==null?void 0:i.jobs)||[])==="out-of-date"||E(r,(i==null?void 0:i.jobs)||[])==="incomplete"));k==null||k(n)},className:"bg-[#005c75] text-white rounded text-[12px] font-['IBM_Plex_Sans'] font-medium hover:bg-[#004a5e] transition-colors cursor-pointer px-[15px] py-0 h-[28px]",children:"Analyze"}):void 0,children:s.entities.sort((t,n)=>{const r=t.entityType==="visual"||t.entityType==="library",l=n.entityType==="visual"||n.entityType==="library";return r&&!l?-1:!r&&l?1:0}).map(t=>e.jsx(pe,{entity:t,isActivelyAnalyzing:q(t.sha),isQueued:$(t),onGenerateSimulation:a},t.sha))},s.filePath)})}),Z>1&&e.jsxs("div",{className:"flex justify-center items-center gap-4 mt-6 p-4",children:[h>1&&e.jsx("a",{href:`?${new URLSearchParams({...Object.fromEntries(U),page:String(h-1)}).toString()}`,className:"no-underline font-medium hover:underline",style:{color:"#005C75"},children:"← Previous"}),e.jsxs("span",{children:["Page ",h," of ",Z]}),h<Z&&e.jsx("a",{href:`?${new URLSearchParams({...Object.fromEntries(U),page:String(h+1)}).toString()}`,className:"no-underline font-medium hover:underline",style:{color:"#005C75"},children:"Next →"})]})]})}const Le=()=>[{title:"CodeYam - Files & Entities"},{name:"description",content:"Browse your codebase files and entities"}],De=le(function(){var U,O,R;const{entities:h,currentCommit:g,page:z,filter:T,entityType:Q,queueState:i}=ce();de(),ne();const[j,F]=y.useState(!1);me({source:"files-page"});const{handleGenerateSimulation:M,handleGenerateAllSimulations:k,isEntityPending:Y,pendingEntityKeys:_}=ue((O=(U=g==null?void 0:g.metadata)==null?void 0:U.currentRun)==null?void 0:O.currentEntityShas,i),L=y.useMemo(()=>{if(!h)return[];const x=new Set([]);for(const p of h)x.add(p.filePath??"No File Path");return Array.from(x)},[h]),H=y.useMemo(()=>{if(!h)return[];let x=h;return j&&(x=x.filter(p=>{var v;return(v=p.metadata)==null?void 0:v.isUncommitted})),x.sort((p,v)=>{var J,D,A,V,C,B;return(J=p.metadata)!=null&&J.isUncommitted&&!((D=v.metadata)!=null&&D.isUncommitted)?-1:!((A=p.metadata)!=null&&A.isUncommitted)&&((V=v.metadata)!=null&&V.isUncommitted)?1:new Date(((C=v.metadata)==null?void 0:C.editedAt)||0).getTime()-new Date(((B=p.metadata)==null?void 0:B.editedAt)||0).getTime()})},[h,j]),I=y.useMemo(()=>{var p;if(!h)return[];const x=new Set([]);for(const v of h)(p=v.metadata)!=null&&p.isUncommitted&&x.add(v.filePath??"No File Path");return Array.from(x)},[h]);return h?e.jsx("div",{className:"bg-[#f9f9f9] min-h-screen",children:e.jsxs("div",{className:"px-20 py-12 font-sans",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-3xl font-semibold text-gray-900 mb-2",children:"Files & Entities"}),e.jsx("p",{className:"text-gray-600",children:"This is a list of all the files in your app."})]}),e.jsx(ve,{entities:H,page:z,itemsPerPage:50,currentRun:(R=g==null?void 0:g.metadata)==null?void 0:R.currentRun,filter:T,entityType:Q,queueState:i,isEntityPending:Y,pendingEntityKeys:_,onGenerateSimulation:M,onGenerateAllSimulations:k,totalFilesCount:L.length,totalEntitiesCount:h.length,uncommittedFilesCount:I.length,showOnlyUncommitted:j,onToggleUncommitted:()=>F(!j)})]})}):e.jsx("div",{className:"bg-[#f9f9f9] min-h-screen",children:e.jsxs("div",{className:"px-12 py-6 font-sans",children:[e.jsx("h1",{className:"text-3xl font-semibold text-gray-900",children:"Error"}),e.jsx("p",{className:"text-base text-gray-500",children:"Unable to retrieve entities"})]})})});export{De as default,Le as meta};