@codeyam/codeyam-cli 0.1.0-staging.ae0de75 → 0.1.0-staging.b6c4c78

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 (420) hide show
  1. package/analyzer-template/.build-info.json +7 -7
  2. package/analyzer-template/log.txt +3 -3
  3. package/analyzer-template/package.json +6 -6
  4. package/analyzer-template/packages/ai/package.json +1 -1
  5. package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +0 -33
  6. package/analyzer-template/packages/analyze/src/lib/ProjectAnalyzer.ts +13 -7
  7. package/analyzer-template/packages/analyze/src/lib/asts/index.ts +7 -2
  8. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.ts +0 -98
  9. package/analyzer-template/packages/aws/package.json +1 -1
  10. package/analyzer-template/packages/database/package.json +1 -1
  11. package/analyzer-template/packages/database/src/lib/kysely/tables/editorScenariosTable.ts +92 -0
  12. package/analyzer-template/packages/database/src/lib/loadEntities.ts +0 -6
  13. package/analyzer-template/packages/database/src/lib/updateCommitMetadata.ts +0 -65
  14. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts +10 -0
  15. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts.map +1 -1
  16. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js +92 -0
  17. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -1
  18. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.d.ts.map +1 -1
  19. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js +0 -6
  20. package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js.map +1 -1
  21. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.d.ts.map +1 -1
  22. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js +0 -25
  23. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js.map +1 -1
  24. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.d.ts +2 -0
  25. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.d.ts.map +1 -1
  26. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.js +2 -0
  27. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.js.map +1 -1
  28. package/analyzer-template/packages/types/src/enums/ProjectFramework.ts +2 -0
  29. package/analyzer-template/packages/ui-components/package.json +1 -1
  30. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.d.ts +2 -0
  31. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.d.ts.map +1 -1
  32. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.js +2 -0
  33. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.js.map +1 -1
  34. package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js +196 -0
  35. package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js.map +1 -0
  36. package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js +114 -0
  37. package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js.map +1 -0
  38. package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js +149 -0
  39. package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js.map +1 -0
  40. package/codeyam-cli/src/commands/__tests__/editor.stepDispatch.test.js +45 -0
  41. package/codeyam-cli/src/commands/__tests__/editor.stepDispatch.test.js.map +1 -0
  42. package/codeyam-cli/src/commands/__tests__/init.gitignore.test.js +101 -47
  43. package/codeyam-cli/src/commands/__tests__/init.gitignore.test.js.map +1 -1
  44. package/codeyam-cli/src/commands/default.js +3 -46
  45. package/codeyam-cli/src/commands/default.js.map +1 -1
  46. package/codeyam-cli/src/commands/editor.js +2629 -329
  47. package/codeyam-cli/src/commands/editor.js.map +1 -1
  48. package/codeyam-cli/src/commands/init.js +68 -34
  49. package/codeyam-cli/src/commands/init.js.map +1 -1
  50. package/codeyam-cli/src/data/techStacks.js +77 -0
  51. package/codeyam-cli/src/data/techStacks.js.map +1 -0
  52. package/codeyam-cli/src/utils/__tests__/analyzerFinalization.test.js +173 -0
  53. package/codeyam-cli/src/utils/__tests__/analyzerFinalization.test.js.map +1 -0
  54. package/codeyam-cli/src/utils/__tests__/backgroundServer.test.js +46 -0
  55. package/codeyam-cli/src/utils/__tests__/backgroundServer.test.js.map +1 -0
  56. package/codeyam-cli/src/utils/__tests__/devServerState.test.js +134 -0
  57. package/codeyam-cli/src/utils/__tests__/devServerState.test.js.map +1 -0
  58. package/codeyam-cli/src/utils/__tests__/editorApi.test.js +137 -0
  59. package/codeyam-cli/src/utils/__tests__/editorApi.test.js.map +1 -0
  60. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +742 -1
  61. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -1
  62. package/codeyam-cli/src/utils/__tests__/editorBroadcastViewport.test.js +76 -0
  63. package/codeyam-cli/src/utils/__tests__/editorBroadcastViewport.test.js.map +1 -0
  64. package/codeyam-cli/src/utils/__tests__/editorCapture.test.js +93 -0
  65. package/codeyam-cli/src/utils/__tests__/editorCapture.test.js.map +1 -0
  66. package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js +181 -3
  67. package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js.map +1 -1
  68. package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js +124 -0
  69. package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js.map +1 -0
  70. package/codeyam-cli/src/utils/__tests__/editorEntityHelpers.test.js +223 -0
  71. package/codeyam-cli/src/utils/__tests__/editorEntityHelpers.test.js.map +1 -0
  72. package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js +294 -0
  73. package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js.map +1 -0
  74. package/codeyam-cli/src/utils/__tests__/editorJournal.test.js +249 -2
  75. package/codeyam-cli/src/utils/__tests__/editorJournal.test.js.map +1 -1
  76. package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js +555 -0
  77. package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js.map +1 -0
  78. package/codeyam-cli/src/utils/__tests__/editorMigration.test.js +430 -0
  79. package/codeyam-cli/src/utils/__tests__/editorMigration.test.js.map +1 -0
  80. package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js +118 -1
  81. package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js.map +1 -1
  82. package/codeyam-cli/src/utils/__tests__/editorPreview.test.js +209 -3
  83. package/codeyam-cli/src/utils/__tests__/editorPreview.test.js.map +1 -1
  84. package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js +153 -0
  85. package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js.map +1 -0
  86. package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js +139 -0
  87. package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js.map +1 -0
  88. package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js +221 -0
  89. package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js.map +1 -0
  90. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js +1114 -2
  91. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js.map +1 -1
  92. package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js +280 -0
  93. package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js.map +1 -0
  94. package/codeyam-cli/src/utils/__tests__/editorSessionFilter.test.js +66 -0
  95. package/codeyam-cli/src/utils/__tests__/editorSessionFilter.test.js.map +1 -0
  96. package/codeyam-cli/src/utils/__tests__/editorShouldRevalidate.test.js +53 -0
  97. package/codeyam-cli/src/utils/__tests__/editorShouldRevalidate.test.js.map +1 -0
  98. package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js +1829 -0
  99. package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js.map +1 -0
  100. package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js +107 -0
  101. package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js.map +1 -0
  102. package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js +129 -0
  103. package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js.map +1 -0
  104. package/codeyam-cli/src/utils/__tests__/routePatternMatching.test.js +118 -0
  105. package/codeyam-cli/src/utils/__tests__/routePatternMatching.test.js.map +1 -0
  106. package/codeyam-cli/src/utils/__tests__/scenarioCoverage.test.js +227 -0
  107. package/codeyam-cli/src/utils/__tests__/scenarioCoverage.test.js.map +1 -0
  108. package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js +454 -0
  109. package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js.map +1 -0
  110. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +26 -5
  111. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
  112. package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js +51 -0
  113. package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js.map +1 -0
  114. package/codeyam-cli/src/utils/__tests__/webappDetection.test.js +142 -0
  115. package/codeyam-cli/src/utils/__tests__/webappDetection.test.js.map +1 -0
  116. package/codeyam-cli/src/utils/analysisRunner.js +3 -1
  117. package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
  118. package/codeyam-cli/src/utils/analyzer.js +9 -0
  119. package/codeyam-cli/src/utils/analyzer.js.map +1 -1
  120. package/codeyam-cli/src/utils/analyzerFinalization.js +100 -0
  121. package/codeyam-cli/src/utils/analyzerFinalization.js.map +1 -0
  122. package/codeyam-cli/src/utils/backgroundServer.js +94 -18
  123. package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
  124. package/codeyam-cli/src/utils/database.js +37 -2
  125. package/codeyam-cli/src/utils/database.js.map +1 -1
  126. package/codeyam-cli/src/utils/devServerState.js +71 -0
  127. package/codeyam-cli/src/utils/devServerState.js.map +1 -0
  128. package/codeyam-cli/src/utils/editorApi.js +79 -0
  129. package/codeyam-cli/src/utils/editorApi.js.map +1 -0
  130. package/codeyam-cli/src/utils/editorAudit.js +135 -7
  131. package/codeyam-cli/src/utils/editorAudit.js.map +1 -1
  132. package/codeyam-cli/src/utils/editorBroadcastViewport.js +26 -0
  133. package/codeyam-cli/src/utils/editorBroadcastViewport.js.map +1 -0
  134. package/codeyam-cli/src/utils/editorCapture.js +102 -0
  135. package/codeyam-cli/src/utils/editorCapture.js.map +1 -0
  136. package/codeyam-cli/src/utils/editorDevServer.js +100 -1
  137. package/codeyam-cli/src/utils/editorDevServer.js.map +1 -1
  138. package/codeyam-cli/src/utils/editorEntityChangeStatus.js +44 -0
  139. package/codeyam-cli/src/utils/editorEntityChangeStatus.js.map +1 -0
  140. package/codeyam-cli/src/utils/editorEntityHelpers.js +129 -0
  141. package/codeyam-cli/src/utils/editorEntityHelpers.js.map +1 -0
  142. package/codeyam-cli/src/utils/editorImageVerifier.js +155 -0
  143. package/codeyam-cli/src/utils/editorImageVerifier.js.map +1 -0
  144. package/codeyam-cli/src/utils/editorJournal.js +92 -4
  145. package/codeyam-cli/src/utils/editorJournal.js.map +1 -1
  146. package/codeyam-cli/src/utils/editorLoaderHelpers.js +140 -0
  147. package/codeyam-cli/src/utils/editorLoaderHelpers.js.map +1 -0
  148. package/codeyam-cli/src/utils/editorMigration.js +224 -0
  149. package/codeyam-cli/src/utils/editorMigration.js.map +1 -0
  150. package/codeyam-cli/src/utils/editorMockState.js +1 -1
  151. package/codeyam-cli/src/utils/editorPreloadHelpers.js +72 -1
  152. package/codeyam-cli/src/utils/editorPreloadHelpers.js.map +1 -1
  153. package/codeyam-cli/src/utils/editorPreview.js +72 -1
  154. package/codeyam-cli/src/utils/editorPreview.js.map +1 -1
  155. package/codeyam-cli/src/utils/editorScenarioSwitch.js +112 -0
  156. package/codeyam-cli/src/utils/editorScenarioSwitch.js.map +1 -0
  157. package/codeyam-cli/src/utils/editorScenarios.js +349 -0
  158. package/codeyam-cli/src/utils/editorScenarios.js.map +1 -1
  159. package/codeyam-cli/src/utils/editorSeedAdapter.js +352 -0
  160. package/codeyam-cli/src/utils/editorSeedAdapter.js.map +1 -0
  161. package/codeyam-cli/src/utils/editorShouldRevalidate.js +21 -0
  162. package/codeyam-cli/src/utils/editorShouldRevalidate.js.map +1 -0
  163. package/codeyam-cli/src/utils/entityChangeStatus.js +360 -0
  164. package/codeyam-cli/src/utils/entityChangeStatus.js.map +1 -0
  165. package/codeyam-cli/src/utils/entityChangeStatus.server.js +196 -0
  166. package/codeyam-cli/src/utils/entityChangeStatus.server.js.map +1 -0
  167. package/codeyam-cli/src/utils/install-skills.js +10 -1
  168. package/codeyam-cli/src/utils/install-skills.js.map +1 -1
  169. package/codeyam-cli/src/utils/parseRegisterArg.js +31 -0
  170. package/codeyam-cli/src/utils/parseRegisterArg.js.map +1 -0
  171. package/codeyam-cli/src/utils/progress.js +2 -2
  172. package/codeyam-cli/src/utils/progress.js.map +1 -1
  173. package/codeyam-cli/src/utils/routePatternMatching.js +129 -0
  174. package/codeyam-cli/src/utils/routePatternMatching.js.map +1 -0
  175. package/codeyam-cli/src/utils/scenarioCoverage.js +74 -0
  176. package/codeyam-cli/src/utils/scenarioCoverage.js.map +1 -0
  177. package/codeyam-cli/src/utils/scenariosManifest.js +244 -0
  178. package/codeyam-cli/src/utils/scenariosManifest.js.map +1 -0
  179. package/codeyam-cli/src/utils/serverState.js +30 -0
  180. package/codeyam-cli/src/utils/serverState.js.map +1 -1
  181. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +47 -16
  182. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
  183. package/codeyam-cli/src/utils/simulationGateMiddleware.js +8 -1
  184. package/codeyam-cli/src/utils/simulationGateMiddleware.js.map +1 -1
  185. package/codeyam-cli/src/utils/slugUtils.js +25 -0
  186. package/codeyam-cli/src/utils/slugUtils.js.map +1 -0
  187. package/codeyam-cli/src/utils/syncMocksMiddleware.js +2 -2
  188. package/codeyam-cli/src/utils/syncMocksMiddleware.js.map +1 -1
  189. package/codeyam-cli/src/utils/webappDetection.js +21 -0
  190. package/codeyam-cli/src/utils/webappDetection.js.map +1 -1
  191. package/codeyam-cli/src/webserver/__tests__/clientErrors.test.js +40 -0
  192. package/codeyam-cli/src/webserver/__tests__/clientErrors.test.js.map +1 -0
  193. package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js +567 -0
  194. package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js.map +1 -0
  195. package/codeyam-cli/src/webserver/__tests__/idleDetector.test.js +146 -0
  196. package/codeyam-cli/src/webserver/__tests__/idleDetector.test.js.map +1 -0
  197. package/codeyam-cli/src/webserver/app/lib/clientErrors.js +65 -0
  198. package/codeyam-cli/src/webserver/app/lib/clientErrors.js.map +1 -0
  199. package/codeyam-cli/src/webserver/app/lib/git.js +397 -0
  200. package/codeyam-cli/src/webserver/app/lib/git.js.map +1 -0
  201. package/codeyam-cli/src/webserver/app/types/editor.js +8 -0
  202. package/codeyam-cli/src/webserver/app/types/editor.js.map +1 -0
  203. package/codeyam-cli/src/webserver/backgroundServer.js +18 -4
  204. package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
  205. package/codeyam-cli/src/webserver/build/client/assets/CopyButton-CzTDWkF2.js +1 -0
  206. package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-C76mRRiF.js → EntityItem-BFbq6iFk.js} +5 -5
  207. package/codeyam-cli/src/webserver/build/client/assets/EntityTypeBadge-CQgyEGV-.js +1 -0
  208. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-CobE682z.js → EntityTypeIcon-B6OMi58N.js} +9 -9
  209. package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-DuYodzo1.js +1 -0
  210. package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-CXo9EeCl.js +25 -0
  211. package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-DYCNb2It.js +3 -0
  212. package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-BU_OAEMP.js → LoadingDots-By5zI316.js} +1 -1
  213. package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-ceAyBX-H.js → LogViewer-CZgY3sxX.js} +3 -3
  214. package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-djPLI-WV.js → ReportIssueModal-CnYYwRDw.js} +4 -4
  215. package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-CDoF7ZpU.js +1 -0
  216. package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-B76aig_2.js → ScenarioViewer-DrnfvaLL.js} +3 -3
  217. package/codeyam-cli/src/webserver/build/client/assets/Spinner-Df3UCi8k.js +34 -0
  218. package/codeyam-cli/src/webserver/build/client/assets/TruncatedFilePath-CK7-NaPZ.js +1 -0
  219. package/codeyam-cli/src/webserver/build/client/assets/ViewportInspectBar-DRKR9T0U.js +1 -0
  220. package/codeyam-cli/src/webserver/build/client/assets/{_index-C96V0n15.js → _index-ClR-g3tY.js} +4 -4
  221. package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-BpKzcsJz.js → activity.(_tab)-DTH6ydEA.js} +8 -8
  222. package/codeyam-cli/src/webserver/build/client/assets/addon-canvas-DpzMmAy5.js +1 -0
  223. package/codeyam-cli/src/webserver/build/client/assets/addon-fit-YJmn1quW.js +12 -0
  224. package/codeyam-cli/src/webserver/build/client/assets/{addon-web-links-Duc5hnl7.js → addon-web-links-74hnHF59.js} +1 -1
  225. package/codeyam-cli/src/webserver/build/client/assets/addon-webgl-DI8QOUvO.js +58 -0
  226. package/codeyam-cli/src/webserver/build/client/assets/{agent-transcripts-D9hemwl6.js → agent-transcripts-B8CYhCO9.js} +7 -7
  227. package/codeyam-cli/src/webserver/build/client/assets/api.editor-file-diff-l0sNRNKZ.js +1 -0
  228. package/codeyam-cli/src/webserver/build/client/assets/api.editor-file-l0sNRNKZ.js +1 -0
  229. package/codeyam-cli/src/webserver/build/client/assets/api.editor-project-info-l0sNRNKZ.js +1 -0
  230. package/codeyam-cli/src/webserver/build/client/assets/api.editor-rename-scenario-l0sNRNKZ.js +1 -0
  231. package/codeyam-cli/src/webserver/build/client/assets/api.editor-save-seed-state-l0sNRNKZ.js +1 -0
  232. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-coverage-l0sNRNKZ.js +1 -0
  233. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-prompt-l0sNRNKZ.js +1 -0
  234. package/codeyam-cli/src/webserver/build/client/assets/api.editor-session-l0sNRNKZ.js +1 -0
  235. package/codeyam-cli/src/webserver/build/client/assets/{book-open-D_nMCFmP.js → book-open-CLaoh4ac.js} +2 -2
  236. package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-BH2h1Ea2.js → chevron-down-BZ2DZxbW.js} +2 -2
  237. package/codeyam-cli/src/webserver/build/client/assets/{chunk-JZWAC4HX-C4pqxYJB.js → chunk-JZWAC4HX-BBXArFPl.js} +13 -21
  238. package/codeyam-cli/src/webserver/build/client/assets/{circle-check-DyIKORY6.js → circle-check-CT4unAk-.js} +2 -2
  239. package/codeyam-cli/src/webserver/build/client/assets/{copy-NDbZjXao.js → copy-zK0B6Nu-.js} +3 -3
  240. package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-DJB0YQJL.js +41 -0
  241. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-CkXFP_i-.js +1 -0
  242. package/codeyam-cli/src/webserver/build/client/assets/editor._tab-DPw7NZHc.js +1 -0
  243. package/codeyam-cli/src/webserver/build/client/assets/editor.entity.(_sha)-y_5LB2iU.js +58 -0
  244. package/codeyam-cli/src/webserver/build/client/assets/editorPreview-DBa7T2FK.js +41 -0
  245. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-CrjR3zZW.js → entity._sha._-BqAN7hyG.js} +3 -3
  246. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-BOi8kpwd.js +6 -0
  247. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-Dg1NhIms.js +6 -0
  248. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-CJX6kkkV.js +6 -0
  249. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-BMvVHNXU.js → entity._sha_.edit._scenarioId-BhVjZhKg.js} +2 -2
  250. package/codeyam-cli/src/webserver/build/client/assets/{entry.client-DTvKq3TY.js → entry.client-_gzKltPN.js} +6 -6
  251. package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-Daa96Fr1.js +1 -0
  252. package/codeyam-cli/src/webserver/build/client/assets/files-CV_17tZS.js +1 -0
  253. package/codeyam-cli/src/webserver/build/client/assets/git-D-YXmMbR.js +1 -0
  254. package/codeyam-cli/src/webserver/build/client/assets/globals-BCTpZEY8.css +1 -0
  255. package/codeyam-cli/src/webserver/build/client/assets/index-Blo6EK8G.js +15 -0
  256. package/codeyam-cli/src/webserver/build/client/assets/{index-10oVnAAH.js → index-BsX0F-9C.js} +1 -1
  257. package/codeyam-cli/src/webserver/build/client/assets/{index-BcvgDzbZ.js → index-CCrgCshv.js} +1 -1
  258. package/codeyam-cli/src/webserver/build/client/assets/jsx-runtime-D_zvdyIk.js +9 -0
  259. package/codeyam-cli/src/webserver/build/client/assets/labs-Byazq8Pv.js +1 -0
  260. package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-BAXYRVEO.js → loader-circle-DVQ0oHR7.js} +2 -2
  261. package/codeyam-cli/src/webserver/build/client/assets/manifest-5f1c29f5.js +1 -0
  262. package/codeyam-cli/src/webserver/build/client/assets/memory-b-VmA2Vj.js +101 -0
  263. package/codeyam-cli/src/webserver/build/client/assets/{pause-DTAcYxBt.js → pause-DGcndCAa.js} +3 -3
  264. package/codeyam-cli/src/webserver/build/client/assets/root-BBCQJ_ZM.js +67 -0
  265. package/codeyam-cli/src/webserver/build/client/assets/{search-fKo7v0Zo.js → search-C0Uw0bcK.js} +2 -2
  266. package/codeyam-cli/src/webserver/build/client/assets/settings-OoNgHIfW.js +1 -0
  267. package/codeyam-cli/src/webserver/build/client/assets/simulations-Bcemfu8a.js +1 -0
  268. package/codeyam-cli/src/webserver/build/client/assets/{terminal-BG4heKCG.js → terminal-BgMmG7R9.js} +3 -3
  269. package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-DtSmdtM4.js → triangle-alert-Cs87hJYK.js} +2 -2
  270. package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-BR3Rs7JY.js +1 -0
  271. package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-C14nCb1q.js → useLastLogLine-BxxP_XF9.js} +1 -1
  272. package/codeyam-cli/src/webserver/build/client/assets/useReportContext-BermyNU5.js +1 -0
  273. package/codeyam-cli/src/webserver/build/client/assets/useToast-a_QN_W9_.js +1 -0
  274. package/codeyam-cli/src/webserver/build/client/sound-test.html +98 -0
  275. package/codeyam-cli/src/webserver/build/server/assets/index-BLKsJR3o.js +1 -0
  276. package/codeyam-cli/src/webserver/build/server/assets/init-C2iMAqYu.js +10 -0
  277. package/codeyam-cli/src/webserver/build/server/assets/server-build-DR42Xd5a.js +489 -0
  278. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  279. package/codeyam-cli/src/webserver/build-info.json +5 -5
  280. package/codeyam-cli/src/webserver/editorProxy.js +511 -50
  281. package/codeyam-cli/src/webserver/editorProxy.js.map +1 -1
  282. package/codeyam-cli/src/webserver/idleDetector.js +73 -0
  283. package/codeyam-cli/src/webserver/idleDetector.js.map +1 -0
  284. package/codeyam-cli/src/webserver/mockStateEvents.js +28 -0
  285. package/codeyam-cli/src/webserver/mockStateEvents.js.map +1 -0
  286. package/codeyam-cli/src/webserver/public/sound-test.html +98 -0
  287. package/codeyam-cli/src/webserver/scripts/codeyam-preload.mjs +242 -3
  288. package/codeyam-cli/src/webserver/scripts/journalCapture.ts +94 -4
  289. package/codeyam-cli/src/webserver/server.js +99 -16
  290. package/codeyam-cli/src/webserver/server.js.map +1 -1
  291. package/codeyam-cli/src/webserver/terminalServer.js +186 -39
  292. package/codeyam-cli/src/webserver/terminalServer.js.map +1 -1
  293. package/codeyam-cli/templates/chrome-extension-react/EXTENSION_SETUP.md +75 -0
  294. package/codeyam-cli/templates/chrome-extension-react/README.md +46 -0
  295. package/codeyam-cli/templates/chrome-extension-react/gitignore +15 -0
  296. package/codeyam-cli/templates/chrome-extension-react/index.html +12 -0
  297. package/codeyam-cli/templates/chrome-extension-react/package.json +27 -0
  298. package/codeyam-cli/templates/chrome-extension-react/popup.html +12 -0
  299. package/codeyam-cli/templates/chrome-extension-react/public/manifest.json +15 -0
  300. package/codeyam-cli/templates/chrome-extension-react/src/background/service-worker.ts +7 -0
  301. package/codeyam-cli/templates/chrome-extension-react/src/globals.css +6 -0
  302. package/codeyam-cli/templates/chrome-extension-react/src/lib/storage.ts +37 -0
  303. package/codeyam-cli/templates/chrome-extension-react/src/popup/App.tsx +12 -0
  304. package/codeyam-cli/templates/chrome-extension-react/src/popup/main.tsx +10 -0
  305. package/codeyam-cli/templates/chrome-extension-react/tsconfig.json +24 -0
  306. package/codeyam-cli/templates/chrome-extension-react/vite.config.ts +41 -0
  307. package/codeyam-cli/templates/codeyam-editor-claude.md +84 -5
  308. package/codeyam-cli/templates/editor-step-hook.py +188 -21
  309. package/codeyam-cli/templates/expo-react-native/MOBILE_SETUP.md +89 -0
  310. package/codeyam-cli/templates/expo-react-native/README.md +41 -0
  311. package/codeyam-cli/templates/expo-react-native/app/(tabs)/_layout.tsx +33 -0
  312. package/codeyam-cli/templates/expo-react-native/app/(tabs)/index.tsx +12 -0
  313. package/codeyam-cli/templates/expo-react-native/app/(tabs)/settings.tsx +12 -0
  314. package/codeyam-cli/templates/expo-react-native/app/_layout.tsx +12 -0
  315. package/codeyam-cli/templates/expo-react-native/app.json +18 -0
  316. package/codeyam-cli/templates/expo-react-native/babel.config.js +9 -0
  317. package/codeyam-cli/templates/expo-react-native/gitignore +12 -0
  318. package/codeyam-cli/templates/expo-react-native/global.css +3 -0
  319. package/codeyam-cli/templates/expo-react-native/lib/storage.ts +32 -0
  320. package/codeyam-cli/templates/expo-react-native/metro.config.js +6 -0
  321. package/codeyam-cli/templates/expo-react-native/nativewind-env.d.ts +1 -0
  322. package/codeyam-cli/templates/expo-react-native/package.json +38 -0
  323. package/codeyam-cli/templates/expo-react-native/tailwind.config.js +10 -0
  324. package/codeyam-cli/templates/expo-react-native/tsconfig.json +10 -0
  325. package/codeyam-cli/templates/nextjs-prisma-sqlite/AUTH_PATTERNS.md +308 -0
  326. package/codeyam-cli/templates/nextjs-prisma-sqlite/AUTH_UPGRADE.md +304 -0
  327. package/codeyam-cli/templates/nextjs-prisma-sqlite/DATABASE.md +126 -0
  328. package/codeyam-cli/templates/nextjs-prisma-sqlite/FEATURE_PATTERNS.md +37 -0
  329. package/codeyam-cli/templates/nextjs-prisma-sqlite/README.md +53 -0
  330. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/codeyam-isolate/layout.tsx +12 -0
  331. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/lib/prisma.ts +9 -4
  332. package/codeyam-cli/templates/nextjs-prisma-sqlite/env +4 -0
  333. package/codeyam-cli/templates/nextjs-prisma-sqlite/gitignore +21 -0
  334. package/codeyam-cli/templates/nextjs-prisma-sqlite/package.json +5 -1
  335. package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma/seed.ts +4 -1
  336. package/codeyam-cli/templates/nextjs-prisma-sqlite/seed-adapter.ts +127 -0
  337. package/codeyam-cli/templates/nextjs-prisma-sqlite/vitest.config.ts +13 -0
  338. package/codeyam-cli/templates/nextjs-prisma-supabase/README.md +52 -0
  339. package/codeyam-cli/templates/{nextjs-prisma-sqlite/PRISMA_SETUP.md → nextjs-prisma-supabase/SUPABASE_SETUP.md} +37 -17
  340. package/codeyam-cli/templates/nextjs-prisma-supabase/app/api/todos/route.ts +17 -0
  341. package/codeyam-cli/templates/nextjs-prisma-supabase/app/globals.css +26 -0
  342. package/codeyam-cli/templates/nextjs-prisma-supabase/app/layout.tsx +34 -0
  343. package/codeyam-cli/templates/nextjs-prisma-supabase/app/lib/prisma.ts +20 -0
  344. package/codeyam-cli/templates/nextjs-prisma-supabase/app/lib/supabase.ts +12 -0
  345. package/codeyam-cli/templates/nextjs-prisma-supabase/app/page.tsx +10 -0
  346. package/codeyam-cli/templates/nextjs-prisma-supabase/env +9 -0
  347. package/codeyam-cli/templates/nextjs-prisma-supabase/eslint.config.mjs +11 -0
  348. package/codeyam-cli/templates/nextjs-prisma-supabase/gitignore +40 -0
  349. package/codeyam-cli/templates/nextjs-prisma-supabase/next.config.ts +11 -0
  350. package/codeyam-cli/templates/nextjs-prisma-supabase/package.json +37 -0
  351. package/codeyam-cli/templates/nextjs-prisma-supabase/postcss.config.mjs +7 -0
  352. package/codeyam-cli/templates/nextjs-prisma-supabase/prisma/schema.prisma +27 -0
  353. package/codeyam-cli/templates/nextjs-prisma-supabase/prisma/seed.ts +39 -0
  354. package/codeyam-cli/templates/nextjs-prisma-supabase/prisma.config.ts +12 -0
  355. package/codeyam-cli/templates/nextjs-prisma-supabase/tsconfig.json +34 -0
  356. package/codeyam-cli/templates/seed-adapters/supabase.ts +282 -0
  357. package/codeyam-cli/templates/skills/codeyam-dev-mode/SKILL.md +2 -2
  358. package/codeyam-cli/templates/skills/codeyam-editor/SKILL.md +159 -17
  359. package/codeyam-cli/templates/skills/codeyam-memory/SKILL.md +10 -10
  360. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/detect-deprecated-patterns.mjs +139 -0
  361. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/find-exports.mjs +52 -0
  362. package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/read-json-field.mjs +61 -0
  363. package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/ripgrep-fallback.mjs +155 -0
  364. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/cleanup.mjs +13 -0
  365. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/filter-session.mjs +95 -0
  366. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/preprocess.mjs +160 -0
  367. package/package.json +15 -10
  368. package/packages/ai/src/lib/generateExecutionFlows.js +0 -11
  369. package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -1
  370. package/packages/analyze/src/lib/ProjectAnalyzer.js +10 -4
  371. package/packages/analyze/src/lib/ProjectAnalyzer.js.map +1 -1
  372. package/packages/analyze/src/lib/asts/index.js +4 -2
  373. package/packages/analyze/src/lib/asts/index.js.map +1 -1
  374. package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js +0 -40
  375. package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js.map +1 -1
  376. package/packages/database/src/lib/kysely/tables/editorScenariosTable.js +92 -0
  377. package/packages/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -1
  378. package/packages/database/src/lib/loadEntities.js +0 -6
  379. package/packages/database/src/lib/loadEntities.js.map +1 -1
  380. package/packages/database/src/lib/updateCommitMetadata.js +0 -25
  381. package/packages/database/src/lib/updateCommitMetadata.js.map +1 -1
  382. package/packages/types/src/enums/ProjectFramework.js +2 -0
  383. package/packages/types/src/enums/ProjectFramework.js.map +1 -1
  384. package/scripts/npm-post-install.cjs +22 -0
  385. package/codeyam-cli/src/webserver/build/client/assets/CopyButton-DmJveP3T.js +0 -1
  386. package/codeyam-cli/src/webserver/build/client/assets/EntityTypeBadge-g3saevPb.js +0 -1
  387. package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-Bu6c6aDe.js +0 -1
  388. package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-DYFW3lDD.js +0 -25
  389. package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-DLeucoVX.js +0 -3
  390. package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-BED4B6sP.js +0 -1
  391. package/codeyam-cli/src/webserver/build/client/assets/Spinner-Bb5uFQ5V.js +0 -34
  392. package/codeyam-cli/src/webserver/build/client/assets/Terminal-wkqC0AQk.js +0 -41
  393. package/codeyam-cli/src/webserver/build/client/assets/TruncatedFilePath-C8OKAR5x.js +0 -1
  394. package/codeyam-cli/src/webserver/build/client/assets/addon-fit-CUXOrorO.js +0 -1
  395. package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-CMT1jU2q.js +0 -21
  396. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-BiM6z3Do.js +0 -1
  397. package/codeyam-cli/src/webserver/build/client/assets/editor-CdjF_fX6.js +0 -8
  398. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-D8ILZMR0.js +0 -6
  399. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-C28BiQzt.js +0 -6
  400. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-p9hhkjJM.js +0 -6
  401. package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-cPo8LiG3.js +0 -1
  402. package/codeyam-cli/src/webserver/build/client/assets/files-DO4CZ16O.js +0 -1
  403. package/codeyam-cli/src/webserver/build/client/assets/git-CFCTYk9I.js +0 -15
  404. package/codeyam-cli/src/webserver/build/client/assets/globals-B17TBSS6.css +0 -1
  405. package/codeyam-cli/src/webserver/build/client/assets/labs-Zk7ryIM1.js +0 -1
  406. package/codeyam-cli/src/webserver/build/client/assets/manifest-b8fd6b07.js +0 -1
  407. package/codeyam-cli/src/webserver/build/client/assets/memory-FweZHj5U.js +0 -93
  408. package/codeyam-cli/src/webserver/build/client/assets/root-DUKqhFlb.js +0 -67
  409. package/codeyam-cli/src/webserver/build/client/assets/settings-DfuTtcJP.js +0 -1
  410. package/codeyam-cli/src/webserver/build/client/assets/simulations-B3aOzpCZ.js +0 -1
  411. package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-ByhSyh0W.js +0 -1
  412. package/codeyam-cli/src/webserver/build/client/assets/useReportContext-O-jkvSPx.js +0 -1
  413. package/codeyam-cli/src/webserver/build/client/assets/useToast-9FIWuYfK.js +0 -1
  414. package/codeyam-cli/src/webserver/build/server/assets/index-BLhjL9Xi.js +0 -1
  415. package/codeyam-cli/src/webserver/build/server/assets/server-build-DyMuI5mU.js +0 -363
  416. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/detect-deprecated-patterns.sh +0 -108
  417. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/find-exports.sh +0 -69
  418. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/cleanup.sh +0 -12
  419. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/filter.jq +0 -45
  420. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/preprocess.sh +0 -139
@@ -0,0 +1,282 @@
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 * as fs from 'fs';
32
+ import * as path from 'path';
33
+
34
+ /**
35
+ * Scan all env vars for values matching a pattern.
36
+ * Returns ALL unique matches (not just the first) so callers can disambiguate.
37
+ */
38
+ function findAllEnvByPattern(pattern: RegExp): string[] {
39
+ const matches = new Set<string>();
40
+ for (const value of Object.values(process.env)) {
41
+ if (value && pattern.test(value)) matches.add(value);
42
+ }
43
+ return [...matches];
44
+ }
45
+
46
+ /**
47
+ * For legacy Supabase JWTs, decode the payload to check the `role` claim.
48
+ * Returns the role string ("service_role", "anon", etc.) or undefined.
49
+ */
50
+ function getJwtRole(jwt: string): string | undefined {
51
+ try {
52
+ const payload = jwt.split('.')[1];
53
+ const decoded = JSON.parse(Buffer.from(payload, 'base64url').toString());
54
+ return decoded.role;
55
+ } catch {
56
+ return undefined;
57
+ }
58
+ }
59
+
60
+ // Detect Supabase credentials by value pattern, not env var name.
61
+ // This works regardless of what the user named their env vars.
62
+ const supabaseUrl = findAllEnvByPattern(
63
+ /^https:\/\/[a-z0-9]+\.supabase\.co\b/,
64
+ )[0];
65
+
66
+ // New-format keys are unambiguous by prefix
67
+ const newSecretKey = findAllEnvByPattern(/^sb_secret_/)[0];
68
+ const newAnonKey = findAllEnvByPattern(/^sb_publishable_/)[0];
69
+
70
+ // Legacy JWT keys — disambiguate by decoding the role claim
71
+ const legacyJwts = findAllEnvByPattern(
72
+ /^eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/,
73
+ );
74
+ const legacyServiceRole = legacyJwts.find(
75
+ (jwt) => getJwtRole(jwt) === 'service_role',
76
+ );
77
+ const legacyAnon = legacyJwts.find((jwt) => getJwtRole(jwt) === 'anon');
78
+
79
+ const secretKey = newSecretKey || legacyServiceRole;
80
+ const anonKey = newAnonKey || legacyAnon;
81
+
82
+ if (!supabaseUrl || !secretKey) {
83
+ console.error(
84
+ 'Could not find Supabase credentials in environment variables.',
85
+ );
86
+ console.error(
87
+ 'Looking for: a URL matching https://<ref>.supabase.co and a key starting with sb_secret_ (or a service_role JWT)',
88
+ );
89
+ console.error(
90
+ 'Add them to .env.local — the seed adapter scans all env vars by value pattern.',
91
+ );
92
+ process.exit(1);
93
+ }
94
+
95
+ // Admin client for user management (uses secret key to bypass RLS)
96
+ const supabase = createClient(supabaseUrl, secretKey, {
97
+ auth: { autoRefreshToken: false, persistSession: false },
98
+ });
99
+
100
+ // Derive the project ref from the URL for cookie naming
101
+ // e.g. "https://abcdefgh.supabase.co" → "abcdefgh"
102
+ function getProjectRef(): string {
103
+ try {
104
+ const hostname = new URL(supabaseUrl!).hostname;
105
+ return hostname.split('.')[0];
106
+ } catch {
107
+ return 'unknown';
108
+ }
109
+ }
110
+
111
+ async function seedTables(seed: Record<string, unknown[]>) {
112
+ const tableNames = Object.keys(seed);
113
+ if (tableNames.length === 0) return;
114
+
115
+ console.log(`Seeding tables: ${tableNames.join(', ')}`);
116
+
117
+ // Wipe tables in reverse order (to respect foreign keys)
118
+ for (const table of [...tableNames].reverse()) {
119
+ const { error } = await supabase.from(table).delete().gte('id', 0);
120
+ if (error) {
121
+ const { error: error2 } = await supabase
122
+ .from(table)
123
+ .delete()
124
+ .not('id', 'is', null);
125
+ if (error2) {
126
+ console.warn(` Could not clear ${table}: ${error2.message}`);
127
+ } else {
128
+ console.log(` Cleared ${table}`);
129
+ }
130
+ } else {
131
+ console.log(` Cleared ${table}`);
132
+ }
133
+ }
134
+
135
+ // Insert seed data
136
+ for (const [table, rows] of Object.entries(seed)) {
137
+ if (!Array.isArray(rows) || rows.length === 0) continue;
138
+ const { error } = await supabase.from(table).insert(rows);
139
+ if (error) {
140
+ console.error(` Failed to seed ${table}: ${error.message}`);
141
+ process.exit(1);
142
+ }
143
+ console.log(` Seeded ${rows.length} rows into ${table}`);
144
+ }
145
+ }
146
+
147
+ /**
148
+ * Handle auth: create user, sign in, write session cookies.
149
+ * Returns the user ID so callers can replace __AUTH_USER_ID__ placeholders in seed data.
150
+ */
151
+ async function handleAuth(auth: {
152
+ email: string;
153
+ password: string;
154
+ }): Promise<string> {
155
+ const { email, password } = auth;
156
+
157
+ // Create user if they don't exist (auto-confirm email so sign-in works)
158
+ const { data: createData, error: createError } =
159
+ await supabase.auth.admin.createUser({
160
+ email,
161
+ password,
162
+ email_confirm: true,
163
+ });
164
+
165
+ if (createError) {
166
+ if (createError.message.includes('already been registered')) {
167
+ // User exists — update their password so sign-in works even if the
168
+ // scenario specifies a different password than a previous run.
169
+ const { data: listData } = await supabase.auth.admin.listUsers();
170
+ const existingUser = listData?.users?.find((u) => u.email === email);
171
+ if (existingUser) {
172
+ await supabase.auth.admin.updateUserById(existingUser.id, {
173
+ password,
174
+ });
175
+ console.log(` Updated password for existing user ${email}`);
176
+ }
177
+ } else {
178
+ console.error(` Failed to create auth user: ${createError.message}`);
179
+ process.exit(1);
180
+ }
181
+ }
182
+
183
+ // Sign in to get a valid session
184
+ // Use a separate client with the publishable/anon key for sign-in (if available)
185
+ const signInClient =
186
+ anonKey && anonKey !== secretKey
187
+ ? createClient(supabaseUrl!, anonKey, {
188
+ auth: { autoRefreshToken: false, persistSession: false },
189
+ })
190
+ : supabase;
191
+
192
+ const { data: signInData, error: signInError } =
193
+ await signInClient.auth.signInWithPassword({ email, password });
194
+
195
+ if (signInError || !signInData.session) {
196
+ console.error(
197
+ ` Failed to sign in as ${email}: ${signInError?.message || 'no session returned'}`,
198
+ );
199
+ process.exit(1);
200
+ }
201
+
202
+ const userId = signInData.user.id;
203
+ console.log(` Signed in as ${email} (user: ${userId})`);
204
+
205
+ // Write session cookies for the proxy to inject
206
+ const projectRef = getProjectRef();
207
+ const sessionOutput = {
208
+ cookies: [
209
+ {
210
+ name: `sb-${projectRef}-auth-token`,
211
+ value: JSON.stringify({
212
+ access_token: signInData.session.access_token,
213
+ refresh_token: signInData.session.refresh_token,
214
+ token_type: 'bearer',
215
+ expires_in: signInData.session.expires_in,
216
+ expires_at: signInData.session.expires_at,
217
+ }),
218
+ path: '/',
219
+ sameSite: 'Lax' as const,
220
+ },
221
+ ],
222
+ };
223
+
224
+ const outputDir = path.join(process.cwd(), '.codeyam', 'tmp');
225
+ fs.mkdirSync(outputDir, { recursive: true });
226
+ const outputPath = path.join(outputDir, 'seed-session.json');
227
+ fs.writeFileSync(outputPath, JSON.stringify(sessionOutput, null, 2));
228
+ console.log(` Session cookies written to ${outputPath}`);
229
+
230
+ return userId;
231
+ }
232
+
233
+ /**
234
+ * Replace __AUTH_USER_ID__ placeholders in seed data with the actual Supabase user ID.
235
+ * This lets scenarios reference the authenticated user in foreign key columns (e.g. user_id)
236
+ * without knowing the UUID ahead of time.
237
+ */
238
+ function replaceAuthPlaceholders(
239
+ seed: Record<string, unknown[]>,
240
+ userId: string,
241
+ ): Record<string, unknown[]> {
242
+ const json = JSON.stringify(seed);
243
+ const replaced = json.replace(/__AUTH_USER_ID__/g, userId);
244
+ return JSON.parse(replaced);
245
+ }
246
+
247
+ async function main() {
248
+ const seedDataPath = process.argv[2];
249
+ if (!seedDataPath) {
250
+ console.error('Usage: npx tsx .codeyam/seed-adapter.ts <seed-data.json>');
251
+ process.exit(1);
252
+ }
253
+
254
+ const raw = fs.readFileSync(seedDataPath, 'utf-8');
255
+ const data = JSON.parse(raw);
256
+
257
+ // Separate auth config from table data
258
+ const auth = data._auth;
259
+ let seed: Record<string, unknown[]> = {};
260
+ for (const [key, value] of Object.entries(data)) {
261
+ if (key === '_auth') continue;
262
+ seed[key] = value as unknown[];
263
+ }
264
+
265
+ // Auth first: we need the user ID to replace __AUTH_USER_ID__ placeholders
266
+ // in seed data (e.g. for user_id foreign key columns with Supabase RLS)
267
+ if (auth) {
268
+ const userId = await handleAuth(
269
+ auth as { email: string; password: string },
270
+ );
271
+ seed = replaceAuthPlaceholders(seed, userId);
272
+ }
273
+
274
+ await seedTables(seed);
275
+
276
+ console.log('Seed complete');
277
+ }
278
+
279
+ main().catch((e) => {
280
+ console.error('Seed adapter error:', e);
281
+ process.exit(1);
282
+ });
@@ -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
@@ -12,16 +12,78 @@ You are in **Editor Mode**. The user sees a split-screen: this terminal on the l
12
12
 
13
13
  You MUST follow a step-by-step workflow driven by `codeyam editor` commands. Each command tells you exactly what to do next. **You do NOT have all the instructions upfront** — the commands provide them incrementally.
14
14
 
15
- **Your first action:** Run `codeyam editor`.
15
+ **Your first action:** Run `codeyam editor steps`.
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
+ ## Migration Mode
20
+
21
+ 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.
22
+
23
+ Migration uses a different command set:
24
+
25
+ ```
26
+ codeyam editor migrate → Survey the project (explore pages, confirm order)
27
+ codeyam editor migrate 1-8 → Run migration step N for the current page
28
+ codeyam editor migrate next → Advance to the next page
29
+ codeyam editor migrate status → Show migration progress
30
+ ```
31
+
32
+ **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.
33
+
34
+ **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.
35
+
36
+ ### Migration Survey (codeyam editor migrate)
37
+
38
+ When you run `codeyam editor migrate` with no arguments and no existing migration state, follow this survey checklist:
39
+
40
+ 1. Read `package.json` — understand the framework, dependencies, and scripts
41
+ 2. Explore the project structure — find all page/route files
42
+ - Next.js App Router: `app/**/page.tsx` | Pages Router: `pages/**/*.tsx`
43
+ - Check for other patterns: `src/` directory, custom routing, etc.
44
+ 3. Read each page/route to assess complexity and data flow
45
+ 4. Identify how the dev server starts (check `scripts` in package.json)
46
+ 5. Note any environment variables, databases, or external services needed
47
+ 6. Present a numbered list of all pages with:
48
+ - Page name and route
49
+ - File path
50
+ - Complexity assessment (simple / moderate / complex)
51
+ 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
52
+ 8. Wait for user confirmation of the order
53
+
54
+ **After user confirms**, write `.codeyam/migration-state.json`:
55
+
56
+ ```json
57
+ {
58
+ "status": "surveyed",
59
+ "startedAt": "<ISO>",
60
+ "completedAt": null,
61
+ "pages": [
62
+ {
63
+ "name": "Home",
64
+ "route": "/",
65
+ "filePath": "app/page.tsx",
66
+ "status": "pending",
67
+ "startedAt": null,
68
+ "completedAt": null,
69
+ "extractedComponents": [],
70
+ "extractedFunctions": [],
71
+ "scenarioCount": 0
72
+ }
73
+ ],
74
+ "currentPageIndex": 0,
75
+ "sharedComponents": []
76
+ }
77
+ ```
78
+
79
+ Then run: `codeyam editor migrate 1`
80
+
19
81
  ## The Cycle
20
82
 
21
- Every feature follows 12 gated steps:
83
+ Every feature follows 13 gated steps:
22
84
 
23
85
  ```
24
- codeyam editor → Setup (if new) or cycle overview
86
+ codeyam editor steps → Setup (if new) or cycle overview
25
87
  codeyam editor 1 → Plan the feature (confirm with user)
26
88
  codeyam editor 2 → Build a working prototype fast
27
89
  codeyam editor 3 → Confirm prototype with user
@@ -33,10 +95,24 @@ codeyam editor 8 → Create app-level scenarios
33
95
  codeyam editor 9 → Create user-persona scenarios
34
96
  codeyam editor 10 → Verify screenshots and check for errors
35
97
  codeyam editor 11 → Create/update journal entry
36
- codeyam editor 12 → Present summary, get final approval
98
+ codeyam editor 12 → Verify screenshots and audit
99
+ codeyam editor 13 → Present summary, get final approval
37
100
  ```
38
101
 
39
- **You MUST run each command and follow its checklist before moving to the next.** Steps 1, 3, and 12 require user confirmation. After step 12, loop back to step 1.
102
+ **You MUST run each command and follow its checklist before moving to the next.** Steps 1, 3, and 13 require user confirmation. After step 13, loop back to step 1.
103
+
104
+ ## Handling User Feedback / Changes
105
+
106
+ 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:
107
+
108
+ - Code changes (components, routes, lib functions, styles)
109
+ - Scenario data updates (seed data, localStorage data, mock data)
110
+ - Style adjustments (CSS, Tailwind classes, layout tweaks)
111
+ - Even small fixes (typos, color tweaks, spacing)
112
+
113
+ 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.
114
+
115
+ **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.
40
116
 
41
117
  ## Key Rules
42
118
 
@@ -45,25 +121,91 @@ codeyam editor 12 → Present summary, get final approval
45
121
  - **Always scaffold with a database** (Prisma + SQLite)
46
122
  - **Build real API routes** — the proxy handles scenario data transparently
47
123
  - **Start the dev server via the CodeYam API** — it handles proxy setup automatically
48
- - **Verify the preview after changes** — check the dev server URL, not the proxy
124
+ - **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.
125
+
126
+ ## Keep the Preview Moving
127
+
128
+ 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.
129
+
130
+ **During prototyping (step 2):**
131
+
132
+ - Refresh after creating the first visible page, even if it's bare
133
+ - Refresh after adding each major UI section (header, list, form, etc.)
134
+ - Refresh after seeding data so the user sees real content appear
135
+ - Refresh after styling changes so the user sees the visual progress
136
+
137
+ **During extraction (step 5):**
138
+
139
+ - Refresh after extracting each batch of components to confirm nothing broke
140
+
141
+ **During changes:**
142
+
143
+ - Refresh after each individual change, not after all changes are done
144
+
145
+ **How to refresh:**
146
+
147
+ ```
148
+ codeyam editor preview '{"dimension":"<name from screenSizes>"}'
149
+ ```
150
+
151
+ Navigate to a specific path or switch scenario:
152
+
153
+ ```
154
+ codeyam editor preview '{"path":"/drinks/1","dimension":"<name from screenSizes>"}'
155
+ codeyam editor preview '{"scenarioId":"abc-123"}'
156
+ ```
157
+
158
+ The goal: the user should see the preview update 4-8+ times during a typical building session, not just once at the end.
159
+
160
+ ## Collaboration
161
+
162
+ 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.
163
+
164
+ 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.
49
165
 
50
166
  ## Quick Reference
51
167
 
52
168
  ```bash
53
- # Register scenario (auto-captures screenshot)
54
- curl -s -X POST http://localhost:${CODEYAM_PORT:-3111}/api/editor-register-scenario \
55
- -H 'Content-Type: application/json' \
56
- -d '{"name":"...","description":"...","mockData":{"routes":{"/api/...":{"body":[...]}}}}'
169
+ # Register component scenario (auto-captures screenshot)
170
+ # ALWAYS include "dimensions" — use the project's default screen size name from setup
171
+ 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":[...]}}}}'
172
+
173
+ # Register app scenario with seed data (ALWAYS include "url" and "dimensions")
174
+ codeyam editor register '{"name":"Full Catalog","type":"application","url":"/","dimensions":["<name from screenSizes>"],"seed":{"drinks":[...]}}'
175
+
176
+ # Register app scenario with localStorage (for apps using client-side storage instead of a database)
177
+ codeyam editor register '{"name":"Full Library","type":"application","url":"/","dimensions":["<name from screenSizes>"],"localStorage":{"articles":[...],"collections":[...]}}'
178
+
179
+ # For large seed/localStorage data, write JSON to a temp file and use @ prefix:
180
+ codeyam editor register @/tmp/scenario-data.json
57
181
 
58
182
  # Journal entry (one per feature, references scenario names)
59
- curl -s -X POST http://localhost:${CODEYAM_PORT:-3111}/api/editor-journal-entry \
60
- -H 'Content-Type: application/json' \
61
- -d '{"title":"...","type":"feature","description":"...","scenarios":["..."]}'
183
+ codeyam editor journal '{"title":"...","type":"feature","description":"..."}'
184
+
185
+ # Update journal with commit info
186
+ codeyam editor journal-update '{"time":"...","commitSha":"...","commitMessage":"..."}'
62
187
 
63
- # Refresh preview
64
- curl -s -X POST http://localhost:${CODEYAM_PORT:-3111}/api/dev-mode-preview
188
+ # Refresh preview / navigate / switch scenario (ALWAYS include "dimension")
189
+ codeyam editor preview '{"dimension":"<name from screenSizes>"}'
190
+ codeyam editor preview '{"path":"/drinks/1","dimension":"<name from screenSizes>"}'
191
+ codeyam editor preview '{"scenarioId":"abc-123"}'
192
+
193
+ # Show/hide results panel
194
+ codeyam editor show-results
195
+ codeyam editor hide-results
196
+
197
+ # Commit feature
198
+ codeyam editor commit '{"message":"feat: Add drinks page"}'
65
199
 
66
200
  # Restart dev server (only for config/dependency changes)
67
- curl -s -X POST http://localhost:${CODEYAM_PORT:-3111}/api/editor-dev-server \
68
- -H 'Content-Type: application/json' -d '{"action":"restart"}'
201
+ codeyam editor dev-server '{"action":"restart"}'
202
+
203
+ # Check for client-side errors
204
+ codeyam editor client-errors
205
+
206
+ # Verify all images load (extracts URLs from pages, HTTP-checks each one)
207
+ codeyam editor verify-images '{"paths":["/","/drinks/1"]}'
208
+
209
+ # Sync scenarios from manifest (after pulling collaborator changes)
210
+ codeyam editor sync
69
211
  ```
@@ -225,31 +225,31 @@ rm -rf /tmp/codeyam-memory/ /tmp/cc-session-analysis/
225
225
  ```
226
226
 
227
227
  ```bash
228
- bash .claude/skills/codeyam-memory/scripts/holistic-analysis/detect-deprecated-patterns.sh
228
+ node .claude/skills/codeyam-memory/scripts/holistic-analysis/detect-deprecated-patterns.mjs
229
229
  ```
230
230
 
231
231
  ```bash
232
- bash .claude/skills/codeyam-memory/scripts/holistic-analysis/find-exports.sh
232
+ node .claude/skills/codeyam-memory/scripts/holistic-analysis/find-exports.mjs
233
233
  ```
234
234
 
235
235
  ```bash
236
- bash .claude/skills/codeyam-memory/scripts/session-mining/preprocess.sh 2>/dev/null
236
+ node .claude/skills/codeyam-memory/scripts/session-mining/preprocess.mjs 2>/dev/null
237
237
  ```
238
238
 
239
- Capture the stdout of `preprocess.sh` — each line is a path to a filtered session file.
239
+ Capture the stdout of `preprocess.mjs` — each line is a path to a filtered session file.
240
240
 
241
241
  ### Step 2: Extract sizing metrics
242
242
 
243
- Use quick `jq` one-liners to extract counts — do NOT read the full JSON files into the main context:
243
+ Use quick one-liners to extract counts — do NOT read the full JSON files into the main context:
244
244
 
245
245
  ```bash
246
- jq '.dependencies | length' /tmp/codeyam-memory/deprecated-scan.json
247
- jq '.explicit_markers | length' /tmp/codeyam-memory/deprecated-scan.json
248
- jq '.stats.total_exports' /tmp/codeyam-memory/exports-scan.json
249
- jq '.stats.total_files' /tmp/codeyam-memory/exports-scan.json
246
+ node .claude/skills/codeyam-memory/scripts/lib/read-json-field.mjs /tmp/codeyam-memory/deprecated-scan.json '.dependencies | length'
247
+ node .claude/skills/codeyam-memory/scripts/lib/read-json-field.mjs /tmp/codeyam-memory/deprecated-scan.json '.explicit_markers | length'
248
+ node .claude/skills/codeyam-memory/scripts/lib/read-json-field.mjs /tmp/codeyam-memory/exports-scan.json '.stats.total_exports'
249
+ node .claude/skills/codeyam-memory/scripts/lib/read-json-field.mjs /tmp/codeyam-memory/exports-scan.json '.stats.total_files'
250
250
  ```
251
251
 
252
- The session count is the number of lines from `preprocess.sh` stdout.
252
+ The session count is the number of lines from `preprocess.mjs` stdout.
253
253
 
254
254
  **Time estimate formulas:**
255
255