@codeyam/codeyam-cli 0.1.0-staging.8778565 → 0.1.0-staging.87dd4be
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.
- package/analyzer-template/.build-info.json +8 -8
- package/analyzer-template/log.txt +3 -3
- package/analyzer-template/package.json +2 -2
- package/analyzer-template/packages/ai/package.json +1 -1
- package/analyzer-template/packages/aws/package.json +1 -1
- package/analyzer-template/packages/database/package.json +1 -1
- package/analyzer-template/packages/database/src/lib/kysely/tables/editorScenariosTable.ts +82 -0
- package/analyzer-template/packages/database/src/lib/loadEntities.ts +0 -6
- package/analyzer-template/packages/database/src/lib/updateCommitMetadata.ts +0 -65
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts +5 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js +84 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js +0 -6
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js +0 -25
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js.map +1 -1
- package/codeyam-cli/src/cli.js +9 -0
- package/codeyam-cli/src/cli.js.map +1 -1
- package/codeyam-cli/src/commands/__tests__/editor.isolateArgs.test.js +51 -0
- package/codeyam-cli/src/commands/__tests__/editor.isolateArgs.test.js.map +1 -0
- package/codeyam-cli/src/commands/__tests__/editor.stepDispatch.test.js +56 -0
- package/codeyam-cli/src/commands/__tests__/editor.stepDispatch.test.js.map +1 -0
- package/codeyam-cli/src/commands/__tests__/init.gitignore.test.js +101 -47
- package/codeyam-cli/src/commands/__tests__/init.gitignore.test.js.map +1 -1
- package/codeyam-cli/src/commands/editor.js +2369 -346
- package/codeyam-cli/src/commands/editor.js.map +1 -1
- package/codeyam-cli/src/commands/editorIsolateArgs.js +25 -0
- package/codeyam-cli/src/commands/editorIsolateArgs.js.map +1 -0
- package/codeyam-cli/src/commands/init.js +69 -34
- package/codeyam-cli/src/commands/init.js.map +1 -1
- package/codeyam-cli/src/commands/telemetry.js +37 -0
- package/codeyam-cli/src/commands/telemetry.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/analyzerFinalization.test.js +173 -0
- package/codeyam-cli/src/utils/__tests__/analyzerFinalization.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorApi.test.js +18 -8
- package/codeyam-cli/src/utils/__tests__/editorApi.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +2046 -1
- package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorBroadcastViewport.test.js +76 -0
- package/codeyam-cli/src/utils/__tests__/editorBroadcastViewport.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorCaptureScenarioSeeding.test.js +137 -0
- package/codeyam-cli/src/utils/__tests__/editorCaptureScenarioSeeding.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorDeleteScenario.test.js +100 -0
- package/codeyam-cli/src/utils/__tests__/editorDeleteScenario.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js +76 -3
- package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorEntityHelpers.test.js +381 -0
- package/codeyam-cli/src/utils/__tests__/editorEntityHelpers.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js +202 -1
- package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorMigration.test.js +435 -0
- package/codeyam-cli/src/utils/__tests__/editorMigration.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorPreview.test.js +88 -1
- package/codeyam-cli/src/utils/__tests__/editorPreview.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js +47 -1
- package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js +70 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js +1335 -1
- package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js +67 -0
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapterPrismaValidation.test.js +143 -0
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapterPrismaValidation.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorSessionFilter.test.js +66 -0
- package/codeyam-cli/src/utils/__tests__/editorSessionFilter.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorShouldRevalidate.test.js +53 -0
- package/codeyam-cli/src/utils/__tests__/editorShouldRevalidate.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js +363 -11
- package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/glossaryAdd.test.js +177 -0
- package/codeyam-cli/src/utils/__tests__/glossaryAdd.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js +30 -2
- package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/routePatternMatching.test.js +118 -0
- package/codeyam-cli/src/utils/__tests__/routePatternMatching.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/scenarioCoverage.test.js +284 -0
- package/codeyam-cli/src/utils/__tests__/scenarioCoverage.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js +649 -223
- package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +1 -0
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/telemetry.test.js +159 -0
- package/codeyam-cli/src/utils/__tests__/telemetry.test.js.map +1 -0
- package/codeyam-cli/src/utils/analysisRunner.js +3 -1
- package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
- package/codeyam-cli/src/utils/analyzer.js +9 -0
- package/codeyam-cli/src/utils/analyzer.js.map +1 -1
- package/codeyam-cli/src/utils/analyzerFinalization.js +100 -0
- package/codeyam-cli/src/utils/analyzerFinalization.js.map +1 -0
- package/codeyam-cli/src/utils/backgroundServer.js +3 -9
- package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/utils/database.js +37 -2
- package/codeyam-cli/src/utils/database.js.map +1 -1
- package/codeyam-cli/src/utils/editorApi.js +11 -5
- package/codeyam-cli/src/utils/editorApi.js.map +1 -1
- package/codeyam-cli/src/utils/editorAudit.js +372 -5
- package/codeyam-cli/src/utils/editorAudit.js.map +1 -1
- package/codeyam-cli/src/utils/editorBroadcastViewport.js +26 -0
- package/codeyam-cli/src/utils/editorBroadcastViewport.js.map +1 -0
- package/codeyam-cli/src/utils/editorDeleteScenario.js +67 -0
- package/codeyam-cli/src/utils/editorDeleteScenario.js.map +1 -0
- package/codeyam-cli/src/utils/editorEntityChangeStatus.js +13 -7
- package/codeyam-cli/src/utils/editorEntityChangeStatus.js.map +1 -1
- package/codeyam-cli/src/utils/editorEntityHelpers.js +144 -0
- package/codeyam-cli/src/utils/editorEntityHelpers.js.map +1 -0
- package/codeyam-cli/src/utils/editorLoaderHelpers.js +72 -1
- package/codeyam-cli/src/utils/editorLoaderHelpers.js.map +1 -1
- package/codeyam-cli/src/utils/editorMigration.js +224 -0
- package/codeyam-cli/src/utils/editorMigration.js.map +1 -0
- package/codeyam-cli/src/utils/editorPreview.js +31 -0
- package/codeyam-cli/src/utils/editorPreview.js.map +1 -1
- package/codeyam-cli/src/utils/editorRecapture.js +109 -0
- package/codeyam-cli/src/utils/editorRecapture.js.map +1 -0
- package/codeyam-cli/src/utils/editorScenarioSwitch.js +24 -2
- package/codeyam-cli/src/utils/editorScenarioSwitch.js.map +1 -1
- package/codeyam-cli/src/utils/editorScenarios.js +458 -0
- package/codeyam-cli/src/utils/editorScenarios.js.map +1 -1
- package/codeyam-cli/src/utils/editorSeedAdapter.js +253 -4
- package/codeyam-cli/src/utils/editorSeedAdapter.js.map +1 -1
- package/codeyam-cli/src/utils/editorShouldRevalidate.js +21 -0
- package/codeyam-cli/src/utils/editorShouldRevalidate.js.map +1 -0
- package/codeyam-cli/src/utils/entityChangeStatus.js +53 -6
- package/codeyam-cli/src/utils/entityChangeStatus.js.map +1 -1
- package/codeyam-cli/src/utils/entityChangeStatus.server.js +41 -3
- package/codeyam-cli/src/utils/entityChangeStatus.server.js.map +1 -1
- package/codeyam-cli/src/utils/fileWatcher.js +38 -0
- package/codeyam-cli/src/utils/fileWatcher.js.map +1 -1
- package/codeyam-cli/src/utils/glossaryAdd.js +74 -0
- package/codeyam-cli/src/utils/glossaryAdd.js.map +1 -0
- package/codeyam-cli/src/utils/install-skills.js +14 -0
- package/codeyam-cli/src/utils/install-skills.js.map +1 -1
- package/codeyam-cli/src/utils/parseRegisterArg.js.map +1 -1
- package/codeyam-cli/src/utils/progress.js +2 -2
- package/codeyam-cli/src/utils/progress.js.map +1 -1
- package/codeyam-cli/src/utils/routePatternMatching.js +129 -0
- package/codeyam-cli/src/utils/routePatternMatching.js.map +1 -0
- package/codeyam-cli/src/utils/scenarioCoverage.js +77 -0
- package/codeyam-cli/src/utils/scenarioCoverage.js.map +1 -0
- package/codeyam-cli/src/utils/scenariosManifest.js +269 -74
- package/codeyam-cli/src/utils/scenariosManifest.js.map +1 -1
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +1 -0
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
- package/codeyam-cli/src/utils/simulationGateMiddleware.js +8 -1
- package/codeyam-cli/src/utils/simulationGateMiddleware.js.map +1 -1
- package/codeyam-cli/src/utils/slugUtils.js +25 -0
- package/codeyam-cli/src/utils/slugUtils.js.map +1 -0
- package/codeyam-cli/src/utils/syncMocksMiddleware.js +2 -2
- package/codeyam-cli/src/utils/syncMocksMiddleware.js.map +1 -1
- package/codeyam-cli/src/utils/telemetry.js +106 -0
- package/codeyam-cli/src/utils/telemetry.js.map +1 -0
- package/codeyam-cli/src/utils/telemetryMiddleware.js +22 -0
- package/codeyam-cli/src/utils/telemetryMiddleware.js.map +1 -0
- package/codeyam-cli/src/webserver/__tests__/buildPtyEnv.test.js +35 -0
- package/codeyam-cli/src/webserver/__tests__/buildPtyEnv.test.js.map +1 -0
- package/codeyam-cli/src/webserver/__tests__/clientErrors.test.js +80 -0
- package/codeyam-cli/src/webserver/__tests__/clientErrors.test.js.map +1 -0
- package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js +218 -0
- package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js.map +1 -1
- package/codeyam-cli/src/webserver/__tests__/idleDetector.test.js +217 -0
- package/codeyam-cli/src/webserver/__tests__/idleDetector.test.js.map +1 -0
- package/codeyam-cli/src/webserver/app/lib/clientErrors.js +71 -0
- package/codeyam-cli/src/webserver/app/lib/clientErrors.js.map +1 -0
- package/codeyam-cli/src/webserver/app/lib/git.js +3 -2
- package/codeyam-cli/src/webserver/app/lib/git.js.map +1 -1
- package/codeyam-cli/src/webserver/app/types/editor.js +8 -0
- package/codeyam-cli/src/webserver/app/types/editor.js.map +1 -0
- package/codeyam-cli/src/webserver/backgroundServer.js +60 -61
- package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/CopyButton-CLe80MMu.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-BcgbViKV.js → EntityItem-Crt_KN_U.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/EntityTypeBadge-CQgyEGV-.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-CQIG2qda.js → EntityTypeIcon-CD7lGABo.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-CgTNOhnu.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-CKeQT5Ty.js +25 -0
- package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-D3s1MFkb.js +3 -0
- package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-BU_OAEMP.js → LoadingDots-By5zI316.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-ceAyBX-H.js → LogViewer-CM5zg40N.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-BzHcG7SE.js → ReportIssueModal-C2PLkej3.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-DanvyBPb.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-0DY_NKil.js → ScenarioViewer-DUMfcNVK.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/Spinner-D0LgAaSa.js +34 -0
- package/codeyam-cli/src/webserver/build/client/assets/TruncatedFilePath-CK7-NaPZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/ViewportInspectBar-BA_Ry-rs.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{_index-DLxKhri3.js → _index-BAWd-Xjf.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-BcY3q6nt.js → activity.(_tab)-BOARiB-g.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/{addon-web-links-Duc5hnl7.js → addon-web-links-CHx25PAe.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{agent-transcripts-Bni3iiUj.js → agent-transcripts-Bg3e7q4S.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-recapture-stale-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-rename-scenario-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-save-seed-state-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-coverage-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-prompt-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-session-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{book-open-BYOypzCa.js → book-open-CL-lMgHh.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-C_Pmso5S.js → chevron-down-GmAjGS9-.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/chunk-JZWAC4HX-BAdwhyCx.js +43 -0
- package/codeyam-cli/src/webserver/build/client/assets/{circle-check-BVMi9VA5.js → circle-check-DFcQkN5j.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{copy-n2FB0_Sw.js → copy-C6iF61Xs.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-CC6AbExI.js → createLucideIcon-4ImjHTVC.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-C8y4mmyv.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/editor._tab-Gbk_i5Js.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/editor.entity.(_sha)-Bnx7yUP0.js +58 -0
- package/codeyam-cli/src/webserver/build/client/assets/editorPreview-oepecPae.js +41 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-BF4oLwaE.js → entity._sha._-Blfy9UlN.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-KTQuL0aj.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-C6eeL24i.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-DQM8E7L4.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-BMvVHNXU.js → entity._sha_.edit._scenarioId-CAoXLsQr.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{entry.client-DTvKq3TY.js → entry.client-SuW9syRS.js} +6 -6
- package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-Daa96Fr1.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/files-D-xGrg29.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/git-Bq_fbXP5.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/globals-fAqOD9ex.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{index-BcvgDzbZ.js → index-Bp1l4hSv.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{index-10oVnAAH.js → index-CWV9XZiG.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{index-yHOVb4rc.js → index-DE3jI_dv.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/jsx-runtime-D_zvdyIk.js +9 -0
- package/codeyam-cli/src/webserver/build/client/assets/labs-B_IX45ih.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-DaAZ_H2w.js → loader-circle-De-7qQ2u.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-b9d4d267.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/memory-Cx2xEx7s.js +101 -0
- package/codeyam-cli/src/webserver/build/client/assets/{pause-f5-1lKBt.js → pause-CFxEKL1u.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/root-DB3O9_9j.js +67 -0
- package/codeyam-cli/src/webserver/build/client/assets/{search-Di64LWVb.js → search-BdBb5aqc.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/settings-DdE-Untf.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/simulations-DSCdE99u.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{terminal-Br7MOqts.js → terminal-CrplD4b1.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-BLdiCuG-.js → triangle-alert-DqJ0j69l.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-DhXHbEjP.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-C14nCb1q.js → useLastLogLine-BNd5hYuW.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/useReportContext-Cy5Qg_UR.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/useToast-5HR2j9ZE.js +1 -0
- package/codeyam-cli/src/webserver/build/client/sound-test.html +98 -0
- package/codeyam-cli/src/webserver/build/server/assets/analysisRunner-CGwTN3V2.js +13 -0
- package/codeyam-cli/src/webserver/build/server/assets/index-D4meMKy3.js +1 -0
- package/codeyam-cli/src/webserver/build/server/assets/init-odGJ_c2-.js +10 -0
- package/codeyam-cli/src/webserver/build/server/assets/progress-CHTtrxFG.js +1 -0
- package/codeyam-cli/src/webserver/build/server/assets/server-build-TmPfF7pT.js +552 -0
- package/codeyam-cli/src/webserver/build/server/index.js +1 -1
- package/codeyam-cli/src/webserver/build-info.json +5 -5
- package/codeyam-cli/src/webserver/editorProxy.js +208 -17
- package/codeyam-cli/src/webserver/editorProxy.js.map +1 -1
- package/codeyam-cli/src/webserver/idleDetector.js +106 -0
- package/codeyam-cli/src/webserver/idleDetector.js.map +1 -0
- package/codeyam-cli/src/webserver/mockStateEvents.js +28 -0
- package/codeyam-cli/src/webserver/mockStateEvents.js.map +1 -0
- package/codeyam-cli/src/webserver/public/sound-test.html +98 -0
- package/codeyam-cli/src/webserver/scripts/journalCapture.ts +36 -0
- package/codeyam-cli/src/webserver/server.js +87 -4
- package/codeyam-cli/src/webserver/server.js.map +1 -1
- package/codeyam-cli/src/webserver/terminalServer.js +140 -35
- package/codeyam-cli/src/webserver/terminalServer.js.map +1 -1
- package/codeyam-cli/templates/chrome-extension-react/README.md +46 -0
- package/codeyam-cli/templates/chrome-extension-react/package.json +1 -0
- package/codeyam-cli/templates/codeyam-editor-claude.md +84 -5
- package/codeyam-cli/templates/codeyam-editor-reference.md +214 -0
- package/codeyam-cli/templates/editor-step-hook.py +114 -24
- package/codeyam-cli/templates/expo-react-native/README.md +41 -0
- package/codeyam-cli/templates/expo-react-native/package.json +1 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/DATABASE.md +14 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/README.md +53 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/package.json +2 -1
- package/codeyam-cli/templates/nextjs-prisma-sqlite/seed-adapter.ts +42 -7
- package/codeyam-cli/templates/nextjs-prisma-supabase/README.md +52 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/package.json +2 -1
- package/codeyam-cli/templates/seed-adapters/supabase.ts +282 -0
- package/codeyam-cli/templates/skills/codeyam-dev-mode/SKILL.md +1 -1
- package/codeyam-cli/templates/skills/codeyam-editor/SKILL.md +76 -10
- package/package.json +2 -1
- package/packages/database/src/lib/kysely/tables/editorScenariosTable.js +84 -0
- package/packages/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -1
- package/packages/database/src/lib/loadEntities.js +0 -6
- package/packages/database/src/lib/loadEntities.js.map +1 -1
- package/packages/database/src/lib/updateCommitMetadata.js +0 -25
- package/packages/database/src/lib/updateCommitMetadata.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/CopyButton-BPXZwM4t.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityTypeBadge-g3saevPb.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-Bu6c6aDe.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-DYFW3lDD.js +0 -25
- package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-DLeucoVX.js +0 -3
- package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-BED4B6sP.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/Spinner-Bb5uFQ5V.js +0 -34
- package/codeyam-cli/src/webserver/build/client/assets/TruncatedFilePath-C8OKAR5x.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/ViewportInspectBar-oAf2Kqsf.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/chunk-JZWAC4HX-C4pqxYJB.js +0 -51
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-Csi0_PMl.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/editor-DgN1LTTt.js +0 -10
- package/codeyam-cli/src/webserver/build/client/assets/editorPreview-BLQMSKZa.js +0 -41
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-C7YX6r3H.js +0 -6
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-CF164ouH.js +0 -6
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-p9hhkjJM.js +0 -6
- package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-cPo8LiG3.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/files-BZrlFE1F.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/git-DdZcvjGh.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/globals-BkWJ_UNc.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/labs-Zk7ryIM1.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-c26eb85b.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/memory-Bl2rpw8u.js +0 -96
- package/codeyam-cli/src/webserver/build/client/assets/root-ClvYBUSA.js +0 -67
- package/codeyam-cli/src/webserver/build/client/assets/settings-0OrEMU6J.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/simulations-DWT-CvLy.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-CrAK28Bc.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useReportContext-O-jkvSPx.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useToast-9FIWuYfK.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/index-DflIr5SD.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-OhKy839M.js +0 -416
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
# .codeyam/ Directory Reference
|
|
2
|
+
|
|
3
|
+
This file documents the `.codeyam/` internals and CLI commands. Consult this when you're stuck on scenario registration, audit failures, preview issues, or understanding what files do what.
|
|
4
|
+
|
|
5
|
+
## Directory Structure
|
|
6
|
+
|
|
7
|
+
### Committed Files (shared across clones)
|
|
8
|
+
|
|
9
|
+
- `config.json` — Project configuration: slug, screen sizes, default viewport, feature metadata
|
|
10
|
+
- `editor-scenarios/` — Scenario JSON files with seed data, localStorage, MSW handlers, and metadata
|
|
11
|
+
- `scenarios-manifest.json` — Index of all scenarios for database sync on fresh clones
|
|
12
|
+
- `design-system.md` — Design tokens and brand guidelines (if present)
|
|
13
|
+
- `glossary.json` — Entity glossary built during extraction steps
|
|
14
|
+
- `msw-handlers/` — MSW handler files for API mocking (one per scenario)
|
|
15
|
+
- `seed-adapters/` — Seed adapter templates for database seeding
|
|
16
|
+
|
|
17
|
+
### Gitignored Files (machine-local)
|
|
18
|
+
|
|
19
|
+
- `db.sqlite3` / `db.sqlite3-wal` / `db.sqlite3-shm` — SQLite database (rebuilt on clone via `codeyam editor`)
|
|
20
|
+
- `secrets.json` — API keys (Anthropic, etc.)
|
|
21
|
+
- `server.json` / `server-state.json` — Background server process state
|
|
22
|
+
- `queue.json` — Analysis job queue state
|
|
23
|
+
- `active-scenario.json` — Currently active scenario for the preview
|
|
24
|
+
- `editor-step.json` — Current editor workflow step number
|
|
25
|
+
- `editor-user-prompt.txt` — The user's feature request text
|
|
26
|
+
- `claude-session-id.txt` — Claude Code session ID for step tracking
|
|
27
|
+
- `editor-mode-context.md` / `dev-mode-context.md` — Generated context for Claude
|
|
28
|
+
- `logs/` — Server and analysis logs
|
|
29
|
+
- `llm-calls/` — LLM call recordings
|
|
30
|
+
- `captures/` — Playwright screenshot captures
|
|
31
|
+
- `results/` — Analysis results
|
|
32
|
+
- `tmp/` — Temporary files (use for large scenario JSON)
|
|
33
|
+
- `rules/` — Auto-installed Claude rules
|
|
34
|
+
- `bin/` — Helper scripts and hooks
|
|
35
|
+
|
|
36
|
+
## CLI Command Reference
|
|
37
|
+
|
|
38
|
+
All commands use the pattern `codeyam editor <subcommand>`.
|
|
39
|
+
|
|
40
|
+
### Scenario Management
|
|
41
|
+
|
|
42
|
+
| Command | Description |
|
|
43
|
+
| --------------------------------------- | ---------------------------------------------------------- |
|
|
44
|
+
| `codeyam editor register '<json>'` | Register a scenario (inline JSON or `@path/to/file.json`) |
|
|
45
|
+
| `codeyam editor scenarios` | List all registered scenarios |
|
|
46
|
+
| `codeyam editor delete <scenarioId>` | Delete a scenario by ID |
|
|
47
|
+
| `codeyam editor scenario-coverage` | Verify all affected scenarios are fresh after code changes |
|
|
48
|
+
| `codeyam editor validate-seed '<json>'` | Validate seed data structure |
|
|
49
|
+
|
|
50
|
+
### Preview & Verification
|
|
51
|
+
|
|
52
|
+
| Command | Description |
|
|
53
|
+
| --------------------------------- | ------------------------------------------------------------------------------------------------- |
|
|
54
|
+
| `codeyam editor preview '<json>'` | Navigate preview — **must include `dimension`** (e.g., `{"path":"/route","dimension":"Desktop"}`) |
|
|
55
|
+
| `codeyam editor client-errors` | Show client-side errors from the preview iframe |
|
|
56
|
+
| `codeyam editor audit` | Check that glossary entries have registered scenarios and tests |
|
|
57
|
+
|
|
58
|
+
### Entity Analysis
|
|
59
|
+
|
|
60
|
+
| Command | Description |
|
|
61
|
+
| ------------------------------------------------ | --------------------------------------------------- |
|
|
62
|
+
| `codeyam editor analyze-imports` | Build the import dependency graph from source files |
|
|
63
|
+
| `codeyam editor dependents <EntityName>` | Find all entities that import a given entity |
|
|
64
|
+
| `codeyam editor isolate "ComponentA ComponentB"` | Create isolation route directories for components |
|
|
65
|
+
|
|
66
|
+
### Server
|
|
67
|
+
|
|
68
|
+
| Command | Description |
|
|
69
|
+
| --------------------------- | ----------------------- |
|
|
70
|
+
| `codeyam editor dev-server` | Query dev server status |
|
|
71
|
+
|
|
72
|
+
### Workflow
|
|
73
|
+
|
|
74
|
+
| Command | Description |
|
|
75
|
+
| ------------------------------------------------------- | --------------------------------------------------------------- |
|
|
76
|
+
| `codeyam editor <1-16>` | Jump to a specific editor workflow step |
|
|
77
|
+
| `codeyam editor steps` | Show setup overview or cycle progress |
|
|
78
|
+
| `codeyam editor change <feature>` | Start the change workflow for modifying features |
|
|
79
|
+
| `codeyam editor sync` | Import scenarios from manifest into database (used after clone) |
|
|
80
|
+
| `codeyam editor migrate [step\|next\|complete\|status]` | Run migration workflow steps |
|
|
81
|
+
|
|
82
|
+
## Scenario Registration Patterns
|
|
83
|
+
|
|
84
|
+
### Component-Level Scenario
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"name": "TaskCard - Overdue",
|
|
89
|
+
"componentName": "TaskCard",
|
|
90
|
+
"url": "/isolated-components/TaskCard?s=Overdue",
|
|
91
|
+
"dimensions": ["Desktop"]
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### App-Level Scenario
|
|
96
|
+
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"name": "Dashboard with Tasks",
|
|
100
|
+
"url": "/",
|
|
101
|
+
"dimensions": ["Desktop"],
|
|
102
|
+
"seedData": {
|
|
103
|
+
"tasks": [{ "id": 1, "title": "Ship feature", "status": "in_progress" }]
|
|
104
|
+
},
|
|
105
|
+
"localStorage": { "user": "{\"name\":\"Alice\"}" }
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Large JSON — Use a Tmp File
|
|
110
|
+
|
|
111
|
+
Write JSON to `.codeyam/tmp/scenario.json` using the **Write tool**, then:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
codeyam editor register @.codeyam/tmp/scenario.json
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Re-registration
|
|
118
|
+
|
|
119
|
+
Registering a scenario with the same name replaces the existing one. No need to delete first.
|
|
120
|
+
|
|
121
|
+
### Dimensions
|
|
122
|
+
|
|
123
|
+
Dimension names come from `screenSizes` in `.codeyam/config.json`. Common values: `"Desktop"`, `"Mobile"`, `"Tablet"`. Every scenario and preview command must specify a dimension.
|
|
124
|
+
|
|
125
|
+
## Troubleshooting
|
|
126
|
+
|
|
127
|
+
### Audit gate blocking step 8+
|
|
128
|
+
|
|
129
|
+
The audit checks that every glossary entity has at least one scenario and passes tests. Fix by:
|
|
130
|
+
|
|
131
|
+
1. Run `codeyam editor audit` to see which entities are missing coverage
|
|
132
|
+
2. Register scenarios for uncovered entities
|
|
133
|
+
3. Fix any failing tests
|
|
134
|
+
4. Re-run audit — do NOT loop `audit` and `analyze-imports` repeatedly
|
|
135
|
+
|
|
136
|
+
### Scenarios showing empty/blank pages or error pages
|
|
137
|
+
|
|
138
|
+
The scenario renders a URL but the page has no visible content, or shows an error page. Common causes:
|
|
139
|
+
|
|
140
|
+
- **URL references IDs that don't exist in the seed data**: The URL contains a dynamic segment (e.g., `/items/abc-123`) but the seed data creates records with different IDs. Check the register output for `API response error` lines — they show the exact API call that failed and the server's response.
|
|
141
|
+
- **Seed data doesn't match the code**: The seeded data has fields the component doesn't read, or the component expects data the seed doesn't provide
|
|
142
|
+
- **Missing API route**: The component fetches from an API that doesn't exist yet
|
|
143
|
+
- **Component not exported or not mounted**: The isolation route doesn't render the component
|
|
144
|
+
- **Only create scenarios for states the current code can render** — if the component isn't built yet, the screenshot will be blank
|
|
145
|
+
|
|
146
|
+
### Client errors in preview
|
|
147
|
+
|
|
148
|
+
Run `codeyam editor client-errors` to see errors from the preview. There are three types:
|
|
149
|
+
|
|
150
|
+
- **Console errors** (`Page console.error:`): JavaScript runtime errors — missing env vars, import errors, schema mismatches
|
|
151
|
+
- **HTTP errors** (`HTTP error: status=NNN`): The page URL itself returned a non-2xx status (e.g., 404 page not found)
|
|
152
|
+
- **API response errors** (`API response error: GET /api/... → NNN`): An API call made during page load returned a non-2xx status, with the server's response body included
|
|
153
|
+
|
|
154
|
+
API response errors are the most actionable — they show the exact endpoint that failed and what the server returned. When you see one, read the scenario's seed data and verify that the IDs in the URL match IDs created by the seed. For example, if the URL is `/page/items/abc-123` but the seed creates items with ID `item-1`, the API call to `/api/items/abc-123` will return 404.
|
|
155
|
+
|
|
156
|
+
### Dependents returning nothing
|
|
157
|
+
|
|
158
|
+
`codeyam editor dependents <Entity>` requires the import graph to be built first. Run:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
codeyam editor analyze-imports
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Then retry `dependents`. The import graph persists in the database.
|
|
165
|
+
|
|
166
|
+
### Database missing after clone
|
|
167
|
+
|
|
168
|
+
This is expected — `db.sqlite3` is gitignored. Running `codeyam editor` detects this state (config.json exists, DB doesn't) and automatically runs `init --force` to rebuild the database and sync scenarios from the manifest.
|
|
169
|
+
|
|
170
|
+
### Dev server not starting
|
|
171
|
+
|
|
172
|
+
Check if another process holds the port:
|
|
173
|
+
|
|
174
|
+
1. Look at `.codeyam/server-state.json` for the PID and port
|
|
175
|
+
2. Kill any stale process
|
|
176
|
+
3. Restart with `codeyam editor` (the editor command starts the server)
|
|
177
|
+
|
|
178
|
+
### Step validation errors
|
|
179
|
+
|
|
180
|
+
Each step has prerequisites. If a step refuses to run:
|
|
181
|
+
|
|
182
|
+
1. Run `codeyam editor steps` to see which steps are complete
|
|
183
|
+
2. Complete the prerequisite steps first
|
|
184
|
+
3. Don't skip steps — the workflow is sequential
|
|
185
|
+
|
|
186
|
+
### Dimension mismatch
|
|
187
|
+
|
|
188
|
+
If previews look wrong or captures fail:
|
|
189
|
+
|
|
190
|
+
- Check `screenSizes` in `.codeyam/config.json` for valid dimension names
|
|
191
|
+
- Scenario `dimensions` must reference names defined in `screenSizes`
|
|
192
|
+
- Preview commands must also include `dimension` — don't omit it
|
|
193
|
+
|
|
194
|
+
### Preview not updating
|
|
195
|
+
|
|
196
|
+
If changes aren't reflected in the preview:
|
|
197
|
+
|
|
198
|
+
- The dev server may need to rebuild — check terminal output for compilation errors
|
|
199
|
+
- Hard-refresh the preview: `codeyam editor preview '{"path":"<current-path>","dimension":"<dimension>","forceRefresh":true}'`
|
|
200
|
+
- Check `codeyam editor client-errors` for runtime errors blocking render
|
|
201
|
+
|
|
202
|
+
## Anti-Patterns
|
|
203
|
+
|
|
204
|
+
**Don't loop audit/analyze-imports.** If audit fails, fix the underlying issues (missing scenarios, failing tests). Running audit repeatedly without fixing anything wastes time.
|
|
205
|
+
|
|
206
|
+
**Don't use `prisma db push --force-reset`.** This drops all data. Instead, add `@default()` values for new required columns, or make them optional (`Int?`). Use `npm run db:push`.
|
|
207
|
+
|
|
208
|
+
**Don't hardcode viewport dimensions.** Always reference named dimensions from `screenSizes` in config.json (e.g., `"Desktop"`). Don't use raw pixel values like `1440x900`.
|
|
209
|
+
|
|
210
|
+
**Don't use bash heredocs for JSON.** Braces and quotes in heredocs trigger Claude Code security warnings. Use the **Write tool** to create `.codeyam/tmp/scenario.json`, then `codeyam editor register @.codeyam/tmp/scenario.json`.
|
|
211
|
+
|
|
212
|
+
**Don't blanket-ignore `.codeyam` in `.gitignore`.** Only machine-local files are ignored with granular patterns. Shared files (`config.json`, `editor-scenarios/`, etc.) must be committable.
|
|
213
|
+
|
|
214
|
+
**Don't register scenarios for unbuilt features.** If the component or page doesn't exist yet, the scenario will capture a blank page. Build the component first, then create scenarios for what it actually renders.
|
|
@@ -27,6 +27,9 @@ STEP_LABELS = {
|
|
|
27
27
|
11: "Journal",
|
|
28
28
|
12: "Review",
|
|
29
29
|
13: "Present",
|
|
30
|
+
14: "Commit",
|
|
31
|
+
15: "Finalize",
|
|
32
|
+
16: "Push",
|
|
30
33
|
}
|
|
31
34
|
|
|
32
35
|
STEP_RESTRICTIONS = {
|
|
@@ -43,6 +46,35 @@ STEP_RESTRICTIONS = {
|
|
|
43
46
|
11: "Create or update the journal entry for this feature. Do NOT create a duplicate — check if one exists first.",
|
|
44
47
|
12: "Verify ALL screenshots exist and NO client-side errors (/api/editor-client-errors). Run codeyam editor audit. Do not proceed until all checks pass.",
|
|
45
48
|
13: "Show the results panel, present summary, then selection menu (AskUserQuestion): Save or make changes.",
|
|
49
|
+
14: "Hide the results panel and commit all changes. Do NOT push — that happens in step 16.",
|
|
50
|
+
15: "Update the journal entry with the commit SHA and amend the commit to include the journal update.",
|
|
51
|
+
16: "Check for a git remote and offer to push. WAIT for the user's answer before starting the next feature.",
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
MIGRATION_STEP_LABELS = {
|
|
55
|
+
1: "Survey",
|
|
56
|
+
2: "App Scenarios",
|
|
57
|
+
3: "Component Scenarios",
|
|
58
|
+
4: "Preview",
|
|
59
|
+
5: "Discuss",
|
|
60
|
+
6: "Decompose",
|
|
61
|
+
7: "Extract",
|
|
62
|
+
8: "Recapture",
|
|
63
|
+
9: "Journal",
|
|
64
|
+
10: "Present",
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
MIGRATION_STEP_RESTRICTIONS = {
|
|
68
|
+
1: "Survey the page and start the dev server. Read all files and map data flow. Do NOT register scenarios yet.",
|
|
69
|
+
2: "Set up seed adapter if needed, then register application scenarios for the ACTUAL page route with seed data.",
|
|
70
|
+
3: "Create isolation routes and register component scenarios for individual visual components.",
|
|
71
|
+
4: "Verify screenshots and show results to the user. Do NOT modify application code.",
|
|
72
|
+
5: "Assess complexity and ask user about decomposition. Wait for user decision before proceeding.",
|
|
73
|
+
6: "Plan-only. Identify all extractions, mark existing components as REUSE. Do NOT write code.",
|
|
74
|
+
7: "Execute the extraction plan. Components first, then functions via TDD.",
|
|
75
|
+
8: "Update glossary, re-register scenarios after code changes, verify screenshots. Fix issues only.",
|
|
76
|
+
9: "Create the journal entry for this page's migration.",
|
|
77
|
+
10: "Show results, present summary, commit or make changes. After commit run `codeyam editor migrate complete` then `codeyam editor migrate next`.",
|
|
46
78
|
}
|
|
47
79
|
|
|
48
80
|
|
|
@@ -81,6 +113,13 @@ def detect_event():
|
|
|
81
113
|
|
|
82
114
|
|
|
83
115
|
def main():
|
|
116
|
+
# Only run in editor Build sessions. The env var is set by the terminal
|
|
117
|
+
# server when launching Claude in editor mode. Without this guard, hooks
|
|
118
|
+
# fire in every Claude session in the project (scenario editing, bare
|
|
119
|
+
# claude, etc.) and inject unwanted step restrictions.
|
|
120
|
+
if not os.environ.get("CODEYAM_EDITOR_ACTIVE"):
|
|
121
|
+
return
|
|
122
|
+
|
|
84
123
|
project_dir = os.environ.get("CLAUDE_PROJECT_DIR", os.getcwd())
|
|
85
124
|
state_path = os.path.join(project_dir, ".codeyam", "editor-step.json")
|
|
86
125
|
prompt_path = os.path.join(project_dir, ".codeyam", "editor-user-prompt.txt")
|
|
@@ -88,11 +127,12 @@ def main():
|
|
|
88
127
|
# Detect event early so we can capture the user prompt even before state exists
|
|
89
128
|
event_type, event_data = detect_event()
|
|
90
129
|
|
|
91
|
-
# Capture the very first user prompt (before state file may exist).
|
|
130
|
+
# Capture the very first real user prompt (before state file may exist).
|
|
92
131
|
# Save to a separate file so it persists across state transitions.
|
|
132
|
+
# Skip slash commands (e.g. /codeyam-editor) — they aren't user prompts.
|
|
93
133
|
if event_type == "user_prompt" and not os.path.exists(prompt_path):
|
|
94
134
|
prompt_text = event_data.get("prompt", "").strip()
|
|
95
|
-
if prompt_text:
|
|
135
|
+
if prompt_text and not prompt_text.startswith("/"):
|
|
96
136
|
try:
|
|
97
137
|
os.makedirs(os.path.dirname(prompt_path), exist_ok=True)
|
|
98
138
|
with open(prompt_path, "w") as f:
|
|
@@ -112,24 +152,40 @@ def main():
|
|
|
112
152
|
step = state.get("step")
|
|
113
153
|
label = state.get("label", "Unknown")
|
|
114
154
|
feature = state.get("feature", "")
|
|
155
|
+
migration = state.get("migration") # Optional migration context
|
|
115
156
|
|
|
116
157
|
if not step:
|
|
117
158
|
return
|
|
118
159
|
|
|
119
160
|
# Log the hook firing
|
|
120
161
|
log_data = {"step": step, "label": label, "feature": feature, "hook": event_type}
|
|
162
|
+
if migration:
|
|
163
|
+
log_data["migration"] = True
|
|
121
164
|
if event_type == "post_tool_use":
|
|
122
165
|
log_data["tool"] = event_data.get("tool_name", "")
|
|
123
166
|
log_event(project_dir, "hook", log_data)
|
|
124
167
|
|
|
125
|
-
|
|
126
|
-
|
|
168
|
+
# Use migration-specific labels/restrictions when in migration mode
|
|
169
|
+
if migration:
|
|
170
|
+
restriction = MIGRATION_STEP_RESTRICTIONS.get(step, "")
|
|
171
|
+
next_cmd = f"codeyam editor migrate {step + 1}" if step < 10 else "codeyam editor migrate next"
|
|
172
|
+
else:
|
|
173
|
+
restriction = STEP_RESTRICTIONS.get(step, "")
|
|
174
|
+
next_cmd = f"codeyam editor {step + 1}" if step < 16 else "codeyam editor 1"
|
|
127
175
|
|
|
128
176
|
# UserPromptSubmit: concise workflow reminder injected before Claude processes the user's message
|
|
129
177
|
if event_type == "user_prompt":
|
|
178
|
+
mode_label = "Migration Mode" if migration else "Editor Mode"
|
|
179
|
+
page_info = ""
|
|
180
|
+
if migration:
|
|
181
|
+
page_name = migration.get("pageName", "")
|
|
182
|
+
page_idx = migration.get("pageIndex", 0)
|
|
183
|
+
total = migration.get("totalPages", 0)
|
|
184
|
+
page_info = f" — Page {page_idx + 1}/{total} ({page_name})"
|
|
185
|
+
|
|
130
186
|
lines = [
|
|
131
187
|
f'<user-prompt-submit-hook>',
|
|
132
|
-
f'
|
|
188
|
+
f'{mode_label} — Step {step} ({label}): "{feature}"{page_info}',
|
|
133
189
|
]
|
|
134
190
|
|
|
135
191
|
# Include the active scenario so Claude knows what the user is looking at
|
|
@@ -149,15 +205,26 @@ def main():
|
|
|
149
205
|
except (IOError, json.JSONDecodeError):
|
|
150
206
|
pass
|
|
151
207
|
|
|
152
|
-
if step ==
|
|
208
|
+
if migration and step == 8:
|
|
209
|
+
lines.append(
|
|
210
|
+
"If the user is requesting changes (even indirectly), "
|
|
211
|
+
"run `codeyam editor change` BEFORE making any modifications. "
|
|
212
|
+
"The change workflow ensures Working Session Results are shown to the user. "
|
|
213
|
+
"If the user chose to commit, run `codeyam editor migrate next` to advance to the next page."
|
|
214
|
+
)
|
|
215
|
+
elif step in (13, 14, 15, 16) and not migration:
|
|
153
216
|
lines.append(
|
|
154
217
|
"If the user is requesting changes (even indirectly), "
|
|
155
218
|
"run `codeyam editor change` BEFORE making any modifications "
|
|
156
219
|
"(code, scenarios, data, styles — everything). "
|
|
157
220
|
"The change command gives you the post-change checklist. "
|
|
158
221
|
"The change workflow ensures Working Session Results are shown to the user. "
|
|
159
|
-
"If the user chose to commit, run `codeyam editor
|
|
160
|
-
|
|
222
|
+
"If the user chose to commit, run `codeyam editor 14` to advance to the commit step."
|
|
223
|
+
)
|
|
224
|
+
elif migration:
|
|
225
|
+
lines.append(
|
|
226
|
+
f"You are on migration step {step}. Follow the `codeyam editor migrate` workflow. "
|
|
227
|
+
f"Do NOT skip ahead or make changes outside the current step."
|
|
161
228
|
)
|
|
162
229
|
else:
|
|
163
230
|
lines.append(
|
|
@@ -170,8 +237,9 @@ def main():
|
|
|
170
237
|
print("\n".join(lines))
|
|
171
238
|
return
|
|
172
239
|
|
|
240
|
+
mode_label = "Migration Mode" if migration else "Editor Mode"
|
|
173
241
|
lines = [
|
|
174
|
-
f'
|
|
242
|
+
f'{mode_label} \u2014 Step {step} ({label}): "{feature}"',
|
|
175
243
|
]
|
|
176
244
|
if restriction:
|
|
177
245
|
lines.append(restriction)
|
|
@@ -182,18 +250,40 @@ def main():
|
|
|
182
250
|
BOLD_CYAN = "\033[1;36m"
|
|
183
251
|
DIM = "\033[2m"
|
|
184
252
|
RESET = "\033[0m"
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
253
|
+
|
|
254
|
+
if migration:
|
|
255
|
+
# Migration progress tracker (10 steps)
|
|
256
|
+
page_name = migration.get("pageName", "")
|
|
257
|
+
page_idx = migration.get("pageIndex", 0)
|
|
258
|
+
total = migration.get("totalPages", 0)
|
|
259
|
+
tracker = [f"{DIM} Migration: Page {page_idx + 1}/{total} ({page_name}){RESET}"]
|
|
260
|
+
tracker.append(f"{DIM} \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510{RESET}")
|
|
261
|
+
for i in range(1, 11):
|
|
262
|
+
lbl = MIGRATION_STEP_LABELS[i].ljust(28)
|
|
263
|
+
num = f" {i}" if i < 10 else f"{i}"
|
|
264
|
+
cntnt = f"{num}. {lbl}"
|
|
265
|
+
if i < step:
|
|
266
|
+
tracker.append(f"{DIM} \u2502{RESET}{GREEN} \u2713 {cntnt}{RESET}{DIM}\u2502{RESET}")
|
|
267
|
+
elif i == step:
|
|
268
|
+
tracker.append(f"{DIM} \u2502{RESET}{BOLD_CYAN} \u2192 {cntnt}{RESET}{DIM}\u2502{RESET}")
|
|
269
|
+
else:
|
|
270
|
+
tracker.append(f"{DIM} \u2502 \u25cb {cntnt}\u2502{RESET}")
|
|
271
|
+
tracker.append(f"{DIM} \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518{RESET}")
|
|
272
|
+
else:
|
|
273
|
+
# Standard progress tracker (16 steps)
|
|
274
|
+
tracker = [f"{DIM} \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510{RESET}"]
|
|
275
|
+
for i in range(1, 17):
|
|
276
|
+
lbl = STEP_LABELS[i].ljust(28)
|
|
277
|
+
num = f" {i}" if i < 10 else f"{i}"
|
|
278
|
+
content = f"{num}. {lbl}"
|
|
279
|
+
if i < step:
|
|
280
|
+
tracker.append(f"{DIM} \u2502{RESET}{GREEN} \u2713 {content}{RESET}{DIM}\u2502{RESET}")
|
|
281
|
+
elif i == step:
|
|
282
|
+
tracker.append(f"{DIM} \u2502{RESET}{BOLD_CYAN} \u2192 {content}{RESET}{DIM}\u2502{RESET}")
|
|
283
|
+
else:
|
|
284
|
+
tracker.append(f"{DIM} \u2502 \u25cb {content}\u2502{RESET}")
|
|
285
|
+
tracker.append(f"{DIM} \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518{RESET}")
|
|
286
|
+
|
|
197
287
|
lines.append("Present this progress tracker to the user (copy verbatim):")
|
|
198
288
|
lines.extend(tracker)
|
|
199
289
|
lines.append(
|
|
@@ -201,7 +291,7 @@ def main():
|
|
|
201
291
|
"\u2713 (done) or \u2717 (skipped + reason)."
|
|
202
292
|
)
|
|
203
293
|
|
|
204
|
-
if event_type == "stop" and step ==
|
|
294
|
+
if event_type == "stop" and ((step in (13, 14) and not migration) or (step == 8 and migration)):
|
|
205
295
|
import subprocess as _sp
|
|
206
296
|
try:
|
|
207
297
|
_result = _sp.run(
|
|
@@ -218,8 +308,8 @@ def main():
|
|
|
218
308
|
"\n\033[1;31m⚠️ You have uncommitted changes but haven't shown Working Session Results.\033[0m"
|
|
219
309
|
)
|
|
220
310
|
lines.append(
|
|
221
|
-
"\033[31mRun `codeyam editor change` if you haven't already, then complete the "
|
|
222
|
-
"checklist and run `codeyam editor 13` to show results to the user.\033[0m"
|
|
311
|
+
f"\033[31mRun `codeyam editor change` if you haven't already, then complete the "
|
|
312
|
+
f"checklist and run `{'codeyam editor migrate 8' if migration else 'codeyam editor 13'}` to show results to the user.\033[0m"
|
|
223
313
|
)
|
|
224
314
|
|
|
225
315
|
lines.append(f"When this step is complete, run: {next_cmd}")
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Project Name
|
|
2
|
+
|
|
3
|
+
Brief description of what this app does.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm run setup
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Development
|
|
12
|
+
|
|
13
|
+
Start the Expo dev server (web):
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm run dev
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
For native platforms:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm run ios # iOS simulator
|
|
23
|
+
npm run android # Android emulator
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Using CodeYam Editor
|
|
27
|
+
|
|
28
|
+
This project was built with [CodeYam](https://codeyam.com). To launch the editor:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
codeyam editor
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Scripts
|
|
35
|
+
|
|
36
|
+
| Script | Description |
|
|
37
|
+
| ----------------- | --------------------------- |
|
|
38
|
+
| `npm run setup` | Install dependencies |
|
|
39
|
+
| `npm run dev` | Start Expo dev server (web) |
|
|
40
|
+
| `npm run ios` | Run on iOS simulator |
|
|
41
|
+
| `npm run android` | Run on Android emulator |
|
|
@@ -23,6 +23,20 @@ npm run db:reset
|
|
|
23
23
|
npx prisma studio
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
+
## Adding Columns to Existing Tables
|
|
27
|
+
|
|
28
|
+
When adding a new **required** column to a table that already has data, `db push` will fail because existing rows have no value for the new column. To avoid this:
|
|
29
|
+
|
|
30
|
+
- **Add a `@default(...)` value** so Prisma can fill existing rows automatically:
|
|
31
|
+
```prisma
|
|
32
|
+
model Rating {
|
|
33
|
+
userId String @default("anonymous") // existing rows get "anonymous"
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
- Once all rows have real values, you can remove the default if desired.
|
|
37
|
+
- **Never use `--force-reset`** — it drops ALL tables and deletes all data.
|
|
38
|
+
- Optional columns (`String?`) don't need a default — existing rows get `null`.
|
|
39
|
+
|
|
26
40
|
## Using the Database
|
|
27
41
|
|
|
28
42
|
```typescript
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Project Name
|
|
2
|
+
|
|
3
|
+
Brief description of what this app does.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
Run the setup script to install dependencies, initialize the database, and seed it with demo data:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm run setup
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Development
|
|
14
|
+
|
|
15
|
+
Start the dev server:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm run dev
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Open [http://localhost:3000](http://localhost:3000) in your browser.
|
|
22
|
+
|
|
23
|
+
## Using CodeYam Editor
|
|
24
|
+
|
|
25
|
+
This project was built with [CodeYam](https://codeyam.com). To launch the editor:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
codeyam editor
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The editor provides a live preview alongside a Claude Code terminal for iterating on the app.
|
|
32
|
+
|
|
33
|
+
## Database
|
|
34
|
+
|
|
35
|
+
This project uses SQLite via Prisma. Common commands:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm run db:push # Apply schema changes and generate Prisma client
|
|
39
|
+
npm run db:seed # Seed the database with demo data
|
|
40
|
+
npm run db:reset # Reset database: drop, recreate, and re-seed
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Scripts
|
|
44
|
+
|
|
45
|
+
| Script | Description |
|
|
46
|
+
| ------------------ | -------------------------------------------- |
|
|
47
|
+
| `npm run setup` | One-line project setup (install + db + seed) |
|
|
48
|
+
| `npm run dev` | Start the development server |
|
|
49
|
+
| `npm run build` | Build for production |
|
|
50
|
+
| `npm run test` | Run tests |
|
|
51
|
+
| `npm run db:push` | Apply Prisma schema changes |
|
|
52
|
+
| `npm run db:seed` | Seed the database |
|
|
53
|
+
| `npm run db:reset` | Reset and re-seed the database |
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
"version": "0.1.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"scripts": {
|
|
6
|
+
"setup": "npm install && npm run db:push && npm run db:seed",
|
|
6
7
|
"dev": "next dev --turbopack",
|
|
7
8
|
"build": "next build",
|
|
8
9
|
"start": "next start",
|
|
@@ -17,7 +18,7 @@
|
|
|
17
18
|
"@prisma/adapter-better-sqlite3": "^7.4.1",
|
|
18
19
|
"@prisma/client": "^7.4.1",
|
|
19
20
|
"better-sqlite3": "^12.6.2",
|
|
20
|
-
"next": "^
|
|
21
|
+
"next": "^16.1.7",
|
|
21
22
|
"prisma": "^7.4.1",
|
|
22
23
|
"react": "^19.1.0",
|
|
23
24
|
"react-dom": "^19.1.0"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import 'dotenv/config';
|
|
20
|
-
import { PrismaClient } from '@prisma/client';
|
|
20
|
+
import { PrismaClient, Prisma } from '@prisma/client';
|
|
21
21
|
import { PrismaBetterSqlite3 } from '@prisma/adapter-better-sqlite3';
|
|
22
22
|
import * as fs from 'fs';
|
|
23
23
|
|
|
@@ -84,9 +84,44 @@ async function main() {
|
|
|
84
84
|
console.log('Seed complete');
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
87
|
+
/**
|
|
88
|
+
* Export mode: dump current database state to a JSON file.
|
|
89
|
+
* Used by CodeYam to save interactive changes back to scenario seed data.
|
|
90
|
+
*
|
|
91
|
+
* Usage: npx tsx .codeyam/seed-adapter.ts --export <output-path.json>
|
|
92
|
+
*/
|
|
93
|
+
async function exportData(outputPath: string) {
|
|
94
|
+
const modelNames = Prisma.dmmf.datamodel.models.map((m) => m.name);
|
|
95
|
+
|
|
96
|
+
const seed: Record<string, unknown[]> = {};
|
|
97
|
+
for (const model of modelNames) {
|
|
98
|
+
const camelCase = model.charAt(0).toLowerCase() + model.slice(1);
|
|
99
|
+
try {
|
|
100
|
+
const rows = await (prisma as any)[camelCase].findMany();
|
|
101
|
+
if (rows.length > 0) {
|
|
102
|
+
seed[camelCase] = rows;
|
|
103
|
+
}
|
|
104
|
+
} catch {
|
|
105
|
+
// Skip tables that can't be queried
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
fs.writeFileSync(outputPath, JSON.stringify(seed, null, 2));
|
|
110
|
+
console.log(`Exported ${Object.keys(seed).length} tables`);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (process.argv[2] === '--export') {
|
|
114
|
+
exportData(process.argv[3])
|
|
115
|
+
.then(() => prisma.$disconnect())
|
|
116
|
+
.catch((e) => {
|
|
117
|
+
console.error('Seed adapter export error:', e);
|
|
118
|
+
process.exit(1);
|
|
119
|
+
});
|
|
120
|
+
} else {
|
|
121
|
+
main()
|
|
122
|
+
.then(() => prisma.$disconnect())
|
|
123
|
+
.catch((e) => {
|
|
124
|
+
console.error('Seed adapter error:', e);
|
|
125
|
+
process.exit(1);
|
|
126
|
+
});
|
|
127
|
+
}
|