@codeyam/codeyam-cli 0.1.0-staging.323686 → 0.1.0-staging.4813bf3
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 +7 -7
- package/analyzer-template/log.txt +3 -3
- package/analyzer-template/package.json +5 -5
- package/analyzer-template/packages/ai/index.ts +7 -1
- package/analyzer-template/packages/ai/package.json +2 -2
- package/analyzer-template/packages/ai/src/lib/analyzeScope.ts +62 -18
- package/analyzer-template/packages/ai/src/lib/astScopes/astScopeAnalyzer.ts +67 -9
- package/analyzer-template/packages/ai/src/lib/astScopes/patterns/forInStatementHandler.ts +10 -17
- package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +409 -50
- package/analyzer-template/packages/ai/src/lib/astScopes/sharedPatterns.ts +28 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/types.ts +21 -6
- package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +992 -249
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.ts +5 -1
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.ts +16 -3
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.ts +6 -4
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.ts +31 -3
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.ts +37 -15
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/coerceObjectsToPrimitivesBySchema.ts +70 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.ts +126 -11
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.ts +179 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.ts +40 -30
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.ts +367 -96
- package/analyzer-template/packages/ai/src/lib/dataStructureChunking.ts +33 -15
- package/analyzer-template/packages/ai/src/lib/generateEntityDataStructure.ts +58 -3
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +315 -6
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarios.ts +9 -5
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +49 -5
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.ts +1 -1
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionals.ts +649 -142
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.ts +1 -1
- package/analyzer-template/packages/ai/src/lib/isolateScopes.ts +51 -3
- package/analyzer-template/packages/ai/src/lib/mergeJsonTypeDefinitions.ts +5 -0
- package/analyzer-template/packages/ai/src/lib/mergeStatements.ts +90 -96
- package/analyzer-template/packages/ai/src/lib/promptGenerators/collapseNullableObjects.ts +118 -0
- package/analyzer-template/packages/ai/src/lib/promptGenerators/gatherAttributesMap.ts +10 -7
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.ts +24 -4
- package/analyzer-template/packages/ai/src/lib/resolvePathToControllable.ts +25 -13
- package/analyzer-template/packages/ai/src/lib/worker/SerializableDataStructure.ts +4 -3
- package/analyzer-template/packages/analyze/index.ts +2 -0
- package/analyzer-template/packages/analyze/src/lib/FileAnalyzer.ts +65 -59
- package/analyzer-template/packages/analyze/src/lib/ProjectAnalyzer.ts +113 -26
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.ts +19 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllEntityNodes.ts +19 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllExports.ts +11 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getImportsAnalysis.ts +8 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getResolvedModule.ts +49 -1
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getSourceFilesForAllImports.ts +2 -1
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +89 -9
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +19 -4
- package/analyzer-template/packages/analyze/src/lib/files/analyze/gatherEntityMap.ts +4 -2
- package/analyzer-template/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.ts +0 -3
- package/analyzer-template/packages/analyze/src/lib/files/analyzeRemixRoute.ts +4 -5
- package/analyzer-template/packages/analyze/src/lib/files/getImportedExports.ts +14 -12
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/TransformationTracer.ts +1315 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.ts +61 -13
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.ts +37 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +229 -19
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.ts +117 -9
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +459 -39
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/propagateArrayItemSchemas.ts +474 -0
- package/analyzer-template/packages/analyze/src/lib/files/setImportedExports.ts +2 -1
- package/analyzer-template/packages/analyze/src/lib/index.ts +1 -0
- package/analyzer-template/packages/analyze/src/lib/utils/getFileByPath.ts +19 -0
- package/analyzer-template/packages/aws/package.json +1 -1
- package/analyzer-template/packages/database/package.json +1 -1
- package/analyzer-template/packages/database/src/lib/analysisBranchToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/analysisToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/branchToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/commitBranchToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/commitToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/fileToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/kysely/db.ts +6 -0
- package/analyzer-template/packages/database/src/lib/kysely/tables/debugReportsTable.ts +1 -1
- package/analyzer-template/packages/database/src/lib/kysely/tables/labsRequestsTable.ts +52 -0
- package/analyzer-template/packages/database/src/lib/projectToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/saveFiles.ts +1 -1
- package/analyzer-template/packages/database/src/lib/scenarioToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/userScenarioToDb.ts +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/analysisBranchToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/analysisBranchToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/analysisToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/analysisToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/branchToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/branchToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/commitBranchToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/commitBranchToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/commitToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/commitToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/fileToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/fileToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts +2 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js +3 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.d.ts +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.d.ts +23 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.d.ts.map +1 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.js +35 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.js.map +1 -0
- package/analyzer-template/packages/github/dist/database/src/lib/projectToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/projectToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/saveFiles.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/saveFiles.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/scenarioToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/scenarioToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/ProjectMetadata.d.ts +7 -0
- package/analyzer-template/packages/github/dist/types/src/types/ProjectMetadata.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts +5 -5
- package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/ScopeAnalysis.d.ts +6 -1
- package/analyzer-template/packages/github/dist/types/src/types/ScopeAnalysis.d.ts.map +1 -1
- package/analyzer-template/packages/github/package.json +1 -1
- package/analyzer-template/packages/types/src/types/ProjectMetadata.ts +7 -0
- package/analyzer-template/packages/types/src/types/ScenariosDataStructure.ts +6 -5
- package/analyzer-template/packages/types/src/types/ScopeAnalysis.ts +6 -1
- package/analyzer-template/packages/utils/dist/types/src/types/ProjectMetadata.d.ts +7 -0
- package/analyzer-template/packages/utils/dist/types/src/types/ProjectMetadata.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts +5 -5
- package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/ScopeAnalysis.d.ts +6 -1
- package/analyzer-template/packages/utils/dist/types/src/types/ScopeAnalysis.d.ts.map +1 -1
- package/analyzer-template/project/constructMockCode.ts +90 -10
- package/analyzer-template/project/writeMockDataTsx.ts +181 -8
- package/analyzer-template/project/writeScenarioComponents.ts +60 -12
- package/analyzer-template/project/writeSimpleRoot.ts +21 -11
- package/background/src/lib/local/createLocalAnalyzer.js +1 -1
- package/background/src/lib/local/createLocalAnalyzer.js.map +1 -1
- package/background/src/lib/virtualized/project/constructMockCode.js +75 -4
- package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
- package/background/src/lib/virtualized/project/writeMockDataTsx.js +162 -4
- package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
- package/background/src/lib/virtualized/project/writeScenarioComponents.js +60 -15
- package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
- package/background/src/lib/virtualized/project/writeSimpleRoot.js +21 -11
- package/background/src/lib/virtualized/project/writeSimpleRoot.js.map +1 -1
- package/codeyam-cli/scripts/apply-setup.js +180 -0
- package/codeyam-cli/scripts/apply-setup.js.map +1 -1
- package/codeyam-cli/src/cli.js +2 -0
- package/codeyam-cli/src/cli.js.map +1 -1
- package/codeyam-cli/src/codeyam-cli.js +18 -2
- package/codeyam-cli/src/codeyam-cli.js.map +1 -1
- package/codeyam-cli/src/commands/analyze.js +4 -2
- package/codeyam-cli/src/commands/analyze.js.map +1 -1
- package/codeyam-cli/src/commands/baseline.js +2 -0
- package/codeyam-cli/src/commands/baseline.js.map +1 -1
- package/codeyam-cli/src/commands/debug.js +9 -5
- package/codeyam-cli/src/commands/debug.js.map +1 -1
- package/codeyam-cli/src/commands/default.js +31 -20
- package/codeyam-cli/src/commands/default.js.map +1 -1
- package/codeyam-cli/src/commands/detect-universal-mocks.js +2 -0
- package/codeyam-cli/src/commands/detect-universal-mocks.js.map +1 -1
- package/codeyam-cli/src/commands/init.js +49 -257
- package/codeyam-cli/src/commands/init.js.map +1 -1
- package/codeyam-cli/src/commands/memory.js +17 -26
- package/codeyam-cli/src/commands/memory.js.map +1 -1
- package/codeyam-cli/src/commands/recapture.js +2 -0
- package/codeyam-cli/src/commands/recapture.js.map +1 -1
- package/codeyam-cli/src/commands/setup-sandbox.js +2 -0
- package/codeyam-cli/src/commands/setup-sandbox.js.map +1 -1
- package/codeyam-cli/src/commands/setup-simulations.js +284 -0
- package/codeyam-cli/src/commands/setup-simulations.js.map +1 -0
- package/codeyam-cli/src/commands/test-startup.js +2 -0
- package/codeyam-cli/src/commands/test-startup.js.map +1 -1
- package/codeyam-cli/src/commands/verify.js +14 -2
- package/codeyam-cli/src/commands/verify.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +128 -86
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
- package/codeyam-cli/src/utils/analyzer.js +7 -0
- package/codeyam-cli/src/utils/analyzer.js.map +1 -1
- package/codeyam-cli/src/utils/backgroundServer.js +5 -0
- package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/utils/generateReport.js +2 -2
- package/codeyam-cli/src/utils/install-skills.js +70 -45
- package/codeyam-cli/src/utils/install-skills.js.map +1 -1
- package/codeyam-cli/src/utils/labsAutoCheck.js +19 -0
- package/codeyam-cli/src/utils/labsAutoCheck.js.map +1 -0
- package/codeyam-cli/src/utils/progress.js +7 -0
- package/codeyam-cli/src/utils/progress.js.map +1 -1
- package/codeyam-cli/src/utils/queue/job.js +4 -0
- package/codeyam-cli/src/utils/queue/job.js.map +1 -1
- package/codeyam-cli/src/utils/requireSimulations.js +10 -0
- package/codeyam-cli/src/utils/requireSimulations.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/confusionDetector.test.js +82 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/confusionDetector.test.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/contextBuilder.test.js +230 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/contextBuilder.test.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/assertRules.js +67 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/assertRules.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/captureFixture.js +105 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/captureFixture.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/loadCapturedFixture.js +34 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/loadCapturedFixture.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/runClaude.js +162 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/runClaude.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/setupTempProject.js +75 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/setupTempProject.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/ruleReflectionE2E.test.js +378 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/ruleReflectionE2E.test.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.js +115 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/transcriptParser.test.js +127 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/transcriptParser.test.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/confusionDetector.js +50 -0
- package/codeyam-cli/src/utils/ruleReflection/confusionDetector.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/contextBuilder.js +116 -0
- package/codeyam-cli/src/utils/ruleReflection/contextBuilder.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/index.js +5 -0
- package/codeyam-cli/src/utils/ruleReflection/index.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/promptBuilder.js +44 -0
- package/codeyam-cli/src/utils/ruleReflection/promptBuilder.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/transcriptParser.js +85 -0
- package/codeyam-cli/src/utils/ruleReflection/transcriptParser.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/types.js +5 -0
- package/codeyam-cli/src/utils/ruleReflection/types.js.map +1 -0
- package/codeyam-cli/src/utils/rules/__tests__/ruleState.test.js +293 -0
- package/codeyam-cli/src/utils/rules/__tests__/ruleState.test.js.map +1 -0
- package/codeyam-cli/src/utils/rules/index.js +1 -0
- package/codeyam-cli/src/utils/rules/index.js.map +1 -1
- package/codeyam-cli/src/utils/rules/parser.js +2 -25
- package/codeyam-cli/src/utils/rules/parser.js.map +1 -1
- package/codeyam-cli/src/utils/rules/ruleState.js +150 -0
- package/codeyam-cli/src/utils/rules/ruleState.js.map +1 -0
- package/codeyam-cli/src/utils/rules/staleness.js +16 -11
- package/codeyam-cli/src/utils/rules/staleness.js.map +1 -1
- package/codeyam-cli/src/utils/serverState.js +37 -10
- package/codeyam-cli/src/utils/serverState.js.map +1 -1
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +21 -44
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
- package/codeyam-cli/src/webserver/app/lib/database.js +15 -3
- package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
- package/codeyam-cli/src/webserver/backgroundServer.js +24 -0
- package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/CopyButton-CA3JxPb7.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-DsN1wKrm.js → EntityItem-B86KKU7e.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-DLqD3qNt.js → EntityTypeBadge-B5ctlSYt.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-Ba2JVPzP.js → EntityTypeIcon-BqY8gDAW.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{InlineSpinner-C8lyxW9k.js → InlineSpinner-ClaLpuOo.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-aht4aafF.js → InteractivePreview-BDhPilK7.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-CVtiBnY5.js → LibraryFunctionPreview-VeqEBv9v.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-B0GLXMsr.js → LoadingDots-Bs7Nn1Jr.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-xgeCVgSM.js → LogViewer-Bm3PmcCz.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-OApQuNyq.js → ReportIssueModal-CgMEzchJ.js} +3 -8
- package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-DuDvi0jm.js → SafeScreenshot-Gq3Ocjo6.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-DzccYyI8.js → ScenarioViewer-CBui0id_.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-DyFZkK0l.js → TruncatedFilePath-CiwXDxLh.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{_index-BwqWJOgH.js → _index-B3TDXxnk.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-BwavGCpm.js → activity.(_tab)-BtBFH820.js} +6 -11
- package/codeyam-cli/src/webserver/build/client/assets/agent-transcripts-CN61MOMa.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.agent-transcripts-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.labs-unlock-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.save-fixture-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/book-open-PttOB2SF.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-Cx24_aWc.js → chevron-down-TJp6ofnp.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{chunk-EPOLDU6W-CXRTFQ3F.js → chunk-JZWAC4HX-JE9ZIoBl.js} +12 -12
- package/codeyam-cli/src/webserver/build/client/assets/{circle-check-BOARzkeR.js → circle-check-CXhHQYrI.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/copy-6y9ALfGT.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-BdhJEx6B.js → createLucideIcon-Ca9fAY46.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{dev.empty-BBnGWYga.js → dev.empty-C0epRiVn.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-BJUiQqZF.js → entity._sha._-BVnB8a9L.js} +10 -10
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha.scenarios._scenarioId.fullscreen-DavjRmOY.js → entity._sha.scenarios._scenarioId.fullscreen-CBoafmVs.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.create-scenario-D1T4TGjf.js → entity._sha_.create-scenario-DGgZjdFg.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-CTBG2mmz.js → entity._sha_.edit._scenarioId-38yPijoD.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entry.client-CS2cb_eZ.js → entry.client-BSHEfydn.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{fileTableUtils-DMJ7zii9.js → fileTableUtils-DCPhhSMo.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{files-CJ6lTdTA.js → files-0N0YJQv7.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{git-CPTZZ-JZ.js → git-DXnyr8uP.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/globals-CKT08Djd.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{index-lzqtyFU8.js → index-CcsFv748.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{index-B1h680n5.js → index-ChN9-fAY.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/labs-BLJ7HxOC.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-B7B9V-bu.js → loader-circle-CTqLEAGU.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-b171b9d3.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/memory-CCQd4aZA.js +78 -0
- package/codeyam-cli/src/webserver/build/client/assets/pause-D6vreykR.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/root-CHhiHoo_.js +62 -0
- package/codeyam-cli/src/webserver/build/client/assets/{search-CxXUmBSd.js → search-B8VUL8nl.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/settings-BejnUJ6R.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{simulations-DwFIBT09.js → simulations-CPoAg7Zo.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/terminal-BrCP7uQo.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-B6LgvRJg.js → triangle-alert-BZz2NjYa.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useCustomSizes-C1v1PQzo.js → useCustomSizes-DNwUduNu.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-aSv48UbS.js → useLastLogLine-COky1GVF.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useReportContext-DYxHZQuP.js → useReportContext-CpZgwliL.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useToast-mBRpZPiu.js → useToast-Bv9JFvUO.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/{index-DVzYx8PN.js → index-8Fv-lH1-.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-Akn3iYFP.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/templates/{codeyam:debug.md → codeyam-debug.md} +1 -1
- package/codeyam-cli/templates/codeyam-diagnose.md +481 -0
- package/codeyam-cli/templates/codeyam-memory-hook.sh +19 -20
- package/codeyam-cli/templates/codeyam-memory.md +392 -0
- package/codeyam-cli/templates/codeyam-new-rule.md +13 -0
- package/codeyam-cli/templates/{codeyam:setup.md → codeyam-setup.md} +13 -1
- package/codeyam-cli/templates/{codeyam:sim.md → codeyam-sim.md} +1 -1
- package/codeyam-cli/templates/{codeyam:test.md → codeyam-test.md} +1 -1
- package/codeyam-cli/templates/{codeyam:verify.md → codeyam-verify.md} +1 -1
- package/codeyam-cli/templates/rule-notification-hook.py +56 -0
- package/codeyam-cli/templates/rule-reflection-hook.py +627 -0
- package/codeyam-cli/templates/rules-instructions.md +132 -0
- package/package.json +2 -2
- package/packages/ai/index.js +3 -2
- package/packages/ai/index.js.map +1 -1
- package/packages/ai/src/lib/analyzeScope.js +50 -13
- package/packages/ai/src/lib/analyzeScope.js.map +1 -1
- package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js +54 -8
- package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js.map +1 -1
- package/packages/ai/src/lib/astScopes/patterns/forInStatementHandler.js +10 -14
- package/packages/ai/src/lib/astScopes/patterns/forInStatementHandler.js.map +1 -1
- package/packages/ai/src/lib/astScopes/processExpression.js +317 -44
- package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
- package/packages/ai/src/lib/astScopes/sharedPatterns.js +25 -0
- package/packages/ai/src/lib/astScopes/sharedPatterns.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +763 -171
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js +5 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.js +13 -3
- package/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.js +6 -4
- package/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js +33 -3
- package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js +36 -11
- package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/coerceObjectsToPrimitivesBySchema.js +63 -0
- package/packages/ai/src/lib/dataStructure/helpers/coerceObjectsToPrimitivesBySchema.js.map +1 -0
- package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js +113 -11
- package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.js +173 -0
- package/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.js.map +1 -0
- package/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.js +37 -20
- package/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js +309 -84
- package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js.map +1 -1
- package/packages/ai/src/lib/dataStructureChunking.js +26 -11
- package/packages/ai/src/lib/dataStructureChunking.js.map +1 -1
- package/packages/ai/src/lib/generateEntityDataStructure.js +46 -2
- package/packages/ai/src/lib/generateEntityDataStructure.js.map +1 -1
- package/packages/ai/src/lib/generateEntityScenarioData.js +227 -4
- package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
- package/packages/ai/src/lib/generateEntityScenarios.js +7 -1
- package/packages/ai/src/lib/generateEntityScenarios.js.map +1 -1
- package/packages/ai/src/lib/generateExecutionFlows.js +26 -4
- package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -1
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js +447 -80
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js.map +1 -1
- package/packages/ai/src/lib/isolateScopes.js +39 -3
- package/packages/ai/src/lib/isolateScopes.js.map +1 -1
- package/packages/ai/src/lib/mergeJsonTypeDefinitions.js +5 -0
- package/packages/ai/src/lib/mergeJsonTypeDefinitions.js.map +1 -1
- package/packages/ai/src/lib/mergeStatements.js +70 -51
- package/packages/ai/src/lib/mergeStatements.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/collapseNullableObjects.js +97 -0
- package/packages/ai/src/lib/promptGenerators/collapseNullableObjects.js.map +1 -0
- package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js +10 -4
- package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js +17 -2
- package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js.map +1 -1
- package/packages/ai/src/lib/resolvePathToControllable.js +24 -14
- package/packages/ai/src/lib/resolvePathToControllable.js.map +1 -1
- package/packages/ai/src/lib/worker/SerializableDataStructure.js.map +1 -1
- package/packages/analyze/index.js +1 -0
- package/packages/analyze/index.js.map +1 -1
- package/packages/analyze/src/lib/FileAnalyzer.js +60 -36
- package/packages/analyze/src/lib/FileAnalyzer.js.map +1 -1
- package/packages/analyze/src/lib/ProjectAnalyzer.js +96 -26
- package/packages/analyze/src/lib/ProjectAnalyzer.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.js +14 -0
- package/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getAllEntityNodes.js +14 -0
- package/packages/analyze/src/lib/asts/sourceFiles/getAllEntityNodes.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getAllExports.js +6 -0
- package/packages/analyze/src/lib/asts/sourceFiles/getAllExports.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getImportsAnalysis.js +6 -0
- package/packages/analyze/src/lib/asts/sourceFiles/getImportsAnalysis.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getResolvedModule.js +39 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getResolvedModule.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getSourceFilesForAllImports.js +2 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getSourceFilesForAllImports.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +65 -7
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +17 -4
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js +2 -1
- package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js +0 -3
- package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeRemixRoute.js +3 -2
- package/packages/analyze/src/lib/files/analyzeRemixRoute.js.map +1 -1
- package/packages/analyze/src/lib/files/getImportedExports.js +11 -7
- package/packages/analyze/src/lib/files/getImportedExports.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js +880 -0
- package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js.map +1 -0
- package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js +56 -10
- package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js +33 -8
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +150 -17
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js +56 -8
- package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +399 -31
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/files/setImportedExports.js +2 -1
- package/packages/analyze/src/lib/files/setImportedExports.js.map +1 -1
- package/packages/analyze/src/lib/index.js +1 -0
- package/packages/analyze/src/lib/index.js.map +1 -1
- package/packages/analyze/src/lib/utils/getFileByPath.js +12 -0
- package/packages/analyze/src/lib/utils/getFileByPath.js.map +1 -0
- package/packages/database/src/lib/analysisBranchToDb.js +1 -1
- package/packages/database/src/lib/analysisBranchToDb.js.map +1 -1
- package/packages/database/src/lib/analysisToDb.js +1 -1
- package/packages/database/src/lib/analysisToDb.js.map +1 -1
- package/packages/database/src/lib/branchToDb.js +1 -1
- package/packages/database/src/lib/branchToDb.js.map +1 -1
- package/packages/database/src/lib/commitBranchToDb.js +1 -1
- package/packages/database/src/lib/commitBranchToDb.js.map +1 -1
- package/packages/database/src/lib/commitToDb.js +1 -1
- package/packages/database/src/lib/commitToDb.js.map +1 -1
- package/packages/database/src/lib/fileToDb.js +1 -1
- package/packages/database/src/lib/fileToDb.js.map +1 -1
- package/packages/database/src/lib/kysely/db.js +3 -0
- package/packages/database/src/lib/kysely/db.js.map +1 -1
- package/packages/database/src/lib/kysely/tables/labsRequestsTable.js +35 -0
- package/packages/database/src/lib/kysely/tables/labsRequestsTable.js.map +1 -0
- package/packages/database/src/lib/projectToDb.js +1 -1
- package/packages/database/src/lib/projectToDb.js.map +1 -1
- package/packages/database/src/lib/saveFiles.js +1 -1
- package/packages/database/src/lib/saveFiles.js.map +1 -1
- package/packages/database/src/lib/scenarioToDb.js +1 -1
- package/packages/database/src/lib/scenarioToDb.js.map +1 -1
- package/scripts/finalize-analyzer.cjs +8 -76
- package/codeyam-cli/src/webserver/build/client/assets/copy-Bb-80kDT.js +0 -6
- package/codeyam-cli/src/webserver/build/client/assets/file-code-Dhef1kWN.js +0 -6
- package/codeyam-cli/src/webserver/build/client/assets/globals-D3yhhV8x.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-7522edd4.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/memory-yxFcrxBX.js +0 -92
- package/codeyam-cli/src/webserver/build/client/assets/root-eVAaavTS.js +0 -62
- package/codeyam-cli/src/webserver/build/client/assets/settings-CS5f3WzT.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-4Cr0uToj.js +0 -257
- package/codeyam-cli/templates/codeyam:diagnose.md +0 -803
- package/codeyam-cli/templates/codeyam:memory.md +0 -462
- package/codeyam-cli/templates/codeyam:new-rule.md +0 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forInStatementHandler.js","sourceRoot":"","sources":["../../../../../../../../packages/ai/src/lib/astScopes/patterns/forInStatementHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C;;;;;;;GAOG;AACH,MAAM,OAAO,qBAAqB;IAChC,SAAS,CAAC,IAAa;QACrB,OAAO,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,OAAO,CAAC,IAAa,EAAE,OAAwB;QAC7C,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC;YAAE,OAAO,KAAK,CAAC;QAE7C,kEAAkE;QAClE,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAE3C,
|
|
1
|
+
{"version":3,"file":"forInStatementHandler.js","sourceRoot":"","sources":["../../../../../../../../packages/ai/src/lib/astScopes/patterns/forInStatementHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C;;;;;;;GAOG;AACH,MAAM,OAAO,qBAAqB;IAChC,SAAS,CAAC,IAAa;QACrB,OAAO,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,OAAO,CAAC,IAAa,EAAE,OAAwB;QAC7C,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC;YAAE,OAAO,KAAK,CAAC;QAE7C,kEAAkE;QAClE,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAE3C,mEAAmE;QACnE,2DAA2D;QAC3D,IAAI,EAAE,CAAC,yBAAyB,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;YACnD,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC;YACnD,IACE,YAAY,CAAC,MAAM,KAAK,CAAC;gBACzB,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI;gBACpB,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EACrC,CAAC;gBACD,MAAM,YAAY,GAAG,cAAc,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAExE,sEAAsE;gBACtE,gEAAgE;gBAChE,iEAAiE;gBACjE,qEAAqE;gBACrE,uEAAuE;gBACvE,kEAAkE;gBAClE,gEAAgE;gBAChE,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;YAC1C,CAAC;QACH,CAAC;aAAM,IAAI,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;YAC7C,mEAAmE;YACnE,MAAM,YAAY,GAAG,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YAEpE,yEAAyE;YACzE,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;QAC1C,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC9C,CAAC;QAED,wBAAwB;QACxB,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAEpC,gDAAgD;QAChD,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
@@ -3,10 +3,144 @@ import * as crypto from 'crypto';
|
|
|
3
3
|
import { StructuredPath } from "./paths.js";
|
|
4
4
|
import { nodeToSource } from "./nodeToSource.js";
|
|
5
5
|
import { methodRegistry, ArrayPushSemantics } from "./methodSemantics.js";
|
|
6
|
-
import { isArithmeticOperator, isAssignmentOperator, isBitwiseCompoundOperator, isComparisonOperator, isDefinedType, isNumericCompoundOperator, leftOrRightType, unwrapExpression, } from "./sharedPatterns.js";
|
|
6
|
+
import { getComparisonOperatorString, isArithmeticOperator, isAssignmentOperator, isBitwiseCompoundOperator, isComparisonOperator, isDefinedType, isNumericCompoundOperator, leftOrRightType, unwrapExpression, } from "./sharedPatterns.js";
|
|
7
7
|
import { processBindingPattern } from "./processBindings.js";
|
|
8
8
|
import { extractConditionalEffectsFromTernary, findUseStateSetters, } from "./conditionalEffectsExtractor.js";
|
|
9
9
|
import { detectArrayDerivedPattern } from "./arrayDerivationDetector.js";
|
|
10
|
+
/**
|
|
11
|
+
* Recursively extracts root variable names from an expression AST node.
|
|
12
|
+
* Used to identify which variables flow into JSX expression children,
|
|
13
|
+
* so we can link them to the return value schema.
|
|
14
|
+
*
|
|
15
|
+
* Examples:
|
|
16
|
+
* - `filteredTopPaths.map(...)` → ['filteredTopPaths']
|
|
17
|
+
* - `a && b` → ['a', 'b']
|
|
18
|
+
* - `condition ? x : y` → ['condition', 'x', 'y']
|
|
19
|
+
*/
|
|
20
|
+
function extractRootVariableNames(node) {
|
|
21
|
+
const ignoredIdentifiers = new Set([
|
|
22
|
+
'undefined',
|
|
23
|
+
'null',
|
|
24
|
+
'true',
|
|
25
|
+
'false',
|
|
26
|
+
'NaN',
|
|
27
|
+
'Infinity',
|
|
28
|
+
]);
|
|
29
|
+
if (ts.isIdentifier(node)) {
|
|
30
|
+
const name = node.text;
|
|
31
|
+
return ignoredIdentifiers.has(name) ? [] : [name];
|
|
32
|
+
}
|
|
33
|
+
if (ts.isPropertyAccessExpression(node)) {
|
|
34
|
+
return extractRootVariableNames(node.expression);
|
|
35
|
+
}
|
|
36
|
+
if (ts.isCallExpression(node)) {
|
|
37
|
+
return extractRootVariableNames(node.expression);
|
|
38
|
+
}
|
|
39
|
+
if (ts.isBinaryExpression(node)) {
|
|
40
|
+
return [
|
|
41
|
+
...extractRootVariableNames(node.left),
|
|
42
|
+
...extractRootVariableNames(node.right),
|
|
43
|
+
];
|
|
44
|
+
}
|
|
45
|
+
if (ts.isPrefixUnaryExpression(node)) {
|
|
46
|
+
return extractRootVariableNames(node.operand);
|
|
47
|
+
}
|
|
48
|
+
if (ts.isConditionalExpression(node)) {
|
|
49
|
+
return [
|
|
50
|
+
...extractRootVariableNames(node.condition),
|
|
51
|
+
...extractRootVariableNames(node.whenTrue),
|
|
52
|
+
...extractRootVariableNames(node.whenFalse),
|
|
53
|
+
];
|
|
54
|
+
}
|
|
55
|
+
if (ts.isParenthesizedExpression(node)) {
|
|
56
|
+
return extractRootVariableNames(node.expression);
|
|
57
|
+
}
|
|
58
|
+
// Stop recursion at JSX elements and other terminal nodes
|
|
59
|
+
if (ts.isJsxElement(node) ||
|
|
60
|
+
ts.isJsxFragment(node) ||
|
|
61
|
+
ts.isJsxSelfClosingElement(node)) {
|
|
62
|
+
return [];
|
|
63
|
+
}
|
|
64
|
+
return [];
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Checks if a JSX element has props that reference variables from the parent scope.
|
|
68
|
+
* This is used to detect unconditionally-rendered children that should have their
|
|
69
|
+
* execution flows merged into the parent.
|
|
70
|
+
*
|
|
71
|
+
* We want to track children where the parent controls data that affects the child's
|
|
72
|
+
* conditional rendering. Static props (like title="Dashboard") don't need tracking
|
|
73
|
+
* because they don't create variable execution flows.
|
|
74
|
+
*
|
|
75
|
+
* Examples:
|
|
76
|
+
* - <WorkoutsView workouts={workouts} /> → true (workouts is a variable)
|
|
77
|
+
* - <ItemList items={items} count={count} /> → true (items, count are variables)
|
|
78
|
+
* - <Header title="Dashboard" /> → false (static string)
|
|
79
|
+
* - <Footer /> → false (no props)
|
|
80
|
+
* - <Button onClick={handleClick} /> → false (only callback, no data props)
|
|
81
|
+
*
|
|
82
|
+
* @returns true if the component has at least one prop that references a variable
|
|
83
|
+
* (excluding callbacks which typically start with 'on' or 'handle')
|
|
84
|
+
*/
|
|
85
|
+
function hasDataPropsFromParent(node, componentName) {
|
|
86
|
+
const attributes = ts.isJsxElement(node)
|
|
87
|
+
? node.openingElement.attributes.properties
|
|
88
|
+
: node.attributes.properties;
|
|
89
|
+
const dataProps = [];
|
|
90
|
+
for (const attr of attributes) {
|
|
91
|
+
// Spread attributes always reference parent data: {...props}
|
|
92
|
+
if (ts.isJsxSpreadAttribute(attr)) {
|
|
93
|
+
const spreadText = attr.expression?.getText() || '...spread';
|
|
94
|
+
dataProps.push(`{...${spreadText}}`);
|
|
95
|
+
console.log(`[UnconditionalChild] ${componentName}: Found spread attribute {${spreadText}}`);
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
if (ts.isJsxAttribute(attr)) {
|
|
99
|
+
const propName = attr.name.getText();
|
|
100
|
+
// Skip callback props - they don't create data-driven execution flows
|
|
101
|
+
// Callbacks typically start with 'on' (onClick, onChange) or 'handle' (handleSubmit)
|
|
102
|
+
if (propName.startsWith('on') ||
|
|
103
|
+
propName.startsWith('handle') ||
|
|
104
|
+
propName === 'ref') {
|
|
105
|
+
console.log(`[UnconditionalChild] ${componentName}: Skipping callback prop '${propName}'`);
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
// Check if the prop value is a JSX expression (references a variable)
|
|
109
|
+
// vs a string literal which is static
|
|
110
|
+
if (attr.initializer) {
|
|
111
|
+
if (ts.isJsxExpression(attr.initializer)) {
|
|
112
|
+
// JSX expression like prop={value} - this references a variable
|
|
113
|
+
// Could be a simple identifier, property access, or more complex expression
|
|
114
|
+
const expression = attr.initializer.expression;
|
|
115
|
+
if (expression) {
|
|
116
|
+
// Skip if it's just a function/arrow function (callback)
|
|
117
|
+
if (ts.isArrowFunction(expression) ||
|
|
118
|
+
ts.isFunctionExpression(expression)) {
|
|
119
|
+
console.log(`[UnconditionalChild] ${componentName}: Skipping inline callback prop '${propName}'`);
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
// This is a data prop that references parent state/props
|
|
123
|
+
const exprText = expression.getText();
|
|
124
|
+
dataProps.push(`${propName}={${exprText}}`);
|
|
125
|
+
console.log(`[UnconditionalChild] ${componentName}: Found data prop '${propName}' = {${exprText}}`);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
// String literals like prop="value" are static
|
|
130
|
+
console.log(`[UnconditionalChild] ${componentName}: Skipping static prop '${propName}'`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
const hasDataProps = dataProps.length > 0;
|
|
136
|
+
if (hasDataProps) {
|
|
137
|
+
console.log(`[UnconditionalChild] ${componentName}: Has ${dataProps.length} data props: [${dataProps.join(', ')}]`);
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
console.log(`[UnconditionalChild] ${componentName}: No data props found, will NOT track`);
|
|
141
|
+
}
|
|
142
|
+
return { hasDataProps, dataProps };
|
|
143
|
+
}
|
|
10
144
|
/**
|
|
11
145
|
* Extracts the component name from a JSX element.
|
|
12
146
|
* Returns null for intrinsic elements (div, span, etc.) since we only care about
|
|
@@ -690,18 +824,40 @@ function extractConditionalsFromJsx(node, context, parentConditions = []) {
|
|
|
690
824
|
// Recursively process nested JSX elements - Fix 32: pass parent conditions
|
|
691
825
|
else if (ts.isJsxElement(child)) {
|
|
692
826
|
// Check if this is a user-defined component (vs intrinsic element like div)
|
|
693
|
-
// If it's a component AND there are parent conditions, record the gating conditions
|
|
694
827
|
const componentName = getComponentNameFromJsx(child);
|
|
695
|
-
if (componentName
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
828
|
+
if (componentName) {
|
|
829
|
+
if (parentConditions.length > 0) {
|
|
830
|
+
// If there are parent conditions, record them as gating conditions
|
|
831
|
+
console.log(`[ChildBoundary] ${componentName}: Conditionally rendered with ${parentConditions.length} gating conditions`);
|
|
832
|
+
for (const condition of parentConditions) {
|
|
833
|
+
console.log(`[ChildBoundary] ${componentName}: Adding gating condition path='${condition.path}' isNegated=${condition.isNegated}`);
|
|
834
|
+
context.addChildBoundaryGatingCondition(componentName, {
|
|
835
|
+
path: condition.path,
|
|
836
|
+
conditionType: 'truthiness',
|
|
837
|
+
location: 'ternary',
|
|
838
|
+
sourceLocation: condition.sourceLocation,
|
|
839
|
+
controlsJsxRendering: true,
|
|
840
|
+
isNegated: condition.isNegated,
|
|
841
|
+
});
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
else {
|
|
845
|
+
// No parent conditions - check if it has data props for unconditional tracking
|
|
846
|
+
console.log(`[ChildBoundary] ${componentName}: Checking for unconditional rendering with data props...`);
|
|
847
|
+
const { hasDataProps, dataProps } = hasDataPropsFromParent(child, componentName);
|
|
848
|
+
if (hasDataProps) {
|
|
849
|
+
// Fix: Track unconditionally-rendered children that receive data props
|
|
850
|
+
// These need to be tracked for flow merging even without gating conditions
|
|
851
|
+
// Example: <WorkoutsView workouts={workouts} /> - parent controls workouts data
|
|
852
|
+
console.log(`[ChildBoundary] ${componentName}: TRACKING as unconditionally-rendered with data props: [${dataProps.join(', ')}]`);
|
|
853
|
+
context.addChildBoundaryGatingCondition(componentName, {
|
|
854
|
+
path: '__unconditional__',
|
|
855
|
+
conditionType: 'truthiness',
|
|
856
|
+
location: 'unconditional',
|
|
857
|
+
controlsJsxRendering: true,
|
|
858
|
+
isNegated: false,
|
|
859
|
+
});
|
|
860
|
+
}
|
|
705
861
|
}
|
|
706
862
|
}
|
|
707
863
|
extractConditionalsFromJsx(child, context, parentConditions);
|
|
@@ -709,18 +865,38 @@ function extractConditionalsFromJsx(node, context, parentConditions = []) {
|
|
|
709
865
|
// Handle self-closing JSX elements (e.g., <ScenarioViewer />)
|
|
710
866
|
else if (ts.isJsxSelfClosingElement(child)) {
|
|
711
867
|
// Check if this is a user-defined component (vs intrinsic element like div)
|
|
712
|
-
// If it's a component AND there are parent conditions, record the gating conditions
|
|
713
868
|
const componentName = getComponentNameFromJsx(child);
|
|
714
|
-
if (componentName
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
869
|
+
if (componentName) {
|
|
870
|
+
if (parentConditions.length > 0) {
|
|
871
|
+
// If there are parent conditions, record them as gating conditions
|
|
872
|
+
console.log(`[ChildBoundary] ${componentName}: Conditionally rendered (self-closing) with ${parentConditions.length} gating conditions`);
|
|
873
|
+
for (const condition of parentConditions) {
|
|
874
|
+
console.log(`[ChildBoundary] ${componentName}: Adding gating condition path='${condition.path}' isNegated=${condition.isNegated}`);
|
|
875
|
+
context.addChildBoundaryGatingCondition(componentName, {
|
|
876
|
+
path: condition.path,
|
|
877
|
+
conditionType: 'truthiness',
|
|
878
|
+
location: 'ternary',
|
|
879
|
+
sourceLocation: condition.sourceLocation,
|
|
880
|
+
controlsJsxRendering: true,
|
|
881
|
+
isNegated: condition.isNegated,
|
|
882
|
+
});
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
else {
|
|
886
|
+
// No parent conditions - check if it has data props for unconditional tracking
|
|
887
|
+
console.log(`[ChildBoundary] ${componentName}: Checking for unconditional rendering (self-closing) with data props...`);
|
|
888
|
+
const { hasDataProps, dataProps } = hasDataPropsFromParent(child, componentName);
|
|
889
|
+
if (hasDataProps) {
|
|
890
|
+
// Fix: Track unconditionally-rendered children that receive data props
|
|
891
|
+
console.log(`[ChildBoundary] ${componentName}: TRACKING as unconditionally-rendered (self-closing) with data props: [${dataProps.join(', ')}]`);
|
|
892
|
+
context.addChildBoundaryGatingCondition(componentName, {
|
|
893
|
+
path: '__unconditional__',
|
|
894
|
+
conditionType: 'truthiness',
|
|
895
|
+
location: 'unconditional',
|
|
896
|
+
controlsJsxRendering: true,
|
|
897
|
+
isNegated: false,
|
|
898
|
+
});
|
|
899
|
+
}
|
|
724
900
|
}
|
|
725
901
|
}
|
|
726
902
|
// Self-closing elements have no children, so no recursion needed
|
|
@@ -846,6 +1022,8 @@ export function extractConditionalUsage(condition, context, location, options =
|
|
|
846
1022
|
}
|
|
847
1023
|
return literalValue;
|
|
848
1024
|
};
|
|
1025
|
+
// Get the comparison operator string for the compound condition
|
|
1026
|
+
const comparisonOperator = getComparisonOperatorString(unwrapped.operatorToken.kind);
|
|
849
1027
|
// Helper to add a condition
|
|
850
1028
|
const addCondition = (path, conditionType, comparedValues, requiredValue, sourceExpr) => {
|
|
851
1029
|
const usage = {
|
|
@@ -881,6 +1059,7 @@ export function extractConditionalUsage(condition, context, location, options =
|
|
|
881
1059
|
comparedValues,
|
|
882
1060
|
isNegated,
|
|
883
1061
|
requiredValue,
|
|
1062
|
+
...(comparisonOperator && { comparisonOperator }),
|
|
884
1063
|
...(chainInfo.currentOrGroupId && {
|
|
885
1064
|
orGroupId: chainInfo.currentOrGroupId,
|
|
886
1065
|
}),
|
|
@@ -1086,15 +1265,21 @@ export function processExpression({ node, context, targetPath, typeHint, }) {
|
|
|
1086
1265
|
const equivalentVariables = context.getEquivalentVariables();
|
|
1087
1266
|
const structure = context.getStructure();
|
|
1088
1267
|
// Propagate existing equivalencies for sub-properties
|
|
1089
|
-
for (const [key,
|
|
1268
|
+
for (const [key, rawValue] of Object.entries(equivalentVariables)) {
|
|
1090
1269
|
// Check if this equivalency is for a sub-property of the identifier
|
|
1091
1270
|
// e.g., completeDataStructure['Function Arguments'] or completeDataStructure.foo
|
|
1092
1271
|
if (key.startsWith(nodePathStr + '.') ||
|
|
1093
1272
|
key.startsWith(nodePathStr + '[')) {
|
|
1094
1273
|
const subPath = key.substring(nodePathStr.length);
|
|
1095
1274
|
const newTargetPath = StructuredPath.fromBase(targetPath.toString() + subPath);
|
|
1096
|
-
|
|
1097
|
-
|
|
1275
|
+
// Handle both string and string[] values
|
|
1276
|
+
const values = Array.isArray(rawValue) ? rawValue : [rawValue];
|
|
1277
|
+
for (const value of values) {
|
|
1278
|
+
if (typeof value === 'string') {
|
|
1279
|
+
const valuePath = StructuredPath.fromBase(value);
|
|
1280
|
+
context.addEquivalence(newTargetPath, valuePath);
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1098
1283
|
}
|
|
1099
1284
|
}
|
|
1100
1285
|
// Propagate existing structure entries for sub-properties
|
|
@@ -1436,20 +1621,38 @@ export function processExpression({ node, context, targetPath, typeHint, }) {
|
|
|
1436
1621
|
// - items[] (from the find result)
|
|
1437
1622
|
// - null (from the fallback)
|
|
1438
1623
|
if (targetPath) {
|
|
1439
|
-
//
|
|
1624
|
+
// Get paths for both sides
|
|
1625
|
+
const leftPath = StructuredPath.fromNode(unwrappedNode.left, context.sourceFile);
|
|
1626
|
+
const rightPath = StructuredPath.fromNode(unwrappedNode.right, context.sourceFile);
|
|
1627
|
+
// Collect all valid paths
|
|
1628
|
+
const allPaths = [];
|
|
1629
|
+
if (leftPath)
|
|
1630
|
+
allPaths.push(leftPath);
|
|
1631
|
+
if (rightPath)
|
|
1632
|
+
allPaths.push(rightPath);
|
|
1633
|
+
// Add multiple equivalencies to track both sources
|
|
1634
|
+
if (allPaths.length > 0) {
|
|
1635
|
+
context.addMultipleEquivalencies(targetPath, allPaths);
|
|
1636
|
+
}
|
|
1637
|
+
// Process both sides to capture their internal structures
|
|
1440
1638
|
processExpression({
|
|
1441
1639
|
node: unwrappedNode.left,
|
|
1442
1640
|
context,
|
|
1443
|
-
targetPath,
|
|
1444
1641
|
});
|
|
1445
|
-
// Process right side recursively for completeness
|
|
1446
1642
|
processExpression({
|
|
1447
1643
|
node: unwrappedNode.right,
|
|
1448
1644
|
context,
|
|
1449
|
-
targetPath,
|
|
1450
1645
|
});
|
|
1451
|
-
//
|
|
1452
|
-
|
|
1646
|
+
// Register the type for the target path
|
|
1647
|
+
const leftType = context.inferTypeFromNode(unwrappedNode.left);
|
|
1648
|
+
const rightType = context.inferTypeFromNode(unwrappedNode.right);
|
|
1649
|
+
const orResultType = isDefinedType(leftType)
|
|
1650
|
+
? leftType
|
|
1651
|
+
: rightType || 'unknown';
|
|
1652
|
+
context.addType(targetPath, orResultType);
|
|
1653
|
+
// Return early - we've already handled equivalencies with addMultipleEquivalencies
|
|
1654
|
+
// Don't fall through to the generic addEquivalence call below
|
|
1655
|
+
return true;
|
|
1453
1656
|
}
|
|
1454
1657
|
// Note: When there's no targetPath, we don't recursively process
|
|
1455
1658
|
// because || is often used in boolean contexts where the full expression matters
|
|
@@ -1529,18 +1732,44 @@ export function processExpression({ node, context, targetPath, typeHint, }) {
|
|
|
1529
1732
|
const semantics = semanticsList[0];
|
|
1530
1733
|
// Get the source expression path (e.g., the object for obj.method())
|
|
1531
1734
|
const sourceExpr = unwrappedNode.expression.expression;
|
|
1532
|
-
const
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
const
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1735
|
+
const unwrappedSourceExpr = unwrapExpression(sourceExpr);
|
|
1736
|
+
// When the source is a ternary expression like (cond ? arr : arr.slice()),
|
|
1737
|
+
// apply method semantics to BOTH branches directly. The ternary itself isn't
|
|
1738
|
+
// a variable - it's just a choice between two paths that both flow to the result.
|
|
1739
|
+
if (ts.isConditionalExpression(unwrappedSourceExpr)) {
|
|
1740
|
+
const branches = [
|
|
1741
|
+
unwrappedSourceExpr.whenTrue,
|
|
1742
|
+
unwrappedSourceExpr.whenFalse,
|
|
1743
|
+
];
|
|
1744
|
+
for (const branch of branches) {
|
|
1745
|
+
const branchPath = StructuredPath.fromNode(branch, context.sourceFile);
|
|
1746
|
+
if (branchPath) {
|
|
1747
|
+
const isArraySemantics = semantics instanceof ArrayPushSemantics;
|
|
1748
|
+
const shouldApply = !isArraySemantics ||
|
|
1749
|
+
isLikelyArrayType(branch, context.typeChecker);
|
|
1750
|
+
if (shouldApply) {
|
|
1751
|
+
semantics.addEquivalences(callPath, branchPath, context);
|
|
1752
|
+
returnType = semantics.getReturnType();
|
|
1753
|
+
handledBySemantics = true;
|
|
1754
|
+
}
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1758
|
+
else {
|
|
1759
|
+
// Regular (non-ternary) source expression
|
|
1760
|
+
const sourcePath = StructuredPath.fromNode(sourceExpr, context.sourceFile);
|
|
1761
|
+
if (sourcePath) {
|
|
1762
|
+
// For array-specific semantics (like push), verify the source is actually an array
|
|
1763
|
+
// This prevents router.push() from being mistakenly treated as Array.push()
|
|
1764
|
+
const isArraySemantics = semantics instanceof ArrayPushSemantics;
|
|
1765
|
+
const shouldApply = !isArraySemantics ||
|
|
1766
|
+
isLikelyArrayType(sourceExpr, context.typeChecker);
|
|
1767
|
+
if (shouldApply) {
|
|
1768
|
+
// Apply method semantics
|
|
1769
|
+
semantics.addEquivalences(callPath, sourcePath, context);
|
|
1770
|
+
returnType = semantics.getReturnType();
|
|
1771
|
+
handledBySemantics = true;
|
|
1772
|
+
}
|
|
1544
1773
|
}
|
|
1545
1774
|
}
|
|
1546
1775
|
}
|
|
@@ -1969,6 +2198,32 @@ export function processExpression({ node, context, targetPath, typeHint, }) {
|
|
|
1969
2198
|
}
|
|
1970
2199
|
// Handle Arrow Functions: (p) => p.prop, (a, b) => { ... }
|
|
1971
2200
|
if (ts.isArrowFunction(unwrappedNode)) {
|
|
2201
|
+
// If this arrow function is a child boundary (e.g., a .map() callback),
|
|
2202
|
+
// don't process its parameters here - they will be processed when the
|
|
2203
|
+
// child scope is analyzed separately. This prevents parameter variables
|
|
2204
|
+
// from leaking into the parent scope's equivalencies.
|
|
2205
|
+
// Check if this arrow function is a child boundary (i.e., should be processed
|
|
2206
|
+
// as a separate child scope, not here in the parent scope).
|
|
2207
|
+
//
|
|
2208
|
+
// We use two checks because childBoundary positions can be unreliable:
|
|
2209
|
+
// 1. Position-based check (standard isChildBoundary)
|
|
2210
|
+
// 2. Text-based check: if the arrow function text doesn't appear in the
|
|
2211
|
+
// statement text, it was replaced with a cyScope placeholder
|
|
2212
|
+
const isChildBoundary = context.isChildBoundary(unwrappedNode);
|
|
2213
|
+
// Text-based child scope detection for when positions are unreliable
|
|
2214
|
+
const arrowFnText = unwrappedNode.getText(context.sourceFile);
|
|
2215
|
+
const firstLine = arrowFnText.split('\n')[0].trim();
|
|
2216
|
+
const searchText = firstLine.substring(0, Math.min(20, firstLine.length));
|
|
2217
|
+
const isInStatementText = context.statementInfo.text.includes(searchText);
|
|
2218
|
+
const isChildScope = !isInStatementText && arrowFnText.length > 10;
|
|
2219
|
+
if (isChildBoundary || isChildScope) {
|
|
2220
|
+
// The method semantics (e.g., ArrayMapSemantics) have already established
|
|
2221
|
+
// the necessary equivalences between the child scope placeholder and array elements
|
|
2222
|
+
if (targetPath) {
|
|
2223
|
+
context.addType(targetPath, 'function');
|
|
2224
|
+
}
|
|
2225
|
+
return true;
|
|
2226
|
+
}
|
|
1972
2227
|
// Create a path for the function
|
|
1973
2228
|
const functionPath = StructuredPath.empty();
|
|
1974
2229
|
// Process parameters
|
|
@@ -2260,6 +2515,15 @@ export function processExpression({ node, context, targetPath, typeHint, }) {
|
|
|
2260
2515
|
for (const child of unwrappedNode.children) {
|
|
2261
2516
|
// Process expressions in JSX children: <div>{expr}</div>
|
|
2262
2517
|
if (ts.isJsxExpression(child) && child.expression) {
|
|
2518
|
+
// When processing return value JSX, link root variables to return value schema
|
|
2519
|
+
if (targetPath && targetPath.base !== '') {
|
|
2520
|
+
const varNames = [
|
|
2521
|
+
...new Set(extractRootVariableNames(child.expression)),
|
|
2522
|
+
];
|
|
2523
|
+
for (const varName of varNames) {
|
|
2524
|
+
context.addEquivalence(targetPath.withProperty(varName), StructuredPath.fromBase(varName));
|
|
2525
|
+
}
|
|
2526
|
+
}
|
|
2263
2527
|
// Process the expression with StructuredPath.empty() as targetPath
|
|
2264
2528
|
// to trigger type registration without imposing prefix
|
|
2265
2529
|
processExpression({
|
|
@@ -2290,6 +2554,15 @@ export function processExpression({ node, context, targetPath, typeHint, }) {
|
|
|
2290
2554
|
for (const child of unwrappedNode.children) {
|
|
2291
2555
|
// Process expressions in JSX children: <>{expr}</>
|
|
2292
2556
|
if (ts.isJsxExpression(child) && child.expression) {
|
|
2557
|
+
// When processing return value JSX, link root variables to return value schema
|
|
2558
|
+
if (targetPath && targetPath.base !== '') {
|
|
2559
|
+
const varNames = [
|
|
2560
|
+
...new Set(extractRootVariableNames(child.expression)),
|
|
2561
|
+
];
|
|
2562
|
+
for (const varName of varNames) {
|
|
2563
|
+
context.addEquivalence(targetPath.withProperty(varName), StructuredPath.fromBase(varName));
|
|
2564
|
+
}
|
|
2565
|
+
}
|
|
2293
2566
|
// Process the expression to extract structure
|
|
2294
2567
|
processExpression({
|
|
2295
2568
|
node: child.expression,
|