@codeyam/codeyam-cli 0.1.0-staging.c90f8c9 → 0.1.0-staging.c9dc00c
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 +837 -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/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 +14 -1
- package/analyzer-template/packages/database/src/lib/kysely/tables/commitsTable.ts +6 -0
- package/analyzer-template/packages/database/src/lib/kysely/tables/labsRequestsTable.ts +52 -0
- 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 +12 -0
- package/analyzer-template/packages/database/src/lib/loadEntityBranches.ts +12 -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/updateCommitMetadata.ts +7 -14
- 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 +11 -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/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/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.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js +9 -0
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.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/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/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 +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/Commit.ts +2 -0
- 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/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 +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/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 +60 -12
- package/analyzer-template/project/writeSimpleRoot.ts +21 -11
- package/analyzer-template/scripts/comboWorkerLoop.cjs +98 -50
- 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/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 +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 +4 -0
- package/codeyam-cli/src/cli.js.map +1 -1
- package/codeyam-cli/src/commands/analyze.js +2 -0
- 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 +14 -4
- 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 +42 -184
- package/codeyam-cli/src/commands/init.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/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 +2 -0
- 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/analysisRunner.js +1 -1
- package/codeyam-cli/src/utils/analysisRunner.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 +4 -0
- package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/utils/install-skills.js +71 -46
- package/codeyam-cli/src/utils/install-skills.js.map +1 -1
- package/codeyam-cli/src/utils/labsAutoCheck.js +48 -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 +6 -0
- package/codeyam-cli/src/utils/rules/index.js.map +1 -0
- package/codeyam-cli/src/utils/rules/parser.js +83 -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 +20 -43
- 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 +31 -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-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-CN61MOMa.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.labs-survey-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.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-EVn6Z9pz.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-CmBYA0PH.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-aa4ff97b.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/memory-BSlqS1QA.js +81 -0
- package/codeyam-cli/src/webserver/build/client/assets/pause-D6vreykR.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/root-DVAbJY8B.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-BK-cnzp-.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-Cz2RkDCa.js +1 -0
- package/codeyam-cli/src/webserver/build/server/assets/server-build-CUVsWicu.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 +195 -496
- package/codeyam-cli/templates/codeyam:memory.md +403 -0
- package/codeyam-cli/templates/codeyam:new-rule.md +2 -2
- package/codeyam-cli/templates/codeyam:setup.md +12 -0
- 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 +136 -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 +654 -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/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 +11 -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/kysely/tables/labsRequestsTable.js +35 -0
- package/packages/database/src/lib/kysely/tables/labsRequestsTable.js.map +1 -0
- 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 +9 -0
- package/packages/database/src/lib/loadCommits.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/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/packages/database/src/lib/updateCommitMetadata.js +5 -4
- package/packages/database/src/lib/updateCommitMetadata.js.map +1 -1
- package/scripts/finalize-analyzer.cjs +8 -76
- 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/client/assets/settings-CS5f3WzT.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/index-uNNbimct.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-B08qC4Y7.js +0 -257
- package/codeyam-cli/templates/codeyam:power-rules.md +0 -449
- /package/codeyam-cli/src/webserver/build/client/assets/{api.rules-l0sNRNKZ.js → api.agent-transcripts-l0sNRNKZ.js} +0 -0
|
@@ -7,6 +7,84 @@ import { isArithmeticOperator, isAssignmentOperator, isBitwiseCompoundOperator,
|
|
|
7
7
|
import { processBindingPattern } from "./processBindings.js";
|
|
8
8
|
import { extractConditionalEffectsFromTernary, findUseStateSetters, } from "./conditionalEffectsExtractor.js";
|
|
9
9
|
import { detectArrayDerivedPattern } from "./arrayDerivationDetector.js";
|
|
10
|
+
/**
|
|
11
|
+
* Checks if a JSX element has props that reference variables from the parent scope.
|
|
12
|
+
* This is used to detect unconditionally-rendered children that should have their
|
|
13
|
+
* execution flows merged into the parent.
|
|
14
|
+
*
|
|
15
|
+
* We want to track children where the parent controls data that affects the child's
|
|
16
|
+
* conditional rendering. Static props (like title="Dashboard") don't need tracking
|
|
17
|
+
* because they don't create variable execution flows.
|
|
18
|
+
*
|
|
19
|
+
* Examples:
|
|
20
|
+
* - <WorkoutsView workouts={workouts} /> → true (workouts is a variable)
|
|
21
|
+
* - <ItemList items={items} count={count} /> → true (items, count are variables)
|
|
22
|
+
* - <Header title="Dashboard" /> → false (static string)
|
|
23
|
+
* - <Footer /> → false (no props)
|
|
24
|
+
* - <Button onClick={handleClick} /> → false (only callback, no data props)
|
|
25
|
+
*
|
|
26
|
+
* @returns true if the component has at least one prop that references a variable
|
|
27
|
+
* (excluding callbacks which typically start with 'on' or 'handle')
|
|
28
|
+
*/
|
|
29
|
+
function hasDataPropsFromParent(node, componentName) {
|
|
30
|
+
const attributes = ts.isJsxElement(node)
|
|
31
|
+
? node.openingElement.attributes.properties
|
|
32
|
+
: node.attributes.properties;
|
|
33
|
+
const dataProps = [];
|
|
34
|
+
for (const attr of attributes) {
|
|
35
|
+
// Spread attributes always reference parent data: {...props}
|
|
36
|
+
if (ts.isJsxSpreadAttribute(attr)) {
|
|
37
|
+
const spreadText = attr.expression?.getText() || '...spread';
|
|
38
|
+
dataProps.push(`{...${spreadText}}`);
|
|
39
|
+
console.log(`[UnconditionalChild] ${componentName}: Found spread attribute {${spreadText}}`);
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (ts.isJsxAttribute(attr)) {
|
|
43
|
+
const propName = attr.name.getText();
|
|
44
|
+
// Skip callback props - they don't create data-driven execution flows
|
|
45
|
+
// Callbacks typically start with 'on' (onClick, onChange) or 'handle' (handleSubmit)
|
|
46
|
+
if (propName.startsWith('on') ||
|
|
47
|
+
propName.startsWith('handle') ||
|
|
48
|
+
propName === 'ref') {
|
|
49
|
+
console.log(`[UnconditionalChild] ${componentName}: Skipping callback prop '${propName}'`);
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
// Check if the prop value is a JSX expression (references a variable)
|
|
53
|
+
// vs a string literal which is static
|
|
54
|
+
if (attr.initializer) {
|
|
55
|
+
if (ts.isJsxExpression(attr.initializer)) {
|
|
56
|
+
// JSX expression like prop={value} - this references a variable
|
|
57
|
+
// Could be a simple identifier, property access, or more complex expression
|
|
58
|
+
const expression = attr.initializer.expression;
|
|
59
|
+
if (expression) {
|
|
60
|
+
// Skip if it's just a function/arrow function (callback)
|
|
61
|
+
if (ts.isArrowFunction(expression) ||
|
|
62
|
+
ts.isFunctionExpression(expression)) {
|
|
63
|
+
console.log(`[UnconditionalChild] ${componentName}: Skipping inline callback prop '${propName}'`);
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
// This is a data prop that references parent state/props
|
|
67
|
+
const exprText = expression.getText();
|
|
68
|
+
dataProps.push(`${propName}={${exprText}}`);
|
|
69
|
+
console.log(`[UnconditionalChild] ${componentName}: Found data prop '${propName}' = {${exprText}}`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
// String literals like prop="value" are static
|
|
74
|
+
console.log(`[UnconditionalChild] ${componentName}: Skipping static prop '${propName}'`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
const hasDataProps = dataProps.length > 0;
|
|
80
|
+
if (hasDataProps) {
|
|
81
|
+
console.log(`[UnconditionalChild] ${componentName}: Has ${dataProps.length} data props: [${dataProps.join(', ')}]`);
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
console.log(`[UnconditionalChild] ${componentName}: No data props found, will NOT track`);
|
|
85
|
+
}
|
|
86
|
+
return { hasDataProps, dataProps };
|
|
87
|
+
}
|
|
10
88
|
/**
|
|
11
89
|
* Extracts the component name from a JSX element.
|
|
12
90
|
* Returns null for intrinsic elements (div, span, etc.) since we only care about
|
|
@@ -690,18 +768,40 @@ function extractConditionalsFromJsx(node, context, parentConditions = []) {
|
|
|
690
768
|
// Recursively process nested JSX elements - Fix 32: pass parent conditions
|
|
691
769
|
else if (ts.isJsxElement(child)) {
|
|
692
770
|
// 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
771
|
const componentName = getComponentNameFromJsx(child);
|
|
695
|
-
if (componentName
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
772
|
+
if (componentName) {
|
|
773
|
+
if (parentConditions.length > 0) {
|
|
774
|
+
// If there are parent conditions, record them as gating conditions
|
|
775
|
+
console.log(`[ChildBoundary] ${componentName}: Conditionally rendered with ${parentConditions.length} gating conditions`);
|
|
776
|
+
for (const condition of parentConditions) {
|
|
777
|
+
console.log(`[ChildBoundary] ${componentName}: Adding gating condition path='${condition.path}' isNegated=${condition.isNegated}`);
|
|
778
|
+
context.addChildBoundaryGatingCondition(componentName, {
|
|
779
|
+
path: condition.path,
|
|
780
|
+
conditionType: 'truthiness',
|
|
781
|
+
location: 'ternary',
|
|
782
|
+
sourceLocation: condition.sourceLocation,
|
|
783
|
+
controlsJsxRendering: true,
|
|
784
|
+
isNegated: condition.isNegated,
|
|
785
|
+
});
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
else {
|
|
789
|
+
// No parent conditions - check if it has data props for unconditional tracking
|
|
790
|
+
console.log(`[ChildBoundary] ${componentName}: Checking for unconditional rendering with data props...`);
|
|
791
|
+
const { hasDataProps, dataProps } = hasDataPropsFromParent(child, componentName);
|
|
792
|
+
if (hasDataProps) {
|
|
793
|
+
// Fix: Track unconditionally-rendered children that receive data props
|
|
794
|
+
// These need to be tracked for flow merging even without gating conditions
|
|
795
|
+
// Example: <WorkoutsView workouts={workouts} /> - parent controls workouts data
|
|
796
|
+
console.log(`[ChildBoundary] ${componentName}: TRACKING as unconditionally-rendered with data props: [${dataProps.join(', ')}]`);
|
|
797
|
+
context.addChildBoundaryGatingCondition(componentName, {
|
|
798
|
+
path: '__unconditional__',
|
|
799
|
+
conditionType: 'truthiness',
|
|
800
|
+
location: 'unconditional',
|
|
801
|
+
controlsJsxRendering: true,
|
|
802
|
+
isNegated: false,
|
|
803
|
+
});
|
|
804
|
+
}
|
|
705
805
|
}
|
|
706
806
|
}
|
|
707
807
|
extractConditionalsFromJsx(child, context, parentConditions);
|
|
@@ -709,18 +809,38 @@ function extractConditionalsFromJsx(node, context, parentConditions = []) {
|
|
|
709
809
|
// Handle self-closing JSX elements (e.g., <ScenarioViewer />)
|
|
710
810
|
else if (ts.isJsxSelfClosingElement(child)) {
|
|
711
811
|
// 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
812
|
const componentName = getComponentNameFromJsx(child);
|
|
714
|
-
if (componentName
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
813
|
+
if (componentName) {
|
|
814
|
+
if (parentConditions.length > 0) {
|
|
815
|
+
// If there are parent conditions, record them as gating conditions
|
|
816
|
+
console.log(`[ChildBoundary] ${componentName}: Conditionally rendered (self-closing) with ${parentConditions.length} gating conditions`);
|
|
817
|
+
for (const condition of parentConditions) {
|
|
818
|
+
console.log(`[ChildBoundary] ${componentName}: Adding gating condition path='${condition.path}' isNegated=${condition.isNegated}`);
|
|
819
|
+
context.addChildBoundaryGatingCondition(componentName, {
|
|
820
|
+
path: condition.path,
|
|
821
|
+
conditionType: 'truthiness',
|
|
822
|
+
location: 'ternary',
|
|
823
|
+
sourceLocation: condition.sourceLocation,
|
|
824
|
+
controlsJsxRendering: true,
|
|
825
|
+
isNegated: condition.isNegated,
|
|
826
|
+
});
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
else {
|
|
830
|
+
// No parent conditions - check if it has data props for unconditional tracking
|
|
831
|
+
console.log(`[ChildBoundary] ${componentName}: Checking for unconditional rendering (self-closing) with data props...`);
|
|
832
|
+
const { hasDataProps, dataProps } = hasDataPropsFromParent(child, componentName);
|
|
833
|
+
if (hasDataProps) {
|
|
834
|
+
// Fix: Track unconditionally-rendered children that receive data props
|
|
835
|
+
console.log(`[ChildBoundary] ${componentName}: TRACKING as unconditionally-rendered (self-closing) with data props: [${dataProps.join(', ')}]`);
|
|
836
|
+
context.addChildBoundaryGatingCondition(componentName, {
|
|
837
|
+
path: '__unconditional__',
|
|
838
|
+
conditionType: 'truthiness',
|
|
839
|
+
location: 'unconditional',
|
|
840
|
+
controlsJsxRendering: true,
|
|
841
|
+
isNegated: false,
|
|
842
|
+
});
|
|
843
|
+
}
|
|
724
844
|
}
|
|
725
845
|
}
|
|
726
846
|
// Self-closing elements have no children, so no recursion needed
|
|
@@ -1086,15 +1206,21 @@ export function processExpression({ node, context, targetPath, typeHint, }) {
|
|
|
1086
1206
|
const equivalentVariables = context.getEquivalentVariables();
|
|
1087
1207
|
const structure = context.getStructure();
|
|
1088
1208
|
// Propagate existing equivalencies for sub-properties
|
|
1089
|
-
for (const [key,
|
|
1209
|
+
for (const [key, rawValue] of Object.entries(equivalentVariables)) {
|
|
1090
1210
|
// Check if this equivalency is for a sub-property of the identifier
|
|
1091
1211
|
// e.g., completeDataStructure['Function Arguments'] or completeDataStructure.foo
|
|
1092
1212
|
if (key.startsWith(nodePathStr + '.') ||
|
|
1093
1213
|
key.startsWith(nodePathStr + '[')) {
|
|
1094
1214
|
const subPath = key.substring(nodePathStr.length);
|
|
1095
1215
|
const newTargetPath = StructuredPath.fromBase(targetPath.toString() + subPath);
|
|
1096
|
-
|
|
1097
|
-
|
|
1216
|
+
// Handle both string and string[] values
|
|
1217
|
+
const values = Array.isArray(rawValue) ? rawValue : [rawValue];
|
|
1218
|
+
for (const value of values) {
|
|
1219
|
+
if (typeof value === 'string') {
|
|
1220
|
+
const valuePath = StructuredPath.fromBase(value);
|
|
1221
|
+
context.addEquivalence(newTargetPath, valuePath);
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1098
1224
|
}
|
|
1099
1225
|
}
|
|
1100
1226
|
// Propagate existing structure entries for sub-properties
|
|
@@ -1436,20 +1562,38 @@ export function processExpression({ node, context, targetPath, typeHint, }) {
|
|
|
1436
1562
|
// - items[] (from the find result)
|
|
1437
1563
|
// - null (from the fallback)
|
|
1438
1564
|
if (targetPath) {
|
|
1439
|
-
//
|
|
1565
|
+
// Get paths for both sides
|
|
1566
|
+
const leftPath = StructuredPath.fromNode(unwrappedNode.left, context.sourceFile);
|
|
1567
|
+
const rightPath = StructuredPath.fromNode(unwrappedNode.right, context.sourceFile);
|
|
1568
|
+
// Collect all valid paths
|
|
1569
|
+
const allPaths = [];
|
|
1570
|
+
if (leftPath)
|
|
1571
|
+
allPaths.push(leftPath);
|
|
1572
|
+
if (rightPath)
|
|
1573
|
+
allPaths.push(rightPath);
|
|
1574
|
+
// Add multiple equivalencies to track both sources
|
|
1575
|
+
if (allPaths.length > 0) {
|
|
1576
|
+
context.addMultipleEquivalencies(targetPath, allPaths);
|
|
1577
|
+
}
|
|
1578
|
+
// Process both sides to capture their internal structures
|
|
1440
1579
|
processExpression({
|
|
1441
1580
|
node: unwrappedNode.left,
|
|
1442
1581
|
context,
|
|
1443
|
-
targetPath,
|
|
1444
1582
|
});
|
|
1445
|
-
// Process right side recursively for completeness
|
|
1446
1583
|
processExpression({
|
|
1447
1584
|
node: unwrappedNode.right,
|
|
1448
1585
|
context,
|
|
1449
|
-
targetPath,
|
|
1450
1586
|
});
|
|
1451
|
-
//
|
|
1452
|
-
|
|
1587
|
+
// Register the type for the target path
|
|
1588
|
+
const leftType = context.inferTypeFromNode(unwrappedNode.left);
|
|
1589
|
+
const rightType = context.inferTypeFromNode(unwrappedNode.right);
|
|
1590
|
+
const orResultType = isDefinedType(leftType)
|
|
1591
|
+
? leftType
|
|
1592
|
+
: rightType || 'unknown';
|
|
1593
|
+
context.addType(targetPath, orResultType);
|
|
1594
|
+
// Return early - we've already handled equivalencies with addMultipleEquivalencies
|
|
1595
|
+
// Don't fall through to the generic addEquivalence call below
|
|
1596
|
+
return true;
|
|
1453
1597
|
}
|
|
1454
1598
|
// Note: When there's no targetPath, we don't recursively process
|
|
1455
1599
|
// because || is often used in boolean contexts where the full expression matters
|
|
@@ -1529,18 +1673,44 @@ export function processExpression({ node, context, targetPath, typeHint, }) {
|
|
|
1529
1673
|
const semantics = semanticsList[0];
|
|
1530
1674
|
// Get the source expression path (e.g., the object for obj.method())
|
|
1531
1675
|
const sourceExpr = unwrappedNode.expression.expression;
|
|
1532
|
-
const
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
const
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1676
|
+
const unwrappedSourceExpr = unwrapExpression(sourceExpr);
|
|
1677
|
+
// When the source is a ternary expression like (cond ? arr : arr.slice()),
|
|
1678
|
+
// apply method semantics to BOTH branches directly. The ternary itself isn't
|
|
1679
|
+
// a variable - it's just a choice between two paths that both flow to the result.
|
|
1680
|
+
if (ts.isConditionalExpression(unwrappedSourceExpr)) {
|
|
1681
|
+
const branches = [
|
|
1682
|
+
unwrappedSourceExpr.whenTrue,
|
|
1683
|
+
unwrappedSourceExpr.whenFalse,
|
|
1684
|
+
];
|
|
1685
|
+
for (const branch of branches) {
|
|
1686
|
+
const branchPath = StructuredPath.fromNode(branch, context.sourceFile);
|
|
1687
|
+
if (branchPath) {
|
|
1688
|
+
const isArraySemantics = semantics instanceof ArrayPushSemantics;
|
|
1689
|
+
const shouldApply = !isArraySemantics ||
|
|
1690
|
+
isLikelyArrayType(branch, context.typeChecker);
|
|
1691
|
+
if (shouldApply) {
|
|
1692
|
+
semantics.addEquivalences(callPath, branchPath, context);
|
|
1693
|
+
returnType = semantics.getReturnType();
|
|
1694
|
+
handledBySemantics = true;
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1697
|
+
}
|
|
1698
|
+
}
|
|
1699
|
+
else {
|
|
1700
|
+
// Regular (non-ternary) source expression
|
|
1701
|
+
const sourcePath = StructuredPath.fromNode(sourceExpr, context.sourceFile);
|
|
1702
|
+
if (sourcePath) {
|
|
1703
|
+
// For array-specific semantics (like push), verify the source is actually an array
|
|
1704
|
+
// This prevents router.push() from being mistakenly treated as Array.push()
|
|
1705
|
+
const isArraySemantics = semantics instanceof ArrayPushSemantics;
|
|
1706
|
+
const shouldApply = !isArraySemantics ||
|
|
1707
|
+
isLikelyArrayType(sourceExpr, context.typeChecker);
|
|
1708
|
+
if (shouldApply) {
|
|
1709
|
+
// Apply method semantics
|
|
1710
|
+
semantics.addEquivalences(callPath, sourcePath, context);
|
|
1711
|
+
returnType = semantics.getReturnType();
|
|
1712
|
+
handledBySemantics = true;
|
|
1713
|
+
}
|
|
1544
1714
|
}
|
|
1545
1715
|
}
|
|
1546
1716
|
}
|
|
@@ -1969,6 +2139,32 @@ export function processExpression({ node, context, targetPath, typeHint, }) {
|
|
|
1969
2139
|
}
|
|
1970
2140
|
// Handle Arrow Functions: (p) => p.prop, (a, b) => { ... }
|
|
1971
2141
|
if (ts.isArrowFunction(unwrappedNode)) {
|
|
2142
|
+
// If this arrow function is a child boundary (e.g., a .map() callback),
|
|
2143
|
+
// don't process its parameters here - they will be processed when the
|
|
2144
|
+
// child scope is analyzed separately. This prevents parameter variables
|
|
2145
|
+
// from leaking into the parent scope's equivalencies.
|
|
2146
|
+
// Check if this arrow function is a child boundary (i.e., should be processed
|
|
2147
|
+
// as a separate child scope, not here in the parent scope).
|
|
2148
|
+
//
|
|
2149
|
+
// We use two checks because childBoundary positions can be unreliable:
|
|
2150
|
+
// 1. Position-based check (standard isChildBoundary)
|
|
2151
|
+
// 2. Text-based check: if the arrow function text doesn't appear in the
|
|
2152
|
+
// statement text, it was replaced with a cyScope placeholder
|
|
2153
|
+
const isChildBoundary = context.isChildBoundary(unwrappedNode);
|
|
2154
|
+
// Text-based child scope detection for when positions are unreliable
|
|
2155
|
+
const arrowFnText = unwrappedNode.getText(context.sourceFile);
|
|
2156
|
+
const firstLine = arrowFnText.split('\n')[0].trim();
|
|
2157
|
+
const searchText = firstLine.substring(0, Math.min(20, firstLine.length));
|
|
2158
|
+
const isInStatementText = context.statementInfo.text.includes(searchText);
|
|
2159
|
+
const isChildScope = !isInStatementText && arrowFnText.length > 10;
|
|
2160
|
+
if (isChildBoundary || isChildScope) {
|
|
2161
|
+
// The method semantics (e.g., ArrayMapSemantics) have already established
|
|
2162
|
+
// the necessary equivalences between the child scope placeholder and array elements
|
|
2163
|
+
if (targetPath) {
|
|
2164
|
+
context.addType(targetPath, 'function');
|
|
2165
|
+
}
|
|
2166
|
+
return true;
|
|
2167
|
+
}
|
|
1972
2168
|
// Create a path for the function
|
|
1973
2169
|
const functionPath = StructuredPath.empty();
|
|
1974
2170
|
// Process parameters
|