@codeyam/codeyam-cli 0.1.0-staging.415103 → 0.1.0-staging.44b55c1
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 +7 -7
- package/analyzer-template/log.txt +3 -3
- package/analyzer-template/package.json +9 -9
- package/analyzer-template/packages/ai/package.json +1 -1
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +0 -33
- package/analyzer-template/packages/analyze/src/lib/ProjectAnalyzer.ts +13 -7
- package/analyzer-template/packages/analyze/src/lib/asts/index.ts +7 -2
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.ts +0 -98
- package/analyzer-template/packages/aws/package.json +2 -2
- package/analyzer-template/packages/database/package.json +3 -3
- package/analyzer-template/packages/database/src/lib/kysely/tables/editorScenariosTable.ts +20 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts +4 -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 +20 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.d.ts +2 -0
- package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.js +2 -0
- package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.js.map +1 -1
- package/analyzer-template/packages/github/package.json +1 -1
- package/analyzer-template/packages/types/src/enums/ProjectFramework.ts +2 -0
- package/analyzer-template/packages/ui-components/package.json +1 -1
- package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.d.ts +2 -0
- package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.js +2 -0
- package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.js.map +1 -1
- package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js +196 -0
- package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js.map +1 -0
- package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js +114 -0
- package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js.map +1 -0
- package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js +149 -0
- package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js.map +1 -0
- package/codeyam-cli/src/commands/default.js +3 -46
- package/codeyam-cli/src/commands/default.js.map +1 -1
- package/codeyam-cli/src/commands/editor.js +2354 -284
- package/codeyam-cli/src/commands/editor.js.map +1 -1
- package/codeyam-cli/src/commands/init.js +6 -1
- package/codeyam-cli/src/commands/init.js.map +1 -1
- package/codeyam-cli/src/data/techStacks.js +77 -0
- package/codeyam-cli/src/data/techStacks.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/devServerState.test.js +134 -0
- package/codeyam-cli/src/utils/__tests__/devServerState.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorApi.test.js +127 -0
- package/codeyam-cli/src/utils/__tests__/editorApi.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +635 -0
- package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorCapture.test.js +93 -0
- package/codeyam-cli/src/utils/__tests__/editorCapture.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js +304 -0
- package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js +121 -0
- package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js +294 -0
- package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorJournal.test.js +542 -0
- package/codeyam-cli/src/utils/__tests__/editorJournal.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js +393 -0
- package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorMockState.test.js +270 -0
- package/codeyam-cli/src/utils/__tests__/editorMockState.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js +217 -0
- package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorPreview.test.js +266 -0
- package/codeyam-cli/src/utils/__tests__/editorPreview.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js +107 -0
- package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js +139 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js +221 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js +221 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js +213 -0
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js +1737 -0
- package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/git.editor.test.js +134 -0
- package/codeyam-cli/src/utils/__tests__/git.editor.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js +107 -0
- package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js +101 -0
- package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/project.test.js +65 -0
- package/codeyam-cli/src/utils/__tests__/project.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/scenarioMarkers.test.js +121 -0
- package/codeyam-cli/src/utils/__tests__/scenarioMarkers.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js +246 -0
- package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +25 -5
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js +51 -0
- package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/webappDetection.test.js +142 -0
- package/codeyam-cli/src/utils/__tests__/webappDetection.test.js.map +1 -0
- package/codeyam-cli/src/utils/backgroundServer.js +2 -2
- package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/utils/buildFlags.js +4 -0
- package/codeyam-cli/src/utils/buildFlags.js.map +1 -0
- package/codeyam-cli/src/utils/devServerState.js +71 -0
- package/codeyam-cli/src/utils/devServerState.js.map +1 -0
- package/codeyam-cli/src/utils/editorApi.js +73 -0
- package/codeyam-cli/src/utils/editorApi.js.map +1 -0
- package/codeyam-cli/src/utils/editorAudit.js +159 -0
- package/codeyam-cli/src/utils/editorAudit.js.map +1 -0
- package/codeyam-cli/src/utils/editorCapture.js +102 -0
- package/codeyam-cli/src/utils/editorCapture.js.map +1 -0
- package/codeyam-cli/src/utils/editorDevServer.js +197 -0
- package/codeyam-cli/src/utils/editorDevServer.js.map +1 -0
- package/codeyam-cli/src/utils/editorEntityChangeStatus.js +44 -0
- package/codeyam-cli/src/utils/editorEntityChangeStatus.js.map +1 -0
- package/codeyam-cli/src/utils/editorImageVerifier.js +155 -0
- package/codeyam-cli/src/utils/editorImageVerifier.js.map +1 -0
- package/codeyam-cli/src/utils/editorJournal.js +225 -0
- package/codeyam-cli/src/utils/editorJournal.js.map +1 -0
- package/codeyam-cli/src/utils/editorLoaderHelpers.js +81 -0
- package/codeyam-cli/src/utils/editorLoaderHelpers.js.map +1 -0
- package/codeyam-cli/src/utils/editorMockState.js +248 -0
- package/codeyam-cli/src/utils/editorMockState.js.map +1 -0
- package/codeyam-cli/src/utils/editorPreloadHelpers.js +135 -0
- package/codeyam-cli/src/utils/editorPreloadHelpers.js.map +1 -0
- package/codeyam-cli/src/utils/editorPreview.js +106 -0
- package/codeyam-cli/src/utils/editorPreview.js.map +1 -0
- package/codeyam-cli/src/utils/editorScenarioSwitch.js +112 -0
- package/codeyam-cli/src/utils/editorScenarioSwitch.js.map +1 -0
- package/codeyam-cli/src/utils/editorScenarios.js +96 -0
- package/codeyam-cli/src/utils/editorScenarios.js.map +1 -0
- package/codeyam-cli/src/utils/editorSeedAdapter.js +173 -0
- package/codeyam-cli/src/utils/editorSeedAdapter.js.map +1 -0
- package/codeyam-cli/src/utils/entityChangeStatus.js +347 -0
- package/codeyam-cli/src/utils/entityChangeStatus.js.map +1 -0
- package/codeyam-cli/src/utils/entityChangeStatus.server.js +158 -0
- package/codeyam-cli/src/utils/entityChangeStatus.server.js.map +1 -0
- package/codeyam-cli/src/utils/git.js +51 -0
- package/codeyam-cli/src/utils/git.js.map +1 -1
- package/codeyam-cli/src/utils/install-skills.js +28 -17
- package/codeyam-cli/src/utils/install-skills.js.map +1 -1
- package/codeyam-cli/src/utils/parseRegisterArg.js +31 -0
- package/codeyam-cli/src/utils/parseRegisterArg.js.map +1 -0
- package/codeyam-cli/src/utils/project.js +15 -5
- package/codeyam-cli/src/utils/project.js.map +1 -1
- package/codeyam-cli/src/utils/scenarioMarkers.js +134 -0
- package/codeyam-cli/src/utils/scenarioMarkers.js.map +1 -0
- package/codeyam-cli/src/utils/scenariosManifest.js +112 -0
- package/codeyam-cli/src/utils/scenariosManifest.js.map +1 -0
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +46 -16
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
- package/codeyam-cli/src/utils/testRunner.js +1 -1
- package/codeyam-cli/src/utils/testRunner.js.map +1 -1
- package/codeyam-cli/src/utils/webappDetection.js +21 -0
- package/codeyam-cli/src/utils/webappDetection.js.map +1 -1
- package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js +410 -0
- package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js.map +1 -0
- package/codeyam-cli/src/webserver/app/lib/database.js +41 -27
- package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
- package/codeyam-cli/src/webserver/app/lib/git.js +396 -0
- package/codeyam-cli/src/webserver/app/lib/git.js.map +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{CopyButton-DmJveP3T.js → CopyButton-BPXZwM4t.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-C76mRRiF.js → EntityItem-BcgbViKV.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-CobE682z.js → EntityTypeIcon-CQIG2qda.js} +9 -9
- package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-djPLI-WV.js → ReportIssueModal-BzHcG7SE.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-B76aig_2.js → ScenarioViewer-0DY_NKil.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/ViewportInspectBar-oAf2Kqsf.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{_index-C96V0n15.js → _index-DLxKhri3.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-BpKzcsJz.js → activity.(_tab)-BcY3q6nt.js} +6 -6
- package/codeyam-cli/src/webserver/build/client/assets/addon-canvas-DpzMmAy5.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/addon-fit-YJmn1quW.js +12 -0
- package/codeyam-cli/src/webserver/build/client/assets/addon-webgl-DI8QOUvO.js +58 -0
- package/codeyam-cli/src/webserver/build/client/assets/{agent-transcripts-D9hemwl6.js → agent-transcripts-Bni3iiUj.js} +5 -5
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-audit-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-file-diff-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-file-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-load-commit-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-project-info-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenarios-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{book-open-D_nMCFmP.js → book-open-BYOypzCa.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-BH2h1Ea2.js → chevron-down-C_Pmso5S.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{circle-check-DyIKORY6.js → circle-check-BVMi9VA5.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{copy-NDbZjXao.js → copy-n2FB0_Sw.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-CC6AbExI.js +41 -0
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-Csi0_PMl.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/editor-pyT-NAuu.js +10 -0
- package/codeyam-cli/src/webserver/build/client/assets/editorPreview-BLQMSKZa.js +41 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-CrjR3zZW.js → entity._sha._-BF4oLwaE.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-C7YX6r3H.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-CF164ouH.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/{files-DO4CZ16O.js → files-BZrlFE1F.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/git-DdZcvjGh.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/globals-BkWJ_UNc.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/index-yHOVb4rc.js +15 -0
- package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-BAXYRVEO.js → loader-circle-DaAZ_H2w.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/manifest-753dd058.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{memory-FweZHj5U.js → memory-Bl2rpw8u.js} +13 -10
- package/codeyam-cli/src/webserver/build/client/assets/{pause-DTAcYxBt.js → pause-f5-1lKBt.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/{root-Dzn8nIkU.js → root-B_X8HS1x.js} +15 -15
- package/codeyam-cli/src/webserver/build/client/assets/{search-fKo7v0Zo.js → search-Di64LWVb.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{settings-DfuTtcJP.js → settings-0OrEMU6J.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{simulations-B3aOzpCZ.js → simulations-DWT-CvLy.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{terminal-BG4heKCG.js → terminal-Br7MOqts.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-DtSmdtM4.js → triangle-alert-BLdiCuG-.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-CrAK28Bc.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/xterm-BqvuqXEL.js +27 -0
- package/codeyam-cli/src/webserver/build/server/assets/{index-DeSuKbSF.js → index-Dp5Hp9wV.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-DpDPLKrh.js +416 -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 +557 -50
- package/codeyam-cli/src/webserver/editorProxy.js.map +1 -1
- package/codeyam-cli/src/webserver/scripts/codeyam-preload.mjs +414 -0
- package/codeyam-cli/src/webserver/scripts/journalCapture.ts +118 -9
- package/codeyam-cli/src/webserver/server.js +93 -12
- package/codeyam-cli/src/webserver/server.js.map +1 -1
- package/codeyam-cli/src/webserver/terminalServer.js +131 -11
- package/codeyam-cli/src/webserver/terminalServer.js.map +1 -1
- package/codeyam-cli/templates/chrome-extension-react/EXTENSION_SETUP.md +75 -0
- package/codeyam-cli/templates/chrome-extension-react/gitignore +15 -0
- package/codeyam-cli/templates/chrome-extension-react/index.html +12 -0
- package/codeyam-cli/templates/chrome-extension-react/package.json +26 -0
- package/codeyam-cli/templates/chrome-extension-react/popup.html +12 -0
- package/codeyam-cli/templates/chrome-extension-react/public/manifest.json +15 -0
- package/codeyam-cli/templates/chrome-extension-react/src/background/service-worker.ts +7 -0
- package/codeyam-cli/templates/chrome-extension-react/src/globals.css +6 -0
- package/codeyam-cli/templates/chrome-extension-react/src/lib/storage.ts +37 -0
- package/codeyam-cli/templates/chrome-extension-react/src/popup/App.tsx +12 -0
- package/codeyam-cli/templates/chrome-extension-react/src/popup/main.tsx +10 -0
- package/codeyam-cli/templates/chrome-extension-react/tsconfig.json +24 -0
- package/codeyam-cli/templates/chrome-extension-react/vite.config.ts +41 -0
- package/codeyam-cli/templates/editor-step-hook.py +108 -20
- package/codeyam-cli/templates/expo-react-native/MOBILE_SETUP.md +89 -0
- package/codeyam-cli/templates/expo-react-native/app/(tabs)/_layout.tsx +33 -0
- package/codeyam-cli/templates/expo-react-native/app/(tabs)/index.tsx +12 -0
- package/codeyam-cli/templates/expo-react-native/app/(tabs)/settings.tsx +12 -0
- package/codeyam-cli/templates/expo-react-native/app/_layout.tsx +12 -0
- package/codeyam-cli/templates/expo-react-native/app.json +18 -0
- package/codeyam-cli/templates/expo-react-native/babel.config.js +9 -0
- package/codeyam-cli/templates/expo-react-native/gitignore +12 -0
- package/codeyam-cli/templates/expo-react-native/global.css +3 -0
- package/codeyam-cli/templates/expo-react-native/lib/storage.ts +32 -0
- package/codeyam-cli/templates/expo-react-native/metro.config.js +6 -0
- package/codeyam-cli/templates/expo-react-native/nativewind-env.d.ts +1 -0
- package/codeyam-cli/templates/expo-react-native/package.json +37 -0
- package/codeyam-cli/templates/expo-react-native/tailwind.config.js +10 -0
- package/codeyam-cli/templates/expo-react-native/tsconfig.json +10 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/AUTH_PATTERNS.md +308 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/AUTH_UPGRADE.md +304 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/DATABASE.md +112 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/FEATURE_PATTERNS.md +37 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/app/codeyam-isolate/layout.tsx +12 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/app/lib/prisma.ts +9 -4
- package/codeyam-cli/templates/nextjs-prisma-sqlite/env +4 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/gitignore +64 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/package.json +4 -1
- package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma/seed.ts +4 -1
- package/codeyam-cli/templates/nextjs-prisma-sqlite/seed-adapter.ts +92 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/vitest.config.ts +13 -0
- package/codeyam-cli/templates/{nextjs-prisma-sqlite/PRISMA_SETUP.md → nextjs-prisma-supabase/SUPABASE_SETUP.md} +37 -17
- package/codeyam-cli/templates/nextjs-prisma-supabase/app/api/todos/route.ts +17 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/app/globals.css +26 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/app/layout.tsx +34 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/app/lib/prisma.ts +20 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/app/lib/supabase.ts +12 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/app/page.tsx +10 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/env +9 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/eslint.config.mjs +11 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/gitignore +40 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/next.config.ts +11 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/package.json +36 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/postcss.config.mjs +7 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/prisma/schema.prisma +27 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/prisma/seed.ts +39 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/prisma.config.ts +12 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/tsconfig.json +34 -0
- package/codeyam-cli/templates/{codeyam-dev-mode.md → skills/codeyam-dev-mode/SKILL.md} +2 -2
- package/codeyam-cli/templates/skills/codeyam-editor/SKILL.md +145 -0
- package/codeyam-cli/templates/{codeyam-memory.md → skills/codeyam-memory/SKILL.md} +215 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/deprecated-prompt.md +100 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/detect-deprecated-patterns.mjs +139 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/find-exports.mjs +52 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/misleading-api-prompt.md +117 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/read-json-field.mjs +61 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/ripgrep-fallback.mjs +155 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/analyze-prompt.md +46 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/cleanup.mjs +13 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/filter-session.mjs +95 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/preprocess.mjs +160 -0
- package/package.json +15 -10
- package/packages/ai/src/lib/generateExecutionFlows.js +0 -11
- package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -1
- package/packages/analyze/src/lib/ProjectAnalyzer.js +10 -4
- package/packages/analyze/src/lib/ProjectAnalyzer.js.map +1 -1
- package/packages/analyze/src/lib/asts/index.js +4 -2
- package/packages/analyze/src/lib/asts/index.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js +0 -40
- package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js.map +1 -1
- package/packages/database/src/lib/kysely/tables/editorScenariosTable.js +20 -0
- package/packages/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -1
- package/packages/types/src/enums/ProjectFramework.js +2 -0
- package/packages/types/src/enums/ProjectFramework.js.map +1 -1
- package/scripts/npm-post-install.cjs +34 -0
- package/codeyam-cli/src/webserver/build/client/assets/Terminal-BaIiqg_w.js +0 -41
- package/codeyam-cli/src/webserver/build/client/assets/addon-fit-CUXOrorO.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-CMT1jU2q.js +0 -21
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-BiM6z3Do.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/editor-BaC8lHDG.js +0 -7
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-DloHYjtt.js +0 -6
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-C28BiQzt.js +0 -6
- package/codeyam-cli/src/webserver/build/client/assets/git-CFCTYk9I.js +0 -15
- package/codeyam-cli/src/webserver/build/client/assets/globals-BH6uYxPM.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-fb3128c3.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-ByhSyh0W.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/xterm-DMSzMhqy.js +0 -9
- package/codeyam-cli/src/webserver/build/server/assets/server-build-BbQ8YBP-.js +0 -362
- package/codeyam-cli/templates/codeyam-editor.md +0 -67
- package/scripts/finalize-analyzer.cjs +0 -13
- /package/codeyam-cli/templates/{codeyam-diagnose.md → commands/codeyam-diagnose.md} +0 -0
- /package/codeyam-cli/templates/{codeyam-debug.md → skills/codeyam-debug/SKILL.md} +0 -0
- /package/codeyam-cli/templates/{codeyam-new-rule.md → skills/codeyam-new-rule/SKILL.md} +0 -0
- /package/codeyam-cli/templates/{codeyam-setup.md → skills/codeyam-setup/SKILL.md} +0 -0
- /package/codeyam-cli/templates/{codeyam-sim.md → skills/codeyam-sim/SKILL.md} +0 -0
- /package/codeyam-cli/templates/{codeyam-test.md → skills/codeyam-test/SKILL.md} +0 -0
- /package/codeyam-cli/templates/{codeyam-verify.md → skills/codeyam-verify/SKILL.md} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateExecutionFlows.js","sourceRoot":"","sources":["../../../../../../../../packages/analyze/src/lib/files/scenarios/generateExecutionFlows.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,qBAAqB,GAEtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,6BAA6B,MAAM,2CAA2C,CAAC;AACtF,OAAO,EAEL,sBAAsB,IAAI,yBAAyB,GACpD,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAW5D,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,sBAAsB,CAAC,EACnD,MAAM,EACN,QAAQ,EACR,KAAK,EACL,cAAc,EACd,iBAAiB,GACU;;IAC3B,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC;QAAE,OAAO;IAE/D,2EAA2E;IAC3E,MAAM,SAAS,GAAG;QAChB,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC,sBAAsB,EAAE,SAAS,IAAI,EAAE;QACpE,YAAY,EAAE,kBAAkB,CAAC,QAAQ,EAAE,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC;KAC5D,CAAC;IAEF,MAAM,CAAC,mCAAmC,EAAE;QAC1C,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,UAAU,EAAE,MAAM,CAAC,IAAI;KACxB,CAAC,CAAC;IAEH,IACE,CAAC,SAAS;QACV,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,MAAM,KAAK,CAAC;YACrD,CAAC,SAAS,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,EAC3C,CAAC;QACD,yDAAyD;QACzD,4DAA4D;QAC5D,QAAQ,CAAC,SAAS,GAAG;YACnB;gBACE,SAAS,EAAE,QAAQ,CAAC,SAAS;gBAC7B,UAAU,EAAE,QAAQ,CAAC,EAAE;gBACvB,IAAI,EAAE,qBAAqB;gBAC3B,WAAW,EAAE,kDAAkD;gBAC/D,QAAQ,EAAE;oBACR,QAAQ,EAAE,yBAAyB;oBACnC,YAAY,EAAE,EAAE;iBACjB;aACF;SACF,CAAC;QAEF,OAAO;IACT,CAAC;IAED,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC;QACtC,
|
|
1
|
+
{"version":3,"file":"generateExecutionFlows.js","sourceRoot":"","sources":["../../../../../../../../packages/analyze/src/lib/files/scenarios/generateExecutionFlows.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,qBAAqB,GAEtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,6BAA6B,MAAM,2CAA2C,CAAC;AACtF,OAAO,EAEL,sBAAsB,IAAI,yBAAyB,GACpD,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAW5D,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,sBAAsB,CAAC,EACnD,MAAM,EACN,QAAQ,EACR,KAAK,EACL,cAAc,EACd,iBAAiB,GACU;;IAC3B,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC;QAAE,OAAO;IAE/D,2EAA2E;IAC3E,MAAM,SAAS,GAAG;QAChB,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC,sBAAsB,EAAE,SAAS,IAAI,EAAE;QACpE,YAAY,EAAE,kBAAkB,CAAC,QAAQ,EAAE,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC;KAC5D,CAAC;IAEF,MAAM,CAAC,mCAAmC,EAAE;QAC1C,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,UAAU,EAAE,MAAM,CAAC,IAAI;KACxB,CAAC,CAAC;IAEH,IACE,CAAC,SAAS;QACV,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,MAAM,KAAK,CAAC;YACrD,CAAC,SAAS,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,EAC3C,CAAC;QACD,yDAAyD;QACzD,4DAA4D;QAC5D,QAAQ,CAAC,SAAS,GAAG;YACnB;gBACE,SAAS,EAAE,QAAQ,CAAC,SAAS;gBAC7B,UAAU,EAAE,QAAQ,CAAC,EAAE;gBACvB,IAAI,EAAE,qBAAqB;gBAC3B,WAAW,EAAE,kDAAkD;gBAC/D,QAAQ,EAAE;oBACR,QAAQ,EAAE,yBAAyB;oBACnC,YAAY,EAAE,EAAE;iBACjB;aACF;SACF,CAAC;QAEF,OAAO;IACT,CAAC;IAED,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC;QACtC,0EAA0E;QAC1E,yFAAyF;QACzF,MAAM,mBAAmB,GAAG,wBAAwB,CAClD,MAAM,EACN,iBAAiB,CAClB,CAAC;QAEF,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,MAAM,CAAC;QAC3D,MAAM,EACJ,MAAM,EAAE,EAAE,cAAc,EAAE,OAAO,EAAE,qBAAqB,EAAE,GAC3D,GAAG,MAAM,6BAA6B,CACrC,GAAG,EAAE,CACH,yBAAyB,CAAC;YACxB,MAAM;YACN,mBAAmB,EAAE,QAAQ,CAAC,QAAQ,CAAC,mBAAmB;YAC1D,KAAK;YACL,mBAAmB,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS;SACtE,CAAC,EACJ,4BAA4B,EAC5B,cAAc,CACf,CAAC;QAEF,QAAQ,CAAC,QAAQ,CAAC,cAAc,GAAG,cAAc,CAAC;QAElD,IAAI,qBAAqB,EAAE,CAAC;YAC1B,MAAA,QAAQ,CAAC,QAAQ,EAAC,QAAQ,QAAR,QAAQ,GAAK,EAAE,EAAC;YAClC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC;gBAC9B,IAAI,EAAE,wBAAwB;gBAC9B,EAAE,EAAE,qBAAqB,CAAC,EAAE;aAC7B,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CACtC,MAAc,EACd,iBAAuC;IAEvC,MAAM,mBAAmB,GAAuC,EAAE,CAAC;IAEnE,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IAED,MAAM,6BAA6B,GACjC,MAAM,CAAC,QAAQ,EAAE,qBAAqB,EAAE,6BAA6B,CAAC;IAExE,IAAI,CAAC,6BAA6B,EAAE,CAAC;QACnC,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;IAC9D,MAAM,eAAe,GAAG,MAAM,CAAC,QAAQ,EAAE,eAAe,IAAI,EAAE,CAAC;IAE/D,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,yDAAyD;QACzD,MAAM,cAAc,GAAG,eAAe,CAAC,IAAI,CACzC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,KAAK,SAAS,IAAI,EAAE,CAAC,YAAY,KAAK,SAAS,CAC/D,CAAC;QAEF,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,SAAS;QACX,CAAC;QAED,sEAAsE;QACtE,MAAM,UAAU,GACd,cAAc,CAAC,gBAAgB,IAAI,cAAc,CAAC,QAAQ,CAAC;QAC7D,MAAM,UAAU,GAAG,cAAc,CAAC,YAAY,IAAI,cAAc,CAAC,IAAI,CAAC;QAEtE,oDAAoD;QACpD,MAAM,aAAa,GAAG,iBAAiB,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC;QAElE,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,SAAS;QACX,CAAC;QAED,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC;YACpC,SAAS;QACX,CAAC;QAED,4CAA4C;QAC5C,MAAM,aAAa,GAAG,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,CAAC;QAC1E,MAAM,sBAAsB,GAAG,aAAa,EAAE,iBAAiB,IAAI,EAAE,CAAC;QACtE,MAAM,qBAAqB,GAAG,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,MAAM,CAAC;QAEzE,iEAAiE;QACjE,mBAAmB,CAAC,SAAS,CAAC,GAAG,aAAa,CAAC,MAAM;aAClD,QAA8B,CAAC;IACpC,CAAC;IAED,OAAO,mBAAmB,CAAC;AAC7B,CAAC"}
|
|
@@ -6,7 +6,11 @@ const editorScenariosSchema = {
|
|
|
6
6
|
description: schemaField(),
|
|
7
7
|
component_name: schemaField(),
|
|
8
8
|
component_path: schemaField(),
|
|
9
|
+
url: schemaField(),
|
|
10
|
+
type: schemaField(),
|
|
9
11
|
screenshot_path: schemaField(),
|
|
12
|
+
viewport_width: schemaField(),
|
|
13
|
+
viewport_height: schemaField(),
|
|
10
14
|
created_at: schemaField(),
|
|
11
15
|
updated_at: schemaField(),
|
|
12
16
|
};
|
|
@@ -20,6 +24,8 @@ export async function createEditorScenariosTable(db) {
|
|
|
20
24
|
.addColumn('description', 'text')
|
|
21
25
|
.addColumn('component_name', 'varchar')
|
|
22
26
|
.addColumn('component_path', 'varchar')
|
|
27
|
+
.addColumn('url', 'varchar')
|
|
28
|
+
.addColumn('type', 'varchar')
|
|
23
29
|
.addColumn('screenshot_path', 'varchar')
|
|
24
30
|
.addColumn('created_at', 'datetime', defaultNow(true))
|
|
25
31
|
.addColumn('updated_at', 'datetime', defaultNow(true))
|
|
@@ -29,6 +35,8 @@ export async function createEditorScenariosTable(db) {
|
|
|
29
35
|
for (const col of [
|
|
30
36
|
'component_name',
|
|
31
37
|
'component_path',
|
|
38
|
+
'url',
|
|
39
|
+
'type',
|
|
32
40
|
'screenshot_path',
|
|
33
41
|
]) {
|
|
34
42
|
try {
|
|
@@ -41,5 +49,17 @@ export async function createEditorScenariosTable(db) {
|
|
|
41
49
|
// Column already exists — expected for fresh databases
|
|
42
50
|
}
|
|
43
51
|
}
|
|
52
|
+
// Integer columns for viewport dimensions
|
|
53
|
+
for (const col of ['viewport_width', 'viewport_height']) {
|
|
54
|
+
try {
|
|
55
|
+
await db.schema
|
|
56
|
+
.alterTable('editor_scenarios')
|
|
57
|
+
.addColumn(col, 'integer')
|
|
58
|
+
.execute();
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
// Column already exists — expected for fresh databases
|
|
62
|
+
}
|
|
63
|
+
}
|
|
44
64
|
}
|
|
45
65
|
//# sourceMappingURL=editorScenariosTable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editorScenariosTable.js","sourceRoot":"","sources":["../../../../../../../../packages/database/src/lib/kysely/tables/editorScenariosTable.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE3D,MAAM,qBAAqB,GAAG;IAC5B,EAAE,EAAE,WAAW,EAAqB;IACpC,UAAU,EAAE,WAAW,EAAU;IACjC,IAAI,EAAE,WAAW,EAAU;IAC3B,WAAW,EAAE,WAAW,EAAiB;IACzC,cAAc,EAAE,WAAW,EAAiB;IAC5C,cAAc,EAAE,WAAW,EAAiB;IAC5C,eAAe,EAAE,WAAW,EAAiB;IAC7C,UAAU,EAAE,WAAW,EAAqB;IAC5C,UAAU,EAAE,WAAW,EAAqB;CACpC,CAAC;AAMX,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC,IAAI,CACpD,qBAAqB,CACY,CAAC;AAEpC,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,EAAe;IAEf,MAAM,EAAE,CAAC,MAAM;SACZ,WAAW,CAAC,kBAAkB,CAAC;SAC/B,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,GAA4B,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC;SAC3E,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC,GAA4B,EAAE,EAAE,CAChE,GAAG,CAAC,OAAO,EAAE,CACd;SACA,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,GAA4B,EAAE,EAAE,CAC7D,GAAG,CAAC,OAAO,EAAE,CACd;SACA,SAAS,CAAC,aAAa,EAAE,MAAM,CAAC;SAChC,SAAS,CAAC,gBAAgB,EAAE,SAAS,CAAC;SACtC,SAAS,CAAC,gBAAgB,EAAE,SAAS,CAAC;SACtC,SAAS,CAAC,iBAAiB,EAAE,SAAS,CAAC;SACvC,SAAS,CAAC,YAAY,EAAE,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;SACrD,SAAS,CAAC,YAAY,EAAE,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;SACrD,WAAW,EAAE;SACb,OAAO,EAAE,CAAC;IAEb,8EAA8E;IAC9E,KAAK,MAAM,GAAG,IAAI;QAChB,gBAAgB;QAChB,gBAAgB;QAChB,iBAAiB;KACT,EAAE,CAAC;QACX,IAAI,CAAC;YACH,MAAM,EAAE,CAAC,MAAM;iBACZ,UAAU,CAAC,kBAAkB,CAAC;iBAC9B,SAAS,CAAC,GAAG,EAAE,SAAS,CAAC;iBACzB,OAAO,EAAE,CAAC;QACf,CAAC;QAAC,MAAM,CAAC;YACP,uDAAuD;QACzD,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
1
|
+
{"version":3,"file":"editorScenariosTable.js","sourceRoot":"","sources":["../../../../../../../../packages/database/src/lib/kysely/tables/editorScenariosTable.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE3D,MAAM,qBAAqB,GAAG;IAC5B,EAAE,EAAE,WAAW,EAAqB;IACpC,UAAU,EAAE,WAAW,EAAU;IACjC,IAAI,EAAE,WAAW,EAAU;IAC3B,WAAW,EAAE,WAAW,EAAiB;IACzC,cAAc,EAAE,WAAW,EAAiB;IAC5C,cAAc,EAAE,WAAW,EAAiB;IAC5C,GAAG,EAAE,WAAW,EAAiB;IACjC,IAAI,EAAE,WAAW,EAAiB;IAClC,eAAe,EAAE,WAAW,EAAiB;IAC7C,cAAc,EAAE,WAAW,EAAiB;IAC5C,eAAe,EAAE,WAAW,EAAiB;IAC7C,UAAU,EAAE,WAAW,EAAqB;IAC5C,UAAU,EAAE,WAAW,EAAqB;CACpC,CAAC;AAMX,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC,IAAI,CACpD,qBAAqB,CACY,CAAC;AAEpC,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,EAAe;IAEf,MAAM,EAAE,CAAC,MAAM;SACZ,WAAW,CAAC,kBAAkB,CAAC;SAC/B,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,GAA4B,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC;SAC3E,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC,GAA4B,EAAE,EAAE,CAChE,GAAG,CAAC,OAAO,EAAE,CACd;SACA,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,GAA4B,EAAE,EAAE,CAC7D,GAAG,CAAC,OAAO,EAAE,CACd;SACA,SAAS,CAAC,aAAa,EAAE,MAAM,CAAC;SAChC,SAAS,CAAC,gBAAgB,EAAE,SAAS,CAAC;SACtC,SAAS,CAAC,gBAAgB,EAAE,SAAS,CAAC;SACtC,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC;SAC3B,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC;SAC5B,SAAS,CAAC,iBAAiB,EAAE,SAAS,CAAC;SACvC,SAAS,CAAC,YAAY,EAAE,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;SACrD,SAAS,CAAC,YAAY,EAAE,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;SACrD,WAAW,EAAE;SACb,OAAO,EAAE,CAAC;IAEb,8EAA8E;IAC9E,KAAK,MAAM,GAAG,IAAI;QAChB,gBAAgB;QAChB,gBAAgB;QAChB,KAAK;QACL,MAAM;QACN,iBAAiB;KACT,EAAE,CAAC;QACX,IAAI,CAAC;YACH,MAAM,EAAE,CAAC,MAAM;iBACZ,UAAU,CAAC,kBAAkB,CAAC;iBAC9B,SAAS,CAAC,GAAG,EAAE,SAAS,CAAC;iBACzB,OAAO,EAAE,CAAC;QACf,CAAC;QAAC,MAAM,CAAC;YACP,uDAAuD;QACzD,CAAC;IACH,CAAC;IAED,0CAA0C;IAC1C,KAAK,MAAM,GAAG,IAAI,CAAC,gBAAgB,EAAE,iBAAiB,CAAU,EAAE,CAAC;QACjE,IAAI,CAAC;YACH,MAAM,EAAE,CAAC,MAAM;iBACZ,UAAU,CAAC,kBAAkB,CAAC;iBAC9B,SAAS,CAAC,GAAG,EAAE,SAAS,CAAC;iBACzB,OAAO,EAAE,CAAC;QACf,CAAC;QAAC,MAAM,CAAC;YACP,uDAAuD;QACzD,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -5,6 +5,8 @@ export var ProjectFramework;
|
|
|
5
5
|
ProjectFramework["CRA"] = "CRA";
|
|
6
6
|
ProjectFramework["Next"] = "Next";
|
|
7
7
|
ProjectFramework["NextPages"] = "NextPages";
|
|
8
|
+
ProjectFramework["Vite"] = "Vite";
|
|
9
|
+
ProjectFramework["Expo"] = "Expo";
|
|
8
10
|
ProjectFramework["Unknown"] = "Unknown";
|
|
9
11
|
})(ProjectFramework || (ProjectFramework = {}));
|
|
10
12
|
//# sourceMappingURL=ProjectFramework.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectFramework.js","sourceRoot":"","sources":["../../../../../../packages/types/src/enums/ProjectFramework.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"ProjectFramework.js","sourceRoot":"","sources":["../../../../../../packages/types/src/enums/ProjectFramework.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,gBASX;AATD,WAAY,gBAAgB;IAC1B,mCAAe,CAAA;IACf,uCAAmB,CAAA;IACnB,+BAAW,CAAA;IACX,iCAAa,CAAA;IACb,2CAAuB,CAAA;IACvB,iCAAa,CAAA;IACb,iCAAa,CAAA;IACb,uCAAmB,CAAA;AACrB,CAAC,EATW,gBAAgB,KAAhB,gBAAgB,QAS3B"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Post-install script — we used to finalize the CodeYam analyzer here,
|
|
5
|
+
* but that is now deferred to the `codeyam setup-simulations` step.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const fs = require('fs');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
|
|
11
|
+
// On macOS/Linux, ensure node-pty spawn-helper binaries are executable.
|
|
12
|
+
// This is a no-op on Windows where chmod isn't needed.
|
|
13
|
+
if (process.platform !== 'win32') {
|
|
14
|
+
const spawnHelpers = [
|
|
15
|
+
'node_modules/node-pty/prebuilds/darwin-arm64/spawn-helper',
|
|
16
|
+
'node_modules/node-pty/prebuilds/darwin-x64/spawn-helper',
|
|
17
|
+
];
|
|
18
|
+
for (const helper of spawnHelpers) {
|
|
19
|
+
const fullPath = path.join(__dirname, '..', helper);
|
|
20
|
+
if (fs.existsSync(fullPath)) {
|
|
21
|
+
try {
|
|
22
|
+
fs.chmodSync(fullPath, 0o755);
|
|
23
|
+
} catch {
|
|
24
|
+
// Best-effort — don't fail the install
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
console.error('');
|
|
31
|
+
console.error(' CodeYam CLI installed successfully!');
|
|
32
|
+
console.error('');
|
|
33
|
+
console.error(" Type 'codeyam' in your project directory to get started.");
|
|
34
|
+
console.error('');
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/xterm-DMSzMhqy.js","assets/chunk-JZWAC4HX-C4pqxYJB.js","assets/addon-fit-CUXOrorO.js","assets/addon-web-links-Duc5hnl7.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r,j as n}from"./chunk-JZWAC4HX-C4pqxYJB.js";import{_ as D}from"./preload-helper-ckwbz45p.js";function K({serverUrl:p,isStarting:j,projectSlug:h,devServerError:S,onStartServer:g}){const[w,y]=r.useState(null),d=r.useRef(null);r.useEffect(()=>{if(!h)return;const N=new EventSource("/api/dev-mode-events");return N.onmessage=R=>{try{const m=JSON.parse(R.data);m.type==="file-synced"&&(y(m.fileName),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{y(null)},5e3))}catch{}},()=>{N.close(),d.current&&clearTimeout(d.current)}},[h]);let i;S?i="error":j?i="starting":p?i="running":i="stopped";const b={starting:"bg-yellow-400",running:"bg-green-400",stopped:"bg-gray-400",error:"bg-red-400"},O={starting:"Starting...",running:p||"Running",stopped:"Stopped",error:"Error"};return n.jsxs("div",{className:"bg-[#1e1e1e] border-t border-[#3d3d3d] h-7 flex items-center px-4 gap-4 shrink-0 text-xs font-mono",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:`w-2 h-2 rounded-full ${b[i]}`}),n.jsxs("span",{className:"text-gray-400",children:["Server:"," ",n.jsx("span",{className:"text-gray-300",children:O[i]})]}),(i==="stopped"||i==="error")&&g&&n.jsx("button",{onClick:g,className:"ml-1 px-2.5 py-0.5 bg-[#005c75] hover:bg-[#007a9a] text-white text-[11px] font-medium rounded transition-colors cursor-pointer border-none leading-tight",children:"Start Server"})]}),n.jsx("div",{className:"w-px h-3 bg-[#3d3d3d]"}),w&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#4ade80",strokeWidth:"2",children:n.jsx("path",{d:"M20 6L9 17l-5-5"})}),n.jsxs("span",{className:"text-green-400",children:["Synced: ",w]})]}),n.jsx("div",{className:"w-px h-3 bg-[#3d3d3d]"})]}),n.jsx("div",{className:"flex-1"}),n.jsx("span",{className:"text-gray-500",children:"Claude edits auto-sync to preview via HMR"})]})}const q=`
|
|
3
|
-
.xterm { cursor: text; position: relative; user-select: none; -ms-user-select: none; -webkit-user-select: none; }
|
|
4
|
-
.xterm.focus, .xterm:focus { outline: none; }
|
|
5
|
-
.xterm .xterm-helpers { position: absolute; top: 0; z-index: 5; }
|
|
6
|
-
.xterm .xterm-helper-textarea { padding: 0; border: 0; margin: 0; position: absolute; opacity: 0; left: -9999em; top: 0; width: 0; height: 0; z-index: -5; white-space: nowrap; overflow: hidden; resize: none; }
|
|
7
|
-
.xterm .composition-view { background: #000; color: #FFF; display: none; position: absolute; white-space: nowrap; z-index: 1; }
|
|
8
|
-
.xterm .composition-view.active { display: block; }
|
|
9
|
-
.xterm .xterm-viewport { background-color: #000; overflow-y: scroll; cursor: default; position: absolute; right: 0; left: 0; top: 0; bottom: 0; }
|
|
10
|
-
.xterm .xterm-screen { position: relative; }
|
|
11
|
-
.xterm .xterm-screen canvas { position: absolute; left: 0; top: 0; }
|
|
12
|
-
.xterm .xterm-scroll-area { visibility: hidden; }
|
|
13
|
-
.xterm-char-measure-element { display: inline-block; visibility: hidden; position: absolute; top: 0; left: -9999em; line-height: normal; }
|
|
14
|
-
.xterm.enable-mouse-events { cursor: default; }
|
|
15
|
-
.xterm.xterm-cursor-pointer, .xterm .xterm-cursor-pointer { cursor: pointer; }
|
|
16
|
-
.xterm.column-select.focus { cursor: crosshair; }
|
|
17
|
-
.xterm .xterm-accessibility:not(.debug), .xterm .xterm-message { position: absolute; left: 0; top: 0; bottom: 0; right: 0; z-index: 10; color: transparent; pointer-events: none; }
|
|
18
|
-
.xterm .xterm-accessibility-tree:not(.debug) *::selection { color: transparent; }
|
|
19
|
-
.xterm .xterm-accessibility-tree { user-select: text; white-space: pre; }
|
|
20
|
-
.xterm .live-region { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
|
|
21
|
-
.xterm-dim { opacity: 1 !important; }
|
|
22
|
-
.xterm-underline-1 { text-decoration: underline; }
|
|
23
|
-
.xterm-underline-2 { text-decoration: double underline; }
|
|
24
|
-
.xterm-underline-3 { text-decoration: wavy underline; }
|
|
25
|
-
.xterm-underline-4 { text-decoration: dotted underline; }
|
|
26
|
-
.xterm-underline-5 { text-decoration: dashed underline; }
|
|
27
|
-
.xterm-overline { text-decoration: overline; }
|
|
28
|
-
.xterm-strikethrough { text-decoration: line-through; }
|
|
29
|
-
.xterm-screen .xterm-decoration-container .xterm-decoration { z-index: 6; position: absolute; }
|
|
30
|
-
.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer { z-index: 7; }
|
|
31
|
-
.xterm-decoration-overview-ruler { z-index: 8; position: absolute; top: 0; right: 0; pointer-events: none; }
|
|
32
|
-
.xterm-decoration-top { z-index: 2; position: relative; }
|
|
33
|
-
`;function U(){if(document.getElementById("xterm-css"))return;const p=document.createElement("style");p.id="xterm-css",p.textContent=q,document.head.appendChild(p)}const Q=r.forwardRef(function({entityName:j,entityType:h,entitySha:S,entityFilePath:g,scenarioName:w,scenarioDescription:y,analysisId:d,projectSlug:i,onRefreshPreview:b,editorMode:O},N){const R=r.useRef(null),m=r.useRef(null),T=r.useRef(null),x=r.useRef(null),k=r.useRef(null),B=r.useRef(!1),E=r.useRef(0),z=r.useRef(!1),C=r.useRef(0),A=r.useRef(null),F=r.useRef(!1),I=r.useRef(!1),L=r.useCallback(()=>{var s;(s=T.current)==null||s.focus()},[]);return r.useImperativeHandle(N,()=>({sendInput(s){const f=x.current;f&&f.readyState===WebSocket.OPEN&&(f.send(JSON.stringify({type:"input",data:s})),setTimeout(()=>{f.readyState===WebSocket.OPEN&&f.send(JSON.stringify({type:"input",data:"\r"}))},100))},focus(){var s;(s=T.current)==null||s.focus()}})),r.useEffect(()=>{const s=R.current;if(!s)return;let f=!1;return U(),Promise.all([D(()=>import("./xterm-DMSzMhqy.js").then(a=>a.x),__vite__mapDeps([0,1])),D(()=>import("./addon-fit-CUXOrorO.js").then(a=>a.a),__vite__mapDeps([2,1])),D(()=>import("./addon-web-links-Duc5hnl7.js").then(a=>a.a),__vite__mapDeps([3,1]))]).then(([a,P,J])=>{if(f)return;const t=new a.Terminal({cursorBlink:!0,fontSize:13,fontFamily:"'IBM Plex Mono', 'Menlo', 'Monaco', monospace",theme:{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#d4d4d4",selectionBackground:"#264f78"}}),_=new P.FitAddon;t.loadAddon(_),t.loadAddon(new J.WebLinksAddon),t.open(s),_.fit(),T.current=t,t.focus(),setTimeout(()=>t.focus(),100),setTimeout(()=>t.focus(),500);const H=window.location.protocol==="https:"?"wss:":"ws:",$=window.location.host;function V(o){const e=new URLSearchParams;return e.set("entityName",j),h&&e.set("entityType",h),S&&e.set("entitySha",S),g&&e.set("entityFilePath",g),w&&e.set("scenarioName",w),y&&e.set("scenarioDescription",y),d&&e.set("analysisId",d),i&&e.set("projectSlug",i),O&&e.set("editorMode","true"),o&&e.set("reconnectId",o),`${H}//${$}/ws/terminal?${e.toString()}`}function M(o){const e=V(o),l=new WebSocket(e);x.current=l,l.onopen=()=>{E.current=0,z.current=!1,typeof Notification<"u"&&Notification.permission==="default"&&Notification.requestPermission(),l.send(JSON.stringify({type:"resize",cols:t.cols,rows:t.rows}))},l.onmessage=u=>{try{const c=JSON.parse(u.data);if(c.type==="session-id"){k.current=c.sessionId;return}if(c.type==="refresh-preview"){b==null||b();return}c.type==="output"&&(t.write(c.data),C.current=Date.now(),F.current=!0,I.current=!1)}catch{t.write(u.data)}},l.onclose=()=>{if(B.current){t.write(`\r
|
|
34
|
-
\x1B[90m[Terminal session ended]\x1B[0m\r
|
|
35
|
-
`);return}const u=E.current;if(u<5&&k.current){const c=1e3*Math.pow(2,Math.min(u,3));E.current=u+1,t.write(`\r
|
|
36
|
-
\x1B[33m[Reconnecting...]\x1B[0m\r
|
|
37
|
-
`),setTimeout(()=>{B.current||M(k.current)},c)}else z.current?t.write(`\r
|
|
38
|
-
\x1B[90m[Terminal session ended]\x1B[0m\r
|
|
39
|
-
`):(z.current=!0,t.write(`\r
|
|
40
|
-
\x1B[33m[Starting new session...]\x1B[0m\r
|
|
41
|
-
`),k.current=null,E.current=0,M())},l.onerror=()=>{}}M(),A.current=setInterval(()=>{if(F.current&&!I.current&&C.current>0&&Date.now()-C.current>3e4&&!document.hasFocus()&&(I.current=!0,typeof Notification<"u"&&Notification.permission==="granted")){const o=new Notification("Claude is ready for you",{body:"Claude has finished and is waiting for your input.",tag:"claude-idle"});o.onclick=()=>{window.focus(),o.close()}}},5e3),t.onData(o=>{const e=x.current;e&&e.readyState===WebSocket.OPEN&&e.send(JSON.stringify({type:"input",data:o}))});let v=null;const W=new ResizeObserver(()=>{v&&clearTimeout(v),v=setTimeout(()=>{const o=_.proposeDimensions();if(!o||o.cols===t.cols&&o.rows===t.rows)return;const e=s.querySelector(".xterm-viewport");let l,u=!0;e&&(l=e.scrollTop,u=e.scrollTop+e.clientHeight>=e.scrollHeight-10),_.fit(),e&&l!==void 0&&!u&&(e.scrollTop=l);const c=x.current;c&&c.readyState===WebSocket.OPEN&&c.send(JSON.stringify({type:"resize",cols:t.cols,rows:t.rows}))},150)});W.observe(s),m.current=()=>{var o;v&&clearTimeout(v),A.current&&clearInterval(A.current),W.disconnect(),B.current=!0,(o=x.current)==null||o.close(),x.current=null,t.dispose(),T.current=null}}),()=>{var a;f=!0,(a=m.current)==null||a.call(m),m.current=null}},[]),n.jsx("div",{ref:R,onClick:L,className:"w-full h-full",style:{padding:"4px 0 0 8px"}})});export{K as D,Q as T};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g}from"./chunk-JZWAC4HX-C4pqxYJB.js";function _(i,s){for(var o=0;o<s.length;o++){const t=s[o];if(typeof t!="string"&&!Array.isArray(t)){for(const e in t)if(e!=="default"&&!(e in i)){const r=Object.getOwnPropertyDescriptor(t,e);r&&Object.defineProperty(i,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}var a={exports:{}},d;function y(){return d||(d=1,(function(i,s){(function(o,t){i.exports=t()})(self,(()=>(()=>{var o={};return(()=>{var t=o;Object.defineProperty(t,"__esModule",{value:!0}),t.FitAddon=void 0,t.FitAddon=class{activate(e){this._terminal=e}dispose(){}fit(){const e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;const r=this._terminal._core;this._terminal.rows===e.rows&&this._terminal.cols===e.cols||(r._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const e=this._terminal._core,r=e._renderService.dimensions;if(r.css.cell.width===0||r.css.cell.height===0)return;const c=this._terminal.options.scrollback===0?0:e.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),m=parseInt(l.getPropertyValue("height")),u=Math.max(0,parseInt(l.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),h=m-(parseInt(n.getPropertyValue("padding-top"))+parseInt(n.getPropertyValue("padding-bottom"))),f=u-(parseInt(n.getPropertyValue("padding-right"))+parseInt(n.getPropertyValue("padding-left")))-c;return{cols:Math.max(2,Math.floor(f/r.css.cell.width)),rows:Math.max(1,Math.floor(h/r.css.cell.height))}}}})(),o})()))})(a)),a.exports}var p=y();const w=g(p),x=_({__proto__:null,default:w},[p]);export{x as a};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import{r as s}from"./chunk-JZWAC4HX-C4pqxYJB.js";/**
|
|
2
|
-
* @license lucide-react v0.556.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const C=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),w=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,o)=>o?o.toUpperCase():r.toLowerCase()),i=t=>{const e=w(t);return e.charAt(0).toUpperCase()+e.slice(1)},l=(...t)=>t.filter((e,r,o)=>!!e&&e.trim()!==""&&o.indexOf(e)===r).join(" ").trim(),f=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};/**
|
|
7
|
-
* @license lucide-react v0.556.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/var h={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
12
|
-
* @license lucide-react v0.556.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const g=s.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:n="",children:a,iconNode:u,...c},p)=>s.createElement("svg",{ref:p,...h,width:e,height:e,stroke:t,strokeWidth:o?Number(r)*24/Number(e):r,className:l("lucide",n),...!a&&!f(c)&&{"aria-hidden":"true"},...c},[...u.map(([m,d])=>s.createElement(m,d)),...Array.isArray(a)?a:[a]]));/**
|
|
17
|
-
* @license lucide-react v0.556.0 - ISC
|
|
18
|
-
*
|
|
19
|
-
* This source code is licensed under the ISC license.
|
|
20
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const b=(t,e)=>{const r=s.forwardRef(({className:o,...n},a)=>s.createElement(g,{ref:a,iconNode:e,className:l(`lucide-${C(i(t))}`,`lucide-${t}`,o),...n}));return r.displayName=i(t),r};export{b as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{w as t,d as r,j as e}from"./chunk-JZWAC4HX-C4pqxYJB.js";import{S as i}from"./ScenarioViewer-B76aig_2.js";import{W as n}from"./InteractivePreview-DYFW3lDD.js";import"./useCustomSizes-ByhSyh0W.js";import"./LogViewer-ceAyBX-H.js";import"./SafeScreenshot-BED4B6sP.js";import"./useLastLogLine-C14nCb1q.js";import"./Spinner-Bb5uFQ5V.js";import"./preload-helper-ckwbz45p.js";import"./ReportIssueModal-djPLI-WV.js";import"./createLucideIcon-CMT1jU2q.js";import"./circle-check-DyIKORY6.js";import"./triangle-alert-DtSmdtM4.js";import"./copy-NDbZjXao.js";import"./scenarioStatus-B_8jpV3e.js";import"./InlineSpinner-Bu6c6aDe.js";const w=()=>[{title:"Empty State - CodeYam"},{name:"description",content:"Simulations empty state development view"}],k=t(function(){r();const s={sha:"mock-sha",name:"Dashboard",filePath:"codeyam-cli/src/webserver/app/routes/_index.tsx",entityType:"visual"};return e.jsx(n,{children:e.jsxs("div",{className:"h-screen bg-[#F8F7F6] flex flex-col overflow-hidden",children:[e.jsx("header",{className:"bg-white border-b border-gray-200 shrink-0 relative h-[54px]",children:e.jsxs("div",{className:"flex items-center h-full px-6 gap-6",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M13 8.5H4M4 8.5L8.5 4M4 8.5L8.5 13",stroke:"#005c75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("h1",{className:"text-lg font-semibold text-black m-0 leading-[26px] shrink-0",children:"Dashboard"}),e.jsx("span",{className:"text-xs text-[#626262] font-mono whitespace-nowrap overflow-hidden text-ellipsis min-w-0",children:"codeyam-cli/src/webserver/app/routes/_index.tsx"})]}),e.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2 px-[15px] py-0 h-[26px] bg-[#efefef] border border-[#e1e1e1] rounded",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-[#626262]"}),e.jsx("span",{className:"text-xs font-semibold text-[#626262]",children:"Not analyzed"})]}),e.jsx("button",{className:"px-[15px] py-0 h-[26px] bg-[#005c75] text-white rounded text-xs font-semibold border-none cursor-pointer hover:bg-[#004a5e] transition-colors",children:"Analyze"})]}),e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-[#626262] ml-auto",children:[e.jsx("span",{className:"leading-[22px]",children:"Next Entity"}),e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M4 8.5H13M13 8.5L8.5 4M13 8.5L8.5 13",stroke:"#005c75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})}),e.jsx("div",{className:"bg-[#efefef] border-b border-[#efefef] shrink-0",children:e.jsxs("div",{className:"flex items-center gap-3 h-11 px-[15px]",children:[e.jsxs("div",{className:"px-4 flex items-center justify-center gap-3 shrink-0 text-sm rounded bg-[#343434] text-[#efefef] font-semibold h-8",children:["Scenarios",e.jsx("span",{className:"px-2 py-0.5 rounded-[9px] text-xs font-semibold bg-[#cbf3fa] text-[#005c75] min-w-[25px] text-center",children:"0"})]}),e.jsxs("div",{className:"px-4 flex items-center justify-center gap-3 shrink-0 text-sm rounded-[9px] text-[#3e3e3e] font-normal",children:["Related Entities",e.jsx("span",{className:"px-2 py-0.5 rounded-[9px] text-xs font-semibold bg-[#e1e1e1] text-[#3e3e3e] min-w-[25px] text-center",children:"5"})]}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"Code"}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"Data Structure"}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"History"})]})}),e.jsxs("div",{className:"flex flex-1 gap-0 min-h-0",children:[e.jsx("div",{className:"w-[165px] bg-[#e1e1e1] border-r border-[#c7c7c7] flex items-center justify-center shrink-0",children:e.jsx("span",{className:"text-xs font-medium text-[#8e8e8e] leading-5",children:"No Scenarios"})}),e.jsx(i,{selectedScenario:null,analysis:void 0,entity:s,viewMode:"screenshot",cacheBuster:Date.now(),hasScenarios:!1,isAnalyzing:!1,projectSlug:null,hasAnApiKey:!0})]})]})})});export{k as default,w as meta};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{r as s,j as e,w as Pe,u as Me,f as Te,b as Ee}from"./chunk-JZWAC4HX-C4pqxYJB.js";import{u as Ie,V as Le,S as Re}from"./useCustomSizes-ByhSyh0W.js";import{T as $e,D as ze}from"./Terminal-BaIiqg_w.js";import{c as _e}from"./cy-logo-cli-DcX-ZS3p.js";import{S as ce,u as De}from"./Spinner-Bb5uFQ5V.js";import"./preload-helper-ckwbz45p.js";import"./useLastLogLine-C14nCb1q.js";function Ae(r){const[l,m]=s.useState(null),[u,x]=s.useState(!1),v=s.useCallback(()=>{r&&(x(!0),fetch(`/api/editor-test-results?testFile=${encodeURIComponent(r)}`).then(o=>o.json()).then(o=>{m(o),x(!1)}).catch(()=>{m({testFilePath:r,status:"error",testCases:[],errorMessage:"Failed to fetch test results"}),x(!1)}))},[r]);return s.useEffect(()=>{r&&v()},[r,v]),{results:l,isRunning:u,runTests:v}}function B({imgSrc:r,name:l,isActive:m,onSelect:u}){return e.jsxs("button",{onClick:u,className:"flex flex-col items-center gap-1 cursor-pointer group",title:l,children:[e.jsx("div",{className:`w-32 h-32 rounded overflow-hidden border-2 transition-all ${m?"border-[#005c75] ring-1 ring-[#005c75]":"border-transparent hover:border-[#4d4d4d]"}`,children:r?e.jsx("img",{src:r,alt:l,className:"w-full h-full object-cover object-top",loading:"lazy"}):e.jsx("div",{className:"w-full h-full bg-[#1a1a1a] flex items-center justify-center",children:e.jsx("span",{className:"text-[8px] text-gray-600",children:"No img"})})}),e.jsx("span",{className:`text-[10px] leading-tight text-center truncate w-32 ${m?"text-white":"text-gray-500 group-hover:text-gray-300"}`,children:l})]})}function oe({testFile:r}){const{results:l,isRunning:m,runTests:u}=Ae(r);return m&&!l?e.jsxs("div",{className:"px-2 pt-1 flex items-center gap-1.5",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#005c75] animate-pulse"}),e.jsx("span",{className:"text-[10px] text-gray-400",children:"Running tests..."})]}):l?l.status==="error"?e.jsx("div",{className:"px-2 pt-1",children:e.jsx("span",{className:"text-[10px] text-red-400",children:l.errorMessage})}):e.jsxs("div",{className:"px-2 pt-1 space-y-0.5",children:[l.testCases.map(x=>{var v;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[x.status==="passed"?e.jsx("span",{className:"text-green-400 text-[10px]",children:"✓"}):x.status==="failed"?e.jsx("span",{className:"text-red-400 text-[10px]",children:"✗"}):e.jsx("span",{className:"text-gray-500 text-[10px]",children:"—"}),e.jsx("span",{className:`text-[10px] ${x.status==="passed"?"text-green-400":x.status==="failed"?"text-red-400":"text-gray-500"}`,children:x.fullName})]}),x.status==="failed"&&((v=x.failureMessages)==null?void 0:v.map((o,j)=>e.jsx("div",{className:"pl-4 text-[9px] text-red-300/70 truncate max-w-full",title:o,children:o.split(`
|
|
2
|
-
`)[0]},j)))]},x.fullName)}),e.jsx("button",{onClick:u,disabled:m,className:"mt-1 text-[10px] text-[#00a0c4] hover:text-[#00c4ee] transition-colors cursor-pointer disabled:opacity-50 bg-transparent border-none p-0",children:m?"Running...":"Re-run"})]}):null}function U({filePath:r,projectRoot:l}){if(!r)return null;const u=`vscode://file/${l?`${l}/${r}`:r}`;return e.jsxs("div",{className:"flex items-center gap-1 px-2 mt-0.5",children:[e.jsx("span",{className:"text-[9px] text-gray-500 truncate",children:r}),e.jsx("a",{href:u,title:"Open in editor",className:"shrink-0 text-gray-500 hover:text-gray-300 transition-colors",children:e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",children:e.jsx("path",{d:"M4.5 1.5H2.5C1.95 1.5 1.5 1.95 1.5 2.5V9.5C1.5 10.05 1.95 10.5 2.5 10.5H9.5C10.05 10.5 10.5 10.05 10.5 9.5V7.5M7.5 1.5H10.5M10.5 1.5V4.5M10.5 1.5L5 7",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}function Be({scenarios:r,projectRoot:l,activeScenarioId:m,onScenarioSelect:u,zoomComponent:x,onZoomChange:v,analyzedEntities:o=[],glossaryFunctions:j=[],activeAnalyzedScenarioId:c,onAnalyzedScenarioSelect:b}){const{appScenarios:M,componentGroups:w}=s.useMemo(()=>{const t=[],i=new Map;for(const h of r)if(h.componentName){const y=i.get(h.componentName)||[];y.push(h),i.set(h.componentName,y)}else t.push(h);return{appScenarios:t,componentGroups:i}},[r]),I=s.useMemo(()=>{const t=new Set((o||[]).filter(h=>h.entityType==="visual").map(h=>h.name)),i=new Map;for(const[h,y]of w)t.has(h)||i.set(h,y);return i},[w,o]),{visualEntities:C,libraryEntities:d}=s.useMemo(()=>{const t=o.filter(h=>h.entityType==="visual").sort((h,y)=>h.name.localeCompare(y.name)),i=o.filter(h=>h.entityType==="library"||h.entityType==="functionCall").sort((h,y)=>h.name.localeCompare(y.name));return{visualEntities:t,libraryEntities:i}},[o]),p=s.useMemo(()=>{const t=new Set(d.map(i=>i.name));return j.filter(i=>!t.has(i.name))},[j,d]),f=o.some(t=>t.isAnalyzing),k=s.useRef(null),E=s.useRef(0),z=s.useCallback(()=>{k.current&&(E.current=k.current.scrollTop)},[]);if(s.useEffect(()=>{k.current&&E.current>0&&(k.current.scrollTop=E.current)}),r.length===0&&o.length===0&&p.length===0)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"text-center text-gray-500 px-8",children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"No scenarios yet"}),e.jsx("p",{className:"text-xs",children:"Scenarios will appear here as Claude creates them alongside your code. Each scenario represents a different state of your app's data."})]})});if(x){const t=w.get(x)||[];return e.jsx("div",{className:"flex-1 overflow-auto",children:e.jsxs("div",{className:"p-3 space-y-1",children:[e.jsxs("button",{onClick:()=>v(void 0),className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-gray-400 hover:text-white transition-colors cursor-pointer",children:[e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M7.5 9L4.5 6L7.5 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),"All scenarios"]}),e.jsx("div",{className:"px-3 py-1.5",children:e.jsx("span",{className:"text-xs font-semibold text-white uppercase tracking-wider",children:x})}),e.jsx("div",{className:"flex flex-wrap gap-2 px-2",children:t.length===0?e.jsx("div",{className:"px-3 py-2 text-xs text-gray-500",children:"No scenarios for this component"}):t.map(i=>e.jsx(B,{imgSrc:i.screenshotPath?`/api/editor-scenario-image/${i.id}.png`:null,name:i.name,isActive:i.id===m,onSelect:()=>u(i)},i.id))})]})})}return e.jsx("div",{ref:k,onScroll:z,className:"flex-1 overflow-auto",children:e.jsxs("div",{className:"p-3 space-y-3",children:[M.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider",children:"Page Scenarios"})}),e.jsx("div",{className:"flex flex-wrap gap-2 px-2 pt-1",children:M.map(t=>e.jsx(B,{imgSrc:t.screenshotPath?`/api/editor-scenario-image/${t.id}.png`:null,name:t.name,isActive:t.id===m&&!c,onSelect:()=>u(t)},t.id))})]}),[...I.entries()].map(([t,i])=>{var h;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between px-2 py-1",children:[e.jsx("span",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider",children:t}),e.jsx("button",{onClick:()=>v(t),className:"text-[10px] text-[#00a0c4] hover:text-[#00c4ee] transition-colors cursor-pointer",children:"Zoom in"})]}),((h=i[0])==null?void 0:h.componentPath)&&e.jsx(U,{filePath:i[0].componentPath,projectRoot:l}),e.jsx("div",{className:"flex flex-wrap gap-2 px-2 pt-1",children:i.map(y=>e.jsx(B,{imgSrc:y.screenshotPath?`/api/editor-scenario-image/${y.id}.png`:null,name:y.name,isActive:y.id===m&&!c,onSelect:()=>u(y)},y.id))})]},t)}),C.length>0&&e.jsxs("div",{className:"pt-2 mt-1 border-t border-[#3d3d3d]",children:[e.jsxs("div",{className:"px-2 py-1",children:[e.jsx("span",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider",children:"Components"}),f&&r.length===0&&o.every(t=>t.scenarioCount===0)&&e.jsx("span",{className:"ml-2 text-[10px] text-gray-500",children:"— Entities are being analyzed..."})]}),C.map(t=>e.jsxs("div",{className:"mt-2",children:[e.jsxs("div",{className:"flex items-center gap-2 px-2 py-1",children:[e.jsx("span",{className:"text-[11px] font-medium text-gray-300 truncate",children:t.name}),t.isAnalyzing&&t.scenarioCount===0&&e.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] text-gray-400",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#005c75] animate-pulse"}),"Analyzing..."]})]}),e.jsx(U,{filePath:t.filePath,projectRoot:l}),(t.scenarios.length>0||t.pendingScenarios.length>0)&&e.jsxs("div",{className:"flex flex-wrap gap-2 px-2 pt-1",children:[t.scenarios.map(i=>e.jsx(B,{imgSrc:i.screenshotPath?`/api/screenshot/${i.screenshotPath}`:null,name:i.name,isActive:i.id===c,onSelect:()=>b==null?void 0:b({analysisId:t.analysisId,scenarioId:i.id,scenarioName:i.name,entitySha:t.sha,entityName:t.name})},i.id)),t.pendingScenarios.map(i=>e.jsx("div",{className:"px-2.5 py-1 bg-[#2a2a2a] text-gray-400 text-[10px] rounded-full",title:i,children:i},i))]})]},t.sha))]}),(d.length>0||p.length>0)&&e.jsxs("div",{className:`pt-2 mt-1 ${C.length>0?"":"border-t border-[#3d3d3d]"}`,children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider",children:"Functions"})}),d.map(t=>e.jsxs("div",{className:"mt-2",children:[e.jsxs("div",{className:"px-2 py-1",children:[e.jsx("span",{className:"text-[11px] font-medium text-gray-300",children:t.name}),t.isAnalyzing&&t.scenarioCount===0&&e.jsxs("span",{className:"ml-2 inline-flex items-center gap-1.5 text-[10px] text-gray-400",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#005c75] animate-pulse"}),"Analyzing..."]})]}),e.jsx(U,{filePath:t.filePath,projectRoot:l}),t.testFile?e.jsx(oe,{testFile:t.testFile}):e.jsx("div",{className:"px-2 pt-1",children:e.jsx("span",{className:"text-[10px] text-gray-500",children:"No test file"})})]},t.sha)),p.map(t=>e.jsxs("div",{className:"mt-2",children:[e.jsx("div",{className:"px-2 py-1",children:e.jsx("span",{className:"text-[11px] font-medium text-gray-300",children:t.name})}),e.jsx(U,{filePath:t.filePath,projectRoot:l}),e.jsx(oe,{testFile:t.testFile})]},t.name))]})]})})}const Ue={feature:{label:"Feature",color:"bg-[#005c75]"},fix:{label:"Fix",color:"bg-amber-700"},refactor:{label:"Refactor",color:"bg-purple-700"},scaffold:{label:"Scaffold",color:"bg-green-700"},data:{label:"Data",color:"bg-blue-700"},milestone:{label:"Milestone",color:"bg-yellow-600"}};function Oe(r){try{return new Date(r).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return""}}function Fe(r){try{return new Date(r+"T00:00:00").toLocaleDateString([],{weekday:"long",month:"long",day:"numeric"})}catch{return r}}function We(){const[r,l]=s.useState([]),[m,u]=s.useState(!0),x=s.useCallback(async()=>{try{const o=await fetch("/api/editor-journal");if(o.ok){const j=await o.json();l(j.entries||[])}}catch{}finally{u(!1)}},[]);if(s.useEffect(()=>{x()},[x]),s.useEffect(()=>{const o=new EventSource("/api/events");return o.addEventListener("message",j=>{try{const c=JSON.parse(j.data);c.type==="db-change"&&c.changeType==="journal"&&x()}catch{}}),()=>o.close()},[x]),m)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx("span",{className:"text-gray-500 text-sm",children:"Loading journal..."})});if(r.length===0)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"text-center text-gray-500 px-8",children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"No journal entries yet"}),e.jsx("p",{className:"text-xs",children:"Journal entries will appear as you build. Claude records features, screenshots, and commits as the project evolves."})]})});const v=new Map;for(const o of[...r].reverse()){const j=v.get(o.date)||[];j.push(o),v.set(o.date,j)}return e.jsx("div",{className:"flex-1 overflow-auto",children:e.jsx("div",{className:"p-3 space-y-4",children:[...v.entries()].map(([o,j])=>e.jsxs("div",{children:[e.jsx("div",{className:"px-3 py-1.5 sticky top-0 bg-[#1e1e1e] z-10",children:e.jsx("span",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider",children:Fe(o)})}),e.jsx("div",{className:"space-y-2",children:j.map((c,b)=>{const M=Ue[c.type]||{label:c.type,color:"bg-gray-600"};return e.jsxs("div",{className:"bg-[#2d2d2d] rounded-lg p-3 space-y-2",children:[e.jsx("div",{className:"flex items-start gap-2",children:e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-white truncate",children:c.title}),e.jsx("span",{className:`${M.color} text-white text-[9px] font-bold px-1.5 py-0.5 rounded uppercase tracking-wider shrink-0`,children:M.label})]}),e.jsx("span",{className:"text-[10px] text-gray-500",children:Oe(c.time)})]})}),e.jsx("p",{className:"text-xs text-gray-400 leading-relaxed",children:c.description}),c.screenshot&&e.jsx("div",{className:"rounded overflow-hidden border border-[#3d3d3d]",children:e.jsx("img",{src:`/api/editor-journal-image/${c.screenshot.replace("screenshots/","")}`,alt:c.title,className:"w-full h-auto",loading:"lazy"})}),c.scenarioScreenshots&&c.scenarioScreenshots.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("span",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider",children:"Scenarios"}),e.jsx("div",{className:"grid grid-cols-2 gap-1.5",children:c.scenarioScreenshots.map(w=>e.jsxs("div",{className:"rounded overflow-hidden border border-[#3d3d3d] bg-[#1e1e1e]",children:[e.jsx("img",{src:`/api/editor-journal-image/${w.path.replace("screenshots/","")}`,alt:w.name,className:"w-full h-auto",loading:"lazy"}),e.jsx("div",{className:"px-1.5 py-1 truncate",children:e.jsx("span",{className:"text-[9px] text-gray-400",children:w.name})})]},w.path))})]}),c.scenarios.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1",children:c.scenarios.map(w=>e.jsx("span",{className:"text-[10px] text-gray-400 bg-[#3d3d3d] px-1.5 py-0.5 rounded",children:w},w))}),c.commitSha&&e.jsxs("div",{className:"flex items-center gap-1.5 text-[10px]",children:[e.jsx("span",{className:"font-mono text-[#00a0c4] bg-[#00a0c4]/10 px-1.5 py-0.5 rounded",children:c.commitSha.slice(0,7)}),e.jsx("span",{className:"text-gray-500 truncate",children:c.commitMessage})]})]},`${c.time}-${b}`)})})]},o))})})}function Y({imgSrc:r,name:l,isActive:m,onSelect:u}){return e.jsxs("button",{onClick:u,className:"flex flex-col items-center gap-1 cursor-pointer group",title:l,children:[e.jsx("div",{className:`w-24 h-24 rounded overflow-hidden border-2 transition-all ${m?"border-[#005c75] ring-1 ring-[#005c75]":"border-transparent hover:border-[#4d4d4d]"}`,children:r?e.jsx("img",{src:r,alt:l,className:"w-full h-full object-cover object-top",loading:"lazy"}):e.jsx("div",{className:"w-full h-full bg-[#1a1a1a] flex items-center justify-center",children:e.jsx("span",{className:"text-[8px] text-gray-600",children:"No img"})})}),e.jsx("span",{className:`text-[10px] leading-tight text-center truncate w-24 ${m?"text-white":"text-gray-500 group-hover:text-gray-300"}`,children:l})]})}function Je({hasProject:r,scenarios:l,analyzedEntities:m,activeScenarioId:u,onScenarioSelect:x,onAnalyzedScenarioSelect:v,onSwitchToBuild:o}){const{pageGroups:j,componentGroups:c}=s.useMemo(()=>{const d=new Map,p=new Map;for(const f of l)if(f.componentName){const k=p.get(f.componentName)||[];k.push(f),p.set(f.componentName,k)}else{const k="Home",E=d.get(k)||[];E.push(f),d.set(k,E)}return{pageGroups:d,componentGroups:p}},[l]),b=s.useRef(null),M=s.useRef(0),w=s.useCallback(()=>{b.current&&(M.current=b.current.scrollTop)},[]);if(s.useEffect(()=>{b.current&&M.current>0&&(b.current.scrollTop=M.current)}),!r)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[e.jsx("h2",{className:"text-lg font-medium text-white font-['IBM_Plex_Sans'] m-0",children:"Ready to build something?"}),e.jsx("button",{onClick:o,className:"px-6 py-3 bg-[#005c75] text-white text-sm font-medium rounded-lg hover:bg-[#004d63] transition-colors cursor-pointer",children:"Start Building"})]})});const I=s.useMemo(()=>m.filter(d=>d.entityType==="visual").sort((d,p)=>d.name.localeCompare(p.name)),[m]);return l.length>0||I.length>0?e.jsx("div",{ref:b,onScroll:w,className:"flex-1 overflow-auto",children:e.jsxs("div",{className:"p-4 space-y-4",children:[e.jsx("h2",{className:"text-sm font-medium text-gray-300 m-0 font-['IBM_Plex_Sans']",children:"What do you want to work on next?"}),e.jsx("button",{onClick:o,className:"w-full py-3 border-2 border-dashed border-[#4d4d4d] rounded-lg text-sm text-gray-400 hover:border-[#005c75] hover:text-white transition-colors cursor-pointer bg-transparent",children:"+ New Page"}),[...j.entries()].map(([d,p])=>e.jsxs("div",{children:[e.jsx("div",{className:"py-1",children:e.jsx("span",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider",children:d})}),e.jsx("div",{className:"flex flex-wrap gap-2 pt-1",children:p.map(f=>e.jsx(Y,{imgSrc:f.screenshotPath?`/api/editor-scenario-image/${f.id}.png`:null,name:f.name,isActive:f.id===u,onSelect:()=>x(f)},f.id))})]},d)),[...c.entries()].map(([d,p])=>e.jsxs("div",{children:[e.jsx("div",{className:"py-1",children:e.jsx("span",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider",children:d})}),e.jsx("div",{className:"flex flex-wrap gap-2 pt-1",children:p.map(f=>e.jsx(Y,{imgSrc:f.screenshotPath?`/api/editor-scenario-image/${f.id}.png`:null,name:f.name,isActive:f.id===u,onSelect:()=>x(f)},f.id))})]},d)),I.map(d=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 py-1",children:[e.jsx("span",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider",children:d.name}),d.isAnalyzing&&d.scenarioCount===0&&e.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] text-gray-400",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#005c75] animate-pulse"}),"Analyzing..."]})]}),(d.scenarios.length>0||d.pendingScenarios.length>0)&&e.jsxs("div",{className:"flex flex-wrap gap-2 pt-1",children:[d.scenarios.map(p=>e.jsx(Y,{imgSrc:p.screenshotPath?`/api/screenshot/${p.screenshotPath}`:null,name:p.name,isActive:!1,onSelect:()=>v({analysisId:d.analysisId,scenarioId:p.id,scenarioName:p.name,entitySha:d.sha,entityName:d.name})},p.id)),d.pendingScenarios.map(p=>e.jsx("div",{className:"px-2.5 py-1 bg-[#2a2a2a] text-gray-400 text-[10px] rounded-full",title:p,children:p},p))]})]},d.sha))]})}):e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-4 px-8 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-white font-['IBM_Plex_Sans'] m-0",children:"Your project is ready"}),e.jsx("p",{className:"text-sm text-gray-400 m-0 font-['IBM_Plex_Sans'] leading-relaxed max-w-[280px]",children:"Describe what you want to build in the Chat and your pages and components will appear here."}),e.jsx("button",{onClick:o,className:"px-6 py-3 bg-[#005c75] text-white text-sm font-medium rounded-lg hover:bg-[#004d63] transition-colors cursor-pointer",children:"Start Building"})]})})}function Ge({items:r,onNavigate:l}){return r.length===0?null:e.jsx("nav",{className:"flex items-center gap-1 text-xs",children:r.map((m,u)=>{const x=u===r.length-1;return e.jsxs("span",{className:"flex items-center gap-1",children:[u>0&&e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",className:"text-gray-500",children:e.jsx("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),x?e.jsx("span",{className:"text-white font-medium",children:m.name}):e.jsx("button",{onClick:()=>l(m.componentName),className:"text-gray-400 hover:text-white transition-colors cursor-pointer",children:m.name})]},m.componentName||"app")})})}const tt=()=>[{title:"Editor - CodeYam"},{name:"description",content:"CodeYam Code + Data Editor"}],Z=[{name:"Mobile",width:375,height:667},{name:"Tablet",width:768,height:1024},{name:"Laptop",width:1024,height:768},{name:"Desktop",width:1440,height:900}];function He({analysisId:r,scenarioId:l,scenarioName:m,entityName:u,projectSlug:x,onStateChange:v}){const{interactiveServerUrl:o,isStarting:j,isLoading:c}=De({analysisId:r,scenarioId:l,scenarioName:m,entityName:u,projectSlug:x,enabled:!0});return s.useEffect(()=>{v(o,j||c)},[o,j,c,v]),null}const st=Pe(function(){const{projectSlug:l,projectRoot:m,hasProject:u,scenarios:x,analyzedEntities:v,glossaryFunctions:o}=Me(),j=Te(),[c,b]=Ee(),M=s.useRef(null),w=s.useRef(null),I=s.useRef(null),C=c.get("zoom")||void 0,d=c.get("scenario")||void 0,[p,f]=s.useState(null),[k,E]=s.useState(null),[z,t]=s.useState(!1),[i,h]=s.useState(null),[y,_]=s.useState(!1),[de,O]=s.useState(!0),[T,K]=s.useState(null),[F,W]=s.useState(null),[J,q]=s.useState(!1),xe=s.useCallback((a,n)=>{W(g=>(a&&a!==g&&_(!1),a)),q(n)},[]),Q=s.useCallback(a=>{K(a),W(null),q(!0),_(!1);const n=new URLSearchParams(c);n.delete("scenario"),n.delete("zoom"),b(n)},[c,b]),[me,X]=s.useState(1440),[N,G]=s.useState({name:"Desktop",width:1440,height:900}),[pe,H]=s.useState(!1),[V,he]=s.useState(null),[P,$]=s.useState("app"),ue=s.useCallback(()=>{$("build"),ee(!0)},[]),[fe,ee]=s.useState(!1);s.useEffect(()=>{if(P==="build"){const a=setTimeout(()=>{var n;return(n=M.current)==null?void 0:n.focus()},50);return()=>clearTimeout(a)}},[P]);const[D,ge]=s.useState(null);s.useEffect(()=>{const a=I.current;if(!a)return;const n=new ResizeObserver(g=>{const S=g[0];S&&ge({width:S.contentRect.width,height:S.contentRect.height})});return n.observe(a),()=>n.disconnect()},[]);const R=s.useMemo(()=>{if(!D)return 1;const a=N.width,n=N.height??900,g=D.width,S=D.height;return a<=g&&n<=S?1:Math.min(g/a,S/n)},[D,N]),[ve,te]=s.useState(0),je=s.useCallback(()=>{te(a=>a+1)},[]),{customSizes:se,addCustomSize:Ne}=Ie(l),A=s.useMemo(()=>[...Z,...se],[se]),ae=s.useRef(!1);s.useEffect(()=>{let a=!1,n=null;const g=async()=>{try{const S=await fetch("/api/editor-dev-server");if(a)return;const L=await S.json();if(L.status==="error")f(null),E(null),t(!1),h(L.errorMessage||"Dev server crashed");else if(L.url)f(L.url),E(L.proxyUrl||null),t(!1),h(null),O(!0);else if(L.status==="starting")t(!0),h(null),O(!0);else if(L.status==="stopped")if(p)f(null),t(!1);else if(ae.current)t(!1);else{ae.current=!0;try{(await fetch("/api/editor-dev-server",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"start"})})).ok?t(!0):O(!1)}catch{}}}catch{}};return g(),n=setInterval(()=>void g(),2e3),()=>{a=!0,n&&clearInterval(n)}},[p]),s.useEffect(()=>{const a=new EventSource("/api/events");return a.addEventListener("message",n=>{try{const g=JSON.parse(n.data);(g.type==="db-change"||g.type==="unknown")&&j.revalidate()}catch{}}),()=>a.close()},[j]);const be=s.useMemo(()=>{const a=[{name:"App"}];return C&&a.push({name:C,componentName:C}),a},[C]),ne=s.useCallback(a=>{const n=new URLSearchParams(c);a?n.set("zoom",a):n.delete("zoom"),n.delete("scenario"),b(n)},[c,b]),re=s.useCallback(a=>{K(null),W(null);const n=new URLSearchParams(c);n.set("scenario",a.id),b(n);const g=a.name.replace(/[^a-zA-Z0-9_]+/g,"_");fetch("/api/editor-switch-scenario",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scenarioSlug:g,scenarioId:a.id})}).catch(()=>{}),te(S=>S+1),_(!1)},[c,b]),ye=(a,n)=>{X(a);const g=A.find(S=>S.width===a&&S.height===n);G({name:(g==null?void 0:g.name)||"Custom",width:a,height:n})},le=a=>{X(a.width),G({name:a.name,width:a.width,height:a.height})},we=a=>{Ne(a,N.width,N.height??900),H(!1),G(n=>({...n,name:a}))},Se=()=>{_(!0)},Ce=s.useCallback(()=>{h(null),t(!0),fetch("/api/editor-dev-server",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"restart"})}).catch(()=>{})},[]),ke=s.useCallback(()=>{h(null),t(!0),fetch("/api/editor-dev-server",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"start"})}).catch(()=>{})},[]),ie=s.useMemo(()=>{if(T&&F)return F;const a=k||p;if(!a)return null;if(C&&d){const n=x.find(S=>S.id===d),g=n?n.name.replace(/[^a-zA-Z0-9_]+/g,"_"):"Default";return`${a}/__codeyam__/${C}/${g}`}return a},[k,p,C,d,x,T,F]);return e.jsxs("div",{className:"fixed inset-0 bg-[#2d2d2d] flex flex-col",children:[T&&e.jsx(He,{analysisId:T.analysisId,scenarioId:T.scenarioId,scenarioName:T.scenarioName,entityName:T.entityName,projectSlug:l,onStateChange:xe},T.analysisId),e.jsx("div",{className:"bg-[#3d3d3d] h-12 flex items-center px-4 gap-4 shrink-0 z-20",children:e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsx("img",{src:_e,alt:"CodeYam",className:"h-6 brightness-0 invert"}),e.jsx("span",{className:"text-white font-medium text-sm whitespace-nowrap",children:"Editor"}),C&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-px h-4 bg-gray-600"}),e.jsx(Ge,{items:be,onNavigate:ne})]}),e.jsx("span",{className:"bg-[#005c75] text-white text-[10px] font-bold px-2 py-0.5 rounded uppercase tracking-wider ml-auto",children:"Code + Data"})]})}),e.jsxs("div",{className:"flex-1 flex min-h-0",children:[e.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[e.jsxs("div",{className:"bg-[#e5e7eb] border-b border-[rgba(0,0,0,0.1)] shrink-0 z-10 h-6 flex items-center justify-center relative",children:[e.jsx("div",{className:"absolute inset-0 flex justify-center",children:e.jsx("div",{style:{maxWidth:`${Z[Z.length-1].width}px`,width:"100%"},children:e.jsx(Le,{currentViewportWidth:me,currentPresetName:N.name,onDevicePresetClick:le,devicePresets:A,hideLabel:!0,onHoverChange:he,lightMode:!0})})}),e.jsxs("div",{className:"relative z-10 flex items-center gap-2",children:[e.jsxs("div",{className:"relative w-28 h-5",children:[e.jsxs("div",{className:"absolute inset-0 bg-white text-gray-900 text-xs px-2 rounded flex items-center justify-between pointer-events-none border border-gray-300",children:[e.jsx("span",{className:"leading-none",children:(V==null?void 0:V.name)||N.name}),e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e.jsxs("select",{value:N.name,onChange:a=>{const n=A.find(g=>g.name===a.target.value);n&&le(n)},className:"relative w-full h-full opacity-0 cursor-pointer",children:[A.map(a=>e.jsx("option",{value:a.name,children:a.name},a.name)),N.name==="Custom"&&e.jsx("option",{value:"Custom",children:"Custom"})]})]}),e.jsx("input",{type:"number",value:N.width,onChange:a=>{const n=parseInt(a.target.value,10);!isNaN(n)&&n>0&&ye(n,N.height??900)},className:"bg-white text-gray-900 text-xs px-1 rounded border border-gray-300 outline-none w-16 text-center h-5 leading-none",min:"200",max:"3840"}),e.jsx("span",{className:"text-gray-400 text-xs h-5 flex items-center leading-none",children:"x"}),e.jsx("span",{className:"bg-gray-100 text-gray-600 text-xs px-1 rounded w-14 text-center h-5 flex items-center justify-center leading-none",children:N.height??900}),N.name==="Custom"&&e.jsx("button",{onClick:()=>H(!0),className:"bg-white text-gray-900 text-xs px-2 rounded h-5 flex items-center leading-none border border-gray-300 hover:bg-gray-50 transition-colors",children:"Save"})]})]}),e.jsx("div",{ref:I,className:"flex-1 flex items-center justify-center overflow-hidden p-8",style:{backgroundImage:`
|
|
3
|
-
linear-gradient(45deg, #ebebeb 25%, transparent 25%),
|
|
4
|
-
linear-gradient(-45deg, #ebebeb 25%, transparent 25%),
|
|
5
|
-
linear-gradient(45deg, transparent 75%, #ebebeb 75%),
|
|
6
|
-
linear-gradient(-45deg, transparent 75%, #ebebeb 75%)
|
|
7
|
-
`,backgroundSize:"16px 16px",backgroundPosition:"0 0, 0 8px, 8px -8px, -8px 0px",backgroundColor:"#fafafa"},children:ie?e.jsx("div",{style:{width:`${N.width*R}px`,height:`${(N.height??900)*R}px`},children:e.jsxs("div",{className:"relative bg-white origin-top-left",style:{width:`${N.width}px`,height:`${N.height??900}px`,transform:R<1?`scale(${R})`:void 0},children:[!y&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10",children:e.jsxs("div",{className:"flex flex-col items-center justify-center gap-6 bg-white rounded-lg p-8 shadow-sm w-[500px] h-[300px]",children:[e.jsx("div",{className:"mb-4",children:e.jsx(ce,{})}),e.jsxs("div",{className:"flex flex-col gap-3 text-center",children:[e.jsx("h2",{className:"text-xl font-medium text-black leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Loading Preview"}),e.jsx("p",{className:"text-sm text-[#666] leading-5 m-0 font-['IBM_Plex_Sans']",children:"Waiting for the app to render"})]})]})}),e.jsx("iframe",{ref:w,src:ie,className:"w-full h-full border-none",title:"Editor preview",onLoad:Se,style:{opacity:y?1:0}},ve)]})}):e.jsx("div",{className:"bg-white rounded-lg shadow-sm flex flex-col items-center justify-center",style:{width:`${N.width*R}px`,height:`${(N.height??900)*R}px`},children:i?e.jsxs("div",{className:"flex flex-col gap-4 text-center px-8 max-w-[600px]",children:[e.jsx("h2",{className:"text-xl font-medium text-red-600 leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Dev Server Failed"}),e.jsx("pre",{className:"text-xs text-left bg-gray-100 text-gray-800 p-4 rounded overflow-auto max-h-[300px] w-full font-mono whitespace-pre-wrap",children:i}),e.jsx("button",{onClick:Ce,className:"mx-auto px-4 py-2 bg-[#005c75] text-white text-sm font-medium rounded hover:bg-[#004d63] transition-colors cursor-pointer",children:"Retry"})]}):z||J?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mb-4",children:e.jsx(ce,{})}),e.jsxs("div",{className:"flex flex-col gap-3 text-center",children:[e.jsx("h2",{className:"text-xl font-medium text-black leading-[28px] m-0 font-['IBM_Plex_Sans']",children:J?"Starting Interactive Mode":"Starting Dev Server"}),e.jsx("p",{className:"text-sm text-[#666] leading-5 m-0 font-['IBM_Plex_Sans']",children:J?"Loading component preview...":"Your dev server is starting up..."})]})]}):e.jsxs("div",{className:"flex flex-col gap-3 text-center px-8",children:[e.jsx("h2",{className:"text-xl font-medium text-black leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Code + Data Editor"}),e.jsx("p",{className:"text-sm text-[#888] leading-5 m-0 font-['IBM_Plex_Sans']",children:"Describe what you want to build in the chat"})]})})})]}),e.jsxs("aside",{className:"w-[50%] min-w-[400px] max-w-[800px] bg-[#1e1e1e] border-r border-[#3d3d3d] shrink-0 flex flex-col overflow-hidden order-first",children:[e.jsx("div",{className:"border-b border-[#3d3d3d] px-4 shrink-0 flex items-center justify-between",children:e.jsxs("div",{className:"flex items-center gap-0",children:[e.jsxs("button",{onClick:()=>$("app"),className:`px-3 py-2 text-xs font-medium transition-colors relative cursor-pointer ${P==="app"?"text-white":"text-gray-500 hover:text-gray-300"}`,children:["App",P==="app"&&e.jsx("span",{className:"absolute bottom-0 left-3 right-3 h-0.5 bg-[#005c75]"})]}),e.jsxs("button",{onClick:()=>{$("build"),ee(!0)},className:`px-3 py-2 text-xs font-medium transition-colors relative cursor-pointer ${P==="build"?"text-white":"text-gray-500 hover:text-gray-300"}`,children:["Build",P==="build"&&e.jsx("span",{className:"absolute bottom-0 left-3 right-3 h-0.5 bg-[#005c75]"})]}),e.jsxs("button",{onClick:()=>$("data"),className:`px-3 py-2 text-xs font-medium transition-colors relative cursor-pointer ${P==="data"?"text-white":"text-gray-500 hover:text-gray-300"}`,children:["Data",P==="data"&&e.jsx("span",{className:"absolute bottom-0 left-3 right-3 h-0.5 bg-[#005c75]"})]}),e.jsxs("button",{onClick:()=>$("journal"),className:`px-3 py-2 text-xs font-medium transition-colors relative cursor-pointer ${P==="journal"?"text-white":"text-gray-500 hover:text-gray-300"}`,children:["Journal",P==="journal"&&e.jsx("span",{className:"absolute bottom-0 left-3 right-3 h-0.5 bg-[#005c75]"})]})]})}),fe&&e.jsx("div",{style:{display:P==="build"?"flex":"none"},className:"flex-1 overflow-hidden flex-col",children:e.jsx($e,{ref:M,entityName:"Editor",projectSlug:l,entityFilePath:null,scenarioName:null,onRefreshPreview:je,editorMode:!0})}),P==="app"&&e.jsx(Je,{hasProject:u,scenarios:x,analyzedEntities:v,activeScenarioId:d,onScenarioSelect:re,onAnalyzedScenarioSelect:Q,onSwitchToBuild:ue}),P==="data"&&e.jsx(Be,{scenarios:x,projectRoot:m,activeScenarioId:d,onScenarioSelect:re,zoomComponent:C,onZoomChange:ne,analyzedEntities:v,glossaryFunctions:o,activeAnalyzedScenarioId:T==null?void 0:T.scenarioId,onAnalyzedScenarioSelect:Q}),P==="journal"&&e.jsx(We,{})]})]}),e.jsx(ze,{serverUrl:p,isStarting:z,projectSlug:l,devServerError:i,onStartServer:de?ke:void 0}),pe&&e.jsx(Re,{width:N.width,height:N.height??900,onSave:we,onCancel:()=>H(!1)})]})});export{st as default,tt as meta};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{a as W,j as e,w as ae,u as ne,r as l}from"./chunk-JZWAC4HX-C4pqxYJB.js";import{u as ie,S as R}from"./Spinner-Bb5uFQ5V.js";import{u as re}from"./useLastLogLine-C14nCb1q.js";import{u as oe,V as le,S as ce}from"./useCustomSizes-ByhSyh0W.js";import{c as de}from"./cy-logo-cli-DcX-ZS3p.js";import{I as T}from"./InlineSpinner-Bu6c6aDe.js";import{T as he,D as xe}from"./Terminal-BaIiqg_w.js";import{S as me}from"./SafeScreenshot-BED4B6sP.js";import"./preload-helper-ckwbz45p.js";function ue({scenarios:w,currentScenarioId:i,entitySha:t,cacheBuster:o}){const c=W();return w.length===0?e.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:e.jsx("p",{className:"text-gray-500 text-sm",children:"No scenarios found"})}):e.jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-3",children:w.map(r=>{var j,m;const p=r.id===i,g=(m=(j=r.metadata)==null?void 0:j.screenshotPaths)==null?void 0:m[0];return e.jsxs("button",{onClick:()=>{c(`/entity/${t}/scenarios/${r.id}/dev`)},className:`w-full text-left rounded-lg overflow-hidden border transition-colors cursor-pointer flex ${p?"border-[#005c75] bg-[#1a3a44]":"border-[#3d3d3d] bg-[#252525] hover:border-[#555]"}`,children:[e.jsx("div",{className:"w-24 h-20 shrink-0 bg-[#1a1a1a]",children:e.jsx(me,{screenshotPath:g,cacheBuster:o,alt:r.name,className:"w-full h-full object-cover object-top"})}),e.jsxs("div",{className:"p-2.5 min-w-0 flex-1",children:[e.jsxs("div",{className:"text-white text-sm font-medium truncate",children:[p&&e.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-[#005c75] mr-1.5 relative top-[-1px]"}),r.name]}),r.description&&e.jsx("div",{className:"text-gray-400 text-xs mt-1 line-clamp-2",children:r.description})]})]},r.id)})})}const P=[{name:"Mobile",width:375,height:667},{name:"Tablet",width:768,height:1024},{name:"Laptop",width:1024,height:768},{name:"Desktop",width:1440,height:900}],ke=ae(function(){const{entity:i,scenario:t,analysis:o,projectSlug:c}=ne(),r=W(),p=l.useRef(null),g=l.useRef(null),[j,m]=l.useState(null),[E,M]=l.useState(1440),[n,N]=l.useState({name:"Desktop",width:1440,height:900}),[V,y]=l.useState(!1),[S,A]=l.useState(null),[d,k]=l.useState("chat"),[H,U]=l.useState(0),F=l.useCallback(()=>{U(s=>s+1)},[]),{customSizes:D,addCustomSize:q}=oe(c),f=l.useMemo(()=>[...P,...D],[D]),{interactiveServerUrl:v,isStarting:C,isLoading:$,showIframe:_,iframeKey:K,onIframeLoad:Y}=ie({analysisId:o==null?void 0:o.id,scenarioId:t==null?void 0:t.id,scenarioName:t==null?void 0:t.name,projectSlug:c,enabled:!0,refreshTrigger:H}),{lastLine:b}=re(c,C||$),G=()=>{r(`/entity/${i.sha}`)},J=(s,a)=>{M(s);const x=f.find(B=>B.width===s&&B.height===a);m(x||null),N({name:(x==null?void 0:x.name)||"Custom",width:s,height:a})},z=s=>{m(s),M(s.width),N({name:s.name,width:s.width,height:s.height})},O=s=>{q(s,n.width,n.height??900),y(!1),N(a=>({...a,name:s}))},Q=()=>{var a;k("chat"),(a=g.current)==null||a.sendInput("Create a new scenario for this entity based on the work we've just done. Create a name and description that reflects what the live preview is showing. Use the scenario data you've changed to create a new scenario in the database. If the data structure was fixed in any way you need to update that in the database as well and backfill all existing scenarios, then save to the database and capture a screenshot. Remember the database is at `.codeyam/db.sqlite3`, the scenarios table has all scenarios and the analyses table contains the scenariosDataStructure is its metadata.")},h=((o==null?void 0:o.scenarios)||[]).filter(s=>{var a;return!((a=s.metadata)!=null&&a.sameAsDefault)}),u=h.findIndex(s=>s.id===(t==null?void 0:t.id)),X=u+1,Z=h.length,L=u>0,I=u<h.length-1,ee=()=>{if(L){const s=h[u-1];r(`/entity/${i.sha}/scenarios/${s.id}/dev`)}},te=()=>{if(I){const s=h[u+1];r(`/entity/${i.sha}/scenarios/${s.id}/dev`)}},se=C||$||!_;return e.jsxs("div",{className:"fixed inset-0 bg-[#2d2d2d] flex flex-col",children:[e.jsxs("div",{className:"bg-[#3d3d3d] h-12 flex items-center px-4 gap-4 shrink-0 z-20",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsx("img",{src:de,alt:"CodeYam",className:"h-6 brightness-0 invert"}),e.jsx("span",{className:"text-white font-medium text-sm whitespace-nowrap",children:i.name}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx("button",{onClick:ee,disabled:!L,className:`${L?"text-white hover:text-gray-300":"text-gray-600 cursor-not-allowed"} transition-colors`,"aria-label":"Previous scenario",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsxs("span",{className:"text-gray-400 text-sm",children:[X,"/",Z]}),e.jsx("button",{onClick:te,disabled:!I,className:`${I?"text-white hover:text-gray-300":"text-gray-600 cursor-not-allowed"} transition-colors`,"aria-label":"Next scenario",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M7.5 15L12.5 10L7.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"flex items-center gap-2 ml-2 min-w-0",children:[e.jsx("span",{className:"text-white font-semibold text-xs whitespace-nowrap shrink-0",children:t==null?void 0:t.name}),(t==null?void 0:t.description)&&e.jsxs("div",{className:"relative group min-w-0",children:[e.jsx("span",{className:"text-gray-400 text-xs truncate block",children:t.description}),e.jsx("div",{className:"absolute left-0 top-full mt-1 hidden group-hover:block z-50 bg-black text-white text-xs px-3 py-2 rounded shadow-lg max-w-md",children:t.description})]})]}),e.jsx("span",{className:"bg-[#005c75] text-white text-[10px] font-bold px-2 py-0.5 rounded uppercase tracking-wider ml-2",children:"Dev Mode"})]}),e.jsx("button",{onClick:G,className:"text-white hover:text-gray-300 transition-colors ml-4","aria-label":"Close dev mode",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"flex-1 flex min-h-0",children:[e.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[e.jsxs("div",{className:"bg-[#e5e7eb] border-b border-[rgba(0,0,0,0.1)] shrink-0 z-10 h-6 flex items-center justify-center relative",children:[e.jsx("div",{className:"absolute inset-0 flex justify-center",children:e.jsx("div",{style:{maxWidth:`${P[P.length-1].width}px`,width:"100%"},children:e.jsx(le,{currentViewportWidth:E,currentPresetName:n.name,onDevicePresetClick:z,devicePresets:f,hideLabel:!0,onHoverChange:A,lightMode:!0})})}),e.jsxs("div",{className:"relative z-10 flex items-center gap-2",children:[e.jsxs("div",{className:"relative w-28 h-5",children:[e.jsxs("div",{className:"absolute inset-0 bg-white text-gray-900 text-xs px-2 rounded flex items-center justify-between pointer-events-none border border-gray-300",children:[e.jsx("span",{className:"leading-none",children:(S==null?void 0:S.name)||n.name}),e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e.jsxs("select",{value:n.name,onChange:s=>{const a=f.find(x=>x.name===s.target.value);a&&z(a)},className:"relative w-full h-full opacity-0 cursor-pointer",children:[f.map(s=>e.jsx("option",{value:s.name,children:s.name},s.name)),n.name==="Custom"&&e.jsx("option",{value:"Custom",children:"Custom"})]})]}),e.jsx("input",{type:"number",value:n.width,onChange:s=>{const a=parseInt(s.target.value,10);!isNaN(a)&&a>0&&J(a,n.height??900)},className:"bg-white text-gray-900 text-xs px-1 rounded border border-gray-300 outline-none w-16 text-center h-5 leading-none",min:"200",max:"3840"}),e.jsx("span",{className:"text-gray-400 text-xs h-5 flex items-center leading-none",children:"x"}),e.jsx("span",{className:"bg-gray-100 text-gray-600 text-xs px-1 rounded w-14 text-center h-5 flex items-center justify-center leading-none",children:n.height??900}),n.name==="Custom"&&e.jsx("button",{onClick:()=>y(!0),className:"bg-white text-gray-900 text-xs px-2 rounded h-5 flex items-center leading-none border border-gray-300 hover:bg-gray-50 transition-colors",children:"Save"})]})]}),e.jsx("div",{className:"flex-1 flex items-center justify-center overflow-auto p-8",style:{backgroundImage:`
|
|
2
|
-
linear-gradient(45deg, #ebebeb 25%, transparent 25%),
|
|
3
|
-
linear-gradient(-45deg, #ebebeb 25%, transparent 25%),
|
|
4
|
-
linear-gradient(45deg, transparent 75%, #ebebeb 75%),
|
|
5
|
-
linear-gradient(-45deg, transparent 75%, #ebebeb 75%)
|
|
6
|
-
`,backgroundSize:"16px 16px",backgroundPosition:"0 0, 0 8px, 8px -8px, -8px 0px",backgroundColor:"#fafafa"},children:v?e.jsxs("div",{className:"relative bg-white w-full h-full",style:{maxWidth:`${n.width}px`,maxHeight:`${n.height}px`},children:[se&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10",children:e.jsxs("div",{className:"flex flex-col items-center justify-center gap-6 bg-white rounded-lg p-8 shadow-sm w-[500px] h-[300px]",children:[e.jsx("div",{className:"mb-4",children:e.jsx(R,{})}),e.jsxs("div",{className:"flex flex-col gap-3 text-center",children:[e.jsx("h2",{className:"text-xl font-medium text-black leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Loading Preview"}),e.jsx("p",{className:"text-sm text-[#666] leading-5 m-0 font-['IBM_Plex_Sans']",children:"Waiting for the dev server to be ready"}),b&&e.jsxs("p",{className:"text-xs font-mono text-[#005c75] text-center leading-5 m-0 mt-3 font-['IBM_Plex_Mono'] uppercase",children:[e.jsx(T,{}),b]})]})]})}),e.jsx("iframe",{ref:p,src:v,className:"w-full h-full border-none",title:`Dev mode preview: ${t==null?void 0:t.name}`,onLoad:Y,style:{opacity:_?1:0}},K)]}):e.jsxs("div",{className:"flex flex-col items-center justify-center gap-6 w-[500px] h-[300px] bg-white rounded-lg p-8 shadow-sm",children:[e.jsx("div",{className:"mb-4",children:e.jsx(R,{})}),e.jsxs("div",{className:"flex flex-col gap-3 text-center",children:[e.jsx("h2",{className:"text-xl font-medium text-black leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Starting Dev Mode"}),e.jsx("p",{className:"text-sm text-[#666] leading-5 m-0 font-['IBM_Plex_Sans']",children:"Setting up a sandboxed environment with live preview"}),b&&e.jsxs("p",{className:"text-xs font-mono text-[#005c75] text-center leading-5 m-0 mt-3 font-['IBM_Plex_Mono'] uppercase",children:[e.jsx(T,{}),b]})]})]})})]}),e.jsxs("aside",{className:"w-[50%] min-w-[400px] max-w-[800px] bg-[#1e1e1e] border-l border-[#3d3d3d] shrink-0 flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"border-b border-[#3d3d3d] px-4 shrink-0 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-0",children:[e.jsxs("button",{onClick:()=>k("chat"),className:`px-3 py-2 text-xs font-medium transition-colors relative cursor-pointer ${d==="chat"?"text-white":"text-gray-500 hover:text-gray-300"}`,children:["Chat",d==="chat"&&e.jsx("span",{className:"absolute bottom-0 left-3 right-3 h-0.5 bg-[#005c75]"})]}),e.jsxs("button",{onClick:()=>k("scenarios"),className:`px-3 py-2 text-xs font-medium transition-colors relative cursor-pointer ${d==="scenarios"?"text-white":"text-gray-500 hover:text-gray-300"}`,children:["Scenarios",d==="scenarios"&&e.jsx("span",{className:"absolute bottom-0 left-3 right-3 h-0.5 bg-[#005c75]"})]})]}),d==="chat"&&e.jsx("button",{onClick:Q,disabled:!v,className:"px-3 py-1 text-[11px] font-medium rounded bg-[#005c75] text-white hover:bg-[#004a5c] transition-colors disabled:bg-gray-600 disabled:text-gray-400 disabled:cursor-not-allowed cursor-pointer",children:"Save Scenario"})]}),e.jsx("div",{style:{display:d==="chat"?"flex":"none"},className:"flex-1 overflow-hidden flex-col",children:e.jsx(he,{ref:g,entityName:i.name,entityType:i.entityType,entitySha:i.sha,entityFilePath:i.filePath||i.localFilePath,scenarioName:t==null?void 0:t.name,scenarioDescription:t==null?void 0:t.description,analysisId:o==null?void 0:o.id,projectSlug:c,onRefreshPreview:F})}),d==="scenarios"&&e.jsx(ue,{scenarios:h,currentScenarioId:t==null?void 0:t.id,entitySha:i.sha,cacheBuster:0})]})]}),e.jsx(xe,{serverUrl:v,isStarting:C,projectSlug:c}),V&&e.jsx(ce,{width:n.width,height:n.height??900,onSave:O,onCancel:()=>y(!1)})]})});export{ke as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{w as Y,u as q,a as G,b as J,r as l,j as e}from"./chunk-JZWAC4HX-C4pqxYJB.js";import{u as O,S as P}from"./Spinner-Bb5uFQ5V.js";import{u as Q}from"./useLastLogLine-C14nCb1q.js";import{u as X,V as Z,S as ee}from"./useCustomSizes-ByhSyh0W.js";import{c as te}from"./cy-logo-cli-DcX-ZS3p.js";import{I as $}from"./InlineSpinner-Bu6c6aDe.js";const b=[{name:"Mobile",width:375,height:667},{name:"Tablet",width:768,height:1024},{name:"Laptop",width:1024,height:768},{name:"Desktop",width:1440,height:900}],xe=Y(function(){const{entity:i,scenario:s,analysis:r,projectSlug:m}=q(),u=G();J();const[ne,w]=l.useState(null),[_,N]=l.useState(1440),[a,g]=l.useState({name:"Desktop",width:1440,height:900}),[z,p]=l.useState(!1),[f,B]=l.useState(null),{customSizes:S,addCustomSize:D}=X(m),x=l.useMemo(()=>[...b,...S],[S]),{interactiveServerUrl:y,isStarting:k,isLoading:C,showIframe:I,iframeKey:W,onIframeLoad:E}=O({analysisId:r==null?void 0:r.id,scenarioId:s==null?void 0:s.id,scenarioName:s==null?void 0:s.name,projectSlug:m,enabled:!0}),{lastLine:h}=Q(m,k||C),U=()=>{u(`/entity/${i.sha}`)},V=(t,n)=>{N(t);const o=x.find(M=>M.width===t&&M.height===n);w(o||null),g({name:(o==null?void 0:o.name)||"Custom",width:t,height:n})},L=t=>{w(t),N(t.width),g({name:t.name,width:t.width,height:t.height})},R=t=>{D(t,a.width,a.height??900),p(!1),g(n=>({...n,name:t}))},c=((r==null?void 0:r.scenarios)||[]).filter(t=>{var n;return!((n=t.metadata)!=null&&n.sameAsDefault)}),d=c.findIndex(t=>t.id===(s==null?void 0:s.id)),H=d+1,T=c.length,v=d>0,j=d<c.length-1,A=()=>{if(v){const t=c[d-1],n=encodeURIComponent(`/entity/${i.sha}/scenarios/${t.id}/fullscreen`);u(`/entity/${i.sha}/scenarios/${t.id}/fullscreen?from=${n}`)}},F=()=>{if(j){const t=c[d+1],n=encodeURIComponent(`/entity/${i.sha}/scenarios/${t.id}/fullscreen`);u(`/entity/${i.sha}/scenarios/${t.id}/fullscreen?from=${n}`)}},K=k||C||!I;return e.jsxs("div",{className:"fixed inset-0 bg-[#2d2d2d] flex flex-col",children:[e.jsxs("div",{className:"bg-[#3d3d3d] h-12 flex items-center px-4 gap-4 shrink-0 z-20",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsx("img",{src:te,alt:"CodeYam",className:"h-6 brightness-0 invert"}),e.jsx("span",{className:"text-white font-medium text-sm whitespace-nowrap",children:i.name}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx("button",{onClick:A,disabled:!v,className:`${v?"text-white hover:text-gray-300":"text-gray-600 cursor-not-allowed"} transition-colors`,"aria-label":"Previous scenario",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsxs("span",{className:"text-gray-400 text-sm",children:[H,"/",T]}),e.jsx("button",{onClick:F,disabled:!j,className:`${j?"text-white hover:text-gray-300":"text-gray-600 cursor-not-allowed"} transition-colors`,"aria-label":"Next scenario",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M7.5 15L12.5 10L7.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"flex items-center gap-2 ml-2 min-w-0",children:[e.jsx("span",{className:"text-white font-semibold text-xs whitespace-nowrap shrink-0",children:s==null?void 0:s.name}),(s==null?void 0:s.description)&&e.jsxs("div",{className:"relative group min-w-0",children:[e.jsx("span",{className:"text-gray-400 text-xs truncate block",children:s.description}),e.jsx("div",{className:"absolute left-0 top-full mt-1 hidden group-hover:block z-50 bg-black text-white text-xs px-3 py-2 rounded shadow-lg max-w-md",children:s.description})]})]})]}),e.jsx("button",{onClick:U,className:"text-white hover:text-gray-300 transition-colors ml-4","aria-label":"Close fullscreen",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"bg-[#e5e7eb] border-b border-[rgba(0,0,0,0.1)] shrink-0 z-10 h-6 flex items-center justify-center relative",children:[e.jsx("div",{className:"absolute inset-0 flex justify-center",children:e.jsx("div",{style:{maxWidth:`${b[b.length-1].width}px`,width:"100%"},children:e.jsx(Z,{currentViewportWidth:_,currentPresetName:a.name,onDevicePresetClick:L,devicePresets:x,hideLabel:!0,onHoverChange:B,lightMode:!0})})}),e.jsxs("div",{className:"relative z-10 flex items-center gap-2",children:[e.jsxs("div",{className:"relative w-28 h-5",children:[e.jsxs("div",{className:"absolute inset-0 bg-white text-gray-900 text-xs px-2 rounded flex items-center justify-between pointer-events-none border border-gray-300",children:[e.jsx("span",{className:"leading-none",children:(f==null?void 0:f.name)||a.name}),e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e.jsxs("select",{value:a.name,onChange:t=>{const n=x.find(o=>o.name===t.target.value);n&&L(n)},className:"relative w-full h-full opacity-0 cursor-pointer",children:[x.map(t=>e.jsx("option",{value:t.name,children:t.name},t.name)),a.name==="Custom"&&e.jsx("option",{value:"Custom",children:"Custom"})]})]}),e.jsx("input",{type:"number",value:a.width,onChange:t=>{const n=parseInt(t.target.value,10);!isNaN(n)&&n>0&&V(n,a.height??900)},className:"bg-white text-gray-900 text-xs px-1 rounded border border-gray-300 outline-none w-16 text-center h-5 leading-none",min:"200",max:"3840"}),e.jsx("span",{className:"text-gray-400 text-xs h-5 flex items-center leading-none",children:"×"}),e.jsx("span",{className:"bg-gray-100 text-gray-600 text-xs px-1 rounded w-14 text-center h-5 flex items-center justify-center leading-none",children:a.height??900}),a.name==="Custom"&&e.jsx("button",{onClick:()=>p(!0),className:"bg-white text-gray-900 text-xs px-2 rounded h-5 flex items-center leading-none border border-gray-300 hover:bg-gray-50 transition-colors",children:"Save"})]})]}),e.jsx("div",{className:"flex-1 flex items-center justify-center overflow-auto p-8",style:{backgroundImage:`
|
|
2
|
-
linear-gradient(45deg, #ebebeb 25%, transparent 25%),
|
|
3
|
-
linear-gradient(-45deg, #ebebeb 25%, transparent 25%),
|
|
4
|
-
linear-gradient(45deg, transparent 75%, #ebebeb 75%),
|
|
5
|
-
linear-gradient(-45deg, transparent 75%, #ebebeb 75%)
|
|
6
|
-
`,backgroundSize:"16px 16px",backgroundPosition:"0 0, 0 8px, 8px -8px, -8px 0px",backgroundColor:"#fafafa"},children:y?e.jsxs("div",{className:"relative bg-white w-full h-full",style:{maxWidth:`${a.width}px`,maxHeight:`${a.height}px`},children:[K&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10",children:e.jsxs("div",{className:"flex flex-col items-center justify-center gap-6 bg-white rounded-lg p-8 shadow-sm w-[500px] h-[300px]",children:[e.jsx("div",{className:"mb-4",children:e.jsx(P,{})}),e.jsxs("div",{className:"flex flex-col gap-3 text-center",children:[e.jsx("h2",{className:"text-xl font-medium text-black leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Starting Interactive Mode"}),e.jsx("p",{className:"text-sm text-[#666] leading-5 m-0 font-['IBM_Plex_Sans']",children:"Setting up a sandboxed environment for your component"}),h&&e.jsxs("p",{className:"text-xs font-mono text-[#005c75] text-center leading-5 m-0 mt-3 font-['IBM_Plex_Mono'] uppercase",children:[e.jsx($,{}),h]})]})]})}),e.jsx("iframe",{src:y,className:"w-full h-full border-none",title:`Interactive preview: ${s==null?void 0:s.name}`,onLoad:E,style:{opacity:I?1:0}},W)]}):e.jsxs("div",{className:"flex flex-col items-center justify-center gap-6 w-[500px] h-[300px] bg-white rounded-lg p-8 shadow-sm",children:[e.jsx("div",{className:"mb-4",children:e.jsx(P,{})}),e.jsxs("div",{className:"flex flex-col gap-3 text-center",children:[e.jsx("h2",{className:"text-xl font-medium text-black leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Starting Interactive Mode"}),e.jsx("p",{className:"text-sm text-[#666] leading-5 m-0 font-['IBM_Plex_Sans']",children:"Setting up a sandboxed environment for your component"}),h&&e.jsxs("p",{className:"text-xs font-mono text-[#005c75] text-center leading-5 m-0 mt-3 font-['IBM_Plex_Mono'] uppercase",children:[e.jsx($,{}),h]})]})]})}),z&&e.jsx(ee,{width:a.width,height:a.height??900,onSave:R,onCancel:()=>p(!1)})]})});export{xe as default};
|