@codeyam/codeyam-cli 0.1.0-staging.6e699e5 → 0.1.0-staging.79ef713
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 +7 -7
- package/analyzer-template/packages/ai/index.ts +10 -2
- package/analyzer-template/packages/ai/package.json +2 -2
- package/analyzer-template/packages/ai/src/lib/analyzeScope.ts +86 -18
- package/analyzer-template/packages/ai/src/lib/astScopes/astScopeAnalyzer.ts +67 -9
- package/analyzer-template/packages/ai/src/lib/astScopes/methodSemantics.ts +41 -17
- package/analyzer-template/packages/ai/src/lib/astScopes/patterns/forInStatementHandler.ts +10 -17
- package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +308 -50
- package/analyzer-template/packages/ai/src/lib/astScopes/types.ts +15 -6
- package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +833 -243
- 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 +54 -3
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.ts +60 -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 +80 -5
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.ts +179 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.ts +40 -30
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.ts +393 -97
- package/analyzer-template/packages/ai/src/lib/generateEntityDataStructure.ts +58 -3
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +283 -1
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarios.ts +9 -5
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +11 -3
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.ts +1 -1
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionals.ts +297 -7
- 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/mergeStatements.ts +90 -96
- package/analyzer-template/packages/ai/src/lib/promptGenerators/gatherAttributesMap.ts +10 -7
- 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/ai/src/lib/worker/analyzeScopeWorker.ts +114 -2
- package/analyzer-template/packages/analyze/index.ts +2 -0
- package/analyzer-template/packages/analyze/src/lib/FileAnalyzer.ts +65 -59
- package/analyzer-template/packages/analyze/src/lib/ProjectAnalyzer.ts +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 +71 -9
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +19 -4
- package/analyzer-template/packages/analyze/src/lib/files/analyze/dependencyResolver.ts +6 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyze/gatherEntityMap.ts +4 -2
- package/analyzer-template/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.ts +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/kysely/db.ts +8 -1
- package/analyzer-template/packages/database/src/lib/kysely/tables/commitsTable.ts +6 -0
- package/analyzer-template/packages/database/src/lib/loadAnalyses.ts +58 -1
- package/analyzer-template/packages/database/src/lib/loadAnalysis.ts +13 -0
- package/analyzer-template/packages/database/src/lib/loadBranch.ts +16 -1
- package/analyzer-template/packages/database/src/lib/loadCommit.ts +11 -0
- package/analyzer-template/packages/database/src/lib/loadCommits.ts +28 -0
- package/analyzer-template/packages/database/src/lib/loadEntities.ts +26 -3
- package/analyzer-template/packages/database/src/lib/loadEntityBranches.ts +12 -0
- package/analyzer-template/packages/database/src/lib/updateCommitMetadata.ts +7 -14
- 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 +8 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.d.ts +1 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.js +3 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalyses.d.ts +2 -0
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalyses.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalyses.js +45 -2
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalyses.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.js +8 -0
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadBranch.js +11 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadBranch.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommit.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommit.js +7 -0
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommit.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.d.ts +3 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js +22 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.d.ts +3 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js +23 -4
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntityBranches.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntityBranches.js +9 -0
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntityBranches.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.d.ts +2 -2
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js +5 -4
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/Commit.d.ts +2 -0
- package/analyzer-template/packages/github/dist/types/src/types/Commit.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/ProjectMetadata.d.ts +3 -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/Commit.ts +2 -0
- package/analyzer-template/packages/types/src/types/ProjectMetadata.ts +1 -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/Commit.d.ts +2 -0
- package/analyzer-template/packages/utils/dist/types/src/types/Commit.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/ProjectMetadata.d.ts +3 -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/playwright/capture.ts +20 -8
- package/analyzer-template/playwright/captureStatic.ts +1 -1
- package/analyzer-template/project/analyzeBaselineCommit.ts +5 -0
- package/analyzer-template/project/analyzeRegularCommit.ts +5 -0
- package/analyzer-template/project/captureLibraryFunctionDirect.ts +29 -26
- package/analyzer-template/project/constructMockCode.ts +90 -10
- package/analyzer-template/project/createEntitiesAndSortFiles.ts +83 -0
- package/analyzer-template/project/loadReadyToBeCaptured.ts +65 -41
- package/analyzer-template/project/orchestrateCapture/AwsCaptureTaskRunner.ts +12 -4
- package/analyzer-template/project/orchestrateCapture/SequentialCaptureTaskRunner.ts +11 -6
- package/analyzer-template/project/orchestrateCapture/taskRunner.ts +4 -2
- package/analyzer-template/project/orchestrateCapture.ts +45 -6
- package/analyzer-template/project/start.ts +35 -11
- package/analyzer-template/project/writeMockDataTsx.ts +181 -8
- package/analyzer-template/project/writeScenarioComponents.ts +103 -12
- package/analyzer-template/project/writeSimpleRoot.ts +21 -11
- package/analyzer-template/scripts/comboWorkerLoop.cjs +98 -50
- package/background/src/lib/virtualized/project/analyzeBaselineCommit.js +5 -0
- package/background/src/lib/virtualized/project/analyzeBaselineCommit.js.map +1 -1
- package/background/src/lib/virtualized/project/analyzeRegularCommit.js +5 -0
- package/background/src/lib/virtualized/project/analyzeRegularCommit.js.map +1 -1
- package/background/src/lib/virtualized/project/captureLibraryFunctionDirect.js +3 -3
- package/background/src/lib/virtualized/project/captureLibraryFunctionDirect.js.map +1 -1
- package/background/src/lib/virtualized/project/constructMockCode.js +75 -4
- package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
- package/background/src/lib/virtualized/project/createEntitiesAndSortFiles.js +73 -1
- package/background/src/lib/virtualized/project/createEntitiesAndSortFiles.js.map +1 -1
- package/background/src/lib/virtualized/project/loadReadyToBeCaptured.js +19 -8
- package/background/src/lib/virtualized/project/loadReadyToBeCaptured.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture/AwsCaptureTaskRunner.js +2 -2
- package/background/src/lib/virtualized/project/orchestrateCapture/AwsCaptureTaskRunner.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture/SequentialCaptureTaskRunner.js +4 -4
- package/background/src/lib/virtualized/project/orchestrateCapture/SequentialCaptureTaskRunner.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture.js +38 -6
- package/background/src/lib/virtualized/project/orchestrateCapture.js.map +1 -1
- package/background/src/lib/virtualized/project/start.js +32 -11
- package/background/src/lib/virtualized/project/start.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 +85 -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/commands/debug.js +7 -5
- package/codeyam-cli/src/commands/debug.js.map +1 -1
- package/codeyam-cli/src/commands/memory.js +264 -0
- package/codeyam-cli/src/commands/memory.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +2 -2
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
- package/codeyam-cli/src/utils/analysisRunner.js +21 -2
- package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
- package/codeyam-cli/src/utils/backgroundServer.js +4 -0
- package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/utils/install-skills.js +55 -10
- package/codeyam-cli/src/utils/install-skills.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/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 +285 -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 +6 -0
- package/codeyam-cli/src/utils/rules/index.js.map +1 -0
- package/codeyam-cli/src/utils/rules/parser.js +78 -0
- package/codeyam-cli/src/utils/rules/parser.js.map +1 -0
- package/codeyam-cli/src/utils/rules/pathMatcher.js +18 -0
- package/codeyam-cli/src/utils/rules/pathMatcher.js.map +1 -0
- package/codeyam-cli/src/utils/rules/ruleState.js +150 -0
- package/codeyam-cli/src/utils/rules/ruleState.js.map +1 -0
- package/codeyam-cli/src/utils/rules/staleness.js +137 -0
- package/codeyam-cli/src/utils/rules/staleness.js.map +1 -0
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +1 -1
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
- package/codeyam-cli/src/webserver/app/lib/database.js +7 -3
- package/codeyam-cli/src/webserver/app/lib/database.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-B86KKU7e.js +11 -0
- 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-D4TZhLuw.js → ReportIssueModal-C6PKeMYR.js} +3 -13
- 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-DEx02QDa.js → ScenarioViewer-BNLaXBHR.js} +3 -3
- 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)-DoLIqZX2.js → activity.(_tab)-BtBFH820.js} +6 -16
- package/codeyam-cli/src/webserver/build/client/assets/agent-transcripts-DfKzxuoe.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.memory-profile-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.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-C5lqplTC.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-C2N4Op8e.js → entity._sha._-n38keI1k.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-0N0YJQv7.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{git-B4RJRvYB.js → git-DXnyr8uP.js} +8 -8
- package/codeyam-cli/src/webserver/build/client/assets/globals-Bh6jH0cL.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-CdVUfvji.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-87319d0f.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/memory-CPIDnDEj.js +76 -0
- package/codeyam-cli/src/webserver/build/client/assets/pause-D6vreykR.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/root-D6oziHts.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-CS5f3WzT.js → settings-eBI36Yv5.js} +1 -1
- 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-9ox9LcrG.js +1 -0
- package/codeyam-cli/src/webserver/build/server/assets/server-build-Cq5Vqcob.js +260 -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-power-rules-hook.sh → codeyam-memory-hook.sh} +12 -13
- package/codeyam-cli/templates/codeyam:diagnose.md +178 -25
- package/codeyam-cli/templates/codeyam:memory.md +404 -0
- package/codeyam-cli/templates/codeyam:new-rule.md +2 -2
- package/codeyam-cli/templates/rule-notification-hook.py +56 -0
- package/codeyam-cli/templates/rule-reflection-hook.py +590 -0
- package/codeyam-cli/templates/rules-instructions.md +123 -0
- package/package.json +8 -6
- package/packages/ai/index.js +3 -2
- package/packages/ai/index.js.map +1 -1
- package/packages/ai/src/lib/analyzeScope.js +68 -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/methodSemantics.js +41 -17
- package/packages/ai/src/lib/astScopes/methodSemantics.js.map +1 -1
- package/packages/ai/src/lib/astScopes/patterns/forInStatementHandler.js +10 -14
- package/packages/ai/src/lib/astScopes/patterns/forInStatementHandler.js.map +1 -1
- package/packages/ai/src/lib/astScopes/processExpression.js +239 -43
- package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +650 -166
- 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 +52 -3
- package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js +55 -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 +73 -5
- package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.js +173 -0
- package/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.js.map +1 -0
- package/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.js +37 -20
- package/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js +333 -86
- package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.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 +205 -1
- 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 +10 -2
- package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -1
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js +209 -3
- 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/mergeStatements.js +70 -51
- package/packages/ai/src/lib/mergeStatements.js.map +1 -1
- 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/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/ai/src/lib/worker/analyzeScopeWorker.js +94 -1
- package/packages/ai/src/lib/worker/analyzeScopeWorker.js.map +1 -1
- package/packages/analyze/index.js +1 -0
- package/packages/analyze/index.js.map +1 -1
- package/packages/analyze/src/lib/FileAnalyzer.js +60 -36
- package/packages/analyze/src/lib/FileAnalyzer.js.map +1 -1
- package/packages/analyze/src/lib/ProjectAnalyzer.js +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 +54 -6
- 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/dependencyResolver.js +5 -0
- package/packages/analyze/src/lib/files/analyze/dependencyResolver.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/kysely/db.js +8 -1
- package/packages/database/src/lib/kysely/db.js.map +1 -1
- package/packages/database/src/lib/kysely/tables/commitsTable.js +3 -0
- package/packages/database/src/lib/kysely/tables/commitsTable.js.map +1 -1
- package/packages/database/src/lib/loadAnalyses.js +45 -2
- package/packages/database/src/lib/loadAnalyses.js.map +1 -1
- package/packages/database/src/lib/loadAnalysis.js +8 -0
- package/packages/database/src/lib/loadAnalysis.js.map +1 -1
- package/packages/database/src/lib/loadBranch.js +11 -1
- package/packages/database/src/lib/loadBranch.js.map +1 -1
- package/packages/database/src/lib/loadCommit.js +7 -0
- package/packages/database/src/lib/loadCommit.js.map +1 -1
- package/packages/database/src/lib/loadCommits.js +22 -1
- package/packages/database/src/lib/loadCommits.js.map +1 -1
- package/packages/database/src/lib/loadEntities.js +23 -4
- package/packages/database/src/lib/loadEntities.js.map +1 -1
- package/packages/database/src/lib/loadEntityBranches.js +9 -0
- package/packages/database/src/lib/loadEntityBranches.js.map +1 -1
- package/packages/database/src/lib/updateCommitMetadata.js +5 -4
- package/packages/database/src/lib/updateCommitMetadata.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityItem-BXhEawa3.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-BRb-0kQl.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/files-Cs4MdYtv.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/git-commit-horizontal-CysbcZxi.js +0 -6
- package/codeyam-cli/src/webserver/build/client/assets/globals-DMUaGAqV.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-f874c610.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/root-Bz5TunQg.js +0 -57
- package/codeyam-cli/src/webserver/build/client/assets/rules-hEkvVw2-.js +0 -97
- package/codeyam-cli/src/webserver/build/server/assets/index-967OuJoF.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-DRTmerg9.js +0 -257
- package/codeyam-cli/templates/codeyam:power-rules.md +0 -447
- /package/codeyam-cli/src/webserver/build/client/assets/{api.rules-l0sNRNKZ.js → api.agent-transcripts-l0sNRNKZ.js} +0 -0
|
@@ -18,6 +18,7 @@ import type {
|
|
|
18
18
|
CompoundConditional,
|
|
19
19
|
DerivedVariableOperation,
|
|
20
20
|
DerivedVariableInfo,
|
|
21
|
+
JsxRenderingUsage,
|
|
21
22
|
} from './astScopes/types';
|
|
22
23
|
import type { EnrichedConditionalUsage } from './worker/SerializableDataStructure';
|
|
23
24
|
import resolvePathToControllable from './resolvePathToControllable';
|
|
@@ -32,7 +33,7 @@ export interface ChildComponentConditionalData {
|
|
|
32
33
|
/** Child's conditional usages keyed by variable name (may include sourceDataPath from enrichment) */
|
|
33
34
|
conditionalUsages: Record<string, ExtendedConditionalUsage[]>;
|
|
34
35
|
/** Child's equivalent signature variables (maps internal paths to prop paths) */
|
|
35
|
-
equivalentSignatureVariables: Record<string, string>;
|
|
36
|
+
equivalentSignatureVariables: Record<string, string | string[]>;
|
|
36
37
|
/** Child's compound conditionals */
|
|
37
38
|
compoundConditionals: CompoundConditional[];
|
|
38
39
|
/**
|
|
@@ -41,6 +42,11 @@ export interface ChildComponentConditionalData {
|
|
|
41
42
|
* then `hasAnalysis` is a gating condition for all of ChildComponent's flows.
|
|
42
43
|
*/
|
|
43
44
|
gatingConditions?: ConditionalUsage[];
|
|
45
|
+
/**
|
|
46
|
+
* Child's JSX rendering usages (arrays rendered via .map(), text interpolation).
|
|
47
|
+
* These generate "variation flows" for different array lengths.
|
|
48
|
+
*/
|
|
49
|
+
jsxRenderingUsages?: JsxRenderingUsage[];
|
|
44
50
|
}
|
|
45
51
|
|
|
46
52
|
export interface GenerateFlowsFromConditionalsArgs {
|
|
@@ -51,7 +57,7 @@ export interface GenerateFlowsFromConditionalsArgs {
|
|
|
51
57
|
/** Map of controllable paths to their types */
|
|
52
58
|
attributesMap: Record<string, string>;
|
|
53
59
|
/** Map from local variable names to data sources */
|
|
54
|
-
equivalentSignatureVariables: Record<string, string>;
|
|
60
|
+
equivalentSignatureVariables: Record<string, string | string[]>;
|
|
55
61
|
/** Map from full paths to short paths */
|
|
56
62
|
fullToShortPathMap: Record<string, string>;
|
|
57
63
|
/**
|
|
@@ -73,6 +79,21 @@ export interface GenerateFlowsFromConditionalsArgs {
|
|
|
73
79
|
* to `currentRun.entityShas` when `isInCurrentRun` isn't in conditionalUsages.
|
|
74
80
|
*/
|
|
75
81
|
derivedVariables?: Record<string, DerivedVariableInfo>;
|
|
82
|
+
/**
|
|
83
|
+
* Optional map of child prop paths to their actual data sources.
|
|
84
|
+
* Used when child props flow through useState but ultimately come from
|
|
85
|
+
* mockable data sources (e.g., API calls, fetchers).
|
|
86
|
+
*
|
|
87
|
+
* Example:
|
|
88
|
+
* - "WorkoutsView().signature[0].workouts" → "createClient()...functionCallReturnValue.data"
|
|
89
|
+
*
|
|
90
|
+
* When a child path translates to a useState value, we check this map
|
|
91
|
+
* to find the real data source that can be mocked.
|
|
92
|
+
*/
|
|
93
|
+
sourceEquivalencies?: Record<
|
|
94
|
+
string,
|
|
95
|
+
Array<{ scopeNodeName: string; schemaPath: string }>
|
|
96
|
+
>;
|
|
76
97
|
}
|
|
77
98
|
|
|
78
99
|
/**
|
|
@@ -117,7 +138,7 @@ function expandDerivedVariableToSources(
|
|
|
117
138
|
path: string,
|
|
118
139
|
conditionalUsages: Record<string, ConditionalUsage[]>,
|
|
119
140
|
attributesMap: Record<string, string>,
|
|
120
|
-
equivalentSignatureVariables: Record<string, string>,
|
|
141
|
+
equivalentSignatureVariables: Record<string, string | string[]>,
|
|
121
142
|
fullToShortPathMap: Record<string, string>,
|
|
122
143
|
visited: Set<string> = new Set(),
|
|
123
144
|
derivedVariables?: Record<string, DerivedVariableInfo>,
|
|
@@ -387,6 +408,20 @@ function findInAttributesMapForPath(
|
|
|
387
408
|
return null;
|
|
388
409
|
}
|
|
389
410
|
|
|
411
|
+
/**
|
|
412
|
+
* Generate a slug from a path for use in flow IDs and exclusive groups.
|
|
413
|
+
*/
|
|
414
|
+
function pathToSlug(path: string): string {
|
|
415
|
+
return path
|
|
416
|
+
.replace(/\[\d+\]/g, '')
|
|
417
|
+
.replace(/\[\]/g, '')
|
|
418
|
+
.replace(/\(\)/g, '')
|
|
419
|
+
.replace(/\.functionCallReturnValue/g, '')
|
|
420
|
+
.replace(/[<>]/g, '')
|
|
421
|
+
.replace(/\./g, '-')
|
|
422
|
+
.toLowerCase();
|
|
423
|
+
}
|
|
424
|
+
|
|
390
425
|
/**
|
|
391
426
|
* Generate a human-readable name from a path.
|
|
392
427
|
* Extracts the last meaningful part of the path.
|
|
@@ -732,8 +767,8 @@ function normalizePathForDeduplication(
|
|
|
732
767
|
*/
|
|
733
768
|
function translateChildPathToParent(
|
|
734
769
|
childPath: string,
|
|
735
|
-
childEquivalentSignatureVariables: Record<string, string>,
|
|
736
|
-
parentEquivalentSignatureVariables: Record<string, string>,
|
|
770
|
+
childEquivalentSignatureVariables: Record<string, string | string[]>,
|
|
771
|
+
parentEquivalentSignatureVariables: Record<string, string | string[]>,
|
|
737
772
|
childName: string,
|
|
738
773
|
): string | null {
|
|
739
774
|
// Extract the root variable from the child path
|
|
@@ -760,7 +795,11 @@ function translateChildPathToParent(
|
|
|
760
795
|
|
|
761
796
|
// Look up the child's equivalence for this root variable
|
|
762
797
|
// e.g., childEquiv[selectedScenario] = "signature[0].selectedScenario"
|
|
763
|
-
|
|
798
|
+
// Handle array case (OR expressions) - use first element if array
|
|
799
|
+
const rawChildPropPath = childEquivalentSignatureVariables[rootVar];
|
|
800
|
+
const childPropPath = Array.isArray(rawChildPropPath)
|
|
801
|
+
? rawChildPropPath[0]
|
|
802
|
+
: rawChildPropPath;
|
|
764
803
|
|
|
765
804
|
if (!childPropPath) {
|
|
766
805
|
// No mapping found - this might be internal state, not a prop
|
|
@@ -773,7 +812,11 @@ function translateChildPathToParent(
|
|
|
773
812
|
|
|
774
813
|
// Look up parent's equivalence to find what value was passed to this prop
|
|
775
814
|
// e.g., parentEquiv["ChildName().signature[0].selectedScenario"] = "selectedScenario"
|
|
776
|
-
|
|
815
|
+
// Handle array case (OR expressions) - use first element if array
|
|
816
|
+
const rawParentValue = parentEquivalentSignatureVariables[fullChildPropPath];
|
|
817
|
+
const parentValue = Array.isArray(rawParentValue)
|
|
818
|
+
? rawParentValue[0]
|
|
819
|
+
: rawParentValue;
|
|
777
820
|
|
|
778
821
|
if (!parentValue) {
|
|
779
822
|
// No parent mapping found - log ALL parent keys that contain the childName
|
|
@@ -800,6 +843,7 @@ export default function generateExecutionFlowsFromConditionals(
|
|
|
800
843
|
fullToShortPathMap,
|
|
801
844
|
childComponentData,
|
|
802
845
|
derivedVariables,
|
|
846
|
+
sourceEquivalencies,
|
|
803
847
|
} = args;
|
|
804
848
|
|
|
805
849
|
const flows: ExecutionFlow[] = [];
|
|
@@ -1771,6 +1815,69 @@ export default function generateExecutionFlowsFromConditionals(
|
|
|
1771
1815
|
}
|
|
1772
1816
|
}
|
|
1773
1817
|
|
|
1818
|
+
// Fallback 2: Try sourceEquivalencies to find the actual data source
|
|
1819
|
+
// This handles the case where props flow through useState but originate
|
|
1820
|
+
// from a mockable data source (e.g., API call, fetcher).
|
|
1821
|
+
//
|
|
1822
|
+
// Example: WorkoutsView receives `workouts` prop which in parent is stored
|
|
1823
|
+
// in useState, but ultimately comes from a Supabase query.
|
|
1824
|
+
// sourceEquivalencies tells us: "WorkoutsView().signature[0].workouts" → "createClient()...data"
|
|
1825
|
+
if (!resolvedPath && sourceEquivalencies) {
|
|
1826
|
+
// Build the child prop path to look up in sourceEquivalencies
|
|
1827
|
+
// Format: "ChildName().signature[0].propName"
|
|
1828
|
+
// First, find what prop this child path maps to
|
|
1829
|
+
let childPropName: string | null = null;
|
|
1830
|
+
for (const [varName, varPath] of Object.entries(
|
|
1831
|
+
childData.equivalentSignatureVariables,
|
|
1832
|
+
)) {
|
|
1833
|
+
// Check if childPath starts with this variable name
|
|
1834
|
+
// e.g., childPath = "workouts.length", varName = "workouts", varPath = "signature[0].workouts"
|
|
1835
|
+
if (
|
|
1836
|
+
childPath === varName ||
|
|
1837
|
+
childPath.startsWith(`${varName}.`)
|
|
1838
|
+
) {
|
|
1839
|
+
childPropName = varName;
|
|
1840
|
+
break;
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
|
|
1844
|
+
if (childPropName) {
|
|
1845
|
+
// Build the full sourceEquivalencies key
|
|
1846
|
+
const sourceEquivKey = `${childName}().signature[0].${childPropName}`;
|
|
1847
|
+
|
|
1848
|
+
const sourceEquivEntry = sourceEquivalencies[sourceEquivKey];
|
|
1849
|
+
if (sourceEquivEntry && sourceEquivEntry.length > 0) {
|
|
1850
|
+
const dataSourcePath = sourceEquivEntry[0].schemaPath;
|
|
1851
|
+
|
|
1852
|
+
// Check if this data source path is controllable
|
|
1853
|
+
const dataSourceResolution = resolvePathToControllable(
|
|
1854
|
+
dataSourcePath,
|
|
1855
|
+
attributesMap,
|
|
1856
|
+
equivalentSignatureVariables,
|
|
1857
|
+
fullToShortPathMap,
|
|
1858
|
+
);
|
|
1859
|
+
|
|
1860
|
+
if (
|
|
1861
|
+
dataSourceResolution.isControllable &&
|
|
1862
|
+
dataSourceResolution.resolvedPath
|
|
1863
|
+
) {
|
|
1864
|
+
// Preserve any suffix from the child path
|
|
1865
|
+
// e.g., childPath = "workouts.length" → suffix = ".length"
|
|
1866
|
+
const suffix = childPath.startsWith(`${childPropName}.`)
|
|
1867
|
+
? childPath.slice(childPropName.length)
|
|
1868
|
+
: '';
|
|
1869
|
+
resolvedPath = dataSourceResolution.resolvedPath + suffix;
|
|
1870
|
+
|
|
1871
|
+
if (shouldDebugChild) {
|
|
1872
|
+
console.log(
|
|
1873
|
+
`[DEBUG CHILD ${childName}] sourceEquivalencies fallback SUCCESS: using data source ${resolvedPath}`,
|
|
1874
|
+
);
|
|
1875
|
+
}
|
|
1876
|
+
}
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1879
|
+
}
|
|
1880
|
+
|
|
1774
1881
|
// If still not resolved after fallback, skip
|
|
1775
1882
|
if (!resolvedPath) {
|
|
1776
1883
|
if (shouldDebugChild) {
|
|
@@ -1970,6 +2077,189 @@ export default function generateExecutionFlowsFromConditionals(
|
|
|
1970
2077
|
}
|
|
1971
2078
|
}
|
|
1972
2079
|
}
|
|
2080
|
+
|
|
2081
|
+
// Process child's jsxRenderingUsages (array.map flows)
|
|
2082
|
+
// This generates array variation flows (empty, few, many) for arrays rendered in child
|
|
2083
|
+
if (childData.jsxRenderingUsages) {
|
|
2084
|
+
for (const jsxUsage of childData.jsxRenderingUsages) {
|
|
2085
|
+
// Translate the child path to a parent path
|
|
2086
|
+
const translatedPath = translateChildPathToParent(
|
|
2087
|
+
jsxUsage.path,
|
|
2088
|
+
childData.equivalentSignatureVariables,
|
|
2089
|
+
equivalentSignatureVariables,
|
|
2090
|
+
childName,
|
|
2091
|
+
);
|
|
2092
|
+
|
|
2093
|
+
if (!translatedPath) {
|
|
2094
|
+
continue;
|
|
2095
|
+
}
|
|
2096
|
+
|
|
2097
|
+
// Resolve to controllable path in parent context
|
|
2098
|
+
const resolution = resolvePathToControllable(
|
|
2099
|
+
translatedPath,
|
|
2100
|
+
attributesMap,
|
|
2101
|
+
equivalentSignatureVariables,
|
|
2102
|
+
fullToShortPathMap,
|
|
2103
|
+
);
|
|
2104
|
+
|
|
2105
|
+
let resolvedPath = resolution.resolvedPath;
|
|
2106
|
+
|
|
2107
|
+
// Try sourceEquivalencies fallback if not controllable
|
|
2108
|
+
if (!resolution.isControllable || !resolvedPath) {
|
|
2109
|
+
if (sourceEquivalencies) {
|
|
2110
|
+
// Build the sourceEquivalencies key
|
|
2111
|
+
// The child path (e.g., "workouts") maps to a prop path (e.g., "signature[0].workouts")
|
|
2112
|
+
let childPropName: string | null = null;
|
|
2113
|
+
for (const [varName, varPath] of Object.entries(
|
|
2114
|
+
childData.equivalentSignatureVariables,
|
|
2115
|
+
)) {
|
|
2116
|
+
if (
|
|
2117
|
+
jsxUsage.path === varName ||
|
|
2118
|
+
jsxUsage.path.startsWith(`${varName}.`)
|
|
2119
|
+
) {
|
|
2120
|
+
childPropName = varName;
|
|
2121
|
+
break;
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
2124
|
+
|
|
2125
|
+
if (childPropName) {
|
|
2126
|
+
const sourceEquivKey = `${childName}().signature[0].${childPropName}`;
|
|
2127
|
+
const sourceEquivEntry = sourceEquivalencies[sourceEquivKey];
|
|
2128
|
+
|
|
2129
|
+
if (sourceEquivEntry && sourceEquivEntry.length > 0) {
|
|
2130
|
+
const dataSourcePath = sourceEquivEntry[0].schemaPath;
|
|
2131
|
+
|
|
2132
|
+
const dataSourceResolution = resolvePathToControllable(
|
|
2133
|
+
dataSourcePath,
|
|
2134
|
+
attributesMap,
|
|
2135
|
+
equivalentSignatureVariables,
|
|
2136
|
+
fullToShortPathMap,
|
|
2137
|
+
);
|
|
2138
|
+
|
|
2139
|
+
if (
|
|
2140
|
+
dataSourceResolution.isControllable &&
|
|
2141
|
+
dataSourceResolution.resolvedPath
|
|
2142
|
+
) {
|
|
2143
|
+
resolvedPath = dataSourceResolution.resolvedPath;
|
|
2144
|
+
}
|
|
2145
|
+
}
|
|
2146
|
+
}
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2149
|
+
|
|
2150
|
+
if (!resolvedPath) {
|
|
2151
|
+
continue;
|
|
2152
|
+
}
|
|
2153
|
+
|
|
2154
|
+
// Check for duplicates
|
|
2155
|
+
const normalizedPath = normalizePathForDeduplication(
|
|
2156
|
+
resolvedPath,
|
|
2157
|
+
fullToShortPathMap,
|
|
2158
|
+
);
|
|
2159
|
+
const dedupeKey = `${normalizedPath}:${jsxUsage.renderingType}`;
|
|
2160
|
+
if (seenNormalizedPaths.has(dedupeKey)) {
|
|
2161
|
+
continue;
|
|
2162
|
+
}
|
|
2163
|
+
seenNormalizedPaths.add(dedupeKey);
|
|
2164
|
+
|
|
2165
|
+
// Generate array variation flows for array-map rendering
|
|
2166
|
+
if (jsxUsage.renderingType === 'array-map') {
|
|
2167
|
+
const baseName = generateNameFromPath(resolvedPath);
|
|
2168
|
+
const pathSlug = pathToSlug(resolvedPath);
|
|
2169
|
+
const exclusiveGroup = `array-length-${pathSlug}`;
|
|
2170
|
+
|
|
2171
|
+
// Empty array flow
|
|
2172
|
+
const emptyFlow: ExecutionFlow = {
|
|
2173
|
+
id: `${pathSlug}-empty-array`,
|
|
2174
|
+
name: `${baseName} Empty`,
|
|
2175
|
+
description: `When ${baseName.toLowerCase()} array is empty`,
|
|
2176
|
+
requiredValues: [
|
|
2177
|
+
{
|
|
2178
|
+
attributePath: resolvedPath,
|
|
2179
|
+
value: '0',
|
|
2180
|
+
comparison: 'length<',
|
|
2181
|
+
valueType: 'array',
|
|
2182
|
+
},
|
|
2183
|
+
...gatingRequiredValues,
|
|
2184
|
+
],
|
|
2185
|
+
impact: 'medium',
|
|
2186
|
+
exclusiveGroup,
|
|
2187
|
+
sourceLocation: jsxUsage.sourceLocation
|
|
2188
|
+
? {
|
|
2189
|
+
lineNumber: jsxUsage.sourceLocation.lineNumber,
|
|
2190
|
+
column: jsxUsage.sourceLocation.column,
|
|
2191
|
+
}
|
|
2192
|
+
: undefined,
|
|
2193
|
+
codeSnippet: jsxUsage.sourceLocation?.codeSnippet,
|
|
2194
|
+
};
|
|
2195
|
+
|
|
2196
|
+
if (!seenFlowIds.has(emptyFlow.id)) {
|
|
2197
|
+
seenFlowIds.add(emptyFlow.id);
|
|
2198
|
+
flows.push(emptyFlow);
|
|
2199
|
+
}
|
|
2200
|
+
|
|
2201
|
+
// Few items flow (1-3)
|
|
2202
|
+
const fewFlow: ExecutionFlow = {
|
|
2203
|
+
id: `${pathSlug}-few-items`,
|
|
2204
|
+
name: `${baseName} Few Items`,
|
|
2205
|
+
description: `When ${baseName.toLowerCase()} array has 1-3 items`,
|
|
2206
|
+
requiredValues: [
|
|
2207
|
+
{
|
|
2208
|
+
attributePath: resolvedPath,
|
|
2209
|
+
value: '3',
|
|
2210
|
+
comparison: 'length<',
|
|
2211
|
+
valueType: 'array',
|
|
2212
|
+
},
|
|
2213
|
+
...gatingRequiredValues,
|
|
2214
|
+
],
|
|
2215
|
+
impact: 'low',
|
|
2216
|
+
exclusiveGroup,
|
|
2217
|
+
sourceLocation: jsxUsage.sourceLocation
|
|
2218
|
+
? {
|
|
2219
|
+
lineNumber: jsxUsage.sourceLocation.lineNumber,
|
|
2220
|
+
column: jsxUsage.sourceLocation.column,
|
|
2221
|
+
}
|
|
2222
|
+
: undefined,
|
|
2223
|
+
codeSnippet: jsxUsage.sourceLocation?.codeSnippet,
|
|
2224
|
+
};
|
|
2225
|
+
|
|
2226
|
+
if (!seenFlowIds.has(fewFlow.id)) {
|
|
2227
|
+
seenFlowIds.add(fewFlow.id);
|
|
2228
|
+
flows.push(fewFlow);
|
|
2229
|
+
}
|
|
2230
|
+
|
|
2231
|
+
// Many items flow (10+)
|
|
2232
|
+
const manyFlow: ExecutionFlow = {
|
|
2233
|
+
id: `${pathSlug}-many-items`,
|
|
2234
|
+
name: `${baseName} Many Items`,
|
|
2235
|
+
description: `When ${baseName.toLowerCase()} array has many items`,
|
|
2236
|
+
requiredValues: [
|
|
2237
|
+
{
|
|
2238
|
+
attributePath: resolvedPath,
|
|
2239
|
+
value: '10',
|
|
2240
|
+
comparison: 'length>',
|
|
2241
|
+
valueType: 'array',
|
|
2242
|
+
},
|
|
2243
|
+
...gatingRequiredValues,
|
|
2244
|
+
],
|
|
2245
|
+
impact: 'low',
|
|
2246
|
+
exclusiveGroup,
|
|
2247
|
+
sourceLocation: jsxUsage.sourceLocation
|
|
2248
|
+
? {
|
|
2249
|
+
lineNumber: jsxUsage.sourceLocation.lineNumber,
|
|
2250
|
+
column: jsxUsage.sourceLocation.column,
|
|
2251
|
+
}
|
|
2252
|
+
: undefined,
|
|
2253
|
+
codeSnippet: jsxUsage.sourceLocation?.codeSnippet,
|
|
2254
|
+
};
|
|
2255
|
+
|
|
2256
|
+
if (!seenFlowIds.has(manyFlow.id)) {
|
|
2257
|
+
seenFlowIds.add(manyFlow.id);
|
|
2258
|
+
flows.push(manyFlow);
|
|
2259
|
+
}
|
|
2260
|
+
}
|
|
2261
|
+
}
|
|
2262
|
+
}
|
|
1973
2263
|
}
|
|
1974
2264
|
}
|
|
1975
2265
|
|
|
@@ -19,7 +19,7 @@ export interface GenerateFlowsFromJsxUsagesArgs {
|
|
|
19
19
|
/** Map of controllable paths to their types */
|
|
20
20
|
attributesMap: Record<string, string>;
|
|
21
21
|
/** Map from local variable names to data sources */
|
|
22
|
-
equivalentSignatureVariables: Record<string, string>;
|
|
22
|
+
equivalentSignatureVariables: Record<string, string | string[]>;
|
|
23
23
|
/** Map from full paths to short paths */
|
|
24
24
|
fullToShortPathMap: Record<string, string>;
|
|
25
25
|
/** Structure map for type lookup */
|
|
@@ -743,6 +743,48 @@ function processScope({
|
|
|
743
743
|
};
|
|
744
744
|
}
|
|
745
745
|
|
|
746
|
+
/**
|
|
747
|
+
* Check if a code string contains only type declarations (type aliases, interfaces, etc.)
|
|
748
|
+
* that don't contribute to runtime behavior. This is used to determine if the root scope
|
|
749
|
+
* should be considered "empty" for scope extraction purposes.
|
|
750
|
+
*/
|
|
751
|
+
function containsOnlyTypeDeclarations(code: string): boolean {
|
|
752
|
+
try {
|
|
753
|
+
const sourceFile = ts.createSourceFile(
|
|
754
|
+
'temp.ts',
|
|
755
|
+
code,
|
|
756
|
+
ts.ScriptTarget.Latest,
|
|
757
|
+
true,
|
|
758
|
+
ts.ScriptKind.TS,
|
|
759
|
+
);
|
|
760
|
+
|
|
761
|
+
// Check each statement - if any is NOT a type-only declaration, return false
|
|
762
|
+
for (const statement of sourceFile.statements) {
|
|
763
|
+
if (
|
|
764
|
+
ts.isTypeAliasDeclaration(statement) ||
|
|
765
|
+
ts.isInterfaceDeclaration(statement) ||
|
|
766
|
+
ts.isEnumDeclaration(statement) ||
|
|
767
|
+
// Import declarations that are type-only
|
|
768
|
+
(ts.isImportDeclaration(statement) &&
|
|
769
|
+
statement.importClause?.isTypeOnly) ||
|
|
770
|
+
// Export declarations that are type-only
|
|
771
|
+
(ts.isExportDeclaration(statement) && statement.isTypeOnly)
|
|
772
|
+
) {
|
|
773
|
+
// This is a type-only declaration, continue checking
|
|
774
|
+
continue;
|
|
775
|
+
}
|
|
776
|
+
// Found a non-type statement
|
|
777
|
+
return false;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
// All statements are type-only (or there are no statements)
|
|
781
|
+
return sourceFile.statements.length > 0;
|
|
782
|
+
} catch {
|
|
783
|
+
// If parsing fails, assume it's not type-only
|
|
784
|
+
return false;
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
|
|
746
788
|
/**
|
|
747
789
|
* Main entry point.
|
|
748
790
|
*
|
|
@@ -792,9 +834,15 @@ export default function isolateScopes(
|
|
|
792
834
|
const jsxLimit = options?.jsxLimit ?? 10;
|
|
793
835
|
processJSXForScope(isolatedScopes, generateSyntheticName, jsxLimit);
|
|
794
836
|
|
|
795
|
-
// If the root scope text is empty and there's
|
|
796
|
-
// return that child scope as the root scope
|
|
797
|
-
|
|
837
|
+
// If the root scope text is empty (or only contains type declarations) and there's
|
|
838
|
+
// only one child scope, return that child scope as the root scope.
|
|
839
|
+
// Type declarations (type aliases, interfaces) don't contribute to runtime behavior,
|
|
840
|
+
// so we treat them as "empty" for scope extraction purposes.
|
|
841
|
+
const rootTextIsEffectivelyEmpty =
|
|
842
|
+
isolatedScopes.text.trim().length === 0 ||
|
|
843
|
+
containsOnlyTypeDeclarations(isolatedScopes.text);
|
|
844
|
+
|
|
845
|
+
if (rootTextIsEffectivelyEmpty) {
|
|
798
846
|
const childScopeArray = Object.values(isolatedScopes.childScopes);
|
|
799
847
|
if (childScopeArray.length === 1) {
|
|
800
848
|
return childScopeArray[0];
|