@codeyam/codeyam-cli 0.1.0-staging.a77070e → 0.1.0-staging.aa28063

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 (349) hide show
  1. package/analyzer-template/.build-info.json +8 -8
  2. package/analyzer-template/log.txt +3 -3
  3. package/analyzer-template/package.json +4 -4
  4. package/analyzer-template/packages/ai/src/lib/astScopes/methodSemantics.ts +135 -0
  5. package/analyzer-template/packages/ai/src/lib/astScopes/nodeToSource.ts +19 -0
  6. package/analyzer-template/packages/ai/src/lib/astScopes/paths.ts +11 -4
  7. package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +36 -9
  8. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/ParentScopeManager.ts +10 -3
  9. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.ts +16 -6
  10. package/analyzer-template/packages/analyze/index.ts +4 -1
  11. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +28 -2
  12. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +5 -36
  13. package/analyzer-template/packages/analyze/src/lib/files/analyze/findOrCreateEntity.ts +10 -6
  14. package/analyzer-template/packages/analyze/src/lib/files/analyze/gatherEntityMap.ts +9 -12
  15. package/analyzer-template/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.ts +21 -0
  16. package/analyzer-template/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.ts +82 -10
  17. package/analyzer-template/packages/analyze/src/lib/files/analyzeChange.ts +4 -0
  18. package/analyzer-template/packages/analyze/src/lib/files/analyzeInitial.ts +4 -0
  19. package/analyzer-template/packages/analyze/src/lib/files/analyzeNextRoute.ts +8 -3
  20. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +239 -58
  21. package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +1684 -1462
  22. package/analyzer-template/packages/aws/package.json +6 -6
  23. package/analyzer-template/packages/database/package.json +2 -2
  24. package/analyzer-template/packages/database/src/lib/loadAnalysis.ts +25 -15
  25. package/analyzer-template/packages/database/src/lib/loadEntity.ts +19 -8
  26. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.d.ts.map +1 -1
  27. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.js +7 -1
  28. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.js.map +1 -1
  29. package/analyzer-template/packages/github/dist/database/src/lib/loadEntity.d.ts +4 -1
  30. package/analyzer-template/packages/github/dist/database/src/lib/loadEntity.d.ts.map +1 -1
  31. package/analyzer-template/packages/github/dist/database/src/lib/loadEntity.js +5 -5
  32. package/analyzer-template/packages/github/dist/database/src/lib/loadEntity.js.map +1 -1
  33. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.d.ts +3 -1
  34. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.d.ts.map +1 -1
  35. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js +22 -1
  36. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js.map +1 -1
  37. package/analyzer-template/packages/utils/src/lib/fs/rsyncCopy.ts +27 -0
  38. package/analyzer-template/project/analyzeFileEntities.ts +26 -0
  39. package/analyzer-template/project/runMultiScenarioServer.ts +26 -3
  40. package/background/src/lib/virtualized/project/analyzeFileEntities.js +22 -0
  41. package/background/src/lib/virtualized/project/analyzeFileEntities.js.map +1 -1
  42. package/background/src/lib/virtualized/project/runMultiScenarioServer.js +23 -3
  43. package/background/src/lib/virtualized/project/runMultiScenarioServer.js.map +1 -1
  44. package/codeyam-cli/src/cli.js +15 -0
  45. package/codeyam-cli/src/cli.js.map +1 -1
  46. package/codeyam-cli/src/commands/__tests__/editor.analyzeImportsArgs.test.js +47 -0
  47. package/codeyam-cli/src/commands/__tests__/editor.analyzeImportsArgs.test.js.map +1 -0
  48. package/codeyam-cli/src/commands/__tests__/editor.auditNoAutoAnalysis.test.js +71 -0
  49. package/codeyam-cli/src/commands/__tests__/editor.auditNoAutoAnalysis.test.js.map +1 -0
  50. package/codeyam-cli/src/commands/__tests__/editor.designSystem.test.js +30 -0
  51. package/codeyam-cli/src/commands/__tests__/editor.designSystem.test.js.map +1 -0
  52. package/codeyam-cli/src/commands/__tests__/editor.statePersistence.test.js +55 -0
  53. package/codeyam-cli/src/commands/__tests__/editor.statePersistence.test.js.map +1 -0
  54. package/codeyam-cli/src/commands/__tests__/editor.stepDispatch.test.js +9 -9
  55. package/codeyam-cli/src/commands/__tests__/init.gitignore.test.js +39 -3
  56. package/codeyam-cli/src/commands/__tests__/init.gitignore.test.js.map +1 -1
  57. package/codeyam-cli/src/commands/editor.js +2080 -459
  58. package/codeyam-cli/src/commands/editor.js.map +1 -1
  59. package/codeyam-cli/src/commands/editorAnalyzeImportsArgs.js +23 -0
  60. package/codeyam-cli/src/commands/editorAnalyzeImportsArgs.js.map +1 -0
  61. package/codeyam-cli/src/commands/init.js +20 -0
  62. package/codeyam-cli/src/commands/init.js.map +1 -1
  63. package/codeyam-cli/src/data/designSystems.js +27 -0
  64. package/codeyam-cli/src/data/designSystems.js.map +1 -0
  65. package/codeyam-cli/src/data/techStacks.js +1 -1
  66. package/codeyam-cli/src/utils/__tests__/editorApi.test.js +44 -0
  67. package/codeyam-cli/src/utils/__tests__/editorApi.test.js.map +1 -1
  68. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +2426 -786
  69. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -1
  70. package/codeyam-cli/src/utils/__tests__/editorEntityHelpers.test.js +66 -0
  71. package/codeyam-cli/src/utils/__tests__/editorEntityHelpers.test.js.map +1 -1
  72. package/codeyam-cli/src/utils/__tests__/editorGuardMiddleware.test.js +67 -0
  73. package/codeyam-cli/src/utils/__tests__/editorGuardMiddleware.test.js.map +1 -0
  74. package/codeyam-cli/src/utils/__tests__/editorPreview.test.js +11 -3
  75. package/codeyam-cli/src/utils/__tests__/editorPreview.test.js.map +1 -1
  76. package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js +98 -1
  77. package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js.map +1 -1
  78. package/codeyam-cli/src/utils/__tests__/editorRoadmap.test.js +1108 -0
  79. package/codeyam-cli/src/utils/__tests__/editorRoadmap.test.js.map +1 -0
  80. package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js +120 -0
  81. package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js.map +1 -1
  82. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js +160 -1
  83. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js.map +1 -1
  84. package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js +134 -1
  85. package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js.map +1 -1
  86. package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js +246 -1
  87. package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js.map +1 -1
  88. package/codeyam-cli/src/utils/__tests__/envFile.test.js +125 -0
  89. package/codeyam-cli/src/utils/__tests__/envFile.test.js.map +1 -0
  90. package/codeyam-cli/src/utils/__tests__/handoffContext.test.js +500 -0
  91. package/codeyam-cli/src/utils/__tests__/handoffContext.test.js.map +1 -0
  92. package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js +16 -1
  93. package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js.map +1 -1
  94. package/codeyam-cli/src/utils/__tests__/manualEntityAnalysis.test.js +302 -0
  95. package/codeyam-cli/src/utils/__tests__/manualEntityAnalysis.test.js.map +1 -0
  96. package/codeyam-cli/src/utils/__tests__/registerScenarioResult.test.js +127 -0
  97. package/codeyam-cli/src/utils/__tests__/registerScenarioResult.test.js.map +1 -0
  98. package/codeyam-cli/src/utils/__tests__/screenshotHash.test.js +84 -0
  99. package/codeyam-cli/src/utils/__tests__/screenshotHash.test.js.map +1 -0
  100. package/codeyam-cli/src/utils/__tests__/testRunner.test.js +216 -0
  101. package/codeyam-cli/src/utils/__tests__/testRunner.test.js.map +1 -0
  102. package/codeyam-cli/src/utils/__tests__/webappDetection.test.js +6 -0
  103. package/codeyam-cli/src/utils/__tests__/webappDetection.test.js.map +1 -1
  104. package/codeyam-cli/src/utils/analysisRunner.js +36 -7
  105. package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
  106. package/codeyam-cli/src/utils/analyzer.js +11 -1
  107. package/codeyam-cli/src/utils/analyzer.js.map +1 -1
  108. package/codeyam-cli/src/utils/designSystemShowcase.js +810 -0
  109. package/codeyam-cli/src/utils/designSystemShowcase.js.map +1 -0
  110. package/codeyam-cli/src/utils/editorApi.js +16 -0
  111. package/codeyam-cli/src/utils/editorApi.js.map +1 -1
  112. package/codeyam-cli/src/utils/editorAudit.js +385 -32
  113. package/codeyam-cli/src/utils/editorAudit.js.map +1 -1
  114. package/codeyam-cli/src/utils/editorGuard.js +36 -0
  115. package/codeyam-cli/src/utils/editorGuard.js.map +1 -0
  116. package/codeyam-cli/src/utils/editorPreview.js +5 -3
  117. package/codeyam-cli/src/utils/editorPreview.js.map +1 -1
  118. package/codeyam-cli/src/utils/editorRecapture.js +109 -0
  119. package/codeyam-cli/src/utils/editorRecapture.js.map +1 -0
  120. package/codeyam-cli/src/utils/editorRoadmap.js +574 -0
  121. package/codeyam-cli/src/utils/editorRoadmap.js.map +1 -0
  122. package/codeyam-cli/src/utils/editorScenarioSwitch.js +27 -12
  123. package/codeyam-cli/src/utils/editorScenarioSwitch.js.map +1 -1
  124. package/codeyam-cli/src/utils/editorScenarios.js +108 -5
  125. package/codeyam-cli/src/utils/editorScenarios.js.map +1 -1
  126. package/codeyam-cli/src/utils/editorSeedAdapter.js +69 -16
  127. package/codeyam-cli/src/utils/editorSeedAdapter.js.map +1 -1
  128. package/codeyam-cli/src/utils/entityChangeStatus.js +30 -2
  129. package/codeyam-cli/src/utils/entityChangeStatus.js.map +1 -1
  130. package/codeyam-cli/src/utils/entityChangeStatus.server.js +31 -0
  131. package/codeyam-cli/src/utils/entityChangeStatus.server.js.map +1 -1
  132. package/codeyam-cli/src/utils/envFile.js +90 -0
  133. package/codeyam-cli/src/utils/envFile.js.map +1 -0
  134. package/codeyam-cli/src/utils/handoffContext.js +257 -0
  135. package/codeyam-cli/src/utils/handoffContext.js.map +1 -0
  136. package/codeyam-cli/src/utils/install-skills.js +36 -6
  137. package/codeyam-cli/src/utils/install-skills.js.map +1 -1
  138. package/codeyam-cli/src/utils/manualEntityAnalysis.js +196 -0
  139. package/codeyam-cli/src/utils/manualEntityAnalysis.js.map +1 -0
  140. package/codeyam-cli/src/utils/queue/__tests__/job.interactiveStart.test.js +159 -0
  141. package/codeyam-cli/src/utils/queue/__tests__/job.interactiveStart.test.js.map +1 -0
  142. package/codeyam-cli/src/utils/queue/job.js +35 -6
  143. package/codeyam-cli/src/utils/queue/job.js.map +1 -1
  144. package/codeyam-cli/src/utils/registerScenarioResult.js +52 -0
  145. package/codeyam-cli/src/utils/registerScenarioResult.js.map +1 -0
  146. package/codeyam-cli/src/utils/scenariosManifest.js +30 -2
  147. package/codeyam-cli/src/utils/scenariosManifest.js.map +1 -1
  148. package/codeyam-cli/src/utils/screenshotHash.js +26 -0
  149. package/codeyam-cli/src/utils/screenshotHash.js.map +1 -0
  150. package/codeyam-cli/src/utils/simulationGateMiddleware.js +9 -0
  151. package/codeyam-cli/src/utils/simulationGateMiddleware.js.map +1 -1
  152. package/codeyam-cli/src/utils/techStackConfig.js +38 -0
  153. package/codeyam-cli/src/utils/techStackConfig.js.map +1 -0
  154. package/codeyam-cli/src/utils/techStackConfig.test.js +85 -0
  155. package/codeyam-cli/src/utils/techStackConfig.test.js.map +1 -0
  156. package/codeyam-cli/src/utils/testResultCache.js +53 -0
  157. package/codeyam-cli/src/utils/testResultCache.js.map +1 -0
  158. package/codeyam-cli/src/utils/testResultCache.server.js +81 -0
  159. package/codeyam-cli/src/utils/testResultCache.server.js.map +1 -0
  160. package/codeyam-cli/src/utils/testResultCache.server.test.js +187 -0
  161. package/codeyam-cli/src/utils/testResultCache.server.test.js.map +1 -0
  162. package/codeyam-cli/src/utils/testResultCache.test.js +230 -0
  163. package/codeyam-cli/src/utils/testResultCache.test.js.map +1 -0
  164. package/codeyam-cli/src/utils/testRunner.js +193 -1
  165. package/codeyam-cli/src/utils/testRunner.js.map +1 -1
  166. package/codeyam-cli/src/utils/webappDetection.js +4 -2
  167. package/codeyam-cli/src/utils/webappDetection.js.map +1 -1
  168. package/codeyam-cli/src/webserver/__tests__/api.interactive-switch-scenario.test.js +99 -0
  169. package/codeyam-cli/src/webserver/__tests__/api.interactive-switch-scenario.test.js.map +1 -0
  170. package/codeyam-cli/src/webserver/__tests__/buildPtyEnv.test.js +95 -1
  171. package/codeyam-cli/src/webserver/__tests__/buildPtyEnv.test.js.map +1 -1
  172. package/codeyam-cli/src/webserver/__tests__/clientErrors.test.js +28 -1
  173. package/codeyam-cli/src/webserver/__tests__/clientErrors.test.js.map +1 -1
  174. package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js +145 -11
  175. package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js.map +1 -1
  176. package/codeyam-cli/src/webserver/__tests__/idleDetector.test.js +105 -7
  177. package/codeyam-cli/src/webserver/__tests__/idleDetector.test.js.map +1 -1
  178. package/codeyam-cli/src/webserver/__tests__/stripClaudeCommand.test.js +135 -0
  179. package/codeyam-cli/src/webserver/__tests__/stripClaudeCommand.test.js.map +1 -0
  180. package/codeyam-cli/src/webserver/app/lib/clientErrors.js +15 -0
  181. package/codeyam-cli/src/webserver/app/lib/clientErrors.js.map +1 -1
  182. package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
  183. package/codeyam-cli/src/webserver/app/routes/api.interactive-switch-scenario.js +34 -0
  184. package/codeyam-cli/src/webserver/app/routes/api.interactive-switch-scenario.js.map +1 -0
  185. package/codeyam-cli/src/webserver/build/client/assets/{CopyButton-CLe80MMu.js → CopyButton-DTBZZfSk.js} +1 -1
  186. package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-Crt_KN_U.js → EntityItem-BxclONWq.js} +1 -1
  187. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-CD7lGABo.js → EntityTypeIcon-BsnEOJZ_.js} +1 -1
  188. package/codeyam-cli/src/webserver/build/client/assets/{InlineSpinner-CgTNOhnu.js → InlineSpinner-ByaELMbv.js} +1 -1
  189. package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-CKeQT5Ty.js → InteractivePreview-6WjVfhxX.js} +2 -2
  190. package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-D3s1MFkb.js → LibraryFunctionPreview-ChX-Hp7W.js} +1 -1
  191. package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-CM5zg40N.js → LogViewer-C-9zQdXg.js} +1 -1
  192. package/codeyam-cli/src/webserver/build/client/assets/MiniClaudeChat-Bs2_Oua4.js +36 -0
  193. package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-C2PLkej3.js → ReportIssueModal-DQsceHVv.js} +1 -1
  194. package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-DanvyBPb.js → SafeScreenshot-DThcm_9M.js} +1 -1
  195. package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-DUMfcNVK.js → ScenarioViewer-Cl4oOA3A.js} +1 -1
  196. package/codeyam-cli/src/webserver/build/client/assets/Spinner-CIil5-gb.js +34 -0
  197. package/codeyam-cli/src/webserver/build/client/assets/{ViewportInspectBar-BA_Ry-rs.js → ViewportInspectBar-BqkA9zyZ.js} +1 -1
  198. package/codeyam-cli/src/webserver/build/client/assets/{_index-BAWd-Xjf.js → _index-DnOgyseQ.js} +1 -1
  199. package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-BOARiB-g.js → activity.(_tab)-DqM9hbNE.js} +1 -1
  200. package/codeyam-cli/src/webserver/build/client/assets/{addon-web-links-CHx25PAe.js → addon-web-links-C58dYPwR.js} +1 -1
  201. package/codeyam-cli/src/webserver/build/client/assets/{agent-transcripts-Bg3e7q4S.js → agent-transcripts-B8NCeOrm.js} +1 -1
  202. package/codeyam-cli/src/webserver/build/client/assets/api.editor-database-verify-l0sNRNKZ.js +1 -0
  203. package/codeyam-cli/src/webserver/build/client/assets/api.editor-github-verify-l0sNRNKZ.js +1 -0
  204. package/codeyam-cli/src/webserver/build/client/assets/api.editor-handoff-l0sNRNKZ.js +1 -0
  205. package/codeyam-cli/src/webserver/build/client/assets/api.editor-hosting-verify-l0sNRNKZ.js +1 -0
  206. package/codeyam-cli/src/webserver/build/client/assets/api.editor-recapture-stale-l0sNRNKZ.js +1 -0
  207. package/codeyam-cli/src/webserver/build/client/assets/api.editor-roadmap-l0sNRNKZ.js +1 -0
  208. package/codeyam-cli/src/webserver/build/client/assets/api.editor-save-scenario-data-l0sNRNKZ.js +1 -0
  209. package/codeyam-cli/src/webserver/build/client/assets/api.editor-schema-l0sNRNKZ.js +1 -0
  210. package/codeyam-cli/src/webserver/build/client/assets/api.editor-verify-routes-l0sNRNKZ.js +1 -0
  211. package/codeyam-cli/src/webserver/build/client/assets/api.interactive-switch-scenario-l0sNRNKZ.js +1 -0
  212. package/codeyam-cli/src/webserver/build/client/assets/{book-open-CL-lMgHh.js → book-open-BFSIqZgO.js} +1 -1
  213. package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-GmAjGS9-.js → chevron-down-B9fDzFVh.js} +1 -1
  214. package/codeyam-cli/src/webserver/build/client/assets/chunk-UVKPFVEO-Bmq2apuh.js +43 -0
  215. package/codeyam-cli/src/webserver/build/client/assets/{circle-check-DFcQkN5j.js → circle-check-DLPObLUx.js} +1 -1
  216. package/codeyam-cli/src/webserver/build/client/assets/{copy-C6iF61Xs.js → copy-DXEmO0TD.js} +1 -1
  217. package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-4ImjHTVC.js → createLucideIcon-BwyFiRot.js} +1 -1
  218. package/codeyam-cli/src/webserver/build/client/assets/cy-logo-cli-Coe5NhbS.js +1 -0
  219. package/codeyam-cli/src/webserver/build/client/assets/{cy-logo-cli-CCKUIm0S.svg → cy-logo-cli-DoA97ML3.svg} +2 -2
  220. package/codeyam-cli/src/webserver/build/client/assets/{dev.empty-C8y4mmyv.js → dev.empty-iRhRIFlp.js} +1 -1
  221. package/codeyam-cli/src/webserver/build/client/assets/editor._tab-BZPBzV73.js +1 -0
  222. package/codeyam-cli/src/webserver/build/client/assets/editor.entity.(_sha)-DOXe0Qx7.js +161 -0
  223. package/codeyam-cli/src/webserver/build/client/assets/editorPreview-C6fEYHrh.js +41 -0
  224. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-Blfy9UlN.js → entity._sha._-pc-vc6wO.js} +13 -12
  225. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha.scenarios._scenarioId.dev-KTQuL0aj.js → entity._sha.scenarios._scenarioId.dev-C8AyYgYT.js} +1 -1
  226. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha.scenarios._scenarioId.fullscreen-C6eeL24i.js → entity._sha.scenarios._scenarioId.fullscreen-DziaVQX1.js} +1 -1
  227. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.create-scenario-DQM8E7L4.js → entity._sha_.create-scenario-BTcpgIpC.js} +1 -1
  228. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-CAoXLsQr.js → entity._sha_.edit._scenarioId-D_O_ajfZ.js} +1 -1
  229. package/codeyam-cli/src/webserver/build/client/assets/{entry.client-SuW9syRS.js → entry.client-j1Vi0bco.js} +6 -6
  230. package/codeyam-cli/src/webserver/build/client/assets/{files-D-xGrg29.js → files-kuny2Q_s.js} +1 -1
  231. package/codeyam-cli/src/webserver/build/client/assets/{git-Bq_fbXP5.js → git-DgCZPMie.js} +1 -1
  232. package/codeyam-cli/src/webserver/build/client/assets/globals-L-aUIeux.css +1 -0
  233. package/codeyam-cli/src/webserver/build/client/assets/{index-Bp1l4hSv.js → index-BliGSSpl.js} +1 -1
  234. package/codeyam-cli/src/webserver/build/client/assets/{index-DE3jI_dv.js → index-SqjQKTdH.js} +1 -1
  235. package/codeyam-cli/src/webserver/build/client/assets/{index-CWV9XZiG.js → index-vyrZD2g4.js} +1 -1
  236. package/codeyam-cli/src/webserver/build/client/assets/{labs-B_IX45ih.js → labs-c3yLxSEp.js} +1 -1
  237. package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-De-7qQ2u.js → loader-circle-D-q28GLF.js} +1 -1
  238. package/codeyam-cli/src/webserver/build/client/assets/manifest-30c44d84.js +1 -0
  239. package/codeyam-cli/src/webserver/build/client/assets/{memory-Cx2xEx7s.js → memory-CEWIUC4t.js} +1 -1
  240. package/codeyam-cli/src/webserver/build/client/assets/{pause-CFxEKL1u.js → pause-BP6fitdh.js} +1 -1
  241. package/codeyam-cli/src/webserver/build/client/assets/{root-DB3O9_9j.js → root-CLedrjXQ.js} +26 -13
  242. package/codeyam-cli/src/webserver/build/client/assets/{search-BdBb5aqc.js → search-BooqacKS.js} +1 -1
  243. package/codeyam-cli/src/webserver/build/client/assets/{settings-DdE-Untf.js → settings-BM0nbryO.js} +1 -1
  244. package/codeyam-cli/src/webserver/build/client/assets/{simulations-DSCdE99u.js → simulations-ovy6FjRY.js} +1 -1
  245. package/codeyam-cli/src/webserver/build/client/assets/{terminal-CrplD4b1.js → terminal-DHemCJIs.js} +1 -1
  246. package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-DqJ0j69l.js → triangle-alert-D87ekDl8.js} +1 -1
  247. package/codeyam-cli/src/webserver/build/client/assets/{useCustomSizes-DhXHbEjP.js → useCustomSizes-Dk0Tciqg.js} +1 -1
  248. package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-C8QvIe05.js +2 -0
  249. package/codeyam-cli/src/webserver/build/client/assets/{useReportContext-Cy5Qg_UR.js → useReportContext-jkCytuYz.js} +1 -1
  250. package/codeyam-cli/src/webserver/build/client/assets/{useToast-5HR2j9ZE.js → useToast-BgqkixU9.js} +1 -1
  251. package/codeyam-cli/src/webserver/build/server/assets/analysisRunner-CuR5TvUx.js +16 -0
  252. package/codeyam-cli/src/webserver/build/server/assets/{index-DxB0pOSt.js → index-D4MWAsqb.js} +1 -1
  253. package/codeyam-cli/src/webserver/build/server/assets/init-JObA4lXD.js +14 -0
  254. package/codeyam-cli/src/webserver/build/server/assets/server-build-i8OXK4oL.js +765 -0
  255. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  256. package/codeyam-cli/src/webserver/build-info.json +5 -5
  257. package/codeyam-cli/src/webserver/editorProxy.js +132 -7
  258. package/codeyam-cli/src/webserver/editorProxy.js.map +1 -1
  259. package/codeyam-cli/src/webserver/idleDetector.js +27 -3
  260. package/codeyam-cli/src/webserver/idleDetector.js.map +1 -1
  261. package/codeyam-cli/src/webserver/scripts/journalCapture.ts +17 -0
  262. package/codeyam-cli/src/webserver/server.js +119 -14
  263. package/codeyam-cli/src/webserver/server.js.map +1 -1
  264. package/codeyam-cli/src/webserver/terminalServer.js +235 -37
  265. package/codeyam-cli/src/webserver/terminalServer.js.map +1 -1
  266. package/codeyam-cli/templates/__tests__/editor-step-hook.prompt-capture.test.ts +118 -0
  267. package/codeyam-cli/templates/codeyam-editor-claude.md +2 -0
  268. package/codeyam-cli/templates/codeyam-editor-codex.md +61 -0
  269. package/codeyam-cli/templates/codeyam-editor-gemini.md +59 -0
  270. package/codeyam-cli/templates/codeyam-editor-reference.md +9 -7
  271. package/codeyam-cli/templates/design-systems/clean-dashboard-design-system.md +255 -0
  272. package/codeyam-cli/templates/design-systems/editorial-design-system.md +267 -0
  273. package/codeyam-cli/templates/design-systems/mono-brutalist-design-system.md +256 -0
  274. package/codeyam-cli/templates/design-systems/neo-brutalist-design-system.md +294 -0
  275. package/codeyam-cli/templates/editor-step-hook.py +93 -46
  276. package/codeyam-cli/templates/expo-react-native/MOBILE_SETUP.md +204 -5
  277. package/codeyam-cli/templates/expo-react-native/__tests__/.gitkeep +0 -0
  278. package/codeyam-cli/templates/expo-react-native/app/_layout.tsx +6 -3
  279. package/codeyam-cli/templates/expo-react-native/app/index.tsx +36 -0
  280. package/codeyam-cli/templates/expo-react-native/app.json +11 -0
  281. package/codeyam-cli/templates/expo-react-native/babel.config.js +1 -0
  282. package/codeyam-cli/templates/expo-react-native/gitignore +2 -0
  283. package/codeyam-cli/templates/expo-react-native/global.css +7 -0
  284. package/codeyam-cli/templates/expo-react-native/lib/theme.ts +73 -0
  285. package/codeyam-cli/templates/expo-react-native/package.json +32 -16
  286. package/codeyam-cli/templates/expo-react-native/patches/expo-modules-autolinking+3.0.24.patch +29 -0
  287. package/codeyam-cli/templates/isolation-route/expo-router.tsx.template +54 -0
  288. package/codeyam-cli/templates/nextjs-prisma-sqlite/gitignore +1 -0
  289. package/codeyam-cli/templates/nextjs-prisma-sqlite/seed-adapter.ts +47 -34
  290. package/codeyam-cli/templates/seed-adapters/supabase.ts +271 -78
  291. package/codeyam-cli/templates/skills/codeyam-editor/SKILL.md +34 -1
  292. package/package.json +1 -1
  293. package/packages/ai/src/lib/astScopes/methodSemantics.js +99 -0
  294. package/packages/ai/src/lib/astScopes/methodSemantics.js.map +1 -1
  295. package/packages/ai/src/lib/astScopes/nodeToSource.js +16 -0
  296. package/packages/ai/src/lib/astScopes/nodeToSource.js.map +1 -1
  297. package/packages/ai/src/lib/astScopes/paths.js +12 -3
  298. package/packages/ai/src/lib/astScopes/paths.js.map +1 -1
  299. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +27 -10
  300. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
  301. package/packages/ai/src/lib/dataStructure/equivalencyManagers/ParentScopeManager.js +9 -2
  302. package/packages/ai/src/lib/dataStructure/equivalencyManagers/ParentScopeManager.js.map +1 -1
  303. package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js +14 -4
  304. package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js.map +1 -1
  305. package/packages/analyze/index.js +1 -1
  306. package/packages/analyze/index.js.map +1 -1
  307. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +16 -2
  308. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
  309. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +6 -26
  310. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
  311. package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js +3 -2
  312. package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js.map +1 -1
  313. package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js +9 -7
  314. package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js.map +1 -1
  315. package/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.js +14 -0
  316. package/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.js.map +1 -1
  317. package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js +44 -11
  318. package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js.map +1 -1
  319. package/packages/analyze/src/lib/files/analyzeChange.js +1 -0
  320. package/packages/analyze/src/lib/files/analyzeChange.js.map +1 -1
  321. package/packages/analyze/src/lib/files/analyzeInitial.js +1 -0
  322. package/packages/analyze/src/lib/files/analyzeInitial.js.map +1 -1
  323. package/packages/analyze/src/lib/files/analyzeNextRoute.js +5 -1
  324. package/packages/analyze/src/lib/files/analyzeNextRoute.js.map +1 -1
  325. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +120 -28
  326. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
  327. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +1368 -1193
  328. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
  329. package/packages/database/src/lib/loadAnalysis.js +7 -1
  330. package/packages/database/src/lib/loadAnalysis.js.map +1 -1
  331. package/packages/database/src/lib/loadEntity.js +5 -5
  332. package/packages/database/src/lib/loadEntity.js.map +1 -1
  333. package/packages/utils/src/lib/fs/rsyncCopy.js +22 -1
  334. package/packages/utils/src/lib/fs/rsyncCopy.js.map +1 -1
  335. package/codeyam-cli/src/webserver/build/client/assets/Spinner-D0LgAaSa.js +0 -34
  336. package/codeyam-cli/src/webserver/build/client/assets/chunk-JZWAC4HX-BAdwhyCx.js +0 -43
  337. package/codeyam-cli/src/webserver/build/client/assets/cy-logo-cli-DcX-ZS3p.js +0 -1
  338. package/codeyam-cli/src/webserver/build/client/assets/editor._tab-Gbk_i5Js.js +0 -1
  339. package/codeyam-cli/src/webserver/build/client/assets/editor.entity.(_sha)-Bnx7yUP0.js +0 -58
  340. package/codeyam-cli/src/webserver/build/client/assets/editorPreview-oepecPae.js +0 -41
  341. package/codeyam-cli/src/webserver/build/client/assets/globals-fAqOD9ex.css +0 -1
  342. package/codeyam-cli/src/webserver/build/client/assets/manifest-3157d6b8.js +0 -1
  343. package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-BNd5hYuW.js +0 -2
  344. package/codeyam-cli/src/webserver/build/server/assets/analysisRunner-BMmkgAkg.js +0 -13
  345. package/codeyam-cli/src/webserver/build/server/assets/init-DLYLaqqP.js +0 -10
  346. package/codeyam-cli/src/webserver/build/server/assets/server-build-CcyitQLQ.js +0 -551
  347. package/codeyam-cli/templates/expo-react-native/app/(tabs)/_layout.tsx +0 -33
  348. package/codeyam-cli/templates/expo-react-native/app/(tabs)/index.tsx +0 -12
  349. package/codeyam-cli/templates/expo-react-native/app/(tabs)/settings.tsx +0 -12
@@ -0,0 +1 @@
1
+ {"version":3,"file":"designSystemShowcase.js","sourceRoot":"","sources":["../../../../src/utils/designSystemShowcase.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AASxB;;;GAGG;AACH,SAAS,sBAA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
  method: 'GET',
54
54
  endpoint: '/api/editor-client-errors',
55
55
  }),
56
+ 'verify-routes': (jsonArg) => {
57
+ if (!jsonArg) {
58
+ throw new Error('JSON argument is required for verify-routes. Example: \'{"paths":["/library"],"apiRoutes":["/api/users"]}\'');
59
+ }
60
+ const body = JSON.parse(jsonArg);
61
+ const hasPaths = Array.isArray(body.paths) && body.paths.length > 0;
62
+ const hasApiRoutes = Array.isArray(body.apiRoutes) && body.apiRoutes.length > 0;
63
+ if (!hasPaths && !hasApiRoutes) {
64
+ throw new Error('verify-routes requires at least one entry in "paths" or "apiRoutes"');
65
+ }
66
+ return {
67
+ method: 'POST',
68
+ endpoint: '/api/editor-verify-routes',
69
+ body,
70
+ };
71
+ },
56
72
  };
57
73
  export function buildEditorApiRequest(subcommand, jsonArg) {
58
74
  const builder = SUBCOMMAND_MAP[subcommand];
@@ -1 +1 @@
1
- {"version":3,"file":"editorApi.js","sourceRoot":"","sources":["../../../../src/utils/editorApi.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,MAAM,cAAc,GAA2D;IAC7E,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE;QACnB,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACvD,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CACb,0IAA0I,CAC3I,CAAC;QACJ,CAAC;QACD,OAAO;YACL,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,uBAAuB;YACjC,IAAI;SACL,CAAC;IACJ,CAAC;IAED,cAAc,EAAE,GAAG,EAAE,CAAC,CAAC;QACrB,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,0BAA0B;KACrC,CAAC;IAEF,cAAc,EAAE,GAAG,EAAE,CAAC,CAAC;QACrB,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,0BAA0B;KACrC,CA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ACd,QAAQ,EAAE,2BAA2B;YACrC,IAAI;SACL,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,MAAM,UAAU,qBAAqB,CACnC,UAAkB,EAClB,OAAgB;IAEhB,MAAM,OAAO,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC;IAC3C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,8BAA8B,UAAU,EAAE,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC;AAC1B,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,OAAyB,EACzB,IAAY;IAEZ,MAAM,GAAG,GAAG,oBAAoB,IAAI,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAC1D,MAAM,OAAO,GAAgB,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;IACxD,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,OAAO,CAAC,OAAO,GAAG,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC;QACzD,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IACD,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACtC,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAS,EAAE,CAAC,IAAI,CAAC,CAAC;IACtD,OAAO,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC;AAClD,CAAC;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC"}
@@ -4,17 +4,34 @@
4
4
  * Cross-references glossary entries against registered scenarios (components)
5
5
  * and test files (functions) to detect gaps Claude may have missed.
6
6
  */
7
- import { isIsolationUrl, } from "./entityChangeStatus.js";
7
+ import { isIsolationUrl, scenarioEntityName, } from "./entityChangeStatus.js";
8
8
  // ─── Logic ───────────────────────────────────────────────────────────
9
9
  const COMPONENT_RETURN_PATTERNS = ['JSX', 'React', 'Element', 'ReactNode'];
10
+ /** File names that indicate page/route files — these are visual components
11
+ * verified via screenshots, not functions that need unit tests. */
12
+ const PAGE_FILE_NAMES = new Set([
13
+ 'page.tsx',
14
+ 'page.ts',
15
+ 'index.tsx',
16
+ 'index.ts',
17
+ ]);
10
18
  /**
11
- * Returns true when the entry's returnType indicates a React component
12
- * (contains "JSX", "React", "Element", or "ReactNode").
19
+ * Returns true when the entry represents a visual component (needs scenarios,
20
+ * not unit tests). Matches on returnType containing JSX/React patterns, OR
21
+ * on file path patterns for page/route files.
13
22
  */
14
23
  export function isComponent(entry) {
15
- if (!entry.returnType)
16
- return false;
17
- return COMPONENT_RETURN_PATTERNS.some((pat) => entry.returnType.includes(pat));
24
+ if (entry.returnType &&
25
+ COMPONENT_RETURN_PATTERNS.some((pat) => entry.returnType.includes(pat))) {
26
+ return true;
27
+ }
28
+ // Page/route files are visual components — verified via app scenarios, not tests
29
+ if (entry.filePath) {
30
+ const fileName = entry.filePath.split('/').pop() || '';
31
+ if (PAGE_FILE_NAMES.has(fileName))
32
+ return true;
33
+ }
34
+ return false;
18
35
  }
19
36
  /**
20
37
  * Split glossary entries into components (JSX-returning) and functions (everything else).
@@ -40,14 +57,28 @@ export function classifyGlossaryEntries(entries) {
40
57
  * @param scenarioCounts - Map of component_name → number of registered scenarios
41
58
  * @param testFileExistence - Map of testFile path → whether the file exists on disk
42
59
  */
43
- export function computeAudit({ components, functions, scenarioCounts, testFileExistence, testResults, clientErrors, }) {
60
+ export function computeAudit({ components, functions, scenarioCounts, testFileExistence, testResults, clientErrors, totalScenarioCounts, entityChangeStatus, analysisFailedEntities, testCaseCounts, }) {
44
61
  const componentResults = components.map((c) => {
45
62
  const count = scenarioCounts[c.name] || 0;
63
+ const totalCount = totalScenarioCounts?.[c.name] || 0;
64
+ const changeStatus = entityChangeStatus?.[c.name];
46
65
  const errors = clientErrors?.[c.name];
47
66
  const hasErrors = count > 0 && errors && errors.length > 0;
48
67
  let status;
49
- if (count === 0) {
50
- status = 'missing';
68
+ if (analysisFailedEntities?.has(c.name)) {
69
+ status = 'analysis_failed';
70
+ }
71
+ else if (count === 0) {
72
+ // Entities with existing scenarios from prior sessions don't need
73
+ // new scenarios — they need recapture. This applies to both "edited"
74
+ // and "impacted" entities: an edited page may not have been re-registered
75
+ // this session, and an impacted page's dependency changed.
76
+ if (changeStatus && totalCount > 0) {
77
+ status = 'needs_recapture';
78
+ }
79
+ else {
80
+ status = 'missing';
81
+ }
51
82
  }
52
83
  else if (hasErrors) {
53
84
  status = 'has_errors';
@@ -55,12 +86,33 @@ export function computeAudit({ components, functions, scenarioCounts, testFileEx
55
86
  else {
56
87
  status = 'ok';
57
88
  }
89
+ // Generate actionable hint for missing or needs_recapture components
90
+ let hint;
91
+ if (status === 'missing') {
92
+ const fileName = c.filePath.split('/').pop() || '';
93
+ if (fileName === 'layout.tsx' || fileName === 'layout.ts') {
94
+ hint = `This is a layout file — register an app-level scenario with pageFilePath instead of componentName: codeyam editor register '{"name":"${c.name} - Default","pageFilePath":"${c.filePath}","url":"/<route>","dimensions":["Desktop"]}'`;
95
+ }
96
+ else if (fileName === 'page.tsx' || fileName === 'page.ts') {
97
+ hint = `This is a page file — register an app-level scenario with pageFilePath: codeyam editor register '{"name":"${c.name} - Default","pageFilePath":"${c.filePath}","url":"/<route>","dimensions":["Desktop"]}'`;
98
+ }
99
+ else {
100
+ hint = `Register a component scenario via an isolation route: codeyam editor isolate ${c.name} then codeyam editor register '{"name":"${c.name} - Default","componentName":"${c.name}","url":"/isolated-components/${c.name}?s=Default","dimensions":["Desktop"]}'`;
101
+ }
102
+ }
103
+ else if (status === 'needs_recapture') {
104
+ hint = `This component's code or dependencies changed — recapture existing scenarios to update screenshots: codeyam editor recapture ${c.name}`;
105
+ }
106
+ else if (status === 'analysis_failed') {
107
+ hint = `Analysis failed for this component (likely timed out due to complex dependencies). The component has partial data but may be missing some dependency schemas. Try re-analyzing: codeyam editor analyze-imports`;
108
+ }
58
109
  return {
59
110
  name: c.name,
60
111
  filePath: c.filePath,
61
- scenarioCount: count,
112
+ scenarioCount: status === 'needs_recapture' ? totalCount : count,
62
113
  status,
63
114
  ...(hasErrors ? { clientErrors: errors } : {}),
115
+ ...(hint ? { hint } : {}),
64
116
  };
65
117
  });
66
118
  const functionResults = functions.map((f) => {
@@ -68,12 +120,17 @@ export function computeAudit({ components, functions, scenarioCounts, testFileEx
68
120
  ? (testFileExistence[f.testFile] ?? false)
69
121
  : false;
70
122
  if (!exists) {
123
+ // Suggest conventional test file path when testFile isn't in the glossary
124
+ const suggestedTestFile = !f.testFile
125
+ ? f.filePath.replace(/\.tsx?$/, '.test.ts')
126
+ : undefined;
71
127
  return {
72
128
  name: f.name,
73
129
  filePath: f.filePath,
74
130
  testFile: f.testFile,
75
131
  testFileExists: false,
76
132
  status: 'missing',
133
+ ...(suggestedTestFile ? { suggestedTestFile } : {}),
77
134
  };
78
135
  }
79
136
  // If we have test results for this file, use them for deeper status
@@ -101,6 +158,14 @@ export function computeAudit({ components, functions, scenarioCounts, testFileEx
101
158
  else {
102
159
  status = 'ok';
103
160
  }
161
+ // Generate actionable hint for non-ok functions
162
+ let hint;
163
+ if (status === 'name_mismatch') {
164
+ hint = `Tests pass but won't show in the CodeYam UI. Add a top-level describe("${f.name}", ...) block in ${f.testFile}`;
165
+ }
166
+ else if (status === 'runner_error' && tr.errorMessage) {
167
+ hint = `Test runner crashed (not a test failure): ${tr.errorMessage}`;
168
+ }
104
169
  return {
105
170
  name: f.name,
106
171
  filePath: f.filePath,
@@ -110,16 +175,23 @@ export function computeAudit({ components, functions, scenarioCounts, testFileEx
110
175
  testsVisibleInUi: tr.hasEntityNameDescribe,
111
176
  status,
112
177
  ...(tr.errorMessage ? { errorMessage: tr.errorMessage } : {}),
178
+ ...(hint ? { hint } : {}),
179
+ ...(testCaseCounts?.[f.name] !== undefined
180
+ ? { testCaseCount: testCaseCounts[f.name] }
181
+ : {}),
113
182
  };
114
183
  });
115
184
  const componentsOk = componentResults.filter((c) => c.status === 'ok').length;
116
185
  const componentsWithErrors = componentResults.filter((c) => c.status === 'has_errors').length;
117
186
  const componentsMissing = componentResults.filter((c) => c.status === 'missing').length;
187
+ const componentsNeedingRecapture = componentResults.filter((c) => c.status === 'needs_recapture').length;
188
+ const componentsAnalysisFailed = componentResults.filter((c) => c.status === 'analysis_failed').length;
118
189
  const functionsOk = functionResults.filter((f) => f.status === 'ok').length;
119
190
  const functionsFailing = functionResults.filter((f) => f.status === 'failing').length;
120
191
  const functionsRunnerError = functionResults.filter((f) => f.status === 'runner_error').length;
121
192
  const functionsNameMismatch = functionResults.filter((f) => f.status === 'name_mismatch').length;
122
193
  const functionsMissing = functionResults.filter((f) => f.status === 'missing').length;
194
+ const functionsThinCoverage = functionResults.filter((f) => f.status === 'ok' && f.testCaseCount !== undefined && f.testCaseCount < 3).length;
123
195
  return {
124
196
  components: componentResults,
125
197
  functions: functionResults,
@@ -128,14 +200,18 @@ export function computeAudit({ components, functions, scenarioCounts, testFileEx
128
200
  componentsOk,
129
201
  componentsMissing,
130
202
  componentsWithErrors,
203
+ componentsNeedingRecapture,
204
+ componentsAnalysisFailed,
131
205
  totalFunctions: functionResults.length,
132
206
  functionsOk,
133
207
  functionsMissing,
134
208
  functionsFailing,
135
209
  functionsRunnerError,
136
210
  functionsNameMismatch,
211
+ functionsThinCoverage,
137
212
  allPassing: componentsMissing === 0 &&
138
213
  componentsWithErrors === 0 &&
214
+ componentsAnalysisFailed === 0 &&
139
215
  functionsFailing === 0 &&
140
216
  functionsRunnerError === 0 &&
141
217
  functionsNameMismatch === 0 &&
@@ -144,32 +220,167 @@ export function computeAudit({ components, functions, scenarioCounts, testFileEx
144
220
  };
145
221
  }
146
222
  /**
147
- * Returns true when the audit failure can be auto-fixed by running
148
- * analyze-imports: incomplete entities are the only issue AND we haven't
149
- * already tried (to prevent infinite retry loops when analysis has errors).
223
+ * Returns true when the audit failure can be auto-fixed inline.
224
+ *
225
+ * Always returns false full analyze-imports takes minutes on large projects
226
+ * and must never run as part of the audit. The audit only does lightweight
227
+ * entity SHA backfill. Users should run `codeyam editor analyze-imports`
228
+ * separately if incomplete entities persist.
150
229
  */
151
- export function isAutoRemediable(summary, alreadyAttempted) {
152
- if (alreadyAttempted)
153
- return false;
154
- if (!summary.incompleteEntities || summary.incompleteEntities === 0)
155
- return false;
156
- return isOnlyIncompleteEntities(summary);
230
+ export function isAutoRemediable(_summary, _alreadyAttempted) {
231
+ return false;
232
+ }
233
+ /**
234
+ * Determine whether the audit should auto-recapture stale scenarios.
235
+ * Returns true when the `--fix` flag is set AND there are stale scenarios.
236
+ */
237
+ export function shouldAutoRecapture(params) {
238
+ return params.fix && params.scenariosNeedingRecapture.length > 0;
239
+ }
240
+ /**
241
+ * Extract unique file paths that need targeted analysis from audit results.
242
+ *
243
+ * After a DB-only backfill attempt fails, these are the files that need
244
+ * `analyze-imports` to create entity records. Unlike full analyze-imports
245
+ * (which scans ALL glossary + page files), this returns only the specific
246
+ * files that have unresolved associations — typically 1-3 files.
247
+ */
248
+ export function determineTargetedAnalysisPaths(auditData) {
249
+ const paths = new Set();
250
+ for (const u of auditData.unassociatedScenarios) {
251
+ if (u.filePath)
252
+ paths.add(u.filePath);
253
+ }
254
+ for (const e of auditData.incompleteEntities) {
255
+ if (e.filePath)
256
+ paths.add(e.filePath);
257
+ }
258
+ return [...paths];
259
+ }
260
+ /**
261
+ * Generate clear, actionable guidance for an incomplete entity.
262
+ *
263
+ * Tells Claude exactly what's wrong, whether it's pre-existing, and
264
+ * the exact command to fix it — no guessing required.
265
+ */
266
+ export function formatIncompleteEntityGuidance(entity) {
267
+ const parts = [];
268
+ if (entity.preExisting) {
269
+ parts.push(`${entity.name}: ${entity.scenarioCount} scenario(s) without import graph (pre-existing issue, not from this session).`);
270
+ parts.push(`This is non-blocking — the entity had scenarios before this session but analyze-imports was never run for it.`);
271
+ }
272
+ else {
273
+ parts.push(`${entity.name}: ${entity.scenarioCount} scenario(s) without import graph — analyze-imports has not been run for this entity.`);
274
+ parts.push(`The entity has scenarios registered but its import graph is not built, so the editor cannot track its dependencies.`);
275
+ }
276
+ parts.push(`Fix: Run \`codeyam editor analyze-imports\` to build the import graph for all entities.`);
277
+ return parts.join(' ');
157
278
  }
158
279
  /**
159
- * Returns true when incompleteEntities is the ONLY audit failure —
160
- * all other failure counts are zero. Used to decide whether auto-running
161
- * analyze-imports can fix the audit without manual intervention.
280
+ * Generate step-by-step manual analysis instructions for an entity
281
+ * whose automated analysis has persistently failed.
282
+ *
283
+ * Used by the audit when analysis-failures.json contains the entity.
284
+ * Tells Claude exactly how to read the source, gather imports/types,
285
+ * and run `codeyam editor manual-entity` to unblock the audit.
286
+ */
287
+ export function formatManualAnalysisGuidance(entity) {
288
+ const lines = [];
289
+ lines.push(`${entity.name}: ${entity.scenarioCount} scenario(s) — automated analysis failed`);
290
+ lines.push(`Error: ${entity.error}`);
291
+ lines.push('');
292
+ lines.push('MANUAL ANALYSIS REQUIRED — follow these steps:');
293
+ lines.push(`1. Read ${entity.filePath}`);
294
+ lines.push('2. Identify which glossary entities it imports (check .codeyam/glossary.json)');
295
+ lines.push('3. Determine entity type: "visual" if it returns JSX, "library" otherwise');
296
+ lines.push('4. Identify the type structure:');
297
+ lines.push(' - For components: props interface and hook return types');
298
+ lines.push(' - For functions: parameter types and return type');
299
+ lines.push(`5. Write the JSON to .codeyam/tmp/manual-entity.json then run: codeyam editor manual-entity @.codeyam/tmp/manual-entity.json`);
300
+ return lines.join('\n');
301
+ }
302
+ /**
303
+ * Resolve incomplete entity SHAs to their source file paths.
304
+ *
305
+ * Used by the audit to run targeted analysis on just the files that need it,
306
+ * instead of scanning all 117+ project files. Returns deduplicated file paths.
307
+ */
308
+ export async function getIncompleteEntityFilePaths(db, incompleteEntities) {
309
+ if (incompleteEntities.length === 0)
310
+ return [];
311
+ const shas = incompleteEntities.map((e) => e.entitySha);
312
+ const rows = await db
313
+ .selectFrom('entities')
314
+ .select('file_path')
315
+ .where('sha', 'in', shas)
316
+ .execute();
317
+ const paths = new Set();
318
+ for (const row of rows) {
319
+ if (row.file_path)
320
+ paths.add(row.file_path);
321
+ }
322
+ return [...paths];
323
+ }
324
+ /**
325
+ * Returns true when the only audit failures are auto-fixable entity issues
326
+ * (incompleteEntities and/or unassociatedScenarios) — all other failure
327
+ * counts are zero. Used to decide whether auto-running analyze-imports +
328
+ * entity SHA sync can fix the audit without manual intervention.
162
329
  */
163
330
  export function isOnlyIncompleteEntities(summary) {
164
331
  return ((summary.componentsMissing ?? 0) === 0 &&
165
332
  (summary.componentsWithErrors ?? 0) === 0 &&
166
333
  (summary.functionsFailing ?? 0) === 0 &&
334
+ (summary.functionsRunnerError ?? 0) === 0 &&
167
335
  (summary.functionsNameMismatch ?? 0) === 0 &&
168
336
  (summary.functionsMissing ?? 0) === 0 &&
169
337
  (summary.missingFromGlossary ?? 0) === 0 &&
170
338
  (summary.miscategorizedScenarios ?? 0) === 0 &&
171
339
  (summary.scenariosNeedingRecapture ?? 0) === 0);
172
340
  }
341
+ /**
342
+ * Returns true when the only audit failures are incomplete entities that ALL
343
+ * existed before the current session. Used by the step gate to avoid blocking
344
+ * progress on pre-existing issues the user didn't cause.
345
+ *
346
+ * Requires both the summary (to confirm no other failure types) and the
347
+ * incompleteEntities array (to verify every entry is pre-existing).
348
+ */
349
+ export function isOnlyPreExistingIncomplete(summary, incompleteEntities) {
350
+ // Must have at least one incomplete entity to be relevant
351
+ if (!incompleteEntities || incompleteEntities.length === 0)
352
+ return false;
353
+ // All other failure types must be zero
354
+ if (!isOnlyIncompleteEntities(summary))
355
+ return false;
356
+ // Every incomplete entity must be pre-existing
357
+ return incompleteEntities.every((e) => e.preExisting);
358
+ }
359
+ /**
360
+ * Filter a list of file paths to only those that need analysis.
361
+ *
362
+ * A file is excluded if ANY entity at that file path has an analysis
363
+ * record (direct or inherited from a sibling version with the same
364
+ * name+filePath). Everything else passes through.
365
+ *
366
+ * Used by handleAnalyzeImports to avoid re-analyzing ~120 files when
367
+ * only a few need it.
368
+ */
369
+ export async function filterToIncompleteFilePaths(db, _projectId, allFilePaths) {
370
+ if (allFilePaths.length === 0)
371
+ return [];
372
+ // Single query: find all file paths that have at least one entity
373
+ // with an analysis record. These are already analyzed and can be skipped.
374
+ const analyzedRows = await db
375
+ .selectFrom('entities')
376
+ .innerJoin('analyses', 'analyses.entity_sha', 'entities.sha')
377
+ .select('entities.file_path')
378
+ .where('entities.file_path', 'in', allFilePaths)
379
+ .groupBy('entities.file_path')
380
+ .execute();
381
+ const analyzedFilePaths = new Set(analyzedRows.map((r) => r.file_path));
382
+ return allFilePaths.filter((fp) => !analyzedFilePaths.has(fp));
383
+ }
173
384
  /**
174
385
  * Ensures the two audit filters — glossary scoping and scenario-count scoping —
175
386
  * are consistent. When entityChangeStatus is empty/undefined (meaning the glossary
@@ -253,24 +464,41 @@ export async function queryIncompleteEntities(db, projectId, featureStartedAt) {
253
464
  // A new entity version (created by the file watcher) may not have direct
254
465
  // analyses, but an older version (same name+filePath) might. This matches
255
466
  // getAllEntities() behavior which inherits analyses across versions.
256
- const entityNames = [
257
- ...new Set(entityRows.map((r) => r.name).filter(Boolean)),
467
+ // IMPORTANT: Must match by name+filePath, not name alone. When a component
468
+ // is extracted to a new file, the old version (different filePath) may have
469
+ // analyses but getAllEntities() won't inherit across different file paths.
470
+ const entityFilePathMap = new Map(entityRows.map((r) => [r.sha, r.file_path]));
471
+ const entityKeys = [
472
+ ...new Set(entityRows
473
+ .map((r) => `${r.name}::${r.file_path}`)
474
+ .filter((k) => !k.startsWith('::') && !k.endsWith('::'))),
258
475
  ];
259
- let namesWithInheritedAnalyses = new Set();
260
- if (entityNames.length > 0) {
476
+ let keysWithInheritedAnalyses = new Set();
477
+ if (entityKeys.length > 0) {
478
+ // We need to find entities that share name+filePath AND have analyses.
479
+ // Since Kysely doesn't support WHERE (name || '::' || file_path) IN (...),
480
+ // query by the entity names and filter by filePath in JS.
481
+ const entityNames = [
482
+ ...new Set(entityRows.map((r) => r.name).filter(Boolean)),
483
+ ];
261
484
  const siblingRows = await db
262
485
  .selectFrom('entities')
263
486
  .innerJoin('analyses', 'analyses.entity_sha', 'entities.sha')
264
- .select('entities.name')
487
+ .select(['entities.name', 'entities.file_path'])
265
488
  .where('entities.name', 'in', entityNames)
266
- .groupBy('entities.name')
489
+ .groupBy(['entities.name', 'entities.file_path'])
267
490
  .execute();
268
- namesWithInheritedAnalyses = new Set(siblingRows.map((r) => r.name));
491
+ keysWithInheritedAnalyses = new Set(siblingRows.map((r) => `${r.name}::${r.file_path}`));
269
492
  }
270
- // Filter out entities that have inherited analyses
493
+ // Filter out entities that have inherited analyses (same name+filePath)
271
494
  const trulyIncompleteShas = incompleteShas.filter((r) => {
272
- const name = entityNameMap.get(r.entity_sha);
273
- return !name || !namesWithInheritedAnalyses.has(name);
495
+ const sha = r.entity_sha;
496
+ const name = entityNameMap.get(sha);
497
+ const filePath = entityFilePathMap.get(sha);
498
+ if (!name)
499
+ return false; // No entity record (phantom SHA) — skip, not fixable by analysis
500
+ const key = `${name}::${filePath}`;
501
+ return !keysWithInheritedAnalyses.has(key);
274
502
  });
275
503
  if (trulyIncompleteShas.length === 0)
276
504
  return [];
@@ -436,6 +664,72 @@ export async function queryPageScenarioCounts(db, projectId, featureStartedAt) {
436
664
  }
437
665
  return counts;
438
666
  }
667
+ // ─── Unassociated Scenarios ───────────────────────────────────────────
668
+ /**
669
+ * Find scenarios with NULL entity_sha that have a file path
670
+ * (component_path or page_file_path). These scenarios were registered
671
+ * before entity records existed in the DB — typically because a subagent
672
+ * registered scenarios without running analyze-imports first.
673
+ *
674
+ * Fix: run `codeyam editor analyze-imports` to create entity records,
675
+ * then entity_sha backfill will associate them automatically.
676
+ *
677
+ * Optionally scoped to the current feature session via featureStartedAt.
678
+ */
679
+ export async function queryUnassociatedScenarios(db, projectId, featureStartedAt) {
680
+ let query = db
681
+ .selectFrom('editor_scenarios')
682
+ .select(['component_name', 'component_path', 'page_file_path', 'name'])
683
+ .where('project_id', '=', projectId)
684
+ .where('entity_sha', 'is', null)
685
+ .where((eb) => eb.or([
686
+ eb('component_path', 'is not', null),
687
+ eb('page_file_path', 'is not', null),
688
+ ]));
689
+ if (featureStartedAt) {
690
+ const sqliteTimestamp = featureStartedAt
691
+ .replace('T', ' ')
692
+ .replace(/\.\d{3}Z$/, '');
693
+ query = query.where((eb) => eb.or([
694
+ eb('created_at', '>=', sqliteTimestamp),
695
+ eb('updated_at', '>=', sqliteTimestamp),
696
+ ]));
697
+ }
698
+ const rows = await query.execute();
699
+ if (rows.length === 0)
700
+ return [];
701
+ // Group by file path (component_path or page_file_path)
702
+ const groups = new Map();
703
+ for (const row of rows) {
704
+ const r = row;
705
+ const filePath = r.component_path || r.page_file_path;
706
+ const existing = groups.get(filePath);
707
+ if (existing) {
708
+ existing.scenarioNames.push(r.name);
709
+ }
710
+ else {
711
+ // Derive a display name: use component_name if available,
712
+ // otherwise extract from file path (e.g., "src/lib/LibraryApp.tsx" → "LibraryApp")
713
+ const displayName = r.component_name ||
714
+ filePath
715
+ .split('/')
716
+ .pop()
717
+ ?.replace(/\.\w+$/, '') ||
718
+ filePath;
719
+ groups.set(filePath, {
720
+ name: displayName,
721
+ filePath,
722
+ scenarioNames: [r.name],
723
+ });
724
+ }
725
+ }
726
+ return [...groups.values()].map((g) => ({
727
+ name: g.name,
728
+ filePath: g.filePath,
729
+ scenarioCount: g.scenarioNames.length,
730
+ scenarioNames: g.scenarioNames,
731
+ }));
732
+ }
439
733
  // ─── Duplicate Name Detection ─────────────────────────────────────────
440
734
  /**
441
735
  * Detect glossary entries that share the same `name`.
@@ -485,6 +779,10 @@ export function identifyScenariosNeedingRecapture(params) {
485
779
  const changeStatus = entityChangeStatus[scenario.entityName];
486
780
  if (!changeStatus)
487
781
  continue;
782
+ // "new" entities need initial scenario creation, not recapture.
783
+ // Only "edited" and "impacted" entities have stale screenshots.
784
+ if (changeStatus.status === 'new')
785
+ continue;
488
786
  result.push({
489
787
  scenarioName: scenario.name,
490
788
  entityName: scenario.entityName,
@@ -493,4 +791,59 @@ export function identifyScenariosNeedingRecapture(params) {
493
791
  }
494
792
  return result;
495
793
  }
794
+ // ─── Client Error Aggregation ─────────────────────────────────────────
795
+ /**
796
+ * Aggregate client errors by component name using scenario metadata.
797
+ *
798
+ * Given a map of scenario ID → { scenarioName, errors } and a list of
799
+ * scenario metadata (with componentName from the DB), group errors by
800
+ * the component they belong to.
801
+ *
802
+ * For component scenarios: use the `componentName` field directly.
803
+ * For app-level scenarios (no componentName): derive the entity name
804
+ * using `scenarioEntityName()` — the same canonical function used by
805
+ * recapture detection and entity change status. This ensures the keys
806
+ * match what `computeAudit` checks against glossary entry names.
807
+ *
808
+ * This replaces the fragile "parse component name from scenario name"
809
+ * approach which fails for app-level scenarios like "Full Page with Library".
810
+ */
811
+ export function aggregateClientErrorsByComponent(clientErrors, scenarioMetadata) {
812
+ const result = {};
813
+ // Build a lookup from scenario name → component/entity name.
814
+ // Uses scenarioEntityName() for consistency with the rest of the system
815
+ // (recapture detection, entity change status, journal filtering).
816
+ const scenarioToComponent = new Map();
817
+ for (const meta of scenarioMetadata) {
818
+ const entityName = scenarioEntityName({
819
+ componentName: meta.componentName,
820
+ pageFilePath: meta.pageFilePath,
821
+ url: meta.url,
822
+ });
823
+ if (entityName) {
824
+ scenarioToComponent.set(meta.name, entityName);
825
+ }
826
+ }
827
+ for (const [, data] of Object.entries(clientErrors)) {
828
+ if (data.errors.length === 0)
829
+ continue;
830
+ // First try: look up via scenario metadata (authoritative)
831
+ let componentName = scenarioToComponent.get(data.scenarioName);
832
+ // Fallback: parse from scenario name convention "ComponentName - Variant"
833
+ if (!componentName) {
834
+ const dashIndex = data.scenarioName.indexOf(' - ');
835
+ componentName =
836
+ dashIndex >= 0
837
+ ? data.scenarioName.slice(0, dashIndex)
838
+ : data.scenarioName;
839
+ }
840
+ if (componentName) {
841
+ if (!result[componentName]) {
842
+ result[componentName] = [];
843
+ }
844
+ result[componentName].push(...data.errors);
845
+ }
846
+ }
847
+ return result;
848
+ }
496
849
  //# sourceMappingURL=editorAudit.js.map