@codeyam/codeyam-cli 0.1.0-staging.323686 → 0.1.0-staging.415103
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 +18 -18
- package/analyzer-template/packages/ai/index.ts +7 -1
- package/analyzer-template/packages/ai/package.json +3 -3
- package/analyzer-template/packages/ai/src/lib/analyzeScope.ts +62 -18
- package/analyzer-template/packages/ai/src/lib/astScopes/astScopeAnalyzer.ts +101 -12
- package/analyzer-template/packages/ai/src/lib/astScopes/patterns/forInStatementHandler.ts +10 -17
- package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +409 -50
- package/analyzer-template/packages/ai/src/lib/astScopes/sharedPatterns.ts +28 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/types.ts +21 -6
- package/analyzer-template/packages/ai/src/lib/completionCall.ts +114 -113
- package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +1250 -253
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.ts +5 -1
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.ts +16 -3
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.ts +6 -4
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.ts +31 -3
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.ts +37 -15
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/coerceObjectsToPrimitivesBySchema.ts +70 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.ts +62 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.ts +140 -14
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.ts +179 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.ts +40 -30
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.ts +367 -96
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.ts +35 -0
- package/analyzer-template/packages/ai/src/lib/dataStructureChunking.ts +40 -13
- package/analyzer-template/packages/ai/src/lib/generateEntityDataStructure.ts +58 -3
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +393 -8
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarios.ts +9 -5
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +145 -5
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.ts +1 -1
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionals.ts +649 -142
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.ts +1 -1
- package/analyzer-template/packages/ai/src/lib/isolateScopes.ts +51 -3
- package/analyzer-template/packages/ai/src/lib/mergeJsonTypeDefinitions.ts +5 -0
- package/analyzer-template/packages/ai/src/lib/mergeStatements.ts +90 -96
- package/analyzer-template/packages/ai/src/lib/promptGenerators/collapseNullableObjects.ts +118 -0
- package/analyzer-template/packages/ai/src/lib/promptGenerators/gatherAttributesMap.ts +10 -7
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.ts +24 -4
- package/analyzer-template/packages/ai/src/lib/resolvePathToControllable.ts +25 -13
- package/analyzer-template/packages/ai/src/lib/worker/SerializableDataStructure.ts +4 -3
- package/analyzer-template/packages/analyze/index.ts +2 -0
- package/analyzer-template/packages/analyze/src/lib/FileAnalyzer.ts +65 -59
- package/analyzer-template/packages/analyze/src/lib/ProjectAnalyzer.ts +119 -26
- package/analyzer-template/packages/analyze/src/lib/asts/nodes/getNodeType.ts +1 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.ts +19 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllEntityNodes.ts +19 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllExports.ts +11 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getImportsAnalysis.ts +8 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getResolvedModule.ts +49 -1
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getSourceFilesForAllImports.ts +2 -1
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +89 -9
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +27 -4
- 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/analyze/gatherEntityMap.ts +4 -2
- package/analyzer-template/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.ts +0 -3
- package/analyzer-template/packages/analyze/src/lib/files/analyzeRemixRoute.ts +4 -5
- package/analyzer-template/packages/analyze/src/lib/files/getImportedExports.ts +14 -12
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/TransformationTracer.ts +1352 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.ts +61 -13
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.ts +87 -25
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +312 -19
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.ts +117 -9
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +591 -75
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/propagateArrayItemSchemas.ts +474 -0
- package/analyzer-template/packages/analyze/src/lib/files/setImportedExports.ts +2 -1
- package/analyzer-template/packages/analyze/src/lib/index.ts +1 -0
- package/analyzer-template/packages/analyze/src/lib/utils/getFileByPath.ts +19 -0
- package/analyzer-template/packages/aws/package.json +10 -10
- package/analyzer-template/packages/database/index.ts +1 -0
- package/analyzer-template/packages/database/package.json +1 -1
- package/analyzer-template/packages/database/src/lib/analysisBranchToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/analysisToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/branchToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/commitBranchToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/commitToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/fileToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/kysely/db.ts +14 -0
- package/analyzer-template/packages/database/src/lib/kysely/tables/debugReportsTable.ts +1 -1
- package/analyzer-template/packages/database/src/lib/kysely/tables/editorScenariosTable.ts +62 -0
- package/analyzer-template/packages/database/src/lib/kysely/tables/labsRequestsTable.ts +52 -0
- package/analyzer-template/packages/database/src/lib/loadCommits.ts +31 -20
- package/analyzer-template/packages/database/src/lib/loadReadyToBeCapturedAnalyses.ts +0 -5
- package/analyzer-template/packages/database/src/lib/projectToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/saveFiles.ts +1 -1
- package/analyzer-template/packages/database/src/lib/scenarioToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/updateCommitMetadata.ts +151 -135
- package/analyzer-template/packages/database/src/lib/updateFreshAnalysisStatus.ts +58 -42
- package/analyzer-template/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.ts +81 -65
- package/analyzer-template/packages/database/src/lib/userScenarioToDb.ts +1 -1
- package/analyzer-template/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.ts +29 -1
- package/analyzer-template/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.ts +33 -5
- package/analyzer-template/packages/github/dist/database/index.d.ts +1 -0
- package/analyzer-template/packages/github/dist/database/index.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/index.js +1 -0
- package/analyzer-template/packages/github/dist/database/index.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/analysisBranchToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/analysisBranchToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/analysisToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/analysisToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/branchToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/branchToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/commitBranchToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/commitBranchToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/commitToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/commitToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/fileToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/fileToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts +4 -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 +8 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.d.ts +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts +20 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts.map +1 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js +45 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.d.ts +23 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.d.ts.map +1 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.js +35 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.js.map +1 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts +5 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js +23 -13
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js +1 -4
- package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/projectToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/projectToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/saveFiles.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/saveFiles.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/scenarioToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/scenarioToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js +100 -89
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.js +41 -30
- package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.js +68 -57
- package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.js.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +29 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +33 -5
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/ProjectMetadata.d.ts +8 -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/dist/types/src/types/ScenariosDataStructure.d.ts +5 -5
- package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/ScopeAnalysis.d.ts +6 -1
- package/analyzer-template/packages/github/dist/types/src/types/ScopeAnalysis.d.ts.map +1 -1
- package/analyzer-template/packages/github/package.json +1 -1
- package/analyzer-template/packages/types/src/types/ProjectMetadata.ts +8 -0
- package/analyzer-template/packages/types/src/types/Scenario.ts +10 -0
- package/analyzer-template/packages/types/src/types/ScenariosDataStructure.ts +6 -5
- package/analyzer-template/packages/types/src/types/ScopeAnalysis.ts +6 -1
- package/analyzer-template/packages/utils/dist/types/src/types/ProjectMetadata.d.ts +8 -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/types/src/types/ScenariosDataStructure.d.ts +5 -5
- package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/ScopeAnalysis.d.ts +6 -1
- package/analyzer-template/packages/utils/dist/types/src/types/ScopeAnalysis.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js +98 -3
- package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js.map +1 -1
- package/analyzer-template/packages/utils/src/lib/fs/rsyncCopy.ts +121 -3
- package/analyzer-template/playwright/captureFromUrl.ts +89 -82
- package/analyzer-template/project/constructMockCode.ts +260 -60
- 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 +198 -8
- package/analyzer-template/project/writeScenarioComponents.ts +170 -29
- package/analyzer-template/project/writeSimpleRoot.ts +21 -11
- package/analyzer-template/tsconfig.json +13 -1
- package/background/src/lib/local/createLocalAnalyzer.js +1 -1
- package/background/src/lib/local/createLocalAnalyzer.js.map +1 -1
- package/background/src/lib/virtualized/project/constructMockCode.js +220 -45
- 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 +174 -4
- package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
- package/background/src/lib/virtualized/project/writeScenarioComponents.js +143 -27
- package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
- package/background/src/lib/virtualized/project/writeSimpleRoot.js +21 -11
- package/background/src/lib/virtualized/project/writeSimpleRoot.js.map +1 -1
- package/codeyam-cli/scripts/apply-setup.js +386 -9
- package/codeyam-cli/scripts/apply-setup.js.map +1 -1
- package/codeyam-cli/src/cli.js +33 -24
- package/codeyam-cli/src/cli.js.map +1 -1
- package/codeyam-cli/src/codeyam-cli.js +18 -2
- package/codeyam-cli/src/codeyam-cli.js.map +1 -1
- package/codeyam-cli/src/commands/analyze.js +21 -9
- package/codeyam-cli/src/commands/analyze.js.map +1 -1
- package/codeyam-cli/src/commands/baseline.js +2 -0
- package/codeyam-cli/src/commands/baseline.js.map +1 -1
- package/codeyam-cli/src/commands/debug.js +9 -5
- package/codeyam-cli/src/commands/debug.js.map +1 -1
- package/codeyam-cli/src/commands/default.js +87 -21
- package/codeyam-cli/src/commands/default.js.map +1 -1
- package/codeyam-cli/src/commands/editor.js +696 -0
- package/codeyam-cli/src/commands/editor.js.map +1 -0
- package/codeyam-cli/src/commands/init.js +75 -259
- package/codeyam-cli/src/commands/init.js.map +1 -1
- package/codeyam-cli/src/commands/memory.js +97 -92
- package/codeyam-cli/src/commands/memory.js.map +1 -1
- package/codeyam-cli/src/commands/recapture.js +2 -0
- package/codeyam-cli/src/commands/recapture.js.map +1 -1
- package/codeyam-cli/src/commands/setup-sandbox.js +2 -0
- package/codeyam-cli/src/commands/setup-sandbox.js.map +1 -1
- package/codeyam-cli/src/commands/setup-simulations.js +284 -0
- package/codeyam-cli/src/commands/setup-simulations.js.map +1 -0
- package/codeyam-cli/src/commands/test-startup.js +2 -0
- package/codeyam-cli/src/commands/test-startup.js.map +1 -1
- package/codeyam-cli/src/commands/verify.js +14 -2
- package/codeyam-cli/src/commands/verify.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/npmVersionCheck.test.js +185 -0
- package/codeyam-cli/src/utils/__tests__/npmVersionCheck.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/pathIgnoring.test.js +9 -0
- package/codeyam-cli/src/utils/__tests__/pathIgnoring.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +154 -86
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
- package/codeyam-cli/src/utils/analyzer.js +7 -0
- package/codeyam-cli/src/utils/analyzer.js.map +1 -1
- package/codeyam-cli/src/utils/backgroundServer.js +109 -22
- package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/utils/devModeEvents.js +40 -0
- package/codeyam-cli/src/utils/devModeEvents.js.map +1 -0
- package/codeyam-cli/src/utils/fileMetadata.js +5 -0
- package/codeyam-cli/src/utils/fileMetadata.js.map +1 -1
- package/codeyam-cli/src/utils/fileWatcher.js +25 -9
- package/codeyam-cli/src/utils/fileWatcher.js.map +1 -1
- package/codeyam-cli/src/utils/generateReport.js +2 -2
- package/codeyam-cli/src/utils/git.js +52 -0
- package/codeyam-cli/src/utils/git.js.map +1 -1
- package/codeyam-cli/src/utils/install-skills.js +101 -45
- package/codeyam-cli/src/utils/install-skills.js.map +1 -1
- package/codeyam-cli/src/utils/interactiveSyncWatcher.js +126 -0
- package/codeyam-cli/src/utils/interactiveSyncWatcher.js.map +1 -0
- package/codeyam-cli/src/utils/labsAutoCheck.js +19 -0
- package/codeyam-cli/src/utils/labsAutoCheck.js.map +1 -0
- package/codeyam-cli/src/utils/npmVersionCheck.js +76 -0
- package/codeyam-cli/src/utils/npmVersionCheck.js.map +1 -0
- package/codeyam-cli/src/utils/pathIgnoring.js +19 -7
- package/codeyam-cli/src/utils/pathIgnoring.js.map +1 -1
- package/codeyam-cli/src/utils/progress.js +7 -0
- package/codeyam-cli/src/utils/progress.js.map +1 -1
- package/codeyam-cli/src/utils/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 +74 -1
- package/codeyam-cli/src/utils/queue/job.js.map +1 -1
- package/codeyam-cli/src/utils/queue/manager.js +7 -6
- package/codeyam-cli/src/utils/queue/manager.js.map +1 -1
- package/codeyam-cli/src/utils/requireSimulations.js +10 -0
- package/codeyam-cli/src/utils/requireSimulations.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/confusionDetector.test.js +82 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/confusionDetector.test.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/contextBuilder.test.js +229 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/contextBuilder.test.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/assertRules.js +67 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/assertRules.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/captureFixture.js +105 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/captureFixture.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/loadCapturedFixture.js +34 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/loadCapturedFixture.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/runClaude.js +162 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/runClaude.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/setupTempProject.js +74 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/setupTempProject.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/ruleReflectionE2E.test.js +376 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/ruleReflectionE2E.test.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.js +113 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/transcriptParser.test.js +127 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/transcriptParser.test.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/confusionDetector.js +50 -0
- package/codeyam-cli/src/utils/ruleReflection/confusionDetector.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/contextBuilder.js +116 -0
- package/codeyam-cli/src/utils/ruleReflection/contextBuilder.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/index.js +5 -0
- package/codeyam-cli/src/utils/ruleReflection/index.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/promptBuilder.js +44 -0
- package/codeyam-cli/src/utils/ruleReflection/promptBuilder.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/transcriptParser.js +85 -0
- package/codeyam-cli/src/utils/ruleReflection/transcriptParser.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/types.js +5 -0
- package/codeyam-cli/src/utils/ruleReflection/types.js.map +1 -0
- package/codeyam-cli/src/utils/rules/__tests__/parser.test.js +83 -0
- package/codeyam-cli/src/utils/rules/__tests__/parser.test.js.map +1 -0
- package/codeyam-cli/src/utils/rules/__tests__/pathMatcher.test.js +118 -0
- package/codeyam-cli/src/utils/rules/__tests__/pathMatcher.test.js.map +1 -0
- package/codeyam-cli/src/utils/rules/__tests__/rulePlacement.test.js +72 -0
- package/codeyam-cli/src/utils/rules/__tests__/rulePlacement.test.js.map +1 -0
- package/codeyam-cli/src/utils/rules/__tests__/ruleState.test.js +293 -0
- package/codeyam-cli/src/utils/rules/__tests__/ruleState.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 +2 -0
- package/codeyam-cli/src/utils/rules/index.js.map +1 -1
- package/codeyam-cli/src/utils/rules/parser.js +16 -29
- package/codeyam-cli/src/utils/rules/parser.js.map +1 -1
- package/codeyam-cli/src/utils/rules/pathMatcher.js +34 -3
- package/codeyam-cli/src/utils/rules/pathMatcher.js.map +1 -1
- package/codeyam-cli/src/utils/rules/rulePlacement.js +65 -0
- package/codeyam-cli/src/utils/rules/rulePlacement.js.map +1 -0
- package/codeyam-cli/src/utils/rules/ruleState.js +150 -0
- package/codeyam-cli/src/utils/rules/ruleState.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/rules/staleness.js +16 -11
- package/codeyam-cli/src/utils/rules/staleness.js.map +1 -1
- package/codeyam-cli/src/utils/serverState.js +64 -12
- package/codeyam-cli/src/utils/serverState.js.map +1 -1
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +61 -43
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
- package/codeyam-cli/src/utils/simulationGateMiddleware.js +159 -0
- package/codeyam-cli/src/utils/simulationGateMiddleware.js.map +1 -0
- package/codeyam-cli/src/utils/syncMocksMiddleware.js +5 -24
- package/codeyam-cli/src/utils/syncMocksMiddleware.js.map +1 -1
- package/codeyam-cli/src/utils/testRunner.js +158 -0
- package/codeyam-cli/src/utils/testRunner.js.map +1 -0
- package/codeyam-cli/src/utils/transcriptPruning.js +67 -0
- package/codeyam-cli/src/utils/transcriptPruning.js.map +1 -0
- package/codeyam-cli/src/utils/versionInfo.js +46 -0
- package/codeyam-cli/src/utils/versionInfo.js.map +1 -1
- package/codeyam-cli/src/utils/webappDetection.js +14 -2
- package/codeyam-cli/src/utils/webappDetection.js.map +1 -1
- package/codeyam-cli/src/webserver/__tests__/dependency-smoke.test.js +66 -0
- package/codeyam-cli/src/webserver/__tests__/dependency-smoke.test.js.map +1 -0
- package/codeyam-cli/src/webserver/app/lib/database.js +15 -3
- 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 +166 -16
- package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/webserver/bootstrap.js +11 -0
- package/codeyam-cli/src/webserver/bootstrap.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/CopyButton-DmJveP3T.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-DsN1wKrm.js → EntityItem-C76mRRiF.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-DLqD3qNt.js → EntityTypeBadge-g3saevPb.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-Ba2JVPzP.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-aht4aafF.js → InteractivePreview-DYFW3lDD.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-CVtiBnY5.js → LibraryFunctionPreview-DLeucoVX.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-B0GLXMsr.js → LoadingDots-BU_OAEMP.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-xgeCVgSM.js → LogViewer-ceAyBX-H.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-OApQuNyq.js → ReportIssueModal-djPLI-WV.js} +3 -8
- package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-DuDvi0jm.js → SafeScreenshot-BED4B6sP.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-DzccYyI8.js → ScenarioViewer-B76aig_2.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/Spinner-Bb5uFQ5V.js +34 -0
- package/codeyam-cli/src/webserver/build/client/assets/Terminal-BaIiqg_w.js +41 -0
- package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-DyFZkK0l.js → TruncatedFilePath-C8OKAR5x.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{_index-BwqWJOgH.js → _index-C96V0n15.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-BwavGCpm.js → activity.(_tab)-BpKzcsJz.js} +6 -11
- 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.agent-transcripts-l0sNRNKZ.js +1 -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-capture-scenario-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-client-errors-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-commit-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-dev-server-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-entity-status-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-entry-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-image._-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-screenshot-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-update-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-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-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.labs-unlock-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/api.save-fixture-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/book-open-D_nMCFmP.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-Cx24_aWc.js → chevron-down-BH2h1Ea2.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{chunk-EPOLDU6W-CXRTFQ3F.js → chunk-JZWAC4HX-C4pqxYJB.js} +12 -12
- package/codeyam-cli/src/webserver/build/client/assets/{circle-check-BOARzkeR.js → circle-check-DyIKORY6.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/copy-NDbZjXao.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-BdhJEx6B.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-BaC8lHDG.js +7 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-BJUiQqZF.js → entity._sha._-CrjR3zZW.js} +11 -11
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-DloHYjtt.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-CTBG2mmz.js → entity._sha_.edit._scenarioId-BMvVHNXU.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{entry.client-CS2cb_eZ.js → entry.client-DTvKq3TY.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{fileTableUtils-DMJ7zii9.js → fileTableUtils-cPo8LiG3.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{files-CJ6lTdTA.js → files-DO4CZ16O.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{git-CPTZZ-JZ.js → git-CFCTYk9I.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/globals-BH6uYxPM.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{index-B1h680n5.js → index-10oVnAAH.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{index-lzqtyFU8.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-B7B9V-bu.js → loader-circle-BAXYRVEO.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-fb3128c3.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/memory-FweZHj5U.js +93 -0
- package/codeyam-cli/src/webserver/build/client/assets/pause-DTAcYxBt.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/root-Dzn8nIkU.js +67 -0
- package/codeyam-cli/src/webserver/build/client/assets/{search-CxXUmBSd.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-DwFIBT09.js → simulations-B3aOzpCZ.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/terminal-BG4heKCG.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-B6LgvRJg.js → triangle-alert-DtSmdtM4.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useCustomSizes-C1v1PQzo.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-DYxHZQuP.js → useReportContext-O-jkvSPx.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useToast-mBRpZPiu.js → useToast-9FIWuYfK.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/xterm-DMSzMhqy.js +9 -0
- package/codeyam-cli/src/webserver/build/server/assets/index-DeSuKbSF.js +1 -0
- package/codeyam-cli/src/webserver/build/server/assets/server-build-BbQ8YBP-.js +362 -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 +272 -0
- package/codeyam-cli/src/webserver/editorProxy.js.map +1 -0
- package/codeyam-cli/src/webserver/scripts/journalCapture.ts +121 -0
- package/codeyam-cli/src/webserver/server.js +177 -1
- package/codeyam-cli/src/webserver/server.js.map +1 -1
- package/codeyam-cli/src/webserver/terminalServer.js +606 -0
- package/codeyam-cli/src/webserver/terminalServer.js.map +1 -0
- package/codeyam-cli/templates/{codeyam:debug.md → codeyam-debug.md} +1 -1
- package/codeyam-cli/templates/codeyam-dev-mode.md +237 -0
- package/codeyam-cli/templates/codeyam-diagnose.md +481 -0
- package/codeyam-cli/templates/codeyam-editor-claude.md +68 -0
- package/codeyam-cli/templates/codeyam-editor.md +67 -0
- package/codeyam-cli/templates/codeyam-memory-hook.sh +19 -20
- package/codeyam-cli/templates/codeyam-memory.md +396 -0
- package/codeyam-cli/templates/codeyam-new-rule.md +11 -0
- package/codeyam-cli/templates/{codeyam:setup.md → codeyam-setup.md} +13 -1
- package/codeyam-cli/templates/{codeyam:sim.md → codeyam-sim.md} +1 -1
- package/codeyam-cli/templates/{codeyam:test.md → codeyam-test.md} +1 -1
- package/codeyam-cli/templates/{codeyam:verify.md → codeyam-verify.md} +1 -1
- package/codeyam-cli/templates/editor-step-hook.py +143 -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/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 +83 -0
- package/codeyam-cli/templates/rule-reflection-hook.py +647 -0
- package/codeyam-cli/templates/rules-instructions.md +78 -0
- package/package.json +16 -14
- package/packages/ai/index.js +3 -2
- package/packages/ai/index.js.map +1 -1
- package/packages/ai/src/lib/analyzeScope.js +50 -13
- package/packages/ai/src/lib/analyzeScope.js.map +1 -1
- package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js +76 -12
- package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js.map +1 -1
- package/packages/ai/src/lib/astScopes/patterns/forInStatementHandler.js +10 -14
- package/packages/ai/src/lib/astScopes/patterns/forInStatementHandler.js.map +1 -1
- package/packages/ai/src/lib/astScopes/processExpression.js +317 -44
- package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
- package/packages/ai/src/lib/astScopes/sharedPatterns.js +25 -0
- package/packages/ai/src/lib/astScopes/sharedPatterns.js.map +1 -1
- package/packages/ai/src/lib/completionCall.js +10 -7
- package/packages/ai/src/lib/completionCall.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +996 -173
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js +5 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.js +13 -3
- package/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.js +6 -4
- package/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js +33 -3
- package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js +36 -11
- package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/coerceObjectsToPrimitivesBySchema.js +63 -0
- package/packages/ai/src/lib/dataStructure/helpers/coerceObjectsToPrimitivesBySchema.js.map +1 -0
- package/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.js +54 -0
- package/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.js.map +1 -0
- package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js +122 -12
- package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.js +173 -0
- package/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.js.map +1 -0
- package/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.js +37 -20
- package/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js +309 -84
- package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.js +34 -0
- package/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.js.map +1 -0
- package/packages/ai/src/lib/dataStructureChunking.js +30 -11
- package/packages/ai/src/lib/dataStructureChunking.js.map +1 -1
- package/packages/ai/src/lib/generateEntityDataStructure.js +46 -2
- package/packages/ai/src/lib/generateEntityDataStructure.js.map +1 -1
- package/packages/ai/src/lib/generateEntityScenarioData.js +284 -6
- package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
- package/packages/ai/src/lib/generateEntityScenarios.js +7 -1
- package/packages/ai/src/lib/generateEntityScenarios.js.map +1 -1
- package/packages/ai/src/lib/generateExecutionFlows.js +107 -4
- package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -1
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js +447 -80
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js.map +1 -1
- package/packages/ai/src/lib/isolateScopes.js +39 -3
- package/packages/ai/src/lib/isolateScopes.js.map +1 -1
- package/packages/ai/src/lib/mergeJsonTypeDefinitions.js +5 -0
- package/packages/ai/src/lib/mergeJsonTypeDefinitions.js.map +1 -1
- package/packages/ai/src/lib/mergeStatements.js +70 -51
- package/packages/ai/src/lib/mergeStatements.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/collapseNullableObjects.js +97 -0
- package/packages/ai/src/lib/promptGenerators/collapseNullableObjects.js.map +1 -0
- package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js +10 -4
- package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js +17 -2
- package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js.map +1 -1
- package/packages/ai/src/lib/resolvePathToControllable.js +24 -14
- package/packages/ai/src/lib/resolvePathToControllable.js.map +1 -1
- package/packages/ai/src/lib/worker/SerializableDataStructure.js.map +1 -1
- package/packages/analyze/index.js +1 -0
- package/packages/analyze/index.js.map +1 -1
- package/packages/analyze/src/lib/FileAnalyzer.js +60 -36
- package/packages/analyze/src/lib/FileAnalyzer.js.map +1 -1
- package/packages/analyze/src/lib/ProjectAnalyzer.js +99 -26
- package/packages/analyze/src/lib/ProjectAnalyzer.js.map +1 -1
- package/packages/analyze/src/lib/asts/nodes/getNodeType.js +1 -0
- package/packages/analyze/src/lib/asts/nodes/getNodeType.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.js +14 -0
- package/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getAllEntityNodes.js +14 -0
- package/packages/analyze/src/lib/asts/sourceFiles/getAllEntityNodes.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getAllExports.js +6 -0
- package/packages/analyze/src/lib/asts/sourceFiles/getAllExports.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getImportsAnalysis.js +6 -0
- package/packages/analyze/src/lib/asts/sourceFiles/getImportsAnalysis.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getResolvedModule.js +39 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getResolvedModule.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getSourceFilesForAllImports.js +2 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getSourceFilesForAllImports.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +65 -7
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +24 -4
- 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/analyze/gatherEntityMap.js +2 -1
- package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js +0 -3
- package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeRemixRoute.js +3 -2
- package/packages/analyze/src/lib/files/analyzeRemixRoute.js.map +1 -1
- package/packages/analyze/src/lib/files/getImportedExports.js +11 -7
- package/packages/analyze/src/lib/files/getImportedExports.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js +907 -0
- package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js.map +1 -0
- package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js +56 -10
- package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js +75 -21
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +215 -17
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js +56 -8
- package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +494 -56
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/files/setImportedExports.js +2 -1
- package/packages/analyze/src/lib/files/setImportedExports.js.map +1 -1
- package/packages/analyze/src/lib/index.js +1 -0
- package/packages/analyze/src/lib/index.js.map +1 -1
- package/packages/analyze/src/lib/utils/getFileByPath.js +12 -0
- package/packages/analyze/src/lib/utils/getFileByPath.js.map +1 -0
- package/packages/database/index.js +1 -0
- package/packages/database/index.js.map +1 -1
- package/packages/database/src/lib/analysisBranchToDb.js +1 -1
- package/packages/database/src/lib/analysisBranchToDb.js.map +1 -1
- package/packages/database/src/lib/analysisToDb.js +1 -1
- package/packages/database/src/lib/analysisToDb.js.map +1 -1
- package/packages/database/src/lib/branchToDb.js +1 -1
- package/packages/database/src/lib/branchToDb.js.map +1 -1
- package/packages/database/src/lib/commitBranchToDb.js +1 -1
- package/packages/database/src/lib/commitBranchToDb.js.map +1 -1
- package/packages/database/src/lib/commitToDb.js +1 -1
- package/packages/database/src/lib/commitToDb.js.map +1 -1
- package/packages/database/src/lib/fileToDb.js +1 -1
- package/packages/database/src/lib/fileToDb.js.map +1 -1
- package/packages/database/src/lib/kysely/db.js +8 -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/kysely/tables/labsRequestsTable.js +35 -0
- package/packages/database/src/lib/kysely/tables/labsRequestsTable.js.map +1 -0
- package/packages/database/src/lib/loadCommits.js +23 -13
- package/packages/database/src/lib/loadCommits.js.map +1 -1
- package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.js +1 -4
- package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.js.map +1 -1
- package/packages/database/src/lib/projectToDb.js +1 -1
- package/packages/database/src/lib/projectToDb.js.map +1 -1
- package/packages/database/src/lib/saveFiles.js +1 -1
- package/packages/database/src/lib/saveFiles.js.map +1 -1
- package/packages/database/src/lib/scenarioToDb.js +1 -1
- package/packages/database/src/lib/scenarioToDb.js.map +1 -1
- package/packages/database/src/lib/updateCommitMetadata.js +100 -89
- package/packages/database/src/lib/updateCommitMetadata.js.map +1 -1
- package/packages/database/src/lib/updateFreshAnalysisStatus.js +41 -30
- package/packages/database/src/lib/updateFreshAnalysisStatus.js.map +1 -1
- package/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.js +68 -57
- package/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.js.map +1 -1
- package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +29 -1
- package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -1
- package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +33 -5
- package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
- package/packages/utils/src/lib/fs/rsyncCopy.js +98 -3
- package/packages/utils/src/lib/fs/rsyncCopy.js.map +1 -1
- package/scripts/finalize-analyzer.cjs +8 -76
- package/codeyam-cli/src/commands/detect-universal-mocks.js +0 -118
- package/codeyam-cli/src/commands/detect-universal-mocks.js.map +0 -1
- package/codeyam-cli/src/commands/list.js +0 -31
- package/codeyam-cli/src/commands/list.js.map +0 -1
- package/codeyam-cli/src/commands/webapp-info.js +0 -146
- package/codeyam-cli/src/commands/webapp-info.js.map +0 -1
- package/codeyam-cli/src/utils/universal-mocks.js +0 -152
- package/codeyam-cli/src/utils/universal-mocks.js.map +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-C8lyxW9k.js +0 -34
- package/codeyam-cli/src/webserver/build/client/assets/copy-Bb-80kDT.js +0 -6
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-BBnGWYga.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-DavjRmOY.js +0 -6
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-D1T4TGjf.js +0 -6
- package/codeyam-cli/src/webserver/build/client/assets/file-code-Dhef1kWN.js +0 -6
- package/codeyam-cli/src/webserver/build/client/assets/globals-D3yhhV8x.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-7522edd4.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/memory-yxFcrxBX.js +0 -92
- package/codeyam-cli/src/webserver/build/client/assets/root-eVAaavTS.js +0 -62
- package/codeyam-cli/src/webserver/build/client/assets/settings-CS5f3WzT.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-aSv48UbS.js +0 -2
- package/codeyam-cli/src/webserver/build/server/assets/index-DVzYx8PN.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-4Cr0uToj.js +0 -257
- package/codeyam-cli/templates/codeyam-stop-hook.sh +0 -284
- package/codeyam-cli/templates/codeyam:diagnose.md +0 -803
- package/codeyam-cli/templates/codeyam:memory.md +0 -462
- package/codeyam-cli/templates/codeyam:new-rule.md +0 -13
|
@@ -0,0 +1,696 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = path.dirname(__filename);
|
|
7
|
+
const STEP_LABELS = {
|
|
8
|
+
1: 'Plan',
|
|
9
|
+
2: 'Prototype',
|
|
10
|
+
3: 'Confirm',
|
|
11
|
+
4: 'Deconstruct',
|
|
12
|
+
5: 'Glossary',
|
|
13
|
+
6: 'Analyze',
|
|
14
|
+
7: 'App Scenarios',
|
|
15
|
+
8: 'User Scenarios',
|
|
16
|
+
9: 'Verify',
|
|
17
|
+
10: 'Review',
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Append a JSONL log entry to .codeyam/logs/editor-log.jsonl
|
|
21
|
+
*/
|
|
22
|
+
function logEvent(root, event, data) {
|
|
23
|
+
try {
|
|
24
|
+
const logsDir = path.join(root, '.codeyam', 'logs');
|
|
25
|
+
fs.mkdirSync(logsDir, { recursive: true });
|
|
26
|
+
const logPath = path.join(logsDir, 'editor-log.jsonl');
|
|
27
|
+
const entry = JSON.stringify({
|
|
28
|
+
ts: new Date().toISOString(),
|
|
29
|
+
event,
|
|
30
|
+
...data,
|
|
31
|
+
});
|
|
32
|
+
fs.appendFileSync(logPath, entry + '\n', 'utf8');
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
// Logging is best-effort
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Get the project root (where .codeyam/ lives) or cwd.
|
|
40
|
+
*/
|
|
41
|
+
function getProjectRoot() {
|
|
42
|
+
return process.env.CODEYAM_ROOT_PATH || process.cwd();
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Path to the editor step state file.
|
|
46
|
+
*/
|
|
47
|
+
function getStatePath(root) {
|
|
48
|
+
return path.join(root, '.codeyam', 'editor-step.json');
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Read the current editor state, or null if none.
|
|
52
|
+
*/
|
|
53
|
+
function readState(root) {
|
|
54
|
+
const statePath = getStatePath(root);
|
|
55
|
+
try {
|
|
56
|
+
const content = fs.readFileSync(statePath, 'utf8');
|
|
57
|
+
return JSON.parse(content);
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Write the editor state.
|
|
65
|
+
*/
|
|
66
|
+
function writeState(root, state) {
|
|
67
|
+
const statePath = getStatePath(root);
|
|
68
|
+
const dir = path.dirname(statePath);
|
|
69
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
70
|
+
fs.writeFileSync(statePath, JSON.stringify(state, null, 2), 'utf8');
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Clear the editor state (for starting a new feature).
|
|
74
|
+
*/
|
|
75
|
+
function clearState(root) {
|
|
76
|
+
const statePath = getStatePath(root);
|
|
77
|
+
try {
|
|
78
|
+
fs.unlinkSync(statePath);
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
// File doesn't exist, that's fine
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Check if a project has been scaffolded (package.json exists).
|
|
86
|
+
*/
|
|
87
|
+
function hasProject(root) {
|
|
88
|
+
return fs.existsSync(path.join(root, 'package.json'));
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Get the CodeYam server port from env or default.
|
|
92
|
+
*/
|
|
93
|
+
function getServerPort() {
|
|
94
|
+
return process.env.CODEYAM_PORT || '3111';
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Print a checklist item.
|
|
98
|
+
* Inline backtick-wrapped text is highlighted in cyan for visibility.
|
|
99
|
+
*/
|
|
100
|
+
function checkbox(text) {
|
|
101
|
+
// Highlight `backtick-wrapped` segments in cyan
|
|
102
|
+
const highlighted = text.replace(/`([^`]+)`/g, (_m, code) => chalk.cyan(code));
|
|
103
|
+
console.log(` ${chalk.dim('[ ]')} ${highlighted}`);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Print a section header.
|
|
107
|
+
*/
|
|
108
|
+
function stepHeader(step, title, feature) {
|
|
109
|
+
console.log();
|
|
110
|
+
console.log(chalk.bold.cyan(`━━━ Step ${step}: ${title} ━━━`));
|
|
111
|
+
if (feature) {
|
|
112
|
+
console.log(chalk.dim(`Feature: "${feature}"`));
|
|
113
|
+
}
|
|
114
|
+
console.log();
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Print a colored progress tracker showing all 10 steps.
|
|
118
|
+
* Steps before `current` are green ✓, `current` is bold cyan →, future steps are dim ○.
|
|
119
|
+
*/
|
|
120
|
+
function printProgressTracker(current) {
|
|
121
|
+
console.log();
|
|
122
|
+
console.log(chalk.dim('┌─────────────────────────────────────┐'));
|
|
123
|
+
for (let i = 1; i <= 10; i++) {
|
|
124
|
+
const label = STEP_LABELS[i];
|
|
125
|
+
const num = i < 10 ? ` ${i}` : `${i}`;
|
|
126
|
+
const content = `${num}. ${label.padEnd(28)}`;
|
|
127
|
+
if (i < current) {
|
|
128
|
+
console.log(chalk.dim(' │') + chalk.green(` ✓ ${content}`) + chalk.dim('│'));
|
|
129
|
+
}
|
|
130
|
+
else if (i === current) {
|
|
131
|
+
console.log(chalk.dim(' │') + chalk.bold.cyan(` → ${content}`) + chalk.dim('│'));
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
console.log(chalk.dim(` │ ○ ${content}│`));
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
console.log(chalk.dim(' └─────────────────────────────────────┘'));
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Print a hard STOP gate directing to the next command.
|
|
141
|
+
*
|
|
142
|
+
* Options:
|
|
143
|
+
* - confirm: true → step requires user confirmation before proceeding (steps 1, 3, 9)
|
|
144
|
+
*/
|
|
145
|
+
function stopGate(current, opts) {
|
|
146
|
+
console.log();
|
|
147
|
+
console.log(chalk.bold.red('━━━ STOP ━━━'));
|
|
148
|
+
console.log();
|
|
149
|
+
console.log(chalk.red('Complete ALL checklist items above before proceeding.'));
|
|
150
|
+
console.log(chalk.red('Do NOT skip ahead. Do NOT combine steps.'));
|
|
151
|
+
if (opts?.confirm) {
|
|
152
|
+
console.log();
|
|
153
|
+
console.log(chalk.yellow('Wait for user confirmation before moving on.'));
|
|
154
|
+
}
|
|
155
|
+
console.log();
|
|
156
|
+
console.log(chalk.bold.yellow('Present the following progress tracker to the user (copy it verbatim):'));
|
|
157
|
+
printProgressTracker(current);
|
|
158
|
+
console.log();
|
|
159
|
+
console.log(chalk.yellow('For the CURRENT step (→), show each checklist item with ✓ (done) or ✗ (skipped + reason).'));
|
|
160
|
+
console.log(chalk.yellow('If any items are ✗, explain why and ask if the user wants to address them.'));
|
|
161
|
+
console.log();
|
|
162
|
+
if (current < 10) {
|
|
163
|
+
console.log(chalk.green('When done, run: ') +
|
|
164
|
+
chalk.bold(`codeyam editor ${current + 1}`));
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
console.log(chalk.green('Feature complete! Run: ') +
|
|
168
|
+
chalk.bold('codeyam editor 1') +
|
|
169
|
+
chalk.green(' to start the next feature'));
|
|
170
|
+
}
|
|
171
|
+
console.log();
|
|
172
|
+
}
|
|
173
|
+
// ─── Setup (no args, no project) ──────────────────────────────────────
|
|
174
|
+
function printSetup(root) {
|
|
175
|
+
const port = getServerPort();
|
|
176
|
+
logEvent(root, 'setup');
|
|
177
|
+
console.log();
|
|
178
|
+
console.log(chalk.bold.cyan('━━━ Editor Mode: Project Setup ━━━'));
|
|
179
|
+
console.log();
|
|
180
|
+
console.log("No project detected. Let's scaffold one.");
|
|
181
|
+
console.log();
|
|
182
|
+
// Resolve the project template directory (works in both src/ and dist/)
|
|
183
|
+
const templateDir = path.join(__dirname, '..', '..', 'templates', 'nextjs-prisma-sqlite');
|
|
184
|
+
const hasTemplate = fs.existsSync(templateDir);
|
|
185
|
+
console.log(chalk.bold('Checklist:'));
|
|
186
|
+
checkbox('Read `.codeyam/editor-mode-context.md` for session state');
|
|
187
|
+
checkbox('Ask the user what they want to build');
|
|
188
|
+
if (hasTemplate) {
|
|
189
|
+
checkbox('Copy the project template and install dependencies');
|
|
190
|
+
console.log();
|
|
191
|
+
console.log(chalk.dim(' Copy template (Next.js + Prisma 7 + SQLite, pre-configured):'));
|
|
192
|
+
console.log(chalk.dim(` cp -r ${templateDir}/* .`));
|
|
193
|
+
console.log(chalk.dim(` cp ${templateDir}/.env ${templateDir}/.gitignore .`));
|
|
194
|
+
console.log(chalk.dim(' npm install'));
|
|
195
|
+
console.log();
|
|
196
|
+
checkbox('Define your data models in `prisma/schema.prisma`');
|
|
197
|
+
console.log(chalk.dim(" Replace the placeholder Todo model with your app's models"));
|
|
198
|
+
console.log();
|
|
199
|
+
checkbox('Push schema and seed the database');
|
|
200
|
+
console.log(chalk.dim(' npm run db:push'));
|
|
201
|
+
console.log(chalk.dim(' # Edit prisma/seed.ts with your seed data, then:'));
|
|
202
|
+
console.log(chalk.dim(' npm run db:seed'));
|
|
203
|
+
console.log();
|
|
204
|
+
console.log(chalk.dim(' See PRISMA_SETUP.md for Prisma patterns and important warnings.'));
|
|
205
|
+
console.log(chalk.dim(' Key: import { prisma } from "@/app/lib/prisma" in API routes.'));
|
|
206
|
+
console.log(chalk.dim(' Key: Seed scripts must use the adapter pattern (see prisma/seed.ts).'));
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
checkbox('Scaffold the project (Next.js recommended) using temp-dir-rsync pattern');
|
|
210
|
+
console.log();
|
|
211
|
+
console.log(chalk.dim(' Scaffolding pattern (avoids .claude/ conflicts):'));
|
|
212
|
+
console.log(chalk.dim(' SCAFFOLD_DIR="/tmp/codeyam-scaffold-$$" && mkdir -p "$SCAFFOLD_DIR"'));
|
|
213
|
+
console.log(chalk.dim(' npx create-next-app@latest "$SCAFFOLD_DIR" --typescript --tailwind --eslint \\'));
|
|
214
|
+
console.log(chalk.dim(' --app --no-src-dir --no-import-alias --no-react-compiler --turbopack'));
|
|
215
|
+
console.log(chalk.dim(' rsync -a --exclude=\'.git\' "$SCAFFOLD_DIR/" . && rm -rf "$SCAFFOLD_DIR"'));
|
|
216
|
+
console.log();
|
|
217
|
+
checkbox('Set up Prisma + SQLite database');
|
|
218
|
+
console.log(chalk.dim(' npm install prisma @prisma/client @prisma/adapter-better-sqlite3 better-sqlite3'));
|
|
219
|
+
console.log(chalk.dim(' npm install -D @types/better-sqlite3'));
|
|
220
|
+
console.log(chalk.dim(' npx prisma init --datasource-provider sqlite'));
|
|
221
|
+
console.log(chalk.dim(' # Define schema, then: npx prisma db push'));
|
|
222
|
+
}
|
|
223
|
+
console.log();
|
|
224
|
+
checkbox('Run `codeyam init --force --keep-server` to detect the project and configure it');
|
|
225
|
+
console.log(chalk.dim(' This auto-detects webapps and configures the start command for analysis'));
|
|
226
|
+
console.log();
|
|
227
|
+
checkbox('Verify `.codeyam/config.json` has `startCommand` in the webapp entry');
|
|
228
|
+
console.log(chalk.dim(' Should look like: "startCommand": { "command": "sh", "args": ["-c", "npm run dev -- --port $PORT"] }'));
|
|
229
|
+
console.log(chalk.dim(' If missing, add it manually. $PORT is replaced at runtime by the analyzer.'));
|
|
230
|
+
console.log();
|
|
231
|
+
checkbox(`Notify CodeYam: \`curl -s -X POST http://localhost:${port}/api/editor-refresh\``);
|
|
232
|
+
checkbox('Verify the preview loads in the browser');
|
|
233
|
+
console.log();
|
|
234
|
+
console.log(chalk.bold.red('━━━ STOP ━━━'));
|
|
235
|
+
console.log();
|
|
236
|
+
console.log(chalk.red('Complete ALL checklist items above. Do NOT start building features yet.'));
|
|
237
|
+
console.log();
|
|
238
|
+
console.log(chalk.bold.yellow('Present a completion checklist to the user:'));
|
|
239
|
+
console.log(chalk.yellow('Show each setup checklist item with ✓ (done) or ✗ (skipped + reason).'));
|
|
240
|
+
console.log(chalk.yellow('If any items are ✗, explain why and ask if the user wants to address them.'));
|
|
241
|
+
console.log();
|
|
242
|
+
console.log(chalk.green('When setup is complete, run: ') +
|
|
243
|
+
chalk.bold('codeyam editor 1') +
|
|
244
|
+
chalk.green(' to start your first feature'));
|
|
245
|
+
console.log();
|
|
246
|
+
}
|
|
247
|
+
// ─── Cycle overview (no args, has project) ────────────────────────────
|
|
248
|
+
function printCycleOverview(root, state) {
|
|
249
|
+
logEvent(root, 'overview', state ? { feature: state.feature, step: state.step } : {});
|
|
250
|
+
console.log();
|
|
251
|
+
console.log(chalk.bold.cyan('━━━ Editor Mode: Feature Cycle ━━━'));
|
|
252
|
+
console.log();
|
|
253
|
+
if (state) {
|
|
254
|
+
console.log(chalk.yellow(`Current: Step ${state.step} (${state.label}) — "${state.feature}"`));
|
|
255
|
+
console.log();
|
|
256
|
+
console.log(chalk.green('Continue with: ') +
|
|
257
|
+
chalk.bold(`codeyam editor ${state.step}`));
|
|
258
|
+
console.log(chalk.dim('Or run ') +
|
|
259
|
+
chalk.bold('codeyam editor 1') +
|
|
260
|
+
chalk.dim(' to start a new feature'));
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
console.log('Each feature follows 10 steps. You MUST run each command in order:');
|
|
264
|
+
console.log();
|
|
265
|
+
console.log(` ${chalk.bold.yellow(' 1')} ${chalk.bold('Plan')} — Plan the feature, confirm with user`);
|
|
266
|
+
console.log(` ${chalk.bold.yellow(' 2')} ${chalk.bold('Prototype')} — Build a working prototype fast`);
|
|
267
|
+
console.log(` ${chalk.bold.yellow(' 3')} ${chalk.bold('Confirm')} — Confirm prototype with user`);
|
|
268
|
+
console.log(` ${chalk.bold.yellow(' 4')} ${chalk.bold('Deconstruct')} — TDD extraction into small functions`);
|
|
269
|
+
console.log(` ${chalk.bold.yellow(' 5')} ${chalk.bold('Glossary')} — Record functions in glossary`);
|
|
270
|
+
console.log(` ${chalk.bold.yellow(' 6')} ${chalk.bold('Analyze')} — Analyze and verify components`);
|
|
271
|
+
console.log(` ${chalk.bold.yellow(' 7')} ${chalk.bold('App Scenarios')} — Create app-level scenarios`);
|
|
272
|
+
console.log(` ${chalk.bold.yellow(' 8')} ${chalk.bold('User Scenarios')} — Create user-persona scenarios`);
|
|
273
|
+
console.log(` ${chalk.bold.yellow(' 9')} ${chalk.bold('Verify')} — Review screenshots, check for errors`);
|
|
274
|
+
console.log(` ${chalk.bold.yellow('10')} ${chalk.bold('Review')} — Present summary, get approval`);
|
|
275
|
+
console.log();
|
|
276
|
+
console.log(chalk.green('Start now: ') + chalk.bold('codeyam editor 1'));
|
|
277
|
+
}
|
|
278
|
+
console.log();
|
|
279
|
+
}
|
|
280
|
+
// ─── Step 1: Plan ─────────────────────────────────────────────────────
|
|
281
|
+
function printStep1(root) {
|
|
282
|
+
clearState(root);
|
|
283
|
+
logEvent(root, 'step', { step: 1, label: 'Plan' });
|
|
284
|
+
stepHeader(1, 'Plan');
|
|
285
|
+
console.log('Plan the feature before writing ANY code.');
|
|
286
|
+
console.log();
|
|
287
|
+
console.log(chalk.bold('Checklist:'));
|
|
288
|
+
checkbox('Read `.codeyam/glossary.json` for reusable functions/components');
|
|
289
|
+
checkbox('Ask the user what they want to build');
|
|
290
|
+
checkbox('Identify the data model (what API routes will return)');
|
|
291
|
+
checkbox('Identify the components needed (reuse from glossary where possible)');
|
|
292
|
+
checkbox('Identify demo/seed data for the prototype');
|
|
293
|
+
checkbox('Present the plan and wait for user confirmation');
|
|
294
|
+
console.log();
|
|
295
|
+
console.log(chalk.dim('Do NOT write any code during this step. Plan only.'));
|
|
296
|
+
console.log();
|
|
297
|
+
console.log(chalk.bold.red('━━━ STOP ━━━'));
|
|
298
|
+
console.log();
|
|
299
|
+
console.log(chalk.red('Complete ALL checklist items above before proceeding.'));
|
|
300
|
+
console.log(chalk.red('Do NOT skip ahead. Do NOT combine steps.'));
|
|
301
|
+
console.log();
|
|
302
|
+
console.log(chalk.yellow('Wait for user confirmation before moving on.'));
|
|
303
|
+
console.log();
|
|
304
|
+
console.log(chalk.bold.yellow('Present the following progress tracker to the user (copy it verbatim):'));
|
|
305
|
+
printProgressTracker(1);
|
|
306
|
+
console.log();
|
|
307
|
+
console.log(chalk.yellow('For the CURRENT step (→), show each checklist item with ✓ (done) or ✗ (skipped + reason).'));
|
|
308
|
+
console.log(chalk.yellow('If any items are ✗, explain why and ask if the user wants to address them.'));
|
|
309
|
+
console.log();
|
|
310
|
+
console.log(chalk.green('When done, run: ') +
|
|
311
|
+
chalk.bold('codeyam editor 2 --feature "Feature Name"'));
|
|
312
|
+
console.log(chalk.dim(' Replace "Feature Name" with a short title for what you just described.'));
|
|
313
|
+
console.log();
|
|
314
|
+
}
|
|
315
|
+
// ─── Step 2: Prototype ────────────────────────────────────────────────
|
|
316
|
+
function printStep2(root, feature) {
|
|
317
|
+
const port = getServerPort();
|
|
318
|
+
writeState(root, {
|
|
319
|
+
feature,
|
|
320
|
+
step: 2,
|
|
321
|
+
label: STEP_LABELS[2],
|
|
322
|
+
startedAt: new Date().toISOString(),
|
|
323
|
+
});
|
|
324
|
+
logEvent(root, 'step', { step: 2, label: 'Prototype', feature });
|
|
325
|
+
stepHeader(2, 'Prototype', feature);
|
|
326
|
+
console.log('Build fast with real data. Prioritize speed over quality.');
|
|
327
|
+
console.log();
|
|
328
|
+
console.log(chalk.bold('Checklist:'));
|
|
329
|
+
checkbox('Create/update API routes (real database reads via Prisma)');
|
|
330
|
+
checkbox('Seed the database with demo data');
|
|
331
|
+
checkbox('Build the page/feature UI components');
|
|
332
|
+
checkbox('Verify the dev server shows the changes');
|
|
333
|
+
console.log();
|
|
334
|
+
console.log(chalk.bold('Verify the dev server:'));
|
|
335
|
+
console.log(chalk.dim(` # Get dev server URL: curl -s http://localhost:${port}/api/editor-dev-server`));
|
|
336
|
+
console.log(chalk.dim(' # Check page loads: curl -s -o /dev/null -w "%{http_code}" http://localhost:<dev-port>'));
|
|
337
|
+
console.log(chalk.dim(' # Check API routes: curl -s http://localhost:<dev-port>/api/your-route'));
|
|
338
|
+
console.log();
|
|
339
|
+
console.log(chalk.dim('Do NOT create scenarios or run codeyam analyze. Do NOT refactor.'));
|
|
340
|
+
stopGate(2);
|
|
341
|
+
}
|
|
342
|
+
// ─── Step 3: Confirm ──────────────────────────────────────────────────
|
|
343
|
+
function printStep3(root, feature) {
|
|
344
|
+
writeState(root, {
|
|
345
|
+
feature,
|
|
346
|
+
step: 3,
|
|
347
|
+
label: STEP_LABELS[3],
|
|
348
|
+
startedAt: new Date().toISOString(),
|
|
349
|
+
});
|
|
350
|
+
logEvent(root, 'step', { step: 3, label: 'Confirm', feature });
|
|
351
|
+
stepHeader(3, 'Confirm', feature);
|
|
352
|
+
console.log('Summarize what was built and get user confirmation.');
|
|
353
|
+
console.log();
|
|
354
|
+
console.log(chalk.bold('Checklist:'));
|
|
355
|
+
checkbox('Summarize what was built (routes, components, data)');
|
|
356
|
+
checkbox('Show the user the current state of the prototype');
|
|
357
|
+
console.log();
|
|
358
|
+
console.log(chalk.bold('Present a selection menu to the user (use AskUserQuestion):'));
|
|
359
|
+
console.log(chalk.green(' "Yes, this looks right!"') +
|
|
360
|
+
chalk.dim(' — proceed to step 4'));
|
|
361
|
+
console.log(chalk.yellow(' "I\'d like some changes"') +
|
|
362
|
+
chalk.dim(' — user describes changes, you make them, then re-present'));
|
|
363
|
+
console.log();
|
|
364
|
+
console.log(chalk.dim('Do NOT refactor or create scenarios until the user approves the prototype.'));
|
|
365
|
+
stopGate(3, { confirm: true });
|
|
366
|
+
}
|
|
367
|
+
// ─── Step 4: Deconstruct ──────────────────────────────────────────────
|
|
368
|
+
function printStep4(root, feature) {
|
|
369
|
+
writeState(root, {
|
|
370
|
+
feature,
|
|
371
|
+
step: 4,
|
|
372
|
+
label: STEP_LABELS[4],
|
|
373
|
+
startedAt: new Date().toISOString(),
|
|
374
|
+
});
|
|
375
|
+
logEvent(root, 'step', { step: 4, label: 'Deconstruct', feature });
|
|
376
|
+
stepHeader(4, 'Deconstruct', feature);
|
|
377
|
+
console.log('TDD extraction: write failing tests first, then extract.');
|
|
378
|
+
console.log();
|
|
379
|
+
console.log(chalk.bold('Checklist:'));
|
|
380
|
+
checkbox('Read `.codeyam/glossary.json` — reuse existing functions/components where they fit');
|
|
381
|
+
checkbox('Review the prototype code for extractable logic');
|
|
382
|
+
checkbox('Extract reusable components (each should accept props, render independently)');
|
|
383
|
+
checkbox('Extract utility functions (pure functions where possible)');
|
|
384
|
+
checkbox('Each component should be small enough to analyze independently');
|
|
385
|
+
console.log();
|
|
386
|
+
console.log(chalk.bold('Testing — CRITICAL:'));
|
|
387
|
+
console.log(chalk.yellow(' Every extracted library function MUST have a dedicated test file'));
|
|
388
|
+
console.log(chalk.yellow(' with thorough coverage. `codeyam analyze` only captures screenshots'));
|
|
389
|
+
console.log(chalk.yellow(' for visual components — it does NOT test library functions.'));
|
|
390
|
+
console.log(chalk.yellow(' Your tests ARE the only test coverage for these functions.'));
|
|
391
|
+
console.log();
|
|
392
|
+
checkbox('For each extracted function: write MULTIPLE failing tests FIRST, then extract to make them pass');
|
|
393
|
+
console.log(chalk.dim(' Cover: typical inputs, edge cases, empty/null inputs, error conditions'));
|
|
394
|
+
console.log(chalk.dim(' Aim for 3-8 test cases per function depending on complexity'));
|
|
395
|
+
checkbox('Place test files next to source: `app/lib/drinks.ts` → `app/lib/drinks.test.ts`');
|
|
396
|
+
checkbox('Run all tests and verify they pass before proceeding');
|
|
397
|
+
console.log();
|
|
398
|
+
console.log(chalk.dim('Reuse glossary functions when they fit naturally — but do NOT overload an existing'));
|
|
399
|
+
console.log(chalk.dim('function to handle too many situations. Extract a new one if the use case diverges.'));
|
|
400
|
+
console.log();
|
|
401
|
+
console.log(chalk.dim('Do NOT create scenarios. Write failing tests first, then extract. TDD only.'));
|
|
402
|
+
stopGate(4);
|
|
403
|
+
}
|
|
404
|
+
// ─── Step 5: Glossary ─────────────────────────────────────────────────
|
|
405
|
+
function printStep5(root, feature) {
|
|
406
|
+
writeState(root, {
|
|
407
|
+
feature,
|
|
408
|
+
step: 5,
|
|
409
|
+
label: STEP_LABELS[5],
|
|
410
|
+
startedAt: new Date().toISOString(),
|
|
411
|
+
});
|
|
412
|
+
logEvent(root, 'step', { step: 5, label: 'Glossary', feature });
|
|
413
|
+
stepHeader(5, 'Glossary', feature);
|
|
414
|
+
console.log('Record all new functions/components in `.codeyam/glossary.json`.');
|
|
415
|
+
console.log();
|
|
416
|
+
console.log(chalk.bold('Checklist:'));
|
|
417
|
+
checkbox("Read `.codeyam/glossary.json` (create if it doesn't exist)");
|
|
418
|
+
checkbox('Add an entry for each new function/component extracted in step 4');
|
|
419
|
+
checkbox('Each entry should have: name, filePath, description, parameters, returnType, tags, feature');
|
|
420
|
+
checkbox('For each function with a test file from step 4, set `testFile` to the relative path');
|
|
421
|
+
console.log();
|
|
422
|
+
console.log(chalk.bold('Entry format:'));
|
|
423
|
+
console.log(chalk.dim(' { "name": "calculateTotal", "filePath": "app/utils/pricing.ts",'));
|
|
424
|
+
console.log(chalk.dim(' "description": "Calculates total price including tax and discounts",'));
|
|
425
|
+
console.log(chalk.dim(' "parameters": [{ "name": "items", "type": "CartItem[]" }],'));
|
|
426
|
+
console.log(chalk.dim(' "returnType": "number", "tags": ["pricing"],'));
|
|
427
|
+
console.log(chalk.dim(' "testFile": "app/utils/pricing.test.ts",'));
|
|
428
|
+
console.log(chalk.dim(` "feature": "${feature}", "createdAt": "..." }`));
|
|
429
|
+
console.log();
|
|
430
|
+
console.log(chalk.dim('Do NOT write application code or create scenarios. Update the glossary only.'));
|
|
431
|
+
stopGate(5);
|
|
432
|
+
}
|
|
433
|
+
// ─── Step 6: Analyze ──────────────────────────────────────────────────
|
|
434
|
+
function printStep6(root, feature) {
|
|
435
|
+
writeState(root, {
|
|
436
|
+
feature,
|
|
437
|
+
step: 6,
|
|
438
|
+
label: STEP_LABELS[6],
|
|
439
|
+
startedAt: new Date().toISOString(),
|
|
440
|
+
});
|
|
441
|
+
logEvent(root, 'step', { step: 6, label: 'Analyze', feature });
|
|
442
|
+
stepHeader(6, 'Analyze and Verify', feature);
|
|
443
|
+
console.log('Verify both visual components (via `codeyam analyze`) and library functions (via tests).');
|
|
444
|
+
console.log();
|
|
445
|
+
console.log(chalk.bold('Visual Components — `codeyam analyze`:'));
|
|
446
|
+
checkbox('List all files with new/modified visual components from step 4');
|
|
447
|
+
checkbox('Run ONE `codeyam analyze --noOpen` command with all component files');
|
|
448
|
+
console.log(chalk.dim(' Example: codeyam analyze --noOpen app/components/DrinkCard.tsx app/components/StarRating.tsx'));
|
|
449
|
+
console.log(chalk.dim(' This discovers and analyzes all entities in all listed files in one pass'));
|
|
450
|
+
console.log(chalk.dim(' Use --entity to filter specific entities: --entity DrinkCard --entity StarRating'));
|
|
451
|
+
checkbox('Wait for the analyze command to complete');
|
|
452
|
+
checkbox('Check results — if any failed, read the log and fix the source code');
|
|
453
|
+
console.log(chalk.dim(' Log location: /tmp/codeyam/local-dev/<project-slug>/codeyam/log.txt'));
|
|
454
|
+
checkbox('Re-run `codeyam analyze` on fixed files until all pass');
|
|
455
|
+
console.log();
|
|
456
|
+
console.log(chalk.bold('Library Functions — run tests:'));
|
|
457
|
+
console.log(chalk.dim(' `codeyam analyze` does NOT test library functions. The tests'));
|
|
458
|
+
console.log(chalk.dim(' you wrote in step 4 are the only coverage for these functions.'));
|
|
459
|
+
checkbox('Run ALL test files created in step 4');
|
|
460
|
+
console.log(chalk.dim(' Example: npx vitest run app/lib/drinks.test.ts'));
|
|
461
|
+
checkbox('Verify every test passes');
|
|
462
|
+
checkbox('If any test fails, fix the source code and re-run');
|
|
463
|
+
console.log();
|
|
464
|
+
console.log(chalk.dim('Do not proceed until both visual analyses and library tests pass.'));
|
|
465
|
+
stopGate(6);
|
|
466
|
+
}
|
|
467
|
+
// ─── Step 7: App Scenarios ────────────────────────────────────────────
|
|
468
|
+
function printStep7(root, feature) {
|
|
469
|
+
const port = getServerPort();
|
|
470
|
+
writeState(root, {
|
|
471
|
+
feature,
|
|
472
|
+
step: 7,
|
|
473
|
+
label: STEP_LABELS[7],
|
|
474
|
+
startedAt: new Date().toISOString(),
|
|
475
|
+
});
|
|
476
|
+
logEvent(root, 'step', { step: 7, label: 'App Scenarios', feature });
|
|
477
|
+
stepHeader(7, 'App Scenarios', feature);
|
|
478
|
+
console.log('Create app-level scenarios representing different data states.');
|
|
479
|
+
console.log();
|
|
480
|
+
console.log(chalk.bold('Checklist:'));
|
|
481
|
+
checkbox('Create scenarios for key data states (empty, loaded, error)');
|
|
482
|
+
console.log(chalk.dim(' Each scenario provides data across ALL API routes for that state'));
|
|
483
|
+
checkbox('Register each scenario (auto-captures screenshot):');
|
|
484
|
+
console.log(chalk.dim(` curl -s -X POST http://localhost:${port}/api/editor-register-scenario \\`));
|
|
485
|
+
console.log(chalk.dim(` -H 'Content-Type: application/json' \\`));
|
|
486
|
+
console.log(chalk.dim(` -d '{"name":"...","description":"...","mockData":{"routes":{"/api/...":{"body":[...]}}}}'`));
|
|
487
|
+
checkbox('Create a journal entry for the feature:');
|
|
488
|
+
console.log(chalk.dim(` curl -s -X POST http://localhost:${port}/api/editor-journal-entry \\`));
|
|
489
|
+
console.log(chalk.dim(` -H 'Content-Type: application/json' \\`));
|
|
490
|
+
console.log(chalk.dim(` -d '{"title":"...","type":"feature","description":"...","scenarios":["..."]}'`));
|
|
491
|
+
console.log();
|
|
492
|
+
console.log(chalk.dim('Do NOT modify application code. Create and register app-level scenarios only.'));
|
|
493
|
+
stopGate(7);
|
|
494
|
+
}
|
|
495
|
+
// ─── Step 8: User Scenarios ───────────────────────────────────────────
|
|
496
|
+
function printStep8(root, feature) {
|
|
497
|
+
const port = getServerPort();
|
|
498
|
+
writeState(root, {
|
|
499
|
+
feature,
|
|
500
|
+
step: 8,
|
|
501
|
+
label: STEP_LABELS[8],
|
|
502
|
+
startedAt: new Date().toISOString(),
|
|
503
|
+
});
|
|
504
|
+
logEvent(root, 'step', { step: 8, label: 'User Scenarios', feature });
|
|
505
|
+
stepHeader(8, 'User Scenarios', feature);
|
|
506
|
+
console.log('Create per-persona scenarios if the app has users. Skip to step 9 if no users.');
|
|
507
|
+
console.log();
|
|
508
|
+
console.log(chalk.bold('If the app has users:'));
|
|
509
|
+
checkbox('Create scenarios for each user persona (admin, regular user, new user)');
|
|
510
|
+
console.log(chalk.dim(' Each persona scenario provides data across ALL API routes for that user type'));
|
|
511
|
+
checkbox('Register each persona scenario (auto-captures screenshot):');
|
|
512
|
+
console.log(chalk.dim(` curl -s -X POST http://localhost:${port}/api/editor-register-scenario \\`));
|
|
513
|
+
console.log(chalk.dim(` -H 'Content-Type: application/json' \\`));
|
|
514
|
+
console.log(chalk.dim(` -d '{"name":"...","description":"...","mockData":{"routes":{"/api/...":{"body":[...]}}}}'`));
|
|
515
|
+
console.log();
|
|
516
|
+
console.log(chalk.bold('If the app has NO users:'));
|
|
517
|
+
console.log(chalk.dim(' Skip this step and proceed to step 9 (Verify).'));
|
|
518
|
+
console.log();
|
|
519
|
+
console.log(chalk.dim('Do NOT modify application code. Create user-persona scenarios only (or skip if no users).'));
|
|
520
|
+
stopGate(8);
|
|
521
|
+
}
|
|
522
|
+
// ─── Step 9: Verify ──────────────────────────────────────────────────
|
|
523
|
+
function printStep9(root, feature) {
|
|
524
|
+
const port = getServerPort();
|
|
525
|
+
writeState(root, {
|
|
526
|
+
feature,
|
|
527
|
+
step: 9,
|
|
528
|
+
label: STEP_LABELS[9],
|
|
529
|
+
startedAt: new Date().toISOString(),
|
|
530
|
+
});
|
|
531
|
+
logEvent(root, 'step', { step: 9, label: 'Verify', feature });
|
|
532
|
+
stepHeader(9, 'Verify', feature);
|
|
533
|
+
console.log('Verify entity screenshots, editor scenarios, and library tests. After ANY code fix, re-analyze affected files.');
|
|
534
|
+
console.log();
|
|
535
|
+
console.log(chalk.bold('Entity screenshots (Data tab) — verify via API:'));
|
|
536
|
+
checkbox(`Check entity status: \`curl -s http://localhost:${port}/api/editor-entity-status\``);
|
|
537
|
+
checkbox('Review `summary.missingScreenshots` — each listed entity needs `codeyam analyze --noOpen <file>`');
|
|
538
|
+
checkbox('Open the Data tab and review each entity screenshot for visual correctness');
|
|
539
|
+
checkbox('If any screenshot looks wrong, fix the component code');
|
|
540
|
+
console.log(chalk.yellow(' IMPORTANT: After fixing ANY visual component, re-run `codeyam analyze --noOpen <file>`'));
|
|
541
|
+
console.log(chalk.yellow(' to update the entity screenshot. Re-capturing an editor scenario is NOT sufficient.'));
|
|
542
|
+
console.log();
|
|
543
|
+
console.log(chalk.bold('Editor scenarios (App tab) — visual + error check:'));
|
|
544
|
+
checkbox(`Refresh the preview: \`curl -s -X POST http://localhost:${port}/api/editor-refresh\``);
|
|
545
|
+
checkbox('Click through each app-level and user-persona scenario in the preview');
|
|
546
|
+
checkbox('Check for visual correctness and client-side errors (Console tab)');
|
|
547
|
+
console.log(chalk.dim(' Look for: React errors, failed fetches, undefined references, hydration mismatches'));
|
|
548
|
+
checkbox('If any errors found, fix the source code and re-test');
|
|
549
|
+
console.log(chalk.yellow(' After fixing code that affects visual components, also re-run `codeyam analyze --noOpen <file>`'));
|
|
550
|
+
console.log();
|
|
551
|
+
console.log(chalk.bold('Library functions — test check:'));
|
|
552
|
+
checkbox('Re-run all test files from step 4 to confirm they still pass');
|
|
553
|
+
console.log(chalk.dim(' Example: npx vitest run app/lib/drinks.test.ts'));
|
|
554
|
+
checkbox('If any test fails, fix the source code and re-run');
|
|
555
|
+
console.log();
|
|
556
|
+
console.log(chalk.dim('Do NOT add new features. Fix issues only. All entity screenshots, scenarios, and tests must be clean.'));
|
|
557
|
+
stopGate(9);
|
|
558
|
+
}
|
|
559
|
+
// ─── Step 10: Review ──────────────────────────────────────────────────
|
|
560
|
+
function printStep10(root, feature) {
|
|
561
|
+
const port = getServerPort();
|
|
562
|
+
writeState(root, {
|
|
563
|
+
feature,
|
|
564
|
+
step: 10,
|
|
565
|
+
label: STEP_LABELS[10],
|
|
566
|
+
startedAt: new Date().toISOString(),
|
|
567
|
+
});
|
|
568
|
+
logEvent(root, 'step', { step: 10, label: 'Review', feature });
|
|
569
|
+
stepHeader(10, 'Review', feature);
|
|
570
|
+
console.log('Present a full summary, verify screenshots, then let the user save or revise.');
|
|
571
|
+
console.log();
|
|
572
|
+
console.log(chalk.bold('Phase 1 — Summary:'));
|
|
573
|
+
checkbox('Summarize the feature that was built');
|
|
574
|
+
checkbox('List all components and functions created');
|
|
575
|
+
checkbox('List glossary entries added in step 5');
|
|
576
|
+
checkbox('List all scenarios (app-level and user-persona)');
|
|
577
|
+
checkbox('Report analysis status (completed/in-progress from step 6)');
|
|
578
|
+
checkbox('Report verification status from step 9 (all clean?)');
|
|
579
|
+
checkbox(`Refresh the preview: \`curl -s -X POST http://localhost:${port}/api/dev-mode-refresh\``);
|
|
580
|
+
console.log();
|
|
581
|
+
console.log(chalk.bold('Phase 2 — Screenshot & error verification:'));
|
|
582
|
+
console.log(chalk.yellow(' CRITICAL: Verify screenshots AND check for client-side errors.'));
|
|
583
|
+
console.log();
|
|
584
|
+
console.log(chalk.bold(' Entity screenshots:'));
|
|
585
|
+
checkbox(`Check entity status: \`curl -s http://localhost:${port}/api/editor-entity-status\``);
|
|
586
|
+
checkbox('Review `summary.missingScreenshots` — each listed entity needs `codeyam analyze --noOpen <file>`');
|
|
587
|
+
checkbox('For each component created in this feature, confirm it has a screenshot in the Data tab');
|
|
588
|
+
console.log();
|
|
589
|
+
console.log(chalk.bold(' Client-side errors:'));
|
|
590
|
+
checkbox(`Check for errors: \`curl -s http://localhost:${port}/api/editor-client-errors\``);
|
|
591
|
+
checkbox('If `hasErrors` is true, list the errors and fix them in the source code');
|
|
592
|
+
checkbox('After fixing, re-capture affected scenarios to clear the errors');
|
|
593
|
+
console.log();
|
|
594
|
+
checkbox('Do NOT proceed until all components have screenshots AND client errors are resolved');
|
|
595
|
+
console.log();
|
|
596
|
+
checkbox('Present the summary (with screenshot and error status) to the user');
|
|
597
|
+
console.log();
|
|
598
|
+
console.log(chalk.bold('Phase 3 — Present a selection menu to the user (use AskUserQuestion):'));
|
|
599
|
+
console.log(chalk.green(' "Save & commit"') +
|
|
600
|
+
chalk.dim(' — git commit all changes and record in journal'));
|
|
601
|
+
console.log(chalk.yellow(' "I\'d like to make some changes"') +
|
|
602
|
+
chalk.dim(' — describe changes, then re-verify'));
|
|
603
|
+
console.log();
|
|
604
|
+
console.log(chalk.bold('If the user chooses "Save & commit":'));
|
|
605
|
+
checkbox(`Git commit all changes: \`curl -s -X POST http://localhost:${port}/api/editor-commit -H 'Content-Type: application/json' -d '{"message":"feat: <feature name>"}'\``);
|
|
606
|
+
checkbox(`Update journal entry with commit SHA: \`curl -s -X PATCH http://localhost:${port}/api/editor-journal-update -H 'Content-Type: application/json' -d '{"time":"<journal entry time>","commitSha":"<sha>","commitMessage":"feat: <feature name>"}'\``);
|
|
607
|
+
console.log(chalk.green(' Then run: ') +
|
|
608
|
+
chalk.bold('codeyam editor 1') +
|
|
609
|
+
chalk.green(' to start the next feature'));
|
|
610
|
+
console.log();
|
|
611
|
+
console.log(chalk.bold('If the user chooses "Make changes":'));
|
|
612
|
+
checkbox('Ask what changes the user wants');
|
|
613
|
+
checkbox('Make the requested changes');
|
|
614
|
+
checkbox(`Update the journal entry description: \`curl -s -X PATCH http://localhost:${port}/api/editor-journal-update -H 'Content-Type: application/json' -d '{"time":"<journal entry time>","description":"<updated description>"}'\``);
|
|
615
|
+
console.log(chalk.yellow(' Then run: ') +
|
|
616
|
+
chalk.bold('codeyam editor 9') +
|
|
617
|
+
chalk.yellow(' to re-verify, which flows back to step 10'));
|
|
618
|
+
console.log();
|
|
619
|
+
console.log(chalk.dim('Do NOT skip the screenshot verification or user menu. Complete all phases in order.'));
|
|
620
|
+
stopGate(10, { confirm: true });
|
|
621
|
+
}
|
|
622
|
+
// ─── Command definition ───────────────────────────────────────────────
|
|
623
|
+
const editorCommand = {
|
|
624
|
+
command: 'editor [step]',
|
|
625
|
+
describe: 'Editor mode guided workflow',
|
|
626
|
+
builder: (yargs) => {
|
|
627
|
+
return yargs
|
|
628
|
+
.positional('step', {
|
|
629
|
+
type: 'number',
|
|
630
|
+
describe: 'Step number (1-10)',
|
|
631
|
+
choices: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
|
|
632
|
+
})
|
|
633
|
+
.option('feature', {
|
|
634
|
+
type: 'string',
|
|
635
|
+
describe: 'Feature name (required for step 2)',
|
|
636
|
+
});
|
|
637
|
+
},
|
|
638
|
+
handler: (argv) => {
|
|
639
|
+
const root = getProjectRoot();
|
|
640
|
+
if (argv.step == null) {
|
|
641
|
+
// No step specified: setup or overview
|
|
642
|
+
if (!hasProject(root)) {
|
|
643
|
+
printSetup(root);
|
|
644
|
+
}
|
|
645
|
+
else {
|
|
646
|
+
const state = readState(root);
|
|
647
|
+
printCycleOverview(root, state);
|
|
648
|
+
}
|
|
649
|
+
return;
|
|
650
|
+
}
|
|
651
|
+
const state = readState(root);
|
|
652
|
+
switch (argv.step) {
|
|
653
|
+
case 1:
|
|
654
|
+
printStep1(root);
|
|
655
|
+
break;
|
|
656
|
+
case 2: {
|
|
657
|
+
const feature = argv.feature || state?.feature;
|
|
658
|
+
if (!feature) {
|
|
659
|
+
console.error(chalk.red('Error: --feature "Feature Name" is required for step 2.'));
|
|
660
|
+
console.error(chalk.dim(' Usage: codeyam editor 2 --feature "Drink Rating System"'));
|
|
661
|
+
process.exit(1);
|
|
662
|
+
}
|
|
663
|
+
printStep2(root, feature);
|
|
664
|
+
break;
|
|
665
|
+
}
|
|
666
|
+
case 3:
|
|
667
|
+
case 4:
|
|
668
|
+
case 5:
|
|
669
|
+
case 6:
|
|
670
|
+
case 7:
|
|
671
|
+
case 8:
|
|
672
|
+
case 9:
|
|
673
|
+
case 10: {
|
|
674
|
+
const feature = argv.feature || state?.feature;
|
|
675
|
+
if (!feature) {
|
|
676
|
+
console.error(chalk.red('Error: No feature in progress. Run codeyam editor 1 first.'));
|
|
677
|
+
process.exit(1);
|
|
678
|
+
}
|
|
679
|
+
const stepFns = {
|
|
680
|
+
3: printStep3,
|
|
681
|
+
4: printStep4,
|
|
682
|
+
5: printStep5,
|
|
683
|
+
6: printStep6,
|
|
684
|
+
7: printStep7,
|
|
685
|
+
8: printStep8,
|
|
686
|
+
9: printStep9,
|
|
687
|
+
10: printStep10,
|
|
688
|
+
};
|
|
689
|
+
stepFns[argv.step](root, feature);
|
|
690
|
+
break;
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
},
|
|
694
|
+
};
|
|
695
|
+
export default editorCommand;
|
|
696
|
+
//# sourceMappingURL=editor.js.map
|