@codeyam/codeyam-cli 0.1.0-staging.a890816 → 0.1.0-staging.ad88eeb

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 (317) 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 +9 -9
  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 +2 -2
  10. package/analyzer-template/packages/database/package.json +3 -3
  11. package/analyzer-template/packages/database/src/lib/kysely/tables/editorScenariosTable.ts +20 -0
  12. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts +4 -0
  13. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts.map +1 -1
  14. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js +20 -0
  15. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -1
  16. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.d.ts +2 -0
  17. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.d.ts.map +1 -1
  18. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.js +2 -0
  19. package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.js.map +1 -1
  20. package/analyzer-template/packages/github/package.json +1 -1
  21. package/analyzer-template/packages/types/src/enums/ProjectFramework.ts +2 -0
  22. package/analyzer-template/packages/ui-components/package.json +1 -1
  23. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.d.ts +2 -0
  24. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.d.ts.map +1 -1
  25. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.js +2 -0
  26. package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.js.map +1 -1
  27. package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js +196 -0
  28. package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js.map +1 -0
  29. package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js +114 -0
  30. package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js.map +1 -0
  31. package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js +149 -0
  32. package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js.map +1 -0
  33. package/codeyam-cli/src/commands/default.js +3 -46
  34. package/codeyam-cli/src/commands/default.js.map +1 -1
  35. package/codeyam-cli/src/commands/editor.js +1893 -215
  36. package/codeyam-cli/src/commands/editor.js.map +1 -1
  37. package/codeyam-cli/src/commands/init.js +6 -1
  38. package/codeyam-cli/src/commands/init.js.map +1 -1
  39. package/codeyam-cli/src/data/techStacks.js +82 -0
  40. package/codeyam-cli/src/data/techStacks.js.map +1 -0
  41. package/codeyam-cli/src/utils/__tests__/devServerState.test.js +134 -0
  42. package/codeyam-cli/src/utils/__tests__/devServerState.test.js.map +1 -0
  43. package/codeyam-cli/src/utils/__tests__/editorApi.test.js +127 -0
  44. package/codeyam-cli/src/utils/__tests__/editorApi.test.js.map +1 -0
  45. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +635 -0
  46. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -0
  47. package/codeyam-cli/src/utils/__tests__/editorCapture.test.js +93 -0
  48. package/codeyam-cli/src/utils/__tests__/editorCapture.test.js.map +1 -0
  49. package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js +279 -0
  50. package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js.map +1 -0
  51. package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js +121 -0
  52. package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js.map +1 -0
  53. package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js +294 -0
  54. package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js.map +1 -0
  55. package/codeyam-cli/src/utils/__tests__/editorJournal.test.js +542 -0
  56. package/codeyam-cli/src/utils/__tests__/editorJournal.test.js.map +1 -0
  57. package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js +393 -0
  58. package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js.map +1 -0
  59. package/codeyam-cli/src/utils/__tests__/editorMockState.test.js +270 -0
  60. package/codeyam-cli/src/utils/__tests__/editorMockState.test.js.map +1 -0
  61. package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js +217 -0
  62. package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js.map +1 -0
  63. package/codeyam-cli/src/utils/__tests__/editorPreview.test.js +266 -0
  64. package/codeyam-cli/src/utils/__tests__/editorPreview.test.js.map +1 -0
  65. package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js +107 -0
  66. package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js.map +1 -0
  67. package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js +139 -0
  68. package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js.map +1 -0
  69. package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js +221 -0
  70. package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js.map +1 -0
  71. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js +221 -0
  72. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js.map +1 -0
  73. package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js +213 -0
  74. package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js.map +1 -0
  75. package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js +1737 -0
  76. package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js.map +1 -0
  77. package/codeyam-cli/src/utils/__tests__/git.editor.test.js +134 -0
  78. package/codeyam-cli/src/utils/__tests__/git.editor.test.js.map +1 -0
  79. package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js +107 -0
  80. package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js.map +1 -0
  81. package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js +101 -0
  82. package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js.map +1 -0
  83. package/codeyam-cli/src/utils/__tests__/project.test.js +65 -0
  84. package/codeyam-cli/src/utils/__tests__/project.test.js.map +1 -0
  85. package/codeyam-cli/src/utils/__tests__/scenarioMarkers.test.js +121 -0
  86. package/codeyam-cli/src/utils/__tests__/scenarioMarkers.test.js.map +1 -0
  87. package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js +246 -0
  88. package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js.map +1 -0
  89. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +25 -5
  90. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
  91. package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js +51 -0
  92. package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js.map +1 -0
  93. package/codeyam-cli/src/utils/__tests__/webappDetection.test.js +142 -0
  94. package/codeyam-cli/src/utils/__tests__/webappDetection.test.js.map +1 -0
  95. package/codeyam-cli/src/utils/backgroundServer.js +2 -2
  96. package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
  97. package/codeyam-cli/src/utils/buildFlags.js +4 -0
  98. package/codeyam-cli/src/utils/buildFlags.js.map +1 -0
  99. package/codeyam-cli/src/utils/devServerState.js +71 -0
  100. package/codeyam-cli/src/utils/devServerState.js.map +1 -0
  101. package/codeyam-cli/src/utils/editorApi.js +73 -0
  102. package/codeyam-cli/src/utils/editorApi.js.map +1 -0
  103. package/codeyam-cli/src/utils/editorAudit.js +159 -0
  104. package/codeyam-cli/src/utils/editorAudit.js.map +1 -0
  105. package/codeyam-cli/src/utils/editorCapture.js +102 -0
  106. package/codeyam-cli/src/utils/editorCapture.js.map +1 -0
  107. package/codeyam-cli/src/utils/editorDevServer.js +193 -0
  108. package/codeyam-cli/src/utils/editorDevServer.js.map +1 -0
  109. package/codeyam-cli/src/utils/editorEntityChangeStatus.js +44 -0
  110. package/codeyam-cli/src/utils/editorEntityChangeStatus.js.map +1 -0
  111. package/codeyam-cli/src/utils/editorImageVerifier.js +155 -0
  112. package/codeyam-cli/src/utils/editorImageVerifier.js.map +1 -0
  113. package/codeyam-cli/src/utils/editorJournal.js +225 -0
  114. package/codeyam-cli/src/utils/editorJournal.js.map +1 -0
  115. package/codeyam-cli/src/utils/editorLoaderHelpers.js +81 -0
  116. package/codeyam-cli/src/utils/editorLoaderHelpers.js.map +1 -0
  117. package/codeyam-cli/src/utils/editorMockState.js +248 -0
  118. package/codeyam-cli/src/utils/editorMockState.js.map +1 -0
  119. package/codeyam-cli/src/utils/editorPreloadHelpers.js +135 -0
  120. package/codeyam-cli/src/utils/editorPreloadHelpers.js.map +1 -0
  121. package/codeyam-cli/src/utils/editorPreview.js +106 -0
  122. package/codeyam-cli/src/utils/editorPreview.js.map +1 -0
  123. package/codeyam-cli/src/utils/editorScenarioSwitch.js +112 -0
  124. package/codeyam-cli/src/utils/editorScenarioSwitch.js.map +1 -0
  125. package/codeyam-cli/src/utils/editorScenarios.js +96 -0
  126. package/codeyam-cli/src/utils/editorScenarios.js.map +1 -0
  127. package/codeyam-cli/src/utils/editorSeedAdapter.js +173 -0
  128. package/codeyam-cli/src/utils/editorSeedAdapter.js.map +1 -0
  129. package/codeyam-cli/src/utils/entityChangeStatus.js +347 -0
  130. package/codeyam-cli/src/utils/entityChangeStatus.js.map +1 -0
  131. package/codeyam-cli/src/utils/entityChangeStatus.server.js +158 -0
  132. package/codeyam-cli/src/utils/entityChangeStatus.server.js.map +1 -0
  133. package/codeyam-cli/src/utils/git.js +51 -0
  134. package/codeyam-cli/src/utils/git.js.map +1 -1
  135. package/codeyam-cli/src/utils/install-skills.js +28 -17
  136. package/codeyam-cli/src/utils/install-skills.js.map +1 -1
  137. package/codeyam-cli/src/utils/parseRegisterArg.js +31 -0
  138. package/codeyam-cli/src/utils/parseRegisterArg.js.map +1 -0
  139. package/codeyam-cli/src/utils/project.js +15 -5
  140. package/codeyam-cli/src/utils/project.js.map +1 -1
  141. package/codeyam-cli/src/utils/scenarioMarkers.js +134 -0
  142. package/codeyam-cli/src/utils/scenarioMarkers.js.map +1 -0
  143. package/codeyam-cli/src/utils/scenariosManifest.js +112 -0
  144. package/codeyam-cli/src/utils/scenariosManifest.js.map +1 -0
  145. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +46 -16
  146. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
  147. package/codeyam-cli/src/utils/testRunner.js +1 -1
  148. package/codeyam-cli/src/utils/testRunner.js.map +1 -1
  149. package/codeyam-cli/src/utils/webappDetection.js +21 -0
  150. package/codeyam-cli/src/utils/webappDetection.js.map +1 -1
  151. package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js +178 -0
  152. package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js.map +1 -0
  153. package/codeyam-cli/src/webserver/app/lib/git.js +396 -0
  154. package/codeyam-cli/src/webserver/app/lib/git.js.map +1 -0
  155. package/codeyam-cli/src/webserver/build/client/assets/{CopyButton-DmJveP3T.js → CopyButton-BPXZwM4t.js} +1 -1
  156. package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-C76mRRiF.js → EntityItem-BcgbViKV.js} +3 -3
  157. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-CobE682z.js → EntityTypeIcon-CQIG2qda.js} +9 -9
  158. package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-djPLI-WV.js → ReportIssueModal-BzHcG7SE.js} +3 -3
  159. package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-B76aig_2.js → ScenarioViewer-0DY_NKil.js} +3 -3
  160. package/codeyam-cli/src/webserver/build/client/assets/ViewportInspectBar-oAf2Kqsf.js +1 -0
  161. package/codeyam-cli/src/webserver/build/client/assets/{_index-C96V0n15.js → _index-DLxKhri3.js} +3 -3
  162. package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-BpKzcsJz.js → activity.(_tab)-BcY3q6nt.js} +6 -6
  163. package/codeyam-cli/src/webserver/build/client/assets/addon-canvas-DpzMmAy5.js +1 -0
  164. package/codeyam-cli/src/webserver/build/client/assets/addon-fit-YJmn1quW.js +12 -0
  165. package/codeyam-cli/src/webserver/build/client/assets/addon-webgl-DI8QOUvO.js +58 -0
  166. package/codeyam-cli/src/webserver/build/client/assets/{agent-transcripts-D9hemwl6.js → agent-transcripts-Bni3iiUj.js} +5 -5
  167. package/codeyam-cli/src/webserver/build/client/assets/api.editor-audit-l0sNRNKZ.js +1 -0
  168. package/codeyam-cli/src/webserver/build/client/assets/api.editor-file-diff-l0sNRNKZ.js +1 -0
  169. package/codeyam-cli/src/webserver/build/client/assets/api.editor-file-l0sNRNKZ.js +1 -0
  170. package/codeyam-cli/src/webserver/build/client/assets/api.editor-load-commit-l0sNRNKZ.js +1 -0
  171. package/codeyam-cli/src/webserver/build/client/assets/api.editor-project-info-l0sNRNKZ.js +1 -0
  172. package/codeyam-cli/src/webserver/build/client/assets/{book-open-D_nMCFmP.js → book-open-BYOypzCa.js} +2 -2
  173. package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-BH2h1Ea2.js → chevron-down-C_Pmso5S.js} +2 -2
  174. package/codeyam-cli/src/webserver/build/client/assets/{circle-check-DyIKORY6.js → circle-check-BVMi9VA5.js} +2 -2
  175. package/codeyam-cli/src/webserver/build/client/assets/{copy-NDbZjXao.js → copy-n2FB0_Sw.js} +3 -3
  176. package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-CC6AbExI.js +41 -0
  177. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-Csi0_PMl.js +1 -0
  178. package/codeyam-cli/src/webserver/build/client/assets/editor-BuT_Huj0.js +10 -0
  179. package/codeyam-cli/src/webserver/build/client/assets/editorPreview-B7ztwLut.js +41 -0
  180. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-CrjR3zZW.js → entity._sha._-BF4oLwaE.js} +3 -3
  181. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-D5rYBT5x.js +6 -0
  182. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-CF164ouH.js +6 -0
  183. package/codeyam-cli/src/webserver/build/client/assets/{files-DO4CZ16O.js → files-BZrlFE1F.js} +1 -1
  184. package/codeyam-cli/src/webserver/build/client/assets/git-DdZcvjGh.js +1 -0
  185. package/codeyam-cli/src/webserver/build/client/assets/globals-BkWJ_UNc.css +1 -0
  186. package/codeyam-cli/src/webserver/build/client/assets/index-yHOVb4rc.js +15 -0
  187. package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-BAXYRVEO.js → loader-circle-DaAZ_H2w.js} +2 -2
  188. package/codeyam-cli/src/webserver/build/client/assets/manifest-b0f1372e.js +1 -0
  189. package/codeyam-cli/src/webserver/build/client/assets/{memory-FweZHj5U.js → memory-Bl2rpw8u.js} +13 -10
  190. package/codeyam-cli/src/webserver/build/client/assets/{pause-DTAcYxBt.js → pause-f5-1lKBt.js} +3 -3
  191. package/codeyam-cli/src/webserver/build/client/assets/{root-DiRdBreB.js → root-B_X8HS1x.js} +18 -18
  192. package/codeyam-cli/src/webserver/build/client/assets/{search-fKo7v0Zo.js → search-Di64LWVb.js} +2 -2
  193. package/codeyam-cli/src/webserver/build/client/assets/{settings-DfuTtcJP.js → settings-0OrEMU6J.js} +1 -1
  194. package/codeyam-cli/src/webserver/build/client/assets/{simulations-B3aOzpCZ.js → simulations-DWT-CvLy.js} +1 -1
  195. package/codeyam-cli/src/webserver/build/client/assets/{terminal-BG4heKCG.js → terminal-Br7MOqts.js} +3 -3
  196. package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-DtSmdtM4.js → triangle-alert-BLdiCuG-.js} +2 -2
  197. package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-CrAK28Bc.js +1 -0
  198. package/codeyam-cli/src/webserver/build/client/assets/xterm-BqvuqXEL.js +27 -0
  199. package/codeyam-cli/src/webserver/build/server/assets/{index-BzAbACSx.js → index-CbF6h3dj.js} +1 -1
  200. package/codeyam-cli/src/webserver/build/server/assets/server-build-DRFwTJqO.js +367 -0
  201. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  202. package/codeyam-cli/src/webserver/build-info.json +5 -5
  203. package/codeyam-cli/src/webserver/editorProxy.js +383 -50
  204. package/codeyam-cli/src/webserver/editorProxy.js.map +1 -1
  205. package/codeyam-cli/src/webserver/scripts/codeyam-preload.mjs +414 -0
  206. package/codeyam-cli/src/webserver/scripts/journalCapture.ts +94 -4
  207. package/codeyam-cli/src/webserver/server.js +93 -12
  208. package/codeyam-cli/src/webserver/server.js.map +1 -1
  209. package/codeyam-cli/src/webserver/terminalServer.js +65 -112
  210. package/codeyam-cli/src/webserver/terminalServer.js.map +1 -1
  211. package/codeyam-cli/templates/chrome-extension-react/EXTENSION_SETUP.md +75 -0
  212. package/codeyam-cli/templates/chrome-extension-react/gitignore +15 -0
  213. package/codeyam-cli/templates/chrome-extension-react/index.html +12 -0
  214. package/codeyam-cli/templates/chrome-extension-react/package.json +26 -0
  215. package/codeyam-cli/templates/chrome-extension-react/popup.html +12 -0
  216. package/codeyam-cli/templates/chrome-extension-react/public/manifest.json +15 -0
  217. package/codeyam-cli/templates/chrome-extension-react/src/background/service-worker.ts +7 -0
  218. package/codeyam-cli/templates/chrome-extension-react/src/globals.css +6 -0
  219. package/codeyam-cli/templates/chrome-extension-react/src/lib/storage.ts +37 -0
  220. package/codeyam-cli/templates/chrome-extension-react/src/popup/App.tsx +12 -0
  221. package/codeyam-cli/templates/chrome-extension-react/src/popup/main.tsx +10 -0
  222. package/codeyam-cli/templates/chrome-extension-react/tsconfig.json +24 -0
  223. package/codeyam-cli/templates/chrome-extension-react/vite.config.ts +35 -0
  224. package/codeyam-cli/templates/editor-step-hook.py +95 -9
  225. package/codeyam-cli/templates/expo-react-native/MOBILE_SETUP.md +89 -0
  226. package/codeyam-cli/templates/expo-react-native/app/(tabs)/_layout.tsx +33 -0
  227. package/codeyam-cli/templates/expo-react-native/app/(tabs)/index.tsx +12 -0
  228. package/codeyam-cli/templates/expo-react-native/app/(tabs)/settings.tsx +12 -0
  229. package/codeyam-cli/templates/expo-react-native/app/_layout.tsx +12 -0
  230. package/codeyam-cli/templates/expo-react-native/app.json +18 -0
  231. package/codeyam-cli/templates/expo-react-native/babel.config.js +9 -0
  232. package/codeyam-cli/templates/expo-react-native/gitignore +12 -0
  233. package/codeyam-cli/templates/expo-react-native/global.css +3 -0
  234. package/codeyam-cli/templates/expo-react-native/lib/storage.ts +32 -0
  235. package/codeyam-cli/templates/expo-react-native/metro.config.js +6 -0
  236. package/codeyam-cli/templates/expo-react-native/nativewind-env.d.ts +1 -0
  237. package/codeyam-cli/templates/expo-react-native/package.json +37 -0
  238. package/codeyam-cli/templates/expo-react-native/tailwind.config.js +10 -0
  239. package/codeyam-cli/templates/expo-react-native/tsconfig.json +10 -0
  240. package/codeyam-cli/templates/nextjs-prisma-sqlite/AUTH_PATTERNS.md +308 -0
  241. package/codeyam-cli/templates/nextjs-prisma-sqlite/AUTH_UPGRADE.md +304 -0
  242. package/codeyam-cli/templates/nextjs-prisma-sqlite/DATABASE.md +112 -0
  243. package/codeyam-cli/templates/nextjs-prisma-sqlite/FEATURE_PATTERNS.md +37 -0
  244. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/codeyam-isolate/layout.tsx +12 -0
  245. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/lib/prisma.ts +9 -4
  246. package/codeyam-cli/templates/nextjs-prisma-sqlite/env +4 -0
  247. package/codeyam-cli/templates/nextjs-prisma-sqlite/gitignore +21 -0
  248. package/codeyam-cli/templates/nextjs-prisma-sqlite/package.json +4 -1
  249. package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma/seed.ts +4 -1
  250. package/codeyam-cli/templates/nextjs-prisma-sqlite/seed-adapter.ts +92 -0
  251. package/codeyam-cli/templates/nextjs-prisma-sqlite/vitest.config.ts +13 -0
  252. package/codeyam-cli/templates/{nextjs-prisma-sqlite/PRISMA_SETUP.md → nextjs-prisma-supabase/SUPABASE_SETUP.md} +37 -17
  253. package/codeyam-cli/templates/nextjs-prisma-supabase/app/api/todos/route.ts +17 -0
  254. package/codeyam-cli/templates/nextjs-prisma-supabase/app/globals.css +26 -0
  255. package/codeyam-cli/templates/nextjs-prisma-supabase/app/layout.tsx +34 -0
  256. package/codeyam-cli/templates/nextjs-prisma-supabase/app/lib/prisma.ts +20 -0
  257. package/codeyam-cli/templates/nextjs-prisma-supabase/app/lib/supabase.ts +12 -0
  258. package/codeyam-cli/templates/nextjs-prisma-supabase/app/page.tsx +10 -0
  259. package/codeyam-cli/templates/nextjs-prisma-supabase/env +9 -0
  260. package/codeyam-cli/templates/nextjs-prisma-supabase/eslint.config.mjs +11 -0
  261. package/codeyam-cli/templates/nextjs-prisma-supabase/gitignore +40 -0
  262. package/codeyam-cli/templates/nextjs-prisma-supabase/next.config.ts +11 -0
  263. package/codeyam-cli/templates/nextjs-prisma-supabase/package.json +36 -0
  264. package/codeyam-cli/templates/nextjs-prisma-supabase/postcss.config.mjs +7 -0
  265. package/codeyam-cli/templates/nextjs-prisma-supabase/prisma/schema.prisma +27 -0
  266. package/codeyam-cli/templates/nextjs-prisma-supabase/prisma/seed.ts +39 -0
  267. package/codeyam-cli/templates/nextjs-prisma-supabase/prisma.config.ts +12 -0
  268. package/codeyam-cli/templates/nextjs-prisma-supabase/tsconfig.json +34 -0
  269. package/codeyam-cli/templates/{codeyam-dev-mode.md → skills/codeyam-dev-mode/SKILL.md} +2 -2
  270. package/codeyam-cli/templates/skills/codeyam-editor/SKILL.md +145 -0
  271. package/codeyam-cli/templates/{codeyam-memory.md → skills/codeyam-memory/SKILL.md} +215 -0
  272. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/deprecated-prompt.md +100 -0
  273. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/detect-deprecated-patterns.mjs +139 -0
  274. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/find-exports.mjs +52 -0
  275. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/misleading-api-prompt.md +117 -0
  276. package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/read-json-field.mjs +61 -0
  277. package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/ripgrep-fallback.mjs +155 -0
  278. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/analyze-prompt.md +46 -0
  279. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/cleanup.mjs +13 -0
  280. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/filter-session.mjs +95 -0
  281. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/preprocess.mjs +160 -0
  282. package/package.json +15 -10
  283. package/packages/ai/src/lib/generateExecutionFlows.js +0 -11
  284. package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -1
  285. package/packages/analyze/src/lib/ProjectAnalyzer.js +10 -4
  286. package/packages/analyze/src/lib/ProjectAnalyzer.js.map +1 -1
  287. package/packages/analyze/src/lib/asts/index.js +4 -2
  288. package/packages/analyze/src/lib/asts/index.js.map +1 -1
  289. package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js +0 -40
  290. package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js.map +1 -1
  291. package/packages/database/src/lib/kysely/tables/editorScenariosTable.js +20 -0
  292. package/packages/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -1
  293. package/packages/types/src/enums/ProjectFramework.js +2 -0
  294. package/packages/types/src/enums/ProjectFramework.js.map +1 -1
  295. package/scripts/npm-post-install.cjs +34 -0
  296. package/codeyam-cli/src/webserver/build/client/assets/Terminal-CcG8YTLx.js +0 -41
  297. package/codeyam-cli/src/webserver/build/client/assets/addon-fit-CUXOrorO.js +0 -1
  298. package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-CMT1jU2q.js +0 -21
  299. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-BiM6z3Do.js +0 -1
  300. package/codeyam-cli/src/webserver/build/client/assets/editor-W_IGJ2Kd.js +0 -7
  301. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-D6SEzMCu.js +0 -6
  302. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-C28BiQzt.js +0 -6
  303. package/codeyam-cli/src/webserver/build/client/assets/git-CFCTYk9I.js +0 -15
  304. package/codeyam-cli/src/webserver/build/client/assets/globals-BZB_H1w2.css +0 -1
  305. package/codeyam-cli/src/webserver/build/client/assets/manifest-8daa4147.js +0 -1
  306. package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-ByhSyh0W.js +0 -1
  307. package/codeyam-cli/src/webserver/build/client/assets/xterm-DMSzMhqy.js +0 -9
  308. package/codeyam-cli/src/webserver/build/server/assets/server-build-OdUocH6P.js +0 -362
  309. package/codeyam-cli/templates/codeyam-editor.md +0 -68
  310. package/scripts/finalize-analyzer.cjs +0 -13
  311. /package/codeyam-cli/templates/{codeyam-diagnose.md → commands/codeyam-diagnose.md} +0 -0
  312. /package/codeyam-cli/templates/{codeyam-debug.md → skills/codeyam-debug/SKILL.md} +0 -0
  313. /package/codeyam-cli/templates/{codeyam-new-rule.md → skills/codeyam-new-rule/SKILL.md} +0 -0
  314. /package/codeyam-cli/templates/{codeyam-setup.md → skills/codeyam-setup/SKILL.md} +0 -0
  315. /package/codeyam-cli/templates/{codeyam-sim.md → skills/codeyam-sim/SKILL.md} +0 -0
  316. /package/codeyam-cli/templates/{codeyam-test.md → skills/codeyam-test/SKILL.md} +0 -0
  317. /package/codeyam-cli/templates/{codeyam-verify.md → skills/codeyam-verify/SKILL.md} +0 -0
@@ -0,0 +1,221 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import os from 'os';
4
+ import { switchActiveScenario } from "../editorScenarioSwitch.js";
5
+ // Mock the seed adapter
6
+ jest.mock('../editorSeedAdapter', () => ({
7
+ runSeedAdapter: jest.fn(),
8
+ detectSeedAdapter: jest.fn(),
9
+ }));
10
+ import { runSeedAdapter, detectSeedAdapter } from "../editorSeedAdapter.js";
11
+ const mockRunSeedAdapter = runSeedAdapter;
12
+ const mockDetectSeedAdapter = detectSeedAdapter;
13
+ describe('switchActiveScenario', () => {
14
+ let tempDir;
15
+ beforeEach(() => {
16
+ jest.clearAllMocks();
17
+ tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'scenario-switch-test-'));
18
+ fs.mkdirSync(path.join(tempDir, '.codeyam', 'editor-scenarios'), {
19
+ recursive: true,
20
+ });
21
+ });
22
+ afterEach(() => {
23
+ fs.rmSync(tempDir, { recursive: true, force: true });
24
+ });
25
+ /**
26
+ * Helper: create a scenario data file and seed file on disk.
27
+ */
28
+ function createScenarioFiles(id, opts) {
29
+ const scenariosDir = path.join(tempDir, '.codeyam', 'editor-scenarios');
30
+ fs.writeFileSync(path.join(scenariosDir, `${id}.json`), JSON.stringify({ type: opts.type, name: opts.name, seed: opts.seed }));
31
+ fs.writeFileSync(path.join(scenariosDir, `${id}.seed.json`), JSON.stringify(opts.seed || {}));
32
+ }
33
+ /**
34
+ * Helper: read the active-scenario.json from the temp dir.
35
+ */
36
+ function readActiveScenario() {
37
+ return JSON.parse(fs.readFileSync(path.join(tempDir, '.codeyam', 'active-scenario.json'), 'utf-8'));
38
+ }
39
+ // ─────────────────────────────────────────────────────────────────────────
40
+ // BUG REPRODUCTION: These tests demonstrate the bug where
41
+ // `codeyam editor preview '{"scenarioId":"208dcaa6-..."}'` displayed
42
+ // scenario `6e8d979f-...` instead. The root cause: the /api/dev-mode-preview
43
+ // endpoint duplicated scenario switching logic from /api/editor-switch-scenario
44
+ // but omitted the seed adapter, type field, and cache invalidation.
45
+ //
46
+ // When switching between two application scenarios, the database must be
47
+ // re-seeded for the new scenario. Without re-seeding, the preview shows
48
+ // data from the PREVIOUS scenario — a different scenario than requested.
49
+ // ─────────────────────────────────────────────────────────────────────────
50
+ describe('application scenario switching must re-seed', () => {
51
+ it('should run seed adapter when switching to an application scenario', async () => {
52
+ const scenarioId = 'full-catalog-208dcaa6';
53
+ createScenarioFiles(scenarioId, {
54
+ type: 'application',
55
+ name: 'Full Catalog',
56
+ seed: {
57
+ drinks: [
58
+ { name: 'Jasmine Tea', description: 'Floral' },
59
+ { name: 'Earl Grey', description: 'Citrus' },
60
+ ],
61
+ },
62
+ });
63
+ mockDetectSeedAdapter.mockReturnValue(path.join(tempDir, '.codeyam', 'seed-adapter.ts'));
64
+ mockRunSeedAdapter.mockResolvedValue({
65
+ success: true,
66
+ output: 'Seeded 2 drinks',
67
+ durationMs: 200,
68
+ });
69
+ await switchActiveScenario({
70
+ scenarioId,
71
+ projectRoot: tempDir,
72
+ });
73
+ // The seed adapter MUST be called for application scenarios
74
+ expect(mockRunSeedAdapter).toHaveBeenCalledTimes(1);
75
+ expect(mockRunSeedAdapter).toHaveBeenCalledWith(path.join(tempDir, '.codeyam', 'seed-adapter.ts'), path.join(tempDir, '.codeyam', 'editor-scenarios', `${scenarioId}.seed.json`));
76
+ });
77
+ it('should include type in active-scenario.json for application scenarios', async () => {
78
+ const scenarioId = 'full-catalog-208dcaa6';
79
+ createScenarioFiles(scenarioId, {
80
+ type: 'application',
81
+ name: 'Full Catalog',
82
+ seed: { drinks: [] },
83
+ });
84
+ mockDetectSeedAdapter.mockReturnValue(path.join(tempDir, '.codeyam', 'seed-adapter.ts'));
85
+ mockRunSeedAdapter.mockResolvedValue({
86
+ success: true,
87
+ output: 'ok',
88
+ durationMs: 100,
89
+ });
90
+ await switchActiveScenario({
91
+ scenarioId,
92
+ projectRoot: tempDir,
93
+ });
94
+ const active = readActiveScenario();
95
+ // type MUST be written so the proxy knows this is a seed-based scenario
96
+ // Without type, the proxy may serve stale mock data from a component scenario
97
+ expect(active.type).toBe('application');
98
+ });
99
+ it('should re-seed when switching from one application scenario to another', async () => {
100
+ // This is the exact bug scenario:
101
+ // 1. Scenario A ("Single Drink") was registered last → DB has its seed data
102
+ // 2. User requests scenario B ("Full Catalog") via preview command
103
+ // 3. Without re-seeding, the DB still has scenario A's data
104
+ // 4. Preview shows scenario A's data → WRONG scenario displayed
105
+ const scenarioA = '6e8d979f-single-drink';
106
+ const scenarioB = '208dcaa6-full-catalog';
107
+ createScenarioFiles(scenarioA, {
108
+ type: 'application',
109
+ name: 'Single Drink',
110
+ seed: { drinks: [{ name: 'Peppermint Tea' }] },
111
+ });
112
+ createScenarioFiles(scenarioB, {
113
+ type: 'application',
114
+ name: 'Full Catalog',
115
+ seed: {
116
+ drinks: [
117
+ { name: 'Jasmine Tea' },
118
+ { name: 'Earl Grey' },
119
+ { name: 'Kombucha' },
120
+ ],
121
+ },
122
+ });
123
+ mockDetectSeedAdapter.mockReturnValue(path.join(tempDir, '.codeyam', 'seed-adapter.ts'));
124
+ mockRunSeedAdapter.mockResolvedValue({
125
+ success: true,
126
+ output: 'ok',
127
+ durationMs: 100,
128
+ });
129
+ // First: switch to scenario A (as if it was just registered)
130
+ await switchActiveScenario({
131
+ scenarioId: scenarioA,
132
+ projectRoot: tempDir,
133
+ });
134
+ expect(mockRunSeedAdapter).toHaveBeenCalledTimes(1);
135
+ const firstSeedCall = mockRunSeedAdapter.mock.calls[0][1];
136
+ expect(firstSeedCall).toContain(`${scenarioA}.seed.json`);
137
+ // Now: switch to scenario B via the preview command
138
+ // This is where the bug occurred — seed adapter was NOT called
139
+ await switchActiveScenario({
140
+ scenarioId: scenarioB,
141
+ projectRoot: tempDir,
142
+ });
143
+ // Seed adapter MUST be called again for the new scenario
144
+ expect(mockRunSeedAdapter).toHaveBeenCalledTimes(2);
145
+ const secondSeedCall = mockRunSeedAdapter.mock.calls[1][1];
146
+ expect(secondSeedCall).toContain(`${scenarioB}.seed.json`);
147
+ // active-scenario.json must point to scenario B with correct type
148
+ const active = readActiveScenario();
149
+ expect(active.scenarioId).toBe(scenarioB);
150
+ expect(active.type).toBe('application');
151
+ expect(active.scenarioName).toBe('Full Catalog');
152
+ });
153
+ });
154
+ describe('type detection from data file', () => {
155
+ it('should detect type from scenario data file when not explicitly provided', async () => {
156
+ const scenarioId = 'auto-detect-type';
157
+ createScenarioFiles(scenarioId, {
158
+ type: 'application',
159
+ name: 'Auto Detect',
160
+ seed: { items: [] },
161
+ });
162
+ mockDetectSeedAdapter.mockReturnValue(path.join(tempDir, '.codeyam', 'seed-adapter.ts'));
163
+ mockRunSeedAdapter.mockResolvedValue({
164
+ success: true,
165
+ output: 'ok',
166
+ durationMs: 50,
167
+ });
168
+ const result = await switchActiveScenario({
169
+ scenarioId,
170
+ // No scenarioType provided — must be detected from file
171
+ projectRoot: tempDir,
172
+ });
173
+ expect(result.type).toBe('application');
174
+ expect(result.seeded).toBe(true);
175
+ expect(mockRunSeedAdapter).toHaveBeenCalled();
176
+ });
177
+ });
178
+ describe('component scenarios', () => {
179
+ it('should not run seed adapter for component scenarios', async () => {
180
+ const scenarioId = 'star-rating-five';
181
+ createScenarioFiles(scenarioId, {
182
+ type: 'component',
183
+ name: 'StarRating - Five Stars',
184
+ });
185
+ const result = await switchActiveScenario({
186
+ scenarioId,
187
+ scenarioType: 'component',
188
+ projectRoot: tempDir,
189
+ });
190
+ expect(mockRunSeedAdapter).not.toHaveBeenCalled();
191
+ expect(mockDetectSeedAdapter).not.toHaveBeenCalled();
192
+ expect(result.seeded).toBe(false);
193
+ });
194
+ });
195
+ describe('slug resolution', () => {
196
+ it('should resolve slug from data file when not provided', async () => {
197
+ const scenarioId = 'abc-123';
198
+ createScenarioFiles(scenarioId, {
199
+ type: 'component',
200
+ name: 'My Scenario',
201
+ });
202
+ await switchActiveScenario({
203
+ scenarioId,
204
+ projectRoot: tempDir,
205
+ });
206
+ const active = readActiveScenario();
207
+ expect(active.scenarioSlug).toBe('My Scenario');
208
+ });
209
+ it('should fall back to scenarioId as slug when data file is missing', async () => {
210
+ const scenarioId = 'missing-data-file';
211
+ // No data file created
212
+ await switchActiveScenario({
213
+ scenarioId,
214
+ projectRoot: tempDir,
215
+ });
216
+ const active = readActiveScenario();
217
+ expect(active.scenarioSlug).toBe(scenarioId);
218
+ });
219
+ });
220
+ });
221
+ //# sourceMappingURL=editorScenarioSwitch.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editorScenarioSwitch.test.js","sourceRoot":"","sources":["../../../../../src/utils/__tests__/editorScenarioSwitch.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAE/D,wBAAwB;AACxB,IAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE,GAAG,EAAE,CAAC,CAAC;IACvC,cAAc,EAAE,IAAI,CAAC,EAAE,EAAE;IACzB,iBAAiB,EAAE,IAAI,CAAC,EAAE,EAAE;CAC7B,CAAC,CAAC,CAAC;AAEJ,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzE,MAAM,kBAAkB,GAAG,cAE1B,CAAC;AACF,MAAM,qBAAqB,GAAG,iBAE7B,CAAC;AAEF,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,IAAI,OAAe,CAAC;IAEpB,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,OAAO,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,I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CAAC,UAAU,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,221 @@
1
+ import fs from 'fs';
2
+ import os from 'os';
3
+ import path from 'path';
4
+ import { deduplicateByName, generateScenarioSlug, convertIsoToSqliteTimestamp, determineCaptureUrl, resolvePreviewNavPath, clearEditorState, clearEditorUserPrompt, } from "../editorScenarios.js";
5
+ describe('editorScenarios', () => {
6
+ describe('deduplicateByName', () => {
7
+ it('should keep only the last item for each key', () => {
8
+ const items = [
9
+ { name: 'Default', id: '1', value: 'old' },
10
+ { name: 'Dark Mode', id: '2', value: 'old' },
11
+ { name: 'Default', id: '3', value: 'new' },
12
+ ];
13
+ const result = deduplicateByName(items, (item) => item.name);
14
+ expect(result).toHaveLength(2);
15
+ expect(result.find((r) => r.name === 'Default')?.id).toBe('3');
16
+ expect(result.find((r) => r.name === 'Dark Mode')?.id).toBe('2');
17
+ });
18
+ it('should return empty array for empty input', () => {
19
+ expect(deduplicateByName([], (x) => x.name)).toEqual([]);
20
+ });
21
+ it('should not lose screenshots when re-registered scenario has null screenshot (filter before dedup)', () => {
22
+ // Simulates the journal screenshot lookup flow:
23
+ // Scenarios ordered by created_at ASC from DB, some re-registered with null screenshot
24
+ const scenarios = [
25
+ {
26
+ name: 'Full Catalog',
27
+ screenshot_path: 'screenshots/aaa.png',
28
+ id: 'aaa',
29
+ },
30
+ {
31
+ name: 'API Error',
32
+ screenshot_path: 'screenshots/bbb.png',
33
+ id: 'bbb',
34
+ },
35
+ { name: 'API Error', screenshot_path: null, id: 'ccc' }, // re-registered, capture in progress
36
+ ];
37
+ // BUG: dedup-then-filter loses "API Error" entirely because dedup picks
38
+ // the latest row (null screenshot), then filter removes it.
39
+ const buggyDeduped = deduplicateByName(scenarios, (s) => s.name);
40
+ const buggyResult = buggyDeduped.filter((s) => s.screenshot_path);
41
+ // This would only contain "Full Catalog" — "API Error" is gone!
42
+ expect(buggyResult).toHaveLength(1); // demonstrates the bug
43
+ // FIX: filter-then-dedup preserves the latest row that HAS a screenshot.
44
+ const filtered = scenarios.filter((s) => s.screenshot_path);
45
+ const fixedResult = deduplicateByName(filtered, (s) => s.name);
46
+ expect(fixedResult).toHaveLength(2);
47
+ expect(fixedResult.find((s) => s.name === 'API Error')?.id).toBe('bbb');
48
+ expect(fixedResult.find((s) => s.name === 'Full Catalog')?.id).toBe('aaa');
49
+ });
50
+ it('should preserve order of first appearance', () => {
51
+ const items = [
52
+ { name: 'A', v: 1 },
53
+ { name: 'B', v: 2 },
54
+ { name: 'A', v: 3 },
55
+ ];
56
+ const result = deduplicateByName(items, (i) => i.name);
57
+ // Map preserves insertion order — A first, then B
58
+ expect(result.map((r) => r.name)).toEqual(['A', 'B']);
59
+ });
60
+ });
61
+ describe('generateScenarioSlug', () => {
62
+ it('should replace non-alphanumeric chars with underscores', () => {
63
+ expect(generateScenarioSlug('Dark Mode')).toBe('Dark_Mode');
64
+ });
65
+ it('should collapse consecutive special characters', () => {
66
+ expect(generateScenarioSlug('Hello -- World!!')).toBe('Hello_World_');
67
+ });
68
+ it('should preserve underscores and alphanumeric characters', () => {
69
+ expect(generateScenarioSlug('Already_Valid123')).toBe('Already_Valid123');
70
+ });
71
+ it('should handle empty string', () => {
72
+ expect(generateScenarioSlug('')).toBe('');
73
+ });
74
+ });
75
+ describe('convertIsoToSqliteTimestamp', () => {
76
+ it('should convert ISO 8601 to SQLite format', () => {
77
+ expect(convertIsoToSqliteTimestamp('2026-02-28T19:00:00.000Z')).toBe('2026-02-28 19:00:00');
78
+ });
79
+ it('should handle timestamps without milliseconds', () => {
80
+ expect(convertIsoToSqliteTimestamp('2026-02-28T19:00:00Z')).toBe('2026-02-28 19:00:00Z');
81
+ });
82
+ it('should replace T with space', () => {
83
+ expect(convertIsoToSqliteTimestamp('2026-01-15T08:30:45.123Z')).toBe('2026-01-15 08:30:45');
84
+ });
85
+ });
86
+ describe('determineCaptureUrl', () => {
87
+ it('should combine path with proxy URL when path-based and proxy available', () => {
88
+ expect(determineCaptureUrl('/isolated-components/DrinkCard?s=Default', 'http://localhost:3112', 'http://localhost:3000')).toBe('http://localhost:3112/isolated-components/DrinkCard?s=Default');
89
+ });
90
+ it('should work with path field normalized to url (path alias)', () => {
91
+ // When Claude writes "path": "/drinks/1" instead of "url": "/drinks/1",
92
+ // the register endpoint normalizes path → url before calling determineCaptureUrl.
93
+ // This test verifies that determineCaptureUrl handles the resulting value correctly.
94
+ const normalizedUrl = '/drinks/1'; // after normalization: body.url = body.path
95
+ expect(determineCaptureUrl(normalizedUrl, 'http://localhost:3112', 'http://localhost:3000')).toBe('http://localhost:3112/drinks/1');
96
+ });
97
+ it('should use full URL directly when not path-based', () => {
98
+ expect(determineCaptureUrl('http://external.com/page', 'http://localhost:3112', 'http://localhost:3000')).toBe('http://external.com/page');
99
+ });
100
+ it('should fall back to proxy root when no URL provided', () => {
101
+ expect(determineCaptureUrl(null, 'http://localhost:3112', 'http://localhost:3000')).toBe('http://localhost:3112');
102
+ });
103
+ it('should fall back to dev server when no URL and no proxy', () => {
104
+ expect(determineCaptureUrl(null, null, 'http://localhost:3000')).toBe('http://localhost:3000');
105
+ });
106
+ it('should return null when nothing available', () => {
107
+ expect(determineCaptureUrl(null, null, null)).toBeNull();
108
+ });
109
+ it('should fall back to dev server for path when proxy unavailable', () => {
110
+ // Path-based but proxy is null — can't route through proxy
111
+ expect(determineCaptureUrl('/some-path', null, 'http://localhost:3000')).toBe('http://localhost:3000');
112
+ });
113
+ });
114
+ describe('clearEditorState', () => {
115
+ let tmpDir;
116
+ let codeyamDir;
117
+ beforeEach(() => {
118
+ tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'editor-state-'));
119
+ codeyamDir = path.join(tmpDir, '.codeyam');
120
+ fs.mkdirSync(codeyamDir, { recursive: true });
121
+ });
122
+ afterEach(() => {
123
+ fs.rmSync(tmpDir, { recursive: true, force: true });
124
+ });
125
+ it('should delete the editor-step.json state file', () => {
126
+ fs.writeFileSync(path.join(codeyamDir, 'editor-step.json'), JSON.stringify({ step: 5, label: 'Extract' }));
127
+ clearEditorState(tmpDir);
128
+ expect(fs.existsSync(path.join(codeyamDir, 'editor-step.json'))).toBe(false);
129
+ });
130
+ it('should preserve editor-user-prompt.txt (captured by hook before step 1)', () => {
131
+ // The hook captures the user's feature request BEFORE step 1 calls clearEditorState.
132
+ // If clearEditorState deletes the prompt file, the next unrelated user message
133
+ // (e.g. "ok" approving a database reset) gets captured as the feature prompt.
134
+ fs.writeFileSync(path.join(codeyamDir, 'editor-step.json'), JSON.stringify({ step: 13, label: 'Present' }));
135
+ fs.writeFileSync(path.join(codeyamDir, 'editor-user-prompt.txt'), 'Could we add a page for each individual drink?');
136
+ clearEditorState(tmpDir);
137
+ expect(fs.readFileSync(path.join(codeyamDir, 'editor-user-prompt.txt'), 'utf8')).toBe('Could we add a page for each individual drink?');
138
+ });
139
+ it('should not throw if state file does not exist', () => {
140
+ expect(() => clearEditorState(tmpDir)).not.toThrow();
141
+ });
142
+ });
143
+ describe('clearEditorUserPrompt', () => {
144
+ let tmpDir;
145
+ let codeyamDir;
146
+ beforeEach(() => {
147
+ tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'editor-prompt-'));
148
+ codeyamDir = path.join(tmpDir, '.codeyam');
149
+ fs.mkdirSync(codeyamDir, { recursive: true });
150
+ });
151
+ afterEach(() => {
152
+ fs.rmSync(tmpDir, { recursive: true, force: true });
153
+ });
154
+ it('should delete the prompt file', () => {
155
+ fs.writeFileSync(path.join(codeyamDir, 'editor-user-prompt.txt'), 'old feature prompt');
156
+ clearEditorUserPrompt(tmpDir);
157
+ expect(fs.existsSync(path.join(codeyamDir, 'editor-user-prompt.txt'))).toBe(false);
158
+ });
159
+ it('should not throw if file does not exist', () => {
160
+ expect(() => clearEditorUserPrompt(tmpDir)).not.toThrow();
161
+ });
162
+ });
163
+ describe('resolvePreviewNavPath', () => {
164
+ it('should use explicit path when provided', () => {
165
+ expect(resolvePreviewNavPath('/explicit', '/scenario-url')).toBe('/explicit');
166
+ });
167
+ it('should fall back to scenario URL when no explicit path', () => {
168
+ expect(resolvePreviewNavPath(null, '/drinks/1')).toBe('/drinks/1');
169
+ });
170
+ it('should return undefined when neither path nor URL provided', () => {
171
+ expect(resolvePreviewNavPath(null, null)).toBeUndefined();
172
+ });
173
+ it('should return undefined for empty strings', () => {
174
+ expect(resolvePreviewNavPath('', '')).toBeUndefined();
175
+ });
176
+ it('should prefer explicit path over scenario URL', () => {
177
+ expect(resolvePreviewNavPath('/', '/drinks/1')).toBe('/');
178
+ });
179
+ });
180
+ describe('register endpoint path→url normalization (logic verification)', () => {
181
+ // These tests verify the normalization logic used in api.editor-register-scenario.ts:
182
+ // body.url = body.url || body.path || undefined;
183
+ // The route can't be unit-tested directly (ESM import.meta), so we verify
184
+ // the normalization + downstream logic here.
185
+ function normalizeUrl(body) {
186
+ // Mirror the exact line from api.editor-register-scenario.ts line 152
187
+ return body.url || body.path || undefined;
188
+ }
189
+ it('should use url when provided', () => {
190
+ expect(normalizeUrl({ url: '/drinks/1' })).toBe('/drinks/1');
191
+ });
192
+ it('should fall back to path when url not provided', () => {
193
+ expect(normalizeUrl({ path: '/drinks/1' })).toBe('/drinks/1');
194
+ });
195
+ it('should prefer url over path', () => {
196
+ expect(normalizeUrl({ url: '/explicit', path: '/fallback' })).toBe('/explicit');
197
+ });
198
+ it('should return undefined when neither provided', () => {
199
+ expect(normalizeUrl({})).toBeUndefined();
200
+ });
201
+ it('should work end-to-end: path → normalize → determineCaptureUrl', () => {
202
+ // Full pipeline: Claude writes "path": "/drinks/1"
203
+ // → register normalizes to url: "/drinks/1"
204
+ // → determineCaptureUrl combines with proxy
205
+ const body = { path: '/drinks/1' };
206
+ const normalizedUrl = normalizeUrl(body);
207
+ const captureUrl = determineCaptureUrl(normalizedUrl || null, 'http://localhost:4100', 'http://localhost:3000');
208
+ expect(captureUrl).toBe('http://localhost:4100/drinks/1');
209
+ });
210
+ it('should work end-to-end: no url → normalize → proxy root', () => {
211
+ // Claude omits both url and path
212
+ // → normalize returns undefined
213
+ // → determineCaptureUrl falls back to proxy root
214
+ const body = {};
215
+ const normalizedUrl = normalizeUrl(body);
216
+ const captureUrl = determineCaptureUrl(normalizedUrl || null, 'http://localhost:4100', 'http://localhost:3000');
217
+ expect(captureUrl).toBe('http://localhost:4100');
218
+ });
219
+ });
220
+ });
221
+ //# sourceMappingURL=editorScenarios.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editorScenarios.test.js","sourceRoot":"","sources":["../../../../../src/utils/__tests__/editorScenarios.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,2BAA2B,EAC3B,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAE5B,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;QACjC,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;YACrD,MAAM,KAAK,GAAG;gBACZ,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE;gBAC1C,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE;gBAC5C,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE;aAC3C,CAAC;YACF,MAAM,MAAM,GAAG,iBAAiB,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC7D,MAAM,CAAC,MAAM,CAAC,CAAC,YAAY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