@codeyam/codeyam-cli 0.1.0-staging.15d0f46 → 0.1.0-staging.1669d45

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 (625) hide show
  1. package/analyzer-template/.build-info.json +7 -7
  2. package/analyzer-template/common/execAsync.ts +1 -1
  3. package/analyzer-template/log.txt +3 -3
  4. package/analyzer-template/package.json +9 -5
  5. package/analyzer-template/packages/ai/index.ts +5 -3
  6. package/analyzer-template/packages/ai/package.json +1 -1
  7. package/analyzer-template/packages/ai/src/lib/__mocks__/completionCall.ts +122 -0
  8. package/analyzer-template/packages/ai/src/lib/analyzeScope.ts +152 -6
  9. package/analyzer-template/packages/ai/src/lib/astScopes/astScopeAnalyzer.ts +107 -1
  10. package/analyzer-template/packages/ai/src/lib/astScopes/conditionalEffectsExtractor.ts +644 -0
  11. package/analyzer-template/packages/ai/src/lib/astScopes/methodSemantics.ts +42 -0
  12. package/analyzer-template/packages/ai/src/lib/astScopes/patterns/ifStatementHandler.ts +18 -0
  13. package/analyzer-template/packages/ai/src/lib/astScopes/patterns/switchStatementHandler.ts +38 -1
  14. package/analyzer-template/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.ts +301 -1
  15. package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +972 -106
  16. package/analyzer-template/packages/ai/src/lib/astScopes/types.ts +232 -0
  17. package/analyzer-template/packages/ai/src/lib/checkAllAttributes.ts +29 -10
  18. package/analyzer-template/packages/ai/src/lib/completionCall.ts +18 -2
  19. package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +1409 -138
  20. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.ts +2 -1
  21. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.ts +771 -0
  22. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.ts +233 -75
  23. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.ts +19 -1
  24. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.ts +39 -4
  25. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.ts +23 -0
  26. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertNullToUndefinedBySchema.ts +98 -0
  27. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.ts +42 -2
  28. package/analyzer-template/packages/ai/src/lib/deepEqual.ts +30 -0
  29. package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarioData.ts +74 -7
  30. package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarios.ts +89 -112
  31. package/analyzer-template/packages/ai/src/lib/generateEntityDataStructure.ts +6 -0
  32. package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +486 -86
  33. package/analyzer-template/packages/ai/src/lib/generateEntityScenarios.ts +182 -104
  34. package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +201 -0
  35. package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.ts +528 -0
  36. package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionals.ts +1019 -0
  37. package/analyzer-template/packages/ai/src/lib/getConditionalUsagesFromCode.ts +143 -31
  38. package/analyzer-template/packages/ai/src/lib/guessScenarioDataFromDescription.ts +8 -2
  39. package/analyzer-template/packages/ai/src/lib/isolateScopes.ts +276 -3
  40. package/analyzer-template/packages/ai/src/lib/mergeStatements.ts +33 -3
  41. package/analyzer-template/packages/ai/src/lib/promptGenerators/gatherAttributesMap.ts +7 -0
  42. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.ts +1 -1
  43. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.ts +32 -102
  44. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.ts +71 -4
  45. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.ts +14 -53
  46. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateMissingKeysPrompt.ts +58 -0
  47. package/analyzer-template/packages/ai/src/lib/promptGenerators/guessNewScenarioDataFromDescriptionGenerator.ts +28 -2
  48. package/analyzer-template/packages/ai/src/lib/resolvePathToControllable.ts +690 -0
  49. package/analyzer-template/packages/ai/src/lib/splitOutsideParentheses.ts +5 -1
  50. package/analyzer-template/packages/ai/src/lib/validateExecutionFlowPaths.ts +531 -0
  51. package/analyzer-template/packages/ai/src/lib/worker/SerializableDataStructure.ts +102 -0
  52. package/analyzer-template/packages/ai/src/lib/worker/analyzeScopeWorker.ts +8 -1
  53. package/analyzer-template/packages/analyze/src/lib/FileAnalyzer.ts +14 -0
  54. package/analyzer-template/packages/analyze/src/lib/asts/nodes/index.ts +1 -0
  55. package/analyzer-template/packages/analyze/src/lib/asts/nodes/isAsyncFunction.ts +67 -0
  56. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +458 -267
  57. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +18 -0
  58. package/analyzer-template/packages/analyze/src/lib/files/analyze/findOrCreateEntity.ts +3 -0
  59. package/analyzer-template/packages/analyze/src/lib/files/analyzeChange.ts +31 -15
  60. package/analyzer-template/packages/analyze/src/lib/files/analyzeEntity.ts +11 -7
  61. package/analyzer-template/packages/analyze/src/lib/files/analyzeInitial.ts +11 -12
  62. package/analyzer-template/packages/analyze/src/lib/files/enums/steps.ts +1 -1
  63. package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.ts +196 -0
  64. package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichUnknownTypesFromSourceEquivalencies.ts +102 -0
  65. package/analyzer-template/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.ts +588 -52
  66. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateChangesScenarioData.ts +1 -1
  67. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.ts +28 -62
  68. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +299 -133
  69. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.ts +156 -0
  70. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarioData.ts +78 -83
  71. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarios.ts +4 -8
  72. package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +384 -94
  73. package/analyzer-template/packages/aws/codebuild/index.ts +1 -0
  74. package/analyzer-template/packages/aws/dist/src/lib/codebuild/waitForBuild.d.ts +11 -1
  75. package/analyzer-template/packages/aws/dist/src/lib/codebuild/waitForBuild.d.ts.map +1 -1
  76. package/analyzer-template/packages/aws/dist/src/lib/codebuild/waitForBuild.js +29 -18
  77. package/analyzer-template/packages/aws/dist/src/lib/codebuild/waitForBuild.js.map +1 -1
  78. package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsDefineContainer.d.ts +2 -2
  79. package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsDefineContainer.d.ts.map +1 -1
  80. package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsDefineContainer.js +2 -2
  81. package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsDefineContainer.js.map +1 -1
  82. package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsTaskFactory.d.ts +8 -18
  83. package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsTaskFactory.d.ts.map +1 -1
  84. package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsTaskFactory.js +17 -61
  85. package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsTaskFactory.js.map +1 -1
  86. package/analyzer-template/packages/aws/dist/src/lib/s3/checkS3ObjectExists.d.ts +15 -0
  87. package/analyzer-template/packages/aws/dist/src/lib/s3/checkS3ObjectExists.d.ts.map +1 -0
  88. package/analyzer-template/packages/aws/dist/src/lib/s3/checkS3ObjectExists.js +31 -0
  89. package/analyzer-template/packages/aws/dist/src/lib/s3/checkS3ObjectExists.js.map +1 -0
  90. package/analyzer-template/packages/aws/dist/src/lib/s3/uploadFileToS3.d.ts.map +1 -1
  91. package/analyzer-template/packages/aws/dist/src/lib/s3/uploadFileToS3.js +8 -1
  92. package/analyzer-template/packages/aws/dist/src/lib/s3/uploadFileToS3.js.map +1 -1
  93. package/analyzer-template/packages/aws/package.json +2 -2
  94. package/analyzer-template/packages/aws/s3/index.ts +1 -0
  95. package/analyzer-template/packages/aws/src/lib/codebuild/waitForBuild.ts +43 -19
  96. package/analyzer-template/packages/aws/src/lib/ecs/ecsDefineContainer.ts +3 -3
  97. package/analyzer-template/packages/aws/src/lib/ecs/ecsTaskFactory.ts +17 -69
  98. package/analyzer-template/packages/aws/src/lib/s3/checkS3ObjectExists.ts +47 -0
  99. package/analyzer-template/packages/aws/src/lib/s3/uploadFileToS3.ts +8 -1
  100. package/analyzer-template/packages/database/src/lib/kysely/db.ts +4 -4
  101. package/analyzer-template/packages/database/src/lib/kysely/tableRelations.ts +2 -2
  102. package/analyzer-template/packages/database/src/lib/kysely/tables/debugReportsTable.ts +36 -9
  103. package/analyzer-template/packages/database/src/lib/loadReadyToBeCapturedAnalyses.ts +7 -3
  104. package/analyzer-template/packages/generate/index.ts +3 -0
  105. package/analyzer-template/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.ts +17 -1
  106. package/analyzer-template/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.ts +193 -0
  107. package/analyzer-template/packages/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.ts +73 -0
  108. package/analyzer-template/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.ts +9 -4
  109. package/analyzer-template/packages/generate/src/lib/deepMerge.ts +26 -1
  110. package/analyzer-template/packages/generate/src/lib/scenarioComponentForServer.ts +114 -0
  111. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts +2 -2
  112. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js +2 -2
  113. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tableRelations.d.ts +2 -2
  114. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/analysesTable.d.ts +1 -11
  115. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/analysesTable.d.ts.map +1 -1
  116. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.d.ts +30 -7
  117. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.d.ts.map +1 -1
  118. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.js +9 -3
  119. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.js.map +1 -1
  120. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/entitiesTable.d.ts +1 -0
  121. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/entitiesTable.d.ts.map +1 -1
  122. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts +2 -6
  123. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts.map +1 -1
  124. package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.d.ts.map +1 -1
  125. package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js +7 -4
  126. package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js.map +1 -1
  127. package/analyzer-template/packages/github/dist/generate/index.d.ts +3 -0
  128. package/analyzer-template/packages/github/dist/generate/index.d.ts.map +1 -1
  129. package/analyzer-template/packages/github/dist/generate/index.js +3 -0
  130. package/analyzer-template/packages/github/dist/generate/index.js.map +1 -1
  131. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.d.ts.map +1 -1
  132. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js +16 -1
  133. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js.map +1 -1
  134. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.d.ts +9 -0
  135. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.d.ts.map +1 -0
  136. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +189 -0
  137. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -0
  138. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.d.ts +20 -0
  139. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.d.ts.map +1 -0
  140. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.js +53 -0
  141. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.js.map +1 -0
  142. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.d.ts.map +1 -1
  143. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +8 -4
  144. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
  145. package/analyzer-template/packages/github/dist/generate/src/lib/deepMerge.d.ts.map +1 -1
  146. package/analyzer-template/packages/github/dist/generate/src/lib/deepMerge.js +27 -1
  147. package/analyzer-template/packages/github/dist/generate/src/lib/deepMerge.js.map +1 -1
  148. package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponentForServer.d.ts +8 -0
  149. package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponentForServer.d.ts.map +1 -0
  150. package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponentForServer.js +89 -0
  151. package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponentForServer.js.map +1 -0
  152. package/analyzer-template/packages/github/dist/github/src/lib/loadOrCreateCommit.d.ts.map +1 -1
  153. package/analyzer-template/packages/github/dist/github/src/lib/loadOrCreateCommit.js +10 -0
  154. package/analyzer-template/packages/github/dist/github/src/lib/loadOrCreateCommit.js.map +1 -1
  155. package/analyzer-template/packages/github/dist/github/src/lib/syncPrimaryBranch.d.ts.map +1 -1
  156. package/analyzer-template/packages/github/dist/github/src/lib/syncPrimaryBranch.js +3 -0
  157. package/analyzer-template/packages/github/dist/github/src/lib/syncPrimaryBranch.js.map +1 -1
  158. package/analyzer-template/packages/github/dist/types/index.d.ts +2 -2
  159. package/analyzer-template/packages/github/dist/types/index.d.ts.map +1 -1
  160. package/analyzer-template/packages/github/dist/types/index.js.map +1 -1
  161. package/analyzer-template/packages/github/dist/types/src/types/Analysis.d.ts +63 -13
  162. package/analyzer-template/packages/github/dist/types/src/types/Analysis.d.ts.map +1 -1
  163. package/analyzer-template/packages/github/dist/types/src/types/Entity.d.ts +2 -0
  164. package/analyzer-template/packages/github/dist/types/src/types/Entity.d.ts.map +1 -1
  165. package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts +11 -6
  166. package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts.map +1 -1
  167. package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts +146 -0
  168. package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
  169. package/analyzer-template/packages/github/dist/types/src/types/StatementInfo.d.ts +2 -0
  170. package/analyzer-template/packages/github/dist/types/src/types/StatementInfo.d.ts.map +1 -1
  171. package/analyzer-template/packages/github/src/lib/loadOrCreateCommit.ts +14 -0
  172. package/analyzer-template/packages/github/src/lib/syncPrimaryBranch.ts +2 -0
  173. package/analyzer-template/packages/process/index.ts +2 -0
  174. package/analyzer-template/packages/process/package.json +12 -0
  175. package/analyzer-template/packages/process/tsconfig.json +8 -0
  176. package/analyzer-template/packages/types/index.ts +4 -0
  177. package/analyzer-template/packages/types/src/types/Analysis.ts +79 -13
  178. package/analyzer-template/packages/types/src/types/Entity.ts +2 -0
  179. package/analyzer-template/packages/types/src/types/Scenario.ts +11 -10
  180. package/analyzer-template/packages/types/src/types/ScenariosDataStructure.ts +161 -0
  181. package/analyzer-template/packages/types/src/types/StatementInfo.ts +2 -0
  182. package/analyzer-template/packages/utils/dist/types/index.d.ts +2 -2
  183. package/analyzer-template/packages/utils/dist/types/index.d.ts.map +1 -1
  184. package/analyzer-template/packages/utils/dist/types/index.js.map +1 -1
  185. package/analyzer-template/packages/utils/dist/types/src/types/Analysis.d.ts +63 -13
  186. package/analyzer-template/packages/utils/dist/types/src/types/Analysis.d.ts.map +1 -1
  187. package/analyzer-template/packages/utils/dist/types/src/types/Entity.d.ts +2 -0
  188. package/analyzer-template/packages/utils/dist/types/src/types/Entity.d.ts.map +1 -1
  189. package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts +11 -6
  190. package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts.map +1 -1
  191. package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts +146 -0
  192. package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
  193. package/analyzer-template/packages/utils/dist/types/src/types/StatementInfo.d.ts +2 -0
  194. package/analyzer-template/packages/utils/dist/types/src/types/StatementInfo.d.ts.map +1 -1
  195. package/analyzer-template/playwright/capture.ts +37 -18
  196. package/analyzer-template/playwright/getCodeYamInfo.ts +12 -7
  197. package/analyzer-template/playwright/takeElementScreenshot.ts +26 -11
  198. package/analyzer-template/playwright/waitForServer.ts +21 -6
  199. package/analyzer-template/project/analyzeBaselineCommit.ts +4 -0
  200. package/analyzer-template/project/analyzeBranchCommit.ts +4 -0
  201. package/analyzer-template/project/analyzeFileEntities.ts +4 -0
  202. package/analyzer-template/project/analyzeRegularCommit.ts +4 -0
  203. package/analyzer-template/project/constructMockCode.ts +868 -132
  204. package/analyzer-template/project/controller/startController.ts +16 -1
  205. package/analyzer-template/project/executeLibraryFunctionDirect.ts +7 -3
  206. package/analyzer-template/project/mocks/analyzeFileMock.ts +8 -7
  207. package/analyzer-template/project/orchestrateCapture/KyselyAnalysisLoader.ts +3 -6
  208. package/analyzer-template/project/orchestrateCapture/SequentialCaptureTaskRunner.ts +49 -33
  209. package/analyzer-template/project/orchestrateCapture.ts +10 -3
  210. package/analyzer-template/project/reconcileMockDataKeys.ts +102 -2
  211. package/analyzer-template/project/runAnalysis.ts +7 -0
  212. package/analyzer-template/project/serverOnlyModules.ts +127 -2
  213. package/analyzer-template/project/start.ts +26 -4
  214. package/analyzer-template/project/startScenarioCapture.ts +72 -40
  215. package/analyzer-template/project/writeMockDataTsx.ts +118 -55
  216. package/analyzer-template/project/writeScenarioClientWrapper.ts +21 -0
  217. package/analyzer-template/project/writeScenarioComponents.ts +263 -92
  218. package/analyzer-template/project/writeScenarioFiles.ts +26 -0
  219. package/analyzer-template/project/writeSimpleRoot.ts +13 -15
  220. package/analyzer-template/scripts/comboWorkerLoop.cjs +1 -0
  221. package/analyzer-template/scripts/defaultCmd.sh +9 -0
  222. package/analyzer-template/tsconfig.json +2 -1
  223. package/background/src/lib/local/createLocalAnalyzer.js +1 -29
  224. package/background/src/lib/local/createLocalAnalyzer.js.map +1 -1
  225. package/background/src/lib/local/execAsync.js +1 -1
  226. package/background/src/lib/local/execAsync.js.map +1 -1
  227. package/background/src/lib/virtualized/common/execAsync.js +1 -1
  228. package/background/src/lib/virtualized/common/execAsync.js.map +1 -1
  229. package/background/src/lib/virtualized/project/analyzeBaselineCommit.js +2 -1
  230. package/background/src/lib/virtualized/project/analyzeBaselineCommit.js.map +1 -1
  231. package/background/src/lib/virtualized/project/analyzeBranchCommit.js +2 -1
  232. package/background/src/lib/virtualized/project/analyzeBranchCommit.js.map +1 -1
  233. package/background/src/lib/virtualized/project/analyzeFileEntities.js +2 -1
  234. package/background/src/lib/virtualized/project/analyzeFileEntities.js.map +1 -1
  235. package/background/src/lib/virtualized/project/analyzeRegularCommit.js +2 -1
  236. package/background/src/lib/virtualized/project/analyzeRegularCommit.js.map +1 -1
  237. package/background/src/lib/virtualized/project/constructMockCode.js +799 -121
  238. package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
  239. package/background/src/lib/virtualized/project/controller/startController.js +11 -1
  240. package/background/src/lib/virtualized/project/controller/startController.js.map +1 -1
  241. package/background/src/lib/virtualized/project/executeLibraryFunctionDirect.js +6 -3
  242. package/background/src/lib/virtualized/project/executeLibraryFunctionDirect.js.map +1 -1
  243. package/background/src/lib/virtualized/project/mocks/analyzeFileMock.js +7 -7
  244. package/background/src/lib/virtualized/project/mocks/analyzeFileMock.js.map +1 -1
  245. package/background/src/lib/virtualized/project/orchestrateCapture/KyselyAnalysisLoader.js +3 -2
  246. package/background/src/lib/virtualized/project/orchestrateCapture/KyselyAnalysisLoader.js.map +1 -1
  247. package/background/src/lib/virtualized/project/orchestrateCapture/SequentialCaptureTaskRunner.js +42 -28
  248. package/background/src/lib/virtualized/project/orchestrateCapture/SequentialCaptureTaskRunner.js.map +1 -1
  249. package/background/src/lib/virtualized/project/orchestrateCapture.js +7 -4
  250. package/background/src/lib/virtualized/project/orchestrateCapture.js.map +1 -1
  251. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js +87 -2
  252. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js.map +1 -1
  253. package/background/src/lib/virtualized/project/runAnalysis.js +6 -0
  254. package/background/src/lib/virtualized/project/runAnalysis.js.map +1 -1
  255. package/background/src/lib/virtualized/project/serverOnlyModules.js +106 -3
  256. package/background/src/lib/virtualized/project/serverOnlyModules.js.map +1 -1
  257. package/background/src/lib/virtualized/project/start.js +21 -4
  258. package/background/src/lib/virtualized/project/start.js.map +1 -1
  259. package/background/src/lib/virtualized/project/startScenarioCapture.js +56 -30
  260. package/background/src/lib/virtualized/project/startScenarioCapture.js.map +1 -1
  261. package/background/src/lib/virtualized/project/writeMockDataTsx.js +110 -48
  262. package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
  263. package/background/src/lib/virtualized/project/writeScenarioClientWrapper.js +15 -0
  264. package/background/src/lib/virtualized/project/writeScenarioClientWrapper.js.map +1 -0
  265. package/background/src/lib/virtualized/project/writeScenarioComponents.js +211 -75
  266. package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
  267. package/background/src/lib/virtualized/project/writeScenarioFiles.js +19 -0
  268. package/background/src/lib/virtualized/project/writeScenarioFiles.js.map +1 -1
  269. package/background/src/lib/virtualized/project/writeSimpleRoot.js +13 -13
  270. package/background/src/lib/virtualized/project/writeSimpleRoot.js.map +1 -1
  271. package/codeyam-cli/src/cli.js +5 -1
  272. package/codeyam-cli/src/cli.js.map +1 -1
  273. package/codeyam-cli/src/commands/analyze.js +1 -1
  274. package/codeyam-cli/src/commands/analyze.js.map +1 -1
  275. package/codeyam-cli/src/commands/baseline.js +174 -0
  276. package/codeyam-cli/src/commands/baseline.js.map +1 -0
  277. package/codeyam-cli/src/commands/debug.js +28 -18
  278. package/codeyam-cli/src/commands/debug.js.map +1 -1
  279. package/codeyam-cli/src/commands/default.js +0 -15
  280. package/codeyam-cli/src/commands/default.js.map +1 -1
  281. package/codeyam-cli/src/commands/recapture.js +44 -23
  282. package/codeyam-cli/src/commands/recapture.js.map +1 -1
  283. package/codeyam-cli/src/commands/report.js +72 -24
  284. package/codeyam-cli/src/commands/report.js.map +1 -1
  285. package/codeyam-cli/src/commands/start.js +8 -12
  286. package/codeyam-cli/src/commands/start.js.map +1 -1
  287. package/codeyam-cli/src/commands/status.js +23 -1
  288. package/codeyam-cli/src/commands/status.js.map +1 -1
  289. package/codeyam-cli/src/commands/test-startup.js +1 -1
  290. package/codeyam-cli/src/commands/test-startup.js.map +1 -1
  291. package/codeyam-cli/src/commands/wipe.js +108 -0
  292. package/codeyam-cli/src/commands/wipe.js.map +1 -0
  293. package/codeyam-cli/src/utils/__tests__/serverVersionStaleness.test.js +81 -0
  294. package/codeyam-cli/src/utils/__tests__/serverVersionStaleness.test.js.map +1 -0
  295. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +27 -27
  296. package/codeyam-cli/src/utils/analysisRunner.js +8 -13
  297. package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
  298. package/codeyam-cli/src/utils/backgroundServer.js +12 -2
  299. package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
  300. package/codeyam-cli/src/utils/database.js +91 -5
  301. package/codeyam-cli/src/utils/database.js.map +1 -1
  302. package/codeyam-cli/src/utils/generateReport.js +253 -106
  303. package/codeyam-cli/src/utils/generateReport.js.map +1 -1
  304. package/codeyam-cli/src/utils/git.js +79 -0
  305. package/codeyam-cli/src/utils/git.js.map +1 -0
  306. package/codeyam-cli/src/utils/install-skills.js +11 -11
  307. package/codeyam-cli/src/utils/install-skills.js.map +1 -1
  308. package/codeyam-cli/src/utils/queue/__tests__/manager.test.js +38 -0
  309. package/codeyam-cli/src/utils/queue/__tests__/manager.test.js.map +1 -1
  310. package/codeyam-cli/src/utils/queue/job.js +239 -16
  311. package/codeyam-cli/src/utils/queue/job.js.map +1 -1
  312. package/codeyam-cli/src/utils/queue/manager.js +19 -7
  313. package/codeyam-cli/src/utils/queue/manager.js.map +1 -1
  314. package/codeyam-cli/src/utils/queue/persistence.js.map +1 -1
  315. package/codeyam-cli/src/utils/serverState.js.map +1 -1
  316. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +5 -5
  317. package/codeyam-cli/src/utils/versionInfo.js +25 -19
  318. package/codeyam-cli/src/utils/versionInfo.js.map +1 -1
  319. package/codeyam-cli/src/utils/wipe.js +128 -0
  320. package/codeyam-cli/src/utils/wipe.js.map +1 -0
  321. package/codeyam-cli/src/webserver/app/lib/database.js +96 -0
  322. package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
  323. package/codeyam-cli/src/webserver/app/lib/dbNotifier.js.map +1 -1
  324. package/codeyam-cli/src/webserver/backgroundServer.js +2 -5
  325. package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
  326. package/codeyam-cli/src/webserver/build/client/assets/EntityItem-vauWK972.js +1 -0
  327. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-DKdsUF7Y.js → EntityTypeBadge-COi5OvsN.js} +1 -1
  328. package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-BwdQv49w.js +41 -0
  329. package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-CEleMv_j.js +34 -0
  330. package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-D68KarMg.js +25 -0
  331. package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-L75Wvqgw.js +3 -0
  332. package/codeyam-cli/src/webserver/build/client/assets/LoadingDots-C53WM8qn.js +6 -0
  333. package/codeyam-cli/src/webserver/build/client/assets/LogViewer-CrNkmy4i.js +3 -0
  334. package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-DzJRkCkr.js +11 -0
  335. package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-CQifa1n-.js +1 -0
  336. package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-CyaBFX7l.js +20 -0
  337. package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-CWjSsLqY.js → TruncatedFilePath-D36O1rzU.js} +1 -1
  338. package/codeyam-cli/src/webserver/build/client/assets/_index-Be83mo_j.js +11 -0
  339. package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-BN6wu6Y-.js +37 -0
  340. package/codeyam-cli/src/webserver/build/client/assets/chevron-down-DgTPh8H-.js +6 -0
  341. package/codeyam-cli/src/webserver/build/client/assets/chunk-EPOLDU6W-DdQKK6on.js +51 -0
  342. package/codeyam-cli/src/webserver/build/client/assets/circle-check-Dmr2bb1R.js +6 -0
  343. package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-Do4ZLUYa.js +21 -0
  344. package/codeyam-cli/src/webserver/build/client/assets/{cy-logo-cli-C1gnJVOL.svg → cy-logo-cli-CCKUIm0S.svg} +2 -2
  345. package/codeyam-cli/src/webserver/build/client/assets/cy-logo-cli-DcX-ZS3p.js +1 -0
  346. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-Bn6aCAy_.js +1 -0
  347. package/codeyam-cli/src/webserver/build/client/assets/entity._sha._-CbdFyxZh.js +23 -0
  348. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-B4iCfs5M.js +6 -0
  349. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-wDWZZO1W.js +6 -0
  350. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.edit._scenarioId-BMbl7MeQ.js +5 -0
  351. package/codeyam-cli/src/webserver/build/client/assets/entry.client-5wRKRIH9.js +29 -0
  352. package/codeyam-cli/src/webserver/build/client/assets/executionFlowCoverage-BWhdfn70.js +1 -0
  353. package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-DD3SDH7t.js +1 -0
  354. package/codeyam-cli/src/webserver/build/client/assets/files-DKyMFI90.js +1 -0
  355. package/codeyam-cli/src/webserver/build/client/assets/git-zXjT7J0G.js +15 -0
  356. package/codeyam-cli/src/webserver/build/client/assets/globals-DTTQ3gY7.css +1 -0
  357. package/codeyam-cli/src/webserver/build/client/assets/html2canvas-pro.esm-fmIEn3Bc.js +9 -0
  358. package/codeyam-cli/src/webserver/build/client/assets/index-DLbXwndH.js +9 -0
  359. package/codeyam-cli/src/webserver/build/client/assets/index-gPZ-lad1.js +3 -0
  360. package/codeyam-cli/src/webserver/build/client/assets/loader-circle-BsPXJ81F.js +6 -0
  361. package/codeyam-cli/src/webserver/build/client/assets/manifest-22590fcf.js +1 -0
  362. package/codeyam-cli/src/webserver/build/client/assets/preload-helper-ckwbz45p.js +1 -0
  363. package/codeyam-cli/src/webserver/build/client/assets/root-BsAarjAM.js +57 -0
  364. package/codeyam-cli/src/webserver/build/client/assets/scenarioStatus-B_8jpV3e.js +1 -0
  365. package/codeyam-cli/src/webserver/build/client/assets/search-P2FKIUql.js +6 -0
  366. package/codeyam-cli/src/webserver/build/client/assets/settings-B2eDuBj8.js +1 -0
  367. package/codeyam-cli/src/webserver/build/client/assets/simulations-L18M6-kN.js +1 -0
  368. package/codeyam-cli/src/webserver/build/client/assets/triangle-alert-BDz7kbVA.js +6 -0
  369. package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-29dDmbH8.js +1 -0
  370. package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-CmrTPlIB.js → useLastLogLine-BUm0UVJm.js} +1 -1
  371. package/codeyam-cli/src/webserver/build/client/assets/useReportContext-CkIOKTrZ.js +1 -0
  372. package/codeyam-cli/src/webserver/build/client/assets/{useToast-C1ig_BmP.js → useToast-KKw5kTn-.js} +1 -1
  373. package/codeyam-cli/src/webserver/build/server/assets/index-BND5I5fv.js +1 -0
  374. package/codeyam-cli/src/webserver/build/server/assets/server-build-CFXnd7MG.js +228 -0
  375. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  376. package/codeyam-cli/src/webserver/build-info.json +5 -5
  377. package/codeyam-cli/src/webserver/devServer.js +1 -3
  378. package/codeyam-cli/src/webserver/devServer.js.map +1 -1
  379. package/codeyam-cli/src/webserver/server.js +35 -25
  380. package/codeyam-cli/src/webserver/server.js.map +1 -1
  381. package/codeyam-cli/templates/{codeyam-debug-skill.md → codeyam:debug.md} +1 -1
  382. package/codeyam-cli/templates/codeyam:diagnose.md +625 -0
  383. package/codeyam-cli/templates/{codeyam-setup-skill.md → codeyam:setup.md} +139 -4
  384. package/codeyam-cli/templates/{codeyam-sim-skill.md → codeyam:sim.md} +1 -1
  385. package/codeyam-cli/templates/{codeyam-test-skill.md → codeyam:test.md} +1 -1
  386. package/codeyam-cli/templates/{codeyam-verify-skill.md → codeyam:verify.md} +1 -1
  387. package/package.json +8 -8
  388. package/packages/ai/index.js +2 -4
  389. package/packages/ai/index.js.map +1 -1
  390. package/packages/ai/src/lib/analyzeScope.js +107 -0
  391. package/packages/ai/src/lib/analyzeScope.js.map +1 -1
  392. package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js +76 -1
  393. package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js.map +1 -1
  394. package/packages/ai/src/lib/astScopes/conditionalEffectsExtractor.js +435 -0
  395. package/packages/ai/src/lib/astScopes/conditionalEffectsExtractor.js.map +1 -0
  396. package/packages/ai/src/lib/astScopes/methodSemantics.js +29 -0
  397. package/packages/ai/src/lib/astScopes/methodSemantics.js.map +1 -1
  398. package/packages/ai/src/lib/astScopes/patterns/ifStatementHandler.js +8 -0
  399. package/packages/ai/src/lib/astScopes/patterns/ifStatementHandler.js.map +1 -1
  400. package/packages/ai/src/lib/astScopes/patterns/switchStatementHandler.js +23 -0
  401. package/packages/ai/src/lib/astScopes/patterns/switchStatementHandler.js.map +1 -1
  402. package/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.js +239 -1
  403. package/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.js.map +1 -1
  404. package/packages/ai/src/lib/astScopes/processExpression.js +728 -87
  405. package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
  406. package/packages/ai/src/lib/checkAllAttributes.js +24 -9
  407. package/packages/ai/src/lib/checkAllAttributes.js.map +1 -1
  408. package/packages/ai/src/lib/completionCall.js +17 -1
  409. package/packages/ai/src/lib/completionCall.js.map +1 -1
  410. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +1126 -82
  411. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
  412. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js +2 -1
  413. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js.map +1 -1
  414. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.js +482 -0
  415. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.js.map +1 -0
  416. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js +173 -55
  417. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js.map +1 -1
  418. package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js +16 -1
  419. package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js.map +1 -1
  420. package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js +35 -2
  421. package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js.map +1 -1
  422. package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js +20 -0
  423. package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js.map +1 -1
  424. package/packages/ai/src/lib/dataStructure/helpers/convertNullToUndefinedBySchema.js +86 -0
  425. package/packages/ai/src/lib/dataStructure/helpers/convertNullToUndefinedBySchema.js.map +1 -0
  426. package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js +34 -3
  427. package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js.map +1 -1
  428. package/packages/ai/src/lib/deepEqual.js +32 -0
  429. package/packages/ai/src/lib/deepEqual.js.map +1 -0
  430. package/packages/ai/src/lib/generateChangesEntityScenarioData.js +62 -5
  431. package/packages/ai/src/lib/generateChangesEntityScenarioData.js.map +1 -1
  432. package/packages/ai/src/lib/generateChangesEntityScenarios.js +81 -90
  433. package/packages/ai/src/lib/generateChangesEntityScenarios.js.map +1 -1
  434. package/packages/ai/src/lib/generateEntityDataStructure.js +5 -0
  435. package/packages/ai/src/lib/generateEntityDataStructure.js.map +1 -1
  436. package/packages/ai/src/lib/generateEntityScenarioData.js +398 -81
  437. package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
  438. package/packages/ai/src/lib/generateEntityScenarios.js +168 -82
  439. package/packages/ai/src/lib/generateEntityScenarios.js.map +1 -1
  440. package/packages/ai/src/lib/generateExecutionFlows.js +123 -0
  441. package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -0
  442. package/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.js +380 -0
  443. package/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.js.map +1 -0
  444. package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js +742 -0
  445. package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js.map +1 -0
  446. package/packages/ai/src/lib/getConditionalUsagesFromCode.js +84 -14
  447. package/packages/ai/src/lib/getConditionalUsagesFromCode.js.map +1 -1
  448. package/packages/ai/src/lib/guessScenarioDataFromDescription.js +2 -1
  449. package/packages/ai/src/lib/guessScenarioDataFromDescription.js.map +1 -1
  450. package/packages/ai/src/lib/isolateScopes.js +231 -4
  451. package/packages/ai/src/lib/isolateScopes.js.map +1 -1
  452. package/packages/ai/src/lib/mergeStatements.js +26 -3
  453. package/packages/ai/src/lib/mergeStatements.js.map +1 -1
  454. package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js +6 -0
  455. package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js.map +1 -1
  456. package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.js +1 -1
  457. package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.js.map +1 -1
  458. package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js +21 -64
  459. package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js.map +1 -1
  460. package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js +58 -4
  461. package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js.map +1 -1
  462. package/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.js +10 -34
  463. package/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.js.map +1 -1
  464. package/packages/ai/src/lib/promptGenerators/generateMissingKeysPrompt.js +45 -0
  465. package/packages/ai/src/lib/promptGenerators/generateMissingKeysPrompt.js.map +1 -0
  466. package/packages/ai/src/lib/promptGenerators/guessNewScenarioDataFromDescriptionGenerator.js +16 -3
  467. package/packages/ai/src/lib/promptGenerators/guessNewScenarioDataFromDescriptionGenerator.js.map +1 -1
  468. package/packages/ai/src/lib/resolvePathToControllable.js +563 -0
  469. package/packages/ai/src/lib/resolvePathToControllable.js.map +1 -0
  470. package/packages/ai/src/lib/splitOutsideParentheses.js +3 -1
  471. package/packages/ai/src/lib/splitOutsideParentheses.js.map +1 -1
  472. package/packages/ai/src/lib/worker/SerializableDataStructure.js +22 -0
  473. package/packages/ai/src/lib/worker/SerializableDataStructure.js.map +1 -1
  474. package/packages/ai/src/lib/worker/analyzeScopeWorker.js +4 -0
  475. package/packages/ai/src/lib/worker/analyzeScopeWorker.js.map +1 -1
  476. package/packages/analyze/src/lib/FileAnalyzer.js +15 -0
  477. package/packages/analyze/src/lib/FileAnalyzer.js.map +1 -1
  478. package/packages/analyze/src/lib/asts/nodes/index.js +1 -0
  479. package/packages/analyze/src/lib/asts/nodes/index.js.map +1 -1
  480. package/packages/analyze/src/lib/asts/nodes/isAsyncFunction.js +52 -0
  481. package/packages/analyze/src/lib/asts/nodes/isAsyncFunction.js.map +1 -0
  482. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +214 -50
  483. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
  484. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +10 -0
  485. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
  486. package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js +2 -0
  487. package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js.map +1 -1
  488. package/packages/analyze/src/lib/files/analyzeChange.js +21 -11
  489. package/packages/analyze/src/lib/files/analyzeChange.js.map +1 -1
  490. package/packages/analyze/src/lib/files/analyzeEntity.js +9 -8
  491. package/packages/analyze/src/lib/files/analyzeEntity.js.map +1 -1
  492. package/packages/analyze/src/lib/files/analyzeInitial.js +9 -10
  493. package/packages/analyze/src/lib/files/analyzeInitial.js.map +1 -1
  494. package/packages/analyze/src/lib/files/enums/steps.js +1 -1
  495. package/packages/analyze/src/lib/files/enums/steps.js.map +1 -1
  496. package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js +159 -0
  497. package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js.map +1 -0
  498. package/packages/analyze/src/lib/files/scenarios/enrichUnknownTypesFromSourceEquivalencies.js +85 -0
  499. package/packages/analyze/src/lib/files/scenarios/enrichUnknownTypesFromSourceEquivalencies.js.map +1 -0
  500. package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js +458 -48
  501. package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js.map +1 -1
  502. package/packages/analyze/src/lib/files/scenarios/generateChangesScenarioData.js +1 -1
  503. package/packages/analyze/src/lib/files/scenarios/generateChangesScenarioData.js.map +1 -1
  504. package/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.js +29 -34
  505. package/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.js.map +1 -1
  506. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +235 -81
  507. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
  508. package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js +96 -0
  509. package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js.map +1 -0
  510. package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js +56 -69
  511. package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js.map +1 -1
  512. package/packages/analyze/src/lib/files/scenarios/generateScenarios.js +4 -8
  513. package/packages/analyze/src/lib/files/scenarios/generateScenarios.js.map +1 -1
  514. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +307 -89
  515. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
  516. package/packages/aws/src/lib/ecs/ecsDefineContainer.js +2 -2
  517. package/packages/aws/src/lib/ecs/ecsDefineContainer.js.map +1 -1
  518. package/packages/aws/src/lib/ecs/ecsTaskFactory.js +17 -61
  519. package/packages/aws/src/lib/ecs/ecsTaskFactory.js.map +1 -1
  520. package/packages/database/src/lib/kysely/db.js +2 -2
  521. package/packages/database/src/lib/kysely/tables/debugReportsTable.js +9 -3
  522. package/packages/database/src/lib/kysely/tables/debugReportsTable.js.map +1 -1
  523. package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.js +7 -4
  524. package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.js.map +1 -1
  525. package/packages/generate/index.js +3 -0
  526. package/packages/generate/index.js.map +1 -1
  527. package/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js +16 -1
  528. package/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js.map +1 -1
  529. package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +189 -0
  530. package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -0
  531. package/packages/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.js +53 -0
  532. package/packages/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.js.map +1 -0
  533. package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +8 -4
  534. package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
  535. package/packages/generate/src/lib/deepMerge.js +27 -1
  536. package/packages/generate/src/lib/deepMerge.js.map +1 -1
  537. package/packages/generate/src/lib/scenarioComponentForServer.js +89 -0
  538. package/packages/generate/src/lib/scenarioComponentForServer.js.map +1 -0
  539. package/packages/github/src/lib/loadOrCreateCommit.js +10 -0
  540. package/packages/github/src/lib/loadOrCreateCommit.js.map +1 -1
  541. package/packages/github/src/lib/syncPrimaryBranch.js +3 -0
  542. package/packages/github/src/lib/syncPrimaryBranch.js.map +1 -1
  543. package/packages/process/index.js +3 -0
  544. package/packages/process/index.js.map +1 -0
  545. package/packages/process/src/GlobalProcessManager.js.map +1 -0
  546. package/{background/src/lib/process → packages/process/src}/ProcessManager.js +1 -1
  547. package/packages/process/src/ProcessManager.js.map +1 -0
  548. package/packages/process/src/index.js.map +1 -0
  549. package/packages/process/src/managedExecAsync.js.map +1 -0
  550. package/packages/types/index.js.map +1 -1
  551. package/scripts/finalize-analyzer.cjs +3 -1
  552. package/analyzer-template/packages/ai/src/lib/findMatchingAttribute.ts +0 -102
  553. package/analyzer-template/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.ts +0 -197
  554. package/analyzer-template/packages/ai/src/lib/generateChangesEntityKeyAttributes.ts +0 -271
  555. package/analyzer-template/packages/ai/src/lib/generateEntityKeyAttributes.ts +0 -294
  556. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityKeyAttributesGenerator.ts +0 -67
  557. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.ts +0 -115
  558. package/analyzer-template/process/INTEGRATION_COMPLETE.md +0 -333
  559. package/analyzer-template/process/INTEGRATION_EXAMPLE.md +0 -525
  560. package/analyzer-template/process/README.md +0 -507
  561. package/background/src/lib/process/GlobalProcessManager.js.map +0 -1
  562. package/background/src/lib/process/ProcessManager.js.map +0 -1
  563. package/background/src/lib/process/index.js.map +0 -1
  564. package/background/src/lib/process/managedExecAsync.js.map +0 -1
  565. package/codeyam-cli/scripts/fixtures/cal.com/universal-mocks/packages/prisma/index.js +0 -238
  566. package/codeyam-cli/scripts/fixtures/cal.com/universal-mocks/packages/prisma/index.js.map +0 -1
  567. package/codeyam-cli/src/webserver/build/client/assets/EntityItem-D0VW1-W7.js +0 -1
  568. package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-BAk4S4pI.js +0 -1
  569. package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-Y756iZxZ.js +0 -25
  570. package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-zzrrjW1p.js +0 -3
  571. package/codeyam-cli/src/webserver/build/client/assets/LogViewer-QMn7bJg6.js +0 -3
  572. package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-DmP5mRxX.js +0 -1
  573. package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-BXwvsbLw.js +0 -1
  574. package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-DAmUX_1y.js +0 -5
  575. package/codeyam-cli/src/webserver/build/client/assets/_index-Df-nk4J5.js +0 -1
  576. package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-_ZUyFdie.js +0 -7
  577. package/codeyam-cli/src/webserver/build/client/assets/chevron-down-Eoh0PhcW.js +0 -1
  578. package/codeyam-cli/src/webserver/build/client/assets/chunk-WWGJGFF6-CZgPLy5i.js +0 -26
  579. package/codeyam-cli/src/webserver/build/client/assets/circle-check-DI-p9ZLZ.js +0 -1
  580. package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-DvyV2x6y.js +0 -1
  581. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-DURu2qlF.js +0 -1
  582. package/codeyam-cli/src/webserver/build/client/assets/entity._sha._-DDobn9Xh.js +0 -16
  583. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-CGdWnLD_.js +0 -1
  584. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.edit._scenarioId-DgMmzrKs.js +0 -5
  585. package/codeyam-cli/src/webserver/build/client/assets/entry.client-DEVXuhkn.js +0 -13
  586. package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-WPRQyc68.js +0 -1
  587. package/codeyam-cli/src/webserver/build/client/assets/files-B9u3lJer.js +0 -1
  588. package/codeyam-cli/src/webserver/build/client/assets/git-YGnKIuHU.js +0 -11
  589. package/codeyam-cli/src/webserver/build/client/assets/globals-28lrWTTo.css +0 -1
  590. package/codeyam-cli/src/webserver/build/client/assets/html2canvas-pro.esm-XQCGvadH.js +0 -5
  591. package/codeyam-cli/src/webserver/build/client/assets/index-CJ0uPJjV.js +0 -1
  592. package/codeyam-cli/src/webserver/build/client/assets/index-CfqeA2XG.js +0 -3
  593. package/codeyam-cli/src/webserver/build/client/assets/loader-circle-DIjSvh6B.js +0 -1
  594. package/codeyam-cli/src/webserver/build/client/assets/manifest-8125c15c.js +0 -1
  595. package/codeyam-cli/src/webserver/build/client/assets/preload-helper-BXl3LOEh.js +0 -1
  596. package/codeyam-cli/src/webserver/build/client/assets/root-C-g286WP.js +0 -16
  597. package/codeyam-cli/src/webserver/build/client/assets/search-xBKWfOxd.js +0 -1
  598. package/codeyam-cli/src/webserver/build/client/assets/settings-DVY_wGOx.js +0 -1
  599. package/codeyam-cli/src/webserver/build/client/assets/simulations-Be1pJo5A.js +0 -1
  600. package/codeyam-cli/src/webserver/build/client/assets/triangle-alert-CR-FkSvx.js +0 -1
  601. package/codeyam-cli/src/webserver/build/client/assets/useReportContext-DABetnSj.js +0 -1
  602. package/codeyam-cli/src/webserver/build/server/assets/index-DcR7DH9q.js +0 -1
  603. package/codeyam-cli/src/webserver/build/server/assets/server-build-BDBrfp7e.js +0 -175
  604. package/codeyam-cli/templates/debug-codeyam.md +0 -527
  605. package/packages/ai/src/lib/findMatchingAttribute.js +0 -77
  606. package/packages/ai/src/lib/findMatchingAttribute.js.map +0 -1
  607. package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js +0 -136
  608. package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js.map +0 -1
  609. package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js +0 -220
  610. package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js.map +0 -1
  611. package/packages/ai/src/lib/generateEntityKeyAttributes.js +0 -241
  612. package/packages/ai/src/lib/generateEntityKeyAttributes.js.map +0 -1
  613. package/packages/ai/src/lib/isFrontend.js +0 -5
  614. package/packages/ai/src/lib/isFrontend.js.map +0 -1
  615. package/packages/ai/src/lib/promptGenerators/generateEntityKeyAttributesGenerator.js +0 -40
  616. package/packages/ai/src/lib/promptGenerators/generateEntityKeyAttributesGenerator.js.map +0 -1
  617. package/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.js +0 -72
  618. package/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.js.map +0 -1
  619. /package/analyzer-template/{process → packages/process/src}/GlobalProcessManager.ts +0 -0
  620. /package/analyzer-template/{process → packages/process/src}/ProcessManager.ts +0 -0
  621. /package/analyzer-template/{process → packages/process/src}/index.ts +0 -0
  622. /package/analyzer-template/{process → packages/process/src}/managedExecAsync.ts +0 -0
  623. /package/{background/src/lib/process → packages/process/src}/GlobalProcessManager.js +0 -0
  624. /package/{background/src/lib/process → packages/process/src}/index.js +0 -0
  625. /package/{background/src/lib/process → packages/process/src}/managedExecAsync.js +0 -0
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Generate a prompt for the follow-up LLM call to fill in missing mockData keys.
3
+ * This is used when the initial Default Scenario response is missing some keys.
4
+ */
5
+ export default function generateMissingKeysPrompt({ scenario, executionFlows, generatedMockData, missingSchema, }) {
6
+ const coveredFlowIds = scenario.metadata?.coveredFlows || [];
7
+ const coveredFlowRequirements = coveredFlowIds
8
+ .map((flowId) => {
9
+ const flow = executionFlows?.find((f) => f.id === flowId);
10
+ if (!flow)
11
+ return null;
12
+ return {
13
+ flowId: flow.id,
14
+ flowName: flow.name,
15
+ requiredValues: flow.requiredValues,
16
+ };
17
+ })
18
+ .filter(Boolean);
19
+ return `The initial response was missing some keys. Generate mock data for ONLY the missing keys listed below.
20
+
21
+ ## Scenario Context
22
+ \`\`\`json
23
+ ${JSON.stringify({ name: scenario.name, description: scenario.description, coveredFlows: coveredFlowRequirements }, null, 2)}
24
+ \`\`\`
25
+
26
+ ## Already Generated Data
27
+ \`\`\`json
28
+ ${JSON.stringify(generatedMockData, null, 2)}
29
+ \`\`\`
30
+
31
+ ## Missing Keys to Generate
32
+ \`\`\`json
33
+ ${JSON.stringify(missingSchema, null, 2)}
34
+ \`\`\`
35
+
36
+ Return ONLY a JSON object with this structure:
37
+ \`\`\`json
38
+ {
39
+ "mockData": {
40
+ // fill in ONLY the missing keys above
41
+ }
42
+ }
43
+ \`\`\``;
44
+ }
45
+ //# sourceMappingURL=generateMissingKeysPrompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateMissingKeysPrompt.js","sourceRoot":"","sources":["../../../../../../../packages/ai/src/lib/promptGenerators/generateMissingKeysPrompt.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAAC,EAChD,QAAQ,EACR,cAAc,EACd,iBAAiB,EACjB,aAAa,GACiB;IAC9B,MAAM,cAAc,GAAG,QAAQ,CAAC,QAAQ,EAAE,YAAY,IAAI,EAAE,CAAC;IAC7D,MAAM,uBAAuB,GAAG,cAAc;SAC3C,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QACd,MAAM,IAAI,GAAG,cAAc,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,CAAC;QAC1D,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC;QACvB,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,EAAE;YACf,QAAQ,EAAE,IAAI,CAAC,IAAI;YACnB,cAAc,EAAE,IAAI,CAAC,cAAc;SACpC,CAAC;IACJ,CAAC,CAAC;SACD,MAAM,CAAC,OAAO,CAAC,CAAC;IAEnB,OAAO;;;;EAIP,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,EAAE,QAAQ,CAAC,WAAW,EAAE,YAAY,EAAE,uBAAuB,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;;;;;EAK1H,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC;;;;;EAK1C,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;;;;;;;;;;OAUjC,CAAC;AACR,CAAC"}
@@ -1,13 +1,26 @@
1
- export default function guessNewScenarioDataFromDescriptionGenerator({ description, existingScenarios, scenariosDataStructure, }) {
1
+ export default function guessNewScenarioDataFromDescriptionGenerator({ description, existingScenarios, scenariosDataStructure, flowSelections, }) {
2
+ let flowSelectionsSection = '';
3
+ if (flowSelections && flowSelections.length > 0) {
4
+ flowSelectionsSection = `
5
+ User-selected Execution Flow Values:
6
+ The user has specifically requested these values be used in the scenario:
7
+ ${flowSelections
8
+ .map((sel) => ` - ${sel.path}: ${sel.value}${sel.isCustom ? ' (custom value)' : ''}`)
9
+ .join('\n')}
10
+
11
+ IMPORTANT: The mockData MUST include these specific values for the specified paths. Generate a scenario name and description that reflects these choices.
12
+ `;
13
+ }
2
14
  return `Mock Scenario Data Structure:
3
15
  \`\`\`
4
16
  ${JSON.stringify(scenariosDataStructure, null, 2)}
5
- \`\`\
17
+ \`\`\`
6
18
  Existing Mock Scenario Data:
7
19
  \`\`\`
8
20
  ${JSON.stringify(existingScenarios, null, 2)}
9
21
  \`\`\`
10
- New Scenario user-created prompt: "${description}"
22
+ ${flowSelectionsSection}
23
+ New Scenario user-created prompt: "${description || '(No additional description - generate based on selected execution flow values)'}"
11
24
  `;
12
25
  }
13
26
  //# sourceMappingURL=guessNewScenarioDataFromDescriptionGenerator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"guessNewScenarioDataFromDescriptionGenerator.js","sourceRoot":"","sources":["../../../../../../../packages/ai/src/lib/promptGenerators/guessNewScenarioDataFromDescriptionGenerator.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,OAAO,UAAU,4CAA4C,CAAC,EACnE,WAAW,EACX,iBAAiB,EACjB,sBAAsB,GACe;IACrC,OAAO;;IAEL,IAAI,CAAC,SAAS,CAAC,sBAAsB,EAAE,IAAI,EAAE,CAAC,CAAC;;;;IAI/C,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC;;uCAEP,WAAW;GAC/C,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"guessNewScenarioDataFromDescriptionGenerator.js","sourceRoot":"","sources":["../../../../../../../packages/ai/src/lib/promptGenerators/guessNewScenarioDataFromDescriptionGenerator.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAC,OAAO,UAAU,4CAA4C,CAAC,EACnE,WAAW,EACX,iBAAiB,EACjB,sBAAsB,EACtB,cAAc,GACuB;IACrC,IAAI,qBAAqB,GAAG,EAAE,CAAC;IAC/B,IAAI,cAAc,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChD,qBAAqB,GAAG;;;IAGxB,cAAc;aACb,GAAG,CACF,CAAC,GAAG,EAAE,EAAE,CACN,OAAO,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,EAAE,CAC1E;aACA,IAAI,CAAC,IAAI,CAAC;;;GAGZ,CAAC;IACF,CAAC;IAED,OAAO;;IAEL,IAAI,CAAC,SAAS,CAAC,sBAAsB,EAAE,IAAI,EAAE,CAAC,CAAC;;;;IAI/C,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC;;EAE5C,qBAAqB;uCACgB,WAAW,IAAI,gFAAgF;GACnI,CAAC;AACJ,CAAC"}
@@ -0,0 +1,563 @@
1
+ /**
2
+ * Resolves a local variable path to a controllable data source path.
3
+ *
4
+ * This is used for deterministic execution flow generation from static analysis.
5
+ * A path is "controllable" if it maps to an entry in attributesMap, meaning
6
+ * we can mock that data during scenario simulation.
7
+ *
8
+ * Resolution strategy:
9
+ * 1. Direct match in attributesMap
10
+ * 2. Normalized match (array indices [N] → [])
11
+ * 3. Full-to-short map lookup
12
+ * 4. Equivalent variable resolution (trace local vars to data sources)
13
+ */
14
+ import { splitOutsideParenthesesAndArrays, joinParenthesesAndArrays, } from "./splitOutsideParentheses.js";
15
+ import cleanPathOfNonTransformingFunctions from "./dataStructure/helpers/cleanPathOfNonTransformingFunctions.js";
16
+ /**
17
+ * Extract the local variable name from a path.
18
+ *
19
+ * Handles patterns like:
20
+ * - "debugFetcher.state" → "debugFetcher"
21
+ * - "EntityDetail.showModal" → "showModal" (strips component prefix)
22
+ * - "isLoading" → "isLoading"
23
+ */
24
+ function extractLocalVariableName(path) {
25
+ const parts = path.split('.');
26
+ if (parts.length >= 2) {
27
+ // Check if first part looks like a component name (PascalCase)
28
+ const firstPart = parts[0];
29
+ if (/^[A-Z][a-zA-Z0-9]*$/.test(firstPart)) {
30
+ // Return the second part as the variable name
31
+ return parts[1];
32
+ }
33
+ }
34
+ // Otherwise return the first part
35
+ return parts[0];
36
+ }
37
+ /**
38
+ * Resolve a compound path by replacing the local variable with its data source.
39
+ *
40
+ * When the data source is a function call (ends with `()`), we insert
41
+ * `.functionCallReturnValue.` to match how paths are stored in the data structure.
42
+ *
43
+ * Examples:
44
+ * - ("debugFetcher.state", "debugFetcher", "useFetcher<...>()")
45
+ * → "useFetcher<...>().functionCallReturnValue.state"
46
+ * - ("debugFetcher.data.success", "debugFetcher", "useFetcher<...>()")
47
+ * → "useFetcher<...>().functionCallReturnValue.data.success"
48
+ */
49
+ function resolveCompoundPath(originalPath, localVarName, dataSourceBase) {
50
+ // Find where the local variable appears in the path
51
+ const varIndex = originalPath.indexOf(localVarName);
52
+ if (varIndex === -1) {
53
+ // If the data source is a function call, we need .functionCallReturnValue
54
+ if (dataSourceBase.endsWith('()')) {
55
+ return dataSourceBase + '.functionCallReturnValue';
56
+ }
57
+ return dataSourceBase;
58
+ }
59
+ // Get the suffix after the local variable name
60
+ const afterVar = originalPath.slice(varIndex + localVarName.length);
61
+ // If the data source is a function call, insert .functionCallReturnValue
62
+ if (dataSourceBase.endsWith('()')) {
63
+ return dataSourceBase + '.functionCallReturnValue' + afterVar;
64
+ }
65
+ // If there's no suffix, just return the data source
66
+ if (!afterVar || afterVar === '') {
67
+ return dataSourceBase;
68
+ }
69
+ // Otherwise just combine them directly
70
+ return dataSourceBase + afterVar;
71
+ }
72
+ /**
73
+ * Check if a type indicates an array.
74
+ * Returns true for "array", "Array", or types ending with "[]" like "User[]"
75
+ */
76
+ function isArrayType(type) {
77
+ return (type === 'array' ||
78
+ type === 'Array' ||
79
+ type.endsWith('[]') ||
80
+ type.startsWith('Array<'));
81
+ }
82
+ /**
83
+ * Check if a path is an array.length access and return the base array path if so.
84
+ * Returns null if not an array.length pattern.
85
+ *
86
+ * Fix 27: Also checks via fullToShortPathMap for translated child paths.
87
+ * Uses path splitting utilities instead of string matching for robustness.
88
+ */
89
+ function getArrayBaseIfLengthAccess(path, attributesMap, fullToShortPathMap) {
90
+ // Use path splitting to detect .length access properly
91
+ const pathParts = splitOutsideParenthesesAndArrays(path);
92
+ if (pathParts.length === 0 || pathParts[pathParts.length - 1] !== 'length') {
93
+ return null;
94
+ }
95
+ // Get the base path (everything except the last 'length' part)
96
+ const basePath = joinParenthesesAndArrays(pathParts.slice(0, -1));
97
+ // Clean the base path of non-transforming functions (e.g., .filter())
98
+ // This handles cases like scenarios.filter(cyScope()).length
99
+ const cleanedBasePath = cleanPathOfNonTransformingFunctions(basePath);
100
+ // Helper to check if a path is in attributesMap with array type
101
+ const checkArrayInAttributesMap = (pathToCheck) => {
102
+ // Direct match
103
+ if (pathToCheck in attributesMap) {
104
+ const type = attributesMap[pathToCheck];
105
+ if (isArrayType(type)) {
106
+ return pathToCheck;
107
+ }
108
+ }
109
+ // Normalized match (array indices [N] → [])
110
+ const normalizedPath = pathToCheck.replace(/\[\d+\]/g, '[]');
111
+ if (normalizedPath !== pathToCheck && normalizedPath in attributesMap) {
112
+ const type = attributesMap[normalizedPath];
113
+ if (isArrayType(type)) {
114
+ return normalizedPath;
115
+ }
116
+ }
117
+ // Try with [] suffix (for filter/sort/etc methods that operate on arrays)
118
+ // cleanPathOfNonTransformingFunctions may strip the method but not add []
119
+ if (!pathToCheck.endsWith('[]')) {
120
+ const pathWithArray = pathToCheck + '[]';
121
+ if (pathWithArray in attributesMap) {
122
+ const type = attributesMap[pathWithArray];
123
+ if (isArrayType(type)) {
124
+ return pathWithArray;
125
+ }
126
+ }
127
+ }
128
+ return null;
129
+ };
130
+ // Check base path directly
131
+ const directResult = checkArrayInAttributesMap(basePath);
132
+ if (directResult)
133
+ return directResult;
134
+ // Check cleaned path (with non-transforming functions removed)
135
+ if (cleanedBasePath !== basePath) {
136
+ const cleanedResult = checkArrayInAttributesMap(cleanedBasePath);
137
+ if (cleanedResult)
138
+ return cleanedResult;
139
+ }
140
+ // Fix 27: Check via fullToShortPathMap
141
+ if (fullToShortPathMap) {
142
+ // Try both basePath and cleanedBasePath
143
+ const pathsToTry = [basePath];
144
+ if (cleanedBasePath !== basePath) {
145
+ pathsToTry.push(cleanedBasePath);
146
+ }
147
+ for (const pathToCheck of pathsToTry) {
148
+ // Direct match in fullToShortPathMap
149
+ if (pathToCheck in fullToShortPathMap) {
150
+ const shortPath = fullToShortPathMap[pathToCheck];
151
+ const shortResult = checkArrayInAttributesMap(shortPath);
152
+ if (shortResult)
153
+ return basePath; // Return original basePath for context
154
+ }
155
+ // Fix 30: Find prefix match in fullToShortPathMap
156
+ const fullPathKeys = Object.keys(fullToShortPathMap);
157
+ for (const fullPath of fullPathKeys) {
158
+ if (pathToCheck.startsWith(fullPath + '.')) {
159
+ const suffix = pathToCheck.slice(fullPath.length);
160
+ const shortBase = fullToShortPathMap[fullPath];
161
+ const shortPath = shortBase + suffix;
162
+ const shortResult = checkArrayInAttributesMap(shortPath);
163
+ if (shortResult)
164
+ return basePath; // Return original basePath for context
165
+ }
166
+ }
167
+ }
168
+ }
169
+ return null;
170
+ }
171
+ /**
172
+ * Check if a path exists in the attributes map (directly or normalized).
173
+ */
174
+ function findInAttributesMap(path, attributesMap) {
175
+ // Direct match
176
+ if (path in attributesMap) {
177
+ return path;
178
+ }
179
+ // Normalized match (array indices [N] → [])
180
+ const normalizedPath = path.replace(/\[\d+\]/g, '[]');
181
+ if (normalizedPath !== path && normalizedPath in attributesMap) {
182
+ return normalizedPath;
183
+ }
184
+ // Fix 33: If path ends with [] (array element access), check if base path is an array
185
+ // This handles cases like `segments[]` where `segments` is in attributesMap as an array
186
+ if (path.endsWith('[]')) {
187
+ const basePath = path.slice(0, -2); // Remove trailing []
188
+ if (basePath in attributesMap) {
189
+ const type = attributesMap[basePath];
190
+ // Check if the base is an array type
191
+ if (isArrayType(type) || type === 'unknown' || type === 'string') {
192
+ // For arrays/strings, element access is controllable
193
+ return path;
194
+ }
195
+ }
196
+ }
197
+ // Fix 33: If path ends with [N] (specific array index), check if base path is an array
198
+ // This handles cases like `segments[0]` where `segments` is in attributesMap as an array
199
+ const arrayIndexMatch = path.match(/^(.+)\[\d+\]$/);
200
+ if (arrayIndexMatch) {
201
+ const basePath = arrayIndexMatch[1];
202
+ if (basePath in attributesMap) {
203
+ const type = attributesMap[basePath];
204
+ // Check if the base is an array type
205
+ if (isArrayType(type) || type === 'unknown' || type === 'string') {
206
+ // For arrays/strings, element access is controllable
207
+ // Return the normalized path for consistency
208
+ return normalizedPath;
209
+ }
210
+ }
211
+ }
212
+ return null;
213
+ }
214
+ /**
215
+ * Fix 35: Check if a path is controllable because a PREFIX of it is controllable.
216
+ *
217
+ * When child components access nested properties on a prop passed from parent,
218
+ * the parent's attributesMap might only contain the base path (e.g., "scenarios[]")
219
+ * but the child uses a nested path (e.g., "scenarios[].metadata.screenshotPaths[]").
220
+ *
221
+ * Since nested properties of controllable objects are also controllable,
222
+ * we should recognize that "scenarios[].metadata.screenshotPaths[]" is controllable
223
+ * if "scenarios[]" is controllable with an object/array type.
224
+ *
225
+ * @param path - The full path to check (e.g., "scenarios[].metadata.screenshotPaths[]")
226
+ * @param attributesMap - Map of controllable paths to their types
227
+ * @param fullToShortPathMap - Map from full paths to short paths
228
+ * @returns The full path if controllable via prefix, null otherwise
229
+ */
230
+ function findControllablePrefix(path, attributesMap, fullToShortPathMap) {
231
+ // Normalize array indices for matching
232
+ const normalizedPath = path.replace(/\[\d+\]/g, '[]');
233
+ // First, try to find a short version of the path using fullToShortPathMap
234
+ // The path might be "useLoaderData...scenarios[].metadata.screenshotPaths[]"
235
+ // We need to find "currentEntityAnalysis.scenarios[]" in attributesMap
236
+ // Try to find the longest matching prefix in fullToShortPathMap
237
+ let shortenedPath = normalizedPath;
238
+ if (fullToShortPathMap) {
239
+ for (const [fullPath, shortPath] of Object.entries(fullToShortPathMap)) {
240
+ // Check if normalizedPath starts with this fullPath
241
+ if (normalizedPath.startsWith(fullPath)) {
242
+ // Replace the prefix with the short version
243
+ const suffix = normalizedPath.slice(fullPath.length);
244
+ shortenedPath = shortPath + suffix;
245
+ break;
246
+ }
247
+ }
248
+ }
249
+ // Now check prefixes on the shortened path
250
+ const pathToCheck = shortenedPath;
251
+ // Split the path into parts by . and []
252
+ // e.g., "scenarios[].metadata.screenshotPaths[]" → ["scenarios[]", "metadata", "screenshotPaths[]"]
253
+ const parts = [];
254
+ let current = '';
255
+ for (let i = 0; i < pathToCheck.length; i++) {
256
+ const char = pathToCheck[i];
257
+ if (char === '.') {
258
+ if (current)
259
+ parts.push(current);
260
+ current = '';
261
+ }
262
+ else if (char === '[') {
263
+ // Include the bracket notation in the current part
264
+ const bracketEnd = pathToCheck.indexOf(']', i);
265
+ if (bracketEnd !== -1) {
266
+ current += pathToCheck.slice(i, bracketEnd + 1);
267
+ i = bracketEnd;
268
+ }
269
+ else {
270
+ current += char;
271
+ }
272
+ }
273
+ else {
274
+ current += char;
275
+ }
276
+ }
277
+ if (current)
278
+ parts.push(current);
279
+ // Try progressively shorter prefixes
280
+ // e.g., "scenarios[].metadata.screenshotPaths[]" → "scenarios[].metadata" → "scenarios[]"
281
+ for (let i = parts.length - 1; i >= 1; i--) {
282
+ const prefix = parts.slice(0, i).join('.');
283
+ // Check direct match in attributesMap
284
+ if (prefix in attributesMap) {
285
+ const type = attributesMap[prefix];
286
+ // For objects, arrays, or unknown types, nested property access is controllable
287
+ if (isArrayType(type) ||
288
+ type === 'object' ||
289
+ type === 'unknown' ||
290
+ type.endsWith('[]') ||
291
+ type.includes('<') // Generic types like Scenario[] or Record<...>
292
+ ) {
293
+ return path; // Return the original path (not normalized) as controllable
294
+ }
295
+ }
296
+ }
297
+ return null;
298
+ }
299
+ /**
300
+ * Fix 34: Find a controllable base path for derived paths.
301
+ *
302
+ * Paths like "useParams().functionCallReturnValue.*.split('/').filter(Boolean)[0]"
303
+ * are derived from "useParams().functionCallReturnValue.*" via string methods.
304
+ * This function strips string method calls to find the controllable base.
305
+ *
306
+ * String methods that create derived paths:
307
+ * - .split(...) → returns array of strings
308
+ * - .filter(...) → returns filtered array
309
+ * - .slice(...) → returns sliced array/string
310
+ * - .map(...) → returns transformed array
311
+ * - .find(...) → returns single element
312
+ * - .trim(), .toLowerCase(), .toUpperCase() → returns modified string
313
+ *
314
+ * @param path - The full derived path
315
+ * @param attributesMap - Map of controllable paths
316
+ * @returns The controllable base path if found, null otherwise
317
+ */
318
+ function findControllableBaseForDerivedPath(path, attributesMap) {
319
+ // Use cleanPathOfNonTransformingFunctions to strip non-transforming methods
320
+ // like .filter(), .sort(), .slice() etc. This handles all method calls generically
321
+ // without hardcoding specific method names.
322
+ const cleanedPath = cleanPathOfNonTransformingFunctions(path);
323
+ // If the path wasn't changed, there are no non-transforming functions to strip
324
+ if (cleanedPath === path) {
325
+ return null;
326
+ }
327
+ // Helper to check if a path is in attributesMap
328
+ const checkInAttributesMap = (pathToCheck) => {
329
+ // Direct match
330
+ if (pathToCheck in attributesMap) {
331
+ return pathToCheck;
332
+ }
333
+ // Normalized match (array indices [N] → [])
334
+ const normalizedPath = pathToCheck.replace(/\[\d+\]/g, '[]');
335
+ if (normalizedPath !== pathToCheck && normalizedPath in attributesMap) {
336
+ return normalizedPath;
337
+ }
338
+ return null;
339
+ };
340
+ // Check the cleaned path directly
341
+ const directResult = checkInAttributesMap(cleanedPath);
342
+ if (directResult) {
343
+ return directResult;
344
+ }
345
+ // Extract the short path (after functionCallReturnValue) for attributesMap lookup
346
+ const functionReturnMatch = cleanedPath.match(/\.functionCallReturnValue\.(.+)$/);
347
+ if (functionReturnMatch) {
348
+ const shortPath = functionReturnMatch[1];
349
+ const shortResult = checkInAttributesMap(shortPath);
350
+ if (shortResult) {
351
+ return shortResult;
352
+ }
353
+ }
354
+ return null;
355
+ }
356
+ /**
357
+ * Resolve a local variable path to a controllable data source path.
358
+ *
359
+ * @param localPath - The path to resolve (e.g., "isLoading", "debugFetcher.state")
360
+ * @param attributesMap - Map of controllable paths to their types
361
+ * @param equivalentSignatureVariables - Map from local variable names to data sources
362
+ * @param fullToShortPathMap - Map from full paths to short paths (for hooks)
363
+ * @returns Resolution result with the controllable path or null
364
+ */
365
+ export default function resolvePathToControllable(localPath, attributesMap, equivalentSignatureVariables, fullToShortPathMap) {
366
+ const chain = [localPath];
367
+ // 1. Direct match in attributesMap
368
+ const directMatch = findInAttributesMap(localPath, attributesMap);
369
+ if (directMatch) {
370
+ chain.push(`direct match: ${directMatch}`);
371
+ return {
372
+ resolvedPath: directMatch,
373
+ resolutionChain: chain,
374
+ isControllable: true,
375
+ };
376
+ }
377
+ // 2. Array.length resolution (direct)
378
+ // If path ends with .length and base is an array, the .length is controllable
379
+ // Fix 27: Pass fullToShortPathMap for child path resolution
380
+ const arrayBase = getArrayBaseIfLengthAccess(localPath, attributesMap, fullToShortPathMap);
381
+ if (arrayBase) {
382
+ chain.push(`array.length: base ${arrayBase} is array type`);
383
+ return {
384
+ resolvedPath: localPath,
385
+ resolutionChain: chain,
386
+ isControllable: true,
387
+ };
388
+ }
389
+ // 3. Full-to-short map lookup
390
+ if (localPath in fullToShortPathMap) {
391
+ const shortPath = fullToShortPathMap[localPath];
392
+ chain.push(`fullToShort: ${shortPath}`);
393
+ const shortMatch = findInAttributesMap(shortPath, attributesMap);
394
+ if (shortMatch) {
395
+ chain.push(`short match: ${shortMatch}`);
396
+ return {
397
+ resolvedPath: localPath, // Return the full path since that's what we'll use
398
+ resolutionChain: chain,
399
+ isControllable: true,
400
+ };
401
+ }
402
+ }
403
+ // 3b. Array element notation resolution (Fix 29)
404
+ // When a path ends with [] (array element access), the fullToShortPathMap
405
+ // may only have the base path (without []). Check if the base is mapped
406
+ // and then verify the short path with [] is in attributesMap.
407
+ if (localPath.endsWith('[]')) {
408
+ const basePath = localPath.slice(0, -2); // Remove trailing []
409
+ if (basePath in fullToShortPathMap) {
410
+ const baseShortPath = fullToShortPathMap[basePath];
411
+ const shortPathWithBrackets = baseShortPath + '[]';
412
+ chain.push(`fullToShort (base): ${basePath} → ${baseShortPath}`);
413
+ const shortMatch = findInAttributesMap(shortPathWithBrackets, attributesMap);
414
+ if (shortMatch) {
415
+ chain.push(`short match with []: ${shortMatch}`);
416
+ return {
417
+ resolvedPath: localPath,
418
+ resolutionChain: chain,
419
+ isControllable: true,
420
+ };
421
+ }
422
+ }
423
+ }
424
+ // 4. Equivalent variable resolution
425
+ const localVarName = extractLocalVariableName(localPath);
426
+ const dataSourceBase = equivalentSignatureVariables[localVarName];
427
+ if (dataSourceBase) {
428
+ chain.push(`equivalent var: ${localVarName} → ${dataSourceBase}`);
429
+ // Build the full resolved path
430
+ let fullResolvedPath = resolveCompoundPath(localPath, localVarName, dataSourceBase);
431
+ chain.push(`resolved: ${fullResolvedPath}`);
432
+ // Fix 33: Handle transitive resolution for array access patterns
433
+ // When dataSourceBase is like "segments[0]" or "segments[]", we need to resolve "segments" first
434
+ // Then combine with the array access: segments -> useParams()... + [0] or []
435
+ const arrayMatch = fullResolvedPath.match(/^([a-zA-Z_$][a-zA-Z0-9_$]*)(\[\d*\].*)$/);
436
+ if (arrayMatch) {
437
+ const baseVarName = arrayMatch[1]; // e.g., "segments"
438
+ const accessSuffix = arrayMatch[2]; // e.g., "[0]" or "[0].property"
439
+ if (baseVarName in equivalentSignatureVariables &&
440
+ baseVarName !== localVarName) {
441
+ const baseDataSource = equivalentSignatureVariables[baseVarName];
442
+ chain.push(`transitive resolution: ${baseVarName} → ${baseDataSource}`);
443
+ // Append the array access suffix to the resolved base
444
+ if (baseDataSource.endsWith('()')) {
445
+ fullResolvedPath =
446
+ baseDataSource + '.functionCallReturnValue' + accessSuffix;
447
+ }
448
+ else if (baseDataSource.endsWith('.functionCallReturnValue')) {
449
+ fullResolvedPath = baseDataSource + accessSuffix;
450
+ }
451
+ else {
452
+ fullResolvedPath = baseDataSource + accessSuffix;
453
+ }
454
+ chain.push(`transitively resolved: ${fullResolvedPath}`);
455
+ }
456
+ }
457
+ // Check if resolved path is controllable
458
+ const resolvedMatch = findInAttributesMap(fullResolvedPath, attributesMap);
459
+ if (resolvedMatch) {
460
+ chain.push(`resolved match: ${resolvedMatch}`);
461
+ return {
462
+ resolvedPath: fullResolvedPath,
463
+ resolutionChain: chain,
464
+ isControllable: true,
465
+ };
466
+ }
467
+ // Check via fullToShortMap
468
+ if (fullResolvedPath in fullToShortPathMap) {
469
+ const shortPath = fullToShortPathMap[fullResolvedPath];
470
+ chain.push(`resolved fullToShort: ${shortPath}`);
471
+ const shortMatch = findInAttributesMap(shortPath, attributesMap);
472
+ if (shortMatch) {
473
+ chain.push(`short resolved match: ${shortMatch}`);
474
+ return {
475
+ resolvedPath: fullResolvedPath,
476
+ resolutionChain: chain,
477
+ isControllable: true,
478
+ };
479
+ }
480
+ }
481
+ // Array.length resolution (after equivalent variable resolution)
482
+ // If the resolved path ends with .length and base is an array, the .length is controllable
483
+ // Fix 27: Pass fullToShortPathMap for child path resolution
484
+ const resolvedArrayBase = getArrayBaseIfLengthAccess(fullResolvedPath, attributesMap, fullToShortPathMap);
485
+ if (resolvedArrayBase) {
486
+ chain.push(`array.length: base ${resolvedArrayBase} is array type`);
487
+ return {
488
+ resolvedPath: fullResolvedPath,
489
+ resolutionChain: chain,
490
+ isControllable: true,
491
+ };
492
+ }
493
+ // Fix 34: Handle derived paths from controllable bases
494
+ // Paths like "useParams().functionCallReturnValue.*.split('/').filter(Boolean)[0]"
495
+ // are derived from "useParams().functionCallReturnValue.*" via string methods.
496
+ // If the base path is controllable, the derived path should also be controllable.
497
+ const derivedBaseResult = findControllableBaseForDerivedPath(fullResolvedPath, attributesMap);
498
+ if (derivedBaseResult) {
499
+ chain.push(`derived from controllable base: ${derivedBaseResult}`);
500
+ return {
501
+ resolvedPath: fullResolvedPath,
502
+ resolutionChain: chain,
503
+ isControllable: true,
504
+ };
505
+ }
506
+ // Fix 35: Handle nested property access on controllable paths
507
+ // When child components access nested properties like "scenarios[].metadata.screenshotPaths[]"
508
+ // but parent only has "scenarios[]" in attributesMap, the nested path should still be
509
+ // controllable since nested properties of controllable objects are also controllable.
510
+ const prefixResult = findControllablePrefix(fullResolvedPath, attributesMap, fullToShortPathMap);
511
+ if (prefixResult) {
512
+ chain.push(`nested property of controllable prefix`);
513
+ return {
514
+ resolvedPath: fullResolvedPath,
515
+ resolutionChain: chain,
516
+ isControllable: true,
517
+ };
518
+ }
519
+ }
520
+ // 5. Fix 35: Check for controllable prefix on the local path directly
521
+ // This handles cases where the localPath itself (before any resolution)
522
+ // has a controllable prefix in attributesMap
523
+ const localPrefixResult = findControllablePrefix(localPath, attributesMap, fullToShortPathMap);
524
+ if (localPrefixResult) {
525
+ chain.push(`nested property of controllable prefix (direct)`);
526
+ return {
527
+ resolvedPath: localPath,
528
+ resolutionChain: chain,
529
+ isControllable: true,
530
+ };
531
+ }
532
+ // 5b. Fix 36: Check for derived paths on localPath directly
533
+ // When localPath contains derivation methods like .filter(cyScope()), check if
534
+ // the base path (before .filter()) is controllable
535
+ const localDerivedResult = findControllableBaseForDerivedPath(localPath, attributesMap);
536
+ if (localDerivedResult) {
537
+ chain.push(`derived from controllable base (direct): ${localDerivedResult}`);
538
+ return {
539
+ resolvedPath: localPath,
540
+ resolutionChain: chain,
541
+ isControllable: true,
542
+ };
543
+ }
544
+ // 5c. Fix 36: Also check .length on derived paths directly
545
+ // E.g., scenarios.filter(cyScope()).length where scenarios[] is controllable
546
+ const localArrayBase = getArrayBaseIfLengthAccess(localPath, attributesMap, fullToShortPathMap);
547
+ if (localArrayBase) {
548
+ chain.push(`array.length on derived path: base ${localArrayBase}`);
549
+ return {
550
+ resolvedPath: localPath,
551
+ resolutionChain: chain,
552
+ isControllable: true,
553
+ };
554
+ }
555
+ // 6. Not controllable
556
+ chain.push('not controllable');
557
+ return {
558
+ resolvedPath: null,
559
+ resolutionChain: chain,
560
+ isControllable: false,
561
+ };
562
+ }
563
+ //# sourceMappingURL=resolvePathToControllable.js.map