@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
package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts
CHANGED
|
@@ -52,6 +52,7 @@ const PRIMITIVE_TYPES = new Set([
|
|
|
52
52
|
|
|
53
53
|
// Check if a type string represents a primitive type
|
|
54
54
|
// Handles union types like "string | undefined" or "number | null"
|
|
55
|
+
// Also handles string literal unions like "'suggestion' | 'warning' | 'tip'"
|
|
55
56
|
function isPrimitiveType(typeStr: string): boolean {
|
|
56
57
|
if (PRIMITIVE_TYPES.has(typeStr)) {
|
|
57
58
|
return true;
|
|
@@ -59,9 +60,15 @@ function isPrimitiveType(typeStr: string): boolean {
|
|
|
59
60
|
// Check union types - if ALL parts of the union are primitives, it's primitive
|
|
60
61
|
// e.g., "string | undefined" -> ["string", "undefined"] -> both are primitive -> true
|
|
61
62
|
// e.g., "object | null" -> ["object", "null"] -> object is not primitive -> false
|
|
63
|
+
// e.g., "'suggestion' | 'warning'" -> string literal union -> true
|
|
62
64
|
if (typeStr.includes('|')) {
|
|
63
65
|
const parts = typeStr.split('|').map((p) => p.trim());
|
|
64
|
-
return parts.every(
|
|
66
|
+
return parts.every(
|
|
67
|
+
(part) =>
|
|
68
|
+
PRIMITIVE_TYPES.has(part) ||
|
|
69
|
+
// String literal values like 'suggestion', 'warning' are primitives
|
|
70
|
+
(part.startsWith("'") && part.endsWith("'")),
|
|
71
|
+
);
|
|
65
72
|
}
|
|
66
73
|
return false;
|
|
67
74
|
}
|
|
@@ -110,9 +117,21 @@ function pathPartMatches(pathPart: string, schemaPathPart: string): boolean {
|
|
|
110
117
|
function bestValueFromOptions(options: Array<string | undefined>) {
|
|
111
118
|
options = options.filter(Boolean) as string[];
|
|
112
119
|
|
|
113
|
-
const known = options.
|
|
114
|
-
if (known) {
|
|
115
|
-
|
|
120
|
+
const known = options.filter((o) => !o.includes('unknown'));
|
|
121
|
+
if (known.length > 0) {
|
|
122
|
+
// Among known values, prefer string literal unions over bare primitives.
|
|
123
|
+
// e.g., "'draft' | 'inProgress' | 'paused' | 'completed'" is more specific than "string".
|
|
124
|
+
// This handles cases where a dependency schema has a bare type like "string" but the
|
|
125
|
+
// child entity's analysis has the actual literal union from TypeScript type resolution.
|
|
126
|
+
if (known.length > 1 && known.some((o) => PRIMITIVE_TYPES.has(o))) {
|
|
127
|
+
const literalUnion = known.find(
|
|
128
|
+
(o) => !PRIMITIVE_TYPES.has(o) && o.includes("'"),
|
|
129
|
+
);
|
|
130
|
+
if (literalUnion) {
|
|
131
|
+
return literalUnion;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return known[0];
|
|
116
135
|
}
|
|
117
136
|
|
|
118
137
|
const notUnknown = options.find((o) => o !== 'unknown');
|
|
@@ -210,6 +229,23 @@ export default function mergeInDependentDataStructure({
|
|
|
210
229
|
equivalentPostfixes: Record<string, string>;
|
|
211
230
|
}[] = [];
|
|
212
231
|
|
|
232
|
+
// O(1) index for findOrCreateEquivalentSchemaPathsEntry.
|
|
233
|
+
// Maps "(rootPath)::(normalizedFuncName)" → the entry containing that root.
|
|
234
|
+
// This replaces the O(E) linear search that was causing O(E²) gather performance.
|
|
235
|
+
const espIndex = new Map<string, (typeof equivalentSchemaPaths)[0]>();
|
|
236
|
+
const espIndexKey = (path: string, functionName: string | undefined) => {
|
|
237
|
+
const normalized = cleanFunctionName(functionName);
|
|
238
|
+
const funcKey =
|
|
239
|
+
normalized === rootScopeName ? '__self__' : normalized || '__self__';
|
|
240
|
+
return `${path}::${funcKey}`;
|
|
241
|
+
};
|
|
242
|
+
const updateEspIndex = (entry: (typeof equivalentSchemaPaths)[0]) => {
|
|
243
|
+
for (const root of entry.equivalentRoots) {
|
|
244
|
+
const funcName = root.function?.name ?? rootScopeName;
|
|
245
|
+
espIndex.set(espIndexKey(root.schemaRootPath, funcName), entry);
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
|
|
213
249
|
// Pre-build a lookup map from cleaned function name to dependency for O(1) lookups.
|
|
214
250
|
// This avoids O(n) linear search in findRelevantDependency which was causing O(n²) performance.
|
|
215
251
|
const dependencyByCleanedName = new Map<
|
|
@@ -324,6 +360,54 @@ export default function mergeInDependentDataStructure({
|
|
|
324
360
|
) => {
|
|
325
361
|
if (!sourceAndUsageEquivalencies) return;
|
|
326
362
|
|
|
363
|
+
// Pre-computed normalized schema index cache.
|
|
364
|
+
// Avoids repeated splitOutsideParenthesesAndArrays calls and function-name
|
|
365
|
+
// normalization for the same schema paths across multiple equivalency iterations.
|
|
366
|
+
// The normalization depends on `functionName` (constant per gatherAllEquivalentSchemaPaths call),
|
|
367
|
+
// so this cache is scoped to this call.
|
|
368
|
+
type NormalizedEntry = { path: string; parts: string[] };
|
|
369
|
+
const normalizedSchemaCache = new Map<
|
|
370
|
+
object,
|
|
371
|
+
{
|
|
372
|
+
byFirstPart: Map<string, NormalizedEntry[]>;
|
|
373
|
+
}
|
|
374
|
+
>();
|
|
375
|
+
const getSchemaIndex = (
|
|
376
|
+
schema: Record<string, string> | undefined,
|
|
377
|
+
): { byFirstPart: Map<string, NormalizedEntry[]> } => {
|
|
378
|
+
if (!schema) return { byFirstPart: new Map() };
|
|
379
|
+
const cached = normalizedSchemaCache.get(schema);
|
|
380
|
+
if (cached) return cached;
|
|
381
|
+
const byFirstPart = new Map<string, NormalizedEntry[]>();
|
|
382
|
+
for (const path in schema) {
|
|
383
|
+
let parts = splitOutsideParenthesesAndArrays(path);
|
|
384
|
+
if (parts[0].startsWith(functionName)) {
|
|
385
|
+
const baseName = cleanFunctionName(parts[0]);
|
|
386
|
+
if (!functionsWithMultipleTypeParams.has(baseName)) {
|
|
387
|
+
parts =
|
|
388
|
+
parts[1] === 'functionCallReturnValue'
|
|
389
|
+
? ['returnValue', ...parts.slice(2)]
|
|
390
|
+
: parts.slice(1);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
const entry: NormalizedEntry = { path, parts };
|
|
394
|
+
// Index by the base of the first part (before any function call args)
|
|
395
|
+
const firstPart = parts[0] ?? '';
|
|
396
|
+
const parenIdx = firstPart.indexOf('(');
|
|
397
|
+
const firstPartBase =
|
|
398
|
+
parenIdx >= 0 ? firstPart.slice(0, parenIdx) : firstPart;
|
|
399
|
+
let bucket = byFirstPart.get(firstPartBase);
|
|
400
|
+
if (!bucket) {
|
|
401
|
+
bucket = [];
|
|
402
|
+
byFirstPart.set(firstPartBase, bucket);
|
|
403
|
+
}
|
|
404
|
+
bucket.push(entry);
|
|
405
|
+
}
|
|
406
|
+
const result = { byFirstPart };
|
|
407
|
+
normalizedSchemaCache.set(schema, result);
|
|
408
|
+
return result;
|
|
409
|
+
};
|
|
410
|
+
|
|
327
411
|
const findOrCreateEquivalentSchemaPathsEntry = (
|
|
328
412
|
allPaths: { path: string; functionName?: string }[],
|
|
329
413
|
) => {
|
|
@@ -354,62 +438,52 @@ export default function mergeInDependentDataStructure({
|
|
|
354
438
|
}
|
|
355
439
|
}
|
|
356
440
|
|
|
441
|
+
// Use espIndex Map for O(1) lookup instead of O(E) linear search.
|
|
442
|
+
// Falls back to linear search only when Map hit has a signature index conflict.
|
|
357
443
|
for (const pathInfo of allPaths) {
|
|
358
|
-
if (
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
// Get all signature indices in the existing entry (grouped by function)
|
|
376
|
-
const existingIndicesByFunction = new Map<string, Set<number>>();
|
|
377
|
-
for (const er of esp.equivalentRoots) {
|
|
378
|
-
const funcKey = er.function
|
|
379
|
-
? `${er.function.name}::${er.function.filePath}`
|
|
380
|
-
: '__self__';
|
|
381
|
-
const idx = extractSignatureIndex(er.schemaRootPath);
|
|
382
|
-
if (idx !== undefined) {
|
|
383
|
-
if (!existingIndicesByFunction.has(funcKey)) {
|
|
384
|
-
existingIndicesByFunction.set(funcKey, new Set());
|
|
385
|
-
}
|
|
386
|
-
existingIndicesByFunction.get(funcKey)!.add(idx);
|
|
387
|
-
}
|
|
444
|
+
if (equivalentSchemaPathsEntry) break;
|
|
445
|
+
const candidate = espIndex.get(
|
|
446
|
+
espIndexKey(pathInfo.path, pathInfo.functionName),
|
|
447
|
+
);
|
|
448
|
+
if (!candidate) continue;
|
|
449
|
+
|
|
450
|
+
// Verify no signature index conflict with the candidate entry
|
|
451
|
+
if (newRootSignatureIndices.size > 0) {
|
|
452
|
+
const existingIndicesByFunction = new Map<string, Set<number>>();
|
|
453
|
+
for (const er of candidate.equivalentRoots) {
|
|
454
|
+
const funcKey = er.function
|
|
455
|
+
? `${er.function.name}::${er.function.filePath}`
|
|
456
|
+
: '__self__';
|
|
457
|
+
const idx = extractSignatureIndex(er.schemaRootPath);
|
|
458
|
+
if (idx !== undefined) {
|
|
459
|
+
if (!existingIndicesByFunction.has(funcKey)) {
|
|
460
|
+
existingIndicesByFunction.set(funcKey, new Set());
|
|
388
461
|
}
|
|
462
|
+
existingIndicesByFunction.get(funcKey)!.add(idx);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
389
465
|
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
// Conflict: entry has indices like [1] but we want to add [2]
|
|
403
|
-
return false;
|
|
404
|
-
}
|
|
405
|
-
}
|
|
466
|
+
let hasConflict = false;
|
|
467
|
+
for (const newRoot of equivalentRoots) {
|
|
468
|
+
const funcKey = newRoot.function
|
|
469
|
+
? `${newRoot.function.name}::${newRoot.function.filePath}`
|
|
470
|
+
: '__self__';
|
|
471
|
+
const newIdx = extractSignatureIndex(newRoot.schemaRootPath);
|
|
472
|
+
if (newIdx !== undefined) {
|
|
473
|
+
const existingIndices = existingIndicesByFunction.get(funcKey);
|
|
474
|
+
if (existingIndices && existingIndices.size > 0) {
|
|
475
|
+
if (!existingIndices.has(newIdx)) {
|
|
476
|
+
hasConflict = true;
|
|
477
|
+
break;
|
|
406
478
|
}
|
|
407
479
|
}
|
|
408
480
|
}
|
|
481
|
+
}
|
|
409
482
|
|
|
410
|
-
|
|
411
|
-
});
|
|
483
|
+
if (hasConflict) continue;
|
|
412
484
|
}
|
|
485
|
+
|
|
486
|
+
equivalentSchemaPathsEntry = candidate;
|
|
413
487
|
}
|
|
414
488
|
|
|
415
489
|
if (!equivalentSchemaPathsEntry) {
|
|
@@ -467,6 +541,9 @@ export default function mergeInDependentDataStructure({
|
|
|
467
541
|
return true;
|
|
468
542
|
});
|
|
469
543
|
|
|
544
|
+
// Keep the espIndex in sync after adding/deduplicating roots
|
|
545
|
+
updateEspIndex(equivalentSchemaPathsEntry);
|
|
546
|
+
|
|
470
547
|
return equivalentSchemaPathsEntry;
|
|
471
548
|
};
|
|
472
549
|
|
|
@@ -535,6 +612,8 @@ export default function mergeInDependentDataStructure({
|
|
|
535
612
|
);
|
|
536
613
|
|
|
537
614
|
const derivedBasePaths: { path: string; functionName?: string }[] = [];
|
|
615
|
+
const allPathSet = new Set(allPaths.map((p) => p.path));
|
|
616
|
+
const derivedBasePathSet = new Set<string>();
|
|
538
617
|
|
|
539
618
|
// For each child path, find its equivalent parent path and derive bases
|
|
540
619
|
for (const childPathInfo of childPaths) {
|
|
@@ -611,26 +690,28 @@ export default function mergeInDependentDataStructure({
|
|
|
611
690
|
!childHasArrayIterator &&
|
|
612
691
|
!childBaseIsGenericSignature
|
|
613
692
|
) {
|
|
614
|
-
// Add child base if not already present
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
693
|
+
// Add child base if not already present (O(1) Set lookup)
|
|
694
|
+
if (
|
|
695
|
+
!allPathSet.has(childBase) &&
|
|
696
|
+
!derivedBasePathSet.has(childBase)
|
|
697
|
+
) {
|
|
619
698
|
derivedBasePaths.push({
|
|
620
699
|
path: childBase,
|
|
621
700
|
functionName: childPathInfo.functionName,
|
|
622
701
|
});
|
|
702
|
+
derivedBasePathSet.add(childBase);
|
|
623
703
|
}
|
|
624
704
|
|
|
625
|
-
// Add parent base if not already present
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
705
|
+
// Add parent base if not already present (O(1) Set lookup)
|
|
706
|
+
if (
|
|
707
|
+
!allPathSet.has(parentBase) &&
|
|
708
|
+
!derivedBasePathSet.has(parentBase)
|
|
709
|
+
) {
|
|
630
710
|
derivedBasePaths.push({
|
|
631
711
|
path: parentBase,
|
|
632
712
|
functionName: parentPathInfo.functionName,
|
|
633
713
|
});
|
|
714
|
+
derivedBasePathSet.add(parentBase);
|
|
634
715
|
}
|
|
635
716
|
}
|
|
636
717
|
}
|
|
@@ -708,21 +789,20 @@ export default function mergeInDependentDataStructure({
|
|
|
708
789
|
}
|
|
709
790
|
|
|
710
791
|
for (const schema of schemas) {
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
792
|
+
// Use pre-computed index to only iterate schema entries whose
|
|
793
|
+
// normalized first part matches pathParts[0], instead of all entries.
|
|
794
|
+
const schemaIndex = getSchemaIndex(schema);
|
|
795
|
+
const lookupPart = pathParts[0] ?? '';
|
|
796
|
+
const lookupParenIdx = lookupPart.indexOf('(');
|
|
797
|
+
const lookupBase =
|
|
798
|
+
lookupParenIdx >= 0
|
|
799
|
+
? lookupPart.slice(0, lookupParenIdx)
|
|
800
|
+
: lookupPart;
|
|
801
|
+
const candidates = schemaIndex.byFirstPart.get(lookupBase) || [];
|
|
802
|
+
for (const {
|
|
803
|
+
path: schemaPath,
|
|
804
|
+
parts: schemaPathParts,
|
|
805
|
+
} of candidates) {
|
|
726
806
|
if (schemaPathParts.length < pathParts.length) continue;
|
|
727
807
|
|
|
728
808
|
// Check if all path parts match (allowing function call variants)
|
|
@@ -850,10 +930,17 @@ export default function mergeInDependentDataStructure({
|
|
|
850
930
|
const entry = findOrCreateEquivalentSchemaPathsEntry([
|
|
851
931
|
{ path: translatedBasePath, functionName: functionName },
|
|
852
932
|
]);
|
|
853
|
-
|
|
933
|
+
const newRoot = {
|
|
854
934
|
schemaRootPath: translatedBasePath,
|
|
855
935
|
function: findRelevantDependency(functionName),
|
|
856
|
-
}
|
|
936
|
+
};
|
|
937
|
+
entry.equivalentRoots.push(newRoot);
|
|
938
|
+
// Update index for the newly added root
|
|
939
|
+
const newRootFuncName = newRoot.function?.name ?? rootScopeName;
|
|
940
|
+
espIndex.set(
|
|
941
|
+
espIndexKey(newRoot.schemaRootPath, newRootFuncName),
|
|
942
|
+
entry,
|
|
943
|
+
);
|
|
857
944
|
|
|
858
945
|
const basePathParts = splitOutsideParenthesesAndArrays(basePath);
|
|
859
946
|
for (const schemaPath in dataStructure.returnValueSchema) {
|
|
@@ -1113,6 +1200,10 @@ export default function mergeInDependentDataStructure({
|
|
|
1113
1200
|
|
|
1114
1201
|
equivalentSchemaPaths = mergeAllEquivalentSchemaPaths();
|
|
1115
1202
|
|
|
1203
|
+
// Collect schemas that need cleaning — batch the calls for the end instead of
|
|
1204
|
+
// calling cleanSchema inside the inner root loop (which was O(roots * schemaSize)).
|
|
1205
|
+
const schemasToClean = new Set<{ [key: string]: string }>();
|
|
1206
|
+
|
|
1116
1207
|
for (const esp of equivalentSchemaPaths) {
|
|
1117
1208
|
// Pre-compute which postfixes have children to avoid O(n²) lookups in the inner loop.
|
|
1118
1209
|
// A postfix "has children" if there are other postfixes that extend it.
|
|
@@ -1290,10 +1381,15 @@ export default function mergeInDependentDataStructure({
|
|
|
1290
1381
|
schema[newSchemaPath] = postfixValue;
|
|
1291
1382
|
}
|
|
1292
1383
|
|
|
1293
|
-
|
|
1384
|
+
schemasToClean.add(schema);
|
|
1294
1385
|
}
|
|
1295
1386
|
}
|
|
1296
1387
|
|
|
1388
|
+
// Batch-clean all modified schemas once (instead of once per root per ESP entry)
|
|
1389
|
+
for (const schema of schemasToClean) {
|
|
1390
|
+
cleanSchema(schema, { stage: 'afterMergePostfix' });
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1297
1393
|
// Propagate equivalency-derived attributes to generic function call variants.
|
|
1298
1394
|
// When attributes are traced via equivalencies (e.g., fileComparisons from buildDataMap.signature[2]),
|
|
1299
1395
|
// they get written to non-generic paths (returnValue.data.x or funcName().functionCallReturnValue.data.x).
|
|
@@ -11,15 +11,15 @@
|
|
|
11
11
|
"author": "",
|
|
12
12
|
"license": "ISC",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@aws-sdk/client-codebuild": "^3.
|
|
15
|
-
"@aws-sdk/client-cloudwatch-logs": "^3.
|
|
16
|
-
"@aws-sdk/client-dynamodb": "^3.
|
|
17
|
-
"@aws-sdk/client-ecr": "^3.
|
|
18
|
-
"@aws-sdk/client-ecs": "^3.
|
|
19
|
-
"@aws-sdk/client-s3": "^3.
|
|
20
|
-
"@aws-sdk/client-sqs": "^3.
|
|
21
|
-
"@aws-sdk/lib-storage": "^3.
|
|
22
|
-
"@aws-sdk/s3-request-presigner": "^3.
|
|
23
|
-
"@aws-sdk/util-dynamodb": "^3.
|
|
14
|
+
"@aws-sdk/client-codebuild": "^3.1000.0",
|
|
15
|
+
"@aws-sdk/client-cloudwatch-logs": "^3.990.0",
|
|
16
|
+
"@aws-sdk/client-dynamodb": "^3.990.0",
|
|
17
|
+
"@aws-sdk/client-ecr": "^3.990.0",
|
|
18
|
+
"@aws-sdk/client-ecs": "^3.990.0",
|
|
19
|
+
"@aws-sdk/client-s3": "^3.990.0",
|
|
20
|
+
"@aws-sdk/client-sqs": "^3.990.0",
|
|
21
|
+
"@aws-sdk/lib-storage": "^3.990.0",
|
|
22
|
+
"@aws-sdk/s3-request-presigner": "^3.990.0",
|
|
23
|
+
"@aws-sdk/util-dynamodb": "^3.990.0"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -75,6 +75,7 @@ export * from './src/lib/kysely/tables/backgroundJobsTable';
|
|
|
75
75
|
export * from './src/lib/kysely/tables/branchesTable';
|
|
76
76
|
export * from './src/lib/kysely/tables/commitBranchesTable';
|
|
77
77
|
export * from './src/lib/kysely/tables/commitsTable';
|
|
78
|
+
export * from './src/lib/kysely/tables/editorScenariosTable';
|
|
78
79
|
export * from './src/lib/kysely/tables/entitiesTable';
|
|
79
80
|
export * from './src/lib/kysely/tables/entityBranchesTable';
|
|
80
81
|
export * from './src/lib/kysely/tables/entityStatementsTable';
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
"license": "ISC",
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@supabase/supabase-js": "2.88.0",
|
|
16
|
-
"better-sqlite3": "^12.
|
|
16
|
+
"better-sqlite3": "^12.6.2",
|
|
17
17
|
"fetch-retry": "^6.0.0",
|
|
18
18
|
"kysely": "^0.28.11",
|
|
19
|
-
"pg": "^8.
|
|
19
|
+
"pg": "^8.19.0"
|
|
20
20
|
},
|
|
21
21
|
"jest": {
|
|
22
22
|
"preset": "ts-jest",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/better-sqlite3": "^7.6.13",
|
|
27
27
|
"@types/jest": "^30.0.0",
|
|
28
|
-
"@types/pg": "^8.
|
|
28
|
+
"@types/pg": "^8.18.0",
|
|
29
29
|
"@types/ws": "^8.18.1"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnalysisBranch } from '~codeyam/types';
|
|
2
2
|
import { DbAnalysisBranch } from './kysely/tableRelations';
|
|
3
|
-
|
|
3
|
+
const randomUUID = () => crypto.randomUUID();
|
|
4
4
|
import { AnalysisBranchesTable } from './kysely/tables/analysisBranchesTable';
|
|
5
5
|
import { type Insertable } from 'kysely';
|
|
6
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Analysis } from '~codeyam/types';
|
|
2
2
|
import { type Insertable } from 'kysely';
|
|
3
3
|
import { AnalysesTable } from './kysely/tables/analysesTable';
|
|
4
|
-
|
|
4
|
+
const randomUUID = () => crypto.randomUUID();
|
|
5
5
|
|
|
6
6
|
export default function analysisToDb(
|
|
7
7
|
analysis: Analysis,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Branch } from '~codeyam/types';
|
|
2
2
|
import { type Insertable } from 'kysely';
|
|
3
3
|
import { BranchesTable } from './kysely/tables/branchesTable';
|
|
4
|
-
|
|
4
|
+
const randomUUID = () => crypto.randomUUID();
|
|
5
5
|
|
|
6
6
|
export default function branchToDb(branch: Branch): Insertable<BranchesTable> {
|
|
7
7
|
const { id, projectId, activeAt, contentChangedAt, metadata, ...remaining } =
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CommitBranch } from '~codeyam/types';
|
|
2
2
|
import { type Insertable } from 'kysely';
|
|
3
|
-
|
|
3
|
+
const randomUUID = () => crypto.randomUUID();
|
|
4
4
|
import { CommitBranchesTable } from './kysely/tables/commitBranchesTable';
|
|
5
5
|
|
|
6
6
|
export default function commitBranchToDb(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Commit } from '~codeyam/types';
|
|
2
2
|
import { CommitsTable } from './kysely/tables/commitsTable';
|
|
3
3
|
import { type Insertable } from 'kysely';
|
|
4
|
-
|
|
4
|
+
const randomUUID = () => crypto.randomUUID();
|
|
5
5
|
|
|
6
6
|
export default function commitToDb(
|
|
7
7
|
commit: Commit,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { File } from '~codeyam/types';
|
|
2
2
|
import { type Insertable } from 'kysely';
|
|
3
3
|
import { FilesTable } from './kysely/tables/filesTable';
|
|
4
|
-
|
|
4
|
+
const randomUUID = () => crypto.randomUUID();
|
|
5
5
|
|
|
6
6
|
export default function fileToDb(file: File): Insertable<FilesTable> {
|
|
7
7
|
return {
|
|
@@ -62,6 +62,10 @@ import {
|
|
|
62
62
|
createScenarioCommentsTable,
|
|
63
63
|
ScenarioCommentsTable,
|
|
64
64
|
} from './tables/scenarioCommentsTable';
|
|
65
|
+
import {
|
|
66
|
+
createEditorScenariosTable,
|
|
67
|
+
EditorScenariosTable,
|
|
68
|
+
} from './tables/editorScenariosTable';
|
|
65
69
|
import { createScenariosTable, ScenariosTable } from './tables/scenariosTable';
|
|
66
70
|
import {
|
|
67
71
|
createStatementsTable,
|
|
@@ -106,6 +110,7 @@ const databaseSchema = {
|
|
|
106
110
|
commit_branches: schemaField<CommitBranchesTable>(),
|
|
107
111
|
commits: schemaField<CommitsTable>(),
|
|
108
112
|
debug_reports: schemaField<DebugBundlesTable>(),
|
|
113
|
+
editor_scenarios: schemaField<EditorScenariosTable>(),
|
|
109
114
|
entities: schemaField<EntitiesTable>(),
|
|
110
115
|
entity_branches: schemaField<EntityBranchesTable>(),
|
|
111
116
|
entity_statements: schemaField<EntityStatementsTable>(),
|
|
@@ -210,6 +215,7 @@ export function getSqliteDatabase(sqlitePath?: string) {
|
|
|
210
215
|
fileMustExist: false,
|
|
211
216
|
});
|
|
212
217
|
sqlite.pragma('journal_mode = WAL');
|
|
218
|
+
sqlite.pragma('busy_timeout = 5000');
|
|
213
219
|
sqlite.pragma('synchronous = FULL');
|
|
214
220
|
|
|
215
221
|
// Verify the database has the expected schema
|
|
@@ -305,6 +311,7 @@ export async function getDatabaseForTesting(
|
|
|
305
311
|
// Standard SQLite testing path
|
|
306
312
|
const sqlite = new SQLiteDatabase(dbPath);
|
|
307
313
|
sqlite.pragma('journal_mode = WAL');
|
|
314
|
+
sqlite.pragma('busy_timeout = 5000');
|
|
308
315
|
sqlite.pragma('synchronous = FULL');
|
|
309
316
|
const kyselyDb = new Kysely<Database>({
|
|
310
317
|
dialect: new SqliteDialect({ database: sqlite }),
|
|
@@ -390,6 +397,7 @@ export async function createSqliteSchema(db: Kysely<Database>): Promise<void> {
|
|
|
390
397
|
await createCommitBranchesTable(db);
|
|
391
398
|
await createCommitsTable(db);
|
|
392
399
|
await createDebugBundlesTable(db);
|
|
400
|
+
await createEditorScenariosTable(db);
|
|
393
401
|
await createEntitiesTable(db);
|
|
394
402
|
await createEntityBranchesTable(db);
|
|
395
403
|
await createEntityStatementsTable(db);
|
|
@@ -6,7 +6,7 @@ import { schemaField, defaultNow } from '../schemaHelpers';
|
|
|
6
6
|
/**
|
|
7
7
|
* Metadata for a debug bundle upload.
|
|
8
8
|
* Note: "bundle" refers to the tarball upload (base + delta).
|
|
9
|
-
* The markdown "debug report" from /codeyam
|
|
9
|
+
* The markdown "debug report" from /codeyam-diagnose is stored in feedback.debugReport.
|
|
10
10
|
*/
|
|
11
11
|
interface DebugBundleMetadata {
|
|
12
12
|
timestamp: string;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Kysely, ColumnDefinitionBuilder } from 'kysely';
|
|
2
|
+
import type { Generated } from 'kysely';
|
|
3
|
+
|
|
4
|
+
import { schemaField, defaultNow } from '../schemaHelpers';
|
|
5
|
+
|
|
6
|
+
const editorScenariosSchema = {
|
|
7
|
+
id: schemaField<Generated<string>>(),
|
|
8
|
+
project_id: schemaField<string>(),
|
|
9
|
+
name: schemaField<string>(),
|
|
10
|
+
description: schemaField<string | null>(),
|
|
11
|
+
component_name: schemaField<string | null>(),
|
|
12
|
+
component_path: schemaField<string | null>(),
|
|
13
|
+
screenshot_path: schemaField<string | null>(),
|
|
14
|
+
created_at: schemaField<Generated<string>>(),
|
|
15
|
+
updated_at: schemaField<Generated<string>>(),
|
|
16
|
+
} as const;
|
|
17
|
+
|
|
18
|
+
export type EditorScenariosTable = {
|
|
19
|
+
[K in keyof typeof editorScenariosSchema]: (typeof editorScenariosSchema)[K];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const EditorScenariosTableColumns = Object.keys(
|
|
23
|
+
editorScenariosSchema,
|
|
24
|
+
) as (keyof EditorScenariosTable)[];
|
|
25
|
+
|
|
26
|
+
export async function createEditorScenariosTable(
|
|
27
|
+
db: Kysely<any>,
|
|
28
|
+
): Promise<void> {
|
|
29
|
+
await db.schema
|
|
30
|
+
.createTable('editor_scenarios')
|
|
31
|
+
.addColumn('id', 'uuid', (col: ColumnDefinitionBuilder) => col.primaryKey())
|
|
32
|
+
.addColumn('project_id', 'uuid', (col: ColumnDefinitionBuilder) =>
|
|
33
|
+
col.notNull(),
|
|
34
|
+
)
|
|
35
|
+
.addColumn('name', 'varchar', (col: ColumnDefinitionBuilder) =>
|
|
36
|
+
col.notNull(),
|
|
37
|
+
)
|
|
38
|
+
.addColumn('description', 'text')
|
|
39
|
+
.addColumn('component_name', 'varchar')
|
|
40
|
+
.addColumn('component_path', 'varchar')
|
|
41
|
+
.addColumn('screenshot_path', 'varchar')
|
|
42
|
+
.addColumn('created_at', 'datetime', defaultNow(true))
|
|
43
|
+
.addColumn('updated_at', 'datetime', defaultNow(true))
|
|
44
|
+
.ifNotExists()
|
|
45
|
+
.execute();
|
|
46
|
+
|
|
47
|
+
// Add columns to existing tables (ALTER TABLE has no IF NOT EXISTS in SQLite)
|
|
48
|
+
for (const col of [
|
|
49
|
+
'component_name',
|
|
50
|
+
'component_path',
|
|
51
|
+
'screenshot_path',
|
|
52
|
+
] as const) {
|
|
53
|
+
try {
|
|
54
|
+
await db.schema
|
|
55
|
+
.alterTable('editor_scenarios')
|
|
56
|
+
.addColumn(col, 'varchar')
|
|
57
|
+
.execute();
|
|
58
|
+
} catch {
|
|
59
|
+
// Column already exists — expected for fresh databases
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|