@codeyam/codeyam-cli 0.1.0-staging.1 → 0.1.0-staging.28f73cf

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 (440) hide show
  1. package/analyzer-template/.build-info.json +7 -7
  2. package/analyzer-template/log.txt +3 -3
  3. package/analyzer-template/package.json +8 -7
  4. package/analyzer-template/packages/ai/index.ts +2 -1
  5. package/analyzer-template/packages/ai/package.json +2 -2
  6. package/analyzer-template/packages/ai/scripts/ai-test-matrix.mjs +424 -0
  7. package/analyzer-template/packages/ai/src/lib/analyzeScope.ts +24 -0
  8. package/analyzer-template/packages/ai/src/lib/astScopes/astScopeAnalyzer.ts +6 -16
  9. package/analyzer-template/packages/ai/src/lib/astScopes/methodSemantics.ts +197 -0
  10. package/analyzer-template/packages/ai/src/lib/astScopes/paths.ts +28 -2
  11. package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +127 -4
  12. package/analyzer-template/packages/ai/src/lib/checkAllAttributes.ts +1 -3
  13. package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +1821 -542
  14. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/FunctionCallManager.ts +138 -0
  15. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.ts +1 -1
  16. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.ts +139 -0
  17. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/DebugTracer.ts +224 -0
  18. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/PathManager.ts +203 -0
  19. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/README.md +294 -0
  20. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.ts +161 -0
  21. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/VisitedTracker.ts +235 -0
  22. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.ts +14 -6
  23. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/selectBestValue.ts +70 -0
  24. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/uniqueIdUtils.ts +113 -0
  25. package/analyzer-template/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.ts +36 -0
  26. package/analyzer-template/packages/ai/src/lib/generateChangesEntityDocumentation.ts +20 -2
  27. package/analyzer-template/packages/ai/src/lib/generateChangesEntityKeyAttributes.ts +51 -107
  28. package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarioData.ts +56 -160
  29. package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarios.ts +79 -265
  30. package/analyzer-template/packages/ai/src/lib/generateEntityDocumentation.ts +16 -2
  31. package/analyzer-template/packages/ai/src/lib/generateEntityKeyAttributes.ts +53 -176
  32. package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +53 -154
  33. package/analyzer-template/packages/ai/src/lib/generateEntityScenarios.ts +84 -254
  34. package/analyzer-template/packages/ai/src/lib/generateStatementAnalysis.ts +48 -71
  35. package/analyzer-template/packages/ai/src/lib/getConditionalUsagesFromCode.ts +27 -6
  36. package/analyzer-template/packages/ai/src/lib/getLLMCallStats.ts +0 -14
  37. package/analyzer-template/packages/ai/src/lib/modelInfo.ts +15 -0
  38. package/analyzer-template/packages/ai/src/lib/promptGenerators/gatherAttributesMap.ts +42 -4
  39. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChangesEntityDocumentationGenerator.ts +8 -33
  40. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.ts +54 -62
  41. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.ts +93 -109
  42. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityDocumentationGenerator.ts +8 -27
  43. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.ts +33 -38
  44. package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.ts +30 -30
  45. package/analyzer-template/packages/ai/src/lib/types/index.ts +2 -0
  46. package/analyzer-template/packages/ai/src/lib/worker/SerializableDataStructure.ts +39 -0
  47. package/analyzer-template/packages/analyze/src/lib/FileAnalyzer.ts +52 -6
  48. package/analyzer-template/packages/analyze/src/lib/asts/nodes/index.ts +2 -1
  49. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.ts +238 -0
  50. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getDeclaredEntityNode.ts +25 -0
  51. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/index.ts +2 -0
  52. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +8 -10
  53. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +6 -1
  54. package/analyzer-template/packages/analyze/src/lib/files/analyze/gatherEntityMap.ts +8 -6
  55. package/analyzer-template/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.ts +5 -13
  56. package/analyzer-template/packages/analyze/src/lib/files/analyzeChange.ts +34 -15
  57. package/analyzer-template/packages/analyze/src/lib/files/analyzeEntity.ts +17 -3
  58. package/analyzer-template/packages/analyze/src/lib/files/analyzeInitial.ts +35 -16
  59. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +7 -1
  60. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.ts +9 -1
  61. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarioData.ts +6 -1
  62. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarios.ts +9 -1
  63. package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +15 -7
  64. package/analyzer-template/packages/aws/dist/src/lib/s3/getPresignedUrl.d.ts +23 -0
  65. package/analyzer-template/packages/aws/dist/src/lib/s3/getPresignedUrl.d.ts.map +1 -0
  66. package/analyzer-template/packages/aws/dist/src/lib/s3/getPresignedUrl.js +30 -0
  67. package/analyzer-template/packages/aws/dist/src/lib/s3/getPresignedUrl.js.map +1 -0
  68. package/analyzer-template/packages/aws/package.json +5 -4
  69. package/analyzer-template/packages/aws/s3/index.ts +4 -0
  70. package/analyzer-template/packages/aws/src/lib/s3/getPresignedUrl.ts +62 -0
  71. package/analyzer-template/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.ts +28 -21
  72. package/analyzer-template/packages/generate/src/lib/componentScenarioPage/componentScenarioPageRemix.ts +18 -11
  73. package/analyzer-template/packages/generate/src/lib/scenarioComponent.ts +6 -3
  74. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.d.ts.map +1 -1
  75. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js +28 -21
  76. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js.map +1 -1
  77. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageRemix.d.ts.map +1 -1
  78. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageRemix.js +18 -11
  79. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageRemix.js.map +1 -1
  80. package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponent.d.ts.map +1 -1
  81. package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponent.js +5 -3
  82. package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponent.js.map +1 -1
  83. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/db.d.ts +2 -0
  84. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/db.d.ts.map +1 -1
  85. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/db.js +3 -0
  86. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/db.js.map +1 -1
  87. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tableRelations.d.ts +2 -0
  88. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tableRelations.d.ts.map +1 -1
  89. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tables/debugReportsTable.d.ts +37 -0
  90. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tables/debugReportsTable.d.ts.map +1 -0
  91. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tables/debugReportsTable.js +27 -0
  92. package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tables/debugReportsTable.js.map +1 -0
  93. package/analyzer-template/packages/github/dist/utils/index.d.ts +2 -0
  94. package/analyzer-template/packages/github/dist/utils/index.d.ts.map +1 -1
  95. package/analyzer-template/packages/github/dist/utils/index.js +2 -0
  96. package/analyzer-template/packages/github/dist/utils/index.js.map +1 -1
  97. package/analyzer-template/packages/github/dist/utils/src/lib/Semaphore.d.ts +25 -0
  98. package/analyzer-template/packages/github/dist/utils/src/lib/Semaphore.d.ts.map +1 -0
  99. package/analyzer-template/packages/github/dist/utils/src/lib/Semaphore.js +40 -0
  100. package/analyzer-template/packages/github/dist/utils/src/lib/Semaphore.js.map +1 -0
  101. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getNextRoutePath.d.ts.map +1 -1
  102. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getNextRoutePath.js +5 -3
  103. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getNextRoutePath.js.map +1 -1
  104. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getRemixRoutePath.d.ts.map +1 -1
  105. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getRemixRoutePath.js +2 -1
  106. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getRemixRoutePath.js.map +1 -1
  107. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/nextRouteFileNameToRoute.d.ts.map +1 -1
  108. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/nextRouteFileNameToRoute.js +2 -1
  109. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/nextRouteFileNameToRoute.js.map +1 -1
  110. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.d.ts.map +1 -1
  111. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.js +1 -0
  112. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.js.map +1 -1
  113. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/sanitizeNextRouteSegments.d.ts +12 -0
  114. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/sanitizeNextRouteSegments.d.ts.map +1 -0
  115. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/sanitizeNextRouteSegments.js +32 -0
  116. package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/sanitizeNextRouteSegments.js.map +1 -0
  117. package/analyzer-template/packages/supabase/src/lib/kysely/db.ts +6 -0
  118. package/analyzer-template/packages/supabase/src/lib/kysely/tableRelations.ts +3 -0
  119. package/analyzer-template/packages/supabase/src/lib/kysely/tables/debugReportsTable.ts +61 -0
  120. package/analyzer-template/packages/ui-components/src/scenario-editor/components/DataItemEditor.tsx +1 -1
  121. package/analyzer-template/packages/utils/dist/utils/index.d.ts +2 -0
  122. package/analyzer-template/packages/utils/dist/utils/index.d.ts.map +1 -1
  123. package/analyzer-template/packages/utils/dist/utils/index.js +2 -0
  124. package/analyzer-template/packages/utils/dist/utils/index.js.map +1 -1
  125. package/analyzer-template/packages/utils/dist/utils/src/lib/Semaphore.d.ts +25 -0
  126. package/analyzer-template/packages/utils/dist/utils/src/lib/Semaphore.d.ts.map +1 -0
  127. package/analyzer-template/packages/utils/dist/utils/src/lib/Semaphore.js +40 -0
  128. package/analyzer-template/packages/utils/dist/utils/src/lib/Semaphore.js.map +1 -0
  129. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getNextRoutePath.d.ts.map +1 -1
  130. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getNextRoutePath.js +5 -3
  131. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getNextRoutePath.js.map +1 -1
  132. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getRemixRoutePath.d.ts.map +1 -1
  133. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getRemixRoutePath.js +2 -1
  134. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getRemixRoutePath.js.map +1 -1
  135. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/nextRouteFileNameToRoute.d.ts.map +1 -1
  136. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/nextRouteFileNameToRoute.js +2 -1
  137. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/nextRouteFileNameToRoute.js.map +1 -1
  138. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.d.ts.map +1 -1
  139. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.js +1 -0
  140. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.js.map +1 -1
  141. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/sanitizeNextRouteSegments.d.ts +12 -0
  142. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/sanitizeNextRouteSegments.d.ts.map +1 -0
  143. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/sanitizeNextRouteSegments.js +32 -0
  144. package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/sanitizeNextRouteSegments.js.map +1 -0
  145. package/analyzer-template/packages/utils/index.ts +2 -0
  146. package/analyzer-template/packages/utils/src/lib/Semaphore.ts +42 -0
  147. package/analyzer-template/packages/utils/src/lib/frameworks/getNextRoutePath.ts +8 -3
  148. package/analyzer-template/packages/utils/src/lib/frameworks/getRemixRoutePath.ts +2 -1
  149. package/analyzer-template/packages/utils/src/lib/frameworks/nextRouteFileNameToRoute.ts +2 -1
  150. package/analyzer-template/packages/utils/src/lib/frameworks/remixRouteFileNameToRoute.ts +1 -0
  151. package/analyzer-template/packages/utils/src/lib/frameworks/sanitizeNextRouteSegments.ts +33 -0
  152. package/analyzer-template/project/constructMockCode.ts +170 -6
  153. package/analyzer-template/project/reconcileMockDataKeys.ts +13 -0
  154. package/analyzer-template/project/start.ts +1 -11
  155. package/analyzer-template/project/startScenarioCapture.ts +24 -0
  156. package/analyzer-template/project/trackGeneratedFiles.ts +41 -0
  157. package/analyzer-template/project/writeMockDataTsx.ts +125 -4
  158. package/analyzer-template/project/writeScenarioComponents.ts +199 -45
  159. package/analyzer-template/project/writeUniversalMocks.ts +72 -10
  160. package/background/src/lib/virtualized/project/constructMockCode.js +158 -7
  161. package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
  162. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js +12 -0
  163. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js.map +1 -1
  164. package/background/src/lib/virtualized/project/start.js +1 -8
  165. package/background/src/lib/virtualized/project/start.js.map +1 -1
  166. package/background/src/lib/virtualized/project/startScenarioCapture.js +18 -0
  167. package/background/src/lib/virtualized/project/startScenarioCapture.js.map +1 -1
  168. package/background/src/lib/virtualized/project/trackGeneratedFiles.js +30 -0
  169. package/background/src/lib/virtualized/project/trackGeneratedFiles.js.map +1 -0
  170. package/background/src/lib/virtualized/project/writeMockDataTsx.js +95 -3
  171. package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
  172. package/background/src/lib/virtualized/project/writeScenarioComponents.js +144 -28
  173. package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
  174. package/background/src/lib/virtualized/project/writeUniversalMocks.js +59 -9
  175. package/background/src/lib/virtualized/project/writeUniversalMocks.js.map +1 -1
  176. package/codeyam-cli/scripts/apply-setup.js +288 -0
  177. package/codeyam-cli/scripts/apply-setup.js.map +1 -0
  178. package/codeyam-cli/scripts/extract-setup.js +130 -0
  179. package/codeyam-cli/scripts/extract-setup.js.map +1 -0
  180. package/codeyam-cli/scripts/fixtures/cal.com/universal-mocks/packages/prisma/index.js +238 -0
  181. package/codeyam-cli/scripts/fixtures/cal.com/universal-mocks/packages/prisma/index.js.map +1 -0
  182. package/codeyam-cli/src/cli.js +6 -0
  183. package/codeyam-cli/src/cli.js.map +1 -1
  184. package/codeyam-cli/src/codeyam-cli.js +0 -0
  185. package/codeyam-cli/src/commands/debug.js +221 -0
  186. package/codeyam-cli/src/commands/debug.js.map +1 -0
  187. package/codeyam-cli/src/commands/init.js +4 -23
  188. package/codeyam-cli/src/commands/init.js.map +1 -1
  189. package/codeyam-cli/src/commands/report.js +102 -0
  190. package/codeyam-cli/src/commands/report.js.map +1 -0
  191. package/codeyam-cli/src/commands/setup-sandbox.js +164 -0
  192. package/codeyam-cli/src/commands/setup-sandbox.js.map +1 -0
  193. package/codeyam-cli/src/utils/__tests__/cleanupAnalysisFiles.test.js +6 -6
  194. package/codeyam-cli/src/utils/__tests__/cleanupAnalysisFiles.test.js.map +1 -1
  195. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +8 -0
  196. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
  197. package/codeyam-cli/src/utils/analysisRunner.js +4 -3
  198. package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
  199. package/codeyam-cli/src/utils/analyzer.js +30 -0
  200. package/codeyam-cli/src/utils/analyzer.js.map +1 -1
  201. package/codeyam-cli/src/utils/backgroundServer.js +25 -5
  202. package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
  203. package/codeyam-cli/src/utils/cleanupAnalysisFiles.js +2 -2
  204. package/codeyam-cli/src/utils/cleanupAnalysisFiles.js.map +1 -1
  205. package/codeyam-cli/src/utils/fileWatcher.js +75 -5
  206. package/codeyam-cli/src/utils/fileWatcher.js.map +1 -1
  207. package/codeyam-cli/src/utils/generateReport.js +219 -0
  208. package/codeyam-cli/src/utils/generateReport.js.map +1 -0
  209. package/codeyam-cli/src/utils/install-skills.js +7 -0
  210. package/codeyam-cli/src/utils/install-skills.js.map +1 -1
  211. package/codeyam-cli/src/utils/queue/__tests__/job.pidTracking.test.js +1 -0
  212. package/codeyam-cli/src/utils/queue/__tests__/job.pidTracking.test.js.map +1 -1
  213. package/codeyam-cli/src/utils/queue/job.js +8 -3
  214. package/codeyam-cli/src/utils/queue/job.js.map +1 -1
  215. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +4 -0
  216. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
  217. package/codeyam-cli/src/utils/webappDetection.js +2 -1
  218. package/codeyam-cli/src/utils/webappDetection.js.map +1 -1
  219. package/codeyam-cli/src/webserver/app/lib/database.js +63 -2
  220. package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
  221. package/codeyam-cli/src/webserver/backgroundServer.js +15 -35
  222. package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
  223. package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-D5ZHFomX.js +1 -0
  224. package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-Dh-FldQK.js → InteractivePreview-XDSzQLOY.js} +3 -3
  225. package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-BYVx9KFp.js +3 -0
  226. package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-Dp6DC845.js → LogViewer-CRcT5fOZ.js} +1 -1
  227. package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-BORLgi0X.js +1 -0
  228. package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-Bual6h18.js +1 -0
  229. package/codeyam-cli/src/webserver/build/client/assets/ScenarioPreview-Bi-YUMa-.js +6 -0
  230. package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-4D2vLLJz.js +5 -0
  231. package/codeyam-cli/src/webserver/build/client/assets/_index-BC200mfN.js +1 -0
  232. package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-CxvZPkCv.js +10 -0
  233. package/codeyam-cli/src/webserver/build/client/assets/api.generate-report-l0sNRNKZ.js +1 -0
  234. package/codeyam-cli/src/webserver/build/client/assets/{chart-column-B2I7jQx2.js → chart-column-B8fb6wnw.js} +1 -1
  235. package/codeyam-cli/src/webserver/build/client/assets/chunk-WWGJGFF6-De6i8FUT.js +26 -0
  236. package/codeyam-cli/src/webserver/build/client/assets/{circle-alert-GwwOAbhw.js → circle-alert-IdsgAK39.js} +1 -1
  237. package/codeyam-cli/src/webserver/build/client/assets/circle-check-BACUUf75.js +1 -0
  238. package/codeyam-cli/src/webserver/build/client/assets/clock-vWeoCemX.js +1 -0
  239. package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-CS7XDrKv.js +1 -0
  240. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-DIOEw_3i.js +1 -0
  241. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-1Z6D0fLM.js → entity._sha._-8Els_3Wb.js} +10 -10
  242. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-C3FZJx1w.js +1 -0
  243. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.edit._scenarioId-YJz_igar.js +5 -0
  244. package/codeyam-cli/src/webserver/build/client/assets/entityStatus-BEqj2qBy.js +1 -0
  245. package/codeyam-cli/src/webserver/build/client/assets/{entityVersioning-DO2gCvXv.js → entityVersioning-Bk_YB1jM.js} +1 -1
  246. package/codeyam-cli/src/webserver/build/client/assets/entry.client-DiP0q291.js +5 -0
  247. package/codeyam-cli/src/webserver/build/client/assets/file-text-LM0mgxXE.js +1 -0
  248. package/codeyam-cli/src/webserver/build/client/assets/files-Dxh9CcaV.js +1 -0
  249. package/codeyam-cli/src/webserver/build/client/assets/git-BXmqrWCH.js +12 -0
  250. package/codeyam-cli/src/webserver/build/client/assets/globals-BGS74ED-.css +1 -0
  251. package/codeyam-cli/src/webserver/build/client/assets/html2canvas-pro.esm-XQCGvadH.js +5 -0
  252. package/codeyam-cli/src/webserver/build/client/assets/index-D-zYbzFZ.js +8 -0
  253. package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-DN7Vr40D.js → loader-circle-BXPKbHEb.js} +1 -1
  254. package/codeyam-cli/src/webserver/build/client/assets/manifest-1af162d4.js +1 -0
  255. package/codeyam-cli/src/webserver/build/client/assets/root-DB7VgjCY.js +16 -0
  256. package/codeyam-cli/src/webserver/build/client/assets/{settings-MZc4XdmE.js → settings-5zF_GOcS.js} +1 -1
  257. package/codeyam-cli/src/webserver/build/client/assets/settings-Dc4MlMpK.js +1 -0
  258. package/codeyam-cli/src/webserver/build/client/assets/simulations-BQ-02-jB.js +1 -0
  259. package/codeyam-cli/src/webserver/build/client/assets/triangle-alert-D7k-ArFa.js +1 -0
  260. package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-BBlyqxij.js → useLastLogLine-AlhS7g5F.js} +1 -1
  261. package/codeyam-cli/src/webserver/build/client/assets/useToast-Ddo4UQv7.js +1 -0
  262. package/codeyam-cli/src/webserver/build/client/assets/{zap-B4gsLUZQ.js → zap-_jw-9DCp.js} +1 -1
  263. package/codeyam-cli/src/webserver/build/server/assets/index-D4JpXSIO.js +1 -0
  264. package/codeyam-cli/src/webserver/build/server/assets/server-build-vwbN7n65.js +169 -0
  265. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  266. package/codeyam-cli/src/webserver/build-info.json +5 -5
  267. package/codeyam-cli/src/webserver/server.js +1 -1
  268. package/codeyam-cli/src/webserver/server.js.map +1 -1
  269. package/codeyam-cli/templates/codeyam-setup-skill.md +85 -94
  270. package/codeyam-cli/templates/debug-command.md +125 -0
  271. package/package.json +9 -11
  272. package/packages/ai/index.js +1 -2
  273. package/packages/ai/index.js.map +1 -1
  274. package/packages/ai/src/lib/analyzeScope.js +13 -0
  275. package/packages/ai/src/lib/analyzeScope.js.map +1 -1
  276. package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js +6 -15
  277. package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js.map +1 -1
  278. package/packages/ai/src/lib/astScopes/methodSemantics.js +134 -0
  279. package/packages/ai/src/lib/astScopes/methodSemantics.js.map +1 -1
  280. package/packages/ai/src/lib/astScopes/paths.js +28 -3
  281. package/packages/ai/src/lib/astScopes/paths.js.map +1 -1
  282. package/packages/ai/src/lib/astScopes/processExpression.js +111 -3
  283. package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
  284. package/packages/ai/src/lib/checkAllAttributes.js +1 -3
  285. package/packages/ai/src/lib/checkAllAttributes.js.map +1 -1
  286. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +1320 -396
  287. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
  288. package/packages/ai/src/lib/dataStructure/equivalencyManagers/FunctionCallManager.js +137 -1
  289. package/packages/ai/src/lib/dataStructure/equivalencyManagers/FunctionCallManager.js.map +1 -1
  290. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js +1 -1
  291. package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js.map +1 -1
  292. package/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.js +112 -0
  293. package/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.js.map +1 -0
  294. package/packages/ai/src/lib/dataStructure/helpers/DebugTracer.js +176 -0
  295. package/packages/ai/src/lib/dataStructure/helpers/DebugTracer.js.map +1 -0
  296. package/packages/ai/src/lib/dataStructure/helpers/PathManager.js +178 -0
  297. package/packages/ai/src/lib/dataStructure/helpers/PathManager.js.map +1 -0
  298. package/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.js +138 -0
  299. package/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.js.map +1 -0
  300. package/packages/ai/src/lib/dataStructure/helpers/VisitedTracker.js +199 -0
  301. package/packages/ai/src/lib/dataStructure/helpers/VisitedTracker.js.map +1 -0
  302. package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js +14 -6
  303. package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js.map +1 -1
  304. package/packages/ai/src/lib/dataStructure/helpers/selectBestValue.js +62 -0
  305. package/packages/ai/src/lib/dataStructure/helpers/selectBestValue.js.map +1 -0
  306. package/packages/ai/src/lib/dataStructure/helpers/uniqueIdUtils.js +90 -0
  307. package/packages/ai/src/lib/dataStructure/helpers/uniqueIdUtils.js.map +1 -0
  308. package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js +22 -0
  309. package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js.map +1 -1
  310. package/packages/ai/src/lib/generateChangesEntityDocumentation.js +19 -1
  311. package/packages/ai/src/lib/generateChangesEntityDocumentation.js.map +1 -1
  312. package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js +51 -107
  313. package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js.map +1 -1
  314. package/packages/ai/src/lib/generateChangesEntityScenarioData.js +55 -156
  315. package/packages/ai/src/lib/generateChangesEntityScenarioData.js.map +1 -1
  316. package/packages/ai/src/lib/generateChangesEntityScenarios.js +79 -262
  317. package/packages/ai/src/lib/generateChangesEntityScenarios.js.map +1 -1
  318. package/packages/ai/src/lib/generateEntityDocumentation.js +15 -1
  319. package/packages/ai/src/lib/generateEntityDocumentation.js.map +1 -1
  320. package/packages/ai/src/lib/generateEntityKeyAttributes.js +53 -176
  321. package/packages/ai/src/lib/generateEntityKeyAttributes.js.map +1 -1
  322. package/packages/ai/src/lib/generateEntityScenarioData.js +52 -152
  323. package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
  324. package/packages/ai/src/lib/generateEntityScenarios.js +88 -258
  325. package/packages/ai/src/lib/generateEntityScenarios.js.map +1 -1
  326. package/packages/ai/src/lib/generateStatementAnalysis.js +46 -71
  327. package/packages/ai/src/lib/generateStatementAnalysis.js.map +1 -1
  328. package/packages/ai/src/lib/getConditionalUsagesFromCode.js +13 -8
  329. package/packages/ai/src/lib/getConditionalUsagesFromCode.js.map +1 -1
  330. package/packages/ai/src/lib/getLLMCallStats.js +0 -14
  331. package/packages/ai/src/lib/getLLMCallStats.js.map +1 -1
  332. package/packages/ai/src/lib/modelInfo.js +15 -0
  333. package/packages/ai/src/lib/modelInfo.js.map +1 -1
  334. package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js +36 -3
  335. package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js.map +1 -1
  336. package/packages/ai/src/lib/promptGenerators/generateChangesEntityDocumentationGenerator.js +8 -33
  337. package/packages/ai/src/lib/promptGenerators/generateChangesEntityDocumentationGenerator.js.map +1 -1
  338. package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.js +35 -41
  339. package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.js.map +1 -1
  340. package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js +59 -72
  341. package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js.map +1 -1
  342. package/packages/ai/src/lib/promptGenerators/generateEntityDocumentationGenerator.js +8 -27
  343. package/packages/ai/src/lib/promptGenerators/generateEntityDocumentationGenerator.js.map +1 -1
  344. package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js +24 -27
  345. package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js.map +1 -1
  346. package/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.js +21 -22
  347. package/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.js.map +1 -1
  348. package/packages/ai/src/lib/types/index.js +2 -0
  349. package/packages/ai/src/lib/types/index.js.map +1 -1
  350. package/packages/ai/src/lib/worker/SerializableDataStructure.js +7 -0
  351. package/packages/ai/src/lib/worker/SerializableDataStructure.js.map +1 -1
  352. package/packages/analyze/src/lib/FileAnalyzer.js +45 -5
  353. package/packages/analyze/src/lib/FileAnalyzer.js.map +1 -1
  354. package/packages/analyze/src/lib/asts/nodes/index.js +2 -1
  355. package/packages/analyze/src/lib/asts/nodes/index.js.map +1 -1
  356. package/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.js +191 -0
  357. package/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.js.map +1 -0
  358. package/packages/analyze/src/lib/asts/sourceFiles/getDeclaredEntityNode.js +16 -0
  359. package/packages/analyze/src/lib/asts/sourceFiles/getDeclaredEntityNode.js.map +1 -0
  360. package/packages/analyze/src/lib/asts/sourceFiles/index.js +2 -0
  361. package/packages/analyze/src/lib/asts/sourceFiles/index.js.map +1 -1
  362. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +6 -8
  363. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
  364. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +5 -1
  365. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
  366. package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js +8 -2
  367. package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js.map +1 -1
  368. package/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.js +5 -8
  369. package/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.js.map +1 -1
  370. package/packages/analyze/src/lib/files/analyzeChange.js +21 -9
  371. package/packages/analyze/src/lib/files/analyzeChange.js.map +1 -1
  372. package/packages/analyze/src/lib/files/analyzeEntity.js +10 -4
  373. package/packages/analyze/src/lib/files/analyzeEntity.js.map +1 -1
  374. package/packages/analyze/src/lib/files/analyzeInitial.js +21 -9
  375. package/packages/analyze/src/lib/files/analyzeInitial.js.map +1 -1
  376. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +6 -1
  377. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
  378. package/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.js +9 -1
  379. package/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.js.map +1 -1
  380. package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js +5 -1
  381. package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js.map +1 -1
  382. package/packages/analyze/src/lib/files/scenarios/generateScenarios.js +9 -1
  383. package/packages/analyze/src/lib/files/scenarios/generateScenarios.js.map +1 -1
  384. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +16 -7
  385. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
  386. package/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js +28 -21
  387. package/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js.map +1 -1
  388. package/packages/generate/src/lib/componentScenarioPage/componentScenarioPageRemix.js +18 -11
  389. package/packages/generate/src/lib/componentScenarioPage/componentScenarioPageRemix.js.map +1 -1
  390. package/packages/generate/src/lib/scenarioComponent.js +5 -3
  391. package/packages/generate/src/lib/scenarioComponent.js.map +1 -1
  392. package/packages/supabase/src/lib/kysely/db.js +3 -0
  393. package/packages/supabase/src/lib/kysely/db.js.map +1 -1
  394. package/packages/supabase/src/lib/kysely/tables/debugReportsTable.js +27 -0
  395. package/packages/supabase/src/lib/kysely/tables/debugReportsTable.js.map +1 -0
  396. package/packages/utils/index.js +2 -0
  397. package/packages/utils/index.js.map +1 -1
  398. package/packages/utils/src/lib/Semaphore.js +40 -0
  399. package/packages/utils/src/lib/Semaphore.js.map +1 -0
  400. package/packages/utils/src/lib/frameworks/getNextRoutePath.js +5 -3
  401. package/packages/utils/src/lib/frameworks/getNextRoutePath.js.map +1 -1
  402. package/packages/utils/src/lib/frameworks/getRemixRoutePath.js +2 -1
  403. package/packages/utils/src/lib/frameworks/getRemixRoutePath.js.map +1 -1
  404. package/packages/utils/src/lib/frameworks/nextRouteFileNameToRoute.js +2 -1
  405. package/packages/utils/src/lib/frameworks/nextRouteFileNameToRoute.js.map +1 -1
  406. package/packages/utils/src/lib/frameworks/remixRouteFileNameToRoute.js +1 -0
  407. package/packages/utils/src/lib/frameworks/remixRouteFileNameToRoute.js.map +1 -1
  408. package/packages/utils/src/lib/frameworks/sanitizeNextRouteSegments.js +32 -0
  409. package/packages/utils/src/lib/frameworks/sanitizeNextRouteSegments.js.map +1 -0
  410. package/analyzer-template/packages/ai/src/lib/generateEntityDataMap.ts +0 -375
  411. package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-GqWwt5wG.js +0 -1
  412. package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-p0fuyqGQ.js +0 -3
  413. package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-xwuhwsZH.js +0 -1
  414. package/codeyam-cli/src/webserver/build/client/assets/ScenarioPreview-Bl2IRh55.js +0 -1
  415. package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-M2QuSHKC.js +0 -5
  416. package/codeyam-cli/src/webserver/build/client/assets/_index-CAVtep9Q.js +0 -1
  417. package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-CLmzsLsT.js +0 -10
  418. package/codeyam-cli/src/webserver/build/client/assets/components-CAx5ONX_.js +0 -40
  419. package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-CgyOwWip.js +0 -1
  420. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-DGy3zrli.js +0 -1
  421. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-ChAdTrrU.js +0 -1
  422. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.edit._scenarioId-D9L7267w.js +0 -5
  423. package/codeyam-cli/src/webserver/build/client/assets/entry.client-C6FRgjPr.js +0 -1
  424. package/codeyam-cli/src/webserver/build/client/assets/files-C3-cQjgv.js +0 -1
  425. package/codeyam-cli/src/webserver/build/client/assets/git-Dp4EB9nv.js +0 -12
  426. package/codeyam-cli/src/webserver/build/client/assets/globals-Da3jt49-.css +0 -1
  427. package/codeyam-cli/src/webserver/build/client/assets/manifest-172a4629.js +0 -1
  428. package/codeyam-cli/src/webserver/build/client/assets/root-COyVTsPq.js +0 -16
  429. package/codeyam-cli/src/webserver/build/client/assets/search-CvyP_1Lo.js +0 -1
  430. package/codeyam-cli/src/webserver/build/client/assets/settings-Hbf8b7J_.js +0 -1
  431. package/codeyam-cli/src/webserver/build/client/assets/simulations-BMBi0VzO.js +0 -1
  432. package/codeyam-cli/src/webserver/build/client/assets/useToast-C_VxoXTh.js +0 -1
  433. package/codeyam-cli/src/webserver/build/client/cy-logo-cli.svg +0 -13
  434. package/codeyam-cli/src/webserver/build/server/assets/index-eAULANMV.js +0 -1
  435. package/codeyam-cli/src/webserver/build/server/assets/server-build-lutv16q5.js +0 -161
  436. package/codeyam-cli/src/webserver/public/cy-logo-cli.svg +0 -13
  437. package/packages/ai/src/lib/generateEntityDataMap.js +0 -335
  438. package/packages/ai/src/lib/generateEntityDataMap.js.map +0 -1
  439. package/packages/ai/src/lib/promptGenerators/generateEntityDataMapGenerator.js +0 -17
  440. package/packages/ai/src/lib/promptGenerators/generateEntityDataMapGenerator.js.map +0 -1
@@ -259,8 +259,16 @@ function getLiteralValue(expr: ts.Expression): string | undefined {
259
259
  /**
260
260
  * Format conditional usages into a string for the LLM prompt
261
261
  */
262
+ /**
263
+ * Interface for conditional usages that may have source tracing information.
264
+ * This is a superset of ConditionalUsage that includes optional sourceDataPath.
265
+ */
266
+ interface EnrichedConditionalUsageInput extends ConditionalUsage {
267
+ sourceDataPath?: string;
268
+ }
269
+
262
270
  export function formatConditionalUsagesForPrompt(
263
- conditionalUsages: Record<string, ConditionalUsage[]>,
271
+ conditionalUsages: Record<string, EnrichedConditionalUsageInput[]>,
264
272
  ): string {
265
273
  const entries = Object.entries(conditionalUsages);
266
274
  if (entries.length === 0) {
@@ -270,7 +278,7 @@ export function formatConditionalUsagesForPrompt(
270
278
  const lines: string[] = [
271
279
  '\n## Static Analysis: Attributes Used in Conditionals',
272
280
  '',
273
- 'The following attributes were found to be used in conditional statements, making them potential key attributes:',
281
+ 'The following attributes were found to be used in conditional statements, making them very likely key attributes:',
274
282
  '',
275
283
  ];
276
284
 
@@ -281,20 +289,30 @@ export function formatConditionalUsagesForPrompt(
281
289
  .flatMap((u) => u.comparedValues || []);
282
290
  const uniqueValues = [...new Set(allComparedValues)];
283
291
 
284
- let description = `- "${path}": `;
292
+ // Get the source data path if available (traced back to data source)
293
+ const sourceDataPath = usages.find((u) => u.sourceDataPath)?.sourceDataPath;
294
+
295
+ let description = `- "${path}"`;
296
+
297
+ // If we have a source data path, show that the local variable derives from a data source
298
+ if (sourceDataPath) {
299
+ description += `\n - Source: "${sourceDataPath}"`;
300
+ }
301
+
302
+ description += '\n - ';
285
303
 
286
304
  if (uniqueTypes.includes('switch')) {
287
- description += 'used as switch discriminant';
305
+ description += 'Used as switch discriminant';
288
306
  if (uniqueValues.length > 0) {
289
307
  description += ` with cases: ${uniqueValues.map((v) => `"${v}"`).join(', ')}`;
290
308
  }
291
309
  } else if (uniqueTypes.includes('comparison')) {
292
- description += 'used in comparison';
310
+ description += 'Used in comparison';
293
311
  if (uniqueValues.length > 0) {
294
312
  description += ` against values: ${uniqueValues.map((v) => `"${v}"`).join(', ')}`;
295
313
  }
296
314
  } else {
297
- description += 'used in truthiness check (presence/absence matters)';
315
+ description += 'Used in truthiness check (presence/absence matters)';
298
316
  }
299
317
 
300
318
  lines.push(description);
@@ -304,6 +322,9 @@ export function formatConditionalUsagesForPrompt(
304
322
  lines.push(
305
323
  'Consider these attributes as candidates for key attributes, especially those with specific comparison values.',
306
324
  );
325
+ lines.push(
326
+ 'When a local variable derives from a data source, the data source is the key attribute.',
327
+ );
307
328
 
308
329
  return lines.join('\n');
309
330
  }
@@ -2,13 +2,6 @@ import OpenAI from 'openai';
2
2
  import { getLLMCallCost } from './getLLMCallCost';
3
3
  import { AI, LlmCallStats } from './types';
4
4
 
5
- /**
6
- * It looks like this function can be massively simplified, and I (AG) think
7
- * that we aren't using openrouter anymore. But, until this is figured out, it
8
- * might not be worth refactoring and messing something subtle up. Ideally
9
- * whatever implicit functionality is in here can be represented in the new
10
- * `getLLMCallStats` such that this get replaced by it.
11
- */
12
5
  export function getLLMCallStats({
13
6
  chatRequest,
14
7
  chatCompletion,
@@ -28,13 +21,6 @@ export function getLLMCallStats({
28
21
  error: JSON.stringify(chatCompletion.error),
29
22
  };
30
23
  }
31
- if (!chatRequest.model) {
32
- // this was previously used to indicate openrouter calls, but we aren't
33
- // doing that anymore and anyway it was a pretty obscure way to indicate
34
- // that state of affairs. if we bring multi-provider back, we will want
35
- // to rewrite a fair bit of this.
36
- return null;
37
- }
38
24
 
39
25
  const usage = chatCompletion.usage || {
40
26
  prompt_tokens: 0,
@@ -27,6 +27,14 @@ export interface ModelInfo {
27
27
 
28
28
  export const MODEL_INFO: Record<AI.Model, ModelInfo> = {
29
29
  // OpenAI models - served directly by OpenAI
30
+ [AI.Model.OPENAI_GPT5_1]: {
31
+ id: AI.Model.OPENAI_GPT5_1,
32
+ provider: OPENAI_PROVIDER,
33
+ apiModelName: 'gpt-5.1',
34
+ maxCompletionTokens: 128000,
35
+ pricing: { input: 1.25, output: 10.0 },
36
+ reasoningEffort: 'none',
37
+ },
30
38
  [AI.Model.OPENAI_GPT5]: {
31
39
  id: AI.Model.OPENAI_GPT5,
32
40
  provider: OPENAI_PROVIDER,
@@ -175,6 +183,13 @@ export const MODEL_INFO: Record<AI.Model, ModelInfo> = {
175
183
  maxCompletionTokens: 200000,
176
184
  pricing: { input: 3.0, output: 15.0 },
177
185
  },
186
+ [AI.Model.ANTHROPIC_CLAUDE_4_5_OPUS]: {
187
+ id: AI.Model.ANTHROPIC_CLAUDE_4_5_OPUS,
188
+ provider: ANTHROPIC_PROVIDER,
189
+ apiModelName: 'claude-opus-4-5',
190
+ maxCompletionTokens: 200000,
191
+ pricing: { input: 5.0, output: 25.0 },
192
+ },
178
193
 
179
194
  // Deprecated models (kept for backward compatibility)
180
195
  [AI.Model.PHIND_CODELLAMA]: {
@@ -5,9 +5,44 @@ import {
5
5
  splitOutsideParenthesesAndArrays,
6
6
  } from '../splitOutsideParentheses';
7
7
 
8
+ /**
9
+ * Checks if a bracket-only path is a valid string key access (not just an index).
10
+ * Valid: ['*'], ['someKey'] - string key access
11
+ * Invalid: [0], [1] - numeric index only (meaningless without parent path)
12
+ */
13
+ function isValidBracketStringKey(attribute: string): boolean {
14
+ // Match ['string'] or ["string"] patterns
15
+ return /^\[['"][^'"]+['"]\]$/.test(attribute);
16
+ }
17
+
18
+ /**
19
+ * Extracts the string key from a bracket notation like ['*'] or ["key"]
20
+ * Returns the key without quotes and brackets, e.g., '*' or 'key'
21
+ */
22
+ function extractBracketStringKey(attribute: string): string | null {
23
+ const match = attribute.match(/^\[['"]([^'"]+)['"]\]$/);
24
+ return match ? match[1] : null;
25
+ }
26
+
27
+ /**
28
+ * Normalizes a path by extracting string keys from bracket notation.
29
+ * If the path is a single bracket string key like ['*'], returns the key ('*').
30
+ * Otherwise returns the path unchanged.
31
+ */
32
+ function normalizePathForInternalUse(path: string): string {
33
+ const extracted = extractBracketStringKey(path);
34
+ return extracted !== null ? extracted : path;
35
+ }
36
+
8
37
  function validAttribute(attribute: string) {
9
- if (!attribute || attribute.length === 0 || attribute.startsWith('['))
10
- return false;
38
+ if (!attribute || attribute.length === 0) return false;
39
+
40
+ // Allow string-key bracket access like ['*'] or ['someKey']
41
+ // These are valid data paths from objects with dynamic/special keys
42
+ if (attribute.startsWith('[')) {
43
+ return isValidBracketStringKey(attribute);
44
+ }
45
+
11
46
  const attributeParts = splitOutsideParenthesesAndArrays(attribute);
12
47
  if (
13
48
  attributeParts.some((part) =>
@@ -153,8 +188,11 @@ export function gatherAttributesMap(
153
188
  // Fall through to normal processing for other return value properties
154
189
  }
155
190
 
156
- const relativePath = joinParenthesesAndArrays(pathParts.slice(2));
157
- if (!validAttribute(relativePath)) continue;
191
+ const rawRelativePath = joinParenthesesAndArrays(pathParts.slice(2));
192
+ if (!validAttribute(rawRelativePath)) continue;
193
+
194
+ // Normalize the path for internal use (e.g., ['*'] -> '*')
195
+ const relativePath = normalizePathForInternalUse(rawRelativePath);
158
196
 
159
197
  attributesMap[relativePath] = returnValueDataStructure[path];
160
198
  associationMap[reverse ? relativePath : path] = reverse
@@ -4,44 +4,19 @@ export default function generateChangesEntityDocumentationGenerator(
4
4
  entity: Entity,
5
5
  previousDocumentation: string,
6
6
  ) {
7
- return `A function recently changed. Here is the current documentation for that function:
7
+ return `## Task
8
+ Review if the existing documentation is still accurate after code changes. If accurate, respond "No changes needed". Otherwise, provide updated documentation.
8
9
 
9
- """
10
+ ## Current Documentation
10
11
  ${previousDocumentation}
11
- """
12
12
 
13
- and here is the new code for ${entity.name}:
14
-
15
- """
13
+ ## Updated Code
14
+ \`\`\`typescript
16
15
  ${entity.code}
17
- """
18
-
19
- If the existing documentation is still accurate please respond with "No changes needed".
20
-
21
- Otherwise, please update the documentation to reflect the changes in the code. Using these instructions:
22
-
23
- - Start with an overview that describes the overall intent of the code. Be concise in your language. Immediately start with the intent of the code. Here is an example Overview:
24
-
25
- \`\`\` Overview
26
- Displays details about a specific Git commit. It shows the commit message, author, date, and provides a link to the commit on GitHub. Users can copy the commit SHA to their clipboard, with a visual indication of the copy action.
27
16
  \`\`\`
28
17
 
29
- Note that it does not mention the name of the function but dives directly into what the code does in concise language followed by a small amount of detail.
30
-
31
- - Next, specify the inputs (with details about types, how the input is used, and examples) and expected outputs (with details about types and examples).
32
-
33
- - Finally, provide examples of how the code can be used with clear inputs and outputs for each example. Provide diverse examples (there's no need to include repetitive examples).
34
-
35
- Write the documentation as markdown. Be concise. Use bullets when possible. No one wants to read long paragraphs of text.
36
-
37
- Provide no other text than the documentation in proper markdown using the headers below.
38
-
39
- ## Overview
40
-
41
- ## Inputs
42
-
43
- ## Output
18
+ ## Overview Example
19
+ Good: "Displays details about a specific Git commit. Shows the commit message, author, date, and provides a link to GitHub."
44
20
 
45
- ## Examples
46
- `;
21
+ Bad: "The CommitDetails function takes a commit object..." (mentions the function name)`;
47
22
  }
@@ -52,77 +52,69 @@ export default function generateChangesEntityScenarioDataGenerator(
52
52
  defaultScenarioData?: ScenarioData,
53
53
  incompleteResponse?: string,
54
54
  ) {
55
- return `${
56
- incompleteResponse
57
- ? `## Incomplete Response
58
-
59
- Here is the incomplete response. Please use this and the following data to complete the response, only returning the missing data.
60
-
61
- Just pick up where this response left off. It will be improper json but we will combine the responses into proper json.
62
-
63
- \`\`\` START INCOMPLETE RESPONSE \`\`\`
55
+ const incompleteSection = incompleteResponse
56
+ ? `## Incomplete Response
57
+ Continue from where this left off (combine for valid JSON):
58
+ \`\`\`
64
59
  ${incompleteResponse}
65
- \`\`\` END INCOMPLETE RESPONSE \`\`\`
60
+ \`\`\`
66
61
 
67
62
  `
68
- : ''
69
- }## Scenario
70
-
71
- This scenario needs mock data to support it. Here are the keyAttributeInstructions for generating this scenario:
72
- \`\`\`
73
- ${JSON.stringify(
74
- {
75
- name: scenario.name,
76
- description: scenario.description,
77
- keyAttributeInstructions: scenario.metadata.keyAttributeInstructions,
78
- },
79
- null,
80
- 2,
81
- )}
82
- \`\`\`
63
+ : '';
83
64
 
84
- ## Existing Scenario
85
-
86
- Here are the "keyAttributeInstructions" and data for this scenario before this more recent code change. Please maintain the existing data as effectively as possible while fulfilling the new data structure and "keyAttributeInstructions".
87
- \`\`\`
88
- ${JSON.stringify(
89
- {
90
- name: existingScenario.name,
91
- data: filterData(structure, existingScenario.metadata.data),
92
- },
93
- null,
94
- 2,
95
- )}
96
- \`\`\`
97
- ${
98
- defaultScenarioData
99
- ? `
100
- ## Default Scenario
65
+ const scenarioJson = JSON.stringify(
66
+ {
67
+ name: scenario.name,
68
+ description: scenario.description,
69
+ keyAttributeInstructions: scenario.metadata.keyAttributeInstructions,
70
+ },
71
+ null,
72
+ 2,
73
+ );
101
74
 
102
- Data for the default scenario. Do not modify it. The data you are generating will be merged into it to create the full data.
103
- \`\`\`
75
+ const existingJson = JSON.stringify(
76
+ {
77
+ name: existingScenario.name,
78
+ data: filterData(structure, existingScenario.metadata.data),
79
+ },
80
+ null,
81
+ 2,
82
+ );
83
+
84
+ const defaultSection = defaultScenarioData
85
+ ? `
86
+ ## Default Scenario Data (merge base, do not modify)
87
+ \`\`\`json
104
88
  ${JSON.stringify(defaultScenarioData.data, null, 2)}
105
89
  \`\`\`
106
90
  `
107
- : ''
108
- }
109
- ${
110
- structure.dataForMocks
111
- ? `The mockData structure (for the default scenario provide robust values for the entire structure):
112
- \`\`\`
91
+ : '';
92
+
93
+ const mockDataSection = structure.dataForMocks
94
+ ? `## mockData Structure
95
+ \`\`\`json
113
96
  ${JSON.stringify(structure.dataForMocks, null, 2)}
114
- \`\`\`
115
- `
116
- : 'There is no mockData for this file. Return {} for the mockData.'
117
- }
118
-
119
- ${
120
- structure.arguments
121
- ? `The argumentsData structure (for the default scenario provide robust values for the entire structure):
122
- \`\`\`
97
+ \`\`\``
98
+ : '## mockData Structure\nNone—return `{}` for mockData.';
99
+
100
+ const argumentsSection = structure.arguments
101
+ ? `## argumentsData Structure
102
+ \`\`\`json
123
103
  ${JSON.stringify(structure.arguments, null, 2)}
104
+ \`\`\``
105
+ : '## argumentsData Structure\nNone—return `[]` for argumentsData.';
106
+
107
+ return `${incompleteSection}## Scenario (new instructions)
108
+ \`\`\`json
109
+ ${scenarioJson}
124
110
  \`\`\`
125
- `
126
- : 'There is no argumentsData for this file. Return [] for the argumentsData.'
127
- }`;
111
+
112
+ ## Existing Scenario (preserve where possible)
113
+ \`\`\`json
114
+ ${existingJson}
115
+ \`\`\`
116
+ ${defaultSection}
117
+ ${mockDataSection}
118
+
119
+ ${argumentsSection}`;
128
120
  }
@@ -41,7 +41,7 @@ export default function generateChangesEntityScenariosGenerator({
41
41
  const filePath = (attr as any).filePath;
42
42
  const entityName = (attr as any).originalEntityName;
43
43
 
44
- if (!filePath || !entityName) continue; // Skip if missing required fields
44
+ if (!filePath || !entityName) continue;
45
45
 
46
46
  if (!relevantDependentKeyAttributes[filePath]) {
47
47
  relevantDependentKeyAttributes[filePath] = {};
@@ -52,128 +52,112 @@ export default function generateChangesEntityScenariosGenerator({
52
52
  relevantDependentKeyAttributes[filePath][entityName].push(attr);
53
53
  }
54
54
 
55
- return `Added Key Attributes:
56
-
57
- \`\`\`
58
- ${
59
- addedKeyAttributes && addedKeyAttributes.length > 0
60
- ? JSON.stringify(
61
- addedKeyAttributes.map((ka) => ({
62
- dataStructurePath: ka.dataStructurePath, // Full path in mockData
63
- localVariable: ka.internalPath, // Local variable name
64
- description: ka.description,
65
- validValueOptions: ka.validValueOptions,
66
- })),
67
- null,
68
- 2,
69
- )
70
- : 'None'
71
- }
72
- \`\`\`
73
-
74
- Removed Key Attributes:
75
-
76
- \`\`\`
77
- ${removedKeyAttributes && removedKeyAttributes.length > 0 ? JSON.stringify(removedKeyAttributes, null, 2) : 'None'}
78
- \`\`\`
79
-
80
- ${
81
- changedDataStructureFields.length > 0
82
- ? `Changed Data Structure Fields:
83
-
84
- The following fields in the data structure have changed (type changed, added, or removed):
85
-
86
- \`\`\`
55
+ const formatKeyAttrs = (attrs: Analysis['metadata']['keyAttributes']) =>
56
+ attrs.map((ka) => ({
57
+ dataStructurePath: ka.dataStructurePath,
58
+ localVariable: ka.internalPath,
59
+ description: ka.description,
60
+ validValueOptions: ka.validValueOptions,
61
+ }));
62
+
63
+ const addedSection =
64
+ addedKeyAttributes?.length > 0
65
+ ? JSON.stringify(formatKeyAttrs(addedKeyAttributes), null, 2)
66
+ : 'None';
67
+
68
+ const removedSection =
69
+ removedKeyAttributes?.length > 0
70
+ ? JSON.stringify(removedKeyAttributes, null, 2)
71
+ : 'None';
72
+
73
+ const changedFieldsSection =
74
+ changedDataStructureFields.length > 0
75
+ ? `
76
+ ## Changed Data Structure Fields
77
+ Fields that changed type, were added, or removed:
78
+ \`\`\`json
87
79
  ${JSON.stringify(changedDataStructureFields, null, 2)}
88
80
  \`\`\`
89
81
 
90
- **IMPORTANT**: For scenarios that reference these changed fields in their keyAttributeInstructions, you MUST regenerate those specific instructions to match the new data structure. For example:
91
- - If "stats.visualEntities" changed from an array to a number, update keyAttributeInstructions from "Array of 10 objects" to "10 (count of visual entities)"
92
- - If a field was removed, remove it from keyAttributeInstructions
93
- - If a field was added, you may add it to keyAttributeInstructions if relevant for the scenario
94
-
95
- Fields that did NOT change can retain their existing keyAttributeInstructions.
96
-
82
+ **Update keyAttributeInstructions for affected scenarios** (e.g., if "stats.visualEntities" changed from array to number).
97
83
  `
98
- : ''
99
- }
100
- Existing Key Attributes:
101
-
102
- \`\`\`
84
+ : '';
85
+
86
+ const existingScenariosJson = JSON.stringify(
87
+ existingScenarios
88
+ .filter((s) => (error ? !!s.metadata.error : !s.metadata.error))
89
+ .map((s) => ({
90
+ name: s.name,
91
+ description: s.description,
92
+ keyAttributeInstructions: s.metadata.keyAttributeInstructions,
93
+ playwrightInstructions: s.metadata.playwrightInstructions,
94
+ })),
95
+ null,
96
+ 2,
97
+ );
98
+
99
+ const diffSection = commitDiff
100
+ ? `
101
+ ## Code Change (Diff)
102
+ \`\`\`diff
103
+ ${commitDiff}
104
+ \`\`\``
105
+ : '';
106
+
107
+ const dependencySection =
108
+ !error &&
109
+ relevantDependentKeyAttributes &&
110
+ Object.keys(relevantDependentKeyAttributes).length > 0
111
+ ? `
112
+ ## Dependency Key Attributes
113
+ \`\`\`json
103
114
  ${JSON.stringify(
104
- keyAttributes.map((ka) => ({
105
- dataStructurePath: ka.dataStructurePath, // Full path in mockData
106
- localVariable: ka.internalPath, // Local variable name
107
- description: ka.description,
108
- validValueOptions: ka.validValueOptions,
109
- })),
115
+ Object.keys(relevantDependentKeyAttributes).reduce((acc: any, path) => {
116
+ acc[path] = Object.keys(relevantDependentKeyAttributes[path]).reduce(
117
+ (entityAcc: any, entityName) => {
118
+ entityAcc[entityName] = relevantDependentKeyAttributes[path][
119
+ entityName
120
+ ].map((ka: any) => ({
121
+ dataStructurePath: ka.dataStructurePath,
122
+ localVariable: ka.path || ka.internalPath,
123
+ description: ka.description,
124
+ validValueOptions: ka.validValueOptions,
125
+ }));
126
+ return entityAcc;
127
+ },
128
+ {},
129
+ );
130
+ return acc;
131
+ }, {}),
110
132
  null,
111
133
  2,
112
134
  )}
113
- \`\`\`
114
-
115
- Existing Scenarios:
135
+ \`\`\``
136
+ : '';
116
137
 
138
+ return `## Added Key Attributes
139
+ \`\`\`json
140
+ ${addedSection}
117
141
  \`\`\`
118
- ${JSON.stringify(
119
- existingScenarios
120
- .filter((s) => (error ? !!s.metadata.error : !s.metadata.error))
121
- .map((s) => ({
122
- name: s.name,
123
- description: s.description,
124
- keyAttributeInstructions: s.metadata.keyAttributeInstructions,
125
- playwrightInstructions: s.metadata.playwrightInstructions,
126
- })),
127
- null,
128
- 2,
129
- )}
130
- \`\`\`
131
-
132
- ${
133
- commitDiff
134
- ? `
135
- Code Change:
136
142
 
143
+ ## Removed Key Attributes
144
+ \`\`\`json
145
+ ${removedSection}
137
146
  \`\`\`
138
- ${commitDiff}
147
+ ${changedFieldsSection}
148
+ ## Current Key Attributes
149
+ \`\`\`json
150
+ ${JSON.stringify(formatKeyAttrs(keyAttributes), null, 2)}
139
151
  \`\`\`
140
- `
141
- : ''
142
- }
143
- Function Code:
144
152
 
153
+ ## Existing Scenarios
154
+ \`\`\`json
155
+ ${existingScenariosJson}
145
156
  \`\`\`
146
- ${entity.code}
147
- \`\`\`
157
+ ${diffSection}
148
158
 
149
- ${
150
- !error &&
151
- relevantDependentKeyAttributes &&
152
- Object.keys(relevantDependentKeyAttributes).length > 0
153
- ? `Key Attributes for Dependencies:
154
- \`\`\`
155
- ${JSON.stringify(
156
- Object.keys(relevantDependentKeyAttributes).reduce((acc: any, path) => {
157
- acc[path] = Object.keys(
158
- (relevantDependentKeyAttributes as any)[path],
159
- ).reduce((entityAcc: any, entityName) => {
160
- entityAcc[entityName] = (relevantDependentKeyAttributes as any)[path][
161
- entityName
162
- ].map((ka: any) => ({
163
- dataStructurePath: ka.dataStructurePath, // Full path in mockData
164
- localVariable: ka.path || ka.internalPath, // Local variable name
165
- description: ka.description,
166
- validValueOptions: ka.validValueOptions,
167
- }));
168
- return entityAcc;
169
- }, {});
170
- return acc;
171
- }, {}),
172
- null,
173
- 2,
174
- )}
175
- \`\`\``
176
- : ''
177
- }
178
- `;
159
+ ## Current Code
160
+ \`\`\`typescript
161
+ ${entity.code}
162
+ \`\`\`${dependencySection}`;
179
163
  }
@@ -1,35 +1,16 @@
1
1
  import { Entity } from '~codeyam/types';
2
2
 
3
3
  export default function generateEntityDocumentationGenerator(entity: Entity) {
4
- return `Here is the code for ${entity.name}:
5
-
6
- """
7
- ${entity.code}
8
- """
9
-
10
- What does this code do? Please create documentation for this code.
11
-
12
- - Start with an overview that describes the overall intent of the code. Be concise in your language. Immediately start with the intent of the code. Here is an example Overview:
4
+ return `## Task
5
+ Document the following code.
13
6
 
14
- \`\`\` Overview
15
- Displays details about a specific Git commit. It shows the commit message, author, date, and provides a link to the commit on GitHub. Users can copy the commit SHA to their clipboard, with a visual indication of the copy action.
7
+ ## Code
8
+ \`\`\`typescript
9
+ ${entity.code}
16
10
  \`\`\`
17
11
 
18
- Note that it does not mention the name of the function but dives directly into what the code does in concise language followed by a small amount of detail.
19
-
20
- - Next, specify the inputs (with details about types, how the input is used, and examples) and expected outputs (with details about types and examples).
21
-
22
- - Finally, provide examples of how the code can be used with clear inputs and outputs for each example. Provide diverse examples (there's no need to include repetitive examples).
23
-
24
- Write the documentation as markdown. Be concise. Use bullets when possible. No one wants to read long paragraphs of text.
25
-
26
- Provide no other text than the documentation in proper markdown using the headers below.
27
-
28
- ## Overview
29
-
30
- ## Inputs
31
-
32
- ## Output
12
+ ## Overview Example
13
+ Good: "Displays details about a specific Git commit. Shows the commit message, author, date, and provides a link to GitHub. Users can copy the commit SHA to clipboard."
33
14
 
34
- ## Examples`;
15
+ Bad: "The CommitDetails function takes a commit object..." (mentions the function name)`;
35
16
  }