@codeyam/codeyam-cli 0.1.0-staging.596f0eb → 0.1.0-staging.76566f9

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 (354) hide show
  1. package/analyzer-template/.build-info.json +7 -7
  2. package/analyzer-template/log.txt +3 -3
  3. package/analyzer-template/package.json +2 -1
  4. package/analyzer-template/packages/ai/src/lib/analyzeScope.ts +2 -0
  5. package/analyzer-template/packages/ai/src/lib/astScopes/astScopeAnalyzer.ts +22 -0
  6. package/analyzer-template/packages/ai/src/lib/astScopes/patterns/switchStatementHandler.ts +23 -1
  7. package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +401 -106
  8. package/analyzer-template/packages/ai/src/lib/astScopes/types.ts +60 -0
  9. package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +734 -45
  10. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.ts +2 -1
  11. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.ts +715 -0
  12. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.ts +233 -75
  13. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.ts +19 -1
  14. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.ts +34 -1
  15. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.ts +23 -0
  16. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertNullToUndefinedBySchema.ts +98 -0
  17. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.ts +34 -1
  18. package/analyzer-template/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.ts +236 -24
  19. package/analyzer-template/packages/ai/src/lib/generateChangesEntityKeyAttributes.ts +18 -1
  20. package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarioData.ts +41 -0
  21. package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarios.ts +37 -4
  22. package/analyzer-template/packages/ai/src/lib/generateEntityDataStructure.ts +5 -0
  23. package/analyzer-template/packages/ai/src/lib/generateEntityKeyAttributes.ts +213 -12
  24. package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +36 -25
  25. package/analyzer-template/packages/ai/src/lib/generateEntityScenarios.ts +114 -11
  26. package/analyzer-template/packages/ai/src/lib/getConditionalUsagesFromCode.ts +143 -31
  27. package/analyzer-template/packages/ai/src/lib/guessScenarioDataFromDescription.ts +8 -2
  28. package/analyzer-template/packages/ai/src/lib/promptGenerators/gatherAttributesMap.ts +7 -0
  29. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.ts +42 -2
  30. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.ts +38 -2
  31. package/analyzer-template/packages/ai/src/lib/promptGenerators/guessNewScenarioDataFromDescriptionGenerator.ts +28 -2
  32. package/analyzer-template/packages/ai/src/lib/worker/SerializableDataStructure.ts +5 -0
  33. package/analyzer-template/packages/ai/src/lib/worker/analyzeScopeWorker.ts +8 -1
  34. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +127 -43
  35. package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.ts +158 -0
  36. package/analyzer-template/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.ts +405 -45
  37. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateChangesScenarioData.ts +1 -1
  38. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +260 -133
  39. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.ts +10 -5
  40. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarioData.ts +77 -83
  41. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarios.ts +2 -5
  42. package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +196 -86
  43. package/analyzer-template/packages/aws/dist/src/lib/s3/checkS3ObjectExists.d.ts +15 -0
  44. package/analyzer-template/packages/aws/dist/src/lib/s3/checkS3ObjectExists.d.ts.map +1 -0
  45. package/analyzer-template/packages/aws/dist/src/lib/s3/checkS3ObjectExists.js +31 -0
  46. package/analyzer-template/packages/aws/dist/src/lib/s3/checkS3ObjectExists.js.map +1 -0
  47. package/analyzer-template/packages/aws/package.json +1 -1
  48. package/analyzer-template/packages/aws/s3/index.ts +1 -0
  49. package/analyzer-template/packages/aws/src/lib/s3/checkS3ObjectExists.ts +47 -0
  50. package/analyzer-template/packages/database/src/lib/kysely/db.ts +4 -4
  51. package/analyzer-template/packages/database/src/lib/kysely/tableRelations.ts +2 -2
  52. package/analyzer-template/packages/database/src/lib/kysely/tables/debugReportsTable.ts +20 -9
  53. package/analyzer-template/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.ts +9 -4
  54. package/analyzer-template/packages/generate/src/lib/deepMerge.ts +26 -1
  55. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts +2 -2
  56. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js +2 -2
  57. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tableRelations.d.ts +2 -2
  58. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/analysesTable.d.ts +8 -1
  59. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/analysesTable.d.ts.map +1 -1
  60. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.d.ts +14 -7
  61. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.d.ts.map +1 -1
  62. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.js +9 -3
  63. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.js.map +1 -1
  64. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts +1 -1
  65. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts.map +1 -1
  66. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.d.ts.map +1 -1
  67. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +8 -4
  68. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
  69. package/analyzer-template/packages/github/dist/generate/src/lib/deepMerge.d.ts.map +1 -1
  70. package/analyzer-template/packages/github/dist/generate/src/lib/deepMerge.js +27 -1
  71. package/analyzer-template/packages/github/dist/generate/src/lib/deepMerge.js.map +1 -1
  72. package/analyzer-template/packages/github/dist/types/index.d.ts +4 -3
  73. package/analyzer-template/packages/github/dist/types/index.d.ts.map +1 -1
  74. package/analyzer-template/packages/github/dist/types/index.js +1 -0
  75. package/analyzer-template/packages/github/dist/types/index.js.map +1 -1
  76. package/analyzer-template/packages/github/dist/types/src/types/Analysis.d.ts +31 -1
  77. package/analyzer-template/packages/github/dist/types/src/types/Analysis.d.ts.map +1 -1
  78. package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts +51 -1
  79. package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts.map +1 -1
  80. package/analyzer-template/packages/github/dist/types/src/types/Scenario.js +21 -1
  81. package/analyzer-template/packages/github/dist/types/src/types/Scenario.js.map +1 -1
  82. package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts +48 -0
  83. package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
  84. package/analyzer-template/packages/github/dist/utils/src/lib/lightweightEntityExtractor.d.ts.map +1 -1
  85. package/analyzer-template/packages/github/dist/utils/src/lib/lightweightEntityExtractor.js +25 -0
  86. package/analyzer-template/packages/github/dist/utils/src/lib/lightweightEntityExtractor.js.map +1 -1
  87. package/analyzer-template/packages/types/index.ts +8 -0
  88. package/analyzer-template/packages/types/src/types/Analysis.ts +32 -1
  89. package/analyzer-template/packages/types/src/types/Scenario.ts +75 -6
  90. package/analyzer-template/packages/types/src/types/ScenariosDataStructure.ts +49 -0
  91. package/analyzer-template/packages/ui-components/src/components/ScenarioDetailInteractiveView.tsx +23 -7
  92. package/analyzer-template/packages/utils/dist/types/index.d.ts +4 -3
  93. package/analyzer-template/packages/utils/dist/types/index.d.ts.map +1 -1
  94. package/analyzer-template/packages/utils/dist/types/index.js +1 -0
  95. package/analyzer-template/packages/utils/dist/types/index.js.map +1 -1
  96. package/analyzer-template/packages/utils/dist/types/src/types/Analysis.d.ts +31 -1
  97. package/analyzer-template/packages/utils/dist/types/src/types/Analysis.d.ts.map +1 -1
  98. package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts +51 -1
  99. package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts.map +1 -1
  100. package/analyzer-template/packages/utils/dist/types/src/types/Scenario.js +21 -1
  101. package/analyzer-template/packages/utils/dist/types/src/types/Scenario.js.map +1 -1
  102. package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts +48 -0
  103. package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
  104. package/analyzer-template/packages/utils/dist/utils/src/lib/lightweightEntityExtractor.d.ts.map +1 -1
  105. package/analyzer-template/packages/utils/dist/utils/src/lib/lightweightEntityExtractor.js +25 -0
  106. package/analyzer-template/packages/utils/dist/utils/src/lib/lightweightEntityExtractor.js.map +1 -1
  107. package/analyzer-template/packages/utils/src/lib/lightweightEntityExtractor.ts +27 -0
  108. package/analyzer-template/playwright/takeElementScreenshot.ts +26 -11
  109. package/analyzer-template/playwright/takeScreenshot.ts +9 -7
  110. package/analyzer-template/project/constructMockCode.ts +286 -84
  111. package/analyzer-template/project/orchestrateCapture/SequentialCaptureTaskRunner.ts +77 -37
  112. package/analyzer-template/project/reconcileMockDataKeys.ts +5 -2
  113. package/analyzer-template/project/runMultiScenarioServer.ts +11 -10
  114. package/analyzer-template/project/serverOnlyModules.ts +71 -23
  115. package/analyzer-template/project/start.ts +10 -0
  116. package/analyzer-template/project/startScenarioCapture.ts +73 -41
  117. package/analyzer-template/project/writeMockDataTsx.ts +115 -54
  118. package/analyzer-template/project/writeScenarioComponents.ts +571 -162
  119. package/analyzer-template/project/writeSimpleRoot.ts +11 -13
  120. package/background/src/lib/virtualized/project/constructMockCode.js +265 -75
  121. package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
  122. package/background/src/lib/virtualized/project/orchestrateCapture/SequentialCaptureTaskRunner.js +67 -32
  123. package/background/src/lib/virtualized/project/orchestrateCapture/SequentialCaptureTaskRunner.js.map +1 -1
  124. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js +5 -2
  125. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js.map +1 -1
  126. package/background/src/lib/virtualized/project/runMultiScenarioServer.js +11 -9
  127. package/background/src/lib/virtualized/project/runMultiScenarioServer.js.map +1 -1
  128. package/background/src/lib/virtualized/project/serverOnlyModules.js +62 -25
  129. package/background/src/lib/virtualized/project/serverOnlyModules.js.map +1 -1
  130. package/background/src/lib/virtualized/project/start.js +6 -0
  131. package/background/src/lib/virtualized/project/start.js.map +1 -1
  132. package/background/src/lib/virtualized/project/startScenarioCapture.js +54 -31
  133. package/background/src/lib/virtualized/project/startScenarioCapture.js.map +1 -1
  134. package/background/src/lib/virtualized/project/writeMockDataTsx.js +106 -46
  135. package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
  136. package/background/src/lib/virtualized/project/writeScenarioComponents.js +399 -106
  137. package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
  138. package/background/src/lib/virtualized/project/writeSimpleRoot.js +11 -11
  139. package/background/src/lib/virtualized/project/writeSimpleRoot.js.map +1 -1
  140. package/codeyam-cli/src/cli.js +2 -0
  141. package/codeyam-cli/src/cli.js.map +1 -1
  142. package/codeyam-cli/src/commands/debug.js +14 -2
  143. package/codeyam-cli/src/commands/debug.js.map +1 -1
  144. package/codeyam-cli/src/commands/recapture.js +215 -0
  145. package/codeyam-cli/src/commands/recapture.js.map +1 -0
  146. package/codeyam-cli/src/commands/report.js +26 -23
  147. package/codeyam-cli/src/commands/report.js.map +1 -1
  148. package/codeyam-cli/src/utils/backgroundServer.js +2 -2
  149. package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
  150. package/codeyam-cli/src/utils/generateReport.js +252 -106
  151. package/codeyam-cli/src/utils/generateReport.js.map +1 -1
  152. package/codeyam-cli/src/utils/install-skills.js +2 -2
  153. package/codeyam-cli/src/utils/install-skills.js.map +1 -1
  154. package/codeyam-cli/src/utils/queue/__tests__/manager.test.js +38 -0
  155. package/codeyam-cli/src/utils/queue/__tests__/manager.test.js.map +1 -1
  156. package/codeyam-cli/src/utils/queue/job.js +140 -16
  157. package/codeyam-cli/src/utils/queue/job.js.map +1 -1
  158. package/codeyam-cli/src/utils/queue/manager.js +19 -7
  159. package/codeyam-cli/src/utils/queue/manager.js.map +1 -1
  160. package/codeyam-cli/src/utils/queue/persistence.js.map +1 -1
  161. package/codeyam-cli/src/webserver/app/lib/database.js +47 -0
  162. package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
  163. package/codeyam-cli/src/webserver/app/lib/dbNotifier.js.map +1 -1
  164. package/codeyam-cli/src/webserver/backgroundServer.js +5 -10
  165. package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
  166. package/codeyam-cli/src/webserver/bootstrap.js +9 -0
  167. package/codeyam-cli/src/webserver/bootstrap.js.map +1 -0
  168. package/codeyam-cli/src/webserver/build/client/assets/EntityItem-wXL1Z2Aq.js +1 -0
  169. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-efWKDYMr.js → EntityTypeBadge-CzGX-miz.js} +1 -1
  170. package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-CXFKsCOD.js +41 -0
  171. package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-D-9pXIaY.js +25 -0
  172. package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-CBQPrpT0.js +3 -0
  173. package/codeyam-cli/src/webserver/build/client/assets/LoadingDots-D1CdlbrV.js +6 -0
  174. package/codeyam-cli/src/webserver/build/client/assets/LogViewer-wDPcZNKx.js +3 -0
  175. package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-4lcOlid-.js +11 -0
  176. package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-BfmDgXxG.js +1 -0
  177. package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-CUxUNEEC.js +15 -0
  178. package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-COPstp9J.js → TruncatedFilePath-6J7zDUD5.js} +1 -1
  179. package/codeyam-cli/src/webserver/build/client/assets/_index-DHImXdXq.js +11 -0
  180. package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-CVP_WGQ3.js +32 -0
  181. package/codeyam-cli/src/webserver/build/client/assets/api.link-scenario-value-l0sNRNKZ.js +1 -0
  182. package/codeyam-cli/src/webserver/build/client/assets/api.update-key-attributes-l0sNRNKZ.js +1 -0
  183. package/codeyam-cli/src/webserver/build/client/assets/api.update-valid-values-l0sNRNKZ.js +1 -0
  184. package/codeyam-cli/src/webserver/build/client/assets/chevron-down-BYimnrHg.js +6 -0
  185. package/codeyam-cli/src/webserver/build/client/assets/chunk-JMJ3UQ3L-BambyYE_.js +51 -0
  186. package/codeyam-cli/src/webserver/build/client/assets/circle-check-CaVsIRxt.js +6 -0
  187. package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-CgUsG7ib.js +21 -0
  188. package/codeyam-cli/src/webserver/build/client/assets/cy-logo-cli-CKnwPCDr.js +1 -0
  189. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-DW_hdGUc.js +1 -0
  190. package/codeyam-cli/src/webserver/build/client/assets/entity._sha._-Dt-SjPsw.js +23 -0
  191. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-DyB90fWk.js +1 -0
  192. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-D_3ero5o.js +1 -0
  193. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.edit._scenarioId-CfLCUi9S.js +5 -0
  194. package/codeyam-cli/src/webserver/build/client/assets/entry.client-DKJyZfAY.js +29 -0
  195. package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-DAtOlaWE.js +1 -0
  196. package/codeyam-cli/src/webserver/build/client/assets/files-ClR0d32A.js +1 -0
  197. package/codeyam-cli/src/webserver/build/client/assets/git-D62Lxxmv.js +15 -0
  198. package/codeyam-cli/src/webserver/build/client/assets/globals-C9s7Lhdl.css +1 -0
  199. package/codeyam-cli/src/webserver/build/client/assets/html2canvas-pro.esm-fmIEn3Bc.js +9 -0
  200. package/codeyam-cli/src/webserver/build/client/assets/index-BosqDOlH.js +3 -0
  201. package/codeyam-cli/src/webserver/build/client/assets/index-CzNNiTkw.js +9 -0
  202. package/codeyam-cli/src/webserver/build/client/assets/keyAttributeCoverage-CTlFMihX.js +1 -0
  203. package/codeyam-cli/src/webserver/build/client/assets/loader-circle-CNp9QFCX.js +6 -0
  204. package/codeyam-cli/src/webserver/build/client/assets/manifest-0d27da29.js +1 -0
  205. package/codeyam-cli/src/webserver/build/client/assets/preload-helper-ckwbz45p.js +1 -0
  206. package/codeyam-cli/src/webserver/build/client/assets/root-B_wIKCIf.js +56 -0
  207. package/codeyam-cli/src/webserver/build/client/assets/scenarioStatus-B_8jpV3e.js +1 -0
  208. package/codeyam-cli/src/webserver/build/client/assets/search-DDGjYAMJ.js +6 -0
  209. package/codeyam-cli/src/webserver/build/client/assets/settings-DgTyB-Wg.js +1 -0
  210. package/codeyam-cli/src/webserver/build/client/assets/simulations-CoNWGt0K.js +1 -0
  211. package/codeyam-cli/src/webserver/build/client/assets/triangle-alert-CBc5dE1s.js +6 -0
  212. package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-BMIGFP-m.js +1 -0
  213. package/codeyam-cli/src/webserver/build/client/assets/useInteractiveMode-Dk_FQqWJ.js +1 -0
  214. package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-3pmpUQB-.js → useLastLogLine-BqPPNjAl.js} +1 -1
  215. package/codeyam-cli/src/webserver/build/client/assets/useReportContext-DsJbgMY9.js +1 -0
  216. package/codeyam-cli/src/webserver/build/client/assets/{useToast-DEyawJ8r.js → useToast-DWHcCcl1.js} +1 -1
  217. package/codeyam-cli/src/webserver/build/server/assets/index-CU58-Ttc.js +1 -0
  218. package/codeyam-cli/src/webserver/build/server/assets/server-build-D35o2uae.js +175 -0
  219. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  220. package/codeyam-cli/src/webserver/build-info.json +5 -5
  221. package/codeyam-cli/src/webserver/devServer.js +1 -3
  222. package/codeyam-cli/src/webserver/devServer.js.map +1 -1
  223. package/codeyam-cli/templates/codeyam-setup-skill.md +138 -3
  224. package/codeyam-cli/templates/debug-codeyam.md +625 -0
  225. package/package.json +14 -14
  226. package/packages/ai/src/lib/analyzeScope.js +2 -0
  227. package/packages/ai/src/lib/analyzeScope.js.map +1 -1
  228. package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js +16 -0
  229. package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js.map +1 -1
  230. package/packages/ai/src/lib/astScopes/patterns/switchStatementHandler.js +16 -0
  231. package/packages/ai/src/lib/astScopes/patterns/switchStatementHandler.js.map +1 -1
  232. package/packages/ai/src/lib/astScopes/processExpression.js +305 -88
  233. package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
  234. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +582 -41
  235. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
  236. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js +2 -1
  237. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js.map +1 -1
  238. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.js +454 -0
  239. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.js.map +1 -0
  240. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js +173 -55
  241. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js.map +1 -1
  242. package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js +16 -1
  243. package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js.map +1 -1
  244. package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js +30 -1
  245. package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js.map +1 -1
  246. package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js +20 -0
  247. package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js.map +1 -1
  248. package/packages/ai/src/lib/dataStructure/helpers/convertNullToUndefinedBySchema.js +86 -0
  249. package/packages/ai/src/lib/dataStructure/helpers/convertNullToUndefinedBySchema.js.map +1 -0
  250. package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js +28 -2
  251. package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js.map +1 -1
  252. package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js +179 -17
  253. package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js.map +1 -1
  254. package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js +6 -0
  255. package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js.map +1 -1
  256. package/packages/ai/src/lib/generateChangesEntityScenarioData.js +41 -0
  257. package/packages/ai/src/lib/generateChangesEntityScenarioData.js.map +1 -1
  258. package/packages/ai/src/lib/generateChangesEntityScenarios.js +37 -4
  259. package/packages/ai/src/lib/generateChangesEntityScenarios.js.map +1 -1
  260. package/packages/ai/src/lib/generateEntityDataStructure.js +4 -0
  261. package/packages/ai/src/lib/generateEntityDataStructure.js.map +1 -1
  262. package/packages/ai/src/lib/generateEntityKeyAttributes.js +176 -9
  263. package/packages/ai/src/lib/generateEntityKeyAttributes.js.map +1 -1
  264. package/packages/ai/src/lib/generateEntityScenarioData.js +29 -25
  265. package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
  266. package/packages/ai/src/lib/generateEntityScenarios.js +105 -9
  267. package/packages/ai/src/lib/generateEntityScenarios.js.map +1 -1
  268. package/packages/ai/src/lib/getConditionalUsagesFromCode.js +84 -14
  269. package/packages/ai/src/lib/getConditionalUsagesFromCode.js.map +1 -1
  270. package/packages/ai/src/lib/guessScenarioDataFromDescription.js +2 -1
  271. package/packages/ai/src/lib/guessScenarioDataFromDescription.js.map +1 -1
  272. package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js +6 -0
  273. package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js.map +1 -1
  274. package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js +38 -2
  275. package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js.map +1 -1
  276. package/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.js +38 -2
  277. package/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.js.map +1 -1
  278. package/packages/ai/src/lib/promptGenerators/guessNewScenarioDataFromDescriptionGenerator.js +16 -3
  279. package/packages/ai/src/lib/promptGenerators/guessNewScenarioDataFromDescriptionGenerator.js.map +1 -1
  280. package/packages/ai/src/lib/worker/SerializableDataStructure.js.map +1 -1
  281. package/packages/ai/src/lib/worker/analyzeScopeWorker.js +4 -0
  282. package/packages/ai/src/lib/worker/analyzeScopeWorker.js.map +1 -1
  283. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +100 -23
  284. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
  285. package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js +125 -0
  286. package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js.map +1 -0
  287. package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js +298 -45
  288. package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js.map +1 -1
  289. package/packages/analyze/src/lib/files/scenarios/generateChangesScenarioData.js +1 -1
  290. package/packages/analyze/src/lib/files/scenarios/generateChangesScenarioData.js.map +1 -1
  291. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +201 -80
  292. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
  293. package/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.js +10 -5
  294. package/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.js.map +1 -1
  295. package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js +55 -69
  296. package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js.map +1 -1
  297. package/packages/analyze/src/lib/files/scenarios/generateScenarios.js +2 -5
  298. package/packages/analyze/src/lib/files/scenarios/generateScenarios.js.map +1 -1
  299. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +171 -81
  300. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
  301. package/packages/database/src/lib/kysely/db.js +2 -2
  302. package/packages/database/src/lib/kysely/tables/debugReportsTable.js +9 -3
  303. package/packages/database/src/lib/kysely/tables/debugReportsTable.js.map +1 -1
  304. package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +8 -4
  305. package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
  306. package/packages/generate/src/lib/deepMerge.js +27 -1
  307. package/packages/generate/src/lib/deepMerge.js.map +1 -1
  308. package/packages/types/index.js +1 -0
  309. package/packages/types/index.js.map +1 -1
  310. package/packages/types/src/types/Scenario.js +21 -1
  311. package/packages/types/src/types/Scenario.js.map +1 -1
  312. package/packages/utils/src/lib/lightweightEntityExtractor.js +25 -0
  313. package/packages/utils/src/lib/lightweightEntityExtractor.js.map +1 -1
  314. package/scripts/finalize-analyzer.cjs +3 -1
  315. package/codeyam-cli/scripts/fixtures/cal.com/universal-mocks/packages/prisma/index.js +0 -238
  316. package/codeyam-cli/scripts/fixtures/cal.com/universal-mocks/packages/prisma/index.js.map +0 -1
  317. package/codeyam-cli/src/webserver/build/client/assets/EntityItem-CVbSvOjo.js +0 -1
  318. package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-DcwcHyl5.js +0 -1
  319. package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-WgwC1GfJ.js +0 -26
  320. package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-IEKom9O2.js +0 -3
  321. package/codeyam-cli/src/webserver/build/client/assets/LogViewer-BYnfxbUG.js +0 -3
  322. package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-_lBPJCzG.js +0 -1
  323. package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-lHVhvsu_.js +0 -1
  324. package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-d_TBk4GQ.js +0 -5
  325. package/codeyam-cli/src/webserver/build/client/assets/_index-kGT7VUqj.js +0 -1
  326. package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-DDGmhu7P.js +0 -7
  327. package/codeyam-cli/src/webserver/build/client/assets/chevron-down-n_HPRfM_.js +0 -1
  328. package/codeyam-cli/src/webserver/build/client/assets/chunk-WWGJGFF6-CbVoyx1U.js +0 -26
  329. package/codeyam-cli/src/webserver/build/client/assets/circle-check-D1VOYveA.js +0 -1
  330. package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-YR8jjAlu.js +0 -1
  331. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-B8vP3V_s.js +0 -1
  332. package/codeyam-cli/src/webserver/build/client/assets/entity._sha._-CN6aLCT1.js +0 -16
  333. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-DA5Jeu2P.js +0 -1
  334. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.edit._scenarioId-BTeitalf.js +0 -5
  335. package/codeyam-cli/src/webserver/build/client/assets/entry.client-du6UEYD-.js +0 -13
  336. package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-BpjkhMoi.js +0 -1
  337. package/codeyam-cli/src/webserver/build/client/assets/files-BQGvk4lJ.js +0 -1
  338. package/codeyam-cli/src/webserver/build/client/assets/git-DVdYRT-I.js +0 -12
  339. package/codeyam-cli/src/webserver/build/client/assets/globals-CO-U8Bpo.css +0 -1
  340. package/codeyam-cli/src/webserver/build/client/assets/html2canvas-pro.esm-XQCGvadH.js +0 -5
  341. package/codeyam-cli/src/webserver/build/client/assets/index-DCG-vks0.js +0 -1
  342. package/codeyam-cli/src/webserver/build/client/assets/loader-circle-GazdNeLl.js +0 -1
  343. package/codeyam-cli/src/webserver/build/client/assets/manifest-0b694d28.js +0 -1
  344. package/codeyam-cli/src/webserver/build/client/assets/root-D3tQP7hx.js +0 -16
  345. package/codeyam-cli/src/webserver/build/client/assets/search-CIY6XmtE.js +0 -1
  346. package/codeyam-cli/src/webserver/build/client/assets/server-build-CMKNK2uU.css +0 -1
  347. package/codeyam-cli/src/webserver/build/client/assets/settings-CoMDgElu.js +0 -1
  348. package/codeyam-cli/src/webserver/build/client/assets/simulations-agkniXp2.js +0 -1
  349. package/codeyam-cli/src/webserver/build/client/assets/triangle-alert-B2VUcygF.js +0 -1
  350. package/codeyam-cli/src/webserver/build/client/assets/useReportContext-EvdK-zXP.js +0 -1
  351. package/codeyam-cli/src/webserver/build/server/assets/index-DGVHQEXD.js +0 -1
  352. package/codeyam-cli/src/webserver/build/server/assets/server-build-CghkTkIL.js +0 -166
  353. package/codeyam-cli/templates/debug-command.md +0 -303
  354. /package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-CMKNK2uU.css → styles-CMKNK2uU.css} +0 -0
@@ -0,0 +1,715 @@
1
+ import { ScopeDataStructure, ScopeNode } from '../../ScopeDataStructure';
2
+ import {
3
+ AddEquivalenciesInfo,
4
+ EquivalencyManager,
5
+ } from '../EquivalencyManager';
6
+
7
+ /**
8
+ * Framework manager for MUI (Material UI) components.
9
+ *
10
+ * Handles patterns where MUI component callbacks receive data from array props:
11
+ *
12
+ * 1. DataGrid: `rows` array → `columns[].renderCell` callback receives `params.row`
13
+ * 2. Autocomplete: `options` array → `renderOption`/`getOptionLabel` callbacks receive option
14
+ *
15
+ * Example DataGrid:
16
+ * ```tsx
17
+ * <DataGrid
18
+ * rows={data}
19
+ * columns={[{ renderCell: (params) => <Cell value={params.row.id} /> }]}
20
+ * />
21
+ * ```
22
+ *
23
+ * Example Autocomplete:
24
+ * ```tsx
25
+ * <Autocomplete
26
+ * options={users}
27
+ * getOptionLabel={(option) => option.name}
28
+ * renderOption={(props, option) => <li {...props}>{option.email}</li>}
29
+ * />
30
+ * ```
31
+ */
32
+ export class MuiManager implements EquivalencyManager {
33
+ postProcess(scopeNode: ScopeNode, scopeDataStructure: ScopeDataStructure) {
34
+ // Check this scope for DataGrid patterns when it's post-processed
35
+ this.processDataGridCallbacks(scopeNode, scopeDataStructure);
36
+
37
+ // Check for Autocomplete patterns
38
+ this.processAutocompleteCallbacks(scopeNode, scopeDataStructure);
39
+
40
+ // Also check if this scope is inside a DataGrid callback and propagate row property accesses
41
+ this.propagateFromChildScope(scopeNode, scopeDataStructure);
42
+ }
43
+
44
+ private processDataGridCallbacks(
45
+ scopeNode: ScopeNode,
46
+ scopeDataStructure: ScopeDataStructure,
47
+ ) {
48
+ // Find DataGrid calls and link renderCell callbacks to rows
49
+ for (const [path, equivalencies] of Object.entries(
50
+ scopeNode.equivalencies,
51
+ )) {
52
+ // Look for DataGrid().signature[0].columns equivalency (DataGrid, DataGridPro, DataGridPremium)
53
+ const dataGridMatch = path.match(
54
+ /^(DataGrid(?:Pro|Premium)?\(\))\.signature\[0\]\.columns$/,
55
+ );
56
+ if (!dataGridMatch) continue;
57
+
58
+ const dataGridCall = dataGridMatch[1];
59
+
60
+ // Find what columns is equivalent to (e.g., "columns" variable)
61
+ for (const equiv of equivalencies) {
62
+ const columnsVar = equiv.schemaPath;
63
+
64
+ // Find renderCell callbacks, following equivalency chains if needed
65
+ const callbackScopes = this.findRenderCellCallbacks(
66
+ columnsVar,
67
+ scopeNode,
68
+ new Set(),
69
+ scopeDataStructure,
70
+ );
71
+
72
+ for (const callbackScopeName of callbackScopes) {
73
+ // Get the callback scope node
74
+ const callbackScopeNode =
75
+ scopeDataStructure.getScopeOrFunctionCallInfo(callbackScopeName);
76
+ if (!callbackScopeNode) {
77
+ continue;
78
+ }
79
+
80
+ // Add equivalency: signature[0].row ≡ DataGrid().signature[0].rows[]
81
+ const callbackParamRowPath = 'signature[0].row';
82
+ const rowsArrayElementPath = `${dataGridCall}.signature[0].rows[]`;
83
+
84
+ scopeDataStructure.addEquivalency(
85
+ callbackParamRowPath,
86
+ rowsArrayElementPath,
87
+ scopeNode.name,
88
+ callbackScopeNode as ScopeNode,
89
+ 'MUI DataGrid renderCell params.row equivalency',
90
+ );
91
+ }
92
+ }
93
+ }
94
+ }
95
+
96
+ /**
97
+ * Process Autocomplete callbacks to link option parameters to options array.
98
+ *
99
+ * Autocomplete has two callback props that receive individual options:
100
+ * - getOptionLabel(option) - param 0 is the option
101
+ * - renderOption(props, option, state) - param 1 is the option
102
+ */
103
+ private processAutocompleteCallbacks(
104
+ scopeNode: ScopeNode,
105
+ scopeDataStructure: ScopeDataStructure,
106
+ ) {
107
+ for (const [path, equivalencies] of Object.entries(
108
+ scopeNode.equivalencies,
109
+ )) {
110
+ // Look for Autocomplete().signature[0].options equivalency
111
+ const autocompleteMatch = path.match(
112
+ /^(Autocomplete\(\))\.signature\[0\]\.options$/,
113
+ );
114
+ if (!autocompleteMatch) continue;
115
+
116
+ const autocompleteCall = autocompleteMatch[1];
117
+
118
+ // Find callback props: getOptionLabel, renderOption
119
+ for (const callbackProp of ['getOptionLabel', 'renderOption']) {
120
+ const callbackPath = `${autocompleteCall}.signature[0].${callbackProp}`;
121
+ const callbackEquivs = scopeNode.equivalencies[callbackPath];
122
+
123
+ if (callbackEquivs) {
124
+ for (const callbackEquiv of callbackEquivs) {
125
+ const callbackMatch = callbackEquiv.schemaPath.match(
126
+ /^(cyScope[0-9A-Fa-f]+)\(\)\.functionCallReturnValue$/,
127
+ );
128
+ if (!callbackMatch) continue;
129
+
130
+ const callbackScopeName = callbackMatch[1];
131
+ const callbackScopeNode =
132
+ scopeDataStructure.getScopeOrFunctionCallInfo(callbackScopeName);
133
+ if (!callbackScopeNode) continue;
134
+
135
+ // Determine which parameter index receives the option
136
+ // getOptionLabel: (option) => ... → param 0
137
+ // renderOption: (props, option, state) => ... → param 1
138
+ const paramIndex = callbackProp === 'renderOption' ? 1 : 0;
139
+
140
+ const callbackParamPath = `signature[${paramIndex}]`;
141
+ const optionsArrayElementPath = `${autocompleteCall}.signature[0].options[]`;
142
+
143
+ scopeDataStructure.addEquivalency(
144
+ callbackParamPath,
145
+ optionsArrayElementPath,
146
+ scopeNode.name,
147
+ callbackScopeNode as ScopeNode,
148
+ `MUI Autocomplete ${callbackProp} option equivalency`,
149
+ );
150
+ // Note: Property accesses are propagated in finalize() after all scopes are established
151
+ }
152
+ }
153
+ }
154
+ }
155
+ }
156
+
157
+ /**
158
+ * Propagate property accesses from Autocomplete callback scope.
159
+ * When we find usages like `option.email`, create equivalencies to `options[].email`
160
+ * and trace back to the original data source (e.g., `users[].email`).
161
+ */
162
+ private propagateAutocompletePropertyAccesses(
163
+ callbackScope: ScopeNode,
164
+ autocompleteCall: string,
165
+ optionParamIndex: number,
166
+ parentScopeName: string,
167
+ scopeDataStructure: ScopeDataStructure,
168
+ ) {
169
+ const parentScope = scopeDataStructure.getScopeOrFunctionCallInfo(
170
+ parentScopeName,
171
+ ) as ScopeNode;
172
+ if (!parentScope) return;
173
+
174
+ // Find what options is equivalent to (e.g., "users")
175
+ const optionsPath = `${autocompleteCall}.signature[0].options`;
176
+ const optionsEquivs = parentScope.equivalencies?.[optionsPath];
177
+ const dataSourcePath = optionsEquivs?.[0]?.schemaPath;
178
+
179
+ // Check for property accesses on the option parameter in the schema
180
+ // The schema contains entries like "signature[1].email" for property accesses
181
+ for (const schemaPath of Object.keys(callbackScope.schema || {})) {
182
+ // Match patterns like signature[0].name, signature[1].email (depending on param index)
183
+ const optionPropertyMatch = schemaPath.match(
184
+ new RegExp(`^signature\\[${optionParamIndex}\\]\\.(\\w+)$`),
185
+ );
186
+
187
+ if (optionPropertyMatch) {
188
+ const propertyName = optionPropertyMatch[1];
189
+
190
+ // Create equivalency: schemaPath → options[].propertyName
191
+ const optionsPropertyPath = `${autocompleteCall}.signature[0].options[].${propertyName}`;
192
+
193
+ scopeDataStructure.addEquivalency(
194
+ schemaPath,
195
+ optionsPropertyPath,
196
+ parentScopeName,
197
+ callbackScope,
198
+ 'MUI Autocomplete option property equivalency',
199
+ );
200
+
201
+ // Also create equivalency to the data source (e.g., users[].email)
202
+ if (dataSourcePath) {
203
+ const dataPropertyPath = `${dataSourcePath}[].${propertyName}`;
204
+
205
+ // Add to parent scope's schema
206
+ if (!parentScope.schema[dataPropertyPath]) {
207
+ parentScope.schema[dataPropertyPath] = 'unknown';
208
+ }
209
+
210
+ // Create bidirectional equivalencies to ensure propagation
211
+ scopeDataStructure.addEquivalency(
212
+ schemaPath,
213
+ dataPropertyPath,
214
+ parentScopeName,
215
+ callbackScope,
216
+ 'MUI Autocomplete option property equivalency',
217
+ );
218
+
219
+ scopeDataStructure.addEquivalency(
220
+ dataPropertyPath,
221
+ schemaPath,
222
+ parentScopeName,
223
+ parentScope,
224
+ 'MUI Autocomplete option property equivalency',
225
+ );
226
+ }
227
+ }
228
+ }
229
+ }
230
+
231
+ /**
232
+ * Find renderCell callbacks for a columns variable, following equivalency chains.
233
+ * For example: tableColumns → allColumns → allColumns[].renderCell → cyScope
234
+ *
235
+ * Also handles useMemo patterns where:
236
+ * - tableColumns → useMemo(cyScope(), [allColumns]).functionCallReturnValue
237
+ * - And allColumns[].renderCell → cyScope()
238
+ */
239
+ private findRenderCellCallbacks(
240
+ columnsVar: string,
241
+ scopeNode: ScopeNode,
242
+ visited: Set<string>,
243
+ scopeDataStructure?: ScopeDataStructure,
244
+ ): string[] {
245
+ if (visited.has(columnsVar)) return [];
246
+ visited.add(columnsVar);
247
+
248
+ const callbackScopes: string[] = [];
249
+
250
+ // Try direct path: columnsVar[].renderCell - check both current scope and parent scopes
251
+ // Also check for indexed paths like columnsVar[3].renderCell (with specific indices)
252
+ const renderCellPath = `${columnsVar}[].renderCell`;
253
+ let renderCellEquivs = scopeNode.equivalencies[renderCellPath];
254
+
255
+ // If not found in current scope, check parent scopes (via scopeNode.tree)
256
+ if (!renderCellEquivs && scopeDataStructure && scopeNode.tree) {
257
+ for (const parentScopeName of scopeNode.tree) {
258
+ const parentScope = scopeDataStructure.getScopeOrFunctionCallInfo(
259
+ parentScopeName,
260
+ ) as ScopeNode;
261
+ if (parentScope?.equivalencies?.[renderCellPath]) {
262
+ renderCellEquivs = parentScope.equivalencies[renderCellPath];
263
+ break;
264
+ }
265
+ }
266
+ }
267
+
268
+ // Also look for indexed paths like tableColumns[3].renderCell, tableColumns[5].renderCell, etc.
269
+ // This is needed because column definitions often have specific indices
270
+ const indexedRenderCellPattern = new RegExp(
271
+ `^${columnsVar.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}\\[\\d+\\]\\.renderCell$`,
272
+ );
273
+ const allScopesToCheck = [scopeNode];
274
+ if (scopeDataStructure && scopeNode.tree) {
275
+ for (const parentScopeName of scopeNode.tree) {
276
+ const parentScope = scopeDataStructure.getScopeOrFunctionCallInfo(
277
+ parentScopeName,
278
+ ) as ScopeNode;
279
+ if (parentScope) allScopesToCheck.push(parentScope);
280
+ }
281
+ }
282
+
283
+ for (const scope of allScopesToCheck) {
284
+ for (const [path, equivs] of Object.entries(scope.equivalencies || {})) {
285
+ if (indexedRenderCellPattern.test(path)) {
286
+ for (const equiv of equivs) {
287
+ const callbackMatch = equiv.schemaPath.match(
288
+ /^(cyScope\d+)\(\)\.functionCallReturnValue$/,
289
+ );
290
+ if (callbackMatch && !callbackScopes.includes(callbackMatch[1])) {
291
+ callbackScopes.push(callbackMatch[1]);
292
+ }
293
+ }
294
+ }
295
+ }
296
+ }
297
+
298
+ if (renderCellEquivs) {
299
+ for (const renderCellEquiv of renderCellEquivs) {
300
+ // Check if it points to a callback (cyScope().functionCallReturnValue)
301
+ const callbackMatch = renderCellEquiv.schemaPath.match(
302
+ /^(cyScope\d+)\(\)\.functionCallReturnValue$/,
303
+ );
304
+ if (callbackMatch && !callbackScopes.includes(callbackMatch[1])) {
305
+ callbackScopes.push(callbackMatch[1]);
306
+ }
307
+ }
308
+ }
309
+
310
+ // If no direct callbacks found, follow equivalency chains
311
+ if (callbackScopes.length === 0) {
312
+ // Look for what columnsVar is equivalent to - check current scope and parent scopes
313
+ let varEquivs = scopeNode.equivalencies[columnsVar];
314
+ let equivScopeNode = scopeNode;
315
+
316
+ // If not found or only self-reference, check parent scopes (via scopeNode.tree)
317
+ if (
318
+ (!varEquivs ||
319
+ (varEquivs.length === 1 && varEquivs[0].schemaPath === columnsVar)) &&
320
+ scopeDataStructure &&
321
+ scopeNode.tree
322
+ ) {
323
+ for (const parentScopeName of scopeNode.tree) {
324
+ const parentScope = scopeDataStructure.getScopeOrFunctionCallInfo(
325
+ parentScopeName,
326
+ ) as ScopeNode;
327
+ if (parentScope?.equivalencies?.[columnsVar]) {
328
+ const parentEquivs = parentScope.equivalencies[columnsVar];
329
+ // Check if it has non-self-reference equivalencies
330
+ if (
331
+ parentEquivs.some((e) => e.schemaPath !== columnsVar) ||
332
+ parentEquivs.some((e) => e.schemaPath.includes('useMemo'))
333
+ ) {
334
+ varEquivs = parentEquivs;
335
+ equivScopeNode = parentScope;
336
+ break;
337
+ }
338
+ }
339
+ }
340
+ }
341
+
342
+ if (varEquivs) {
343
+ for (const varEquiv of varEquivs) {
344
+ const schemaPath = varEquiv.schemaPath;
345
+
346
+ // Handle useMemo pattern: useMemo(cyScope(), [allColumns]).functionCallReturnValue
347
+ // The second argument [allColumns] tells us what's being passed to useMemo
348
+ const useMemoMatch = schemaPath.match(
349
+ /^useMemo\(cyScope\d+\(\), \[([^\]]+)\]\)\.functionCallReturnValue$/,
350
+ );
351
+ if (useMemoMatch) {
352
+ // The array in the dependency list often contains the actual columns variable
353
+ const depsList = useMemoMatch[1];
354
+ // Parse the deps - could be comma-separated
355
+ const deps = depsList.split(',').map((d) => d.trim());
356
+ for (const dep of deps) {
357
+ const nestedCallbacks = this.findRenderCellCallbacks(
358
+ dep,
359
+ equivScopeNode,
360
+ visited,
361
+ scopeDataStructure,
362
+ );
363
+ callbackScopes.push(...nestedCallbacks);
364
+ }
365
+ continue;
366
+ }
367
+
368
+ // Skip other function calls and internal paths
369
+ if (schemaPath.includes('()') || schemaPath.includes('[')) {
370
+ continue;
371
+ }
372
+
373
+ // Skip self-references
374
+ if (schemaPath === columnsVar) {
375
+ continue;
376
+ }
377
+
378
+ // Recursively search in the equivalent variable
379
+ const nestedCallbacks = this.findRenderCellCallbacks(
380
+ schemaPath,
381
+ equivScopeNode,
382
+ visited,
383
+ scopeDataStructure,
384
+ );
385
+ callbackScopes.push(...nestedCallbacks);
386
+ }
387
+ }
388
+ }
389
+
390
+ return callbackScopes;
391
+ }
392
+
393
+ /**
394
+ * Propagate row property accesses from callback scope and its children.
395
+ * When we find usages like `params.row.id`, create equivalencies to `rows[].id`.
396
+ */
397
+ private propagateRowPropertyAccesses(
398
+ callbackScope: ScopeNode,
399
+ dataGridCall: string,
400
+ parentScopeName: string,
401
+ scopeDataStructure: ScopeDataStructure,
402
+ ) {
403
+ // Check all scopes (callback and its children) for params.row.* accesses
404
+ const scopesToCheck = [callbackScope];
405
+
406
+ // Find child scopes by looking for scopes whose tree includes the callback scope
407
+ const callbackScopeName = callbackScope.name;
408
+ for (const [scopeName, scope] of Object.entries(
409
+ scopeDataStructure.scopeNodes,
410
+ )) {
411
+ if (
412
+ scope.tree &&
413
+ scope.tree.includes(callbackScopeName) &&
414
+ scopeName !== callbackScopeName
415
+ ) {
416
+ scopesToCheck.push(scope);
417
+ }
418
+ }
419
+
420
+ for (const scope of scopesToCheck) {
421
+ // Find equivalencies that reference params.row.* or signature[0].row.*
422
+ for (const [path, equivs] of Object.entries(scope.equivalencies)) {
423
+ for (const equiv of equivs) {
424
+ const schemaPath = equiv.schemaPath;
425
+
426
+ // Match patterns like params.row.id, params.row.flagged, signature[0].row.status
427
+ const rowPropertyMatch = schemaPath.match(
428
+ /^(?:params|signature\[0\])\.row\.(\w+)$/,
429
+ );
430
+
431
+ if (rowPropertyMatch) {
432
+ const propertyName = rowPropertyMatch[1];
433
+
434
+ // Create equivalency: the path accessing params.row.X → rows[].X
435
+ // e.g., updateStatus().signature[0].id → DataGrid().signature[0].rows[].id
436
+ const rowsPropertyPath = `${dataGridCall}.signature[0].rows[].${propertyName}`;
437
+
438
+ scopeDataStructure.addEquivalency(
439
+ path,
440
+ rowsPropertyPath,
441
+ parentScopeName,
442
+ scope,
443
+ 'MUI DataGrid renderCell params.row equivalency',
444
+ );
445
+ }
446
+ }
447
+ }
448
+ }
449
+ }
450
+
451
+ /**
452
+ * Process from child scope perspective: look for params.row.* accesses
453
+ * and trace back to find DataGrid rows equivalency in parent scopes.
454
+ */
455
+ private propagateFromChildScope(
456
+ scopeNode: ScopeNode,
457
+ scopeDataStructure: ScopeDataStructure,
458
+ ) {
459
+ // Look for equivalencies in this scope that reference params.row.*
460
+ for (const [path, equivs] of Object.entries(scopeNode.equivalencies)) {
461
+ for (const equiv of equivs) {
462
+ const schemaPath = equiv.schemaPath;
463
+
464
+ // Match patterns like params.row.id, params.row.status
465
+ const rowPropertyMatch = schemaPath.match(/^params\.row\.(\w+)$/);
466
+
467
+ if (rowPropertyMatch) {
468
+ const propertyName = rowPropertyMatch[1];
469
+
470
+ // Look in parent scopes for DataGrid rows equivalency
471
+ // The pattern we're looking for is: signature[0].row → DataGrid().signature[0].rows[]
472
+ const dataGridCall = this.findDataGridInParentScopes(
473
+ scopeNode,
474
+ scopeDataStructure,
475
+ );
476
+
477
+ if (dataGridCall) {
478
+ // Find the parent scope that has the DataGrid
479
+ const parentScopeName = this.findDataGridScopeName(
480
+ scopeNode,
481
+ scopeDataStructure,
482
+ );
483
+ const parentScope = parentScopeName
484
+ ? (scopeDataStructure.getScopeOrFunctionCallInfo(
485
+ parentScopeName,
486
+ ) as ScopeNode)
487
+ : undefined;
488
+
489
+ // Find what DataGrid().signature[0].rows is equivalent to (e.g., "data.quotes")
490
+ const rowsPath = `${dataGridCall}.signature[0].rows`;
491
+ const rowsEquivs = parentScope?.equivalencies?.[rowsPath];
492
+ const dataSourcePath = rowsEquivs?.[0]?.schemaPath;
493
+
494
+ if (dataSourcePath && parentScope) {
495
+ // Create equivalency: path → dataSource[].propertyName (e.g., data.quotes[].id)
496
+ const dataPropertyPath = `${dataSourcePath}[].${propertyName}`;
497
+
498
+ // Add equivalency in child scope
499
+ scopeDataStructure.addEquivalency(
500
+ path,
501
+ dataPropertyPath,
502
+ parentScopeName || scopeNode.name,
503
+ scopeNode,
504
+ 'MUI DataGrid renderCell params.row equivalency',
505
+ );
506
+
507
+ // Also add the property access to the parent scope's schema
508
+ // This ensures that data.quotes[].id shows up as an accessed property
509
+ if (!parentScope.schema[dataPropertyPath]) {
510
+ parentScope.schema[dataPropertyPath] = 'unknown';
511
+ }
512
+
513
+ // And create an equivalency FROM the data path so it propagates to returnValue
514
+ scopeDataStructure.addEquivalency(
515
+ dataPropertyPath,
516
+ path,
517
+ parentScopeName!,
518
+ parentScope,
519
+ 'MUI DataGrid renderCell params.row equivalency',
520
+ );
521
+ }
522
+ }
523
+ }
524
+ }
525
+ }
526
+ }
527
+
528
+ /**
529
+ * Find the DataGrid call in parent scopes by looking for signature[0].row → DataGrid().signature[0].rows[]
530
+ */
531
+ private findDataGridInParentScopes(
532
+ scopeNode: ScopeNode,
533
+ scopeDataStructure: ScopeDataStructure,
534
+ ): string | undefined {
535
+ // Check the scope tree (parent scopes)
536
+ if (!scopeNode.tree) return undefined;
537
+
538
+ for (const parentScopeName of scopeNode.tree) {
539
+ const parentScope = scopeDataStructure.getScopeOrFunctionCallInfo(
540
+ parentScopeName,
541
+ ) as ScopeNode;
542
+ if (!parentScope?.equivalencies) continue;
543
+
544
+ // Look for signature[0].row → DataGrid().signature[0].rows[]
545
+ const rowEquivs = parentScope.equivalencies['signature[0].row'];
546
+ if (rowEquivs) {
547
+ for (const equiv of rowEquivs) {
548
+ const match = equiv.schemaPath.match(
549
+ /^(DataGrid(?:Pro|Premium)?)\(\)\.signature\[0\]\.rows\[\]$/,
550
+ );
551
+ if (match) {
552
+ return `${match[1]}()`;
553
+ }
554
+ }
555
+ }
556
+ }
557
+
558
+ return undefined;
559
+ }
560
+
561
+ /**
562
+ * Find the scope name that contains the DataGrid call
563
+ */
564
+ private findDataGridScopeName(
565
+ scopeNode: ScopeNode,
566
+ scopeDataStructure: ScopeDataStructure,
567
+ ): string | undefined {
568
+ if (!scopeNode.tree) return undefined;
569
+
570
+ for (const parentScopeName of scopeNode.tree) {
571
+ const parentScope = scopeDataStructure.getScopeOrFunctionCallInfo(
572
+ parentScopeName,
573
+ ) as ScopeNode;
574
+ if (!parentScope?.equivalencies) continue;
575
+
576
+ // Look for DataGrid().signature[0].columns
577
+ for (const path of Object.keys(parentScope.equivalencies)) {
578
+ if (
579
+ path.match(/^DataGrid(?:Pro|Premium)?\(\)\.signature\[0\]\.columns$/)
580
+ ) {
581
+ return parentScopeName;
582
+ }
583
+ }
584
+ }
585
+
586
+ return undefined;
587
+ }
588
+
589
+ isInterestedInSubpath(
590
+ subPathParts: string[],
591
+ _scopeNode: ScopeNode,
592
+ _scopeDataStructure: ScopeDataStructure,
593
+ ): boolean {
594
+ // We're interested in MUI component paths (DataGrid variants and Autocomplete)
595
+ const hasMuiComponent = subPathParts.some((part) =>
596
+ part.match(/^(DataGrid(Pro|Premium)?|Autocomplete)\(/),
597
+ );
598
+ return hasMuiComponent;
599
+ }
600
+
601
+ addEquivalencies(_addEquivalenciesInfo: AddEquivalenciesInfo): boolean {
602
+ // We handle DataGrid in finalize() instead, since we need to scan
603
+ // for all equivalencies after they've been established
604
+ return false;
605
+ }
606
+
607
+ finalize(_scopeNode: ScopeNode, scopeDataStructure: ScopeDataStructure) {
608
+ // Iterate through all scopes (finalize is only called on root)
609
+ for (const [scopeName, scopeNode] of Object.entries(
610
+ scopeDataStructure.scopeNodes,
611
+ )) {
612
+ this.finalizeScope(scopeNode, scopeDataStructure);
613
+ }
614
+ }
615
+
616
+ private finalizeScope(
617
+ scopeNode: ScopeNode,
618
+ scopeDataStructure: ScopeDataStructure,
619
+ ) {
620
+ // Propagate row property accesses after all scopes are established
621
+ // Find DataGrid calls in this scope and link renderCell params.row.* to rows[].*
622
+ for (const [path, equivalencies] of Object.entries(
623
+ scopeNode.equivalencies,
624
+ )) {
625
+ // Look for DataGrid().signature[0].columns equivalency
626
+ const dataGridMatch = path.match(
627
+ /^(DataGrid(?:Pro|Premium)?\(\))\.signature\[0\]\.columns$/,
628
+ );
629
+ if (dataGridMatch) {
630
+ const dataGridCall = dataGridMatch[1];
631
+
632
+ // Find what columns is equivalent to
633
+ for (const equiv of equivalencies) {
634
+ const columnsVar = equiv.schemaPath;
635
+
636
+ // Find renderCell callbacks
637
+ const callbackScopes = this.findRenderCellCallbacks(
638
+ columnsVar,
639
+ scopeNode,
640
+ new Set(),
641
+ scopeDataStructure,
642
+ );
643
+
644
+ for (const callbackScopeName of callbackScopes) {
645
+ const callbackScopeNode =
646
+ scopeDataStructure.getScopeOrFunctionCallInfo(callbackScopeName);
647
+ if (!callbackScopeNode) continue;
648
+
649
+ // Propagate sub-property accesses from params.row.*
650
+ this.propagateRowPropertyAccesses(
651
+ callbackScopeNode as ScopeNode,
652
+ dataGridCall,
653
+ scopeNode.name,
654
+ scopeDataStructure,
655
+ );
656
+ }
657
+ }
658
+ continue;
659
+ }
660
+
661
+ // Look for Autocomplete().signature[0].options equivalency
662
+ const autocompleteMatch = path.match(
663
+ /^(Autocomplete\(\))\.signature\[0\]\.options$/,
664
+ );
665
+ if (autocompleteMatch) {
666
+ const autocompleteCall = autocompleteMatch[1];
667
+
668
+ // Find callback props and propagate property accesses
669
+ for (const callbackProp of ['getOptionLabel', 'renderOption']) {
670
+ const callbackPath = `${autocompleteCall}.signature[0].${callbackProp}`;
671
+ const callbackEquivs = scopeNode.equivalencies[callbackPath];
672
+
673
+ if (callbackEquivs) {
674
+ for (const callbackEquiv of callbackEquivs) {
675
+ const callbackMatch = callbackEquiv.schemaPath.match(
676
+ /^(cyScope[0-9A-Fa-f]+)\(\)\.functionCallReturnValue$/,
677
+ );
678
+ if (!callbackMatch) continue;
679
+
680
+ const callbackScopeName = callbackMatch[1];
681
+ const callbackScopeNode =
682
+ scopeDataStructure.getScopeOrFunctionCallInfo(
683
+ callbackScopeName,
684
+ );
685
+ if (!callbackScopeNode) continue;
686
+
687
+ // Determine which parameter index receives the option
688
+ const paramIndex = callbackProp === 'renderOption' ? 1 : 0;
689
+
690
+ // Propagate property accesses from this callback
691
+ this.propagateAutocompletePropertyAccesses(
692
+ callbackScopeNode as ScopeNode,
693
+ autocompleteCall,
694
+ paramIndex,
695
+ scopeNode.name,
696
+ scopeDataStructure,
697
+ );
698
+ }
699
+ }
700
+ }
701
+ }
702
+ }
703
+ }
704
+
705
+ internalFunctions: Set<string> = new Set([
706
+ 'DataGrid',
707
+ 'DataGridPro',
708
+ 'DataGridPremium',
709
+ 'Autocomplete',
710
+ ]);
711
+
712
+ toString() {
713
+ return 'MuiManager';
714
+ }
715
+ }