@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,528 @@
|
|
|
1
|
+
import type { ConditionalEffect, ConditionalUsage } from './astScopes/types';
|
|
2
|
+
import type { ExecutionFlow } from '~codeyam/types';
|
|
3
|
+
import type { EnrichedConditionalUsage } from './worker/SerializableDataStructure';
|
|
4
|
+
import resolvePathToControllable from './resolvePathToControllable';
|
|
5
|
+
|
|
6
|
+
/** Extended conditional usage type that may include sourceDataPath from enrichment */
|
|
7
|
+
type ExtendedConditionalUsage = ConditionalUsage &
|
|
8
|
+
Partial<EnrichedConditionalUsage>;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Options for generating execution flows from conditional effects
|
|
12
|
+
*/
|
|
13
|
+
export interface GenerateExecutionFlowsOptions {
|
|
14
|
+
/** Map of state variable names to their display names (for better naming) */
|
|
15
|
+
stateVariableNames?: Record<string, string>;
|
|
16
|
+
/** Map of state variable names to whether they typically block other content */
|
|
17
|
+
blocksOtherFlowsMap?: Record<string, boolean>;
|
|
18
|
+
/** Map of controllable paths to their types (for path resolution) */
|
|
19
|
+
attributesMap?: Record<string, string>;
|
|
20
|
+
/** Map from local variable names to data sources */
|
|
21
|
+
equivalentSignatureVariables?: Record<string, string>;
|
|
22
|
+
/** Map from full paths to short paths */
|
|
23
|
+
fullToShortPathMap?: Record<string, string>;
|
|
24
|
+
/**
|
|
25
|
+
* Map of local variable paths to their enriched conditional usages.
|
|
26
|
+
* Used to look up sourceDataPath for conditions.
|
|
27
|
+
*/
|
|
28
|
+
conditionalUsages?: Record<string, ExtendedConditionalUsage[]>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Patterns that indicate a state variable controls modal/overlay/blocking content
|
|
33
|
+
*/
|
|
34
|
+
const BLOCKING_PATTERNS = [
|
|
35
|
+
/modal/i,
|
|
36
|
+
/overlay/i,
|
|
37
|
+
/dialog/i,
|
|
38
|
+
/popup/i,
|
|
39
|
+
/drawer/i,
|
|
40
|
+
/sheet/i,
|
|
41
|
+
/lightbox/i,
|
|
42
|
+
/backdrop/i,
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Check if a state variable name suggests it controls blocking content
|
|
47
|
+
*/
|
|
48
|
+
function isBlockingStateVariable(stateVariable: string): boolean {
|
|
49
|
+
return BLOCKING_PATTERNS.some((pattern) => pattern.test(stateVariable));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Generate a human-readable name from a state variable and value
|
|
54
|
+
*/
|
|
55
|
+
function generateFlowName(
|
|
56
|
+
stateVariable: string,
|
|
57
|
+
value: string,
|
|
58
|
+
valueType: string,
|
|
59
|
+
): string {
|
|
60
|
+
// Convert camelCase to Title Case with spaces
|
|
61
|
+
const humanReadable = stateVariable
|
|
62
|
+
.replace(/([A-Z])/g, ' $1')
|
|
63
|
+
.replace(/^./, (str) => str.toUpperCase())
|
|
64
|
+
.trim();
|
|
65
|
+
|
|
66
|
+
// For boolean state, describe the state
|
|
67
|
+
if (valueType === 'boolean') {
|
|
68
|
+
if (value === 'true') {
|
|
69
|
+
// Check for common patterns
|
|
70
|
+
if (/^show/i.test(stateVariable)) {
|
|
71
|
+
return humanReadable.replace(/^Show\s*/i, '') + ' Visible';
|
|
72
|
+
}
|
|
73
|
+
if (/^is/i.test(stateVariable)) {
|
|
74
|
+
return humanReadable.replace(/^Is\s*/i, '') + ' Active';
|
|
75
|
+
}
|
|
76
|
+
if (/open$/i.test(stateVariable)) {
|
|
77
|
+
return humanReadable;
|
|
78
|
+
}
|
|
79
|
+
return humanReadable + ' Enabled';
|
|
80
|
+
} else {
|
|
81
|
+
if (/^show/i.test(stateVariable)) {
|
|
82
|
+
return humanReadable.replace(/^Show\s*/i, '') + ' Hidden';
|
|
83
|
+
}
|
|
84
|
+
if (/^is/i.test(stateVariable)) {
|
|
85
|
+
return humanReadable.replace(/^Is\s*/i, '') + ' Inactive';
|
|
86
|
+
}
|
|
87
|
+
if (/open$/i.test(stateVariable)) {
|
|
88
|
+
return humanReadable.replace(/Open$/i, 'Closed');
|
|
89
|
+
}
|
|
90
|
+
return humanReadable + ' Disabled';
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// For string values, include the value in the name
|
|
95
|
+
if (valueType === 'string') {
|
|
96
|
+
const valueCapitalized =
|
|
97
|
+
value.charAt(0).toUpperCase() + value.slice(1).toLowerCase();
|
|
98
|
+
return `${humanReadable}: ${valueCapitalized}`;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return humanReadable;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Generate a flow ID from state variable and value
|
|
106
|
+
*/
|
|
107
|
+
function generateFlowId(stateVariable: string, value: string): string {
|
|
108
|
+
// Sanitize the value for use in an ID
|
|
109
|
+
const sanitizedValue = value
|
|
110
|
+
.toLowerCase()
|
|
111
|
+
.replace(/[^a-z0-9]/g, '-')
|
|
112
|
+
.replace(/-+/g, '-')
|
|
113
|
+
.replace(/^-|-$/g, '');
|
|
114
|
+
|
|
115
|
+
return `${stateVariable}-${sanitizedValue}`;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Generate a description for the flow
|
|
120
|
+
*/
|
|
121
|
+
function generateFlowDescription(
|
|
122
|
+
stateVariable: string,
|
|
123
|
+
value: string,
|
|
124
|
+
valueType: string,
|
|
125
|
+
conditions: Array<{ path: string; requiredValue: string | boolean }>,
|
|
126
|
+
): string {
|
|
127
|
+
const conditionDesc = conditions
|
|
128
|
+
.map((c) => {
|
|
129
|
+
if (typeof c.requiredValue === 'boolean') {
|
|
130
|
+
return c.requiredValue ? `${c.path} is truthy` : `${c.path} is falsy`;
|
|
131
|
+
}
|
|
132
|
+
return `${c.path} equals "${c.requiredValue}"`;
|
|
133
|
+
})
|
|
134
|
+
.join(' AND ');
|
|
135
|
+
|
|
136
|
+
if (valueType === 'boolean') {
|
|
137
|
+
const stateDesc = value === 'true' ? 'shown/enabled' : 'hidden/disabled';
|
|
138
|
+
return `${stateVariable} is ${stateDesc} when ${conditionDesc}`;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return `${stateVariable} is set to "${value}" when ${conditionDesc}`;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Convert a condition's requiredValue to comparison type
|
|
146
|
+
*/
|
|
147
|
+
function getComparisonType(
|
|
148
|
+
conditionType: 'truthiness' | 'comparison' | 'switch',
|
|
149
|
+
requiredValue: string | boolean,
|
|
150
|
+
): 'equals' | 'truthy' | 'falsy' {
|
|
151
|
+
if (conditionType === 'truthiness') {
|
|
152
|
+
return requiredValue === true ? 'truthy' : 'falsy';
|
|
153
|
+
}
|
|
154
|
+
return 'equals';
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Get the value string for the required value
|
|
159
|
+
*/
|
|
160
|
+
function getValueString(
|
|
161
|
+
conditionType: 'truthiness' | 'comparison' | 'switch',
|
|
162
|
+
requiredValue: string | boolean,
|
|
163
|
+
): string {
|
|
164
|
+
if (conditionType === 'truthiness') {
|
|
165
|
+
return requiredValue === true ? 'truthy' : 'falsy';
|
|
166
|
+
}
|
|
167
|
+
return String(requiredValue);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Determine impact level based on effect type
|
|
172
|
+
*/
|
|
173
|
+
function determineImpact(
|
|
174
|
+
valueType: string,
|
|
175
|
+
stateVariable: string,
|
|
176
|
+
): 'high' | 'medium' | 'low' {
|
|
177
|
+
// Boolean state changes typically have high impact (show/hide, enable/disable)
|
|
178
|
+
if (valueType === 'boolean') {
|
|
179
|
+
return 'high';
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Modal-related changes are high impact
|
|
183
|
+
if (isBlockingStateVariable(stateVariable)) {
|
|
184
|
+
return 'high';
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// String state changes are typically medium impact
|
|
188
|
+
if (valueType === 'string') {
|
|
189
|
+
return 'medium';
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// Default to medium
|
|
193
|
+
return 'medium';
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Clean up sourceDataPath by removing redundant scope prefixes.
|
|
198
|
+
*
|
|
199
|
+
* This function ONLY handles the specific pattern where a scope name is
|
|
200
|
+
* duplicated before the hook call:
|
|
201
|
+
*
|
|
202
|
+
* Example:
|
|
203
|
+
* "useLoaderData<LoaderData>.useLoaderData<LoaderData>().functionCallReturnValue.entity.sha"
|
|
204
|
+
* → "useLoaderData<LoaderData>().functionCallReturnValue.entity.sha"
|
|
205
|
+
*
|
|
206
|
+
* For paths with multiple function calls (like fetch().json()), or paths
|
|
207
|
+
* that don't match the expected pattern, returns null to indicate the
|
|
208
|
+
* fallback resolution should be used.
|
|
209
|
+
*/
|
|
210
|
+
function cleanSourceDataPath(sourceDataPath: string): string | null {
|
|
211
|
+
// Count function call patterns - both empty () and with content (...)
|
|
212
|
+
// We detect multiple function calls by counting:
|
|
213
|
+
// 1. Empty () patterns
|
|
214
|
+
// 2. Patterns like functionName(...) - closing paren followed by dot or end
|
|
215
|
+
const emptyFnCalls = (sourceDataPath.match(/\(\)/g) || []).length;
|
|
216
|
+
const fnCallReturnValues = (
|
|
217
|
+
sourceDataPath.match(/\.functionCallReturnValue/g) || []
|
|
218
|
+
).length;
|
|
219
|
+
|
|
220
|
+
// If there are multiple functionCallReturnValue occurrences, this is a chained call
|
|
221
|
+
// (e.g., fetch(...).functionCallReturnValue.json().functionCallReturnValue.data)
|
|
222
|
+
if (fnCallReturnValues > 1 || emptyFnCalls !== 1) {
|
|
223
|
+
// Multiple function calls - return null to use fallback resolution
|
|
224
|
+
return null;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// Find the "()" which marks the function call
|
|
228
|
+
const fnCallIndex = sourceDataPath.indexOf('()');
|
|
229
|
+
|
|
230
|
+
// Find where the function name starts (go back to find the start of this segment)
|
|
231
|
+
const beforeFnCall = sourceDataPath.slice(0, fnCallIndex);
|
|
232
|
+
const lastDotBeforeFn = beforeFnCall.lastIndexOf('.');
|
|
233
|
+
|
|
234
|
+
if (lastDotBeforeFn === -1) {
|
|
235
|
+
return sourceDataPath;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// Extract the scope prefix and the actual path
|
|
239
|
+
const scopePrefix = sourceDataPath.slice(0, lastDotBeforeFn);
|
|
240
|
+
const actualPath = sourceDataPath.slice(lastDotBeforeFn + 1);
|
|
241
|
+
|
|
242
|
+
// Verify this is actually a redundant scope prefix pattern
|
|
243
|
+
// The actualPath should start with something that matches the scopePrefix
|
|
244
|
+
// e.g., scopePrefix="useLoaderData<LoaderData>" and actualPath starts with "useLoaderData<LoaderData>()..."
|
|
245
|
+
if (!actualPath.startsWith(scopePrefix.split('.').pop() || '')) {
|
|
246
|
+
// Not a redundant prefix pattern - return the original path
|
|
247
|
+
return sourceDataPath;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
return actualPath;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Find a path in attributesMap, using fullToShortPathMap to verify the path is controllable.
|
|
255
|
+
*
|
|
256
|
+
* IMPORTANT: Returns the FULL path (preserving data source context) when possible.
|
|
257
|
+
* This ensures execution flows can be traced back to specific data sources,
|
|
258
|
+
* which is critical when multiple data sources have the same property names
|
|
259
|
+
* (e.g., multiple useFetcher hooks all having 'state' and 'data').
|
|
260
|
+
*
|
|
261
|
+
* The attributesMap contains short relative paths (e.g., "entity.sha")
|
|
262
|
+
* The sourceDataPath contains full paths (e.g., "useLoaderData<LoaderData>().functionCallReturnValue.entity.sha")
|
|
263
|
+
* The fullToShortPathMap maps full paths to short paths
|
|
264
|
+
*/
|
|
265
|
+
function findInAttributesMapForPath(
|
|
266
|
+
path: string,
|
|
267
|
+
attributesMap: Record<string, string>,
|
|
268
|
+
fullToShortPathMap: Record<string, string>,
|
|
269
|
+
): string | null {
|
|
270
|
+
// Direct match in attributesMap (already a short path)
|
|
271
|
+
if (path in attributesMap) {
|
|
272
|
+
return path;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// Try looking up the path in fullToShortPathMap to verify it's controllable
|
|
276
|
+
// IMPORTANT: Return the FULL path, not the short path, to preserve data source context
|
|
277
|
+
if (path in fullToShortPathMap) {
|
|
278
|
+
const shortPath = fullToShortPathMap[path];
|
|
279
|
+
if (shortPath in attributesMap) {
|
|
280
|
+
return path; // Return FULL path to preserve data source context
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// Normalized match (array indices [N] → [])
|
|
285
|
+
const normalizedPath = path.replace(/\[\d+\]/g, '[]');
|
|
286
|
+
if (normalizedPath !== path) {
|
|
287
|
+
if (normalizedPath in attributesMap) {
|
|
288
|
+
return normalizedPath;
|
|
289
|
+
}
|
|
290
|
+
if (normalizedPath in fullToShortPathMap) {
|
|
291
|
+
const shortPath = fullToShortPathMap[normalizedPath];
|
|
292
|
+
if (shortPath in attributesMap) {
|
|
293
|
+
return normalizedPath; // Return normalized FULL path
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// Try prefix matching for child paths
|
|
299
|
+
for (const attrPath of Object.keys(attributesMap)) {
|
|
300
|
+
if (path.startsWith(attrPath + '.') || path.startsWith(attrPath + '[')) {
|
|
301
|
+
return path;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// Try suffix matching: if the path ends with ".X.Y.Z" and attributesMap has "X.Y.Z"
|
|
306
|
+
// Return the FULL input path to preserve data source context
|
|
307
|
+
for (const attrPath of Object.keys(attributesMap)) {
|
|
308
|
+
if (
|
|
309
|
+
path.endsWith('.' + attrPath) ||
|
|
310
|
+
path.endsWith('.' + attrPath.replace(/\[\d+\]/g, '[]'))
|
|
311
|
+
) {
|
|
312
|
+
return path; // Return FULL path, not short attrPath
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
return null;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Resolve a condition path to a controllable data source path.
|
|
321
|
+
*
|
|
322
|
+
* Resolution strategy:
|
|
323
|
+
* 1. Look up sourceDataPath in conditionalUsages (pre-computed during AST analysis)
|
|
324
|
+
* 2. Fall back to resolvePathToControllable (variable resolution)
|
|
325
|
+
*
|
|
326
|
+
* @returns The resolved controllable path, or null if not controllable
|
|
327
|
+
*/
|
|
328
|
+
function resolveConditionPath(
|
|
329
|
+
localPath: string,
|
|
330
|
+
options?: GenerateExecutionFlowsOptions,
|
|
331
|
+
): string | null {
|
|
332
|
+
if (!options) {
|
|
333
|
+
return null;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
const {
|
|
337
|
+
attributesMap = {},
|
|
338
|
+
equivalentSignatureVariables = {},
|
|
339
|
+
fullToShortPathMap = {},
|
|
340
|
+
conditionalUsages = {},
|
|
341
|
+
} = options;
|
|
342
|
+
|
|
343
|
+
// 1. Try to use pre-computed sourceDataPath from conditionalUsages
|
|
344
|
+
const usagesForPath = conditionalUsages[localPath];
|
|
345
|
+
if (usagesForPath && usagesForPath.length > 0) {
|
|
346
|
+
const usage = usagesForPath[0];
|
|
347
|
+
if (usage.sourceDataPath) {
|
|
348
|
+
// Clean up the sourceDataPath - it may have redundant scope prefixes
|
|
349
|
+
// Returns null for paths that don't match the expected pattern (e.g., multiple function calls)
|
|
350
|
+
const cleanedPath = cleanSourceDataPath(usage.sourceDataPath);
|
|
351
|
+
|
|
352
|
+
if (cleanedPath) {
|
|
353
|
+
// Verify the cleaned path exists in attributesMap (using fullToShortPathMap for resolution)
|
|
354
|
+
const pathMatch = findInAttributesMapForPath(
|
|
355
|
+
cleanedPath,
|
|
356
|
+
attributesMap,
|
|
357
|
+
fullToShortPathMap,
|
|
358
|
+
);
|
|
359
|
+
if (pathMatch) {
|
|
360
|
+
return pathMatch;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
// If cleanedPath is null or pathMatch not found, fall through to resolvePathToControllable
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
// 2. Fall back to resolution via equivalentSignatureVariables
|
|
368
|
+
const resolution = resolvePathToControllable(
|
|
369
|
+
localPath,
|
|
370
|
+
attributesMap,
|
|
371
|
+
equivalentSignatureVariables,
|
|
372
|
+
fullToShortPathMap,
|
|
373
|
+
);
|
|
374
|
+
|
|
375
|
+
if (resolution.isControllable && resolution.resolvedPath) {
|
|
376
|
+
return resolution.resolvedPath;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
return null;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Converts conditional effects from static analysis into ExecutionFlow objects.
|
|
384
|
+
*
|
|
385
|
+
* This allows automatic generation of execution flows based on what the code
|
|
386
|
+
* actually does, rather than relying on LLM interpretation which may incorrectly
|
|
387
|
+
* use useState variable names instead of data source conditions.
|
|
388
|
+
*
|
|
389
|
+
* IMPORTANT: Only generates flows where ALL condition paths resolve to controllable
|
|
390
|
+
* data sources. Flows with unresolvable paths (e.g., internal useState variables)
|
|
391
|
+
* are excluded to prevent invalid mock data.
|
|
392
|
+
*
|
|
393
|
+
* @param conditionalEffects - Array of conditional effects from static analysis
|
|
394
|
+
* @param options - Optional configuration for flow generation
|
|
395
|
+
* @returns Array of ExecutionFlow objects
|
|
396
|
+
*/
|
|
397
|
+
export default function generateExecutionFlowsFromConditionalEffects(
|
|
398
|
+
conditionalEffects: ConditionalEffect[],
|
|
399
|
+
options?: GenerateExecutionFlowsOptions,
|
|
400
|
+
): ExecutionFlow[] {
|
|
401
|
+
// Use a map to deduplicate flows by ID, keeping the one with MORE conditions
|
|
402
|
+
// This handles the case where both `condition` (singular) and `conditions` (plural)
|
|
403
|
+
// entries exist for the same setter - we want the more complete one
|
|
404
|
+
const flowMap = new Map<string, ExecutionFlow>();
|
|
405
|
+
|
|
406
|
+
for (const effect of conditionalEffects) {
|
|
407
|
+
// Get conditions (handle both single condition and multiple conditions)
|
|
408
|
+
const conditions: Array<{
|
|
409
|
+
path: string;
|
|
410
|
+
conditionType: 'truthiness' | 'comparison' | 'switch';
|
|
411
|
+
comparedValues?: string[];
|
|
412
|
+
requiredValue: string | boolean;
|
|
413
|
+
}> = [];
|
|
414
|
+
|
|
415
|
+
if (effect.condition) {
|
|
416
|
+
conditions.push(effect.condition);
|
|
417
|
+
} else if (effect.conditions) {
|
|
418
|
+
conditions.push(...effect.conditions);
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
if (conditions.length === 0) {
|
|
422
|
+
continue;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
// Resolve all condition paths to controllable data sources
|
|
426
|
+
// If ANY path cannot be resolved, skip this entire flow
|
|
427
|
+
const resolvedConditions: Array<{
|
|
428
|
+
originalPath: string;
|
|
429
|
+
resolvedPath: string;
|
|
430
|
+
conditionType: 'truthiness' | 'comparison' | 'switch';
|
|
431
|
+
requiredValue: string | boolean;
|
|
432
|
+
}> = [];
|
|
433
|
+
|
|
434
|
+
let allPathsControllable = true;
|
|
435
|
+
for (const c of conditions) {
|
|
436
|
+
const resolvedPath = resolveConditionPath(c.path, options);
|
|
437
|
+
if (!resolvedPath) {
|
|
438
|
+
// Path is not controllable - skip this entire flow
|
|
439
|
+
allPathsControllable = false;
|
|
440
|
+
break;
|
|
441
|
+
}
|
|
442
|
+
resolvedConditions.push({
|
|
443
|
+
originalPath: c.path,
|
|
444
|
+
resolvedPath,
|
|
445
|
+
conditionType: c.conditionType,
|
|
446
|
+
requiredValue: c.requiredValue,
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
if (!allPathsControllable) {
|
|
451
|
+
// Skip flows where any condition path cannot be resolved
|
|
452
|
+
continue;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
const { stateVariable, value, valueType } = effect.effect;
|
|
456
|
+
|
|
457
|
+
// Check if this is a blocking state variable
|
|
458
|
+
const isBlocking =
|
|
459
|
+
options?.blocksOtherFlowsMap?.[stateVariable] ??
|
|
460
|
+
(isBlockingStateVariable(stateVariable) && value === 'true');
|
|
461
|
+
|
|
462
|
+
// Generate required values from resolved conditions
|
|
463
|
+
const requiredValues: ExecutionFlow['requiredValues'] =
|
|
464
|
+
resolvedConditions.map((c) => ({
|
|
465
|
+
attributePath: c.resolvedPath,
|
|
466
|
+
value: getValueString(c.conditionType, c.requiredValue),
|
|
467
|
+
comparison: getComparisonType(c.conditionType, c.requiredValue),
|
|
468
|
+
valueType: inferValueType(c.conditionType, c.requiredValue),
|
|
469
|
+
}));
|
|
470
|
+
|
|
471
|
+
// Create the execution flow (use resolved paths in description too)
|
|
472
|
+
const flowId = generateFlowId(stateVariable, value);
|
|
473
|
+
const flow: ExecutionFlow = {
|
|
474
|
+
id: flowId,
|
|
475
|
+
name: generateFlowName(stateVariable, value, valueType),
|
|
476
|
+
description: generateFlowDescription(
|
|
477
|
+
stateVariable,
|
|
478
|
+
value,
|
|
479
|
+
valueType,
|
|
480
|
+
resolvedConditions.map((c) => ({
|
|
481
|
+
path: c.resolvedPath,
|
|
482
|
+
requiredValue: c.requiredValue,
|
|
483
|
+
})),
|
|
484
|
+
),
|
|
485
|
+
requiredValues,
|
|
486
|
+
impact: determineImpact(valueType, stateVariable),
|
|
487
|
+
blocksOtherFlows: isBlocking || undefined,
|
|
488
|
+
sourceLocation: effect.sourceLocation
|
|
489
|
+
? {
|
|
490
|
+
lineNumber: effect.sourceLocation.lineNumber,
|
|
491
|
+
column: effect.sourceLocation.column,
|
|
492
|
+
}
|
|
493
|
+
: undefined,
|
|
494
|
+
codeSnippet: effect.sourceLocation?.codeSnippet,
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
// Only add/replace if this flow has MORE conditions than existing one
|
|
498
|
+
// This ensures we keep the most complete condition chain
|
|
499
|
+
const existingFlow = flowMap.get(flowId);
|
|
500
|
+
if (
|
|
501
|
+
!existingFlow ||
|
|
502
|
+
requiredValues.length > existingFlow.requiredValues.length
|
|
503
|
+
) {
|
|
504
|
+
flowMap.set(flowId, flow);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
return Array.from(flowMap.values());
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* Infer the value type for a condition
|
|
513
|
+
*/
|
|
514
|
+
function inferValueType(
|
|
515
|
+
conditionType: 'truthiness' | 'comparison' | 'switch',
|
|
516
|
+
requiredValue: string | boolean,
|
|
517
|
+
): ExecutionFlow['requiredValues'][0]['valueType'] {
|
|
518
|
+
if (typeof requiredValue === 'boolean') {
|
|
519
|
+
return 'boolean';
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
// For string values, check if it looks like a number
|
|
523
|
+
if (!isNaN(Number(requiredValue))) {
|
|
524
|
+
return 'number';
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
return 'string';
|
|
528
|
+
}
|