@codeyam/codeyam-cli 0.1.0-staging.b8a55ba → 0.1.0-staging.d0ad4ae
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/common/execAsync.ts +1 -1
- package/analyzer-template/log.txt +3 -3
- package/analyzer-template/package.json +7 -4
- package/analyzer-template/packages/ai/package.json +1 -1
- package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +14 -1
- package/analyzer-template/packages/ai/src/lib/checkAllAttributes.ts +29 -10
- package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +120 -19
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.ts +2 -1
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.ts +91 -35
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.ts +110 -74
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.ts +11 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertNullToUndefinedBySchema.ts +98 -0
- package/analyzer-template/packages/ai/src/lib/deepEqual.ts +30 -0
- package/analyzer-template/packages/ai/src/lib/findMatchingAttribute.ts +24 -17
- package/analyzer-template/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.ts +214 -39
- package/analyzer-template/packages/ai/src/lib/generateChangesEntityKeyAttributes.ts +54 -1
- package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarioData.ts +72 -6
- package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarios.ts +12 -5
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +39 -23
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.ts +32 -0
- package/analyzer-template/packages/analyze/src/lib/FileAnalyzer.ts +14 -0
- package/analyzer-template/packages/analyze/src/lib/asts/nodes/index.ts +1 -0
- package/analyzer-template/packages/analyze/src/lib/asts/nodes/isAsyncFunction.ts +67 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +73 -69
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +6 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyze/findOrCreateEntity.ts +3 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyzeChange.ts +22 -6
- package/analyzer-template/packages/analyze/src/lib/files/analyzeEntity.ts +9 -5
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.ts +49 -11
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichUnknownTypesFromSourceEquivalencies.ts +102 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.ts +399 -52
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.ts +128 -2
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +114 -70
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarioData.ts +34 -129
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +155 -79
- package/analyzer-template/packages/aws/codebuild/index.ts +1 -0
- package/analyzer-template/packages/aws/dist/src/lib/codebuild/waitForBuild.d.ts +11 -1
- package/analyzer-template/packages/aws/dist/src/lib/codebuild/waitForBuild.d.ts.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/codebuild/waitForBuild.js +29 -18
- package/analyzer-template/packages/aws/dist/src/lib/codebuild/waitForBuild.js.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsDefineContainer.d.ts +2 -2
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsDefineContainer.d.ts.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsDefineContainer.js +2 -2
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsDefineContainer.js.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsTaskFactory.d.ts +8 -18
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsTaskFactory.d.ts.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsTaskFactory.js +17 -61
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsTaskFactory.js.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/s3/uploadFileToS3.d.ts.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/s3/uploadFileToS3.js +8 -1
- package/analyzer-template/packages/aws/dist/src/lib/s3/uploadFileToS3.js.map +1 -1
- package/analyzer-template/packages/aws/package.json +1 -1
- package/analyzer-template/packages/aws/src/lib/codebuild/waitForBuild.ts +43 -19
- package/analyzer-template/packages/aws/src/lib/ecs/ecsDefineContainer.ts +3 -3
- package/analyzer-template/packages/aws/src/lib/ecs/ecsTaskFactory.ts +17 -69
- package/analyzer-template/packages/aws/src/lib/s3/uploadFileToS3.ts +8 -1
- package/analyzer-template/packages/generate/index.ts +3 -0
- package/analyzer-template/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.ts +17 -1
- package/analyzer-template/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.ts +193 -0
- package/analyzer-template/packages/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.ts +73 -0
- package/analyzer-template/packages/generate/src/lib/scenarioComponentForServer.ts +114 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/entitiesTable.d.ts +1 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/entitiesTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts +1 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/index.d.ts +3 -0
- package/analyzer-template/packages/github/dist/generate/index.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/index.js +3 -0
- package/analyzer-template/packages/github/dist/generate/index.js.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js +16 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.d.ts +9 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.d.ts.map +1 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +189 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.d.ts +20 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.d.ts.map +1 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.js +53 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.js.map +1 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponentForServer.d.ts +8 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponentForServer.d.ts.map +1 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponentForServer.js +89 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponentForServer.js.map +1 -0
- package/analyzer-template/packages/github/dist/github/src/lib/loadOrCreateCommit.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/github/src/lib/loadOrCreateCommit.js +10 -0
- package/analyzer-template/packages/github/dist/github/src/lib/loadOrCreateCommit.js.map +1 -1
- package/analyzer-template/packages/github/dist/github/src/lib/syncPrimaryBranch.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/github/src/lib/syncPrimaryBranch.js +3 -0
- package/analyzer-template/packages/github/dist/github/src/lib/syncPrimaryBranch.js.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/Entity.d.ts +2 -0
- package/analyzer-template/packages/github/dist/types/src/types/Entity.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts +6 -0
- package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts.map +1 -1
- package/analyzer-template/packages/github/src/lib/loadOrCreateCommit.ts +14 -0
- package/analyzer-template/packages/github/src/lib/syncPrimaryBranch.ts +2 -0
- package/analyzer-template/packages/process/index.ts +2 -0
- package/analyzer-template/packages/process/package.json +12 -0
- package/analyzer-template/packages/process/tsconfig.json +8 -0
- package/analyzer-template/packages/types/src/types/Entity.ts +2 -0
- package/analyzer-template/packages/types/src/types/Scenario.ts +6 -0
- package/analyzer-template/packages/utils/dist/types/src/types/Entity.d.ts +2 -0
- package/analyzer-template/packages/utils/dist/types/src/types/Entity.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts +6 -0
- package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts.map +1 -1
- package/analyzer-template/playwright/capture.ts +37 -18
- package/analyzer-template/playwright/waitForServer.ts +21 -6
- package/analyzer-template/project/constructMockCode.ts +781 -140
- package/analyzer-template/project/orchestrateCapture/KyselyAnalysisLoader.ts +3 -6
- package/analyzer-template/project/orchestrateCapture.ts +10 -3
- package/analyzer-template/project/reconcileMockDataKeys.ts +28 -100
- package/analyzer-template/project/runAnalysis.ts +5 -0
- package/analyzer-template/project/serverOnlyModules.ts +127 -2
- package/analyzer-template/project/start.ts +5 -3
- package/analyzer-template/project/startScenarioCapture.ts +6 -0
- package/analyzer-template/project/writeMockDataTsx.ts +50 -22
- package/analyzer-template/project/writeScenarioClientWrapper.ts +21 -0
- package/analyzer-template/project/writeScenarioComponents.ts +162 -100
- package/analyzer-template/project/writeScenarioFiles.ts +26 -0
- package/analyzer-template/project/writeSimpleRoot.ts +11 -35
- package/analyzer-template/scripts/comboWorkerLoop.cjs +1 -0
- package/analyzer-template/scripts/defaultCmd.sh +9 -0
- package/background/src/lib/local/createLocalAnalyzer.js +1 -29
- package/background/src/lib/local/createLocalAnalyzer.js.map +1 -1
- package/background/src/lib/local/execAsync.js +1 -1
- package/background/src/lib/local/execAsync.js.map +1 -1
- package/background/src/lib/virtualized/common/execAsync.js +1 -1
- package/background/src/lib/virtualized/common/execAsync.js.map +1 -1
- package/background/src/lib/virtualized/project/constructMockCode.js +718 -127
- package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture/KyselyAnalysisLoader.js +3 -2
- package/background/src/lib/virtualized/project/orchestrateCapture/KyselyAnalysisLoader.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture.js +7 -4
- package/background/src/lib/virtualized/project/orchestrateCapture.js.map +1 -1
- package/background/src/lib/virtualized/project/reconcileMockDataKeys.js +25 -61
- package/background/src/lib/virtualized/project/reconcileMockDataKeys.js.map +1 -1
- package/background/src/lib/virtualized/project/runAnalysis.js +4 -0
- package/background/src/lib/virtualized/project/runAnalysis.js.map +1 -1
- package/background/src/lib/virtualized/project/serverOnlyModules.js +106 -3
- package/background/src/lib/virtualized/project/serverOnlyModules.js.map +1 -1
- package/background/src/lib/virtualized/project/start.js +5 -3
- package/background/src/lib/virtualized/project/start.js.map +1 -1
- package/background/src/lib/virtualized/project/startScenarioCapture.js +7 -0
- package/background/src/lib/virtualized/project/startScenarioCapture.js.map +1 -1
- package/background/src/lib/virtualized/project/writeMockDataTsx.js +52 -23
- package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
- package/background/src/lib/virtualized/project/writeScenarioClientWrapper.js +15 -0
- package/background/src/lib/virtualized/project/writeScenarioClientWrapper.js.map +1 -0
- package/background/src/lib/virtualized/project/writeScenarioComponents.js +136 -83
- package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
- package/background/src/lib/virtualized/project/writeScenarioFiles.js +19 -0
- package/background/src/lib/virtualized/project/writeScenarioFiles.js.map +1 -1
- package/background/src/lib/virtualized/project/writeSimpleRoot.js +11 -34
- package/background/src/lib/virtualized/project/writeSimpleRoot.js.map +1 -1
- package/codeyam-cli/src/cli.js +5 -1
- package/codeyam-cli/src/cli.js.map +1 -1
- package/codeyam-cli/src/commands/analyze.js +1 -1
- package/codeyam-cli/src/commands/analyze.js.map +1 -1
- package/codeyam-cli/src/commands/baseline.js +177 -0
- package/codeyam-cli/src/commands/baseline.js.map +1 -0
- package/codeyam-cli/src/commands/status.js +23 -1
- package/codeyam-cli/src/commands/status.js.map +1 -1
- package/codeyam-cli/src/commands/test-startup.js +1 -1
- package/codeyam-cli/src/commands/test-startup.js.map +1 -1
- package/codeyam-cli/src/commands/wipe.js +108 -0
- package/codeyam-cli/src/commands/wipe.js.map +1 -0
- package/codeyam-cli/src/utils/database.js +91 -5
- package/codeyam-cli/src/utils/database.js.map +1 -1
- package/codeyam-cli/src/utils/git.js +79 -0
- package/codeyam-cli/src/utils/git.js.map +1 -0
- package/codeyam-cli/src/utils/queue/job.js +104 -0
- package/codeyam-cli/src/utils/queue/job.js.map +1 -1
- package/codeyam-cli/src/utils/queue/persistence.js.map +1 -1
- package/codeyam-cli/src/utils/wipe.js +128 -0
- package/codeyam-cli/src/utils/wipe.js.map +1 -0
- package/codeyam-cli/src/webserver/app/lib/database.js +66 -17
- package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-wXL1Z2Aq.js → EntityItem-Cmysw5OP.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-CzGX-miz.js → EntityTypeBadge-DLqD3qNt.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-CXFKsCOD.js → EntityTypeIcon-CAneekK2.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-D-9pXIaY.js → InteractivePreview-Cu16OUmx.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-CBQPrpT0.js → LibraryFunctionPreview-CVtiBnY5.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-D1CdlbrV.js → LoadingDots-B0GLXMsr.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-wDPcZNKx.js → LogViewer-xgeCVgSM.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-4lcOlid-.js → ReportIssueModal-DcAUIpD_.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-BfmDgXxG.js → SafeScreenshot-DuDvi0jm.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-BMKg0SAF.js +15 -0
- package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-6J7zDUD5.js → TruncatedFilePath-DyFZkK0l.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/_index-DSmTpjmK.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-BF_aK4y6.js +32 -0
- package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-BYimnrHg.js → chevron-down-Cx24_aWc.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/chunk-EPOLDU6W-CXRTFQ3F.js +51 -0
- package/codeyam-cli/src/webserver/build/client/assets/{circle-check-CaVsIRxt.js → circle-check-BOARzkeR.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-CgUsG7ib.js → createLucideIcon-BdhJEx6B.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{dev.empty-DW_hdGUc.js → dev.empty-RJCf3Tvw.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-zUEpfPsu.js → entity._sha._-D0-YwkBh.js} +12 -12
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-EylcgScH.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.create-scenario-D_3ero5o.js → entity._sha_.create-scenario-DMe7kvgo.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-CfLCUi9S.js → entity._sha_.edit._scenarioId-C1H_a_Y3.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entry.client-DKJyZfAY.js → entry.client-CS2cb_eZ.js} +6 -6
- package/codeyam-cli/src/webserver/build/client/assets/{fileTableUtils-DAtOlaWE.js → fileTableUtils-DMJ7zii9.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{files-ClR0d32A.js → files-BW7Cyeyi.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{git-D62Lxxmv.js → git-CZu4fif0.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/globals-wHVy_II5.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{index-CzNNiTkw.js → index-B1h680n5.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{index-BosqDOlH.js → index-lzqtyFU8.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-CNp9QFCX.js → loader-circle-B7B9V-bu.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{manifest-09d684be.js → manifest-2d191949.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/root-FHgpM6gc.js +56 -0
- package/codeyam-cli/src/webserver/build/client/assets/{search-DDGjYAMJ.js → search-CxXUmBSd.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{settings-DgTyB-Wg.js → settings-6D8k8Jp5.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/simulations-CDJZnWhN.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-CBc5dE1s.js → triangle-alert-B6LgvRJg.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useCustomSizes-BMIGFP-m.js → useCustomSizes-Dv18q8LD.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useInteractiveMode-Dk_FQqWJ.js → useInteractiveMode-0ToGk4K3.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-BqPPNjAl.js → useLastLogLine-aSv48UbS.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useReportContext-DsJbgMY9.js → useReportContext-1BX144Eg.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useToast-DWHcCcl1.js → useToast-mBRpZPiu.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/{index-CV6i1S1A.js → index-pU0o5t1o.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-YzfkRwdn.js +178 -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/templates/codeyam-setup-skill.md +138 -3
- package/codeyam-cli/templates/debug-codeyam.md +7 -2
- package/package.json +5 -5
- package/packages/ai/src/lib/astScopes/processExpression.js +13 -1
- package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
- package/packages/ai/src/lib/checkAllAttributes.js +24 -9
- package/packages/ai/src/lib/checkAllAttributes.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +94 -18
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js +2 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.js +51 -23
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js +70 -54
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js +11 -0
- package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/convertNullToUndefinedBySchema.js +86 -0
- package/packages/ai/src/lib/dataStructure/helpers/convertNullToUndefinedBySchema.js.map +1 -0
- package/packages/ai/src/lib/deepEqual.js +32 -0
- package/packages/ai/src/lib/deepEqual.js.map +1 -0
- package/packages/ai/src/lib/findMatchingAttribute.js +20 -16
- package/packages/ai/src/lib/findMatchingAttribute.js.map +1 -1
- package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js +168 -41
- package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js.map +1 -1
- package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js +42 -1
- package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js.map +1 -1
- package/packages/ai/src/lib/generateChangesEntityScenarioData.js +59 -3
- package/packages/ai/src/lib/generateChangesEntityScenarioData.js.map +1 -1
- package/packages/ai/src/lib/generateChangesEntityScenarios.js +6 -6
- package/packages/ai/src/lib/generateChangesEntityScenarios.js.map +1 -1
- package/packages/ai/src/lib/generateEntityScenarioData.js +32 -23
- package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js +20 -1
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js.map +1 -1
- package/packages/analyze/src/lib/FileAnalyzer.js +15 -0
- package/packages/analyze/src/lib/FileAnalyzer.js.map +1 -1
- package/packages/analyze/src/lib/asts/nodes/index.js +1 -0
- package/packages/analyze/src/lib/asts/nodes/index.js.map +1 -1
- package/packages/analyze/src/lib/asts/nodes/isAsyncFunction.js +52 -0
- package/packages/analyze/src/lib/asts/nodes/isAsyncFunction.js.map +1 -0
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +59 -50
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +6 -0
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js +2 -0
- package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeChange.js +14 -4
- package/packages/analyze/src/lib/files/analyzeChange.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeEntity.js +7 -6
- package/packages/analyze/src/lib/files/analyzeEntity.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js +44 -10
- package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/enrichUnknownTypesFromSourceEquivalencies.js +85 -0
- package/packages/analyze/src/lib/files/scenarios/enrichUnknownTypesFromSourceEquivalencies.js.map +1 -0
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js +314 -52
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.js +97 -2
- package/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +88 -52
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js +26 -98
- package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +141 -75
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
- package/packages/aws/src/lib/ecs/ecsDefineContainer.js +2 -2
- package/packages/aws/src/lib/ecs/ecsDefineContainer.js.map +1 -1
- package/packages/aws/src/lib/ecs/ecsTaskFactory.js +17 -61
- package/packages/aws/src/lib/ecs/ecsTaskFactory.js.map +1 -1
- package/packages/generate/index.js +3 -0
- package/packages/generate/index.js.map +1 -1
- package/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js +16 -1
- package/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js.map +1 -1
- package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +189 -0
- package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -0
- package/packages/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.js +53 -0
- package/packages/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.js.map +1 -0
- package/packages/generate/src/lib/scenarioComponentForServer.js +89 -0
- package/packages/generate/src/lib/scenarioComponentForServer.js.map +1 -0
- package/packages/github/src/lib/loadOrCreateCommit.js +10 -0
- package/packages/github/src/lib/loadOrCreateCommit.js.map +1 -1
- package/packages/github/src/lib/syncPrimaryBranch.js +3 -0
- package/packages/github/src/lib/syncPrimaryBranch.js.map +1 -1
- package/packages/process/index.js +3 -0
- package/packages/process/index.js.map +1 -0
- package/packages/process/src/GlobalProcessManager.js.map +1 -0
- package/{background/src/lib/process → packages/process/src}/ProcessManager.js +1 -1
- package/packages/process/src/ProcessManager.js.map +1 -0
- package/packages/process/src/index.js.map +1 -0
- package/packages/process/src/managedExecAsync.js.map +1 -0
- package/analyzer-template/process/INTEGRATION_COMPLETE.md +0 -333
- package/analyzer-template/process/INTEGRATION_EXAMPLE.md +0 -525
- package/analyzer-template/process/README.md +0 -507
- package/background/src/lib/process/GlobalProcessManager.js.map +0 -1
- package/background/src/lib/process/ProcessManager.js.map +0 -1
- package/background/src/lib/process/index.js.map +0 -1
- package/background/src/lib/process/managedExecAsync.js.map +0 -1
- package/codeyam-cli/scripts/fixtures/cal.com/universal-mocks/packages/prisma/index.js +0 -238
- package/codeyam-cli/scripts/fixtures/cal.com/universal-mocks/packages/prisma/index.js.map +0 -1
- package/codeyam-cli/scripts/fixtures/formbricks/universal-mocks/apps/web/lib/instance/service.js +0 -7
- package/codeyam-cli/scripts/fixtures/formbricks/universal-mocks/apps/web/lib/instance/service.js.map +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-CUxUNEEC.js +0 -15
- package/codeyam-cli/src/webserver/build/client/assets/_index-DHImXdXq.js +0 -11
- package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-2mG6mjVb.js +0 -32
- package/codeyam-cli/src/webserver/build/client/assets/chunk-JMJ3UQ3L-BambyYE_.js +0 -51
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-DyB90fWk.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/globals-C6vQASxy.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/root-BxJUvKau.js +0 -56
- package/codeyam-cli/src/webserver/build/client/assets/simulations-CoNWGt0K.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-BDlyhfrv.js +0 -175
- /package/analyzer-template/{process → packages/process/src}/GlobalProcessManager.ts +0 -0
- /package/analyzer-template/{process → packages/process/src}/ProcessManager.ts +0 -0
- /package/analyzer-template/{process → packages/process/src}/index.ts +0 -0
- /package/analyzer-template/{process → packages/process/src}/managedExecAsync.ts +0 -0
- /package/{background/src/lib/process → packages/process/src}/GlobalProcessManager.js +0 -0
- /package/{background/src/lib/process → packages/process/src}/index.js +0 -0
- /package/{background/src/lib/process → packages/process/src}/managedExecAsync.js +0 -0
package/codeyam-cli/src/webserver/build/client/assets/{settings-DgTyB-Wg.js → settings-6D8k8Jp5.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{w as te,u as ae,e as re,c as ne,f as ie,r,j as e}from"./chunk-JMJ3UQ3L-BambyYE_.js";import{u as oe}from"./useReportContext-DsJbgMY9.js";const me=()=>[{title:"CodeYam - Settings"},{name:"description",content:"Configure project settings"}];function D(c){if(!c)return"";const t=[c.command];return c.args&&c.args.length>0&&t.push(...c.args),t.join(" ")}function F({mock:c,onSave:t,onCancel:o}){const[i,u]=r.useState(c.entityName),[l,n]=r.useState(c.filePath),[p,x]=r.useState(c.content),y=()=>{if(!i.trim()||!l.trim()||!p.trim()){alert("All fields are required");return}t({entityName:i,filePath:l,content:p})};return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Entity Name"}),e.jsx("input",{type:"text",value:i,onChange:m=>u(m.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded text-sm focus:outline-none focus:border-[#005C75] focus:ring-1 focus:ring-[#005C75]",placeholder:"e.g., determineDatabaseType"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"File Path"}),e.jsx("input",{type:"text",value:l,onChange:m=>n(m.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded text-sm focus:outline-none focus:border-[#005C75] focus:ring-1 focus:ring-[#005C75]",placeholder:"e.g., packages/database/src/lib/kysely/db.ts"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Content"}),e.jsx("textarea",{value:p,onChange:m=>x(m.target.value),rows:6,className:"w-full px-3 py-2 border border-gray-300 rounded text-sm font-mono focus:outline-none focus:border-[#005C75] focus:ring-1 focus:ring-[#005C75]",placeholder:"e.g., function determineDatabaseType() { return 'postgresql' }"})]}),e.jsxs("div",{className:"flex gap-2 justify-end",children:[e.jsx("button",{type:"button",onClick:o,className:"px-4 py-2 bg-gray-200 text-gray-800 border-none rounded text-sm cursor-pointer hover:bg-gray-300",children:"Cancel"}),e.jsx("button",{type:"button",onClick:y,className:"px-4 py-2 bg-[#005C75] text-white border-none rounded text-sm cursor-pointer hover:bg-[#004a5d]",children:"Save"})]})]})}function le(c){try{return new Date(c).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return c}}const xe=te(function(){var R,q;const{config:t,secrets:o,versionInfo:i,error:u}=ae(),l=re(),n=ne(),p=ie(),[x,y]=r.useState("project-metadata");oe({source:"settings-page"});const[m,h]=r.useState((t==null?void 0:t.universalMocks)||[]),[j,A]=r.useState(((t==null?void 0:t.pathsToIgnore)||[]).join(", ")),[S,V]=r.useState(((t==null?void 0:t.pathsToIgnore)||[]).join(", ")),[$,k]=r.useState((o==null?void 0:o.GROQ_API_KEY)||""),[z,P]=r.useState((o==null?void 0:o.ANTHROPIC_API_KEY)||""),[G,I]=r.useState((o==null?void 0:o.OPENAI_API_KEY)||""),[f,U]=r.useState(!1),[N,Y]=r.useState(!1),[v,H]=r.useState(!1),[K,g]=r.useState(!1),[M,L]=r.useState(!1),[T,E]=r.useState(!1),[W,C]=r.useState(null),[J,b]=r.useState(!1),[w,_]=r.useState({});r.useEffect(()=>{var s;if(t){h(t.universalMocks||[]);const a=(t.pathsToIgnore||[]).join(", ");A(a),V(a);const d={};(s=t.webapps)==null||s.forEach((O,se)=>{O.startCommand&&(d[se]=D(O.startCommand))}),_(d)}o&&(k(o.GROQ_API_KEY||""),P(o.ANTHROPIC_API_KEY||""),I(o.OPENAI_API_KEY||""))},[t,o]),r.useEffect(()=>{if(l!=null&&l.success){g(!0);const s=setTimeout(()=>g(!1),3e3);return()=>clearTimeout(s)}},[l]),r.useEffect(()=>{if(n.state==="idle"&&n.data&&!T){console.log("[Settings] Fetcher data:",n.data);const s=n.data;if(s.success){console.log("[Settings] Save successful, revalidating..."),g(!0),E(!0),(j!==S||s.requiresRestart)&&L(!0),p.revalidate();const a=setTimeout(()=>{g(!1),E(!1)},3e3);return()=>clearTimeout(a)}}},[n.state,n.data,T,p,j,S]);const Q=s=>{s.preventDefault();const a=new FormData(s.currentTarget);a.set("universalMocks",JSON.stringify(m)),a.set("startCommands",JSON.stringify(w)),console.log("[Settings] Submitting form data:",{universalMocks:a.get("universalMocks"),startCommands:a.get("startCommands"),openAiApiKey:a.get("openAiApiKey")?"***":"(empty)"}),n.submit(a,{method:"post"})},B=s=>{h([...m,s]),b(!1)},X=(s,a)=>{const d=[...m];d[s]=a,h(d),C(null)},Z=s=>{h(m.filter((a,d)=>d!==s))};if(u)return e.jsxs("div",{className:"max-w-6xl mx-auto p-8 font-sans",children:[e.jsx("header",{className:"mb-6 pb-4 border-b border-gray-200",children:e.jsx("div",{className:"flex justify-between items-center",children:e.jsx("h1",{className:"text-4xl font-bold text-gray-900",children:"Settings"})})}),e.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:e.jsx("p",{className:"text-red-700",children:u})})]});const ee=[{id:"project-metadata",label:"Project Metadata"},{id:"ai-provider",label:"AI Provider Configuration"},{id:"commands",label:"Commands"},{id:"paths-to-ignore",label:"Paths To Ignore"},{id:"universal-mocks",label:"Universal Mocks"},{id:"current-configuration",label:"Current Configuration"}];return e.jsx("div",{className:"bg-[#f9f9f9] min-h-screen",children:e.jsxs("div",{className:"px-20 py-12 font-sans",children:[e.jsxs("div",{className:"mb-8 flex justify-between items-start",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-semibold text-gray-900 mb-2",children:"Settings"}),e.jsx("p",{className:"text-gray-600",children:"Project Configuration"})]}),e.jsx("button",{type:"submit",form:"settings-form",disabled:n.state==="submitting",className:"px-6 py-2 bg-[#005C75] text-white border-none rounded text-sm font-medium cursor-pointer disabled:cursor-not-allowed disabled:opacity-60 hover:bg-[#004a5d] whitespace-nowrap",children:n.state==="submitting"?"Saving...":"Save Settings"})]}),e.jsxs("div",{className:"flex gap-8 items-start",children:[e.jsx("nav",{className:"w-64 flex-shrink-0",children:e.jsx("ul",{className:"space-y-1",children:ee.map(s=>e.jsx("li",{children:e.jsx("button",{type:"button",onClick:()=>y(s.id),className:`w-full text-left px-0 py-2.5 text-sm transition-colors cursor-pointer ${x===s.id?"text-[#005C75] font-medium":"text-gray-600 hover:text-gray-900"}`,children:s.label})},s.id))})}),e.jsx("div",{className:"flex-1 min-w-0 -mt-2",children:e.jsxs("form",{id:"settings-form",onSubmit:Q,className:"space-y-6",children:[x==="project-metadata"&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Project Metadata"}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"block mb-2 font-medium text-gray-700",children:"Web Applications"}),t!=null&&t.webapps&&t.webapps.length>0?e.jsx("div",{className:"space-y-3",children:t.webapps.map((s,a)=>{var d;return e.jsx("div",{className:"p-4 bg-white border border-gray-200 rounded",children:e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Path:"})," ",e.jsx("span",{className:"text-gray-900",children:s.path==="."?"Root":s.path})]}),s.appDirectory&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"App Directory:"})," ",e.jsx("span",{className:"text-gray-900",children:s.appDirectory})]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Framework:"})," ",e.jsx("span",{className:"text-gray-900",children:s.framework})]}),s.startCommand&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Start Command:"})," ",e.jsxs("span",{className:"text-gray-900 font-mono text-xs",children:[s.startCommand.command," ",(d=s.startCommand.args)==null?void 0:d.join(" ")]})]})]})},a)})}):e.jsx("p",{className:"text-sm text-gray-600 italic",children:"No web applications configured"}),e.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"Web applications are detected during initialization. To modify, edit `.codeyam/config.json` or re-run `codeyam init`."})]})]}),x==="ai-provider"&&e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-800 mb-4",children:"AI Provider API Keys"}),e.jsx("p",{className:"text-sm text-gray-600 mb-6",children:"Configure API keys for AI-powered analysis. Choose the provider that best fits your needs."}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"border border-gray-200 rounded-lg p-5 bg-white",children:[e.jsx("div",{className:"flex items-start justify-between mb-3",children:e.jsxs("div",{children:[e.jsx("h4",{className:"text-base font-semibold text-gray-900 mb-1",children:"Groq"}),e.jsx("p",{className:"text-sm text-gray-600 mb-3",children:"Lightning-fast inference with industry-leading speed. Groq's LPU architecture delivers exceptional performance for real-time AI applications with competitive pricing."}),e.jsxs("div",{className:"flex gap-3 text-xs",children:[e.jsxs("div",{className:"px-2 py-1 bg-green-100 text-green-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Cost:"})," ","$0.10/1M tokens"]}),e.jsxs("div",{className:"px-2 py-1 bg-cyan-100 text-cyan-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Speed:"})," 850 tokens/s"]}),e.jsxs("div",{className:"px-2 py-1 bg-purple-100 text-purple-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Reliability:"})," ","Less reliable, but capable of producing reasonable results"]})]})]})}),e.jsxs("div",{className:"mt-4",children:[e.jsx("label",{htmlFor:"groqApiKey",className:"block text-sm font-medium text-gray-700 mb-2",children:"API Key"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:f?"text":"password",id:"groqApiKey",name:"groqApiKey",value:$,onChange:s=>k(s.target.value),placeholder:"gsk_...",className:"w-full px-3 py-2 pr-24 border border-gray-300 rounded text-sm focus:outline-none focus:border-[#005C75] focus:ring-1 focus:ring-[#005C75]"}),e.jsx("button",{type:"button",onClick:()=>U(!f),className:"absolute right-2 top-1/2 -translate-y-1/2 px-3 py-1 text-xs text-gray-600 hover:text-gray-800 focus:outline-none cursor-pointer",children:f?"Hide":"Show"})]})]})]}),e.jsxs("div",{className:"border border-gray-200 rounded-lg p-5 bg-white",children:[e.jsx("div",{className:"flex items-start justify-between mb-3",children:e.jsxs("div",{children:[e.jsx("h4",{className:"text-base font-semibold text-gray-900 mb-1",children:"Anthropic Claude"}),e.jsx("p",{className:"text-sm text-gray-600 mb-3",children:"Advanced reasoning and coding capabilities with superior context understanding. Claude excels at complex analysis tasks and provides highly accurate results with detailed explanations."}),e.jsxs("div",{className:"flex gap-3 text-xs",children:[e.jsxs("div",{className:"px-2 py-1 bg-green-100 text-green-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Cost:"})," ","$3.00/1M tokens"]}),e.jsxs("div",{className:"px-2 py-1 bg-cyan-100 text-cyan-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Speed:"})," 120 tokens/s"]}),e.jsxs("div",{className:"px-2 py-1 bg-purple-100 text-purple-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Reliability:"})," ","Consistent, high quality results"]})]})]})}),e.jsxs("div",{className:"mt-4",children:[e.jsx("label",{htmlFor:"anthropicApiKey",className:"block text-sm font-medium text-gray-700 mb-2",children:"API Key"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:N?"text":"password",id:"anthropicApiKey",name:"anthropicApiKey",value:z,onChange:s=>P(s.target.value),placeholder:"sk-ant-...",className:"w-full px-3 py-2 pr-24 border border-gray-300 rounded text-sm focus:outline-none focus:border-[#005C75] focus:ring-1 focus:ring-[#005C75]"}),e.jsx("button",{type:"button",onClick:()=>Y(!N),className:"absolute right-2 top-1/2 -translate-y-1/2 px-3 py-1 text-xs text-gray-600 hover:text-gray-800 focus:outline-none cursor-pointer",children:N?"Hide":"Show"})]})]})]}),e.jsxs("div",{className:"border border-gray-200 rounded-lg p-5 bg-white",children:[e.jsx("div",{className:"flex items-start justify-between mb-3",children:e.jsxs("div",{children:[e.jsx("h4",{className:"text-base font-semibold text-gray-900 mb-1",children:"OpenAI GPT"}),e.jsx("p",{className:"text-sm text-gray-600 mb-3",children:"Industry-standard AI with broad capabilities and extensive ecosystem. GPT models offer reliable performance across diverse tasks with good balance of speed and quality."}),e.jsxs("div",{className:"flex gap-3 text-xs",children:[e.jsxs("div",{className:"px-2 py-1 bg-green-100 text-green-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Cost:"})," ","$2.50/1M tokens"]}),e.jsxs("div",{className:"px-2 py-1 bg-cyan-100 text-cyan-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Speed:"})," 150 tokens/s"]}),e.jsxs("div",{className:"px-2 py-1 bg-purple-100 text-purple-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Reliability:"})," ","Consistent, high quality results"]})]})]})}),e.jsxs("div",{className:"mt-4",children:[e.jsx("label",{htmlFor:"openAiApiKey",className:"block text-sm font-medium text-gray-700 mb-2",children:"API Key"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:v?"text":"password",id:"openAiApiKey",name:"openAiApiKey",value:G,onChange:s=>I(s.target.value),placeholder:"sk-...",className:"w-full px-3 py-2 pr-24 border border-gray-300 rounded text-sm focus:outline-none focus:border-[#005C75] focus:ring-1 focus:ring-[#005C75]"}),e.jsx("button",{type:"button",onClick:()=>H(!v),className:"absolute right-2 top-1/2 -translate-y-1/2 px-3 py-1 text-xs text-gray-600 hover:text-gray-800 focus:outline-none cursor-pointer",children:v?"Hide":"Show"})]})]})]})]})]}),x==="commands"&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Commands"}),e.jsx("p",{className:"text-sm text-gray-600 mb-6",children:"Configure start commands for your web applications"}),t!=null&&t.webapps&&t.webapps.length>0?e.jsx("div",{className:"space-y-4",children:t.webapps.map((s,a)=>e.jsxs("div",{className:"border border-gray-200 rounded-lg p-5 bg-white",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("div",{className:"text-base font-semibold text-gray-900 mb-1",children:s.path==="."?"Root":s.path}),e.jsx("div",{className:"text-sm text-gray-600",children:s.framework})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:`startCommand-${a}`,className:"block text-sm font-medium text-gray-700 mb-2",children:"Start Command"}),e.jsx("input",{type:"text",id:`startCommand-${a}`,name:`startCommand-${a}`,value:w[a]||"",onChange:d=>_({...w,[a]:d.target.value}),placeholder:"e.g., pnpm dev --port $PORT",className:"w-full px-3 py-2 border border-gray-300 rounded text-sm font-mono focus:outline-none focus:border-[#005C75] focus:ring-1 focus:ring-[#005C75]"}),e.jsx("p",{className:"mt-2 text-xs text-gray-500",children:"Use $PORT as a placeholder for the dynamic port number"})]})]},a))}):e.jsx("p",{className:"text-sm text-gray-600 italic",children:"No web applications configured"})]}),x==="paths-to-ignore"&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Paths To Ignore"}),e.jsx("input",{type:"text",id:"pathsToIgnore",name:"pathsToIgnore",value:j,onChange:s=>A(s.target.value),placeholder:"e.g., __tests__, \\.test\\.ts$, ^background (no quotes needed)",className:"w-full px-3 py-3 border border-gray-300 rounded text-sm font-mono focus:outline-none focus:border-[#005C75] focus:ring-2 focus:ring-[#005C75]/10"}),e.jsxs("p",{className:"mt-2 text-sm text-gray-600",children:["Comma-separated list of regex patterns for paths to ignore during file watching. Examples:"," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:"__tests__"}),","," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:"\\.test\\.tsx?$"}),","," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:"^background"}),e.jsx("br",{}),e.jsx("span",{className:"text-xs text-gray-500 mt-1 inline-block",children:"Note: Files matching patterns in .gitignore are also automatically ignored"})]})]}),x==="universal-mocks"&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Universal Mocks"}),e.jsx("p",{className:"mb-3 text-sm text-gray-600",children:"Mock functions that will be applied across all entity simulations"}),m.length===0?e.jsxs("div",{className:"mb-4",children:[e.jsx("div",{className:"text-sm text-gray-500 mb-3",children:"No universal mocks configured"}),e.jsx("button",{type:"button",onClick:()=>b(!0),className:"px-4 py-2 bg-[#005C75] text-white border-none rounded text-sm cursor-pointer hover:bg-[#004a5d]",children:"Add Mock"})]}):e.jsx("div",{className:"space-y-3",children:m.map((s,a)=>e.jsx("div",{className:"p-4 bg-gray-50 rounded border border-gray-200",children:W===a?e.jsx(F,{mock:s,onSave:d=>X(a,d),onCancel:()=>C(null)}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex justify-between items-start mb-2",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"font-medium text-gray-800 mb-1",children:s.entityName}),e.jsx("div",{className:"text-sm text-gray-600 mb-2",children:s.filePath}),e.jsx("pre",{className:"text-xs bg-white p-2 rounded border border-gray-200 overflow-x-auto",children:s.content})]}),e.jsxs("div",{className:"flex gap-2 ml-3",children:[e.jsx("button",{type:"button",onClick:()=>C(a),className:"px-3 py-1 bg-teal-600 text-white border-none rounded text-sm cursor-pointer hover:bg-teal-700",children:"Edit"}),e.jsx("button",{type:"button",onClick:()=>Z(a),className:"px-3 py-1 bg-red-600 text-white border-none rounded text-sm cursor-pointer hover:bg-red-700",children:"Delete"})]})]})})},a))}),m.length>0&&e.jsx("button",{type:"button",onClick:()=>b(!0),className:"mt-4 px-4 py-2 bg-[#005C75] text-white border-none rounded text-sm cursor-pointer hover:bg-[#004a5d]",children:"Add Mock"})]}),x==="current-configuration"&&e.jsxs("div",{className:"space-y-6",children:[t&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Current Configuration"}),e.jsx("div",{className:"p-4 bg-white border border-gray-200 rounded mb-6",children:e.jsxs("div",{className:"space-y-2 text-sm",children:[t.projectSlug&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Project Slug:"})," ",e.jsx("span",{className:"text-gray-900",children:t.projectSlug})]}),t.packageManager&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Package Manager:"})," ",e.jsx("span",{className:"text-gray-900",children:t.packageManager})]})]})}),t.webapps&&t.webapps.length>0&&e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-gray-800 mb-3",children:"Web Applications"}),e.jsx("div",{className:"space-y-3",children:t.webapps.map((s,a)=>e.jsx("div",{className:"p-4 bg-white border border-gray-200 rounded",children:e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Path:"})," ",e.jsx("span",{className:"text-gray-900",children:s.path==="."?"Root":s.path})]}),s.appDirectory&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"App Directory:"})," ",e.jsx("span",{className:"text-gray-900",children:s.appDirectory})]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Framework:"})," ",e.jsx("span",{className:"text-gray-900",children:s.framework})]}),s.startCommand&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Start Command:"})," ",e.jsx("span",{className:"text-gray-900 font-mono text-xs",children:D(s.startCommand)})]})]})},a))})]})]}),i&&e.jsxs("div",{className:"mt-6",children:[e.jsx("h3",{className:"text-base font-semibold text-gray-800 mb-3",children:"Version Information"}),e.jsx("div",{className:"p-4 bg-white border border-gray-200 rounded",children:e.jsxs("div",{className:"space-y-2 text-sm",children:[i.webserverVersion&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Webserver:"})," ",e.jsx("span",{className:"text-gray-900 font-mono",children:i.webserverVersion.version||"unknown"})]}),i.templateVersion&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Analyzer Template:"})," ",e.jsx("span",{className:"font-mono text-gray-900",children:i.templateVersion.version||((R=i.templateVersion.gitCommit)==null?void 0:R.slice(0,7))||"unknown"}),i.templateVersion.buildTimestamp&&e.jsxs("span",{className:"text-gray-500 ml-2",children:["(built"," ",le(i.templateVersion.buildTimestamp),")"]})]}),i.cachedAnalyzerVersion&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Cached Analyzer:"})," ",e.jsx("span",{className:"font-mono text-gray-900",children:i.cachedAnalyzerVersion.version||((q=i.cachedAnalyzerVersion.gitCommit)==null?void 0:q.slice(0,7))||"unknown"}),i.isCacheStale?e.jsx("span",{className:"ml-2 px-2 py-0.5 bg-amber-100 text-amber-800 rounded text-xs",children:"Stale - will update on next analysis"}):e.jsx("span",{className:"ml-2 px-2 py-0.5 bg-green-100 text-green-800 rounded text-xs",children:"Up to date"})]}),!i.cachedAnalyzerVersion&&(t==null?void 0:t.projectSlug)&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Cached Analyzer:"})," ",e.jsx("span",{className:"text-gray-500 italic",children:"Not initialized - will be created on first analysis"})]})]})})]})]})]})})]}),(K||M||(l==null?void 0:l.error)||n.data&&typeof n.data=="object"&&"error"in n.data)&&e.jsxs("div",{className:"mt-6 max-w-5xl mx-auto space-y-3",children:[K&&e.jsx("div",{className:"text-emerald-600 text-sm font-medium bg-emerald-50 border border-emerald-200 rounded px-4 py-2",children:"Settings saved successfully!"}),M&&e.jsxs("div",{className:"text-amber-700 text-sm font-medium bg-amber-50 border border-amber-200 rounded px-4 py-2",children:[e.jsx("div",{children:"⚠️ Settings changed. Please restart CodeYam for changes to take effect:"}),e.jsx("code",{className:"ml-2 bg-amber-100 px-2 py-1 rounded text-xs",children:"codeyam stop && codeyam"})]}),(l==null?void 0:l.error)&&e.jsx("div",{className:"text-red-600 text-sm font-medium bg-red-50 border border-red-200 rounded px-4 py-2",children:l.error}),(()=>{if(n.data&&typeof n.data=="object"&&"error"in n.data){const s=n.data;return typeof s.error=="string"?e.jsx("div",{className:"text-red-600 text-sm font-medium bg-red-50 border border-red-200 rounded px-4 py-2",children:s.error}):null}return null})()]}),J&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center p-4 z-50",children:e.jsxs("div",{className:"bg-white rounded-lg max-w-2xl w-full p-6",children:[e.jsx("h2",{className:"text-2xl font-bold mb-4 text-gray-900",children:"Add Universal Mock"}),e.jsx(F,{mock:{entityName:"",filePath:"",content:""},onSave:B,onCancel:()=>b(!1)})]})})]})})});export{xe as default,me as meta};
|
|
1
|
+
import{w as te,u as ae,e as re,c as ne,f as ie,r,j as e}from"./chunk-EPOLDU6W-CXRTFQ3F.js";import{u as oe}from"./useReportContext-1BX144Eg.js";const me=()=>[{title:"CodeYam - Settings"},{name:"description",content:"Configure project settings"}];function D(c){if(!c)return"";const t=[c.command];return c.args&&c.args.length>0&&t.push(...c.args),t.join(" ")}function F({mock:c,onSave:t,onCancel:o}){const[i,u]=r.useState(c.entityName),[l,n]=r.useState(c.filePath),[p,x]=r.useState(c.content),y=()=>{if(!i.trim()||!l.trim()||!p.trim()){alert("All fields are required");return}t({entityName:i,filePath:l,content:p})};return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Entity Name"}),e.jsx("input",{type:"text",value:i,onChange:m=>u(m.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded text-sm focus:outline-none focus:border-[#005C75] focus:ring-1 focus:ring-[#005C75]",placeholder:"e.g., determineDatabaseType"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"File Path"}),e.jsx("input",{type:"text",value:l,onChange:m=>n(m.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded text-sm focus:outline-none focus:border-[#005C75] focus:ring-1 focus:ring-[#005C75]",placeholder:"e.g., packages/database/src/lib/kysely/db.ts"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Content"}),e.jsx("textarea",{value:p,onChange:m=>x(m.target.value),rows:6,className:"w-full px-3 py-2 border border-gray-300 rounded text-sm font-mono focus:outline-none focus:border-[#005C75] focus:ring-1 focus:ring-[#005C75]",placeholder:"e.g., function determineDatabaseType() { return 'postgresql' }"})]}),e.jsxs("div",{className:"flex gap-2 justify-end",children:[e.jsx("button",{type:"button",onClick:o,className:"px-4 py-2 bg-gray-200 text-gray-800 border-none rounded text-sm cursor-pointer hover:bg-gray-300",children:"Cancel"}),e.jsx("button",{type:"button",onClick:y,className:"px-4 py-2 bg-[#005C75] text-white border-none rounded text-sm cursor-pointer hover:bg-[#004a5d]",children:"Save"})]})]})}function le(c){try{return new Date(c).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return c}}const xe=te(function(){var R,q;const{config:t,secrets:o,versionInfo:i,error:u}=ae(),l=re(),n=ne(),p=ie(),[x,y]=r.useState("project-metadata");oe({source:"settings-page"});const[m,h]=r.useState((t==null?void 0:t.universalMocks)||[]),[j,A]=r.useState(((t==null?void 0:t.pathsToIgnore)||[]).join(", ")),[S,V]=r.useState(((t==null?void 0:t.pathsToIgnore)||[]).join(", ")),[$,k]=r.useState((o==null?void 0:o.GROQ_API_KEY)||""),[z,P]=r.useState((o==null?void 0:o.ANTHROPIC_API_KEY)||""),[G,I]=r.useState((o==null?void 0:o.OPENAI_API_KEY)||""),[f,U]=r.useState(!1),[N,Y]=r.useState(!1),[v,H]=r.useState(!1),[K,g]=r.useState(!1),[M,L]=r.useState(!1),[T,E]=r.useState(!1),[W,C]=r.useState(null),[J,b]=r.useState(!1),[w,_]=r.useState({});r.useEffect(()=>{var s;if(t){h(t.universalMocks||[]);const a=(t.pathsToIgnore||[]).join(", ");A(a),V(a);const d={};(s=t.webapps)==null||s.forEach((O,se)=>{O.startCommand&&(d[se]=D(O.startCommand))}),_(d)}o&&(k(o.GROQ_API_KEY||""),P(o.ANTHROPIC_API_KEY||""),I(o.OPENAI_API_KEY||""))},[t,o]),r.useEffect(()=>{if(l!=null&&l.success){g(!0);const s=setTimeout(()=>g(!1),3e3);return()=>clearTimeout(s)}},[l]),r.useEffect(()=>{if(n.state==="idle"&&n.data&&!T){console.log("[Settings] Fetcher data:",n.data);const s=n.data;if(s.success){console.log("[Settings] Save successful, revalidating..."),g(!0),E(!0),(j!==S||s.requiresRestart)&&L(!0),p.revalidate();const a=setTimeout(()=>{g(!1),E(!1)},3e3);return()=>clearTimeout(a)}}},[n.state,n.data,T,p,j,S]);const Q=s=>{s.preventDefault();const a=new FormData(s.currentTarget);a.set("universalMocks",JSON.stringify(m)),a.set("startCommands",JSON.stringify(w)),console.log("[Settings] Submitting form data:",{universalMocks:a.get("universalMocks"),startCommands:a.get("startCommands"),openAiApiKey:a.get("openAiApiKey")?"***":"(empty)"}),n.submit(a,{method:"post"})},B=s=>{h([...m,s]),b(!1)},X=(s,a)=>{const d=[...m];d[s]=a,h(d),C(null)},Z=s=>{h(m.filter((a,d)=>d!==s))};if(u)return e.jsxs("div",{className:"max-w-6xl mx-auto p-8 font-sans",children:[e.jsx("header",{className:"mb-6 pb-4 border-b border-gray-200",children:e.jsx("div",{className:"flex justify-between items-center",children:e.jsx("h1",{className:"text-4xl font-bold text-gray-900",children:"Settings"})})}),e.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:e.jsx("p",{className:"text-red-700",children:u})})]});const ee=[{id:"project-metadata",label:"Project Metadata"},{id:"ai-provider",label:"AI Provider Configuration"},{id:"commands",label:"Commands"},{id:"paths-to-ignore",label:"Paths To Ignore"},{id:"universal-mocks",label:"Universal Mocks"},{id:"current-configuration",label:"Current Configuration"}];return e.jsx("div",{className:"bg-[#f9f9f9] min-h-screen",children:e.jsxs("div",{className:"px-20 py-12 font-sans",children:[e.jsxs("div",{className:"mb-8 flex justify-between items-start",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-semibold text-gray-900 mb-2",children:"Settings"}),e.jsx("p",{className:"text-gray-600",children:"Project Configuration"})]}),e.jsx("button",{type:"submit",form:"settings-form",disabled:n.state==="submitting",className:"px-6 py-2 bg-[#005C75] text-white border-none rounded text-sm font-medium cursor-pointer disabled:cursor-not-allowed disabled:opacity-60 hover:bg-[#004a5d] whitespace-nowrap",children:n.state==="submitting"?"Saving...":"Save Settings"})]}),e.jsxs("div",{className:"flex gap-8 items-start",children:[e.jsx("nav",{className:"w-64 flex-shrink-0",children:e.jsx("ul",{className:"space-y-1",children:ee.map(s=>e.jsx("li",{children:e.jsx("button",{type:"button",onClick:()=>y(s.id),className:`w-full text-left px-0 py-2.5 text-sm transition-colors cursor-pointer ${x===s.id?"text-[#005C75] font-medium":"text-gray-600 hover:text-gray-900"}`,children:s.label})},s.id))})}),e.jsx("div",{className:"flex-1 min-w-0 -mt-2",children:e.jsxs("form",{id:"settings-form",onSubmit:Q,className:"space-y-6",children:[x==="project-metadata"&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Project Metadata"}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"block mb-2 font-medium text-gray-700",children:"Web Applications"}),t!=null&&t.webapps&&t.webapps.length>0?e.jsx("div",{className:"space-y-3",children:t.webapps.map((s,a)=>{var d;return e.jsx("div",{className:"p-4 bg-white border border-gray-200 rounded",children:e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Path:"})," ",e.jsx("span",{className:"text-gray-900",children:s.path==="."?"Root":s.path})]}),s.appDirectory&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"App Directory:"})," ",e.jsx("span",{className:"text-gray-900",children:s.appDirectory})]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Framework:"})," ",e.jsx("span",{className:"text-gray-900",children:s.framework})]}),s.startCommand&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Start Command:"})," ",e.jsxs("span",{className:"text-gray-900 font-mono text-xs",children:[s.startCommand.command," ",(d=s.startCommand.args)==null?void 0:d.join(" ")]})]})]})},a)})}):e.jsx("p",{className:"text-sm text-gray-600 italic",children:"No web applications configured"}),e.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"Web applications are detected during initialization. To modify, edit `.codeyam/config.json` or re-run `codeyam init`."})]})]}),x==="ai-provider"&&e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-800 mb-4",children:"AI Provider API Keys"}),e.jsx("p",{className:"text-sm text-gray-600 mb-6",children:"Configure API keys for AI-powered analysis. Choose the provider that best fits your needs."}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"border border-gray-200 rounded-lg p-5 bg-white",children:[e.jsx("div",{className:"flex items-start justify-between mb-3",children:e.jsxs("div",{children:[e.jsx("h4",{className:"text-base font-semibold text-gray-900 mb-1",children:"Groq"}),e.jsx("p",{className:"text-sm text-gray-600 mb-3",children:"Lightning-fast inference with industry-leading speed. Groq's LPU architecture delivers exceptional performance for real-time AI applications with competitive pricing."}),e.jsxs("div",{className:"flex gap-3 text-xs",children:[e.jsxs("div",{className:"px-2 py-1 bg-green-100 text-green-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Cost:"})," ","$0.10/1M tokens"]}),e.jsxs("div",{className:"px-2 py-1 bg-cyan-100 text-cyan-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Speed:"})," 850 tokens/s"]}),e.jsxs("div",{className:"px-2 py-1 bg-purple-100 text-purple-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Reliability:"})," ","Less reliable, but capable of producing reasonable results"]})]})]})}),e.jsxs("div",{className:"mt-4",children:[e.jsx("label",{htmlFor:"groqApiKey",className:"block text-sm font-medium text-gray-700 mb-2",children:"API Key"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:f?"text":"password",id:"groqApiKey",name:"groqApiKey",value:$,onChange:s=>k(s.target.value),placeholder:"gsk_...",className:"w-full px-3 py-2 pr-24 border border-gray-300 rounded text-sm focus:outline-none focus:border-[#005C75] focus:ring-1 focus:ring-[#005C75]"}),e.jsx("button",{type:"button",onClick:()=>U(!f),className:"absolute right-2 top-1/2 -translate-y-1/2 px-3 py-1 text-xs text-gray-600 hover:text-gray-800 focus:outline-none cursor-pointer",children:f?"Hide":"Show"})]})]})]}),e.jsxs("div",{className:"border border-gray-200 rounded-lg p-5 bg-white",children:[e.jsx("div",{className:"flex items-start justify-between mb-3",children:e.jsxs("div",{children:[e.jsx("h4",{className:"text-base font-semibold text-gray-900 mb-1",children:"Anthropic Claude"}),e.jsx("p",{className:"text-sm text-gray-600 mb-3",children:"Advanced reasoning and coding capabilities with superior context understanding. Claude excels at complex analysis tasks and provides highly accurate results with detailed explanations."}),e.jsxs("div",{className:"flex gap-3 text-xs",children:[e.jsxs("div",{className:"px-2 py-1 bg-green-100 text-green-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Cost:"})," ","$3.00/1M tokens"]}),e.jsxs("div",{className:"px-2 py-1 bg-cyan-100 text-cyan-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Speed:"})," 120 tokens/s"]}),e.jsxs("div",{className:"px-2 py-1 bg-purple-100 text-purple-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Reliability:"})," ","Consistent, high quality results"]})]})]})}),e.jsxs("div",{className:"mt-4",children:[e.jsx("label",{htmlFor:"anthropicApiKey",className:"block text-sm font-medium text-gray-700 mb-2",children:"API Key"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:N?"text":"password",id:"anthropicApiKey",name:"anthropicApiKey",value:z,onChange:s=>P(s.target.value),placeholder:"sk-ant-...",className:"w-full px-3 py-2 pr-24 border border-gray-300 rounded text-sm focus:outline-none focus:border-[#005C75] focus:ring-1 focus:ring-[#005C75]"}),e.jsx("button",{type:"button",onClick:()=>Y(!N),className:"absolute right-2 top-1/2 -translate-y-1/2 px-3 py-1 text-xs text-gray-600 hover:text-gray-800 focus:outline-none cursor-pointer",children:N?"Hide":"Show"})]})]})]}),e.jsxs("div",{className:"border border-gray-200 rounded-lg p-5 bg-white",children:[e.jsx("div",{className:"flex items-start justify-between mb-3",children:e.jsxs("div",{children:[e.jsx("h4",{className:"text-base font-semibold text-gray-900 mb-1",children:"OpenAI GPT"}),e.jsx("p",{className:"text-sm text-gray-600 mb-3",children:"Industry-standard AI with broad capabilities and extensive ecosystem. GPT models offer reliable performance across diverse tasks with good balance of speed and quality."}),e.jsxs("div",{className:"flex gap-3 text-xs",children:[e.jsxs("div",{className:"px-2 py-1 bg-green-100 text-green-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Cost:"})," ","$2.50/1M tokens"]}),e.jsxs("div",{className:"px-2 py-1 bg-cyan-100 text-cyan-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Speed:"})," 150 tokens/s"]}),e.jsxs("div",{className:"px-2 py-1 bg-purple-100 text-purple-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Reliability:"})," ","Consistent, high quality results"]})]})]})}),e.jsxs("div",{className:"mt-4",children:[e.jsx("label",{htmlFor:"openAiApiKey",className:"block text-sm font-medium text-gray-700 mb-2",children:"API Key"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:v?"text":"password",id:"openAiApiKey",name:"openAiApiKey",value:G,onChange:s=>I(s.target.value),placeholder:"sk-...",className:"w-full px-3 py-2 pr-24 border border-gray-300 rounded text-sm focus:outline-none focus:border-[#005C75] focus:ring-1 focus:ring-[#005C75]"}),e.jsx("button",{type:"button",onClick:()=>H(!v),className:"absolute right-2 top-1/2 -translate-y-1/2 px-3 py-1 text-xs text-gray-600 hover:text-gray-800 focus:outline-none cursor-pointer",children:v?"Hide":"Show"})]})]})]})]})]}),x==="commands"&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Commands"}),e.jsx("p",{className:"text-sm text-gray-600 mb-6",children:"Configure start commands for your web applications"}),t!=null&&t.webapps&&t.webapps.length>0?e.jsx("div",{className:"space-y-4",children:t.webapps.map((s,a)=>e.jsxs("div",{className:"border border-gray-200 rounded-lg p-5 bg-white",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("div",{className:"text-base font-semibold text-gray-900 mb-1",children:s.path==="."?"Root":s.path}),e.jsx("div",{className:"text-sm text-gray-600",children:s.framework})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:`startCommand-${a}`,className:"block text-sm font-medium text-gray-700 mb-2",children:"Start Command"}),e.jsx("input",{type:"text",id:`startCommand-${a}`,name:`startCommand-${a}`,value:w[a]||"",onChange:d=>_({...w,[a]:d.target.value}),placeholder:"e.g., pnpm dev --port $PORT",className:"w-full px-3 py-2 border border-gray-300 rounded text-sm font-mono focus:outline-none focus:border-[#005C75] focus:ring-1 focus:ring-[#005C75]"}),e.jsx("p",{className:"mt-2 text-xs text-gray-500",children:"Use $PORT as a placeholder for the dynamic port number"})]})]},a))}):e.jsx("p",{className:"text-sm text-gray-600 italic",children:"No web applications configured"})]}),x==="paths-to-ignore"&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Paths To Ignore"}),e.jsx("input",{type:"text",id:"pathsToIgnore",name:"pathsToIgnore",value:j,onChange:s=>A(s.target.value),placeholder:"e.g., __tests__, \\.test\\.ts$, ^background (no quotes needed)",className:"w-full px-3 py-3 border border-gray-300 rounded text-sm font-mono focus:outline-none focus:border-[#005C75] focus:ring-2 focus:ring-[#005C75]/10"}),e.jsxs("p",{className:"mt-2 text-sm text-gray-600",children:["Comma-separated list of regex patterns for paths to ignore during file watching. Examples:"," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:"__tests__"}),","," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:"\\.test\\.tsx?$"}),","," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:"^background"}),e.jsx("br",{}),e.jsx("span",{className:"text-xs text-gray-500 mt-1 inline-block",children:"Note: Files matching patterns in .gitignore are also automatically ignored"})]})]}),x==="universal-mocks"&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Universal Mocks"}),e.jsx("p",{className:"mb-3 text-sm text-gray-600",children:"Mock functions that will be applied across all entity simulations"}),m.length===0?e.jsxs("div",{className:"mb-4",children:[e.jsx("div",{className:"text-sm text-gray-500 mb-3",children:"No universal mocks configured"}),e.jsx("button",{type:"button",onClick:()=>b(!0),className:"px-4 py-2 bg-[#005C75] text-white border-none rounded text-sm cursor-pointer hover:bg-[#004a5d]",children:"Add Mock"})]}):e.jsx("div",{className:"space-y-3",children:m.map((s,a)=>e.jsx("div",{className:"p-4 bg-gray-50 rounded border border-gray-200",children:W===a?e.jsx(F,{mock:s,onSave:d=>X(a,d),onCancel:()=>C(null)}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex justify-between items-start mb-2",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"font-medium text-gray-800 mb-1",children:s.entityName}),e.jsx("div",{className:"text-sm text-gray-600 mb-2",children:s.filePath}),e.jsx("pre",{className:"text-xs bg-white p-2 rounded border border-gray-200 overflow-x-auto",children:s.content})]}),e.jsxs("div",{className:"flex gap-2 ml-3",children:[e.jsx("button",{type:"button",onClick:()=>C(a),className:"px-3 py-1 bg-teal-600 text-white border-none rounded text-sm cursor-pointer hover:bg-teal-700",children:"Edit"}),e.jsx("button",{type:"button",onClick:()=>Z(a),className:"px-3 py-1 bg-red-600 text-white border-none rounded text-sm cursor-pointer hover:bg-red-700",children:"Delete"})]})]})})},a))}),m.length>0&&e.jsx("button",{type:"button",onClick:()=>b(!0),className:"mt-4 px-4 py-2 bg-[#005C75] text-white border-none rounded text-sm cursor-pointer hover:bg-[#004a5d]",children:"Add Mock"})]}),x==="current-configuration"&&e.jsxs("div",{className:"space-y-6",children:[t&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Current Configuration"}),e.jsx("div",{className:"p-4 bg-white border border-gray-200 rounded mb-6",children:e.jsxs("div",{className:"space-y-2 text-sm",children:[t.projectSlug&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Project Slug:"})," ",e.jsx("span",{className:"text-gray-900",children:t.projectSlug})]}),t.packageManager&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Package Manager:"})," ",e.jsx("span",{className:"text-gray-900",children:t.packageManager})]})]})}),t.webapps&&t.webapps.length>0&&e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-gray-800 mb-3",children:"Web Applications"}),e.jsx("div",{className:"space-y-3",children:t.webapps.map((s,a)=>e.jsx("div",{className:"p-4 bg-white border border-gray-200 rounded",children:e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Path:"})," ",e.jsx("span",{className:"text-gray-900",children:s.path==="."?"Root":s.path})]}),s.appDirectory&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"App Directory:"})," ",e.jsx("span",{className:"text-gray-900",children:s.appDirectory})]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Framework:"})," ",e.jsx("span",{className:"text-gray-900",children:s.framework})]}),s.startCommand&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Start Command:"})," ",e.jsx("span",{className:"text-gray-900 font-mono text-xs",children:D(s.startCommand)})]})]})},a))})]})]}),i&&e.jsxs("div",{className:"mt-6",children:[e.jsx("h3",{className:"text-base font-semibold text-gray-800 mb-3",children:"Version Information"}),e.jsx("div",{className:"p-4 bg-white border border-gray-200 rounded",children:e.jsxs("div",{className:"space-y-2 text-sm",children:[i.webserverVersion&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Webserver:"})," ",e.jsx("span",{className:"text-gray-900 font-mono",children:i.webserverVersion.version||"unknown"})]}),i.templateVersion&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Analyzer Template:"})," ",e.jsx("span",{className:"font-mono text-gray-900",children:i.templateVersion.version||((R=i.templateVersion.gitCommit)==null?void 0:R.slice(0,7))||"unknown"}),i.templateVersion.buildTimestamp&&e.jsxs("span",{className:"text-gray-500 ml-2",children:["(built"," ",le(i.templateVersion.buildTimestamp),")"]})]}),i.cachedAnalyzerVersion&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Cached Analyzer:"})," ",e.jsx("span",{className:"font-mono text-gray-900",children:i.cachedAnalyzerVersion.version||((q=i.cachedAnalyzerVersion.gitCommit)==null?void 0:q.slice(0,7))||"unknown"}),i.isCacheStale?e.jsx("span",{className:"ml-2 px-2 py-0.5 bg-amber-100 text-amber-800 rounded text-xs",children:"Stale - will update on next analysis"}):e.jsx("span",{className:"ml-2 px-2 py-0.5 bg-green-100 text-green-800 rounded text-xs",children:"Up to date"})]}),!i.cachedAnalyzerVersion&&(t==null?void 0:t.projectSlug)&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Cached Analyzer:"})," ",e.jsx("span",{className:"text-gray-500 italic",children:"Not initialized - will be created on first analysis"})]})]})})]})]})]})})]}),(K||M||(l==null?void 0:l.error)||n.data&&typeof n.data=="object"&&"error"in n.data)&&e.jsxs("div",{className:"mt-6 max-w-5xl mx-auto space-y-3",children:[K&&e.jsx("div",{className:"text-emerald-600 text-sm font-medium bg-emerald-50 border border-emerald-200 rounded px-4 py-2",children:"Settings saved successfully!"}),M&&e.jsxs("div",{className:"text-amber-700 text-sm font-medium bg-amber-50 border border-amber-200 rounded px-4 py-2",children:[e.jsx("div",{children:"⚠️ Settings changed. Please restart CodeYam for changes to take effect:"}),e.jsx("code",{className:"ml-2 bg-amber-100 px-2 py-1 rounded text-xs",children:"codeyam stop && codeyam"})]}),(l==null?void 0:l.error)&&e.jsx("div",{className:"text-red-600 text-sm font-medium bg-red-50 border border-red-200 rounded px-4 py-2",children:l.error}),(()=>{if(n.data&&typeof n.data=="object"&&"error"in n.data){const s=n.data;return typeof s.error=="string"?e.jsx("div",{className:"text-red-600 text-sm font-medium bg-red-50 border border-red-200 rounded px-4 py-2",children:s.error}):null}return null})()]}),J&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center p-4 z-50",children:e.jsxs("div",{className:"bg-white rounded-lg max-w-2xl w-full p-6",children:[e.jsx("h2",{className:"text-2xl font-bold mb-4 text-gray-900",children:"Add Universal Mock"}),e.jsx(F,{mock:{entityName:"",filePath:"",content:""},onSave:B,onCancel:()=>b(!1)})]})})]})})});export{xe as default,me as meta};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w as B,u as $,r as d,j as e,a as R,L as E,c as U}from"./chunk-EPOLDU6W-CXRTFQ3F.js";import{u as _}from"./useReportContext-1BX144Eg.js";import{S as V}from"./SafeScreenshot-DuDvi0jm.js";import{L as W}from"./LoadingDots-B0GLXMsr.js";import{E as P}from"./EntityTypeIcon-CAneekK2.js";import{g as H,a as Q,f as Y}from"./fileTableUtils-DMJ7zii9.js";import{C as q}from"./chevron-down-Cx24_aWc.js";import{S as J}from"./search-CxXUmBSd.js";import{L as K}from"./loader-circle-B7B9V-bu.js";import"./createLucideIcon-BdhJEx6B.js";const ie=()=>[{title:"Simulations - CodeYam"},{name:"description",content:"A visual gallery of your recently captured component screenshots"}],ce=B(function(){const i=$(),c=i.entities,p=i.queueState;_({source:"simulations-page"});const[l,S]=d.useState(""),[x,h]=d.useState("visual"),f=d.useMemo(()=>{const s=[];return c.forEach(r=>{var b;const n=(b=r.analyses)==null?void 0:b[0];if(n!=null&&n.scenarios){const j=n.scenarios.filter(o=>{var m;return!((m=o.metadata)!=null&&m.sameAsDefault)}).map(o=>{var C,A,k,z,L;const m=(A=(C=o.metadata)==null?void 0:C.screenshotPaths)==null?void 0:A[0],N=(k=o.metadata)==null?void 0:k.noScreenshotSaved,F=m&&!N,T=(L=(z=n.status)==null?void 0:z.scenarios)==null?void 0:L.find(I=>I.name===o.name),M=T&&T.screenshotStartedAt&&!T.screenshotFinishedAt;let w;return F?w="completed":M?w="capturing":w="error",{scenarioName:o.name,scenarioDescription:o.description||"",screenshotPath:m||"",scenarioId:o.id,state:w}}).filter(o=>o.state==="completed"||o.state==="capturing");j.length>0&&s.push({entity:r,screenshots:j,createdAt:n.createdAt||""})}}),s.sort((r,n)=>new Date(n.createdAt).getTime()-new Date(r.createdAt).getTime()),s},[c]),y=d.useMemo(()=>c.filter(s=>{var b,j;const r=(b=s.analyses)==null?void 0:b[0];return!((j=r==null?void 0:r.scenarios)==null?void 0:j.some(o=>{var m,N;return(N=(m=o.metadata)==null?void 0:m.screenshotPaths)==null?void 0:N[0]}))}),[c]),g=d.useMemo(()=>f.filter(({entity:s})=>{const r=!l||s.name.toLowerCase().includes(l.toLowerCase()),n=x==="all"||s.entityType===x;return r&&n}),[f,l,x]),a=d.useMemo(()=>y.filter(s=>{const r=!l||s.name.toLowerCase().includes(l.toLowerCase()),n=x==="all"||s.entityType===x;return r&&n}),[y,l,x]),u=d.useCallback(s=>{S(s.target.value)},[]),D=d.useCallback(s=>{h(s.target.value)},[]),v=f.length>0;return e.jsx("div",{className:"bg-[#f9f9f9] min-h-screen overflow-y-auto",children:e.jsxs("div",{className:"px-20 py-12",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-3xl font-semibold text-gray-900 mb-2",children:"Simulations"}),e.jsx("p",{className:"text-gray-600",children:"A visual gallery of your recently captured simulations."})]}),!v&&e.jsx("div",{className:"bg-[#D1F3F9] border border-[#A5E8F0] rounded-lg p-4 mb-6",children:e.jsxs("p",{className:"text-sm text-gray-700 m-0",children:["This page will display a visual gallery of your recently captured component simulations."," ",e.jsx("strong",{children:"Start by analyzing your first component below."})]})}),e.jsxs("div",{className:"bg-white border-b border-gray-200 rounded-t-lg px-5 py-4 mb-3",children:[e.jsx("div",{className:"text-[11px] text-gray-500 mb-2 uppercase",children:"Filters"}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("div",{className:"relative",children:[e.jsxs("select",{className:"appearance-none bg-gray-50 border border-gray-200 rounded px-3 pr-8 text-[13px] h-[39px] cursor-pointer focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] hover:border-gray-300 transition-colors",value:x,onChange:D,children:[e.jsx("option",{value:"all",children:"All Types"}),e.jsx("option",{value:"visual",children:"Visual"}),e.jsx("option",{value:"library",children:"Library"})]}),e.jsx(q,{className:"absolute right-2 top-1/2 -translate-y-1/2 w-3 h-3 text-gray-500 pointer-events-none"})]}),e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(J,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx("input",{type:"text",placeholder:"Search component",className:"w-full bg-gray-50 border border-gray-200 rounded pl-9 pr-3 text-[13px] h-[39px] placeholder:text-gray-400 focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] transition-colors",value:l,onChange:u})]})]})]}),v&&g.length>0&&e.jsx("div",{className:"bg-[#efefef] rounded-lg mb-2 text-[11px] font-normal leading-[16px] text-[#3e3e3e] uppercase",children:e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-2",children:[e.jsx("span",{children:"ENTITY"}),e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-[#3e3e3e]",children:e.jsx("path",{d:"M3 5L6 8L9 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})}),e.jsxs("div",{className:"flex flex-col gap-[3px]",children:[v&&(g.length===0?e.jsx("div",{className:"bg-white border border-gray-200 rounded-lg p-8 text-center text-gray-500",children:"No simulations match your filters."}):e.jsx(e.Fragment,{children:g.map(({entity:s,screenshots:r})=>e.jsx(O,{entity:s,screenshots:r,queueJobs:(p==null?void 0:p.jobs)||[]},s.sha))})),!v&&(a.length===0?e.jsx("div",{className:"bg-white border border-gray-200 rounded-b-lg p-8 text-center text-gray-500",children:"No components found matching your filters."}):a.map(s=>e.jsx(G,{entity:s},s.sha)))]})]})})});function O({entity:t,screenshots:i,queueJobs:c}){var f,y,g;const p=R(),l=i.length||(((g=(y=(f=t.analyses)==null?void 0:f[0])==null?void 0:y.scenarios)==null?void 0:g.length)??0),S=a=>{p(`/entity/${t.sha}/scenarios/${a}?from=simulations`)},x=H(t,c),h=Q(x);return e.jsx("div",{className:"bg-white rounded hover:bg-gray-50 transition-colors border-b border-[#e1e1e1]",children:e.jsxs("div",{className:"px-5 pb-[15px]",children:[e.jsxs("div",{className:"flex items-center justify-between py-[10px]",children:[e.jsxs(E,{to:`/entity/${t.sha}`,className:"flex items-center gap-2 no-underline",children:[e.jsx(P,{type:t.entityType}),e.jsxs("span",{className:"font-['IBM_Plex_Sans'] font-medium text-[12px] leading-[15px] text-[#343434]",children:[t.name," (",l,")"]})]}),e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsxs("span",{className:"px-2 rounded inline-flex items-center gap-1.5 max-w-full whitespace-nowrap overflow-hidden",style:{backgroundColor:h.bgColor,color:h.textColor,height:"23px",fontSize:"10px",lineHeight:"15px"},children:[h.icon,h.text]}),e.jsx("button",{onClick:()=>void p(`/entity/${t.sha}/logs`),className:"bg-[#e0e9ec] text-[#005c75] rounded font-['IBM_Plex_Sans'] font-semibold hover:bg-[#d0dfe5] transition-colors px-[10px] py-0 cursor-pointer border-none",style:{fontSize:"10px",lineHeight:"22px"},children:"View Logs"})]})]}),e.jsx("div",{className:"flex gap-2.5 overflow-x-auto pb-1",children:i.length>0?i.map(a=>e.jsx("button",{onClick:()=>S(a.scenarioId||""),className:"shrink-0 block cursor-pointer bg-transparent border-none p-0",children:e.jsx("div",{className:"w-36 h-24 rounded-md border overflow-hidden flex items-center justify-center transition-all",style:{"--hover-border":"#005C75",backgroundColor:a.state==="capturing"?"#f9f9f9":"#f3f4f6",borderColor:a.state==="capturing"?"#efefef":"#d1d5db"},onMouseEnter:u=>{a.state==="completed"&&(u.currentTarget.style.borderColor="#005C75",u.currentTarget.style.boxShadow="0 4px 12px rgba(0, 92, 117, 0.15)")},onMouseLeave:u=>{u.currentTarget.style.borderColor=a.state==="capturing"?"#efefef":"#d1d5db",u.currentTarget.style.boxShadow="none"},children:a.state==="completed"?e.jsx(V,{screenshotPath:a.screenshotPath,alt:a.scenarioName,className:"max-w-full max-h-full object-contain"}):a.state==="capturing"?e.jsx(W,{size:"medium"}):null})},a.scenarioId)):e.jsx("div",{className:"text-xs text-gray-400 py-4",children:"No screenshots available"})})]})})}function G({entity:t}){const i=U(),[c,p]=d.useState(!1),l=()=>{p(!0),i.submit({entitySha:t.sha,filePath:t.filePath||""},{method:"post",action:"/api/analyze"})};return d.useEffect(()=>{i.state==="idle"&&c&&p(!1)},[i.state,c]),e.jsx("div",{className:"bg-white rounded hover:bg-gray-100 transition-colors cursor-pointer border-b border-[#e1e1e1]",onClick:l,children:e.jsxs("div",{className:"px-5 py-4 flex items-center",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsx(P,{type:t.entityType}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-0.5",children:[e.jsx(E,{to:`/entity/${t.sha}`,className:"text-sm font-medium text-gray-900 no-underline",children:t.name}),e.jsx("span",{className:"text-[10px] font-semibold px-1 py-0.5 rounded",style:{color:t.entityType==="visual"?"#7c3aed":t.entityType==="library"?"#0DBFE9":t.entityType==="type"?"#dc2626":t.entityType==="data"?"#2563eb":t.entityType==="index"?"#ea580c":t.entityType==="functionCall"?"#7c3aed":t.entityType==="class"?"#059669":t.entityType==="method"?"#0891b2":"#6b7280",backgroundColor:t.entityType==="visual"?"#f3e8ff":t.entityType==="library"?"#cffafe":t.entityType==="type"?"#fee2e2":t.entityType==="data"?"#dbeafe":t.entityType==="index"?"#ffedd5":t.entityType==="functionCall"?"#f3e8ff":t.entityType==="class"?"#d1fae5":t.entityType==="method"?"#cffafe":"#f3f4f6"},children:t.entityType?t.entityType.toUpperCase():"UNKNOWN"})]}),e.jsx("div",{className:"text-xs text-gray-400 truncate",children:t.filePath})]})]}),e.jsx("div",{className:"w-32 flex justify-center",children:e.jsx("span",{className:"text-[10px] text-gray-500 bg-gray-100 px-2 py-1 rounded",children:"Not analyzed"})}),e.jsx("div",{className:"w-32 text-center text-[10px] text-gray-500",children:Y(t.createdAt||null)}),e.jsx("div",{className:"w-24 flex justify-end",children:c||i.state!=="idle"?e.jsxs("div",{className:"px-2 py-1 bg-pink-100 rounded text-xs text-pink-700 font-semibold flex items-center gap-1.5",children:[e.jsx(K,{size:14,className:"animate-spin"}),"Analyzing..."]}):e.jsx("button",{onClick:l,className:"bg-[#e0e9ec] text-[#005c75] px-4 py-1.5 rounded text-xs font-medium hover:bg-[#d0dde1] transition-colors cursor-pointer",children:"Analyze"})})]})})}export{ce as default,ie as meta};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,j as e}from"./chunk-
|
|
1
|
+
import{r as d,j as e}from"./chunk-EPOLDU6W-CXRTFQ3F.js";const N=10,A=1024;function T({currentViewportWidth:g,currentPresetName:y,onDevicePresetClick:m,devicePresets:u,onHoverChange:o,hideLabel:v=!1}){const[a,l]=d.useState(null),c=d.useRef(null),h=d.useMemo(()=>[...u].sort((s,n)=>s.width-n.width),[u]),{fittingPresets:t,overflowPresets:i}=d.useMemo(()=>{const s=[],n=[];for(const r of h)r.width<=A?s.push(r):n.push(r);return n.sort((r,f)=>f.width-r.width),{fittingPresets:s,overflowPresets:n}},[h]),b=d.useCallback(s=>{if(!c.current)return null;const n=c.current.getBoundingClientRect(),r=s-n.left,f=n.width,w=f/2,z=(t.length>0?t[t.length-1].width:0)/2,E=w-z,P=w+z,M=i.length>0?(i.length-1)*N:0;if(i.length>0){if(r<E){if(r<=M){const x=Math.min(Math.floor(r/N),i.length-1);return i[x]}return i[i.length-1]}if(r>P){const x=f-r;if(x<=M){const j=Math.min(Math.floor(x/N),i.length-1);return i[j]}return i[i.length-1]}}const C=Math.abs(r-w);for(let x=t.length-1;x>=0;x--){const j=t[x],F=t[x-1],I=j.width/2,R=F?F.width/2:0;if(C<=I&&C>=R)return j}return t[0]||i[i.length-1]||null},[t,i]),p=d.useCallback(s=>{const n=b(s.clientX);l(n),o==null||o(n)},[b,o]),S=d.useCallback(()=>{l(null),o==null||o(null)},[o]),$=d.useCallback(s=>{const n=b(s.clientX);n&&m(n)},[b,m]),k=a||{name:y,width:g};return e.jsxs("div",{ref:c,className:"relative h-6 shrink-0 overflow-hidden cursor-pointer",onMouseMove:p,onMouseLeave:S,onClick:$,children:[a&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:e.jsx("div",{className:"h-full transition-all duration-100 bg-[#005C75]",style:{width:`${a.width}px`}})}),e.jsx("div",{className:"absolute inset-0 pointer-events-none",children:t.map(s=>{const n=s.width===g,r=(a==null?void 0:a.name)===s.name,f=s.width/2;return e.jsxs("div",{children:[e.jsx("div",{className:"absolute top-0 bottom-0",style:{left:`calc(50% - ${f}px)`},children:e.jsx("div",{className:`w-0.5 h-full transition-colors duration-75 ${n||r?"bg-white":"bg-[rgba(255,255,255,0.3)]"}`})}),e.jsx("div",{className:"absolute top-0 bottom-0",style:{left:`calc(50% + ${f}px)`},children:e.jsx("div",{className:`w-0.5 h-full transition-colors duration-75 ${n||r?"bg-white":"bg-[rgba(255,255,255,0.3)]"}`})})]},s.name)})}),e.jsx("div",{className:"absolute inset-0 pointer-events-none",children:i.map((s,n)=>{const r=n*N,f=s.width===g,w=(a==null?void 0:a.name)===s.name;return e.jsxs("div",{children:[e.jsx("div",{className:"absolute top-0 bottom-0",style:{left:`${r}px`},children:e.jsx("div",{className:`w-0.5 h-full transition-colors duration-75 ${f||w?"bg-white":"bg-[rgba(255,255,255,0.3)]"}`})}),e.jsx("div",{className:"absolute top-0 bottom-0",style:{right:`${r}px`},children:e.jsx("div",{className:`w-0.5 h-full transition-colors duration-75 ${f||w?"bg-white":"bg-[rgba(255,255,255,0.3)]"}`})})]},s.name)})}),!v&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:e.jsxs("div",{className:`text-[10px] px-2 py-0.5 rounded shadow-sm whitespace-nowrap transition-colors ${a?"bg-[#005c75] text-white":"bg-white/90 text-[#005c75] border border-[rgba(0,92,117,0.25)]"}`,children:[k.name," - ",k.width,"px"]})})]})}function W({width:g,height:y,onSave:m,onCancel:u}){const[o,v]=d.useState(""),[a,l]=d.useState(""),c=()=>{const t=o.trim();if(!t){l("Please enter a name for this custom size");return}m(t)},h=t=>{t.key==="Enter"&&o.trim()&&c(),t.key==="Escape"&&u()};return e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center p-4 z-50",children:e.jsxs("div",{className:"bg-white rounded-lg max-w-md w-full p-6 shadow-xl",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Save Custom Size"}),e.jsx("button",{onClick:u,className:"text-gray-400 hover:text-gray-600 transition-colors cursor-pointer","aria-label":"Close",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsxs("div",{className:"mb-6 p-4 bg-gray-50 rounded-lg border border-gray-200",children:[e.jsx("div",{className:"text-sm text-gray-500 mb-1",children:"Dimensions"}),e.jsxs("div",{className:"text-lg font-medium text-gray-900",children:[g,"px × ",y,"px"]})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{htmlFor:"custom-size-name",className:"block text-sm font-medium text-gray-700 mb-2",children:"Name"}),e.jsx("input",{id:"custom-size-name",type:"text",value:o,onChange:t=>{v(t.target.value),l("")},onKeyDown:h,placeholder:"e.g., iPhone 15 Pro",className:`w-full px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75] ${a?"border-red-300":"border-gray-300"}`,autoFocus:!0}),a&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:a})]}),e.jsxs("div",{className:"flex gap-3 justify-end",children:[e.jsx("button",{onClick:u,className:"px-4 py-2 bg-gray-100 text-gray-700 text-sm font-medium rounded-md hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-gray-300 transition-colors cursor-pointer",children:"Cancel"}),e.jsx("button",{onClick:c,disabled:!o.trim(),className:"px-4 py-2 bg-[#005c75] text-white text-sm font-medium rounded-md hover:bg-[#004a5c] focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:ring-offset-1 transition-colors cursor-pointer disabled:bg-gray-300 disabled:cursor-not-allowed",children:"Save"})]})]})})}function X(g){const[y,m]=d.useState([]),u=g?`codeyam-custom-sizes-${g}`:null;d.useEffect(()=>{if(!u||typeof window>"u"){m([]);return}try{const l=localStorage.getItem(u);if(l){const c=JSON.parse(l);Array.isArray(c)&&m(c)}}catch(l){console.error("[useCustomSizes] Failed to load custom sizes:",l),m([])}},[u]);const o=d.useCallback(l=>{if(!(!u||typeof window>"u"))try{localStorage.setItem(u,JSON.stringify(l))}catch(c){console.error("[useCustomSizes] Failed to save custom sizes:",c)}},[u]),v=d.useCallback((l,c,h)=>{m(t=>{const i=t.findIndex(S=>S.name===l),b={name:l,width:c,height:h};let p;return i>=0?(p=[...t],p[i]=b):p=[...t,b],o(p),p})},[o]),a=d.useCallback(l=>{m(c=>{const h=c.filter(t=>t.name!==l);return o(h),h})},[o]);return{customSizes:y,addCustomSize:v,removeCustomSize:a}}export{W as S,T as V,X as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as D,r as e}from"./chunk-
|
|
1
|
+
import{c as D,r as e}from"./chunk-EPOLDU6W-CXRTFQ3F.js";import{u as K}from"./useLastLogLine-aSv48UbS.js";function C(s){const o=s.replace(/[^a-zA-Z0-9_]+/g,"_");return o.slice(0,1).toUpperCase()+o.slice(1)}function O({analysisId:s,scenarioId:o,scenarioName:u,projectSlug:f,enabled:h=!0,refreshTrigger:l=0}){const B=D(),[g,w]=e.useState(null),[b,E]=e.useState(!1),[q,a]=e.useState(!1),[x,i]=e.useState(!1),d=e.useRef(!1),S=e.useRef(null),R=e.useRef(null),[L,m]=e.useState(0),[A,I]=e.useState(0),r=e.useRef(null),c=e.useRef(!1),{interactiveUrl:M,resetLogs:y}=K(f,h),U=e.useRef(o),F=e.useRef(l);e.useEffect(()=>{F.current!==l&&(F.current=l,g&&(console.log("[useInteractiveMode] Manual refresh triggered"),a(!0),i(!1),m(0),I(t=>t+1),c.current=!1,r.current&&(clearTimeout(r.current),r.current=null)))},[l,g]),e.useEffect(()=>{if(U.current!==o&&(U.current=o,S.current&&R.current&&u)){const t=C(R.current),n=C(u),v=S.current.replace(t,n);w(v),a(!0),i(!1),m(0),I(p=>p+1),c.current=!1,r.current&&(clearTimeout(r.current),r.current=null);return}},[o,u]),e.useEffect(()=>{if(M){const t=M+"?width=600px";S.current=t,u&&(R.current=u),w(t),E(!1),a(!0)}},[M]),e.useEffect(()=>{const t=n=>{n.data.type==="codeyam-resize"&&(c.current||(c.current=!0,r.current&&(clearTimeout(r.current),r.current=null),m(0),i(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{a(!1)})})))};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)},[]);const k=()=>{c.current=!1,r.current&&clearTimeout(r.current);const t=500*Math.pow(2,L);r.current=setTimeout(()=>{c.current||(L<2?(m(n=>n+1),I(n=>n+1),a(!0)):(console.error("[useInteractiveMode] Interactive mode failed to load after 3 attempts - showing iframe anyway"),i(!0),a(!1)))},t)};return e.useEffect(()=>{h&&!d.current&&o&&s&&(d.current=!0,E(!0),i(!1),w(null),(async()=>{if(f)try{await fetch(`/api/logs/${f}`,{method:"DELETE"})}catch(n){console.error("[useInteractiveMode] Failed to clear log file:",n)}y(),B.submit({action:"start",analysisId:s,scenarioId:o},{method:"post",action:"/api/interactive-mode"})})())},[h,o,s,y,f]),e.useEffect(()=>{const t=s,n=()=>{if(d.current&&t){const p=new URLSearchParams({action:"stop",analysisId:t});console.log("[useInteractiveMode] Sending stop request via sendBeacon");const T=navigator.sendBeacon("/api/interactive-mode",p);console.log("[useInteractiveMode] sendBeacon result:",T),T||(console.log("[useInteractiveMode] sendBeacon failed, using fetch fallback"),fetch("/api/interactive-mode",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:p,keepalive:!0}).catch(z=>console.error("Failed to stop interactive mode:",z)))}},v=()=>{n()};return window.addEventListener("beforeunload",v),()=>{window.removeEventListener("beforeunload",v),console.log("[useInteractiveMode] Cleanup running:",{hasStarted:d.current,analysisId:t}),n()}},[s]),{interactiveServerUrl:g,isStarting:b,isLoading:q,showIframe:x,iframeKey:A,onIframeLoad:k}}export{O as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t}from"./chunk-
|
|
1
|
+
import{r as t}from"./chunk-EPOLDU6W-CXRTFQ3F.js";function I(c,s){const[E,l]=t.useState(""),[d,n]=t.useState(!1),[g,a]=t.useState(null),[$,r]=t.useState(!1);t.useEffect(()=>{s&&(r(!1),n(!1),a(null))},[s]),t.useEffect(()=>{if(!c||!s){s||l("");return}const u=async()=>{try{const i=await fetch(`/api/logs/${c}`);if(i.ok){const o=(await i.text()).trim().split(`
|
|
2
2
|
`).filter(e=>e.length>0);if(o.length<3){n(!1),r(!1),a(null),l("");return}const f=o.filter(e=>e.includes("CodeYam Log Level 1"));if(f.length>0){const e=f[f.length-1];l(e.replace(/.*CodeYam Log Level 1: /,""))}const L=o.find(e=>e.includes("$$INTERACTIVE_SERVER_URL$$:"));if(L){const e=L.split("$$INTERACTIVE_SERVER_URL$$:")[1].trim();a(e),r(!0)}o.some(e=>e.includes("CodeYam: Exiting start.js"))&&n(!0)}}catch{}};u().catch(()=>{});const m=setInterval(()=>{u().catch(()=>{})},2e3);return()=>clearInterval(m)},[c,s]);const h=t.useCallback(()=>{l(""),n(!1),a(null),r(!1)},[]);return{lastLine:E,interactiveUrl:g,isCompleted:d,resetLogs:h}}export{I as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,j as x,d as i}from"./chunk-
|
|
1
|
+
import{r as e,j as x,d as i}from"./chunk-EPOLDU6W-CXRTFQ3F.js";const s={source:"navbar"},r=e.createContext(void 0);function l({children:t}){const[n,o]=e.useState(s),a=e.useCallback(u=>{o(u)},[]),c=e.useCallback(()=>{o(s)},[]);return x.jsx(r.Provider,{value:{contextData:n,setContextData:a,resetContextData:c},children:t})}function f(t){const n=e.useContext(r),o=e.useRef(n);e.useEffect(()=>{if(o.current)return o.current.setContextData(t),()=>{var a;(a=o.current)==null||a.resetContextData()}},[t.source,t.entitySha,t.scenarioId,t.analysisId])}function D(){const t=e.useContext(r),n=i();return t?{source:t.contextData.source,entitySha:t.contextData.entitySha,scenarioId:t.contextData.scenarioId,analysisId:t.contextData.analysisId,currentUrl:n.pathname}:{source:"navbar",currentUrl:n.pathname}}export{l as R,D as a,f as u};
|
package/codeyam-cli/src/webserver/build/client/assets/{useToast-DWHcCcl1.js → useToast-mBRpZPiu.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,j as T}from"./chunk-
|
|
1
|
+
import{r as t,j as T}from"./chunk-EPOLDU6W-CXRTFQ3F.js";const n=t.createContext(void 0);function m({children:o}){const[i,r]=t.useState([]),c=t.useCallback((s,e="info",a=5e3)=>{const d={id:`toast-${Date.now()}-${Math.random()}`,message:s,type:e,duration:a};r(x=>[...x,d])},[]),u=t.useCallback(s=>{r(e=>e.filter(a=>a.id!==s))},[]);return T.jsx(n.Provider,{value:{toasts:i,showToast:c,closeToast:u},children:o})}function v(){const o=t.useContext(n);if(!o)throw new Error("useToast must be used within a ToastProvider");return o}export{m as T,v as u};
|
package/codeyam-cli/src/webserver/build/server/assets/{index-CV6i1S1A.js → index-pU0o5t1o.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"fetch-retry";import{H as O,I as Q,J as R,K as V,L as W,M as X,P as Y,S as Z,d as _,a as $,b as aa,c as sa,e as ta,f as oa,g as ra,h as ia,i as ma,j as ea,k as pa,D as la,G as na,F as da,E as ba,l as ua,m as ca,n as Ta,o as Ca,p as ha,q as ya,r as Aa,s as Ba,t as Sa,u as ga,v as Ea,w as Fa,x as Pa,y as ja,z as Da,A as Ma,B as fa,C as qa}from"./server-build-
|
|
1
|
+
import"fetch-retry";import{H as O,I as Q,J as R,K as V,L as W,M as X,P as Y,S as Z,d as _,a as $,b as aa,c as sa,e as ta,f as oa,g as ra,h as ia,i as ma,j as ea,k as pa,D as la,G as na,F as da,E as ba,l as ua,m as ca,n as Ta,o as Ca,p as ha,q as ya,r as Aa,s as Ba,t as Sa,u as ga,v as Ea,w as Fa,x as Pa,y as ja,z as Da,A as Ma,B as fa,C as qa}from"./server-build-YzfkRwdn.js";import"typescript";import"kysely";import"react/jsx-runtime";import"node:stream";import"@react-router/node";import"react-router";import"isbot";import"react-dom/server";import"react";import"lucide-react";import"better-sqlite3";import"pg";import"fs";import"path";import"kysely/helpers/sqlite";import"kysely/helpers/postgres";import"fs/promises";import"os";import"prompts";import"chalk";import"crypto";import"child_process";import"util";import"dotenv";import"events";import"uuid";import"url";import"openai";import"p-queue";import"p-retry";import"@aws-sdk/client-dynamodb";import"lru-cache";import"pluralize";import"piscina";import"json5";import"@aws-sdk/util-dynamodb";import"react-syntax-highlighter";import"react-syntax-highlighter/dist/cjs/styles/prism/index.js";import"node:crypto";import"v8";import"react-diff-viewer-continued";export{O as AnalysisBranchesTableColumns,Q as BranchesTableColumns,R as CommitsTableColumns,V as EntitiesTableColumns,W as EntityBranchesTableColumns,X as FilesTableColumns,Y as ProjectsTableColumns,Z as ScenariosTableColumns,_ as dbToAnalysis,$ as dbToAnalysisBranch,aa as dbToBranch,sa as dbToCommit,ta as dbToEntity,oa as dbToFile,ra as dbToProject,ia as dbToScenario,ma as dbToUserScenario,ea as deleteScenarios,pa as generateSha,la as getDatabase,na as getJsonHelper,da as getPostgreDatabase,ba as getSqliteDatabase,ua as loadAnalyses,ca as loadAnalysis,Ta as loadBranches,Ca as loadCommitBranches,ha as loadCommits,ya as loadEntities,Aa as loadEntity,Ba as loadFiles,Sa as loadProject,ga as updateCommitMetadata,Ea as updateFreshAnalysisMetadata,Fa as updateFreshAnalysisStatus,Pa as updateProjectMetadata,ja as upsertAnalyses,Da as upsertCommitBranches,Ma as upsertCommits,fa as upsertGithubUser,qa as upsertScenarios};
|