@codeyam/codeyam-cli 0.1.0-staging.1a2737b → 0.1.0-staging.27d5a59
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 +9 -9
- package/analyzer-template/packages/ai/package.json +2 -2
- package/analyzer-template/packages/ai/src/lib/astScopes/astScopeAnalyzer.ts +34 -3
- package/analyzer-template/packages/ai/src/lib/completionCall.ts +114 -113
- package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +27 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.ts +62 -0
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +78 -2
- package/analyzer-template/packages/analyze/src/lib/ProjectAnalyzer.ts +19 -7
- package/analyzer-template/packages/analyze/src/lib/asts/index.ts +7 -2
- 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/generateDataStructure.ts +83 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +23 -4
- package/analyzer-template/packages/aws/package.json +1 -1
- 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/kysely/db.ts +8 -0
- 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/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/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/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/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/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 +6 -2
- 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 +14 -2
- package/analyzer-template/playwright/captureFromUrl.ts +89 -82
- package/analyzer-template/project/constructMockCode.ts +136 -43
- 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 +36 -7
- package/analyzer-template/tsconfig.json +13 -1
- package/background/src/lib/virtualized/project/constructMockCode.js +115 -34
- package/background/src/lib/virtualized/project/constructMockCode.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 +29 -7
- package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
- package/codeyam-cli/scripts/apply-setup.js +208 -11
- package/codeyam-cli/scripts/apply-setup.js.map +1 -1
- package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js +196 -0
- package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js.map +1 -0
- package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js +114 -0
- package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js.map +1 -0
- package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js +149 -0
- package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js.map +1 -0
- package/codeyam-cli/src/cli.js +9 -12
- package/codeyam-cli/src/cli.js.map +1 -1
- package/codeyam-cli/src/commands/analyze.js +17 -7
- package/codeyam-cli/src/commands/analyze.js.map +1 -1
- package/codeyam-cli/src/commands/default.js +7 -2
- package/codeyam-cli/src/commands/default.js.map +1 -1
- package/codeyam-cli/src/commands/editor.js +1982 -0
- package/codeyam-cli/src/commands/editor.js.map +1 -0
- package/codeyam-cli/src/commands/init.js +40 -11
- package/codeyam-cli/src/commands/init.js.map +1 -1
- package/codeyam-cli/src/commands/memory.js +29 -58
- package/codeyam-cli/src/commands/memory.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 +6 -0
- package/codeyam-cli/src/utils/__tests__/npmVersionCheck.test.js.map +1 -1
- 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 +26 -0
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
- package/codeyam-cli/src/utils/backgroundServer.js +21 -5
- 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/git.js +103 -0
- package/codeyam-cli/src/utils/git.js.map +1 -1
- package/codeyam-cli/src/utils/install-skills.js +57 -15
- 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/npmVersionCheck.js +2 -2
- package/codeyam-cli/src/utils/npmVersionCheck.js.map +1 -1
- package/codeyam-cli/src/utils/pathIgnoring.js +19 -7
- package/codeyam-cli/src/utils/pathIgnoring.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 +1 -1
- package/codeyam-cli/src/utils/requireSimulations.js.map +1 -1
- package/codeyam-cli/src/utils/ruleReflection/__tests__/contextBuilder.test.js +5 -6
- package/codeyam-cli/src/utils/ruleReflection/__tests__/contextBuilder.test.js.map +1 -1
- package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.js +2 -5
- package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.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__/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 +14 -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/sourceFiles.js +43 -0
- package/codeyam-cli/src/utils/rules/sourceFiles.js.map +1 -0
- 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 +27 -2
- package/codeyam-cli/src/utils/serverState.js.map +1 -1
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +45 -4
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
- package/codeyam-cli/src/utils/simulationGateMiddleware.js +63 -42
- package/codeyam-cli/src/utils/simulationGateMiddleware.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 +21 -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/app/lib/database.js +41 -27
- 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 +118 -18
- package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{CopyButton-jNYXRRNI.js → CopyButton-DmJveP3T.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-bwuHPyTa.js → EntityItem-C76mRRiF.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-CvzqMxcu.js → EntityTypeBadge-g3saevPb.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-BH0XDim7.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-yjIHlOGa.js → InteractivePreview-DYFW3lDD.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-Cq5o8jL4.js → LibraryFunctionPreview-DLeucoVX.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-BvMu2i-g.js → LoadingDots-BU_OAEMP.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-kgBTLoJD.js → LogViewer-ceAyBX-H.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-BzPgx-xO.js → ReportIssueModal-djPLI-WV.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-CwZrv-Ok.js → SafeScreenshot-BED4B6sP.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-BX2Ny2Qj.js → ScenarioViewer-B76aig_2.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/Spinner-Bb5uFQ5V.js +34 -0
- package/codeyam-cli/src/webserver/build/client/assets/Terminal-nZNBALox.js +41 -0
- package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-CDpEprKa.js → TruncatedFilePath-C8OKAR5x.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{_index-BRx8ZGZo.js → _index-C96V0n15.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-4S4yPfFw.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.dev-mode-events-l0sNRNKZ.js +1 -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-file-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-D4IPYH_y.js → book-open-D_nMCFmP.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-CG65viiV.js → chevron-down-BH2h1Ea2.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{chunk-JZWAC4HX-DB3aFuEO.js → chunk-JZWAC4HX-C4pqxYJB.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{circle-check-igfMr5DY.js → circle-check-DyIKORY6.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{copy-Coc4o_8c.js → copy-NDbZjXao.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-D1zB-pYc.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-B2KwhQph.js +8 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-B0h9AqE6.js → entity._sha._-CrjR3zZW.js} +10 -10
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-DjACbfdI.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-PePWg17F.js → entity._sha_.edit._scenarioId-BMvVHNXU.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{entry.client-I-Wo99C_.js → entry.client-DTvKq3TY.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{fileTableUtils-9sMMAiWJ.js → fileTableUtils-cPo8LiG3.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{files-Co65J0s3.js → files-DO4CZ16O.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{git-BdHOxVfg.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-CUM5iXwc.js → index-10oVnAAH.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{index-_417gcQW.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-TzRHMVog.js → loader-circle-BAXYRVEO.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-af20abcd.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-hjzB7t2z.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-DcAwD_Ln.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-DVNJVQgD.js → simulations-B3aOzpCZ.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{terminal-DbEAHMbA.js → terminal-BG4heKCG.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-CAD5b1o_.js → triangle-alert-DtSmdtM4.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useCustomSizes-BqgrAzs3.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-DZlYx2c4.js → useReportContext-O-jkvSPx.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useToast-ihdMtlf6.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-D_kZbNJs.js +1 -0
- package/codeyam-cli/src/webserver/build/server/assets/server-build-CWy5OIH9.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/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 +24 -4
- package/codeyam-cli/templates/rules-instructions.md +34 -88
- 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} +215 -0
- 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.mjs +139 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/find-exports.mjs +52 -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/lib/read-json-field.mjs +61 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/ripgrep-fallback.mjs +155 -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.mjs +13 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/filter-session.mjs +95 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/preprocess.mjs +160 -0
- package/codeyam-cli/templates/{codeyam-new-rule.md → skills/codeyam-new-rule/SKILL.md} +0 -2
- package/package.json +12 -10
- 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/completionCall.js +10 -7
- package/packages/ai/src/lib/completionCall.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +21 -0
- 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/stripNullableMarkers.js +34 -0
- package/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.js.map +1 -0
- package/packages/ai/src/lib/generateEntityScenarioData.js +57 -2
- package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
- package/packages/analyze/src/lib/ProjectAnalyzer.js +13 -4
- package/packages/analyze/src/lib/ProjectAnalyzer.js.map +1 -1
- package/packages/analyze/src/lib/asts/index.js +4 -2
- package/packages/analyze/src/lib/asts/index.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/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 +18 -4
- 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/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/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 +6 -2
- 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 -120
- 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-EhOseatT.js +0 -34
- package/codeyam-cli/src/webserver/build/client/assets/agent-transcripts-DHKuQSmR.js +0 -17
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-JTAjQ54M.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-DjLxr2JB.js +0 -6
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-CtYowLOt.js +0 -6
- package/codeyam-cli/src/webserver/build/client/assets/globals-BSZfYCkU.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/labs-BK0C1H1T.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-040dab1c.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/memory-UIDVz141.js +0 -92
- package/codeyam-cli/src/webserver/build/client/assets/root-D1WadSdf.js +0 -62
- package/codeyam-cli/src/webserver/build/client/assets/settings-CclxrcPK.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-DAFqfEDH.js +0 -2
- package/codeyam-cli/src/webserver/build/server/assets/index-B3dE0r28.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-DYbfdxa3.js +0 -273
- package/codeyam-cli/templates/codeyam-stop-hook.sh +0 -284
- package/scripts/finalize-analyzer.cjs +0 -13
- /package/codeyam-cli/templates/{codeyam-diagnose.md → commands/codeyam-diagnose.md} +0 -0
- /package/codeyam-cli/templates/{codeyam-debug.md → skills/codeyam-debug/SKILL.md} +0 -0
- /package/codeyam-cli/templates/{codeyam-setup.md → skills/codeyam-setup/SKILL.md} +0 -0
- /package/codeyam-cli/templates/{codeyam-sim.md → skills/codeyam-sim/SKILL.md} +0 -0
- /package/codeyam-cli/templates/{codeyam-test.md → skills/codeyam-test/SKILL.md} +0 -0
- /package/codeyam-cli/templates/{codeyam-verify.md → skills/codeyam-verify/SKILL.md} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"buildTimestamp": "2026-
|
|
3
|
-
"buildTime":
|
|
4
|
-
"gitCommit": "
|
|
2
|
+
"buildTimestamp": "2026-03-04T15:14:59.990Z",
|
|
3
|
+
"buildTime": 1772637299990,
|
|
4
|
+
"gitCommit": "27d5a59ac1626fe196a1738a3ff894057deb9361",
|
|
5
5
|
"nodeVersion": "v20.20.0",
|
|
6
|
-
"contentHash": "
|
|
7
|
-
"buildNumber":
|
|
8
|
-
"semanticVersion": "0.1.
|
|
9
|
-
"version": "0.1.
|
|
6
|
+
"contentHash": "1348fb22a8854524e9b9fe65a720281456edd206f1009239c3ad46934f629fb5",
|
|
7
|
+
"buildNumber": 832,
|
|
8
|
+
"semanticVersion": "0.1.832",
|
|
9
|
+
"version": "0.1.832 (2026-03-04T15:14+1348fb2)"
|
|
10
10
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
[
|
|
3
|
-
[
|
|
2
|
+
[3/4/2026, 3:14:59 PM] > codeyam-combo@1.0.0 mergeDependencies
|
|
3
|
+
[3/4/2026, 3:14:59 PM] > node ./scripts/mergePackageJsonFiles.cjs
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
[
|
|
6
|
+
[3/4/2026, 3:14:59 PM] Merged dependencies into root package.json
|
|
7
7
|
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@aws-sdk/client-cloudwatch-logs": "^3.990.0",
|
|
11
11
|
"@aws-sdk/client-cloudfront": "^3.990.0",
|
|
12
|
-
"@aws-sdk/client-codebuild": "^3.
|
|
12
|
+
"@aws-sdk/client-codebuild": "^3.1000.0",
|
|
13
13
|
"@aws-sdk/client-dynamodb": "^3.990.0",
|
|
14
14
|
"@aws-sdk/client-ec2": "^3.990.0",
|
|
15
15
|
"@aws-sdk/client-ecr": "^3.990.0",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@aws-sdk/client-sqs": "^3.990.0",
|
|
19
19
|
"@aws-sdk/lib-storage": "^3.990.0",
|
|
20
20
|
"@aws-sdk/util-dynamodb": "^3.990.0",
|
|
21
|
-
"@octokit/auth-app": "^8.
|
|
21
|
+
"@octokit/auth-app": "^8.2.0",
|
|
22
22
|
"@octokit/rest": "^22.0.0",
|
|
23
23
|
"@sendgrid/mail": "^8.1.4",
|
|
24
24
|
"@supabase/supabase-js": "2.88.0",
|
|
@@ -32,24 +32,24 @@
|
|
|
32
32
|
"jsonc-parser": "^3.2.1",
|
|
33
33
|
"lru-cache": "^11.2.5",
|
|
34
34
|
"openai": "^6.16.0",
|
|
35
|
-
"p-queue": "^
|
|
35
|
+
"p-queue": "^9.1.0",
|
|
36
36
|
"p-retry": "^7.1.1",
|
|
37
37
|
"piscina": "^5.1.4",
|
|
38
38
|
"pixelmatch": "^5.3.0",
|
|
39
39
|
"playwright": "1.58.0",
|
|
40
40
|
"sharp": "^0.34.5",
|
|
41
|
-
"simple-git": "^3.
|
|
41
|
+
"simple-git": "^3.32.2",
|
|
42
42
|
"undici": "^7.18.2",
|
|
43
43
|
"uuid": "^11.1.0",
|
|
44
44
|
"pluralize": "^8.0.0",
|
|
45
45
|
"yargs": "^18.0.0",
|
|
46
46
|
"json5": "^2.2.3",
|
|
47
|
-
"@anthropic-ai/sdk": "^0.
|
|
47
|
+
"@anthropic-ai/sdk": "^0.78.0",
|
|
48
48
|
"@aws-sdk/s3-request-presigner": "^3.990.0",
|
|
49
|
-
"better-sqlite3": "^12.
|
|
49
|
+
"better-sqlite3": "^12.6.2",
|
|
50
50
|
"fetch-retry": "^6.0.0",
|
|
51
51
|
"kysely": "^0.28.11",
|
|
52
|
-
"pg": "^8.
|
|
52
|
+
"pg": "^8.19.0",
|
|
53
53
|
"@octokit/request": "^10.0.3",
|
|
54
54
|
"lucide-react": "^0.556.0",
|
|
55
55
|
"react-resizable": "^3.0.5"
|
|
@@ -57,12 +57,12 @@
|
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"typescript": "^5.9.3",
|
|
59
59
|
"@jest/types": "^30.2.0",
|
|
60
|
-
"@types/node": "^25.
|
|
60
|
+
"@types/node": "^25.3.3",
|
|
61
61
|
"@types/yargs": "^17.0.34",
|
|
62
62
|
"@types/jsdom": "^27.0.0",
|
|
63
63
|
"@types/better-sqlite3": "^7.6.13",
|
|
64
64
|
"@types/jest": "^30.0.0",
|
|
65
|
-
"@types/pg": "^8.
|
|
65
|
+
"@types/pg": "^8.18.0",
|
|
66
66
|
"@types/ws": "^8.18.1",
|
|
67
67
|
"@octokit/types": "^16.0.0",
|
|
68
68
|
"@types/react": "^19.2.7",
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
"author": "",
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@anthropic-ai/sdk": "^0.
|
|
12
|
+
"@anthropic-ai/sdk": "^0.78.0",
|
|
13
13
|
"jsdom": "^27.4.0",
|
|
14
|
-
"p-queue": "^
|
|
14
|
+
"p-queue": "^9.1.0",
|
|
15
15
|
"p-retry": "^7.1.1",
|
|
16
16
|
"piscina": "^5.1.4",
|
|
17
17
|
"lru-cache": "^11.2.5"
|
|
@@ -909,11 +909,42 @@ export class ASTScopeAnalyzer {
|
|
|
909
909
|
if (tsType.flags & ts.TypeFlags.Union) {
|
|
910
910
|
const unionType = tsType as ts.UnionType;
|
|
911
911
|
|
|
912
|
-
// Check if it's a string literal union
|
|
913
|
-
|
|
912
|
+
// Check if it's a string literal union (optionally with null/undefined).
|
|
913
|
+
// Preserve literal values so the LLM knows which values are valid when
|
|
914
|
+
// generating mock data. Without this, types like
|
|
915
|
+
// 'suggestion' | 'warning' | 'achievement' | 'tip' become just 'string'
|
|
916
|
+
// and the LLM generates invalid values (e.g. "Motivational").
|
|
917
|
+
const stringLiterals = unionType.types.filter(
|
|
914
918
|
(t) => (t.flags & ts.TypeFlags.StringLiteral) !== 0,
|
|
915
919
|
);
|
|
916
|
-
|
|
920
|
+
const nullishTypes = unionType.types.filter(
|
|
921
|
+
(t) =>
|
|
922
|
+
(t.flags & ts.TypeFlags.Undefined) !== 0 ||
|
|
923
|
+
(t.flags & ts.TypeFlags.Null) !== 0,
|
|
924
|
+
);
|
|
925
|
+
|
|
926
|
+
if (
|
|
927
|
+
stringLiterals.length > 0 &&
|
|
928
|
+
stringLiterals.length + nullishTypes.length === unionType.types.length
|
|
929
|
+
) {
|
|
930
|
+
const literalValues = stringLiterals.map(
|
|
931
|
+
(t) => `'${(t as ts.LiteralType).value}'`,
|
|
932
|
+
);
|
|
933
|
+
const literalUnion = literalValues.join(' | ');
|
|
934
|
+
|
|
935
|
+
if (nullishTypes.length > 0) {
|
|
936
|
+
const nullishParts: string[] = [];
|
|
937
|
+
if (nullishTypes.some((t) => (t.flags & ts.TypeFlags.Null) !== 0))
|
|
938
|
+
nullishParts.push('null');
|
|
939
|
+
if (
|
|
940
|
+
nullishTypes.some((t) => (t.flags & ts.TypeFlags.Undefined) !== 0)
|
|
941
|
+
)
|
|
942
|
+
nullishParts.push('undefined');
|
|
943
|
+
return `${literalUnion} | ${nullishParts.join(' | ')}`;
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
return literalUnion;
|
|
947
|
+
}
|
|
917
948
|
|
|
918
949
|
// Check if it's a number literal union
|
|
919
950
|
const isAllNumberLiterals = unionType.types.every(
|
|
@@ -36,7 +36,6 @@ interface CompletionCallProps {
|
|
|
36
36
|
const queue = new PQueue({
|
|
37
37
|
concurrency: 100,
|
|
38
38
|
timeout: 20 * 60 * 1000, // 20 minutes
|
|
39
|
-
throwOnTimeout: true,
|
|
40
39
|
autoStart: true,
|
|
41
40
|
});
|
|
42
41
|
|
|
@@ -135,62 +134,63 @@ export default async function completionCall({
|
|
|
135
134
|
};
|
|
136
135
|
const params = lib.openai.chatRequestToOpenAIChatParams(chatRequest);
|
|
137
136
|
|
|
138
|
-
const
|
|
139
|
-
()
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}, 10000);
|
|
137
|
+
const chatCompletionResult = await queue.add(() => {
|
|
138
|
+
queueEndTime = Date.now();
|
|
139
|
+
return PRetry(
|
|
140
|
+
async () => {
|
|
141
|
+
const callStartTime = Date.now();
|
|
142
|
+
const waitingMessages = [
|
|
143
|
+
'Waiting for LLM response',
|
|
144
|
+
'Still waiting for LLM response',
|
|
145
|
+
'LLM call in progress',
|
|
146
|
+
'Processing LLM request',
|
|
147
|
+
'Awaiting LLM completion',
|
|
148
|
+
];
|
|
149
|
+
|
|
150
|
+
const logInterval = setInterval(() => {
|
|
151
|
+
const elapsedSeconds = Math.floor(
|
|
152
|
+
(Date.now() - callStartTime) / 1000,
|
|
153
|
+
);
|
|
154
|
+
const messageIndex =
|
|
155
|
+
Math.floor(elapsedSeconds / 10) % waitingMessages.length;
|
|
156
|
+
awsLogDebugLevel(
|
|
157
|
+
1,
|
|
158
|
+
`${waitingMessages[messageIndex]} [type=${type}, model=${model}, elapsed=${elapsedSeconds}s]`,
|
|
159
|
+
);
|
|
160
|
+
}, 10000);
|
|
163
161
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
},
|
|
162
|
+
try {
|
|
163
|
+
return await openai.chat.completions.create(params, {
|
|
164
|
+
timeout: 5 * 60 * 1000, // 5 minute timeout
|
|
165
|
+
});
|
|
166
|
+
} finally {
|
|
167
|
+
clearInterval(logInterval);
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
...defaultRetryOptions,
|
|
172
|
+
onFailedAttempt: (error) => {
|
|
173
|
+
retryCount++;
|
|
174
|
+
console.log(
|
|
175
|
+
`CodeYam Error: Completion call failed [model=${model}]`,
|
|
176
|
+
{
|
|
177
|
+
error,
|
|
178
|
+
prompt,
|
|
179
|
+
systemMessage,
|
|
180
|
+
attempts,
|
|
181
|
+
retryCount,
|
|
182
|
+
},
|
|
183
|
+
);
|
|
187
184
|
},
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
185
|
+
},
|
|
186
|
+
);
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
if (!chatCompletionResult) {
|
|
190
|
+
throw new Error('Completion call returned no result');
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const chatCompletion = chatCompletionResult;
|
|
194
194
|
const endTime = Date.now();
|
|
195
195
|
|
|
196
196
|
const llmCallStats = getLLMCallStats({
|
|
@@ -310,65 +310,66 @@ ${completion}
|
|
|
310
310
|
|
|
311
311
|
Please provide a corrected version with valid JSON only. Do not include any explanatory text, just the valid JSON object.`;
|
|
312
312
|
|
|
313
|
-
const
|
|
314
|
-
(
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
const
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
313
|
+
const correctionChatCompletionResult = await queue.add(() => {
|
|
314
|
+
return PRetry(
|
|
315
|
+
async () => {
|
|
316
|
+
const correctionStartTime = Date.now();
|
|
317
|
+
const waitingMessages = [
|
|
318
|
+
'Waiting for LLM correction response',
|
|
319
|
+
'Still waiting for LLM correction',
|
|
320
|
+
'LLM correction in progress',
|
|
321
|
+
'Processing LLM correction request',
|
|
322
|
+
'Awaiting LLM correction completion',
|
|
323
|
+
];
|
|
324
|
+
|
|
325
|
+
const logInterval = setInterval(() => {
|
|
326
|
+
const elapsedSeconds = Math.floor(
|
|
327
|
+
(Date.now() - correctionStartTime) / 1000,
|
|
328
|
+
);
|
|
329
|
+
const messageIndex =
|
|
330
|
+
Math.floor(elapsedSeconds / 10) % waitingMessages.length;
|
|
331
|
+
awsLogDebugLevel(
|
|
332
|
+
1,
|
|
333
|
+
`${waitingMessages[messageIndex]} [type=${type}, model=${model}, elapsed=${elapsedSeconds}s]`,
|
|
334
|
+
);
|
|
335
|
+
}, 10000);
|
|
336
|
+
|
|
337
|
+
try {
|
|
338
|
+
return await openai.chat.completions.create(
|
|
339
|
+
{
|
|
340
|
+
...params,
|
|
341
|
+
messages: [
|
|
342
|
+
{ role: 'system', content: systemMessage },
|
|
343
|
+
{ role: 'user', content: prompt },
|
|
344
|
+
{ role: 'assistant', content: completion },
|
|
345
|
+
{ role: 'user', content: correctionPrompt },
|
|
346
|
+
],
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
timeout: 5 * 60 * 1000,
|
|
350
|
+
},
|
|
351
|
+
);
|
|
352
|
+
} finally {
|
|
353
|
+
clearInterval(logInterval);
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
...defaultRetryOptions,
|
|
358
|
+
onFailedAttempt: (error) => {
|
|
359
|
+
console.log('CodeYam Error: Correction call failed', {
|
|
360
|
+
error,
|
|
361
|
+
attempts,
|
|
362
|
+
});
|
|
356
363
|
},
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
);
|
|
367
|
-
},
|
|
368
|
-
{
|
|
369
|
-
throwOnTimeout: true,
|
|
370
|
-
},
|
|
371
|
-
);
|
|
364
|
+
},
|
|
365
|
+
);
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
if (!correctionChatCompletionResult) {
|
|
369
|
+
throw new Error('Correction call returned no result');
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
const correctionChatCompletion = correctionChatCompletionResult;
|
|
372
373
|
|
|
373
374
|
const correctedRawCompletion =
|
|
374
375
|
correctionChatCompletion.choices?.[0]?.message?.content;
|
|
@@ -1108,6 +1108,33 @@ export class ScopeDataStructure {
|
|
|
1108
1108
|
return;
|
|
1109
1109
|
}
|
|
1110
1110
|
|
|
1111
|
+
// Case 3: Circular reference through scope-suffixed names (____cyScope pattern)
|
|
1112
|
+
// When a named arrow function is defined inside a scope (e.g., useEffect callback):
|
|
1113
|
+
// const identifyUser = async () => { ... };
|
|
1114
|
+
// identifyUser();
|
|
1115
|
+
// This creates a variable "identifyUser" and a scope "identifyUser____cyScope9F".
|
|
1116
|
+
// Mutual equivalencies between these cause infinite loops in Phase 2 because
|
|
1117
|
+
// processing one triggers addToSchema → followEquivalencies → addEquivalency
|
|
1118
|
+
// on the reverse, which repeats indefinitely.
|
|
1119
|
+
// Only block when the REVERSE direction already exists (creating a cycle).
|
|
1120
|
+
// The initial one-directional equivalency is necessary for scope resolution.
|
|
1121
|
+
if (
|
|
1122
|
+
path &&
|
|
1123
|
+
equivalentPath &&
|
|
1124
|
+
(equivalentPath.startsWith(path + '____') ||
|
|
1125
|
+
path.startsWith(equivalentPath + '____'))
|
|
1126
|
+
) {
|
|
1127
|
+
// Check if the reverse equivalency already exists
|
|
1128
|
+
const reverseEquivalencies =
|
|
1129
|
+
scopeNode.equivalencies[equivalentPath] || [];
|
|
1130
|
+
const reverseExists = reverseEquivalencies.some(
|
|
1131
|
+
(v) => v.schemaPath === path,
|
|
1132
|
+
);
|
|
1133
|
+
if (reverseExists) {
|
|
1134
|
+
return;
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1111
1138
|
if (!equivalentScopeName) {
|
|
1112
1139
|
console.error(
|
|
1113
1140
|
'CodeYam Error: Missing equivalent scope name - FULL CONTEXT:',
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coerces primitive values to empty arrays when the schema expects an array.
|
|
3
|
+
*
|
|
4
|
+
* The LLM sometimes generates a primitive (boolean, number, string) where the
|
|
5
|
+
* schema expects an array. For example:
|
|
6
|
+
* Schema: { webapps: [{ name: "string" }] }
|
|
7
|
+
* LLM output: { webapps: true }
|
|
8
|
+
*
|
|
9
|
+
* This causes runtime errors like `TypeError: config.webapps?.forEach is not a function`
|
|
10
|
+
* because the code expects an array but gets a boolean.
|
|
11
|
+
*
|
|
12
|
+
* Coercion rule:
|
|
13
|
+
* - primitive → array: replace with []
|
|
14
|
+
*
|
|
15
|
+
* Null and undefined values are preserved (they may be intentionally nullable).
|
|
16
|
+
*
|
|
17
|
+
* @param data The mock data object to coerce (mutated in place)
|
|
18
|
+
* @param schema The schema describing expected types
|
|
19
|
+
*/
|
|
20
|
+
export default function coercePrimitivesToArraysBySchema<T>(
|
|
21
|
+
data: T,
|
|
22
|
+
schema: unknown,
|
|
23
|
+
): T {
|
|
24
|
+
if (data === null || data === undefined) {
|
|
25
|
+
return data;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (typeof data !== 'object') {
|
|
29
|
+
return data;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (Array.isArray(data)) {
|
|
33
|
+
const itemSchema = Array.isArray(schema) ? schema[0] : undefined;
|
|
34
|
+
for (let i = 0; i < data.length; i++) {
|
|
35
|
+
data[i] = coercePrimitivesToArraysBySchema(data[i], itemSchema);
|
|
36
|
+
}
|
|
37
|
+
return data;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const dataObj = data as Record<string, unknown>;
|
|
41
|
+
const schemaObj = schema as Record<string, unknown> | undefined;
|
|
42
|
+
|
|
43
|
+
for (const key of Object.keys(dataObj)) {
|
|
44
|
+
const value = dataObj[key];
|
|
45
|
+
const fieldSchema = schemaObj?.[key];
|
|
46
|
+
|
|
47
|
+
if (value === null || value === undefined) {
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (typeof value !== 'object' && Array.isArray(fieldSchema)) {
|
|
52
|
+
// Schema expects an array but the value is a primitive.
|
|
53
|
+
// Replace with an empty array.
|
|
54
|
+
dataObj[key] = [];
|
|
55
|
+
} else if (typeof value === 'object' && value !== null) {
|
|
56
|
+
// Both value and schema are objects — recurse
|
|
57
|
+
coercePrimitivesToArraysBySchema(value, fieldSchema);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return data;
|
|
62
|
+
}
|
|
@@ -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
|
}
|
|
@@ -1063,6 +1115,18 @@ export async function generateDataForScenario({
|
|
|
1063
1115
|
);
|
|
1064
1116
|
}
|
|
1065
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
|
+
|
|
1066
1130
|
// Relocate misplaced nested keys to their correct position.
|
|
1067
1131
|
// The LLM sometimes places nested keys at root level instead of inside their
|
|
1068
1132
|
// parent object (e.g., 'fastener' at root instead of inside 'trpc').
|
|
@@ -1098,6 +1162,18 @@ export async function generateDataForScenario({
|
|
|
1098
1162
|
);
|
|
1099
1163
|
}
|
|
1100
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
|
+
|
|
1101
1177
|
// Convert comma-separated strings to arrays when appropriate.
|
|
1102
1178
|
// The LLM sometimes generates strings like "color,size" instead of arrays
|
|
1103
1179
|
// like ["color", "size"] when the schema type is incorrectly inferred as
|
|
@@ -46,6 +46,12 @@ export class ProjectAnalyzer {
|
|
|
46
46
|
lib.asts.createProgramFromTsConfigPath(configPath, excludePatterns),
|
|
47
47
|
);
|
|
48
48
|
|
|
49
|
+
if (this.programs.length === 0) {
|
|
50
|
+
throw new Error(
|
|
51
|
+
'No TypeScript programs could be created — no tsconfig.json found',
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
49
55
|
// Primary program is the first one (usually root) for backward compatibility
|
|
50
56
|
this.program = this.programs[0];
|
|
51
57
|
this.typeChecker = this.program.getTypeChecker();
|
|
@@ -334,17 +340,23 @@ export class ProjectAnalyzer {
|
|
|
334
340
|
* Refresh the TypeScript program to pick up file changes
|
|
335
341
|
*/
|
|
336
342
|
refreshProgram(): void {
|
|
337
|
-
// Memory logging: Capture state before refresh
|
|
338
|
-
const memBefore = process.memoryUsage();
|
|
339
|
-
|
|
340
343
|
// Apply the same unapprovedPaths filtering when refreshing
|
|
341
344
|
const excludePatterns =
|
|
342
345
|
this.project.metadata?.unapprovedPaths?.filter(Boolean) || [];
|
|
343
346
|
|
|
344
|
-
//
|
|
345
|
-
this.
|
|
346
|
-
|
|
347
|
-
|
|
347
|
+
// Release old programs and caches BEFORE creating new ones to reduce peak memory.
|
|
348
|
+
// Without this, both old (~1.7GB) and new (~1.7GB) programs coexist during creation,
|
|
349
|
+
// causing OOM on monorepos with multiple tsconfigs.
|
|
350
|
+
this.programs = [];
|
|
351
|
+
this.sourceFileByPath.clear();
|
|
352
|
+
this.typeCheckerByPath.clear();
|
|
353
|
+
|
|
354
|
+
// Create programs one at a time so each old program can be GC'd before the next
|
|
355
|
+
for (const configPath of this.tsConfigPaths) {
|
|
356
|
+
this.programs.push(
|
|
357
|
+
lib.asts.createProgramFromTsConfigPath(configPath, excludePatterns),
|
|
358
|
+
);
|
|
359
|
+
}
|
|
348
360
|
|
|
349
361
|
// Update primary program for backward compatibility
|
|
350
362
|
this.program = this.programs[0];
|