@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
@@ -1,9 +1,74 @@
1
1
  import ts from 'typescript';
2
+ import * as crypto from 'crypto';
2
3
  import { StructuredPath } from "./paths.js";
3
4
  import { nodeToSource } from "./nodeToSource.js";
4
5
  import { methodRegistry, ArrayPushSemantics } from "./methodSemantics.js";
5
6
  import { isArithmeticOperator, isAssignmentOperator, isBitwiseCompoundOperator, isComparisonOperator, isDefinedType, isNumericCompoundOperator, leftOrRightType, unwrapExpression, } from "./sharedPatterns.js";
6
7
  import { processBindingPattern } from "./processBindings.js";
8
+ /**
9
+ * Converts a call expression argument to a StructuredPath.
10
+ *
11
+ * IMPORTANT: We always use the original source text for callbacks, never cyScope names.
12
+ * cyScope names are internal identifiers for child scopes and should NEVER appear
13
+ * in schema paths or call signatures. Using cyScope names causes data merge conflicts
14
+ * because the same callback gets different identifiers in different contexts.
15
+ */
16
+ function getArgPathForCallSignature(arg, context) {
17
+ // Always use the standard path conversion - never replace with cyScope names
18
+ return (StructuredPath.fromNode(arg, context.sourceFile) ||
19
+ nodeToSource(arg, context.sourceFile));
20
+ }
21
+ /**
22
+ * Builds a StructuredPath for a call expression using the original source text.
23
+ *
24
+ * IMPORTANT: This function ensures consistent call signatures by always using
25
+ * the original callback text, never cyScope names. This prevents schema path
26
+ * conflicts where the same call would have different paths.
27
+ */
28
+ function buildCallPathFromSource(node, context) {
29
+ const expression = node.expression;
30
+ // Convert arguments using original source text
31
+ const argPaths = node.arguments.map((arg) => getArgPathForCallSignature(arg, context));
32
+ // Handle type arguments if present
33
+ let typeArgs = undefined;
34
+ if (node.typeArguments && node.typeArguments.length > 0) {
35
+ typeArgs = node.typeArguments.map((typeArg) => typeArg.getText(context.sourceFile));
36
+ }
37
+ if (ts.isIdentifier(expression)) {
38
+ // Simple function call: func(arg1, arg2)
39
+ return StructuredPath.fromFunction(expression.text, argPaths, typeArgs);
40
+ }
41
+ else if (ts.isPropertyAccessExpression(expression)) {
42
+ // Method call: obj.method(arg1, arg2)
43
+ const objPath = StructuredPath.fromNode(expression.expression, context.sourceFile);
44
+ if (!objPath)
45
+ return null;
46
+ return objPath
47
+ .withProperty(expression.name.text)
48
+ .withFunctionCall(argPaths, typeArgs);
49
+ }
50
+ else if (ts.isCallExpression(expression)) {
51
+ // Chained call: func(arg1)(arg2)
52
+ const funcPath = buildCallPathFromSource(expression, context);
53
+ if (!funcPath)
54
+ return null;
55
+ return funcPath.withFunctionCall(argPaths, typeArgs);
56
+ }
57
+ else if (ts.isElementAccessExpression(expression)) {
58
+ // Element access call: obj[key](args)
59
+ const basePath = StructuredPath.fromNode(expression, context.sourceFile);
60
+ if (!basePath)
61
+ return null;
62
+ return basePath.withFunctionCall(argPaths, typeArgs);
63
+ }
64
+ else {
65
+ // Complex call expression
66
+ const basePath = StructuredPath.fromNode(expression, context.sourceFile);
67
+ if (!basePath)
68
+ return null;
69
+ return basePath.withFunctionCall(argPaths, typeArgs);
70
+ }
71
+ }
7
72
  /**
8
73
  * Checks if an expression is likely an array type.
9
74
  * Uses TypeScript's type checker when available, falls back to heuristics.
@@ -81,102 +146,220 @@ export function markConditionVariablesAsNullable(condition, context) {
81
146
  }
82
147
  }
83
148
  /**
84
- * Extracts conditional usages from a condition expression for key attribute detection.
85
- * This function identifies which attributes are used in conditionals and how they're used.
86
- *
87
- * @param condition The condition expression to analyze
88
- * @param context The analysis context
89
- * @param location Where this condition appears (if, ternary, logical-and, switch)
149
+ * Helper to extract source location from an AST node
90
150
  */
91
- export function extractConditionalUsage(condition, context, location) {
92
- const unwrapped = unwrapExpression(condition);
93
- // Handle binary expressions with && (logical AND chains)
94
- // Example: `a && b && <Component />` - both a and b are conditional checks
151
+ function getSourceLocation(node, sourceFile) {
152
+ const start = node.getStart(sourceFile);
153
+ const { line, character } = sourceFile.getLineAndCharacterOfPosition(start);
154
+ const codeSnippet = node.getText(sourceFile);
155
+ return {
156
+ lineNumber: line + 1, // Convert to 1-based
157
+ column: character,
158
+ codeSnippet: codeSnippet.length > 100
159
+ ? codeSnippet.slice(0, 100) + '...'
160
+ : codeSnippet,
161
+ };
162
+ }
163
+ /**
164
+ * Counts the number of conditions in an && chain (excluding JSX consequence)
165
+ */
166
+ function countConditionsInAndChain(expr) {
167
+ const unwrapped = unwrapExpression(expr);
95
168
  if (ts.isBinaryExpression(unwrapped) &&
96
169
  unwrapped.operatorToken.kind === ts.SyntaxKind.AmpersandAmpersandToken) {
97
- // Recursively process left side
98
- extractConditionalUsage(unwrapped.left, context, location);
99
- // Process right side if it's not JSX (JSX is the consequence, not the condition)
170
+ const leftCount = countConditionsInAndChain(unwrapped.left);
100
171
  const rightUnwrapped = unwrapExpression(unwrapped.right);
101
172
  const isJsxConsequence = ts.isJsxElement(rightUnwrapped) ||
102
173
  ts.isJsxSelfClosingElement(rightUnwrapped) ||
103
174
  ts.isJsxFragment(rightUnwrapped);
104
- if (!isJsxConsequence) {
105
- extractConditionalUsage(unwrapped.right, context, location);
175
+ if (isJsxConsequence) {
176
+ return leftCount;
106
177
  }
107
- return;
178
+ return leftCount + countConditionsInAndChain(unwrapped.right);
108
179
  }
109
- // Handle binary expressions with || (logical OR)
110
- if (ts.isBinaryExpression(unwrapped) &&
111
- unwrapped.operatorToken.kind === ts.SyntaxKind.BarBarToken) {
112
- // Both sides of || are conditional checks
113
- extractConditionalUsage(unwrapped.left, context, location);
114
- extractConditionalUsage(unwrapped.right, context, location);
115
- return;
116
- }
117
- // Handle comparison operators (===, !==, <, >, <=, >=)
118
- // Example: `if (status === 'active')` - status is compared against 'active'
119
- if (ts.isBinaryExpression(unwrapped) &&
120
- isComparisonOperator(unwrapped.operatorToken.kind)) {
121
- // Try to extract the variable and the compared value
122
- const leftPath = StructuredPath.fromNode(unwrapped.left, context.sourceFile);
123
- const rightPath = StructuredPath.fromNode(unwrapped.right, context.sourceFile);
124
- // Check if left is a variable and right is a literal
125
- if (leftPath && isLiteralExpression(unwrapped.right)) {
126
- const literalValue = getLiteralValue(unwrapped.right, context);
127
- context.addConditionalUsage({
128
- path: leftPath.toLeftHandSideString(),
129
- conditionType: 'comparison',
130
- comparedValues: literalValue !== undefined ? [literalValue] : undefined,
131
- location,
132
- });
180
+ // Single condition (not an && chain)
181
+ return 1;
182
+ }
183
+ /**
184
+ * Extracts conditional usages from a condition expression for key attribute detection.
185
+ * This function identifies which attributes are used in conditionals and how they're used.
186
+ * It also tracks compound conditionals (&&-chains) where all conditions must be true together.
187
+ *
188
+ * @param condition The condition expression to analyze
189
+ * @param context The analysis context
190
+ * @param location Where this condition appears (if, ternary, logical-and, switch)
191
+ */
192
+ export function extractConditionalUsage(condition, context, location) {
193
+ // Internal recursive function with chain tracking
194
+ function extractWithChainTracking(expr, chainInfo, isNegated) {
195
+ const unwrapped = unwrapExpression(expr);
196
+ // Handle binary expressions with && (logical AND chains)
197
+ // Example: `a && b && <Component />` - both a and b are conditional checks
198
+ if (ts.isBinaryExpression(unwrapped) &&
199
+ unwrapped.operatorToken.kind === ts.SyntaxKind.AmpersandAmpersandToken) {
200
+ // Track if we're creating the chain at this level (root of the chain)
201
+ const isChainRoot = !chainInfo;
202
+ // If no chainInfo, this is the root of a new chain
203
+ if (isChainRoot) {
204
+ const chainLength = countConditionsInAndChain(unwrapped);
205
+ // Only create chain tracking for chains with 2+ conditions
206
+ if (chainLength >= 2) {
207
+ const chainId = `chain_${crypto.randomUUID().slice(0, 8)}`;
208
+ const chainExpression = unwrapped.getText(context.sourceFile);
209
+ const compound = {
210
+ chainId,
211
+ expression: chainExpression.length > 200
212
+ ? chainExpression.slice(0, 200) + '...'
213
+ : chainExpression,
214
+ conditions: [],
215
+ location,
216
+ sourceLocation: getSourceLocation(unwrapped, context.sourceFile),
217
+ };
218
+ chainInfo = {
219
+ chainId,
220
+ chainLength,
221
+ chainExpression: compound.expression,
222
+ currentPosition: 0,
223
+ compound,
224
+ };
225
+ }
226
+ }
227
+ // Recursively process left side
228
+ extractWithChainTracking(unwrapped.left, chainInfo, false);
229
+ // Process right side if it's not JSX (JSX is the consequence, not the condition)
230
+ const rightUnwrapped = unwrapExpression(unwrapped.right);
231
+ const isJsxConsequence = ts.isJsxElement(rightUnwrapped) ||
232
+ ts.isJsxSelfClosingElement(rightUnwrapped) ||
233
+ ts.isJsxFragment(rightUnwrapped);
234
+ if (!isJsxConsequence) {
235
+ extractWithChainTracking(unwrapped.right, chainInfo, false);
236
+ }
237
+ // If this is the root of the chain, register the compound conditional
238
+ if (isChainRoot && chainInfo) {
239
+ context.addCompoundConditional(chainInfo.compound);
240
+ }
133
241
  return;
134
242
  }
135
- // Check if right is a variable and left is a literal
136
- if (rightPath && isLiteralExpression(unwrapped.left)) {
137
- const literalValue = getLiteralValue(unwrapped.left, context);
138
- context.addConditionalUsage({
139
- path: rightPath.toLeftHandSideString(),
140
- conditionType: 'comparison',
141
- comparedValues: literalValue !== undefined ? [literalValue] : undefined,
142
- location,
143
- });
243
+ // Handle binary expressions with || (logical OR)
244
+ // OR breaks the chain - each side is independent
245
+ if (ts.isBinaryExpression(unwrapped) &&
246
+ unwrapped.operatorToken.kind === ts.SyntaxKind.BarBarToken) {
247
+ // Both sides of || are independent conditional checks (no chain tracking)
248
+ extractWithChainTracking(unwrapped.left, null, false);
249
+ extractWithChainTracking(unwrapped.right, null, false);
144
250
  return;
145
251
  }
146
- // Both sides are variables - record both as comparisons without specific values
147
- if (leftPath) {
148
- context.addConditionalUsage({
149
- path: leftPath.toLeftHandSideString(),
150
- conditionType: 'comparison',
151
- location,
152
- });
252
+ // Handle comparison operators (===, !==, <, >, <=, >=)
253
+ // Example: `if (status === 'active')` - status is compared against 'active'
254
+ if (ts.isBinaryExpression(unwrapped) &&
255
+ isComparisonOperator(unwrapped.operatorToken.kind)) {
256
+ // Try to extract the variable and the compared value
257
+ const leftPath = StructuredPath.fromNode(unwrapped.left, context.sourceFile);
258
+ const rightPath = StructuredPath.fromNode(unwrapped.right, context.sourceFile);
259
+ // Determine the compared value for computing requiredValue
260
+ const getRequiredValue = (literalValue, isNegatedComparison) => {
261
+ if (literalValue === undefined)
262
+ return undefined;
263
+ // For !== comparisons, the condition is true when NOT equal to the value
264
+ // For === comparisons, the condition is true when equal to the value
265
+ const isNotEqual = unwrapped.operatorToken.kind ===
266
+ ts.SyntaxKind.ExclamationEqualsEqualsToken ||
267
+ unwrapped.operatorToken.kind === ts.SyntaxKind.ExclamationEqualsToken;
268
+ if (isNotEqual) {
269
+ // !== 'value' means requiredValue is NOT 'value', but we express this as "not 'value'"
270
+ return `not ${literalValue}`;
271
+ }
272
+ return literalValue;
273
+ };
274
+ // Helper to add a condition
275
+ const addCondition = (path, conditionType, comparedValues, requiredValue) => {
276
+ const usage = {
277
+ path,
278
+ conditionType,
279
+ comparedValues,
280
+ location,
281
+ sourceLocation: getSourceLocation(unwrapped, context.sourceFile),
282
+ isNegated,
283
+ };
284
+ // Add chain info if part of a compound conditional
285
+ if (chainInfo) {
286
+ usage.chainId = chainInfo.chainId;
287
+ usage.chainPosition = chainInfo.currentPosition;
288
+ usage.chainLength = chainInfo.chainLength;
289
+ usage.chainExpression = chainInfo.chainExpression;
290
+ chainInfo.currentPosition++;
291
+ // Add to compound conditional conditions
292
+ chainInfo.compound.conditions.push({
293
+ path,
294
+ conditionType,
295
+ comparedValues,
296
+ isNegated,
297
+ requiredValue,
298
+ });
299
+ }
300
+ context.addConditionalUsage(usage);
301
+ };
302
+ // Check if left is a variable and right is a literal
303
+ if (leftPath && isLiteralExpression(unwrapped.right)) {
304
+ const literalValue = getLiteralValue(unwrapped.right, context);
305
+ addCondition(leftPath.toLeftHandSideString(), 'comparison', literalValue !== undefined ? [literalValue] : undefined, getRequiredValue(literalValue, isNegated));
306
+ return;
307
+ }
308
+ // Check if right is a variable and left is a literal
309
+ if (rightPath && isLiteralExpression(unwrapped.left)) {
310
+ const literalValue = getLiteralValue(unwrapped.left, context);
311
+ addCondition(rightPath.toLeftHandSideString(), 'comparison', literalValue !== undefined ? [literalValue] : undefined, getRequiredValue(literalValue, isNegated));
312
+ return;
313
+ }
314
+ // Both sides are variables - record both as comparisons without specific values
315
+ if (leftPath) {
316
+ addCondition(leftPath.toLeftHandSideString(), 'comparison');
317
+ }
318
+ if (rightPath) {
319
+ addCondition(rightPath.toLeftHandSideString(), 'comparison');
320
+ }
321
+ return;
322
+ }
323
+ // Handle prefix unary NOT expression: !variable
324
+ // Example: `if (!isVisible)` - isVisible is a truthiness check (negated)
325
+ if (ts.isPrefixUnaryExpression(unwrapped) &&
326
+ unwrapped.operator === ts.SyntaxKind.ExclamationToken) {
327
+ extractWithChainTracking(unwrapped.operand, chainInfo, !isNegated);
328
+ return;
153
329
  }
154
- if (rightPath) {
155
- context.addConditionalUsage({
156
- path: rightPath.toLeftHandSideString(),
157
- conditionType: 'comparison',
330
+ // Handle simple identifiers or property accesses (truthiness checks)
331
+ // Example: `if (x)` or `x && <JSX />` - x is checked for truthiness
332
+ const path = StructuredPath.fromNode(unwrapped, context.sourceFile);
333
+ if (path && !path.isLiteral()) {
334
+ const pathStr = path.toLeftHandSideString();
335
+ const usage = {
336
+ path: pathStr,
337
+ conditionType: 'truthiness',
158
338
  location,
159
- });
339
+ sourceLocation: getSourceLocation(unwrapped, context.sourceFile),
340
+ isNegated,
341
+ };
342
+ // Add chain info if part of a compound conditional
343
+ if (chainInfo) {
344
+ usage.chainId = chainInfo.chainId;
345
+ usage.chainPosition = chainInfo.currentPosition;
346
+ usage.chainLength = chainInfo.chainLength;
347
+ usage.chainExpression = chainInfo.chainExpression;
348
+ chainInfo.currentPosition++;
349
+ // Add to compound conditional conditions
350
+ // For truthiness, requiredValue is true if not negated, false if negated
351
+ chainInfo.compound.conditions.push({
352
+ path: pathStr,
353
+ conditionType: 'truthiness',
354
+ isNegated,
355
+ requiredValue: !isNegated,
356
+ });
357
+ }
358
+ context.addConditionalUsage(usage);
160
359
  }
161
- return;
162
- }
163
- // Handle prefix unary NOT expression: !variable
164
- // Example: `if (!isVisible)` - isVisible is a truthiness check
165
- if (ts.isPrefixUnaryExpression(unwrapped) &&
166
- unwrapped.operator === ts.SyntaxKind.ExclamationToken) {
167
- extractConditionalUsage(unwrapped.operand, context, location);
168
- return;
169
- }
170
- // Handle simple identifiers or property accesses (truthiness checks)
171
- // Example: `if (x)` or `x && <JSX />` - x is checked for truthiness
172
- const path = StructuredPath.fromNode(unwrapped, context.sourceFile);
173
- if (path && !path.isLiteral()) {
174
- context.addConditionalUsage({
175
- path: path.toLeftHandSideString(),
176
- conditionType: 'truthiness',
177
- location,
178
- });
179
360
  }
361
+ // Start extraction with no chain info
362
+ extractWithChainTracking(condition, null, false);
180
363
  }
181
364
  /**
182
365
  * Helper to check if an expression is a literal value
@@ -254,7 +437,15 @@ export function processExpression({ node, context, targetPath, typeHint, }) {
254
437
  unwrappedNode.operatorToken.kind === ts.SyntaxKind.AmpersandAmpersandToken) {
255
438
  markConditionVariablesAsNullable(unwrappedNode, context);
256
439
  // Extract conditional usages for key attribute detection
257
- extractConditionalUsage(unwrappedNode, context, 'logical-and');
440
+ // Only call from the OUTERMOST && expression to avoid duplicates
441
+ // Check if parent is also a && (meaning we're nested)
442
+ const parent = unwrappedNode.parent;
443
+ const parentIsAndChain = parent &&
444
+ ts.isBinaryExpression(parent) &&
445
+ parent.operatorToken.kind === ts.SyntaxKind.AmpersandAmpersandToken;
446
+ if (!parentIsAndChain) {
447
+ extractConditionalUsage(unwrappedNode, context, 'logical-and');
448
+ }
258
449
  }
259
450
  // If the node falls within an excluded child scope, stop processing it.
260
451
  if (context.isChildBoundary(node)) {
@@ -666,9 +857,10 @@ export function processExpression({ node, context, targetPath, typeHint, }) {
666
857
  context.markUnsupported(unwrappedNode.expression, `processExpression: Couldn't get path for called expression: ${ts.SyntaxKind[unwrappedNode.expression.kind]}`, false);
667
858
  return false;
668
859
  }
669
- // Construct empty arguments list just to get the call path
670
- // We'll process each argument with its parameter path as targetPath
671
- const callPath = StructuredPath.fromNode(unwrappedNode, context.sourceFile);
860
+ // Build call path using original source text for consistent schema paths.
861
+ // IMPORTANT: Never use cyScope names in call paths - they are internal identifiers
862
+ // that should not appear in schema paths or call signatures.
863
+ const callPath = buildCallPathFromSource(unwrappedNode, context);
672
864
  // 2. Process all arguments recursively WITH targetPath for proper equivalence
673
865
  for (let i = 0; i < unwrappedNode.arguments.length; i++) {
674
866
  const arg = unwrappedNode.arguments[i];
@@ -798,6 +990,12 @@ export function processExpression({ node, context, targetPath, typeHint, }) {
798
990
  }
799
991
  // Create a path for this property within the base
800
992
  const propPath = targetPath.withProperty(propName);
993
+ // Handle child boundaries (callback functions) in object properties
994
+ // This establishes equivalency between the property path and the child scope
995
+ // e.g., columns[0].renderCell → cyScope1()
996
+ if (context.isChildBoundary(property.initializer)) {
997
+ context.addChildBoundaryEquivalence(propPath, property.initializer);
998
+ }
801
999
  // Process the property value with propPath as targetPath
802
1000
  // This allows nested object literals to work correctly
803
1001
  processExpression({
@@ -1038,8 +1236,12 @@ export function processExpression({ node, context, targetPath, typeHint, }) {
1038
1236
  context,
1039
1237
  typeHint: 'boolean | unknown',
1040
1238
  }); //TODO: could we capture that this is evidence of a boolean type?
1041
- processExpression({ node: unwrappedNode.whenTrue, context });
1042
- processExpression({ node: unwrappedNode.whenFalse, context });
1239
+ // Process both branches WITH targetPath to establish equivalencies
1240
+ // This is critical for tracing nested properties through ternary assignments
1241
+ // e.g., const items = condition ? arr1 : arr2; items.map(i => i.prop)
1242
+ // We need items to be equivalent to both arr1 AND arr2 for proper tracing
1243
+ processExpression({ node: unwrappedNode.whenTrue, context, targetPath });
1244
+ processExpression({ node: unwrappedNode.whenFalse, context, targetPath });
1043
1245
  // Create a path for the whole expression
1044
1246
  const expressionSourcePath = nodeToSource(unwrappedNode, context.sourceFile);
1045
1247
  // Infer type based on branches
@@ -1054,10 +1256,22 @@ export function processExpression({ node, context, targetPath, typeHint, }) {
1054
1256
  }
1055
1257
  // Register type for the expression
1056
1258
  context.addType(expressionSourcePath, resultType);
1057
- // If targetPath is provided, establish equivalence and register type
1259
+ // If targetPath is provided, only register type (don't overwrite branch equivalencies)
1260
+ // The equivalencies to individual branches (set above) are more useful for tracing
1261
+ // than an equivalency to the entire ternary expression text
1058
1262
  if (targetPath) {
1059
- context.addEquivalence(targetPath, expressionSourcePath);
1060
- context.addType(targetPath, resultType);
1263
+ // NOTE: We intentionally do NOT add equivalence here.
1264
+ // The branch processing above already added equivalencies:
1265
+ // targetPath -> whenTrue branch
1266
+ // targetPath -> whenFalse branch
1267
+ // Adding an equivalence to expressionSourcePath would overwrite those
1268
+ // with a useless equivalence to the ternary text itself.
1269
+ //
1270
+ // Use updateSchemaType instead of addType because:
1271
+ // 1. Branch processing may have already set a type on targetPath
1272
+ // 2. addType has a guard that prevents overwriting specific types with 'unknown'
1273
+ // 3. updateSchemaType bypasses this guard, ensuring the ternary's computed type is used
1274
+ context.updateSchemaType(targetPath, resultType);
1061
1275
  }
1062
1276
  return true;
1063
1277
  }
@@ -1618,6 +1832,9 @@ function processJsxAttribute(attr, context, componentPath, targetPath) {
1618
1832
  if (ts.isJsxExpression(attr.initializer) && attr.initializer.expression) {
1619
1833
  const expression = attr.initializer.expression;
1620
1834
  if (context.isChildBoundary(expression)) {
1835
+ // Create equivalency between attribute path and child scope
1836
+ // e.g., Grid().signature[0].renderRow → cyScope1()
1837
+ context.addChildBoundaryEquivalence(attributePath, expression);
1621
1838
  return true;
1622
1839
  }
1623
1840
  // Process the expression with attributePath as targetPath