@codeyam/codeyam-cli 0.1.0-staging.1669d45 → 0.1.0-staging.1a2737b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/analyzer-template/.build-info.json +8 -8
- package/analyzer-template/log.txt +3 -3
- package/analyzer-template/package.json +19 -19
- package/analyzer-template/packages/ai/index.ts +16 -2
- package/analyzer-template/packages/ai/package.json +2 -2
- package/analyzer-template/packages/ai/src/lib/analyzeScope.ts +110 -52
- package/analyzer-template/packages/ai/src/lib/astScopes/arrayDerivationDetector.ts +199 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/astScopeAnalyzer.ts +98 -9
- package/analyzer-template/packages/ai/src/lib/astScopes/methodSemantics.ts +139 -23
- package/analyzer-template/packages/ai/src/lib/astScopes/patterns/forInStatementHandler.ts +10 -17
- package/analyzer-template/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.ts +6 -126
- package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +656 -28
- package/analyzer-template/packages/ai/src/lib/astScopes/sharedPatterns.ts +28 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/types.ts +94 -7
- package/analyzer-template/packages/ai/src/lib/completionCall.ts +198 -34
- package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +1331 -254
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.ts +5 -1
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.ts +205 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.ts +10 -2
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.ts +16 -3
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.ts +6 -4
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.ts +54 -3
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.ts +124 -17
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/coerceObjectsToPrimitivesBySchema.ts +70 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.ts +140 -14
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.ts +179 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.ts +40 -30
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.ts +393 -97
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fixNullIdsBySchema.ts +129 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.ts +35 -0
- package/analyzer-template/packages/ai/src/lib/dataStructureChunking.ts +183 -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/generateEntityDataStructure.ts +58 -3
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +936 -7
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarios.ts +35 -6
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +515 -6
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.ts +1 -1
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionals.ts +1540 -75
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.ts +239 -0
- package/analyzer-template/packages/ai/src/lib/isolateScopes.ts +51 -3
- package/analyzer-template/packages/ai/src/lib/mergeJsonTypeDefinitions.ts +5 -0
- package/analyzer-template/packages/ai/src/lib/mergeStatements.ts +90 -96
- package/analyzer-template/packages/ai/src/lib/promptGenerators/collapseNullableObjects.ts +118 -0
- package/analyzer-template/packages/ai/src/lib/promptGenerators/gatherAttributesMap.ts +10 -7
- 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 +44 -7
- package/analyzer-template/packages/ai/src/lib/promptGenerators/simplifyKeysForLLM.ts +391 -0
- package/analyzer-template/packages/ai/src/lib/resolvePathToControllable.ts +179 -45
- package/analyzer-template/packages/ai/src/lib/worker/SerializableDataStructure.ts +26 -4
- package/analyzer-template/packages/ai/src/lib/worker/analyzeScopeWorker.ts +114 -2
- package/analyzer-template/packages/analyze/index.ts +2 -0
- package/analyzer-template/packages/analyze/src/lib/FileAnalyzer.ts +65 -59
- package/analyzer-template/packages/analyze/src/lib/ProjectAnalyzer.ts +113 -26
- package/analyzer-template/packages/analyze/src/lib/analysisContext.ts +44 -4
- package/analyzer-template/packages/analyze/src/lib/asts/nodes/getNodeType.ts +1 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.ts +19 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllEntityNodes.ts +19 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllExports.ts +11 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getImportsAnalysis.ts +8 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getResolvedModule.ts +49 -1
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getSourceFilesForAllImports.ts +2 -1
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +99 -22
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +19 -4
- package/analyzer-template/packages/analyze/src/lib/files/analyze/dependencyResolver.ts +6 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyze/gatherEntityMap.ts +4 -2
- package/analyzer-template/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.ts +33 -10
- package/analyzer-template/packages/analyze/src/lib/files/analyzeRemixRoute.ts +4 -5
- package/analyzer-template/packages/analyze/src/lib/files/getImportedExports.ts +14 -12
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/TransformationTracer.ts +1315 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.ts +193 -76
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.ts +87 -25
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +269 -22
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.ts +118 -10
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +647 -73
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.ts +56 -11
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/propagateArrayItemSchemas.ts +474 -0
- package/analyzer-template/packages/analyze/src/lib/files/setImportedExports.ts +2 -1
- package/analyzer-template/packages/analyze/src/lib/index.ts +1 -0
- package/analyzer-template/packages/analyze/src/lib/utils/getFileByPath.ts +19 -0
- package/analyzer-template/packages/aws/package.json +10 -10
- package/analyzer-template/packages/database/package.json +1 -1
- package/analyzer-template/packages/database/src/lib/analysisBranchToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/analysisToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/branchToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/commitBranchToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/commitToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/fileToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/kysely/db.ts +14 -1
- package/analyzer-template/packages/database/src/lib/kysely/tables/commitsTable.ts +6 -0
- package/analyzer-template/packages/database/src/lib/kysely/tables/debugReportsTable.ts +1 -1
- package/analyzer-template/packages/database/src/lib/kysely/tables/labsRequestsTable.ts +52 -0
- package/analyzer-template/packages/database/src/lib/loadAnalyses.ts +58 -1
- package/analyzer-template/packages/database/src/lib/loadAnalysis.ts +13 -0
- package/analyzer-template/packages/database/src/lib/loadBranch.ts +16 -1
- package/analyzer-template/packages/database/src/lib/loadCommit.ts +11 -0
- package/analyzer-template/packages/database/src/lib/loadCommits.ts +28 -0
- package/analyzer-template/packages/database/src/lib/loadEntities.ts +26 -3
- package/analyzer-template/packages/database/src/lib/loadEntityBranches.ts +12 -0
- package/analyzer-template/packages/database/src/lib/projectToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/saveFiles.ts +1 -1
- package/analyzer-template/packages/database/src/lib/scenarioToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/updateCommitMetadata.ts +7 -14
- package/analyzer-template/packages/database/src/lib/userScenarioToDb.ts +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/analysisBranchToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/analysisBranchToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/analysisToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/analysisToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/branchToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/branchToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/commitBranchToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/commitBranchToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/commitToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/commitToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/fileToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/fileToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts +2 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js +11 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js.map +1 -1
- 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/commitsTable.d.ts +1 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.js +3 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.d.ts +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.d.ts +23 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.d.ts.map +1 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.js +35 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.js.map +1 -0
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalyses.d.ts +2 -0
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalyses.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalyses.js +45 -2
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalyses.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.js +8 -0
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadBranch.js +11 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadBranch.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommit.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommit.js +7 -0
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommit.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.d.ts +3 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js +22 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.d.ts +3 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js +23 -4
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntityBranches.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntityBranches.js +9 -0
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntityBranches.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/projectToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/projectToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/saveFiles.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/saveFiles.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/scenarioToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/scenarioToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.d.ts +2 -2
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js +5 -4
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js.map +1 -1
- package/analyzer-template/packages/github/dist/types/index.d.ts +1 -1
- 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 +25 -1
- package/analyzer-template/packages/github/dist/types/src/types/Analysis.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/Commit.d.ts +2 -0
- package/analyzer-template/packages/github/dist/types/src/types/Commit.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/ProjectMetadata.d.ts +7 -0
- package/analyzer-template/packages/github/dist/types/src/types/ProjectMetadata.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts +56 -6
- package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/ScopeAnalysis.d.ts +6 -1
- package/analyzer-template/packages/github/dist/types/src/types/ScopeAnalysis.d.ts.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/package.json +1 -1
- package/analyzer-template/packages/types/index.ts +1 -0
- package/analyzer-template/packages/types/src/types/Analysis.ts +25 -0
- package/analyzer-template/packages/types/src/types/Commit.ts +2 -0
- package/analyzer-template/packages/types/src/types/ProjectMetadata.ts +7 -0
- package/analyzer-template/packages/types/src/types/ScenariosDataStructure.ts +70 -6
- package/analyzer-template/packages/types/src/types/ScopeAnalysis.ts +6 -1
- package/analyzer-template/packages/utils/dist/types/index.d.ts +1 -1
- 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 +25 -1
- package/analyzer-template/packages/utils/dist/types/src/types/Analysis.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/Commit.d.ts +2 -0
- package/analyzer-template/packages/utils/dist/types/src/types/Commit.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/ProjectMetadata.d.ts +7 -0
- package/analyzer-template/packages/utils/dist/types/src/types/ProjectMetadata.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts +56 -6
- package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/ScopeAnalysis.d.ts +6 -1
- package/analyzer-template/packages/utils/dist/types/src/types/ScopeAnalysis.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js +93 -2
- package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.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/fs/rsyncCopy.ts +108 -2
- package/analyzer-template/packages/utils/src/lib/safeFileName.ts +48 -3
- package/analyzer-template/playwright/capture.ts +20 -8
- package/analyzer-template/playwright/captureStatic.ts +1 -1
- package/analyzer-template/project/analyzeBaselineCommit.ts +5 -0
- package/analyzer-template/project/analyzeRegularCommit.ts +5 -0
- package/analyzer-template/project/captureLibraryFunctionDirect.ts +29 -26
- package/analyzer-template/project/constructMockCode.ts +436 -44
- package/analyzer-template/project/createEntitiesAndSortFiles.ts +83 -0
- package/analyzer-template/project/loadReadyToBeCaptured.ts +65 -41
- package/analyzer-template/project/orchestrateCapture/AwsCaptureTaskRunner.ts +12 -4
- package/analyzer-template/project/orchestrateCapture/SequentialCaptureTaskRunner.ts +18 -7
- package/analyzer-template/project/orchestrateCapture/taskRunner.ts +4 -2
- package/analyzer-template/project/orchestrateCapture.ts +75 -7
- package/analyzer-template/project/reconcileMockDataKeys.ts +152 -9
- package/analyzer-template/project/runAnalysis.ts +4 -0
- package/analyzer-template/project/start.ts +35 -11
- package/analyzer-template/project/writeMockDataTsx.ts +295 -10
- package/analyzer-template/project/writeScenarioComponents.ts +237 -32
- package/analyzer-template/project/writeSimpleRoot.ts +21 -11
- package/analyzer-template/scripts/comboWorkerLoop.cjs +98 -50
- package/background/src/lib/local/createLocalAnalyzer.js +1 -1
- package/background/src/lib/local/createLocalAnalyzer.js.map +1 -1
- package/background/src/lib/virtualized/project/analyzeBaselineCommit.js +5 -0
- package/background/src/lib/virtualized/project/analyzeBaselineCommit.js.map +1 -1
- package/background/src/lib/virtualized/project/analyzeRegularCommit.js +5 -0
- package/background/src/lib/virtualized/project/analyzeRegularCommit.js.map +1 -1
- package/background/src/lib/virtualized/project/captureLibraryFunctionDirect.js +3 -3
- package/background/src/lib/virtualized/project/captureLibraryFunctionDirect.js.map +1 -1
- package/background/src/lib/virtualized/project/constructMockCode.js +359 -14
- package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
- package/background/src/lib/virtualized/project/createEntitiesAndSortFiles.js +73 -1
- package/background/src/lib/virtualized/project/createEntitiesAndSortFiles.js.map +1 -1
- package/background/src/lib/virtualized/project/loadReadyToBeCaptured.js +19 -8
- package/background/src/lib/virtualized/project/loadReadyToBeCaptured.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture/AwsCaptureTaskRunner.js +2 -2
- package/background/src/lib/virtualized/project/orchestrateCapture/AwsCaptureTaskRunner.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture/SequentialCaptureTaskRunner.js +7 -5
- package/background/src/lib/virtualized/project/orchestrateCapture/SequentialCaptureTaskRunner.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture.js +62 -7
- package/background/src/lib/virtualized/project/orchestrateCapture.js.map +1 -1
- package/background/src/lib/virtualized/project/reconcileMockDataKeys.js +126 -9
- package/background/src/lib/virtualized/project/reconcileMockDataKeys.js.map +1 -1
- package/background/src/lib/virtualized/project/runAnalysis.js +3 -0
- package/background/src/lib/virtualized/project/runAnalysis.js.map +1 -1
- package/background/src/lib/virtualized/project/start.js +32 -11
- package/background/src/lib/virtualized/project/start.js.map +1 -1
- package/background/src/lib/virtualized/project/writeMockDataTsx.js +251 -6
- package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
- package/background/src/lib/virtualized/project/writeScenarioComponents.js +173 -30
- package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
- package/background/src/lib/virtualized/project/writeSimpleRoot.js +21 -11
- package/background/src/lib/virtualized/project/writeSimpleRoot.js.map +1 -1
- package/codeyam-cli/scripts/apply-setup.js +180 -0
- package/codeyam-cli/scripts/apply-setup.js.map +1 -1
- package/codeyam-cli/src/cli.js +32 -18
- package/codeyam-cli/src/cli.js.map +1 -1
- package/codeyam-cli/src/codeyam-cli.js +18 -2
- package/codeyam-cli/src/codeyam-cli.js.map +1 -1
- package/codeyam-cli/src/commands/analyze.js +4 -2
- package/codeyam-cli/src/commands/analyze.js.map +1 -1
- package/codeyam-cli/src/commands/baseline.js +2 -0
- package/codeyam-cli/src/commands/baseline.js.map +1 -1
- package/codeyam-cli/src/commands/debug.js +9 -5
- package/codeyam-cli/src/commands/debug.js.map +1 -1
- package/codeyam-cli/src/commands/default.js +31 -20
- package/codeyam-cli/src/commands/default.js.map +1 -1
- package/codeyam-cli/src/commands/detect-universal-mocks.js +2 -0
- package/codeyam-cli/src/commands/detect-universal-mocks.js.map +1 -1
- package/codeyam-cli/src/commands/init.js +49 -257
- package/codeyam-cli/src/commands/init.js.map +1 -1
- package/codeyam-cli/src/commands/memory.js +307 -0
- package/codeyam-cli/src/commands/memory.js.map +1 -0
- package/codeyam-cli/src/commands/recapture.js +2 -0
- package/codeyam-cli/src/commands/recapture.js.map +1 -1
- package/codeyam-cli/src/commands/setup-sandbox.js +2 -0
- package/codeyam-cli/src/commands/setup-sandbox.js.map +1 -1
- package/codeyam-cli/src/commands/setup-simulations.js +284 -0
- package/codeyam-cli/src/commands/setup-simulations.js.map +1 -0
- package/codeyam-cli/src/commands/test-startup.js +2 -0
- package/codeyam-cli/src/commands/test-startup.js.map +1 -1
- package/codeyam-cli/src/commands/verify.js +14 -2
- package/codeyam-cli/src/commands/verify.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/npmVersionCheck.test.js +179 -0
- package/codeyam-cli/src/utils/__tests__/npmVersionCheck.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +128 -82
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
- package/codeyam-cli/src/utils/analysisRunner.js +21 -2
- package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
- package/codeyam-cli/src/utils/analyzer.js +7 -0
- package/codeyam-cli/src/utils/analyzer.js.map +1 -1
- package/codeyam-cli/src/utils/backgroundServer.js +90 -19
- package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/utils/generateReport.js +2 -2
- package/codeyam-cli/src/utils/install-skills.js +77 -38
- package/codeyam-cli/src/utils/install-skills.js.map +1 -1
- package/codeyam-cli/src/utils/labsAutoCheck.js +19 -0
- package/codeyam-cli/src/utils/labsAutoCheck.js.map +1 -0
- package/codeyam-cli/src/utils/npmVersionCheck.js +76 -0
- package/codeyam-cli/src/utils/npmVersionCheck.js.map +1 -0
- package/codeyam-cli/src/utils/progress.js +7 -0
- package/codeyam-cli/src/utils/progress.js.map +1 -1
- package/codeyam-cli/src/utils/queue/job.js +5 -0
- package/codeyam-cli/src/utils/queue/job.js.map +1 -1
- package/codeyam-cli/src/utils/queue/manager.js +6 -0
- package/codeyam-cli/src/utils/queue/manager.js.map +1 -1
- package/codeyam-cli/src/utils/requireSimulations.js +10 -0
- package/codeyam-cli/src/utils/requireSimulations.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/confusionDetector.test.js +82 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/confusionDetector.test.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/contextBuilder.test.js +230 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/contextBuilder.test.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/assertRules.js +67 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/assertRules.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/captureFixture.js +105 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/captureFixture.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/loadCapturedFixture.js +34 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/loadCapturedFixture.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/runClaude.js +162 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/runClaude.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/setupTempProject.js +74 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/setupTempProject.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/ruleReflectionE2E.test.js +376 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/ruleReflectionE2E.test.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.js +116 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/transcriptParser.test.js +127 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/transcriptParser.test.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/confusionDetector.js +50 -0
- package/codeyam-cli/src/utils/ruleReflection/confusionDetector.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/contextBuilder.js +116 -0
- package/codeyam-cli/src/utils/ruleReflection/contextBuilder.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/index.js +5 -0
- package/codeyam-cli/src/utils/ruleReflection/index.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/promptBuilder.js +44 -0
- package/codeyam-cli/src/utils/ruleReflection/promptBuilder.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/transcriptParser.js +85 -0
- package/codeyam-cli/src/utils/ruleReflection/transcriptParser.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/types.js +5 -0
- package/codeyam-cli/src/utils/ruleReflection/types.js.map +1 -0
- package/codeyam-cli/src/utils/rules/__tests__/ruleState.test.js +293 -0
- package/codeyam-cli/src/utils/rules/__tests__/ruleState.test.js.map +1 -0
- package/codeyam-cli/src/utils/rules/index.js +6 -0
- package/codeyam-cli/src/utils/rules/index.js.map +1 -0
- package/codeyam-cli/src/utils/rules/parser.js +83 -0
- package/codeyam-cli/src/utils/rules/parser.js.map +1 -0
- package/codeyam-cli/src/utils/rules/pathMatcher.js +18 -0
- package/codeyam-cli/src/utils/rules/pathMatcher.js.map +1 -0
- package/codeyam-cli/src/utils/rules/ruleState.js +150 -0
- package/codeyam-cli/src/utils/rules/ruleState.js.map +1 -0
- package/codeyam-cli/src/utils/rules/staleness.js +137 -0
- package/codeyam-cli/src/utils/rules/staleness.js.map +1 -0
- package/codeyam-cli/src/utils/serverState.js +37 -10
- package/codeyam-cli/src/utils/serverState.js.map +1 -1
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +21 -42
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
- package/codeyam-cli/src/utils/simulationGateMiddleware.js +138 -0
- package/codeyam-cli/src/utils/simulationGateMiddleware.js.map +1 -0
- package/codeyam-cli/src/utils/syncMocksMiddleware.js +5 -24
- package/codeyam-cli/src/utils/syncMocksMiddleware.js.map +1 -1
- package/codeyam-cli/src/utils/versionInfo.js +25 -0
- package/codeyam-cli/src/utils/versionInfo.js.map +1 -1
- package/codeyam-cli/src/webserver/__tests__/dependency-smoke.test.js +66 -0
- package/codeyam-cli/src/webserver/__tests__/dependency-smoke.test.js.map +1 -0
- package/codeyam-cli/src/webserver/app/lib/database.js +22 -6
- 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 +50 -0
- package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/webserver/bootstrap.js +51 -0
- package/codeyam-cli/src/webserver/bootstrap.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/CopyButton-jNYXRRNI.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/EntityItem-bwuHPyTa.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-COi5OvsN.js → EntityTypeBadge-CvzqMxcu.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-BwdQv49w.js → EntityTypeIcon-BH0XDim7.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{InlineSpinner-CEleMv_j.js → InlineSpinner-EhOseatT.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-D68KarMg.js → InteractivePreview-yjIHlOGa.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-L75Wvqgw.js → LibraryFunctionPreview-Cq5o8jL4.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-C53WM8qn.js → LoadingDots-BvMu2i-g.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-CrNkmy4i.js → LogViewer-kgBTLoJD.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-BzPgx-xO.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-CQifa1n-.js → SafeScreenshot-CwZrv-Ok.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-CyaBFX7l.js → ScenarioViewer-BX2Ny2Qj.js} +3 -13
- package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-D36O1rzU.js → TruncatedFilePath-CDpEprKa.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/_index-BRx8ZGZo.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-4S4yPfFw.js +27 -0
- package/codeyam-cli/src/webserver/build/client/assets/agent-transcripts-DHKuQSmR.js +17 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.agent-transcripts-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.health-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.labs-unlock-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.memory-profile-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.save-fixture-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/book-open-D4IPYH_y.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-DgTPh8H-.js → chevron-down-CG65viiV.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{chunk-EPOLDU6W-DdQKK6on.js → chunk-JZWAC4HX-DB3aFuEO.js} +12 -12
- package/codeyam-cli/src/webserver/build/client/assets/{circle-check-Dmr2bb1R.js → circle-check-igfMr5DY.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/copy-Coc4o_8c.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-Do4ZLUYa.js → createLucideIcon-D1zB-pYc.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-JTAjQ54M.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-CbdFyxZh.js → entity._sha._-B0h9AqE6.js} +12 -12
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha.scenarios._scenarioId.fullscreen-B4iCfs5M.js → entity._sha.scenarios._scenarioId.fullscreen-DjLxr2JB.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.create-scenario-wDWZZO1W.js → entity._sha_.create-scenario-CtYowLOt.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-BMbl7MeQ.js → entity._sha_.edit._scenarioId-PePWg17F.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entry.client-5wRKRIH9.js → entry.client-I-Wo99C_.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{fileTableUtils-DD3SDH7t.js → fileTableUtils-9sMMAiWJ.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/files-Co65J0s3.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{git-zXjT7J0G.js → git-BdHOxVfg.js} +8 -8
- package/codeyam-cli/src/webserver/build/client/assets/globals-BSZfYCkU.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{index-DLbXwndH.js → index-CUM5iXwc.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{index-gPZ-lad1.js → index-_417gcQW.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/labs-BK0C1H1T.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-BsPXJ81F.js → loader-circle-TzRHMVog.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-040dab1c.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/memory-UIDVz141.js +92 -0
- package/codeyam-cli/src/webserver/build/client/assets/pause-hjzB7t2z.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/root-D1WadSdf.js +62 -0
- package/codeyam-cli/src/webserver/build/client/assets/{search-P2FKIUql.js → search-DcAwD_Ln.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/settings-CclxrcPK.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{simulations-L18M6-kN.js → simulations-DVNJVQgD.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/terminal-DbEAHMbA.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-BDz7kbVA.js → triangle-alert-CAD5b1o_.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useCustomSizes-29dDmbH8.js → useCustomSizes-BqgrAzs3.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-BUm0UVJm.js → useLastLogLine-DAFqfEDH.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useReportContext-CkIOKTrZ.js → useReportContext-DZlYx2c4.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useToast-KKw5kTn-.js → useToast-ihdMtlf6.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/index-B3dE0r28.js +1 -0
- package/codeyam-cli/src/webserver/build/server/assets/server-build-DYbfdxa3.js +273 -0
- package/codeyam-cli/src/webserver/build/server/index.js +1 -1
- package/codeyam-cli/src/webserver/build-info.json +5 -5
- package/codeyam-cli/templates/{codeyam:debug.md → codeyam-debug.md} +48 -4
- package/codeyam-cli/templates/codeyam-diagnose.md +481 -0
- package/codeyam-cli/templates/codeyam-memory-hook.sh +199 -0
- package/codeyam-cli/templates/codeyam-memory.md +396 -0
- package/codeyam-cli/templates/codeyam-new-rule.md +13 -0
- package/codeyam-cli/templates/{codeyam:setup.md → codeyam-setup.md} +13 -1
- package/codeyam-cli/templates/{codeyam:sim.md → codeyam-sim.md} +1 -1
- package/codeyam-cli/templates/{codeyam:test.md → codeyam-test.md} +1 -1
- package/codeyam-cli/templates/{codeyam:verify.md → codeyam-verify.md} +1 -1
- package/codeyam-cli/templates/rule-notification-hook.py +56 -0
- package/codeyam-cli/templates/rule-reflection-hook.py +627 -0
- package/codeyam-cli/templates/rules-instructions.md +132 -0
- package/package.json +18 -15
- package/packages/ai/index.js +7 -3
- package/packages/ai/index.js.map +1 -1
- package/packages/ai/src/lib/analyzeScope.js +91 -30
- 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 +78 -8
- package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js.map +1 -1
- package/packages/ai/src/lib/astScopes/methodSemantics.js +109 -23
- package/packages/ai/src/lib/astScopes/methodSemantics.js.map +1 -1
- package/packages/ai/src/lib/astScopes/patterns/forInStatementHandler.js +10 -14
- package/packages/ai/src/lib/astScopes/patterns/forInStatementHandler.js.map +1 -1
- package/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.js +1 -102
- package/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.js.map +1 -1
- package/packages/ai/src/lib/astScopes/processExpression.js +518 -28
- package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
- package/packages/ai/src/lib/astScopes/sharedPatterns.js +25 -0
- package/packages/ai/src/lib/astScopes/sharedPatterns.js.map +1 -1
- package/packages/ai/src/lib/completionCall.js +161 -30
- package/packages/ai/src/lib/completionCall.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +1061 -174
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js +5 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.js +179 -0
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js +7 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.js +13 -3
- package/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.js +6 -4
- package/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js +52 -3
- package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js +106 -13
- package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/coerceObjectsToPrimitivesBySchema.js +63 -0
- package/packages/ai/src/lib/dataStructure/helpers/coerceObjectsToPrimitivesBySchema.js.map +1 -0
- package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js +122 -12
- package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.js +173 -0
- package/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.js.map +1 -0
- package/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.js +37 -20
- package/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js +333 -86
- 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 +130 -0
- package/packages/ai/src/lib/dataStructureChunking.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/generateEntityDataStructure.js +46 -2
- package/packages/ai/src/lib/generateEntityDataStructure.js.map +1 -1
- package/packages/ai/src/lib/generateEntityScenarioData.js +734 -8
- package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
- package/packages/ai/src/lib/generateEntityScenarios.js +26 -2
- package/packages/ai/src/lib/generateEntityScenarios.js.map +1 -1
- package/packages/ai/src/lib/generateExecutionFlows.js +376 -4
- package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -1
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js +1124 -59
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js.map +1 -1
- package/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.js +194 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.js.map +1 -0
- package/packages/ai/src/lib/isolateScopes.js +39 -3
- package/packages/ai/src/lib/isolateScopes.js.map +1 -1
- package/packages/ai/src/lib/mergeJsonTypeDefinitions.js +5 -0
- package/packages/ai/src/lib/mergeJsonTypeDefinitions.js.map +1 -1
- package/packages/ai/src/lib/mergeStatements.js +70 -51
- package/packages/ai/src/lib/mergeStatements.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/collapseNullableObjects.js +97 -0
- package/packages/ai/src/lib/promptGenerators/collapseNullableObjects.js.map +1 -0
- package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js +10 -4
- package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.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 +30 -7
- package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.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 +155 -41
- package/packages/ai/src/lib/resolvePathToControllable.js.map +1 -1
- package/packages/ai/src/lib/worker/SerializableDataStructure.js +7 -0
- package/packages/ai/src/lib/worker/SerializableDataStructure.js.map +1 -1
- package/packages/ai/src/lib/worker/analyzeScopeWorker.js +94 -1
- package/packages/ai/src/lib/worker/analyzeScopeWorker.js.map +1 -1
- package/packages/analyze/index.js +1 -0
- package/packages/analyze/index.js.map +1 -1
- package/packages/analyze/src/lib/FileAnalyzer.js +60 -36
- package/packages/analyze/src/lib/FileAnalyzer.js.map +1 -1
- package/packages/analyze/src/lib/ProjectAnalyzer.js +96 -26
- package/packages/analyze/src/lib/ProjectAnalyzer.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/getNodeType.js +1 -0
- package/packages/analyze/src/lib/asts/nodes/getNodeType.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.js +14 -0
- package/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getAllEntityNodes.js +14 -0
- package/packages/analyze/src/lib/asts/sourceFiles/getAllEntityNodes.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getAllExports.js +6 -0
- package/packages/analyze/src/lib/asts/sourceFiles/getAllExports.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getImportsAnalysis.js +6 -0
- package/packages/analyze/src/lib/asts/sourceFiles/getImportsAnalysis.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getResolvedModule.js +39 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getResolvedModule.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getSourceFilesForAllImports.js +2 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getSourceFilesForAllImports.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +72 -10
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +17 -4
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/dependencyResolver.js +5 -0
- package/packages/analyze/src/lib/files/analyze/dependencyResolver.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js +2 -1
- package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js +31 -10
- package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeRemixRoute.js +3 -2
- package/packages/analyze/src/lib/files/analyzeRemixRoute.js.map +1 -1
- package/packages/analyze/src/lib/files/getImportedExports.js +11 -7
- package/packages/analyze/src/lib/files/getImportedExports.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js +880 -0
- package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js.map +1 -0
- package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js +164 -68
- package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js +75 -21
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +185 -20
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js +57 -9
- package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +542 -53
- 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/analyze/src/lib/files/setImportedExports.js +2 -1
- package/packages/analyze/src/lib/files/setImportedExports.js.map +1 -1
- package/packages/analyze/src/lib/index.js +1 -0
- package/packages/analyze/src/lib/index.js.map +1 -1
- package/packages/analyze/src/lib/utils/getFileByPath.js +12 -0
- package/packages/analyze/src/lib/utils/getFileByPath.js.map +1 -0
- package/packages/database/src/lib/analysisBranchToDb.js +1 -1
- package/packages/database/src/lib/analysisBranchToDb.js.map +1 -1
- package/packages/database/src/lib/analysisToDb.js +1 -1
- package/packages/database/src/lib/analysisToDb.js.map +1 -1
- package/packages/database/src/lib/branchToDb.js +1 -1
- package/packages/database/src/lib/branchToDb.js.map +1 -1
- package/packages/database/src/lib/commitBranchToDb.js +1 -1
- package/packages/database/src/lib/commitBranchToDb.js.map +1 -1
- package/packages/database/src/lib/commitToDb.js +1 -1
- package/packages/database/src/lib/commitToDb.js.map +1 -1
- package/packages/database/src/lib/fileToDb.js +1 -1
- package/packages/database/src/lib/fileToDb.js.map +1 -1
- package/packages/database/src/lib/kysely/db.js +11 -1
- package/packages/database/src/lib/kysely/db.js.map +1 -1
- package/packages/database/src/lib/kysely/tables/commitsTable.js +3 -0
- package/packages/database/src/lib/kysely/tables/commitsTable.js.map +1 -1
- package/packages/database/src/lib/kysely/tables/labsRequestsTable.js +35 -0
- package/packages/database/src/lib/kysely/tables/labsRequestsTable.js.map +1 -0
- package/packages/database/src/lib/loadAnalyses.js +45 -2
- package/packages/database/src/lib/loadAnalyses.js.map +1 -1
- package/packages/database/src/lib/loadAnalysis.js +8 -0
- package/packages/database/src/lib/loadAnalysis.js.map +1 -1
- package/packages/database/src/lib/loadBranch.js +11 -1
- package/packages/database/src/lib/loadBranch.js.map +1 -1
- package/packages/database/src/lib/loadCommit.js +7 -0
- package/packages/database/src/lib/loadCommit.js.map +1 -1
- package/packages/database/src/lib/loadCommits.js +22 -1
- package/packages/database/src/lib/loadCommits.js.map +1 -1
- package/packages/database/src/lib/loadEntities.js +23 -4
- package/packages/database/src/lib/loadEntities.js.map +1 -1
- package/packages/database/src/lib/loadEntityBranches.js +9 -0
- package/packages/database/src/lib/loadEntityBranches.js.map +1 -1
- package/packages/database/src/lib/projectToDb.js +1 -1
- package/packages/database/src/lib/projectToDb.js.map +1 -1
- package/packages/database/src/lib/saveFiles.js +1 -1
- package/packages/database/src/lib/saveFiles.js.map +1 -1
- package/packages/database/src/lib/scenarioToDb.js +1 -1
- package/packages/database/src/lib/scenarioToDb.js.map +1 -1
- package/packages/database/src/lib/updateCommitMetadata.js +5 -4
- package/packages/database/src/lib/updateCommitMetadata.js.map +1 -1
- package/packages/types/index.js.map +1 -1
- package/packages/utils/src/lib/fs/rsyncCopy.js +93 -2
- package/packages/utils/src/lib/fs/rsyncCopy.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 +8 -76
- package/codeyam-cli/src/webserver/build/client/assets/EntityItem-vauWK972.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-DzJRkCkr.js +0 -11
- package/codeyam-cli/src/webserver/build/client/assets/_index-Be83mo_j.js +0 -11
- package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-BN6wu6Y-.js +0 -37
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-Bn6aCAy_.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/files-DKyMFI90.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/globals-DTTQ3gY7.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-22590fcf.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/root-BsAarjAM.js +0 -57
- package/codeyam-cli/src/webserver/build/client/assets/settings-B2eDuBj8.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/index-BND5I5fv.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-CFXnd7MG.js +0 -228
- package/codeyam-cli/templates/codeyam:diagnose.md +0 -625
|
@@ -1,5 +1,97 @@
|
|
|
1
|
-
import { spawn } from 'child_process';
|
|
1
|
+
import { spawn, execSync } from 'child_process';
|
|
2
|
+
import { existsSync, readdirSync, rmSync } from 'fs';
|
|
3
|
+
import { join } from 'path';
|
|
4
|
+
/**
|
|
5
|
+
* Try to use APFS copy-on-write clones on macOS for near-instant directory copies.
|
|
6
|
+
* Falls back to rsync on non-macOS or if the clone fails.
|
|
7
|
+
*
|
|
8
|
+
* Returns true if the clone succeeded (caller can skip rsync).
|
|
9
|
+
*/
|
|
10
|
+
function tryApfsClone({ sourcePath, destinationPath, excludes, silent, }) {
|
|
11
|
+
if (process.platform !== 'darwin')
|
|
12
|
+
return false;
|
|
13
|
+
// APFS clone requires the destination to not exist.
|
|
14
|
+
// If it exists and is empty, remove it so we can clone into it.
|
|
15
|
+
if (existsSync(destinationPath)) {
|
|
16
|
+
try {
|
|
17
|
+
const contents = readdirSync(destinationPath);
|
|
18
|
+
if (contents.length > 0) {
|
|
19
|
+
// Destination is non-empty — can't use clone, fall back to rsync
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
rmSync(destinationPath, { recursive: true });
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
// cp -c -R: APFS copy-on-write clone (faster than rsync, avoids data copy)
|
|
30
|
+
execSync(`cp -c -R "${sourcePath}" "${destinationPath}"`, {
|
|
31
|
+
stdio: 'pipe',
|
|
32
|
+
timeout: 300000, // 5 min safety timeout
|
|
33
|
+
});
|
|
34
|
+
// Remove excluded items from the clone
|
|
35
|
+
for (const exclude of excludes) {
|
|
36
|
+
if (exclude.includes('*')) {
|
|
37
|
+
// Glob pattern — use shell expansion
|
|
38
|
+
try {
|
|
39
|
+
execSync(`rm -rf "${join(destinationPath, exclude)}"`, {
|
|
40
|
+
stdio: 'pipe',
|
|
41
|
+
shell: '/bin/sh',
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
// Glob matched nothing — fine
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
const excludePath = join(destinationPath, exclude);
|
|
50
|
+
if (existsSync(excludePath)) {
|
|
51
|
+
rmSync(excludePath, { recursive: true, force: true });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (!silent) {
|
|
56
|
+
console.log(`Directory cloned (APFS CoW) from ${sourcePath} to ${destinationPath}`);
|
|
57
|
+
}
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
// Clone failed (cross-volume, non-APFS, etc.) — fall back to rsync
|
|
62
|
+
// Clean up any partial clone
|
|
63
|
+
if (existsSync(destinationPath)) {
|
|
64
|
+
try {
|
|
65
|
+
rmSync(destinationPath, { recursive: true });
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
// Best effort cleanup
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
2
74
|
export default async function rsyncCopy({ sourcePath, destinationPath, excludes = [], keepExisting = false, silent = false, extraArgs = [], }) {
|
|
75
|
+
const startTime = Date.now();
|
|
76
|
+
// On macOS, try APFS copy-on-write clone first (near-instant).
|
|
77
|
+
// Skip when extraArgs are provided since those are rsync-specific flags
|
|
78
|
+
// that the clone path can't honor.
|
|
79
|
+
if (!keepExisting && extraArgs.length === 0) {
|
|
80
|
+
const cloned = tryApfsClone({
|
|
81
|
+
sourcePath,
|
|
82
|
+
destinationPath,
|
|
83
|
+
excludes,
|
|
84
|
+
silent,
|
|
85
|
+
});
|
|
86
|
+
if (cloned) {
|
|
87
|
+
if (!silent) {
|
|
88
|
+
const duration = ((Date.now() - startTime) / 1000).toFixed(1);
|
|
89
|
+
console.log(`Directory synced from ${sourcePath} to ${destinationPath} [Time: ${duration}s]`);
|
|
90
|
+
}
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// Fall back to rsync
|
|
3
95
|
return new Promise((resolve, reject) => {
|
|
4
96
|
const source = sourcePath.endsWith('/') ? sourcePath : `${sourcePath}/`;
|
|
5
97
|
const dest = destinationPath.endsWith('/')
|
|
@@ -16,7 +108,6 @@ export default async function rsyncCopy({ sourcePath, destinationPath, excludes
|
|
|
16
108
|
rsyncArgs.push(`--exclude=${exclude}`);
|
|
17
109
|
}
|
|
18
110
|
rsyncArgs.push(source, dest);
|
|
19
|
-
const startTime = Date.now();
|
|
20
111
|
const rsyncProcess = spawn('rsync', rsyncArgs);
|
|
21
112
|
rsyncProcess.on('exit', (code) => {
|
|
22
113
|
if (code === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rsyncCopy.js","sourceRoot":"","sources":["../../../../../../../packages/utils/src/lib/fs/rsyncCopy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"rsyncCopy.js","sourceRoot":"","sources":["../../../../../../../packages/utils/src/lib/fs/rsyncCopy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B;;;;;GAKG;AACH,SAAS,YAAY,CAAC,EACpB,UAAU,EACV,eAAe,EACf,QAAQ,EACR,MAAM,GAMP;IACC,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAEhD,oDAAoD;IACpD,gEAAgE;IAChE,IAAI,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;QAChC,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,WAAW,CAAC,eAAe,CAAC,CAAC;YAC9C,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACxB,iEAAiE;gBACjE,OAAO,KAAK,CAAC;YACf,CAAC;YACD,MAAM,CAAC,eAAe,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC/C,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,IAAI,CAAC;QACH,2EAA2E;QAC3E,QAAQ,CAAC,aAAa,UAAU,MAAM,eAAe,GAAG,EAAE;YACxD,KAAK,EAAE,MAAM;YACb,OAAO,EAAE,MAAO,EAAE,uBAAuB;SAC1C,CAAC,CAAC;QAEH,uCAAuC;QACvC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC1B,qCAAqC;gBACrC,IAAI,CAAC;oBACH,QAAQ,CAAC,WAAW,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,GAAG,EAAE;wBACrD,KAAK,EAAE,MAAM;wBACb,KAAK,EAAE,SAAS;qBACjB,CAAC,CAAC;gBACL,CAAC;gBAAC,MAAM,CAAC;oBACP,8BAA8B;gBAChC,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,MAAM,WAAW,GAAG,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;gBACnD,IAAI,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;oBAC5B,MAAM,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;gBACxD,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,CAAC,GAAG,CACT,oCAAoC,UAAU,OAAO,eAAe,EAAE,CACvE,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,mEAAmE;QACnE,6BAA6B;QAC7B,IAAI,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;YAChC,IAAI,CAAC;gBACH,MAAM,CAAC,eAAe,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAC/C,CAAC;YAAC,MAAM,CAAC;gBACP,sBAAsB;YACxB,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,SAAS,CAAC,EACtC,UAAU,EACV,eAAe,EACf,QAAQ,GAAG,EAAE,EACb,YAAY,GAAG,KAAK,EACpB,MAAM,GAAG,KAAK,EACd,SAAS,GAAG,EAAE,GAQf;IACC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAE7B,+DAA+D;IAC/D,wEAAwE;IACxE,mCAAmC;IACnC,IAAI,CAAC,YAAY,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5C,MAAM,MAAM,GAAG,YAAY,CAAC;YAC1B,UAAU;YACV,eAAe;YACf,QAAQ;YACR,MAAM;SACP,CAAC,CAAC;QACH,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,MAAM,QAAQ,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;gBAC9D,OAAO,CAAC,GAAG,CACT,yBAAyB,UAAU,OAAO,eAAe,WAAW,QAAQ,IAAI,CACjF,CAAC;YACJ,CAAC;YACD,OAAO;QACT,CAAC;IACH,CAAC;IAED,qBAAqB;IACrB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,GAAG,CAAC;QACxE,MAAM,IAAI,GAAG,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC;YACxC,CAAC,CAAC,eAAe;YACjB,CAAC,CAAC,GAAG,eAAe,GAAG,CAAC;QAE1B,MAAM,SAAS,GAAG,CAAC,IAAI,CAAC,CAAC;QAEzB,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,SAAS,CAAC,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;QACxC,CAAC;QAED,wCAAwC;QACxC,SAAS,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC;QAE7B,8BAA8B;QAC9B,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,SAAS,CAAC,IAAI,CAAC,aAAa,OAAO,EAAE,CAAC,CAAC;QACzC,CAAC;QAED,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAE7B,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAE/C,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;YAC/B,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;gBACf,IAAI,CAAC,MAAM,EAAE,CAAC;oBACZ,MAAM,QAAQ,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;oBAC9D,OAAO,CAAC,GAAG,CACT,yBAAyB,UAAU,OAAO,eAAe,WAAW,QAAQ,IAAI,CACjF,CAAC;gBACJ,CAAC;gBACD,OAAO,EAAE,CAAC;YACZ,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,IAAI,KAAK,CAAC,+BAA+B,IAAI,EAAE,CAAC,CAAC,CAAC;YAC3D,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YACjC,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;YACxC,CAAC;YACD,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,10 +1,36 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Simple hash function for generating unique suffixes.
|
|
3
|
+
* Uses djb2 algorithm - fast and produces good distribution.
|
|
4
|
+
* Not cryptographically secure, but sufficient for filename uniqueness.
|
|
5
|
+
*/
|
|
6
|
+
function simpleHash(str) {
|
|
7
|
+
let hash = 5381;
|
|
8
|
+
for (let i = 0; i < str.length; i++) {
|
|
9
|
+
hash = (hash * 33) ^ str.charCodeAt(i);
|
|
10
|
+
}
|
|
11
|
+
// Convert to unsigned 32-bit and then to hex
|
|
12
|
+
return (hash >>> 0).toString(16).padStart(8, '0');
|
|
13
|
+
}
|
|
14
|
+
export default function safeFileName(name, options = {}) {
|
|
15
|
+
const { maxLength } = options;
|
|
2
16
|
// Replace unsafe characters with underscores, preserving original casing
|
|
3
17
|
// Then trim leading/trailing underscores to avoid malformed route segments
|
|
4
|
-
|
|
18
|
+
let safeSlug = name.replace(/[^a-zA-Z0-9_]+/g, '_').replace(/^_+|_+$/g, '');
|
|
5
19
|
if (!safeSlug)
|
|
6
20
|
return '';
|
|
7
21
|
// Ensure it starts with a capital letter (for consistency with Remix routes)
|
|
8
|
-
|
|
22
|
+
safeSlug = safeSlug.slice(0, 1).toUpperCase() + safeSlug.slice(1);
|
|
23
|
+
// If maxLength is specified and the slug exceeds it, truncate and add a hash
|
|
24
|
+
if (maxLength && safeSlug.length > maxLength) {
|
|
25
|
+
// Create an 8-character hash of the full name for uniqueness
|
|
26
|
+
const hash = simpleHash(name);
|
|
27
|
+
// Reserve space for underscore + hash (9 chars total)
|
|
28
|
+
const truncateLength = maxLength - 9;
|
|
29
|
+
const truncated = safeSlug.substring(0, truncateLength);
|
|
30
|
+
// Remove trailing underscore if present (from mid-word truncation)
|
|
31
|
+
const cleanTruncated = truncated.replace(/_+$/, '');
|
|
32
|
+
safeSlug = `${cleanTruncated}_${hash}`;
|
|
33
|
+
}
|
|
34
|
+
return safeSlug;
|
|
9
35
|
}
|
|
10
36
|
//# sourceMappingURL=safeFileName.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safeFileName.js","sourceRoot":"","sources":["../../../../../../packages/utils/src/lib/safeFileName.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,YAAY,
|
|
1
|
+
{"version":3,"file":"safeFileName.js","sourceRoot":"","sources":["../../../../../../packages/utils/src/lib/safeFileName.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,SAAS,UAAU,CAAC,GAAW;IAC7B,IAAI,IAAI,GAAG,IAAI,CAAC;IAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACpC,IAAI,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC;IACD,6CAA6C;IAC7C,OAAO,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACpD,CAAC;AAWD,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,IAAY,EACZ,UAA+B,EAAE;IAEjC,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAE9B,yEAAyE;IACzE,2EAA2E;IAC3E,IAAI,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAE5E,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,CAAC;IAEzB,6EAA6E;IAC7E,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAElE,6EAA6E;IAC7E,IAAI,SAAS,IAAI,QAAQ,CAAC,MAAM,GAAG,SAAS,EAAE,CAAC;QAC7C,6DAA6D;QAC7D,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;QAE9B,sDAAsD;QACtD,MAAM,cAAc,GAAG,SAAS,GAAG,CAAC,CAAC;QACrC,MAAM,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;QAExD,mEAAmE;QACnE,MAAM,cAAc,GAAG,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAEpD,QAAQ,GAAG,GAAG,cAAc,IAAI,IAAI,EAAE,CAAC;IACzC,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1,81 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Post-install script
|
|
5
|
-
*
|
|
4
|
+
* Post-install script — now a no-op.
|
|
5
|
+
* Analyzer finalization is deferred to `codeyam setup-simulations`.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
console.log('🚀 CodeYam CLI: Finalizing analyzer template...');
|
|
16
|
-
console.log('📁 Template path:', analyzerTemplatePath);
|
|
17
|
-
|
|
18
|
-
async function execAsync(command, args, workingDir) {
|
|
19
|
-
return new Promise((resolve, reject) => {
|
|
20
|
-
console.log(`Running: ${command} ${args.join(' ')}`);
|
|
21
|
-
const process = spawn(command, args, {
|
|
22
|
-
cwd: workingDir,
|
|
23
|
-
stdio: 'inherit',
|
|
24
|
-
shell: true,
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
process.on('close', (code) => {
|
|
28
|
-
if (code === 0) {
|
|
29
|
-
resolve();
|
|
30
|
-
} else {
|
|
31
|
-
reject(
|
|
32
|
-
new Error(
|
|
33
|
-
`Command failed with exit code ${code}: ${command} ${args.join(' ')}`,
|
|
34
|
-
),
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
process.on('error', (error) => {
|
|
40
|
-
reject(new Error(`Failed to start command: ${error.message}`));
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
async function finalizeAnalyzerTemplate() {
|
|
46
|
-
try {
|
|
47
|
-
console.log('📦 Installing analyzer dependencies...');
|
|
48
|
-
// Use --include=dev to ensure devDependencies (like @types/node) are installed
|
|
49
|
-
// even when running from a global install context
|
|
50
|
-
await execAsync('npm', ['install', '--include=dev'], analyzerTemplatePath);
|
|
51
|
-
|
|
52
|
-
console.log('🎭 Installing Playwright browsers...');
|
|
53
|
-
await execAsync('npx', ['playwright', 'install'], analyzerTemplatePath);
|
|
54
|
-
|
|
55
|
-
console.log('🔨 Building analyzer template...');
|
|
56
|
-
await execAsync('npm', ['run', 'build'], analyzerTemplatePath);
|
|
57
|
-
|
|
58
|
-
// Create finalization marker
|
|
59
|
-
const fs = require('fs');
|
|
60
|
-
const markerPath = path.join(analyzerTemplatePath, '.finalized');
|
|
61
|
-
fs.writeFileSync(markerPath, new Date().toISOString());
|
|
62
|
-
|
|
63
|
-
console.log('✅ CodeYam CLI analyzer ready!');
|
|
64
|
-
console.log('');
|
|
65
|
-
console.log('You can now use: codeyam init');
|
|
66
|
-
} catch (error) {
|
|
67
|
-
console.error('❌ Failed to finalize CodeYam CLI analyzer:');
|
|
68
|
-
console.error(error.message);
|
|
69
|
-
console.error('');
|
|
70
|
-
console.error('This means the CodeYam CLI installation is incomplete.');
|
|
71
|
-
console.error('You can try manually running:');
|
|
72
|
-
console.error(` cd ${analyzerTemplatePath}`);
|
|
73
|
-
console.error(' npm install');
|
|
74
|
-
console.error(' npx playwright install');
|
|
75
|
-
console.error(' npm run build');
|
|
76
|
-
console.error('');
|
|
77
|
-
process.exit(1);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
finalizeAnalyzerTemplate();
|
|
8
|
+
console.log('');
|
|
9
|
+
console.log(' CodeYam CLI installed successfully!');
|
|
10
|
+
console.log('');
|
|
11
|
+
console.log(' Run "codeyam init" to set up your project.');
|
|
12
|
+
console.log(' Run "codeyam setup-simulations" to enable visual simulations (optional).');
|
|
13
|
+
console.log('');
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as C,r as u,j as e,L as N}from"./chunk-EPOLDU6W-DdQKK6on.js";import{u as E}from"./useToast-KKw5kTn-.js";import{f as T,g as F}from"./fileTableUtils-DD3SDH7t.js";import{T as D}from"./TruncatedFilePath-D36O1rzU.js";import{S as k}from"./SafeScreenshot-CQifa1n-.js";import{L as P}from"./LibraryFunctionPreview-L75Wvqgw.js";import{T as B}from"./triangle-alert-BDz7kbVA.js";import{E as v}from"./EntityTypeIcon-BwdQv49w.js";import{E as I}from"./EntityTypeBadge-COi5OvsN.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,11 +0,0 @@
|
|
|
1
|
-
import{r as t,c as D,j as e}from"./chunk-EPOLDU6W-DdQKK6on.js";import{c as v}from"./createLucideIcon-Do4ZLUYa.js";import{C as $}from"./circle-check-Dmr2bb1R.js";import{T as j}from"./triangle-alert-BDz7kbVA.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 T=[["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"}]],R=v("bug",T);/**
|
|
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 E=[["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"}]],N=v("settings",E);function F(a){return a.scenarioName&&a.entityName?`${a.entityName} → "${a.scenarioName}"`:a.entityName?a.entityName:a.scenarioId?`Scenario: ${a.scenarioId.slice(0,8)}...`:a.entitySha?`Entity: ${a.entitySha.slice(0,8)}...`:"General feedback"}function Y({isOpen:a,onClose:k,context:r,defaultEmail:w="",screenshotDataUrl:d}){const[u,h]=t.useState(""),[x,S]=t.useState(w),[m,y]=t.useState(!1),[l,g]=t.useState(!1),[C,b]=t.useState(null),[o,p]=t.useState(null),i=D(),n=i.state!=="idle";if(i.data&&!l&&!o){const s=i.data;s.success&&s.reportId?(g(!0),b(s.reportId)):s.error&&p(s.error)}const I=async()=>{p(null);const s=new FormData;if(s.append("issueType","other"),s.append("description",u),s.append("email",x),s.append("source",r.source),s.append("entitySha",r.entitySha||""),s.append("scenarioId",r.scenarioId||""),s.append("analysisId",r.analysisId||""),s.append("currentUrl",r.currentUrl),s.append("entityName",r.entityName||""),s.append("entityType",r.entityType||""),s.append("scenarioName",r.scenarioName||""),s.append("errorMessage",r.errorMessage||""),d)try{const z=await(await fetch(d)).blob();s.append("screenshot",z,"screenshot.jpg")}catch(f){console.error("Failed to convert screenshot:",f)}i.submit(s,{method:"post",action:"/api/generate-report",encType:"multipart/form-data"})},c=()=>{h(""),y(!1),g(!1),b(null),p(null),k()},M=s=>{s.key==="Escape"&&c()};return a?e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center p-4 z-50",onKeyDown:M,children:e.jsxs("div",{className:"bg-white rounded-lg max-w-lg w-full p-6 shadow-xl",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[n?e.jsx("div",{className:"animate-spin",children:e.jsx(N,{size:24,style:{strokeWidth:1.5}})}):l?e.jsx($,{size:24,style:{color:"#10B981",strokeWidth:1.5}}):e.jsx(R,{size:24,style:{color:"#005C75",strokeWidth:1.5}}),e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:l?"Report Submitted":"Report Issue"})]}),e.jsx("button",{onClick:c,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"})})})]}),l?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:C})]})]}),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:c,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:`${r.source}${r.entitySha?` • Entity: ${r.entitySha}`:""}${r.scenarioId?` • Scenario: ${r.scenarioId}`:""}${r.analysisId?` • Analysis: ${r.analysisId}`:""}`,children:F(r)}),e.jsx("button",{type:"button",onClick:()=>y(!m),className:"text-xs text-gray-500 hover:text-gray-700 underline cursor-pointer",children:m?"Hide":"Details"})]}),m&&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:"})," ",r.source]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400",children:"URL:"})," ",r.currentUrl]}),r.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:r.entitySha})]}),r.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:r.scenarioId})]}),r.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:r.analysisId})]})]})]}),d&&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:d,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:u,onChange:s=>h(s.target.value),placeholder:"Optional: Describe what you expected vs what happened...",rows:4,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"})]}),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:x,onChange:s=>S(s.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-6 p-3 bg-amber-50 rounded-lg border border-amber-200 flex gap-2",children:[e.jsx(j,{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."})]})]}),n&&e.jsx("div",{className:"mb-4 text-center",children:e.jsx("p",{className:"text-sm text-gray-600",children:i.formData?"Uploading report...":"Creating archive..."})}),o&&e.jsxs("div",{className:"mb-4 p-3 bg-red-50 rounded-lg border border-red-200 flex gap-2",children:[e.jsx(j,{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:o})]})]}),e.jsxs("div",{className:"flex gap-3 justify-end",children:[e.jsx("button",{onClick:c,disabled:n,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 I(),disabled:n,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:n?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"animate-spin",children:e.jsx(N,{size:16,style:{strokeWidth:1.5}})}),"Submitting..."]}):o?"Try Again":"Submit Report"})]})]})]})}):null}export{R as B,Y as R,N as S};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{r as h,j as e,L as p,w as se,u as te,c as ne,e as ae}from"./chunk-EPOLDU6W-DdQKK6on.js";import{u as le}from"./useLastLogLine-BUm0UVJm.js";import{u as re}from"./useToast-KKw5kTn-.js";import{u as oe}from"./useReportContext-CkIOKTrZ.js";import{L as ie}from"./LogViewer-CrNkmy4i.js";import{I as k,C as U,E as ce}from"./EntityTypeIcon-BwdQv49w.js";import{S as Y}from"./SafeScreenshot-CQifa1n-.js";import{c as P}from"./createLucideIcon-Do4ZLUYa.js";import{C as de}from"./circle-check-Dmr2bb1R.js";import{L as C}from"./loader-circle-BsPXJ81F.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 xe=[["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"}]],me=P("folder-open",xe);/**
|
|
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 he=[["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=P("zap",he);function ue({recentSimulations:u}){const y=h.useMemo(()=>{const a=new Map;return u.forEach(n=>{const d=n.entitySha,c=a.get(d);c?c.push(n):a.set(d,[n])}),Array.from(a.entries()).map(([n,d])=>({entitySha:n,entityName:d[0].entityName,scenarios:d}))},[u]);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:u.length>0?`Latest ${u.length} captured screenshot${u.length!==1?"s":""}`:"No simulations captured yet"})]})}),u.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-6 mb-5",children:y.map(a=>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(k,{size:16,style:{color:"#8B5CF6"}})}),e.jsx(p,{to:`/entity/${a.entitySha}`,className:"text-sm font-semibold text-gray-900 no-underline hover:text-gray-700 transition-colors",children:a.entityName})]}),e.jsx("div",{className:"grid grid-cols-4 gap-3",children:a.scenarios.map((n,d)=>e.jsx(p,{to:n.scenarioId?`/entity/${n.entitySha}/scenarios/${n.scenarioId}`:`/entity/${n.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:n.scenarioName,children:e.jsx(Y,{screenshotPath:n.screenshotPath,alt:n.scenarioName,className:"max-w-full max-h-full object-contain object-center"})},n.scenarioId||`${n.entitySha}-${d}`))})]},a.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:a=>a.currentTarget.style.backgroundColor="#EEF4F8",onMouseLeave:a=>a.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(k,{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 ge="/assets/codeyam-name-logo-CvKwUgHo.svg",Ee=()=>[{title:"Dashboard - CodeYam"},{name:"description",content:"CodeYam project dashboard"}],Fe=se(function(){var _,H;const{stats:y,uncommittedFiles:a,uncommittedEntitiesList:n,recentSimulations:d,visualEntitiesForSimulation:c,projectSlug:f,queueState:$,currentCommit:S}=te(),x=ne(),q=ae(),{showToast:b}=re();oe({source:"dashboard"});const[Q,Z]=h.useState(new Set),[m,G]=h.useState(null),[O,B]=h.useState(!1),[M,E]=h.useState(!1),{lastLine:F,isCompleted:D}=le(f,!!m),{simulatingEntity:A,scenarios:N,scenarioStatuses:K,allScenariosCaptured:T}=h.useMemo(()=>{var r,w;const s={simulatingEntity:null,scenarios:[],scenarioStatuses:[],allScenariosCaptured:!1};if(!m)return s;const i=c==null?void 0:c.find(z=>z.sha===m);if(!i)return s;const l=(r=i.analyses)==null?void 0:r[0],o=(l==null?void 0:l.scenarios)||[],t=((w=l==null?void 0:l.status)==null?void 0:w.scenarios)||[],j=t.filter(z=>z.screenshotFinishedAt).length,g=o.length>0&&j===o.length;return{simulatingEntity:i,scenarios:o,scenarioStatuses:t,allScenariosCaptured:g}},[m,c]);h.useEffect(()=>{(D||T)&&G(null)},[D,T]);const L=(_=S==null?void 0:S.metadata)==null?void 0:_.currentRun,V=new Set((L==null?void 0:L.currentEntityShas)||[]),I=new Set($.jobs.flatMap(s=>s.entityShas||[])),R=new Set(((H=$.currentlyExecuting)==null?void 0:H.entityShas)||[]),W=n.filter(s=>s.entityType==="visual"||s.entityType==="library"),v=W.filter(s=>!V.has(s.sha)&&!I.has(s.sha)&&!R.has(s.sha)),X=()=>{if(v.length===0){b("All entities are already queued or analyzing","info",3e3);return}const s=v.map(i=>i.sha);E(!0),b(`Starting analysis for ${v.length} entities...`,"info",3e3),x.submit({entityShas:s.join(",")},{method:"post",action:"/api/analyze"})};h.useEffect(()=>{if(x.state==="idle"&&x.data){const s=x.data;s.success?(console.log("[Analyze All] Success:",s.message),b(`Analysis started for ${s.entityCount} entities in ${s.fileCount} files. Watch the logs for progress.`,"success",6e3),E(!1)):s.error&&(console.error("[Analyze All] Error:",s.error),b(`Error: ${s.error}`,"error",8e3),E(!1))}},[x.state,x.data,b]);const J=s=>{Z(i=>{const l=new Set(i);return l.has(s)?l.delete(s):l.add(s),l})},ee=[{label:"Total Entities",value:y.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:y.entitiesWithAnalyses,iconType:"check",link:"/simulations",color:"#10B981",tooltip:"Entities that have been analyzed by CodeYam and have generated scenarios."},{label:"Visual Components",value:y.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:y.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:ge,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:f?f.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,i)=>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(me,{size:20,style:{color:s.color}}),s.iconType==="check"&&e.jsx(de,{size:20,style:{color:s.color}}),s.iconType==="image"&&e.jsx(k,{size:20,style:{color:s.color}}),s.iconType==="code-xml"&&e.jsx(U,{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 →"})]})]})},i))}),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:a.length>0?`${a.length} file${a.length!==1?"s":""} with ${n.length} uncommitted entit${n.length!==1?"ies":"y"}`:"No uncommitted changes detected"})]}),W.length>0&&e.jsx("button",{onClick:X,disabled:x.state!=="idle"||M||v.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...":v.length===0?"All Queued":"Analyze All"})]}),a.length>0?e.jsx("div",{className:"flex flex-col gap-3",children:a.map(([s,i])=>{const l=Q.has(s),o=i.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:l?"▼":"▶"}),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:[o.length," entit",o.length!==1?"ies":"y"]})]})]})}),l&&e.jsx("div",{className:"border-t border-gray-200 bg-gray-50 p-3 flex flex-col gap-2",children:o.length>0?o.map(t=>{const j=V.has(t.sha),g=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:r=>r.currentTarget.style.borderColor="#005C75",onMouseLeave:r=>r.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(k,{size:16,style:{color:"#8B5CF6"}}),t.entityType==="library"&&e.jsx(U,{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:[j&&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(C,{size:14,className:"animate-spin"}),"Analyzing..."]}),!j&&g&&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"}),!j&&!g&&e.jsx("button",{onClick:r=>{r.preventDefault(),r.stopPropagation(),b(`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:r=>r.currentTarget.style.backgroundColor="#004560",onMouseLeave:r=>r.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(ue,{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:[A&&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 ",A.name]}),e.jsx("div",{className:"text-[13px] text-gray-500 font-mono overflow-hidden text-ellipsis whitespace-nowrap",children:A.filePath})]})]})}),T?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 (",N.length," scenario",N.length!==1?"s":"",")"]})]}):F?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(C,{size:18,className:"animate-spin shrink-0"}),e.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap font-mono text-xs",title:F,children:F}),f&&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(C,{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(C,{size:18,className:"animate-spin shrink-0"}),e.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap",children:"Starting analysis..."})]}),N.length>0&&e.jsx("div",{className:"flex gap-2 flex-wrap p-4 bg-white border-t border-gray-200",children:N.slice(0,8).map((s,i)=>{var g,r;const l=(r=(g=s.metadata)==null?void 0:g.screenshotPaths)==null?void 0:r[0],o=K.find(w=>w.name===s.name),t=(o==null?void 0:o.screenshotStartedAt)&&!(o!=null&&o.screenshotFinishedAt);return l?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:l,alt:s.name,title:s.name,className:"max-w-full max-h-full object-contain object-center"})},i):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:`Capturing ${s.name}...`,children:e.jsx("span",{className:t?"animate-pulse":"text-gray-400",children:t?"⋯":"⏹️"})},i)})})]})]})]}),O&&f&&e.jsx(ie,{projectSlug:f,onClose:()=>B(!1)})]})})});export{Fe as default,Ee as meta};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import{j as e,w as G,u as X,h as Z,r as D,L as m,e as Q}from"./chunk-EPOLDU6W-DdQKK6on.js";import{L as R}from"./LogViewer-CrNkmy4i.js";import{u as ee}from"./useLastLogLine-BUm0UVJm.js";import{u as se}from"./useReportContext-CkIOKTrZ.js";import{E as q}from"./EntityTypeIcon-BwdQv49w.js";import{E as Y}from"./EntityTypeBadge-COi5OvsN.js";import{S as J}from"./SafeScreenshot-CQifa1n-.js";import{L as te}from"./LoadingDots-C53WM8qn.js";import{L as oe}from"./loader-circle-BsPXJ81F.js";import{c as M}from"./createLucideIcon-Do4ZLUYa.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 ie=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],re=M("ban",ie);/**
|
|
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 le=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]],ae=M("circle-pause",le);/**
|
|
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 ne=[["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 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],ce=M("file-code",ne);/**
|
|
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 de=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],xe=M("grip-vertical",de);/**
|
|
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 he=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],pe=M("list-todo",he);/**
|
|
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 fe=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],ge=M("pause",fe),me={analyzer:{bgColor:"#e1e1e1",textColor:"#3e3e3e",borderColor:"#e1e1e1"},capture:{bgColor:"#e1e1e1",textColor:"#3e3e3e",borderColor:"#e1e1e1"},running:{bgColor:"#e8ffe6",textColor:"#00925d",borderColor:"#c3f3bf"},error:{bgColor:"#fee2e2",textColor:"#991b1b",borderColor:"#fecaca"}};function V({variant:l,pid:s,label:S,className:h=""}){const n=me[l],r=S||(l==="analyzer"&&s?`Analyzer: ${s}`:l==="capture"&&s?`Capture: ${s}`:l==="running"?"Running":l==="error"?"Error":"");return e.jsx("div",{className:`inline-flex items-center justify-center px-[8px] rounded-[4px] ${h}`,style:{backgroundColor:n.bgColor,borderWidth:"1px",borderStyle:"solid",borderColor:n.borderColor,height:"20px"},children:e.jsx("span",{className:"font-['IBM_Plex_Sans']",style:{fontSize:"10px",fontWeight:400,lineHeight:"15px",color:n.textColor},children:r})})}function ye({activeTab:l,hasCurrentActivity:s,queuedCount:S,historicCount:h}){const n=[{id:"current",label:"Current Activity",hasContent:s,count:s?1:null},{id:"queued",label:"Queued Activity",hasContent:S>0,count:S},{id:"historic",label:"Historic Activity",hasContent:h>0,count:h}];return e.jsx("div",{className:"border-b border-gray-200 mb-6",children:e.jsx("nav",{className:"flex gap-8",children:n.map(r=>{const a=l===r.id;return e.jsx(m,{to:r.id==="current"?"/activity":`/activity/${r.id}`,className:`
|
|
32
|
-
relative pb-4 px-2 text-sm transition-colors cursor-pointer
|
|
33
|
-
${a?"font-medium border-b-2":"font-normal hover:text-gray-700"}
|
|
34
|
-
`,style:a?{color:"#005C75",borderColor:"#005C75"}:{color:"#9ca3af"},children:e.jsxs("span",{className:"flex items-center gap-2",children:[r.label,r.count!==null&&r.count>0&&e.jsx("span",{className:`inline-flex items-center justify-center px-2 py-0.5 text-xs font-semibold rounded-full ${a?"bg-[#cbf3fa] text-[#005c75]":"bg-[#e1e1e1] text-[#3e3e3e]"}`,children:r.count}),r.count===null&&r.hasContent&&e.jsx("span",{className:`
|
|
35
|
-
inline-block w-2 h-2 rounded-full
|
|
36
|
-
${a?"":"bg-gray-400"}
|
|
37
|
-
`,style:a?{backgroundColor:"#005C75"}:{}})]})},r.id)})})})}function ue({currentlyExecuting:l,currentRun:s,state:S,projectSlug:h,commitSha:n,onShowLogs:r,recentCompletedEntities:a,hasMoreCompletedRuns:c,currentEntityScenarios:v,currentEntityForScenarios:y,currentAnalysisStatus:u}){var I,_,P,U;const[N,C]=D.useState({}),[T,L]=D.useState({isKilling:!1,current:0,total:0}),$=Q(),W=!!l,z=(l==null?void 0:l.entities)||[],t=!!(s!=null&&s.analysisCompletedAt),d=t&&!!(s!=null&&s.capturePid),f=!t,F=W,w=v||[],{lastLine:b}=ee(h,F);D.useEffect(()=>{if(!s)return;const o=[s.analyzerPid,s.capturePid].filter(i=>!!i);if(o.length===0)return;let p=!0;const k=async()=>{try{const A=await(await fetch(`/api/process-status?pids=${o.join(",")}`)).json();if(A.processes&&p){const E={};A.processes.forEach(g=>{E[g.pid]={isRunning:g.isRunning,processName:g.processName}}),C(E)}}catch(i){p&&console.error("Failed to fetch process statuses:",i)}};k();const x=setInterval(()=>void k(),5e3);return()=>{p=!1,clearInterval(x)}},[s==null?void 0:s.analyzerPid,s==null?void 0:s.capturePid]);const j=z==null?void 0:z[0];return e.jsxs("div",{className:"flex flex-col gap-[45px]",children:[F?e.jsxs("div",{className:"rounded-[10px] p-[15px]",style:{backgroundColor:"#f6f9fc",border:"1px solid #e0e9ec"},children:[e.jsxs("div",{className:"flex items-center gap-2 mb-[15px]",children:[e.jsx(oe,{size:14,strokeWidth:2.5,className:"animate-spin",style:{color:"#005c75"}}),e.jsx("span",{className:"font-medium",style:{fontSize:"14px",lineHeight:"18px",color:"#005c75"},children:d?"Capturing...":"Analyzing..."})]}),j&&e.jsxs("div",{className:"bg-white border border-[#e1e1e1] rounded-[4px] mb-[15px]",style:{height:"60px",padding:"0 15px",display:"flex",alignItems:"center",justifyContent:"space-between",boxShadow:"0 1px 3px 0 rgb(0 0 0 / 0.1)"},children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{children:e.jsx(q,{type:j.entityType||"other",size:"large"})}),e.jsxs("div",{className:"flex flex-col gap-[1px]",children:[e.jsxs("div",{className:"flex items-center gap-[14px]",children:[e.jsx(m,{to:`/entity/${j.sha}`,className:"hover:underline cursor-pointer",style:{fontSize:"14px",lineHeight:"18px",fontWeight:500,color:"#000"},children:j.name}),j.entityType&&e.jsx(Y,{type:j.entityType})]}),e.jsx("div",{className:"truncate font-mono",style:{fontSize:"12px",lineHeight:"15px",color:"#8e8e8e",width:"422px"},title:j.filePath,children:j.filePath})]})]}),e.jsx("button",{onClick:r,className:"px-[10px] rounded-[4px] transition-colors whitespace-nowrap cursor-pointer",style:{backgroundColor:"#e0e9ec",color:"#005c75",fontSize:"10px",lineHeight:"22px",fontWeight:600},children:"View Logs"})]}),d&&w&&w.length>0&&y&&e.jsx("div",{className:"flex gap-[10px] overflow-x-auto mb-[15px]",children:w.map(o=>{var g,B,O,K;if(!o.id)return null;const p=(B=(g=o.metadata)==null?void 0:g.screenshotPaths)==null?void 0:B[0],k=(O=o.metadata)==null?void 0:O.noScreenshotSaved,x=p&&!k,i=(K=u==null?void 0:u.scenarios)==null?void 0:K.find(H=>H.name===o.name),E=i&&i.screenshotStartedAt&&!i.screenshotFinishedAt||!x&&!k;return e.jsx(m,{to:`/entity/${y.sha}/scenarios/${o.id}`,className:"border border-solid rounded-[6px] overflow-hidden flex-shrink-0 cursor-pointer",style:{width:"160px",height:"90px",backgroundColor:E?"#f9f9f9":void 0,borderColor:E?"#efefef":"#ccc"},children:x?e.jsx(J,{screenshotPath:p,alt:o.name,className:"w-full h-full object-contain bg-gray-100"}):E?e.jsx("div",{className:"w-full h-full flex items-center justify-center",children:e.jsx(te,{size:"medium"})}):e.jsx("div",{className:"w-full h-full flex items-center justify-center font-mono",style:{backgroundColor:"#FAFAFA",backgroundImage:"radial-gradient(circle, rgba(0,0,0,0.02) 1px, transparent 1px)",backgroundSize:"20px 20px",color:"#b0b0b0",fontSize:"11px"},children:"No preview"})},o.id)})}),b&&e.jsx("div",{className:"mb-[15px] font-['IBM_Plex_Mono']",style:{fontSize:"12px",lineHeight:"20px",fontWeight:500,color:"#005c75"},children:b}),e.jsx("div",{className:"mb-[15px]",style:{height:"1px",backgroundColor:"#e0e9ec"}}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{style:{fontSize:"12px",lineHeight:"15px",fontWeight:400,color:"#000"},children:["Running Processes:"," "]}),(s==null?void 0:s.analyzerPid)&&e.jsx(V,{variant:"analyzer",pid:s.analyzerPid}),(s==null?void 0:s.analyzerPid)&&(f||((I=N[s.analyzerPid])==null?void 0:I.isRunning))&&e.jsx(V,{variant:"running"}),(s==null?void 0:s.capturePid)&&e.jsx(V,{variant:"capture",pid:s.capturePid}),(s==null?void 0:s.capturePid)&&(d||((_=N[s.capturePid])==null?void 0:_.isRunning))&&e.jsx(V,{variant:"running"})]}),(((P=N[s==null?void 0:s.analyzerPid])==null?void 0:P.isRunning)||((U=N[s==null?void 0:s.capturePid])==null?void 0:U.isRunning))&&e.jsx("button",{onClick:()=>{const o=[s==null?void 0:s.analyzerPid,s==null?void 0:s.capturePid].filter(x=>{var i;return!!x&&((i=N[x])==null?void 0:i.isRunning)});if(o.length===0)return;const p=o.join(", ");if(!confirm(`Are you sure you want to kill all running processes (${p})?`))return;L({isKilling:!0,current:1,total:o.length}),(async()=>{for(let x=0;x<o.length;x++){const i=o[x];try{await fetch("/api/kill-process",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pid:i,commitSha:n||""})})}catch(A){console.error(`Failed to kill process ${i}:`,A)}x<o.length-1&&L({isKilling:!0,current:x+2,total:o.length})}L({isKilling:!1,current:0,total:0}),$.revalidate()})()},disabled:T.isKilling,className:"px-[8px] rounded-[4px] transition-colors whitespace-nowrap cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",style:{backgroundColor:"#991b1b",color:"white",fontSize:"12px",lineHeight:"15px",fontWeight:500,height:"27px",width:"114px"},children:T.isKilling?"Killing...":"Kill All Processes"})]})]}):e.jsxs("div",{className:"border border-dashed border-[#BCCDD3] rounded-xl p-6 flex items-center justify-between",style:{backgroundColor:"#EDEFF0",backgroundImage:"radial-gradient(circle, rgba(0,0,0,0.03) 1px, transparent 1px)",backgroundSize:"20px 20px",borderWidth:"1px",borderStyle:"dashed"},children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 bg-[#DEE3E5] border border-[#BBCCD3] rounded-full flex items-center justify-center flex-shrink-0",children:e.jsx(ge,{size:24,style:{color:"#005C75"}})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-medium mb-1",style:{color:"#3E3E3E"},children:"No Current Activity"}),e.jsxs("p",{className:"text-sm",style:{color:"#8e8e8e"},children:["There are no analyses running. Trigger one from"," ",e.jsx(m,{to:"/git",className:"text-[#005C75] hover:underline font-medium cursor-pointer",children:"Git"})," ","or"," ",e.jsx(m,{to:"/files",className:"text-[#005C75] hover:underline font-medium cursor-pointer",children:"Files"}),"."]})]})]}),e.jsxs(m,{to:"/files",className:"px-4 py-2 bg-[#005C75] text-white rounded-lg text-sm font-medium hover:bg-[#004a5e] transition-colors flex items-center gap-2 whitespace-nowrap no-underline",children:[e.jsx("span",{children:"+"}),e.jsx("span",{children:"New Analysis"})]})]}),a&&a.length>0&&e.jsxs("div",{children:[e.jsx("h3",{className:"font-mono uppercase",style:{fontSize:"12px",lineHeight:"18px",color:"#8e8e8e",marginBottom:"16px",fontWeight:500,letterSpacing:"0.05em"},children:"Recently Completed Analyses"}),e.jsx("div",{className:"flex flex-col gap-4",children:a.map(o=>{var x;const p=(x=o.analyses)==null?void 0:x[0],k=(p==null?void 0:p.scenarios)||[];return p==null||p.status,e.jsx("div",{className:"rounded-[8px] p-[15px]",style:{backgroundColor:"#ffffff",border:"1px solid #aff1a9"},children:e.jsxs("div",{className:"flex flex-col gap-[15px]",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx(q,{type:o.entityType||"other",size:"large"})}),e.jsxs("div",{className:"flex flex-col flex-shrink-0",style:{marginLeft:"15px",gap:"4px"},children:[e.jsxs("div",{className:"flex items-center gap-[5px]",children:[e.jsx(m,{to:`/entity/${o.sha}`,className:"hover:underline cursor-pointer",title:o.name,style:{fontSize:"14px",lineHeight:"18px",color:"#343434",fontWeight:500},children:o.name}),e.jsx("div",{className:"flex items-center justify-center px-2 rounded",style:{height:"20px",backgroundColor:"#e8ffe6",color:"#00925d",fontSize:"12px",lineHeight:"16px",fontWeight:400},children:o.isUncommitted?"Modified":"Up to date"})]}),e.jsx("div",{style:{fontSize:"12px",lineHeight:"15px",color:"#8e8e8e",fontWeight:400},className:"font-mono",title:o.filePath,children:o.filePath})]}),e.jsx("div",{className:"flex-1"}),e.jsx("div",{className:"flex-shrink-0",children:e.jsx("button",{onClick:r,className:"px-[10px] rounded transition-colors whitespace-nowrap",style:{backgroundColor:"#e0e9ec",color:"#005c75",fontSize:"10px",lineHeight:"22px",fontWeight:600},onMouseEnter:i=>{i.currentTarget.style.backgroundColor="#d0dfe3"},onMouseLeave:i=>{i.currentTarget.style.backgroundColor="#e0e9ec"},children:"View Logs"})})]}),e.jsx("div",{className:"border-t border-gray-200 mx-[-15px]"}),k.length>0?e.jsx("div",{className:"flex gap-2.5 overflow-x-auto pb-3 px-[15px] pt-3",style:{paddingLeft:"47px"},children:k.map(i=>{var B,O,K;if(!i.id)return null;const A=(O=(B=i.metadata)==null?void 0:B.screenshotPaths)==null?void 0:O[0],E=(K=i.metadata)==null?void 0:K.noScreenshotSaved,g=A&&!E;return e.jsxs("div",{className:"shrink-0 flex flex-col gap-2",children:[e.jsx(m,{to:`/entity/${o.sha}/scenarios/${i.id}`,className:"block cursor-pointer",children:e.jsx("div",{className:"w-36 h-24 rounded-md border overflow-hidden flex items-center justify-center transition-all",style:{backgroundColor:g?"#f3f4f6":"#FAFAFA",borderColor:g?"#d1d5db":"#BCCDD3",borderStyle:g?"solid":"dashed"},onMouseEnter:H=>{g&&(H.currentTarget.style.borderColor="#005C75",H.currentTarget.style.boxShadow="0 4px 12px rgba(0, 92, 117, 0.15)")},onMouseLeave:H=>{H.currentTarget.style.borderColor=g?"#d1d5db":"#BCCDD3",H.currentTarget.style.boxShadow="none"},children:g?e.jsx(J,{screenshotPath:A,alt:i.name,className:"max-w-full max-h-full object-contain"}):e.jsx("div",{className:"w-full h-full flex items-center justify-center font-mono",style:{backgroundImage:"radial-gradient(circle, rgba(0,0,0,0.02) 1px, transparent 1px)",backgroundSize:"20px 20px",color:"#b0b0b0",fontSize:"11px"},children:"No preview"})})}),e.jsx("div",{className:"text-left text-xs text-gray-600 cursor-default",style:{fontSize:"11px",lineHeight:"14px",maxWidth:"144px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i.name})]},i.id)})}):e.jsx("div",{className:"italic",style:{fontSize:"12px",color:"#646464",marginLeft:"49px"},children:"No scenarios available"})]})},o.sha)})})]})]})}function be({queueJobs:l,state:s,currentRun:S}){if(!l||l.length===0)return e.jsxs("div",{className:"border border-dashed border-[#BCCDD3] rounded-xl p-6 flex items-center justify-between",style:{backgroundColor:"#EDEFF0",backgroundImage:"radial-gradient(circle, rgba(0,0,0,0.03) 1px, transparent 1px)",backgroundSize:"20px 20px",borderWidth:"1px",borderStyle:"dashed"},children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 bg-[#DEE3E5] border border-[#BBCCD3] rounded-full flex items-center justify-center flex-shrink-0",children:e.jsx(pe,{size:24,style:{color:"#005C75"}})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-medium mb-1",style:{color:"#3E3E3E"},children:"No Queued Jobs"}),e.jsx("p",{className:"text-sm",style:{color:"#8e8e8e"},children:"Analysis jobs will appear here when they are queued but not yet started."})]})]}),e.jsxs(m,{to:"/files",className:"px-4 py-2 bg-[#005C75] text-white rounded-lg text-sm font-medium hover:bg-[#004a5e] transition-colors flex items-center gap-2 whitespace-nowrap no-underline",children:[e.jsx("span",{children:"+"}),e.jsx("span",{children:"New Analysis"})]})]});const[h,n]=D.useState(null),[r,a]=D.useState(null),[c,v]=D.useState(null),[y,u]=D.useState(!1),N=Q(),C=t=>{n(t)},T=(t,d)=>{t.preventDefault(),a(d)},L=async(t,d)=>{if(t.preventDefault(),!h){a(null);return}const f=l.findIndex(b=>b.id===h);if(f===-1){n(null),a(null);return}if(f===d){n(null),a(null);return}const F=f<d?"down":"up",w=Math.abs(d-f);u(!0);try{for(let b=0;b<w;b++)await fetch("/api/queue",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"reorder",jobId:h,direction:F})});N.revalidate()}catch(b){console.error("Failed to reorder job:",b)}finally{u(!1),n(null),a(null)}},$=()=>{y||(n(null),a(null))},W=async t=>{if(confirm("Are you sure you want to cancel this job?"))try{await fetch("/api/queue",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"remove",jobId:t})}),window.location.reload()}catch(d){console.error("Failed to cancel job:",d)}},z=async()=>{if(confirm(`Are you sure you want to cancel all ${l.length} queued jobs?`))try{await fetch("/api/queue",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clear"})}),window.location.reload()}catch(t){console.error("Failed to cancel jobs:",t)}};return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h3",{className:"font-semibold",style:{fontSize:"16px",lineHeight:"24px",color:"#343434"},children:[l.length," Queued Job",l.length!==1?"s":""]}),l.length>0&&e.jsx("button",{onClick:()=>void z(),className:"px-[10px] py-0 rounded transition-colors cursor-pointer hover:bg-red-300",style:{backgroundColor:"#ffdcd9",color:"#ef4444",fontSize:"12px",fontWeight:500,height:"29px"},children:"Cancel All"})]}),e.jsx("div",{className:"flex flex-col gap-3",children:l.map((t,d)=>{var j,I,_;const f=(j=t.entities)==null?void 0:j[0],F=c===d,w=h===t.id,b=r===d;return e.jsxs("div",{className:"rounded-lg p-4 relative",style:{backgroundColor:"#f6f9fc",border:"1px solid #005C75",opacity:w||y?.5:1,transform:b&&h!==null&&!w?"translateY(-2px)":"translateY(0)",transition:"transform 0.2s ease, opacity 0.2s ease",cursor:y?"not-allowed":w?"grabbing":"grab"},onMouseEnter:()=>v(d),onMouseLeave:()=>v(null),draggable:!y,onDragStart:P=>{C(t.id),P.dataTransfer.effectAllowed="move"},onDragOver:P=>T(P,d),onDrop:P=>void L(P,d),onDragEnd:$,children:[e.jsxs("div",{className:"absolute left-4 top-4 flex items-center gap-1.5 flex-shrink-0",children:[e.jsx(ae,{size:16,style:{color:"#005C75"}}),e.jsxs("span",{style:{fontSize:"14px",fontWeight:500,lineHeight:"18px",color:"#005C75"},children:["Job ",d+1]})]}),e.jsx("div",{className:"bg-white rounded mt-8",style:{border:"1px solid #e1e1e1",height:"60px"},children:e.jsxs("div",{className:"flex items-center justify-between h-full px-[15px]",children:[f?e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[e.jsx("div",{children:e.jsx(q,{type:f.entityType||"other",size:"large"})}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(m,{to:`/entity/${f.sha}`,className:"hover:underline cursor-pointer",style:{fontSize:"14px",lineHeight:"18px",fontWeight:500,color:"#000"},children:f.name}),f.entityType&&e.jsx(Y,{type:f.entityType})]}),e.jsx("div",{className:"font-mono",style:{fontSize:"12px",lineHeight:"15px",color:"#8e8e8e"},children:f.filePath})]})]}):e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[e.jsx("div",{style:{transform:"scale(1.0)"},children:e.jsx(ce,{size:18,style:{color:"#8e8e8e"}})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{style:{fontSize:"14px",lineHeight:"18px",fontWeight:500,color:"#000"},children:((I=t.entityNames)==null?void 0:I[0])||(t.type==="analysis"?"Analysis Job":t.type==="recapture"?"Recapture Job":t.type==="debug-setup"?"Debug Setup":t.type.charAt(0).toUpperCase()+t.type.slice(1))}),e.jsx("div",{style:{fontSize:"12px",lineHeight:"15px",color:"#8e8e8e"},children:((_=t.filePaths)==null?void 0:_[0])||(t.filePaths&&t.filePaths.length>1?`${t.filePaths.length} files`:t.entityShas&&t.entityShas.length>0?`${t.entityShas.length} ${t.entityShas.length===1?"entity":"entities"}`:"Queued for processing")})]})]}),F&&e.jsx("div",{className:"mr-2 cursor-grab active:cursor-grabbing",style:{color:"#8e8e8e"},title:"Drag to reorder",children:e.jsx(xe,{size:20})}),e.jsx("button",{onClick:()=>void W(t.id),className:"transition-colors cursor-pointer hover:bg-red-100 rounded flex items-center justify-center",style:{fontSize:"10px",fontWeight:600,lineHeight:"22px",color:"#ef4444",backgroundColor:"#fef6f6",padding:"0 10px",height:"22px"},children:"Cancel"})]})})]},t.id)})})]})}function je({historicalRuns:l,totalHistoricalRuns:s,currentPage:S,totalPages:h,tab:n,onShowLogs:r}){if(s===0)return e.jsxs("div",{className:"border border-dashed border-[#BCCDD3] rounded-xl p-6 flex items-center justify-between",style:{backgroundColor:"#EDEFF0",backgroundImage:"radial-gradient(circle, rgba(0,0,0,0.03) 1px, transparent 1px)",backgroundSize:"20px 20px",borderWidth:"1px",borderStyle:"dashed"},children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 bg-[#DEE3E5] border border-[#BBCCD3] rounded-full flex items-center justify-center flex-shrink-0",children:e.jsx(re,{size:24,style:{color:"#005C75"}})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-medium mb-1",style:{color:"#3E3E3E"},children:"No Historic Activity"}),e.jsx("p",{className:"text-sm",style:{color:"#8e8e8e"},children:"Completed analyses will appear here for historical reference."})]})]}),e.jsxs(m,{to:"/files",className:"px-4 py-2 bg-[#005C75] text-white rounded-lg text-sm font-medium hover:bg-[#004a5e] transition-colors flex items-center gap-2 whitespace-nowrap no-underline",children:[e.jsx("span",{children:"+"}),e.jsx("span",{children:"New Analysis"})]})]});const a=[];return l.forEach(c=>{c.entities&&c.entities.length>0&&c.entities.forEach(v=>{a.push({...v,runCreatedAt:c.createdAt})})}),e.jsx("div",{className:"flex flex-col gap-4",children:a.slice(0,20).map(c=>{var N;const v=(N=c.analyses)==null?void 0:N[0],y=(v==null?void 0:v.scenarios)||[],u=!c.isUncommitted;return e.jsxs("div",{className:"rounded-lg p-4",style:{backgroundColor:u?"#ffffff":"#fef9e7",border:"1px solid",borderColor:u?"#aff1a9":"#f9d689"},children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[e.jsx("div",{children:e.jsx(q,{type:c.entityType||"other",size:"large"})}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(m,{to:`/entity/${c.sha}`,className:"hover:underline cursor-pointer",style:{fontSize:"14px",lineHeight:"18px",fontWeight:500,color:"#343434"},children:c.name}),e.jsx("div",{className:"px-2 py-0.5 rounded",style:{backgroundColor:u?"#e8ffe6":"#fef3cd",color:u?"#00925d":"#a16207",fontSize:"12px",fontWeight:400},children:u?"Up to date":"Out of date"})]}),e.jsx("div",{className:"font-mono",style:{fontSize:"12px",lineHeight:"15px",color:"#8e8e8e"},title:c.filePath,children:c.filePath})]})]}),e.jsx("button",{onClick:r,className:"px-3 py-1 rounded transition-colors whitespace-nowrap cursor-pointer",style:{backgroundColor:"#e0e9ec",color:"#005c75",fontSize:"10px",fontWeight:600},children:"View Logs"})]}),y.length>0&&e.jsxs("div",{className:"flex gap-2 overflow-x-auto",style:{marginLeft:"44px"},children:[y.slice(0,8).map(C=>{var W,z,t;if(!C.id)return null;const T=(z=(W=C.metadata)==null?void 0:W.screenshotPaths)==null?void 0:z[0],L=(t=C.metadata)==null?void 0:t.noScreenshotSaved,$=T&&!L;return e.jsx(m,{to:`/entity/${c.sha}/scenarios/${C.id}`,className:"border rounded overflow-hidden flex-shrink-0 cursor-pointer",style:{width:"120px",height:"80px",borderColor:$?"#ccc":"#BCCDD3",borderStyle:$?"solid":"dashed"},children:$?e.jsx(J,{screenshotPath:T,alt:C.name,className:"w-full h-full object-cover bg-gray-100"}):e.jsx("div",{className:"w-full h-full flex items-center justify-center font-mono",style:{backgroundColor:"#FAFAFA",backgroundImage:"radial-gradient(circle, rgba(0,0,0,0.02) 1px, transparent 1px)",backgroundSize:"20px 20px",color:"#b0b0b0",fontSize:"11px"},children:"No preview"})},C.id)}),y.length>8&&e.jsxs("div",{className:"flex items-center justify-center flex-shrink-0",style:{width:"120px",height:"80px",fontSize:"12px",color:"#646464"},children:["+",y.length-8," more"]})]})]},`${c.sha}-${c.runCreatedAt}`)})})}const De=G(function(){const s=X(),S=Z(),[h,n]=D.useState(!1);se({source:"activity-page"});const r=S.tab||"current";return s?e.jsxs("div",{className:"px-20 py-12",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-[28px] font-semibold text-gray-900 mb-2",children:"Activity"}),e.jsx("p",{className:"text-[15px] text-gray-500",children:"View queued, current, and historical analysis activity."})]}),e.jsx(ye,{activeTab:r,hasCurrentActivity:s.hasCurrentActivity,queuedCount:s.queuedCount,historicCount:s.totalHistoricalRuns}),r==="current"&&e.jsx(ue,{currentlyExecuting:s.currentlyExecuting,currentRun:s.currentRun,state:s.state,projectSlug:s.projectSlug,commitSha:s.commitSha,onShowLogs:()=>n(!0),recentCompletedEntities:s.recentCompletedEntities||[],hasMoreCompletedRuns:s.hasMoreCompletedRuns||!1,currentEntityScenarios:s.currentEntityScenarios||[],currentEntityForScenarios:s.currentEntityForScenarios,currentAnalysisStatus:s.currentAnalysisStatus}),r==="queued"&&e.jsx(be,{queueJobs:s.queueJobs,state:s.state,currentRun:s.currentRun}),r==="historic"&&e.jsx(je,{historicalRuns:s.historicalRuns,totalHistoricalRuns:s.totalHistoricalRuns,currentPage:s.currentPage,totalPages:s.totalPages,tab:r,onShowLogs:()=>n(!0)}),h&&s.projectSlug&&e.jsx(R,{projectSlug:s.projectSlug,onClose:()=>n(!1)})]}):e.jsx("div",{className:"px-20 py-12",children:e.jsx("div",{className:"text-center",children:e.jsx("p",{className:"text-gray-600",children:"Loading..."})})})});export{De as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{w as t,c as r,j as e}from"./chunk-EPOLDU6W-DdQKK6on.js";import{S as i}from"./ScenarioViewer-CyaBFX7l.js";import{W as n}from"./InteractivePreview-D68KarMg.js";import"./useCustomSizes-29dDmbH8.js";import"./LogViewer-CrNkmy4i.js";import"./SafeScreenshot-CQifa1n-.js";import"./useLastLogLine-BUm0UVJm.js";import"./InlineSpinner-CEleMv_j.js";import"./preload-helper-ckwbz45p.js";import"./ReportIssueModal-DzJRkCkr.js";import"./createLucideIcon-Do4ZLUYa.js";import"./circle-check-Dmr2bb1R.js";import"./triangle-alert-BDz7kbVA.js";import"./scenarioStatus-B_8jpV3e.js";const N=()=>[{title:"Empty State - CodeYam"},{name:"description",content:"Simulations empty state development view"}],y=t(function(){r();const s={sha:"mock-sha",name:"Dashboard",filePath:"codeyam-cli/src/webserver/app/routes/_index.tsx",entityType:"visual"};return e.jsx(n,{children:e.jsxs("div",{className:"h-screen bg-[#F8F7F6] flex flex-col overflow-hidden",children:[e.jsx("header",{className:"bg-white border-b border-gray-200 shrink-0 relative h-[54px]",children:e.jsxs("div",{className:"flex items-center h-full px-6 gap-6",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M13 8.5H4M4 8.5L8.5 4M4 8.5L8.5 13",stroke:"#005c75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("h1",{className:"text-lg font-semibold text-black m-0 leading-[26px] shrink-0",children:"Dashboard"}),e.jsx("span",{className:"text-xs text-[#626262] font-mono whitespace-nowrap overflow-hidden text-ellipsis min-w-0",children:"codeyam-cli/src/webserver/app/routes/_index.tsx"})]}),e.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2 px-[15px] py-0 h-[26px] bg-[#efefef] border border-[#e1e1e1] rounded",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-[#626262]"}),e.jsx("span",{className:"text-xs font-semibold text-[#626262]",children:"Not analyzed"})]}),e.jsx("button",{className:"px-[15px] py-0 h-[26px] bg-[#005c75] text-white rounded text-xs font-semibold border-none cursor-pointer hover:bg-[#004a5e] transition-colors",children:"Analyze"})]}),e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-[#626262] ml-auto",children:[e.jsx("span",{className:"leading-[22px]",children:"Next Entity"}),e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M4 8.5H13M13 8.5L8.5 4M13 8.5L8.5 13",stroke:"#005c75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})}),e.jsx("div",{className:"bg-[#efefef] border-b border-[#efefef] shrink-0",children:e.jsxs("div",{className:"flex items-center gap-3 h-11 px-[15px]",children:[e.jsxs("div",{className:"px-4 flex items-center justify-center gap-3 shrink-0 text-sm rounded bg-[#343434] text-[#efefef] font-semibold h-8",children:["Scenarios",e.jsx("span",{className:"px-2 py-0.5 rounded-[9px] text-xs font-semibold bg-[#cbf3fa] text-[#005c75] min-w-[25px] text-center",children:"0"})]}),e.jsxs("div",{className:"px-4 flex items-center justify-center gap-3 shrink-0 text-sm rounded-[9px] text-[#3e3e3e] font-normal",children:["Related Entities",e.jsx("span",{className:"px-2 py-0.5 rounded-[9px] text-xs font-semibold bg-[#e1e1e1] text-[#3e3e3e] min-w-[25px] text-center",children:"5"})]}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"Code"}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"Data Structure"}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"History"})]})}),e.jsxs("div",{className:"flex flex-1 gap-0 min-h-0",children:[e.jsx("div",{className:"w-[165px] bg-[#e1e1e1] border-r border-[#c7c7c7] flex items-center justify-center shrink-0",children:e.jsx("span",{className:"text-xs font-medium text-[#8e8e8e] leading-5",children:"No Scenarios"})}),e.jsx(i,{selectedScenario:null,analysis:void 0,entity:s,viewMode:"screenshot",cacheBuster:Date.now(),hasScenarios:!1,isAnalyzing:!1,projectSlug:null,hasAnApiKey:!0})]})]})})});export{y as default,N as meta};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as ne,r as y,j as e,w as le,u as ce,e as de}from"./chunk-EPOLDU6W-DdQKK6on.js";import{u as me}from"./useReportContext-CkIOKTrZ.js";import{F as he,a as pe,E as fe,S as xe,u as ue}from"./EntityItem-vauWK972.js";import{g as E}from"./fileTableUtils-DD3SDH7t.js";import{C as ae}from"./chevron-down-DgTPh8H-.js";import{S as ye}from"./search-P2FKIUql.js";import"./useToast-KKw5kTn-.js";import"./TruncatedFilePath-D36O1rzU.js";import"./SafeScreenshot-CQifa1n-.js";import"./LibraryFunctionPreview-L75Wvqgw.js";import"./scenarioStatus-B_8jpV3e.js";import"./triangle-alert-BDz7kbVA.js";import"./createLucideIcon-Do4ZLUYa.js";import"./EntityTypeIcon-BwdQv49w.js";import"./EntityTypeBadge-COi5OvsN.js";function ve({entities:G,page:h,itemsPerPage:g=50,currentRun:U,filter:z,entityType:Q,queueState:o,isEntityPending:j,pendingEntityKeys:F,onGenerateSimulation:S,onGenerateAllSimulations:M,totalFilesCount:Y,totalEntitiesCount:_,uncommittedFilesCount:L,showOnlyUncommitted:H,onToggleUncommitted:W}){const[T,I]=ne(),[R,x]=y.useState(new Set),[f,v]=y.useState(""),[J,k]=y.useState(!1),[A,O]=y.useState("all"),[C,V]=y.useState("desc"),B=Q||"all",ee=y.useMemo(()=>{let s=G;return B!=="all"&&(s=s.filter(r=>r.entityType===B)),z==="analyzed"&&(s=s.filter(r=>r.analyses&&r.analyses.length>0)),s},[G,B,z]),te=y.useMemo(()=>{const s=new Map,r=new Map,p=new Map;ee.forEach(a=>{var i,l;const t=`${a.filePath}::${a.name}`,n=r.get(t);if(!n)r.set(t,a),p.set(t,[]);else{const d=((i=n.metadata)==null?void 0:i.editedAt)||n.createdAt||"",c=((l=a.metadata)==null?void 0:l.editedAt)||a.createdAt||"";let m=!1;if(c>d)m=!0;else if(c===d){const u=n.createdAt||"";m=(a.createdAt||"")>u}m?(p.get(t).push(n),r.set(t,a)):p.get(t).push(a)}}),r.forEach((a,t)=>{var i;if(!(a.analyses&&a.analyses.length>0)&&((i=a.metadata)!=null&&i.previousVersionWithAnalyses)){const d=(p.get(t)||[]).find(c=>{var m;return c.sha===((m=a.metadata)==null?void 0:m.previousVersionWithAnalyses)});d&&d.analyses&&d.analyses.length>0&&(a.analyses=d.analyses)}}),Array.from(r.values()).sort((a,t)=>{var l,d,c,m;const n=!((l=a.metadata)!=null&&l.notExported)&&!((d=a.metadata)!=null&&d.namedExport),i=!((c=t.metadata)!=null&&c.notExported)&&!((m=t.metadata)!=null&&m.namedExport);return n&&!i?-1:!n&&i?1:0}).forEach(a=>{var d,c,m,u,b;const t=a.filePath??"No File Path";s.has(t)||s.set(t,{filePath:t,entities:[],totalCount:0,uncommittedCount:0,lastUpdated:null,previewScreenshots:[],previewScreenshotErrors:[],previewLibraryScenarios:[],state:"up-to-date",simulationCount:0});const n=s.get(t);n.entities.push(a),n.totalCount++,(d=a.metadata)!=null&&d.isUncommitted&&n.uncommittedCount++;const i=((u=(m=(c=a.analyses)==null?void 0:c[0])==null?void 0:m.scenarios)==null?void 0:u.length)||0;n.simulationCount+=i;const l=((b=a.metadata)==null?void 0:b.editedAt)||a.updatedAt;l&&(!n.lastUpdated||new Date(l)>new Date(n.lastUpdated))&&(n.lastUpdated=l)});const K=(o==null?void 0:o.jobs)||[],q=a=>{const t=`${a.filePath||""}::${a.name}`;return(F==null?void 0:F.includes(t))||!1};s.forEach(a=>{const t=a.entities.map(n=>q(n)?"queued":E(n,K));t.includes("analyzing")||t.includes("queued")?a.state="analyzing":t.includes("incomplete")?a.state="incomplete":t.includes("out-of-date")?a.state="out-of-date":t.includes("not-analyzed")?a.state="not-analyzed":a.state="up-to-date"}),s.forEach(a=>{var t,n,i,l,d;for(const c of a.entities){if(a.previewScreenshots.length+a.previewLibraryScenarios.length>=3)break;const u=((n=(t=c.analyses)==null?void 0:t[0])==null?void 0:n.scenarios)||[];if(c.entityType==="library"){const b=u.find(N=>{var P,D;return((P=N.metadata)==null?void 0:P.executionResult)||((D=N.metadata)==null?void 0:D.error)});b&&a.previewLibraryScenarios.push({scenario:b,entitySha:c.sha})}else{const b=u.find(N=>{var P,D;return(D=(P=N.metadata)==null?void 0:P.screenshotPaths)==null?void 0:D[0]});if(b){const N=(l=(i=b.metadata)==null?void 0:i.screenshotPaths)==null?void 0:l[0],P=!!((d=b.metadata)!=null&&d.error);N&&!a.previewScreenshots.includes(N)&&(a.previewScreenshots.push(N),a.previewScreenshotErrors.push(P))}}}});const $=Array.from(s.values());return $.sort((a,t)=>{if(z==="analyzed"){const l=Math.max(...a.entities.filter(c=>{var m,u;return(u=(m=c.analyses)==null?void 0:m[0])==null?void 0:u.createdAt}).map(c=>new Date(c.analyses[0].createdAt).getTime()),0),d=Math.max(...t.entities.filter(c=>{var m,u;return(u=(m=c.analyses)==null?void 0:m[0])==null?void 0:u.createdAt}).map(c=>new Date(c.analyses[0].createdAt).getTime()),0);return C==="desc"?d-l:l-d}if(a.uncommittedCount>0&&t.uncommittedCount===0)return-1;if(a.uncommittedCount===0&&t.uncommittedCount>0)return 1;const n=a.lastUpdated?new Date(a.lastUpdated).getTime():0,i=t.lastUpdated?new Date(t.lastUpdated).getTime():0;return C==="desc"?i-n:n-i}),$},[ee,z,C,o,F]),w=y.useMemo(()=>{let s=te;if(A!=="all"&&(s=s.filter(r=>r.state===A)),f.trim()){const r=f.toLowerCase();s=s.filter(p=>p.filePath.toLowerCase().includes(r))}return s},[te,f,A]),se=(h-1)*g,oe=se+g,X=w.slice(se,oe),Z=Math.ceil(w.length/g),ie=s=>{x(r=>{const p=new Set(r);return p.has(s)?p.delete(s):p.add(s),p})},re=()=>{V(s=>s==="desc"?"asc":"desc")};return e.jsxs("div",{children:[e.jsxs("div",{className:"bg-white border-b border-gray-200 rounded-t-lg px-5 py-4 mb-3",children:[e.jsx("div",{className:"text-[11px] text-gray-500 mb-2 uppercase",children:"Filters"}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("div",{className:"relative w-[130px]",children:[e.jsxs("select",{value:B,onChange:s=>{const r=s.target.value,p=new URLSearchParams(T);r==="all"?p.delete("entityType"):p.set("entityType",r),p.set("page","1"),I(p)},className:"appearance-none bg-gray-50 border border-gray-200 rounded px-[10px] pr-6 text-[13px] h-[39px] w-full cursor-pointer focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] hover:border-gray-300 transition-colors",children:[e.jsx("option",{value:"all",children:"All Types"}),e.jsx("option",{value:"visual",children:"Visual"}),e.jsx("option",{value:"library",children:"Library"})]}),e.jsx(ae,{className:"absolute right-2 top-1/2 -translate-y-1/2 w-3 h-3 text-gray-500 pointer-events-none"})]}),e.jsxs("div",{className:"relative w-[130px]",children:[e.jsxs("select",{value:A,onChange:s=>O(s.target.value),className:"appearance-none bg-gray-50 border border-gray-200 rounded px-[10px] pr-6 text-[13px] h-[39px] w-full cursor-pointer focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] hover:border-gray-300 transition-colors",children:[e.jsx("option",{value:"all",children:"All States"}),e.jsx("option",{value:"analyzing",children:"Analyzing..."}),e.jsx("option",{value:"up-to-date",children:"Up to date"}),e.jsx("option",{value:"incomplete",children:"Incomplete"}),e.jsx("option",{value:"out-of-date",children:"Out of date"}),e.jsx("option",{value:"not-analyzed",children:"Not analyzed"})]}),e.jsx(ae,{className:"absolute right-2 top-1/2 -translate-y-1/2 w-3 h-3 text-gray-500 pointer-events-none"})]}),e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(ye,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx("input",{type:"text",placeholder:"Search component",value:f,onChange:s=>v(s.target.value),className:"w-full bg-gray-50 border border-gray-200 rounded pl-9 pr-[10px] text-[13px] h-[39px] placeholder:text-gray-400 focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] transition-colors"})]})]})]}),Y!==void 0&&_!==void 0&&L!==void 0&&e.jsx("div",{className:"mb-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsxs("span",{className:"font-mono uppercase",style:{fontSize:"11px",color:"#8b8b8b",fontWeight:500,letterSpacing:"0.05em"},children:[e.jsx("span",{style:{color:"#000000"},children:w.length})," ",w.length===1?"file":"files"]}),e.jsxs("div",{className:"relative group inline-flex items-center ml-1.5",children:[e.jsx("svg",{className:"w-3 h-3 text-gray-400 cursor-help",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),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:["In CodeYam, an entity is a discrete, analyzable unit of code that can be independently simulated and tested.",e.jsx("div",{className:"absolute -top-1 left-4 w-2 h-2 bg-gray-900 transform rotate-45"})]})})]}),e.jsx("span",{className:"font-mono uppercase",style:{fontSize:"11px",color:"#d1d5db",fontWeight:500,letterSpacing:"0.05em",marginLeft:"8px"},children:"|"}),e.jsxs("span",{className:"font-mono uppercase",style:{fontSize:"11px",color:"#8b8b8b",fontWeight:500,letterSpacing:"0.05em",marginLeft:"8px"},children:[e.jsx("span",{style:{color:"#000000"},children:w.reduce((s,r)=>s+r.totalCount,0)})," ",w.reduce((s,r)=>s+r.totalCount,0)===1?"entity":"entities"]}),e.jsx("span",{className:"font-mono uppercase",style:{fontSize:"11px",color:"#d1d5db",fontWeight:500,letterSpacing:"0.05em",marginLeft:"8px"},children:"|"}),H?e.jsxs("button",{onClick:W,className:"flex items-center gap-2 text-[#005c75] underline hover:text-[#004a5e] transition-colors ml-2 font-mono uppercase cursor-pointer",style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.05em"},children:[w.filter(s=>s.uncommittedCount>0).length," ","uncommitted"," ",w.filter(s=>s.uncommittedCount>0).length===1?"file":"files",e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})]}):e.jsxs("button",{onClick:W,className:"text-[#005c75] underline hover:text-[#004a5e] transition-colors ml-2 font-mono uppercase",style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.05em"},children:[L," uncommitted"," ",L===1?"file":"files"]})]}),X.length>0&&e.jsxs("div",{className:"flex gap-6",children:[e.jsx("button",{onClick:()=>{x(new Set(X.map(s=>s.filePath))),k(!0)},className:"text-[#005c75] hover:bg-[#E6F5F8] hover:text-[#003d4f] font-medium transition-all cursor-pointer px-3 py-1 rounded",children:"Expand All"}),e.jsx("button",{onClick:()=>{x(new Set),k(!1)},className:"text-[#005c75] hover:bg-[#E6F5F8] hover:text-[#003d4f] font-medium transition-all cursor-pointer px-3 py-1 rounded",children:"Collapse All"})]})]})}),e.jsx(he,{showActions:!0,sortOrder:C,onSortChange:re}),e.jsx("div",{className:"flex flex-col gap-[3px]",children:X.map(s=>{const r=R.has(s.filePath),K=s.entities.filter(t=>(t.entityType==="visual"||t.entityType==="library")&&(E(t,(o==null?void 0:o.jobs)||[])==="not-analyzed"||E(t,(o==null?void 0:o.jobs)||[])==="out-of-date"||E(t,(o==null?void 0:o.jobs)||[])==="incomplete")).length>0,q=t=>{var n;return((n=U==null?void 0:U.currentEntityShas)==null?void 0:n.includes(t))||!1},$=t=>{var n;return j!=null&&j(t)?!0:((n=o==null?void 0:o.jobs)==null?void 0:n.some(i=>{var l;return(l=i.entityShas)==null?void 0:l.includes(t.sha)}))||!1},a=t=>{S==null||S(t)};return e.jsx(pe,{filePath:s.filePath,isExpanded:r,onToggle:()=>ie(s.filePath),simulationPreviews:e.jsx(xe,{entities:s.entities,maxPreviews:1}),entityCount:s.totalCount,state:s.state,lastModified:s.lastUpdated,uncommittedCount:s.uncommittedCount,isUncommitted:s.uncommittedCount>0,actionButton:K?e.jsx("button",{onClick:t=>{t.stopPropagation();const n=s.entities.filter(i=>(i.entityType==="visual"||i.entityType==="library")&&(E(i,(o==null?void 0:o.jobs)||[])==="not-analyzed"||E(i,(o==null?void 0:o.jobs)||[])==="out-of-date"||E(i,(o==null?void 0:o.jobs)||[])==="incomplete"));M==null||M(n)},className:"bg-[#005c75] text-white rounded text-[12px] font-['IBM_Plex_Sans'] font-normal hover:bg-[#004a5e] transition-colors cursor-pointer px-[15px] py-0 h-[28px]",children:s.state==="out-of-date"?"Re-analyze":"Analyze"}):void 0,children:s.entities.sort((t,n)=>{const i=t.entityType==="visual"||t.entityType==="library",l=n.entityType==="visual"||n.entityType==="library";return i&&!l?-1:!i&&l?1:0}).map(t=>e.jsx(fe,{entity:t,isActivelyAnalyzing:q(t.sha),isQueued:$(t),onGenerateSimulation:a},t.sha))},s.filePath)})}),Z>1&&e.jsxs("div",{className:"flex justify-center items-center gap-4 mt-6 p-4",children:[h>1&&e.jsx("a",{href:`?${new URLSearchParams({...Object.fromEntries(T),page:String(h-1)}).toString()}`,className:"no-underline font-medium hover:underline",style:{color:"#005C75"},children:"← Previous"}),e.jsxs("span",{children:["Page ",h," of ",Z]}),h<Z&&e.jsx("a",{href:`?${new URLSearchParams({...Object.fromEntries(T),page:String(h+1)}).toString()}`,className:"no-underline font-medium hover:underline",style:{color:"#005C75"},children:"Next →"})]})]})}const Le=()=>[{title:"CodeYam - Files & Entities"},{name:"description",content:"Browse your codebase files and entities"}],ke=le(function(){var T,I,R;const{entities:h,currentCommit:g,page:U,filter:z,entityType:Q,queueState:o}=ce();de(),ne();const[j,F]=y.useState(!1);me({source:"files-page"});const{handleGenerateSimulation:S,handleGenerateAllSimulations:M,isEntityPending:Y,pendingEntityKeys:_}=ue((I=(T=g==null?void 0:g.metadata)==null?void 0:T.currentRun)==null?void 0:I.currentEntityShas,o),L=y.useMemo(()=>{if(!h)return[];const x=new Set([]);for(const f of h)x.add(f.filePath??"No File Path");return Array.from(x)},[h]),H=y.useMemo(()=>{if(!h)return[];let x=h;return j&&(x=x.filter(f=>{var v;return(v=f.metadata)==null?void 0:v.isUncommitted})),x.sort((f,v)=>{var J,k,A,O,C,V;return(J=f.metadata)!=null&&J.isUncommitted&&!((k=v.metadata)!=null&&k.isUncommitted)?-1:!((A=f.metadata)!=null&&A.isUncommitted)&&((O=v.metadata)!=null&&O.isUncommitted)?1:new Date(((C=v.metadata)==null?void 0:C.editedAt)||0).getTime()-new Date(((V=f.metadata)==null?void 0:V.editedAt)||0).getTime()})},[h,j]),W=y.useMemo(()=>{var f;if(!h)return[];const x=new Set([]);for(const v of h)(f=v.metadata)!=null&&f.isUncommitted&&x.add(v.filePath??"No File Path");return Array.from(x)},[h]);return h?e.jsx("div",{className:"bg-[#f9f9f9] min-h-screen",children:e.jsxs("div",{className:"px-20 py-12 font-sans",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-[28px] font-semibold text-gray-900 mb-2",children:"Files & Entities"}),e.jsx("p",{className:"text-[15px] text-gray-500",children:"This is a list of all the files in your app."})]}),e.jsx(ve,{entities:H,page:U,itemsPerPage:50,currentRun:(R=g==null?void 0:g.metadata)==null?void 0:R.currentRun,filter:z,entityType:Q,queueState:o,isEntityPending:Y,pendingEntityKeys:_,onGenerateSimulation:S,onGenerateAllSimulations:M,totalFilesCount:L.length,totalEntitiesCount:h.length,uncommittedFilesCount:W.length,showOnlyUncommitted:j,onToggleUncommitted:()=>F(!j)})]})}):e.jsx("div",{className:"bg-[#F8F7F6] min-h-screen",children:e.jsxs("div",{className:"px-12 py-6 font-sans",children:[e.jsx("h1",{className:"text-[28px] font-semibold text-gray-900",children:"Error"}),e.jsx("p",{className:"text-base text-gray-500",children:"Unable to retrieve entities"})]})})});export{ke as default,Le as meta};
|