@codeyam/codeyam-cli 0.1.0-staging.d0ad4ae → 0.1.0-staging.d52b24f
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 +27 -27
- package/analyzer-template/packages/ai/index.ts +21 -5
- package/analyzer-template/packages/ai/package.json +3 -3
- package/analyzer-template/packages/ai/src/lib/__mocks__/completionCall.ts +122 -0
- package/analyzer-template/packages/ai/src/lib/analyzeScope.ts +226 -24
- package/analyzer-template/packages/ai/src/lib/astScopes/arrayDerivationDetector.ts +199 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/astScopeAnalyzer.ts +217 -13
- package/analyzer-template/packages/ai/src/lib/astScopes/conditionalEffectsExtractor.ts +644 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/methodSemantics.ts +181 -23
- package/analyzer-template/packages/ai/src/lib/astScopes/patterns/forInStatementHandler.ts +10 -17
- package/analyzer-template/packages/ai/src/lib/astScopes/patterns/ifStatementHandler.ts +18 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/patterns/switchStatementHandler.ts +15 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.ts +181 -1
- package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +1215 -29
- package/analyzer-template/packages/ai/src/lib/astScopes/sharedPatterns.ts +28 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/types.ts +265 -6
- package/analyzer-template/packages/ai/src/lib/completionCall.ts +247 -66
- package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +2020 -334
- 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 +129 -20
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/coerceObjectsToPrimitivesBySchema.ts +70 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.ts +62 -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 -90
- 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/generateChangesEntityScenarioData.ts +4 -3
- package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarios.ts +86 -149
- package/analyzer-template/packages/ai/src/lib/generateEntityDataStructure.ts +59 -3
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +1458 -65
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarios.ts +200 -196
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +677 -0
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.ts +528 -0
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionals.ts +2484 -0
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.ts +239 -0
- package/analyzer-template/packages/ai/src/lib/guessScenarioDataFromDescription.ts +5 -5
- package/analyzer-template/packages/ai/src/lib/isolateScopes.ts +328 -7
- package/analyzer-template/packages/ai/src/lib/mergeJsonTypeDefinitions.ts +5 -0
- package/analyzer-template/packages/ai/src/lib/mergeStatements.ts +111 -87
- 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/generateChangesEntityScenarioDataGenerator.ts +1 -1
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.ts +28 -170
- 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 +110 -6
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.ts +14 -89
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateMissingKeysPrompt.ts +58 -0
- package/analyzer-template/packages/ai/src/lib/promptGenerators/guessNewScenarioDataFromDescriptionGenerator.ts +11 -11
- package/analyzer-template/packages/ai/src/lib/promptGenerators/simplifyKeysForLLM.ts +391 -0
- package/analyzer-template/packages/ai/src/lib/resolvePathToControllable.ts +824 -0
- package/analyzer-template/packages/ai/src/lib/splitOutsideParentheses.ts +5 -1
- package/analyzer-template/packages/ai/src/lib/validateExecutionFlowPaths.ts +531 -0
- package/analyzer-template/packages/ai/src/lib/worker/SerializableDataStructure.ts +122 -3
- 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 +132 -33
- package/analyzer-template/packages/analyze/src/lib/analysisContext.ts +44 -4
- package/analyzer-template/packages/analyze/src/lib/asts/index.ts +7 -2
- 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 +447 -255
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +39 -4
- package/analyzer-template/packages/analyze/src/lib/files/analyze/findOrCreateEntity.ts +12 -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/analyzeChange.ts +14 -14
- package/analyzer-template/packages/analyze/src/lib/files/analyzeEntity.ts +4 -4
- package/analyzer-template/packages/analyze/src/lib/files/analyzeInitial.ts +11 -12
- package/analyzer-template/packages/analyze/src/lib/files/analyzeRemixRoute.ts +4 -5
- package/analyzer-template/packages/analyze/src/lib/files/enums/steps.ts +1 -1
- package/analyzer-template/packages/analyze/src/lib/files/getImportedExports.ts +14 -12
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/TransformationTracer.ts +1352 -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 +203 -41
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.ts +28 -188
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +355 -23
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.ts +166 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarioData.ts +1 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarios.ts +2 -3
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +845 -72
- 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/index.ts +1 -0
- package/analyzer-template/packages/database/package.json +4 -4
- 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 +22 -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 +17 -1
- package/analyzer-template/packages/database/src/lib/kysely/tables/editorScenariosTable.ts +164 -0
- 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 +58 -19
- package/analyzer-template/packages/database/src/lib/loadEntities.ts +26 -9
- package/analyzer-template/packages/database/src/lib/loadEntityBranches.ts +12 -0
- package/analyzer-template/packages/database/src/lib/loadReadyToBeCapturedAnalyses.ts +5 -6
- 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 +96 -152
- package/analyzer-template/packages/database/src/lib/updateFreshAnalysisStatus.ts +58 -42
- package/analyzer-template/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.ts +81 -65
- package/analyzer-template/packages/database/src/lib/userScenarioToDb.ts +1 -1
- package/analyzer-template/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.ts +29 -1
- package/analyzer-template/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.ts +33 -5
- package/analyzer-template/packages/github/dist/database/index.d.ts +1 -0
- package/analyzer-template/packages/github/dist/database/index.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/index.js +1 -0
- package/analyzer-template/packages/github/dist/database/index.js.map +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 +4 -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 +16 -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 +1 -18
- 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 +17 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts +29 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts.map +1 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js +149 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -0
- 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/kysely/tables/scenariosTable.d.ts +6 -6
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/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 +45 -14
- 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 -10
- 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/loadReadyToBeCapturedAnalyses.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js +5 -5
- package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.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 +76 -89
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.js +41 -30
- package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.js +68 -57
- package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.js.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +29 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +33 -5
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
- package/analyzer-template/packages/github/dist/types/index.d.ts +3 -4
- package/analyzer-template/packages/github/dist/types/index.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/index.js +0 -1
- package/analyzer-template/packages/github/dist/types/index.js.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.d.ts +2 -0
- package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.js +2 -0
- package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.js.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/Analysis.d.ts +71 -27
- 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 +8 -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/Scenario.d.ts +13 -54
- package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/Scenario.js +1 -21
- package/analyzer-template/packages/github/dist/types/src/types/Scenario.js.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts +153 -5
- 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/types/src/types/StatementInfo.d.ts +2 -0
- package/analyzer-template/packages/github/dist/types/src/types/StatementInfo.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/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 +2 -2
- package/analyzer-template/packages/types/index.ts +3 -6
- package/analyzer-template/packages/types/src/enums/ProjectFramework.ts +2 -0
- package/analyzer-template/packages/types/src/types/Analysis.ts +87 -27
- package/analyzer-template/packages/types/src/types/Commit.ts +2 -0
- package/analyzer-template/packages/types/src/types/ProjectMetadata.ts +8 -0
- package/analyzer-template/packages/types/src/types/Scenario.ts +13 -77
- package/analyzer-template/packages/types/src/types/ScenariosDataStructure.ts +181 -5
- package/analyzer-template/packages/types/src/types/ScopeAnalysis.ts +6 -1
- package/analyzer-template/packages/types/src/types/StatementInfo.ts +2 -0
- package/analyzer-template/packages/ui-components/package.json +1 -1
- package/analyzer-template/packages/utils/dist/types/index.d.ts +3 -4
- package/analyzer-template/packages/utils/dist/types/index.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/index.js +0 -1
- package/analyzer-template/packages/utils/dist/types/index.js.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.d.ts +2 -0
- package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.js +2 -0
- package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.js.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/Analysis.d.ts +71 -27
- 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 +8 -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/Scenario.d.ts +13 -54
- package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/Scenario.js +1 -21
- package/analyzer-template/packages/utils/dist/types/src/types/Scenario.js.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts +153 -5
- 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/types/src/types/StatementInfo.d.ts +2 -0
- package/analyzer-template/packages/utils/dist/types/src/types/StatementInfo.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js +98 -3
- 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 +121 -3
- package/analyzer-template/packages/utils/src/lib/safeFileName.ts +48 -3
- package/analyzer-template/playwright/capture.ts +20 -8
- package/analyzer-template/playwright/captureFromUrl.ts +89 -82
- package/analyzer-template/playwright/captureStatic.ts +1 -1
- package/analyzer-template/playwright/getCodeYamInfo.ts +12 -7
- package/analyzer-template/project/analyzeBaselineCommit.ts +9 -0
- package/analyzer-template/project/analyzeBranchCommit.ts +4 -0
- package/analyzer-template/project/analyzeFileEntities.ts +4 -0
- package/analyzer-template/project/analyzeRegularCommit.ts +9 -0
- package/analyzer-template/project/captureLibraryFunctionDirect.ts +29 -26
- package/analyzer-template/project/constructMockCode.ts +593 -91
- package/analyzer-template/project/controller/startController.ts +16 -1
- package/analyzer-template/project/createEntitiesAndSortFiles.ts +83 -0
- package/analyzer-template/project/executeLibraryFunctionDirect.ts +7 -3
- package/analyzer-template/project/loadReadyToBeCaptured.ts +65 -41
- package/analyzer-template/project/mocks/analyzeFileMock.ts +8 -7
- 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 +220 -1
- package/analyzer-template/project/runAnalysis.ts +6 -0
- package/analyzer-template/project/start.ts +49 -12
- package/analyzer-template/project/startScenarioCapture.ts +9 -0
- package/analyzer-template/project/writeClientLogRoute.ts +125 -0
- package/analyzer-template/project/writeMockDataTsx.ts +312 -10
- package/analyzer-template/project/writeScenarioComponents.ts +314 -43
- package/analyzer-template/project/writeSimpleRoot.ts +21 -11
- package/analyzer-template/scripts/comboWorkerLoop.cjs +98 -50
- package/analyzer-template/tsconfig.json +14 -1
- 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 +7 -1
- package/background/src/lib/virtualized/project/analyzeBaselineCommit.js.map +1 -1
- package/background/src/lib/virtualized/project/analyzeBranchCommit.js +2 -1
- package/background/src/lib/virtualized/project/analyzeBranchCommit.js.map +1 -1
- package/background/src/lib/virtualized/project/analyzeFileEntities.js +2 -1
- package/background/src/lib/virtualized/project/analyzeFileEntities.js.map +1 -1
- package/background/src/lib/virtualized/project/analyzeRegularCommit.js +7 -1
- 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 +493 -52
- package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
- package/background/src/lib/virtualized/project/controller/startController.js +11 -1
- package/background/src/lib/virtualized/project/controller/startController.js.map +1 -1
- package/background/src/lib/virtualized/project/createEntitiesAndSortFiles.js +73 -1
- package/background/src/lib/virtualized/project/createEntitiesAndSortFiles.js.map +1 -1
- package/background/src/lib/virtualized/project/executeLibraryFunctionDirect.js +6 -3
- package/background/src/lib/virtualized/project/executeLibraryFunctionDirect.js.map +1 -1
- package/background/src/lib/virtualized/project/loadReadyToBeCaptured.js +19 -8
- package/background/src/lib/virtualized/project/loadReadyToBeCaptured.js.map +1 -1
- package/background/src/lib/virtualized/project/mocks/analyzeFileMock.js +7 -7
- package/background/src/lib/virtualized/project/mocks/analyzeFileMock.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture/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 +184 -1
- package/background/src/lib/virtualized/project/reconcileMockDataKeys.js.map +1 -1
- package/background/src/lib/virtualized/project/runAnalysis.js +5 -0
- package/background/src/lib/virtualized/project/runAnalysis.js.map +1 -1
- package/background/src/lib/virtualized/project/start.js +44 -12
- package/background/src/lib/virtualized/project/start.js.map +1 -1
- package/background/src/lib/virtualized/project/startScenarioCapture.js +5 -0
- package/background/src/lib/virtualized/project/startScenarioCapture.js.map +1 -1
- package/background/src/lib/virtualized/project/writeClientLogRoute.js +110 -0
- package/background/src/lib/virtualized/project/writeClientLogRoute.js.map +1 -0
- package/background/src/lib/virtualized/project/writeMockDataTsx.js +263 -6
- package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
- package/background/src/lib/virtualized/project/writeScenarioComponents.js +237 -41
- 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 +386 -9
- package/codeyam-cli/scripts/apply-setup.js.map +1 -1
- package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js +196 -0
- package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js.map +1 -0
- package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js +114 -0
- package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js.map +1 -0
- package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js +149 -0
- package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js.map +1 -0
- package/codeyam-cli/src/cli.js +35 -24
- 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/__tests__/editor.stepDispatch.test.js +56 -0
- package/codeyam-cli/src/commands/__tests__/editor.stepDispatch.test.js.map +1 -0
- package/codeyam-cli/src/commands/__tests__/init.gitignore.test.js +101 -47
- package/codeyam-cli/src/commands/__tests__/init.gitignore.test.js.map +1 -1
- package/codeyam-cli/src/commands/analyze.js +21 -9
- package/codeyam-cli/src/commands/analyze.js.map +1 -1
- package/codeyam-cli/src/commands/baseline.js +10 -11
- package/codeyam-cli/src/commands/baseline.js.map +1 -1
- package/codeyam-cli/src/commands/debug.js +37 -23
- package/codeyam-cli/src/commands/debug.js.map +1 -1
- package/codeyam-cli/src/commands/default.js +43 -35
- package/codeyam-cli/src/commands/default.js.map +1 -1
- package/codeyam-cli/src/commands/editor.js +4283 -0
- package/codeyam-cli/src/commands/editor.js.map +1 -0
- package/codeyam-cli/src/commands/init.js +147 -292
- package/codeyam-cli/src/commands/init.js.map +1 -1
- package/codeyam-cli/src/commands/memory.js +278 -0
- package/codeyam-cli/src/commands/memory.js.map +1 -0
- package/codeyam-cli/src/commands/recapture.js +31 -18
- package/codeyam-cli/src/commands/recapture.js.map +1 -1
- package/codeyam-cli/src/commands/report.js +46 -1
- package/codeyam-cli/src/commands/report.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/start.js +8 -12
- package/codeyam-cli/src/commands/start.js.map +1 -1
- 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/data/techStacks.js +77 -0
- package/codeyam-cli/src/data/techStacks.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/analyzerFinalization.test.js +173 -0
- package/codeyam-cli/src/utils/__tests__/analyzerFinalization.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/backgroundServer.test.js +46 -0
- package/codeyam-cli/src/utils/__tests__/backgroundServer.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/devServerState.test.js +134 -0
- package/codeyam-cli/src/utils/__tests__/devServerState.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorApi.test.js +137 -0
- package/codeyam-cli/src/utils/__tests__/editorApi.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +987 -0
- package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorBroadcastViewport.test.js +76 -0
- package/codeyam-cli/src/utils/__tests__/editorBroadcastViewport.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorCapture.test.js +93 -0
- package/codeyam-cli/src/utils/__tests__/editorCapture.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorDeleteScenario.test.js +100 -0
- package/codeyam-cli/src/utils/__tests__/editorDeleteScenario.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js +304 -0
- package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js +124 -0
- package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorEntityHelpers.test.js +261 -0
- package/codeyam-cli/src/utils/__tests__/editorEntityHelpers.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js +294 -0
- package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorJournal.test.js +542 -0
- package/codeyam-cli/src/utils/__tests__/editorJournal.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js +594 -0
- package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorMigration.test.js +435 -0
- package/codeyam-cli/src/utils/__tests__/editorMigration.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorMockState.test.js +270 -0
- package/codeyam-cli/src/utils/__tests__/editorMockState.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js +217 -0
- package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorPreview.test.js +353 -0
- package/codeyam-cli/src/utils/__tests__/editorPreview.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js +153 -0
- package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js +139 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js +221 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js +1483 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js +280 -0
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapterPrismaValidation.test.js +143 -0
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapterPrismaValidation.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorSessionFilter.test.js +66 -0
- package/codeyam-cli/src/utils/__tests__/editorSessionFilter.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorShouldRevalidate.test.js +53 -0
- package/codeyam-cli/src/utils/__tests__/editorShouldRevalidate.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js +1857 -0
- package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/git.editor.test.js +134 -0
- package/codeyam-cli/src/utils/__tests__/git.editor.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js +107 -0
- package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/npmVersionCheck.test.js +185 -0
- package/codeyam-cli/src/utils/__tests__/npmVersionCheck.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js +129 -0
- package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/pathIgnoring.test.js +9 -0
- package/codeyam-cli/src/utils/__tests__/pathIgnoring.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/project.test.js +65 -0
- package/codeyam-cli/src/utils/__tests__/project.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/routePatternMatching.test.js +118 -0
- package/codeyam-cli/src/utils/__tests__/routePatternMatching.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/scenarioCoverage.test.js +227 -0
- package/codeyam-cli/src/utils/__tests__/scenarioCoverage.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/scenarioMarkers.test.js +121 -0
- package/codeyam-cli/src/utils/__tests__/scenarioMarkers.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js +493 -0
- package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/serverVersionStaleness.test.js +81 -0
- package/codeyam-cli/src/utils/__tests__/serverVersionStaleness.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +175 -82
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js +51 -0
- package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/webappDetection.test.js +142 -0
- package/codeyam-cli/src/utils/__tests__/webappDetection.test.js.map +1 -0
- package/codeyam-cli/src/utils/analysisRunner.js +32 -16
- package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
- package/codeyam-cli/src/utils/analyzer.js +16 -0
- package/codeyam-cli/src/utils/analyzer.js.map +1 -1
- package/codeyam-cli/src/utils/analyzerFinalization.js +100 -0
- package/codeyam-cli/src/utils/analyzerFinalization.js.map +1 -0
- package/codeyam-cli/src/utils/backgroundServer.js +202 -29
- package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/utils/buildFlags.js +4 -0
- package/codeyam-cli/src/utils/buildFlags.js.map +1 -0
- package/codeyam-cli/src/utils/database.js +37 -2
- package/codeyam-cli/src/utils/database.js.map +1 -1
- package/codeyam-cli/src/utils/devModeEvents.js +40 -0
- package/codeyam-cli/src/utils/devModeEvents.js.map +1 -0
- package/codeyam-cli/src/utils/devServerState.js +71 -0
- package/codeyam-cli/src/utils/devServerState.js.map +1 -0
- package/codeyam-cli/src/utils/editorApi.js +79 -0
- package/codeyam-cli/src/utils/editorApi.js.map +1 -0
- package/codeyam-cli/src/utils/editorAudit.js +210 -0
- package/codeyam-cli/src/utils/editorAudit.js.map +1 -0
- package/codeyam-cli/src/utils/editorBroadcastViewport.js +26 -0
- package/codeyam-cli/src/utils/editorBroadcastViewport.js.map +1 -0
- package/codeyam-cli/src/utils/editorCapture.js +102 -0
- package/codeyam-cli/src/utils/editorCapture.js.map +1 -0
- package/codeyam-cli/src/utils/editorDeleteScenario.js +67 -0
- package/codeyam-cli/src/utils/editorDeleteScenario.js.map +1 -0
- package/codeyam-cli/src/utils/editorDevServer.js +197 -0
- package/codeyam-cli/src/utils/editorDevServer.js.map +1 -0
- package/codeyam-cli/src/utils/editorEntityChangeStatus.js +44 -0
- package/codeyam-cli/src/utils/editorEntityChangeStatus.js.map +1 -0
- package/codeyam-cli/src/utils/editorEntityHelpers.js +129 -0
- package/codeyam-cli/src/utils/editorEntityHelpers.js.map +1 -0
- package/codeyam-cli/src/utils/editorImageVerifier.js +155 -0
- package/codeyam-cli/src/utils/editorImageVerifier.js.map +1 -0
- package/codeyam-cli/src/utils/editorJournal.js +225 -0
- package/codeyam-cli/src/utils/editorJournal.js.map +1 -0
- package/codeyam-cli/src/utils/editorLoaderHelpers.js +152 -0
- package/codeyam-cli/src/utils/editorLoaderHelpers.js.map +1 -0
- package/codeyam-cli/src/utils/editorMigration.js +224 -0
- package/codeyam-cli/src/utils/editorMigration.js.map +1 -0
- package/codeyam-cli/src/utils/editorMockState.js +248 -0
- package/codeyam-cli/src/utils/editorMockState.js.map +1 -0
- package/codeyam-cli/src/utils/editorPreloadHelpers.js +135 -0
- package/codeyam-cli/src/utils/editorPreloadHelpers.js.map +1 -0
- package/codeyam-cli/src/utils/editorPreview.js +137 -0
- package/codeyam-cli/src/utils/editorPreview.js.map +1 -0
- package/codeyam-cli/src/utils/editorScenarioSwitch.js +112 -0
- package/codeyam-cli/src/utils/editorScenarioSwitch.js.map +1 -0
- package/codeyam-cli/src/utils/editorScenarios.js +548 -0
- package/codeyam-cli/src/utils/editorScenarios.js.map +1 -0
- package/codeyam-cli/src/utils/editorSeedAdapter.js +422 -0
- package/codeyam-cli/src/utils/editorSeedAdapter.js.map +1 -0
- package/codeyam-cli/src/utils/editorShouldRevalidate.js +21 -0
- package/codeyam-cli/src/utils/editorShouldRevalidate.js.map +1 -0
- package/codeyam-cli/src/utils/entityChangeStatus.js +366 -0
- package/codeyam-cli/src/utils/entityChangeStatus.js.map +1 -0
- package/codeyam-cli/src/utils/entityChangeStatus.server.js +196 -0
- package/codeyam-cli/src/utils/entityChangeStatus.server.js.map +1 -0
- package/codeyam-cli/src/utils/fileMetadata.js +5 -0
- package/codeyam-cli/src/utils/fileMetadata.js.map +1 -1
- package/codeyam-cli/src/utils/fileWatcher.js +63 -9
- package/codeyam-cli/src/utils/fileWatcher.js.map +1 -1
- package/codeyam-cli/src/utils/generateReport.js +4 -3
- package/codeyam-cli/src/utils/generateReport.js.map +1 -1
- package/codeyam-cli/src/utils/git.js +103 -0
- package/codeyam-cli/src/utils/git.js.map +1 -1
- package/codeyam-cli/src/utils/install-skills.js +129 -39
- package/codeyam-cli/src/utils/install-skills.js.map +1 -1
- package/codeyam-cli/src/utils/interactiveSyncWatcher.js +126 -0
- package/codeyam-cli/src/utils/interactiveSyncWatcher.js.map +1 -0
- 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/parseRegisterArg.js +31 -0
- package/codeyam-cli/src/utils/parseRegisterArg.js.map +1 -0
- package/codeyam-cli/src/utils/pathIgnoring.js +19 -7
- package/codeyam-cli/src/utils/pathIgnoring.js.map +1 -1
- package/codeyam-cli/src/utils/progress.js +8 -1
- package/codeyam-cli/src/utils/progress.js.map +1 -1
- package/codeyam-cli/src/utils/project.js +15 -5
- package/codeyam-cli/src/utils/project.js.map +1 -1
- package/codeyam-cli/src/utils/queue/__tests__/heartbeat.test.js +11 -11
- package/codeyam-cli/src/utils/queue/__tests__/heartbeat.test.js.map +1 -1
- package/codeyam-cli/src/utils/queue/__tests__/manager.test.js +22 -0
- package/codeyam-cli/src/utils/queue/__tests__/manager.test.js.map +1 -1
- package/codeyam-cli/src/utils/queue/heartbeat.js +13 -5
- package/codeyam-cli/src/utils/queue/heartbeat.js.map +1 -1
- package/codeyam-cli/src/utils/queue/job.js +75 -1
- package/codeyam-cli/src/utils/queue/job.js.map +1 -1
- package/codeyam-cli/src/utils/queue/manager.js +7 -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/routePatternMatching.js +129 -0
- package/codeyam-cli/src/utils/routePatternMatching.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 +229 -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 +113 -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__/parser.test.js +83 -0
- package/codeyam-cli/src/utils/rules/__tests__/parser.test.js.map +1 -0
- package/codeyam-cli/src/utils/rules/__tests__/pathMatcher.test.js +118 -0
- package/codeyam-cli/src/utils/rules/__tests__/pathMatcher.test.js.map +1 -0
- package/codeyam-cli/src/utils/rules/__tests__/rulePlacement.test.js +72 -0
- package/codeyam-cli/src/utils/rules/__tests__/rulePlacement.test.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/__tests__/sourceFiles.test.js +76 -0
- package/codeyam-cli/src/utils/rules/__tests__/sourceFiles.test.js.map +1 -0
- package/codeyam-cli/src/utils/rules/index.js +7 -0
- package/codeyam-cli/src/utils/rules/index.js.map +1 -0
- package/codeyam-cli/src/utils/rules/parser.js +93 -0
- package/codeyam-cli/src/utils/rules/parser.js.map +1 -0
- package/codeyam-cli/src/utils/rules/pathMatcher.js +49 -0
- package/codeyam-cli/src/utils/rules/pathMatcher.js.map +1 -0
- package/codeyam-cli/src/utils/rules/rulePlacement.js +65 -0
- package/codeyam-cli/src/utils/rules/rulePlacement.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/sourceFiles.js +43 -0
- package/codeyam-cli/src/utils/rules/sourceFiles.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/scenarioCoverage.js +74 -0
- package/codeyam-cli/src/utils/scenarioCoverage.js.map +1 -0
- package/codeyam-cli/src/utils/scenarioMarkers.js +134 -0
- package/codeyam-cli/src/utils/scenarioMarkers.js.map +1 -0
- package/codeyam-cli/src/utils/scenariosManifest.js +249 -0
- package/codeyam-cli/src/utils/scenariosManifest.js.map +1 -0
- package/codeyam-cli/src/utils/serverState.js +94 -12
- package/codeyam-cli/src/utils/serverState.js.map +1 -1
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +96 -45
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
- package/codeyam-cli/src/utils/simulationGateMiddleware.js +166 -0
- package/codeyam-cli/src/utils/simulationGateMiddleware.js.map +1 -0
- package/codeyam-cli/src/utils/slugUtils.js +25 -0
- package/codeyam-cli/src/utils/slugUtils.js.map +1 -0
- package/codeyam-cli/src/utils/syncMocksMiddleware.js +7 -26
- package/codeyam-cli/src/utils/syncMocksMiddleware.js.map +1 -1
- package/codeyam-cli/src/utils/testRunner.js +158 -0
- package/codeyam-cli/src/utils/testRunner.js.map +1 -0
- package/codeyam-cli/src/utils/transcriptPruning.js +67 -0
- package/codeyam-cli/src/utils/transcriptPruning.js.map +1 -0
- package/codeyam-cli/src/utils/versionInfo.js +67 -15
- package/codeyam-cli/src/utils/versionInfo.js.map +1 -1
- package/codeyam-cli/src/utils/webappDetection.js +35 -2
- package/codeyam-cli/src/utils/webappDetection.js.map +1 -1
- package/codeyam-cli/src/webserver/__tests__/buildPtyEnv.test.js +35 -0
- package/codeyam-cli/src/webserver/__tests__/buildPtyEnv.test.js.map +1 -0
- package/codeyam-cli/src/webserver/__tests__/clientErrors.test.js +40 -0
- package/codeyam-cli/src/webserver/__tests__/clientErrors.test.js.map +1 -0
- 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/__tests__/editorProxy.test.js +567 -0
- package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js.map +1 -0
- package/codeyam-cli/src/webserver/__tests__/idleDetector.test.js +146 -0
- package/codeyam-cli/src/webserver/__tests__/idleDetector.test.js.map +1 -0
- package/codeyam-cli/src/webserver/app/lib/clientErrors.js +65 -0
- package/codeyam-cli/src/webserver/app/lib/clientErrors.js.map +1 -0
- package/codeyam-cli/src/webserver/app/lib/database.js +63 -33
- 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/app/lib/git.js +397 -0
- package/codeyam-cli/src/webserver/app/lib/git.js.map +1 -0
- package/codeyam-cli/src/webserver/app/types/editor.js +8 -0
- package/codeyam-cli/src/webserver/app/types/editor.js.map +1 -0
- package/codeyam-cli/src/webserver/backgroundServer.js +182 -18
- 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-CzTDWkF2.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/EntityItem-BFbq6iFk.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/EntityTypeBadge-CQgyEGV-.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-B6OMi58N.js +41 -0
- package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-DuYodzo1.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-CXo9EeCl.js +25 -0
- package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-DYCNb2It.js +3 -0
- package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-B0GLXMsr.js → LoadingDots-By5zI316.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-xgeCVgSM.js → LogViewer-CZgY3sxX.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-CnYYwRDw.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-CDoF7ZpU.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-DrnfvaLL.js +10 -0
- package/codeyam-cli/src/webserver/build/client/assets/Spinner-Df3UCi8k.js +34 -0
- package/codeyam-cli/src/webserver/build/client/assets/TruncatedFilePath-CK7-NaPZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/ViewportInspectBar-DRKR9T0U.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/_index-ClR-g3tY.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-DTH6ydEA.js +27 -0
- package/codeyam-cli/src/webserver/build/client/assets/addon-canvas-DpzMmAy5.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/addon-fit-YJmn1quW.js +12 -0
- package/codeyam-cli/src/webserver/build/client/assets/addon-web-links-74hnHF59.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/addon-webgl-DI8QOUvO.js +58 -0
- package/codeyam-cli/src/webserver/build/client/assets/agent-transcripts-B8CYhCO9.js +22 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-capture-scenario-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-client-errors-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-commit-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-dev-server-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-entity-status-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-file-diff-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-file-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-entry-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-image._-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-screenshot-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-update-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-load-commit-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-project-info-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-refresh-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-register-scenario-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-rename-scenario-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-save-seed-state-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-coverage-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-data-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-image._-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-prompt-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenarios-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-session-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-switch-scenario-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-test-results-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.rule-path-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-CLaoh4ac.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-Cx24_aWc.js → chevron-down-BZ2DZxbW.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/chunk-JZWAC4HX-BBXArFPl.js +43 -0
- package/codeyam-cli/src/webserver/build/client/assets/{circle-check-BOARzkeR.js → circle-check-CT4unAk-.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/copy-zK0B6Nu-.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-DJB0YQJL.js +41 -0
- package/codeyam-cli/src/webserver/build/client/assets/{cy-logo-cli-C1gnJVOL.svg → cy-logo-cli-CCKUIm0S.svg} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/cy-logo-cli-DcX-ZS3p.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-CkXFP_i-.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/editor._tab-DPw7NZHc.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/editor.entity.(_sha)-B2KVBVj4.js +58 -0
- package/codeyam-cli/src/webserver/build/client/assets/editorPreview-DBa7T2FK.js +41 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-D0-YwkBh.js → entity._sha._-BqAN7hyG.js} +13 -13
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-BOi8kpwd.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-Dg1NhIms.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-CJX6kkkV.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-C1H_a_Y3.js → entity._sha_.edit._scenarioId-BhVjZhKg.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{entry.client-CS2cb_eZ.js → entry.client-_gzKltPN.js} +6 -6
- package/codeyam-cli/src/webserver/build/client/assets/executionFlowCoverage-BWhdfn70.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-Daa96Fr1.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/files-CV_17tZS.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/git-D-YXmMbR.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/globals-CGrDAxj0.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/index-Blo6EK8G.js +15 -0
- package/codeyam-cli/src/webserver/build/client/assets/{index-B1h680n5.js → index-BsX0F-9C.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{index-lzqtyFU8.js → index-CCrgCshv.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/jsx-runtime-D_zvdyIk.js +9 -0
- package/codeyam-cli/src/webserver/build/client/assets/labs-Byazq8Pv.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-B7B9V-bu.js → loader-circle-DVQ0oHR7.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/manifest-a6273a24.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/memory-b-VmA2Vj.js +101 -0
- package/codeyam-cli/src/webserver/build/client/assets/pause-DGcndCAa.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/root-D5Zi3U2Z.js +67 -0
- package/codeyam-cli/src/webserver/build/client/assets/{search-CxXUmBSd.js → search-C0Uw0bcK.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/settings-OoNgHIfW.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/simulations-Bcemfu8a.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/terminal-BgMmG7R9.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-B6LgvRJg.js → triangle-alert-Cs87hJYK.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-BR3Rs7JY.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-BxxP_XF9.js +2 -0
- package/codeyam-cli/src/webserver/build/client/assets/useReportContext-BermyNU5.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/useToast-a_QN_W9_.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/xterm-BqvuqXEL.js +27 -0
- package/codeyam-cli/src/webserver/build/client/sound-test.html +98 -0
- package/codeyam-cli/src/webserver/build/server/assets/analysisRunner-H_bGKza6.js +13 -0
- package/codeyam-cli/src/webserver/build/server/assets/index-BjsaHnnW.js +1 -0
- package/codeyam-cli/src/webserver/build/server/assets/init-CmahXA_a.js +10 -0
- package/codeyam-cli/src/webserver/build/server/assets/progress-CHTtrxFG.js +1 -0
- package/codeyam-cli/src/webserver/build/server/assets/server-build-BYvtz6_N.js +501 -0
- package/codeyam-cli/src/webserver/build/server/index.js +1 -1
- package/codeyam-cli/src/webserver/build-info.json +5 -5
- package/codeyam-cli/src/webserver/devServer.js +39 -5
- package/codeyam-cli/src/webserver/devServer.js.map +1 -1
- package/codeyam-cli/src/webserver/editorProxy.js +901 -0
- package/codeyam-cli/src/webserver/editorProxy.js.map +1 -0
- package/codeyam-cli/src/webserver/idleDetector.js +73 -0
- package/codeyam-cli/src/webserver/idleDetector.js.map +1 -0
- package/codeyam-cli/src/webserver/mockStateEvents.js +28 -0
- package/codeyam-cli/src/webserver/mockStateEvents.js.map +1 -0
- package/codeyam-cli/src/webserver/public/sound-test.html +98 -0
- package/codeyam-cli/src/webserver/scripts/codeyam-preload.mjs +414 -0
- package/codeyam-cli/src/webserver/scripts/journalCapture.ts +230 -0
- package/codeyam-cli/src/webserver/server.js +344 -26
- package/codeyam-cli/src/webserver/server.js.map +1 -1
- package/codeyam-cli/src/webserver/terminalServer.js +831 -0
- package/codeyam-cli/src/webserver/terminalServer.js.map +1 -0
- package/codeyam-cli/templates/chrome-extension-react/EXTENSION_SETUP.md +75 -0
- package/codeyam-cli/templates/chrome-extension-react/README.md +46 -0
- package/codeyam-cli/templates/chrome-extension-react/gitignore +15 -0
- package/codeyam-cli/templates/chrome-extension-react/index.html +12 -0
- package/codeyam-cli/templates/chrome-extension-react/package.json +27 -0
- package/codeyam-cli/templates/chrome-extension-react/popup.html +12 -0
- package/codeyam-cli/templates/chrome-extension-react/public/manifest.json +15 -0
- package/codeyam-cli/templates/chrome-extension-react/src/background/service-worker.ts +7 -0
- package/codeyam-cli/templates/chrome-extension-react/src/globals.css +6 -0
- package/codeyam-cli/templates/chrome-extension-react/src/lib/storage.ts +37 -0
- package/codeyam-cli/templates/chrome-extension-react/src/popup/App.tsx +12 -0
- package/codeyam-cli/templates/chrome-extension-react/src/popup/main.tsx +10 -0
- package/codeyam-cli/templates/chrome-extension-react/tsconfig.json +24 -0
- package/codeyam-cli/templates/chrome-extension-react/vite.config.ts +41 -0
- package/codeyam-cli/templates/codeyam-editor-claude.md +147 -0
- package/codeyam-cli/templates/codeyam-memory-hook.sh +199 -0
- package/codeyam-cli/templates/commands/codeyam-diagnose.md +481 -0
- package/codeyam-cli/templates/editor-step-hook.py +321 -0
- package/codeyam-cli/templates/expo-react-native/MOBILE_SETUP.md +89 -0
- package/codeyam-cli/templates/expo-react-native/README.md +41 -0
- package/codeyam-cli/templates/expo-react-native/app/(tabs)/_layout.tsx +33 -0
- package/codeyam-cli/templates/expo-react-native/app/(tabs)/index.tsx +12 -0
- package/codeyam-cli/templates/expo-react-native/app/(tabs)/settings.tsx +12 -0
- package/codeyam-cli/templates/expo-react-native/app/_layout.tsx +12 -0
- package/codeyam-cli/templates/expo-react-native/app.json +18 -0
- package/codeyam-cli/templates/expo-react-native/babel.config.js +9 -0
- package/codeyam-cli/templates/expo-react-native/gitignore +12 -0
- package/codeyam-cli/templates/expo-react-native/global.css +3 -0
- package/codeyam-cli/templates/expo-react-native/lib/storage.ts +32 -0
- package/codeyam-cli/templates/expo-react-native/metro.config.js +6 -0
- package/codeyam-cli/templates/expo-react-native/nativewind-env.d.ts +1 -0
- package/codeyam-cli/templates/expo-react-native/package.json +38 -0
- package/codeyam-cli/templates/expo-react-native/tailwind.config.js +10 -0
- package/codeyam-cli/templates/expo-react-native/tsconfig.json +10 -0
- package/codeyam-cli/templates/hooks/staleness-check.sh +43 -0
- package/codeyam-cli/templates/isolation-route/next-app.tsx.template +80 -0
- package/codeyam-cli/templates/isolation-route/next-pages.tsx.template +79 -0
- package/codeyam-cli/templates/isolation-route/vite-react.tsx.template +78 -0
- package/codeyam-cli/templates/msw/browser-setup.ts.template +47 -0
- package/codeyam-cli/templates/msw/handler-router.ts.template +47 -0
- package/codeyam-cli/templates/msw/server-setup.ts.template +52 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/AUTH_PATTERNS.md +308 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/AUTH_UPGRADE.md +304 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/DATABASE.md +126 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/FEATURE_PATTERNS.md +37 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/README.md +53 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/app/api/todos/route.ts +17 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/app/codeyam-isolate/layout.tsx +12 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/app/globals.css +26 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/app/layout.tsx +34 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/app/lib/prisma.ts +24 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/app/page.tsx +10 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/env +4 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/eslint.config.mjs +11 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/gitignore +64 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/next.config.ts +14 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/package.json +39 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/postcss.config.mjs +7 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma/schema.prisma +27 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma/seed.ts +40 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma.config.ts +12 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/seed-adapter.ts +127 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/tsconfig.json +34 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/vitest.config.ts +13 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/README.md +52 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/SUPABASE_SETUP.md +104 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/app/api/todos/route.ts +17 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/app/globals.css +26 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/app/layout.tsx +34 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/app/lib/prisma.ts +20 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/app/lib/supabase.ts +12 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/app/page.tsx +10 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/env +9 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/eslint.config.mjs +11 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/gitignore +40 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/next.config.ts +11 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/package.json +37 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/postcss.config.mjs +7 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/prisma/schema.prisma +27 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/prisma/seed.ts +39 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/prisma.config.ts +12 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/tsconfig.json +34 -0
- package/codeyam-cli/templates/prompts/conversation-guidance.txt +44 -0
- package/codeyam-cli/templates/prompts/conversation-prompt.txt +28 -0
- package/codeyam-cli/templates/prompts/interruption-prompt.txt +31 -0
- package/codeyam-cli/templates/prompts/stale-rules-prompt.txt +24 -0
- package/codeyam-cli/templates/rule-notification-hook.py +83 -0
- package/codeyam-cli/templates/rule-reflection-hook.py +647 -0
- package/codeyam-cli/templates/rules-instructions.md +78 -0
- package/codeyam-cli/templates/seed-adapters/supabase.ts +282 -0
- package/codeyam-cli/templates/{codeyam-debug-skill.md → skills/codeyam-debug/SKILL.md} +48 -4
- package/codeyam-cli/templates/skills/codeyam-dev-mode/SKILL.md +237 -0
- package/codeyam-cli/templates/skills/codeyam-editor/SKILL.md +211 -0
- package/codeyam-cli/templates/skills/codeyam-memory/SKILL.md +611 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/deprecated-prompt.md +100 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/detect-deprecated-patterns.mjs +139 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/find-exports.mjs +52 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/misleading-api-prompt.md +117 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/read-json-field.mjs +61 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/ripgrep-fallback.mjs +155 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/analyze-prompt.md +46 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/cleanup.mjs +13 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/filter-session.mjs +95 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/preprocess.mjs +160 -0
- package/codeyam-cli/templates/skills/codeyam-new-rule/SKILL.md +11 -0
- package/codeyam-cli/templates/{codeyam-setup-skill.md → skills/codeyam-setup/SKILL.md} +13 -1
- package/codeyam-cli/templates/{codeyam-sim-skill.md → skills/codeyam-sim/SKILL.md} +1 -1
- package/codeyam-cli/templates/{codeyam-test-skill.md → skills/codeyam-test/SKILL.md} +1 -1
- package/codeyam-cli/templates/{codeyam-verify-skill.md → skills/codeyam-verify/SKILL.md} +1 -1
- package/package.json +32 -22
- package/packages/ai/index.js +8 -6
- package/packages/ai/index.js.map +1 -1
- package/packages/ai/src/lib/analyzeScope.js +179 -13
- 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 +160 -13
- package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js.map +1 -1
- package/packages/ai/src/lib/astScopes/conditionalEffectsExtractor.js +435 -0
- package/packages/ai/src/lib/astScopes/conditionalEffectsExtractor.js.map +1 -0
- package/packages/ai/src/lib/astScopes/methodSemantics.js +138 -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/ifStatementHandler.js +8 -0
- package/packages/ai/src/lib/astScopes/patterns/ifStatementHandler.js.map +1 -1
- package/packages/ai/src/lib/astScopes/patterns/switchStatementHandler.js +7 -0
- package/packages/ai/src/lib/astScopes/patterns/switchStatementHandler.js.map +1 -1
- package/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.js +138 -1
- package/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.js.map +1 -1
- package/packages/ai/src/lib/astScopes/processExpression.js +931 -29
- 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 +188 -38
- package/packages/ai/src/lib/completionCall.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +1600 -189
- 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 +111 -14
- 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/coercePrimitivesToArraysBySchema.js +54 -0
- package/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.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 -81
- 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/dataStructure/helpers/stripNullableMarkers.js +34 -0
- package/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.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/generateChangesEntityScenarioData.js +4 -3
- package/packages/ai/src/lib/generateChangesEntityScenarioData.js.map +1 -1
- package/packages/ai/src/lib/generateChangesEntityScenarios.js +78 -120
- package/packages/ai/src/lib/generateChangesEntityScenarios.js.map +1 -1
- package/packages/ai/src/lib/generateEntityDataStructure.js +47 -2
- package/packages/ai/src/lib/generateEntityDataStructure.js.map +1 -1
- package/packages/ai/src/lib/generateEntityScenarioData.js +1153 -60
- package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
- package/packages/ai/src/lib/generateEntityScenarios.js +177 -163
- package/packages/ai/src/lib/generateEntityScenarios.js.map +1 -1
- package/packages/ai/src/lib/generateExecutionFlows.js +484 -0
- package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.js +380 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.js.map +1 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js +1807 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js.map +1 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.js +194 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.js.map +1 -0
- package/packages/ai/src/lib/guessScenarioDataFromDescription.js +2 -2
- package/packages/ai/src/lib/guessScenarioDataFromDescription.js.map +1 -1
- package/packages/ai/src/lib/isolateScopes.js +270 -7
- 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 +88 -46
- 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/generateChangesEntityScenarioDataGenerator.js +1 -1
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js +21 -119
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateChunkPrompt.js +54 -0
- package/packages/ai/src/lib/promptGenerators/generateChunkPrompt.js.map +1 -0
- package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js +83 -6
- package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.js +10 -70
- package/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateMissingKeysPrompt.js +45 -0
- package/packages/ai/src/lib/promptGenerators/generateMissingKeysPrompt.js.map +1 -0
- package/packages/ai/src/lib/promptGenerators/guessNewScenarioDataFromDescriptionGenerator.js +9 -9
- package/packages/ai/src/lib/promptGenerators/guessNewScenarioDataFromDescriptionGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/simplifyKeysForLLM.js +335 -0
- package/packages/ai/src/lib/promptGenerators/simplifyKeysForLLM.js.map +1 -0
- package/packages/ai/src/lib/resolvePathToControllable.js +677 -0
- package/packages/ai/src/lib/resolvePathToControllable.js.map +1 -0
- package/packages/ai/src/lib/splitOutsideParentheses.js +3 -1
- package/packages/ai/src/lib/splitOutsideParentheses.js.map +1 -1
- package/packages/ai/src/lib/worker/SerializableDataStructure.js +29 -0
- package/packages/ai/src/lib/worker/SerializableDataStructure.js.map +1 -1
- package/packages/ai/src/lib/worker/analyzeScopeWorker.js +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 +109 -30
- 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/index.js +4 -2
- package/packages/analyze/src/lib/asts/index.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 +189 -41
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +28 -4
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js +9 -0
- package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.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/analyzeChange.js +10 -10
- package/packages/analyze/src/lib/files/analyzeChange.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeEntity.js +4 -4
- package/packages/analyze/src/lib/files/analyzeEntity.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeInitial.js +9 -10
- package/packages/analyze/src/lib/files/analyzeInitial.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeRemixRoute.js +3 -2
- package/packages/analyze/src/lib/files/analyzeRemixRoute.js.map +1 -1
- package/packages/analyze/src/lib/files/enums/steps.js +1 -1
- package/packages/analyze/src/lib/files/enums/steps.js.map +1 -1
- package/packages/analyze/src/lib/files/getImportedExports.js +11 -7
- package/packages/analyze/src/lib/files/getImportedExports.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js +907 -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 +178 -31
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.js +29 -129
- package/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +252 -21
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js +104 -0
- package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js.map +1 -0
- package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js +1 -0
- package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateScenarios.js +2 -3
- package/packages/analyze/src/lib/files/scenarios/generateScenarios.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +686 -55
- 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/index.js +1 -0
- package/packages/database/index.js.map +1 -1
- 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 +16 -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/debugReportsTable.js.map +1 -1
- package/packages/database/src/lib/kysely/tables/editorScenariosTable.js +149 -0
- package/packages/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -0
- 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 +45 -14
- package/packages/database/src/lib/loadCommits.js.map +1 -1
- package/packages/database/src/lib/loadEntities.js +23 -10
- 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/loadReadyToBeCapturedAnalyses.js +5 -5
- package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.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 +76 -89
- package/packages/database/src/lib/updateCommitMetadata.js.map +1 -1
- package/packages/database/src/lib/updateFreshAnalysisStatus.js +41 -30
- package/packages/database/src/lib/updateFreshAnalysisStatus.js.map +1 -1
- package/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.js +68 -57
- package/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.js.map +1 -1
- package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +29 -1
- package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -1
- package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +33 -5
- package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
- package/packages/types/index.js +0 -1
- package/packages/types/index.js.map +1 -1
- package/packages/types/src/enums/ProjectFramework.js +2 -0
- package/packages/types/src/enums/ProjectFramework.js.map +1 -1
- package/packages/types/src/types/Scenario.js +1 -21
- package/packages/types/src/types/Scenario.js.map +1 -1
- package/packages/utils/src/lib/fs/rsyncCopy.js +98 -3
- 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/npm-post-install.cjs +34 -0
- package/analyzer-template/packages/ai/src/lib/findMatchingAttribute.ts +0 -109
- package/analyzer-template/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.ts +0 -584
- package/analyzer-template/packages/ai/src/lib/generateChangesEntityKeyAttributes.ts +0 -341
- package/analyzer-template/packages/ai/src/lib/generateEntityKeyAttributes.ts +0 -495
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityKeyAttributesGenerator.ts +0 -67
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.ts +0 -120
- package/codeyam-cli/src/commands/detect-universal-mocks.js +0 -118
- package/codeyam-cli/src/commands/detect-universal-mocks.js.map +0 -1
- package/codeyam-cli/src/commands/list.js +0 -31
- package/codeyam-cli/src/commands/list.js.map +0 -1
- package/codeyam-cli/src/commands/webapp-info.js +0 -146
- package/codeyam-cli/src/commands/webapp-info.js.map +0 -1
- package/codeyam-cli/src/utils/universal-mocks.js +0 -152
- package/codeyam-cli/src/utils/universal-mocks.js.map +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityItem-Cmysw5OP.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityTypeBadge-DLqD3qNt.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-CAneekK2.js +0 -41
- package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-Cu16OUmx.js +0 -25
- package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-CVtiBnY5.js +0 -3
- package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-DcAUIpD_.js +0 -11
- package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-DuDvi0jm.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-BMKg0SAF.js +0 -15
- package/codeyam-cli/src/webserver/build/client/assets/TruncatedFilePath-DyFZkK0l.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/_index-DSmTpjmK.js +0 -11
- package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-BF_aK4y6.js +0 -32
- package/codeyam-cli/src/webserver/build/client/assets/chunk-EPOLDU6W-CXRTFQ3F.js +0 -51
- package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-BdhJEx6B.js +0 -21
- package/codeyam-cli/src/webserver/build/client/assets/cy-logo-cli-CKnwPCDr.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-RJCf3Tvw.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-EylcgScH.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-DMe7kvgo.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-DMJ7zii9.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/files-BW7Cyeyi.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/git-CZu4fif0.js +0 -15
- package/codeyam-cli/src/webserver/build/client/assets/globals-wHVy_II5.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/keyAttributeCoverage-CTlFMihX.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-2d191949.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/root-FHgpM6gc.js +0 -56
- package/codeyam-cli/src/webserver/build/client/assets/settings-6D8k8Jp5.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/simulations-CDJZnWhN.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-Dv18q8LD.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useInteractiveMode-0ToGk4K3.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-aSv48UbS.js +0 -2
- package/codeyam-cli/src/webserver/build/client/assets/useReportContext-1BX144Eg.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useToast-mBRpZPiu.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/index-pU0o5t1o.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-YzfkRwdn.js +0 -178
- package/codeyam-cli/templates/codeyam-stop-hook.sh +0 -284
- package/codeyam-cli/templates/debug-codeyam.md +0 -625
- package/packages/ai/src/lib/findMatchingAttribute.js +0 -81
- package/packages/ai/src/lib/findMatchingAttribute.js.map +0 -1
- package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js +0 -425
- package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js.map +0 -1
- package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js +0 -267
- package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js.map +0 -1
- package/packages/ai/src/lib/generateEntityKeyAttributes.js +0 -408
- package/packages/ai/src/lib/generateEntityKeyAttributes.js.map +0 -1
- package/packages/ai/src/lib/isFrontend.js +0 -5
- package/packages/ai/src/lib/isFrontend.js.map +0 -1
- package/packages/ai/src/lib/promptGenerators/generateEntityKeyAttributesGenerator.js +0 -40
- package/packages/ai/src/lib/promptGenerators/generateEntityKeyAttributesGenerator.js.map +0 -1
- package/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.js +0 -77
- package/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.js.map +0 -1
- package/scripts/finalize-analyzer.cjs +0 -81
- /package/codeyam-cli/src/webserver/build/client/assets/{api.link-scenario-value-l0sNRNKZ.js → api.agent-transcripts-l0sNRNKZ.js} +0 -0
- /package/codeyam-cli/src/webserver/build/client/assets/{api.update-key-attributes-l0sNRNKZ.js → api.dev-mode-events-l0sNRNKZ.js} +0 -0
- /package/codeyam-cli/src/webserver/build/client/assets/{api.update-valid-values-l0sNRNKZ.js → api.editor-audit-l0sNRNKZ.js} +0 -0
|
@@ -9,6 +9,7 @@ import { StructuredPath } from './paths';
|
|
|
9
9
|
import { nodeToSource } from './nodeToSource';
|
|
10
10
|
import { methodRegistry, ArrayPushSemantics } from './methodSemantics';
|
|
11
11
|
import {
|
|
12
|
+
getComparisonOperatorString,
|
|
12
13
|
isArithmeticOperator,
|
|
13
14
|
isAssignmentOperator,
|
|
14
15
|
isBitwiseCompoundOperator,
|
|
@@ -19,6 +20,321 @@ import {
|
|
|
19
20
|
unwrapExpression,
|
|
20
21
|
} from './sharedPatterns';
|
|
21
22
|
import { processBindingPattern } from './processBindings';
|
|
23
|
+
import {
|
|
24
|
+
extractConditionalEffectsFromTernary,
|
|
25
|
+
findUseStateSetters,
|
|
26
|
+
} from './conditionalEffectsExtractor';
|
|
27
|
+
import { detectArrayDerivedPattern } from './arrayDerivationDetector';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Recursively extracts root variable names from an expression AST node.
|
|
31
|
+
* Used to identify which variables flow into JSX expression children,
|
|
32
|
+
* so we can link them to the return value schema.
|
|
33
|
+
*
|
|
34
|
+
* Examples:
|
|
35
|
+
* - `filteredTopPaths.map(...)` → ['filteredTopPaths']
|
|
36
|
+
* - `a && b` → ['a', 'b']
|
|
37
|
+
* - `condition ? x : y` → ['condition', 'x', 'y']
|
|
38
|
+
*/
|
|
39
|
+
function extractRootVariableNames(node: ts.Expression): string[] {
|
|
40
|
+
const ignoredIdentifiers = new Set([
|
|
41
|
+
'undefined',
|
|
42
|
+
'null',
|
|
43
|
+
'true',
|
|
44
|
+
'false',
|
|
45
|
+
'NaN',
|
|
46
|
+
'Infinity',
|
|
47
|
+
]);
|
|
48
|
+
|
|
49
|
+
if (ts.isIdentifier(node)) {
|
|
50
|
+
const name = node.text;
|
|
51
|
+
return ignoredIdentifiers.has(name) ? [] : [name];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (ts.isPropertyAccessExpression(node)) {
|
|
55
|
+
return extractRootVariableNames(node.expression);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (ts.isCallExpression(node)) {
|
|
59
|
+
return extractRootVariableNames(node.expression);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (ts.isBinaryExpression(node)) {
|
|
63
|
+
return [
|
|
64
|
+
...extractRootVariableNames(node.left),
|
|
65
|
+
...extractRootVariableNames(node.right),
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (ts.isPrefixUnaryExpression(node)) {
|
|
70
|
+
return extractRootVariableNames(node.operand);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (ts.isConditionalExpression(node)) {
|
|
74
|
+
return [
|
|
75
|
+
...extractRootVariableNames(node.condition),
|
|
76
|
+
...extractRootVariableNames(node.whenTrue),
|
|
77
|
+
...extractRootVariableNames(node.whenFalse),
|
|
78
|
+
];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (ts.isParenthesizedExpression(node)) {
|
|
82
|
+
return extractRootVariableNames(node.expression);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Stop recursion at JSX elements and other terminal nodes
|
|
86
|
+
if (
|
|
87
|
+
ts.isJsxElement(node) ||
|
|
88
|
+
ts.isJsxFragment(node) ||
|
|
89
|
+
ts.isJsxSelfClosingElement(node)
|
|
90
|
+
) {
|
|
91
|
+
return [];
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return [];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Checks if a JSX element has props that reference variables from the parent scope.
|
|
99
|
+
* This is used to detect unconditionally-rendered children that should have their
|
|
100
|
+
* execution flows merged into the parent.
|
|
101
|
+
*
|
|
102
|
+
* We want to track children where the parent controls data that affects the child's
|
|
103
|
+
* conditional rendering. Static props (like title="Dashboard") don't need tracking
|
|
104
|
+
* because they don't create variable execution flows.
|
|
105
|
+
*
|
|
106
|
+
* Examples:
|
|
107
|
+
* - <WorkoutsView workouts={workouts} /> → true (workouts is a variable)
|
|
108
|
+
* - <ItemList items={items} count={count} /> → true (items, count are variables)
|
|
109
|
+
* - <Header title="Dashboard" /> → false (static string)
|
|
110
|
+
* - <Footer /> → false (no props)
|
|
111
|
+
* - <Button onClick={handleClick} /> → false (only callback, no data props)
|
|
112
|
+
*
|
|
113
|
+
* @returns true if the component has at least one prop that references a variable
|
|
114
|
+
* (excluding callbacks which typically start with 'on' or 'handle')
|
|
115
|
+
*/
|
|
116
|
+
function hasDataPropsFromParent(
|
|
117
|
+
node: ts.JsxElement | ts.JsxSelfClosingElement,
|
|
118
|
+
componentName: string,
|
|
119
|
+
): { hasDataProps: boolean; dataProps: string[] } {
|
|
120
|
+
const attributes = ts.isJsxElement(node)
|
|
121
|
+
? node.openingElement.attributes.properties
|
|
122
|
+
: node.attributes.properties;
|
|
123
|
+
|
|
124
|
+
const dataProps: string[] = [];
|
|
125
|
+
|
|
126
|
+
for (const attr of attributes) {
|
|
127
|
+
// Spread attributes always reference parent data: {...props}
|
|
128
|
+
if (ts.isJsxSpreadAttribute(attr)) {
|
|
129
|
+
const spreadText = attr.expression?.getText() || '...spread';
|
|
130
|
+
dataProps.push(`{...${spreadText}}`);
|
|
131
|
+
console.log(
|
|
132
|
+
`[UnconditionalChild] ${componentName}: Found spread attribute {${spreadText}}`,
|
|
133
|
+
);
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (ts.isJsxAttribute(attr)) {
|
|
138
|
+
const propName = attr.name.getText();
|
|
139
|
+
|
|
140
|
+
// Skip callback props - they don't create data-driven execution flows
|
|
141
|
+
// Callbacks typically start with 'on' (onClick, onChange) or 'handle' (handleSubmit)
|
|
142
|
+
if (
|
|
143
|
+
propName.startsWith('on') ||
|
|
144
|
+
propName.startsWith('handle') ||
|
|
145
|
+
propName === 'ref'
|
|
146
|
+
) {
|
|
147
|
+
console.log(
|
|
148
|
+
`[UnconditionalChild] ${componentName}: Skipping callback prop '${propName}'`,
|
|
149
|
+
);
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// Check if the prop value is a JSX expression (references a variable)
|
|
154
|
+
// vs a string literal which is static
|
|
155
|
+
if (attr.initializer) {
|
|
156
|
+
if (ts.isJsxExpression(attr.initializer)) {
|
|
157
|
+
// JSX expression like prop={value} - this references a variable
|
|
158
|
+
// Could be a simple identifier, property access, or more complex expression
|
|
159
|
+
const expression = attr.initializer.expression;
|
|
160
|
+
if (expression) {
|
|
161
|
+
// Skip if it's just a function/arrow function (callback)
|
|
162
|
+
if (
|
|
163
|
+
ts.isArrowFunction(expression) ||
|
|
164
|
+
ts.isFunctionExpression(expression)
|
|
165
|
+
) {
|
|
166
|
+
console.log(
|
|
167
|
+
`[UnconditionalChild] ${componentName}: Skipping inline callback prop '${propName}'`,
|
|
168
|
+
);
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
// This is a data prop that references parent state/props
|
|
172
|
+
const exprText = expression.getText();
|
|
173
|
+
dataProps.push(`${propName}={${exprText}}`);
|
|
174
|
+
console.log(
|
|
175
|
+
`[UnconditionalChild] ${componentName}: Found data prop '${propName}' = {${exprText}}`,
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
} else {
|
|
179
|
+
// String literals like prop="value" are static
|
|
180
|
+
console.log(
|
|
181
|
+
`[UnconditionalChild] ${componentName}: Skipping static prop '${propName}'`,
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const hasDataProps = dataProps.length > 0;
|
|
189
|
+
if (hasDataProps) {
|
|
190
|
+
console.log(
|
|
191
|
+
`[UnconditionalChild] ${componentName}: Has ${dataProps.length} data props: [${dataProps.join(', ')}]`,
|
|
192
|
+
);
|
|
193
|
+
} else {
|
|
194
|
+
console.log(
|
|
195
|
+
`[UnconditionalChild] ${componentName}: No data props found, will NOT track`,
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
return { hasDataProps, dataProps };
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Extracts the component name from a JSX element.
|
|
204
|
+
* Returns null for intrinsic elements (div, span, etc.) since we only care about
|
|
205
|
+
* custom components for gating condition tracking.
|
|
206
|
+
*
|
|
207
|
+
* Examples:
|
|
208
|
+
* - <ChildViewer /> → "ChildViewer"
|
|
209
|
+
* - <ScenarioViewer scenario={...} /> → "ScenarioViewer"
|
|
210
|
+
* - <div> → null (intrinsic element)
|
|
211
|
+
*/
|
|
212
|
+
function getComponentNameFromJsx(
|
|
213
|
+
node: ts.JsxElement | ts.JsxSelfClosingElement,
|
|
214
|
+
): string | null {
|
|
215
|
+
let tagName: ts.JsxTagNameExpression;
|
|
216
|
+
|
|
217
|
+
if (ts.isJsxElement(node)) {
|
|
218
|
+
tagName = node.openingElement.tagName;
|
|
219
|
+
} else {
|
|
220
|
+
tagName = node.tagName;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// Get the text of the tag name
|
|
224
|
+
const name = tagName.getText();
|
|
225
|
+
|
|
226
|
+
// Check if it's a custom component (starts with uppercase) vs intrinsic element
|
|
227
|
+
// Custom components start with uppercase: <MyComponent />
|
|
228
|
+
// Intrinsic elements start with lowercase: <div />
|
|
229
|
+
if (
|
|
230
|
+
name &&
|
|
231
|
+
name[0] === name[0].toUpperCase() &&
|
|
232
|
+
name[0] !== name[0].toLowerCase()
|
|
233
|
+
) {
|
|
234
|
+
return name;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
return null;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Extracts condition paths from a logical AND chain expression.
|
|
242
|
+
* Used for creating gating conditions for child components.
|
|
243
|
+
*
|
|
244
|
+
* Example: `hasData && isReady && <Component />` returns ['hasData', 'isReady']
|
|
245
|
+
*/
|
|
246
|
+
function extractConditionPathsFromAndChain(
|
|
247
|
+
expr: ts.Expression,
|
|
248
|
+
sourceFile: ts.SourceFile,
|
|
249
|
+
): string[] {
|
|
250
|
+
const paths: string[] = [];
|
|
251
|
+
const unwrapped = unwrapExpression(expr);
|
|
252
|
+
|
|
253
|
+
if (
|
|
254
|
+
ts.isBinaryExpression(unwrapped) &&
|
|
255
|
+
unwrapped.operatorToken.kind === ts.SyntaxKind.AmpersandAmpersandToken
|
|
256
|
+
) {
|
|
257
|
+
// Recursively get conditions from left side
|
|
258
|
+
paths.push(
|
|
259
|
+
...extractConditionPathsFromAndChain(unwrapped.left, sourceFile),
|
|
260
|
+
);
|
|
261
|
+
|
|
262
|
+
// Process right side if it's not JSX (JSX is the consequence, not a condition)
|
|
263
|
+
const rightUnwrapped = unwrapExpression(unwrapped.right);
|
|
264
|
+
if (
|
|
265
|
+
!ts.isJsxElement(rightUnwrapped) &&
|
|
266
|
+
!ts.isJsxSelfClosingElement(rightUnwrapped) &&
|
|
267
|
+
!ts.isJsxFragment(rightUnwrapped)
|
|
268
|
+
) {
|
|
269
|
+
paths.push(
|
|
270
|
+
...extractConditionPathsFromAndChain(unwrapped.right, sourceFile),
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
} else {
|
|
274
|
+
// Base case: extract path from this expression
|
|
275
|
+
const path = StructuredPath.fromNode(unwrapped, sourceFile);
|
|
276
|
+
if (path) {
|
|
277
|
+
paths.push(path.toString());
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
return paths;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Finds the rightmost JSX element in an && chain.
|
|
286
|
+
* Example: `a && b && <Component />` returns <Component />
|
|
287
|
+
*/
|
|
288
|
+
function findJsxInAndChain(
|
|
289
|
+
expr: ts.Expression,
|
|
290
|
+
): ts.JsxElement | ts.JsxSelfClosingElement | null {
|
|
291
|
+
const unwrapped = unwrapExpression(expr);
|
|
292
|
+
|
|
293
|
+
if (ts.isJsxElement(unwrapped) || ts.isJsxSelfClosingElement(unwrapped)) {
|
|
294
|
+
return unwrapped;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
if (
|
|
298
|
+
ts.isBinaryExpression(unwrapped) &&
|
|
299
|
+
unwrapped.operatorToken.kind === ts.SyntaxKind.AmpersandAmpersandToken
|
|
300
|
+
) {
|
|
301
|
+
// Check right side first (most common case: condition && <Jsx />)
|
|
302
|
+
const rightResult = findJsxInAndChain(unwrapped.right);
|
|
303
|
+
if (rightResult) return rightResult;
|
|
304
|
+
|
|
305
|
+
// Also check left side for rare cases
|
|
306
|
+
return findJsxInAndChain(unwrapped.left);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
return null;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Fix 32: Finds a JSX fragment in an && chain.
|
|
314
|
+
* Example: `activeTab && <><ChildA /><ChildB /></>` returns the fragment
|
|
315
|
+
* This is needed to propagate parent conditions through fragments.
|
|
316
|
+
*/
|
|
317
|
+
function findJsxFragmentInAndChain(expr: ts.Expression): ts.JsxFragment | null {
|
|
318
|
+
const unwrapped = unwrapExpression(expr);
|
|
319
|
+
|
|
320
|
+
if (ts.isJsxFragment(unwrapped)) {
|
|
321
|
+
return unwrapped;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
if (
|
|
325
|
+
ts.isBinaryExpression(unwrapped) &&
|
|
326
|
+
unwrapped.operatorToken.kind === ts.SyntaxKind.AmpersandAmpersandToken
|
|
327
|
+
) {
|
|
328
|
+
// Check right side first (most common case: condition && <></>)
|
|
329
|
+
const rightResult = findJsxFragmentInAndChain(unwrapped.right);
|
|
330
|
+
if (rightResult) return rightResult;
|
|
331
|
+
|
|
332
|
+
// Also check left side for rare cases
|
|
333
|
+
return findJsxFragmentInAndChain(unwrapped.left);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
return null;
|
|
337
|
+
}
|
|
22
338
|
|
|
23
339
|
/**
|
|
24
340
|
* Detects if a property access looks like an environment variable store access.
|
|
@@ -227,6 +543,149 @@ function getSourceLocation(
|
|
|
227
543
|
};
|
|
228
544
|
}
|
|
229
545
|
|
|
546
|
+
/**
|
|
547
|
+
* Extracts the root array path from an expression that ends with .map().
|
|
548
|
+
* Handles chained methods like .filter().map(), .slice().map(), etc.
|
|
549
|
+
*
|
|
550
|
+
* Examples:
|
|
551
|
+
* - items.map(...) → "items"
|
|
552
|
+
* - data.users.map(...) → "data.users"
|
|
553
|
+
* - items.filter(...).map(...) → "items"
|
|
554
|
+
* - items.slice(0, 5).map(...) → "items"
|
|
555
|
+
*/
|
|
556
|
+
function extractArrayPathFromMapCall(
|
|
557
|
+
expr: ts.CallExpression,
|
|
558
|
+
sourceFile: ts.SourceFile,
|
|
559
|
+
): string | null {
|
|
560
|
+
// Walk up the chain to find the root array
|
|
561
|
+
let current: ts.Expression = expr.expression;
|
|
562
|
+
|
|
563
|
+
while (ts.isPropertyAccessExpression(current)) {
|
|
564
|
+
const methodName = current.name.getText(sourceFile);
|
|
565
|
+
|
|
566
|
+
// Common array methods that return arrays (so we keep going up)
|
|
567
|
+
const arrayReturningMethods = [
|
|
568
|
+
'map',
|
|
569
|
+
'filter',
|
|
570
|
+
'slice',
|
|
571
|
+
'concat',
|
|
572
|
+
'flat',
|
|
573
|
+
'flatMap',
|
|
574
|
+
'reverse',
|
|
575
|
+
'sort',
|
|
576
|
+
'toReversed',
|
|
577
|
+
'toSorted',
|
|
578
|
+
'toSpliced',
|
|
579
|
+
];
|
|
580
|
+
|
|
581
|
+
if (arrayReturningMethods.includes(methodName)) {
|
|
582
|
+
const objectExpr = current.expression;
|
|
583
|
+
|
|
584
|
+
// If the object is a call expression (chained method), keep going
|
|
585
|
+
if (ts.isCallExpression(objectExpr)) {
|
|
586
|
+
current = objectExpr.expression;
|
|
587
|
+
} else {
|
|
588
|
+
// Found the root - it's an identifier or property access
|
|
589
|
+
const path = StructuredPath.fromNode(objectExpr, sourceFile);
|
|
590
|
+
return path ? path.toString() : null;
|
|
591
|
+
}
|
|
592
|
+
} else {
|
|
593
|
+
// Not an array method we recognize
|
|
594
|
+
break;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
return null;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* Extracts JSX rendering usages from a JSX expression.
|
|
603
|
+
* Detects:
|
|
604
|
+
* - array.map() calls → 'array-map' type
|
|
605
|
+
* - string interpolations (identifiers/property access) → 'text-interpolation' type
|
|
606
|
+
*
|
|
607
|
+
* Recursively searches inside && chains and ternary expressions.
|
|
608
|
+
*
|
|
609
|
+
* @param expr The expression inside {expr}
|
|
610
|
+
* @param context The analysis context
|
|
611
|
+
*/
|
|
612
|
+
function extractJsxRenderingUsage(
|
|
613
|
+
expr: ts.Expression,
|
|
614
|
+
context: AnalysisContext,
|
|
615
|
+
): void {
|
|
616
|
+
const unwrapped = unwrapExpression(expr);
|
|
617
|
+
const sourceLocation = getSourceLocation(expr, context.sourceFile);
|
|
618
|
+
|
|
619
|
+
// Detect array.map() calls
|
|
620
|
+
if (ts.isCallExpression(unwrapped)) {
|
|
621
|
+
const calleeExpr = unwrapped.expression;
|
|
622
|
+
|
|
623
|
+
if (ts.isPropertyAccessExpression(calleeExpr)) {
|
|
624
|
+
const methodName = calleeExpr.name.getText(context.sourceFile);
|
|
625
|
+
|
|
626
|
+
if (methodName === 'map') {
|
|
627
|
+
const arrayPath = extractArrayPathFromMapCall(
|
|
628
|
+
unwrapped,
|
|
629
|
+
context.sourceFile,
|
|
630
|
+
);
|
|
631
|
+
|
|
632
|
+
if (arrayPath) {
|
|
633
|
+
context.addJsxRenderingUsage({
|
|
634
|
+
path: arrayPath,
|
|
635
|
+
renderingType: 'array-map',
|
|
636
|
+
valueType: 'array',
|
|
637
|
+
sourceLocation,
|
|
638
|
+
});
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
// Detect simple string interpolations: {title} or {user.name}
|
|
644
|
+
else if (
|
|
645
|
+
ts.isIdentifier(unwrapped) ||
|
|
646
|
+
ts.isPropertyAccessExpression(unwrapped)
|
|
647
|
+
) {
|
|
648
|
+
const path = StructuredPath.fromNode(unwrapped, context.sourceFile);
|
|
649
|
+
|
|
650
|
+
if (path) {
|
|
651
|
+
const pathStr = path.toString();
|
|
652
|
+
const typeInfo = context.getTypeInfo(path);
|
|
653
|
+
|
|
654
|
+
// Only track as text interpolation if it's a string type
|
|
655
|
+
// Check for 'string' type, or types that contain 'string' (but not 'string[]')
|
|
656
|
+
if (
|
|
657
|
+
typeInfo === 'string' ||
|
|
658
|
+
(typeInfo &&
|
|
659
|
+
typeInfo.includes('string') &&
|
|
660
|
+
!typeInfo.includes('string[]'))
|
|
661
|
+
) {
|
|
662
|
+
context.addJsxRenderingUsage({
|
|
663
|
+
path: pathStr,
|
|
664
|
+
renderingType: 'text-interpolation',
|
|
665
|
+
valueType: 'string',
|
|
666
|
+
sourceLocation,
|
|
667
|
+
});
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
// Recursively search inside && chains: {showList && items.map(...)}
|
|
672
|
+
else if (
|
|
673
|
+
ts.isBinaryExpression(unwrapped) &&
|
|
674
|
+
unwrapped.operatorToken.kind === ts.SyntaxKind.AmpersandAmpersandToken
|
|
675
|
+
) {
|
|
676
|
+
// Check the right side of the && chain (where .map() typically appears)
|
|
677
|
+
const rightSide = unwrapExpression(unwrapped.right);
|
|
678
|
+
extractJsxRenderingUsage(rightSide, context);
|
|
679
|
+
// Also check nested && chains on the left
|
|
680
|
+
extractJsxRenderingUsage(unwrapped.left, context);
|
|
681
|
+
}
|
|
682
|
+
// Recursively search inside ternaries: {isEmpty ? null : items.map(...)}
|
|
683
|
+
else if (ts.isConditionalExpression(unwrapped)) {
|
|
684
|
+
extractJsxRenderingUsage(unwrapped.whenTrue, context);
|
|
685
|
+
extractJsxRenderingUsage(unwrapped.whenFalse, context);
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
|
|
230
689
|
/**
|
|
231
690
|
* Counts the number of conditions in an && chain (excluding JSX consequence)
|
|
232
691
|
*/
|
|
@@ -263,6 +722,492 @@ interface ChainInfo {
|
|
|
263
722
|
chainExpression: string;
|
|
264
723
|
currentPosition: number;
|
|
265
724
|
compound: CompoundConditional;
|
|
725
|
+
/**
|
|
726
|
+
* When processing OR expressions within an && chain, this tracks the
|
|
727
|
+
* current OR group ID. Conditions added while this is set will be marked
|
|
728
|
+
* as OR alternatives (only one needs to be true).
|
|
729
|
+
*/
|
|
730
|
+
currentOrGroupId?: string;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
/**
|
|
734
|
+
* Parent gating condition accumulated during JSX traversal.
|
|
735
|
+
* Used to track conditions from parent && chains that gate child components.
|
|
736
|
+
*/
|
|
737
|
+
interface ParentGatingCondition {
|
|
738
|
+
path: string;
|
|
739
|
+
sourceLocation: { lineNumber: number; column: number; codeSnippet: string };
|
|
740
|
+
isNegated?: boolean;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
/**
|
|
744
|
+
* Extracts conditionals from JSX elements by recursively traversing children.
|
|
745
|
+
*
|
|
746
|
+
* This is CRITICAL for extracting compound conditionals from JSX expressions
|
|
747
|
+
* like `{hasNewerVersion && !isActive && <Banner />}`.
|
|
748
|
+
*
|
|
749
|
+
* This function is called BEFORE the child boundary check in processExpression
|
|
750
|
+
* because JSX elements are NOT scopes - their expressions use variables from
|
|
751
|
+
* the parent scope and should have their conditionals extracted regardless of
|
|
752
|
+
* whether the JSX is within a child boundary.
|
|
753
|
+
*
|
|
754
|
+
* Fix 32: Added parentConditions parameter to track gating conditions from
|
|
755
|
+
* parent && chains. When we find a component nested inside multiple conditionals
|
|
756
|
+
* like `{activeTab && <>{ternary ? ... : <Component />}</>}`, ALL parent
|
|
757
|
+
* conditions should be added as gating conditions for the component.
|
|
758
|
+
*
|
|
759
|
+
* @param node The JSX element, self-closing element, or fragment to traverse
|
|
760
|
+
* @param context The analysis context
|
|
761
|
+
* @param parentConditions Accumulated gating conditions from parent && chains
|
|
762
|
+
*/
|
|
763
|
+
function extractConditionalsFromJsx(
|
|
764
|
+
node: ts.JsxElement | ts.JsxSelfClosingElement | ts.JsxFragment,
|
|
765
|
+
context: AnalysisContext,
|
|
766
|
+
parentConditions: ParentGatingCondition[] = [],
|
|
767
|
+
): void {
|
|
768
|
+
// Get children to process
|
|
769
|
+
let children: ts.NodeArray<ts.JsxChild> | undefined;
|
|
770
|
+
|
|
771
|
+
if (ts.isJsxElement(node)) {
|
|
772
|
+
children = node.children;
|
|
773
|
+
} else if (ts.isJsxFragment(node)) {
|
|
774
|
+
children = node.children;
|
|
775
|
+
}
|
|
776
|
+
// JsxSelfClosingElement has no children
|
|
777
|
+
|
|
778
|
+
if (!children) {
|
|
779
|
+
return;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
for (const child of children) {
|
|
783
|
+
// Process JSX expressions: {expr}
|
|
784
|
+
if (ts.isJsxExpression(child) && child.expression) {
|
|
785
|
+
const expr = unwrapExpression(child.expression);
|
|
786
|
+
|
|
787
|
+
// Extract JSX rendering usages (array.map, text interpolation)
|
|
788
|
+
// This handles direct usages like {items.map(...)} or {user.name}
|
|
789
|
+
extractJsxRenderingUsage(expr, context);
|
|
790
|
+
|
|
791
|
+
// If the expression is an && chain, extract its conditional usages
|
|
792
|
+
if (
|
|
793
|
+
ts.isBinaryExpression(expr) &&
|
|
794
|
+
expr.operatorToken.kind === ts.SyntaxKind.AmpersandAmpersandToken
|
|
795
|
+
) {
|
|
796
|
+
// Mark nullable variables
|
|
797
|
+
markConditionVariablesAsNullable(expr, context);
|
|
798
|
+
// Extract conditional usage (this handles compound conditionals)
|
|
799
|
+
// Pass controlsJsxRendering: true since this conditional controls JSX rendering
|
|
800
|
+
extractConditionalUsage(expr, context, 'logical-and', {
|
|
801
|
+
controlsJsxRendering: true,
|
|
802
|
+
});
|
|
803
|
+
|
|
804
|
+
// Extract all condition paths from the && chain for gating tracking
|
|
805
|
+
const conditionPaths = extractConditionPathsFromAndChain(
|
|
806
|
+
expr,
|
|
807
|
+
context.sourceFile,
|
|
808
|
+
);
|
|
809
|
+
const sourceLocation = getSourceLocation(expr, context.sourceFile);
|
|
810
|
+
|
|
811
|
+
// Fix 32: Build accumulated conditions including parent conditions
|
|
812
|
+
const accumulatedConditions: ParentGatingCondition[] = [
|
|
813
|
+
...parentConditions,
|
|
814
|
+
...conditionPaths.map((path) => ({
|
|
815
|
+
path,
|
|
816
|
+
sourceLocation,
|
|
817
|
+
isNegated: false,
|
|
818
|
+
})),
|
|
819
|
+
];
|
|
820
|
+
|
|
821
|
+
// Track gating conditions for child components
|
|
822
|
+
// Example: {hasAnalysis && <ScenarioViewer />}
|
|
823
|
+
const jsxElement = findJsxInAndChain(expr);
|
|
824
|
+
if (jsxElement) {
|
|
825
|
+
const componentName = getComponentNameFromJsx(jsxElement);
|
|
826
|
+
if (componentName) {
|
|
827
|
+
// Fix 32: Add ALL accumulated conditions (parent + current) as gating conditions
|
|
828
|
+
for (const condition of accumulatedConditions) {
|
|
829
|
+
context.addChildBoundaryGatingCondition(componentName, {
|
|
830
|
+
path: condition.path,
|
|
831
|
+
conditionType: 'truthiness',
|
|
832
|
+
location: 'logical-and',
|
|
833
|
+
sourceLocation: condition.sourceLocation,
|
|
834
|
+
controlsJsxRendering: true,
|
|
835
|
+
isNegated: condition.isNegated,
|
|
836
|
+
});
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
// Fix 32: Recursively process nested JSX with accumulated conditions
|
|
841
|
+
if (
|
|
842
|
+
ts.isJsxElement(jsxElement) ||
|
|
843
|
+
ts.isJsxSelfClosingElement(jsxElement)
|
|
844
|
+
) {
|
|
845
|
+
extractConditionalsFromJsx(
|
|
846
|
+
jsxElement,
|
|
847
|
+
context,
|
|
848
|
+
accumulatedConditions,
|
|
849
|
+
);
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
// Fix 32: Also check for nested JSX fragments
|
|
854
|
+
const jsxFragment = findJsxFragmentInAndChain(expr);
|
|
855
|
+
if (jsxFragment) {
|
|
856
|
+
extractConditionalsFromJsx(
|
|
857
|
+
jsxFragment,
|
|
858
|
+
context,
|
|
859
|
+
accumulatedConditions,
|
|
860
|
+
);
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
// If the expression is a ternary, extract its conditional
|
|
864
|
+
else if (ts.isConditionalExpression(expr)) {
|
|
865
|
+
// Pass controlsJsxRendering: true since this conditional controls JSX rendering
|
|
866
|
+
extractConditionalUsage(expr.condition, context, 'ternary', {
|
|
867
|
+
controlsJsxRendering: true,
|
|
868
|
+
});
|
|
869
|
+
|
|
870
|
+
// Track gating conditions for components in both branches of the ternary
|
|
871
|
+
// Example: {isError ? <ErrorView /> : <SuccessView />}
|
|
872
|
+
const conditionPath = StructuredPath.fromNode(
|
|
873
|
+
unwrapExpression(expr.condition),
|
|
874
|
+
context.sourceFile,
|
|
875
|
+
);
|
|
876
|
+
const sourceLocation = getSourceLocation(expr, context.sourceFile);
|
|
877
|
+
|
|
878
|
+
// Recursively process the whenTrue and whenFalse branches for JSX
|
|
879
|
+
const whenTrue = unwrapExpression(expr.whenTrue);
|
|
880
|
+
const whenFalse = unwrapExpression(expr.whenFalse);
|
|
881
|
+
|
|
882
|
+
// Fix 32: Build conditions for whenTrue branch (parent conditions + ternary condition truthy)
|
|
883
|
+
const whenTrueConditions: ParentGatingCondition[] = [
|
|
884
|
+
...parentConditions,
|
|
885
|
+
...(conditionPath
|
|
886
|
+
? [
|
|
887
|
+
{
|
|
888
|
+
path: conditionPath.toString(),
|
|
889
|
+
sourceLocation,
|
|
890
|
+
isNegated: false,
|
|
891
|
+
},
|
|
892
|
+
]
|
|
893
|
+
: []),
|
|
894
|
+
];
|
|
895
|
+
|
|
896
|
+
// Fix 32: Build conditions for whenFalse branch (parent conditions + ternary condition falsy)
|
|
897
|
+
const whenFalseConditions: ParentGatingCondition[] = [
|
|
898
|
+
...parentConditions,
|
|
899
|
+
...(conditionPath
|
|
900
|
+
? [
|
|
901
|
+
{
|
|
902
|
+
path: conditionPath.toString(),
|
|
903
|
+
sourceLocation,
|
|
904
|
+
isNegated: true,
|
|
905
|
+
},
|
|
906
|
+
]
|
|
907
|
+
: []),
|
|
908
|
+
];
|
|
909
|
+
|
|
910
|
+
// Handle whenTrue branch (condition is truthy)
|
|
911
|
+
if (ts.isJsxElement(whenTrue) || ts.isJsxSelfClosingElement(whenTrue)) {
|
|
912
|
+
const componentName = getComponentNameFromJsx(whenTrue);
|
|
913
|
+
if (componentName) {
|
|
914
|
+
// Fix 32: Add ALL conditions (parent + ternary) as gating conditions
|
|
915
|
+
for (const condition of whenTrueConditions) {
|
|
916
|
+
context.addChildBoundaryGatingCondition(componentName, {
|
|
917
|
+
path: condition.path,
|
|
918
|
+
conditionType: 'truthiness',
|
|
919
|
+
location: 'ternary',
|
|
920
|
+
sourceLocation: condition.sourceLocation,
|
|
921
|
+
controlsJsxRendering: true,
|
|
922
|
+
isNegated: condition.isNegated,
|
|
923
|
+
});
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
if (
|
|
928
|
+
ts.isJsxElement(whenTrue) ||
|
|
929
|
+
ts.isJsxSelfClosingElement(whenTrue) ||
|
|
930
|
+
ts.isJsxFragment(whenTrue)
|
|
931
|
+
) {
|
|
932
|
+
extractConditionalsFromJsx(whenTrue, context, whenTrueConditions);
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
// Handle whenFalse branch (condition is falsy/negated)
|
|
936
|
+
if (
|
|
937
|
+
ts.isJsxElement(whenFalse) ||
|
|
938
|
+
ts.isJsxSelfClosingElement(whenFalse)
|
|
939
|
+
) {
|
|
940
|
+
const componentName = getComponentNameFromJsx(whenFalse);
|
|
941
|
+
if (componentName) {
|
|
942
|
+
// Fix 32: Add ALL conditions (parent + ternary) as gating conditions
|
|
943
|
+
for (const condition of whenFalseConditions) {
|
|
944
|
+
context.addChildBoundaryGatingCondition(componentName, {
|
|
945
|
+
path: condition.path,
|
|
946
|
+
conditionType: 'truthiness',
|
|
947
|
+
location: 'ternary',
|
|
948
|
+
sourceLocation: condition.sourceLocation,
|
|
949
|
+
controlsJsxRendering: true,
|
|
950
|
+
isNegated: condition.isNegated,
|
|
951
|
+
});
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
if (
|
|
956
|
+
ts.isJsxElement(whenFalse) ||
|
|
957
|
+
ts.isJsxSelfClosingElement(whenFalse) ||
|
|
958
|
+
ts.isJsxFragment(whenFalse)
|
|
959
|
+
) {
|
|
960
|
+
extractConditionalsFromJsx(whenFalse, context, whenFalseConditions);
|
|
961
|
+
}
|
|
962
|
+
// Handle chained ternaries: a ? <A/> : b ? <B/> : <C/>
|
|
963
|
+
// When whenFalse is another ConditionalExpression, recursively process it
|
|
964
|
+
else if (ts.isConditionalExpression(whenFalse)) {
|
|
965
|
+
// Extract conditional usage for the nested ternary's condition
|
|
966
|
+
extractConditionalUsage(whenFalse.condition, context, 'ternary', {
|
|
967
|
+
controlsJsxRendering: true,
|
|
968
|
+
});
|
|
969
|
+
|
|
970
|
+
// Get the nested condition path
|
|
971
|
+
const nestedConditionPath = StructuredPath.fromNode(
|
|
972
|
+
unwrapExpression(whenFalse.condition),
|
|
973
|
+
context.sourceFile,
|
|
974
|
+
);
|
|
975
|
+
const nestedSourceLocation = getSourceLocation(
|
|
976
|
+
whenFalse,
|
|
977
|
+
context.sourceFile,
|
|
978
|
+
);
|
|
979
|
+
|
|
980
|
+
const nestedWhenTrue = unwrapExpression(whenFalse.whenTrue);
|
|
981
|
+
const nestedWhenFalse = unwrapExpression(whenFalse.whenFalse);
|
|
982
|
+
|
|
983
|
+
// Fix 32: Build conditions for nested whenTrue (parent falsy + nested truthy)
|
|
984
|
+
const nestedWhenTrueConditions: ParentGatingCondition[] = [
|
|
985
|
+
...whenFalseConditions, // Parent ternary was falsy to get here
|
|
986
|
+
...(nestedConditionPath
|
|
987
|
+
? [
|
|
988
|
+
{
|
|
989
|
+
path: nestedConditionPath.toString(),
|
|
990
|
+
sourceLocation: nestedSourceLocation,
|
|
991
|
+
isNegated: false,
|
|
992
|
+
},
|
|
993
|
+
]
|
|
994
|
+
: []),
|
|
995
|
+
];
|
|
996
|
+
|
|
997
|
+
// Fix 32: Build conditions for nested whenFalse (parent falsy + nested falsy)
|
|
998
|
+
const nestedWhenFalseConditions: ParentGatingCondition[] = [
|
|
999
|
+
...whenFalseConditions, // Parent ternary was falsy to get here
|
|
1000
|
+
...(nestedConditionPath
|
|
1001
|
+
? [
|
|
1002
|
+
{
|
|
1003
|
+
path: nestedConditionPath.toString(),
|
|
1004
|
+
sourceLocation: nestedSourceLocation,
|
|
1005
|
+
isNegated: true,
|
|
1006
|
+
},
|
|
1007
|
+
]
|
|
1008
|
+
: []),
|
|
1009
|
+
];
|
|
1010
|
+
|
|
1011
|
+
// Handle nested whenTrue branch
|
|
1012
|
+
if (
|
|
1013
|
+
ts.isJsxElement(nestedWhenTrue) ||
|
|
1014
|
+
ts.isJsxSelfClosingElement(nestedWhenTrue)
|
|
1015
|
+
) {
|
|
1016
|
+
const componentName = getComponentNameFromJsx(nestedWhenTrue);
|
|
1017
|
+
if (componentName) {
|
|
1018
|
+
// Fix 32: Add ALL accumulated conditions
|
|
1019
|
+
for (const condition of nestedWhenTrueConditions) {
|
|
1020
|
+
context.addChildBoundaryGatingCondition(componentName, {
|
|
1021
|
+
path: condition.path,
|
|
1022
|
+
conditionType: 'truthiness',
|
|
1023
|
+
location: 'ternary',
|
|
1024
|
+
sourceLocation: condition.sourceLocation,
|
|
1025
|
+
controlsJsxRendering: true,
|
|
1026
|
+
isNegated: condition.isNegated,
|
|
1027
|
+
});
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
if (
|
|
1032
|
+
ts.isJsxElement(nestedWhenTrue) ||
|
|
1033
|
+
ts.isJsxSelfClosingElement(nestedWhenTrue) ||
|
|
1034
|
+
ts.isJsxFragment(nestedWhenTrue)
|
|
1035
|
+
) {
|
|
1036
|
+
extractConditionalsFromJsx(
|
|
1037
|
+
nestedWhenTrue,
|
|
1038
|
+
context,
|
|
1039
|
+
nestedWhenTrueConditions,
|
|
1040
|
+
);
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
// Handle nested whenFalse branch (this could be another chained ternary or JSX)
|
|
1044
|
+
if (
|
|
1045
|
+
ts.isJsxElement(nestedWhenFalse) ||
|
|
1046
|
+
ts.isJsxSelfClosingElement(nestedWhenFalse)
|
|
1047
|
+
) {
|
|
1048
|
+
const componentName = getComponentNameFromJsx(nestedWhenFalse);
|
|
1049
|
+
if (componentName) {
|
|
1050
|
+
// Fix 32: Add ALL accumulated conditions
|
|
1051
|
+
for (const condition of nestedWhenFalseConditions) {
|
|
1052
|
+
context.addChildBoundaryGatingCondition(componentName, {
|
|
1053
|
+
path: condition.path,
|
|
1054
|
+
conditionType: 'truthiness',
|
|
1055
|
+
location: 'ternary',
|
|
1056
|
+
sourceLocation: condition.sourceLocation,
|
|
1057
|
+
controlsJsxRendering: true,
|
|
1058
|
+
isNegated: condition.isNegated,
|
|
1059
|
+
});
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
if (
|
|
1064
|
+
ts.isJsxElement(nestedWhenFalse) ||
|
|
1065
|
+
ts.isJsxSelfClosingElement(nestedWhenFalse) ||
|
|
1066
|
+
ts.isJsxFragment(nestedWhenFalse)
|
|
1067
|
+
) {
|
|
1068
|
+
extractConditionalsFromJsx(
|
|
1069
|
+
nestedWhenFalse,
|
|
1070
|
+
context,
|
|
1071
|
+
nestedWhenFalseConditions,
|
|
1072
|
+
);
|
|
1073
|
+
}
|
|
1074
|
+
// If nestedWhenFalse is yet another ConditionalExpression, the recursion
|
|
1075
|
+
// will handle it on the next iteration when this function processes it
|
|
1076
|
+
else if (ts.isConditionalExpression(nestedWhenFalse)) {
|
|
1077
|
+
// Recursively handle deeper nesting by wrapping in a synthetic process
|
|
1078
|
+
// We create a fake JsxExpression context to reuse the same logic
|
|
1079
|
+
const syntheticChild = {
|
|
1080
|
+
kind: ts.SyntaxKind.JsxExpression,
|
|
1081
|
+
expression: nestedWhenFalse,
|
|
1082
|
+
} as unknown as ts.JsxExpression;
|
|
1083
|
+
// Process via the main JSX expression handler by recursing
|
|
1084
|
+
// For now, just extract conditionals directly
|
|
1085
|
+
extractConditionalUsage(
|
|
1086
|
+
nestedWhenFalse.condition,
|
|
1087
|
+
context,
|
|
1088
|
+
'ternary',
|
|
1089
|
+
{ controlsJsxRendering: true },
|
|
1090
|
+
);
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
// Recursively process nested JSX elements - Fix 32: pass parent conditions
|
|
1096
|
+
else if (ts.isJsxElement(child)) {
|
|
1097
|
+
// Check if this is a user-defined component (vs intrinsic element like div)
|
|
1098
|
+
const componentName = getComponentNameFromJsx(child);
|
|
1099
|
+
if (componentName) {
|
|
1100
|
+
if (parentConditions.length > 0) {
|
|
1101
|
+
// If there are parent conditions, record them as gating conditions
|
|
1102
|
+
console.log(
|
|
1103
|
+
`[ChildBoundary] ${componentName}: Conditionally rendered with ${parentConditions.length} gating conditions`,
|
|
1104
|
+
);
|
|
1105
|
+
for (const condition of parentConditions) {
|
|
1106
|
+
console.log(
|
|
1107
|
+
`[ChildBoundary] ${componentName}: Adding gating condition path='${condition.path}' isNegated=${condition.isNegated}`,
|
|
1108
|
+
);
|
|
1109
|
+
context.addChildBoundaryGatingCondition(componentName, {
|
|
1110
|
+
path: condition.path,
|
|
1111
|
+
conditionType: 'truthiness',
|
|
1112
|
+
location: 'ternary',
|
|
1113
|
+
sourceLocation: condition.sourceLocation,
|
|
1114
|
+
controlsJsxRendering: true,
|
|
1115
|
+
isNegated: condition.isNegated,
|
|
1116
|
+
});
|
|
1117
|
+
}
|
|
1118
|
+
} else {
|
|
1119
|
+
// No parent conditions - check if it has data props for unconditional tracking
|
|
1120
|
+
console.log(
|
|
1121
|
+
`[ChildBoundary] ${componentName}: Checking for unconditional rendering with data props...`,
|
|
1122
|
+
);
|
|
1123
|
+
const { hasDataProps, dataProps } = hasDataPropsFromParent(
|
|
1124
|
+
child,
|
|
1125
|
+
componentName,
|
|
1126
|
+
);
|
|
1127
|
+
if (hasDataProps) {
|
|
1128
|
+
// Fix: Track unconditionally-rendered children that receive data props
|
|
1129
|
+
// These need to be tracked for flow merging even without gating conditions
|
|
1130
|
+
// Example: <WorkoutsView workouts={workouts} /> - parent controls workouts data
|
|
1131
|
+
console.log(
|
|
1132
|
+
`[ChildBoundary] ${componentName}: TRACKING as unconditionally-rendered with data props: [${dataProps.join(', ')}]`,
|
|
1133
|
+
);
|
|
1134
|
+
context.addChildBoundaryGatingCondition(componentName, {
|
|
1135
|
+
path: '__unconditional__',
|
|
1136
|
+
conditionType: 'truthiness',
|
|
1137
|
+
location: 'unconditional',
|
|
1138
|
+
controlsJsxRendering: true,
|
|
1139
|
+
isNegated: false,
|
|
1140
|
+
});
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
extractConditionalsFromJsx(child, context, parentConditions);
|
|
1145
|
+
}
|
|
1146
|
+
// Handle self-closing JSX elements (e.g., <ScenarioViewer />)
|
|
1147
|
+
else if (ts.isJsxSelfClosingElement(child)) {
|
|
1148
|
+
// Check if this is a user-defined component (vs intrinsic element like div)
|
|
1149
|
+
const componentName = getComponentNameFromJsx(child);
|
|
1150
|
+
if (componentName) {
|
|
1151
|
+
if (parentConditions.length > 0) {
|
|
1152
|
+
// If there are parent conditions, record them as gating conditions
|
|
1153
|
+
console.log(
|
|
1154
|
+
`[ChildBoundary] ${componentName}: Conditionally rendered (self-closing) with ${parentConditions.length} gating conditions`,
|
|
1155
|
+
);
|
|
1156
|
+
for (const condition of parentConditions) {
|
|
1157
|
+
console.log(
|
|
1158
|
+
`[ChildBoundary] ${componentName}: Adding gating condition path='${condition.path}' isNegated=${condition.isNegated}`,
|
|
1159
|
+
);
|
|
1160
|
+
context.addChildBoundaryGatingCondition(componentName, {
|
|
1161
|
+
path: condition.path,
|
|
1162
|
+
conditionType: 'truthiness',
|
|
1163
|
+
location: 'ternary',
|
|
1164
|
+
sourceLocation: condition.sourceLocation,
|
|
1165
|
+
controlsJsxRendering: true,
|
|
1166
|
+
isNegated: condition.isNegated,
|
|
1167
|
+
});
|
|
1168
|
+
}
|
|
1169
|
+
} else {
|
|
1170
|
+
// No parent conditions - check if it has data props for unconditional tracking
|
|
1171
|
+
console.log(
|
|
1172
|
+
`[ChildBoundary] ${componentName}: Checking for unconditional rendering (self-closing) with data props...`,
|
|
1173
|
+
);
|
|
1174
|
+
const { hasDataProps, dataProps } = hasDataPropsFromParent(
|
|
1175
|
+
child,
|
|
1176
|
+
componentName,
|
|
1177
|
+
);
|
|
1178
|
+
if (hasDataProps) {
|
|
1179
|
+
// Fix: Track unconditionally-rendered children that receive data props
|
|
1180
|
+
console.log(
|
|
1181
|
+
`[ChildBoundary] ${componentName}: TRACKING as unconditionally-rendered (self-closing) with data props: [${dataProps.join(', ')}]`,
|
|
1182
|
+
);
|
|
1183
|
+
context.addChildBoundaryGatingCondition(componentName, {
|
|
1184
|
+
path: '__unconditional__',
|
|
1185
|
+
conditionType: 'truthiness',
|
|
1186
|
+
location: 'unconditional',
|
|
1187
|
+
controlsJsxRendering: true,
|
|
1188
|
+
isNegated: false,
|
|
1189
|
+
});
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
// Self-closing elements have no children, so no recursion needed
|
|
1194
|
+
}
|
|
1195
|
+
// Recursively process nested JSX fragments - Fix 32: pass parent conditions
|
|
1196
|
+
else if (ts.isJsxFragment(child)) {
|
|
1197
|
+
extractConditionalsFromJsx(child, context, parentConditions);
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
/**
|
|
1203
|
+
* Options for extractConditionalUsage
|
|
1204
|
+
*/
|
|
1205
|
+
interface ExtractConditionalOptions {
|
|
1206
|
+
/**
|
|
1207
|
+
* Whether this conditional controls JSX rendering.
|
|
1208
|
+
* Set to true when the conditional appears in a JSX expression like {cond && <Component />}
|
|
1209
|
+
*/
|
|
1210
|
+
controlsJsxRendering?: boolean;
|
|
266
1211
|
}
|
|
267
1212
|
|
|
268
1213
|
/**
|
|
@@ -273,12 +1218,15 @@ interface ChainInfo {
|
|
|
273
1218
|
* @param condition The condition expression to analyze
|
|
274
1219
|
* @param context The analysis context
|
|
275
1220
|
* @param location Where this condition appears (if, ternary, logical-and, switch)
|
|
1221
|
+
* @param options Additional options including controlsJsxRendering flag
|
|
276
1222
|
*/
|
|
277
1223
|
export function extractConditionalUsage(
|
|
278
1224
|
condition: ts.Expression,
|
|
279
1225
|
context: AnalysisContext,
|
|
280
1226
|
location: ConditionalUsage['location'],
|
|
1227
|
+
options: ExtractConditionalOptions = {},
|
|
281
1228
|
): void {
|
|
1229
|
+
const { controlsJsxRendering } = options;
|
|
282
1230
|
// Internal recursive function with chain tracking
|
|
283
1231
|
function extractWithChainTracking(
|
|
284
1232
|
expr: ts.Expression,
|
|
@@ -312,6 +1260,7 @@ export function extractConditionalUsage(
|
|
|
312
1260
|
conditions: [],
|
|
313
1261
|
location,
|
|
314
1262
|
sourceLocation: getSourceLocation(unwrapped, context.sourceFile),
|
|
1263
|
+
controlsJsxRendering,
|
|
315
1264
|
};
|
|
316
1265
|
chainInfo = {
|
|
317
1266
|
chainId,
|
|
@@ -345,14 +1294,37 @@ export function extractConditionalUsage(
|
|
|
345
1294
|
}
|
|
346
1295
|
|
|
347
1296
|
// Handle binary expressions with || (logical OR)
|
|
348
|
-
// OR
|
|
1297
|
+
// When OR is inside an && chain, we need to continue chain tracking
|
|
1298
|
+
// and mark conditions as OR alternatives
|
|
349
1299
|
if (
|
|
350
1300
|
ts.isBinaryExpression(unwrapped) &&
|
|
351
1301
|
unwrapped.operatorToken.kind === ts.SyntaxKind.BarBarToken
|
|
352
1302
|
) {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
1303
|
+
if (chainInfo) {
|
|
1304
|
+
// We're inside an && chain - continue tracking but mark as OR alternatives
|
|
1305
|
+
// Generate an orGroupId so conditions from both sides can be grouped
|
|
1306
|
+
const orGroupId =
|
|
1307
|
+
chainInfo.currentOrGroupId ?? `or_${crypto.randomUUID().slice(0, 8)}`;
|
|
1308
|
+
|
|
1309
|
+
// Process left side with OR group tracking
|
|
1310
|
+
const leftChainInfo = {
|
|
1311
|
+
...chainInfo,
|
|
1312
|
+
currentOrGroupId: orGroupId,
|
|
1313
|
+
};
|
|
1314
|
+
extractWithChainTracking(unwrapped.left, leftChainInfo, false);
|
|
1315
|
+
|
|
1316
|
+
// Process right side with same OR group
|
|
1317
|
+
// Note: we use leftChainInfo's currentPosition which may have been updated
|
|
1318
|
+
const rightChainInfo = {
|
|
1319
|
+
...leftChainInfo,
|
|
1320
|
+
currentPosition: chainInfo.currentPosition,
|
|
1321
|
+
};
|
|
1322
|
+
extractWithChainTracking(unwrapped.right, rightChainInfo, false);
|
|
1323
|
+
} else {
|
|
1324
|
+
// Not inside a chain - OR breaks into independent conditional checks
|
|
1325
|
+
extractWithChainTracking(unwrapped.left, null, false);
|
|
1326
|
+
extractWithChainTracking(unwrapped.right, null, false);
|
|
1327
|
+
}
|
|
356
1328
|
return;
|
|
357
1329
|
}
|
|
358
1330
|
|
|
@@ -391,12 +1363,18 @@ export function extractConditionalUsage(
|
|
|
391
1363
|
return literalValue;
|
|
392
1364
|
};
|
|
393
1365
|
|
|
1366
|
+
// Get the comparison operator string for the compound condition
|
|
1367
|
+
const comparisonOperator = getComparisonOperatorString(
|
|
1368
|
+
unwrapped.operatorToken.kind,
|
|
1369
|
+
);
|
|
1370
|
+
|
|
394
1371
|
// Helper to add a condition
|
|
395
1372
|
const addCondition = (
|
|
396
1373
|
path: string,
|
|
397
1374
|
conditionType: 'comparison' | 'truthiness',
|
|
398
1375
|
comparedValues?: string[],
|
|
399
1376
|
requiredValue?: string | boolean,
|
|
1377
|
+
sourceExpr?: ts.Expression,
|
|
400
1378
|
) => {
|
|
401
1379
|
const usage: ConditionalUsage = {
|
|
402
1380
|
path,
|
|
@@ -405,8 +1383,20 @@ export function extractConditionalUsage(
|
|
|
405
1383
|
location,
|
|
406
1384
|
sourceLocation: getSourceLocation(unwrapped, context.sourceFile),
|
|
407
1385
|
isNegated,
|
|
1386
|
+
controlsJsxRendering,
|
|
408
1387
|
};
|
|
409
1388
|
|
|
1389
|
+
// Check for inline array-derived patterns (.length) on the source expression
|
|
1390
|
+
if (sourceExpr) {
|
|
1391
|
+
const arrayDerived = detectArrayDerivedPattern(sourceExpr);
|
|
1392
|
+
if (arrayDerived) {
|
|
1393
|
+
usage.derivedFrom = {
|
|
1394
|
+
operation: arrayDerived.operation,
|
|
1395
|
+
sourcePath: arrayDerived.sourcePath,
|
|
1396
|
+
};
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
|
|
410
1400
|
// Add chain info if part of a compound conditional
|
|
411
1401
|
if (chainInfo) {
|
|
412
1402
|
usage.chainId = chainInfo.chainId;
|
|
@@ -422,6 +1412,10 @@ export function extractConditionalUsage(
|
|
|
422
1412
|
comparedValues,
|
|
423
1413
|
isNegated,
|
|
424
1414
|
requiredValue,
|
|
1415
|
+
...(comparisonOperator && { comparisonOperator }),
|
|
1416
|
+
...(chainInfo.currentOrGroupId && {
|
|
1417
|
+
orGroupId: chainInfo.currentOrGroupId,
|
|
1418
|
+
}),
|
|
425
1419
|
});
|
|
426
1420
|
}
|
|
427
1421
|
|
|
@@ -436,6 +1430,7 @@ export function extractConditionalUsage(
|
|
|
436
1430
|
'comparison',
|
|
437
1431
|
literalValue !== undefined ? [literalValue] : undefined,
|
|
438
1432
|
getRequiredValue(literalValue, isNegated),
|
|
1433
|
+
unwrapped.left, // Pass source expression for array derivation detection
|
|
439
1434
|
);
|
|
440
1435
|
return;
|
|
441
1436
|
}
|
|
@@ -448,16 +1443,29 @@ export function extractConditionalUsage(
|
|
|
448
1443
|
'comparison',
|
|
449
1444
|
literalValue !== undefined ? [literalValue] : undefined,
|
|
450
1445
|
getRequiredValue(literalValue, isNegated),
|
|
1446
|
+
unwrapped.right, // Pass source expression for array derivation detection
|
|
451
1447
|
);
|
|
452
1448
|
return;
|
|
453
1449
|
}
|
|
454
1450
|
|
|
455
1451
|
// Both sides are variables - record both as comparisons without specific values
|
|
456
1452
|
if (leftPath) {
|
|
457
|
-
addCondition(
|
|
1453
|
+
addCondition(
|
|
1454
|
+
leftPath.toLeftHandSideString(),
|
|
1455
|
+
'comparison',
|
|
1456
|
+
undefined,
|
|
1457
|
+
undefined,
|
|
1458
|
+
unwrapped.left,
|
|
1459
|
+
);
|
|
458
1460
|
}
|
|
459
1461
|
if (rightPath) {
|
|
460
|
-
addCondition(
|
|
1462
|
+
addCondition(
|
|
1463
|
+
rightPath.toLeftHandSideString(),
|
|
1464
|
+
'comparison',
|
|
1465
|
+
undefined,
|
|
1466
|
+
undefined,
|
|
1467
|
+
unwrapped.right,
|
|
1468
|
+
);
|
|
461
1469
|
}
|
|
462
1470
|
return;
|
|
463
1471
|
}
|
|
@@ -483,8 +1491,19 @@ export function extractConditionalUsage(
|
|
|
483
1491
|
location,
|
|
484
1492
|
sourceLocation: getSourceLocation(unwrapped, context.sourceFile),
|
|
485
1493
|
isNegated,
|
|
1494
|
+
controlsJsxRendering,
|
|
486
1495
|
};
|
|
487
1496
|
|
|
1497
|
+
// Check for inline array-derived patterns (.some(), .every(), .includes(), .length)
|
|
1498
|
+
// This populates derivedFrom so downstream code can resolve to the base array path
|
|
1499
|
+
const arrayDerived = detectArrayDerivedPattern(unwrapped);
|
|
1500
|
+
if (arrayDerived) {
|
|
1501
|
+
usage.derivedFrom = {
|
|
1502
|
+
operation: arrayDerived.operation,
|
|
1503
|
+
sourcePath: arrayDerived.sourcePath,
|
|
1504
|
+
};
|
|
1505
|
+
}
|
|
1506
|
+
|
|
488
1507
|
// Add chain info if part of a compound conditional
|
|
489
1508
|
if (chainInfo) {
|
|
490
1509
|
usage.chainId = chainInfo.chainId;
|
|
@@ -500,6 +1519,9 @@ export function extractConditionalUsage(
|
|
|
500
1519
|
conditionType: 'truthiness',
|
|
501
1520
|
isNegated,
|
|
502
1521
|
requiredValue: !isNegated,
|
|
1522
|
+
...(chainInfo.currentOrGroupId && {
|
|
1523
|
+
orGroupId: chainInfo.currentOrGroupId,
|
|
1524
|
+
}),
|
|
503
1525
|
});
|
|
504
1526
|
}
|
|
505
1527
|
|
|
@@ -623,6 +1645,18 @@ export function processExpression({
|
|
|
623
1645
|
}
|
|
624
1646
|
}
|
|
625
1647
|
|
|
1648
|
+
// CRITICAL: Extract conditionals from JSX BEFORE checking child boundaries
|
|
1649
|
+
// JSX elements are NOT scopes - their expressions use variables from the parent scope.
|
|
1650
|
+
// Even if the JSX element is within a child boundary (e.g., because it contains callbacks),
|
|
1651
|
+
// we must still extract conditionals from JSX expression children like {x && <div>...</div>}
|
|
1652
|
+
if (
|
|
1653
|
+
ts.isJsxElement(unwrappedNode) ||
|
|
1654
|
+
ts.isJsxSelfClosingElement(unwrappedNode) ||
|
|
1655
|
+
ts.isJsxFragment(unwrappedNode)
|
|
1656
|
+
) {
|
|
1657
|
+
extractConditionalsFromJsx(unwrappedNode, context);
|
|
1658
|
+
}
|
|
1659
|
+
|
|
626
1660
|
// If the node falls within an excluded child scope, stop processing it.
|
|
627
1661
|
if (context.isChildBoundary(node)) {
|
|
628
1662
|
return true;
|
|
@@ -657,7 +1691,7 @@ export function processExpression({
|
|
|
657
1691
|
const structure = context.getStructure();
|
|
658
1692
|
|
|
659
1693
|
// Propagate existing equivalencies for sub-properties
|
|
660
|
-
for (const [key,
|
|
1694
|
+
for (const [key, rawValue] of Object.entries(equivalentVariables)) {
|
|
661
1695
|
// Check if this equivalency is for a sub-property of the identifier
|
|
662
1696
|
// e.g., completeDataStructure['Function Arguments'] or completeDataStructure.foo
|
|
663
1697
|
if (
|
|
@@ -668,8 +1702,14 @@ export function processExpression({
|
|
|
668
1702
|
const newTargetPath = StructuredPath.fromBase(
|
|
669
1703
|
targetPath.toString() + subPath,
|
|
670
1704
|
);
|
|
671
|
-
|
|
672
|
-
|
|
1705
|
+
// Handle both string and string[] values
|
|
1706
|
+
const values = Array.isArray(rawValue) ? rawValue : [rawValue];
|
|
1707
|
+
for (const value of values) {
|
|
1708
|
+
if (typeof value === 'string') {
|
|
1709
|
+
const valuePath = StructuredPath.fromBase(value);
|
|
1710
|
+
context.addEquivalence(newTargetPath, valuePath);
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
673
1713
|
}
|
|
674
1714
|
}
|
|
675
1715
|
|
|
@@ -1122,6 +2162,14 @@ export function processExpression({
|
|
|
1122
2162
|
// e.g., `const tab = segments[0] || 'default'` should trace tab back to segments[0]
|
|
1123
2163
|
if (operatorKind === ts.SyntaxKind.QuestionQuestionToken) {
|
|
1124
2164
|
// specifically for ?? we create an equivalence to the left side
|
|
2165
|
+
// IMPORTANT: Also process the left side recursively to apply method semantics
|
|
2166
|
+
// (e.g., for `const segments = splat?.split('/') ?? []`, we need split semantics)
|
|
2167
|
+
processExpression({
|
|
2168
|
+
node: unwrappedNode.left,
|
|
2169
|
+
context,
|
|
2170
|
+
// Don't pass targetPath here - we'll establish equivalence separately below
|
|
2171
|
+
});
|
|
2172
|
+
|
|
1125
2173
|
if (targetPath) {
|
|
1126
2174
|
resultPath = StructuredPath.fromNode(
|
|
1127
2175
|
unwrappedNode.left,
|
|
@@ -1139,15 +2187,55 @@ export function processExpression({
|
|
|
1139
2187
|
);
|
|
1140
2188
|
}
|
|
1141
2189
|
} else if (operatorKind === ts.SyntaxKind.BarBarToken) {
|
|
1142
|
-
// For ||,
|
|
2190
|
+
// For ||, create equivalences to BOTH sides
|
|
1143
2191
|
// This enables data flow tracing through fallback expressions
|
|
2192
|
+
// e.g., `const item = items.find(...) || null` should trace to both:
|
|
2193
|
+
// - items[] (from the find result)
|
|
2194
|
+
// - null (from the fallback)
|
|
1144
2195
|
if (targetPath) {
|
|
1145
|
-
|
|
2196
|
+
// Get paths for both sides
|
|
2197
|
+
const leftPath = StructuredPath.fromNode(
|
|
1146
2198
|
unwrappedNode.left,
|
|
1147
2199
|
context.sourceFile,
|
|
1148
2200
|
);
|
|
2201
|
+
const rightPath = StructuredPath.fromNode(
|
|
2202
|
+
unwrappedNode.right,
|
|
2203
|
+
context.sourceFile,
|
|
2204
|
+
);
|
|
2205
|
+
|
|
2206
|
+
// Collect all valid paths
|
|
2207
|
+
const allPaths: StructuredPath[] = [];
|
|
2208
|
+
if (leftPath) allPaths.push(leftPath);
|
|
2209
|
+
if (rightPath) allPaths.push(rightPath);
|
|
2210
|
+
|
|
2211
|
+
// Add multiple equivalencies to track both sources
|
|
2212
|
+
if (allPaths.length > 0) {
|
|
2213
|
+
context.addMultipleEquivalencies(targetPath, allPaths);
|
|
2214
|
+
}
|
|
2215
|
+
|
|
2216
|
+
// Process both sides to capture their internal structures
|
|
2217
|
+
processExpression({
|
|
2218
|
+
node: unwrappedNode.left,
|
|
2219
|
+
context,
|
|
2220
|
+
});
|
|
2221
|
+
processExpression({
|
|
2222
|
+
node: unwrappedNode.right,
|
|
2223
|
+
context,
|
|
2224
|
+
});
|
|
2225
|
+
|
|
2226
|
+
// Register the type for the target path
|
|
2227
|
+
const leftType = context.inferTypeFromNode(unwrappedNode.left);
|
|
2228
|
+
const rightType = context.inferTypeFromNode(unwrappedNode.right);
|
|
2229
|
+
const orResultType = isDefinedType(leftType)
|
|
2230
|
+
? leftType
|
|
2231
|
+
: rightType || 'unknown';
|
|
2232
|
+
context.addType(targetPath, orResultType);
|
|
2233
|
+
|
|
2234
|
+
// Return early - we've already handled equivalencies with addMultipleEquivalencies
|
|
2235
|
+
// Don't fall through to the generic addEquivalence call below
|
|
2236
|
+
return true;
|
|
1149
2237
|
}
|
|
1150
|
-
// Note:
|
|
2238
|
+
// Note: When there's no targetPath, we don't recursively process
|
|
1151
2239
|
// because || is often used in boolean contexts where the full expression matters
|
|
1152
2240
|
}
|
|
1153
2241
|
} else if (operatorKind === ts.SyntaxKind.InstanceOfKeyword) {
|
|
@@ -1255,24 +2343,56 @@ export function processExpression({
|
|
|
1255
2343
|
|
|
1256
2344
|
// Get the source expression path (e.g., the object for obj.method())
|
|
1257
2345
|
const sourceExpr = unwrappedNode.expression.expression;
|
|
1258
|
-
const
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
if (
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
2346
|
+
const unwrappedSourceExpr = unwrapExpression(sourceExpr);
|
|
2347
|
+
|
|
2348
|
+
// When the source is a ternary expression like (cond ? arr : arr.slice()),
|
|
2349
|
+
// apply method semantics to BOTH branches directly. The ternary itself isn't
|
|
2350
|
+
// a variable - it's just a choice between two paths that both flow to the result.
|
|
2351
|
+
if (ts.isConditionalExpression(unwrappedSourceExpr)) {
|
|
2352
|
+
const branches = [
|
|
2353
|
+
unwrappedSourceExpr.whenTrue,
|
|
2354
|
+
unwrappedSourceExpr.whenFalse,
|
|
2355
|
+
];
|
|
2356
|
+
|
|
2357
|
+
for (const branch of branches) {
|
|
2358
|
+
const branchPath = StructuredPath.fromNode(
|
|
2359
|
+
branch,
|
|
2360
|
+
context.sourceFile,
|
|
2361
|
+
);
|
|
2362
|
+
if (branchPath) {
|
|
2363
|
+
const isArraySemantics = semantics instanceof ArrayPushSemantics;
|
|
2364
|
+
const shouldApply =
|
|
2365
|
+
!isArraySemantics ||
|
|
2366
|
+
isLikelyArrayType(branch, context.typeChecker);
|
|
2367
|
+
|
|
2368
|
+
if (shouldApply) {
|
|
2369
|
+
semantics.addEquivalences(callPath, branchPath, context);
|
|
2370
|
+
returnType = semantics.getReturnType();
|
|
2371
|
+
handledBySemantics = true;
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2374
|
+
}
|
|
2375
|
+
} else {
|
|
2376
|
+
// Regular (non-ternary) source expression
|
|
2377
|
+
const sourcePath = StructuredPath.fromNode(
|
|
2378
|
+
sourceExpr,
|
|
2379
|
+
context.sourceFile,
|
|
2380
|
+
);
|
|
1270
2381
|
|
|
1271
|
-
if (
|
|
1272
|
-
//
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
2382
|
+
if (sourcePath) {
|
|
2383
|
+
// For array-specific semantics (like push), verify the source is actually an array
|
|
2384
|
+
// This prevents router.push() from being mistakenly treated as Array.push()
|
|
2385
|
+
const isArraySemantics = semantics instanceof ArrayPushSemantics;
|
|
2386
|
+
const shouldApply =
|
|
2387
|
+
!isArraySemantics ||
|
|
2388
|
+
isLikelyArrayType(sourceExpr, context.typeChecker);
|
|
2389
|
+
|
|
2390
|
+
if (shouldApply) {
|
|
2391
|
+
// Apply method semantics
|
|
2392
|
+
semantics.addEquivalences(callPath, sourcePath, context);
|
|
2393
|
+
returnType = semantics.getReturnType();
|
|
2394
|
+
handledBySemantics = true;
|
|
2395
|
+
}
|
|
1276
2396
|
}
|
|
1277
2397
|
}
|
|
1278
2398
|
}
|
|
@@ -1686,6 +2806,17 @@ export function processExpression({
|
|
|
1686
2806
|
// Extract conditional usages for key attribute detection
|
|
1687
2807
|
extractConditionalUsage(unwrappedNode.condition, context, 'ternary');
|
|
1688
2808
|
|
|
2809
|
+
// Extract conditional effects (setter calls in ternary branches)
|
|
2810
|
+
const knownSetters = findUseStateSetters(context.sourceFile);
|
|
2811
|
+
const effects = extractConditionalEffectsFromTernary(
|
|
2812
|
+
unwrappedNode,
|
|
2813
|
+
context,
|
|
2814
|
+
knownSetters,
|
|
2815
|
+
);
|
|
2816
|
+
for (const effect of effects) {
|
|
2817
|
+
context.addConditionalEffect(effect);
|
|
2818
|
+
}
|
|
2819
|
+
|
|
1689
2820
|
// Process all parts recursively
|
|
1690
2821
|
processExpression({
|
|
1691
2822
|
node: unwrappedNode.condition,
|
|
@@ -1819,6 +2950,35 @@ export function processExpression({
|
|
|
1819
2950
|
|
|
1820
2951
|
// Handle Arrow Functions: (p) => p.prop, (a, b) => { ... }
|
|
1821
2952
|
if (ts.isArrowFunction(unwrappedNode)) {
|
|
2953
|
+
// If this arrow function is a child boundary (e.g., a .map() callback),
|
|
2954
|
+
// don't process its parameters here - they will be processed when the
|
|
2955
|
+
// child scope is analyzed separately. This prevents parameter variables
|
|
2956
|
+
// from leaking into the parent scope's equivalencies.
|
|
2957
|
+
// Check if this arrow function is a child boundary (i.e., should be processed
|
|
2958
|
+
// as a separate child scope, not here in the parent scope).
|
|
2959
|
+
//
|
|
2960
|
+
// We use two checks because childBoundary positions can be unreliable:
|
|
2961
|
+
// 1. Position-based check (standard isChildBoundary)
|
|
2962
|
+
// 2. Text-based check: if the arrow function text doesn't appear in the
|
|
2963
|
+
// statement text, it was replaced with a cyScope placeholder
|
|
2964
|
+
const isChildBoundary = context.isChildBoundary(unwrappedNode);
|
|
2965
|
+
|
|
2966
|
+
// Text-based child scope detection for when positions are unreliable
|
|
2967
|
+
const arrowFnText = unwrappedNode.getText(context.sourceFile);
|
|
2968
|
+
const firstLine = arrowFnText.split('\n')[0].trim();
|
|
2969
|
+
const searchText = firstLine.substring(0, Math.min(20, firstLine.length));
|
|
2970
|
+
const isInStatementText = context.statementInfo.text.includes(searchText);
|
|
2971
|
+
const isChildScope = !isInStatementText && arrowFnText.length > 10;
|
|
2972
|
+
|
|
2973
|
+
if (isChildBoundary || isChildScope) {
|
|
2974
|
+
// The method semantics (e.g., ArrayMapSemantics) have already established
|
|
2975
|
+
// the necessary equivalences between the child scope placeholder and array elements
|
|
2976
|
+
if (targetPath) {
|
|
2977
|
+
context.addType(targetPath, 'function');
|
|
2978
|
+
}
|
|
2979
|
+
return true;
|
|
2980
|
+
}
|
|
2981
|
+
|
|
1822
2982
|
// Create a path for the function
|
|
1823
2983
|
const functionPath = StructuredPath.empty();
|
|
1824
2984
|
|
|
@@ -2249,6 +3409,19 @@ export function processExpression({
|
|
|
2249
3409
|
for (const child of unwrappedNode.children) {
|
|
2250
3410
|
// Process expressions in JSX children: <div>{expr}</div>
|
|
2251
3411
|
if (ts.isJsxExpression(child) && child.expression) {
|
|
3412
|
+
// When processing return value JSX, link root variables to return value schema
|
|
3413
|
+
if (targetPath && targetPath.base !== '') {
|
|
3414
|
+
const varNames = [
|
|
3415
|
+
...new Set(extractRootVariableNames(child.expression)),
|
|
3416
|
+
];
|
|
3417
|
+
for (const varName of varNames) {
|
|
3418
|
+
context.addEquivalence(
|
|
3419
|
+
targetPath.withProperty(varName),
|
|
3420
|
+
StructuredPath.fromBase(varName),
|
|
3421
|
+
);
|
|
3422
|
+
}
|
|
3423
|
+
}
|
|
3424
|
+
|
|
2252
3425
|
// Process the expression with StructuredPath.empty() as targetPath
|
|
2253
3426
|
// to trigger type registration without imposing prefix
|
|
2254
3427
|
processExpression({
|
|
@@ -2283,6 +3456,19 @@ export function processExpression({
|
|
|
2283
3456
|
for (const child of unwrappedNode.children) {
|
|
2284
3457
|
// Process expressions in JSX children: <>{expr}</>
|
|
2285
3458
|
if (ts.isJsxExpression(child) && child.expression) {
|
|
3459
|
+
// When processing return value JSX, link root variables to return value schema
|
|
3460
|
+
if (targetPath && targetPath.base !== '') {
|
|
3461
|
+
const varNames = [
|
|
3462
|
+
...new Set(extractRootVariableNames(child.expression)),
|
|
3463
|
+
];
|
|
3464
|
+
for (const varName of varNames) {
|
|
3465
|
+
context.addEquivalence(
|
|
3466
|
+
targetPath.withProperty(varName),
|
|
3467
|
+
StructuredPath.fromBase(varName),
|
|
3468
|
+
);
|
|
3469
|
+
}
|
|
3470
|
+
}
|
|
3471
|
+
|
|
2286
3472
|
// Process the expression to extract structure
|
|
2287
3473
|
processExpression({
|
|
2288
3474
|
node: child.expression,
|