@codeyam/codeyam-cli 0.1.0-staging.596f0eb → 0.1.0-staging.6e699e5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/analyzer-template/.build-info.json +8 -8
- package/analyzer-template/common/execAsync.ts +1 -1
- package/analyzer-template/log.txt +3 -3
- package/analyzer-template/package.json +10 -6
- package/analyzer-template/packages/ai/index.ts +10 -3
- package/analyzer-template/packages/ai/package.json +1 -1
- package/analyzer-template/packages/ai/src/lib/__mocks__/completionCall.ts +122 -0
- package/analyzer-template/packages/ai/src/lib/analyzeScope.ts +128 -6
- package/analyzer-template/packages/ai/src/lib/astScopes/arrayDerivationDetector.ts +199 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/astScopeAnalyzer.ts +138 -1
- package/analyzer-template/packages/ai/src/lib/astScopes/conditionalEffectsExtractor.ts +644 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/methodSemantics.ts +140 -6
- package/analyzer-template/packages/ai/src/lib/astScopes/patterns/ifStatementHandler.ts +18 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/patterns/switchStatementHandler.ts +38 -1
- package/analyzer-template/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.ts +181 -1
- package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +1239 -104
- package/analyzer-template/packages/ai/src/lib/astScopes/types.ts +304 -0
- package/analyzer-template/packages/ai/src/lib/checkAllAttributes.ts +29 -10
- package/analyzer-template/packages/ai/src/lib/completionCall.ts +216 -36
- package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +1501 -138
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.ts +2 -1
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.ts +976 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.ts +243 -77
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.ts +19 -1
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.ts +103 -6
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.ts +23 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertNullToUndefinedBySchema.ts +98 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.ts +42 -2
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fixNullIdsBySchema.ts +129 -0
- package/analyzer-template/packages/ai/src/lib/dataStructureChunking.ts +156 -0
- package/analyzer-template/packages/ai/src/lib/deepEqual.ts +30 -0
- package/analyzer-template/packages/ai/src/lib/e2eDataTracking.ts +334 -0
- package/analyzer-template/packages/ai/src/lib/extractCriticalDataKeys.ts +120 -0
- package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarioData.ts +74 -7
- package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarios.ts +89 -112
- package/analyzer-template/packages/ai/src/lib/generateEntityDataStructure.ts +6 -0
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +1111 -91
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarios.ts +207 -104
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +570 -0
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.ts +528 -0
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionals.ts +1977 -0
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.ts +239 -0
- package/analyzer-template/packages/ai/src/lib/getConditionalUsagesFromCode.ts +143 -31
- package/analyzer-template/packages/ai/src/lib/guessScenarioDataFromDescription.ts +8 -2
- package/analyzer-template/packages/ai/src/lib/isolateScopes.ts +276 -3
- package/analyzer-template/packages/ai/src/lib/mergeStatements.ts +33 -3
- package/analyzer-template/packages/ai/src/lib/promptGenerators/gatherAttributesMap.ts +7 -0
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.ts +1 -1
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.ts +32 -102
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChunkPrompt.ts +82 -0
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateCriticalKeysPrompt.ts +103 -0
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.ts +90 -6
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.ts +14 -53
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateMissingKeysPrompt.ts +58 -0
- package/analyzer-template/packages/ai/src/lib/promptGenerators/guessNewScenarioDataFromDescriptionGenerator.ts +28 -2
- package/analyzer-template/packages/ai/src/lib/promptGenerators/simplifyKeysForLLM.ts +391 -0
- package/analyzer-template/packages/ai/src/lib/resolvePathToControllable.ts +812 -0
- package/analyzer-template/packages/ai/src/lib/splitOutsideParentheses.ts +5 -1
- package/analyzer-template/packages/ai/src/lib/validateExecutionFlowPaths.ts +531 -0
- package/analyzer-template/packages/ai/src/lib/worker/SerializableDataStructure.ts +123 -0
- package/analyzer-template/packages/ai/src/lib/worker/analyzeScopeWorker.ts +8 -1
- package/analyzer-template/packages/analyze/src/lib/FileAnalyzer.ts +14 -0
- package/analyzer-template/packages/analyze/src/lib/analysisContext.ts +44 -4
- package/analyzer-template/packages/analyze/src/lib/asts/nodes/index.ts +1 -0
- package/analyzer-template/packages/analyze/src/lib/asts/nodes/isAsyncFunction.ts +67 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +455 -267
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +18 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyze/findOrCreateEntity.ts +3 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.ts +33 -7
- package/analyzer-template/packages/analyze/src/lib/files/analyzeChange.ts +31 -15
- package/analyzer-template/packages/analyze/src/lib/files/analyzeEntity.ts +11 -7
- package/analyzer-template/packages/analyze/src/lib/files/analyzeInitial.ts +11 -12
- package/analyzer-template/packages/analyze/src/lib/files/enums/steps.ts +1 -1
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.ts +265 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichUnknownTypesFromSourceEquivalencies.ts +102 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.ts +588 -52
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateChangesScenarioData.ts +1 -1
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.ts +28 -62
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +336 -133
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.ts +156 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarioData.ts +78 -83
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarios.ts +4 -8
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +461 -94
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.ts +56 -11
- package/analyzer-template/packages/aws/codebuild/index.ts +1 -0
- package/analyzer-template/packages/aws/dist/src/lib/codebuild/waitForBuild.d.ts +11 -1
- package/analyzer-template/packages/aws/dist/src/lib/codebuild/waitForBuild.d.ts.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/codebuild/waitForBuild.js +29 -18
- package/analyzer-template/packages/aws/dist/src/lib/codebuild/waitForBuild.js.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsDefineContainer.d.ts +2 -2
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsDefineContainer.d.ts.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsDefineContainer.js +2 -2
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsDefineContainer.js.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsTaskFactory.d.ts +8 -18
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsTaskFactory.d.ts.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsTaskFactory.js +17 -61
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsTaskFactory.js.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/s3/checkS3ObjectExists.d.ts +15 -0
- package/analyzer-template/packages/aws/dist/src/lib/s3/checkS3ObjectExists.d.ts.map +1 -0
- package/analyzer-template/packages/aws/dist/src/lib/s3/checkS3ObjectExists.js +31 -0
- package/analyzer-template/packages/aws/dist/src/lib/s3/checkS3ObjectExists.js.map +1 -0
- package/analyzer-template/packages/aws/dist/src/lib/s3/uploadFileToS3.d.ts.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/s3/uploadFileToS3.js +8 -1
- package/analyzer-template/packages/aws/dist/src/lib/s3/uploadFileToS3.js.map +1 -1
- package/analyzer-template/packages/aws/package.json +3 -3
- package/analyzer-template/packages/aws/s3/index.ts +1 -0
- package/analyzer-template/packages/aws/src/lib/codebuild/waitForBuild.ts +43 -19
- package/analyzer-template/packages/aws/src/lib/ecs/ecsDefineContainer.ts +3 -3
- package/analyzer-template/packages/aws/src/lib/ecs/ecsTaskFactory.ts +17 -69
- package/analyzer-template/packages/aws/src/lib/s3/checkS3ObjectExists.ts +47 -0
- package/analyzer-template/packages/aws/src/lib/s3/uploadFileToS3.ts +8 -1
- package/analyzer-template/packages/database/src/lib/kysely/db.ts +4 -4
- package/analyzer-template/packages/database/src/lib/kysely/tableRelations.ts +2 -2
- package/analyzer-template/packages/database/src/lib/kysely/tables/debugReportsTable.ts +36 -9
- package/analyzer-template/packages/database/src/lib/loadReadyToBeCapturedAnalyses.ts +7 -3
- package/analyzer-template/packages/generate/index.ts +3 -0
- package/analyzer-template/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.ts +17 -1
- package/analyzer-template/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.ts +193 -0
- package/analyzer-template/packages/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.ts +73 -0
- package/analyzer-template/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.ts +9 -4
- package/analyzer-template/packages/generate/src/lib/deepMerge.ts +26 -1
- package/analyzer-template/packages/generate/src/lib/scenarioComponentForServer.ts +114 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts +2 -2
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js +2 -2
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tableRelations.d.ts +2 -2
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/analysesTable.d.ts +1 -11
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/analysesTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.d.ts +30 -7
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.js +9 -3
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/entitiesTable.d.ts +1 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/entitiesTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts +2 -6
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js +7 -4
- package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js.map +1 -1
- package/analyzer-template/packages/github/dist/generate/index.d.ts +3 -0
- package/analyzer-template/packages/github/dist/generate/index.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/index.js +3 -0
- package/analyzer-template/packages/github/dist/generate/index.js.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js +16 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.d.ts +9 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.d.ts.map +1 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +189 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.d.ts +20 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.d.ts.map +1 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.js +53 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.js.map +1 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +8 -4
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/deepMerge.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/deepMerge.js +27 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/deepMerge.js.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponentForServer.d.ts +8 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponentForServer.d.ts.map +1 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponentForServer.js +89 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponentForServer.js.map +1 -0
- package/analyzer-template/packages/github/dist/github/src/lib/loadOrCreateCommit.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/github/src/lib/loadOrCreateCommit.js +10 -0
- package/analyzer-template/packages/github/dist/github/src/lib/loadOrCreateCommit.js.map +1 -1
- package/analyzer-template/packages/github/dist/github/src/lib/syncPrimaryBranch.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/github/src/lib/syncPrimaryBranch.js +3 -0
- package/analyzer-template/packages/github/dist/github/src/lib/syncPrimaryBranch.js.map +1 -1
- package/analyzer-template/packages/github/dist/types/index.d.ts +2 -2
- package/analyzer-template/packages/github/dist/types/index.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/index.js.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/Analysis.d.ts +87 -13
- package/analyzer-template/packages/github/dist/types/src/types/Analysis.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/Entity.d.ts +2 -0
- package/analyzer-template/packages/github/dist/types/src/types/Entity.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts +11 -6
- package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts +196 -0
- package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/StatementInfo.d.ts +2 -0
- package/analyzer-template/packages/github/dist/types/src/types/StatementInfo.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/lightweightEntityExtractor.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/lightweightEntityExtractor.js +25 -0
- package/analyzer-template/packages/github/dist/utils/src/lib/lightweightEntityExtractor.js.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.d.ts +9 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.js +29 -3
- package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.js.map +1 -1
- package/analyzer-template/packages/github/src/lib/loadOrCreateCommit.ts +14 -0
- package/analyzer-template/packages/github/src/lib/syncPrimaryBranch.ts +2 -0
- package/analyzer-template/packages/process/index.ts +2 -0
- package/analyzer-template/packages/process/package.json +12 -0
- package/analyzer-template/packages/process/tsconfig.json +8 -0
- package/analyzer-template/packages/types/index.ts +5 -0
- package/analyzer-template/packages/types/src/types/Analysis.ts +104 -13
- package/analyzer-template/packages/types/src/types/Entity.ts +2 -0
- package/analyzer-template/packages/types/src/types/Scenario.ts +11 -10
- package/analyzer-template/packages/types/src/types/ScenariosDataStructure.ts +224 -0
- package/analyzer-template/packages/types/src/types/StatementInfo.ts +2 -0
- package/analyzer-template/packages/ui-components/src/components/ScenarioDetailInteractiveView.tsx +23 -7
- package/analyzer-template/packages/utils/dist/types/index.d.ts +2 -2
- package/analyzer-template/packages/utils/dist/types/index.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/index.js.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/Analysis.d.ts +87 -13
- package/analyzer-template/packages/utils/dist/types/src/types/Analysis.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/Entity.d.ts +2 -0
- package/analyzer-template/packages/utils/dist/types/src/types/Entity.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts +11 -6
- package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts +196 -0
- package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/StatementInfo.d.ts +2 -0
- package/analyzer-template/packages/utils/dist/types/src/types/StatementInfo.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/lightweightEntityExtractor.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/lightweightEntityExtractor.js +25 -0
- package/analyzer-template/packages/utils/dist/utils/src/lib/lightweightEntityExtractor.js.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/safeFileName.d.ts +9 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/safeFileName.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/safeFileName.js +29 -3
- package/analyzer-template/packages/utils/dist/utils/src/lib/safeFileName.js.map +1 -1
- package/analyzer-template/packages/utils/src/lib/lightweightEntityExtractor.ts +27 -0
- package/analyzer-template/packages/utils/src/lib/safeFileName.ts +48 -3
- package/analyzer-template/playwright/capture.ts +37 -18
- package/analyzer-template/playwright/getCodeYamInfo.ts +12 -7
- package/analyzer-template/playwright/takeElementScreenshot.ts +26 -11
- package/analyzer-template/playwright/takeScreenshot.ts +9 -7
- package/analyzer-template/playwright/waitForServer.ts +21 -6
- package/analyzer-template/project/analyzeBaselineCommit.ts +4 -0
- package/analyzer-template/project/analyzeBranchCommit.ts +4 -0
- package/analyzer-template/project/analyzeFileEntities.ts +4 -0
- package/analyzer-template/project/analyzeRegularCommit.ts +4 -0
- package/analyzer-template/project/constructMockCode.ts +1181 -160
- package/analyzer-template/project/controller/startController.ts +16 -1
- package/analyzer-template/project/executeLibraryFunctionDirect.ts +7 -3
- package/analyzer-template/project/mocks/analyzeFileMock.ts +8 -7
- package/analyzer-template/project/orchestrateCapture/KyselyAnalysisLoader.ts +3 -6
- package/analyzer-template/project/orchestrateCapture/SequentialCaptureTaskRunner.ts +82 -36
- package/analyzer-template/project/orchestrateCapture.ts +36 -3
- package/analyzer-template/project/reconcileMockDataKeys.ts +245 -2
- package/analyzer-template/project/runAnalysis.ts +11 -0
- package/analyzer-template/project/runMultiScenarioServer.ts +11 -10
- package/analyzer-template/project/serverOnlyModules.ts +194 -21
- package/analyzer-template/project/start.ts +26 -4
- package/analyzer-template/project/startScenarioCapture.ts +79 -41
- package/analyzer-template/project/writeMockDataTsx.ts +232 -57
- package/analyzer-template/project/writeScenarioClientWrapper.ts +21 -0
- package/analyzer-template/project/writeScenarioComponents.ts +769 -181
- package/analyzer-template/project/writeScenarioFiles.ts +26 -0
- package/analyzer-template/project/writeSimpleRoot.ts +13 -15
- package/analyzer-template/scripts/comboWorkerLoop.cjs +1 -0
- package/analyzer-template/scripts/defaultCmd.sh +9 -0
- package/analyzer-template/tsconfig.json +2 -1
- package/background/src/lib/local/createLocalAnalyzer.js +1 -29
- package/background/src/lib/local/createLocalAnalyzer.js.map +1 -1
- package/background/src/lib/local/execAsync.js +1 -1
- package/background/src/lib/local/execAsync.js.map +1 -1
- package/background/src/lib/virtualized/common/execAsync.js +1 -1
- package/background/src/lib/virtualized/common/execAsync.js.map +1 -1
- package/background/src/lib/virtualized/project/analyzeBaselineCommit.js +2 -1
- package/background/src/lib/virtualized/project/analyzeBaselineCommit.js.map +1 -1
- package/background/src/lib/virtualized/project/analyzeBranchCommit.js +2 -1
- package/background/src/lib/virtualized/project/analyzeBranchCommit.js.map +1 -1
- package/background/src/lib/virtualized/project/analyzeFileEntities.js +2 -1
- package/background/src/lib/virtualized/project/analyzeFileEntities.js.map +1 -1
- package/background/src/lib/virtualized/project/analyzeRegularCommit.js +2 -1
- package/background/src/lib/virtualized/project/analyzeRegularCommit.js.map +1 -1
- package/background/src/lib/virtualized/project/constructMockCode.js +1053 -124
- package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
- package/background/src/lib/virtualized/project/controller/startController.js +11 -1
- package/background/src/lib/virtualized/project/controller/startController.js.map +1 -1
- package/background/src/lib/virtualized/project/executeLibraryFunctionDirect.js +6 -3
- package/background/src/lib/virtualized/project/executeLibraryFunctionDirect.js.map +1 -1
- package/background/src/lib/virtualized/project/mocks/analyzeFileMock.js +7 -7
- package/background/src/lib/virtualized/project/mocks/analyzeFileMock.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture/KyselyAnalysisLoader.js +3 -2
- package/background/src/lib/virtualized/project/orchestrateCapture/KyselyAnalysisLoader.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture/SequentialCaptureTaskRunner.js +69 -32
- package/background/src/lib/virtualized/project/orchestrateCapture/SequentialCaptureTaskRunner.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture.js +27 -4
- package/background/src/lib/virtualized/project/orchestrateCapture.js.map +1 -1
- package/background/src/lib/virtualized/project/reconcileMockDataKeys.js +204 -2
- package/background/src/lib/virtualized/project/reconcileMockDataKeys.js.map +1 -1
- package/background/src/lib/virtualized/project/runAnalysis.js +9 -0
- package/background/src/lib/virtualized/project/runAnalysis.js.map +1 -1
- package/background/src/lib/virtualized/project/runMultiScenarioServer.js +11 -9
- package/background/src/lib/virtualized/project/runMultiScenarioServer.js.map +1 -1
- package/background/src/lib/virtualized/project/serverOnlyModules.js +163 -23
- package/background/src/lib/virtualized/project/serverOnlyModules.js.map +1 -1
- package/background/src/lib/virtualized/project/start.js +21 -4
- package/background/src/lib/virtualized/project/start.js.map +1 -1
- package/background/src/lib/virtualized/project/startScenarioCapture.js +61 -31
- package/background/src/lib/virtualized/project/startScenarioCapture.js.map +1 -1
- package/background/src/lib/virtualized/project/writeMockDataTsx.js +199 -50
- package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
- package/background/src/lib/virtualized/project/writeScenarioClientWrapper.js +15 -0
- package/background/src/lib/virtualized/project/writeScenarioClientWrapper.js.map +1 -0
- package/background/src/lib/virtualized/project/writeScenarioComponents.js +552 -125
- package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
- package/background/src/lib/virtualized/project/writeScenarioFiles.js +19 -0
- package/background/src/lib/virtualized/project/writeScenarioFiles.js.map +1 -1
- package/background/src/lib/virtualized/project/writeSimpleRoot.js +13 -13
- package/background/src/lib/virtualized/project/writeSimpleRoot.js.map +1 -1
- package/codeyam-cli/src/cli.js +7 -1
- package/codeyam-cli/src/cli.js.map +1 -1
- package/codeyam-cli/src/commands/analyze.js +1 -1
- package/codeyam-cli/src/commands/analyze.js.map +1 -1
- package/codeyam-cli/src/commands/baseline.js +174 -0
- package/codeyam-cli/src/commands/baseline.js.map +1 -0
- package/codeyam-cli/src/commands/debug.js +40 -18
- package/codeyam-cli/src/commands/debug.js.map +1 -1
- package/codeyam-cli/src/commands/default.js +0 -15
- package/codeyam-cli/src/commands/default.js.map +1 -1
- package/codeyam-cli/src/commands/recapture.js +226 -0
- package/codeyam-cli/src/commands/recapture.js.map +1 -0
- package/codeyam-cli/src/commands/report.js +72 -24
- package/codeyam-cli/src/commands/report.js.map +1 -1
- package/codeyam-cli/src/commands/start.js +8 -12
- package/codeyam-cli/src/commands/start.js.map +1 -1
- package/codeyam-cli/src/commands/status.js +23 -1
- package/codeyam-cli/src/commands/status.js.map +1 -1
- package/codeyam-cli/src/commands/test-startup.js +1 -1
- package/codeyam-cli/src/commands/test-startup.js.map +1 -1
- package/codeyam-cli/src/commands/wipe.js +108 -0
- package/codeyam-cli/src/commands/wipe.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/serverVersionStaleness.test.js +81 -0
- package/codeyam-cli/src/utils/__tests__/serverVersionStaleness.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +31 -27
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
- package/codeyam-cli/src/utils/analysisRunner.js +8 -13
- package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
- package/codeyam-cli/src/utils/backgroundServer.js +14 -4
- package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/utils/database.js +91 -5
- package/codeyam-cli/src/utils/database.js.map +1 -1
- package/codeyam-cli/src/utils/generateReport.js +253 -106
- package/codeyam-cli/src/utils/generateReport.js.map +1 -1
- package/codeyam-cli/src/utils/git.js +79 -0
- package/codeyam-cli/src/utils/git.js.map +1 -0
- package/codeyam-cli/src/utils/install-skills.js +31 -17
- package/codeyam-cli/src/utils/install-skills.js.map +1 -1
- package/codeyam-cli/src/utils/queue/__tests__/manager.test.js +38 -0
- package/codeyam-cli/src/utils/queue/__tests__/manager.test.js.map +1 -1
- package/codeyam-cli/src/utils/queue/job.js +245 -16
- package/codeyam-cli/src/utils/queue/job.js.map +1 -1
- package/codeyam-cli/src/utils/queue/manager.js +25 -7
- package/codeyam-cli/src/utils/queue/manager.js.map +1 -1
- package/codeyam-cli/src/utils/queue/persistence.js.map +1 -1
- package/codeyam-cli/src/utils/serverState.js.map +1 -1
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +7 -5
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
- package/codeyam-cli/src/utils/versionInfo.js +25 -19
- package/codeyam-cli/src/utils/versionInfo.js.map +1 -1
- package/codeyam-cli/src/utils/wipe.js +128 -0
- package/codeyam-cli/src/utils/wipe.js.map +1 -0
- package/codeyam-cli/src/webserver/app/lib/database.js +98 -1
- package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
- package/codeyam-cli/src/webserver/app/lib/dbNotifier.js.map +1 -1
- package/codeyam-cli/src/webserver/backgroundServer.js +5 -10
- package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/webserver/bootstrap.js +49 -0
- package/codeyam-cli/src/webserver/bootstrap.js.map +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/EntityItem-BXhEawa3.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-efWKDYMr.js → EntityTypeBadge-DLqD3qNt.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-Ba2JVPzP.js +41 -0
- package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-C8lyxW9k.js +34 -0
- package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-aht4aafF.js +25 -0
- package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-CVtiBnY5.js +3 -0
- package/codeyam-cli/src/webserver/build/client/assets/LoadingDots-B0GLXMsr.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/LogViewer-xgeCVgSM.js +3 -0
- package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-D4TZhLuw.js +21 -0
- package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-DuDvi0jm.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-DEx02QDa.js +10 -0
- package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-COPstp9J.js → TruncatedFilePath-DyFZkK0l.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/_index-BwqWJOgH.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-DoLIqZX2.js +37 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.health-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.restart-server-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.rules-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/chevron-down-Cx24_aWc.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/chunk-EPOLDU6W-CXRTFQ3F.js +51 -0
- package/codeyam-cli/src/webserver/build/client/assets/circle-check-BOARzkeR.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-BdhJEx6B.js +21 -0
- package/codeyam-cli/src/webserver/build/client/assets/{cy-logo-cli-C1gnJVOL.svg → cy-logo-cli-CCKUIm0S.svg} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/cy-logo-cli-DcX-ZS3p.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-BRb-0kQl.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha._-C2N4Op8e.js +23 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-DavjRmOY.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-D1T4TGjf.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.edit._scenarioId-CTBG2mmz.js +5 -0
- package/codeyam-cli/src/webserver/build/client/assets/entry.client-CS2cb_eZ.js +29 -0
- package/codeyam-cli/src/webserver/build/client/assets/executionFlowCoverage-BWhdfn70.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-DMJ7zii9.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/files-Cs4MdYtv.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/git-B4RJRvYB.js +15 -0
- package/codeyam-cli/src/webserver/build/client/assets/git-commit-horizontal-CysbcZxi.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/globals-DMUaGAqV.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/html2canvas-pro.esm-fmIEn3Bc.js +9 -0
- package/codeyam-cli/src/webserver/build/client/assets/index-B1h680n5.js +9 -0
- package/codeyam-cli/src/webserver/build/client/assets/index-lzqtyFU8.js +3 -0
- package/codeyam-cli/src/webserver/build/client/assets/loader-circle-B7B9V-bu.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/manifest-f874c610.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/preload-helper-ckwbz45p.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/root-Bz5TunQg.js +57 -0
- package/codeyam-cli/src/webserver/build/client/assets/rules-hEkvVw2-.js +97 -0
- package/codeyam-cli/src/webserver/build/client/assets/scenarioStatus-B_8jpV3e.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/search-CxXUmBSd.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/settings-CS5f3WzT.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/simulations-DwFIBT09.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/triangle-alert-B6LgvRJg.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-C1v1PQzo.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-3pmpUQB-.js → useLastLogLine-aSv48UbS.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/useReportContext-DYxHZQuP.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{useToast-DEyawJ8r.js → useToast-mBRpZPiu.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/index-967OuJoF.js +1 -0
- package/codeyam-cli/src/webserver/build/server/assets/server-build-DRTmerg9.js +257 -0
- package/codeyam-cli/src/webserver/build/server/index.js +1 -1
- package/codeyam-cli/src/webserver/build-info.json +5 -5
- package/codeyam-cli/src/webserver/devServer.js +1 -3
- package/codeyam-cli/src/webserver/devServer.js.map +1 -1
- package/codeyam-cli/src/webserver/server.js +35 -25
- package/codeyam-cli/src/webserver/server.js.map +1 -1
- package/codeyam-cli/templates/codeyam-power-rules-hook.sh +200 -0
- package/codeyam-cli/templates/{codeyam-debug-skill.md → codeyam:debug.md} +48 -4
- package/codeyam-cli/templates/codeyam:diagnose.md +650 -0
- package/codeyam-cli/templates/codeyam:new-rule.md +13 -0
- package/codeyam-cli/templates/codeyam:power-rules.md +447 -0
- package/codeyam-cli/templates/{codeyam-setup-skill.md → codeyam:setup.md} +139 -4
- package/codeyam-cli/templates/{codeyam-sim-skill.md → codeyam:sim.md} +1 -1
- package/codeyam-cli/templates/{codeyam-test-skill.md → codeyam:test.md} +1 -1
- package/codeyam-cli/templates/{codeyam-verify-skill.md → codeyam:verify.md} +1 -1
- package/package.json +17 -16
- package/packages/ai/index.js +5 -4
- package/packages/ai/index.js.map +1 -1
- package/packages/ai/src/lib/analyzeScope.js +99 -0
- package/packages/ai/src/lib/analyzeScope.js.map +1 -1
- package/packages/ai/src/lib/astScopes/arrayDerivationDetector.js +150 -0
- package/packages/ai/src/lib/astScopes/arrayDerivationDetector.js.map +1 -0
- package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js +100 -1
- package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js.map +1 -1
- package/packages/ai/src/lib/astScopes/conditionalEffectsExtractor.js +435 -0
- package/packages/ai/src/lib/astScopes/conditionalEffectsExtractor.js.map +1 -0
- package/packages/ai/src/lib/astScopes/methodSemantics.js +97 -6
- package/packages/ai/src/lib/astScopes/methodSemantics.js.map +1 -1
- package/packages/ai/src/lib/astScopes/patterns/ifStatementHandler.js +8 -0
- package/packages/ai/src/lib/astScopes/patterns/ifStatementHandler.js.map +1 -1
- package/packages/ai/src/lib/astScopes/patterns/switchStatementHandler.js +23 -0
- package/packages/ai/src/lib/astScopes/patterns/switchStatementHandler.js.map +1 -1
- package/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.js +138 -1
- package/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.js.map +1 -1
- package/packages/ai/src/lib/astScopes/processExpression.js +945 -87
- package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
- package/packages/ai/src/lib/checkAllAttributes.js +24 -9
- package/packages/ai/src/lib/checkAllAttributes.js.map +1 -1
- package/packages/ai/src/lib/completionCall.js +178 -31
- package/packages/ai/src/lib/completionCall.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +1198 -82
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js +2 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.js +661 -0
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.js.map +1 -0
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js +180 -56
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js +16 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js +86 -4
- package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js +20 -0
- package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/convertNullToUndefinedBySchema.js +86 -0
- package/packages/ai/src/lib/dataStructure/helpers/convertNullToUndefinedBySchema.js.map +1 -0
- package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js +34 -3
- package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/fixNullIdsBySchema.js +107 -0
- package/packages/ai/src/lib/dataStructure/helpers/fixNullIdsBySchema.js.map +1 -0
- package/packages/ai/src/lib/dataStructureChunking.js +111 -0
- package/packages/ai/src/lib/dataStructureChunking.js.map +1 -0
- package/packages/ai/src/lib/deepEqual.js +32 -0
- package/packages/ai/src/lib/deepEqual.js.map +1 -0
- package/packages/ai/src/lib/e2eDataTracking.js +241 -0
- package/packages/ai/src/lib/e2eDataTracking.js.map +1 -0
- package/packages/ai/src/lib/extractCriticalDataKeys.js +96 -0
- package/packages/ai/src/lib/extractCriticalDataKeys.js.map +1 -0
- package/packages/ai/src/lib/generateChangesEntityScenarioData.js +62 -5
- package/packages/ai/src/lib/generateChangesEntityScenarioData.js.map +1 -1
- package/packages/ai/src/lib/generateChangesEntityScenarios.js +81 -90
- package/packages/ai/src/lib/generateChangesEntityScenarios.js.map +1 -1
- package/packages/ai/src/lib/generateEntityDataStructure.js +5 -0
- package/packages/ai/src/lib/generateEntityDataStructure.js.map +1 -1
- package/packages/ai/src/lib/generateEntityScenarioData.js +904 -84
- package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
- package/packages/ai/src/lib/generateEntityScenarios.js +186 -82
- package/packages/ai/src/lib/generateEntityScenarios.js.map +1 -1
- package/packages/ai/src/lib/generateExecutionFlows.js +392 -0
- package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.js +380 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.js.map +1 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js +1440 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js.map +1 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.js +194 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.js.map +1 -0
- package/packages/ai/src/lib/getConditionalUsagesFromCode.js +84 -14
- package/packages/ai/src/lib/getConditionalUsagesFromCode.js.map +1 -1
- package/packages/ai/src/lib/guessScenarioDataFromDescription.js +2 -1
- package/packages/ai/src/lib/guessScenarioDataFromDescription.js.map +1 -1
- package/packages/ai/src/lib/isolateScopes.js +231 -4
- package/packages/ai/src/lib/isolateScopes.js.map +1 -1
- package/packages/ai/src/lib/mergeStatements.js +26 -3
- package/packages/ai/src/lib/mergeStatements.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js +6 -0
- package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.js +1 -1
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js +21 -64
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateChunkPrompt.js +54 -0
- package/packages/ai/src/lib/promptGenerators/generateChunkPrompt.js.map +1 -0
- package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js +68 -6
- package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.js +10 -34
- package/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateMissingKeysPrompt.js +45 -0
- package/packages/ai/src/lib/promptGenerators/generateMissingKeysPrompt.js.map +1 -0
- package/packages/ai/src/lib/promptGenerators/guessNewScenarioDataFromDescriptionGenerator.js +16 -3
- package/packages/ai/src/lib/promptGenerators/guessNewScenarioDataFromDescriptionGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/simplifyKeysForLLM.js +335 -0
- package/packages/ai/src/lib/promptGenerators/simplifyKeysForLLM.js.map +1 -0
- package/packages/ai/src/lib/resolvePathToControllable.js +667 -0
- package/packages/ai/src/lib/resolvePathToControllable.js.map +1 -0
- package/packages/ai/src/lib/splitOutsideParentheses.js +3 -1
- package/packages/ai/src/lib/splitOutsideParentheses.js.map +1 -1
- package/packages/ai/src/lib/worker/SerializableDataStructure.js +29 -0
- package/packages/ai/src/lib/worker/SerializableDataStructure.js.map +1 -1
- package/packages/ai/src/lib/worker/analyzeScopeWorker.js +4 -0
- package/packages/ai/src/lib/worker/analyzeScopeWorker.js.map +1 -1
- package/packages/analyze/src/lib/FileAnalyzer.js +15 -0
- package/packages/analyze/src/lib/FileAnalyzer.js.map +1 -1
- package/packages/analyze/src/lib/analysisContext.js +30 -5
- package/packages/analyze/src/lib/analysisContext.js.map +1 -1
- package/packages/analyze/src/lib/asts/nodes/index.js +1 -0
- package/packages/analyze/src/lib/asts/nodes/index.js.map +1 -1
- package/packages/analyze/src/lib/asts/nodes/isAsyncFunction.js +52 -0
- package/packages/analyze/src/lib/asts/nodes/isAsyncFunction.js.map +1 -0
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +218 -50
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +10 -0
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js +2 -0
- package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js +31 -7
- package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeChange.js +21 -11
- package/packages/analyze/src/lib/files/analyzeChange.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeEntity.js +9 -8
- package/packages/analyze/src/lib/files/analyzeEntity.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeInitial.js +9 -10
- package/packages/analyze/src/lib/files/analyzeInitial.js.map +1 -1
- package/packages/analyze/src/lib/files/enums/steps.js +1 -1
- package/packages/analyze/src/lib/files/enums/steps.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js +209 -0
- package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js.map +1 -0
- package/packages/analyze/src/lib/files/scenarios/enrichUnknownTypesFromSourceEquivalencies.js +85 -0
- package/packages/analyze/src/lib/files/scenarios/enrichUnknownTypesFromSourceEquivalencies.js.map +1 -0
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js +458 -48
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateChangesScenarioData.js +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateChangesScenarioData.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.js +29 -34
- package/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +264 -78
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js +96 -0
- package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js.map +1 -0
- package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js +56 -69
- package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateScenarios.js +4 -8
- package/packages/analyze/src/lib/files/scenarios/generateScenarios.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +372 -89
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.js +46 -9
- package/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.js.map +1 -1
- package/packages/aws/src/lib/ecs/ecsDefineContainer.js +2 -2
- package/packages/aws/src/lib/ecs/ecsDefineContainer.js.map +1 -1
- package/packages/aws/src/lib/ecs/ecsTaskFactory.js +17 -61
- package/packages/aws/src/lib/ecs/ecsTaskFactory.js.map +1 -1
- package/packages/database/src/lib/kysely/db.js +2 -2
- package/packages/database/src/lib/kysely/tables/debugReportsTable.js +9 -3
- package/packages/database/src/lib/kysely/tables/debugReportsTable.js.map +1 -1
- package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.js +7 -4
- package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.js.map +1 -1
- package/packages/generate/index.js +3 -0
- package/packages/generate/index.js.map +1 -1
- package/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js +16 -1
- package/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js.map +1 -1
- package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +189 -0
- package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -0
- package/packages/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.js +53 -0
- package/packages/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.js.map +1 -0
- package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +8 -4
- package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
- package/packages/generate/src/lib/deepMerge.js +27 -1
- package/packages/generate/src/lib/deepMerge.js.map +1 -1
- package/packages/generate/src/lib/scenarioComponentForServer.js +89 -0
- package/packages/generate/src/lib/scenarioComponentForServer.js.map +1 -0
- package/packages/github/src/lib/loadOrCreateCommit.js +10 -0
- package/packages/github/src/lib/loadOrCreateCommit.js.map +1 -1
- package/packages/github/src/lib/syncPrimaryBranch.js +3 -0
- package/packages/github/src/lib/syncPrimaryBranch.js.map +1 -1
- package/packages/process/index.js +3 -0
- package/packages/process/index.js.map +1 -0
- package/packages/process/src/GlobalProcessManager.js.map +1 -0
- package/{background/src/lib/process → packages/process/src}/ProcessManager.js +1 -1
- package/packages/process/src/ProcessManager.js.map +1 -0
- package/packages/process/src/index.js.map +1 -0
- package/packages/process/src/managedExecAsync.js.map +1 -0
- package/packages/types/index.js.map +1 -1
- package/packages/utils/src/lib/lightweightEntityExtractor.js +25 -0
- package/packages/utils/src/lib/lightweightEntityExtractor.js.map +1 -1
- package/packages/utils/src/lib/safeFileName.js +29 -3
- package/packages/utils/src/lib/safeFileName.js.map +1 -1
- package/scripts/finalize-analyzer.cjs +6 -4
- package/analyzer-template/packages/ai/src/lib/findMatchingAttribute.ts +0 -102
- package/analyzer-template/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.ts +0 -197
- package/analyzer-template/packages/ai/src/lib/generateChangesEntityKeyAttributes.ts +0 -271
- package/analyzer-template/packages/ai/src/lib/generateEntityKeyAttributes.ts +0 -294
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityKeyAttributesGenerator.ts +0 -67
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.ts +0 -115
- package/analyzer-template/process/INTEGRATION_COMPLETE.md +0 -333
- package/analyzer-template/process/INTEGRATION_EXAMPLE.md +0 -525
- package/analyzer-template/process/README.md +0 -507
- package/background/src/lib/process/GlobalProcessManager.js.map +0 -1
- package/background/src/lib/process/ProcessManager.js.map +0 -1
- package/background/src/lib/process/index.js.map +0 -1
- package/background/src/lib/process/managedExecAsync.js.map +0 -1
- package/codeyam-cli/scripts/fixtures/cal.com/universal-mocks/packages/prisma/index.js +0 -238
- package/codeyam-cli/scripts/fixtures/cal.com/universal-mocks/packages/prisma/index.js.map +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityItem-CVbSvOjo.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-DcwcHyl5.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-WgwC1GfJ.js +0 -26
- package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-IEKom9O2.js +0 -3
- package/codeyam-cli/src/webserver/build/client/assets/LogViewer-BYnfxbUG.js +0 -3
- package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-_lBPJCzG.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-lHVhvsu_.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-d_TBk4GQ.js +0 -5
- package/codeyam-cli/src/webserver/build/client/assets/_index-kGT7VUqj.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-DDGmhu7P.js +0 -7
- package/codeyam-cli/src/webserver/build/client/assets/chevron-down-n_HPRfM_.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/chunk-WWGJGFF6-CbVoyx1U.js +0 -26
- package/codeyam-cli/src/webserver/build/client/assets/circle-check-D1VOYveA.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-YR8jjAlu.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-B8vP3V_s.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha._-CN6aLCT1.js +0 -16
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-DA5Jeu2P.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.edit._scenarioId-BTeitalf.js +0 -5
- package/codeyam-cli/src/webserver/build/client/assets/entry.client-du6UEYD-.js +0 -13
- package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-BpjkhMoi.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/files-BQGvk4lJ.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/git-DVdYRT-I.js +0 -12
- package/codeyam-cli/src/webserver/build/client/assets/globals-CO-U8Bpo.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/html2canvas-pro.esm-XQCGvadH.js +0 -5
- package/codeyam-cli/src/webserver/build/client/assets/index-DCG-vks0.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/loader-circle-GazdNeLl.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-0b694d28.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/root-D3tQP7hx.js +0 -16
- package/codeyam-cli/src/webserver/build/client/assets/search-CIY6XmtE.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/server-build-CMKNK2uU.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/settings-CoMDgElu.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/simulations-agkniXp2.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/triangle-alert-B2VUcygF.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useReportContext-EvdK-zXP.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/index-DGVHQEXD.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-CghkTkIL.js +0 -166
- package/codeyam-cli/templates/debug-command.md +0 -303
- package/packages/ai/src/lib/findMatchingAttribute.js +0 -77
- package/packages/ai/src/lib/findMatchingAttribute.js.map +0 -1
- package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js +0 -136
- package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js.map +0 -1
- package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js +0 -220
- package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js.map +0 -1
- package/packages/ai/src/lib/generateEntityKeyAttributes.js +0 -241
- package/packages/ai/src/lib/generateEntityKeyAttributes.js.map +0 -1
- package/packages/ai/src/lib/isFrontend.js +0 -5
- package/packages/ai/src/lib/isFrontend.js.map +0 -1
- package/packages/ai/src/lib/promptGenerators/generateEntityKeyAttributesGenerator.js +0 -40
- package/packages/ai/src/lib/promptGenerators/generateEntityKeyAttributesGenerator.js.map +0 -1
- package/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.js +0 -72
- package/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.js.map +0 -1
- /package/analyzer-template/{process → packages/process/src}/GlobalProcessManager.ts +0 -0
- /package/analyzer-template/{process → packages/process/src}/ProcessManager.ts +0 -0
- /package/analyzer-template/{process → packages/process/src}/index.ts +0 -0
- /package/analyzer-template/{process → packages/process/src}/managedExecAsync.ts +0 -0
- /package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-CMKNK2uU.css → styles-CMKNK2uU.css} +0 -0
- /package/{background/src/lib/process → packages/process/src}/GlobalProcessManager.js +0 -0
- /package/{background/src/lib/process → packages/process/src}/index.js +0 -0
- /package/{background/src/lib/process → packages/process/src}/managedExecAsync.js +0 -0
|
@@ -218,7 +218,11 @@ export function joinParenthesesAndArrays(parts: string[]): string {
|
|
|
218
218
|
|
|
219
219
|
const noIndexParts: string[] = [];
|
|
220
220
|
for (const part of parts) {
|
|
221
|
-
|
|
221
|
+
// Append array indices [x] and function call arguments (x) directly without a dot
|
|
222
|
+
if (
|
|
223
|
+
noIndexParts.length > 0 &&
|
|
224
|
+
(part.startsWith('[') || part.startsWith('('))
|
|
225
|
+
) {
|
|
222
226
|
noIndexParts[noIndexParts.length - 1] += part;
|
|
223
227
|
} else {
|
|
224
228
|
noIndexParts.push(part);
|
|
@@ -0,0 +1,531 @@
|
|
|
1
|
+
import type { ExecutionFlow } from '~codeyam/types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Classification types for execution flow paths
|
|
5
|
+
*/
|
|
6
|
+
export type PathClassification =
|
|
7
|
+
| 'controllable'
|
|
8
|
+
| 'needs_resolution'
|
|
9
|
+
| 'interaction_required';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Result of classifying a single path
|
|
13
|
+
*/
|
|
14
|
+
export interface PathClassificationResult {
|
|
15
|
+
classification: PathClassification;
|
|
16
|
+
originalPath: string;
|
|
17
|
+
dataSourcePath?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Result of classifying an entire execution flow
|
|
22
|
+
*/
|
|
23
|
+
export interface FlowClassificationResult {
|
|
24
|
+
classification: PathClassification;
|
|
25
|
+
controllablePaths: string[];
|
|
26
|
+
unresolvedPaths: string[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Result of attempting to resolve execution flow paths
|
|
31
|
+
*/
|
|
32
|
+
export interface FlowResolutionResult {
|
|
33
|
+
resolved: boolean;
|
|
34
|
+
classification: PathClassification;
|
|
35
|
+
flow: ExecutionFlow;
|
|
36
|
+
resolvedPaths: string[];
|
|
37
|
+
unresolvedPaths: string[];
|
|
38
|
+
interactionRequiredPaths: string[];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Result of processing all execution flows
|
|
43
|
+
*/
|
|
44
|
+
export interface ProcessExecutionFlowsResult {
|
|
45
|
+
controllableFlows: ExecutionFlow[];
|
|
46
|
+
interactionRequiredFlows: ExecutionFlow[];
|
|
47
|
+
needsLlmResolution: ExecutionFlow[];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Classify a single attribute path.
|
|
52
|
+
*
|
|
53
|
+
* @param path - The attribute path from an execution flow
|
|
54
|
+
* @param attributesMap - Map of controllable paths to their types
|
|
55
|
+
* @param fullToShortPathMap - Optional map from full paths to short paths (for hook paths)
|
|
56
|
+
* @returns Classification result
|
|
57
|
+
*/
|
|
58
|
+
export function classifyExecutionFlowPath(
|
|
59
|
+
path: string,
|
|
60
|
+
attributesMap: Record<string, string>,
|
|
61
|
+
fullToShortPathMap?: Record<string, string>,
|
|
62
|
+
): PathClassificationResult {
|
|
63
|
+
// Check if path exists directly in attributesMap
|
|
64
|
+
if (path in attributesMap) {
|
|
65
|
+
return {
|
|
66
|
+
classification: 'controllable',
|
|
67
|
+
originalPath: path,
|
|
68
|
+
dataSourcePath: path,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Check if this is a sub-path of a controllable path
|
|
73
|
+
// e.g., "props.data.items[0].name" might match "props.data.items[].name"
|
|
74
|
+
const normalizedPath = path.replace(/\[\d+\]/g, '[]');
|
|
75
|
+
if (normalizedPath in attributesMap) {
|
|
76
|
+
return {
|
|
77
|
+
classification: 'controllable',
|
|
78
|
+
originalPath: path,
|
|
79
|
+
dataSourcePath: normalizedPath,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Try to convert full path to short path using the association map
|
|
84
|
+
// e.g., "useLoaderData<LoaderData>().functionCallReturnValue.entity.sha" → "entity.sha"
|
|
85
|
+
if (fullToShortPathMap && path in fullToShortPathMap) {
|
|
86
|
+
const shortPath = fullToShortPathMap[path];
|
|
87
|
+
if (shortPath in attributesMap) {
|
|
88
|
+
return {
|
|
89
|
+
classification: 'controllable',
|
|
90
|
+
originalPath: path,
|
|
91
|
+
dataSourcePath: shortPath,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Path doesn't exist in attributesMap - needs resolution
|
|
97
|
+
return {
|
|
98
|
+
classification: 'needs_resolution',
|
|
99
|
+
originalPath: path,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Extended ExecutionFlow type that may have interactionRequired marker
|
|
105
|
+
*/
|
|
106
|
+
type ExecutionFlowWithInteraction = ExecutionFlow & {
|
|
107
|
+
interactionRequired?: boolean;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Classify an entire execution flow based on its requiredValues paths.
|
|
112
|
+
*
|
|
113
|
+
* @param flow - The execution flow to classify
|
|
114
|
+
* @param attributesMap - Map of controllable paths to their types
|
|
115
|
+
* @param fullToShortPathMap - Optional map from full paths to short paths (for hook paths)
|
|
116
|
+
* @returns Classification result for the flow
|
|
117
|
+
*/
|
|
118
|
+
export function classifyExecutionFlow(
|
|
119
|
+
flow: ExecutionFlowWithInteraction,
|
|
120
|
+
attributesMap: Record<string, string>,
|
|
121
|
+
fullToShortPathMap?: Record<string, string>,
|
|
122
|
+
): FlowClassificationResult {
|
|
123
|
+
// If already marked as interaction-required by LLM, respect that
|
|
124
|
+
if (flow.interactionRequired) {
|
|
125
|
+
return {
|
|
126
|
+
classification: 'interaction_required',
|
|
127
|
+
controllablePaths: [],
|
|
128
|
+
unresolvedPaths: flow.requiredValues.map((rv) => rv.attributePath),
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
const controllablePaths: string[] = [];
|
|
133
|
+
const unresolvedPaths: string[] = [];
|
|
134
|
+
|
|
135
|
+
for (const rv of flow.requiredValues) {
|
|
136
|
+
const result = classifyExecutionFlowPath(
|
|
137
|
+
rv.attributePath,
|
|
138
|
+
attributesMap,
|
|
139
|
+
fullToShortPathMap,
|
|
140
|
+
);
|
|
141
|
+
if (result.classification === 'controllable') {
|
|
142
|
+
controllablePaths.push(rv.attributePath);
|
|
143
|
+
} else {
|
|
144
|
+
unresolvedPaths.push(rv.attributePath);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// If any path is unresolved, the whole flow needs resolution
|
|
149
|
+
if (unresolvedPaths.length > 0) {
|
|
150
|
+
return {
|
|
151
|
+
classification: 'needs_resolution',
|
|
152
|
+
controllablePaths,
|
|
153
|
+
unresolvedPaths,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return {
|
|
158
|
+
classification: 'controllable',
|
|
159
|
+
controllablePaths,
|
|
160
|
+
unresolvedPaths: [],
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Extract the local variable name from a path like "ComponentName.variableName"
|
|
166
|
+
* or just "variableName"
|
|
167
|
+
*/
|
|
168
|
+
function extractLocalVariableName(path: string): string {
|
|
169
|
+
// Handle "Component.stateName" pattern - extract just the state name
|
|
170
|
+
const parts = path.split('.');
|
|
171
|
+
if (parts.length >= 2) {
|
|
172
|
+
// Check if first part looks like a component name (PascalCase)
|
|
173
|
+
const firstPart = parts[0];
|
|
174
|
+
if (/^[A-Z][a-zA-Z0-9]*$/.test(firstPart)) {
|
|
175
|
+
// Return the second part as the variable name
|
|
176
|
+
return parts[1];
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
// Otherwise return the first part
|
|
180
|
+
return parts[0];
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Resolve a compound path by replacing the local variable with its data source.
|
|
185
|
+
*
|
|
186
|
+
* When the data source is a function call (ends with `()`), we need to insert
|
|
187
|
+
* `.functionCallReturnValue.` to match how paths are stored in the data structure.
|
|
188
|
+
*
|
|
189
|
+
* Examples:
|
|
190
|
+
* - resolveCompoundPath("debugFetcher.state", "debugFetcher", "useFetcher<...>()")
|
|
191
|
+
* → "useFetcher<...>().functionCallReturnValue.state"
|
|
192
|
+
* - resolveCompoundPath("debugFetcher.data.success", "debugFetcher", "useFetcher<...>()")
|
|
193
|
+
* → "useFetcher<...>().functionCallReturnValue.data.success"
|
|
194
|
+
* - resolveCompoundPath("EntityDetail.showDebugModal", "showDebugModal", "useFetcher<...>().data.success")
|
|
195
|
+
* → "useFetcher<...>().data.success" (no suffix in this case, data source already has path)
|
|
196
|
+
*/
|
|
197
|
+
function resolveCompoundPath(
|
|
198
|
+
originalPath: string,
|
|
199
|
+
localVarName: string,
|
|
200
|
+
dataSourceBase: string,
|
|
201
|
+
): string {
|
|
202
|
+
// Find where the local variable appears in the path
|
|
203
|
+
const varIndex = originalPath.indexOf(localVarName);
|
|
204
|
+
if (varIndex === -1) {
|
|
205
|
+
// Shouldn't happen, but return the data source as fallback
|
|
206
|
+
return dataSourceBase;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// Get the suffix after the local variable name (e.g., ".data.success" from "debugFetcher.data.success")
|
|
210
|
+
const afterVar = originalPath.slice(varIndex + localVarName.length);
|
|
211
|
+
|
|
212
|
+
// If there's no suffix, just return the data source
|
|
213
|
+
if (!afterVar || afterVar === '') {
|
|
214
|
+
return dataSourceBase;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// If the data source is a function call (ends with `()`), we need to insert
|
|
218
|
+
// `.functionCallReturnValue` before the property access because that's how
|
|
219
|
+
// the data structure paths are stored.
|
|
220
|
+
// e.g., "debugFetcher.data" with dataSource "useFetcher<...>()"
|
|
221
|
+
// becomes "useFetcher<...>().functionCallReturnValue.data"
|
|
222
|
+
if (dataSourceBase.endsWith('()')) {
|
|
223
|
+
return dataSourceBase + '.functionCallReturnValue' + afterVar;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// Otherwise just combine them directly
|
|
227
|
+
return dataSourceBase + afterVar;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Attempt to resolve execution flow paths to their data sources.
|
|
232
|
+
* Uses equivalentVariables mapping to trace local variables back to data sources.
|
|
233
|
+
*
|
|
234
|
+
* @param flow - The execution flow to resolve
|
|
235
|
+
* @param attributesMap - Map of controllable paths to their types
|
|
236
|
+
* @param equivalentVariables - Map from local variable names to their data source paths
|
|
237
|
+
* @param fullToShortPathMap - Optional map from full paths to short paths (for hook paths)
|
|
238
|
+
* @returns Resolution result
|
|
239
|
+
*/
|
|
240
|
+
export function resolveExecutionFlowPaths(
|
|
241
|
+
flow: ExecutionFlow,
|
|
242
|
+
attributesMap: Record<string, string>,
|
|
243
|
+
equivalentVariables: Record<string, string>,
|
|
244
|
+
fullToShortPathMap?: Record<string, string>,
|
|
245
|
+
): FlowResolutionResult {
|
|
246
|
+
const resolvedPaths: string[] = [];
|
|
247
|
+
const unresolvedPaths: string[] = [];
|
|
248
|
+
const interactionRequiredPaths: string[] = [];
|
|
249
|
+
|
|
250
|
+
// Deep clone the flow to avoid mutating the original
|
|
251
|
+
const resolvedFlow: ExecutionFlow = JSON.parse(JSON.stringify(flow));
|
|
252
|
+
|
|
253
|
+
for (let i = 0; i < resolvedFlow.requiredValues.length; i++) {
|
|
254
|
+
const rv = resolvedFlow.requiredValues[i];
|
|
255
|
+
const pathResult = classifyExecutionFlowPath(
|
|
256
|
+
rv.attributePath,
|
|
257
|
+
attributesMap,
|
|
258
|
+
fullToShortPathMap,
|
|
259
|
+
);
|
|
260
|
+
|
|
261
|
+
if (pathResult.classification === 'controllable') {
|
|
262
|
+
// Path is already controllable
|
|
263
|
+
resolvedPaths.push(rv.attributePath);
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// Try to resolve using equivalentVariables
|
|
268
|
+
const localVarName = extractLocalVariableName(rv.attributePath);
|
|
269
|
+
const dataSourceBase = equivalentVariables[localVarName];
|
|
270
|
+
|
|
271
|
+
if (dataSourceBase) {
|
|
272
|
+
// Build the full resolved path by replacing the local variable with its data source
|
|
273
|
+
// e.g., "debugFetcher.state" with dataSourceBase "useFetcher<...>()"
|
|
274
|
+
// becomes "useFetcher<...>().functionCallReturnValue.state"
|
|
275
|
+
const fullResolvedPath = resolveCompoundPath(
|
|
276
|
+
rv.attributePath,
|
|
277
|
+
localVarName,
|
|
278
|
+
dataSourceBase,
|
|
279
|
+
);
|
|
280
|
+
|
|
281
|
+
console.log('CodeYam: Attempting path resolution', {
|
|
282
|
+
originalPath: rv.attributePath,
|
|
283
|
+
localVarName,
|
|
284
|
+
dataSourceBase: dataSourceBase.slice(0, 60) + '...',
|
|
285
|
+
resolvedPath: fullResolvedPath.slice(0, 80) + '...',
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
// Check if the full resolved path is in attributesMap
|
|
289
|
+
const resolvedPathResult = classifyExecutionFlowPath(
|
|
290
|
+
fullResolvedPath,
|
|
291
|
+
attributesMap,
|
|
292
|
+
fullToShortPathMap,
|
|
293
|
+
);
|
|
294
|
+
|
|
295
|
+
console.log('CodeYam: Path resolution result', {
|
|
296
|
+
resolvedPath: fullResolvedPath.slice(0, 80) + '...',
|
|
297
|
+
classification: resolvedPathResult.classification,
|
|
298
|
+
dataSourcePath: resolvedPathResult.dataSourcePath,
|
|
299
|
+
inFullToShortMap: fullToShortPathMap
|
|
300
|
+
? fullResolvedPath in fullToShortPathMap
|
|
301
|
+
: 'no map',
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
if (resolvedPathResult.classification === 'controllable') {
|
|
305
|
+
// Successfully resolved!
|
|
306
|
+
resolvedFlow.requiredValues[i] = {
|
|
307
|
+
...rv,
|
|
308
|
+
attributePath: fullResolvedPath,
|
|
309
|
+
};
|
|
310
|
+
resolvedPaths.push(fullResolvedPath);
|
|
311
|
+
continue;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// Could not resolve - check if we have evidence it's interaction-required
|
|
316
|
+
// We only mark as interaction_required if we looked up the variable and it
|
|
317
|
+
// explicitly wasn't in equivalentVariables (meaning the static analysis
|
|
318
|
+
// determined it has no data source). If equivalentVariables is empty/sparse,
|
|
319
|
+
// we flag for LLM resolution instead.
|
|
320
|
+
const hasEquivalentVariables = Object.keys(equivalentVariables).length > 0;
|
|
321
|
+
const variableWasLookedUp =
|
|
322
|
+
localVarName in equivalentVariables || hasEquivalentVariables;
|
|
323
|
+
|
|
324
|
+
if (variableWasLookedUp && !(localVarName in equivalentVariables)) {
|
|
325
|
+
// We have mappings but this variable isn't in them - likely interaction-required
|
|
326
|
+
interactionRequiredPaths.push(rv.attributePath);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
unresolvedPaths.push(rv.attributePath);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// Determine overall classification
|
|
333
|
+
let classification: PathClassification;
|
|
334
|
+
const allResolved = unresolvedPaths.length === 0;
|
|
335
|
+
|
|
336
|
+
if (allResolved) {
|
|
337
|
+
classification = 'controllable';
|
|
338
|
+
} else if (
|
|
339
|
+
interactionRequiredPaths.length === unresolvedPaths.length &&
|
|
340
|
+
interactionRequiredPaths.length > 0
|
|
341
|
+
) {
|
|
342
|
+
// All unresolved paths were determined to be interaction-required
|
|
343
|
+
classification = 'interaction_required';
|
|
344
|
+
} else {
|
|
345
|
+
// Some paths couldn't be resolved and we don't know if they're interaction-required
|
|
346
|
+
classification = 'needs_resolution';
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
return {
|
|
350
|
+
resolved: allResolved,
|
|
351
|
+
classification,
|
|
352
|
+
flow: resolvedFlow,
|
|
353
|
+
resolvedPaths,
|
|
354
|
+
unresolvedPaths,
|
|
355
|
+
interactionRequiredPaths,
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Generate a prompt for the LLM to resolve unresolved execution flow paths.
|
|
361
|
+
*
|
|
362
|
+
* @param unresolvedFlows - Flows with paths that couldn't be auto-resolved
|
|
363
|
+
* @param attributesMap - Map of controllable paths to their types
|
|
364
|
+
* @returns Prompt string for LLM
|
|
365
|
+
*/
|
|
366
|
+
export function generatePathResolutionPrompt(
|
|
367
|
+
unresolvedFlows: ExecutionFlow[],
|
|
368
|
+
attributesMap: Record<string, string>,
|
|
369
|
+
): string {
|
|
370
|
+
const availablePaths = Object.entries(attributesMap)
|
|
371
|
+
.map(([path, type]) => `- ${path}: ${type}`)
|
|
372
|
+
.join('\n');
|
|
373
|
+
|
|
374
|
+
const flowsToResolve = unresolvedFlows
|
|
375
|
+
.map((flow) => {
|
|
376
|
+
const unresolvedPaths = flow.requiredValues
|
|
377
|
+
.filter((rv) => !(rv.attributePath in attributesMap))
|
|
378
|
+
.map((rv) => rv.attributePath);
|
|
379
|
+
|
|
380
|
+
return `Flow "${flow.name}" (${flow.id}):
|
|
381
|
+
Unresolved paths:
|
|
382
|
+
${unresolvedPaths.map((p) => ` - ${p}`).join('\n')}`;
|
|
383
|
+
})
|
|
384
|
+
.join('\n\n');
|
|
385
|
+
|
|
386
|
+
return `## Execution Flow Path Resolution Required
|
|
387
|
+
|
|
388
|
+
The following execution flows have attribute paths that don't map to controllable data sources.
|
|
389
|
+
For each unresolved path, either:
|
|
390
|
+
1. Map it to a data source from the available paths below
|
|
391
|
+
2. Mark the flow as \`interactionRequired: true\` if it can only be triggered by user interaction (clicking a button, etc.)
|
|
392
|
+
|
|
393
|
+
### Available Data Sources (controllable via mock data)
|
|
394
|
+
${availablePaths}
|
|
395
|
+
|
|
396
|
+
### Flows Needing Resolution
|
|
397
|
+
${flowsToResolve}
|
|
398
|
+
|
|
399
|
+
### Response Format
|
|
400
|
+
Return a JSON object with resolved flows:
|
|
401
|
+
\`\`\`json
|
|
402
|
+
{
|
|
403
|
+
"resolvedFlows": [
|
|
404
|
+
{
|
|
405
|
+
"id": "flow-id",
|
|
406
|
+
"resolvedPaths": {
|
|
407
|
+
"OriginalPath.name": "mappedDataSource.path"
|
|
408
|
+
},
|
|
409
|
+
"interactionRequired": false
|
|
410
|
+
}
|
|
411
|
+
]
|
|
412
|
+
}
|
|
413
|
+
\`\`\`
|
|
414
|
+
|
|
415
|
+
If a path cannot be mapped to a data source and requires user interaction, set \`interactionRequired: true\`.
|
|
416
|
+
`;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Process all execution flows: classify, resolve, and categorize.
|
|
421
|
+
*
|
|
422
|
+
* @param executionFlows - All execution flows to process
|
|
423
|
+
* @param attributesMap - Map of controllable paths to their types
|
|
424
|
+
* @param equivalentVariables - Map from local variable names to their data source paths
|
|
425
|
+
* @param fullToShortPathMap - Optional map from full paths to short paths (for hook paths)
|
|
426
|
+
* @returns Categorized flows
|
|
427
|
+
*/
|
|
428
|
+
export function processExecutionFlows(
|
|
429
|
+
executionFlows: ExecutionFlow[],
|
|
430
|
+
attributesMap: Record<string, string>,
|
|
431
|
+
equivalentVariables: Record<string, string>,
|
|
432
|
+
fullToShortPathMap?: Record<string, string>,
|
|
433
|
+
): ProcessExecutionFlowsResult {
|
|
434
|
+
// Log a sample of available mappings for debugging
|
|
435
|
+
const sampleFullToShort = fullToShortPathMap
|
|
436
|
+
? Object.entries(fullToShortPathMap)
|
|
437
|
+
.filter(([k]) => k.includes('Fetcher') || k.includes('success'))
|
|
438
|
+
.slice(0, 5)
|
|
439
|
+
.map(([k, v]) => `${k.slice(0, 60)}... -> ${v}`)
|
|
440
|
+
: [];
|
|
441
|
+
const sampleEquivalent = Object.entries(equivalentVariables)
|
|
442
|
+
.filter(([k]) => k.includes('Fetcher') || k.includes('fetcher'))
|
|
443
|
+
.slice(0, 5)
|
|
444
|
+
.map(([k, v]) => `${k} -> ${v.slice(0, 50)}...`);
|
|
445
|
+
|
|
446
|
+
console.log('CodeYam: processExecutionFlows starting', {
|
|
447
|
+
totalFlows: executionFlows.length,
|
|
448
|
+
attributesMapSize: Object.keys(attributesMap).length,
|
|
449
|
+
equivalentVariablesSize: Object.keys(equivalentVariables).length,
|
|
450
|
+
fullToShortMapSize: fullToShortPathMap
|
|
451
|
+
? Object.keys(fullToShortPathMap).length
|
|
452
|
+
: 0,
|
|
453
|
+
sampleFullToShort,
|
|
454
|
+
sampleEquivalent,
|
|
455
|
+
});
|
|
456
|
+
|
|
457
|
+
const controllableFlows: ExecutionFlow[] = [];
|
|
458
|
+
const interactionRequiredFlows: ExecutionFlow[] = [];
|
|
459
|
+
const needsLlmResolution: ExecutionFlow[] = [];
|
|
460
|
+
|
|
461
|
+
for (const flow of executionFlows) {
|
|
462
|
+
// First classify
|
|
463
|
+
const classification = classifyExecutionFlow(
|
|
464
|
+
flow,
|
|
465
|
+
attributesMap,
|
|
466
|
+
fullToShortPathMap,
|
|
467
|
+
);
|
|
468
|
+
|
|
469
|
+
if (classification.classification === 'controllable') {
|
|
470
|
+
// Already controllable, no resolution needed
|
|
471
|
+
controllableFlows.push(flow);
|
|
472
|
+
continue;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
if (classification.classification === 'interaction_required') {
|
|
476
|
+
// Already marked as interaction required
|
|
477
|
+
interactionRequiredFlows.push(flow);
|
|
478
|
+
continue;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
// Try to resolve
|
|
482
|
+
const resolution = resolveExecutionFlowPaths(
|
|
483
|
+
flow,
|
|
484
|
+
attributesMap,
|
|
485
|
+
equivalentVariables,
|
|
486
|
+
fullToShortPathMap,
|
|
487
|
+
);
|
|
488
|
+
|
|
489
|
+
if (resolution.resolved) {
|
|
490
|
+
// Successfully resolved all paths
|
|
491
|
+
controllableFlows.push(resolution.flow);
|
|
492
|
+
console.log(`CodeYam: Resolved execution flow "${flow.name}" paths`, {
|
|
493
|
+
originalPaths: flow.requiredValues.map((rv) => rv.attributePath),
|
|
494
|
+
resolvedPaths: resolution.flow.requiredValues.map(
|
|
495
|
+
(rv) => rv.attributePath,
|
|
496
|
+
),
|
|
497
|
+
});
|
|
498
|
+
} else if (resolution.classification === 'interaction_required') {
|
|
499
|
+
// Some paths require user interaction
|
|
500
|
+
interactionRequiredFlows.push(flow);
|
|
501
|
+
console.log(
|
|
502
|
+
`CodeYam: Execution flow "${flow.name}" requires user interaction`,
|
|
503
|
+
{
|
|
504
|
+
interactionRequiredPaths: resolution.interactionRequiredPaths,
|
|
505
|
+
},
|
|
506
|
+
);
|
|
507
|
+
} else {
|
|
508
|
+
// Could not resolve - needs LLM help
|
|
509
|
+
needsLlmResolution.push(flow);
|
|
510
|
+
console.log(
|
|
511
|
+
`CodeYam: Execution flow "${flow.name}" needs LLM resolution`,
|
|
512
|
+
{
|
|
513
|
+
unresolvedPaths: resolution.unresolvedPaths,
|
|
514
|
+
},
|
|
515
|
+
);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
// Log summary
|
|
520
|
+
console.log('CodeYam: Filtered out execution flows with unresolvable paths', {
|
|
521
|
+
controllable: controllableFlows.length,
|
|
522
|
+
interactionRequired: interactionRequiredFlows.length,
|
|
523
|
+
needsLlmResolution: needsLlmResolution.length,
|
|
524
|
+
});
|
|
525
|
+
|
|
526
|
+
return {
|
|
527
|
+
controllableFlows,
|
|
528
|
+
interactionRequiredFlows,
|
|
529
|
+
needsLlmResolution,
|
|
530
|
+
};
|
|
531
|
+
}
|
|
@@ -10,6 +10,11 @@ import {
|
|
|
10
10
|
fuzzyMatchFunctionName,
|
|
11
11
|
findFuzzyMatchingKey,
|
|
12
12
|
} from './fuzzyMatchFunctionName';
|
|
13
|
+
import type {
|
|
14
|
+
ConditionalEffect,
|
|
15
|
+
CompoundConditional,
|
|
16
|
+
JsxRenderingUsage,
|
|
17
|
+
} from '../astScopes/types';
|
|
13
18
|
|
|
14
19
|
export interface SerializableScopeVariable {
|
|
15
20
|
scopeNodeName: string;
|
|
@@ -28,6 +33,11 @@ export interface SerializableFunctionCallInfo {
|
|
|
28
33
|
receivingVariableNames?: string[];
|
|
29
34
|
/** Maps each call signature to the variable that receives its return value */
|
|
30
35
|
callSignatureToVariable?: Record<string, string>;
|
|
36
|
+
/**
|
|
37
|
+
* Stores individual return value schemas per receiving variable, BEFORE merging.
|
|
38
|
+
* Key is the receiving variable name (e.g., "userFetcher", "reportFetcher").
|
|
39
|
+
*/
|
|
40
|
+
perVariableSchemas?: Record<string, Record<string, string>>;
|
|
31
41
|
}
|
|
32
42
|
|
|
33
43
|
export interface SerializableFunctionResult {
|
|
@@ -60,6 +70,43 @@ export interface EnrichedConditionalUsage {
|
|
|
60
70
|
* This connects the local variable to the original data attribute.
|
|
61
71
|
*/
|
|
62
72
|
sourceDataPath?: string;
|
|
73
|
+
/** Whether this condition is negated (e.g., !foo) */
|
|
74
|
+
isNegated?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Whether this conditional controls JSX rendering.
|
|
77
|
+
* True when the conditional appears in a JSX expression like {cond && <Component />}
|
|
78
|
+
*/
|
|
79
|
+
controlsJsxRendering?: boolean;
|
|
80
|
+
/** Source location information */
|
|
81
|
+
sourceLocation?: {
|
|
82
|
+
lineNumber: number;
|
|
83
|
+
column: number;
|
|
84
|
+
codeSnippet: string;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Information about how this variable was derived from other variables.
|
|
88
|
+
* Used to trace derived boolean variables back to their data sources.
|
|
89
|
+
*/
|
|
90
|
+
derivedFrom?: {
|
|
91
|
+
/** For single-source derivations (notNull, equals, etc.) */
|
|
92
|
+
sourcePath?: string;
|
|
93
|
+
/** For multi-source derivations (or, and) */
|
|
94
|
+
sourcePaths?: string[];
|
|
95
|
+
/** The operation that derived this variable */
|
|
96
|
+
operation:
|
|
97
|
+
| 'notNull'
|
|
98
|
+
| 'isNull'
|
|
99
|
+
| 'equals'
|
|
100
|
+
| 'notEquals'
|
|
101
|
+
| 'or'
|
|
102
|
+
| 'and'
|
|
103
|
+
| 'arrayIncludes'
|
|
104
|
+
| 'arraySome'
|
|
105
|
+
| 'arrayEvery'
|
|
106
|
+
| 'arrayLength';
|
|
107
|
+
/** For comparison operations, the value being compared to */
|
|
108
|
+
comparedValue?: string;
|
|
109
|
+
};
|
|
63
110
|
}
|
|
64
111
|
|
|
65
112
|
export interface SerializableDataStructure {
|
|
@@ -83,6 +130,41 @@ export interface SerializableDataStructure {
|
|
|
83
130
|
* the traced source data path.
|
|
84
131
|
*/
|
|
85
132
|
conditionalUsages?: Record<string, EnrichedConditionalUsage[]>;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Conditional effects tracking.
|
|
136
|
+
* Tracks what setter calls happen inside conditionals (if, switch, ternary).
|
|
137
|
+
* Used to auto-generate execution flows from static analysis.
|
|
138
|
+
*/
|
|
139
|
+
conditionalEffects?: ConditionalEffect[];
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Compound conditionals grouped by chain (all conditions must be true together).
|
|
143
|
+
* Used to generate execution flows that satisfy ALL conditions in compound expressions like:
|
|
144
|
+
* (hasNewerVersion || isFromDifferentVersion) && !isAnalyzing && !isQueued
|
|
145
|
+
*/
|
|
146
|
+
compoundConditionals?: CompoundConditional[];
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Gating conditions for child component boundaries.
|
|
150
|
+
* Maps child component name to the conditions that must be true for that child to render.
|
|
151
|
+
*
|
|
152
|
+
* Example:
|
|
153
|
+
* {hasAnalysis && <ScenarioViewer />} would produce:
|
|
154
|
+
* { ScenarioViewer: [{ path: 'hasAnalysis', conditionType: 'truthiness', ... }] }
|
|
155
|
+
*
|
|
156
|
+
* This allows us to merge child component execution flows with parent gating conditions.
|
|
157
|
+
*/
|
|
158
|
+
childBoundaryGatingConditions?: Record<string, EnrichedConditionalUsage[]>;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* JSX rendering usages - tracks arrays rendered via .map() and strings interpolated in JSX.
|
|
162
|
+
* Used to generate execution flows for array sizes and text lengths without explicit conditionals.
|
|
163
|
+
*
|
|
164
|
+
* Example:
|
|
165
|
+
* {items.map(i => <Item {...i} />)} produces an array-map usage for 'items'
|
|
166
|
+
*/
|
|
167
|
+
jsxRenderingUsages?: JsxRenderingUsage[];
|
|
86
168
|
}
|
|
87
169
|
|
|
88
170
|
/**
|
|
@@ -227,3 +309,44 @@ export function getConditionalUsages(
|
|
|
227
309
|
): Record<string, EnrichedConditionalUsage[]> {
|
|
228
310
|
return dataStructure.conditionalUsages ?? {};
|
|
229
311
|
}
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Get conditional effects (setter calls inside conditionals).
|
|
315
|
+
* Returns the array of conditional effects, or empty array if not available.
|
|
316
|
+
*/
|
|
317
|
+
export function getConditionalEffects(
|
|
318
|
+
dataStructure: SerializableDataStructure,
|
|
319
|
+
): ConditionalEffect[] {
|
|
320
|
+
return dataStructure.conditionalEffects ?? [];
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Get compound conditionals (grouped conditions that must all be true).
|
|
325
|
+
* Returns the array of compound conditionals, or empty array if not available.
|
|
326
|
+
*/
|
|
327
|
+
export function getCompoundConditionals(
|
|
328
|
+
dataStructure: SerializableDataStructure,
|
|
329
|
+
): CompoundConditional[] {
|
|
330
|
+
return dataStructure.compoundConditionals ?? [];
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Get child boundary gating conditions.
|
|
335
|
+
* Returns the mapping of child component names to their gating conditions,
|
|
336
|
+
* or empty object if not available.
|
|
337
|
+
*/
|
|
338
|
+
export function getChildBoundaryGatingConditions(
|
|
339
|
+
dataStructure: SerializableDataStructure,
|
|
340
|
+
): Record<string, EnrichedConditionalUsage[]> {
|
|
341
|
+
return dataStructure.childBoundaryGatingConditions ?? {};
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Get JSX rendering usages (arrays rendered via .map() and strings interpolated in JSX).
|
|
346
|
+
* Returns the array of JSX rendering usages, or empty array if not available.
|
|
347
|
+
*/
|
|
348
|
+
export function getJsxRenderingUsages(
|
|
349
|
+
dataStructure: SerializableDataStructure,
|
|
350
|
+
): JsxRenderingUsage[] {
|
|
351
|
+
return dataStructure.jsxRenderingUsages ?? [];
|
|
352
|
+
}
|