@codeyam/codeyam-cli 0.1.0-staging.b8f4f94 → 0.1.0-staging.ba3f279

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 (580) 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 +5 -5
  4. package/analyzer-template/packages/ai/package.json +1 -1
  5. package/analyzer-template/packages/ai/src/lib/astScopes/methodSemantics.ts +135 -0
  6. package/analyzer-template/packages/ai/src/lib/astScopes/nodeToSource.ts +19 -0
  7. package/analyzer-template/packages/ai/src/lib/astScopes/paths.ts +11 -4
  8. package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +36 -9
  9. package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/ParentScopeManager.ts +10 -3
  10. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.ts +16 -6
  11. package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +0 -33
  12. package/analyzer-template/packages/analyze/index.ts +4 -1
  13. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +28 -2
  14. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +5 -36
  15. package/analyzer-template/packages/analyze/src/lib/files/analyze/findOrCreateEntity.ts +10 -6
  16. package/analyzer-template/packages/analyze/src/lib/files/analyze/gatherEntityMap.ts +9 -12
  17. package/analyzer-template/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.ts +21 -0
  18. package/analyzer-template/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.ts +82 -10
  19. package/analyzer-template/packages/analyze/src/lib/files/analyzeChange.ts +4 -0
  20. package/analyzer-template/packages/analyze/src/lib/files/analyzeInitial.ts +4 -0
  21. package/analyzer-template/packages/analyze/src/lib/files/analyzeNextRoute.ts +8 -3
  22. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +239 -58
  23. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.ts +0 -98
  24. package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +1684 -1462
  25. package/analyzer-template/packages/aws/package.json +2 -2
  26. package/analyzer-template/packages/database/package.json +2 -2
  27. package/analyzer-template/packages/database/src/lib/kysely/tables/editorScenariosTable.ts +102 -0
  28. package/analyzer-template/packages/database/src/lib/loadAnalysis.ts +25 -15
  29. package/analyzer-template/packages/database/src/lib/loadEntities.ts +0 -6
  30. package/analyzer-template/packages/database/src/lib/loadEntity.ts +19 -8
  31. package/analyzer-template/packages/database/src/lib/updateCommitMetadata.ts +0 -65
  32. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts +9 -0
  33. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts.map +1 -1
  34. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js +104 -0
  35. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -1
  36. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.d.ts.map +1 -1
  37. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.js +7 -1
  38. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.js.map +1 -1
  39. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.d.ts.map +1 -1
  40. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js +0 -6
  41. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js.map +1 -1
  42. package/analyzer-template/packages/github/dist/database/src/lib/loadEntity.d.ts +4 -1
  43. package/analyzer-template/packages/github/dist/database/src/lib/loadEntity.d.ts.map +1 -1
  44. package/analyzer-template/packages/github/dist/database/src/lib/loadEntity.js +5 -5
  45. package/analyzer-template/packages/github/dist/database/src/lib/loadEntity.js.map +1 -1
  46. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.d.ts.map +1 -1
  47. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js +0 -25
  48. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js.map +1 -1
  49. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.d.ts +2 -0
  50. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.d.ts.map +1 -1
  51. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.js +2 -0
  52. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.js.map +1 -1
  53. package/analyzer-template/packages/types/src/enums/ProjectFramework.ts +2 -0
  54. package/analyzer-template/packages/ui-components/package.json +1 -1
  55. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.d.ts +2 -0
  56. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.d.ts.map +1 -1
  57. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.js +2 -0
  58. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.js.map +1 -1
  59. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.d.ts +3 -1
  60. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.d.ts.map +1 -1
  61. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js +22 -1
  62. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js.map +1 -1
  63. package/analyzer-template/packages/utils/src/lib/fs/rsyncCopy.ts +27 -0
  64. package/analyzer-template/project/analyzeFileEntities.ts +26 -0
  65. package/analyzer-template/project/runMultiScenarioServer.ts +26 -3
  66. package/background/src/lib/virtualized/project/analyzeFileEntities.js +22 -0
  67. package/background/src/lib/virtualized/project/analyzeFileEntities.js.map +1 -1
  68. package/background/src/lib/virtualized/project/runMultiScenarioServer.js +23 -3
  69. package/background/src/lib/virtualized/project/runMultiScenarioServer.js.map +1 -1
  70. package/codeyam-cli/src/cli.js +24 -0
  71. package/codeyam-cli/src/cli.js.map +1 -1
  72. package/codeyam-cli/src/commands/__tests__/editor.analyzeImportsArgs.test.js +47 -0
  73. package/codeyam-cli/src/commands/__tests__/editor.analyzeImportsArgs.test.js.map +1 -0
  74. package/codeyam-cli/src/commands/__tests__/editor.auditNoAutoAnalysis.test.js +71 -0
  75. package/codeyam-cli/src/commands/__tests__/editor.auditNoAutoAnalysis.test.js.map +1 -0
  76. package/codeyam-cli/src/commands/__tests__/editor.designSystem.test.js +30 -0
  77. package/codeyam-cli/src/commands/__tests__/editor.designSystem.test.js.map +1 -0
  78. package/codeyam-cli/src/commands/__tests__/editor.isolateArgs.test.js +51 -0
  79. package/codeyam-cli/src/commands/__tests__/editor.isolateArgs.test.js.map +1 -0
  80. package/codeyam-cli/src/commands/__tests__/editor.statePersistence.test.js +55 -0
  81. package/codeyam-cli/src/commands/__tests__/editor.statePersistence.test.js.map +1 -0
  82. package/codeyam-cli/src/commands/__tests__/editor.stepDispatch.test.js +56 -0
  83. package/codeyam-cli/src/commands/__tests__/editor.stepDispatch.test.js.map +1 -0
  84. package/codeyam-cli/src/commands/__tests__/init.gitignore.test.js +101 -47
  85. package/codeyam-cli/src/commands/__tests__/init.gitignore.test.js.map +1 -1
  86. package/codeyam-cli/src/commands/editor.js +4623 -678
  87. package/codeyam-cli/src/commands/editor.js.map +1 -1
  88. package/codeyam-cli/src/commands/editorAnalyzeImportsArgs.js +23 -0
  89. package/codeyam-cli/src/commands/editorAnalyzeImportsArgs.js.map +1 -0
  90. package/codeyam-cli/src/commands/editorIsolateArgs.js +25 -0
  91. package/codeyam-cli/src/commands/editorIsolateArgs.js.map +1 -0
  92. package/codeyam-cli/src/commands/init.js +69 -34
  93. package/codeyam-cli/src/commands/init.js.map +1 -1
  94. package/codeyam-cli/src/commands/telemetry.js +37 -0
  95. package/codeyam-cli/src/commands/telemetry.js.map +1 -0
  96. package/codeyam-cli/src/data/designSystems.js +27 -0
  97. package/codeyam-cli/src/data/designSystems.js.map +1 -0
  98. package/codeyam-cli/src/data/techStacks.js +77 -0
  99. package/codeyam-cli/src/data/techStacks.js.map +1 -0
  100. package/codeyam-cli/src/utils/__tests__/analyzerFinalization.test.js +173 -0
  101. package/codeyam-cli/src/utils/__tests__/analyzerFinalization.test.js.map +1 -0
  102. package/codeyam-cli/src/utils/__tests__/backgroundServer.test.js +46 -0
  103. package/codeyam-cli/src/utils/__tests__/backgroundServer.test.js.map +1 -0
  104. package/codeyam-cli/src/utils/__tests__/devServerState.test.js +134 -0
  105. package/codeyam-cli/src/utils/__tests__/devServerState.test.js.map +1 -0
  106. package/codeyam-cli/src/utils/__tests__/editorApi.test.js +181 -0
  107. package/codeyam-cli/src/utils/__tests__/editorApi.test.js.map +1 -0
  108. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +3545 -1
  109. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -1
  110. package/codeyam-cli/src/utils/__tests__/editorBroadcastViewport.test.js +76 -0
  111. package/codeyam-cli/src/utils/__tests__/editorBroadcastViewport.test.js.map +1 -0
  112. package/codeyam-cli/src/utils/__tests__/editorCapture.test.js +93 -0
  113. package/codeyam-cli/src/utils/__tests__/editorCapture.test.js.map +1 -0
  114. package/codeyam-cli/src/utils/__tests__/editorCaptureScenarioSeeding.test.js +137 -0
  115. package/codeyam-cli/src/utils/__tests__/editorCaptureScenarioSeeding.test.js.map +1 -0
  116. package/codeyam-cli/src/utils/__tests__/editorDeleteScenario.test.js +100 -0
  117. package/codeyam-cli/src/utils/__tests__/editorDeleteScenario.test.js.map +1 -0
  118. package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js +181 -3
  119. package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js.map +1 -1
  120. package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js +194 -0
  121. package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js.map +1 -0
  122. package/codeyam-cli/src/utils/__tests__/editorEntityHelpers.test.js +381 -0
  123. package/codeyam-cli/src/utils/__tests__/editorEntityHelpers.test.js.map +1 -0
  124. package/codeyam-cli/src/utils/__tests__/editorGuardMiddleware.test.js +67 -0
  125. package/codeyam-cli/src/utils/__tests__/editorGuardMiddleware.test.js.map +1 -0
  126. package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js +294 -0
  127. package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js.map +1 -0
  128. package/codeyam-cli/src/utils/__tests__/editorJournal.test.js +238 -2
  129. package/codeyam-cli/src/utils/__tests__/editorJournal.test.js.map +1 -1
  130. package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js +594 -0
  131. package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js.map +1 -0
  132. package/codeyam-cli/src/utils/__tests__/editorMigration.test.js +435 -0
  133. package/codeyam-cli/src/utils/__tests__/editorMigration.test.js.map +1 -0
  134. package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js +118 -1
  135. package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js.map +1 -1
  136. package/codeyam-cli/src/utils/__tests__/editorPreview.test.js +217 -3
  137. package/codeyam-cli/src/utils/__tests__/editorPreview.test.js.map +1 -1
  138. package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js +153 -0
  139. package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js.map +1 -0
  140. package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js +139 -0
  141. package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js.map +1 -0
  142. package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js +411 -0
  143. package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js.map +1 -0
  144. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js +1665 -2
  145. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js.map +1 -1
  146. package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js +413 -0
  147. package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js.map +1 -0
  148. package/codeyam-cli/src/utils/__tests__/editorSeedAdapterPrismaValidation.test.js +143 -0
  149. package/codeyam-cli/src/utils/__tests__/editorSeedAdapterPrismaValidation.test.js.map +1 -0
  150. package/codeyam-cli/src/utils/__tests__/editorSessionFilter.test.js +66 -0
  151. package/codeyam-cli/src/utils/__tests__/editorSessionFilter.test.js.map +1 -0
  152. package/codeyam-cli/src/utils/__tests__/editorShouldRevalidate.test.js +53 -0
  153. package/codeyam-cli/src/utils/__tests__/editorShouldRevalidate.test.js.map +1 -0
  154. package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js +905 -1
  155. package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js.map +1 -1
  156. package/codeyam-cli/src/utils/__tests__/glossaryAdd.test.js +177 -0
  157. package/codeyam-cli/src/utils/__tests__/glossaryAdd.test.js.map +1 -0
  158. package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js +122 -0
  159. package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js.map +1 -0
  160. package/codeyam-cli/src/utils/__tests__/manualEntityAnalysis.test.js +302 -0
  161. package/codeyam-cli/src/utils/__tests__/manualEntityAnalysis.test.js.map +1 -0
  162. package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js +129 -0
  163. package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js.map +1 -0
  164. package/codeyam-cli/src/utils/__tests__/registerScenarioResult.test.js +127 -0
  165. package/codeyam-cli/src/utils/__tests__/registerScenarioResult.test.js.map +1 -0
  166. package/codeyam-cli/src/utils/__tests__/routePatternMatching.test.js +118 -0
  167. package/codeyam-cli/src/utils/__tests__/routePatternMatching.test.js.map +1 -0
  168. package/codeyam-cli/src/utils/__tests__/scenarioCoverage.test.js +284 -0
  169. package/codeyam-cli/src/utils/__tests__/scenarioCoverage.test.js.map +1 -0
  170. package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js +672 -0
  171. package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js.map +1 -0
  172. package/codeyam-cli/src/utils/__tests__/screenshotHash.test.js +84 -0
  173. package/codeyam-cli/src/utils/__tests__/screenshotHash.test.js.map +1 -0
  174. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +26 -5
  175. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
  176. package/codeyam-cli/src/utils/__tests__/telemetry.test.js +159 -0
  177. package/codeyam-cli/src/utils/__tests__/telemetry.test.js.map +1 -0
  178. package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js +51 -0
  179. package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js.map +1 -0
  180. package/codeyam-cli/src/utils/__tests__/testRunner.test.js +216 -0
  181. package/codeyam-cli/src/utils/__tests__/testRunner.test.js.map +1 -0
  182. package/codeyam-cli/src/utils/__tests__/webappDetection.test.js +148 -0
  183. package/codeyam-cli/src/utils/__tests__/webappDetection.test.js.map +1 -0
  184. package/codeyam-cli/src/utils/analysisRunner.js +39 -8
  185. package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
  186. package/codeyam-cli/src/utils/analyzer.js +19 -0
  187. package/codeyam-cli/src/utils/analyzer.js.map +1 -1
  188. package/codeyam-cli/src/utils/analyzerFinalization.js +100 -0
  189. package/codeyam-cli/src/utils/analyzerFinalization.js.map +1 -0
  190. package/codeyam-cli/src/utils/backgroundServer.js +93 -17
  191. package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
  192. package/codeyam-cli/src/utils/database.js +37 -2
  193. package/codeyam-cli/src/utils/database.js.map +1 -1
  194. package/codeyam-cli/src/utils/devServerState.js +71 -0
  195. package/codeyam-cli/src/utils/devServerState.js.map +1 -0
  196. package/codeyam-cli/src/utils/editorApi.js +95 -0
  197. package/codeyam-cli/src/utils/editorApi.js.map +1 -0
  198. package/codeyam-cli/src/utils/editorAudit.js +732 -10
  199. package/codeyam-cli/src/utils/editorAudit.js.map +1 -1
  200. package/codeyam-cli/src/utils/editorBroadcastViewport.js +26 -0
  201. package/codeyam-cli/src/utils/editorBroadcastViewport.js.map +1 -0
  202. package/codeyam-cli/src/utils/editorCapture.js +102 -0
  203. package/codeyam-cli/src/utils/editorCapture.js.map +1 -0
  204. package/codeyam-cli/src/utils/editorDeleteScenario.js +67 -0
  205. package/codeyam-cli/src/utils/editorDeleteScenario.js.map +1 -0
  206. package/codeyam-cli/src/utils/editorDevServer.js +100 -1
  207. package/codeyam-cli/src/utils/editorDevServer.js.map +1 -1
  208. package/codeyam-cli/src/utils/editorEntityChangeStatus.js +50 -0
  209. package/codeyam-cli/src/utils/editorEntityChangeStatus.js.map +1 -0
  210. package/codeyam-cli/src/utils/editorEntityHelpers.js +144 -0
  211. package/codeyam-cli/src/utils/editorEntityHelpers.js.map +1 -0
  212. package/codeyam-cli/src/utils/editorGuard.js +36 -0
  213. package/codeyam-cli/src/utils/editorGuard.js.map +1 -0
  214. package/codeyam-cli/src/utils/editorImageVerifier.js +155 -0
  215. package/codeyam-cli/src/utils/editorImageVerifier.js.map +1 -0
  216. package/codeyam-cli/src/utils/editorJournal.js +85 -4
  217. package/codeyam-cli/src/utils/editorJournal.js.map +1 -1
  218. package/codeyam-cli/src/utils/editorLoaderHelpers.js +152 -0
  219. package/codeyam-cli/src/utils/editorLoaderHelpers.js.map +1 -0
  220. package/codeyam-cli/src/utils/editorMigration.js +224 -0
  221. package/codeyam-cli/src/utils/editorMigration.js.map +1 -0
  222. package/codeyam-cli/src/utils/editorMockState.js +1 -1
  223. package/codeyam-cli/src/utils/editorPreloadHelpers.js +72 -1
  224. package/codeyam-cli/src/utils/editorPreloadHelpers.js.map +1 -1
  225. package/codeyam-cli/src/utils/editorPreview.js +74 -1
  226. package/codeyam-cli/src/utils/editorPreview.js.map +1 -1
  227. package/codeyam-cli/src/utils/editorRecapture.js +109 -0
  228. package/codeyam-cli/src/utils/editorRecapture.js.map +1 -0
  229. package/codeyam-cli/src/utils/editorScenarioSwitch.js +149 -0
  230. package/codeyam-cli/src/utils/editorScenarioSwitch.js.map +1 -0
  231. package/codeyam-cli/src/utils/editorScenarios.js +621 -0
  232. package/codeyam-cli/src/utils/editorScenarios.js.map +1 -1
  233. package/codeyam-cli/src/utils/editorSeedAdapter.js +475 -0
  234. package/codeyam-cli/src/utils/editorSeedAdapter.js.map +1 -0
  235. package/codeyam-cli/src/utils/editorShouldRevalidate.js +21 -0
  236. package/codeyam-cli/src/utils/editorShouldRevalidate.js.map +1 -0
  237. package/codeyam-cli/src/utils/entityChangeStatus.js +143 -4
  238. package/codeyam-cli/src/utils/entityChangeStatus.js.map +1 -1
  239. package/codeyam-cli/src/utils/entityChangeStatus.server.js +227 -0
  240. package/codeyam-cli/src/utils/entityChangeStatus.server.js.map +1 -0
  241. package/codeyam-cli/src/utils/fileWatcher.js +38 -0
  242. package/codeyam-cli/src/utils/fileWatcher.js.map +1 -1
  243. package/codeyam-cli/src/utils/glossaryAdd.js +74 -0
  244. package/codeyam-cli/src/utils/glossaryAdd.js.map +1 -0
  245. package/codeyam-cli/src/utils/install-skills.js +14 -0
  246. package/codeyam-cli/src/utils/install-skills.js.map +1 -1
  247. package/codeyam-cli/src/utils/manualEntityAnalysis.js +196 -0
  248. package/codeyam-cli/src/utils/manualEntityAnalysis.js.map +1 -0
  249. package/codeyam-cli/src/utils/parseRegisterArg.js +31 -0
  250. package/codeyam-cli/src/utils/parseRegisterArg.js.map +1 -0
  251. package/codeyam-cli/src/utils/progress.js +2 -2
  252. package/codeyam-cli/src/utils/progress.js.map +1 -1
  253. package/codeyam-cli/src/utils/queue/__tests__/job.interactiveStart.test.js +159 -0
  254. package/codeyam-cli/src/utils/queue/__tests__/job.interactiveStart.test.js.map +1 -0
  255. package/codeyam-cli/src/utils/queue/job.js +35 -6
  256. package/codeyam-cli/src/utils/queue/job.js.map +1 -1
  257. package/codeyam-cli/src/utils/registerScenarioResult.js +52 -0
  258. package/codeyam-cli/src/utils/registerScenarioResult.js.map +1 -0
  259. package/codeyam-cli/src/utils/routePatternMatching.js +129 -0
  260. package/codeyam-cli/src/utils/routePatternMatching.js.map +1 -0
  261. package/codeyam-cli/src/utils/scenarioCoverage.js +77 -0
  262. package/codeyam-cli/src/utils/scenarioCoverage.js.map +1 -0
  263. package/codeyam-cli/src/utils/scenariosManifest.js +313 -0
  264. package/codeyam-cli/src/utils/scenariosManifest.js.map +1 -0
  265. package/codeyam-cli/src/utils/screenshotHash.js +26 -0
  266. package/codeyam-cli/src/utils/screenshotHash.js.map +1 -0
  267. package/codeyam-cli/src/utils/serverState.js +30 -0
  268. package/codeyam-cli/src/utils/serverState.js.map +1 -1
  269. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +42 -15
  270. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
  271. package/codeyam-cli/src/utils/simulationGateMiddleware.js +17 -1
  272. package/codeyam-cli/src/utils/simulationGateMiddleware.js.map +1 -1
  273. package/codeyam-cli/src/utils/slugUtils.js +25 -0
  274. package/codeyam-cli/src/utils/slugUtils.js.map +1 -0
  275. package/codeyam-cli/src/utils/syncMocksMiddleware.js +2 -2
  276. package/codeyam-cli/src/utils/syncMocksMiddleware.js.map +1 -1
  277. package/codeyam-cli/src/utils/telemetry.js +106 -0
  278. package/codeyam-cli/src/utils/telemetry.js.map +1 -0
  279. package/codeyam-cli/src/utils/telemetryMiddleware.js +22 -0
  280. package/codeyam-cli/src/utils/telemetryMiddleware.js.map +1 -0
  281. package/codeyam-cli/src/utils/testResultCache.js +53 -0
  282. package/codeyam-cli/src/utils/testResultCache.js.map +1 -0
  283. package/codeyam-cli/src/utils/testResultCache.server.js +81 -0
  284. package/codeyam-cli/src/utils/testResultCache.server.js.map +1 -0
  285. package/codeyam-cli/src/utils/testResultCache.server.test.js +187 -0
  286. package/codeyam-cli/src/utils/testResultCache.server.test.js.map +1 -0
  287. package/codeyam-cli/src/utils/testResultCache.test.js +230 -0
  288. package/codeyam-cli/src/utils/testResultCache.test.js.map +1 -0
  289. package/codeyam-cli/src/utils/testRunner.js +193 -1
  290. package/codeyam-cli/src/utils/testRunner.js.map +1 -1
  291. package/codeyam-cli/src/utils/webappDetection.js +25 -2
  292. package/codeyam-cli/src/utils/webappDetection.js.map +1 -1
  293. package/codeyam-cli/src/webserver/__tests__/api.interactive-switch-scenario.test.js +98 -0
  294. package/codeyam-cli/src/webserver/__tests__/api.interactive-switch-scenario.test.js.map +1 -0
  295. package/codeyam-cli/src/webserver/__tests__/buildPtyEnv.test.js +35 -0
  296. package/codeyam-cli/src/webserver/__tests__/buildPtyEnv.test.js.map +1 -0
  297. package/codeyam-cli/src/webserver/__tests__/clientErrors.test.js +107 -0
  298. package/codeyam-cli/src/webserver/__tests__/clientErrors.test.js.map +1 -0
  299. package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js +647 -0
  300. package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js.map +1 -0
  301. package/codeyam-cli/src/webserver/__tests__/idleDetector.test.js +315 -0
  302. package/codeyam-cli/src/webserver/__tests__/idleDetector.test.js.map +1 -0
  303. package/codeyam-cli/src/webserver/__tests__/stripClaudeCommand.test.js +135 -0
  304. package/codeyam-cli/src/webserver/__tests__/stripClaudeCommand.test.js.map +1 -0
  305. package/codeyam-cli/src/webserver/app/lib/clientErrors.js +86 -0
  306. package/codeyam-cli/src/webserver/app/lib/clientErrors.js.map +1 -0
  307. package/codeyam-cli/src/webserver/app/lib/git.js +397 -0
  308. package/codeyam-cli/src/webserver/app/lib/git.js.map +1 -0
  309. package/codeyam-cli/src/webserver/app/routes/api.interactive-switch-scenario.js +34 -0
  310. package/codeyam-cli/src/webserver/app/routes/api.interactive-switch-scenario.js.map +1 -0
  311. package/codeyam-cli/src/webserver/app/types/editor.js +8 -0
  312. package/codeyam-cli/src/webserver/app/types/editor.js.map +1 -0
  313. package/codeyam-cli/src/webserver/backgroundServer.js +60 -61
  314. package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
  315. package/codeyam-cli/src/webserver/build/client/assets/CopyButton-CLe80MMu.js +1 -0
  316. package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-C76mRRiF.js → EntityItem-Crt_KN_U.js} +5 -5
  317. package/codeyam-cli/src/webserver/build/client/assets/EntityTypeBadge-CQgyEGV-.js +1 -0
  318. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-CobE682z.js → EntityTypeIcon-CD7lGABo.js} +9 -9
  319. package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-CgTNOhnu.js +1 -0
  320. package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-DtYTSPL2.js +25 -0
  321. package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-D3s1MFkb.js +3 -0
  322. package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-BU_OAEMP.js → LoadingDots-By5zI316.js} +1 -1
  323. package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-ceAyBX-H.js → LogViewer-CM5zg40N.js} +3 -3
  324. package/codeyam-cli/src/webserver/build/client/assets/MiniClaudeChat-CQENLSrF.js +36 -0
  325. package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-djPLI-WV.js → ReportIssueModal-C2PLkej3.js} +4 -4
  326. package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-DanvyBPb.js +1 -0
  327. package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-B76aig_2.js → ScenarioViewer-CefgqbCr.js} +3 -3
  328. package/codeyam-cli/src/webserver/build/client/assets/Spinner-Bc8BG-Lw.js +34 -0
  329. package/codeyam-cli/src/webserver/build/client/assets/TruncatedFilePath-CK7-NaPZ.js +1 -0
  330. package/codeyam-cli/src/webserver/build/client/assets/ViewportInspectBar-BA_Ry-rs.js +1 -0
  331. package/codeyam-cli/src/webserver/build/client/assets/{_index-C96V0n15.js → _index-C1YkzTAV.js} +4 -4
  332. package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-BpKzcsJz.js → activity.(_tab)-yH46LLUz.js} +8 -8
  333. package/codeyam-cli/src/webserver/build/client/assets/addon-canvas-DpzMmAy5.js +1 -0
  334. package/codeyam-cli/src/webserver/build/client/assets/addon-fit-YJmn1quW.js +12 -0
  335. package/codeyam-cli/src/webserver/build/client/assets/{addon-web-links-Duc5hnl7.js → addon-web-links-CHx25PAe.js} +1 -1
  336. package/codeyam-cli/src/webserver/build/client/assets/addon-webgl-DI8QOUvO.js +58 -0
  337. package/codeyam-cli/src/webserver/build/client/assets/{agent-transcripts-D9hemwl6.js → agent-transcripts-Bg3e7q4S.js} +7 -7
  338. package/codeyam-cli/src/webserver/build/client/assets/api.editor-project-info-l0sNRNKZ.js +1 -0
  339. package/codeyam-cli/src/webserver/build/client/assets/api.editor-recapture-stale-l0sNRNKZ.js +1 -0
  340. package/codeyam-cli/src/webserver/build/client/assets/api.editor-rename-scenario-l0sNRNKZ.js +1 -0
  341. package/codeyam-cli/src/webserver/build/client/assets/api.editor-save-scenario-data-l0sNRNKZ.js +1 -0
  342. package/codeyam-cli/src/webserver/build/client/assets/api.editor-save-seed-state-l0sNRNKZ.js +1 -0
  343. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-coverage-l0sNRNKZ.js +1 -0
  344. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-prompt-l0sNRNKZ.js +1 -0
  345. package/codeyam-cli/src/webserver/build/client/assets/api.editor-schema-l0sNRNKZ.js +1 -0
  346. package/codeyam-cli/src/webserver/build/client/assets/api.editor-session-l0sNRNKZ.js +1 -0
  347. package/codeyam-cli/src/webserver/build/client/assets/api.editor-verify-routes-l0sNRNKZ.js +1 -0
  348. package/codeyam-cli/src/webserver/build/client/assets/api.interactive-switch-scenario-l0sNRNKZ.js +1 -0
  349. package/codeyam-cli/src/webserver/build/client/assets/{book-open-D_nMCFmP.js → book-open-CL-lMgHh.js} +2 -2
  350. package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-BH2h1Ea2.js → chevron-down-GmAjGS9-.js} +2 -2
  351. package/codeyam-cli/src/webserver/build/client/assets/chunk-JZWAC4HX-BAdwhyCx.js +43 -0
  352. package/codeyam-cli/src/webserver/build/client/assets/{circle-check-DyIKORY6.js → circle-check-DFcQkN5j.js} +2 -2
  353. package/codeyam-cli/src/webserver/build/client/assets/{copy-NDbZjXao.js → copy-C6iF61Xs.js} +3 -3
  354. package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-4ImjHTVC.js +41 -0
  355. package/codeyam-cli/src/webserver/build/client/assets/cy-logo-cli-Coe5NhbS.js +1 -0
  356. package/codeyam-cli/src/webserver/build/client/assets/{cy-logo-cli-CCKUIm0S.svg → cy-logo-cli-DoA97ML3.svg} +2 -2
  357. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-CRepiabR.js +1 -0
  358. package/codeyam-cli/src/webserver/build/client/assets/editor._tab-Gbk_i5Js.js +1 -0
  359. package/codeyam-cli/src/webserver/build/client/assets/editor.entity.(_sha)-CRxPi2BB.js +96 -0
  360. package/codeyam-cli/src/webserver/build/client/assets/editorPreview-CluPkvXJ.js +41 -0
  361. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-CrjR3zZW.js → entity._sha._-DYJRGiDI.js} +14 -13
  362. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-wdiwx5-Z.js +6 -0
  363. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-BrkN-40Y.js +6 -0
  364. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-DxfhekTZ.js +6 -0
  365. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-BMvVHNXU.js → entity._sha_.edit._scenarioId-CRXJWmpB.js} +2 -2
  366. package/codeyam-cli/src/webserver/build/client/assets/{entry.client-DTvKq3TY.js → entry.client-SuW9syRS.js} +6 -6
  367. package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-Daa96Fr1.js +1 -0
  368. package/codeyam-cli/src/webserver/build/client/assets/files-D-xGrg29.js +1 -0
  369. package/codeyam-cli/src/webserver/build/client/assets/git-Bq_fbXP5.js +1 -0
  370. package/codeyam-cli/src/webserver/build/client/assets/globals-BsGHu8WX.css +1 -0
  371. package/codeyam-cli/src/webserver/build/client/assets/{index-BcvgDzbZ.js → index-Bp1l4hSv.js} +1 -1
  372. package/codeyam-cli/src/webserver/build/client/assets/{index-10oVnAAH.js → index-CWV9XZiG.js} +1 -1
  373. package/codeyam-cli/src/webserver/build/client/assets/{index-yHOVb4rc.js → index-DE3jI_dv.js} +1 -1
  374. package/codeyam-cli/src/webserver/build/client/assets/jsx-runtime-D_zvdyIk.js +9 -0
  375. package/codeyam-cli/src/webserver/build/client/assets/labs-B_IX45ih.js +1 -0
  376. package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-BAXYRVEO.js → loader-circle-De-7qQ2u.js} +2 -2
  377. package/codeyam-cli/src/webserver/build/client/assets/manifest-9032538f.js +1 -0
  378. package/codeyam-cli/src/webserver/build/client/assets/memory-Cx2xEx7s.js +101 -0
  379. package/codeyam-cli/src/webserver/build/client/assets/{pause-DTAcYxBt.js → pause-CFxEKL1u.js} +3 -3
  380. package/codeyam-cli/src/webserver/build/client/assets/root-dKFRTYcy.js +80 -0
  381. package/codeyam-cli/src/webserver/build/client/assets/{search-fKo7v0Zo.js → search-BdBb5aqc.js} +2 -2
  382. package/codeyam-cli/src/webserver/build/client/assets/settings-DdE-Untf.js +1 -0
  383. package/codeyam-cli/src/webserver/build/client/assets/simulations-DSCdE99u.js +1 -0
  384. package/codeyam-cli/src/webserver/build/client/assets/{terminal-BG4heKCG.js → terminal-CrplD4b1.js} +3 -3
  385. package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-DtSmdtM4.js → triangle-alert-DqJ0j69l.js} +2 -2
  386. package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-DhXHbEjP.js +1 -0
  387. package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-D9QZKaLJ.js +2 -0
  388. package/codeyam-cli/src/webserver/build/client/assets/useReportContext-Cy5Qg_UR.js +1 -0
  389. package/codeyam-cli/src/webserver/build/client/assets/useToast-5HR2j9ZE.js +1 -0
  390. package/codeyam-cli/src/webserver/build/client/sound-test.html +98 -0
  391. package/codeyam-cli/src/webserver/build/server/assets/analysisRunner-OLsM110H.js +16 -0
  392. package/codeyam-cli/src/webserver/build/server/assets/index-WHdB6WTN.js +1 -0
  393. package/codeyam-cli/src/webserver/build/server/assets/init-DbSiZoE6.js +10 -0
  394. package/codeyam-cli/src/webserver/build/server/assets/progress-CHTtrxFG.js +1 -0
  395. package/codeyam-cli/src/webserver/build/server/assets/server-build-DZbLY6O_.js +690 -0
  396. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  397. package/codeyam-cli/src/webserver/build-info.json +5 -5
  398. package/codeyam-cli/src/webserver/editorProxy.js +638 -50
  399. package/codeyam-cli/src/webserver/editorProxy.js.map +1 -1
  400. package/codeyam-cli/src/webserver/idleDetector.js +130 -0
  401. package/codeyam-cli/src/webserver/idleDetector.js.map +1 -0
  402. package/codeyam-cli/src/webserver/mockStateEvents.js +28 -0
  403. package/codeyam-cli/src/webserver/mockStateEvents.js.map +1 -0
  404. package/codeyam-cli/src/webserver/public/sound-test.html +98 -0
  405. package/codeyam-cli/src/webserver/scripts/codeyam-preload.mjs +242 -3
  406. package/codeyam-cli/src/webserver/scripts/journalCapture.ts +147 -4
  407. package/codeyam-cli/src/webserver/server.js +153 -26
  408. package/codeyam-cli/src/webserver/server.js.map +1 -1
  409. package/codeyam-cli/src/webserver/terminalServer.js +305 -51
  410. package/codeyam-cli/src/webserver/terminalServer.js.map +1 -1
  411. package/codeyam-cli/templates/__tests__/editor-step-hook.prompt-capture.test.ts +118 -0
  412. package/codeyam-cli/templates/chrome-extension-react/EXTENSION_SETUP.md +75 -0
  413. package/codeyam-cli/templates/chrome-extension-react/README.md +46 -0
  414. package/codeyam-cli/templates/chrome-extension-react/gitignore +15 -0
  415. package/codeyam-cli/templates/chrome-extension-react/index.html +12 -0
  416. package/codeyam-cli/templates/chrome-extension-react/package.json +27 -0
  417. package/codeyam-cli/templates/chrome-extension-react/popup.html +12 -0
  418. package/codeyam-cli/templates/chrome-extension-react/public/manifest.json +15 -0
  419. package/codeyam-cli/templates/chrome-extension-react/src/background/service-worker.ts +7 -0
  420. package/codeyam-cli/templates/chrome-extension-react/src/globals.css +6 -0
  421. package/codeyam-cli/templates/chrome-extension-react/src/lib/storage.ts +37 -0
  422. package/codeyam-cli/templates/chrome-extension-react/src/popup/App.tsx +12 -0
  423. package/codeyam-cli/templates/chrome-extension-react/src/popup/main.tsx +10 -0
  424. package/codeyam-cli/templates/chrome-extension-react/tsconfig.json +24 -0
  425. package/codeyam-cli/templates/chrome-extension-react/vite.config.ts +41 -0
  426. package/codeyam-cli/templates/codeyam-editor-claude.md +86 -5
  427. package/codeyam-cli/templates/codeyam-editor-reference.md +216 -0
  428. package/codeyam-cli/templates/design-systems/clean-dashboard-design-system.md +255 -0
  429. package/codeyam-cli/templates/design-systems/editorial-design-system.md +267 -0
  430. package/codeyam-cli/templates/design-systems/mono-brutalist-design-system.md +256 -0
  431. package/codeyam-cli/templates/design-systems/neo-brutalist-design-system.md +294 -0
  432. package/codeyam-cli/templates/editor-step-hook.py +219 -45
  433. package/codeyam-cli/templates/expo-react-native/MOBILE_SETUP.md +288 -0
  434. package/codeyam-cli/templates/expo-react-native/README.md +41 -0
  435. package/codeyam-cli/templates/expo-react-native/__tests__/.gitkeep +0 -0
  436. package/codeyam-cli/templates/expo-react-native/app/_layout.tsx +15 -0
  437. package/codeyam-cli/templates/expo-react-native/app/index.tsx +36 -0
  438. package/codeyam-cli/templates/expo-react-native/app.json +29 -0
  439. package/codeyam-cli/templates/expo-react-native/babel.config.js +10 -0
  440. package/codeyam-cli/templates/expo-react-native/gitignore +14 -0
  441. package/codeyam-cli/templates/expo-react-native/global.css +10 -0
  442. package/codeyam-cli/templates/expo-react-native/lib/storage.ts +32 -0
  443. package/codeyam-cli/templates/expo-react-native/lib/theme.ts +73 -0
  444. package/codeyam-cli/templates/expo-react-native/metro.config.js +6 -0
  445. package/codeyam-cli/templates/expo-react-native/nativewind-env.d.ts +1 -0
  446. package/codeyam-cli/templates/expo-react-native/package.json +54 -0
  447. package/codeyam-cli/templates/expo-react-native/patches/expo-modules-autolinking+3.0.24.patch +29 -0
  448. package/codeyam-cli/templates/expo-react-native/tailwind.config.js +10 -0
  449. package/codeyam-cli/templates/expo-react-native/tsconfig.json +10 -0
  450. package/codeyam-cli/templates/isolation-route/expo-router.tsx.template +54 -0
  451. package/codeyam-cli/templates/nextjs-prisma-sqlite/AUTH_PATTERNS.md +308 -0
  452. package/codeyam-cli/templates/nextjs-prisma-sqlite/AUTH_UPGRADE.md +304 -0
  453. package/codeyam-cli/templates/nextjs-prisma-sqlite/DATABASE.md +126 -0
  454. package/codeyam-cli/templates/nextjs-prisma-sqlite/FEATURE_PATTERNS.md +37 -0
  455. package/codeyam-cli/templates/nextjs-prisma-sqlite/README.md +53 -0
  456. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/codeyam-isolate/layout.tsx +12 -0
  457. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/lib/prisma.ts +9 -4
  458. package/codeyam-cli/templates/nextjs-prisma-sqlite/env +4 -0
  459. package/codeyam-cli/templates/nextjs-prisma-sqlite/gitignore +21 -0
  460. package/codeyam-cli/templates/nextjs-prisma-sqlite/package.json +6 -2
  461. package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma/seed.ts +4 -1
  462. package/codeyam-cli/templates/nextjs-prisma-sqlite/seed-adapter.ts +140 -0
  463. package/codeyam-cli/templates/nextjs-prisma-sqlite/vitest.config.ts +13 -0
  464. package/codeyam-cli/templates/nextjs-prisma-supabase/README.md +52 -0
  465. package/codeyam-cli/templates/{nextjs-prisma-sqlite/PRISMA_SETUP.md → nextjs-prisma-supabase/SUPABASE_SETUP.md} +37 -17
  466. package/codeyam-cli/templates/nextjs-prisma-supabase/app/api/todos/route.ts +17 -0
  467. package/codeyam-cli/templates/nextjs-prisma-supabase/app/globals.css +26 -0
  468. package/codeyam-cli/templates/nextjs-prisma-supabase/app/layout.tsx +34 -0
  469. package/codeyam-cli/templates/nextjs-prisma-supabase/app/lib/prisma.ts +20 -0
  470. package/codeyam-cli/templates/nextjs-prisma-supabase/app/lib/supabase.ts +12 -0
  471. package/codeyam-cli/templates/nextjs-prisma-supabase/app/page.tsx +10 -0
  472. package/codeyam-cli/templates/nextjs-prisma-supabase/env +9 -0
  473. package/codeyam-cli/templates/nextjs-prisma-supabase/eslint.config.mjs +11 -0
  474. package/codeyam-cli/templates/nextjs-prisma-supabase/gitignore +40 -0
  475. package/codeyam-cli/templates/nextjs-prisma-supabase/next.config.ts +11 -0
  476. package/codeyam-cli/templates/nextjs-prisma-supabase/package.json +37 -0
  477. package/codeyam-cli/templates/nextjs-prisma-supabase/postcss.config.mjs +7 -0
  478. package/codeyam-cli/templates/nextjs-prisma-supabase/prisma/schema.prisma +27 -0
  479. package/codeyam-cli/templates/nextjs-prisma-supabase/prisma/seed.ts +39 -0
  480. package/codeyam-cli/templates/nextjs-prisma-supabase/prisma.config.ts +12 -0
  481. package/codeyam-cli/templates/nextjs-prisma-supabase/tsconfig.json +34 -0
  482. package/codeyam-cli/templates/seed-adapters/supabase.ts +374 -0
  483. package/codeyam-cli/templates/skills/codeyam-dev-mode/SKILL.md +2 -2
  484. package/codeyam-cli/templates/skills/codeyam-editor/SKILL.md +183 -13
  485. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/detect-deprecated-patterns.mjs +0 -0
  486. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/find-exports.mjs +0 -0
  487. package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/read-json-field.mjs +0 -0
  488. package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/ripgrep-fallback.mjs +0 -0
  489. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/cleanup.mjs +0 -0
  490. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/filter-session.mjs +0 -0
  491. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/preprocess.mjs +0 -0
  492. package/package.json +7 -1
  493. package/packages/ai/src/lib/astScopes/methodSemantics.js +99 -0
  494. package/packages/ai/src/lib/astScopes/methodSemantics.js.map +1 -1
  495. package/packages/ai/src/lib/astScopes/nodeToSource.js +16 -0
  496. package/packages/ai/src/lib/astScopes/nodeToSource.js.map +1 -1
  497. package/packages/ai/src/lib/astScopes/paths.js +12 -3
  498. package/packages/ai/src/lib/astScopes/paths.js.map +1 -1
  499. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +27 -10
  500. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
  501. package/packages/ai/src/lib/dataStructure/equivalencyManagers/ParentScopeManager.js +9 -2
  502. package/packages/ai/src/lib/dataStructure/equivalencyManagers/ParentScopeManager.js.map +1 -1
  503. package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js +14 -4
  504. package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js.map +1 -1
  505. package/packages/ai/src/lib/generateExecutionFlows.js +0 -11
  506. package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -1
  507. package/packages/analyze/index.js +1 -1
  508. package/packages/analyze/index.js.map +1 -1
  509. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +16 -2
  510. package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
  511. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +6 -26
  512. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
  513. package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js +3 -2
  514. package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js.map +1 -1
  515. package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js +9 -7
  516. package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js.map +1 -1
  517. package/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.js +14 -0
  518. package/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.js.map +1 -1
  519. package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js +44 -11
  520. package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js.map +1 -1
  521. package/packages/analyze/src/lib/files/analyzeChange.js +1 -0
  522. package/packages/analyze/src/lib/files/analyzeChange.js.map +1 -1
  523. package/packages/analyze/src/lib/files/analyzeInitial.js +1 -0
  524. package/packages/analyze/src/lib/files/analyzeInitial.js.map +1 -1
  525. package/packages/analyze/src/lib/files/analyzeNextRoute.js +5 -1
  526. package/packages/analyze/src/lib/files/analyzeNextRoute.js.map +1 -1
  527. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +120 -28
  528. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
  529. package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js +0 -40
  530. package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js.map +1 -1
  531. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +1368 -1193
  532. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
  533. package/packages/database/src/lib/kysely/tables/editorScenariosTable.js +104 -0
  534. package/packages/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -1
  535. package/packages/database/src/lib/loadAnalysis.js +7 -1
  536. package/packages/database/src/lib/loadAnalysis.js.map +1 -1
  537. package/packages/database/src/lib/loadEntities.js +0 -6
  538. package/packages/database/src/lib/loadEntities.js.map +1 -1
  539. package/packages/database/src/lib/loadEntity.js +5 -5
  540. package/packages/database/src/lib/loadEntity.js.map +1 -1
  541. package/packages/database/src/lib/updateCommitMetadata.js +0 -25
  542. package/packages/database/src/lib/updateCommitMetadata.js.map +1 -1
  543. package/packages/types/src/enums/ProjectFramework.js +2 -0
  544. package/packages/types/src/enums/ProjectFramework.js.map +1 -1
  545. package/packages/utils/src/lib/fs/rsyncCopy.js +22 -1
  546. package/packages/utils/src/lib/fs/rsyncCopy.js.map +1 -1
  547. package/codeyam-cli/src/webserver/build/client/assets/CopyButton-DmJveP3T.js +0 -1
  548. package/codeyam-cli/src/webserver/build/client/assets/EntityTypeBadge-g3saevPb.js +0 -1
  549. package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-Bu6c6aDe.js +0 -1
  550. package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-DYFW3lDD.js +0 -25
  551. package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-DLeucoVX.js +0 -3
  552. package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-BED4B6sP.js +0 -1
  553. package/codeyam-cli/src/webserver/build/client/assets/Spinner-Bb5uFQ5V.js +0 -34
  554. package/codeyam-cli/src/webserver/build/client/assets/Terminal-nZNBALox.js +0 -41
  555. package/codeyam-cli/src/webserver/build/client/assets/TruncatedFilePath-C8OKAR5x.js +0 -1
  556. package/codeyam-cli/src/webserver/build/client/assets/addon-fit-CUXOrorO.js +0 -1
  557. package/codeyam-cli/src/webserver/build/client/assets/chunk-JZWAC4HX-C4pqxYJB.js +0 -51
  558. package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-CMT1jU2q.js +0 -21
  559. package/codeyam-cli/src/webserver/build/client/assets/cy-logo-cli-DcX-ZS3p.js +0 -1
  560. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-BiM6z3Do.js +0 -1
  561. package/codeyam-cli/src/webserver/build/client/assets/editor-DTwKl1Xu.js +0 -10
  562. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-DjACbfdI.js +0 -6
  563. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-C28BiQzt.js +0 -6
  564. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-p9hhkjJM.js +0 -6
  565. package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-cPo8LiG3.js +0 -1
  566. package/codeyam-cli/src/webserver/build/client/assets/files-DO4CZ16O.js +0 -1
  567. package/codeyam-cli/src/webserver/build/client/assets/git-CdN8sCqs.js +0 -1
  568. package/codeyam-cli/src/webserver/build/client/assets/globals-h1-1oFYI.css +0 -1
  569. package/codeyam-cli/src/webserver/build/client/assets/labs-Zk7ryIM1.js +0 -1
  570. package/codeyam-cli/src/webserver/build/client/assets/manifest-9422aeab.js +0 -1
  571. package/codeyam-cli/src/webserver/build/client/assets/memory-Dg0mvYrI.js +0 -96
  572. package/codeyam-cli/src/webserver/build/client/assets/root-BzQgN2ff.js +0 -67
  573. package/codeyam-cli/src/webserver/build/client/assets/settings-DfuTtcJP.js +0 -1
  574. package/codeyam-cli/src/webserver/build/client/assets/simulations-B3aOzpCZ.js +0 -1
  575. package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-ByhSyh0W.js +0 -1
  576. package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-C14nCb1q.js +0 -2
  577. package/codeyam-cli/src/webserver/build/client/assets/useReportContext-O-jkvSPx.js +0 -1
  578. package/codeyam-cli/src/webserver/build/client/assets/useToast-9FIWuYfK.js +0 -1
  579. package/codeyam-cli/src/webserver/build/server/assets/index-Bh_pNxNA.js +0 -1
  580. package/codeyam-cli/src/webserver/build/server/assets/server-build-Bqr22tlO.js +0 -367
@@ -0,0 +1,374 @@
1
+ /**
2
+ * CodeYam Seed Adapter for Supabase.
3
+ *
4
+ * Seeds the database and optionally signs in a user for authenticated scenarios.
5
+ *
6
+ * Usage: npx tsx .codeyam/seed-adapter.ts <path-to-seed-data.json>
7
+ *
8
+ * Input JSON format:
9
+ * {
10
+ * "tableName": [{ "column": "value", ... }, ...],
11
+ * "_auth": { // optional
12
+ * "email": "alice@example.com",
13
+ * "password": "test123"
14
+ * }
15
+ * }
16
+ *
17
+ * When _auth is present, the adapter:
18
+ * 1. Creates the user if they don't exist (auto-confirms email)
19
+ * 2. Signs in with signInWithPassword to get a valid session
20
+ * 3. Writes session cookies to .codeyam/tmp/seed-session.json
21
+ * so the CodeYam proxy can inject them into the browser
22
+ *
23
+ * Requirements:
24
+ * - A Supabase project URL (https://<ref>.supabase.co) in any env var
25
+ * - A secret key (sb_secret_... or legacy eyJ... service_role JWT) in any env var
26
+ *
27
+ * The adapter scans ALL env vars by value pattern — no specific naming required.
28
+ */
29
+
30
+ import { createClient } from '@supabase/supabase-js';
31
+ import { Prisma } from '@prisma/client';
32
+ import * as fs from 'fs';
33
+ import * as path from 'path';
34
+
35
+ /**
36
+ * Scan all env vars for values matching a pattern.
37
+ * Returns ALL unique matches (not just the first) so callers can disambiguate.
38
+ */
39
+ function findAllEnvByPattern(pattern: RegExp): string[] {
40
+ const matches = new Set<string>();
41
+ for (const value of Object.values(process.env)) {
42
+ if (value && pattern.test(value)) matches.add(value);
43
+ }
44
+ return [...matches];
45
+ }
46
+
47
+ /**
48
+ * For legacy Supabase JWTs, decode the payload to check the `role` claim.
49
+ * Returns the role string ("service_role", "anon", etc.) or undefined.
50
+ */
51
+ function getJwtRole(jwt: string): string | undefined {
52
+ try {
53
+ const payload = jwt.split('.')[1];
54
+ const decoded = JSON.parse(Buffer.from(payload, 'base64url').toString());
55
+ return decoded.role;
56
+ } catch {
57
+ return undefined;
58
+ }
59
+ }
60
+
61
+ // Detect Supabase credentials by value pattern, not env var name.
62
+ // This works regardless of what the user named their env vars.
63
+ const supabaseUrl = findAllEnvByPattern(
64
+ /^https:\/\/[a-z0-9]+\.supabase\.co\b/,
65
+ )[0];
66
+
67
+ // New-format keys are unambiguous by prefix
68
+ const newSecretKey = findAllEnvByPattern(/^sb_secret_/)[0];
69
+ const newAnonKey = findAllEnvByPattern(/^sb_publishable_/)[0];
70
+
71
+ // Legacy JWT keys — disambiguate by decoding the role claim
72
+ const legacyJwts = findAllEnvByPattern(
73
+ /^eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/,
74
+ );
75
+ const legacyServiceRole = legacyJwts.find(
76
+ (jwt) => getJwtRole(jwt) === 'service_role',
77
+ );
78
+ const legacyAnon = legacyJwts.find((jwt) => getJwtRole(jwt) === 'anon');
79
+
80
+ const secretKey = newSecretKey || legacyServiceRole;
81
+ const anonKey = newAnonKey || legacyAnon;
82
+
83
+ if (!supabaseUrl || !secretKey) {
84
+ console.error(
85
+ 'Could not find Supabase credentials in environment variables.',
86
+ );
87
+ console.error(
88
+ 'Looking for: a URL matching https://<ref>.supabase.co and a key starting with sb_secret_ (or a service_role JWT)',
89
+ );
90
+ console.error(
91
+ 'Add them to .env.local — the seed adapter scans all env vars by value pattern.',
92
+ );
93
+ process.exit(1);
94
+ }
95
+
96
+ // Admin client for user management (uses secret key to bypass RLS)
97
+ const supabase = createClient(supabaseUrl, secretKey, {
98
+ auth: { autoRefreshToken: false, persistSession: false },
99
+ });
100
+
101
+ // Derive the project ref from the URL for cookie naming
102
+ // e.g. "https://abcdefgh.supabase.co" → "abcdefgh"
103
+ function getProjectRef(): string {
104
+ try {
105
+ const hostname = new URL(supabaseUrl!).hostname;
106
+ return hostname.split('.')[0];
107
+ } catch {
108
+ return 'unknown';
109
+ }
110
+ }
111
+
112
+ /**
113
+ * Build a mapping from lowercased seed-data keys to actual PostgreSQL table names.
114
+ * Prisma creates tables with the model name (PascalCase) unless @@map is used.
115
+ * PostgREST requires the exact table name, so we need this translation.
116
+ */
117
+ function buildTableNameMap(): Record<string, string> {
118
+ const map: Record<string, string> = {};
119
+ for (const model of Prisma.dmmf.datamodel.models) {
120
+ // dbName is set when @@map is used, otherwise null → use model name
121
+ const dbName = (model as any).dbName || model.name;
122
+ // Map lowercased model name → actual table name
123
+ const lowered = model.name.charAt(0).toLowerCase() + model.name.slice(1);
124
+ map[lowered] = dbName;
125
+ map[model.name] = dbName; // Also map PascalCase for safety
126
+ }
127
+ return map;
128
+ }
129
+
130
+ async function seedTables(seed: Record<string, unknown[]>) {
131
+ if (Object.keys(seed).length === 0) return;
132
+
133
+ const tableMap = buildTableNameMap();
134
+
135
+ // Discover ALL models from the Prisma schema — not just the tables in the seed data.
136
+ // This ensures FK-dependent tables are cleared even when the seed only contains
137
+ // the parent table's data. Every editor project has Prisma installed.
138
+ const allTables = Prisma.dmmf.datamodel.models.map(
139
+ (m) => (m as any).dbName || m.name,
140
+ );
141
+
142
+ console.log(
143
+ `Clearing ${allTables.length} tables, seeding: ${Object.keys(seed).join(', ')}`,
144
+ );
145
+
146
+ // Clear ALL tables in reverse order (children before parents for FK safety)
147
+ for (const table of [...allTables].reverse()) {
148
+ const { error } = await supabase.from(table).delete().gte('id', 0);
149
+ if (error) {
150
+ const { error: error2 } = await supabase
151
+ .from(table)
152
+ .delete()
153
+ .not('id', 'is', null);
154
+ if (error2) {
155
+ console.warn(` Could not clear ${table}: ${error2.message}`);
156
+ } else {
157
+ console.log(` Cleared ${table}`);
158
+ }
159
+ } else {
160
+ console.log(` Cleared ${table}`);
161
+ }
162
+ }
163
+
164
+ // Insert seed data — translate seed keys to actual table names
165
+ for (const [seedKey, rows] of Object.entries(seed)) {
166
+ if (!Array.isArray(rows) || rows.length === 0) continue;
167
+ const table = tableMap[seedKey] || seedKey;
168
+ const { error } = await supabase.from(table).insert(rows);
169
+ if (error) {
170
+ console.error(` Failed to seed ${table}: ${error.message}`);
171
+ process.exit(1);
172
+ }
173
+ console.log(` Seeded ${rows.length} rows into ${table}`);
174
+ }
175
+ }
176
+
177
+ /**
178
+ * Build a minimal JWT with a far-future expiry.
179
+ * The signature is fake — it doesn't matter because the CodeYam preload module
180
+ * intercepts the Supabase auth validation endpoint and returns mock data.
181
+ */
182
+ function buildFakeJwt(userId: string, email: string): string {
183
+ const header = { alg: 'HS256', typ: 'JWT' };
184
+ const payload = {
185
+ sub: userId,
186
+ email,
187
+ role: 'authenticated',
188
+ aud: 'authenticated',
189
+ exp: 9999999999,
190
+ iat: Math.floor(Date.now() / 1000),
191
+ };
192
+ const encode = (obj: object) =>
193
+ Buffer.from(JSON.stringify(obj)).toString('base64url');
194
+ return `${encode(header)}.${encode(payload)}.codeyam-mock-signature`;
195
+ }
196
+
197
+ /**
198
+ * Build a Supabase user response object matching the /auth/v1/user endpoint format.
199
+ */
200
+ function buildUserResponse(user: { id: string; email?: string }) {
201
+ return {
202
+ id: user.id,
203
+ aud: 'authenticated',
204
+ role: 'authenticated',
205
+ email: user.email || '',
206
+ email_confirmed_at: new Date().toISOString(),
207
+ app_metadata: { provider: 'email', providers: ['email'] },
208
+ user_metadata: {},
209
+ created_at: new Date().toISOString(),
210
+ };
211
+ }
212
+
213
+ /**
214
+ * Handle auth: create user, sign in, write session cookies.
215
+ * Returns the user ID so callers can replace __AUTH_USER_ID__ placeholders in seed data.
216
+ */
217
+ async function handleAuth(auth: {
218
+ email: string;
219
+ password: string;
220
+ }): Promise<string> {
221
+ const { email, password } = auth;
222
+
223
+ // Create user if they don't exist (auto-confirm email so sign-in works)
224
+ const { data: createData, error: createError } =
225
+ await supabase.auth.admin.createUser({
226
+ email,
227
+ password,
228
+ email_confirm: true,
229
+ });
230
+
231
+ if (createError) {
232
+ if (createError.message.includes('already been registered')) {
233
+ // User exists — update their password so sign-in works even if the
234
+ // scenario specifies a different password than a previous run.
235
+ const { data: listData } = await supabase.auth.admin.listUsers();
236
+ const existingUser = listData?.users?.find((u) => u.email === email);
237
+ if (existingUser) {
238
+ await supabase.auth.admin.updateUserById(existingUser.id, {
239
+ password,
240
+ });
241
+ console.log(` Updated password for existing user ${email}`);
242
+ }
243
+ } else {
244
+ console.error(` Failed to create auth user: ${createError.message}`);
245
+ process.exit(1);
246
+ }
247
+ }
248
+
249
+ // Sign in to get a valid session
250
+ // Use a separate client with the publishable/anon key for sign-in (if available)
251
+ const signInClient =
252
+ anonKey && anonKey !== secretKey
253
+ ? createClient(supabaseUrl!, anonKey, {
254
+ auth: { autoRefreshToken: false, persistSession: false },
255
+ })
256
+ : supabase;
257
+
258
+ const { data: signInData, error: signInError } =
259
+ await signInClient.auth.signInWithPassword({ email, password });
260
+
261
+ if (signInError || !signInData.session) {
262
+ console.error(
263
+ ` Failed to sign in as ${email}: ${signInError?.message || 'no session returned'}`,
264
+ );
265
+ process.exit(1);
266
+ }
267
+
268
+ const userId = signInData.user.id;
269
+ console.log(` Signed in as ${email} (user: ${userId})`);
270
+
271
+ // Use the REAL JWT from Supabase sign-in for the session cookie so auth
272
+ // works immediately against the real Supabase API. The externalApis below
273
+ // provide a fallback for when the CLI supports preload-based auth
274
+ // interception (no real Supabase calls needed at render time).
275
+ const fakeJwt = buildFakeJwt(userId, email);
276
+ const userResponse = buildUserResponse(signInData.user);
277
+
278
+ const projectRef = getProjectRef();
279
+ const sessionOutput = {
280
+ cookies: [
281
+ {
282
+ name: `sb-${projectRef}-auth-token`,
283
+ value: JSON.stringify({
284
+ access_token: signInData.session.access_token,
285
+ refresh_token: signInData.session.refresh_token,
286
+ token_type: 'bearer',
287
+ expires_in: signInData.session.expires_in,
288
+ expires_at: signInData.session.expires_at,
289
+ }),
290
+ path: '/',
291
+ sameSite: 'Lax' as const,
292
+ },
293
+ ],
294
+ // External API mocks — when the CLI supports propagating these, the
295
+ // preload module will intercept server-side getUser() calls so Next.js
296
+ // middleware returns the mock user without hitting real Supabase.
297
+ externalApis: {
298
+ [`${supabaseUrl}/auth/v1/user`]: {
299
+ body: userResponse,
300
+ status: 200,
301
+ },
302
+ [`${supabaseUrl}/auth/v1/token`]: {
303
+ body: {
304
+ access_token: fakeJwt,
305
+ token_type: 'bearer',
306
+ expires_in: 315360000,
307
+ expires_at: 9999999999,
308
+ refresh_token: 'codeyam-mock-refresh-token',
309
+ user: userResponse,
310
+ },
311
+ status: 200,
312
+ },
313
+ },
314
+ };
315
+
316
+ const outputDir = path.join(process.cwd(), '.codeyam', 'tmp');
317
+ fs.mkdirSync(outputDir, { recursive: true });
318
+ const outputPath = path.join(outputDir, 'seed-session.json');
319
+ fs.writeFileSync(outputPath, JSON.stringify(sessionOutput, null, 2));
320
+ console.log(` Session cookies + auth mocks written to ${outputPath}`);
321
+
322
+ return userId;
323
+ }
324
+
325
+ /**
326
+ * Replace __AUTH_USER_ID__ placeholders in seed data with the actual Supabase user ID.
327
+ * This lets scenarios reference the authenticated user in foreign key columns (e.g. user_id)
328
+ * without knowing the UUID ahead of time.
329
+ */
330
+ function replaceAuthPlaceholders(
331
+ seed: Record<string, unknown[]>,
332
+ userId: string,
333
+ ): Record<string, unknown[]> {
334
+ const json = JSON.stringify(seed);
335
+ const replaced = json.replace(/__AUTH_USER_ID__/g, userId);
336
+ return JSON.parse(replaced);
337
+ }
338
+
339
+ async function main() {
340
+ const seedDataPath = process.argv[2];
341
+ if (!seedDataPath) {
342
+ console.error('Usage: npx tsx .codeyam/seed-adapter.ts <seed-data.json>');
343
+ process.exit(1);
344
+ }
345
+
346
+ const raw = fs.readFileSync(seedDataPath, 'utf-8');
347
+ const data = JSON.parse(raw);
348
+
349
+ // Separate auth config from table data
350
+ const auth = data._auth;
351
+ let seed: Record<string, unknown[]> = {};
352
+ for (const [key, value] of Object.entries(data)) {
353
+ if (key === '_auth') continue;
354
+ seed[key] = value as unknown[];
355
+ }
356
+
357
+ // Auth first: we need the user ID to replace __AUTH_USER_ID__ placeholders
358
+ // in seed data (e.g. for user_id foreign key columns with Supabase RLS)
359
+ if (auth) {
360
+ const userId = await handleAuth(
361
+ auth as { email: string; password: string },
362
+ );
363
+ seed = replaceAuthPlaceholders(seed, userId);
364
+ }
365
+
366
+ await seedTables(seed);
367
+
368
+ console.log('Seed complete');
369
+ }
370
+
371
+ main().catch((e) => {
372
+ console.error('Seed adapter error:', e);
373
+ process.exit(1);
374
+ });
@@ -53,7 +53,7 @@ Then present a **concise** overview to the user:
53
53
 
54
54
  1. **Component Summary** — 2-3 sentences on what the component does and the current scenario being previewed.
55
55
 
56
- 2. **Suggested Tests** — Compare the component's code paths (conditionals, edge cases, visual states) against the existing scenarios from the database. Recommend 2-4 specific ways to test the component that are **not yet covered** by saved scenarios. Focus on interesting visual states — e.g. "What does this look like with a very long title?", "What happens when the list is empty?", "How does the error state render?". Be specific to this component, not generic.
56
+ 2. **Suggested Tests** — Compare the component's code paths (conditionals, edge cases, visual states) against the existing scenarios from the database. Recommend 2-4 specific ways to test the component that are **not yet covered** by saved scenarios. Focus on interesting visual states — e.g. "What does this look like with a very long title?", "What happens when the list is empty?", "How does the error state render?". Also suggest ways to enrich the _existing_ scenario's data to better exercise the component (more realistic content, populated optional fields, diverse values). Be specific to this component, not generic.
57
57
 
58
58
  Keep it brief — no tables, no exhaustive attribute lists. The user can see the preview and wants actionable suggestions, not a data dump.
59
59
 
@@ -229,7 +229,7 @@ tail -50 <server log path from context file>
229
229
  ## Tips
230
230
 
231
231
  - **NEVER modify shimmed component files** (`*_Scenario.tsx`) to change rendering behavior — only edit `MockData_*.tsx` files to change what the component displays. Shimmed components are auto-generated; functional changes to them won't persist and can't be saved as scenarios.
232
- - Keep edits small and incremental so the user can see changes in the preview as you go
232
+ - **Refresh the preview frequently** the user is watching the preview panel as you work. Make small changes, then refresh so they see visual progress. Don't batch multiple edits into one big refresh at the end. Aim for a refresh after every meaningful edit (new data values, layout changes, style tweaks).
233
233
  - **Always add `[CY-DEBUG]` logging before refreshing** — never refresh without a way to verify the result
234
234
  - Mock data files are TypeScript (`.tsx`) — they export scenario-specific props/data
235
235
  - The database at `.codeyam/db.sqlite3` has entity and scenario metadata if you need deeper investigation
@@ -16,6 +16,77 @@ You MUST follow a step-by-step workflow driven by `codeyam editor` commands. Eac
16
16
 
17
17
  **The rule:** After completing what a command tells you to do, run the NEXT command it specifies. The commands are your instructions — follow them one at a time.
18
18
 
19
+ ## TASK Directive
20
+
21
+ Some `codeyam editor N` commands output a `━━━ TASK ━━━` section with an `EXACT_TASK_TITLE:` line. When you see one:
22
+
23
+ 1. Delete ALL existing tasks: run TaskList, then run TaskUpdate with status "deleted" for every task returned
24
+ 2. Run TaskCreate with the EXACT title from the `EXACT_TASK_TITLE:` line — copy it character-for-character, do NOT paraphrase
25
+
26
+ This ensures only one task is ever visible. Do NOT create tasks on your own. Only create them when a `━━━ TASK ━━━` directive tells you to.
27
+
28
+ ## Migration Mode
29
+
30
+ When `codeyam editor steps` shows **"Project Migration"** instead of "Feature Cycle", the project is being migrated from an existing codebase. Follow the `codeyam editor migrate` commands instead of the normal 13-step cycle.
31
+
32
+ Migration uses a different command set:
33
+
34
+ ```
35
+ codeyam editor migrate → Survey the project (explore pages, confirm order)
36
+ codeyam editor migrate 1-8 → Run migration step N for the current page
37
+ codeyam editor migrate next → Advance to the next page
38
+ codeyam editor migrate status → Show migration progress
39
+ ```
40
+
41
+ **The same rule applies:** run the command shown in the output, follow its checklist, then run the next command it specifies. Migration steps are 1-8 per page: Capture → Preview → Discuss → Decompose → Extract → Recapture → Journal → Present. Steps 4-6 (Decompose/Extract/Recapture) are optional — the user decides at step 3 whether to decompose or skip to step 7. After all pages are migrated, the project transitions to the normal feature cycle.
42
+
43
+ **IMPORTANT:** When `codeyam editor steps` tells you to run a `codeyam editor migrate` command, run THAT command — do NOT run `codeyam editor 1` or any other normal step command.
44
+
45
+ ### Migration Survey (codeyam editor migrate)
46
+
47
+ When you run `codeyam editor migrate` with no arguments and no existing migration state, follow this survey checklist:
48
+
49
+ 1. Read `package.json` — understand the framework, dependencies, and scripts
50
+ 2. Explore the project structure — find all page/route files
51
+ - Next.js App Router: `app/**/page.tsx` | Pages Router: `pages/**/*.tsx`
52
+ - Check for other patterns: `src/` directory, custom routing, etc.
53
+ 3. Read each page/route to assess complexity and data flow
54
+ 4. Identify how the dev server starts (check `scripts` in package.json)
55
+ 5. Note any environment variables, databases, or external services needed
56
+ 6. Present a numbered list of all pages with:
57
+ - Page name and route
58
+ - File path
59
+ - Complexity assessment (simple / moderate / complex)
60
+ 7. Suggest a migration order — **start with the most complex pages** (dashboards, analytics, etc.) as they best demonstrate CodeYam's value and have rich decomposition opportunities
61
+ 8. Wait for user confirmation of the order
62
+
63
+ **After user confirms**, write `.codeyam/migration-state.json`:
64
+
65
+ ```json
66
+ {
67
+ "status": "surveyed",
68
+ "startedAt": "<ISO>",
69
+ "completedAt": null,
70
+ "pages": [
71
+ {
72
+ "name": "Home",
73
+ "route": "/",
74
+ "filePath": "app/page.tsx",
75
+ "status": "pending",
76
+ "startedAt": null,
77
+ "completedAt": null,
78
+ "extractedComponents": [],
79
+ "extractedFunctions": [],
80
+ "scenarioCount": 0
81
+ }
82
+ ],
83
+ "currentPageIndex": 0,
84
+ "sharedComponents": []
85
+ }
86
+ ```
87
+
88
+ Then run: `codeyam editor migrate 1`
89
+
19
90
  ## The Cycle
20
91
 
21
92
  Every feature follows 13 gated steps:
@@ -41,34 +112,133 @@ codeyam editor 13 → Present summary, get final approval
41
112
 
42
113
  ## Handling User Feedback / Changes
43
114
 
44
- When the user asks for changes — whether through the menu, a direct request, or even a question that implies a change (e.g., "Can the cards have images?") — you MUST run `codeyam editor change` **before** writing any code. This command gives you the post-change checklist (re-register scenarios, re-run tests, update journal, etc.). Never make changes without running the change workflow first.
115
+ When the user asks for changes — whether through the menu, a direct request, or even a question that implies a change (e.g., "Can the cards have images?") — you MUST run `codeyam editor change` **before** making any modifications. This includes:
116
+
117
+ - Code changes (components, routes, lib functions, styles)
118
+ - Scenario data updates (seed data, localStorage data, mock data)
119
+ - Style adjustments (CSS, Tailwind classes, layout tweaks)
120
+ - Even small fixes (typos, color tweaks, spacing)
121
+
122
+ This command gives you the post-change checklist (re-register scenarios, re-run tests, update journal, etc.). Never make changes without running the change workflow first.
123
+
124
+ **CRITICAL:** The change workflow MUST end with `codeyam editor 13`, which shows Working Session Results to the user. Skipping this step is a broken experience — the user will not see what changed and cannot approve or request further changes. Every change, no matter how small, must conclude with results being shown.
45
125
 
46
126
  ## Key Rules
47
127
 
48
128
  - **Run the commands** — they ARE your instructions, not suggestions
129
+ - **One step at a time** — run each `codeyam editor N` command, read its FULL output, complete every checklist item, then advance. The CLI enforces a minimum time per step.
130
+ - **NEVER batch-run steps** — `for step in 5 6 7 8; do codeyam editor $step; done` or piping to `head` defeats the entire workflow. Each step has unique instructions you must read and follow.
131
+ - **NEVER delegate multiple steps to a subagent** — each step must be run, read, and completed in the main conversation. You MAY use subagents for parallelizable work _within_ a single step (e.g. extracting components + writing tests in step 5).
49
132
  - **Every feature gets scenarios** — this is the core value of CodeYam
50
133
  - **Always scaffold with a database** (Prisma + SQLite)
51
134
  - **Build real API routes** — the proxy handles scenario data transparently
52
135
  - **Start the dev server via the CodeYam API** — it handles proxy setup automatically
53
- - **Verify the preview after changes** — check the dev server URL, not the proxy
136
+ - **Keep the preview moving** — the user watches the preview panel as you work. Refresh it frequently so they see progress, not a static screen. See below.
137
+
138
+ ## Keep the Preview Moving
139
+
140
+ The user is watching the live preview panel while you work. A static preview makes it feel like nothing is happening. **Refresh the preview after every meaningful change** — not just at the end of a step.
141
+
142
+ **During prototyping (step 2):**
143
+
144
+ - Refresh after creating the first visible page, even if it's bare
145
+ - Refresh after adding each major UI section (header, list, form, etc.)
146
+ - Refresh after seeding data so the user sees real content appear
147
+ - Refresh after styling changes so the user sees the visual progress
148
+
149
+ **During extraction (step 5):**
150
+
151
+ - Refresh after extracting each batch of components to confirm nothing broke
152
+
153
+ **During changes:**
154
+
155
+ - Refresh after each individual change, not after all changes are done
156
+
157
+ **How to refresh:**
158
+
159
+ ```
160
+ codeyam editor preview '{"dimension":"<name from screenSizes>"}'
161
+ ```
162
+
163
+ Navigate to a specific path or switch scenario:
164
+
165
+ ```
166
+ codeyam editor preview '{"path":"/drinks/1","dimension":"<name from screenSizes>"}'
167
+ codeyam editor preview '{"scenarioId":"abc-123"}'
168
+ ```
169
+
170
+ The goal: the user should see the preview update 4-8+ times during a typical building session, not just once at the end.
171
+
172
+ ## Collaboration
173
+
174
+ Isolation routes are committed to git (not gitignored). They are protected by a layout guard at `app/isolated-components/layout.tsx` that returns `notFound()` in production, so they are safe to commit. Scenarios, screenshots, journal entries, and the glossary are also committed. Only the local database and secrets are gitignored.
175
+
176
+ When a collaborator clones the repo and runs `codeyam editor`, scenarios are auto-imported from `scenarios-manifest.json`. Run `codeyam editor sync` to manually re-sync after pulling new changes.
177
+
178
+ ## Expo / React Native Projects
179
+
180
+ When working with an Expo project (tech stack `expo-react-native`):
181
+
182
+ - Use `<View>`, `<Text>`, `<ScrollView>`, `<Pressable>` from `react-native` — **never use HTML elements** (`<div>`, `<span>`, `<h1>`, etc.)
183
+ - Do NOT use `'use client'` — this is a Next.js directive that has no meaning in Expo
184
+ - Do NOT import from `next/navigation`, `next/router`, or any `next/*` package
185
+ - Use `expo-router` for navigation: `useRouter()`, `useLocalSearchParams()`, `<Link>`
186
+ - Use `@/lib/theme` for all design tokens — not CSS custom properties (`var(--token)` does not work in React Native)
187
+ - AsyncStorage maps to localStorage on web — CodeYam's `localStorage` injection in scenarios works automatically
188
+ - Test with `npx jest`, not `npx vitest`
189
+ - Isolation routes use Expo Router: `app/isolated-components/ComponentName.tsx` (not a `/page.tsx` subdirectory)
190
+ - Capture wrappers use `nativeID="codeyam-capture"` (not `id="codeyam-capture"`) — `nativeID` maps to `id` on web
191
+ - The preview renders via react-native-web in a browser — some visual differences from native devices are expected (fonts, SafeAreaView, shadows). See `MOBILE_SETUP.md` for details.
54
192
 
55
193
  ## Quick Reference
56
194
 
57
195
  ```bash
58
- # Register scenario (auto-captures screenshot)
59
- curl -s -X POST http://localhost:${CODEYAM_PORT:-3111}/api/editor-register-scenario \
60
- -H 'Content-Type: application/json' \
61
- -d '{"name":"...","description":"...","mockData":{"routes":{"/api/...":{"body":[...]}}}}'
196
+ # Register component scenario (auto-captures screenshot)
197
+ # ALWAYS include "dimensions" — use the project's default screen size name from setup
198
+ codeyam editor register '{"name":"DrinkCard - Default","componentName":"DrinkCard","componentPath":"app/components/DrinkCard.tsx","url":"/isolated-components/DrinkCard?s=Default","dimensions":["<name from screenSizes>"],"mockData":{"routes":{"/api/...":{"body":[...]}}}}'
199
+
200
+ # Register app scenario with seed data (ALWAYS include "url" and "dimensions")
201
+ codeyam editor register '{"name":"Full Catalog","type":"application","url":"/","dimensions":["<name from screenSizes>"],"seed":{"drinks":[...]}}'
202
+
203
+ # Register app scenario with localStorage (for apps using client-side storage instead of a database)
204
+ codeyam editor register '{"name":"Full Library","type":"application","url":"/","dimensions":["<name from screenSizes>"],"localStorage":{"articles":[...],"collections":[...]}}'
205
+
206
+ # BULK REGISTRATION (preferred — register all scenarios at once):
207
+ # Write an array of scenarios to a temp file, then register with @ prefix.
208
+ # This is faster and avoids repeated screenshot capture overhead.
209
+ # File format: [{"name":"...","type":"...","url":"...","seed":{...}}, ...]
210
+ codeyam editor register @.codeyam/tmp/scenarios.json
211
+
212
+ # Single scenario from file (for large seed/localStorage data):
213
+ codeyam editor register @/tmp/scenario-data.json
62
214
 
63
215
  # Journal entry (one per feature, references scenario names)
64
- curl -s -X POST http://localhost:${CODEYAM_PORT:-3111}/api/editor-journal-entry \
65
- -H 'Content-Type: application/json' \
66
- -d '{"title":"...","type":"feature","description":"...","scenarios":["..."]}'
216
+ codeyam editor journal '{"title":"...","type":"feature","description":"..."}'
67
217
 
68
- # Refresh preview
69
- curl -s -X POST http://localhost:${CODEYAM_PORT:-3111}/api/dev-mode-preview
218
+ # Update journal with commit info
219
+ codeyam editor journal-update '{"time":"...","commitSha":"...","commitMessage":"..."}'
220
+
221
+ # Refresh preview / navigate / switch scenario (ALWAYS include "dimension")
222
+ codeyam editor preview '{"dimension":"<name from screenSizes>"}'
223
+ codeyam editor preview '{"path":"/drinks/1","dimension":"<name from screenSizes>"}'
224
+ codeyam editor preview '{"scenarioId":"abc-123"}'
225
+
226
+ # Show/hide results panel
227
+ codeyam editor show-results
228
+ codeyam editor hide-results
229
+
230
+ # Commit feature
231
+ codeyam editor commit '{"message":"feat: Add drinks page"}'
70
232
 
71
233
  # Restart dev server (only for config/dependency changes)
72
- curl -s -X POST http://localhost:${CODEYAM_PORT:-3111}/api/editor-dev-server \
73
- -H 'Content-Type: application/json' -d '{"action":"restart"}'
234
+ codeyam editor dev-server '{"action":"restart"}'
235
+
236
+ # Check for client-side errors
237
+ codeyam editor client-errors
238
+
239
+ # Verify all images load (extracts URLs from pages, HTTP-checks each one)
240
+ codeyam editor verify-images '{"paths":["/","/drinks/1"]}'
241
+
242
+ # Sync scenarios from manifest (after pulling collaborator changes)
243
+ codeyam editor sync
74
244
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codeyam/codeyam-cli",
3
- "version": "0.1.0-staging.b8f4f94",
3
+ "version": "0.1.0-staging.ba3f279",
4
4
  "description": "Local development CLI for CodeYam analysis",
5
5
  "type": "module",
6
6
  "bin": {
@@ -46,6 +46,7 @@
46
46
  "p-queue": "^9.1.0",
47
47
  "p-retry": "^7.1.1",
48
48
  "pg": "^8.19.0",
49
+ "posthog-node": "^4.0.0",
49
50
  "piscina": "^5.1.4",
50
51
  "pixelmatch": "^5.3.0",
51
52
  "playwright": "1.58.0",
@@ -61,6 +62,11 @@
61
62
  "node-pty": "^1.0.0",
62
63
  "sharp": "^0.34.5",
63
64
  "ws": "^8.18.3",
65
+ "@xterm/xterm": "^6.0.0",
66
+ "@xterm/addon-fit": "^0.11.0",
67
+ "@xterm/addon-web-links": "^0.11.0",
68
+ "@xterm/addon-webgl": "^0.18.0",
69
+ "@xterm/addon-canvas": "^0.7.0",
64
70
  "simple-git": "^3.32.2",
65
71
  "typescript": "^5.9.3",
66
72
  "uuid": "^11.1.0",