@codeyam/codeyam-cli 0.1.0-staging.eb21b2f → 0.1.0-staging.f777668
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 +21 -21
- 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 +259 -5
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.ts +62 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.ts +35 -0
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +78 -2
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +0 -33
- 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/asts/nodes/getNodeType.ts +1 -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/generateDataStructure.ts +83 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.ts +0 -98
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +23 -4
- 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/kysely/db.ts +8 -0
- package/analyzer-template/packages/database/src/lib/kysely/tables/editorScenariosTable.ts +68 -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 +22 -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 +51 -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 +168 -48
- 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 +96 -17
- package/analyzer-template/tsconfig.json +13 -1
- package/background/src/lib/virtualized/project/constructMockCode.js +143 -39
- 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 +73 -12
- 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 +32 -25
- 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 +14 -2
- package/codeyam-cli/src/commands/default.js.map +1 -1
- package/codeyam-cli/src/commands/editor.js +2607 -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__/devServerState.test.js +134 -0
- package/codeyam-cli/src/utils/__tests__/devServerState.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorApi.test.js +127 -0
- package/codeyam-cli/src/utils/__tests__/editorApi.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +635 -0
- package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorCapture.test.js +93 -0
- package/codeyam-cli/src/utils/__tests__/editorCapture.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js +155 -0
- package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js +121 -0
- package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js +294 -0
- package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorJournal.test.js +542 -0
- package/codeyam-cli/src/utils/__tests__/editorJournal.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js +393 -0
- package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.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 +217 -0
- package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorPreview.test.js +266 -0
- package/codeyam-cli/src/utils/__tests__/editorPreview.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js +139 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js +221 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js +221 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js +213 -0
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js +1686 -0
- package/codeyam-cli/src/utils/__tests__/entityChangeStatus.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__/journalCaptureStabilization.test.js +107 -0
- package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.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__/parseRegisterArg.test.js +101 -0
- package/codeyam-cli/src/utils/__tests__/parseRegisterArg.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__/scenariosManifest.test.js +246 -0
- package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +50 -4
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js +50 -0
- package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js.map +1 -0
- 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/devServerState.js +71 -0
- package/codeyam-cli/src/utils/devServerState.js.map +1 -0
- package/codeyam-cli/src/utils/editorApi.js +73 -0
- package/codeyam-cli/src/utils/editorApi.js.map +1 -0
- package/codeyam-cli/src/utils/editorAudit.js +159 -0
- package/codeyam-cli/src/utils/editorAudit.js.map +1 -0
- package/codeyam-cli/src/utils/editorCapture.js +102 -0
- package/codeyam-cli/src/utils/editorCapture.js.map +1 -0
- package/codeyam-cli/src/utils/editorDevServer.js +109 -0
- package/codeyam-cli/src/utils/editorDevServer.js.map +1 -0
- package/codeyam-cli/src/utils/editorEntityChangeStatus.js +44 -0
- package/codeyam-cli/src/utils/editorEntityChangeStatus.js.map +1 -0
- package/codeyam-cli/src/utils/editorImageVerifier.js +155 -0
- package/codeyam-cli/src/utils/editorImageVerifier.js.map +1 -0
- package/codeyam-cli/src/utils/editorJournal.js +225 -0
- package/codeyam-cli/src/utils/editorJournal.js.map +1 -0
- package/codeyam-cli/src/utils/editorLoaderHelpers.js +81 -0
- package/codeyam-cli/src/utils/editorLoaderHelpers.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 +135 -0
- package/codeyam-cli/src/utils/editorPreloadHelpers.js.map +1 -0
- package/codeyam-cli/src/utils/editorPreview.js +106 -0
- package/codeyam-cli/src/utils/editorPreview.js.map +1 -0
- package/codeyam-cli/src/utils/editorScenarioSwitch.js +112 -0
- package/codeyam-cli/src/utils/editorScenarioSwitch.js.map +1 -0
- package/codeyam-cli/src/utils/editorScenarios.js +96 -0
- package/codeyam-cli/src/utils/editorScenarios.js.map +1 -0
- package/codeyam-cli/src/utils/editorSeedAdapter.js +173 -0
- package/codeyam-cli/src/utils/editorSeedAdapter.js.map +1 -0
- package/codeyam-cli/src/utils/entityChangeStatus.js +337 -0
- package/codeyam-cli/src/utils/entityChangeStatus.js.map +1 -0
- package/codeyam-cli/src/utils/entityChangeStatus.server.js +107 -0
- package/codeyam-cli/src/utils/entityChangeStatus.server.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/parseRegisterArg.js +31 -0
- package/codeyam-cli/src/utils/parseRegisterArg.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/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__/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 +2 -4
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/ruleReflectionE2E.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/scenariosManifest.js +112 -0
- package/codeyam-cli/src/utils/scenariosManifest.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 +82 -11
- 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 +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/app/lib/git.js +396 -0
- package/codeyam-cli/src/webserver/app/lib/git.js.map +1 -0
- 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-ZlRKbhrq.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/Spinner-Bb5uFQ5V.js +34 -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/ViewportInspectBar-oAf2Kqsf.js +1 -0
- 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-canvas-DpzMmAy5.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/addon-fit-YJmn1quW.js +12 -0
- package/codeyam-cli/src/webserver/build/client/assets/addon-web-links-Duc5hnl7.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/addon-webgl-DI8QOUvO.js +58 -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-diff-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-project-info-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-CltMNppm.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/editor-DTEBHY7Z.js +10 -0
- package/codeyam-cli/src/webserver/build/client/assets/editorPreview-B7ztwLut.js +41 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-B0h9AqE6.js → entity._sha._-DItJnD8s.js} +10 -10
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-D5rYBT5x.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-CF164ouH.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-CdN8sCqs.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/globals-JMY99HpD.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/index-yHOVb4rc.js +15 -0
- 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-7aab51c4.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-FRztnN-P.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-CrAK28Bc.js +1 -0
- 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-Cz751Dm2.js +1 -0
- package/codeyam-cli/src/webserver/build/server/assets/server-build-DSylnYVM.js +367 -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 +431 -0
- package/codeyam-cli/src/webserver/editorProxy.js.map +1 -0
- package/codeyam-cli/src/webserver/scripts/codeyam-preload.mjs +414 -0
- package/codeyam-cli/src/webserver/scripts/journalCapture.ts +230 -0
- package/codeyam-cli/src/webserver/server.js +258 -1
- package/codeyam-cli/src/webserver/server.js.map +1 -1
- package/codeyam-cli/src/webserver/terminalServer.js +706 -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 +208 -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/codeyam-isolate/layout.tsx +12 -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 +64 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/next.config.ts +14 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/package.json +38 -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/seed-adapter.ts +89 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/tsconfig.json +34 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/vitest.config.ts +13 -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 +136 -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 +21 -14
- 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 +234 -3
- 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/ai/src/lib/generateExecutionFlows.js +0 -11
- package/packages/ai/src/lib/generateExecutionFlows.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/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.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/generateExecutionFlows.js +0 -40
- package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.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 +51 -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/git-BdHOxVfg.js +0 -15
- package/codeyam-cli/src/webserver/build/client/assets/globals-CCgBKWy4.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-390cb8fa.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/memory-CzZySbBE.js +0 -78
- package/codeyam-cli/src/webserver/build/client/assets/root-DnbDhvTU.js +0 -62
- package/codeyam-cli/src/webserver/build/client/assets/settings-CclxrcPK.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-BqgrAzs3.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-CXfuiwt3.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-BSvme_Ao.js +0 -259
- 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
|
@@ -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:',
|
|
@@ -3360,6 +3387,22 @@ export class ScopeDataStructure {
|
|
|
3360
3387
|
* ensure all sub-paths of that variable are reflected under signature[N].
|
|
3361
3388
|
*/
|
|
3362
3389
|
private propagateParameterToSignaturePaths(scopeNode: ScopeNode) {
|
|
3390
|
+
// Helper: check if a type is a concrete scalar that cannot have sub-properties.
|
|
3391
|
+
const SCALAR_TYPES = new Set([
|
|
3392
|
+
'string',
|
|
3393
|
+
'number',
|
|
3394
|
+
'boolean',
|
|
3395
|
+
'bigint',
|
|
3396
|
+
'symbol',
|
|
3397
|
+
'void',
|
|
3398
|
+
'never',
|
|
3399
|
+
]);
|
|
3400
|
+
const isDefinitelyScalar = (type: string): boolean => {
|
|
3401
|
+
const parts = type.split('|').map((s) => s.trim());
|
|
3402
|
+
const base = parts.filter((s) => s !== 'undefined' && s !== 'null');
|
|
3403
|
+
return base.length > 0 && base.every((b) => SCALAR_TYPES.has(b));
|
|
3404
|
+
};
|
|
3405
|
+
|
|
3363
3406
|
// Find variable → signature[N] equivalencies
|
|
3364
3407
|
for (const [varName, equivalencies] of Object.entries(
|
|
3365
3408
|
scopeNode.equivalencies,
|
|
@@ -3390,7 +3433,38 @@ export class ScopeDataStructure {
|
|
|
3390
3433
|
|
|
3391
3434
|
// Only add if the signature path doesn't already exist
|
|
3392
3435
|
if (!scopeNode.schema[sigKey]) {
|
|
3393
|
-
|
|
3436
|
+
// Check if this path represents variable conflation:
|
|
3437
|
+
// When a standalone variable (e.g., showWorkoutForm from useState)
|
|
3438
|
+
// appears as a sub-property of a scalar-typed ancestor (e.g.,
|
|
3439
|
+
// activity_type = "string"), it's from scope conflation, not real
|
|
3440
|
+
// property access. Block these while allowing legitimate built-in
|
|
3441
|
+
// accesses like string.length or string.slice.
|
|
3442
|
+
let isConflatedPath = false;
|
|
3443
|
+
let checkPos = signaturePath.length;
|
|
3444
|
+
while (true) {
|
|
3445
|
+
checkPos = sigKey.indexOf('.', checkPos + 1);
|
|
3446
|
+
if (checkPos === -1) break;
|
|
3447
|
+
const ancestorPath = sigKey.substring(0, checkPos);
|
|
3448
|
+
const ancestorType = scopeNode.schema[ancestorPath];
|
|
3449
|
+
if (ancestorType && isDefinitelyScalar(ancestorType)) {
|
|
3450
|
+
// Ancestor is scalar — check if the immediate sub-property
|
|
3451
|
+
// is also a standalone variable (indicating conflation)
|
|
3452
|
+
const afterDot = sigKey.substring(checkPos + 1);
|
|
3453
|
+
const nextSep = afterDot.search(/[.\[]/);
|
|
3454
|
+
const subPropName =
|
|
3455
|
+
nextSep === -1
|
|
3456
|
+
? afterDot
|
|
3457
|
+
: afterDot.substring(0, nextSep);
|
|
3458
|
+
if (scopeNode.schema[subPropName] !== undefined) {
|
|
3459
|
+
isConflatedPath = true;
|
|
3460
|
+
break;
|
|
3461
|
+
}
|
|
3462
|
+
}
|
|
3463
|
+
}
|
|
3464
|
+
|
|
3465
|
+
if (!isConflatedPath) {
|
|
3466
|
+
scopeNode.schema[sigKey] = scopeNode.schema[key];
|
|
3467
|
+
}
|
|
3394
3468
|
}
|
|
3395
3469
|
}
|
|
3396
3470
|
}
|
|
@@ -4165,6 +4239,24 @@ export class ScopeDataStructure {
|
|
|
4165
4239
|
}
|
|
4166
4240
|
}
|
|
4167
4241
|
|
|
4242
|
+
// Helper: check if a type is a concrete scalar that cannot have sub-properties.
|
|
4243
|
+
// e.g., "string", "number | undefined", "boolean | null" are scalar.
|
|
4244
|
+
// "object", "array", "function", "unknown", "Workout", etc. are NOT scalar.
|
|
4245
|
+
const SCALAR_TYPES = new Set([
|
|
4246
|
+
'string',
|
|
4247
|
+
'number',
|
|
4248
|
+
'boolean',
|
|
4249
|
+
'bigint',
|
|
4250
|
+
'symbol',
|
|
4251
|
+
'void',
|
|
4252
|
+
'never',
|
|
4253
|
+
]);
|
|
4254
|
+
const isDefinitelyScalarType = (type: string): boolean => {
|
|
4255
|
+
const parts = type.split('|').map((s) => s.trim());
|
|
4256
|
+
const base = parts.filter((s) => s !== 'undefined' && s !== 'null');
|
|
4257
|
+
return base.length > 0 && base.every((b) => SCALAR_TYPES.has(b));
|
|
4258
|
+
};
|
|
4259
|
+
|
|
4168
4260
|
// Propagate nested paths from variables to their signature equivalents
|
|
4169
4261
|
// e.g., if workouts = signature[0].workouts, then workouts[].title becomes
|
|
4170
4262
|
// signature[0].workouts[].title
|
|
@@ -4189,7 +4281,69 @@ export class ScopeDataStructure {
|
|
|
4189
4281
|
|
|
4190
4282
|
// Add to schema if not already present
|
|
4191
4283
|
if (!tempScopeNode.schema[signatureKey]) {
|
|
4192
|
-
|
|
4284
|
+
// Check if this path represents variable conflation:
|
|
4285
|
+
// When a standalone variable (e.g., showWorkoutForm from useState)
|
|
4286
|
+
// appears as a sub-property of a scalar-typed ancestor (e.g.,
|
|
4287
|
+
// activity_type = "string"), it's from scope conflation, not real
|
|
4288
|
+
// property access. Block these while allowing legitimate built-in
|
|
4289
|
+
// accesses like string.length or string.slice.
|
|
4290
|
+
let isConflatedPath = false;
|
|
4291
|
+
let checkPos = signaturePath.length;
|
|
4292
|
+
while (true) {
|
|
4293
|
+
checkPos = signatureKey.indexOf('.', checkPos + 1);
|
|
4294
|
+
if (checkPos === -1) break;
|
|
4295
|
+
const ancestorPath = signatureKey.substring(0, checkPos);
|
|
4296
|
+
const ancestorType = tempScopeNode.schema[ancestorPath];
|
|
4297
|
+
if (ancestorType && isDefinitelyScalarType(ancestorType)) {
|
|
4298
|
+
// Ancestor is scalar — check if the immediate sub-property
|
|
4299
|
+
// is also a standalone variable (indicating conflation)
|
|
4300
|
+
const afterDot = signatureKey.substring(checkPos + 1);
|
|
4301
|
+
const nextSep = afterDot.search(/[.\[]/);
|
|
4302
|
+
const subPropName =
|
|
4303
|
+
nextSep === -1 ? afterDot : afterDot.substring(0, nextSep);
|
|
4304
|
+
if (schema[subPropName] !== undefined) {
|
|
4305
|
+
isConflatedPath = true;
|
|
4306
|
+
break;
|
|
4307
|
+
}
|
|
4308
|
+
}
|
|
4309
|
+
}
|
|
4310
|
+
|
|
4311
|
+
if (!isConflatedPath) {
|
|
4312
|
+
tempScopeNode.schema[signatureKey] = schema[schemaKey];
|
|
4313
|
+
}
|
|
4314
|
+
}
|
|
4315
|
+
}
|
|
4316
|
+
}
|
|
4317
|
+
}
|
|
4318
|
+
|
|
4319
|
+
// Post-process: filter out conflated signature paths.
|
|
4320
|
+
// During phase 2 scope analysis, useState(false) conflation can create
|
|
4321
|
+
// bad paths like signature[0].mockWorkouts[].activity_type.showWorkoutForm
|
|
4322
|
+
// directly in scopeNode.schema. These flow through signatureInSchema into
|
|
4323
|
+
// tempScopeNode.schema without any guard. Filter them out here by checking:
|
|
4324
|
+
// 1. An ancestor in the path has a concrete scalar type (string, number, boolean, etc.)
|
|
4325
|
+
// 2. The immediate sub-property of that scalar ancestor is also a standalone
|
|
4326
|
+
// variable in the schema (indicating conflation, not a real property access)
|
|
4327
|
+
for (const key of Object.keys(tempScopeNode.schema)) {
|
|
4328
|
+
if (!key.startsWith('signature[')) continue;
|
|
4329
|
+
|
|
4330
|
+
// Walk through the path looking for scalar-typed ancestors
|
|
4331
|
+
let pos = 0;
|
|
4332
|
+
while (true) {
|
|
4333
|
+
pos = key.indexOf('.', pos + 1);
|
|
4334
|
+
if (pos === -1) break;
|
|
4335
|
+
const ancestorPath = key.substring(0, pos);
|
|
4336
|
+
const ancestorType = tempScopeNode.schema[ancestorPath];
|
|
4337
|
+
if (ancestorType && isDefinitelyScalarType(ancestorType)) {
|
|
4338
|
+
// Found a scalar ancestor — check if the sub-property name
|
|
4339
|
+
// is a standalone variable in the getSchema() result
|
|
4340
|
+
const afterDot = key.substring(pos + 1);
|
|
4341
|
+
const nextSep = afterDot.search(/[.\[]/);
|
|
4342
|
+
const subPropName =
|
|
4343
|
+
nextSep === -1 ? afterDot : afterDot.substring(0, nextSep);
|
|
4344
|
+
if (schema[subPropName] !== undefined) {
|
|
4345
|
+
delete tempScopeNode.schema[key];
|
|
4346
|
+
break;
|
|
4193
4347
|
}
|
|
4194
4348
|
}
|
|
4195
4349
|
}
|
|
@@ -4929,9 +5083,109 @@ export class ScopeDataStructure {
|
|
|
4929
5083
|
// Replace cyScope placeholders in all external function call data
|
|
4930
5084
|
// This ensures call signatures and schema paths use actual callback text
|
|
4931
5085
|
// instead of internal cyScope names, preventing mock data merge conflicts.
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
5086
|
+
const rootScopeName = this.scopeTreeManager.getRootName();
|
|
5087
|
+
const rootSchema = this.scopeNodes[rootScopeName]?.schema ?? {};
|
|
5088
|
+
|
|
5089
|
+
return this.externalFunctionCalls.map((efc) => {
|
|
5090
|
+
const cleaned = this.cleanCyScopeFromFunctionCallInfo(efc);
|
|
5091
|
+
return this.filterConflatedExternalPaths(cleaned, rootSchema);
|
|
5092
|
+
});
|
|
5093
|
+
}
|
|
5094
|
+
|
|
5095
|
+
/**
|
|
5096
|
+
* Filters out conflated paths from external function call schemas.
|
|
5097
|
+
*
|
|
5098
|
+
* When multiple useState(false) calls create equivalency conflation during
|
|
5099
|
+
* Phase 1 analysis, standalone boolean state variables (like showWorkoutForm,
|
|
5100
|
+
* showGoalForm) can bleed into external function call schemas as sub-properties
|
|
5101
|
+
* of unrelated data fields (like data[].activity_type.showWorkoutForm).
|
|
5102
|
+
*
|
|
5103
|
+
* Detection: group sub-properties by parent path. If 2+ sub-properties of
|
|
5104
|
+
* the same parent all match standalone root scope variable names, treat them
|
|
5105
|
+
* as conflation artifacts and remove them.
|
|
5106
|
+
*/
|
|
5107
|
+
private filterConflatedExternalPaths(
|
|
5108
|
+
efc: FunctionCallInfo,
|
|
5109
|
+
rootSchema: Record<string, string>,
|
|
5110
|
+
): FunctionCallInfo {
|
|
5111
|
+
// Build a set of top-level root scope variable names (simple names, no dots/brackets)
|
|
5112
|
+
const topLevelRootVars = new Set<string>();
|
|
5113
|
+
for (const key of Object.keys(rootSchema)) {
|
|
5114
|
+
if (!key.includes('.') && !key.includes('[')) {
|
|
5115
|
+
topLevelRootVars.add(key);
|
|
5116
|
+
}
|
|
5117
|
+
}
|
|
5118
|
+
|
|
5119
|
+
if (topLevelRootVars.size === 0) return efc;
|
|
5120
|
+
|
|
5121
|
+
// Group sub-property matches by their parent path.
|
|
5122
|
+
// For a path like "...data[].activity_type.showWorkoutForm",
|
|
5123
|
+
// parent = "...data[].activity_type", child = "showWorkoutForm"
|
|
5124
|
+
const parentToConflatedKeys = new Map<string, string[]>();
|
|
5125
|
+
|
|
5126
|
+
for (const key of Object.keys(efc.schema)) {
|
|
5127
|
+
const lastDot = key.lastIndexOf('.');
|
|
5128
|
+
if (lastDot === -1) continue;
|
|
5129
|
+
|
|
5130
|
+
const parent = key.substring(0, lastDot);
|
|
5131
|
+
const child = key.substring(lastDot + 1);
|
|
5132
|
+
|
|
5133
|
+
// Skip array access or function call patterns
|
|
5134
|
+
if (child.includes('[') || child.includes('(')) continue;
|
|
5135
|
+
|
|
5136
|
+
// Only consider paths inside array element chains (contains []).
|
|
5137
|
+
// Direct children of functionCallReturnValue are legitimate destructured
|
|
5138
|
+
// return values, not conflation. Conflation happens deeper in the chain
|
|
5139
|
+
// when array element fields get corrupted sub-properties.
|
|
5140
|
+
if (!parent.includes('[')) continue;
|
|
5141
|
+
|
|
5142
|
+
if (topLevelRootVars.has(child)) {
|
|
5143
|
+
if (!parentToConflatedKeys.has(parent)) {
|
|
5144
|
+
parentToConflatedKeys.set(parent, []);
|
|
5145
|
+
}
|
|
5146
|
+
parentToConflatedKeys.get(parent)!.push(key);
|
|
5147
|
+
}
|
|
5148
|
+
}
|
|
5149
|
+
|
|
5150
|
+
// Only filter when 2+ sub-properties of the same parent match root scope vars.
|
|
5151
|
+
// This threshold avoids false positives from coincidental name matches.
|
|
5152
|
+
const keysToRemove = new Set<string>();
|
|
5153
|
+
const parentsToRestore = new Set<string>();
|
|
5154
|
+
|
|
5155
|
+
for (const [parent, conflatedKeys] of parentToConflatedKeys) {
|
|
5156
|
+
if (conflatedKeys.length >= 2) {
|
|
5157
|
+
for (const key of conflatedKeys) {
|
|
5158
|
+
keysToRemove.add(key);
|
|
5159
|
+
}
|
|
5160
|
+
parentsToRestore.add(parent);
|
|
5161
|
+
}
|
|
5162
|
+
}
|
|
5163
|
+
|
|
5164
|
+
if (keysToRemove.size === 0) return efc;
|
|
5165
|
+
|
|
5166
|
+
// Create a new schema without the conflated paths
|
|
5167
|
+
const newSchema: Record<string, string> = {};
|
|
5168
|
+
for (const [key, value] of Object.entries(efc.schema)) {
|
|
5169
|
+
if (keysToRemove.has(key)) continue;
|
|
5170
|
+
|
|
5171
|
+
// Restore parent type: if it was changed to "object" because of conflated
|
|
5172
|
+
// sub-properties, and now all those sub-properties are removed, change it
|
|
5173
|
+
// back to "unknown" (we don't know the original type)
|
|
5174
|
+
if (parentsToRestore.has(key) && value === 'object') {
|
|
5175
|
+
// Check if there are any remaining sub-properties
|
|
5176
|
+
const hasRemainingSubProps = Object.keys(efc.schema).some(
|
|
5177
|
+
(k) =>
|
|
5178
|
+
!keysToRemove.has(k) &&
|
|
5179
|
+
k !== key &&
|
|
5180
|
+
(k.startsWith(key + '.') || k.startsWith(key + '[')),
|
|
5181
|
+
);
|
|
5182
|
+
newSchema[key] = hasRemainingSubProps ? value : 'unknown';
|
|
5183
|
+
} else {
|
|
5184
|
+
newSchema[key] = value;
|
|
5185
|
+
}
|
|
5186
|
+
}
|
|
5187
|
+
|
|
5188
|
+
return { ...efc, schema: newSchema };
|
|
4935
5189
|
}
|
|
4936
5190
|
|
|
4937
5191
|
/**
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recursively strips `_nullable` keys from LLM-generated mock data.
|
|
3
|
+
*
|
|
4
|
+
* The `_nullable` marker is an internal CodeYam concept used in type definitions
|
|
5
|
+
* to indicate that a field can be null/undefined. The LLM sometimes includes
|
|
6
|
+
* these markers in its generated scenario data, which causes runtime errors
|
|
7
|
+
* when code iterates over object keys (e.g., `Object.keys(importedBy)` picks
|
|
8
|
+
* up `_nullable` as a key alongside real data).
|
|
9
|
+
*
|
|
10
|
+
* This function mutates the input object in-place, consistent with other
|
|
11
|
+
* post-processing helpers like `convertNullToUndefinedBySchema`.
|
|
12
|
+
*/
|
|
13
|
+
export default function stripNullableMarkers(
|
|
14
|
+
data: Record<string, unknown>,
|
|
15
|
+
): void {
|
|
16
|
+
if (data == null || typeof data !== 'object') return;
|
|
17
|
+
|
|
18
|
+
// Delete _nullable from this level
|
|
19
|
+
if ('_nullable' in data) {
|
|
20
|
+
delete data._nullable;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Recurse into nested objects and arrays
|
|
24
|
+
for (const value of Object.values(data)) {
|
|
25
|
+
if (Array.isArray(value)) {
|
|
26
|
+
for (const item of value) {
|
|
27
|
+
if (item !== null && typeof item === 'object' && !Array.isArray(item)) {
|
|
28
|
+
stripNullableMarkers(item as Record<string, unknown>);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
} else if (value !== null && typeof value === 'object') {
|
|
32
|
+
stripNullableMarkers(value as Record<string, unknown>);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -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
|
|
@@ -129,19 +129,6 @@ export default function generateExecutionFlows({
|
|
|
129
129
|
fullToShortPathMap[fullPath] = shortPath;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
console.log(
|
|
133
|
-
`[generateExecutionFlows] ${entity.name}: attributesMap has ${Object.keys(resolvedAttributesMap).length} keys, fullToShortPathMap has ${Object.keys(fullToShortPathMap).length} entries`,
|
|
134
|
-
);
|
|
135
|
-
console.log(
|
|
136
|
-
`[generateExecutionFlows] ${entity.name}: attributesMap keys: [${Object.keys(resolvedAttributesMap).join(', ')}]`,
|
|
137
|
-
);
|
|
138
|
-
console.log(
|
|
139
|
-
`[generateExecutionFlows] ${entity.name}: fullToShortPathMap: ${JSON.stringify(fullToShortPathMap)}`,
|
|
140
|
-
);
|
|
141
|
-
console.log(
|
|
142
|
-
`[generateExecutionFlows] ${entity.name}: equivalentSignatureVariables: ${JSON.stringify(equivalentSignatureVariables)}`,
|
|
143
|
-
);
|
|
144
|
-
|
|
145
132
|
// Get pre-computed conditional data from metadata
|
|
146
133
|
const conditionalUsages: Record<string, ConditionalUsage[]> =
|
|
147
134
|
entity.metadata?.isolatedDataStructure?.conditionalUsages ?? {};
|
|
@@ -186,26 +173,6 @@ export default function generateExecutionFlows({
|
|
|
186
173
|
}
|
|
187
174
|
}
|
|
188
175
|
|
|
189
|
-
console.log(
|
|
190
|
-
`[generateExecutionFlows] ${entity.name}: conditionalUsages keys: [${Object.keys(conditionalUsages).join(', ')}]`,
|
|
191
|
-
);
|
|
192
|
-
console.log(
|
|
193
|
-
`[generateExecutionFlows] ${entity.name}: conditionalUsages sourceDataPaths: ${JSON.stringify(
|
|
194
|
-
Object.fromEntries(
|
|
195
|
-
Object.entries(conditionalUsages).map(([k, v]) => [
|
|
196
|
-
k,
|
|
197
|
-
(v as any[]).map((u: any) => u.sourceDataPath ?? '(none)'),
|
|
198
|
-
]),
|
|
199
|
-
),
|
|
200
|
-
)}`,
|
|
201
|
-
);
|
|
202
|
-
console.log(
|
|
203
|
-
`[generateExecutionFlows] ${entity.name}: compoundConditionals count: ${compoundConditionals.length}`,
|
|
204
|
-
);
|
|
205
|
-
console.log(
|
|
206
|
-
`[generateExecutionFlows] ${entity.name}: sourceEquivalencies keys count: ${Object.keys(mergedDataStructure.sourceEquivalencies ?? {}).length}`,
|
|
207
|
-
);
|
|
208
|
-
|
|
209
176
|
const conditionalsBasedFlows = generateExecutionFlowsFromConditionals({
|
|
210
177
|
conditionalUsages,
|
|
211
178
|
compoundConditionals,
|
|
@@ -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];
|
|
@@ -95,8 +95,13 @@ export function createProgramFromTsConfigPath(
|
|
|
95
95
|
throw new Error('Could not parse tsconfig.json');
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
//
|
|
99
|
-
|
|
98
|
+
// Always filter out node_modules from root files to prevent OOM on large projects.
|
|
99
|
+
// This only removes them as root compilation targets — TypeScript's module resolution
|
|
100
|
+
// still follows imports into node_modules for type info when processing source files.
|
|
101
|
+
let fileNames = parsedCommandLine.fileNames.filter(
|
|
102
|
+
(f) => !f.includes('/node_modules/'),
|
|
103
|
+
);
|
|
104
|
+
|
|
100
105
|
if (excludePatterns && excludePatterns.length > 0) {
|
|
101
106
|
const regexPatterns = excludePatterns
|
|
102
107
|
.map((pattern) => {
|
|
@@ -310,7 +310,15 @@ export default async function analyzeEntities({
|
|
|
310
310
|
);
|
|
311
311
|
|
|
312
312
|
// Flush transformation trace if tracing is enabled
|
|
313
|
-
|
|
313
|
+
// Wrapped in try/catch because trace data can exceed V8's max string length
|
|
314
|
+
// for large projects, and we must not crash the analysis process over tracing.
|
|
315
|
+
try {
|
|
316
|
+
transformationTracer.flush();
|
|
317
|
+
} catch (e) {
|
|
318
|
+
console.warn(
|
|
319
|
+
`CodeYam Warning: Failed to flush transformation trace: ${e.message}`,
|
|
320
|
+
);
|
|
321
|
+
}
|
|
314
322
|
|
|
315
323
|
return analyses;
|
|
316
324
|
|
|
@@ -100,12 +100,6 @@ export function getCandidatesReadyForCapture(
|
|
|
100
100
|
continue;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
// Skip notExported entities - they can't be imported into the simulation
|
|
104
|
-
// environment and will always fail capture. Don't mark them as ready.
|
|
105
|
-
if (candidate.entity?.metadata?.notExported) {
|
|
106
|
-
continue;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
103
|
// Get all transitive dependencies
|
|
110
104
|
const candidateKey = `${candidate.filePath}:${candidate.entityName}`;
|
|
111
105
|
const { missingDependencies } = getTransitiveDependencies(
|