@codeyam/codeyam-cli 0.1.0-staging.1669d45 → 0.1.0-staging.27d5a59

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 (898) hide show
  1. package/analyzer-template/.build-info.json +8 -8
  2. package/analyzer-template/log.txt +3 -3
  3. package/analyzer-template/package.json +26 -26
  4. package/analyzer-template/packages/ai/index.ts +16 -2
  5. package/analyzer-template/packages/ai/package.json +3 -3
  6. package/analyzer-template/packages/ai/src/lib/analyzeScope.ts +110 -52
  7. package/analyzer-template/packages/ai/src/lib/astScopes/arrayDerivationDetector.ts +199 -0
  8. package/analyzer-template/packages/ai/src/lib/astScopes/astScopeAnalyzer.ts +132 -12
  9. package/analyzer-template/packages/ai/src/lib/astScopes/methodSemantics.ts +139 -23
  10. package/analyzer-template/packages/ai/src/lib/astScopes/patterns/forInStatementHandler.ts +10 -17
  11. package/analyzer-template/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.ts +6 -126
  12. package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +656 -28
  13. package/analyzer-template/packages/ai/src/lib/astScopes/sharedPatterns.ts +28 -0
  14. package/analyzer-template/packages/ai/src/lib/astScopes/types.ts +94 -7
  15. package/analyzer-template/packages/ai/src/lib/completionCall.ts +229 -64
  16. package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +1358 -254
  17. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.ts +5 -1
  18. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.ts +205 -0
  19. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.ts +10 -2
  20. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.ts +16 -3
  21. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.ts +6 -4
  22. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.ts +54 -3
  23. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.ts +124 -17
  24. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/coerceObjectsToPrimitivesBySchema.ts +70 -0
  25. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.ts +62 -0
  26. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.ts +140 -14
  27. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.ts +179 -0
  28. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.ts +40 -30
  29. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.ts +393 -97
  30. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fixNullIdsBySchema.ts +129 -0
  31. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.ts +35 -0
  32. package/analyzer-template/packages/ai/src/lib/dataStructureChunking.ts +183 -0
  33. package/analyzer-template/packages/ai/src/lib/e2eDataTracking.ts +334 -0
  34. package/analyzer-template/packages/ai/src/lib/extractCriticalDataKeys.ts +120 -0
  35. package/analyzer-template/packages/ai/src/lib/generateEntityDataStructure.ts +58 -3
  36. package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +1012 -7
  37. package/analyzer-template/packages/ai/src/lib/generateEntityScenarios.ts +35 -6
  38. package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +515 -6
  39. package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.ts +1 -1
  40. package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionals.ts +1540 -75
  41. package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.ts +239 -0
  42. package/analyzer-template/packages/ai/src/lib/isolateScopes.ts +51 -3
  43. package/analyzer-template/packages/ai/src/lib/mergeJsonTypeDefinitions.ts +5 -0
  44. package/analyzer-template/packages/ai/src/lib/mergeStatements.ts +90 -96
  45. package/analyzer-template/packages/ai/src/lib/promptGenerators/collapseNullableObjects.ts +118 -0
  46. package/analyzer-template/packages/ai/src/lib/promptGenerators/gatherAttributesMap.ts +10 -7
  47. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChunkPrompt.ts +82 -0
  48. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateCriticalKeysPrompt.ts +103 -0
  49. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.ts +44 -7
  50. package/analyzer-template/packages/ai/src/lib/promptGenerators/simplifyKeysForLLM.ts +391 -0
  51. package/analyzer-template/packages/ai/src/lib/resolvePathToControllable.ts +179 -45
  52. package/analyzer-template/packages/ai/src/lib/worker/SerializableDataStructure.ts +26 -4
  53. package/analyzer-template/packages/ai/src/lib/worker/analyzeScopeWorker.ts +114 -2
  54. package/analyzer-template/packages/analyze/index.ts +2 -0
  55. package/analyzer-template/packages/analyze/src/lib/FileAnalyzer.ts +65 -59
  56. package/analyzer-template/packages/analyze/src/lib/ProjectAnalyzer.ts +132 -33
  57. package/analyzer-template/packages/analyze/src/lib/analysisContext.ts +44 -4
  58. package/analyzer-template/packages/analyze/src/lib/asts/index.ts +7 -2
  59. package/analyzer-template/packages/analyze/src/lib/asts/nodes/getNodeType.ts +1 -0
  60. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.ts +19 -0
  61. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllEntityNodes.ts +19 -0
  62. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllExports.ts +11 -0
  63. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getImportsAnalysis.ts +8 -0
  64. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getResolvedModule.ts +49 -1
  65. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getSourceFilesForAllImports.ts +2 -1
  66. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +99 -22
  67. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +27 -4
  68. package/analyzer-template/packages/analyze/src/lib/files/analyze/findOrCreateEntity.ts +12 -0
  69. package/analyzer-template/packages/analyze/src/lib/files/analyze/gatherEntityMap.ts +4 -2
  70. package/analyzer-template/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.ts +33 -10
  71. package/analyzer-template/packages/analyze/src/lib/files/analyzeRemixRoute.ts +4 -5
  72. package/analyzer-template/packages/analyze/src/lib/files/getImportedExports.ts +14 -12
  73. package/analyzer-template/packages/analyze/src/lib/files/scenarios/TransformationTracer.ts +1352 -0
  74. package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.ts +193 -76
  75. package/analyzer-template/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.ts +87 -25
  76. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +352 -22
  77. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.ts +118 -10
  78. package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +667 -74
  79. package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.ts +56 -11
  80. package/analyzer-template/packages/analyze/src/lib/files/scenarios/propagateArrayItemSchemas.ts +474 -0
  81. package/analyzer-template/packages/analyze/src/lib/files/setImportedExports.ts +2 -1
  82. package/analyzer-template/packages/analyze/src/lib/index.ts +1 -0
  83. package/analyzer-template/packages/analyze/src/lib/utils/getFileByPath.ts +19 -0
  84. package/analyzer-template/packages/aws/package.json +10 -10
  85. package/analyzer-template/packages/database/index.ts +1 -0
  86. package/analyzer-template/packages/database/package.json +4 -4
  87. package/analyzer-template/packages/database/src/lib/analysisBranchToDb.ts +1 -1
  88. package/analyzer-template/packages/database/src/lib/analysisToDb.ts +1 -1
  89. package/analyzer-template/packages/database/src/lib/branchToDb.ts +1 -1
  90. package/analyzer-template/packages/database/src/lib/commitBranchToDb.ts +1 -1
  91. package/analyzer-template/packages/database/src/lib/commitToDb.ts +1 -1
  92. package/analyzer-template/packages/database/src/lib/fileToDb.ts +1 -1
  93. package/analyzer-template/packages/database/src/lib/kysely/db.ts +22 -1
  94. package/analyzer-template/packages/database/src/lib/kysely/tables/commitsTable.ts +6 -0
  95. package/analyzer-template/packages/database/src/lib/kysely/tables/debugReportsTable.ts +1 -1
  96. package/analyzer-template/packages/database/src/lib/kysely/tables/editorScenariosTable.ts +62 -0
  97. package/analyzer-template/packages/database/src/lib/kysely/tables/labsRequestsTable.ts +52 -0
  98. package/analyzer-template/packages/database/src/lib/loadAnalyses.ts +58 -1
  99. package/analyzer-template/packages/database/src/lib/loadAnalysis.ts +13 -0
  100. package/analyzer-template/packages/database/src/lib/loadBranch.ts +16 -1
  101. package/analyzer-template/packages/database/src/lib/loadCommit.ts +11 -0
  102. package/analyzer-template/packages/database/src/lib/loadCommits.ts +58 -19
  103. package/analyzer-template/packages/database/src/lib/loadEntities.ts +26 -3
  104. package/analyzer-template/packages/database/src/lib/loadEntityBranches.ts +12 -0
  105. package/analyzer-template/packages/database/src/lib/loadReadyToBeCapturedAnalyses.ts +0 -5
  106. package/analyzer-template/packages/database/src/lib/projectToDb.ts +1 -1
  107. package/analyzer-template/packages/database/src/lib/saveFiles.ts +1 -1
  108. package/analyzer-template/packages/database/src/lib/scenarioToDb.ts +1 -1
  109. package/analyzer-template/packages/database/src/lib/updateCommitMetadata.ts +153 -144
  110. package/analyzer-template/packages/database/src/lib/updateFreshAnalysisStatus.ts +58 -42
  111. package/analyzer-template/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.ts +81 -65
  112. package/analyzer-template/packages/database/src/lib/userScenarioToDb.ts +1 -1
  113. package/analyzer-template/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.ts +29 -1
  114. package/analyzer-template/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.ts +33 -5
  115. package/analyzer-template/packages/github/dist/database/index.d.ts +1 -0
  116. package/analyzer-template/packages/github/dist/database/index.d.ts.map +1 -1
  117. package/analyzer-template/packages/github/dist/database/index.js +1 -0
  118. package/analyzer-template/packages/github/dist/database/index.js.map +1 -1
  119. package/analyzer-template/packages/github/dist/database/src/lib/analysisBranchToDb.js +1 -1
  120. package/analyzer-template/packages/github/dist/database/src/lib/analysisBranchToDb.js.map +1 -1
  121. package/analyzer-template/packages/github/dist/database/src/lib/analysisToDb.js +1 -1
  122. package/analyzer-template/packages/github/dist/database/src/lib/analysisToDb.js.map +1 -1
  123. package/analyzer-template/packages/github/dist/database/src/lib/branchToDb.js +1 -1
  124. package/analyzer-template/packages/github/dist/database/src/lib/branchToDb.js.map +1 -1
  125. package/analyzer-template/packages/github/dist/database/src/lib/commitBranchToDb.js +1 -1
  126. package/analyzer-template/packages/github/dist/database/src/lib/commitBranchToDb.js.map +1 -1
  127. package/analyzer-template/packages/github/dist/database/src/lib/commitToDb.js +1 -1
  128. package/analyzer-template/packages/github/dist/database/src/lib/commitToDb.js.map +1 -1
  129. package/analyzer-template/packages/github/dist/database/src/lib/fileToDb.js +1 -1
  130. package/analyzer-template/packages/github/dist/database/src/lib/fileToDb.js.map +1 -1
  131. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts +4 -0
  132. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts.map +1 -1
  133. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js +16 -1
  134. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js.map +1 -1
  135. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/analysesTable.d.ts.map +1 -1
  136. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.d.ts +1 -0
  137. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.d.ts.map +1 -1
  138. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.js +3 -0
  139. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.js.map +1 -1
  140. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.d.ts +1 -1
  141. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts +20 -0
  142. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts.map +1 -0
  143. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js +45 -0
  144. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -0
  145. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.d.ts +23 -0
  146. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.d.ts.map +1 -0
  147. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.js +35 -0
  148. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.js.map +1 -0
  149. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts +5 -0
  150. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts.map +1 -1
  151. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalyses.d.ts +2 -0
  152. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalyses.d.ts.map +1 -1
  153. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalyses.js +45 -2
  154. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalyses.js.map +1 -1
  155. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.d.ts.map +1 -1
  156. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.js +8 -0
  157. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.js.map +1 -1
  158. package/analyzer-template/packages/github/dist/database/src/lib/loadBranch.js +11 -1
  159. package/analyzer-template/packages/github/dist/database/src/lib/loadBranch.js.map +1 -1
  160. package/analyzer-template/packages/github/dist/database/src/lib/loadCommit.d.ts.map +1 -1
  161. package/analyzer-template/packages/github/dist/database/src/lib/loadCommit.js +7 -0
  162. package/analyzer-template/packages/github/dist/database/src/lib/loadCommit.js.map +1 -1
  163. package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.d.ts +3 -1
  164. package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.d.ts.map +1 -1
  165. package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js +45 -14
  166. package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js.map +1 -1
  167. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.d.ts +3 -1
  168. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.d.ts.map +1 -1
  169. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js +23 -4
  170. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js.map +1 -1
  171. package/analyzer-template/packages/github/dist/database/src/lib/loadEntityBranches.d.ts.map +1 -1
  172. package/analyzer-template/packages/github/dist/database/src/lib/loadEntityBranches.js +9 -0
  173. package/analyzer-template/packages/github/dist/database/src/lib/loadEntityBranches.js.map +1 -1
  174. package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.d.ts.map +1 -1
  175. package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js +1 -4
  176. package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js.map +1 -1
  177. package/analyzer-template/packages/github/dist/database/src/lib/projectToDb.js +1 -1
  178. package/analyzer-template/packages/github/dist/database/src/lib/projectToDb.js.map +1 -1
  179. package/analyzer-template/packages/github/dist/database/src/lib/saveFiles.js +1 -1
  180. package/analyzer-template/packages/github/dist/database/src/lib/saveFiles.js.map +1 -1
  181. package/analyzer-template/packages/github/dist/database/src/lib/scenarioToDb.js +1 -1
  182. package/analyzer-template/packages/github/dist/database/src/lib/scenarioToDb.js.map +1 -1
  183. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.d.ts +2 -2
  184. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.d.ts.map +1 -1
  185. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js +100 -88
  186. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js.map +1 -1
  187. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.d.ts.map +1 -1
  188. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.js +41 -30
  189. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.js.map +1 -1
  190. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.d.ts.map +1 -1
  191. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.js +68 -57
  192. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.js.map +1 -1
  193. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.d.ts.map +1 -1
  194. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +29 -1
  195. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -1
  196. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.d.ts.map +1 -1
  197. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +33 -5
  198. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
  199. package/analyzer-template/packages/github/dist/types/index.d.ts +1 -1
  200. package/analyzer-template/packages/github/dist/types/index.d.ts.map +1 -1
  201. package/analyzer-template/packages/github/dist/types/index.js.map +1 -1
  202. package/analyzer-template/packages/github/dist/types/src/types/Analysis.d.ts +25 -1
  203. package/analyzer-template/packages/github/dist/types/src/types/Analysis.d.ts.map +1 -1
  204. package/analyzer-template/packages/github/dist/types/src/types/Commit.d.ts +2 -0
  205. package/analyzer-template/packages/github/dist/types/src/types/Commit.d.ts.map +1 -1
  206. package/analyzer-template/packages/github/dist/types/src/types/ProjectMetadata.d.ts +8 -0
  207. package/analyzer-template/packages/github/dist/types/src/types/ProjectMetadata.d.ts.map +1 -1
  208. package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts +10 -0
  209. package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts.map +1 -1
  210. package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts +56 -6
  211. package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
  212. package/analyzer-template/packages/github/dist/types/src/types/ScopeAnalysis.d.ts +6 -1
  213. package/analyzer-template/packages/github/dist/types/src/types/ScopeAnalysis.d.ts.map +1 -1
  214. package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.d.ts +9 -1
  215. package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.d.ts.map +1 -1
  216. package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.js +29 -3
  217. package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.js.map +1 -1
  218. package/analyzer-template/packages/github/package.json +2 -2
  219. package/analyzer-template/packages/types/index.ts +1 -0
  220. package/analyzer-template/packages/types/src/types/Analysis.ts +25 -0
  221. package/analyzer-template/packages/types/src/types/Commit.ts +2 -0
  222. package/analyzer-template/packages/types/src/types/ProjectMetadata.ts +8 -0
  223. package/analyzer-template/packages/types/src/types/Scenario.ts +10 -0
  224. package/analyzer-template/packages/types/src/types/ScenariosDataStructure.ts +70 -6
  225. package/analyzer-template/packages/types/src/types/ScopeAnalysis.ts +6 -1
  226. package/analyzer-template/packages/utils/dist/types/index.d.ts +1 -1
  227. package/analyzer-template/packages/utils/dist/types/index.d.ts.map +1 -1
  228. package/analyzer-template/packages/utils/dist/types/index.js.map +1 -1
  229. package/analyzer-template/packages/utils/dist/types/src/types/Analysis.d.ts +25 -1
  230. package/analyzer-template/packages/utils/dist/types/src/types/Analysis.d.ts.map +1 -1
  231. package/analyzer-template/packages/utils/dist/types/src/types/Commit.d.ts +2 -0
  232. package/analyzer-template/packages/utils/dist/types/src/types/Commit.d.ts.map +1 -1
  233. package/analyzer-template/packages/utils/dist/types/src/types/ProjectMetadata.d.ts +8 -0
  234. package/analyzer-template/packages/utils/dist/types/src/types/ProjectMetadata.d.ts.map +1 -1
  235. package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts +10 -0
  236. package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts.map +1 -1
  237. package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts +56 -6
  238. package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
  239. package/analyzer-template/packages/utils/dist/types/src/types/ScopeAnalysis.d.ts +6 -1
  240. package/analyzer-template/packages/utils/dist/types/src/types/ScopeAnalysis.d.ts.map +1 -1
  241. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.d.ts.map +1 -1
  242. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js +98 -3
  243. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js.map +1 -1
  244. package/analyzer-template/packages/utils/dist/utils/src/lib/safeFileName.d.ts +9 -1
  245. package/analyzer-template/packages/utils/dist/utils/src/lib/safeFileName.d.ts.map +1 -1
  246. package/analyzer-template/packages/utils/dist/utils/src/lib/safeFileName.js +29 -3
  247. package/analyzer-template/packages/utils/dist/utils/src/lib/safeFileName.js.map +1 -1
  248. package/analyzer-template/packages/utils/src/lib/fs/rsyncCopy.ts +121 -3
  249. package/analyzer-template/packages/utils/src/lib/safeFileName.ts +48 -3
  250. package/analyzer-template/playwright/capture.ts +20 -8
  251. package/analyzer-template/playwright/captureFromUrl.ts +89 -82
  252. package/analyzer-template/playwright/captureStatic.ts +1 -1
  253. package/analyzer-template/project/analyzeBaselineCommit.ts +5 -0
  254. package/analyzer-template/project/analyzeRegularCommit.ts +5 -0
  255. package/analyzer-template/project/captureLibraryFunctionDirect.ts +29 -26
  256. package/analyzer-template/project/constructMockCode.ts +572 -87
  257. package/analyzer-template/project/createEntitiesAndSortFiles.ts +83 -0
  258. package/analyzer-template/project/loadReadyToBeCaptured.ts +65 -41
  259. package/analyzer-template/project/orchestrateCapture/AwsCaptureTaskRunner.ts +12 -4
  260. package/analyzer-template/project/orchestrateCapture/SequentialCaptureTaskRunner.ts +18 -7
  261. package/analyzer-template/project/orchestrateCapture/taskRunner.ts +4 -2
  262. package/analyzer-template/project/orchestrateCapture.ts +75 -7
  263. package/analyzer-template/project/reconcileMockDataKeys.ts +158 -10
  264. package/analyzer-template/project/runAnalysis.ts +4 -0
  265. package/analyzer-template/project/start.ts +38 -11
  266. package/analyzer-template/project/startScenarioCapture.ts +9 -0
  267. package/analyzer-template/project/writeClientLogRoute.ts +125 -0
  268. package/analyzer-template/project/writeMockDataTsx.ts +312 -10
  269. package/analyzer-template/project/writeScenarioComponents.ts +271 -37
  270. package/analyzer-template/project/writeSimpleRoot.ts +21 -11
  271. package/analyzer-template/scripts/comboWorkerLoop.cjs +98 -50
  272. package/analyzer-template/tsconfig.json +13 -1
  273. package/background/src/lib/local/createLocalAnalyzer.js +1 -1
  274. package/background/src/lib/local/createLocalAnalyzer.js.map +1 -1
  275. package/background/src/lib/virtualized/project/analyzeBaselineCommit.js +5 -0
  276. package/background/src/lib/virtualized/project/analyzeBaselineCommit.js.map +1 -1
  277. package/background/src/lib/virtualized/project/analyzeRegularCommit.js +5 -0
  278. package/background/src/lib/virtualized/project/analyzeRegularCommit.js.map +1 -1
  279. package/background/src/lib/virtualized/project/captureLibraryFunctionDirect.js +3 -3
  280. package/background/src/lib/virtualized/project/captureLibraryFunctionDirect.js.map +1 -1
  281. package/background/src/lib/virtualized/project/constructMockCode.js +474 -48
  282. package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
  283. package/background/src/lib/virtualized/project/createEntitiesAndSortFiles.js +73 -1
  284. package/background/src/lib/virtualized/project/createEntitiesAndSortFiles.js.map +1 -1
  285. package/background/src/lib/virtualized/project/loadReadyToBeCaptured.js +19 -8
  286. package/background/src/lib/virtualized/project/loadReadyToBeCaptured.js.map +1 -1
  287. package/background/src/lib/virtualized/project/orchestrateCapture/AwsCaptureTaskRunner.js +2 -2
  288. package/background/src/lib/virtualized/project/orchestrateCapture/AwsCaptureTaskRunner.js.map +1 -1
  289. package/background/src/lib/virtualized/project/orchestrateCapture/SequentialCaptureTaskRunner.js +7 -5
  290. package/background/src/lib/virtualized/project/orchestrateCapture/SequentialCaptureTaskRunner.js.map +1 -1
  291. package/background/src/lib/virtualized/project/orchestrateCapture.js +62 -7
  292. package/background/src/lib/virtualized/project/orchestrateCapture.js.map +1 -1
  293. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js +133 -10
  294. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js.map +1 -1
  295. package/background/src/lib/virtualized/project/runAnalysis.js +3 -0
  296. package/background/src/lib/virtualized/project/runAnalysis.js.map +1 -1
  297. package/background/src/lib/virtualized/project/start.js +34 -11
  298. package/background/src/lib/virtualized/project/start.js.map +1 -1
  299. package/background/src/lib/virtualized/project/startScenarioCapture.js +5 -0
  300. package/background/src/lib/virtualized/project/startScenarioCapture.js.map +1 -1
  301. package/background/src/lib/virtualized/project/writeClientLogRoute.js +110 -0
  302. package/background/src/lib/virtualized/project/writeClientLogRoute.js.map +1 -0
  303. package/background/src/lib/virtualized/project/writeMockDataTsx.js +263 -6
  304. package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
  305. package/background/src/lib/virtualized/project/writeScenarioComponents.js +200 -35
  306. package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
  307. package/background/src/lib/virtualized/project/writeSimpleRoot.js +21 -11
  308. package/background/src/lib/virtualized/project/writeSimpleRoot.js.map +1 -1
  309. package/codeyam-cli/scripts/apply-setup.js +386 -9
  310. package/codeyam-cli/scripts/apply-setup.js.map +1 -1
  311. package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js +196 -0
  312. package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js.map +1 -0
  313. package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js +114 -0
  314. package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js.map +1 -0
  315. package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js +149 -0
  316. package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js.map +1 -0
  317. package/codeyam-cli/src/cli.js +35 -24
  318. package/codeyam-cli/src/cli.js.map +1 -1
  319. package/codeyam-cli/src/codeyam-cli.js +18 -2
  320. package/codeyam-cli/src/codeyam-cli.js.map +1 -1
  321. package/codeyam-cli/src/commands/analyze.js +21 -9
  322. package/codeyam-cli/src/commands/analyze.js.map +1 -1
  323. package/codeyam-cli/src/commands/baseline.js +2 -0
  324. package/codeyam-cli/src/commands/baseline.js.map +1 -1
  325. package/codeyam-cli/src/commands/debug.js +9 -5
  326. package/codeyam-cli/src/commands/debug.js.map +1 -1
  327. package/codeyam-cli/src/commands/default.js +37 -21
  328. package/codeyam-cli/src/commands/default.js.map +1 -1
  329. package/codeyam-cli/src/commands/editor.js +1982 -0
  330. package/codeyam-cli/src/commands/editor.js.map +1 -0
  331. package/codeyam-cli/src/commands/init.js +81 -260
  332. package/codeyam-cli/src/commands/init.js.map +1 -1
  333. package/codeyam-cli/src/commands/memory.js +278 -0
  334. package/codeyam-cli/src/commands/memory.js.map +1 -0
  335. package/codeyam-cli/src/commands/recapture.js +2 -0
  336. package/codeyam-cli/src/commands/recapture.js.map +1 -1
  337. package/codeyam-cli/src/commands/setup-sandbox.js +2 -0
  338. package/codeyam-cli/src/commands/setup-sandbox.js.map +1 -1
  339. package/codeyam-cli/src/commands/setup-simulations.js +284 -0
  340. package/codeyam-cli/src/commands/setup-simulations.js.map +1 -0
  341. package/codeyam-cli/src/commands/test-startup.js +2 -0
  342. package/codeyam-cli/src/commands/test-startup.js.map +1 -1
  343. package/codeyam-cli/src/commands/verify.js +14 -2
  344. package/codeyam-cli/src/commands/verify.js.map +1 -1
  345. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +246 -0
  346. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -0
  347. package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js +126 -0
  348. package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js.map +1 -0
  349. package/codeyam-cli/src/utils/__tests__/editorJournal.test.js +295 -0
  350. package/codeyam-cli/src/utils/__tests__/editorJournal.test.js.map +1 -0
  351. package/codeyam-cli/src/utils/__tests__/editorMockState.test.js +270 -0
  352. package/codeyam-cli/src/utils/__tests__/editorMockState.test.js.map +1 -0
  353. package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js +100 -0
  354. package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js.map +1 -0
  355. package/codeyam-cli/src/utils/__tests__/editorPreview.test.js +147 -0
  356. package/codeyam-cli/src/utils/__tests__/editorPreview.test.js.map +1 -0
  357. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js +76 -0
  358. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js.map +1 -0
  359. package/codeyam-cli/src/utils/__tests__/git.editor.test.js +134 -0
  360. package/codeyam-cli/src/utils/__tests__/git.editor.test.js.map +1 -0
  361. package/codeyam-cli/src/utils/__tests__/npmVersionCheck.test.js +185 -0
  362. package/codeyam-cli/src/utils/__tests__/npmVersionCheck.test.js.map +1 -0
  363. package/codeyam-cli/src/utils/__tests__/pathIgnoring.test.js +9 -0
  364. package/codeyam-cli/src/utils/__tests__/pathIgnoring.test.js.map +1 -1
  365. package/codeyam-cli/src/utils/__tests__/project.test.js +65 -0
  366. package/codeyam-cli/src/utils/__tests__/project.test.js.map +1 -0
  367. package/codeyam-cli/src/utils/__tests__/scenarioMarkers.test.js +121 -0
  368. package/codeyam-cli/src/utils/__tests__/scenarioMarkers.test.js.map +1 -0
  369. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +154 -82
  370. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
  371. package/codeyam-cli/src/utils/analysisRunner.js +21 -2
  372. package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
  373. package/codeyam-cli/src/utils/analyzer.js +7 -0
  374. package/codeyam-cli/src/utils/analyzer.js.map +1 -1
  375. package/codeyam-cli/src/utils/backgroundServer.js +109 -22
  376. package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
  377. package/codeyam-cli/src/utils/buildFlags.js +4 -0
  378. package/codeyam-cli/src/utils/buildFlags.js.map +1 -0
  379. package/codeyam-cli/src/utils/devModeEvents.js +40 -0
  380. package/codeyam-cli/src/utils/devModeEvents.js.map +1 -0
  381. package/codeyam-cli/src/utils/editorAudit.js +82 -0
  382. package/codeyam-cli/src/utils/editorAudit.js.map +1 -0
  383. package/codeyam-cli/src/utils/editorDevServer.js +98 -0
  384. package/codeyam-cli/src/utils/editorDevServer.js.map +1 -0
  385. package/codeyam-cli/src/utils/editorJournal.js +137 -0
  386. package/codeyam-cli/src/utils/editorJournal.js.map +1 -0
  387. package/codeyam-cli/src/utils/editorMockState.js +248 -0
  388. package/codeyam-cli/src/utils/editorMockState.js.map +1 -0
  389. package/codeyam-cli/src/utils/editorPreloadHelpers.js +64 -0
  390. package/codeyam-cli/src/utils/editorPreloadHelpers.js.map +1 -0
  391. package/codeyam-cli/src/utils/editorPreview.js +66 -0
  392. package/codeyam-cli/src/utils/editorPreview.js.map +1 -0
  393. package/codeyam-cli/src/utils/editorScenarios.js +56 -0
  394. package/codeyam-cli/src/utils/editorScenarios.js.map +1 -0
  395. package/codeyam-cli/src/utils/fileMetadata.js +5 -0
  396. package/codeyam-cli/src/utils/fileMetadata.js.map +1 -1
  397. package/codeyam-cli/src/utils/fileWatcher.js +25 -9
  398. package/codeyam-cli/src/utils/fileWatcher.js.map +1 -1
  399. package/codeyam-cli/src/utils/generateReport.js +2 -2
  400. package/codeyam-cli/src/utils/git.js +103 -0
  401. package/codeyam-cli/src/utils/git.js.map +1 -1
  402. package/codeyam-cli/src/utils/install-skills.js +120 -39
  403. package/codeyam-cli/src/utils/install-skills.js.map +1 -1
  404. package/codeyam-cli/src/utils/interactiveSyncWatcher.js +126 -0
  405. package/codeyam-cli/src/utils/interactiveSyncWatcher.js.map +1 -0
  406. package/codeyam-cli/src/utils/labsAutoCheck.js +19 -0
  407. package/codeyam-cli/src/utils/labsAutoCheck.js.map +1 -0
  408. package/codeyam-cli/src/utils/npmVersionCheck.js +76 -0
  409. package/codeyam-cli/src/utils/npmVersionCheck.js.map +1 -0
  410. package/codeyam-cli/src/utils/pathIgnoring.js +19 -7
  411. package/codeyam-cli/src/utils/pathIgnoring.js.map +1 -1
  412. package/codeyam-cli/src/utils/progress.js +7 -0
  413. package/codeyam-cli/src/utils/progress.js.map +1 -1
  414. package/codeyam-cli/src/utils/project.js +15 -5
  415. package/codeyam-cli/src/utils/project.js.map +1 -1
  416. package/codeyam-cli/src/utils/queue/__tests__/heartbeat.test.js +11 -11
  417. package/codeyam-cli/src/utils/queue/__tests__/heartbeat.test.js.map +1 -1
  418. package/codeyam-cli/src/utils/queue/__tests__/manager.test.js +22 -0
  419. package/codeyam-cli/src/utils/queue/__tests__/manager.test.js.map +1 -1
  420. package/codeyam-cli/src/utils/queue/heartbeat.js +13 -5
  421. package/codeyam-cli/src/utils/queue/heartbeat.js.map +1 -1
  422. package/codeyam-cli/src/utils/queue/job.js +75 -1
  423. package/codeyam-cli/src/utils/queue/job.js.map +1 -1
  424. package/codeyam-cli/src/utils/queue/manager.js +7 -0
  425. package/codeyam-cli/src/utils/queue/manager.js.map +1 -1
  426. package/codeyam-cli/src/utils/requireSimulations.js +10 -0
  427. package/codeyam-cli/src/utils/requireSimulations.js.map +1 -0
  428. package/codeyam-cli/src/utils/ruleReflection/__tests__/confusionDetector.test.js +82 -0
  429. package/codeyam-cli/src/utils/ruleReflection/__tests__/confusionDetector.test.js.map +1 -0
  430. package/codeyam-cli/src/utils/ruleReflection/__tests__/contextBuilder.test.js +229 -0
  431. package/codeyam-cli/src/utils/ruleReflection/__tests__/contextBuilder.test.js.map +1 -0
  432. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/assertRules.js +67 -0
  433. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/assertRules.js.map +1 -0
  434. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/captureFixture.js +105 -0
  435. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/captureFixture.js.map +1 -0
  436. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/loadCapturedFixture.js +34 -0
  437. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/loadCapturedFixture.js.map +1 -0
  438. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/runClaude.js +162 -0
  439. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/runClaude.js.map +1 -0
  440. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/setupTempProject.js +74 -0
  441. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/setupTempProject.js.map +1 -0
  442. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/ruleReflectionE2E.test.js +376 -0
  443. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/ruleReflectionE2E.test.js.map +1 -0
  444. package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.js +113 -0
  445. package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.js.map +1 -0
  446. package/codeyam-cli/src/utils/ruleReflection/__tests__/transcriptParser.test.js +127 -0
  447. package/codeyam-cli/src/utils/ruleReflection/__tests__/transcriptParser.test.js.map +1 -0
  448. package/codeyam-cli/src/utils/ruleReflection/confusionDetector.js +50 -0
  449. package/codeyam-cli/src/utils/ruleReflection/confusionDetector.js.map +1 -0
  450. package/codeyam-cli/src/utils/ruleReflection/contextBuilder.js +116 -0
  451. package/codeyam-cli/src/utils/ruleReflection/contextBuilder.js.map +1 -0
  452. package/codeyam-cli/src/utils/ruleReflection/index.js +5 -0
  453. package/codeyam-cli/src/utils/ruleReflection/index.js.map +1 -0
  454. package/codeyam-cli/src/utils/ruleReflection/promptBuilder.js +44 -0
  455. package/codeyam-cli/src/utils/ruleReflection/promptBuilder.js.map +1 -0
  456. package/codeyam-cli/src/utils/ruleReflection/transcriptParser.js +85 -0
  457. package/codeyam-cli/src/utils/ruleReflection/transcriptParser.js.map +1 -0
  458. package/codeyam-cli/src/utils/ruleReflection/types.js +5 -0
  459. package/codeyam-cli/src/utils/ruleReflection/types.js.map +1 -0
  460. package/codeyam-cli/src/utils/rules/__tests__/parser.test.js +83 -0
  461. package/codeyam-cli/src/utils/rules/__tests__/parser.test.js.map +1 -0
  462. package/codeyam-cli/src/utils/rules/__tests__/pathMatcher.test.js +118 -0
  463. package/codeyam-cli/src/utils/rules/__tests__/pathMatcher.test.js.map +1 -0
  464. package/codeyam-cli/src/utils/rules/__tests__/rulePlacement.test.js +72 -0
  465. package/codeyam-cli/src/utils/rules/__tests__/rulePlacement.test.js.map +1 -0
  466. package/codeyam-cli/src/utils/rules/__tests__/ruleState.test.js +293 -0
  467. package/codeyam-cli/src/utils/rules/__tests__/ruleState.test.js.map +1 -0
  468. package/codeyam-cli/src/utils/rules/__tests__/sourceFiles.test.js +76 -0
  469. package/codeyam-cli/src/utils/rules/__tests__/sourceFiles.test.js.map +1 -0
  470. package/codeyam-cli/src/utils/rules/index.js +7 -0
  471. package/codeyam-cli/src/utils/rules/index.js.map +1 -0
  472. package/codeyam-cli/src/utils/rules/parser.js +93 -0
  473. package/codeyam-cli/src/utils/rules/parser.js.map +1 -0
  474. package/codeyam-cli/src/utils/rules/pathMatcher.js +49 -0
  475. package/codeyam-cli/src/utils/rules/pathMatcher.js.map +1 -0
  476. package/codeyam-cli/src/utils/rules/rulePlacement.js +65 -0
  477. package/codeyam-cli/src/utils/rules/rulePlacement.js.map +1 -0
  478. package/codeyam-cli/src/utils/rules/ruleState.js +150 -0
  479. package/codeyam-cli/src/utils/rules/ruleState.js.map +1 -0
  480. package/codeyam-cli/src/utils/rules/sourceFiles.js +43 -0
  481. package/codeyam-cli/src/utils/rules/sourceFiles.js.map +1 -0
  482. package/codeyam-cli/src/utils/rules/staleness.js +137 -0
  483. package/codeyam-cli/src/utils/rules/staleness.js.map +1 -0
  484. package/codeyam-cli/src/utils/scenarioMarkers.js +134 -0
  485. package/codeyam-cli/src/utils/scenarioMarkers.js.map +1 -0
  486. package/codeyam-cli/src/utils/serverState.js +64 -12
  487. package/codeyam-cli/src/utils/serverState.js.map +1 -1
  488. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +61 -41
  489. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
  490. package/codeyam-cli/src/utils/simulationGateMiddleware.js +159 -0
  491. package/codeyam-cli/src/utils/simulationGateMiddleware.js.map +1 -0
  492. package/codeyam-cli/src/utils/syncMocksMiddleware.js +5 -24
  493. package/codeyam-cli/src/utils/syncMocksMiddleware.js.map +1 -1
  494. package/codeyam-cli/src/utils/testRunner.js +158 -0
  495. package/codeyam-cli/src/utils/testRunner.js.map +1 -0
  496. package/codeyam-cli/src/utils/transcriptPruning.js +67 -0
  497. package/codeyam-cli/src/utils/transcriptPruning.js.map +1 -0
  498. package/codeyam-cli/src/utils/versionInfo.js +46 -0
  499. package/codeyam-cli/src/utils/versionInfo.js.map +1 -1
  500. package/codeyam-cli/src/utils/webappDetection.js +14 -2
  501. package/codeyam-cli/src/utils/webappDetection.js.map +1 -1
  502. package/codeyam-cli/src/webserver/__tests__/dependency-smoke.test.js +66 -0
  503. package/codeyam-cli/src/webserver/__tests__/dependency-smoke.test.js.map +1 -0
  504. package/codeyam-cli/src/webserver/app/lib/database.js +63 -33
  505. package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
  506. package/codeyam-cli/src/webserver/app/lib/dbNotifier.js.map +1 -1
  507. package/codeyam-cli/src/webserver/backgroundServer.js +166 -16
  508. package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
  509. package/codeyam-cli/src/webserver/bootstrap.js +51 -0
  510. package/codeyam-cli/src/webserver/bootstrap.js.map +1 -1
  511. package/codeyam-cli/src/webserver/build/client/assets/CopyButton-DmJveP3T.js +1 -0
  512. package/codeyam-cli/src/webserver/build/client/assets/EntityItem-C76mRRiF.js +11 -0
  513. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-COi5OvsN.js → EntityTypeBadge-g3saevPb.js} +1 -1
  514. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-BwdQv49w.js → EntityTypeIcon-CobE682z.js} +1 -1
  515. package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-Bu6c6aDe.js +1 -0
  516. package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-D68KarMg.js → InteractivePreview-DYFW3lDD.js} +3 -3
  517. package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-L75Wvqgw.js → LibraryFunctionPreview-DLeucoVX.js} +1 -1
  518. package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-C53WM8qn.js → LoadingDots-BU_OAEMP.js} +1 -1
  519. package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-CrNkmy4i.js → LogViewer-ceAyBX-H.js} +1 -1
  520. package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-djPLI-WV.js +11 -0
  521. package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-CQifa1n-.js → SafeScreenshot-BED4B6sP.js} +1 -1
  522. package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-CyaBFX7l.js → ScenarioViewer-B76aig_2.js} +3 -13
  523. package/codeyam-cli/src/webserver/build/client/assets/Spinner-Bb5uFQ5V.js +34 -0
  524. package/codeyam-cli/src/webserver/build/client/assets/Terminal-nZNBALox.js +41 -0
  525. package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-D36O1rzU.js → TruncatedFilePath-C8OKAR5x.js} +1 -1
  526. package/codeyam-cli/src/webserver/build/client/assets/_index-C96V0n15.js +11 -0
  527. package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-BpKzcsJz.js +27 -0
  528. package/codeyam-cli/src/webserver/build/client/assets/addon-fit-CUXOrorO.js +1 -0
  529. package/codeyam-cli/src/webserver/build/client/assets/addon-web-links-Duc5hnl7.js +1 -0
  530. package/codeyam-cli/src/webserver/build/client/assets/agent-transcripts-D9hemwl6.js +22 -0
  531. package/codeyam-cli/src/webserver/build/client/assets/api.agent-transcripts-l0sNRNKZ.js +1 -0
  532. package/codeyam-cli/src/webserver/build/client/assets/api.dev-mode-events-l0sNRNKZ.js +1 -0
  533. package/codeyam-cli/src/webserver/build/client/assets/api.editor-audit-l0sNRNKZ.js +1 -0
  534. package/codeyam-cli/src/webserver/build/client/assets/api.editor-capture-scenario-l0sNRNKZ.js +1 -0
  535. package/codeyam-cli/src/webserver/build/client/assets/api.editor-client-errors-l0sNRNKZ.js +1 -0
  536. package/codeyam-cli/src/webserver/build/client/assets/api.editor-commit-l0sNRNKZ.js +1 -0
  537. package/codeyam-cli/src/webserver/build/client/assets/api.editor-dev-server-l0sNRNKZ.js +1 -0
  538. package/codeyam-cli/src/webserver/build/client/assets/api.editor-entity-status-l0sNRNKZ.js +1 -0
  539. package/codeyam-cli/src/webserver/build/client/assets/api.editor-file-l0sNRNKZ.js +1 -0
  540. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-entry-l0sNRNKZ.js +1 -0
  541. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-image._-l0sNRNKZ.js +1 -0
  542. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-l0sNRNKZ.js +1 -0
  543. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-screenshot-l0sNRNKZ.js +1 -0
  544. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-update-l0sNRNKZ.js +1 -0
  545. package/codeyam-cli/src/webserver/build/client/assets/api.editor-load-commit-l0sNRNKZ.js +1 -0
  546. package/codeyam-cli/src/webserver/build/client/assets/api.editor-refresh-l0sNRNKZ.js +1 -0
  547. package/codeyam-cli/src/webserver/build/client/assets/api.editor-register-scenario-l0sNRNKZ.js +1 -0
  548. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-data-l0sNRNKZ.js +1 -0
  549. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-image._-l0sNRNKZ.js +1 -0
  550. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenarios-l0sNRNKZ.js +1 -0
  551. package/codeyam-cli/src/webserver/build/client/assets/api.editor-switch-scenario-l0sNRNKZ.js +1 -0
  552. package/codeyam-cli/src/webserver/build/client/assets/api.editor-test-results-l0sNRNKZ.js +1 -0
  553. package/codeyam-cli/src/webserver/build/client/assets/api.health-l0sNRNKZ.js +1 -0
  554. package/codeyam-cli/src/webserver/build/client/assets/api.labs-unlock-l0sNRNKZ.js +1 -0
  555. package/codeyam-cli/src/webserver/build/client/assets/api.memory-profile-l0sNRNKZ.js +1 -0
  556. package/codeyam-cli/src/webserver/build/client/assets/api.restart-server-l0sNRNKZ.js +1 -0
  557. package/codeyam-cli/src/webserver/build/client/assets/api.rule-path-l0sNRNKZ.js +1 -0
  558. package/codeyam-cli/src/webserver/build/client/assets/api.save-fixture-l0sNRNKZ.js +1 -0
  559. package/codeyam-cli/src/webserver/build/client/assets/book-open-D_nMCFmP.js +6 -0
  560. package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-DgTPh8H-.js → chevron-down-BH2h1Ea2.js} +1 -1
  561. package/codeyam-cli/src/webserver/build/client/assets/{chunk-EPOLDU6W-DdQKK6on.js → chunk-JZWAC4HX-C4pqxYJB.js} +12 -12
  562. package/codeyam-cli/src/webserver/build/client/assets/{circle-check-Dmr2bb1R.js → circle-check-DyIKORY6.js} +1 -1
  563. package/codeyam-cli/src/webserver/build/client/assets/copy-NDbZjXao.js +11 -0
  564. package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-Do4ZLUYa.js → createLucideIcon-CMT1jU2q.js} +1 -1
  565. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-BiM6z3Do.js +1 -0
  566. package/codeyam-cli/src/webserver/build/client/assets/editor-B2KwhQph.js +8 -0
  567. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-CbdFyxZh.js → entity._sha._-CrjR3zZW.js} +12 -12
  568. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-DjACbfdI.js +6 -0
  569. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-C28BiQzt.js +6 -0
  570. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-p9hhkjJM.js +6 -0
  571. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-BMbl7MeQ.js → entity._sha_.edit._scenarioId-BMvVHNXU.js} +2 -2
  572. package/codeyam-cli/src/webserver/build/client/assets/{entry.client-5wRKRIH9.js → entry.client-DTvKq3TY.js} +1 -1
  573. package/codeyam-cli/src/webserver/build/client/assets/{fileTableUtils-DD3SDH7t.js → fileTableUtils-cPo8LiG3.js} +1 -1
  574. package/codeyam-cli/src/webserver/build/client/assets/files-DO4CZ16O.js +1 -0
  575. package/codeyam-cli/src/webserver/build/client/assets/{git-zXjT7J0G.js → git-CFCTYk9I.js} +8 -8
  576. package/codeyam-cli/src/webserver/build/client/assets/globals-B17TBSS6.css +1 -0
  577. package/codeyam-cli/src/webserver/build/client/assets/{index-DLbXwndH.js → index-10oVnAAH.js} +1 -1
  578. package/codeyam-cli/src/webserver/build/client/assets/{index-gPZ-lad1.js → index-BcvgDzbZ.js} +1 -1
  579. package/codeyam-cli/src/webserver/build/client/assets/labs-Zk7ryIM1.js +1 -0
  580. package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-BsPXJ81F.js → loader-circle-BAXYRVEO.js} +1 -1
  581. package/codeyam-cli/src/webserver/build/client/assets/manifest-af20abcd.js +1 -0
  582. package/codeyam-cli/src/webserver/build/client/assets/memory-Dg0mvYrI.js +96 -0
  583. package/codeyam-cli/src/webserver/build/client/assets/pause-DTAcYxBt.js +11 -0
  584. package/codeyam-cli/src/webserver/build/client/assets/root-DUKqhFlb.js +67 -0
  585. package/codeyam-cli/src/webserver/build/client/assets/{search-P2FKIUql.js → search-fKo7v0Zo.js} +1 -1
  586. package/codeyam-cli/src/webserver/build/client/assets/settings-DfuTtcJP.js +1 -0
  587. package/codeyam-cli/src/webserver/build/client/assets/{simulations-L18M6-kN.js → simulations-B3aOzpCZ.js} +1 -1
  588. package/codeyam-cli/src/webserver/build/client/assets/terminal-BG4heKCG.js +11 -0
  589. package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-BDz7kbVA.js → triangle-alert-DtSmdtM4.js} +1 -1
  590. package/codeyam-cli/src/webserver/build/client/assets/{useCustomSizes-29dDmbH8.js → useCustomSizes-ByhSyh0W.js} +1 -1
  591. package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-C14nCb1q.js +2 -0
  592. package/codeyam-cli/src/webserver/build/client/assets/{useReportContext-CkIOKTrZ.js → useReportContext-O-jkvSPx.js} +1 -1
  593. package/codeyam-cli/src/webserver/build/client/assets/{useToast-KKw5kTn-.js → useToast-9FIWuYfK.js} +1 -1
  594. package/codeyam-cli/src/webserver/build/client/assets/xterm-BqvuqXEL.js +27 -0
  595. package/codeyam-cli/src/webserver/build/server/assets/index-D_kZbNJs.js +1 -0
  596. package/codeyam-cli/src/webserver/build/server/assets/server-build-CWy5OIH9.js +366 -0
  597. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  598. package/codeyam-cli/src/webserver/build-info.json +5 -5
  599. package/codeyam-cli/src/webserver/devServer.js +39 -5
  600. package/codeyam-cli/src/webserver/devServer.js.map +1 -1
  601. package/codeyam-cli/src/webserver/editorProxy.js +440 -0
  602. package/codeyam-cli/src/webserver/editorProxy.js.map +1 -0
  603. package/codeyam-cli/src/webserver/scripts/codeyam-preload.mjs +175 -0
  604. package/codeyam-cli/src/webserver/scripts/journalCapture.ts +140 -0
  605. package/codeyam-cli/src/webserver/server.js +226 -1
  606. package/codeyam-cli/src/webserver/server.js.map +1 -1
  607. package/codeyam-cli/src/webserver/terminalServer.js +698 -0
  608. package/codeyam-cli/src/webserver/terminalServer.js.map +1 -0
  609. package/codeyam-cli/templates/codeyam-editor-claude.md +68 -0
  610. package/codeyam-cli/templates/codeyam-memory-hook.sh +199 -0
  611. package/codeyam-cli/templates/commands/codeyam-diagnose.md +481 -0
  612. package/codeyam-cli/templates/editor-step-hook.py +147 -0
  613. package/codeyam-cli/templates/hooks/staleness-check.sh +43 -0
  614. package/codeyam-cli/templates/isolation-route/next-app.tsx.template +80 -0
  615. package/codeyam-cli/templates/isolation-route/next-pages.tsx.template +79 -0
  616. package/codeyam-cli/templates/isolation-route/vite-react.tsx.template +78 -0
  617. package/codeyam-cli/templates/msw/browser-setup.ts.template +47 -0
  618. package/codeyam-cli/templates/msw/handler-router.ts.template +47 -0
  619. package/codeyam-cli/templates/msw/server-setup.ts.template +52 -0
  620. package/codeyam-cli/templates/nextjs-prisma-sqlite/PRISMA_SETUP.md +84 -0
  621. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/api/todos/route.ts +17 -0
  622. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/globals.css +26 -0
  623. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/layout.tsx +34 -0
  624. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/lib/prisma.ts +19 -0
  625. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/page.tsx +10 -0
  626. package/codeyam-cli/templates/nextjs-prisma-sqlite/eslint.config.mjs +11 -0
  627. package/codeyam-cli/templates/nextjs-prisma-sqlite/gitignore +43 -0
  628. package/codeyam-cli/templates/nextjs-prisma-sqlite/next.config.ts +14 -0
  629. package/codeyam-cli/templates/nextjs-prisma-sqlite/package.json +35 -0
  630. package/codeyam-cli/templates/nextjs-prisma-sqlite/postcss.config.mjs +7 -0
  631. package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma/schema.prisma +27 -0
  632. package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma/seed.ts +37 -0
  633. package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma.config.ts +12 -0
  634. package/codeyam-cli/templates/nextjs-prisma-sqlite/tsconfig.json +34 -0
  635. package/codeyam-cli/templates/prompts/conversation-guidance.txt +44 -0
  636. package/codeyam-cli/templates/prompts/conversation-prompt.txt +28 -0
  637. package/codeyam-cli/templates/prompts/interruption-prompt.txt +31 -0
  638. package/codeyam-cli/templates/prompts/stale-rules-prompt.txt +24 -0
  639. package/codeyam-cli/templates/rule-notification-hook.py +83 -0
  640. package/codeyam-cli/templates/rule-reflection-hook.py +647 -0
  641. package/codeyam-cli/templates/rules-instructions.md +78 -0
  642. package/codeyam-cli/templates/{codeyam:debug.md → skills/codeyam-debug/SKILL.md} +48 -4
  643. package/codeyam-cli/templates/skills/codeyam-dev-mode/SKILL.md +237 -0
  644. package/codeyam-cli/templates/skills/codeyam-editor/SKILL.md +69 -0
  645. package/codeyam-cli/templates/skills/codeyam-memory/SKILL.md +611 -0
  646. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/deprecated-prompt.md +100 -0
  647. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/detect-deprecated-patterns.mjs +139 -0
  648. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/find-exports.mjs +52 -0
  649. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/misleading-api-prompt.md +117 -0
  650. package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/read-json-field.mjs +61 -0
  651. package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/ripgrep-fallback.mjs +155 -0
  652. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/analyze-prompt.md +46 -0
  653. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/cleanup.mjs +13 -0
  654. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/filter-session.mjs +95 -0
  655. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/preprocess.mjs +160 -0
  656. package/codeyam-cli/templates/skills/codeyam-new-rule/SKILL.md +11 -0
  657. package/codeyam-cli/templates/{codeyam:setup.md → skills/codeyam-setup/SKILL.md} +13 -1
  658. package/codeyam-cli/templates/{codeyam:sim.md → skills/codeyam-sim/SKILL.md} +1 -1
  659. package/codeyam-cli/templates/{codeyam:test.md → skills/codeyam-test/SKILL.md} +1 -1
  660. package/codeyam-cli/templates/{codeyam:verify.md → skills/codeyam-verify/SKILL.md} +1 -1
  661. package/package.json +27 -22
  662. package/packages/ai/index.js +7 -3
  663. package/packages/ai/index.js.map +1 -1
  664. package/packages/ai/src/lib/analyzeScope.js +91 -30
  665. package/packages/ai/src/lib/analyzeScope.js.map +1 -1
  666. package/packages/ai/src/lib/astScopes/arrayDerivationDetector.js +150 -0
  667. package/packages/ai/src/lib/astScopes/arrayDerivationDetector.js.map +1 -0
  668. package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js +100 -12
  669. package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js.map +1 -1
  670. package/packages/ai/src/lib/astScopes/methodSemantics.js +109 -23
  671. package/packages/ai/src/lib/astScopes/methodSemantics.js.map +1 -1
  672. package/packages/ai/src/lib/astScopes/patterns/forInStatementHandler.js +10 -14
  673. package/packages/ai/src/lib/astScopes/patterns/forInStatementHandler.js.map +1 -1
  674. package/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.js +1 -102
  675. package/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.js.map +1 -1
  676. package/packages/ai/src/lib/astScopes/processExpression.js +518 -28
  677. package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
  678. package/packages/ai/src/lib/astScopes/sharedPatterns.js +25 -0
  679. package/packages/ai/src/lib/astScopes/sharedPatterns.js.map +1 -1
  680. package/packages/ai/src/lib/completionCall.js +171 -37
  681. package/packages/ai/src/lib/completionCall.js.map +1 -1
  682. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +1082 -174
  683. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
  684. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js +5 -1
  685. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js.map +1 -1
  686. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.js +179 -0
  687. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.js.map +1 -1
  688. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js +7 -1
  689. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js.map +1 -1
  690. package/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.js +13 -3
  691. package/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.js.map +1 -1
  692. package/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.js +6 -4
  693. package/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.js.map +1 -1
  694. package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js +52 -3
  695. package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js.map +1 -1
  696. package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js +106 -13
  697. package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js.map +1 -1
  698. package/packages/ai/src/lib/dataStructure/helpers/coerceObjectsToPrimitivesBySchema.js +63 -0
  699. package/packages/ai/src/lib/dataStructure/helpers/coerceObjectsToPrimitivesBySchema.js.map +1 -0
  700. package/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.js +54 -0
  701. package/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.js.map +1 -0
  702. package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js +122 -12
  703. package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js.map +1 -1
  704. package/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.js +173 -0
  705. package/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.js.map +1 -0
  706. package/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.js +37 -20
  707. package/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.js.map +1 -1
  708. package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js +333 -86
  709. package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js.map +1 -1
  710. package/packages/ai/src/lib/dataStructure/helpers/fixNullIdsBySchema.js +107 -0
  711. package/packages/ai/src/lib/dataStructure/helpers/fixNullIdsBySchema.js.map +1 -0
  712. package/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.js +34 -0
  713. package/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.js.map +1 -0
  714. package/packages/ai/src/lib/dataStructureChunking.js +130 -0
  715. package/packages/ai/src/lib/dataStructureChunking.js.map +1 -0
  716. package/packages/ai/src/lib/e2eDataTracking.js +241 -0
  717. package/packages/ai/src/lib/e2eDataTracking.js.map +1 -0
  718. package/packages/ai/src/lib/extractCriticalDataKeys.js +96 -0
  719. package/packages/ai/src/lib/extractCriticalDataKeys.js.map +1 -0
  720. package/packages/ai/src/lib/generateEntityDataStructure.js +46 -2
  721. package/packages/ai/src/lib/generateEntityDataStructure.js.map +1 -1
  722. package/packages/ai/src/lib/generateEntityScenarioData.js +789 -8
  723. package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
  724. package/packages/ai/src/lib/generateEntityScenarios.js +26 -2
  725. package/packages/ai/src/lib/generateEntityScenarios.js.map +1 -1
  726. package/packages/ai/src/lib/generateExecutionFlows.js +376 -4
  727. package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -1
  728. package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js +1124 -59
  729. package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js.map +1 -1
  730. package/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.js +194 -0
  731. package/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.js.map +1 -0
  732. package/packages/ai/src/lib/isolateScopes.js +39 -3
  733. package/packages/ai/src/lib/isolateScopes.js.map +1 -1
  734. package/packages/ai/src/lib/mergeJsonTypeDefinitions.js +5 -0
  735. package/packages/ai/src/lib/mergeJsonTypeDefinitions.js.map +1 -1
  736. package/packages/ai/src/lib/mergeStatements.js +70 -51
  737. package/packages/ai/src/lib/mergeStatements.js.map +1 -1
  738. package/packages/ai/src/lib/promptGenerators/collapseNullableObjects.js +97 -0
  739. package/packages/ai/src/lib/promptGenerators/collapseNullableObjects.js.map +1 -0
  740. package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js +10 -4
  741. package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js.map +1 -1
  742. package/packages/ai/src/lib/promptGenerators/generateChunkPrompt.js +54 -0
  743. package/packages/ai/src/lib/promptGenerators/generateChunkPrompt.js.map +1 -0
  744. package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js +30 -7
  745. package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js.map +1 -1
  746. package/packages/ai/src/lib/promptGenerators/simplifyKeysForLLM.js +335 -0
  747. package/packages/ai/src/lib/promptGenerators/simplifyKeysForLLM.js.map +1 -0
  748. package/packages/ai/src/lib/resolvePathToControllable.js +155 -41
  749. package/packages/ai/src/lib/resolvePathToControllable.js.map +1 -1
  750. package/packages/ai/src/lib/worker/SerializableDataStructure.js +7 -0
  751. package/packages/ai/src/lib/worker/SerializableDataStructure.js.map +1 -1
  752. package/packages/ai/src/lib/worker/analyzeScopeWorker.js +94 -1
  753. package/packages/ai/src/lib/worker/analyzeScopeWorker.js.map +1 -1
  754. package/packages/analyze/index.js +1 -0
  755. package/packages/analyze/index.js.map +1 -1
  756. package/packages/analyze/src/lib/FileAnalyzer.js +60 -36
  757. package/packages/analyze/src/lib/FileAnalyzer.js.map +1 -1
  758. package/packages/analyze/src/lib/ProjectAnalyzer.js +109 -30
  759. package/packages/analyze/src/lib/ProjectAnalyzer.js.map +1 -1
  760. package/packages/analyze/src/lib/analysisContext.js +30 -5
  761. package/packages/analyze/src/lib/analysisContext.js.map +1 -1
  762. package/packages/analyze/src/lib/asts/index.js +4 -2
  763. package/packages/analyze/src/lib/asts/index.js.map +1 -1
  764. package/packages/analyze/src/lib/asts/nodes/getNodeType.js +1 -0
  765. package/packages/analyze/src/lib/asts/nodes/getNodeType.js.map +1 -1
  766. package/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.js +14 -0
  767. package/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.js.map +1 -1
  768. package/packages/analyze/src/lib/asts/sourceFiles/getAllEntityNodes.js +14 -0
  769. package/packages/analyze/src/lib/asts/sourceFiles/getAllEntityNodes.js.map +1 -1
  770. package/packages/analyze/src/lib/asts/sourceFiles/getAllExports.js +6 -0
  771. package/packages/analyze/src/lib/asts/sourceFiles/getAllExports.js.map +1 -1
  772. package/packages/analyze/src/lib/asts/sourceFiles/getImportsAnalysis.js +6 -0
  773. package/packages/analyze/src/lib/asts/sourceFiles/getImportsAnalysis.js.map +1 -1
  774. package/packages/analyze/src/lib/asts/sourceFiles/getResolvedModule.js +39 -1
  775. package/packages/analyze/src/lib/asts/sourceFiles/getResolvedModule.js.map +1 -1
  776. package/packages/analyze/src/lib/asts/sourceFiles/getSourceFilesForAllImports.js +2 -1
  777. package/packages/analyze/src/lib/asts/sourceFiles/getSourceFilesForAllImports.js.map +1 -1
  778. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +72 -10
  779. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
  780. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +24 -4
  781. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
  782. package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js +9 -0
  783. package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js.map +1 -1
  784. package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js +2 -1
  785. package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js.map +1 -1
  786. package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js +31 -10
  787. package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js.map +1 -1
  788. package/packages/analyze/src/lib/files/analyzeRemixRoute.js +3 -2
  789. package/packages/analyze/src/lib/files/analyzeRemixRoute.js.map +1 -1
  790. package/packages/analyze/src/lib/files/getImportedExports.js +11 -7
  791. package/packages/analyze/src/lib/files/getImportedExports.js.map +1 -1
  792. package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js +907 -0
  793. package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js.map +1 -0
  794. package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js +164 -68
  795. package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js.map +1 -1
  796. package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js +75 -21
  797. package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js.map +1 -1
  798. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +250 -20
  799. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
  800. package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js +57 -9
  801. package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js.map +1 -1
  802. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +558 -55
  803. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
  804. package/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.js +46 -9
  805. package/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.js.map +1 -1
  806. package/packages/analyze/src/lib/files/setImportedExports.js +2 -1
  807. package/packages/analyze/src/lib/files/setImportedExports.js.map +1 -1
  808. package/packages/analyze/src/lib/index.js +1 -0
  809. package/packages/analyze/src/lib/index.js.map +1 -1
  810. package/packages/analyze/src/lib/utils/getFileByPath.js +12 -0
  811. package/packages/analyze/src/lib/utils/getFileByPath.js.map +1 -0
  812. package/packages/database/index.js +1 -0
  813. package/packages/database/index.js.map +1 -1
  814. package/packages/database/src/lib/analysisBranchToDb.js +1 -1
  815. package/packages/database/src/lib/analysisBranchToDb.js.map +1 -1
  816. package/packages/database/src/lib/analysisToDb.js +1 -1
  817. package/packages/database/src/lib/analysisToDb.js.map +1 -1
  818. package/packages/database/src/lib/branchToDb.js +1 -1
  819. package/packages/database/src/lib/branchToDb.js.map +1 -1
  820. package/packages/database/src/lib/commitBranchToDb.js +1 -1
  821. package/packages/database/src/lib/commitBranchToDb.js.map +1 -1
  822. package/packages/database/src/lib/commitToDb.js +1 -1
  823. package/packages/database/src/lib/commitToDb.js.map +1 -1
  824. package/packages/database/src/lib/fileToDb.js +1 -1
  825. package/packages/database/src/lib/fileToDb.js.map +1 -1
  826. package/packages/database/src/lib/kysely/db.js +16 -1
  827. package/packages/database/src/lib/kysely/db.js.map +1 -1
  828. package/packages/database/src/lib/kysely/tables/commitsTable.js +3 -0
  829. package/packages/database/src/lib/kysely/tables/commitsTable.js.map +1 -1
  830. package/packages/database/src/lib/kysely/tables/editorScenariosTable.js +45 -0
  831. package/packages/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -0
  832. package/packages/database/src/lib/kysely/tables/labsRequestsTable.js +35 -0
  833. package/packages/database/src/lib/kysely/tables/labsRequestsTable.js.map +1 -0
  834. package/packages/database/src/lib/loadAnalyses.js +45 -2
  835. package/packages/database/src/lib/loadAnalyses.js.map +1 -1
  836. package/packages/database/src/lib/loadAnalysis.js +8 -0
  837. package/packages/database/src/lib/loadAnalysis.js.map +1 -1
  838. package/packages/database/src/lib/loadBranch.js +11 -1
  839. package/packages/database/src/lib/loadBranch.js.map +1 -1
  840. package/packages/database/src/lib/loadCommit.js +7 -0
  841. package/packages/database/src/lib/loadCommit.js.map +1 -1
  842. package/packages/database/src/lib/loadCommits.js +45 -14
  843. package/packages/database/src/lib/loadCommits.js.map +1 -1
  844. package/packages/database/src/lib/loadEntities.js +23 -4
  845. package/packages/database/src/lib/loadEntities.js.map +1 -1
  846. package/packages/database/src/lib/loadEntityBranches.js +9 -0
  847. package/packages/database/src/lib/loadEntityBranches.js.map +1 -1
  848. package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.js +1 -4
  849. package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.js.map +1 -1
  850. package/packages/database/src/lib/projectToDb.js +1 -1
  851. package/packages/database/src/lib/projectToDb.js.map +1 -1
  852. package/packages/database/src/lib/saveFiles.js +1 -1
  853. package/packages/database/src/lib/saveFiles.js.map +1 -1
  854. package/packages/database/src/lib/scenarioToDb.js +1 -1
  855. package/packages/database/src/lib/scenarioToDb.js.map +1 -1
  856. package/packages/database/src/lib/updateCommitMetadata.js +100 -88
  857. package/packages/database/src/lib/updateCommitMetadata.js.map +1 -1
  858. package/packages/database/src/lib/updateFreshAnalysisStatus.js +41 -30
  859. package/packages/database/src/lib/updateFreshAnalysisStatus.js.map +1 -1
  860. package/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.js +68 -57
  861. package/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.js.map +1 -1
  862. package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +29 -1
  863. package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -1
  864. package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +33 -5
  865. package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
  866. package/packages/types/index.js.map +1 -1
  867. package/packages/utils/src/lib/fs/rsyncCopy.js +98 -3
  868. package/packages/utils/src/lib/fs/rsyncCopy.js.map +1 -1
  869. package/packages/utils/src/lib/safeFileName.js +29 -3
  870. package/packages/utils/src/lib/safeFileName.js.map +1 -1
  871. package/scripts/npm-post-install.cjs +34 -0
  872. package/codeyam-cli/src/commands/detect-universal-mocks.js +0 -118
  873. package/codeyam-cli/src/commands/detect-universal-mocks.js.map +0 -1
  874. package/codeyam-cli/src/commands/list.js +0 -31
  875. package/codeyam-cli/src/commands/list.js.map +0 -1
  876. package/codeyam-cli/src/commands/webapp-info.js +0 -146
  877. package/codeyam-cli/src/commands/webapp-info.js.map +0 -1
  878. package/codeyam-cli/src/utils/universal-mocks.js +0 -152
  879. package/codeyam-cli/src/utils/universal-mocks.js.map +0 -1
  880. package/codeyam-cli/src/webserver/build/client/assets/EntityItem-vauWK972.js +0 -1
  881. package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-CEleMv_j.js +0 -34
  882. package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-DzJRkCkr.js +0 -11
  883. package/codeyam-cli/src/webserver/build/client/assets/_index-Be83mo_j.js +0 -11
  884. package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-BN6wu6Y-.js +0 -37
  885. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-Bn6aCAy_.js +0 -1
  886. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-B4iCfs5M.js +0 -6
  887. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-wDWZZO1W.js +0 -6
  888. package/codeyam-cli/src/webserver/build/client/assets/files-DKyMFI90.js +0 -1
  889. package/codeyam-cli/src/webserver/build/client/assets/globals-DTTQ3gY7.css +0 -1
  890. package/codeyam-cli/src/webserver/build/client/assets/manifest-22590fcf.js +0 -1
  891. package/codeyam-cli/src/webserver/build/client/assets/root-BsAarjAM.js +0 -57
  892. package/codeyam-cli/src/webserver/build/client/assets/settings-B2eDuBj8.js +0 -1
  893. package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-BUm0UVJm.js +0 -2
  894. package/codeyam-cli/src/webserver/build/server/assets/index-BND5I5fv.js +0 -1
  895. package/codeyam-cli/src/webserver/build/server/assets/server-build-CFXnd7MG.js +0 -228
  896. package/codeyam-cli/templates/codeyam-stop-hook.sh +0 -284
  897. package/codeyam-cli/templates/codeyam:diagnose.md +0 -625
  898. package/scripts/finalize-analyzer.cjs +0 -81
@@ -3,9 +3,144 @@ import * as crypto from 'crypto';
3
3
  import { StructuredPath } from "./paths.js";
4
4
  import { nodeToSource } from "./nodeToSource.js";
5
5
  import { methodRegistry, ArrayPushSemantics } from "./methodSemantics.js";
6
- import { isArithmeticOperator, isAssignmentOperator, isBitwiseCompoundOperator, isComparisonOperator, isDefinedType, isNumericCompoundOperator, leftOrRightType, unwrapExpression, } from "./sharedPatterns.js";
6
+ import { getComparisonOperatorString, isArithmeticOperator, isAssignmentOperator, isBitwiseCompoundOperator, isComparisonOperator, isDefinedType, isNumericCompoundOperator, leftOrRightType, unwrapExpression, } from "./sharedPatterns.js";
7
7
  import { processBindingPattern } from "./processBindings.js";
8
8
  import { extractConditionalEffectsFromTernary, findUseStateSetters, } from "./conditionalEffectsExtractor.js";
9
+ import { detectArrayDerivedPattern } from "./arrayDerivationDetector.js";
10
+ /**
11
+ * Recursively extracts root variable names from an expression AST node.
12
+ * Used to identify which variables flow into JSX expression children,
13
+ * so we can link them to the return value schema.
14
+ *
15
+ * Examples:
16
+ * - `filteredTopPaths.map(...)` → ['filteredTopPaths']
17
+ * - `a && b` → ['a', 'b']
18
+ * - `condition ? x : y` → ['condition', 'x', 'y']
19
+ */
20
+ function extractRootVariableNames(node) {
21
+ const ignoredIdentifiers = new Set([
22
+ 'undefined',
23
+ 'null',
24
+ 'true',
25
+ 'false',
26
+ 'NaN',
27
+ 'Infinity',
28
+ ]);
29
+ if (ts.isIdentifier(node)) {
30
+ const name = node.text;
31
+ return ignoredIdentifiers.has(name) ? [] : [name];
32
+ }
33
+ if (ts.isPropertyAccessExpression(node)) {
34
+ return extractRootVariableNames(node.expression);
35
+ }
36
+ if (ts.isCallExpression(node)) {
37
+ return extractRootVariableNames(node.expression);
38
+ }
39
+ if (ts.isBinaryExpression(node)) {
40
+ return [
41
+ ...extractRootVariableNames(node.left),
42
+ ...extractRootVariableNames(node.right),
43
+ ];
44
+ }
45
+ if (ts.isPrefixUnaryExpression(node)) {
46
+ return extractRootVariableNames(node.operand);
47
+ }
48
+ if (ts.isConditionalExpression(node)) {
49
+ return [
50
+ ...extractRootVariableNames(node.condition),
51
+ ...extractRootVariableNames(node.whenTrue),
52
+ ...extractRootVariableNames(node.whenFalse),
53
+ ];
54
+ }
55
+ if (ts.isParenthesizedExpression(node)) {
56
+ return extractRootVariableNames(node.expression);
57
+ }
58
+ // Stop recursion at JSX elements and other terminal nodes
59
+ if (ts.isJsxElement(node) ||
60
+ ts.isJsxFragment(node) ||
61
+ ts.isJsxSelfClosingElement(node)) {
62
+ return [];
63
+ }
64
+ return [];
65
+ }
66
+ /**
67
+ * Checks if a JSX element has props that reference variables from the parent scope.
68
+ * This is used to detect unconditionally-rendered children that should have their
69
+ * execution flows merged into the parent.
70
+ *
71
+ * We want to track children where the parent controls data that affects the child's
72
+ * conditional rendering. Static props (like title="Dashboard") don't need tracking
73
+ * because they don't create variable execution flows.
74
+ *
75
+ * Examples:
76
+ * - <WorkoutsView workouts={workouts} /> → true (workouts is a variable)
77
+ * - <ItemList items={items} count={count} /> → true (items, count are variables)
78
+ * - <Header title="Dashboard" /> → false (static string)
79
+ * - <Footer /> → false (no props)
80
+ * - <Button onClick={handleClick} /> → false (only callback, no data props)
81
+ *
82
+ * @returns true if the component has at least one prop that references a variable
83
+ * (excluding callbacks which typically start with 'on' or 'handle')
84
+ */
85
+ function hasDataPropsFromParent(node, componentName) {
86
+ const attributes = ts.isJsxElement(node)
87
+ ? node.openingElement.attributes.properties
88
+ : node.attributes.properties;
89
+ const dataProps = [];
90
+ for (const attr of attributes) {
91
+ // Spread attributes always reference parent data: {...props}
92
+ if (ts.isJsxSpreadAttribute(attr)) {
93
+ const spreadText = attr.expression?.getText() || '...spread';
94
+ dataProps.push(`{...${spreadText}}`);
95
+ console.log(`[UnconditionalChild] ${componentName}: Found spread attribute {${spreadText}}`);
96
+ continue;
97
+ }
98
+ if (ts.isJsxAttribute(attr)) {
99
+ const propName = attr.name.getText();
100
+ // Skip callback props - they don't create data-driven execution flows
101
+ // Callbacks typically start with 'on' (onClick, onChange) or 'handle' (handleSubmit)
102
+ if (propName.startsWith('on') ||
103
+ propName.startsWith('handle') ||
104
+ propName === 'ref') {
105
+ console.log(`[UnconditionalChild] ${componentName}: Skipping callback prop '${propName}'`);
106
+ continue;
107
+ }
108
+ // Check if the prop value is a JSX expression (references a variable)
109
+ // vs a string literal which is static
110
+ if (attr.initializer) {
111
+ if (ts.isJsxExpression(attr.initializer)) {
112
+ // JSX expression like prop={value} - this references a variable
113
+ // Could be a simple identifier, property access, or more complex expression
114
+ const expression = attr.initializer.expression;
115
+ if (expression) {
116
+ // Skip if it's just a function/arrow function (callback)
117
+ if (ts.isArrowFunction(expression) ||
118
+ ts.isFunctionExpression(expression)) {
119
+ console.log(`[UnconditionalChild] ${componentName}: Skipping inline callback prop '${propName}'`);
120
+ continue;
121
+ }
122
+ // This is a data prop that references parent state/props
123
+ const exprText = expression.getText();
124
+ dataProps.push(`${propName}={${exprText}}`);
125
+ console.log(`[UnconditionalChild] ${componentName}: Found data prop '${propName}' = {${exprText}}`);
126
+ }
127
+ }
128
+ else {
129
+ // String literals like prop="value" are static
130
+ console.log(`[UnconditionalChild] ${componentName}: Skipping static prop '${propName}'`);
131
+ }
132
+ }
133
+ }
134
+ }
135
+ const hasDataProps = dataProps.length > 0;
136
+ if (hasDataProps) {
137
+ console.log(`[UnconditionalChild] ${componentName}: Has ${dataProps.length} data props: [${dataProps.join(', ')}]`);
138
+ }
139
+ else {
140
+ console.log(`[UnconditionalChild] ${componentName}: No data props found, will NOT track`);
141
+ }
142
+ return { hasDataProps, dataProps };
143
+ }
9
144
  /**
10
145
  * Extracts the component name from a JSX element.
11
146
  * Returns null for intrinsic elements (div, span, etc.) since we only care about
@@ -273,6 +408,123 @@ function getSourceLocation(node, sourceFile) {
273
408
  : codeSnippet,
274
409
  };
275
410
  }
411
+ /**
412
+ * Extracts the root array path from an expression that ends with .map().
413
+ * Handles chained methods like .filter().map(), .slice().map(), etc.
414
+ *
415
+ * Examples:
416
+ * - items.map(...) → "items"
417
+ * - data.users.map(...) → "data.users"
418
+ * - items.filter(...).map(...) → "items"
419
+ * - items.slice(0, 5).map(...) → "items"
420
+ */
421
+ function extractArrayPathFromMapCall(expr, sourceFile) {
422
+ // Walk up the chain to find the root array
423
+ let current = expr.expression;
424
+ while (ts.isPropertyAccessExpression(current)) {
425
+ const methodName = current.name.getText(sourceFile);
426
+ // Common array methods that return arrays (so we keep going up)
427
+ const arrayReturningMethods = [
428
+ 'map',
429
+ 'filter',
430
+ 'slice',
431
+ 'concat',
432
+ 'flat',
433
+ 'flatMap',
434
+ 'reverse',
435
+ 'sort',
436
+ 'toReversed',
437
+ 'toSorted',
438
+ 'toSpliced',
439
+ ];
440
+ if (arrayReturningMethods.includes(methodName)) {
441
+ const objectExpr = current.expression;
442
+ // If the object is a call expression (chained method), keep going
443
+ if (ts.isCallExpression(objectExpr)) {
444
+ current = objectExpr.expression;
445
+ }
446
+ else {
447
+ // Found the root - it's an identifier or property access
448
+ const path = StructuredPath.fromNode(objectExpr, sourceFile);
449
+ return path ? path.toString() : null;
450
+ }
451
+ }
452
+ else {
453
+ // Not an array method we recognize
454
+ break;
455
+ }
456
+ }
457
+ return null;
458
+ }
459
+ /**
460
+ * Extracts JSX rendering usages from a JSX expression.
461
+ * Detects:
462
+ * - array.map() calls → 'array-map' type
463
+ * - string interpolations (identifiers/property access) → 'text-interpolation' type
464
+ *
465
+ * Recursively searches inside && chains and ternary expressions.
466
+ *
467
+ * @param expr The expression inside {expr}
468
+ * @param context The analysis context
469
+ */
470
+ function extractJsxRenderingUsage(expr, context) {
471
+ const unwrapped = unwrapExpression(expr);
472
+ const sourceLocation = getSourceLocation(expr, context.sourceFile);
473
+ // Detect array.map() calls
474
+ if (ts.isCallExpression(unwrapped)) {
475
+ const calleeExpr = unwrapped.expression;
476
+ if (ts.isPropertyAccessExpression(calleeExpr)) {
477
+ const methodName = calleeExpr.name.getText(context.sourceFile);
478
+ if (methodName === 'map') {
479
+ const arrayPath = extractArrayPathFromMapCall(unwrapped, context.sourceFile);
480
+ if (arrayPath) {
481
+ context.addJsxRenderingUsage({
482
+ path: arrayPath,
483
+ renderingType: 'array-map',
484
+ valueType: 'array',
485
+ sourceLocation,
486
+ });
487
+ }
488
+ }
489
+ }
490
+ }
491
+ // Detect simple string interpolations: {title} or {user.name}
492
+ else if (ts.isIdentifier(unwrapped) ||
493
+ ts.isPropertyAccessExpression(unwrapped)) {
494
+ const path = StructuredPath.fromNode(unwrapped, context.sourceFile);
495
+ if (path) {
496
+ const pathStr = path.toString();
497
+ const typeInfo = context.getTypeInfo(path);
498
+ // Only track as text interpolation if it's a string type
499
+ // Check for 'string' type, or types that contain 'string' (but not 'string[]')
500
+ if (typeInfo === 'string' ||
501
+ (typeInfo &&
502
+ typeInfo.includes('string') &&
503
+ !typeInfo.includes('string[]'))) {
504
+ context.addJsxRenderingUsage({
505
+ path: pathStr,
506
+ renderingType: 'text-interpolation',
507
+ valueType: 'string',
508
+ sourceLocation,
509
+ });
510
+ }
511
+ }
512
+ }
513
+ // Recursively search inside && chains: {showList && items.map(...)}
514
+ else if (ts.isBinaryExpression(unwrapped) &&
515
+ unwrapped.operatorToken.kind === ts.SyntaxKind.AmpersandAmpersandToken) {
516
+ // Check the right side of the && chain (where .map() typically appears)
517
+ const rightSide = unwrapExpression(unwrapped.right);
518
+ extractJsxRenderingUsage(rightSide, context);
519
+ // Also check nested && chains on the left
520
+ extractJsxRenderingUsage(unwrapped.left, context);
521
+ }
522
+ // Recursively search inside ternaries: {isEmpty ? null : items.map(...)}
523
+ else if (ts.isConditionalExpression(unwrapped)) {
524
+ extractJsxRenderingUsage(unwrapped.whenTrue, context);
525
+ extractJsxRenderingUsage(unwrapped.whenFalse, context);
526
+ }
527
+ }
276
528
  /**
277
529
  * Counts the number of conditions in an && chain (excluding JSX consequence)
278
530
  */
@@ -330,6 +582,9 @@ function extractConditionalsFromJsx(node, context, parentConditions = []) {
330
582
  // Process JSX expressions: {expr}
331
583
  if (ts.isJsxExpression(child) && child.expression) {
332
584
  const expr = unwrapExpression(child.expression);
585
+ // Extract JSX rendering usages (array.map, text interpolation)
586
+ // This handles direct usages like {items.map(...)} or {user.name}
587
+ extractJsxRenderingUsage(expr, context);
333
588
  // If the expression is an && chain, extract its conditional usages
334
589
  if (ts.isBinaryExpression(expr) &&
335
590
  expr.operatorToken.kind === ts.SyntaxKind.AmpersandAmpersandToken) {
@@ -568,8 +823,84 @@ function extractConditionalsFromJsx(node, context, parentConditions = []) {
568
823
  }
569
824
  // Recursively process nested JSX elements - Fix 32: pass parent conditions
570
825
  else if (ts.isJsxElement(child)) {
826
+ // Check if this is a user-defined component (vs intrinsic element like div)
827
+ const componentName = getComponentNameFromJsx(child);
828
+ if (componentName) {
829
+ if (parentConditions.length > 0) {
830
+ // If there are parent conditions, record them as gating conditions
831
+ console.log(`[ChildBoundary] ${componentName}: Conditionally rendered with ${parentConditions.length} gating conditions`);
832
+ for (const condition of parentConditions) {
833
+ console.log(`[ChildBoundary] ${componentName}: Adding gating condition path='${condition.path}' isNegated=${condition.isNegated}`);
834
+ context.addChildBoundaryGatingCondition(componentName, {
835
+ path: condition.path,
836
+ conditionType: 'truthiness',
837
+ location: 'ternary',
838
+ sourceLocation: condition.sourceLocation,
839
+ controlsJsxRendering: true,
840
+ isNegated: condition.isNegated,
841
+ });
842
+ }
843
+ }
844
+ else {
845
+ // No parent conditions - check if it has data props for unconditional tracking
846
+ console.log(`[ChildBoundary] ${componentName}: Checking for unconditional rendering with data props...`);
847
+ const { hasDataProps, dataProps } = hasDataPropsFromParent(child, componentName);
848
+ if (hasDataProps) {
849
+ // Fix: Track unconditionally-rendered children that receive data props
850
+ // These need to be tracked for flow merging even without gating conditions
851
+ // Example: <WorkoutsView workouts={workouts} /> - parent controls workouts data
852
+ console.log(`[ChildBoundary] ${componentName}: TRACKING as unconditionally-rendered with data props: [${dataProps.join(', ')}]`);
853
+ context.addChildBoundaryGatingCondition(componentName, {
854
+ path: '__unconditional__',
855
+ conditionType: 'truthiness',
856
+ location: 'unconditional',
857
+ controlsJsxRendering: true,
858
+ isNegated: false,
859
+ });
860
+ }
861
+ }
862
+ }
571
863
  extractConditionalsFromJsx(child, context, parentConditions);
572
864
  }
865
+ // Handle self-closing JSX elements (e.g., <ScenarioViewer />)
866
+ else if (ts.isJsxSelfClosingElement(child)) {
867
+ // Check if this is a user-defined component (vs intrinsic element like div)
868
+ const componentName = getComponentNameFromJsx(child);
869
+ if (componentName) {
870
+ if (parentConditions.length > 0) {
871
+ // If there are parent conditions, record them as gating conditions
872
+ console.log(`[ChildBoundary] ${componentName}: Conditionally rendered (self-closing) with ${parentConditions.length} gating conditions`);
873
+ for (const condition of parentConditions) {
874
+ console.log(`[ChildBoundary] ${componentName}: Adding gating condition path='${condition.path}' isNegated=${condition.isNegated}`);
875
+ context.addChildBoundaryGatingCondition(componentName, {
876
+ path: condition.path,
877
+ conditionType: 'truthiness',
878
+ location: 'ternary',
879
+ sourceLocation: condition.sourceLocation,
880
+ controlsJsxRendering: true,
881
+ isNegated: condition.isNegated,
882
+ });
883
+ }
884
+ }
885
+ else {
886
+ // No parent conditions - check if it has data props for unconditional tracking
887
+ console.log(`[ChildBoundary] ${componentName}: Checking for unconditional rendering (self-closing) with data props...`);
888
+ const { hasDataProps, dataProps } = hasDataPropsFromParent(child, componentName);
889
+ if (hasDataProps) {
890
+ // Fix: Track unconditionally-rendered children that receive data props
891
+ console.log(`[ChildBoundary] ${componentName}: TRACKING as unconditionally-rendered (self-closing) with data props: [${dataProps.join(', ')}]`);
892
+ context.addChildBoundaryGatingCondition(componentName, {
893
+ path: '__unconditional__',
894
+ conditionType: 'truthiness',
895
+ location: 'unconditional',
896
+ controlsJsxRendering: true,
897
+ isNegated: false,
898
+ });
899
+ }
900
+ }
901
+ }
902
+ // Self-closing elements have no children, so no recursion needed
903
+ }
573
904
  // Recursively process nested JSX fragments - Fix 32: pass parent conditions
574
905
  else if (ts.isJsxFragment(child)) {
575
906
  extractConditionalsFromJsx(child, context, parentConditions);
@@ -640,12 +971,33 @@ export function extractConditionalUsage(condition, context, location, options =
640
971
  return;
641
972
  }
642
973
  // Handle binary expressions with || (logical OR)
643
- // OR breaks the chain - each side is independent
974
+ // When OR is inside an && chain, we need to continue chain tracking
975
+ // and mark conditions as OR alternatives
644
976
  if (ts.isBinaryExpression(unwrapped) &&
645
977
  unwrapped.operatorToken.kind === ts.SyntaxKind.BarBarToken) {
646
- // Both sides of || are independent conditional checks (no chain tracking)
647
- extractWithChainTracking(unwrapped.left, null, false);
648
- extractWithChainTracking(unwrapped.right, null, false);
978
+ if (chainInfo) {
979
+ // We're inside an && chain - continue tracking but mark as OR alternatives
980
+ // Generate an orGroupId so conditions from both sides can be grouped
981
+ const orGroupId = chainInfo.currentOrGroupId ?? `or_${crypto.randomUUID().slice(0, 8)}`;
982
+ // Process left side with OR group tracking
983
+ const leftChainInfo = {
984
+ ...chainInfo,
985
+ currentOrGroupId: orGroupId,
986
+ };
987
+ extractWithChainTracking(unwrapped.left, leftChainInfo, false);
988
+ // Process right side with same OR group
989
+ // Note: we use leftChainInfo's currentPosition which may have been updated
990
+ const rightChainInfo = {
991
+ ...leftChainInfo,
992
+ currentPosition: chainInfo.currentPosition,
993
+ };
994
+ extractWithChainTracking(unwrapped.right, rightChainInfo, false);
995
+ }
996
+ else {
997
+ // Not inside a chain - OR breaks into independent conditional checks
998
+ extractWithChainTracking(unwrapped.left, null, false);
999
+ extractWithChainTracking(unwrapped.right, null, false);
1000
+ }
649
1001
  return;
650
1002
  }
651
1003
  // Handle comparison operators (===, !==, <, >, <=, >=)
@@ -670,8 +1022,10 @@ export function extractConditionalUsage(condition, context, location, options =
670
1022
  }
671
1023
  return literalValue;
672
1024
  };
1025
+ // Get the comparison operator string for the compound condition
1026
+ const comparisonOperator = getComparisonOperatorString(unwrapped.operatorToken.kind);
673
1027
  // Helper to add a condition
674
- const addCondition = (path, conditionType, comparedValues, requiredValue) => {
1028
+ const addCondition = (path, conditionType, comparedValues, requiredValue, sourceExpr) => {
675
1029
  const usage = {
676
1030
  path,
677
1031
  conditionType,
@@ -681,6 +1035,16 @@ export function extractConditionalUsage(condition, context, location, options =
681
1035
  isNegated,
682
1036
  controlsJsxRendering,
683
1037
  };
1038
+ // Check for inline array-derived patterns (.length) on the source expression
1039
+ if (sourceExpr) {
1040
+ const arrayDerived = detectArrayDerivedPattern(sourceExpr);
1041
+ if (arrayDerived) {
1042
+ usage.derivedFrom = {
1043
+ operation: arrayDerived.operation,
1044
+ sourcePath: arrayDerived.sourcePath,
1045
+ };
1046
+ }
1047
+ }
684
1048
  // Add chain info if part of a compound conditional
685
1049
  if (chainInfo) {
686
1050
  usage.chainId = chainInfo.chainId;
@@ -695,6 +1059,10 @@ export function extractConditionalUsage(condition, context, location, options =
695
1059
  comparedValues,
696
1060
  isNegated,
697
1061
  requiredValue,
1062
+ ...(comparisonOperator && { comparisonOperator }),
1063
+ ...(chainInfo.currentOrGroupId && {
1064
+ orGroupId: chainInfo.currentOrGroupId,
1065
+ }),
698
1066
  });
699
1067
  }
700
1068
  context.addConditionalUsage(usage);
@@ -702,21 +1070,21 @@ export function extractConditionalUsage(condition, context, location, options =
702
1070
  // Check if left is a variable and right is a literal
703
1071
  if (leftPath && isLiteralExpression(unwrapped.right)) {
704
1072
  const literalValue = getLiteralValue(unwrapped.right, context);
705
- addCondition(leftPath.toLeftHandSideString(), 'comparison', literalValue !== undefined ? [literalValue] : undefined, getRequiredValue(literalValue, isNegated));
1073
+ addCondition(leftPath.toLeftHandSideString(), 'comparison', literalValue !== undefined ? [literalValue] : undefined, getRequiredValue(literalValue, isNegated), unwrapped.left);
706
1074
  return;
707
1075
  }
708
1076
  // Check if right is a variable and left is a literal
709
1077
  if (rightPath && isLiteralExpression(unwrapped.left)) {
710
1078
  const literalValue = getLiteralValue(unwrapped.left, context);
711
- addCondition(rightPath.toLeftHandSideString(), 'comparison', literalValue !== undefined ? [literalValue] : undefined, getRequiredValue(literalValue, isNegated));
1079
+ addCondition(rightPath.toLeftHandSideString(), 'comparison', literalValue !== undefined ? [literalValue] : undefined, getRequiredValue(literalValue, isNegated), unwrapped.right);
712
1080
  return;
713
1081
  }
714
1082
  // Both sides are variables - record both as comparisons without specific values
715
1083
  if (leftPath) {
716
- addCondition(leftPath.toLeftHandSideString(), 'comparison');
1084
+ addCondition(leftPath.toLeftHandSideString(), 'comparison', undefined, undefined, unwrapped.left);
717
1085
  }
718
1086
  if (rightPath) {
719
- addCondition(rightPath.toLeftHandSideString(), 'comparison');
1087
+ addCondition(rightPath.toLeftHandSideString(), 'comparison', undefined, undefined, unwrapped.right);
720
1088
  }
721
1089
  return;
722
1090
  }
@@ -740,6 +1108,15 @@ export function extractConditionalUsage(condition, context, location, options =
740
1108
  isNegated,
741
1109
  controlsJsxRendering,
742
1110
  };
1111
+ // Check for inline array-derived patterns (.some(), .every(), .includes(), .length)
1112
+ // This populates derivedFrom so downstream code can resolve to the base array path
1113
+ const arrayDerived = detectArrayDerivedPattern(unwrapped);
1114
+ if (arrayDerived) {
1115
+ usage.derivedFrom = {
1116
+ operation: arrayDerived.operation,
1117
+ sourcePath: arrayDerived.sourcePath,
1118
+ };
1119
+ }
743
1120
  // Add chain info if part of a compound conditional
744
1121
  if (chainInfo) {
745
1122
  usage.chainId = chainInfo.chainId;
@@ -754,6 +1131,9 @@ export function extractConditionalUsage(condition, context, location, options =
754
1131
  conditionType: 'truthiness',
755
1132
  isNegated,
756
1133
  requiredValue: !isNegated,
1134
+ ...(chainInfo.currentOrGroupId && {
1135
+ orGroupId: chainInfo.currentOrGroupId,
1136
+ }),
757
1137
  });
758
1138
  }
759
1139
  context.addConditionalUsage(usage);
@@ -885,15 +1265,21 @@ export function processExpression({ node, context, targetPath, typeHint, }) {
885
1265
  const equivalentVariables = context.getEquivalentVariables();
886
1266
  const structure = context.getStructure();
887
1267
  // Propagate existing equivalencies for sub-properties
888
- for (const [key, value] of Object.entries(equivalentVariables)) {
1268
+ for (const [key, rawValue] of Object.entries(equivalentVariables)) {
889
1269
  // Check if this equivalency is for a sub-property of the identifier
890
1270
  // e.g., completeDataStructure['Function Arguments'] or completeDataStructure.foo
891
1271
  if (key.startsWith(nodePathStr + '.') ||
892
1272
  key.startsWith(nodePathStr + '[')) {
893
1273
  const subPath = key.substring(nodePathStr.length);
894
1274
  const newTargetPath = StructuredPath.fromBase(targetPath.toString() + subPath);
895
- const valuePath = StructuredPath.fromBase(value);
896
- context.addEquivalence(newTargetPath, valuePath);
1275
+ // Handle both string and string[] values
1276
+ const values = Array.isArray(rawValue) ? rawValue : [rawValue];
1277
+ for (const value of values) {
1278
+ if (typeof value === 'string') {
1279
+ const valuePath = StructuredPath.fromBase(value);
1280
+ context.addEquivalence(newTargetPath, valuePath);
1281
+ }
1282
+ }
897
1283
  }
898
1284
  }
899
1285
  // Propagate existing structure entries for sub-properties
@@ -1229,12 +1615,46 @@ export function processExpression({ node, context, targetPath, typeHint, }) {
1229
1615
  }
1230
1616
  }
1231
1617
  else if (operatorKind === ts.SyntaxKind.BarBarToken) {
1232
- // For ||, also create an equivalence to the left side
1618
+ // For ||, create equivalences to BOTH sides
1233
1619
  // This enables data flow tracing through fallback expressions
1620
+ // e.g., `const item = items.find(...) || null` should trace to both:
1621
+ // - items[] (from the find result)
1622
+ // - null (from the fallback)
1234
1623
  if (targetPath) {
1235
- resultPath = StructuredPath.fromNode(unwrappedNode.left, context.sourceFile);
1624
+ // Get paths for both sides
1625
+ const leftPath = StructuredPath.fromNode(unwrappedNode.left, context.sourceFile);
1626
+ const rightPath = StructuredPath.fromNode(unwrappedNode.right, context.sourceFile);
1627
+ // Collect all valid paths
1628
+ const allPaths = [];
1629
+ if (leftPath)
1630
+ allPaths.push(leftPath);
1631
+ if (rightPath)
1632
+ allPaths.push(rightPath);
1633
+ // Add multiple equivalencies to track both sources
1634
+ if (allPaths.length > 0) {
1635
+ context.addMultipleEquivalencies(targetPath, allPaths);
1636
+ }
1637
+ // Process both sides to capture their internal structures
1638
+ processExpression({
1639
+ node: unwrappedNode.left,
1640
+ context,
1641
+ });
1642
+ processExpression({
1643
+ node: unwrappedNode.right,
1644
+ context,
1645
+ });
1646
+ // Register the type for the target path
1647
+ const leftType = context.inferTypeFromNode(unwrappedNode.left);
1648
+ const rightType = context.inferTypeFromNode(unwrappedNode.right);
1649
+ const orResultType = isDefinedType(leftType)
1650
+ ? leftType
1651
+ : rightType || 'unknown';
1652
+ context.addType(targetPath, orResultType);
1653
+ // Return early - we've already handled equivalencies with addMultipleEquivalencies
1654
+ // Don't fall through to the generic addEquivalence call below
1655
+ return true;
1236
1656
  }
1237
- // Note: Unlike ??, we don't set targetPath when there's no target
1657
+ // Note: When there's no targetPath, we don't recursively process
1238
1658
  // because || is often used in boolean contexts where the full expression matters
1239
1659
  }
1240
1660
  }
@@ -1312,18 +1732,44 @@ export function processExpression({ node, context, targetPath, typeHint, }) {
1312
1732
  const semantics = semanticsList[0];
1313
1733
  // Get the source expression path (e.g., the object for obj.method())
1314
1734
  const sourceExpr = unwrappedNode.expression.expression;
1315
- const sourcePath = StructuredPath.fromNode(sourceExpr, context.sourceFile);
1316
- if (sourcePath) {
1317
- // For array-specific semantics (like push), verify the source is actually an array
1318
- // This prevents router.push() from being mistakenly treated as Array.push()
1319
- const isArraySemantics = semantics instanceof ArrayPushSemantics;
1320
- const shouldApply = !isArraySemantics ||
1321
- isLikelyArrayType(sourceExpr, context.typeChecker);
1322
- if (shouldApply) {
1323
- // Apply method semantics
1324
- semantics.addEquivalences(callPath, sourcePath, context);
1325
- returnType = semantics.getReturnType();
1326
- handledBySemantics = true;
1735
+ const unwrappedSourceExpr = unwrapExpression(sourceExpr);
1736
+ // When the source is a ternary expression like (cond ? arr : arr.slice()),
1737
+ // apply method semantics to BOTH branches directly. The ternary itself isn't
1738
+ // a variable - it's just a choice between two paths that both flow to the result.
1739
+ if (ts.isConditionalExpression(unwrappedSourceExpr)) {
1740
+ const branches = [
1741
+ unwrappedSourceExpr.whenTrue,
1742
+ unwrappedSourceExpr.whenFalse,
1743
+ ];
1744
+ for (const branch of branches) {
1745
+ const branchPath = StructuredPath.fromNode(branch, context.sourceFile);
1746
+ if (branchPath) {
1747
+ const isArraySemantics = semantics instanceof ArrayPushSemantics;
1748
+ const shouldApply = !isArraySemantics ||
1749
+ isLikelyArrayType(branch, context.typeChecker);
1750
+ if (shouldApply) {
1751
+ semantics.addEquivalences(callPath, branchPath, context);
1752
+ returnType = semantics.getReturnType();
1753
+ handledBySemantics = true;
1754
+ }
1755
+ }
1756
+ }
1757
+ }
1758
+ else {
1759
+ // Regular (non-ternary) source expression
1760
+ const sourcePath = StructuredPath.fromNode(sourceExpr, context.sourceFile);
1761
+ if (sourcePath) {
1762
+ // For array-specific semantics (like push), verify the source is actually an array
1763
+ // This prevents router.push() from being mistakenly treated as Array.push()
1764
+ const isArraySemantics = semantics instanceof ArrayPushSemantics;
1765
+ const shouldApply = !isArraySemantics ||
1766
+ isLikelyArrayType(sourceExpr, context.typeChecker);
1767
+ if (shouldApply) {
1768
+ // Apply method semantics
1769
+ semantics.addEquivalences(callPath, sourcePath, context);
1770
+ returnType = semantics.getReturnType();
1771
+ handledBySemantics = true;
1772
+ }
1327
1773
  }
1328
1774
  }
1329
1775
  }
@@ -1752,6 +2198,32 @@ export function processExpression({ node, context, targetPath, typeHint, }) {
1752
2198
  }
1753
2199
  // Handle Arrow Functions: (p) => p.prop, (a, b) => { ... }
1754
2200
  if (ts.isArrowFunction(unwrappedNode)) {
2201
+ // If this arrow function is a child boundary (e.g., a .map() callback),
2202
+ // don't process its parameters here - they will be processed when the
2203
+ // child scope is analyzed separately. This prevents parameter variables
2204
+ // from leaking into the parent scope's equivalencies.
2205
+ // Check if this arrow function is a child boundary (i.e., should be processed
2206
+ // as a separate child scope, not here in the parent scope).
2207
+ //
2208
+ // We use two checks because childBoundary positions can be unreliable:
2209
+ // 1. Position-based check (standard isChildBoundary)
2210
+ // 2. Text-based check: if the arrow function text doesn't appear in the
2211
+ // statement text, it was replaced with a cyScope placeholder
2212
+ const isChildBoundary = context.isChildBoundary(unwrappedNode);
2213
+ // Text-based child scope detection for when positions are unreliable
2214
+ const arrowFnText = unwrappedNode.getText(context.sourceFile);
2215
+ const firstLine = arrowFnText.split('\n')[0].trim();
2216
+ const searchText = firstLine.substring(0, Math.min(20, firstLine.length));
2217
+ const isInStatementText = context.statementInfo.text.includes(searchText);
2218
+ const isChildScope = !isInStatementText && arrowFnText.length > 10;
2219
+ if (isChildBoundary || isChildScope) {
2220
+ // The method semantics (e.g., ArrayMapSemantics) have already established
2221
+ // the necessary equivalences between the child scope placeholder and array elements
2222
+ if (targetPath) {
2223
+ context.addType(targetPath, 'function');
2224
+ }
2225
+ return true;
2226
+ }
1755
2227
  // Create a path for the function
1756
2228
  const functionPath = StructuredPath.empty();
1757
2229
  // Process parameters
@@ -2043,6 +2515,15 @@ export function processExpression({ node, context, targetPath, typeHint, }) {
2043
2515
  for (const child of unwrappedNode.children) {
2044
2516
  // Process expressions in JSX children: <div>{expr}</div>
2045
2517
  if (ts.isJsxExpression(child) && child.expression) {
2518
+ // When processing return value JSX, link root variables to return value schema
2519
+ if (targetPath && targetPath.base !== '') {
2520
+ const varNames = [
2521
+ ...new Set(extractRootVariableNames(child.expression)),
2522
+ ];
2523
+ for (const varName of varNames) {
2524
+ context.addEquivalence(targetPath.withProperty(varName), StructuredPath.fromBase(varName));
2525
+ }
2526
+ }
2046
2527
  // Process the expression with StructuredPath.empty() as targetPath
2047
2528
  // to trigger type registration without imposing prefix
2048
2529
  processExpression({
@@ -2073,6 +2554,15 @@ export function processExpression({ node, context, targetPath, typeHint, }) {
2073
2554
  for (const child of unwrappedNode.children) {
2074
2555
  // Process expressions in JSX children: <>{expr}</>
2075
2556
  if (ts.isJsxExpression(child) && child.expression) {
2557
+ // When processing return value JSX, link root variables to return value schema
2558
+ if (targetPath && targetPath.base !== '') {
2559
+ const varNames = [
2560
+ ...new Set(extractRootVariableNames(child.expression)),
2561
+ ];
2562
+ for (const varName of varNames) {
2563
+ context.addEquivalence(targetPath.withProperty(varName), StructuredPath.fromBase(varName));
2564
+ }
2565
+ }
2076
2566
  // Process the expression to extract structure
2077
2567
  processExpression({
2078
2568
  node: child.expression,