@codeyam/codeyam-cli 0.1.0-staging.596f0eb → 0.1.0-staging.6e699e5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/analyzer-template/.build-info.json +8 -8
- package/analyzer-template/common/execAsync.ts +1 -1
- package/analyzer-template/log.txt +3 -3
- package/analyzer-template/package.json +10 -6
- package/analyzer-template/packages/ai/index.ts +10 -3
- package/analyzer-template/packages/ai/package.json +1 -1
- package/analyzer-template/packages/ai/src/lib/__mocks__/completionCall.ts +122 -0
- package/analyzer-template/packages/ai/src/lib/analyzeScope.ts +128 -6
- package/analyzer-template/packages/ai/src/lib/astScopes/arrayDerivationDetector.ts +199 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/astScopeAnalyzer.ts +138 -1
- package/analyzer-template/packages/ai/src/lib/astScopes/conditionalEffectsExtractor.ts +644 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/methodSemantics.ts +140 -6
- package/analyzer-template/packages/ai/src/lib/astScopes/patterns/ifStatementHandler.ts +18 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/patterns/switchStatementHandler.ts +38 -1
- package/analyzer-template/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.ts +181 -1
- package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +1239 -104
- package/analyzer-template/packages/ai/src/lib/astScopes/types.ts +304 -0
- package/analyzer-template/packages/ai/src/lib/checkAllAttributes.ts +29 -10
- package/analyzer-template/packages/ai/src/lib/completionCall.ts +216 -36
- package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +1501 -138
- 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 +976 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.ts +243 -77
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.ts +19 -1
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.ts +103 -6
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.ts +23 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertNullToUndefinedBySchema.ts +98 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.ts +42 -2
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fixNullIdsBySchema.ts +129 -0
- package/analyzer-template/packages/ai/src/lib/dataStructureChunking.ts +156 -0
- package/analyzer-template/packages/ai/src/lib/deepEqual.ts +30 -0
- package/analyzer-template/packages/ai/src/lib/e2eDataTracking.ts +334 -0
- package/analyzer-template/packages/ai/src/lib/extractCriticalDataKeys.ts +120 -0
- package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarioData.ts +74 -7
- package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarios.ts +89 -112
- package/analyzer-template/packages/ai/src/lib/generateEntityDataStructure.ts +6 -0
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +1111 -91
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarios.ts +207 -104
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +570 -0
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.ts +528 -0
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionals.ts +1977 -0
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.ts +239 -0
- package/analyzer-template/packages/ai/src/lib/getConditionalUsagesFromCode.ts +143 -31
- package/analyzer-template/packages/ai/src/lib/guessScenarioDataFromDescription.ts +8 -2
- package/analyzer-template/packages/ai/src/lib/isolateScopes.ts +276 -3
- package/analyzer-template/packages/ai/src/lib/mergeStatements.ts +33 -3
- package/analyzer-template/packages/ai/src/lib/promptGenerators/gatherAttributesMap.ts +7 -0
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.ts +1 -1
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.ts +32 -102
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChunkPrompt.ts +82 -0
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateCriticalKeysPrompt.ts +103 -0
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.ts +90 -6
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.ts +14 -53
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateMissingKeysPrompt.ts +58 -0
- package/analyzer-template/packages/ai/src/lib/promptGenerators/guessNewScenarioDataFromDescriptionGenerator.ts +28 -2
- package/analyzer-template/packages/ai/src/lib/promptGenerators/simplifyKeysForLLM.ts +391 -0
- package/analyzer-template/packages/ai/src/lib/resolvePathToControllable.ts +812 -0
- package/analyzer-template/packages/ai/src/lib/splitOutsideParentheses.ts +5 -1
- package/analyzer-template/packages/ai/src/lib/validateExecutionFlowPaths.ts +531 -0
- package/analyzer-template/packages/ai/src/lib/worker/SerializableDataStructure.ts +123 -0
- package/analyzer-template/packages/ai/src/lib/worker/analyzeScopeWorker.ts +8 -1
- package/analyzer-template/packages/analyze/src/lib/FileAnalyzer.ts +14 -0
- package/analyzer-template/packages/analyze/src/lib/analysisContext.ts +44 -4
- 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 +455 -267
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +18 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyze/findOrCreateEntity.ts +3 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.ts +33 -7
- package/analyzer-template/packages/analyze/src/lib/files/analyzeChange.ts +31 -15
- package/analyzer-template/packages/analyze/src/lib/files/analyzeEntity.ts +11 -7
- package/analyzer-template/packages/analyze/src/lib/files/analyzeInitial.ts +11 -12
- package/analyzer-template/packages/analyze/src/lib/files/enums/steps.ts +1 -1
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.ts +265 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichUnknownTypesFromSourceEquivalencies.ts +102 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.ts +588 -52
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateChangesScenarioData.ts +1 -1
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.ts +28 -62
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +336 -133
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.ts +156 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarioData.ts +78 -83
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarios.ts +4 -8
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +461 -94
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.ts +56 -11
- 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/checkS3ObjectExists.d.ts +15 -0
- package/analyzer-template/packages/aws/dist/src/lib/s3/checkS3ObjectExists.d.ts.map +1 -0
- package/analyzer-template/packages/aws/dist/src/lib/s3/checkS3ObjectExists.js +31 -0
- package/analyzer-template/packages/aws/dist/src/lib/s3/checkS3ObjectExists.js.map +1 -0
- 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 +3 -3
- package/analyzer-template/packages/aws/s3/index.ts +1 -0
- 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/checkS3ObjectExists.ts +47 -0
- package/analyzer-template/packages/aws/src/lib/s3/uploadFileToS3.ts +8 -1
- package/analyzer-template/packages/database/src/lib/kysely/db.ts +4 -4
- package/analyzer-template/packages/database/src/lib/kysely/tableRelations.ts +2 -2
- package/analyzer-template/packages/database/src/lib/kysely/tables/debugReportsTable.ts +36 -9
- package/analyzer-template/packages/database/src/lib/loadReadyToBeCapturedAnalyses.ts +7 -3
- 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/componentScenarioPage/getIFrameMessageListenerCode.ts +9 -4
- package/analyzer-template/packages/generate/src/lib/deepMerge.ts +26 -1
- package/analyzer-template/packages/generate/src/lib/scenarioComponentForServer.ts +114 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts +2 -2
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js +2 -2
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tableRelations.d.ts +2 -2
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/analysesTable.d.ts +1 -11
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/analysesTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.d.ts +30 -7
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.js +9 -3
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.js.map +1 -1
- 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 +2 -6
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js +7 -4
- package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js.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/componentScenarioPage/getIFrameMessageListenerCode.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +8 -4
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/deepMerge.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/deepMerge.js +27 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/deepMerge.js.map +1 -1
- 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/index.d.ts +2 -2
- package/analyzer-template/packages/github/dist/types/index.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/index.js.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/Analysis.d.ts +87 -13
- package/analyzer-template/packages/github/dist/types/src/types/Analysis.d.ts.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 +11 -6
- package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts +196 -0
- package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/StatementInfo.d.ts +2 -0
- package/analyzer-template/packages/github/dist/types/src/types/StatementInfo.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/lightweightEntityExtractor.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/lightweightEntityExtractor.js +25 -0
- package/analyzer-template/packages/github/dist/utils/src/lib/lightweightEntityExtractor.js.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.d.ts +9 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.js +29 -3
- package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.js.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/index.ts +5 -0
- package/analyzer-template/packages/types/src/types/Analysis.ts +104 -13
- package/analyzer-template/packages/types/src/types/Entity.ts +2 -0
- package/analyzer-template/packages/types/src/types/Scenario.ts +11 -10
- package/analyzer-template/packages/types/src/types/ScenariosDataStructure.ts +224 -0
- package/analyzer-template/packages/types/src/types/StatementInfo.ts +2 -0
- package/analyzer-template/packages/ui-components/src/components/ScenarioDetailInteractiveView.tsx +23 -7
- package/analyzer-template/packages/utils/dist/types/index.d.ts +2 -2
- package/analyzer-template/packages/utils/dist/types/index.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/index.js.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/Analysis.d.ts +87 -13
- package/analyzer-template/packages/utils/dist/types/src/types/Analysis.d.ts.map +1 -1
- 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 +11 -6
- package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts +196 -0
- package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/StatementInfo.d.ts +2 -0
- package/analyzer-template/packages/utils/dist/types/src/types/StatementInfo.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/lightweightEntityExtractor.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/lightweightEntityExtractor.js +25 -0
- package/analyzer-template/packages/utils/dist/utils/src/lib/lightweightEntityExtractor.js.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/safeFileName.d.ts +9 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/safeFileName.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/safeFileName.js +29 -3
- package/analyzer-template/packages/utils/dist/utils/src/lib/safeFileName.js.map +1 -1
- package/analyzer-template/packages/utils/src/lib/lightweightEntityExtractor.ts +27 -0
- package/analyzer-template/packages/utils/src/lib/safeFileName.ts +48 -3
- package/analyzer-template/playwright/capture.ts +37 -18
- package/analyzer-template/playwright/getCodeYamInfo.ts +12 -7
- package/analyzer-template/playwright/takeElementScreenshot.ts +26 -11
- package/analyzer-template/playwright/takeScreenshot.ts +9 -7
- package/analyzer-template/playwright/waitForServer.ts +21 -6
- package/analyzer-template/project/analyzeBaselineCommit.ts +4 -0
- package/analyzer-template/project/analyzeBranchCommit.ts +4 -0
- package/analyzer-template/project/analyzeFileEntities.ts +4 -0
- package/analyzer-template/project/analyzeRegularCommit.ts +4 -0
- package/analyzer-template/project/constructMockCode.ts +1181 -160
- package/analyzer-template/project/controller/startController.ts +16 -1
- package/analyzer-template/project/executeLibraryFunctionDirect.ts +7 -3
- package/analyzer-template/project/mocks/analyzeFileMock.ts +8 -7
- package/analyzer-template/project/orchestrateCapture/KyselyAnalysisLoader.ts +3 -6
- package/analyzer-template/project/orchestrateCapture/SequentialCaptureTaskRunner.ts +82 -36
- package/analyzer-template/project/orchestrateCapture.ts +36 -3
- package/analyzer-template/project/reconcileMockDataKeys.ts +245 -2
- package/analyzer-template/project/runAnalysis.ts +11 -0
- package/analyzer-template/project/runMultiScenarioServer.ts +11 -10
- package/analyzer-template/project/serverOnlyModules.ts +194 -21
- package/analyzer-template/project/start.ts +26 -4
- package/analyzer-template/project/startScenarioCapture.ts +79 -41
- package/analyzer-template/project/writeMockDataTsx.ts +232 -57
- package/analyzer-template/project/writeScenarioClientWrapper.ts +21 -0
- package/analyzer-template/project/writeScenarioComponents.ts +769 -181
- package/analyzer-template/project/writeScenarioFiles.ts +26 -0
- package/analyzer-template/project/writeSimpleRoot.ts +13 -15
- package/analyzer-template/scripts/comboWorkerLoop.cjs +1 -0
- package/analyzer-template/scripts/defaultCmd.sh +9 -0
- package/analyzer-template/tsconfig.json +2 -1
- 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/analyzeBaselineCommit.js +2 -1
- package/background/src/lib/virtualized/project/analyzeBaselineCommit.js.map +1 -1
- package/background/src/lib/virtualized/project/analyzeBranchCommit.js +2 -1
- package/background/src/lib/virtualized/project/analyzeBranchCommit.js.map +1 -1
- package/background/src/lib/virtualized/project/analyzeFileEntities.js +2 -1
- package/background/src/lib/virtualized/project/analyzeFileEntities.js.map +1 -1
- package/background/src/lib/virtualized/project/analyzeRegularCommit.js +2 -1
- package/background/src/lib/virtualized/project/analyzeRegularCommit.js.map +1 -1
- package/background/src/lib/virtualized/project/constructMockCode.js +1053 -124
- package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
- package/background/src/lib/virtualized/project/controller/startController.js +11 -1
- package/background/src/lib/virtualized/project/controller/startController.js.map +1 -1
- package/background/src/lib/virtualized/project/executeLibraryFunctionDirect.js +6 -3
- package/background/src/lib/virtualized/project/executeLibraryFunctionDirect.js.map +1 -1
- package/background/src/lib/virtualized/project/mocks/analyzeFileMock.js +7 -7
- package/background/src/lib/virtualized/project/mocks/analyzeFileMock.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/SequentialCaptureTaskRunner.js +69 -32
- package/background/src/lib/virtualized/project/orchestrateCapture/SequentialCaptureTaskRunner.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture.js +27 -4
- package/background/src/lib/virtualized/project/orchestrateCapture.js.map +1 -1
- package/background/src/lib/virtualized/project/reconcileMockDataKeys.js +204 -2
- package/background/src/lib/virtualized/project/reconcileMockDataKeys.js.map +1 -1
- package/background/src/lib/virtualized/project/runAnalysis.js +9 -0
- package/background/src/lib/virtualized/project/runAnalysis.js.map +1 -1
- package/background/src/lib/virtualized/project/runMultiScenarioServer.js +11 -9
- package/background/src/lib/virtualized/project/runMultiScenarioServer.js.map +1 -1
- package/background/src/lib/virtualized/project/serverOnlyModules.js +163 -23
- package/background/src/lib/virtualized/project/serverOnlyModules.js.map +1 -1
- package/background/src/lib/virtualized/project/start.js +21 -4
- package/background/src/lib/virtualized/project/start.js.map +1 -1
- package/background/src/lib/virtualized/project/startScenarioCapture.js +61 -31
- package/background/src/lib/virtualized/project/startScenarioCapture.js.map +1 -1
- package/background/src/lib/virtualized/project/writeMockDataTsx.js +199 -50
- 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 +552 -125
- 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 +13 -13
- package/background/src/lib/virtualized/project/writeSimpleRoot.js.map +1 -1
- package/codeyam-cli/src/cli.js +7 -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 +174 -0
- package/codeyam-cli/src/commands/baseline.js.map +1 -0
- package/codeyam-cli/src/commands/debug.js +40 -18
- package/codeyam-cli/src/commands/debug.js.map +1 -1
- package/codeyam-cli/src/commands/default.js +0 -15
- package/codeyam-cli/src/commands/default.js.map +1 -1
- package/codeyam-cli/src/commands/recapture.js +226 -0
- package/codeyam-cli/src/commands/recapture.js.map +1 -0
- package/codeyam-cli/src/commands/report.js +72 -24
- package/codeyam-cli/src/commands/report.js.map +1 -1
- package/codeyam-cli/src/commands/start.js +8 -12
- package/codeyam-cli/src/commands/start.js.map +1 -1
- 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/__tests__/serverVersionStaleness.test.js +81 -0
- package/codeyam-cli/src/utils/__tests__/serverVersionStaleness.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +31 -27
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
- package/codeyam-cli/src/utils/analysisRunner.js +8 -13
- package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
- package/codeyam-cli/src/utils/backgroundServer.js +14 -4
- package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/utils/database.js +91 -5
- package/codeyam-cli/src/utils/database.js.map +1 -1
- package/codeyam-cli/src/utils/generateReport.js +253 -106
- package/codeyam-cli/src/utils/generateReport.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/install-skills.js +31 -17
- package/codeyam-cli/src/utils/install-skills.js.map +1 -1
- package/codeyam-cli/src/utils/queue/__tests__/manager.test.js +38 -0
- package/codeyam-cli/src/utils/queue/__tests__/manager.test.js.map +1 -1
- package/codeyam-cli/src/utils/queue/job.js +245 -16
- package/codeyam-cli/src/utils/queue/job.js.map +1 -1
- package/codeyam-cli/src/utils/queue/manager.js +25 -7
- package/codeyam-cli/src/utils/queue/manager.js.map +1 -1
- package/codeyam-cli/src/utils/queue/persistence.js.map +1 -1
- package/codeyam-cli/src/utils/serverState.js.map +1 -1
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +7 -5
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
- package/codeyam-cli/src/utils/versionInfo.js +25 -19
- package/codeyam-cli/src/utils/versionInfo.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 +98 -1
- package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
- package/codeyam-cli/src/webserver/app/lib/dbNotifier.js.map +1 -1
- package/codeyam-cli/src/webserver/backgroundServer.js +5 -10
- package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/webserver/bootstrap.js +49 -0
- package/codeyam-cli/src/webserver/bootstrap.js.map +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/EntityItem-BXhEawa3.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-efWKDYMr.js → EntityTypeBadge-DLqD3qNt.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-Ba2JVPzP.js +41 -0
- package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-C8lyxW9k.js +34 -0
- package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-aht4aafF.js +25 -0
- package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-CVtiBnY5.js +3 -0
- package/codeyam-cli/src/webserver/build/client/assets/LoadingDots-B0GLXMsr.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/LogViewer-xgeCVgSM.js +3 -0
- package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-D4TZhLuw.js +21 -0
- package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-DuDvi0jm.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-DEx02QDa.js +10 -0
- package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-COPstp9J.js → TruncatedFilePath-DyFZkK0l.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/_index-BwqWJOgH.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-DoLIqZX2.js +37 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.health-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.restart-server-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.rules-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/chevron-down-Cx24_aWc.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/chunk-EPOLDU6W-CXRTFQ3F.js +51 -0
- package/codeyam-cli/src/webserver/build/client/assets/circle-check-BOARzkeR.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-BdhJEx6B.js +21 -0
- package/codeyam-cli/src/webserver/build/client/assets/{cy-logo-cli-C1gnJVOL.svg → cy-logo-cli-CCKUIm0S.svg} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/cy-logo-cli-DcX-ZS3p.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-BRb-0kQl.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha._-C2N4Op8e.js +23 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-DavjRmOY.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-D1T4TGjf.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.edit._scenarioId-CTBG2mmz.js +5 -0
- package/codeyam-cli/src/webserver/build/client/assets/entry.client-CS2cb_eZ.js +29 -0
- package/codeyam-cli/src/webserver/build/client/assets/executionFlowCoverage-BWhdfn70.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-DMJ7zii9.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/files-Cs4MdYtv.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/git-B4RJRvYB.js +15 -0
- package/codeyam-cli/src/webserver/build/client/assets/git-commit-horizontal-CysbcZxi.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/globals-DMUaGAqV.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/html2canvas-pro.esm-fmIEn3Bc.js +9 -0
- package/codeyam-cli/src/webserver/build/client/assets/index-B1h680n5.js +9 -0
- package/codeyam-cli/src/webserver/build/client/assets/index-lzqtyFU8.js +3 -0
- package/codeyam-cli/src/webserver/build/client/assets/loader-circle-B7B9V-bu.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/manifest-f874c610.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/preload-helper-ckwbz45p.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/root-Bz5TunQg.js +57 -0
- package/codeyam-cli/src/webserver/build/client/assets/rules-hEkvVw2-.js +97 -0
- package/codeyam-cli/src/webserver/build/client/assets/scenarioStatus-B_8jpV3e.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/search-CxXUmBSd.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/settings-CS5f3WzT.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/simulations-DwFIBT09.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/triangle-alert-B6LgvRJg.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-C1v1PQzo.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-3pmpUQB-.js → useLastLogLine-aSv48UbS.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/useReportContext-DYxHZQuP.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{useToast-DEyawJ8r.js → useToast-mBRpZPiu.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/index-967OuJoF.js +1 -0
- package/codeyam-cli/src/webserver/build/server/assets/server-build-DRTmerg9.js +257 -0
- package/codeyam-cli/src/webserver/build/server/index.js +1 -1
- package/codeyam-cli/src/webserver/build-info.json +5 -5
- package/codeyam-cli/src/webserver/devServer.js +1 -3
- package/codeyam-cli/src/webserver/devServer.js.map +1 -1
- package/codeyam-cli/src/webserver/server.js +35 -25
- package/codeyam-cli/src/webserver/server.js.map +1 -1
- package/codeyam-cli/templates/codeyam-power-rules-hook.sh +200 -0
- package/codeyam-cli/templates/{codeyam-debug-skill.md → codeyam:debug.md} +48 -4
- package/codeyam-cli/templates/codeyam:diagnose.md +650 -0
- package/codeyam-cli/templates/codeyam:new-rule.md +13 -0
- package/codeyam-cli/templates/codeyam:power-rules.md +447 -0
- package/codeyam-cli/templates/{codeyam-setup-skill.md → codeyam:setup.md} +139 -4
- package/codeyam-cli/templates/{codeyam-sim-skill.md → codeyam:sim.md} +1 -1
- package/codeyam-cli/templates/{codeyam-test-skill.md → codeyam:test.md} +1 -1
- package/codeyam-cli/templates/{codeyam-verify-skill.md → codeyam:verify.md} +1 -1
- package/package.json +17 -16
- package/packages/ai/index.js +5 -4
- package/packages/ai/index.js.map +1 -1
- package/packages/ai/src/lib/analyzeScope.js +99 -0
- package/packages/ai/src/lib/analyzeScope.js.map +1 -1
- package/packages/ai/src/lib/astScopes/arrayDerivationDetector.js +150 -0
- package/packages/ai/src/lib/astScopes/arrayDerivationDetector.js.map +1 -0
- package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js +100 -1
- package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js.map +1 -1
- package/packages/ai/src/lib/astScopes/conditionalEffectsExtractor.js +435 -0
- package/packages/ai/src/lib/astScopes/conditionalEffectsExtractor.js.map +1 -0
- package/packages/ai/src/lib/astScopes/methodSemantics.js +97 -6
- package/packages/ai/src/lib/astScopes/methodSemantics.js.map +1 -1
- package/packages/ai/src/lib/astScopes/patterns/ifStatementHandler.js +8 -0
- package/packages/ai/src/lib/astScopes/patterns/ifStatementHandler.js.map +1 -1
- package/packages/ai/src/lib/astScopes/patterns/switchStatementHandler.js +23 -0
- package/packages/ai/src/lib/astScopes/patterns/switchStatementHandler.js.map +1 -1
- package/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.js +138 -1
- package/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.js.map +1 -1
- package/packages/ai/src/lib/astScopes/processExpression.js +945 -87
- 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/completionCall.js +178 -31
- package/packages/ai/src/lib/completionCall.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +1198 -82
- 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 +661 -0
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.js.map +1 -0
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js +180 -56
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js +16 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js +86 -4
- package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js +20 -0
- package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.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/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js +34 -3
- package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/fixNullIdsBySchema.js +107 -0
- package/packages/ai/src/lib/dataStructure/helpers/fixNullIdsBySchema.js.map +1 -0
- package/packages/ai/src/lib/dataStructureChunking.js +111 -0
- package/packages/ai/src/lib/dataStructureChunking.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/e2eDataTracking.js +241 -0
- package/packages/ai/src/lib/e2eDataTracking.js.map +1 -0
- package/packages/ai/src/lib/extractCriticalDataKeys.js +96 -0
- package/packages/ai/src/lib/extractCriticalDataKeys.js.map +1 -0
- package/packages/ai/src/lib/generateChangesEntityScenarioData.js +62 -5
- package/packages/ai/src/lib/generateChangesEntityScenarioData.js.map +1 -1
- package/packages/ai/src/lib/generateChangesEntityScenarios.js +81 -90
- package/packages/ai/src/lib/generateChangesEntityScenarios.js.map +1 -1
- package/packages/ai/src/lib/generateEntityDataStructure.js +5 -0
- package/packages/ai/src/lib/generateEntityDataStructure.js.map +1 -1
- package/packages/ai/src/lib/generateEntityScenarioData.js +904 -84
- package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
- package/packages/ai/src/lib/generateEntityScenarios.js +186 -82
- package/packages/ai/src/lib/generateEntityScenarios.js.map +1 -1
- package/packages/ai/src/lib/generateExecutionFlows.js +392 -0
- package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.js +380 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.js.map +1 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js +1440 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js.map +1 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.js +194 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.js.map +1 -0
- package/packages/ai/src/lib/getConditionalUsagesFromCode.js +84 -14
- package/packages/ai/src/lib/getConditionalUsagesFromCode.js.map +1 -1
- package/packages/ai/src/lib/guessScenarioDataFromDescription.js +2 -1
- package/packages/ai/src/lib/guessScenarioDataFromDescription.js.map +1 -1
- package/packages/ai/src/lib/isolateScopes.js +231 -4
- package/packages/ai/src/lib/isolateScopes.js.map +1 -1
- package/packages/ai/src/lib/mergeStatements.js +26 -3
- package/packages/ai/src/lib/mergeStatements.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js +6 -0
- package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.js +1 -1
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js +21 -64
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateChunkPrompt.js +54 -0
- package/packages/ai/src/lib/promptGenerators/generateChunkPrompt.js.map +1 -0
- package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js +68 -6
- package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.js +10 -34
- package/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateMissingKeysPrompt.js +45 -0
- package/packages/ai/src/lib/promptGenerators/generateMissingKeysPrompt.js.map +1 -0
- package/packages/ai/src/lib/promptGenerators/guessNewScenarioDataFromDescriptionGenerator.js +16 -3
- package/packages/ai/src/lib/promptGenerators/guessNewScenarioDataFromDescriptionGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/simplifyKeysForLLM.js +335 -0
- package/packages/ai/src/lib/promptGenerators/simplifyKeysForLLM.js.map +1 -0
- package/packages/ai/src/lib/resolvePathToControllable.js +667 -0
- package/packages/ai/src/lib/resolvePathToControllable.js.map +1 -0
- package/packages/ai/src/lib/splitOutsideParentheses.js +3 -1
- package/packages/ai/src/lib/splitOutsideParentheses.js.map +1 -1
- package/packages/ai/src/lib/worker/SerializableDataStructure.js +29 -0
- package/packages/ai/src/lib/worker/SerializableDataStructure.js.map +1 -1
- package/packages/ai/src/lib/worker/analyzeScopeWorker.js +4 -0
- package/packages/ai/src/lib/worker/analyzeScopeWorker.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/analysisContext.js +30 -5
- package/packages/analyze/src/lib/analysisContext.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 +218 -50
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +10 -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/analyze/validateDependencyAnalyses.js +31 -7
- package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeChange.js +21 -11
- package/packages/analyze/src/lib/files/analyzeChange.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeEntity.js +9 -8
- package/packages/analyze/src/lib/files/analyzeEntity.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeInitial.js +9 -10
- package/packages/analyze/src/lib/files/analyzeInitial.js.map +1 -1
- package/packages/analyze/src/lib/files/enums/steps.js +1 -1
- package/packages/analyze/src/lib/files/enums/steps.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js +209 -0
- package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js.map +1 -0
- 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 +458 -48
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateChangesScenarioData.js +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateChangesScenarioData.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.js +29 -34
- package/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +264 -78
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js +96 -0
- package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js.map +1 -0
- package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js +56 -69
- package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateScenarios.js +4 -8
- package/packages/analyze/src/lib/files/scenarios/generateScenarios.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +372 -89
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.js +46 -9
- package/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.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/database/src/lib/kysely/db.js +2 -2
- package/packages/database/src/lib/kysely/tables/debugReportsTable.js +9 -3
- package/packages/database/src/lib/kysely/tables/debugReportsTable.js.map +1 -1
- package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.js +7 -4
- package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.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/componentScenarioPage/getIFrameMessageListenerCode.js +8 -4
- package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
- package/packages/generate/src/lib/deepMerge.js +27 -1
- package/packages/generate/src/lib/deepMerge.js.map +1 -1
- 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/packages/types/index.js.map +1 -1
- package/packages/utils/src/lib/lightweightEntityExtractor.js +25 -0
- package/packages/utils/src/lib/lightweightEntityExtractor.js.map +1 -1
- package/packages/utils/src/lib/safeFileName.js +29 -3
- package/packages/utils/src/lib/safeFileName.js.map +1 -1
- package/scripts/finalize-analyzer.cjs +6 -4
- package/analyzer-template/packages/ai/src/lib/findMatchingAttribute.ts +0 -102
- package/analyzer-template/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.ts +0 -197
- package/analyzer-template/packages/ai/src/lib/generateChangesEntityKeyAttributes.ts +0 -271
- package/analyzer-template/packages/ai/src/lib/generateEntityKeyAttributes.ts +0 -294
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityKeyAttributesGenerator.ts +0 -67
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.ts +0 -115
- 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/src/webserver/build/client/assets/EntityItem-CVbSvOjo.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-DcwcHyl5.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-WgwC1GfJ.js +0 -26
- package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-IEKom9O2.js +0 -3
- package/codeyam-cli/src/webserver/build/client/assets/LogViewer-BYnfxbUG.js +0 -3
- package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-_lBPJCzG.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-lHVhvsu_.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-d_TBk4GQ.js +0 -5
- package/codeyam-cli/src/webserver/build/client/assets/_index-kGT7VUqj.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-DDGmhu7P.js +0 -7
- package/codeyam-cli/src/webserver/build/client/assets/chevron-down-n_HPRfM_.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/chunk-WWGJGFF6-CbVoyx1U.js +0 -26
- package/codeyam-cli/src/webserver/build/client/assets/circle-check-D1VOYveA.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-YR8jjAlu.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-B8vP3V_s.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha._-CN6aLCT1.js +0 -16
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-DA5Jeu2P.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.edit._scenarioId-BTeitalf.js +0 -5
- package/codeyam-cli/src/webserver/build/client/assets/entry.client-du6UEYD-.js +0 -13
- package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-BpjkhMoi.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/files-BQGvk4lJ.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/git-DVdYRT-I.js +0 -12
- package/codeyam-cli/src/webserver/build/client/assets/globals-CO-U8Bpo.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/html2canvas-pro.esm-XQCGvadH.js +0 -5
- package/codeyam-cli/src/webserver/build/client/assets/index-DCG-vks0.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/loader-circle-GazdNeLl.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-0b694d28.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/root-D3tQP7hx.js +0 -16
- package/codeyam-cli/src/webserver/build/client/assets/search-CIY6XmtE.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/server-build-CMKNK2uU.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/settings-CoMDgElu.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/simulations-agkniXp2.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/triangle-alert-B2VUcygF.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useReportContext-EvdK-zXP.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/index-DGVHQEXD.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-CghkTkIL.js +0 -166
- package/codeyam-cli/templates/debug-command.md +0 -303
- package/packages/ai/src/lib/findMatchingAttribute.js +0 -77
- package/packages/ai/src/lib/findMatchingAttribute.js.map +0 -1
- package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js +0 -136
- package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js.map +0 -1
- package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js +0 -220
- package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js.map +0 -1
- package/packages/ai/src/lib/generateEntityKeyAttributes.js +0 -241
- package/packages/ai/src/lib/generateEntityKeyAttributes.js.map +0 -1
- package/packages/ai/src/lib/isFrontend.js +0 -5
- package/packages/ai/src/lib/isFrontend.js.map +0 -1
- package/packages/ai/src/lib/promptGenerators/generateEntityKeyAttributesGenerator.js +0 -40
- package/packages/ai/src/lib/promptGenerators/generateEntityKeyAttributesGenerator.js.map +0 -1
- package/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.js +0 -72
- package/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.js.map +0 -1
- /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/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-CMKNK2uU.css → styles-CMKNK2uU.css} +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
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// set NODE_ENV before any imports that load React/React-DOM
|
|
3
|
+
if (!process.env.NODE_ENV) {
|
|
4
|
+
process.env.NODE_ENV = 'production';
|
|
5
|
+
}
|
|
6
|
+
import * as net from 'net';
|
|
7
|
+
/**
|
|
8
|
+
* Check if a port is available by attempting to create a server on it
|
|
9
|
+
*/
|
|
10
|
+
function isPortAvailable(port) {
|
|
11
|
+
return new Promise((resolve) => {
|
|
12
|
+
const server = net.createServer();
|
|
13
|
+
server.once('error', () => resolve(false));
|
|
14
|
+
server.once('listening', () => {
|
|
15
|
+
server.close(() => resolve(true));
|
|
16
|
+
});
|
|
17
|
+
server.listen(port, '127.0.0.1');
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Wait for a port to become available
|
|
22
|
+
*/
|
|
23
|
+
async function waitForPort(port, maxWaitMs = 30000) {
|
|
24
|
+
const startTime = Date.now();
|
|
25
|
+
const pollIntervalMs = 100;
|
|
26
|
+
while (Date.now() - startTime < maxWaitMs) {
|
|
27
|
+
if (await isPortAvailable(port)) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
await new Promise((resolve) => setTimeout(resolve, pollIntervalMs));
|
|
31
|
+
}
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
void (async () => {
|
|
35
|
+
const port = parseInt(process.env.CODEYAM_PORT || '3111');
|
|
36
|
+
// If CODEYAM_WAIT_FOR_PORT is set, wait for the port to be free before starting
|
|
37
|
+
// This is used during server restart to wait for the old server to exit
|
|
38
|
+
if (process.env.CODEYAM_WAIT_FOR_PORT === 'true') {
|
|
39
|
+
console.log(`[Bootstrap] Waiting for port ${port} to become available...`);
|
|
40
|
+
const portAvailable = await waitForPort(port);
|
|
41
|
+
if (!portAvailable) {
|
|
42
|
+
console.error(`[Bootstrap] Port ${port} did not become available within timeout`);
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
console.log(`[Bootstrap] Port ${port} is now available, starting server...`);
|
|
46
|
+
}
|
|
47
|
+
await import('./backgroundServer.js');
|
|
48
|
+
})();
|
|
49
|
+
//# sourceMappingURL=bootstrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../../../src/webserver/bootstrap.ts"],"names":[],"mappings":";AAEA,4DAA4D;AAC5D,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IAC1B,OAAO,CAAC,GAAG,CAAC,QAAQ,GAAG,YAAY,CAAC;AACtC,CAAC;AAED,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAE3B;;GAEG;AACH,SAAS,eAAe,CAAC,IAAY;IACnC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,MAAM,MAAM,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC;QAClC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;QAC3C,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE;YAC5B,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,KAAK,UAAU,WAAW,CACxB,IAAY,EACZ,YAAoB,KAAK;IAEzB,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC7B,MAAM,cAAc,GAAG,GAAG,CAAC;IAE3B,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,GAAG,SAAS,EAAE,CAAC;QAC1C,IAAI,MAAM,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;YAChC,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,KAAK,CAAC,KAAK,IAAI,EAAE;IACf,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,MAAM,CAAC,CAAC;IAE1D,gFAAgF;IAChF,wEAAwE;IACxE,IAAI,OAAO,CAAC,GAAG,CAAC,qBAAqB,KAAK,MAAM,EAAE,CAAC;QACjD,OAAO,CAAC,GAAG,CAAC,gCAAgC,IAAI,yBAAyB,CAAC,CAAC;QAC3E,MAAM,aAAa,GAAG,MAAM,WAAW,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,OAAO,CAAC,KAAK,CACX,oBAAoB,IAAI,0CAA0C,CACnE,CAAC;YACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,OAAO,CAAC,GAAG,CACT,oBAAoB,IAAI,uCAAuC,CAChE,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC;AACxC,CAAC,CAAC,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as C,r as u,j as e,L as N}from"./chunk-EPOLDU6W-CXRTFQ3F.js";import{u as E}from"./useToast-mBRpZPiu.js";import{f as T,g as F}from"./fileTableUtils-DMJ7zii9.js";import{T as D}from"./TruncatedFilePath-DyFZkK0l.js";import{S as k}from"./SafeScreenshot-DuDvi0jm.js";import{L as P}from"./LibraryFunctionPreview-CVtiBnY5.js";import{T as B}from"./triangle-alert-B6LgvRJg.js";import{E as v}from"./EntityTypeIcon-Ba2JVPzP.js";import{E as I}from"./EntityTypeBadge-DLqD3qNt.js";function w(s){return`${s.filePath||""}::${s.name}`}function S(s,i){const n=C(),{showToast:d}=E(),[l,o]=u.useState(new Map);u.useEffect(()=>{if(n.state==="idle"&&n.data){const t=n.data;t!=null&&t.error&&d(`Error: ${t.error}`,"error",6e3)}},[n.state,n.data,d]),u.useEffect(()=>{var r;if(l.size===0)return;const t=new Set;(r=i==null?void 0:i.jobs)==null||r.forEach(c=>{var x;(x=c.entityShas)==null||x.forEach(m=>{l.forEach((b,j)=>{b===m&&t.add(j)})})}),s==null||s.forEach(c=>{l.forEach((x,m)=>{x===c&&t.add(m)})}),t.size>0&&o(c=>{const x=new Map(c);return t.forEach(m=>x.delete(m)),x})},[i,s,l]);const h=u.useCallback(t=>{console.log("Generate analysis clicked for entity:",t.sha,t.name);const r=w(t);o(x=>new Map(x).set(r,t.sha));const c=new FormData;c.append("entitySha",t.sha),c.append("filePath",t.filePath||""),n.submit(c,{method:"post",action:"/api/analyze"})},[n]),g=u.useCallback(t=>{const r=t.filter(m=>m.entityType==="visual"||m.entityType==="library");console.log("Generate analysis for all entities:",r.length),o(m=>{const b=new Map(m);return r.forEach(j=>b.set(w(j),j.sha)),b});const c=r.map(m=>m.sha).join(","),x=new FormData;x.append("entityShas",c),n.submit(x,{method:"post",action:"/api/analyze"})},[n]),a=u.useCallback(t=>(s==null?void 0:s.includes(t))??!1,[s]),y=u.useCallback(t=>{const r=w(t);return l.has(r)},[l]),p=u.useCallback(t=>{var r;return((r=i==null?void 0:i.jobs)==null?void 0:r.some(c=>{var x;return(x=c.entityShas)==null?void 0:x.includes(t)}))??!1},[i]),f=u.useMemo(()=>Array.from(l.keys()),[l]);return{isAnalyzing:n.state!=="idle",handleGenerateSimulation:h,handleGenerateAllSimulations:g,isEntityBeingAnalyzed:a,isEntityPending:y,isEntityInQueue:p,pendingEntityKeys:f}}function G({showActions:s=!1,sortOrder:i="desc",onSortChange:n,onAnalyzeAll:d,analyzeAllDisabled:l=!1,analyzeAllText:o="Analyze All"}){return 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 justify-between items-center px-3 py-2",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[e.jsx("span",{className:"w-4"}),e.jsx("span",{children:"FILE"})]}),e.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[e.jsx("div",{className:"flex items-center justify-center h-[38px]",style:{width:"100px"},children:e.jsx("span",{children:"UNCOMMITTED"})}),e.jsx("div",{className:"flex items-center justify-center h-[38px]",style:{width:"70px"},children:e.jsx("span",{children:"SIMULATIONS"})}),e.jsxs("div",{className:"flex gap-4 items-center",children:[e.jsx("span",{className:"text-center",style:{width:"70px"},children:"ENTITIES"}),e.jsxs("div",{className:"flex items-center justify-center gap-1 cursor-pointer hover:text-[#232323] transition-colors",style:{width:"116px"},onClick:n,role:"button",tabIndex:0,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),n==null||n())},children:[e.jsx("span",{children:"MODIFIED"}),e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{transform:i==="asc"?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"},children:e.jsx("path",{d:"M3 5L6 8L9 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),s&&e.jsx("div",{className:"text-center",style:{width:"127px"},children:d&&e.jsx("button",{onClick:d,disabled:l,className:"bg-[#005c75] text-white rounded text-[12px] font-['IBM_Plex_Sans'] font-normal hover:bg-[#004a5e] transition-colors cursor-pointer disabled:bg-gray-400 disabled:cursor-not-allowed whitespace-nowrap px-3 py-1.5 normal-case",title:l?o:"Analyze all entities",children:o})})]})]})]})})}function M({status:s,variant:i="compact"}){const n={modified:{label:"M",bgColor:"bg-[#f59e0c]"},added:{label:"A",bgColor:"bg-emerald-500"},deleted:{label:"D",bgColor:"bg-red-500",showWarning:!0},renamed:{label:"R",bgColor:"bg-indigo-500"},untracked:{label:"U",bgColor:"bg-purple-500"}},d={modified:{label:"MODIFIED",textColor:"#BB6BD9"},added:{label:"ADDED",textColor:"#F2994A"},deleted:{label:"DELETED",textColor:"#EF4444"},renamed:{label:"RENAMED",textColor:"#3B82F6"},untracked:{label:"UNTRACKED",textColor:"#6B7280"}};if(i==="full"){const o=d[s]||{label:"UNKNOWN",textColor:"#6B7280"};return e.jsx("div",{className:"bg-[#f9f9f9] inline-flex items-center justify-center px-[5px] py-0 rounded",style:{height:"22px"},children:e.jsx("span",{className:"text-[10px] font-['IBM_Plex_Sans'] font-medium leading-[22px]",style:{color:o.textColor},children:o.label})})}const l=n[s]||{label:"?",bgColor:"bg-gray-500"};return e.jsxs("div",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:`inline-flex items-center justify-center w-5 h-5 text-[11px] font-bold text-white rounded ${l.bgColor}`,title:s,children:l.label}),l.showWarning&&e.jsx("span",{className:"inline-flex items-center justify-center w-3 h-3 text-[10px] text-amber-600",title:"Warning: File will be deleted",children:"⚠"})]})}function U({filePath:s,isExpanded:i,onToggle:n,fileStatus:d,simulationPreviews:l,entityCount:o,state:h,lastModified:g,actionButton:a,uncommittedCount:y,children:p,isNotAnalyzable:f=!1,isUncommitted:t=!1}){return e.jsxs("div",{className:"bg-white overflow-hidden",style:i?{border:"1px solid #e1e1e1",borderLeft:"4px solid #005C75",borderRadius:"8px"}:{borderBottom:"1px solid #e1e1e1"},children:[e.jsxs("div",{className:`flex justify-between items-center p-3 cursor-pointer select-none transition-colors ${f?"opacity-50":"hover:bg-gray-200"}`,style:{outlineColor:"#005C75"},onClick:n,role:"button",tabIndex:0,onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),n())},children:[e.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[e.jsx("span",{className:"w-4 inline-flex items-center justify-center shrink-0",style:{transform:i?"rotate(90deg)":"none"},children:e.jsx("svg",{width:"10",height:"12",viewBox:"0 0 10 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M1.5 1.268L8.5 6L1.5 10.732V1.268Z",fill:i?"#3e3e3e":"#c7c7c7"})})}),e.jsx("img",{src:"/icons/file-icon.svg",alt:"file",className:"w-4 h-5 shrink-0"}),e.jsx(D,{filePath:s}),d&&e.jsx(M,{status:typeof d=="string"?d:d.status,variant:"full"}),t&&h==="out-of-date"&&e.jsx("span",{className:"text-[11px] px-2 rounded inline-flex items-center gap-1.5 whitespace-nowrap",style:{backgroundColor:"#fdf9c9",color:"#c69538",height:"22px"},children:"Out of date"})]}),e.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[e.jsx("div",{className:"flex items-center justify-center h-[38px]",style:{width:"100px"},children:(t||h==="out-of-date")&&e.jsxs("div",{className:"flex gap-1.5 items-center",children:[t&&e.jsx("span",{className:"text-[11px] px-2 rounded inline-flex items-center gap-1.5 whitespace-nowrap",style:{backgroundColor:"#fff3cd",color:"#856404",height:"22px"},children:"Uncommitted"}),h==="out-of-date"&&!t&&e.jsx("span",{className:"text-[11px] px-2 rounded inline-flex items-center gap-1.5 whitespace-nowrap",style:{backgroundColor:"#fdf9c9",color:"#c69538",height:"22px"},children:"Out of date"})]})}),e.jsx("div",{className:"flex items-center justify-center h-[38px]",style:{width:"70px"},children:l}),e.jsxs("div",{className:"flex gap-4 items-center",children:[e.jsx("div",{className:"flex items-center justify-center",style:{width:"70px"},children:e.jsx("div",{className:"bg-[#f9f9f9] flex items-center justify-center px-2 rounded whitespace-nowrap",style:{height:"26px"},children:e.jsxs("span",{className:"text-[13px] text-[#3e3e3e]",children:[o," ",o===1?"entity":"entities"]})})}),e.jsx("div",{className:"text-[12px] text-gray-600 text-center",style:{width:"116px"},children:T(g)}),e.jsx("div",{style:{width:"127px"},className:"flex justify-center",children:a})]})]})]}),i&&p&&e.jsx("div",{className:"bg-gray-50 py-2 rounded-bl-[4px] rounded-br-[4px] flex flex-col gap-1",children:p})]})}function H({entities:s,maxPreviews:i=3}){var d,l,o,h,g;const n=[];for(const a of s){if(n.length>=i)break;const y=((l=(d=a.analyses)==null?void 0:d[0])==null?void 0:l.scenarios)||[];if(a.entityType==="library"){const p=y.find(f=>{var t,r;return((t=f.metadata)==null?void 0:t.executionResult)||((r=f.metadata)==null?void 0:r.error)});p&&n.push({type:"library",scenario:p,entitySha:a.sha})}else if(a.entityType==="visual"){const p=y.find(f=>{var t,r;return(r=(t=f.metadata)==null?void 0:t.screenshotPaths)==null?void 0:r[0]});if(p){const f=(h=(o=p.metadata)==null?void 0:o.screenshotPaths)==null?void 0:h[0],t=!!((g=p.metadata)!=null&&g.error);f&&n.push({type:"screenshot",screenshot:f,hasError:t,scenario:p,entitySha:a.sha})}}}return n.length===0?e.jsx("span",{className:"text-gray-400 font-light text-[14px]",children:"—"}):e.jsx(e.Fragment,{children:n.map((a,y)=>{if(a.type==="screenshot"&&a.screenshot){const p=a.hasError?"border-red-400":"border-gray-200";return e.jsxs(N,{to:a.scenario?`/entity/${a.entitySha}/scenarios/${a.scenario.id}`:`/entity/${a.entitySha}`,className:`relative w-[50px] h-[38px] border ${p} rounded overflow-hidden bg-gray-50 shrink-0 flex items-center justify-center cursor-pointer transition-all hover:scale-105 hover:shadow-md`,onClick:f=>f.stopPropagation(),children:[e.jsx(k,{screenshotPath:a.screenshot,alt:`Preview ${y+1}`,className:"max-w-full max-h-full object-contain object-center"}),a.hasError&&e.jsx("div",{className:"absolute top-0 right-0 w-4 h-4 bg-red-500 text-white flex items-center justify-center text-[10px] rounded-bl",title:"Error during capture",children:e.jsx(B,{size:12,color:"white"})})]},`screenshot-${y}`)}return a.type==="library"&&a.scenario&&a.entitySha?e.jsx(P,{scenario:a.scenario,entitySha:a.entitySha,size:"small",showBorder:!0},`library-${y}`):null})})}function J({entity:s,isActivelyAnalyzing:i,isQueued:n,onGenerateSimulation:d}){var p,f;const l=i||n?[{entityShas:[s.sha]}]:[],o=F(s,l,i),h=s.entityType==="visual"||s.entityType==="library",g=h&&(o==="not-analyzed"||o==="out-of-date")&&!i&&!n,y=(((f=(p=s.analyses)==null?void 0:p[0])==null?void 0:f.scenarios)||[]).filter(t=>{var r,c;return(c=(r=t.metadata)==null?void 0:r.screenshotPaths)==null?void 0:c[0]});return e.jsxs("div",{className:"bg-white rounded-lg",children:[e.jsxs(N,{to:`/entity/${s.sha}`,className:"flex items-center justify-between p-3 transition-colors hover:bg-gray-100 cursor-pointer",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[e.jsx("span",{className:"w-4 shrink-0"}),s.entityType==="type"?e.jsx("div",{className:"bg-[#ffe1e1] inline-flex items-center justify-center px-[4px] rounded-[4px]",style:{height:"18px",width:"18px"},children:e.jsx("div",{className:"w-[10px] h-[10px] flex items-center justify-center",children:e.jsx(v,{type:"type"})})}):e.jsx(v,{type:s.entityType||"other"}),e.jsx("span",{className:`font-['IBM_Plex_Sans'] text-[14px] leading-[18px] text-black ${h?"font-medium":"font-normal"}`,children:s.name}),e.jsx(I,{type:s.entityType||"other"})]}),e.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[e.jsx("div",{style:{width:"160px"}}),e.jsxs("div",{className:"flex gap-4 items-center",children:[e.jsx("div",{style:{width:"70px"}}),e.jsx("div",{style:{width:"116px"}}),e.jsx("div",{style:{width:"127px"},className:"flex justify-center items-center",children:h?o==="queued"?e.jsxs("span",{className:"text-[13px] px-2 rounded inline-flex items-center gap-1.5 whitespace-nowrap",style:{backgroundColor:"#cbf3fa",color:"#3098b4",height:"26px"},children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#3098b4",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("polyline",{points:"12,6 12,12 16,14"})]}),"Queued"]}):o==="analyzing"?e.jsxs("span",{className:"text-[13px] px-2 rounded inline-flex items-center gap-1.5 whitespace-nowrap",style:{backgroundColor:"#ffdbf6",color:"#ff2ab5",height:"26px"},children:[e.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 9 9",fill:"none",className:"animate-spin",children:[e.jsx("circle",{cx:"4.5",cy:"4.5",r:"3.5",stroke:"#FFF4FC",strokeWidth:"1",fill:"none"}),e.jsx("path",{d:"M4.5 1C2.57 1 1 2.57 1 4.5C1 5.6 1.5 6.58 2.28 7.23",stroke:"#FF2AB5",strokeWidth:"1",strokeLinecap:"round",fill:"none"})]}),"Analyzing..."]}):o==="up-to-date"?e.jsx("span",{className:"text-[13px] px-2 rounded inline-flex items-center gap-1.5 whitespace-nowrap",style:{backgroundColor:"#e8ffe6",color:"#00925d",height:"26px"},children:"Up to date"}):o==="out-of-date"?e.jsx("button",{onClick:t=>{t.preventDefault(),t.stopPropagation(),d(s)},className:"bg-[#e0e9ec] text-[#005c75] rounded text-[12px] font-['IBM_Plex_Sans'] font-normal hover:bg-[#d0dfe5] transition-colors cursor-pointer px-[15px] py-0 h-[28px]",children:"Re-Analyze"}):g&&e.jsx("button",{onClick:t=>{t.preventDefault(),t.stopPropagation(),d(s)},className:"bg-[#e0e9ec] text-[#005c75] rounded text-[12px] font-['IBM_Plex_Sans'] font-normal hover:bg-[#d0dfe5] transition-colors cursor-pointer px-[15px] py-0 h-[28px]",children:"Analyze"}):e.jsx("span",{className:"text-[12px] text-gray-400",children:"Not Analyzable"})})]})]})]}),y.length>0&&e.jsx("div",{className:"px-3 pb-3 pt-0 flex items-center gap-2 pl-[52px]",children:y.map((t,r)=>{var x,m;const c=(m=(x=t.metadata)==null?void 0:x.screenshotPaths)==null?void 0:m[0];return c?e.jsx(N,{to:`/entity/${s.sha}?scenario=${t.id}`,className:"relative w-[120px] h-[90px] border border-gray-200 rounded overflow-hidden bg-gray-50 shrink-0 flex items-center justify-center hover:border-gray-400 transition-colors",onClick:b=>b.stopPropagation(),children:e.jsx(k,{screenshotPath:c,alt:t.name,className:"max-w-full max-h-full object-contain object-center"})},t.id):null})})]})}export{J as E,G as F,H as S,U as a,S as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as o}from"./chunk-
|
|
1
|
+
import{j as o}from"./chunk-EPOLDU6W-CXRTFQ3F.js";const l={visual:{label:"VISUAL",bgColor:"#f9f9f9",textColor:"#9040f5"},library:{label:"LIBRARY",bgColor:"#f9f9f9",textColor:"#06b6d5"},type:{label:"TYPE",bgColor:"#ffe1e1",textColor:"#db2627"},other:{label:"OTHER",bgColor:"#f9f9f9",textColor:"#646464"}};function n({type:t,className:r=""}){const e=l[t]||l.other;return o.jsx("div",{className:`inline-flex items-center justify-center px-[4px] rounded-[4px] ${r}`,style:{backgroundColor:e.bgColor,color:e.textColor,height:"15px"},children:o.jsx("span",{className:"text-[10px] font-['IBM_Plex_Sans'] font-semibold leading-[15px] uppercase",children:e.label})})}export{n as E};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import{j as e}from"./chunk-EPOLDU6W-CXRTFQ3F.js";import{c}from"./createLucideIcon-BdhJEx6B.js";/**
|
|
2
|
+
* @license lucide-react v0.556.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const h=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],g=c("box",h);/**
|
|
7
|
+
* @license lucide-react v0.556.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const f=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],p=c("chart-column",f);/**
|
|
12
|
+
* @license lucide-react v0.556.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const b=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],y=c("code-xml",b);/**
|
|
17
|
+
* @license lucide-react v0.556.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const x=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],i=c("code",x);/**
|
|
22
|
+
* @license lucide-react v0.556.0 - ISC
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the ISC license.
|
|
25
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/const C=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],s=c("file-text",C);/**
|
|
27
|
+
* @license lucide-react v0.556.0 - ISC
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the ISC license.
|
|
30
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/const k=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],u=c("image",k);/**
|
|
32
|
+
* @license lucide-react v0.556.0 - ISC
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the ISC license.
|
|
35
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/const m=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],z=c("list",m);/**
|
|
37
|
+
* @license lucide-react v0.556.0 - ISC
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the ISC license.
|
|
40
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/const j=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],M=c("tag",j);function v({type:t,size:a="default"}){const n={visual:{iconColor:"#7c3aed",bgColor:"bg-purple-100",bgHex:"#f3e8ff"},library:{iconColor:"#06b6d5",bgColor:"bg-[#e6fbff]",bgHex:"#e6fbff"},type:{iconColor:"#db2627",bgColor:"bg-[#ffe1e1]",bgHex:"#ffe1e1"},data:{iconColor:"#2563eb",bgColor:"bg-blue-100",bgHex:"#dbeafe"},index:{iconColor:"#ea580c",bgColor:"bg-orange-100",bgHex:"#ffedd5"},functionCall:{iconColor:"#7c3aed",bgColor:"bg-purple-100",bgHex:"#f3e8ff"},class:{iconColor:"#059669",bgColor:"bg-emerald-100",bgHex:"#d1fae5"},method:{iconColor:"#0891b2",bgColor:"bg-cyan-100",bgHex:"#cffafe"},other:{iconColor:"#6b7280",bgColor:"bg-gray-100",bgHex:"#f3f4f6"}},o=n[t]||n.other,r=a==="large"?18:14,l=a==="large"?32:18,d=()=>{switch(t){case"library":return e.jsx(y,{size:r,color:o.iconColor});case"visual":return e.jsx(u,{size:r,color:o.iconColor});case"type":return e.jsx(M,{size:r,color:o.iconColor});case"data":return e.jsx(p,{size:r,color:o.iconColor});case"index":return e.jsx(z,{size:r,color:o.iconColor});case"functionCall":return e.jsx(i,{size:r,color:o.iconColor});case"class":return e.jsx(g,{size:r,color:o.iconColor});case"method":return e.jsx(i,{size:r,color:o.iconColor});case"other":return e.jsx(s,{size:r,color:o.iconColor});default:return e.jsx(s,{size:r,color:o.iconColor})}};return e.jsx("span",{className:`flex items-center justify-center rounded ${o.bgColor}`,style:{width:`${l}px`,height:`${l}px`},children:d()})}export{y as C,v as E,u as I};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import{c as _,r as e,j as h}from"./chunk-EPOLDU6W-CXRTFQ3F.js";import{u as K}from"./useLastLogLine-aSv48UbS.js";function U(s){const r=s.replace(/[^a-zA-Z0-9_]+/g,"_");return r.slice(0,1).toUpperCase()+r.slice(1)}function V({analysisId:s,scenarioId:r,scenarioName:a,projectSlug:i,enabled:g=!0,refreshTrigger:f=0}){const k=_(),[S,w]=e.useState(null),[A,E]=e.useState(!1),[B,c]=e.useState(!1),[q,l]=e.useState(!1),d=e.useRef(!1),x=e.useRef(null),I=e.useRef(null),[M,m]=e.useState(0),[z,R]=e.useState(0),n=e.useRef(null),u=e.useRef(!1),{interactiveUrl:b,resetLogs:L}=K(i,g),y=e.useRef(r),F=e.useRef(f);e.useEffect(()=>{F.current!==f&&(F.current=f,S&&(console.log("[useInteractiveMode] Manual refresh triggered"),c(!0),l(!1),m(0),R(t=>t+1),u.current=!1,n.current&&(clearTimeout(n.current),n.current=null)))},[f,S]),e.useEffect(()=>{if(y.current!==r&&(y.current=r,x.current&&I.current&&a)){const t=U(I.current),o=U(a),p=x.current.replace(t,o);w(p),c(!0),l(!1),m(0),R(v=>v+1),u.current=!1,n.current&&(clearTimeout(n.current),n.current=null);return}},[r,a]),e.useEffect(()=>{if(b){const t=b+"?width=600px";x.current=t,a&&(I.current=a),w(t),E(!1),c(!0)}},[b]),e.useEffect(()=>{const t=o=>{o.data.type==="codeyam-resize"&&(u.current||(u.current=!0,n.current&&(clearTimeout(n.current),n.current=null),m(0),l(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{c(!1)})})))};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)},[]);const j=()=>{u.current=!1,n.current&&clearTimeout(n.current);const t=500*Math.pow(2,M);n.current=setTimeout(()=>{u.current||(M<2?(m(o=>o+1),R(o=>o+1),c(!0)):(console.error("[useInteractiveMode] Interactive mode failed to load after 3 attempts - showing iframe anyway"),l(!0),c(!1)))},t)};return e.useEffect(()=>{g&&!d.current&&r&&s&&(d.current=!0,E(!0),l(!1),w(null),(async()=>{if(i)try{await fetch(`/api/logs/${i}`,{method:"DELETE"})}catch(o){console.error("[useInteractiveMode] Failed to clear log file:",o)}L(),k.submit({action:"start",analysisId:s,scenarioId:r},{method:"post",action:"/api/interactive-mode"})})())},[g,r,s,L,i]),e.useEffect(()=>{const t=s,o=()=>{if(d.current&&t){const v=new URLSearchParams({action:"stop",analysisId:t});console.log("[useInteractiveMode] Sending stop request via sendBeacon");const T=navigator.sendBeacon("/api/interactive-mode",v);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:v,keepalive:!0}).catch(D=>console.error("Failed to stop interactive mode:",D)))}},p=()=>{o()};return window.addEventListener("beforeunload",p),()=>{window.removeEventListener("beforeunload",p),console.log("[useInteractiveMode] Cleanup running:",{hasStarted:d.current,analysisId:t}),o()}},[s]),{interactiveServerUrl:S,isStarting:A,isLoading:B,showIframe:q,iframeKey:z,onIframeLoad:j}}function Z(){return h.jsxs("div",{className:"spinner-container",children:[h.jsx("span",{className:"loader"}),h.jsx("style",{children:`
|
|
2
|
+
.loader {
|
|
3
|
+
width: 48px;
|
|
4
|
+
height: 48px;
|
|
5
|
+
border: 3px solid rgba(0, 92, 117, 0.2);
|
|
6
|
+
border-radius: 50%;
|
|
7
|
+
display: inline-block;
|
|
8
|
+
position: relative;
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
animation: rotation 1s linear infinite;
|
|
11
|
+
}
|
|
12
|
+
.loader::after {
|
|
13
|
+
content: '';
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
position: absolute;
|
|
16
|
+
left: 50%;
|
|
17
|
+
top: 50%;
|
|
18
|
+
transform: translate(-50%, -50%);
|
|
19
|
+
width: 56px;
|
|
20
|
+
height: 56px;
|
|
21
|
+
border-radius: 50%;
|
|
22
|
+
border: 3px solid;
|
|
23
|
+
border-color: #005c75 transparent;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@keyframes rotation {
|
|
27
|
+
0% {
|
|
28
|
+
transform: rotate(0deg);
|
|
29
|
+
}
|
|
30
|
+
100% {
|
|
31
|
+
transform: rotate(360deg);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
`})]})}const C=["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"],N=80;function $(){const[s,r]=e.useState(0);return e.useEffect(()=>{const a=setInterval(()=>{r(i=>(i+1)%C.length)},N);return()=>clearInterval(a)},[]),h.jsx("span",{className:"inline-block mr-2",children:C[s]})}export{$ as I,Z as S,V as u};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-lzqtyFU8.js","assets/chunk-EPOLDU6W-CXRTFQ3F.js","assets/index-B1h680n5.js","assets/styles-CMKNK2uU.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as t,j as e}from"./chunk-EPOLDU6W-CXRTFQ3F.js";import{_ as L}from"./preload-helper-ckwbz45p.js";import{u as Q}from"./useLastLogLine-aSv48UbS.js";import{S as P,I as B}from"./InlineSpinner-C8lyxW9k.js";const $=t.createContext({dimensions:{height:720,width:1200},updateDimensions:()=>{},iframeRef:{current:null},scale:1,updateScale:()=>{},maxWidth:1200,updateMaxWidth:()=>{}}),U=()=>{const o=t.useContext($);if(!o)throw new Error("useWebContainer must be used within a WebContainerProvider");return o},oe=({children:o})=>{const[i,r]=t.useState({height:720,width:1200}),[d,f]=t.useState(1),[u,g]=t.useState(1200),x=t.useRef(null),h=t.useCallback(({height:l,width:j})=>{r(S=>({height:l??S.height,width:j??S.width}))},[]),v=t.useCallback(l=>{f(l)},[]),w=t.useCallback(l=>{g(l)},[]);return e.jsx($.Provider,{value:{dimensions:i,updateDimensions:h,iframeRef:x,scale:d,updateScale:v,maxWidth:u,updateMaxWidth:w},children:o})},X=typeof window<"u";function Z(){const[o,i]=t.useState(null);return t.useEffect(()=>{L(()=>import("./index-lzqtyFU8.js").then(r=>r.i),__vite__mapDeps([0,1,2])).then(r=>{i(()=>r.ResizableBox)}),L(()=>Promise.resolve({}),__vite__mapDeps([3]))},[]),o}const ee=1200,te=720,H=30,se=({id:o,scenarioName:i,iframeUrl:r,defaultWidth:d=1440,defaultHeight:f=900,onDataOverride:u,onIframeLoad:g,onScaleChange:x,onDimensionChange:h})=>{const v=Z(),[w,l]=t.useState(!1),[j,S]=t.useState(!1),[c,A]=t.useState(ee),[_,D]=t.useState(te),[E,T]=t.useState(null),[M,I]=t.useState(null),{dimensions:a,updateDimensions:y,iframeRef:m,updateScale:N,updateMaxWidth:R}=U(),k=t.useMemo(()=>Math.min(1,c/a.width),[c,a.width]),p=M!==null?M:k;t.useEffect(()=>{w||(N(p),x==null||x(p))},[p,N,x,w]),t.useEffect(()=>{R(c)},[c,R]);const G=t.useCallback(()=>{l(!0),I(k)},[k]),O=t.useCallback(()=>{l(!1),I(null)},[]),V=t.useCallback((n,s)=>{const b=M!==null?M:1,z=Math.round(s.size.width/b);y({width:z}),h==null||h(z,a.height)},[y,M,h,a.height]),F=t.useCallback(()=>{setTimeout(()=>{S(!0)},100),g&&g()},[g]);t.useEffect(()=>{const n=s=>{if(s.data.type==="codeyam-resize"){if(i&&s.data.name!==i||a.height===s.data.height||s.data.height===0)return;y({height:s.data.height})}};return window.addEventListener("message",n),()=>{window.removeEventListener("message",n)}},[m,i,d,a,y]),t.useEffect(()=>{j&&u&&u(m.current)},[j,u,m]),t.useEffect(()=>{if(!i)return;const n=setInterval(()=>{var s,b;(b=(s=m==null?void 0:m.current)==null?void 0:s.contentWindow)==null||b.postMessage({type:"codeyam-respond",name:i},"*")},1e3);return()=>clearInterval(n)},[i,m]),t.useEffect(()=>{const n=()=>{const s=document.getElementById("scenario-container");if(!s)return;const b=s.getBoundingClientRect(),z=s.clientWidth-H*2,q=window.innerHeight-b.top-H*2,J=Math.max(q,400),K=window.innerHeight-b.top;A(z),D(J),T(K)};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),t.useEffect(()=>{y({width:d,height:f})},[d,f,y]);const C=t.useMemo(()=>a.width*p,[a.width,p]),W=t.useMemo(()=>{const n=a.height,s=n*p;return n&&n!==720&&n!==900&&s<_?s:_},[a.height,_,p]),Y=t.useCallback(()=>{window.history.back()},[]);return!X||!v?e.jsx("div",{className:"relative bg-gray-100 w-full h-full flex items-center justify-center",children:e.jsx("p",{className:"text-gray-500",children:"Loading interactive view..."})}):e.jsxs("div",{id:"scenario-container",className:"relative bg-gray-100 w-full flex items-center justify-center",style:E?{height:`${E}px`}:{},children:[w&&e.jsx("div",{className:"fixed inset-0 z-50 bg-transparent"}),e.jsx("style",{children:`
|
|
3
|
+
.react-resizable-handle-e {
|
|
4
|
+
display: flex !important;
|
|
5
|
+
align-items: center !important;
|
|
6
|
+
justify-content: center !important;
|
|
7
|
+
width: 6px !important;
|
|
8
|
+
height: 48px !important;
|
|
9
|
+
right: -8px !important;
|
|
10
|
+
top: 50% !important;
|
|
11
|
+
transform: translateY(-50%) !important;
|
|
12
|
+
cursor: ew-resize !important;
|
|
13
|
+
background: #d1d5db !important;
|
|
14
|
+
border-radius: 3px !important;
|
|
15
|
+
opacity: 0 !important;
|
|
16
|
+
transition: all 0.2s ease !important;
|
|
17
|
+
}
|
|
18
|
+
.react-resizable-handle-e:hover {
|
|
19
|
+
opacity: 0.8 !important;
|
|
20
|
+
background: #9ca3af !important;
|
|
21
|
+
}
|
|
22
|
+
.react-resizable:hover .react-resizable-handle-e {
|
|
23
|
+
opacity: 0.4 !important;
|
|
24
|
+
}
|
|
25
|
+
`}),e.jsx(v,{width:C,height:W,minConstraints:[300,200],maxConstraints:[c,_],className:"relative bg-white rounded-lg shadow-md",resizeHandles:["e"],onResizeStart:G,onResizeStop:O,onResize:V,children:e.jsx("div",{className:"overflow-auto",style:{width:`${C}px`,height:`${W}px`},children:e.jsx("div",{style:{width:`${a.width}px`,height:`${a.height}px`,transform:`scale(${p})`,transformOrigin:"top left"},children:r?e.jsx("iframe",{ref:m,className:"w-full h-full rounded-lg",src:r,onLoad:F,sandbox:"allow-scripts allow-same-origin"}):e.jsxs("p",{className:"w-full h-full flex flex-col gap-3 items-center justify-center",children:[e.jsx("span",{className:"text-xl font-light",children:"Oops! Looks like this scenario is not available yet. Please check back later."}),e.jsx("span",{className:"text-blue-600 cursor-pointer",onClick:Y,children:"Go back"})]})})})},`resizable-box-${o}`)]})};function le({scenarioId:o,scenarioName:i,iframeUrl:r,isStarting:d,isLoading:f,showIframe:u,iframeKey:g,onIframeLoad:x,onScaleChange:h,onDimensionChange:v,projectSlug:w,defaultWidth:l=1440,defaultHeight:j=900,retryCount:S=0}){const{lastLine:c}=Q(w??null,d||f);return r?e.jsxs("div",{className:"flex-1 min-h-0 relative",style:{background:"transparent"},children:[e.jsx("div",{style:{opacity:u?1:0,background:"transparent"},children:e.jsx(se,{id:o,scenarioName:i,iframeUrl:r,defaultWidth:l,defaultHeight:j,onIframeLoad:x,onScaleChange:h,onDimensionChange:v},g)}),!u&&(d||f)&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10",children:e.jsxs("div",{className:"flex flex-col items-center justify-center gap-6 bg-white rounded-lg p-8 shadow-sm w-[500px] h-[300px]",children:[e.jsx("div",{className:"mb-4",children:e.jsx(P,{})}),e.jsxs("div",{className:"flex flex-col gap-3 text-center",children:[e.jsx("h2",{className:"text-xl font-medium text-black leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Starting Interactive Mode"}),e.jsx("p",{className:"text-sm text-[#666] leading-5 m-0 font-['IBM_Plex_Sans']",children:"Setting up a sandboxed environment for your component"}),c&&e.jsxs("p",{className:"text-xs font-mono text-[#005c75] text-center leading-5 m-0 mt-3 font-['IBM_Plex_Mono'] uppercase",children:[e.jsx(B,{}),c]})]})]})})]}):e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-12 text-center",children:e.jsxs("div",{className:"flex flex-col items-center justify-center gap-6 w-[500px] h-[300px] bg-white rounded-lg p-8 shadow-sm",children:[e.jsx("div",{className:"mb-4",children:e.jsx(P,{})}),e.jsxs("div",{className:"flex flex-col gap-3 text-center",children:[e.jsx("h2",{className:"text-xl font-medium text-black leading-[28px] m-0 font-['IBM_Plex_Sans']",children:"Starting Interactive Mode"}),e.jsx("p",{className:"text-sm text-[#666] leading-5 m-0 font-['IBM_Plex_Sans']",children:"Setting up a sandboxed environment for your component"}),c&&e.jsxs("p",{className:"text-xs font-mono text-[#005c75] text-center leading-5 m-0 mt-3 font-['IBM_Plex_Mono'] uppercase",children:[e.jsx(B,{}),c]})]})]})})}export{le as I,oe as W,U as u};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{j as r,L as C}from"./chunk-EPOLDU6W-CXRTFQ3F.js";import{g as L}from"./scenarioStatus-B_8jpV3e.js";function M({scenario:s,entitySha:m,size:g="medium",showBorder:j=!0,isOutdated:E=!1}){var x,h,u,p,$,f;const t=L(s,void 0,void 0,m,void 0),e=(x=s.metadata)==null?void 0:x.executionResult,o=!!e,b=(((u=(h=s.metadata)==null?void 0:h.data)==null?void 0:u.argumentsData)||[]).length,c=(e==null?void 0:e.returnValue)!==void 0&&(e==null?void 0:e.returnValue)!==null,i=(($=(p=e==null?void 0:e.sideEffects)==null?void 0:p.consoleOutput)==null?void 0:$.length)||0,d=((f=e==null?void 0:e.timing)==null?void 0:f.duration)||0;let a=0;b>0&&a++,b>2&&a++,c&&a++,i>0&&a++,a=Math.min(3,a);const l=g==="small"?{width:"w-[50px]",height:"h-[38px]",iconSize:"text-base",textSize:"text-[8px]"}:{width:"w-20",height:"h-15",iconSize:"text-xl",textSize:"text-[10px]"},n=t.hasError?{border:"border-red-400",bg:"bg-red-50",icon:"text-red-600",badge:"bg-red-100 text-red-700"}:o?E?{border:"border-amber-500",bg:"bg-amber-50",icon:"text-amber-700",badge:"bg-amber-100 text-amber-700"}:{border:"border-blue-400",bg:"bg-blue-50",icon:"text-blue-600",badge:"bg-blue-100 text-blue-700"}:{border:"border-gray-300 border-dashed",bg:"bg-gray-50",icon:"text-gray-400",badge:"bg-gray-100 text-gray-600"},w=j?`border-2 ${n.border}`:"",S=Array.from({length:3},(v,y)=>r.jsx("div",{className:`w-1 h-1 rounded-full ${y<a?n.icon.replace("text-","bg-"):"bg-gray-300"}`},y)),N=t.hasError?`Error: ${t.errorMessage||"Unknown error"}`:o?`${s.name}
|
|
2
|
+
${b} args → ${c?"value":"void"}${i>0?` (${i} logs)`:""}
|
|
3
|
+
${d}ms`:`Not executed: ${s.name}`;return r.jsxs(C,{to:`/entity/${m}/scenarios/${s.id}`,className:`relative ${l.width} ${l.height} ${w} rounded ${n.bg} flex flex-col items-center justify-center gap-0.5 cursor-pointer transition-all hover:scale-105 hover:shadow-md`,title:N,onClick:v=>v.stopPropagation(),children:[r.jsx("div",{className:`${n.icon} ${l.iconSize} font-mono font-bold`,children:t.hasError?"⚠":o?"ƒ":"○"}),o&&!t.hasError&&r.jsxs("div",{className:`flex items-center gap-0.5 ${l.textSize} ${n.badge} px-1 rounded`,children:[r.jsx("span",{children:b}),r.jsx("span",{children:"→"}),r.jsx("span",{children:c?"✓":"∅"})]}),o&&!t.hasError&&g==="medium"&&r.jsx("div",{className:"flex gap-0.5 mt-0.5",children:S}),o&&!t.hasError&&d>100&&g==="medium"&&r.jsx("div",{className:`absolute top-0.5 right-0.5 ${l.textSize} ${n.badge} px-1 rounded`,children:d>1e3?`${Math.round(d/1e3)}s`:`${d}ms`}),o&&!t.hasError&&i>0&&g==="medium"&&r.jsxs("div",{className:"absolute bottom-0.5 left-0.5 text-[8px] text-gray-500",children:["📝",i]})]})}export{M as L};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{j as i}from"./chunk-EPOLDU6W-CXRTFQ3F.js";let s=!1;function r(){if(s)return;const e=document.createElement("style");e.textContent=`
|
|
2
|
+
@keyframes strongPulse {
|
|
3
|
+
0%, 100% { opacity: 0.2; }
|
|
4
|
+
50% { opacity: 1; }
|
|
5
|
+
}
|
|
6
|
+
`,document.head.appendChild(e),s=!0}function c({size:e="medium",className:o=""}){typeof document<"u"&&r();const a={small:{sideDotSize:3,centerDotSize:4,gap:2},medium:{sideDotSize:4,centerDotSize:6,gap:2},large:{sideDotSize:6,centerDotSize:8,gap:3}},{sideDotSize:t,centerDotSize:n,gap:l}=a[e];return i.jsxs("div",{className:`flex items-center justify-center ${o}`,style:{gap:`${l}px`},role:"status","aria-label":"Loading",children:[i.jsx("div",{className:"rounded-full",style:{width:`${t}px`,height:`${t}px`,backgroundColor:"#005c75",animation:"strongPulse 1.5s ease-in-out infinite",animationDelay:"0s"}}),i.jsx("div",{className:"rounded-full",style:{width:`${n}px`,height:`${n}px`,backgroundColor:"#005c75",animation:"strongPulse 1.5s ease-in-out infinite",animationDelay:"0.3s"}}),i.jsx("div",{className:"rounded-full",style:{width:`${t}px`,height:`${t}px`,backgroundColor:"#005c75",animation:"strongPulse 1.5s ease-in-out infinite",animationDelay:"0.6s"}})]})}export{c as L};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{r,j as e}from"./chunk-EPOLDU6W-CXRTFQ3F.js";function w({projectSlug:x,onClose:l}){const[m,o]=r.useState("Loading logs..."),[u,g]=r.useState(!0),[d,f]=r.useState(!0),[n,b]=r.useState("all"),a=r.useRef(null);return r.useEffect(()=>{const t=async()=>{try{const s=await fetch(`/api/logs/${x}`);if(s.ok){const h=await s.text();if(n==="all")o(h);else{const c=h.trim().split(`
|
|
2
|
+
`).filter(i=>{if(i.length===0)return!1;const p=i.match(/^.*CodeYam Log Level (\d+):/);return!!p&&Number(p[1])<=n});o(c.map(i=>i.replace(/^.*CodeYam Log Level \d+:\s*/,"")).join(`
|
|
3
|
+
`))}d&&a.current&&setTimeout(()=>{var c;(c=a.current)==null||c.scrollTo({top:a.current.scrollHeight,behavior:"smooth"})},100)}else o(`Error: ${s.status} - ${await s.text()}`)}catch(s){o(`Error fetching logs: ${s.message}`)}};if(t().catch(()=>{}),u){const s=setInterval(()=>{t().catch(()=>{})},2e3);return()=>clearInterval(s)}},[x,u,d,n]),r.useEffect(()=>{const t=s=>{s.key==="Escape"&&l()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[l]),e.jsx("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-9999 p-5",onClick:l,children:e.jsxs("div",{className:"bg-[#1e1e1e] rounded-lg shadow-2xl flex flex-col max-w-[1200px] w-full max-h-[90vh] overflow-hidden",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"flex justify-between items-center px-5 py-4 border-b border-[#333] bg-[#252525]",children:[e.jsxs("h3",{className:"m-0 text-lg font-semibold text-white",children:["Analysis Logs - ",x]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("label",{className:"flex items-center gap-2 text-sm text-[#ccc] select-none",children:[e.jsx("span",{children:"Log Level:"}),e.jsxs("select",{value:n,onChange:t=>b(t.target.value==="all"?"all":Number(t.target.value)),className:"bg-[#333] text-white border border-[#555] rounded px-2 py-1 text-sm cursor-pointer outline-none transition-all hover:border-[#777] hover:bg-[#3a3a3a] focus:border-blue-600",children:[e.jsx("option",{value:"1",children:"1"}),e.jsx("option",{value:"2",children:"2"}),e.jsx("option",{value:"3",children:"3"}),e.jsx("option",{value:"4",children:"4"}),e.jsx("option",{value:"all",children:"All"})]})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-sm text-[#ccc] cursor-pointer select-none group",children:[e.jsx("input",{type:"checkbox",checked:u,onChange:t=>g(t.target.checked),className:"cursor-pointer"}),e.jsx("span",{className:"group-hover:text-white",children:"Auto-refresh"})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-sm text-[#ccc] cursor-pointer select-none group",children:[e.jsx("input",{type:"checkbox",checked:d,onChange:t=>f(t.target.checked),className:"cursor-pointer"}),e.jsx("span",{className:"group-hover:text-white",children:"Auto-scroll"})]}),e.jsx("button",{onClick:l,className:"bg-transparent border-none text-[#999] text-2xl cursor-pointer p-0 w-8 h-8 flex items-center justify-center rounded transition-all hover:bg-[#333] hover:text-white",title:"Close (Esc)",children:"✕"})]})]}),e.jsx("pre",{className:"flex-1 m-0 px-5 py-4 overflow-auto font-mono text-[13px] leading-relaxed text-[#d4d4d4] bg-[#1e1e1e] whitespace-pre-wrap wrap-break-word scrollbar-thin scrollbar-thumb-[#424242] scrollbar-track-[#1e1e1e] hover:scrollbar-thumb-[#4f4f4f]",ref:a,children:m})]})})}export{w as L};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import{r as t,c as T,j as e}from"./chunk-EPOLDU6W-CXRTFQ3F.js";import{c as x}from"./createLucideIcon-BdhJEx6B.js";import{C as F}from"./circle-check-BOARzkeR.js";import{T as w}from"./triangle-alert-B6LgvRJg.js";/**
|
|
2
|
+
* @license lucide-react v0.556.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const E=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],_=x("bug",E);/**
|
|
7
|
+
* @license lucide-react v0.556.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const A=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],W=x("check",A);/**
|
|
12
|
+
* @license lucide-react v0.556.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const B=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],L=x("copy",B);/**
|
|
17
|
+
* @license lucide-react v0.556.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const Y=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],S=x("settings",Y);function U(r){return r.scenarioName&&r.entityName?`${r.entityName} → "${r.scenarioName}"`:r.entityName?r.entityName:r.scenarioId?`Scenario: ${r.scenarioId.slice(0,8)}...`:r.entitySha?`Entity: ${r.entitySha.slice(0,8)}...`:"General feedback"}function q({content:r,className:h=""}){const[s,d]=t.useState(!1),i=t.useCallback(()=>{navigator.clipboard.writeText(r).then(()=>{d(!0),setTimeout(()=>d(!1),2e3)}).catch(n=>{console.error("Failed to copy:",n)})},[r]);return e.jsx("button",{onClick:i,className:`cursor-pointer flex items-center gap-1 ${h}`,disabled:s,"aria-label":s?"Copied to clipboard":"Copy to clipboard",children:s?e.jsxs(e.Fragment,{children:[e.jsx(W,{size:14}),"Copied"]}):e.jsxs(e.Fragment,{children:[e.jsx(L,{size:14}),"Copy"]})})}function G({isOpen:r,onClose:h,context:s,defaultEmail:d="",screenshotDataUrl:i}){const[n,b]=t.useState(""),[j,I]=t.useState(d),[u,f]=t.useState(!1),[c,N]=t.useState(!1),[M,v]=t.useState(null),[m,y]=t.useState(null),l=T(),o=l.state!=="idle",g=!!(s.scenarioId||s.analysisId),$=s.analysisId||s.scenarioId||"",k=()=>{const a=`/codeyam:diagnose ${$}`;return n.trim()?`${a} ${n.trim()}`:a};if(l.data&&!c&&!m){const a=l.data;a.success&&a.reportId?(N(!0),v(a.reportId)):a.error&&y(a.error)}const z=async()=>{y(null);const a=new FormData;if(a.append("issueType","other"),a.append("description",n),a.append("email",j),a.append("source",s.source),a.append("entitySha",s.entitySha||""),a.append("scenarioId",s.scenarioId||""),a.append("analysisId",s.analysisId||""),a.append("currentUrl",s.currentUrl),a.append("entityName",s.entityName||""),a.append("entityType",s.entityType||""),a.append("scenarioName",s.scenarioName||""),a.append("errorMessage",s.errorMessage||""),i)try{const R=await(await fetch(i)).blob();a.append("screenshot",R,"screenshot.jpg")}catch(C){console.error("Failed to convert screenshot:",C)}l.submit(a,{method:"post",action:"/api/generate-report",encType:"multipart/form-data"})},p=()=>{b(""),f(!1),N(!1),v(null),y(null),h()},D=a=>{a.key==="Escape"&&p()};return r?e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center p-4 z-50",onKeyDown:D,children:e.jsxs("div",{className:"bg-white rounded-lg max-w-lg w-full p-6 shadow-xl max-h-[90vh] overflow-y-auto",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[o?e.jsx("div",{className:"animate-spin",children:e.jsx(S,{size:24,style:{strokeWidth:1.5}})}):c?e.jsx(F,{size:24,style:{color:"#10B981",strokeWidth:1.5}}):e.jsx(_,{size:24,style:{color:"#005C75",strokeWidth:1.5}}),e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:c?"Report Submitted":"Report Issue"})]}),e.jsx("button",{onClick:p,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"})})})]}),c?e.jsxs("div",{children:[e.jsxs("div",{className:"mb-6 p-4 bg-green-50 rounded-lg border border-green-200",children:[e.jsx("p",{className:"text-sm text-green-800 font-medium mb-1",children:"Thank you for your feedback!"}),e.jsxs("p",{className:"text-xs text-green-700",children:["Report ID:"," ",e.jsx("code",{className:"bg-green-100 px-1 rounded",children:M})]})]}),e.jsx("p",{className:"text-sm text-gray-600 mb-6",children:"The CodeYam team will investigate and may reach out if you provided an email address."}),e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{onClick:p,className:"px-4 py-2 bg-[#005c75] text-white text-sm font-medium rounded-md hover:bg-[#004a5c] transition-colors cursor-pointer",children:"Done"})})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"mb-4 p-3 bg-gray-50 rounded-lg border border-gray-200",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-sm font-medium text-gray-900",title:`${s.source}${s.entitySha?` • Entity: ${s.entitySha}`:""}${s.scenarioId?` • Scenario: ${s.scenarioId}`:""}${s.analysisId?` • Analysis: ${s.analysisId}`:""}`,children:U(s)}),e.jsx("button",{type:"button",onClick:()=>f(!u),className:"text-xs text-gray-500 hover:text-gray-700 underline cursor-pointer",children:u?"Hide":"Details"})]}),u&&e.jsxs("div",{className:"mt-2 pt-2 border-t border-gray-200 text-xs text-gray-600 space-y-1 break-all",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400",children:"Source:"})," ",s.source]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400",children:"URL:"})," ",s.currentUrl]}),s.entitySha&&e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400",children:"Entity:"})," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:s.entitySha})]}),s.scenarioId&&e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400",children:"Scenario:"})," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:s.scenarioId})]}),s.analysisId&&e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400",children:"Analysis:"})," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:s.analysisId})]})]})]}),i&&e.jsxs("div",{className:"mb-4 p-3 bg-gray-50 rounded-lg border border-gray-200",children:[e.jsx("div",{className:"text-xs text-gray-500 mb-2",children:"Screenshot (will be included in report)"}),e.jsx("img",{src:i,alt:"Page screenshot",className:"w-full max-h-[150px] object-contain rounded border border-gray-300"})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{htmlFor:"description",className:"block text-sm font-medium text-gray-700 mb-2",children:"What happened?"}),e.jsx("textarea",{id:"description",value:n,onChange:a=>b(a.target.value),placeholder:"Optional: Describe what you expected vs what happened...",rows:3,className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75] resize-none"})]}),g&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-4 p-4 bg-purple-50 rounded-lg border border-purple-200",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("span",{className:"text-lg",children:"🔧"}),e.jsx("h3",{className:"text-sm font-semibold text-purple-900",children:"Diagnose & Fix (Recommended)"})]}),e.jsx("p",{className:"text-xs text-purple-700 mb-3",children:"Run this command in Claude Code to investigate the issue locally and potentially fix it. A detailed report will also be uploaded."}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"bg-gray-800 text-gray-50 px-3 py-2.5 pr-20 rounded-md text-xs font-mono overflow-x-auto whitespace-nowrap",children:k()}),e.jsx(q,{content:k(),className:"absolute top-1.5 right-2 px-2 py-1 bg-purple-600 text-white border-none rounded text-[11px] font-medium hover:bg-purple-700 transition-colors"})]})]}),e.jsxs("div",{className:"relative my-5",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("div",{className:"w-full border-t border-gray-300"})}),e.jsx("div",{className:"relative flex justify-center",children:e.jsx("span",{className:"bg-white px-3 text-xs text-gray-500 uppercase",children:"or"})})]})]}),e.jsxs("div",{className:g?"opacity-75":"",children:[g&&e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("span",{className:"text-lg",children:"📤"}),e.jsx("h3",{className:"text-sm font-semibold text-gray-700",children:"Quick Report"}),e.jsx("span",{className:"text-xs text-gray-500",children:"(won't investigate locally)"})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-2",children:"Your email"}),e.jsx("input",{id:"email",type:"email",value:j,onChange:a=>I(a.target.value),placeholder:"you@example.com",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75]"})]}),e.jsxs("div",{className:"mb-4 p-3 bg-amber-50 rounded-lg border border-amber-200 flex gap-2",children:[e.jsx(w,{size:16,className:"flex-shrink-0 mt-0.5",style:{color:"#D97706"}}),e.jsxs("div",{className:"text-xs text-amber-800",children:[e.jsx("p",{className:"font-medium mb-1",children:"Source code will be uploaded"}),e.jsx("p",{children:"This report includes your project source code, git history, and CodeYam logs. Only submit if you're comfortable sharing this with the CodeYam team."})]})]}),o&&e.jsx("div",{className:"mb-4 text-center",children:e.jsx("p",{className:"text-sm text-gray-600",children:l.formData?"Uploading report...":"Creating archive..."})}),m&&e.jsxs("div",{className:"mb-4 p-3 bg-red-50 rounded-lg border border-red-200 flex gap-2",children:[e.jsx(w,{size:16,className:"flex-shrink-0 mt-0.5",style:{color:"#DC2626"}}),e.jsxs("div",{className:"text-xs text-red-800",children:[e.jsx("p",{className:"font-medium mb-1",children:"Upload failed"}),e.jsx("p",{children:m})]})]}),e.jsxs("div",{className:"flex gap-3 justify-end",children:[e.jsx("button",{onClick:p,disabled:o,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 disabled:opacity-50 cursor-pointer",children:"Cancel"}),e.jsx("button",{onClick:()=>void z(),disabled:o,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 disabled:bg-gray-300 disabled:cursor-not-allowed flex items-center gap-2 cursor-pointer",children:o?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"animate-spin",children:e.jsx(S,{size:16,style:{strokeWidth:1.5}})}),"Submitting..."]}):m?"Try Again":"Submit Report"})]})]})]})]})}):null}export{_ as B,W as C,G as R,S,L as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as a,j as e}from"./chunk-EPOLDU6W-CXRTFQ3F.js";function j({screenshotPath:l,cacheBuster:o,alt:x,className:f="",title:n}){const[i,s]=a.useState("loading"),[c,r]=a.useState(!1),d=a.useRef(null),u=o?`/api/screenshot/${l}?cb=${o}`:`/api/screenshot/${l}`,m=()=>{s("success"),r(!0)},h=()=>{s("error"),r(!1)};return a.useEffect(()=>{s("loading"),r(!1);const t=d.current;t!=null&&t.complete&&(t.naturalHeight!==0?(s("success"),r(!0)):(s("error"),r(!1)))},[u]),l?e.jsxs("div",{className:"relative w-full h-full flex items-center justify-center",title:n,children:[e.jsx("img",{ref:d,src:u,alt:x,onLoad:m,onError:h,className:f||"max-w-full max-h-full object-contain",style:{visibility:c?"visible":"hidden",position:c?"relative":"absolute"}}),i==="loading"&&e.jsx("div",{className:"absolute inset-0 bg-gray-100 animate-pulse rounded flex items-center justify-center",children:e.jsx("svg",{className:"w-8 h-8 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),i==="error"&&e.jsxs("div",{className:"absolute inset-0 border-2 border-dashed border-gray-300 bg-gray-50 rounded flex flex-col items-center justify-center text-xs gap-1",children:[e.jsx("span",{className:"text-2xl text-gray-400",children:"📷"}),e.jsx("span",{className:"text-gray-400 whitespace-nowrap",children:"No Screenshot"})]})]}):e.jsx("div",{className:"w-full h-full border-2 border-dashed border-gray-300 bg-gray-50 rounded flex flex-col items-center justify-center text-xs gap-1",title:n,children:e.jsx("span",{className:"text-2xl text-gray-400",children:"📷"})})}export{j as S};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{r as i,j as e,c as ge,L as ie}from"./chunk-EPOLDU6W-CXRTFQ3F.js";import{I as be}from"./InteractivePreview-aht4aafF.js";import{u as je,V as we,S as Ne}from"./useCustomSizes-C1v1PQzo.js";import{L as J}from"./LogViewer-xgeCVgSM.js";import{S as ve}from"./SafeScreenshot-DuDvi0jm.js";import{u as ke}from"./useLastLogLine-aSv48UbS.js";import{u as Ce}from"./InlineSpinner-C8lyxW9k.js";import{_ as ye}from"./preload-helper-ckwbz45p.js";import{C as Ie,a as Ee,R as Le}from"./ReportIssueModal-D4TZhLuw.js";import{g as Pe}from"./scenarioStatus-B_8jpV3e.js";function $e({presets:s,customSizes:t,currentWidth:n,currentHeight:o,scale:v,onSizeChange:N,onSaveCustomSize:w,onRemoveCustomSize:d,className:k=""}){const[h,x]=i.useState(!1),[g,b]=i.useState(String(n)),[m,j]=i.useState(String(o)),[C,u]=i.useState(!1),[l,R]=i.useState(!1),P=i.useRef(null);i.useEffect(()=>{C||b(String(n))},[n,C]),i.useEffect(()=>{l||j(String(o))},[o,l]),i.useEffect(()=>{const r=f=>{P.current&&!P.current.contains(f.target)&&x(!1)};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[]);const $=i.useMemo(()=>{const r=s.find(c=>c.width===n&&c.height===o);if(r)return r.name;const f=t.find(c=>c.width===n&&c.height===o);return f?f.name:"Custom"},[s,t,n,o]),O=$==="Custom",S=r=>{N(r.width,r.height),x(!1)},W=r=>{const f=r.target.value;b(f);const c=parseInt(f,10);!isNaN(c)&&c>0&&N(c,o)},U=r=>{const f=r.target.value;j(f);const c=parseInt(f,10);!isNaN(c)&&c>0&&N(n,c)},A=()=>{u(!1);const r=parseInt(g,10);(isNaN(r)||r<=0)&&b(String(n))},K=()=>{R(!1);const r=parseInt(m,10);(isNaN(r)||r<=0)&&j(String(o))},D=r=>{(r.key==="Enter"||r.key==="Escape")&&r.target.blur()};return e.jsxs("div",{className:`flex items-center gap-3 ${k}`,children:[e.jsxs("div",{className:"relative",ref:P,children:[e.jsxs("button",{onClick:()=>x(!h),className:"flex items-center gap-2 px-3 py-1.5 bg-white border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:ring-offset-1 min-w-[120px] justify-between",children:[e.jsx("span",{children:$}),e.jsx("svg",{className:`w-4 h-4 transition-transform ${h?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),h&&e.jsx("div",{className:"absolute top-full left-0 mt-1 min-w-full bg-white border border-gray-200 rounded-md shadow-lg z-50",children:e.jsxs("div",{className:"py-1",children:[s.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-3 py-1 text-xs font-semibold text-gray-500 uppercase tracking-wider whitespace-nowrap",children:"Presets"}),s.map(r=>e.jsxs("button",{onClick:()=>S(r),className:`w-full text-left px-3 py-2 text-sm hover:bg-gray-100 flex justify-between items-center gap-4 whitespace-nowrap ${$===r.name?"bg-[#f0f7f9] text-[#005c75]":"text-gray-700"}`,children:[e.jsx("span",{children:r.name}),e.jsxs("span",{className:"text-xs text-gray-500",children:[r.width," x ",r.height]})]},r.name))]}),t.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t border-gray-100 my-1"}),e.jsx("div",{className:"px-3 py-1 text-xs font-semibold text-gray-500 uppercase tracking-wider whitespace-nowrap",children:"Custom"}),[...t].sort((r,f)=>r.width-f.width).map(r=>e.jsxs("div",{className:`flex items-center gap-1 hover:bg-gray-100 ${$===r.name?"bg-[#f0f7f9] text-[#005c75]":"text-gray-700"}`,children:[e.jsxs("button",{onClick:()=>S(r),className:"flex-1 text-left px-3 py-2 text-sm flex justify-between items-center gap-4 whitespace-nowrap cursor-pointer",children:[e.jsx("span",{children:r.name}),e.jsxs("span",{className:"text-xs text-gray-500",children:[r.width," x ",r.height]})]}),d&&e.jsx("button",{onClick:f=>{f.stopPropagation(),$===r.name&&s.length>0&&N(s[0].width,s[0].height),d(r.name)},className:"p-1.5 mr-1 text-gray-400 hover:text-red-500 hover:bg-red-50 rounded cursor-pointer transition-colors",title:"Remove custom size",children:e.jsx("svg",{className:"w-4 h-4",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"})})})]},r.name))]})]})})]}),e.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("input",{type:"text",value:g,onChange:W,onFocus:()=>u(!0),onBlur:A,onKeyDown:D,className:"w-16 px-2 py-1 text-right border border-gray-300 rounded-l-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75]"}),e.jsx("span",{className:"px-2 py-1 bg-gray-100 border border-l-0 border-gray-300 rounded-r-md text-gray-500 text-sm",children:"px"})]}),e.jsx("span",{className:"text-gray-400 mx-1",children:"×"}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("input",{type:"text",value:m,onChange:U,onFocus:()=>R(!0),onBlur:K,onKeyDown:D,className:"w-16 px-2 py-1 text-right border border-gray-300 rounded-l-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75]"}),e.jsx("span",{className:"px-2 py-1 bg-gray-100 border border-l-0 border-gray-300 rounded-r-md text-gray-500 text-sm",children:"px"})]}),v!==void 0&&v<1&&e.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",Math.round(v*100),"%)"]})]}),O&&e.jsx("button",{onClick:w,className:"px-3 py-1.5 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",children:"Save Custom Size"})]})}function de({size:s=24,className:t=""}){return e.jsxs("svg",{width:s,height:s,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:[e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z",fill:"#ef4444",stroke:"none"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13",stroke:"#FFFFFF",strokeWidth:"2",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"17",r:"1",fill:"#FFFFFF"})]})}function _e({scenario:s,analysis:t,entity:n}){var w,d,k;const o=((w=s.metadata)==null?void 0:w.executionResult)||null,v=((k=(d=s.metadata)==null?void 0:d.data)==null?void 0:k.argumentsData)||[],N=h=>{var j,C,u;if(!h)return"No execution results available yet. Run the function to capture side effects including console output, file operations, and API calls.";const x=[],g=((j=h.sideEffects)==null?void 0:j.consoleOutput)||[];g.length>0&&(x.push(`Console Output: ${g.length} log ${g.length===1?"entry":"entries"} captured`),g.forEach(l=>{x.push(` [${l.level.toUpperCase()}] ${l.args.join(" ")}`)}));const b=((C=h.sideEffects)==null?void 0:C.fileWrites)||[];b.length>0&&(x.push(`
|
|
2
|
+
File System Operations: ${b.length} ${b.length===1?"operation":"operations"} detected`),b.forEach(l=>{x.push(` ${l.operation}: ${l.path}${l.size?` (${l.size} bytes)`:""}`)}));const m=((u=h.sideEffects)==null?void 0:u.apiCalls)||[];return m.length>0&&(x.push(`
|
|
3
|
+
API Calls: ${m.length} ${m.length===1?"call":"calls"} made`),m.forEach(l=>{x.push(` ${l.method} ${l.url}${l.status?` → ${l.status}`:""}${l.duration?` (${l.duration}ms)`:""}`)})),h.error&&x.push(`
|
|
4
|
+
Error: ${h.error.name||"Error"}: ${h.error.message}`),x.length===0?"No side effects detected. The function executed without console output, file operations, or API calls.":x.join(`
|
|
5
|
+
`)};return e.jsxs("div",{className:"flex w-full h-full gap-0",children:[e.jsxs("div",{className:"flex-1 border border-gray-200 bg-white rounded flex flex-col",children:[e.jsx("div",{className:"px-4 pt-3.5 pb-2.5",children:e.jsx("h3",{className:"text-[9px] font-semibold text-[#005c75] uppercase tracking-wide text-center m-0",children:"Input Data"})}),e.jsx("div",{className:"flex-1 overflow-auto px-4 pb-0",children:e.jsx("pre",{className:"text-xs font-mono text-gray-800 whitespace-pre-wrap break-words m-0",children:JSON.stringify(v,null,2)})})]}),e.jsxs("div",{className:"flex-1 border border-gray-200 bg-white rounded flex flex-col ml-[-1px]",children:[e.jsx("div",{className:"px-4 pt-3.5 pb-2.5",children:e.jsx("h3",{className:"text-[9px] font-semibold text-[#005c75] uppercase tracking-wide text-center m-0",children:"Returned Data"})}),e.jsx("div",{className:"flex-1 overflow-auto px-4 pb-0",children:o?e.jsx("pre",{className:"text-xs font-mono text-gray-800 whitespace-pre-wrap break-words m-0",children:o.returnValue!==void 0?JSON.stringify(o.returnValue,null,2):"undefined"}):e.jsx("div",{className:"text-sm text-gray-500 italic",children:"No execution results yet"})})]}),e.jsxs("div",{className:"flex-1 border border-gray-200 bg-white rounded flex flex-col ml-[-1px]",children:[e.jsx("div",{className:"px-4 pt-3.5 pb-2.5",children:e.jsx("h3",{className:"text-[9px] font-semibold text-[#005c75] uppercase tracking-wide text-center m-0",children:"Side Effects"})}),e.jsx("div",{className:"flex-1 overflow-auto px-4 pb-4",children:e.jsx("p",{className:"text-sm text-gray-700 leading-[22px] m-0 whitespace-pre-wrap",children:N(o)})})]})]})}const F={commandBoxBg:"#f6f9fc",commandBoxBorder:"#e1e1e1",commandBoxText:"#005c75",heading:"#000",subtext:"#646464",link:"#005c75"};function T({scenarioId:s,analysisId:t}){const[n,o]=i.useState(!1),[v,N]=i.useState(!1),[w,d]=i.useState(null),[k,h]=i.useState(!1),x=s||t;if(!x)return null;const g=`/codeyam:diagnose ${x}`,b=async()=>{N(!0);try{const{default:j}=await ye(async()=>{const{default:l}=await import("./html2canvas-pro.esm-fmIEn3Bc.js");return{default:l}},[]),u=(await j(document.body,{scale:.5})).toDataURL("image/jpeg",.8);d(u),o(!0)}catch(j){console.error("Screenshot capture failed:",j),o(!0)}finally{N(!1)}},m=()=>{o(!1),d(null)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-center p-6 bg-cywhite-100 rounded-lg border-cygray-30 border",children:[e.jsx("h3",{className:"font-semibold font-['IBM_Plex_Sans']",style:{fontSize:"18px",lineHeight:"26px",color:F.heading},children:"Claude can help debug this error."}),e.jsx("p",{className:"m-0 mb-4 font-['IBM_Plex_Sans']",style:{fontSize:"14px",lineHeight:"18px",color:F.subtext},children:"Simply run this command in Claude Code:"}),e.jsxs("div",{className:"flex items-center justify-between rounded mx-auto mb-3 border",style:{backgroundColor:F.commandBoxBg,borderColor:F.commandBoxBorder,maxWidth:"505px",height:"35px",paddingLeft:"13px",paddingRight:"13px",paddingTop:"6px",paddingBottom:"6px"},children:[e.jsx("code",{className:"font-mono font-['IBM_Plex_Mono'] flex-1 text-left",style:{fontSize:"12px",lineHeight:"20px",color:F.commandBoxText},children:g}),e.jsx("button",{onClick:j=>{j.stopPropagation(),navigator.clipboard.writeText(g),h(!0),setTimeout(()=>h(!1),2e3)},className:"ml-3 cursor-pointer p-0 bg-transparent border-none hover:opacity-80 transition-opacity",style:{width:"14px",height:"14px",color:k?"#22c55e":F.commandBoxText},title:k?"Copied!":"Copy command","aria-label":"Copy command to clipboard",children:k?e.jsx(Ie,{size:14}):e.jsx(Ee,{size:14})})]}),e.jsxs("p",{className:"m-0 font-['IBM_Plex_Sans']",style:{fontSize:"12px",lineHeight:"15px",color:"#005c75"},children:["If Claude is unable to address this issue or suggests reporting it,"," ",e.jsx("button",{onClick:()=>void b(),disabled:v,className:"underline cursor-pointer bg-transparent border-none p-0 font-normal hover:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed font-['IBM_Plex_Sans']",style:{fontSize:"12px",lineHeight:"15px",color:F.link},children:v?"capturing...":"please do so here"}),"."]})]}),e.jsx(Le,{isOpen:n,onClose:m,context:{source:s?"scenario-page":"entity-page",entitySha:void 0,scenarioId:s,analysisId:t,currentUrl:typeof window<"u"?window.location.pathname:"/"},screenshotDataUrl:w??void 0})]})}const ce=1440,H=[{name:"Mobile",width:375,height:667},{name:"Tablet",width:768,height:1024},{name:"Laptop",width:1024,height:768},{name:"Desktop",width:1440,height:900}],E={background:"#ffdcd9",border:"#fda4a4",text:"#ef4444",link:"#991b1b"};function He({selectedScenario:s,analysis:t,entity:n,viewMode:o,cacheBuster:v,hasScenarios:N,isAnalyzing:w=!1,projectSlug:d,hasAnApiKey:k=!0,processIsRunning:h,queueState:x}){var Q,X,Z,ee,te,se,re,ne,oe,ae,le;const g=ge(),[b,m]=i.useState(!1),[j,C]=i.useState(!1),[u,l]=i.useState({name:"Desktop",width:ce,height:900}),[R,P]=i.useState(ce),[$,O]=i.useState(1),{customSizes:S,addCustomSize:W,removeCustomSize:U}=je(d),A=i.useMemo(()=>[...H,...S],[S]),K=(a,I)=>{P(a);const y=A.find(p=>p.width===a&&p.height===I);l({name:(y==null?void 0:y.name)||"Custom",width:a,height:I})},D=a=>{P(a.width),l({name:a.name,width:a.width,height:a.height})},r=a=>{W(a,u.width,u.height??900),C(!1),l(I=>({...I,name:a}))},f=(a,I)=>{P(a);const y=A.find(p=>p.width===a&&p.height===I);l(p=>({name:(y==null?void 0:y.name)||"Custom",width:a,height:p.height}))},c=(X=(Q=s==null?void 0:s.metadata)==null?void 0:Q.screenshotPaths)==null?void 0:X[0],M=i.useMemo(()=>s?Pe(s,t==null?void 0:t.status,h,n==null?void 0:n.sha,x):null,[s,t==null?void 0:t.status,h,n==null?void 0:n.sha,x]),L=i.useMemo(()=>{var I,y;const a=[];if((I=t==null?void 0:t.status)!=null&&I.errors&&t.status.errors.length>0)for(const p of t.status.errors)a.push({source:`${p.phase} phase`,message:p.message,stack:p.stack});if((y=t==null?void 0:t.status)!=null&&y.steps)for(const p of t.status.steps)p.error&&a.push({source:p.name,message:p.error,stack:p.errorStack});return a},[(Z=t==null?void 0:t.status)==null?void 0:Z.errors,(ee=t==null?void 0:t.status)==null?void 0:ee.steps]),_=(M==null?void 0:M.errorMessage)||null,Y=(M==null?void 0:M.errorStack)||null,{interactiveServerUrl:q,isStarting:G,isLoading:xe,showIframe:me,iframeKey:he,onIframeLoad:ue}=Ce({analysisId:t==null?void 0:t.id,scenarioId:s==null?void 0:s.id,scenarioName:s==null?void 0:s.name,projectSlug:d,enabled:o==="interactive"}),V=i.useMemo(()=>q||null,[q]),z=!w&&N&&s&&!((se=(te=s.metadata)==null?void 0:te.screenshotPaths)!=null&&se[0])&&((ne=(re=t==null?void 0:t.status)==null?void 0:re.scenarios)==null?void 0:ne.some(a=>a.name===s.name&&a.screenshotStartedAt&&!a.screenshotFinishedAt)),{lastLine:B}=ke(d,w||o==="interactive"||z||!1);if(!s){if(w&&n)return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-12 text-center bg-[#f6f9fc]",children:e.jsxs("div",{className:"flex flex-col items-center gap-6 max-w-2xl",children:[e.jsx("div",{className:"w-12 h-12 mb-2",children:e.jsx("svg",{className:"animate-spin",viewBox:"0 0 50 50",children:e.jsx("circle",{cx:"25",cy:"25",r:"20",fill:"none",stroke:"#005c75",strokeWidth:"4",strokeDasharray:"31.4 31.4",strokeLinecap:"round"})})}),e.jsx("h2",{className:"text-2xl font-semibold text-[#005c75] leading-[30px] m-0 font-['IBM_Plex_Sans']",children:z?"Capturing screenshots...":"Analyzing..."}),e.jsx("p",{className:"text-xs text-[#8e8e8e] text-center leading-5 m-0 font-['IBM_Plex_Mono']",children:"This may take a few minutes."}),B&&e.jsx("p",{className:"text-xs font-mono text-[#005c75] text-center leading-5 m-0 max-w-xl",children:B}),d&&e.jsx("button",{onClick:()=>m(!0),className:"w-[148px] px-2.5 py-[5px] bg-[#005c75] text-white border-none rounded-sm text-xs font-medium cursor-pointer transition-colors hover:bg-[#004a5c] font-['IBM_Plex_Sans']",children:"View full logs"})]})}),b&&d&&e.jsx(J,{projectSlug:d,onClose:()=>m(!1)})]});if(!N&&n&&!w){if(L.length>0){const a=L.length===1?((oe=L[0])==null?void 0:oe.message)||"An error occurred during analysis.":`${L.length} errors occurred during analysis.`;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex-1 flex flex-col justify-center items-center px-5",style:{minHeight:"75vh"},children:e.jsxs("div",{className:"w-full flex flex-col gap-4",style:{maxWidth:"600px"},children:[e.jsx("div",{className:"p-4 rounded",style:{backgroundColor:E.background,border:`2px solid ${E.border}`},role:"alert",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(de,{size:24,className:"shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("p",{className:"m-0 font-['IBM_Plex_Sans']",style:{fontSize:"14px",lineHeight:"20px",color:E.text},children:[e.jsx("span",{className:"font-semibold",children:"Analysis Error."})," ",a," ",e.jsx("button",{onClick:()=>m(!0),className:"underline cursor-pointer bg-transparent border-none p-0 font-medium hover:opacity-80",style:{color:E.link},children:"See logs"})," ","for details."]})})]})}),e.jsx("div",{className:"bg-white border rounded-lg",style:{borderColor:"#e1e1e1"},children:e.jsx(T,{analysisId:t==null?void 0:t.id})})]})}),b&&d&&e.jsx(J,{projectSlug:d,onClose:()=>m(!1)})]})}return e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center bg-[#f6f9fc]",children:e.jsxs("div",{className:"max-w-[600px]",children:[e.jsx("h2",{className:"text-[28px] font-semibold text-[#343434] mb-4 m-0 leading-10",children:"No simulations yet"}),e.jsx("p",{className:"text-base font-normal text-[#3e3e3e] mb-8 leading-6 m-0",children:"Analyze the code to create simulations and create test scenarios automatically."}),n.filePath&&e.jsx("button",{onClick:()=>{g.submit({entitySha:n.sha,filePath:n.filePath},{method:"post",action:"/api/analyze"})},disabled:g.state!=="idle",className:"h-[54px] w-[183px] px-2.5 py-[5px] bg-[#005c75] text-white border-none rounded-lg text-base font-medium cursor-pointer transition-all hover:bg-[#004a5e] disabled:bg-gray-400 disabled:cursor-not-allowed",children:g.state!=="idle"?"Analyzing...":"Analyze"})]})})}return e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center",children:e.jsx("p",{className:"text-base text-gray-500 m-0",children:"Select a scenario to view its screenshot"})})}const fe=o==="screenshot"&&(c||_)||o==="interactive"&&(V||G)||o==="data",pe=(w||z&&!c)&&!_&&o==="screenshot";return e.jsxs(e.Fragment,{children:[e.jsx("main",{className:"flex-1 overflow-auto flex flex-col min-w-0",style:{backgroundImage:`
|
|
6
|
+
linear-gradient(45deg, #ebebeb 25%, transparent 25%),
|
|
7
|
+
linear-gradient(-45deg, #ebebeb 25%, transparent 25%),
|
|
8
|
+
linear-gradient(45deg, transparent 75%, #ebebeb 75%),
|
|
9
|
+
linear-gradient(-45deg, transparent 75%, #ebebeb 75%)
|
|
10
|
+
`,backgroundSize:"16px 16px",backgroundPosition:"0 0, 0 8px, 8px -8px, -8px 0px",backgroundColor:"#fafafa"},children:pe?e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center bg-linear-to-br from-blue-50 to-indigo-50",children:e.jsxs("div",{className:"max-w-2xl w-full bg-white rounded-t-2xl shadow-xl p-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-24 h-24 bg-blue-100 rounded-full mb-6",children:e.jsx("span",{className:"text-5xl animate-spin",children:"⚙️"})}),e.jsx("h2",{className:"text-3xl font-bold text-gray-900 mb-4 m-0",children:z?`Capturing ${n==null?void 0:n.name}`:`Analyzing ${n==null?void 0:n.name}`}),e.jsx("p",{className:"text-base text-gray-600 leading-relaxed m-0 mb-2",children:z?`Taking screenshots for ${((ae=t==null?void 0:t.scenarios)==null?void 0:ae.length)||0} scenario${((le=t==null?void 0:t.scenarios)==null?void 0:le.length)!==1?"s":""}...`:`Generating simulations and scenarios for this ${n==null?void 0:n.entityType} entity...`}),s&&e.jsxs("p",{className:"text-sm text-blue-600 font-semibold m-0",children:["Currently processing: ",s.name]})]}),B&&e.jsx("div",{className:"bg-[#f6f9fc] border-2 border-[#e1e1e1] rounded-lg p-6 mb-6",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("span",{className:"text-xl shrink-0",children:"📝"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-xs font-semibold text-gray-700 uppercase tracking-wide mb-2 m-0",children:"Current Progress"}),e.jsx("p",{className:"text-sm text-gray-900 font-mono wrap-break-word m-0",title:B,children:B})]})]})}),d&&e.jsx("button",{onClick:()=>m(!0),className:"px-6 py-3 bg-[#005c75] text-white border-none rounded-lg text-base font-semibold cursor-pointer transition-all hover:bg-[#004a5e] hover:shadow-lg",children:"📋 View Full Logs"}),e.jsx("p",{className:"text-xs text-gray-500 mt-8 m-0",children:"Screenshots will appear here as they are captured. This may take a few minutes."})]})}):fe?e.jsxs(e.Fragment,{children:[_&&!c&&e.jsx("div",{className:"flex-1 flex flex-col justify-center items-center p-6",children:e.jsxs("div",{className:"w-full flex flex-col gap-4",style:{maxWidth:"600px"},children:[e.jsx("div",{className:"p-4 rounded overflow-auto",style:{backgroundColor:E.background,border:`2px solid ${E.border}`,maxHeight:"50vh"},role:"alert",children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2 font-bold",style:{color:E.text},children:[e.jsx(de,{size:24,className:"shrink-0"}),e.jsx("div",{children:"Capture Error"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("button",{onClick:()=>m(!0),className:"underline cursor-pointer bg-transparent border-none p-0 font-medium hover:opacity-80",style:{color:E.link},children:"See logs"})," ","for details."]}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx("div",{className:"m-0 font-['IBM_Plex_Sans']",style:{fontSize:"14px",lineHeight:"20px",color:E.text},children:_})})]})}),e.jsx("div",{className:"bg-white border rounded-lg",style:{borderColor:"#e1e1e1"},children:e.jsx(T,{scenarioId:s==null?void 0:s.id,analysisId:t==null?void 0:t.id})})]})}),o==="interactive"?e.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[V&&e.jsxs("div",{className:"bg-gray-50 border-b border-gray-200 px-6 py-3 shrink-0 flex justify-center items-center gap-4",children:[e.jsx($e,{presets:[...H],customSizes:S,currentWidth:u.width,currentHeight:u.height??900,scale:$,onSizeChange:K,onSaveCustomSize:()=>C(!0),onRemoveCustomSize:U}),s&&n&&e.jsxs(ie,{to:`/entity/${n.sha}/scenarios/${s.id}/fullscreen?from=${encodeURIComponent(`/entity/${n.sha}/scenarios/${s.id}/interactive`)}`,className:"flex items-center gap-2 px-4 py-2 bg-[#005c75] text-white rounded hover:bg-[#004a5c] transition-colors text-sm font-medium no-underline",title:"Open in fullscreen",children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M2 5V2H5M11 2H14V5M14 11V14H11M5 14H2V11",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),"Fullscreen"]})]}),V&&e.jsx("div",{className:"bg-[#005c75] border-b border-[rgba(0,0,0,0.2)] flex justify-center",children:e.jsx("div",{style:{maxWidth:`${H[H.length-1].width}px`,width:"100%"},children:e.jsx(we,{currentViewportWidth:R,currentPresetName:u.name,onDevicePresetClick:D,devicePresets:A})})}),e.jsx(be,{scenarioId:s.id,scenarioName:s.name,iframeUrl:V,isStarting:G,isLoading:xe,showIframe:me,iframeKey:he,onIframeLoad:ue,onScaleChange:O,onDimensionChange:f,projectSlug:d,defaultWidth:u.width,defaultHeight:u.height})]}):o==="data"?e.jsx("div",{className:"flex-1 min-h-0",children:e.jsx(_e,{scenario:s,analysis:t,entity:n})}):e.jsx("div",{className:"flex-1 flex flex-col",children:e.jsx("div",{className:"flex-1 p-6 flex items-center justify-center",children:e.jsx("div",{className:"transition-all duration-300",style:{maxWidth:`${R}px`},children:(c||!_)&&e.jsx(ve,{screenshotPath:c,cacheBuster:v,alt:s.name,className:"w-full rounded-lg shadow-[0_10px_25px_rgba(0,0,0,0.1)] bg-white"})})})})]}):e.jsx("div",{className:"flex-1 flex flex-col",children:e.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 overflow-auto w-full",children:w&&!c?e.jsx("div",{className:"w-full h-full flex items-center justify-center",children:e.jsx("div",{className:"bg-blue-50 border-2 border-blue-200 rounded-lg p-8",children:e.jsxs("div",{className:"flex items-start gap-4 mb-6",children:[e.jsx("span",{className:"animate-spin text-4xl shrink-0",children:"⚙️"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-xl font-semibold text-blue-900 m-0 mb-3",children:"Capturing Screenshot"}),e.jsxs("p",{className:"text-sm text-blue-800 m-0 mb-4",children:["Analysis is in progress for"," ",e.jsx("strong",{children:s.name}),". The screenshot will appear here once capture is complete."]}),B&&e.jsxs("div",{className:"bg-white border border-blue-200 rounded p-4 mt-4",children:[e.jsx("h4",{className:"text-xs font-semibold text-blue-800 m-0 mb-2 uppercase tracking-wide",children:"Current Progress"}),e.jsx("p",{className:"text-sm text-blue-900 m-0 font-mono wrap-break-word",children:B})]}),d&&e.jsx("button",{onClick:()=>m(!0),className:"mt-4 px-4 py-2 bg-[#005c75] text-white border-none rounded-md text-sm font-semibold cursor-pointer transition-colors hover:bg-[#004a5e]",children:"📋 View Full Logs"})]})]})})}):_?e.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center overflow-auto gap-6",children:[!k&&e.jsx("div",{className:"bg-blue-50 border-2 border-blue-300 rounded-lg p-8",children:e.jsxs("div",{className:"flex-1 flex flex-col gap-4 items-center justify-center",children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("span",{className:"text-blue-600 text-2xl shrink-0",children:"🔑"}),e.jsx("h3",{className:"text-xl font-semibold text-blue-900 m-0 mb-3",children:"Improve Analysis Quality with an API Key"})]}),e.jsxs("div",{className:"bg-white border border-blue-200 rounded p-4",children:[e.jsx("h4",{className:"text-xs font-semibold text-blue-900 m-0 mb-2 uppercase tracking-wide",children:"CodeYam requires an AI API key for reliable analysis."}),e.jsxs("ul",{className:"text-sm text-blue-800 m-0 space-y-1 pl-5 list-disc",children:[e.jsx("li",{children:"You can use API keys for a variety of models"}),e.jsx("li",{children:"Faster analysis processing"}),e.jsx("li",{children:"Better handling of complex code structures"}),e.jsx("li",{children:"Improved scenario generation quality"})]})]}),e.jsx(ie,{to:"/settings",className:"inline-block px-4 py-2 bg-blue-600 text-white border-none rounded-md text-sm font-semibold cursor-pointer transition-colors hover:bg-blue-700",children:"🔐 Configure API Keys"})]})}),e.jsx("div",{className:"bg-red-50 border-2 border-red-300 rounded-lg p-8 w-full max-w-4xl my-auto",children:e.jsxs("div",{className:"flex items-start gap-4 mb-6",children:[e.jsx("span",{className:"text-red-500 text-4xl shrink-0",children:"⚠️"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-xl font-semibold text-red-800 m-0 mb-3",children:"Capture Failed"}),e.jsx("p",{className:"text-sm text-red-700 m-0 mb-4",children:"An error occurred while capturing this scenario. No screenshot is available."}),e.jsxs("div",{className:"bg-white border border-red-200 rounded p-4",children:[e.jsx("h4",{className:"text-xs font-semibold text-red-800 m-0 mb-2 uppercase tracking-wide",children:"Error Message"}),e.jsx("div",{className:"max-h-[300px] overflow-auto",children:e.jsx("p",{className:"text-sm text-red-900 m-0 font-mono whitespace-pre-wrap wrap-break-word",children:_})})]}),Y&&e.jsxs("details",{className:"mt-4",children:[e.jsx("summary",{className:"text-sm text-red-700 cursor-pointer hover:text-red-900 font-semibold",children:"📋 View full stack trace"}),e.jsx("div",{className:"mt-3 bg-white border border-red-200 rounded p-4 overflow-auto",children:e.jsx("pre",{className:"text-xs text-red-900 font-mono whitespace-pre-wrap wrap-break-word m-0",children:Y})})]}),e.jsx("div",{className:"mt-4 bg-white border rounded-lg",style:{borderColor:"#e1e1e1"},children:e.jsx(T,{scenarioId:s==null?void 0:s.id,analysisId:t==null?void 0:t.id})})]})]})})]}):L.length>0?e.jsx("div",{className:"w-full h-full flex items-center justify-center overflow-auto",children:e.jsx("div",{className:"bg-red-50 border-2 border-red-300 rounded-lg p-8 w-full max-w-4xl my-auto",children:e.jsxs("div",{className:"flex items-start gap-4 mb-6",children:[e.jsx("span",{className:"text-red-500 text-4xl shrink-0",children:"⚠️"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx(AnalysisErrorDisplay,{errors:L,title:"Analysis Error",description:L.length===1?"An error occurred during analysis. Screenshot capture was not completed.":`${L.length} errors occurred during analysis. Screenshot capture was not completed.`}),e.jsx("div",{className:"mt-4 bg-white border rounded-lg",style:{borderColor:"#e1e1e1"},children:e.jsx(T,{scenarioId:s==null?void 0:s.id,analysisId:t==null?void 0:t.id})})]})]})})}):e.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[e.jsx("span",{className:"text-6xl text-gray-300",children:"📷"}),e.jsx("p",{className:"text-lg text-gray-500 m-0",children:"No screenshot available for this scenario"}),e.jsx("p",{className:"text-sm text-gray-400 m-0",children:"Try recapturing or debugging this scenario"})]})})})}),b&&d&&e.jsx(J,{projectSlug:d,onClose:()=>m(!1)}),j&&e.jsx(Ne,{width:u.width,height:u.height??900,onSave:r,onCancel:()=>C(!1)})]})}export{de as E,He as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as v}from"./chunk-
|
|
1
|
+
import{j as v}from"./chunk-EPOLDU6W-CXRTFQ3F.js";function O({filePath:n,maxLength:x=60,className:f,style:u}){const o=((t,r)=>{if(t.length<=r)return t;const a="...",c=r-a.length,i=Math.ceil(c*.4),d=Math.floor(c*.6),e=t.slice(0,i),s=t.slice(-d),h=e.lastIndexOf("/"),l=s.indexOf("/"),g=h>i*.5?e.slice(0,h+1):e,m=l!==-1&&l<d*.5?s.slice(l):s;return`${g}${a}${m}`})(n,x),p=o!==n;return v.jsx("span",{className:f||"font-normal text-gray-900 text-[14px] select-text cursor-text",style:{...u,display:"inline-block",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:p?n:void 0,children:o})}export{O as T};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{r as u,j as e,L as p,w as se,u as te,c as ae,f as re}from"./chunk-EPOLDU6W-CXRTFQ3F.js";import{u as ne}from"./useLastLogLine-aSv48UbS.js";import{u as le}from"./useToast-mBRpZPiu.js";import{u as oe}from"./useReportContext-DYxHZQuP.js";import{L as ie}from"./LogViewer-xgeCVgSM.js";import{I as E,C as P,E as ce}from"./EntityTypeIcon-Ba2JVPzP.js";import{S as Y}from"./SafeScreenshot-DuDvi0jm.js";import{g as de}from"./scenarioStatus-B_8jpV3e.js";import{c as q}from"./createLucideIcon-BdhJEx6B.js";import{C as xe}from"./circle-check-BOARzkeR.js";import{L as S}from"./loader-circle-B7B9V-bu.js";/**
|
|
2
|
+
* @license lucide-react v0.556.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const me=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],he=q("folder-open",me);/**
|
|
7
|
+
* @license lucide-react v0.556.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const ue=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],pe=q("zap",ue);function ge({recentSimulations:g}){const f=u.useMemo(()=>{const r=new Map;return g.forEach(a=>{const d=a.entitySha,c=r.get(d);c?c.push(a):r.set(d,[a])}),Array.from(r.entries()).map(([a,d])=>({entitySha:a,entityName:d[0].entityName,scenarios:d}))},[g]);return e.jsxs("section",{className:"bg-white border border-gray-200 rounded-xl p-6",children:[e.jsx("div",{className:"flex justify-between items-start mb-5",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-[22px] font-semibold text-gray-900 m-0 mb-1",children:"Recent Simulations"}),e.jsx("p",{className:"text-sm text-gray-500 m-0",children:g.length>0?`Latest ${g.length} captured screenshot${g.length!==1?"s":""}`:"No simulations captured yet"})]})}),g.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-6 mb-5",children:f.map(r=>e.jsxs("div",{children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx("div",{className:"shrink-0 rounded-lg p-1.5 flex items-center justify-center bg-purple-100",children:e.jsx(E,{size:16,style:{color:"#8B5CF6"}})}),e.jsx(p,{to:`/entity/${r.entitySha}`,className:"text-sm font-semibold text-gray-900 no-underline hover:text-gray-700 transition-colors",children:r.entityName})]}),e.jsx("div",{className:"grid grid-cols-4 gap-3",children:r.scenarios.map((a,d)=>e.jsx(p,{to:a.scenarioId?`/entity/${a.entitySha}/scenarios/${a.scenarioId}`:`/entity/${a.entitySha}`,className:"aspect-4/3 border border-gray-200 rounded-lg overflow-hidden bg-gray-50 transition-all flex items-center justify-center hover:scale-105",onMouseEnter:c=>{c.currentTarget.style.borderColor="#005C75",c.currentTarget.style.boxShadow="0 4px 12px rgba(0, 92, 117, 0.2)"},onMouseLeave:c=>{c.currentTarget.style.borderColor="#E5E7EB",c.currentTarget.style.boxShadow="none"},title:a.scenarioName,children:e.jsx(Y,{screenshotPath:a.screenshotPath,alt:a.scenarioName,className:"max-w-full max-h-full object-contain object-center"})},a.scenarioId||`${a.entitySha}-${d}`))})]},r.entitySha))}),e.jsx(p,{to:"/simulations",className:"block text-center p-3 rounded-lg no-underline font-semibold text-sm transition-all",style:{color:"#005C75",backgroundColor:"#F6F9FC"},onMouseEnter:r=>r.currentTarget.style.backgroundColor="#EEF4F8",onMouseLeave:r=>r.currentTarget.style.backgroundColor="#F6F9FC",children:"View All Recent Simulations →"})]}):e.jsxs("div",{className:"py-12 px-6 text-center rounded-lg w-full flex flex-col items-center justify-center min-h-50 border border-dashed",style:{backgroundColor:"#F2F7F8",borderColor:"#BBCCD3"},children:[e.jsx("div",{className:"mb-4 rounded-full flex items-center justify-center",style:{width:"48px",height:"48px",backgroundColor:"#E5EFF1"},children:e.jsx(E,{size:24,style:{color:"#7A9BA5"},strokeWidth:1.5})}),e.jsx("p",{className:"text-sm font-medium m-0",style:{color:"#5A7380"},children:"No simulations captured yet."}),e.jsxs("p",{className:"text-xs m-0 mt-2",style:{color:"#7A9BA5"},children:["Trigger an analysis from the"," ",e.jsx(p,{to:"/git",className:"underline hover:no-underline",style:{color:"#7A9BA5"},children:"Git"})," ","or"," ",e.jsx(p,{to:"/files",className:"underline hover:no-underline",style:{color:"#7A9BA5"},children:"Files"})," ","page."]})]})]})}const ye="/assets/codeyam-name-logo-CvKwUgHo.svg",Te=()=>[{title:"Dashboard - CodeYam"},{name:"description",content:"CodeYam project dashboard"}],Le=se(function(){var _,H;const{stats:f,uncommittedFiles:r,uncommittedEntitiesList:a,recentSimulations:d,visualEntitiesForSimulation:c,projectSlug:b,queueState:$,currentCommit:F}=te(),x=ae(),Q=re(),{showToast:j}=le();oe({source:"dashboard"});const[Z,G]=u.useState(new Set),[m,O]=u.useState(null),[K,B]=u.useState(!1),[M,A]=u.useState(!1),{lastLine:T,isCompleted:D}=ne(b,!!m),{simulatingEntity:v,scenarios:k,scenarioStatuses:fe,allScenariosCaptured:L}=u.useMemo(()=>{var o,C;const s={simulatingEntity:null,scenarios:[],scenarioStatuses:[],allScenariosCaptured:!1};if(!m)return s;const l=c==null?void 0:c.find(N=>N.sha===m);if(!l)return s;const n=(o=l.analyses)==null?void 0:o[0],i=(n==null?void 0:n.scenarios)||[],t=((C=n==null?void 0:n.status)==null?void 0:C.scenarios)||[],y=t.filter(N=>N.screenshotFinishedAt).length,h=i.length>0&&y===i.length;return{simulatingEntity:l,scenarios:i,scenarioStatuses:t,allScenariosCaptured:h}},[m,c]);u.useEffect(()=>{(D||L)&&O(null)},[D,L]);const z=(_=F==null?void 0:F.metadata)==null?void 0:_.currentRun,V=new Set((z==null?void 0:z.currentEntityShas)||[]),I=new Set($.jobs.flatMap(s=>s.entityShas||[])),R=new Set(((H=$.currentlyExecuting)==null?void 0:H.entityShas)||[]),W=a.filter(s=>s.entityType==="visual"||s.entityType==="library"),w=W.filter(s=>!V.has(s.sha)&&!I.has(s.sha)&&!R.has(s.sha)),X=()=>{if(w.length===0){j("All entities are already queued or analyzing","info",3e3);return}const s=w.map(l=>l.sha);A(!0),j(`Starting analysis for ${w.length} entities...`,"info",3e3),x.submit({entityShas:s.join(",")},{method:"post",action:"/api/analyze"})};u.useEffect(()=>{if(x.state==="idle"&&x.data){const s=x.data;s.success?(console.log("[Analyze All] Success:",s.message),j(`Analysis started for ${s.entityCount} entities in ${s.fileCount} files. Watch the logs for progress.`,"success",6e3),A(!1)):s.error&&(console.error("[Analyze All] Error:",s.error),j(`Error: ${s.error}`,"error",8e3),A(!1))}},[x.state,x.data,j]);const J=s=>{G(l=>{const n=new Set(l);return n.has(s)?n.delete(s):n.add(s),n})},ee=[{label:"Total Entities",value:f.totalEntities,iconType:"folder",link:"/files",color:"#005C75",tooltip:"In CodeYam, an entity is a discrete, analyzable unit of code that can be independently simulated and tested."},{label:"Analyzed Entities",value:f.entitiesWithAnalyses,iconType:"check",link:"/simulations",color:"#10B981",tooltip:"Entities that have been analyzed by CodeYam and have generated scenarios."},{label:"Visual Components",value:f.visualEntities,iconType:"image",link:"/files?entityType=visual",color:"#8B5CF6",tooltip:"React components and visual elements that can be rendered and captured as screenshots."},{label:"Library Functions",value:f.libraryEntities,iconType:"code-xml",link:"/files?entityType=library",color:"#0DBFE9",tooltip:"Reusable functions and utilities that can be independently tested."}];return e.jsx("div",{className:"bg-cygray-10 min-h-screen",children:e.jsxs("div",{className:"px-20 pt-8 pb-12",children:[e.jsxs("header",{className:"mb-8 flex justify-between items-center",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("img",{src:ye,alt:"CodeYam",className:"h-3.5"}),e.jsx("span",{className:"text-gray-400 text-sm",children:"|"}),e.jsx("h1",{className:"text-sm font-mono font-normal text-gray-400 m-0",children:b?b.replace(/-/g," ").replace(/\b\w/g,s=>s.toUpperCase()):"Project"})]}),Q.state==="loading"&&e.jsx("div",{className:"text-blue-600 text-sm font-medium animate-pulse",children:"🔄 Updating..."})]}),e.jsx("div",{className:"flex items-center justify-between gap-3",children:ee.map((s,l)=>e.jsx(p,{to:s.link,className:"flex-1 bg-white rounded-xl border border-gray-200 overflow-hidden flex transition-all hover:shadow-lg no-underline cursor-pointer",style:{borderLeft:`4px solid ${s.color}`},children:e.jsxs("div",{className:"px-6 py-6 flex flex-col gap-3 flex-1",children:[e.jsxs("div",{className:"flex md:justify-between md:items-start md:flex-row flex-col",children:[e.jsxs("div",{className:"flex items-center gap-1.5 group relative",children:[e.jsx("span",{className:"text-xs text-gray-700 font-medium font-mono uppercase",children:s.label}),e.jsxs("svg",{className:"w-3 h-3 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",strokeWidth:"2"}),e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 16v-4m0-4h.01"})]}),e.jsx("div",{className:"absolute left-0 top-full mt-2 hidden group-hover:block z-50 w-80",children:e.jsxs("div",{className:"bg-gray-900 text-white text-xs rounded-lg px-3 py-2 shadow-lg",children:[s.tooltip,e.jsx("div",{className:"absolute -top-1 left-4 w-2 h-2 bg-gray-900 transform rotate-45"})]})})]}),e.jsx("div",{className:"text-xs font-medium transition-colors flex items-center gap-1 sm:hidden md:flex",style:{color:s.color},children:"View All →"})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"rounded-lg p-2 leading-none shrink-0",style:{backgroundColor:`${s.color}15`},children:[s.iconType==="folder"&&e.jsx(he,{size:20,style:{color:s.color}}),s.iconType==="check"&&e.jsx(xe,{size:20,style:{color:s.color}}),s.iconType==="image"&&e.jsx(E,{size:20,style:{color:s.color}}),s.iconType==="code-xml"&&e.jsx(P,{size:20,style:{color:s.color}})]}),e.jsx("div",{className:"text-3xl font-semibold font-mono text-gray-900 leading-none",children:s.value.toLocaleString("en-US")})]}),e.jsx("div",{className:"text-xs font-medium transition-colors flex items-center gap-1 md:hidden",style:{color:s.color},children:"View All →"})]})]})},l))}),e.jsxs("div",{className:"mt-12 grid gap-8 items-start",style:{gridTemplateColumns:"repeat(auto-fit, minmax(500px, 1fr))"},children:[e.jsxs("section",{id:"uncommitted",className:"bg-white border border-gray-200 rounded-xl p-6",children:[e.jsxs("div",{className:"flex justify-between items-start mb-5",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-[22px] font-semibold text-gray-900 m-0 mb-1",children:"Uncommitted Changes"}),e.jsx("p",{className:"text-sm text-gray-500 m-0",children:r.length>0?`${r.length} file${r.length!==1?"s":""} with ${a.length} uncommitted entit${a.length!==1?"ies":"y"}`:"No uncommitted changes detected"})]}),W.length>0&&e.jsx("button",{onClick:X,disabled:x.state!=="idle"||M||w.length===0,className:"px-5 py-2.5 text-white border-none rounded-lg text-sm font-semibold cursor-pointer transition-all hover:-translate-y-px disabled:bg-gray-400 disabled:cursor-not-allowed disabled:translate-y-0",style:{backgroundColor:"#005C75"},onMouseEnter:s=>s.currentTarget.style.backgroundColor="#004560",onMouseLeave:s=>s.currentTarget.style.backgroundColor="#005C75",children:x.state!=="idle"||M?"Starting analysis...":w.length===0?"All Queued":"Analyze All"})]}),r.length>0?e.jsx("div",{className:"flex flex-col gap-3",children:r.map(([s,l])=>{const n=Z.has(s),i=l.editedEntities||[];return e.jsxs("div",{className:"bg-white border border-gray-200 border-l-4 rounded-lg overflow-hidden",style:{borderLeftColor:"#005C75"},children:[e.jsx("div",{className:"p-4 cursor-pointer select-none transition-colors hover:bg-gray-50",onClick:()=>J(s),role:"button",tabIndex:0,children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-gray-500 text-xs w-4 shrink-0",children:n?"▼":"▶"}),e.jsxs("svg",{width:"16",height:"20",viewBox:"0 0 12 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"shrink-0",children:[e.jsxs("g",{clipPath:"url(#clip0_784_10666)",children:[e.jsx("path",{d:"M0 2.55857C0 1.14551 1.14551 0 2.55857 0H8.73194L12 3.3616V13.4414C12 14.8545 10.8545 16 9.44143 16H2.55857C1.14551 16 0 14.8545 0 13.4414V2.55857Z",fill:"#DDDDFE"}),e.jsx("path",{d:"M8.72656 3.3307H11.9906L8.72656 0V3.3307Z",fill:"#306AFF"}),e.jsx("line",{x1:"1.8125",y1:"5.94825",x2:"10.0235",y2:"5.94825",stroke:"#306AFF",strokeWidth:"1.27929"}),e.jsx("line",{x1:"1.8125",y1:"8.82715",x2:"6.01207",y2:"8.82715",stroke:"#306AFF",strokeWidth:"1.27929"}),e.jsx("line",{x1:"1.8125",y1:"11.7061",x2:"10.0235",y2:"11.7061",stroke:"#306AFF",strokeWidth:"1.27929"})]}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_784_10666",children:e.jsx("rect",{width:"12",height:"16",fill:"white"})})})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"font-normal text-gray-900 text-sm block truncate",children:s}),e.jsxs("span",{className:"text-xs text-gray-500",children:[i.length," entit",i.length!==1?"ies":"y"]})]})]})}),n&&e.jsx("div",{className:"border-t border-gray-200 bg-gray-50 p-3 flex flex-col gap-2",children:i.length>0?i.map(t=>{const y=V.has(t.sha),h=I.has(t.sha)||R.has(t.sha);return e.jsxs(p,{to:`/entity/${t.sha}`,className:"flex items-center gap-4 p-4 bg-white border border-gray-200 rounded-lg no-underline transition-all hover:shadow-md hover:-translate-y-0.5",style:{borderColor:"inherit"},onMouseEnter:o=>o.currentTarget.style.borderColor="#005C75",onMouseLeave:o=>o.currentTarget.style.borderColor="inherit",children:[e.jsxs("div",{className:"shrink-0 rounded-lg p-1.5 flex items-center justify-center",style:{backgroundColor:t.entityType==="visual"?"#8B5CF615":t.entityType==="library"?"#6366F1":"#EC4899"},children:[t.entityType==="visual"&&e.jsx(E,{size:16,style:{color:"#8B5CF6"}}),t.entityType==="library"&&e.jsx(P,{size:16,className:"text-white"}),t.entityType==="other"&&e.jsx(pe,{size:16,className:"text-white"})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[e.jsx("div",{className:"font-semibold text-gray-900 text-sm",children:t.name}),t.entityType==="visual"&&e.jsx("div",{className:"px-2 py-0.5 rounded-sm text-[10px] uppercase font-bold",style:{backgroundColor:"#8B5CF60D",color:"#8B5CF6"},children:"Visual"}),t.entityType==="library"&&e.jsx("div",{className:"px-2 py-0.5 rounded-sm text-[10px] uppercase font-bold",style:{backgroundColor:"#0DBFE90D",color:"#0DBFE9"},children:"Library"}),t.entityType==="other"&&e.jsx("div",{className:"px-2 py-0.5 rounded-sm text-[10px] uppercase font-bold",style:{backgroundColor:"#EC48990D",color:"#EC4899"},children:"Other"})]}),t.description&&e.jsx("div",{className:"text-sm text-gray-500 mt-1 overflow-hidden text-ellipsis whitespace-nowrap",children:t.description})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[y&&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(S,{size:14,className:"animate-spin"}),"Analyzing..."]}),!y&&h&&e.jsx("div",{className:"px-2 py-1 bg-purple-50 border border-purple-300 rounded text-xs text-purple-700 font-semibold",children:"⏳ Queued"}),!y&&!h&&e.jsx("button",{onClick:o=>{o.preventDefault(),o.stopPropagation(),j(`Starting analysis for ${t.name}...`,"info",3e3),x.submit({entityShas:t.sha},{method:"post",action:"/api/analyze"})},disabled:x.state!=="idle",className:"px-3 py-1.5 text-white border-none rounded text-xs font-medium cursor-pointer transition-all disabled:bg-gray-400 disabled:cursor-not-allowed",style:{backgroundColor:"#005C75"},onMouseEnter:o=>o.currentTarget.style.backgroundColor="#004560",onMouseLeave:o=>o.currentTarget.style.backgroundColor="#005C75",children:"Analyze"})]})]},t.sha)}):e.jsx("div",{className:"text-sm text-gray-500 italic p-2",children:"No entity changes detected in this file"})})]},s)})}):e.jsxs("div",{className:"py-12 px-6 text-center flex flex-col items-center rounded-lg min-h-50 justify-center border border-dashed",style:{backgroundColor:"#F2F7F8",borderColor:"#BBCCD3"},children:[e.jsx("div",{className:"mb-4 rounded-full flex items-center justify-center",style:{width:"48px",height:"48px",backgroundColor:"#E5EFF1"},children:e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#7A9BA5",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e.jsx("polyline",{points:"14 2 14 8 20 8"}),e.jsx("line",{x1:"12",y1:"18",x2:"12",y2:"12"}),e.jsx("line",{x1:"9",y1:"15",x2:"15",y2:"15"})]})}),e.jsx("p",{className:"text-sm font-medium m-0",style:{color:"#5A7380"},children:"No Uncommitted Changes."})]})]}),!m&&e.jsx(ge,{recentSimulations:d}),m&&e.jsxs("section",{className:"bg-white border border-gray-200 rounded-xl p-6",children:[e.jsx("div",{className:"flex justify-between items-start mb-5",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-[22px] font-semibold text-gray-900 m-0 mb-1",children:"Recent Simulations"}),e.jsx("p",{className:"text-sm text-gray-500 m-0",children:d.length>0?`Latest ${d.length} captured screenshot${d.length!==1?"s":""}`:"No simulations captured yet"})]})}),m&&e.jsxs("div",{className:"p-0 bg-white rounded-lg flex flex-col gap-0",children:[v&&e.jsx("div",{className:"p-4 rounded-t-lg",style:{backgroundColor:"#F0F5F8",borderBottom:"2px solid #005C75"},children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-[32px] leading-none",children:e.jsx(ce,{type:"visual"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"text-base font-bold mb-1",style:{color:"#005C75"},children:["Generating Simulations for ",v.name]}),e.jsx("div",{className:"text-[13px] text-gray-500 font-mono overflow-hidden text-ellipsis whitespace-nowrap",children:v.filePath})]})]})}),L?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-emerald-600 font-medium p-4 bg-emerald-50",children:[e.jsx("span",{className:"text-lg",children:"✅"}),e.jsxs("span",{children:["Complete (",k.length," scenario",k.length!==1?"s":"",")"]})]}):T?e.jsxs("div",{className:"flex items-center justify-between gap-1.5 text-sm font-medium p-4 bg-gray-50",style:{color:"#005C75"},children:[e.jsx(S,{size:18,className:"animate-spin shrink-0"}),e.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap font-mono text-xs",title:T,children:T}),b&&e.jsx("button",{onClick:()=>B(!0),className:"px-2 py-1.5 bg-gray-500 text-white border-none rounded-md text-[13px] font-medium cursor-pointer transition-all whitespace-nowrap self-start hover:bg-gray-600 hover:-translate-y-px",title:"View analysis logs",children:"📋 Logs"})]}):x.state!=="idle"?e.jsxs("div",{className:"flex items-center justify-between gap-1.5 text-sm font-medium p-4 bg-gray-50",style:{color:"#005C75"},children:[e.jsx(S,{size:18,className:"animate-spin shrink-0"}),e.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap",children:"Initializing analysis..."})]}):e.jsxs("div",{className:"flex items-center justify-between gap-1.5 text-sm font-medium p-4 bg-gray-50",style:{color:"#005C75"},children:[e.jsx(S,{size:18,className:"animate-spin shrink-0"}),e.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap",children:"Starting analysis..."})]}),k.length>0&&e.jsx("div",{className:"flex gap-2 flex-wrap p-4 bg-white border-t border-gray-200",children:k.slice(0,8).map((s,l)=>{var C,N,U;const n=(C=v==null?void 0:v.analyses)==null?void 0:C[0],i=de(s,n==null?void 0:n.status,void 0,m||void 0,void 0),t=(U=(N=s.metadata)==null?void 0:N.screenshotPaths)==null?void 0:U[0],y=i.isCaptured,h=i.status==="capturing"||i.status==="starting",o=i.hasError;return y?e.jsx(p,{to:`/entity/${m}`,className:"w-20 h-15 border-2 border-gray-200 rounded overflow-hidden bg-gray-50 cursor-pointer transition-all flex items-center justify-center no-underline hover:border-blue-600 hover:scale-105 hover:shadow-md",children:e.jsx(Y,{screenshotPath:t,alt:s.name,title:s.name,className:"max-w-full max-h-full object-contain object-center"})},l):o?e.jsx("div",{className:"w-20 h-15 border-2 border-solid border-red-300 rounded bg-red-50 flex flex-col items-center justify-center text-lg",title:i.errorMessage||"Capture error",children:e.jsx("span",{className:"text-red-500",children:"⚠️"})},l):e.jsx("div",{className:"w-20 h-15 border-2 border-dashed border-gray-300 rounded bg-gray-50 flex items-center justify-center text-2xl",title:`${h?"Capturing":"Pending"} ${s.name}...`,children:e.jsx("span",{className:h?"animate-pulse":"text-gray-400",children:h?"⋯":"⏹️"})},l)})})]})]})]}),K&&b&&e.jsx(ie,{projectSlug:b,onClose:()=>B(!1)})]})})});export{Le as default,Te as meta};
|