@codeyam/codeyam-cli 0.1.0-staging.036391e → 0.1.0-staging.039fa00
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 +19 -19
- package/analyzer-template/packages/ai/index.ts +1 -0
- package/analyzer-template/packages/ai/package.json +2 -2
- package/analyzer-template/packages/ai/src/lib/analyzeScope.ts +14 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/astScopeAnalyzer.ts +34 -3
- package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +101 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/sharedPatterns.ts +28 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/types.ts +6 -0
- package/analyzer-template/packages/ai/src/lib/completionCall.ts +114 -113
- package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +435 -13
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.ts +62 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.ts +70 -19
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.ts +35 -0
- package/analyzer-template/packages/ai/src/lib/dataStructureChunking.ts +40 -13
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +110 -7
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +134 -2
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionals.ts +359 -142
- package/analyzer-template/packages/ai/src/lib/mergeJsonTypeDefinitions.ts +5 -0
- package/analyzer-template/packages/ai/src/lib/promptGenerators/collapseNullableObjects.ts +118 -0
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.ts +24 -4
- package/analyzer-template/packages/analyze/src/lib/ProjectAnalyzer.ts +6 -0
- package/analyzer-template/packages/analyze/src/lib/asts/nodes/getNodeType.ts +1 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +18 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +9 -1
- package/analyzer-template/packages/analyze/src/lib/files/analyze/dependencyResolver.ts +0 -6
- package/analyzer-template/packages/analyze/src/lib/files/analyze/findOrCreateEntity.ts +12 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/TransformationTracer.ts +65 -28
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.ts +50 -25
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +83 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +176 -80
- package/analyzer-template/packages/aws/package.json +10 -10
- package/analyzer-template/packages/database/index.ts +1 -0
- package/analyzer-template/packages/database/package.json +3 -3
- 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 +8 -0
- package/analyzer-template/packages/database/src/lib/kysely/tables/debugReportsTable.ts +1 -1
- package/analyzer-template/packages/database/src/lib/kysely/tables/editorScenariosTable.ts +62 -0
- package/analyzer-template/packages/database/src/lib/loadCommits.ts +31 -20
- package/analyzer-template/packages/database/src/lib/loadReadyToBeCapturedAnalyses.ts +0 -5
- 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 +151 -135
- package/analyzer-template/packages/database/src/lib/updateFreshAnalysisStatus.ts +58 -42
- package/analyzer-template/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.ts +81 -65
- package/analyzer-template/packages/database/src/lib/userScenarioToDb.ts +1 -1
- package/analyzer-template/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.ts +29 -1
- package/analyzer-template/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.ts +33 -5
- package/analyzer-template/packages/github/dist/database/index.d.ts +1 -0
- package/analyzer-template/packages/github/dist/database/index.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/index.js +1 -0
- package/analyzer-template/packages/github/dist/database/index.js.map +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 +5 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.d.ts +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts +20 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts.map +1 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js +45 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts +5 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js +23 -13
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js +1 -4
- package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.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.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js +100 -89
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.js +41 -30
- package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.js +68 -57
- package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.js.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +29 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +33 -5
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/ProjectMetadata.d.ts +1 -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/Scenario.d.ts +10 -0
- package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts.map +1 -1
- package/analyzer-template/packages/github/package.json +1 -1
- package/analyzer-template/packages/types/src/types/ProjectMetadata.ts +1 -0
- package/analyzer-template/packages/types/src/types/Scenario.ts +10 -0
- package/analyzer-template/packages/utils/dist/types/src/types/ProjectMetadata.d.ts +1 -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/Scenario.d.ts +10 -0
- package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js +98 -3
- package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js.map +1 -1
- package/analyzer-template/packages/utils/src/lib/fs/rsyncCopy.ts +121 -3
- package/analyzer-template/playwright/captureFromUrl.ts +89 -82
- package/analyzer-template/project/constructMockCode.ts +170 -50
- package/analyzer-template/project/orchestrateCapture.ts +4 -1
- package/analyzer-template/project/reconcileMockDataKeys.ts +19 -14
- package/analyzer-template/project/start.ts +3 -0
- package/analyzer-template/project/startScenarioCapture.ts +9 -0
- package/analyzer-template/project/writeClientLogRoute.ts +125 -0
- package/analyzer-template/project/writeMockDataTsx.ts +17 -0
- package/analyzer-template/project/writeScenarioComponents.ts +110 -17
- package/analyzer-template/tsconfig.json +13 -1
- package/background/src/lib/local/createLocalAnalyzer.js +1 -1
- package/background/src/lib/local/createLocalAnalyzer.js.map +1 -1
- package/background/src/lib/virtualized/project/constructMockCode.js +145 -41
- package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture.js +4 -1
- package/background/src/lib/virtualized/project/orchestrateCapture.js.map +1 -1
- package/background/src/lib/virtualized/project/reconcileMockDataKeys.js +17 -11
- package/background/src/lib/virtualized/project/reconcileMockDataKeys.js.map +1 -1
- package/background/src/lib/virtualized/project/start.js +2 -0
- package/background/src/lib/virtualized/project/start.js.map +1 -1
- package/background/src/lib/virtualized/project/startScenarioCapture.js +5 -0
- package/background/src/lib/virtualized/project/startScenarioCapture.js.map +1 -1
- package/background/src/lib/virtualized/project/writeClientLogRoute.js +110 -0
- package/background/src/lib/virtualized/project/writeClientLogRoute.js.map +1 -0
- package/background/src/lib/virtualized/project/writeMockDataTsx.js +12 -0
- package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
- package/background/src/lib/virtualized/project/writeScenarioComponents.js +83 -12
- package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
- package/codeyam-cli/scripts/apply-setup.js +209 -12
- package/codeyam-cli/scripts/apply-setup.js.map +1 -1
- package/codeyam-cli/src/cli.js +33 -24
- package/codeyam-cli/src/cli.js.map +1 -1
- package/codeyam-cli/src/codeyam-cli.js +18 -2
- package/codeyam-cli/src/codeyam-cli.js.map +1 -1
- package/codeyam-cli/src/commands/analyze.js +21 -9
- 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 +2 -0
- package/codeyam-cli/src/commands/debug.js.map +1 -1
- package/codeyam-cli/src/commands/default.js +87 -21
- package/codeyam-cli/src/commands/default.js.map +1 -1
- package/codeyam-cli/src/commands/editor.js +1839 -0
- package/codeyam-cli/src/commands/editor.js.map +1 -0
- package/codeyam-cli/src/commands/init.js +81 -260
- package/codeyam-cli/src/commands/init.js.map +1 -1
- package/codeyam-cli/src/commands/memory.js +95 -81
- package/codeyam-cli/src/commands/memory.js.map +1 -1
- package/codeyam-cli/src/commands/recapture.js +2 -0
- package/codeyam-cli/src/commands/recapture.js.map +1 -1
- package/codeyam-cli/src/commands/setup-sandbox.js +2 -0
- package/codeyam-cli/src/commands/setup-sandbox.js.map +1 -1
- package/codeyam-cli/src/commands/setup-simulations.js +284 -0
- package/codeyam-cli/src/commands/setup-simulations.js.map +1 -0
- package/codeyam-cli/src/commands/test-startup.js +2 -0
- package/codeyam-cli/src/commands/test-startup.js.map +1 -1
- package/codeyam-cli/src/commands/verify.js +14 -2
- package/codeyam-cli/src/commands/verify.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +246 -0
- package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js +126 -0
- package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorJournal.test.js +295 -0
- package/codeyam-cli/src/utils/__tests__/editorJournal.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorMockState.test.js +270 -0
- package/codeyam-cli/src/utils/__tests__/editorMockState.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js +100 -0
- package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorPreview.test.js +147 -0
- package/codeyam-cli/src/utils/__tests__/editorPreview.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js +76 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/git.editor.test.js +134 -0
- package/codeyam-cli/src/utils/__tests__/git.editor.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/npmVersionCheck.test.js +185 -0
- package/codeyam-cli/src/utils/__tests__/npmVersionCheck.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/pathIgnoring.test.js +9 -0
- package/codeyam-cli/src/utils/__tests__/pathIgnoring.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/project.test.js +65 -0
- package/codeyam-cli/src/utils/__tests__/project.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/scenarioMarkers.test.js +121 -0
- package/codeyam-cli/src/utils/__tests__/scenarioMarkers.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +154 -86
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
- package/codeyam-cli/src/utils/analyzer.js +7 -0
- package/codeyam-cli/src/utils/analyzer.js.map +1 -1
- package/codeyam-cli/src/utils/backgroundServer.js +109 -26
- package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/utils/buildFlags.js +4 -0
- package/codeyam-cli/src/utils/buildFlags.js.map +1 -0
- package/codeyam-cli/src/utils/devModeEvents.js +40 -0
- package/codeyam-cli/src/utils/devModeEvents.js.map +1 -0
- package/codeyam-cli/src/utils/editorAudit.js +82 -0
- package/codeyam-cli/src/utils/editorAudit.js.map +1 -0
- package/codeyam-cli/src/utils/editorDevServer.js +98 -0
- package/codeyam-cli/src/utils/editorDevServer.js.map +1 -0
- package/codeyam-cli/src/utils/editorJournal.js +137 -0
- package/codeyam-cli/src/utils/editorJournal.js.map +1 -0
- package/codeyam-cli/src/utils/editorMockState.js +248 -0
- package/codeyam-cli/src/utils/editorMockState.js.map +1 -0
- package/codeyam-cli/src/utils/editorPreloadHelpers.js +64 -0
- package/codeyam-cli/src/utils/editorPreloadHelpers.js.map +1 -0
- package/codeyam-cli/src/utils/editorPreview.js +66 -0
- package/codeyam-cli/src/utils/editorPreview.js.map +1 -0
- package/codeyam-cli/src/utils/editorScenarios.js +56 -0
- package/codeyam-cli/src/utils/editorScenarios.js.map +1 -0
- package/codeyam-cli/src/utils/fileMetadata.js +5 -0
- package/codeyam-cli/src/utils/fileMetadata.js.map +1 -1
- package/codeyam-cli/src/utils/fileWatcher.js +25 -9
- package/codeyam-cli/src/utils/fileWatcher.js.map +1 -1
- package/codeyam-cli/src/utils/generateReport.js +2 -2
- package/codeyam-cli/src/utils/git.js +103 -0
- package/codeyam-cli/src/utils/git.js.map +1 -1
- package/codeyam-cli/src/utils/install-skills.js +87 -65
- package/codeyam-cli/src/utils/install-skills.js.map +1 -1
- package/codeyam-cli/src/utils/interactiveSyncWatcher.js +126 -0
- package/codeyam-cli/src/utils/interactiveSyncWatcher.js.map +1 -0
- package/codeyam-cli/src/utils/labsAutoCheck.js +0 -29
- package/codeyam-cli/src/utils/labsAutoCheck.js.map +1 -1
- package/codeyam-cli/src/utils/npmVersionCheck.js +76 -0
- package/codeyam-cli/src/utils/npmVersionCheck.js.map +1 -0
- package/codeyam-cli/src/utils/pathIgnoring.js +19 -7
- package/codeyam-cli/src/utils/pathIgnoring.js.map +1 -1
- package/codeyam-cli/src/utils/progress.js +7 -0
- package/codeyam-cli/src/utils/progress.js.map +1 -1
- package/codeyam-cli/src/utils/project.js +15 -5
- package/codeyam-cli/src/utils/project.js.map +1 -1
- package/codeyam-cli/src/utils/queue/__tests__/heartbeat.test.js +11 -11
- package/codeyam-cli/src/utils/queue/__tests__/heartbeat.test.js.map +1 -1
- package/codeyam-cli/src/utils/queue/__tests__/manager.test.js +22 -0
- package/codeyam-cli/src/utils/queue/__tests__/manager.test.js.map +1 -1
- package/codeyam-cli/src/utils/queue/heartbeat.js +13 -5
- package/codeyam-cli/src/utils/queue/heartbeat.js.map +1 -1
- package/codeyam-cli/src/utils/queue/job.js +70 -1
- package/codeyam-cli/src/utils/queue/job.js.map +1 -1
- package/codeyam-cli/src/utils/queue/manager.js +7 -6
- package/codeyam-cli/src/utils/queue/manager.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__/contextBuilder.test.js +7 -8
- package/codeyam-cli/src/utils/ruleReflection/__tests__/contextBuilder.test.js.map +1 -1
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/assertRules.js +1 -1
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/assertRules.js.map +1 -1
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/setupTempProject.js +0 -1
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/setupTempProject.js.map +1 -1
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/ruleReflectionE2E.test.js +97 -6
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/ruleReflectionE2E.test.js.map +1 -1
- package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.js +4 -6
- package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.js.map +1 -1
- package/codeyam-cli/src/utils/ruleReflection/contextBuilder.js +3 -3
- package/codeyam-cli/src/utils/ruleReflection/contextBuilder.js.map +1 -1
- package/codeyam-cli/src/utils/rules/__tests__/parser.test.js +83 -0
- package/codeyam-cli/src/utils/rules/__tests__/parser.test.js.map +1 -0
- package/codeyam-cli/src/utils/rules/__tests__/pathMatcher.test.js +118 -0
- package/codeyam-cli/src/utils/rules/__tests__/pathMatcher.test.js.map +1 -0
- package/codeyam-cli/src/utils/rules/__tests__/rulePlacement.test.js +72 -0
- package/codeyam-cli/src/utils/rules/__tests__/rulePlacement.test.js.map +1 -0
- package/codeyam-cli/src/utils/rules/__tests__/ruleState.test.js +23 -23
- package/codeyam-cli/src/utils/rules/__tests__/ruleState.test.js.map +1 -1
- package/codeyam-cli/src/utils/rules/__tests__/sourceFiles.test.js +76 -0
- package/codeyam-cli/src/utils/rules/__tests__/sourceFiles.test.js.map +1 -0
- package/codeyam-cli/src/utils/rules/index.js +1 -0
- package/codeyam-cli/src/utils/rules/index.js.map +1 -1
- package/codeyam-cli/src/utils/rules/parser.js +19 -4
- package/codeyam-cli/src/utils/rules/parser.js.map +1 -1
- package/codeyam-cli/src/utils/rules/pathMatcher.js +34 -3
- package/codeyam-cli/src/utils/rules/pathMatcher.js.map +1 -1
- package/codeyam-cli/src/utils/rules/rulePlacement.js +65 -0
- package/codeyam-cli/src/utils/rules/rulePlacement.js.map +1 -0
- package/codeyam-cli/src/utils/rules/ruleState.js +10 -10
- package/codeyam-cli/src/utils/rules/ruleState.js.map +1 -1
- package/codeyam-cli/src/utils/rules/sourceFiles.js +43 -0
- package/codeyam-cli/src/utils/rules/sourceFiles.js.map +1 -0
- package/codeyam-cli/src/utils/rules/staleness.js +6 -6
- package/codeyam-cli/src/utils/rules/staleness.js.map +1 -1
- package/codeyam-cli/src/utils/scenarioMarkers.js +134 -0
- package/codeyam-cli/src/utils/scenarioMarkers.js.map +1 -0
- package/codeyam-cli/src/utils/serverState.js +64 -12
- package/codeyam-cli/src/utils/serverState.js.map +1 -1
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +61 -43
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
- package/codeyam-cli/src/utils/simulationGateMiddleware.js +159 -0
- package/codeyam-cli/src/utils/simulationGateMiddleware.js.map +1 -0
- package/codeyam-cli/src/utils/syncMocksMiddleware.js +5 -24
- package/codeyam-cli/src/utils/syncMocksMiddleware.js.map +1 -1
- package/codeyam-cli/src/utils/testRunner.js +158 -0
- package/codeyam-cli/src/utils/testRunner.js.map +1 -0
- package/codeyam-cli/src/utils/transcriptPruning.js +67 -0
- package/codeyam-cli/src/utils/transcriptPruning.js.map +1 -0
- package/codeyam-cli/src/utils/versionInfo.js +46 -0
- package/codeyam-cli/src/utils/versionInfo.js.map +1 -1
- package/codeyam-cli/src/utils/webappDetection.js +14 -2
- package/codeyam-cli/src/utils/webappDetection.js.map +1 -1
- package/codeyam-cli/src/webserver/__tests__/dependency-smoke.test.js +66 -0
- package/codeyam-cli/src/webserver/__tests__/dependency-smoke.test.js.map +1 -0
- package/codeyam-cli/src/webserver/app/lib/database.js +55 -30
- package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
- package/codeyam-cli/src/webserver/app/lib/dbNotifier.js.map +1 -1
- package/codeyam-cli/src/webserver/backgroundServer.js +144 -25
- package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/webserver/bootstrap.js +11 -0
- package/codeyam-cli/src/webserver/bootstrap.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{CopyButton-CA3JxPb7.js → CopyButton-DmJveP3T.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-B86KKU7e.js → EntityItem-C76mRRiF.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-B5ctlSYt.js → EntityTypeBadge-g3saevPb.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-BqY8gDAW.js → EntityTypeIcon-CobE682z.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-Bu6c6aDe.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-BDhPilK7.js → InteractivePreview-DYFW3lDD.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-VeqEBv9v.js → LibraryFunctionPreview-DLeucoVX.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-Bs7Nn1Jr.js → LoadingDots-BU_OAEMP.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-Bm3PmcCz.js → LogViewer-ceAyBX-H.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-C6PKeMYR.js → ReportIssueModal-djPLI-WV.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-Gq3Ocjo6.js → SafeScreenshot-BED4B6sP.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-BNLaXBHR.js → ScenarioViewer-B76aig_2.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/Spinner-Bb5uFQ5V.js +34 -0
- package/codeyam-cli/src/webserver/build/client/assets/Terminal-Dnj5CY9R.js +41 -0
- package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-CiwXDxLh.js → TruncatedFilePath-C8OKAR5x.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{_index-B3TDXxnk.js → _index-C96V0n15.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-BtBFH820.js → activity.(_tab)-BpKzcsJz.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/addon-fit-CUXOrorO.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/addon-web-links-Duc5hnl7.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/agent-transcripts-D9hemwl6.js +22 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-audit-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-capture-scenario-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-client-errors-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-commit-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-dev-server-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-entity-status-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-entry-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-image._-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-screenshot-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-update-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-load-commit-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-refresh-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-register-scenario-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-data-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-image._-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenarios-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-switch-scenario-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-test-results-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.rule-path-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{book-open-PttOB2SF.js → book-open-D_nMCFmP.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-TJp6ofnp.js → chevron-down-BH2h1Ea2.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{chunk-JZWAC4HX-JE9ZIoBl.js → chunk-JZWAC4HX-C4pqxYJB.js} +9 -9
- package/codeyam-cli/src/webserver/build/client/assets/{circle-check-CXhHQYrI.js → circle-check-DyIKORY6.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{copy-6y9ALfGT.js → copy-NDbZjXao.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-Ca9fAY46.js → createLucideIcon-CMT1jU2q.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-BiM6z3Do.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/editor-D1DAKXtT.js +8 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-n38keI1k.js → entity._sha._-CrjR3zZW.js} +10 -10
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-DkzqFzFj.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-C28BiQzt.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-p9hhkjJM.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-38yPijoD.js → entity._sha_.edit._scenarioId-BMvVHNXU.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{entry.client-BSHEfydn.js → entry.client-DTvKq3TY.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{fileTableUtils-DCPhhSMo.js → fileTableUtils-cPo8LiG3.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{files-0N0YJQv7.js → files-DO4CZ16O.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{git-DXnyr8uP.js → git-CFCTYk9I.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/globals-B17TBSS6.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{index-ChN9-fAY.js → index-10oVnAAH.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{index-CcsFv748.js → index-BcvgDzbZ.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/labs-Zk7ryIM1.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-CTqLEAGU.js → loader-circle-BAXYRVEO.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-a632de18.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/memory-Dg0mvYrI.js +96 -0
- package/codeyam-cli/src/webserver/build/client/assets/{pause-D6vreykR.js → pause-DTAcYxBt.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/root-DUKqhFlb.js +67 -0
- package/codeyam-cli/src/webserver/build/client/assets/{search-B8VUL8nl.js → search-fKo7v0Zo.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/settings-DfuTtcJP.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{simulations-CPoAg7Zo.js → simulations-B3aOzpCZ.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{terminal-BrCP7uQo.js → terminal-BG4heKCG.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-BZz2NjYa.js → triangle-alert-DtSmdtM4.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useCustomSizes-DNwUduNu.js → useCustomSizes-ByhSyh0W.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-C14nCb1q.js +2 -0
- package/codeyam-cli/src/webserver/build/client/assets/{useReportContext-CpZgwliL.js → useReportContext-O-jkvSPx.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useToast-Bv9JFvUO.js → useToast-9FIWuYfK.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/xterm-BqvuqXEL.js +27 -0
- package/codeyam-cli/src/webserver/build/server/assets/index-HfLydfDq.js +1 -0
- package/codeyam-cli/src/webserver/build/server/assets/server-build-CUu_F-oo.js +366 -0
- package/codeyam-cli/src/webserver/build/server/index.js +1 -1
- package/codeyam-cli/src/webserver/build-info.json +5 -5
- package/codeyam-cli/src/webserver/devServer.js +39 -5
- package/codeyam-cli/src/webserver/devServer.js.map +1 -1
- package/codeyam-cli/src/webserver/editorProxy.js +440 -0
- package/codeyam-cli/src/webserver/editorProxy.js.map +1 -0
- package/codeyam-cli/src/webserver/scripts/codeyam-preload.mjs +175 -0
- package/codeyam-cli/src/webserver/scripts/journalCapture.ts +140 -0
- package/codeyam-cli/src/webserver/server.js +226 -1
- package/codeyam-cli/src/webserver/server.js.map +1 -1
- package/codeyam-cli/src/webserver/terminalServer.js +698 -0
- package/codeyam-cli/src/webserver/terminalServer.js.map +1 -0
- package/codeyam-cli/templates/codeyam-editor-claude.md +68 -0
- package/codeyam-cli/templates/codeyam-memory-hook.sh +14 -14
- package/codeyam-cli/templates/commands/codeyam-diagnose.md +481 -0
- package/codeyam-cli/templates/editor-step-hook.py +147 -0
- package/codeyam-cli/templates/hooks/staleness-check.sh +43 -0
- package/codeyam-cli/templates/isolation-route/next-app.tsx.template +80 -0
- package/codeyam-cli/templates/isolation-route/next-pages.tsx.template +79 -0
- package/codeyam-cli/templates/isolation-route/vite-react.tsx.template +78 -0
- package/codeyam-cli/templates/msw/browser-setup.ts.template +47 -0
- package/codeyam-cli/templates/msw/handler-router.ts.template +47 -0
- package/codeyam-cli/templates/msw/server-setup.ts.template +52 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/PRISMA_SETUP.md +84 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/app/api/todos/route.ts +17 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/app/globals.css +26 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/app/layout.tsx +34 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/app/lib/prisma.ts +19 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/app/page.tsx +10 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/eslint.config.mjs +11 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/gitignore +43 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/next.config.ts +14 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/package.json +35 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/postcss.config.mjs +7 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma/schema.prisma +27 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma/seed.ts +37 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma.config.ts +12 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/tsconfig.json +34 -0
- package/codeyam-cli/templates/prompts/conversation-guidance.txt +44 -0
- package/codeyam-cli/templates/prompts/conversation-prompt.txt +28 -0
- package/codeyam-cli/templates/prompts/interruption-prompt.txt +31 -0
- package/codeyam-cli/templates/prompts/stale-rules-prompt.txt +24 -0
- package/codeyam-cli/templates/rule-notification-hook.py +44 -17
- package/codeyam-cli/templates/rule-reflection-hook.py +88 -31
- package/codeyam-cli/templates/rules-instructions.md +45 -90
- package/codeyam-cli/templates/{codeyam:debug.md → skills/codeyam-debug/SKILL.md} +1 -1
- package/codeyam-cli/templates/skills/codeyam-dev-mode/SKILL.md +237 -0
- package/codeyam-cli/templates/skills/codeyam-editor/SKILL.md +69 -0
- package/codeyam-cli/templates/{codeyam:memory.md → skills/codeyam-memory/SKILL.md} +231 -24
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/deprecated-prompt.md +100 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/detect-deprecated-patterns.sh +108 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/find-exports.sh +69 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/misleading-api-prompt.md +117 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/analyze-prompt.md +46 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/cleanup.sh +12 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/filter.jq +45 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/preprocess.sh +139 -0
- package/codeyam-cli/templates/{codeyam:new-rule.md → skills/codeyam-new-rule/SKILL.md} +1 -3
- package/codeyam-cli/templates/{codeyam:setup.md → skills/codeyam-setup/SKILL.md} +13 -1
- package/codeyam-cli/templates/{codeyam:sim.md → skills/codeyam-sim/SKILL.md} +1 -1
- package/codeyam-cli/templates/{codeyam:test.md → skills/codeyam-test/SKILL.md} +1 -1
- package/codeyam-cli/templates/{codeyam:verify.md → skills/codeyam-verify/SKILL.md} +1 -1
- package/package.json +15 -13
- package/packages/ai/index.js +1 -1
- package/packages/ai/index.js.map +1 -1
- package/packages/ai/src/lib/analyzeScope.js +14 -0
- package/packages/ai/src/lib/analyzeScope.js.map +1 -1
- package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js +22 -4
- package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js.map +1 -1
- package/packages/ai/src/lib/astScopes/processExpression.js +78 -1
- package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
- package/packages/ai/src/lib/astScopes/sharedPatterns.js +25 -0
- package/packages/ai/src/lib/astScopes/sharedPatterns.js.map +1 -1
- package/packages/ai/src/lib/completionCall.js +10 -7
- package/packages/ai/src/lib/completionCall.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +362 -10
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.js +54 -0
- package/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.js.map +1 -0
- package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js +59 -17
- package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.js +34 -0
- package/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.js.map +1 -0
- package/packages/ai/src/lib/dataStructureChunking.js +30 -11
- package/packages/ai/src/lib/dataStructureChunking.js.map +1 -1
- package/packages/ai/src/lib/generateEntityScenarioData.js +79 -5
- package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
- package/packages/ai/src/lib/generateExecutionFlows.js +97 -2
- package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -1
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js +242 -81
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js.map +1 -1
- package/packages/ai/src/lib/mergeJsonTypeDefinitions.js +5 -0
- package/packages/ai/src/lib/mergeJsonTypeDefinitions.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/collapseNullableObjects.js +97 -0
- package/packages/ai/src/lib/promptGenerators/collapseNullableObjects.js.map +1 -0
- package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js +17 -2
- package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js.map +1 -1
- package/packages/analyze/src/lib/ProjectAnalyzer.js +3 -0
- package/packages/analyze/src/lib/ProjectAnalyzer.js.map +1 -1
- package/packages/analyze/src/lib/asts/nodes/getNodeType.js +1 -0
- package/packages/analyze/src/lib/asts/nodes/getNodeType.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +11 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +8 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/dependencyResolver.js +0 -5
- package/packages/analyze/src/lib/files/analyze/dependencyResolver.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js +9 -0
- package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js +54 -27
- package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js +42 -13
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +65 -0
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +141 -71
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
- package/packages/database/index.js +1 -0
- package/packages/database/index.js.map +1 -1
- 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 +5 -0
- package/packages/database/src/lib/kysely/db.js.map +1 -1
- package/packages/database/src/lib/kysely/tables/editorScenariosTable.js +45 -0
- package/packages/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -0
- package/packages/database/src/lib/loadCommits.js +23 -13
- package/packages/database/src/lib/loadCommits.js.map +1 -1
- package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.js +1 -4
- package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.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 +100 -89
- package/packages/database/src/lib/updateCommitMetadata.js.map +1 -1
- package/packages/database/src/lib/updateFreshAnalysisStatus.js +41 -30
- package/packages/database/src/lib/updateFreshAnalysisStatus.js.map +1 -1
- package/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.js +68 -57
- package/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.js.map +1 -1
- package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +29 -1
- package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -1
- package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +33 -5
- package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
- package/packages/utils/src/lib/fs/rsyncCopy.js +98 -3
- package/packages/utils/src/lib/fs/rsyncCopy.js.map +1 -1
- package/scripts/npm-post-install.cjs +34 -0
- package/codeyam-cli/src/commands/detect-universal-mocks.js +0 -118
- package/codeyam-cli/src/commands/detect-universal-mocks.js.map +0 -1
- package/codeyam-cli/src/commands/list.js +0 -31
- package/codeyam-cli/src/commands/list.js.map +0 -1
- package/codeyam-cli/src/commands/webapp-info.js +0 -146
- package/codeyam-cli/src/commands/webapp-info.js.map +0 -1
- package/codeyam-cli/src/utils/universal-mocks.js +0 -152
- package/codeyam-cli/src/utils/universal-mocks.js.map +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-ClaLpuOo.js +0 -34
- package/codeyam-cli/src/webserver/build/client/assets/agent-transcripts-DfKzxuoe.js +0 -11
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-C5lqplTC.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-CBoafmVs.js +0 -6
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-DGgZjdFg.js +0 -6
- package/codeyam-cli/src/webserver/build/client/assets/globals-DoeDFXZN.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/labs-CmBYA0PH.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-76786b8e.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/memory-CrNQfdMO.js +0 -76
- package/codeyam-cli/src/webserver/build/client/assets/root-QAY34PIo.js +0 -62
- package/codeyam-cli/src/webserver/build/client/assets/settings-eBI36Yv5.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-COky1GVF.js +0 -2
- package/codeyam-cli/src/webserver/build/server/assets/index-DV1ykEI6.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-BrcVrUEv.js +0 -260
- package/codeyam-cli/templates/codeyam-stop-hook.sh +0 -284
- package/codeyam-cli/templates/codeyam:diagnose.md +0 -805
- package/scripts/finalize-analyzer.cjs +0 -81
- /package/codeyam-cli/src/webserver/build/client/assets/{api.labs-survey-l0sNRNKZ.js → api.dev-mode-events-l0sNRNKZ.js} +0 -0
|
@@ -14,21 +14,46 @@ const isStandaloneIndex = (s?: string) => !!s && STANDALONE_INDEX_RE.test(s);
|
|
|
14
14
|
// The regex matches any path ending with .length that has [] somewhere before it
|
|
15
15
|
const DYNAMIC_LENGTH_RE = /\[\].*\.length$/;
|
|
16
16
|
|
|
17
|
-
//
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
// Cache for type string analysis to avoid repeated split/filter operations.
|
|
18
|
+
// These functions are called multiple times per path segment across thousands of paths.
|
|
19
|
+
const typeAnalysisCache = new Map<
|
|
20
|
+
string,
|
|
21
|
+
{ isSkippable: boolean; baseType: string; isNullable: boolean }
|
|
22
|
+
>();
|
|
23
|
+
|
|
24
|
+
function getTypeAnalysis(t: string) {
|
|
25
|
+
const cached = typeAnalysisCache.get(t);
|
|
26
|
+
if (cached) return cached;
|
|
23
27
|
const parts = t.split('|').map((s) => s.trim());
|
|
24
28
|
const base = parts.filter((s) => s !== 'undefined' && s !== 'null');
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
base[0] === '
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
const result = {
|
|
30
|
+
isSkippable:
|
|
31
|
+
base.length === 1 &&
|
|
32
|
+
(base[0] === 'object' ||
|
|
33
|
+
base[0] === 'array' ||
|
|
34
|
+
base[0] === 'function' ||
|
|
35
|
+
base[0] === 'unknown'),
|
|
36
|
+
baseType: base[0],
|
|
37
|
+
isNullable: parts.includes('undefined') || parts.includes('null'),
|
|
38
|
+
};
|
|
39
|
+
typeAnalysisCache.set(t, result);
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Treat these as structural placeholders (don't commit them as concrete leaves)
|
|
44
|
+
function isSkippableLeafType(t: string) {
|
|
45
|
+
return getTypeAnalysis(t).isSkippable;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Extract the base structural type from a potentially nullable type string.
|
|
49
|
+
// e.g., 'object | undefined' → 'object', 'array | null' → 'array'
|
|
50
|
+
function getBaseSkippableType(t: string): string {
|
|
51
|
+
return getTypeAnalysis(t).baseType;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Check if a type string has nullable annotations (| undefined or | null)
|
|
55
|
+
function isNullableType(t: string): boolean {
|
|
56
|
+
return getTypeAnalysis(t).isNullable;
|
|
32
57
|
}
|
|
33
58
|
|
|
34
59
|
// Matches paths containing [][] — e.g., "items[][]" or "items[][].text"
|
|
@@ -317,15 +342,41 @@ export default function convertDotNotation(
|
|
|
317
342
|
cursor[key] = typ;
|
|
318
343
|
} else {
|
|
319
344
|
// Structural/placeholder terminal
|
|
320
|
-
|
|
345
|
+
const nullable = isNullableType(typ);
|
|
346
|
+
const baseType = getBaseSkippableType(typ);
|
|
347
|
+
|
|
348
|
+
if (baseType === 'array') {
|
|
321
349
|
if (!Array.isArray(cursor[key])) cursor[key] = [];
|
|
350
|
+
if (nullable) {
|
|
351
|
+
(cursor[key] as any)._nullable = true;
|
|
352
|
+
}
|
|
322
353
|
} else if (
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
354
|
+
baseType === 'object' ||
|
|
355
|
+
baseType === 'function' ||
|
|
356
|
+
baseType === 'unknown'
|
|
326
357
|
) {
|
|
327
|
-
if (
|
|
328
|
-
|
|
358
|
+
if (nullable) {
|
|
359
|
+
// Nullable object: ensure it's an actual object (not a string
|
|
360
|
+
// placeholder) so _nullable can be set and child paths can
|
|
361
|
+
// populate properties on it.
|
|
362
|
+
if (
|
|
363
|
+
cursor[key] === undefined ||
|
|
364
|
+
typeof cursor[key] === 'string'
|
|
365
|
+
) {
|
|
366
|
+
cursor[key] = {};
|
|
367
|
+
}
|
|
368
|
+
if (
|
|
369
|
+
typeof cursor[key] === 'object' &&
|
|
370
|
+
cursor[key] !== null &&
|
|
371
|
+
!Array.isArray(cursor[key])
|
|
372
|
+
) {
|
|
373
|
+
(cursor[key] as any)._nullable = true;
|
|
374
|
+
}
|
|
375
|
+
} else {
|
|
376
|
+
// Non-nullable: preserve existing behavior (string placeholder)
|
|
377
|
+
if (cursor[key] === undefined) {
|
|
378
|
+
cursor[key] = typ;
|
|
379
|
+
}
|
|
329
380
|
}
|
|
330
381
|
}
|
|
331
382
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recursively strips `_nullable` keys from LLM-generated mock data.
|
|
3
|
+
*
|
|
4
|
+
* The `_nullable` marker is an internal CodeYam concept used in type definitions
|
|
5
|
+
* to indicate that a field can be null/undefined. The LLM sometimes includes
|
|
6
|
+
* these markers in its generated scenario data, which causes runtime errors
|
|
7
|
+
* when code iterates over object keys (e.g., `Object.keys(importedBy)` picks
|
|
8
|
+
* up `_nullable` as a key alongside real data).
|
|
9
|
+
*
|
|
10
|
+
* This function mutates the input object in-place, consistent with other
|
|
11
|
+
* post-processing helpers like `convertNullToUndefinedBySchema`.
|
|
12
|
+
*/
|
|
13
|
+
export default function stripNullableMarkers(
|
|
14
|
+
data: Record<string, unknown>,
|
|
15
|
+
): void {
|
|
16
|
+
if (data == null || typeof data !== 'object') return;
|
|
17
|
+
|
|
18
|
+
// Delete _nullable from this level
|
|
19
|
+
if ('_nullable' in data) {
|
|
20
|
+
delete data._nullable;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Recurse into nested objects and arrays
|
|
24
|
+
for (const value of Object.values(data)) {
|
|
25
|
+
if (Array.isArray(value)) {
|
|
26
|
+
for (const item of value) {
|
|
27
|
+
if (item !== null && typeof item === 'object' && !Array.isArray(item)) {
|
|
28
|
+
stripNullableMarkers(item as Record<string, unknown>);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
} else if (value !== null && typeof value === 'object') {
|
|
32
|
+
stripNullableMarkers(value as Record<string, unknown>);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -3,9 +3,11 @@ import type { ExecutionFlow, ScenariosDataStructure } from '~codeyam/types';
|
|
|
3
3
|
// Type for a single required value from ExecutionFlow
|
|
4
4
|
type RequiredValue = NonNullable<ExecutionFlow['requiredValues']>[number];
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const DEFAULT_MAX_CHUNK_SIZE = 10_000; // ~10K chars per chunk
|
|
7
|
+
const DEFAULT_MAX_KEYS_PER_CHUNK = 20;
|
|
7
8
|
|
|
8
9
|
export interface ChunkOptions {
|
|
10
|
+
maxChunkSize?: number;
|
|
9
11
|
maxKeysPerChunk?: number;
|
|
10
12
|
}
|
|
11
13
|
|
|
@@ -15,8 +17,12 @@ export interface ChunkOptions {
|
|
|
15
17
|
* Large schemas overwhelm LLMs, causing them to make mistakes on some keys.
|
|
16
18
|
* By processing smaller chunks, each key gets more focused attention.
|
|
17
19
|
*
|
|
20
|
+
* Uses cumulative JSON size to decide chunk boundaries rather than a fixed
|
|
21
|
+
* key count, so a single oversized key gets its own chunk while many small
|
|
22
|
+
* keys are grouped together efficiently.
|
|
23
|
+
*
|
|
18
24
|
* @param dataForMocks - The full data structure schema
|
|
19
|
-
* @param options - Chunking options (
|
|
25
|
+
* @param options - Chunking options (maxChunkSize defaults to 10_000)
|
|
20
26
|
* @returns Array of smaller data structure chunks
|
|
21
27
|
*/
|
|
22
28
|
export function chunkDataStructure(
|
|
@@ -27,27 +33,48 @@ export function chunkDataStructure(
|
|
|
27
33
|
return [dataForMocks];
|
|
28
34
|
}
|
|
29
35
|
|
|
30
|
-
const {
|
|
36
|
+
const {
|
|
37
|
+
maxChunkSize = DEFAULT_MAX_CHUNK_SIZE,
|
|
38
|
+
maxKeysPerChunk = DEFAULT_MAX_KEYS_PER_CHUNK,
|
|
39
|
+
} = options;
|
|
31
40
|
const keys = Object.keys(dataForMocks);
|
|
32
41
|
|
|
33
|
-
//
|
|
34
|
-
|
|
42
|
+
// Calculate total size to see if chunking is needed
|
|
43
|
+
const totalSize = JSON.stringify(dataForMocks).length;
|
|
44
|
+
if (totalSize <= maxChunkSize && keys.length <= maxKeysPerChunk) {
|
|
35
45
|
return [dataForMocks];
|
|
36
46
|
}
|
|
37
47
|
|
|
48
|
+
// Greedily pack keys into chunks by cumulative size and key count
|
|
38
49
|
const chunks: Array<ScenariosDataStructure['dataForMocks']> = [];
|
|
50
|
+
let currentChunk: Record<string, unknown> = {};
|
|
51
|
+
let currentSize = 0;
|
|
52
|
+
|
|
53
|
+
for (const key of keys) {
|
|
54
|
+
const keySize = JSON.stringify(
|
|
55
|
+
(dataForMocks as Record<string, unknown>)[key],
|
|
56
|
+
).length;
|
|
39
57
|
|
|
40
|
-
|
|
41
|
-
const chunkKeys = keys.slice(i, i + maxKeysPerChunk);
|
|
42
|
-
const chunk: ScenariosDataStructure['dataForMocks'] = {};
|
|
58
|
+
const currentKeyCount = Object.keys(currentChunk).length;
|
|
43
59
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
60
|
+
// If adding this key would exceed size or key count limit AND chunk isn't empty, start a new chunk
|
|
61
|
+
if (
|
|
62
|
+
currentSize > 0 &&
|
|
63
|
+
(currentSize + keySize > maxChunkSize ||
|
|
64
|
+
currentKeyCount >= maxKeysPerChunk)
|
|
65
|
+
) {
|
|
66
|
+
chunks.push(currentChunk as ScenariosDataStructure['dataForMocks']);
|
|
67
|
+
currentChunk = {};
|
|
68
|
+
currentSize = 0;
|
|
48
69
|
}
|
|
49
70
|
|
|
50
|
-
|
|
71
|
+
currentChunk[key] = (dataForMocks as Record<string, unknown>)[key];
|
|
72
|
+
currentSize += keySize;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Push the last chunk
|
|
76
|
+
if (Object.keys(currentChunk).length > 0) {
|
|
77
|
+
chunks.push(currentChunk as ScenariosDataStructure['dataForMocks']);
|
|
51
78
|
}
|
|
52
79
|
|
|
53
80
|
return chunks;
|
|
@@ -19,6 +19,8 @@ import convertNullToUndefinedBySchema from './dataStructure/helpers/convertNullT
|
|
|
19
19
|
import convertTypeAnnotationsToValues from './dataStructure/helpers/convertTypeAnnotationsToValues';
|
|
20
20
|
import fixNullIdsBySchema from './dataStructure/helpers/fixNullIdsBySchema';
|
|
21
21
|
import coerceObjectsToPrimitivesBySchema from './dataStructure/helpers/coerceObjectsToPrimitivesBySchema';
|
|
22
|
+
import coercePrimitivesToArraysBySchema from './dataStructure/helpers/coercePrimitivesToArraysBySchema';
|
|
23
|
+
import stripNullableMarkers from './dataStructure/helpers/stripNullableMarkers';
|
|
22
24
|
import { JsonTypeDefinition } from '~codeyam/types';
|
|
23
25
|
import { deepMerge } from '~codeyam/generate';
|
|
24
26
|
import {
|
|
@@ -172,6 +174,46 @@ function findKeyPath(
|
|
|
172
174
|
return null;
|
|
173
175
|
}
|
|
174
176
|
|
|
177
|
+
/**
|
|
178
|
+
* Strip primitive values from `source` when the `destination` already has an
|
|
179
|
+
* array or object at the same key. Returns a cleaned copy of source (or null
|
|
180
|
+
* if nothing remains after stripping).
|
|
181
|
+
*
|
|
182
|
+
* This prevents misplaced LLM data (e.g., `{ webapps: true }`) from
|
|
183
|
+
* overwriting correct complex values (e.g., `{ webapps: [...] }`) during
|
|
184
|
+
* deep merge in relocateMisplacedNestedKeys.
|
|
185
|
+
*/
|
|
186
|
+
function stripPrimitivesOverwritingComplexValues(
|
|
187
|
+
destination: Record<string, unknown>,
|
|
188
|
+
source: unknown,
|
|
189
|
+
): Record<string, unknown> | null {
|
|
190
|
+
if (typeof source !== 'object' || source === null || Array.isArray(source)) {
|
|
191
|
+
return null;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
const result: Record<string, unknown> = {};
|
|
195
|
+
let hasKeys = false;
|
|
196
|
+
|
|
197
|
+
for (const key of Object.keys(source as Record<string, unknown>)) {
|
|
198
|
+
const srcVal = (source as Record<string, unknown>)[key];
|
|
199
|
+
const dstVal = destination[key];
|
|
200
|
+
|
|
201
|
+
// If destination has an array or object but source has a primitive, skip it
|
|
202
|
+
if (
|
|
203
|
+
typeof dstVal === 'object' &&
|
|
204
|
+
dstVal !== null &&
|
|
205
|
+
typeof srcVal !== 'object'
|
|
206
|
+
) {
|
|
207
|
+
continue;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
result[key] = srcVal;
|
|
211
|
+
hasKeys = true;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
return hasKeys ? result : null;
|
|
215
|
+
}
|
|
216
|
+
|
|
175
217
|
/**
|
|
176
218
|
* Relocate misplaced nested keys in mockData to their correct position
|
|
177
219
|
* based on the dataForMocks structure.
|
|
@@ -233,12 +275,22 @@ function relocateMisplacedNestedKeys(
|
|
|
233
275
|
}
|
|
234
276
|
|
|
235
277
|
// Deep merge the value into the correct location
|
|
236
|
-
// Use deep merge to preserve existing data at that location
|
|
278
|
+
// Use deep merge to preserve existing data at that location.
|
|
279
|
+
// Before merging, strip primitives from the misplaced value that would
|
|
280
|
+
// overwrite arrays/objects at the destination. The misplaced data is lower
|
|
281
|
+
// quality — the LLM put it in the wrong place — so primitives like `true`
|
|
282
|
+
// should not overwrite correct complex values like arrays.
|
|
237
283
|
if (current[key] !== undefined && typeof current[key] === 'object') {
|
|
238
|
-
|
|
284
|
+
const safeValue = stripPrimitivesOverwritingComplexValues(
|
|
239
285
|
current[key] as Record<string, unknown>,
|
|
240
286
|
value as Record<string, unknown>,
|
|
241
287
|
);
|
|
288
|
+
if (safeValue !== null) {
|
|
289
|
+
current[key] = deepMerge(
|
|
290
|
+
current[key] as Record<string, unknown>,
|
|
291
|
+
safeValue,
|
|
292
|
+
);
|
|
293
|
+
}
|
|
242
294
|
} else {
|
|
243
295
|
current[key] = value;
|
|
244
296
|
}
|
|
@@ -294,11 +346,13 @@ function generateDefaultForSchemaType(schemaType: unknown): unknown {
|
|
|
294
346
|
if (schemaType.includes('| null')) return null;
|
|
295
347
|
return schemaType; // Return the type as a string placeholder
|
|
296
348
|
}
|
|
297
|
-
if (
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
349
|
+
if (Array.isArray(schemaType)) {
|
|
350
|
+
if (schemaType.length === 0) return [];
|
|
351
|
+
// Generate a single default element based on the first element's schema
|
|
352
|
+
const elementDefault = generateDefaultForSchemaType(schemaType[0]);
|
|
353
|
+
return elementDefault !== undefined ? [elementDefault] : [];
|
|
354
|
+
}
|
|
355
|
+
if (typeof schemaType === 'object' && schemaType !== null) {
|
|
302
356
|
// Recursively generate defaults for nested objects
|
|
303
357
|
const result: Record<string, unknown> = {};
|
|
304
358
|
for (const [key, value] of Object.entries(schemaType)) {
|
|
@@ -426,6 +480,8 @@ function fillMissingMockDataKeysWithDefaults(
|
|
|
426
480
|
const missingKeys: string[] = [];
|
|
427
481
|
|
|
428
482
|
for (const key of Object.keys(dataForMocks)) {
|
|
483
|
+
if (key === '_nullable') continue; // Internal marker, not a data key
|
|
484
|
+
|
|
429
485
|
const fullPath = pathPrefix ? `${pathPrefix}.${key}` : key;
|
|
430
486
|
|
|
431
487
|
if (mockData[key] === undefined) {
|
|
@@ -841,6 +897,29 @@ export async function generateDataForScenario({
|
|
|
841
897
|
}
|
|
842
898
|
}
|
|
843
899
|
|
|
900
|
+
// Detect keys that were lost from failed or partial chunk responses
|
|
901
|
+
// and fill them with schema-based defaults so they aren't permanently lost.
|
|
902
|
+
const allChunkedKeys = chunks.flatMap((c) => Object.keys(c || {}));
|
|
903
|
+
const returnedKeys = new Set(Object.keys(chunkedMockData));
|
|
904
|
+
const missingChunkKeys = allChunkedKeys.filter(
|
|
905
|
+
(k) => !returnedKeys.has(k),
|
|
906
|
+
);
|
|
907
|
+
|
|
908
|
+
if (missingChunkKeys.length > 0) {
|
|
909
|
+
awsLog(
|
|
910
|
+
`Chunked processing: ${missingChunkKeys.length} key(s) missing from chunk results, filling with defaults: ${missingChunkKeys.join(', ')}`,
|
|
911
|
+
);
|
|
912
|
+
const dataForMocksRecord = structure.dataForMocks as Record<
|
|
913
|
+
string,
|
|
914
|
+
unknown
|
|
915
|
+
>;
|
|
916
|
+
for (const key of missingChunkKeys) {
|
|
917
|
+
chunkedMockData[key] = generateDefaultForSchemaType(
|
|
918
|
+
dataForMocksRecord[key],
|
|
919
|
+
);
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
|
|
844
923
|
awsLog(
|
|
845
924
|
`Chunked processing complete. Generated ${Object.keys(chunkedMockData).length} keys total`,
|
|
846
925
|
);
|
|
@@ -1036,6 +1115,18 @@ export async function generateDataForScenario({
|
|
|
1036
1115
|
);
|
|
1037
1116
|
}
|
|
1038
1117
|
|
|
1118
|
+
// Strip _nullable markers from LLM-generated mock data.
|
|
1119
|
+
// The _nullable marker is an internal CodeYam concept used in type definitions
|
|
1120
|
+
// to indicate that a field can be null/undefined. The LLM sometimes includes
|
|
1121
|
+
// these markers in its generated data, which causes runtime errors when code
|
|
1122
|
+
// iterates over object keys (e.g., Object.keys(importedBy) picks up "_nullable",
|
|
1123
|
+
// then Object.keys(importedBy["_nullable"]) calls Object.keys(null) and throws).
|
|
1124
|
+
if (fullScenarioData.data.mockData) {
|
|
1125
|
+
stripNullableMarkers(
|
|
1126
|
+
fullScenarioData.data.mockData as Record<string, unknown>,
|
|
1127
|
+
);
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1039
1130
|
// Relocate misplaced nested keys to their correct position.
|
|
1040
1131
|
// The LLM sometimes places nested keys at root level instead of inside their
|
|
1041
1132
|
// parent object (e.g., 'fastener' at root instead of inside 'trpc').
|
|
@@ -1071,6 +1162,18 @@ export async function generateDataForScenario({
|
|
|
1071
1162
|
);
|
|
1072
1163
|
}
|
|
1073
1164
|
|
|
1165
|
+
// Coerce primitives to empty arrays when the schema expects an array.
|
|
1166
|
+
// The LLM sometimes generates a primitive (e.g., `webapps: true`) where the
|
|
1167
|
+
// schema expects an array (e.g., `webapps: [{ name: "string" }]`).
|
|
1168
|
+
// This causes runtime errors like "TypeError: config.webapps?.forEach is not a function".
|
|
1169
|
+
// Must run AFTER coerceObjectsToPrimitivesBySchema and BEFORE convertCommaSeparatedStringsToArrays.
|
|
1170
|
+
if (structure.dataForMocks && fullScenarioData.data.mockData) {
|
|
1171
|
+
coercePrimitivesToArraysBySchema(
|
|
1172
|
+
fullScenarioData.data.mockData,
|
|
1173
|
+
structure.dataForMocks,
|
|
1174
|
+
);
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1074
1177
|
// Convert comma-separated strings to arrays when appropriate.
|
|
1075
1178
|
// The LLM sometimes generates strings like "color,size" instead of arrays
|
|
1076
1179
|
// like ["color", "size"] when the schema type is incorrectly inferred as
|
|
@@ -32,6 +32,30 @@ import resolvePathToControllable from './resolvePathToControllable';
|
|
|
32
32
|
import { AI } from '~codeyam/ai';
|
|
33
33
|
import type { JsxRenderingUsage, ConditionalUsage } from './astScopes/types';
|
|
34
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Patterns that indicate a child component is a modal/overlay/blocking element.
|
|
37
|
+
* Same patterns used in generateExecutionFlowsFromConditionalEffects.ts for
|
|
38
|
+
* state variable names — here applied to child component names.
|
|
39
|
+
*/
|
|
40
|
+
const BLOCKING_CHILD_PATTERNS = [
|
|
41
|
+
/modal/i,
|
|
42
|
+
/overlay/i,
|
|
43
|
+
/dialog/i,
|
|
44
|
+
/popup/i,
|
|
45
|
+
/drawer/i,
|
|
46
|
+
/sheet/i,
|
|
47
|
+
/lightbox/i,
|
|
48
|
+
/backdrop/i,
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Check if a child component name suggests it's a blocking/modal element.
|
|
53
|
+
* Exported for testing.
|
|
54
|
+
*/
|
|
55
|
+
export function isBlockingChildComponent(componentName: string): boolean {
|
|
56
|
+
return BLOCKING_CHILD_PATTERNS.some((pattern) => pattern.test(componentName));
|
|
57
|
+
}
|
|
58
|
+
|
|
35
59
|
interface GenerateExecutionFlowsArgs {
|
|
36
60
|
entity: Pick<Entity, 'sha' | 'name' | 'filePath' | 'code' | 'metadata'>;
|
|
37
61
|
mergedDataStructure: Omit<DataStructure, 'equivalentSignatureVariables'>;
|
|
@@ -105,6 +129,19 @@ export default function generateExecutionFlows({
|
|
|
105
129
|
fullToShortPathMap[fullPath] = shortPath;
|
|
106
130
|
}
|
|
107
131
|
|
|
132
|
+
console.log(
|
|
133
|
+
`[generateExecutionFlows] ${entity.name}: attributesMap has ${Object.keys(resolvedAttributesMap).length} keys, fullToShortPathMap has ${Object.keys(fullToShortPathMap).length} entries`,
|
|
134
|
+
);
|
|
135
|
+
console.log(
|
|
136
|
+
`[generateExecutionFlows] ${entity.name}: attributesMap keys: [${Object.keys(resolvedAttributesMap).join(', ')}]`,
|
|
137
|
+
);
|
|
138
|
+
console.log(
|
|
139
|
+
`[generateExecutionFlows] ${entity.name}: fullToShortPathMap: ${JSON.stringify(fullToShortPathMap)}`,
|
|
140
|
+
);
|
|
141
|
+
console.log(
|
|
142
|
+
`[generateExecutionFlows] ${entity.name}: equivalentSignatureVariables: ${JSON.stringify(equivalentSignatureVariables)}`,
|
|
143
|
+
);
|
|
144
|
+
|
|
108
145
|
// Get pre-computed conditional data from metadata
|
|
109
146
|
const conditionalUsages: Record<string, ConditionalUsage[]> =
|
|
110
147
|
entity.metadata?.isolatedDataStructure?.conditionalUsages ?? {};
|
|
@@ -149,6 +186,26 @@ export default function generateExecutionFlows({
|
|
|
149
186
|
}
|
|
150
187
|
}
|
|
151
188
|
|
|
189
|
+
console.log(
|
|
190
|
+
`[generateExecutionFlows] ${entity.name}: conditionalUsages keys: [${Object.keys(conditionalUsages).join(', ')}]`,
|
|
191
|
+
);
|
|
192
|
+
console.log(
|
|
193
|
+
`[generateExecutionFlows] ${entity.name}: conditionalUsages sourceDataPaths: ${JSON.stringify(
|
|
194
|
+
Object.fromEntries(
|
|
195
|
+
Object.entries(conditionalUsages).map(([k, v]) => [
|
|
196
|
+
k,
|
|
197
|
+
(v as any[]).map((u: any) => u.sourceDataPath ?? '(none)'),
|
|
198
|
+
]),
|
|
199
|
+
),
|
|
200
|
+
)}`,
|
|
201
|
+
);
|
|
202
|
+
console.log(
|
|
203
|
+
`[generateExecutionFlows] ${entity.name}: compoundConditionals count: ${compoundConditionals.length}`,
|
|
204
|
+
);
|
|
205
|
+
console.log(
|
|
206
|
+
`[generateExecutionFlows] ${entity.name}: sourceEquivalencies keys count: ${Object.keys(mergedDataStructure.sourceEquivalencies ?? {}).length}`,
|
|
207
|
+
);
|
|
208
|
+
|
|
152
209
|
const conditionalsBasedFlows = generateExecutionFlowsFromConditionals({
|
|
153
210
|
conditionalUsages,
|
|
154
211
|
compoundConditionals,
|
|
@@ -240,6 +297,11 @@ export default function generateExecutionFlows({
|
|
|
240
297
|
calculateFlowPriority(flow, gatingPathToChildren);
|
|
241
298
|
}
|
|
242
299
|
|
|
300
|
+
// Assign exclusiveGroup for truthy/falsy flow pairs that control child components.
|
|
301
|
+
// When the same gating path produces both a truthy flow (show component) and a
|
|
302
|
+
// falsy flow (hide component), they are mutually exclusive and should be grouped.
|
|
303
|
+
assignExclusiveGroupsForGatingPairs(allFlows);
|
|
304
|
+
|
|
243
305
|
// Sort flows by priority (highest first)
|
|
244
306
|
allFlows.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
|
|
245
307
|
|
|
@@ -328,6 +390,60 @@ function buildGatingPathToChildrenMap(
|
|
|
328
390
|
return gatingPathToChildren;
|
|
329
391
|
}
|
|
330
392
|
|
|
393
|
+
/**
|
|
394
|
+
* Assign exclusiveGroup for truthy/falsy flow pairs that control child components.
|
|
395
|
+
*
|
|
396
|
+
* When the same attribute path produces both a truthy and falsy flow (e.g.,
|
|
397
|
+
* {diffView && <DiffModal/>}), they are mutually exclusive — only one can be
|
|
398
|
+
* active at a time. Grouping them ensures the scenario generator treats them
|
|
399
|
+
* as alternative states rather than combining them.
|
|
400
|
+
*/
|
|
401
|
+
function assignExclusiveGroupsForGatingPairs(flows: ExecutionFlow[]): void {
|
|
402
|
+
// Build a map: attributePath -> flows with truthy or falsy comparison for that path
|
|
403
|
+
const pathToFlows = new Map<
|
|
404
|
+
string,
|
|
405
|
+
{ truthy: ExecutionFlow[]; falsy: ExecutionFlow[] }
|
|
406
|
+
>();
|
|
407
|
+
|
|
408
|
+
for (const flow of flows) {
|
|
409
|
+
// Only consider flows that control child components
|
|
410
|
+
if (!flow.childComponentsControlled?.length) continue;
|
|
411
|
+
|
|
412
|
+
for (const rv of flow.requiredValues) {
|
|
413
|
+
if (rv.comparison === 'truthy' || rv.comparison === 'falsy') {
|
|
414
|
+
if (!pathToFlows.has(rv.attributePath)) {
|
|
415
|
+
pathToFlows.set(rv.attributePath, { truthy: [], falsy: [] });
|
|
416
|
+
}
|
|
417
|
+
pathToFlows.get(rv.attributePath)![rv.comparison].push(flow);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
// Also check falsy flows that DON'T have childComponentsControlled —
|
|
423
|
+
// they still pair with truthy flows that do
|
|
424
|
+
for (const flow of flows) {
|
|
425
|
+
if (flow.childComponentsControlled?.length) continue; // Already processed
|
|
426
|
+
|
|
427
|
+
for (const rv of flow.requiredValues) {
|
|
428
|
+
if (rv.comparison === 'falsy' && pathToFlows.has(rv.attributePath)) {
|
|
429
|
+
pathToFlows.get(rv.attributePath)!.falsy.push(flow);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
// Assign exclusiveGroup where both truthy and falsy flows exist
|
|
435
|
+
for (const [attributePath, { truthy, falsy }] of pathToFlows) {
|
|
436
|
+
if (truthy.length > 0 && falsy.length > 0) {
|
|
437
|
+
const groupName = `gating:${attributePath}`;
|
|
438
|
+
for (const flow of [...truthy, ...falsy]) {
|
|
439
|
+
if (!flow.exclusiveGroup) {
|
|
440
|
+
flow.exclusiveGroup = groupName;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
|
|
331
447
|
/**
|
|
332
448
|
* Calculate priority and childComponentsControlled for a flow.
|
|
333
449
|
*
|
|
@@ -382,6 +498,19 @@ function calculateFlowPriority(
|
|
|
382
498
|
if (flow.impact !== 'high') {
|
|
383
499
|
flow.impact = 'high';
|
|
384
500
|
}
|
|
501
|
+
|
|
502
|
+
// Check if any controlled child component is a modal/dialog/overlay.
|
|
503
|
+
// Only truthy flows (which SHOW the component) should be marked as blocking.
|
|
504
|
+
// Falsy flows (which HIDE the component) should not be blocking.
|
|
505
|
+
const isTruthyFlow = flow.requiredValues.some(
|
|
506
|
+
(rv) => rv.comparison === 'truthy' || rv.comparison === 'equals',
|
|
507
|
+
);
|
|
508
|
+
if (
|
|
509
|
+
isTruthyFlow &&
|
|
510
|
+
Array.from(childComponentsControlled).some(isBlockingChildComponent)
|
|
511
|
+
) {
|
|
512
|
+
flow.blocksOtherFlows = true;
|
|
513
|
+
}
|
|
385
514
|
}
|
|
386
515
|
|
|
387
516
|
// Calculate priority score
|
|
@@ -503,8 +632,11 @@ function buildValueGroupMap(flows: ExecutionFlow[]): Map<string, string[]> {
|
|
|
503
632
|
for (const [, flowValues] of pathToValues) {
|
|
504
633
|
// Only create groups if there are multiple different values for the same path
|
|
505
634
|
const uniqueValues = new Set(flowValues.map((fv) => fv.value));
|
|
506
|
-
if (uniqueValues.size > 1) {
|
|
507
|
-
// This attribute has multiple values, so all flows are siblings
|
|
635
|
+
if (uniqueValues.size > 1 && flowValues.length <= 10) {
|
|
636
|
+
// This attribute has multiple values, so all flows are siblings.
|
|
637
|
+
// Skip large groups (>10 flows) — these are typically shared gating conditions
|
|
638
|
+
// (like route params) that would dominate the selection by pulling in too many
|
|
639
|
+
// siblings and displacing higher-priority flows.
|
|
508
640
|
const siblingIds = flowValues.map((fv) => fv.flowId);
|
|
509
641
|
for (const fv of flowValues) {
|
|
510
642
|
valueGroupMap.set(
|