@codeyam/codeyam-cli 0.1.0-staging.b8a55ba → 0.1.0-staging.c90f8c9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/analyzer-template/.build-info.json +8 -8
- package/analyzer-template/common/execAsync.ts +1 -1
- package/analyzer-template/log.txt +3 -3
- package/analyzer-template/package.json +9 -6
- package/analyzer-template/packages/ai/index.ts +10 -3
- package/analyzer-template/packages/ai/package.json +1 -1
- package/analyzer-template/packages/ai/src/lib/__mocks__/completionCall.ts +122 -0
- package/analyzer-template/packages/ai/src/lib/analyzeScope.ts +126 -6
- package/analyzer-template/packages/ai/src/lib/astScopes/arrayDerivationDetector.ts +199 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/astScopeAnalyzer.ts +116 -1
- package/analyzer-template/packages/ai/src/lib/astScopes/conditionalEffectsExtractor.ts +644 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/methodSemantics.ts +140 -6
- package/analyzer-template/packages/ai/src/lib/astScopes/patterns/ifStatementHandler.ts +18 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/patterns/switchStatementHandler.ts +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 +849 -9
- package/analyzer-template/packages/ai/src/lib/astScopes/types.ts +244 -0
- package/analyzer-template/packages/ai/src/lib/checkAllAttributes.ts +29 -10
- package/analyzer-template/packages/ai/src/lib/completionCall.ts +216 -36
- package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +892 -117
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.ts +2 -1
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.ts +296 -35
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.ts +120 -76
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.ts +80 -5
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertNullToUndefinedBySchema.ts +98 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.ts +8 -1
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fixNullIdsBySchema.ts +129 -0
- package/analyzer-template/packages/ai/src/lib/dataStructureChunking.ts +156 -0
- package/analyzer-template/packages/ai/src/lib/deepEqual.ts +30 -0
- package/analyzer-template/packages/ai/src/lib/e2eDataTracking.ts +334 -0
- package/analyzer-template/packages/ai/src/lib/extractCriticalDataKeys.ts +120 -0
- package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarioData.ts +74 -7
- package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarios.ts +86 -142
- package/analyzer-template/packages/ai/src/lib/generateEntityDataStructure.ts +1 -0
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +1111 -87
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarios.ts +191 -191
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +570 -0
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.ts +528 -0
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionals.ts +1977 -0
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.ts +239 -0
- package/analyzer-template/packages/ai/src/lib/guessScenarioDataFromDescription.ts +5 -5
- package/analyzer-template/packages/ai/src/lib/isolateScopes.ts +276 -3
- package/analyzer-template/packages/ai/src/lib/mergeStatements.ts +33 -3
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.ts +1 -1
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.ts +32 -142
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChunkPrompt.ts +82 -0
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateCriticalKeysPrompt.ts +103 -0
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.ts +90 -6
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.ts +14 -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 +812 -0
- package/analyzer-template/packages/ai/src/lib/splitOutsideParentheses.ts +5 -1
- package/analyzer-template/packages/ai/src/lib/validateExecutionFlowPaths.ts +531 -0
- package/analyzer-template/packages/ai/src/lib/worker/SerializableDataStructure.ts +118 -0
- package/analyzer-template/packages/analyze/src/lib/FileAnalyzer.ts +14 -0
- package/analyzer-template/packages/analyze/src/lib/analysisContext.ts +44 -4
- package/analyzer-template/packages/analyze/src/lib/asts/nodes/index.ts +1 -0
- package/analyzer-template/packages/analyze/src/lib/asts/nodes/isAsyncFunction.ts +67 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +381 -265
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +18 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyze/findOrCreateEntity.ts +3 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.ts +33 -7
- package/analyzer-template/packages/analyze/src/lib/files/analyzeChange.ts +31 -15
- package/analyzer-template/packages/analyze/src/lib/files/analyzeEntity.ts +11 -7
- package/analyzer-template/packages/analyze/src/lib/files/analyzeInitial.ts +11 -12
- package/analyzer-template/packages/analyze/src/lib/files/enums/steps.ts +1 -1
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.ts +148 -41
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichUnknownTypesFromSourceEquivalencies.ts +102 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.ts +506 -59
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.ts +28 -62
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +157 -74
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.ts +156 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarioData.ts +35 -129
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarios.ts +2 -3
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +420 -87
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.ts +56 -11
- package/analyzer-template/packages/aws/codebuild/index.ts +1 -0
- package/analyzer-template/packages/aws/dist/src/lib/codebuild/waitForBuild.d.ts +11 -1
- package/analyzer-template/packages/aws/dist/src/lib/codebuild/waitForBuild.d.ts.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/codebuild/waitForBuild.js +29 -18
- package/analyzer-template/packages/aws/dist/src/lib/codebuild/waitForBuild.js.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsDefineContainer.d.ts +2 -2
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsDefineContainer.d.ts.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsDefineContainer.js +2 -2
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsDefineContainer.js.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsTaskFactory.d.ts +8 -18
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsTaskFactory.d.ts.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsTaskFactory.js +17 -61
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsTaskFactory.js.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/s3/uploadFileToS3.d.ts.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/s3/uploadFileToS3.js +8 -1
- package/analyzer-template/packages/aws/dist/src/lib/s3/uploadFileToS3.js.map +1 -1
- package/analyzer-template/packages/aws/package.json +3 -3
- package/analyzer-template/packages/aws/src/lib/codebuild/waitForBuild.ts +43 -19
- package/analyzer-template/packages/aws/src/lib/ecs/ecsDefineContainer.ts +3 -3
- package/analyzer-template/packages/aws/src/lib/ecs/ecsTaskFactory.ts +17 -69
- package/analyzer-template/packages/aws/src/lib/s3/uploadFileToS3.ts +8 -1
- package/analyzer-template/packages/database/src/lib/kysely/tables/debugReportsTable.ts +17 -1
- package/analyzer-template/packages/database/src/lib/loadAnalyses.ts +58 -1
- package/analyzer-template/packages/database/src/lib/loadCommits.ts +16 -0
- package/analyzer-template/packages/database/src/lib/loadEntities.ts +26 -3
- package/analyzer-template/packages/database/src/lib/loadReadyToBeCapturedAnalyses.ts +7 -3
- package/analyzer-template/packages/generate/index.ts +3 -0
- package/analyzer-template/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.ts +17 -1
- package/analyzer-template/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.ts +193 -0
- package/analyzer-template/packages/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.ts +73 -0
- package/analyzer-template/packages/generate/src/lib/scenarioComponentForServer.ts +114 -0
- 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/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/entitiesTable.d.ts +1 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/entitiesTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts +2 -6
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/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/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 +13 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.d.ts +3 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js +23 -4
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js +7 -4
- package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js.map +1 -1
- package/analyzer-template/packages/github/dist/generate/index.d.ts +3 -0
- package/analyzer-template/packages/github/dist/generate/index.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/index.js +3 -0
- package/analyzer-template/packages/github/dist/generate/index.js.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js +16 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.d.ts +9 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.d.ts.map +1 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +189 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.d.ts +20 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.d.ts.map +1 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.js +53 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.js.map +1 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponentForServer.d.ts +8 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponentForServer.d.ts.map +1 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponentForServer.js +89 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponentForServer.js.map +1 -0
- package/analyzer-template/packages/github/dist/github/src/lib/loadOrCreateCommit.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/github/src/lib/loadOrCreateCommit.js +10 -0
- package/analyzer-template/packages/github/dist/github/src/lib/loadOrCreateCommit.js.map +1 -1
- package/analyzer-template/packages/github/dist/github/src/lib/syncPrimaryBranch.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/github/src/lib/syncPrimaryBranch.js +3 -0
- package/analyzer-template/packages/github/dist/github/src/lib/syncPrimaryBranch.js.map +1 -1
- package/analyzer-template/packages/github/dist/types/index.d.ts +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/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/Entity.d.ts +2 -0
- package/analyzer-template/packages/github/dist/types/src/types/Entity.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts +9 -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 +148 -0
- package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/StatementInfo.d.ts +2 -0
- package/analyzer-template/packages/github/dist/types/src/types/StatementInfo.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.d.ts +9 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.js +29 -3
- package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.js.map +1 -1
- package/analyzer-template/packages/github/src/lib/loadOrCreateCommit.ts +14 -0
- package/analyzer-template/packages/github/src/lib/syncPrimaryBranch.ts +2 -0
- package/analyzer-template/packages/process/index.ts +2 -0
- package/analyzer-template/packages/process/package.json +12 -0
- package/analyzer-template/packages/process/tsconfig.json +8 -0
- package/analyzer-template/packages/types/index.ts +3 -6
- package/analyzer-template/packages/types/src/types/Analysis.ts +87 -27
- package/analyzer-template/packages/types/src/types/Entity.ts +2 -0
- package/analyzer-template/packages/types/src/types/Scenario.ts +9 -77
- package/analyzer-template/packages/types/src/types/ScenariosDataStructure.ts +175 -0
- package/analyzer-template/packages/types/src/types/StatementInfo.ts +2 -0
- 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/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/Entity.d.ts +2 -0
- package/analyzer-template/packages/utils/dist/types/src/types/Entity.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts +9 -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 +148 -0
- package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/StatementInfo.d.ts +2 -0
- package/analyzer-template/packages/utils/dist/types/src/types/StatementInfo.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/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/safeFileName.ts +48 -3
- package/analyzer-template/playwright/capture.ts +37 -18
- package/analyzer-template/playwright/getCodeYamInfo.ts +12 -7
- package/analyzer-template/playwright/waitForServer.ts +21 -6
- package/analyzer-template/project/analyzeBaselineCommit.ts +4 -0
- package/analyzer-template/project/analyzeBranchCommit.ts +4 -0
- package/analyzer-template/project/analyzeFileEntities.ts +4 -0
- package/analyzer-template/project/analyzeRegularCommit.ts +4 -0
- package/analyzer-template/project/constructMockCode.ts +1112 -169
- package/analyzer-template/project/controller/startController.ts +16 -1
- package/analyzer-template/project/executeLibraryFunctionDirect.ts +7 -3
- package/analyzer-template/project/mocks/analyzeFileMock.ts +8 -7
- package/analyzer-template/project/orchestrateCapture/KyselyAnalysisLoader.ts +3 -6
- package/analyzer-template/project/orchestrateCapture/SequentialCaptureTaskRunner.ts +7 -1
- package/analyzer-template/project/orchestrateCapture.ts +36 -3
- package/analyzer-template/project/reconcileMockDataKeys.ts +220 -78
- package/analyzer-template/project/runAnalysis.ts +11 -0
- package/analyzer-template/project/serverOnlyModules.ts +127 -2
- package/analyzer-template/project/start.ts +16 -4
- package/analyzer-template/project/startScenarioCapture.ts +6 -0
- package/analyzer-template/project/writeMockDataTsx.ts +164 -24
- package/analyzer-template/project/writeScenarioClientWrapper.ts +21 -0
- package/analyzer-template/project/writeScenarioComponents.ts +304 -112
- package/analyzer-template/project/writeScenarioFiles.ts +26 -0
- package/analyzer-template/project/writeSimpleRoot.ts +11 -35
- package/analyzer-template/scripts/comboWorkerLoop.cjs +1 -0
- package/analyzer-template/scripts/defaultCmd.sh +9 -0
- package/analyzer-template/tsconfig.json +2 -1
- package/background/src/lib/local/createLocalAnalyzer.js +1 -29
- package/background/src/lib/local/createLocalAnalyzer.js.map +1 -1
- package/background/src/lib/local/execAsync.js +1 -1
- package/background/src/lib/local/execAsync.js.map +1 -1
- package/background/src/lib/virtualized/common/execAsync.js +1 -1
- package/background/src/lib/virtualized/common/execAsync.js.map +1 -1
- package/background/src/lib/virtualized/project/analyzeBaselineCommit.js +2 -1
- package/background/src/lib/virtualized/project/analyzeBaselineCommit.js.map +1 -1
- package/background/src/lib/virtualized/project/analyzeBranchCommit.js +2 -1
- package/background/src/lib/virtualized/project/analyzeBranchCommit.js.map +1 -1
- package/background/src/lib/virtualized/project/analyzeFileEntities.js +2 -1
- package/background/src/lib/virtualized/project/analyzeFileEntities.js.map +1 -1
- package/background/src/lib/virtualized/project/analyzeRegularCommit.js +2 -1
- package/background/src/lib/virtualized/project/analyzeRegularCommit.js.map +1 -1
- package/background/src/lib/virtualized/project/constructMockCode.js +987 -130
- package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
- package/background/src/lib/virtualized/project/controller/startController.js +11 -1
- package/background/src/lib/virtualized/project/controller/startController.js.map +1 -1
- package/background/src/lib/virtualized/project/executeLibraryFunctionDirect.js +6 -3
- package/background/src/lib/virtualized/project/executeLibraryFunctionDirect.js.map +1 -1
- package/background/src/lib/virtualized/project/mocks/analyzeFileMock.js +7 -7
- package/background/src/lib/virtualized/project/mocks/analyzeFileMock.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture/KyselyAnalysisLoader.js +3 -2
- package/background/src/lib/virtualized/project/orchestrateCapture/KyselyAnalysisLoader.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture/SequentialCaptureTaskRunner.js +3 -1
- package/background/src/lib/virtualized/project/orchestrateCapture/SequentialCaptureTaskRunner.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture.js +27 -4
- package/background/src/lib/virtualized/project/orchestrateCapture.js.map +1 -1
- package/background/src/lib/virtualized/project/reconcileMockDataKeys.js +188 -47
- package/background/src/lib/virtualized/project/reconcileMockDataKeys.js.map +1 -1
- package/background/src/lib/virtualized/project/runAnalysis.js +9 -0
- package/background/src/lib/virtualized/project/runAnalysis.js.map +1 -1
- package/background/src/lib/virtualized/project/serverOnlyModules.js +106 -3
- package/background/src/lib/virtualized/project/serverOnlyModules.js.map +1 -1
- package/background/src/lib/virtualized/project/start.js +15 -4
- package/background/src/lib/virtualized/project/start.js.map +1 -1
- package/background/src/lib/virtualized/project/startScenarioCapture.js +7 -0
- package/background/src/lib/virtualized/project/startScenarioCapture.js.map +1 -1
- package/background/src/lib/virtualized/project/writeMockDataTsx.js +139 -23
- package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
- package/background/src/lib/virtualized/project/writeScenarioClientWrapper.js +15 -0
- package/background/src/lib/virtualized/project/writeScenarioClientWrapper.js.map +1 -0
- package/background/src/lib/virtualized/project/writeScenarioComponents.js +228 -95
- package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
- package/background/src/lib/virtualized/project/writeScenarioFiles.js +19 -0
- package/background/src/lib/virtualized/project/writeScenarioFiles.js.map +1 -1
- package/background/src/lib/virtualized/project/writeSimpleRoot.js +11 -34
- package/background/src/lib/virtualized/project/writeSimpleRoot.js.map +1 -1
- package/codeyam-cli/src/cli.js +5 -1
- package/codeyam-cli/src/cli.js.map +1 -1
- package/codeyam-cli/src/commands/analyze.js +1 -1
- package/codeyam-cli/src/commands/analyze.js.map +1 -1
- package/codeyam-cli/src/commands/baseline.js +174 -0
- package/codeyam-cli/src/commands/baseline.js.map +1 -0
- package/codeyam-cli/src/commands/debug.js +28 -18
- package/codeyam-cli/src/commands/debug.js.map +1 -1
- package/codeyam-cli/src/commands/default.js +0 -15
- package/codeyam-cli/src/commands/default.js.map +1 -1
- package/codeyam-cli/src/commands/recapture.js +29 -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/start.js +8 -12
- package/codeyam-cli/src/commands/start.js.map +1 -1
- package/codeyam-cli/src/commands/status.js +23 -1
- package/codeyam-cli/src/commands/status.js.map +1 -1
- package/codeyam-cli/src/commands/test-startup.js +1 -1
- package/codeyam-cli/src/commands/test-startup.js.map +1 -1
- package/codeyam-cli/src/commands/wipe.js +108 -0
- package/codeyam-cli/src/commands/wipe.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/serverVersionStaleness.test.js +81 -0
- package/codeyam-cli/src/utils/__tests__/serverVersionStaleness.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +31 -27
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
- package/codeyam-cli/src/utils/analysisRunner.js +28 -14
- package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
- package/codeyam-cli/src/utils/backgroundServer.js +12 -2
- package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/utils/database.js +91 -5
- package/codeyam-cli/src/utils/database.js.map +1 -1
- package/codeyam-cli/src/utils/generateReport.js +4 -3
- package/codeyam-cli/src/utils/generateReport.js.map +1 -1
- package/codeyam-cli/src/utils/git.js +79 -0
- package/codeyam-cli/src/utils/git.js.map +1 -0
- package/codeyam-cli/src/utils/install-skills.js +31 -17
- package/codeyam-cli/src/utils/install-skills.js.map +1 -1
- package/codeyam-cli/src/utils/queue/job.js +105 -0
- package/codeyam-cli/src/utils/queue/job.js.map +1 -1
- package/codeyam-cli/src/utils/queue/manager.js +6 -0
- package/codeyam-cli/src/utils/queue/manager.js.map +1 -1
- package/codeyam-cli/src/utils/queue/persistence.js.map +1 -1
- package/codeyam-cli/src/utils/serverState.js.map +1 -1
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +7 -5
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
- package/codeyam-cli/src/utils/versionInfo.js +25 -19
- package/codeyam-cli/src/utils/versionInfo.js.map +1 -1
- package/codeyam-cli/src/utils/wipe.js +128 -0
- package/codeyam-cli/src/utils/wipe.js.map +1 -0
- package/codeyam-cli/src/webserver/app/lib/database.js +73 -20
- package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
- package/codeyam-cli/src/webserver/bootstrap.js +40 -0
- package/codeyam-cli/src/webserver/bootstrap.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityItem-BXhEawa3.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-CzGX-miz.js → EntityTypeBadge-DLqD3qNt.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-Ba2JVPzP.js +41 -0
- package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-C8lyxW9k.js +34 -0
- package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-aht4aafF.js +25 -0
- package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-CBQPrpT0.js → LibraryFunctionPreview-CVtiBnY5.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-D1CdlbrV.js → LoadingDots-B0GLXMsr.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-wDPcZNKx.js → LogViewer-xgeCVgSM.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-D4TZhLuw.js +21 -0
- package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-BfmDgXxG.js → SafeScreenshot-DuDvi0jm.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-DEx02QDa.js +10 -0
- package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-6J7zDUD5.js → TruncatedFilePath-DyFZkK0l.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/_index-BwqWJOgH.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-DoLIqZX2.js +37 -0
- package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-BYimnrHg.js → chevron-down-Cx24_aWc.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/chunk-EPOLDU6W-CXRTFQ3F.js +51 -0
- package/codeyam-cli/src/webserver/build/client/assets/{circle-check-CaVsIRxt.js → circle-check-BOARzkeR.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-CgUsG7ib.js → createLucideIcon-BdhJEx6B.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{cy-logo-cli-C1gnJVOL.svg → cy-logo-cli-CCKUIm0S.svg} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/cy-logo-cli-DcX-ZS3p.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-BRb-0kQl.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-zUEpfPsu.js → entity._sha._-C2N4Op8e.js} +12 -12
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-DavjRmOY.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-D1T4TGjf.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-CfLCUi9S.js → entity._sha_.edit._scenarioId-CTBG2mmz.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entry.client-DKJyZfAY.js → entry.client-CS2cb_eZ.js} +6 -6
- package/codeyam-cli/src/webserver/build/client/assets/executionFlowCoverage-BWhdfn70.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{fileTableUtils-DAtOlaWE.js → fileTableUtils-DMJ7zii9.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/files-Cs4MdYtv.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{git-D62Lxxmv.js → git-B4RJRvYB.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/git-commit-horizontal-CysbcZxi.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/globals-DMUaGAqV.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{index-CzNNiTkw.js → index-B1h680n5.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{index-BosqDOlH.js → index-lzqtyFU8.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-CNp9QFCX.js → loader-circle-B7B9V-bu.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-f874c610.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/root-Bz5TunQg.js +57 -0
- package/codeyam-cli/src/webserver/build/client/assets/rules-hEkvVw2-.js +97 -0
- package/codeyam-cli/src/webserver/build/client/assets/{search-DDGjYAMJ.js → search-CxXUmBSd.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/settings-CS5f3WzT.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/simulations-DwFIBT09.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-CBc5dE1s.js → triangle-alert-B6LgvRJg.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-C1v1PQzo.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-BqPPNjAl.js → useLastLogLine-aSv48UbS.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/useReportContext-DYxHZQuP.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{useToast-DWHcCcl1.js → useToast-mBRpZPiu.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/index-uNNbimct.js +1 -0
- package/codeyam-cli/src/webserver/build/server/assets/server-build-B08qC4Y7.js +257 -0
- package/codeyam-cli/src/webserver/build/server/index.js +1 -1
- package/codeyam-cli/src/webserver/build-info.json +5 -5
- package/codeyam-cli/src/webserver/server.js +35 -25
- package/codeyam-cli/src/webserver/server.js.map +1 -1
- package/codeyam-cli/templates/codeyam-power-rules-hook.sh +200 -0
- package/codeyam-cli/templates/{codeyam-debug-skill.md → codeyam:debug.md} +48 -4
- package/codeyam-cli/templates/{debug-codeyam.md → codeyam:diagnose.md} +185 -23
- package/codeyam-cli/templates/codeyam:new-rule.md +13 -0
- package/codeyam-cli/templates/codeyam:power-rules.md +449 -0
- package/codeyam-cli/templates/{codeyam-setup-skill.md → codeyam:setup.md} +139 -4
- package/codeyam-cli/templates/{codeyam-sim-skill.md → codeyam:sim.md} +1 -1
- package/codeyam-cli/templates/{codeyam-test-skill.md → codeyam:test.md} +1 -1
- package/codeyam-cli/templates/{codeyam-verify-skill.md → codeyam:verify.md} +1 -1
- package/package.json +6 -5
- package/packages/ai/index.js +5 -4
- package/packages/ai/index.js.map +1 -1
- package/packages/ai/src/lib/analyzeScope.js +97 -0
- package/packages/ai/src/lib/analyzeScope.js.map +1 -1
- package/packages/ai/src/lib/astScopes/arrayDerivationDetector.js +150 -0
- package/packages/ai/src/lib/astScopes/arrayDerivationDetector.js.map +1 -0
- package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js +84 -1
- package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js.map +1 -1
- package/packages/ai/src/lib/astScopes/conditionalEffectsExtractor.js +435 -0
- package/packages/ai/src/lib/astScopes/conditionalEffectsExtractor.js.map +1 -0
- package/packages/ai/src/lib/astScopes/methodSemantics.js +97 -6
- package/packages/ai/src/lib/astScopes/methodSemantics.js.map +1 -1
- package/packages/ai/src/lib/astScopes/patterns/ifStatementHandler.js +8 -0
- package/packages/ai/src/lib/astScopes/patterns/ifStatementHandler.js.map +1 -1
- package/packages/ai/src/lib/astScopes/patterns/switchStatementHandler.js +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 +654 -13
- package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
- package/packages/ai/src/lib/checkAllAttributes.js +24 -9
- package/packages/ai/src/lib/checkAllAttributes.js.map +1 -1
- package/packages/ai/src/lib/completionCall.js +178 -31
- package/packages/ai/src/lib/completionCall.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +715 -64
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js +2 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.js +230 -23
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js +77 -55
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js +67 -3
- package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/convertNullToUndefinedBySchema.js +86 -0
- package/packages/ai/src/lib/dataStructure/helpers/convertNullToUndefinedBySchema.js.map +1 -0
- package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js +6 -1
- package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/fixNullIdsBySchema.js +107 -0
- package/packages/ai/src/lib/dataStructure/helpers/fixNullIdsBySchema.js.map +1 -0
- package/packages/ai/src/lib/dataStructureChunking.js +111 -0
- package/packages/ai/src/lib/dataStructureChunking.js.map +1 -0
- package/packages/ai/src/lib/deepEqual.js +32 -0
- package/packages/ai/src/lib/deepEqual.js.map +1 -0
- package/packages/ai/src/lib/e2eDataTracking.js +241 -0
- package/packages/ai/src/lib/e2eDataTracking.js.map +1 -0
- package/packages/ai/src/lib/extractCriticalDataKeys.js +96 -0
- package/packages/ai/src/lib/extractCriticalDataKeys.js.map +1 -0
- package/packages/ai/src/lib/generateChangesEntityScenarioData.js +62 -5
- package/packages/ai/src/lib/generateChangesEntityScenarioData.js.map +1 -1
- package/packages/ai/src/lib/generateChangesEntityScenarios.js +78 -120
- package/packages/ai/src/lib/generateChangesEntityScenarios.js.map +1 -1
- package/packages/ai/src/lib/generateEntityDataStructure.js +1 -0
- package/packages/ai/src/lib/generateEntityDataStructure.js.map +1 -1
- package/packages/ai/src/lib/generateEntityScenarioData.js +906 -82
- package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
- package/packages/ai/src/lib/generateEntityScenarios.js +170 -162
- package/packages/ai/src/lib/generateEntityScenarios.js.map +1 -1
- package/packages/ai/src/lib/generateExecutionFlows.js +392 -0
- package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.js +380 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.js.map +1 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js +1440 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js.map +1 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.js +194 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.js.map +1 -0
- package/packages/ai/src/lib/guessScenarioDataFromDescription.js +2 -2
- package/packages/ai/src/lib/guessScenarioDataFromDescription.js.map +1 -1
- package/packages/ai/src/lib/isolateScopes.js +231 -4
- package/packages/ai/src/lib/isolateScopes.js.map +1 -1
- package/packages/ai/src/lib/mergeStatements.js +26 -3
- package/packages/ai/src/lib/mergeStatements.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.js +1 -1
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js +21 -100
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateChunkPrompt.js +54 -0
- package/packages/ai/src/lib/promptGenerators/generateChunkPrompt.js.map +1 -0
- package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js +68 -6
- package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.js +10 -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 +667 -0
- package/packages/ai/src/lib/resolvePathToControllable.js.map +1 -0
- package/packages/ai/src/lib/splitOutsideParentheses.js +3 -1
- package/packages/ai/src/lib/splitOutsideParentheses.js.map +1 -1
- package/packages/ai/src/lib/worker/SerializableDataStructure.js +29 -0
- package/packages/ai/src/lib/worker/SerializableDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/FileAnalyzer.js +15 -0
- package/packages/analyze/src/lib/FileAnalyzer.js.map +1 -1
- package/packages/analyze/src/lib/analysisContext.js +30 -5
- package/packages/analyze/src/lib/analysisContext.js.map +1 -1
- package/packages/analyze/src/lib/asts/nodes/index.js +1 -0
- package/packages/analyze/src/lib/asts/nodes/index.js.map +1 -1
- package/packages/analyze/src/lib/asts/nodes/isAsyncFunction.js +52 -0
- package/packages/analyze/src/lib/asts/nodes/isAsyncFunction.js.map +1 -0
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +151 -52
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +10 -0
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js +2 -0
- package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js +31 -7
- package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeChange.js +21 -11
- package/packages/analyze/src/lib/files/analyzeChange.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeEntity.js +9 -8
- package/packages/analyze/src/lib/files/analyzeEntity.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeInitial.js +9 -10
- package/packages/analyze/src/lib/files/analyzeInitial.js.map +1 -1
- package/packages/analyze/src/lib/files/enums/steps.js +1 -1
- package/packages/analyze/src/lib/files/enums/steps.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js +121 -37
- package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/enrichUnknownTypesFromSourceEquivalencies.js +85 -0
- package/packages/analyze/src/lib/files/scenarios/enrichUnknownTypesFromSourceEquivalencies.js.map +1 -0
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js +410 -55
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.js +29 -34
- package/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +126 -57
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js +96 -0
- package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js.map +1 -0
- package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js +27 -98
- 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 +342 -83
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.js +46 -9
- package/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.js.map +1 -1
- package/packages/aws/src/lib/ecs/ecsDefineContainer.js +2 -2
- package/packages/aws/src/lib/ecs/ecsDefineContainer.js.map +1 -1
- package/packages/aws/src/lib/ecs/ecsTaskFactory.js +17 -61
- package/packages/aws/src/lib/ecs/ecsTaskFactory.js.map +1 -1
- package/packages/database/src/lib/kysely/tables/debugReportsTable.js.map +1 -1
- package/packages/database/src/lib/loadAnalyses.js +45 -2
- package/packages/database/src/lib/loadAnalyses.js.map +1 -1
- package/packages/database/src/lib/loadCommits.js +13 -1
- package/packages/database/src/lib/loadCommits.js.map +1 -1
- package/packages/database/src/lib/loadEntities.js +23 -4
- package/packages/database/src/lib/loadEntities.js.map +1 -1
- package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.js +7 -4
- package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.js.map +1 -1
- package/packages/generate/index.js +3 -0
- package/packages/generate/index.js.map +1 -1
- package/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js +16 -1
- package/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js.map +1 -1
- package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +189 -0
- package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -0
- package/packages/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.js +53 -0
- package/packages/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.js.map +1 -0
- package/packages/generate/src/lib/scenarioComponentForServer.js +89 -0
- package/packages/generate/src/lib/scenarioComponentForServer.js.map +1 -0
- package/packages/github/src/lib/loadOrCreateCommit.js +10 -0
- package/packages/github/src/lib/loadOrCreateCommit.js.map +1 -1
- package/packages/github/src/lib/syncPrimaryBranch.js +3 -0
- package/packages/github/src/lib/syncPrimaryBranch.js.map +1 -1
- package/packages/process/index.js +3 -0
- package/packages/process/index.js.map +1 -0
- package/packages/process/src/GlobalProcessManager.js.map +1 -0
- package/{background/src/lib/process → packages/process/src}/ProcessManager.js +1 -1
- package/packages/process/src/ProcessManager.js.map +1 -0
- package/packages/process/src/index.js.map +1 -0
- package/packages/process/src/managedExecAsync.js.map +1 -0
- package/packages/types/index.js +0 -1
- package/packages/types/index.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/safeFileName.js +29 -3
- package/packages/utils/src/lib/safeFileName.js.map +1 -1
- package/scripts/finalize-analyzer.cjs +3 -3
- package/analyzer-template/packages/ai/src/lib/findMatchingAttribute.ts +0 -102
- package/analyzer-template/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.ts +0 -409
- package/analyzer-template/packages/ai/src/lib/generateChangesEntityKeyAttributes.ts +0 -288
- 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/analyzer-template/process/INTEGRATION_COMPLETE.md +0 -333
- package/analyzer-template/process/INTEGRATION_EXAMPLE.md +0 -525
- package/analyzer-template/process/README.md +0 -507
- package/background/src/lib/process/GlobalProcessManager.js.map +0 -1
- package/background/src/lib/process/ProcessManager.js.map +0 -1
- package/background/src/lib/process/index.js.map +0 -1
- package/background/src/lib/process/managedExecAsync.js.map +0 -1
- package/codeyam-cli/scripts/fixtures/cal.com/universal-mocks/packages/prisma/index.js +0 -238
- package/codeyam-cli/scripts/fixtures/cal.com/universal-mocks/packages/prisma/index.js.map +0 -1
- package/codeyam-cli/scripts/fixtures/formbricks/universal-mocks/apps/web/lib/instance/service.js +0 -7
- package/codeyam-cli/scripts/fixtures/formbricks/universal-mocks/apps/web/lib/instance/service.js.map +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityItem-wXL1Z2Aq.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-CXFKsCOD.js +0 -41
- package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-D-9pXIaY.js +0 -25
- package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-4lcOlid-.js +0 -11
- package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-CUxUNEEC.js +0 -15
- package/codeyam-cli/src/webserver/build/client/assets/_index-DHImXdXq.js +0 -11
- package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-2mG6mjVb.js +0 -32
- package/codeyam-cli/src/webserver/build/client/assets/chunk-JMJ3UQ3L-BambyYE_.js +0 -51
- package/codeyam-cli/src/webserver/build/client/assets/cy-logo-cli-CKnwPCDr.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-DW_hdGUc.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-DyB90fWk.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-D_3ero5o.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/files-ClR0d32A.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/globals-C6vQASxy.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-09d684be.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/root-BxJUvKau.js +0 -56
- package/codeyam-cli/src/webserver/build/client/assets/settings-DgTyB-Wg.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/simulations-CoNWGt0K.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-BMIGFP-m.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useInteractiveMode-Dk_FQqWJ.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useReportContext-DsJbgMY9.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/index-CV6i1S1A.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-BDlyhfrv.js +0 -175
- package/packages/ai/src/lib/findMatchingAttribute.js +0 -77
- package/packages/ai/src/lib/findMatchingAttribute.js.map +0 -1
- package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js +0 -298
- package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js.map +0 -1
- package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js +0 -226
- 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/analyzer-template/{process → packages/process/src}/GlobalProcessManager.ts +0 -0
- /package/analyzer-template/{process → packages/process/src}/ProcessManager.ts +0 -0
- /package/analyzer-template/{process → packages/process/src}/index.ts +0 -0
- /package/analyzer-template/{process → packages/process/src}/managedExecAsync.ts +0 -0
- /package/codeyam-cli/src/webserver/build/client/assets/{api.link-scenario-value-l0sNRNKZ.js → api.health-l0sNRNKZ.js} +0 -0
- /package/codeyam-cli/src/webserver/build/client/assets/{api.update-key-attributes-l0sNRNKZ.js → api.restart-server-l0sNRNKZ.js} +0 -0
- /package/codeyam-cli/src/webserver/build/client/assets/{api.update-valid-values-l0sNRNKZ.js → api.rules-l0sNRNKZ.js} +0 -0
- /package/{background/src/lib/process → packages/process/src}/GlobalProcessManager.js +0 -0
- /package/{background/src/lib/process → packages/process/src}/index.js +0 -0
- /package/{background/src/lib/process → packages/process/src}/managedExecAsync.js +0 -0
|
@@ -0,0 +1,570 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates execution flows using pure static analysis.
|
|
3
|
+
*
|
|
4
|
+
* This module has been refactored to use deterministic flow generation
|
|
5
|
+
* instead of LLM calls. Flows are derived from:
|
|
6
|
+
* 1. conditionalUsages - variables used in if/ternary/&&/switch
|
|
7
|
+
* 2. conditionalEffects - setter calls inside conditionals
|
|
8
|
+
* 3. jsxRenderingUsages - arrays rendered via .map() and strings interpolated in JSX
|
|
9
|
+
*
|
|
10
|
+
* Only paths that resolve to controllable data sources produce flows,
|
|
11
|
+
* eliminating the problem of invalid paths like useState variables.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import {
|
|
15
|
+
DataStructure,
|
|
16
|
+
Entity,
|
|
17
|
+
ExecutionFlow,
|
|
18
|
+
ConditionalEffect,
|
|
19
|
+
} from '~codeyam/types';
|
|
20
|
+
import { awsLog } from '~codeyam/utils';
|
|
21
|
+
import { gatherAttributesMap } from './promptGenerators/gatherAttributesMap';
|
|
22
|
+
import { fillInDirectSchemaGapsAndUnknowns } from './dataStructure/helpers/fillInSchemaGapsAndUnknowns';
|
|
23
|
+
import { clearAttributesFromMapping } from './dataStructure/helpers/cleanNonObjectFunctions';
|
|
24
|
+
import type { CompoundConditional } from '~codeyam/types';
|
|
25
|
+
import { LlmCall } from '~codeyam/types';
|
|
26
|
+
import generateExecutionFlowsFromConditionalEffects from './generateExecutionFlowsFromConditionalEffects';
|
|
27
|
+
import generateExecutionFlowsFromConditionals, {
|
|
28
|
+
ChildComponentConditionalData,
|
|
29
|
+
} from './generateExecutionFlowsFromConditionals';
|
|
30
|
+
import generateExecutionFlowsFromJsxUsages from './generateExecutionFlowsFromJsxUsages';
|
|
31
|
+
import resolvePathToControllable from './resolvePathToControllable';
|
|
32
|
+
import { AI } from '~codeyam/ai';
|
|
33
|
+
import type { JsxRenderingUsage, ConditionalUsage } from './astScopes/types';
|
|
34
|
+
|
|
35
|
+
interface GenerateExecutionFlowsArgs {
|
|
36
|
+
entity: Pick<Entity, 'sha' | 'name' | 'filePath' | 'code' | 'metadata'>;
|
|
37
|
+
mergedDataStructure: Omit<DataStructure, 'equivalentSignatureVariables'>;
|
|
38
|
+
/** @deprecated Model is no longer used - execution flows are generated via static analysis */
|
|
39
|
+
model?: AI.Model;
|
|
40
|
+
/**
|
|
41
|
+
* Optional map of child entity names to their metadata.
|
|
42
|
+
* Used for merging child component execution flows into the parent.
|
|
43
|
+
* The caller should:
|
|
44
|
+
* 1. Look at childBoundaryGatingConditions to see which children need metadata
|
|
45
|
+
* 2. Find those entities (via importedExports or database lookup)
|
|
46
|
+
* 3. Pass their metadata here
|
|
47
|
+
*/
|
|
48
|
+
childEntityMetadata?: Record<string, Entity['metadata']>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export default function generateExecutionFlows({
|
|
52
|
+
entity,
|
|
53
|
+
mergedDataStructure,
|
|
54
|
+
childEntityMetadata,
|
|
55
|
+
}: GenerateExecutionFlowsArgs) {
|
|
56
|
+
awsLog(`CodeYam: Generating execution flows (static analysis)`, {
|
|
57
|
+
filePath: entity.filePath,
|
|
58
|
+
entityName: entity.name,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const isolatedDataStructure = entity.metadata?.isolatedDataStructure;
|
|
62
|
+
|
|
63
|
+
const equivalentSignatureVariables =
|
|
64
|
+
isolatedDataStructure?.equivalentSignatureVariables ?? {};
|
|
65
|
+
const { attributesMap, associationMap } = gatherAttributesMap(
|
|
66
|
+
isolatedDataStructure ?? mergedDataStructure,
|
|
67
|
+
mergedDataStructure,
|
|
68
|
+
equivalentSignatureVariables,
|
|
69
|
+
true,
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
// Clean the attributes map to remove primitive-returning array method paths
|
|
73
|
+
clearAttributesFromMapping(attributesMap);
|
|
74
|
+
|
|
75
|
+
if (Object.keys(attributesMap).length === 0) {
|
|
76
|
+
console.log(
|
|
77
|
+
`CodeYam: No valid attributes found for ${entity.filePath} ${entity.name}`,
|
|
78
|
+
);
|
|
79
|
+
return {
|
|
80
|
+
executionFlows: [],
|
|
81
|
+
llmCall: null as LlmCall | null,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Build merged schema for type inference
|
|
86
|
+
const mergedSchemaForTypeLookup = Object.fromEntries(
|
|
87
|
+
Object.entries(mergedDataStructure.signatureSchema ?? {})
|
|
88
|
+
.filter(([k]) => k.startsWith('signature['))
|
|
89
|
+
.map(([k, v]) => [k.replace(/^signature\[\d+\]\./, ''), v]),
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
// Resolve unknown types using heuristics
|
|
93
|
+
const resolvedAttributesMap = fillInDirectSchemaGapsAndUnknowns({
|
|
94
|
+
scopeName: entity.name,
|
|
95
|
+
schema: { ...attributesMap },
|
|
96
|
+
mergedSchema: mergedSchemaForTypeLookup,
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
// Build fullToShortPathMap from associationMap
|
|
100
|
+
// When reverse=true (which is what we pass), associationMap maps short→full
|
|
101
|
+
// (e.g., "state" → "useFetcher<...>().functionCallReturnValue.state")
|
|
102
|
+
// We need full→short for path resolution lookups
|
|
103
|
+
const fullToShortPathMap: Record<string, string> = {};
|
|
104
|
+
for (const [shortPath, fullPath] of Object.entries(associationMap)) {
|
|
105
|
+
fullToShortPathMap[fullPath] = shortPath;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Get pre-computed conditional data from metadata
|
|
109
|
+
const conditionalUsages: Record<string, ConditionalUsage[]> =
|
|
110
|
+
entity.metadata?.isolatedDataStructure?.conditionalUsages ?? {};
|
|
111
|
+
const compoundConditionals: CompoundConditional[] =
|
|
112
|
+
entity.metadata?.isolatedDataStructure?.compoundConditionals ?? [];
|
|
113
|
+
const conditionalEffects: ConditionalEffect[] =
|
|
114
|
+
entity.metadata?.isolatedDataStructure?.conditionalEffects ?? [];
|
|
115
|
+
// Get derivedVariables for multi-level derivation tracing
|
|
116
|
+
// This allows tracing through intermediate derived variables that aren't directly
|
|
117
|
+
// used in conditionals (e.g., isInCurrentRun that feeds into isAnalyzing)
|
|
118
|
+
const derivedVariables =
|
|
119
|
+
entity.metadata?.isolatedDataStructure?.derivedVariables;
|
|
120
|
+
|
|
121
|
+
// Build child component data for merging child flows into parent
|
|
122
|
+
// This requires:
|
|
123
|
+
// 1. childBoundaryGatingConditions - which parent conditions gate each child
|
|
124
|
+
// 2. childEntityMetadata - passed by caller after looking up child entities
|
|
125
|
+
const childBoundaryGatingConditions: Record<string, ConditionalUsage[]> =
|
|
126
|
+
entity.metadata?.isolatedDataStructure?.childBoundaryGatingConditions ?? {};
|
|
127
|
+
|
|
128
|
+
// Build childComponentData using the provided childEntityMetadata
|
|
129
|
+
// The caller is responsible for looking up child entities (via importedExports
|
|
130
|
+
// or database) and passing their metadata here
|
|
131
|
+
const childComponentData: Record<string, ChildComponentConditionalData> = {};
|
|
132
|
+
if (childEntityMetadata) {
|
|
133
|
+
for (const [childName, gatingConditions] of Object.entries(
|
|
134
|
+
childBoundaryGatingConditions,
|
|
135
|
+
)) {
|
|
136
|
+
const childMeta = childEntityMetadata[childName];
|
|
137
|
+
const childIsolated = childMeta?.isolatedDataStructure;
|
|
138
|
+
|
|
139
|
+
if (childIsolated) {
|
|
140
|
+
childComponentData[childName] = {
|
|
141
|
+
conditionalUsages: childIsolated.conditionalUsages ?? {},
|
|
142
|
+
equivalentSignatureVariables:
|
|
143
|
+
childIsolated.equivalentSignatureVariables ?? {},
|
|
144
|
+
compoundConditionals: childIsolated.compoundConditionals ?? [],
|
|
145
|
+
gatingConditions,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const conditionalsBasedFlows = generateExecutionFlowsFromConditionals({
|
|
152
|
+
conditionalUsages,
|
|
153
|
+
compoundConditionals,
|
|
154
|
+
attributesMap: resolvedAttributesMap,
|
|
155
|
+
equivalentSignatureVariables,
|
|
156
|
+
fullToShortPathMap,
|
|
157
|
+
childComponentData:
|
|
158
|
+
Object.keys(childComponentData).length > 0
|
|
159
|
+
? childComponentData
|
|
160
|
+
: undefined,
|
|
161
|
+
derivedVariables,
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
console.log(
|
|
165
|
+
`CodeYam: Generated ${conditionalsBasedFlows.length} flows from conditional usages`,
|
|
166
|
+
);
|
|
167
|
+
|
|
168
|
+
// Generate flows from conditional effects (setter calls inside conditionals)
|
|
169
|
+
// Pass resolution context so paths can be resolved to controllable data sources
|
|
170
|
+
const effectsBasedFlows = generateExecutionFlowsFromConditionalEffects(
|
|
171
|
+
conditionalEffects,
|
|
172
|
+
{
|
|
173
|
+
attributesMap: resolvedAttributesMap,
|
|
174
|
+
equivalentSignatureVariables,
|
|
175
|
+
fullToShortPathMap,
|
|
176
|
+
conditionalUsages,
|
|
177
|
+
},
|
|
178
|
+
);
|
|
179
|
+
|
|
180
|
+
console.log(
|
|
181
|
+
`CodeYam: Generated ${effectsBasedFlows.length} flows from conditional effects`,
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
// Generate flows from JSX rendering usages (array.map, text interpolation)
|
|
185
|
+
const jsxRenderingUsages: JsxRenderingUsage[] =
|
|
186
|
+
entity.metadata?.isolatedDataStructure?.jsxRenderingUsages ?? [];
|
|
187
|
+
|
|
188
|
+
const jsxBasedFlows = generateExecutionFlowsFromJsxUsages({
|
|
189
|
+
jsxRenderingUsages,
|
|
190
|
+
attributesMap: resolvedAttributesMap,
|
|
191
|
+
equivalentSignatureVariables,
|
|
192
|
+
fullToShortPathMap,
|
|
193
|
+
structure: isolatedDataStructure?.structure ?? {},
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
// Merge all flows, deduplicating by ID
|
|
197
|
+
// Effects-based flows take precedence as they have precise data source paths
|
|
198
|
+
// Conditionals-based flows second
|
|
199
|
+
// JSX-based flows last (lower priority as they're variation flows)
|
|
200
|
+
const allFlows: ExecutionFlow[] = [];
|
|
201
|
+
const seenIds = new Set<string>();
|
|
202
|
+
|
|
203
|
+
// Add effects-based flows first (higher priority)
|
|
204
|
+
for (const flow of effectsBasedFlows) {
|
|
205
|
+
if (!seenIds.has(flow.id)) {
|
|
206
|
+
seenIds.add(flow.id);
|
|
207
|
+
allFlows.push(flow);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// Add conditionals-based flows
|
|
212
|
+
for (const flow of conditionalsBasedFlows) {
|
|
213
|
+
if (!seenIds.has(flow.id)) {
|
|
214
|
+
seenIds.add(flow.id);
|
|
215
|
+
allFlows.push(flow);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// Add JSX-based flows (lowest priority - variation flows)
|
|
220
|
+
for (const flow of jsxBasedFlows) {
|
|
221
|
+
if (!seenIds.has(flow.id)) {
|
|
222
|
+
seenIds.add(flow.id);
|
|
223
|
+
allFlows.push(flow);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// Build a map of gating paths → child components they gate
|
|
228
|
+
// This allows us to identify which flows control child component rendering
|
|
229
|
+
const gatingPathToChildren = buildGatingPathToChildrenMap(
|
|
230
|
+
childBoundaryGatingConditions,
|
|
231
|
+
equivalentSignatureVariables,
|
|
232
|
+
resolvedAttributesMap,
|
|
233
|
+
fullToShortPathMap,
|
|
234
|
+
);
|
|
235
|
+
|
|
236
|
+
// Calculate priority and childComponentsControlled for each flow
|
|
237
|
+
for (const flow of allFlows) {
|
|
238
|
+
calculateFlowPriority(flow, gatingPathToChildren);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// Sort flows by priority (highest first)
|
|
242
|
+
allFlows.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
|
|
243
|
+
|
|
244
|
+
return {
|
|
245
|
+
executionFlows: allFlows,
|
|
246
|
+
llmCall: null as LlmCall | null, // No LLM calls in static analysis mode
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Build a map of gating paths to the child components they gate.
|
|
252
|
+
* This is used to identify which flows control child component rendering.
|
|
253
|
+
*/
|
|
254
|
+
function buildGatingPathToChildrenMap(
|
|
255
|
+
childBoundaryGatingConditions: Record<string, ConditionalUsage[]>,
|
|
256
|
+
equivalentSignatureVariables: Record<string, string>,
|
|
257
|
+
attributesMap: Record<string, string>,
|
|
258
|
+
fullToShortPathMap: Record<string, string>,
|
|
259
|
+
): Map<string, string[]> {
|
|
260
|
+
const gatingPathToChildren = new Map<string, string[]>();
|
|
261
|
+
|
|
262
|
+
for (const [childName, gatingConditions] of Object.entries(
|
|
263
|
+
childBoundaryGatingConditions,
|
|
264
|
+
)) {
|
|
265
|
+
for (const condition of gatingConditions) {
|
|
266
|
+
// Get the path that gates this child
|
|
267
|
+
let gatingPath = condition.path;
|
|
268
|
+
|
|
269
|
+
// If there's a derivedFrom sourcePath, use that
|
|
270
|
+
if (condition.derivedFrom?.sourcePath) {
|
|
271
|
+
gatingPath = condition.derivedFrom.sourcePath;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// Try to resolve to a controllable path
|
|
275
|
+
const resolution = resolvePathToControllable(
|
|
276
|
+
gatingPath,
|
|
277
|
+
attributesMap,
|
|
278
|
+
equivalentSignatureVariables,
|
|
279
|
+
fullToShortPathMap,
|
|
280
|
+
);
|
|
281
|
+
|
|
282
|
+
const finalPath =
|
|
283
|
+
resolution.isControllable && resolution.resolvedPath
|
|
284
|
+
? resolution.resolvedPath
|
|
285
|
+
: (equivalentSignatureVariables[gatingPath] ?? gatingPath);
|
|
286
|
+
|
|
287
|
+
// Add this child to the list of children gated by this path
|
|
288
|
+
const existing = gatingPathToChildren.get(finalPath) ?? [];
|
|
289
|
+
if (!existing.includes(childName)) {
|
|
290
|
+
existing.push(childName);
|
|
291
|
+
gatingPathToChildren.set(finalPath, existing);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// Also handle comparison conditions like "activeTab === 'scenarios'"
|
|
295
|
+
const comparisonMatch = gatingPath.match(
|
|
296
|
+
/^([a-zA-Z_][a-zA-Z0-9_]*)\s*(===?|!==?)\s*['"]?([^'"]+)['"]?$/,
|
|
297
|
+
);
|
|
298
|
+
if (comparisonMatch) {
|
|
299
|
+
const [, varName] = comparisonMatch;
|
|
300
|
+
const varResolution = resolvePathToControllable(
|
|
301
|
+
varName,
|
|
302
|
+
attributesMap,
|
|
303
|
+
equivalentSignatureVariables,
|
|
304
|
+
fullToShortPathMap,
|
|
305
|
+
);
|
|
306
|
+
const resolvedVarPath =
|
|
307
|
+
varResolution.isControllable && varResolution.resolvedPath
|
|
308
|
+
? varResolution.resolvedPath
|
|
309
|
+
: (equivalentSignatureVariables[varName] ?? varName);
|
|
310
|
+
|
|
311
|
+
const varExisting = gatingPathToChildren.get(resolvedVarPath) ?? [];
|
|
312
|
+
if (!varExisting.includes(childName)) {
|
|
313
|
+
varExisting.push(childName);
|
|
314
|
+
gatingPathToChildren.set(resolvedVarPath, varExisting);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
return gatingPathToChildren;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Calculate priority and childComponentsControlled for a flow.
|
|
325
|
+
*
|
|
326
|
+
* Priority factors (in order of importance):
|
|
327
|
+
* 1. Controls rendering of child components (more components = higher priority)
|
|
328
|
+
* 2. Controls JSX rendering (impact = 'high')
|
|
329
|
+
* 3. Number of conditions required
|
|
330
|
+
*/
|
|
331
|
+
function calculateFlowPriority(
|
|
332
|
+
flow: ExecutionFlow,
|
|
333
|
+
gatingPathToChildren: Map<string, string[]>,
|
|
334
|
+
): void {
|
|
335
|
+
// Find which child components this flow controls
|
|
336
|
+
const childComponentsControlled = new Set<string>();
|
|
337
|
+
|
|
338
|
+
for (const rv of flow.requiredValues) {
|
|
339
|
+
// Check if this required value's path gates any child components
|
|
340
|
+
const children = gatingPathToChildren.get(rv.attributePath);
|
|
341
|
+
if (children) {
|
|
342
|
+
// Only count truthy values as "enabling" the child component
|
|
343
|
+
// Falsy values would hide the child, not enable it
|
|
344
|
+
if (rv.comparison === 'truthy' || rv.comparison === 'equals') {
|
|
345
|
+
for (const child of children) {
|
|
346
|
+
childComponentsControlled.add(child);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
// Also check without function call markers for broader matching
|
|
352
|
+
const simplifiedPath = rv.attributePath
|
|
353
|
+
.replace(/\(\)/g, '')
|
|
354
|
+
.replace(/\.functionCallReturnValue/g, '');
|
|
355
|
+
const childrenSimplified = gatingPathToChildren.get(simplifiedPath);
|
|
356
|
+
if (childrenSimplified) {
|
|
357
|
+
if (rv.comparison === 'truthy' || rv.comparison === 'equals') {
|
|
358
|
+
for (const child of childrenSimplified) {
|
|
359
|
+
childComponentsControlled.add(child);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// Set childComponentsControlled if any were found
|
|
366
|
+
if (childComponentsControlled.size > 0) {
|
|
367
|
+
flow.childComponentsControlled = Array.from(childComponentsControlled);
|
|
368
|
+
|
|
369
|
+
// Upgrade impact to 'high' if this flow controls child components
|
|
370
|
+
// A flow that controls which child components render DOES impact JSX rendering,
|
|
371
|
+
// even if the condition itself isn't directly in the JSX tree.
|
|
372
|
+
// This ensures flows like viewMode === 'screenshot' (which controls SafeScreenshot
|
|
373
|
+
// rendering via ScenarioViewer) get proper prioritization.
|
|
374
|
+
if (flow.impact !== 'high') {
|
|
375
|
+
flow.impact = 'high';
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
// Calculate priority score
|
|
380
|
+
let priority = 0;
|
|
381
|
+
|
|
382
|
+
// Base priority by impact level
|
|
383
|
+
if (flow.impact === 'high') {
|
|
384
|
+
priority += 100;
|
|
385
|
+
} else if (flow.impact === 'medium') {
|
|
386
|
+
priority += 50;
|
|
387
|
+
} else {
|
|
388
|
+
priority += 25;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
// Add priority for each child component controlled
|
|
392
|
+
// Each child component adds significant priority
|
|
393
|
+
priority += (flow.childComponentsControlled?.length ?? 0) * 75;
|
|
394
|
+
|
|
395
|
+
// Add small bonus for number of required values (more specific = slightly higher priority)
|
|
396
|
+
priority += Math.min(flow.requiredValues.length * 5, 25);
|
|
397
|
+
|
|
398
|
+
flow.priority = priority;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Get execution flows suitable for LLM scenario generation.
|
|
403
|
+
*
|
|
404
|
+
* Filters and sorts flows based on priority, ensuring diversity
|
|
405
|
+
* across exclusive groups and respecting min/max thresholds.
|
|
406
|
+
*/
|
|
407
|
+
export function getFlowsForScenarioGeneration(
|
|
408
|
+
flows: ExecutionFlow[],
|
|
409
|
+
options: {
|
|
410
|
+
/** Maximum number of flows to return (default: 20) */
|
|
411
|
+
maxFlows?: number;
|
|
412
|
+
/** Minimum priority threshold (default: 0) */
|
|
413
|
+
minPriority?: number;
|
|
414
|
+
/** Ensure at least one flow per exclusive group (default: false) */
|
|
415
|
+
ensureGroupDiversity?: boolean;
|
|
416
|
+
/** Return both included and excluded flows (default: false) */
|
|
417
|
+
includeExcludedFlows?: boolean;
|
|
418
|
+
} = {},
|
|
419
|
+
):
|
|
420
|
+
| ExecutionFlow[]
|
|
421
|
+
| { includedFlows: ExecutionFlow[]; excludedFlows: ExecutionFlow[] } {
|
|
422
|
+
const {
|
|
423
|
+
maxFlows = 20,
|
|
424
|
+
minPriority = 0,
|
|
425
|
+
ensureGroupDiversity = false,
|
|
426
|
+
includeExcludedFlows = false,
|
|
427
|
+
} = options;
|
|
428
|
+
|
|
429
|
+
// Filter by minimum priority
|
|
430
|
+
let eligibleFlows = flows.filter((f) => (f.priority ?? 0) >= minPriority);
|
|
431
|
+
|
|
432
|
+
// Flows should already be sorted by priority, but ensure it
|
|
433
|
+
eligibleFlows = [...eligibleFlows].sort(
|
|
434
|
+
(a, b) => (b.priority ?? 0) - (a.priority ?? 0),
|
|
435
|
+
);
|
|
436
|
+
|
|
437
|
+
let includedFlows: ExecutionFlow[];
|
|
438
|
+
|
|
439
|
+
if (ensureGroupDiversity) {
|
|
440
|
+
// Ensure diversity across exclusive groups
|
|
441
|
+
includedFlows = selectFlowsWithGroupDiversity(eligibleFlows, maxFlows);
|
|
442
|
+
} else {
|
|
443
|
+
// Simple top-N selection
|
|
444
|
+
includedFlows = eligibleFlows.slice(0, maxFlows);
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
if (includeExcludedFlows) {
|
|
448
|
+
const includedIds = new Set(includedFlows.map((f) => f.id));
|
|
449
|
+
const excludedFlows = flows.filter((f) => !includedIds.has(f.id));
|
|
450
|
+
return { includedFlows, excludedFlows };
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
return includedFlows;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* Build a map of attribute-value pairs to help identify related flows.
|
|
458
|
+
* Flows with the same attributePath but different values are considered "value siblings".
|
|
459
|
+
* For example, viewMode='interactive' and viewMode='screenshot' are value siblings.
|
|
460
|
+
*/
|
|
461
|
+
function buildValueGroupMap(flows: ExecutionFlow[]): Map<string, string[]> {
|
|
462
|
+
// Map from attributePath to array of (flowId, value) pairs
|
|
463
|
+
const pathToValues = new Map<
|
|
464
|
+
string,
|
|
465
|
+
Array<{ flowId: string; value: string }>
|
|
466
|
+
>();
|
|
467
|
+
|
|
468
|
+
for (const flow of flows) {
|
|
469
|
+
for (const rv of flow.requiredValues) {
|
|
470
|
+
// Only consider equals comparisons with specific values (not truthy/falsy)
|
|
471
|
+
if (
|
|
472
|
+
rv.comparison === 'equals' &&
|
|
473
|
+
rv.value &&
|
|
474
|
+
rv.value !== 'truthy' &&
|
|
475
|
+
rv.value !== 'falsy'
|
|
476
|
+
) {
|
|
477
|
+
// Normalize the attributePath for comparison
|
|
478
|
+
const normalizedPath = rv.attributePath
|
|
479
|
+
.toLowerCase()
|
|
480
|
+
.replace(/[^a-z0-9]/g, '');
|
|
481
|
+
|
|
482
|
+
if (!pathToValues.has(normalizedPath)) {
|
|
483
|
+
pathToValues.set(normalizedPath, []);
|
|
484
|
+
}
|
|
485
|
+
pathToValues
|
|
486
|
+
.get(normalizedPath)!
|
|
487
|
+
.push({ flowId: flow.id, value: rv.value });
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
// Now create the value group map: flowId -> list of sibling flowIds
|
|
493
|
+
const valueGroupMap = new Map<string, string[]>();
|
|
494
|
+
|
|
495
|
+
for (const [, flowValues] of pathToValues) {
|
|
496
|
+
// Only create groups if there are multiple different values for the same path
|
|
497
|
+
const uniqueValues = new Set(flowValues.map((fv) => fv.value));
|
|
498
|
+
if (uniqueValues.size > 1) {
|
|
499
|
+
// This attribute has multiple values, so all flows are siblings
|
|
500
|
+
const siblingIds = flowValues.map((fv) => fv.flowId);
|
|
501
|
+
for (const fv of flowValues) {
|
|
502
|
+
valueGroupMap.set(
|
|
503
|
+
fv.flowId,
|
|
504
|
+
siblingIds.filter((id) => id !== fv.flowId),
|
|
505
|
+
);
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
return valueGroupMap;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* Select flows ensuring diversity across exclusive groups AND attribute values.
|
|
515
|
+
* Guarantees:
|
|
516
|
+
* 1. At least one flow per exclusive group
|
|
517
|
+
* 2. When a flow with a specific attribute value is selected, include sibling values too
|
|
518
|
+
*/
|
|
519
|
+
function selectFlowsWithGroupDiversity(
|
|
520
|
+
flows: ExecutionFlow[],
|
|
521
|
+
maxFlows: number,
|
|
522
|
+
): ExecutionFlow[] {
|
|
523
|
+
const selected: ExecutionFlow[] = [];
|
|
524
|
+
const selectedIds = new Set<string>();
|
|
525
|
+
const groupsRepresented = new Set<string>();
|
|
526
|
+
|
|
527
|
+
// Build value group map to identify sibling flows
|
|
528
|
+
const valueGroupMap = buildValueGroupMap(flows);
|
|
529
|
+
|
|
530
|
+
// First pass: ensure at least one flow per exclusive group
|
|
531
|
+
for (const flow of flows) {
|
|
532
|
+
if (selectedIds.has(flow.id)) continue;
|
|
533
|
+
if (selected.length >= maxFlows) break;
|
|
534
|
+
|
|
535
|
+
if (flow.exclusiveGroup && !groupsRepresented.has(flow.exclusiveGroup)) {
|
|
536
|
+
selected.push(flow);
|
|
537
|
+
selectedIds.add(flow.id);
|
|
538
|
+
groupsRepresented.add(flow.exclusiveGroup);
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
// Second pass: fill remaining slots with highest priority flows
|
|
543
|
+
// But also include sibling value flows when we select a flow with a specific value
|
|
544
|
+
for (const flow of flows) {
|
|
545
|
+
if (selectedIds.has(flow.id)) continue;
|
|
546
|
+
if (selected.length >= maxFlows) break;
|
|
547
|
+
|
|
548
|
+
selected.push(flow);
|
|
549
|
+
selectedIds.add(flow.id);
|
|
550
|
+
|
|
551
|
+
// Check if this flow has sibling value flows that should also be included
|
|
552
|
+
const siblingIds = valueGroupMap.get(flow.id);
|
|
553
|
+
if (siblingIds && siblingIds.length > 0) {
|
|
554
|
+
// Try to include sibling flows (different values of the same attribute)
|
|
555
|
+
for (const siblingId of siblingIds) {
|
|
556
|
+
if (selectedIds.has(siblingId)) continue;
|
|
557
|
+
if (selected.length >= maxFlows) break;
|
|
558
|
+
|
|
559
|
+
const siblingFlow = flows.find((f) => f.id === siblingId);
|
|
560
|
+
if (siblingFlow) {
|
|
561
|
+
selected.push(siblingFlow);
|
|
562
|
+
selectedIds.add(siblingId);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
// Re-sort by priority to maintain consistent ordering
|
|
569
|
+
return selected.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
|
|
570
|
+
}
|