@codeyam/codeyam-cli 0.1.0-staging.ae0de75 → 0.1.0-staging.b147f46
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 +8 -8
- package/analyzer-template/log.txt +3 -3
- package/analyzer-template/package.json +7 -7
- package/analyzer-template/packages/ai/package.json +1 -1
- package/analyzer-template/packages/ai/src/lib/astScopes/methodSemantics.ts +135 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/nodeToSource.ts +19 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/paths.ts +11 -4
- package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +36 -9
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/ParentScopeManager.ts +10 -3
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.ts +16 -6
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +0 -33
- package/analyzer-template/packages/analyze/index.ts +4 -1
- package/analyzer-template/packages/analyze/src/lib/ProjectAnalyzer.ts +13 -7
- package/analyzer-template/packages/analyze/src/lib/asts/index.ts +7 -2
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +28 -2
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +5 -36
- package/analyzer-template/packages/analyze/src/lib/files/analyze/findOrCreateEntity.ts +10 -6
- package/analyzer-template/packages/analyze/src/lib/files/analyze/gatherEntityMap.ts +9 -12
- package/analyzer-template/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.ts +21 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.ts +82 -10
- package/analyzer-template/packages/analyze/src/lib/files/analyzeChange.ts +4 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyzeInitial.ts +4 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyzeNextRoute.ts +8 -3
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +239 -58
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.ts +0 -98
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +1684 -1462
- package/analyzer-template/packages/aws/package.json +2 -2
- package/analyzer-template/packages/database/package.json +2 -2
- package/analyzer-template/packages/database/src/lib/kysely/tables/editorScenariosTable.ts +102 -0
- package/analyzer-template/packages/database/src/lib/loadAnalysis.ts +19 -15
- package/analyzer-template/packages/database/src/lib/loadEntities.ts +0 -6
- package/analyzer-template/packages/database/src/lib/loadEntity.ts +19 -8
- package/analyzer-template/packages/database/src/lib/updateCommitMetadata.ts +0 -65
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts +9 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js +104 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js +0 -6
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntity.d.ts +4 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntity.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntity.js +5 -5
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntity.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 +0 -25
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.d.ts +2 -0
- package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.js +2 -0
- package/analyzer-template/packages/github/dist/types/src/enums/ProjectFramework.js.map +1 -1
- package/analyzer-template/packages/types/src/enums/ProjectFramework.ts +2 -0
- package/analyzer-template/packages/ui-components/package.json +1 -1
- package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.d.ts +2 -0
- package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.js +2 -0
- package/analyzer-template/packages/utils/dist/types/src/enums/ProjectFramework.js.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.d.ts +3 -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 +22 -1
- 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 +27 -0
- package/analyzer-template/project/analyzeFileEntities.ts +26 -0
- package/background/src/lib/virtualized/project/analyzeFileEntities.js +22 -0
- package/background/src/lib/virtualized/project/analyzeFileEntities.js.map +1 -1
- package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js +196 -0
- package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js.map +1 -0
- package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js +114 -0
- package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js.map +1 -0
- package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js +149 -0
- package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js.map +1 -0
- package/codeyam-cli/src/cli.js +24 -0
- package/codeyam-cli/src/cli.js.map +1 -1
- package/codeyam-cli/src/commands/__tests__/editor.analyzeImportsArgs.test.js +47 -0
- package/codeyam-cli/src/commands/__tests__/editor.analyzeImportsArgs.test.js.map +1 -0
- package/codeyam-cli/src/commands/__tests__/editor.auditNoAutoAnalysis.test.js +71 -0
- package/codeyam-cli/src/commands/__tests__/editor.auditNoAutoAnalysis.test.js.map +1 -0
- package/codeyam-cli/src/commands/__tests__/editor.isolateArgs.test.js +51 -0
- package/codeyam-cli/src/commands/__tests__/editor.isolateArgs.test.js.map +1 -0
- package/codeyam-cli/src/commands/__tests__/editor.stepDispatch.test.js +56 -0
- package/codeyam-cli/src/commands/__tests__/editor.stepDispatch.test.js.map +1 -0
- package/codeyam-cli/src/commands/__tests__/init.gitignore.test.js +101 -47
- package/codeyam-cli/src/commands/__tests__/init.gitignore.test.js.map +1 -1
- package/codeyam-cli/src/commands/default.js +3 -46
- package/codeyam-cli/src/commands/default.js.map +1 -1
- package/codeyam-cli/src/commands/editor.js +4654 -836
- package/codeyam-cli/src/commands/editor.js.map +1 -1
- package/codeyam-cli/src/commands/editorAnalyzeImportsArgs.js +23 -0
- package/codeyam-cli/src/commands/editorAnalyzeImportsArgs.js.map +1 -0
- package/codeyam-cli/src/commands/editorIsolateArgs.js +25 -0
- package/codeyam-cli/src/commands/editorIsolateArgs.js.map +1 -0
- package/codeyam-cli/src/commands/init.js +69 -34
- package/codeyam-cli/src/commands/init.js.map +1 -1
- package/codeyam-cli/src/commands/telemetry.js +37 -0
- package/codeyam-cli/src/commands/telemetry.js.map +1 -0
- package/codeyam-cli/src/data/techStacks.js +77 -0
- package/codeyam-cli/src/data/techStacks.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/analyzerFinalization.test.js +173 -0
- package/codeyam-cli/src/utils/__tests__/analyzerFinalization.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/backgroundServer.test.js +46 -0
- package/codeyam-cli/src/utils/__tests__/backgroundServer.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/devServerState.test.js +134 -0
- package/codeyam-cli/src/utils/__tests__/devServerState.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorApi.test.js +137 -0
- package/codeyam-cli/src/utils/__tests__/editorApi.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +3769 -1
- package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorBroadcastViewport.test.js +76 -0
- package/codeyam-cli/src/utils/__tests__/editorBroadcastViewport.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorCapture.test.js +93 -0
- package/codeyam-cli/src/utils/__tests__/editorCapture.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorCaptureScenarioSeeding.test.js +137 -0
- package/codeyam-cli/src/utils/__tests__/editorCaptureScenarioSeeding.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorDeleteScenario.test.js +100 -0
- package/codeyam-cli/src/utils/__tests__/editorDeleteScenario.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js +181 -3
- package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js +194 -0
- package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorEntityHelpers.test.js +381 -0
- package/codeyam-cli/src/utils/__tests__/editorEntityHelpers.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorGuardMiddleware.test.js +67 -0
- package/codeyam-cli/src/utils/__tests__/editorGuardMiddleware.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js +294 -0
- package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorJournal.test.js +249 -2
- package/codeyam-cli/src/utils/__tests__/editorJournal.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js +594 -0
- package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorMigration.test.js +435 -0
- package/codeyam-cli/src/utils/__tests__/editorMigration.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js +118 -1
- package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorPreview.test.js +217 -3
- package/codeyam-cli/src/utils/__tests__/editorPreview.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js +153 -0
- package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js +139 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js +291 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js +1694 -2
- package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js +329 -0
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapterPrismaValidation.test.js +143 -0
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapterPrismaValidation.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorSessionFilter.test.js +66 -0
- package/codeyam-cli/src/utils/__tests__/editorSessionFilter.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorShouldRevalidate.test.js +53 -0
- package/codeyam-cli/src/utils/__tests__/editorShouldRevalidate.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js +2121 -0
- package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/glossaryAdd.test.js +177 -0
- package/codeyam-cli/src/utils/__tests__/glossaryAdd.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js +122 -0
- package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/manualEntityAnalysis.test.js +302 -0
- package/codeyam-cli/src/utils/__tests__/manualEntityAnalysis.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js +129 -0
- package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/registerScenarioResult.test.js +127 -0
- package/codeyam-cli/src/utils/__tests__/registerScenarioResult.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/routePatternMatching.test.js +118 -0
- package/codeyam-cli/src/utils/__tests__/routePatternMatching.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/scenarioCoverage.test.js +284 -0
- package/codeyam-cli/src/utils/__tests__/scenarioCoverage.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js +672 -0
- package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/screenshotHash.test.js +84 -0
- package/codeyam-cli/src/utils/__tests__/screenshotHash.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +26 -5
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/telemetry.test.js +159 -0
- package/codeyam-cli/src/utils/__tests__/telemetry.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js +51 -0
- package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/testRunner.test.js +217 -0
- package/codeyam-cli/src/utils/__tests__/testRunner.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/webappDetection.test.js +142 -0
- package/codeyam-cli/src/utils/__tests__/webappDetection.test.js.map +1 -0
- package/codeyam-cli/src/utils/analysisRunner.js +39 -8
- package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
- package/codeyam-cli/src/utils/analyzer.js +19 -0
- package/codeyam-cli/src/utils/analyzer.js.map +1 -1
- package/codeyam-cli/src/utils/analyzerFinalization.js +100 -0
- package/codeyam-cli/src/utils/analyzerFinalization.js.map +1 -0
- package/codeyam-cli/src/utils/backgroundServer.js +95 -19
- package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/utils/database.js +37 -2
- package/codeyam-cli/src/utils/database.js.map +1 -1
- package/codeyam-cli/src/utils/devServerState.js +71 -0
- package/codeyam-cli/src/utils/devServerState.js.map +1 -0
- package/codeyam-cli/src/utils/editorApi.js +79 -0
- package/codeyam-cli/src/utils/editorApi.js.map +1 -0
- package/codeyam-cli/src/utils/editorAudit.js +753 -8
- package/codeyam-cli/src/utils/editorAudit.js.map +1 -1
- package/codeyam-cli/src/utils/editorBroadcastViewport.js +26 -0
- package/codeyam-cli/src/utils/editorBroadcastViewport.js.map +1 -0
- package/codeyam-cli/src/utils/editorCapture.js +102 -0
- package/codeyam-cli/src/utils/editorCapture.js.map +1 -0
- package/codeyam-cli/src/utils/editorDeleteScenario.js +67 -0
- package/codeyam-cli/src/utils/editorDeleteScenario.js.map +1 -0
- package/codeyam-cli/src/utils/editorDevServer.js +100 -1
- package/codeyam-cli/src/utils/editorDevServer.js.map +1 -1
- package/codeyam-cli/src/utils/editorEntityChangeStatus.js +50 -0
- package/codeyam-cli/src/utils/editorEntityChangeStatus.js.map +1 -0
- package/codeyam-cli/src/utils/editorEntityHelpers.js +144 -0
- package/codeyam-cli/src/utils/editorEntityHelpers.js.map +1 -0
- package/codeyam-cli/src/utils/editorGuard.js +36 -0
- package/codeyam-cli/src/utils/editorGuard.js.map +1 -0
- package/codeyam-cli/src/utils/editorImageVerifier.js +155 -0
- package/codeyam-cli/src/utils/editorImageVerifier.js.map +1 -0
- package/codeyam-cli/src/utils/editorJournal.js +92 -4
- package/codeyam-cli/src/utils/editorJournal.js.map +1 -1
- package/codeyam-cli/src/utils/editorLoaderHelpers.js +152 -0
- package/codeyam-cli/src/utils/editorLoaderHelpers.js.map +1 -0
- package/codeyam-cli/src/utils/editorMigration.js +224 -0
- package/codeyam-cli/src/utils/editorMigration.js.map +1 -0
- package/codeyam-cli/src/utils/editorMockState.js +1 -1
- package/codeyam-cli/src/utils/editorPreloadHelpers.js +72 -1
- package/codeyam-cli/src/utils/editorPreloadHelpers.js.map +1 -1
- package/codeyam-cli/src/utils/editorPreview.js +74 -1
- package/codeyam-cli/src/utils/editorPreview.js.map +1 -1
- package/codeyam-cli/src/utils/editorRecapture.js +109 -0
- package/codeyam-cli/src/utils/editorRecapture.js.map +1 -0
- package/codeyam-cli/src/utils/editorScenarioSwitch.js +134 -0
- package/codeyam-cli/src/utils/editorScenarioSwitch.js.map +1 -0
- package/codeyam-cli/src/utils/editorScenarios.js +620 -0
- package/codeyam-cli/src/utils/editorScenarios.js.map +1 -1
- package/codeyam-cli/src/utils/editorSeedAdapter.js +462 -0
- package/codeyam-cli/src/utils/editorSeedAdapter.js.map +1 -0
- package/codeyam-cli/src/utils/editorShouldRevalidate.js +21 -0
- package/codeyam-cli/src/utils/editorShouldRevalidate.js.map +1 -0
- package/codeyam-cli/src/utils/entityChangeStatus.js +394 -0
- package/codeyam-cli/src/utils/entityChangeStatus.js.map +1 -0
- package/codeyam-cli/src/utils/entityChangeStatus.server.js +212 -0
- package/codeyam-cli/src/utils/entityChangeStatus.server.js.map +1 -0
- package/codeyam-cli/src/utils/fileWatcher.js +38 -0
- package/codeyam-cli/src/utils/fileWatcher.js.map +1 -1
- package/codeyam-cli/src/utils/glossaryAdd.js +74 -0
- package/codeyam-cli/src/utils/glossaryAdd.js.map +1 -0
- package/codeyam-cli/src/utils/install-skills.js +15 -1
- package/codeyam-cli/src/utils/install-skills.js.map +1 -1
- package/codeyam-cli/src/utils/manualEntityAnalysis.js +196 -0
- package/codeyam-cli/src/utils/manualEntityAnalysis.js.map +1 -0
- package/codeyam-cli/src/utils/parseRegisterArg.js +31 -0
- package/codeyam-cli/src/utils/parseRegisterArg.js.map +1 -0
- package/codeyam-cli/src/utils/progress.js +2 -2
- package/codeyam-cli/src/utils/progress.js.map +1 -1
- package/codeyam-cli/src/utils/queue/job.js +26 -5
- package/codeyam-cli/src/utils/queue/job.js.map +1 -1
- package/codeyam-cli/src/utils/registerScenarioResult.js +52 -0
- package/codeyam-cli/src/utils/registerScenarioResult.js.map +1 -0
- package/codeyam-cli/src/utils/routePatternMatching.js +129 -0
- package/codeyam-cli/src/utils/routePatternMatching.js.map +1 -0
- package/codeyam-cli/src/utils/scenarioCoverage.js +77 -0
- package/codeyam-cli/src/utils/scenarioCoverage.js.map +1 -0
- package/codeyam-cli/src/utils/scenariosManifest.js +307 -0
- package/codeyam-cli/src/utils/scenariosManifest.js.map +1 -0
- package/codeyam-cli/src/utils/screenshotHash.js +26 -0
- package/codeyam-cli/src/utils/screenshotHash.js.map +1 -0
- package/codeyam-cli/src/utils/serverState.js +30 -0
- package/codeyam-cli/src/utils/serverState.js.map +1 -1
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +47 -16
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
- package/codeyam-cli/src/utils/simulationGateMiddleware.js +17 -1
- package/codeyam-cli/src/utils/simulationGateMiddleware.js.map +1 -1
- package/codeyam-cli/src/utils/slugUtils.js +25 -0
- package/codeyam-cli/src/utils/slugUtils.js.map +1 -0
- package/codeyam-cli/src/utils/syncMocksMiddleware.js +2 -2
- package/codeyam-cli/src/utils/syncMocksMiddleware.js.map +1 -1
- package/codeyam-cli/src/utils/telemetry.js +106 -0
- package/codeyam-cli/src/utils/telemetry.js.map +1 -0
- package/codeyam-cli/src/utils/telemetryMiddleware.js +22 -0
- package/codeyam-cli/src/utils/telemetryMiddleware.js.map +1 -0
- package/codeyam-cli/src/utils/testRunner.js +199 -1
- package/codeyam-cli/src/utils/testRunner.js.map +1 -1
- package/codeyam-cli/src/utils/webappDetection.js +21 -0
- package/codeyam-cli/src/utils/webappDetection.js.map +1 -1
- package/codeyam-cli/src/webserver/__tests__/buildPtyEnv.test.js +35 -0
- package/codeyam-cli/src/webserver/__tests__/buildPtyEnv.test.js.map +1 -0
- package/codeyam-cli/src/webserver/__tests__/clientErrors.test.js +107 -0
- package/codeyam-cli/src/webserver/__tests__/clientErrors.test.js.map +1 -0
- package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js +647 -0
- package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js.map +1 -0
- package/codeyam-cli/src/webserver/__tests__/idleDetector.test.js +283 -0
- package/codeyam-cli/src/webserver/__tests__/idleDetector.test.js.map +1 -0
- package/codeyam-cli/src/webserver/__tests__/stripClaudeCommand.test.js +135 -0
- package/codeyam-cli/src/webserver/__tests__/stripClaudeCommand.test.js.map +1 -0
- package/codeyam-cli/src/webserver/app/lib/clientErrors.js +86 -0
- package/codeyam-cli/src/webserver/app/lib/clientErrors.js.map +1 -0
- package/codeyam-cli/src/webserver/app/lib/git.js +397 -0
- package/codeyam-cli/src/webserver/app/lib/git.js.map +1 -0
- package/codeyam-cli/src/webserver/app/types/editor.js +8 -0
- package/codeyam-cli/src/webserver/app/types/editor.js.map +1 -0
- package/codeyam-cli/src/webserver/backgroundServer.js +60 -61
- package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/CopyButton-CLe80MMu.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-C76mRRiF.js → EntityItem-Crt_KN_U.js} +5 -5
- package/codeyam-cli/src/webserver/build/client/assets/EntityTypeBadge-CQgyEGV-.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-CobE682z.js → EntityTypeIcon-CD7lGABo.js} +9 -9
- package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-CgTNOhnu.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-CKeQT5Ty.js +25 -0
- package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-D3s1MFkb.js +3 -0
- package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-BU_OAEMP.js → LoadingDots-By5zI316.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-ceAyBX-H.js → LogViewer-CM5zg40N.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/MiniClaudeChat-CQENLSrF.js +36 -0
- package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-djPLI-WV.js → ReportIssueModal-C2PLkej3.js} +4 -4
- package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-DanvyBPb.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-B76aig_2.js → ScenarioViewer-DUMfcNVK.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/Spinner-D0LgAaSa.js +34 -0
- package/codeyam-cli/src/webserver/build/client/assets/TruncatedFilePath-CK7-NaPZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/ViewportInspectBar-BA_Ry-rs.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{_index-C96V0n15.js → _index-BAWd-Xjf.js} +4 -4
- package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-BpKzcsJz.js → activity.(_tab)-BOARiB-g.js} +8 -8
- package/codeyam-cli/src/webserver/build/client/assets/addon-canvas-DpzMmAy5.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/addon-fit-YJmn1quW.js +12 -0
- package/codeyam-cli/src/webserver/build/client/assets/{addon-web-links-Duc5hnl7.js → addon-web-links-CHx25PAe.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/addon-webgl-DI8QOUvO.js +58 -0
- package/codeyam-cli/src/webserver/build/client/assets/{agent-transcripts-D9hemwl6.js → agent-transcripts-Bg3e7q4S.js} +7 -7
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-file-diff-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-file-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-project-info-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-recapture-stale-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-rename-scenario-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-save-scenario-data-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-save-seed-state-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-coverage-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-prompt-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-schema-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-session-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{book-open-D_nMCFmP.js → book-open-CL-lMgHh.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-BH2h1Ea2.js → chevron-down-GmAjGS9-.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/chunk-JZWAC4HX-BAdwhyCx.js +43 -0
- package/codeyam-cli/src/webserver/build/client/assets/{circle-check-DyIKORY6.js → circle-check-DFcQkN5j.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{copy-NDbZjXao.js → copy-C6iF61Xs.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-4ImjHTVC.js +41 -0
- package/codeyam-cli/src/webserver/build/client/assets/cy-logo-cli-Coe5NhbS.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{cy-logo-cli-CCKUIm0S.svg → cy-logo-cli-DoA97ML3.svg} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-C8y4mmyv.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/editor._tab-Gbk_i5Js.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/editor.entity.(_sha)-DMv5ESGo.js +96 -0
- package/codeyam-cli/src/webserver/build/client/assets/editorPreview-CluPkvXJ.js +41 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-CrjR3zZW.js → entity._sha._-ByHz6rAQ.js} +14 -13
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-CmLO432x.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-Bz9sCUF_.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-DQM8E7L4.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-BMvVHNXU.js → entity._sha_.edit._scenarioId-CAoXLsQr.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{entry.client-DTvKq3TY.js → entry.client-SuW9syRS.js} +6 -6
- package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-Daa96Fr1.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/files-D-xGrg29.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/git-Bq_fbXP5.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/globals-oyPmV37k.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{index-BcvgDzbZ.js → index-Bp1l4hSv.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{index-10oVnAAH.js → index-CWV9XZiG.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/index-DE3jI_dv.js +15 -0
- package/codeyam-cli/src/webserver/build/client/assets/jsx-runtime-D_zvdyIk.js +9 -0
- package/codeyam-cli/src/webserver/build/client/assets/labs-B_IX45ih.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-BAXYRVEO.js → loader-circle-De-7qQ2u.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/manifest-1a45e154.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/memory-Cx2xEx7s.js +101 -0
- package/codeyam-cli/src/webserver/build/client/assets/{pause-DTAcYxBt.js → pause-CFxEKL1u.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/root-D2_tktnk.js +80 -0
- package/codeyam-cli/src/webserver/build/client/assets/{search-fKo7v0Zo.js → search-BdBb5aqc.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/settings-DdE-Untf.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/simulations-DSCdE99u.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{terminal-BG4heKCG.js → terminal-CrplD4b1.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-DtSmdtM4.js → triangle-alert-DqJ0j69l.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-DhXHbEjP.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-C14nCb1q.js → useLastLogLine-BNd5hYuW.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/useReportContext-Cy5Qg_UR.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/useToast-5HR2j9ZE.js +1 -0
- package/codeyam-cli/src/webserver/build/client/sound-test.html +98 -0
- package/codeyam-cli/src/webserver/build/server/assets/analysisRunner-By5slFjw.js +16 -0
- package/codeyam-cli/src/webserver/build/server/assets/index-DXaOwBnm.js +1 -0
- package/codeyam-cli/src/webserver/build/server/assets/init-CLG1LjQM.js +10 -0
- package/codeyam-cli/src/webserver/build/server/assets/progress-CHTtrxFG.js +1 -0
- package/codeyam-cli/src/webserver/build/server/assets/server-build-NZmUqQv6.js +688 -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/editorProxy.js +638 -50
- package/codeyam-cli/src/webserver/editorProxy.js.map +1 -1
- package/codeyam-cli/src/webserver/idleDetector.js +121 -0
- package/codeyam-cli/src/webserver/idleDetector.js.map +1 -0
- package/codeyam-cli/src/webserver/mockStateEvents.js +28 -0
- package/codeyam-cli/src/webserver/mockStateEvents.js.map +1 -0
- package/codeyam-cli/src/webserver/public/sound-test.html +98 -0
- package/codeyam-cli/src/webserver/scripts/codeyam-preload.mjs +242 -3
- package/codeyam-cli/src/webserver/scripts/journalCapture.ts +147 -4
- package/codeyam-cli/src/webserver/server.js +169 -16
- package/codeyam-cli/src/webserver/server.js.map +1 -1
- package/codeyam-cli/src/webserver/terminalServer.js +321 -49
- package/codeyam-cli/src/webserver/terminalServer.js.map +1 -1
- package/codeyam-cli/templates/__tests__/editor-step-hook.prompt-capture.test.ts +118 -0
- package/codeyam-cli/templates/chrome-extension-react/EXTENSION_SETUP.md +75 -0
- package/codeyam-cli/templates/chrome-extension-react/README.md +46 -0
- package/codeyam-cli/templates/chrome-extension-react/gitignore +15 -0
- package/codeyam-cli/templates/chrome-extension-react/index.html +12 -0
- package/codeyam-cli/templates/chrome-extension-react/package.json +27 -0
- package/codeyam-cli/templates/chrome-extension-react/popup.html +12 -0
- package/codeyam-cli/templates/chrome-extension-react/public/manifest.json +15 -0
- package/codeyam-cli/templates/chrome-extension-react/src/background/service-worker.ts +7 -0
- package/codeyam-cli/templates/chrome-extension-react/src/globals.css +6 -0
- package/codeyam-cli/templates/chrome-extension-react/src/lib/storage.ts +37 -0
- package/codeyam-cli/templates/chrome-extension-react/src/popup/App.tsx +12 -0
- package/codeyam-cli/templates/chrome-extension-react/src/popup/main.tsx +10 -0
- package/codeyam-cli/templates/chrome-extension-react/tsconfig.json +24 -0
- package/codeyam-cli/templates/chrome-extension-react/vite.config.ts +41 -0
- package/codeyam-cli/templates/codeyam-editor-claude.md +86 -5
- package/codeyam-cli/templates/codeyam-editor-reference.md +216 -0
- package/codeyam-cli/templates/editor-step-hook.py +262 -41
- package/codeyam-cli/templates/expo-react-native/MOBILE_SETUP.md +89 -0
- package/codeyam-cli/templates/expo-react-native/README.md +41 -0
- package/codeyam-cli/templates/expo-react-native/app/(tabs)/_layout.tsx +33 -0
- package/codeyam-cli/templates/expo-react-native/app/(tabs)/index.tsx +12 -0
- package/codeyam-cli/templates/expo-react-native/app/(tabs)/settings.tsx +12 -0
- package/codeyam-cli/templates/expo-react-native/app/_layout.tsx +12 -0
- package/codeyam-cli/templates/expo-react-native/app.json +18 -0
- package/codeyam-cli/templates/expo-react-native/babel.config.js +9 -0
- package/codeyam-cli/templates/expo-react-native/gitignore +12 -0
- package/codeyam-cli/templates/expo-react-native/global.css +3 -0
- package/codeyam-cli/templates/expo-react-native/lib/storage.ts +32 -0
- package/codeyam-cli/templates/expo-react-native/metro.config.js +6 -0
- package/codeyam-cli/templates/expo-react-native/nativewind-env.d.ts +1 -0
- package/codeyam-cli/templates/expo-react-native/package.json +38 -0
- package/codeyam-cli/templates/expo-react-native/tailwind.config.js +10 -0
- package/codeyam-cli/templates/expo-react-native/tsconfig.json +10 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/AUTH_PATTERNS.md +308 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/AUTH_UPGRADE.md +304 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/DATABASE.md +126 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/FEATURE_PATTERNS.md +37 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/README.md +53 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/app/codeyam-isolate/layout.tsx +12 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/app/lib/prisma.ts +9 -4
- package/codeyam-cli/templates/nextjs-prisma-sqlite/env +4 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/gitignore +21 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/package.json +6 -2
- package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma/seed.ts +4 -1
- package/codeyam-cli/templates/nextjs-prisma-sqlite/seed-adapter.ts +135 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/vitest.config.ts +13 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/README.md +52 -0
- package/codeyam-cli/templates/{nextjs-prisma-sqlite/PRISMA_SETUP.md → nextjs-prisma-supabase/SUPABASE_SETUP.md} +37 -17
- package/codeyam-cli/templates/nextjs-prisma-supabase/app/api/todos/route.ts +17 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/app/globals.css +26 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/app/layout.tsx +34 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/app/lib/prisma.ts +20 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/app/lib/supabase.ts +12 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/app/page.tsx +10 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/env +9 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/eslint.config.mjs +11 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/gitignore +40 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/next.config.ts +11 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/package.json +37 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/postcss.config.mjs +7 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/prisma/schema.prisma +27 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/prisma/seed.ts +39 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/prisma.config.ts +12 -0
- package/codeyam-cli/templates/nextjs-prisma-supabase/tsconfig.json +34 -0
- package/codeyam-cli/templates/seed-adapters/supabase.ts +282 -0
- package/codeyam-cli/templates/skills/codeyam-dev-mode/SKILL.md +2 -2
- package/codeyam-cli/templates/skills/codeyam-editor/SKILL.md +177 -17
- package/codeyam-cli/templates/skills/codeyam-memory/SKILL.md +10 -10
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/detect-deprecated-patterns.mjs +139 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/find-exports.mjs +52 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/read-json-field.mjs +61 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/ripgrep-fallback.mjs +155 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/cleanup.mjs +13 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/filter-session.mjs +95 -0
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/preprocess.mjs +160 -0
- package/package.json +16 -10
- package/packages/ai/src/lib/astScopes/methodSemantics.js +99 -0
- package/packages/ai/src/lib/astScopes/methodSemantics.js.map +1 -1
- package/packages/ai/src/lib/astScopes/nodeToSource.js +16 -0
- package/packages/ai/src/lib/astScopes/nodeToSource.js.map +1 -1
- package/packages/ai/src/lib/astScopes/paths.js +12 -3
- package/packages/ai/src/lib/astScopes/paths.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +27 -10
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/ParentScopeManager.js +9 -2
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/ParentScopeManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js +14 -4
- package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js.map +1 -1
- package/packages/ai/src/lib/generateExecutionFlows.js +0 -11
- package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -1
- package/packages/analyze/index.js +1 -1
- package/packages/analyze/index.js.map +1 -1
- package/packages/analyze/src/lib/ProjectAnalyzer.js +10 -4
- package/packages/analyze/src/lib/ProjectAnalyzer.js.map +1 -1
- package/packages/analyze/src/lib/asts/index.js +4 -2
- package/packages/analyze/src/lib/asts/index.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +16 -2
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +6 -26
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js +3 -2
- package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js +9 -7
- package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.js +14 -0
- package/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js +44 -11
- package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeChange.js +1 -0
- package/packages/analyze/src/lib/files/analyzeChange.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeInitial.js +1 -0
- package/packages/analyze/src/lib/files/analyzeInitial.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeNextRoute.js +5 -1
- package/packages/analyze/src/lib/files/analyzeNextRoute.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +120 -28
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js +0 -40
- package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +1368 -1193
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
- package/packages/database/src/lib/kysely/tables/editorScenariosTable.js +104 -0
- package/packages/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -1
- package/packages/database/src/lib/loadAnalysis.js +1 -1
- package/packages/database/src/lib/loadAnalysis.js.map +1 -1
- package/packages/database/src/lib/loadEntities.js +0 -6
- package/packages/database/src/lib/loadEntities.js.map +1 -1
- package/packages/database/src/lib/loadEntity.js +5 -5
- package/packages/database/src/lib/loadEntity.js.map +1 -1
- package/packages/database/src/lib/updateCommitMetadata.js +0 -25
- package/packages/database/src/lib/updateCommitMetadata.js.map +1 -1
- package/packages/types/src/enums/ProjectFramework.js +2 -0
- package/packages/types/src/enums/ProjectFramework.js.map +1 -1
- package/packages/utils/src/lib/fs/rsyncCopy.js +22 -1
- package/packages/utils/src/lib/fs/rsyncCopy.js.map +1 -1
- package/scripts/npm-post-install.cjs +22 -0
- package/codeyam-cli/src/webserver/build/client/assets/CopyButton-DmJveP3T.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityTypeBadge-g3saevPb.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-Bu6c6aDe.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-DYFW3lDD.js +0 -25
- package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-DLeucoVX.js +0 -3
- package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-BED4B6sP.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/Spinner-Bb5uFQ5V.js +0 -34
- package/codeyam-cli/src/webserver/build/client/assets/Terminal-wkqC0AQk.js +0 -41
- package/codeyam-cli/src/webserver/build/client/assets/TruncatedFilePath-C8OKAR5x.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/addon-fit-CUXOrorO.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/chunk-JZWAC4HX-C4pqxYJB.js +0 -51
- package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-CMT1jU2q.js +0 -21
- package/codeyam-cli/src/webserver/build/client/assets/cy-logo-cli-DcX-ZS3p.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-BiM6z3Do.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/editor-CdjF_fX6.js +0 -8
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-D8ILZMR0.js +0 -6
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-C28BiQzt.js +0 -6
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-p9hhkjJM.js +0 -6
- package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-cPo8LiG3.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/files-DO4CZ16O.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/git-CFCTYk9I.js +0 -15
- package/codeyam-cli/src/webserver/build/client/assets/globals-B17TBSS6.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/labs-Zk7ryIM1.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-b8fd6b07.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/memory-FweZHj5U.js +0 -93
- package/codeyam-cli/src/webserver/build/client/assets/root-DUKqhFlb.js +0 -67
- package/codeyam-cli/src/webserver/build/client/assets/settings-DfuTtcJP.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/simulations-B3aOzpCZ.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-ByhSyh0W.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useReportContext-O-jkvSPx.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useToast-9FIWuYfK.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/index-BLhjL9Xi.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-DyMuI5mU.js +0 -363
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/detect-deprecated-patterns.sh +0 -108
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/find-exports.sh +0 -69
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/cleanup.sh +0 -12
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/filter.jq +0 -45
- package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/preprocess.sh +0 -139
|
@@ -5,6 +5,100 @@ import fs from 'fs';
|
|
|
5
5
|
import path from 'path';
|
|
6
6
|
import * as pty from 'node-pty';
|
|
7
7
|
import { createMarkerTransformer } from "../utils/scenarioMarkers.js";
|
|
8
|
+
import { IdleDetector } from "./idleDetector.js";
|
|
9
|
+
import { mockStateEventEmitter } from "./mockStateEvents.js";
|
|
10
|
+
/**
|
|
11
|
+
* Strip the raw `claude ...` shell command from suppressed PTY output
|
|
12
|
+
* so it doesn't leak to the user in the fallback timeout path.
|
|
13
|
+
*/
|
|
14
|
+
export function stripClaudeCommand(output) {
|
|
15
|
+
// Find the line containing the claude command and strip everything before
|
|
16
|
+
// and including it (shell prompt, ANSI codes, command echo). Preserve any
|
|
17
|
+
// real output that follows.
|
|
18
|
+
const idx = output.indexOf('claude ');
|
|
19
|
+
if (idx === -1)
|
|
20
|
+
return output;
|
|
21
|
+
// Find the end of the command line (\r or \n after "claude")
|
|
22
|
+
let end = idx;
|
|
23
|
+
while (end < output.length && output[end] !== '\r' && output[end] !== '\n') {
|
|
24
|
+
end++;
|
|
25
|
+
}
|
|
26
|
+
// Skip past trailing \r\n
|
|
27
|
+
while (end < output.length &&
|
|
28
|
+
(output[end] === '\r' || output[end] === '\n')) {
|
|
29
|
+
end++;
|
|
30
|
+
}
|
|
31
|
+
// Strip leading ANSI escape sequences from the remainder
|
|
32
|
+
// (e.g. bracketed paste mode toggles like \x1b[?2004l)
|
|
33
|
+
let rest = output.slice(end);
|
|
34
|
+
rest = rest.replace(/^(\x1b\[[\x20-\x3f]*[\x40-\x7e]|\x1b[()][A-Z0-9])*/, '');
|
|
35
|
+
return rest;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Detect whether a PTY output chunk contains Claude Code's welcome banner.
|
|
39
|
+
* Supports both the old box-drawing format (`╭─── Claude Code ───╮`)
|
|
40
|
+
* and the new block-art format (`▐▛███▜▌ Claude Code`).
|
|
41
|
+
*/
|
|
42
|
+
export function isBannerChunk(data) {
|
|
43
|
+
// Strip ANSI escape sequences before checking — Claude Code's Ink renderer
|
|
44
|
+
// inserts SGR color codes between the banner characters (e.g. ▐\x1b[48;5;16m▛).
|
|
45
|
+
const plain = data.replace(/\x1b\[[0-9;?]*[A-Za-z]|\x1b\][^\x07]*\x07|\x1b[()][A-Z0-9]/g, '');
|
|
46
|
+
return plain.includes('╭') || plain.includes('▐▛');
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Determine whether the startup output filter should be active.
|
|
50
|
+
* The filter strips the raw `claude --session-id ...` command from the
|
|
51
|
+
* terminal so the user never sees it.
|
|
52
|
+
*/
|
|
53
|
+
export function shouldFilterStartup(opts) {
|
|
54
|
+
return opts.hasContext || opts.editorMode;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Manages PTY output suppression during Claude startup.
|
|
58
|
+
*
|
|
59
|
+
* Suppresses all output until the welcome banner arrives, then clears
|
|
60
|
+
* the screen. The claude command is stripped from any chunk that is forwarded
|
|
61
|
+
* (both the banner chunk on the normal path and the buffered output on the
|
|
62
|
+
* fallback timeout path).
|
|
63
|
+
*/
|
|
64
|
+
export class StartupOutputFilter {
|
|
65
|
+
constructor() {
|
|
66
|
+
this.hasClearedScreen = false;
|
|
67
|
+
this.suppressedOutput = '';
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Process a PTY data chunk. Returns an object describing what action to take:
|
|
71
|
+
* - `type: 'suppress'` — buffer the chunk, send nothing
|
|
72
|
+
* - `type: 'clear-and-send'` — clear screen, then send `data`
|
|
73
|
+
* - `type: 'send'` — send `data` as-is (post-startup)
|
|
74
|
+
*/
|
|
75
|
+
processChunk(data) {
|
|
76
|
+
if (!this.hasClearedScreen && isBannerChunk(data)) {
|
|
77
|
+
this.hasClearedScreen = true;
|
|
78
|
+
const cleaned = stripClaudeCommand(data);
|
|
79
|
+
return { type: 'clear-and-send', data: cleaned };
|
|
80
|
+
}
|
|
81
|
+
if (!this.hasClearedScreen) {
|
|
82
|
+
this.suppressedOutput += data;
|
|
83
|
+
return { type: 'suppress' };
|
|
84
|
+
}
|
|
85
|
+
return { type: 'send', data };
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Called when the fallback timeout fires (╭ never arrived).
|
|
89
|
+
* Returns the buffered output with the command stripped, or null if
|
|
90
|
+
* the screen was already cleared.
|
|
91
|
+
*/
|
|
92
|
+
getTimeoutOutput() {
|
|
93
|
+
if (this.hasClearedScreen)
|
|
94
|
+
return null;
|
|
95
|
+
this.hasClearedScreen = true;
|
|
96
|
+
if (this.suppressedOutput.length === 0)
|
|
97
|
+
return null;
|
|
98
|
+
const cleaned = stripClaudeCommand(this.suppressedOutput);
|
|
99
|
+
return cleaned.length > 0 ? cleaned : null;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
8
102
|
// Use globalThis so the sessions Set is shared across module instances.
|
|
9
103
|
// In Vite dev mode, this file is loaded twice: once by the Vite plugin (Node.js native)
|
|
10
104
|
// and once by the SSR context (ssrLoadModule). Without globalThis, each instance
|
|
@@ -52,7 +146,7 @@ const ENV_PASSTHROUGH_KEYS = [
|
|
|
52
146
|
'HOMEBREW_CELLAR',
|
|
53
147
|
'HOMEBREW_REPOSITORY',
|
|
54
148
|
];
|
|
55
|
-
function buildPtyEnv() {
|
|
149
|
+
export function buildPtyEnv(options) {
|
|
56
150
|
const env = {};
|
|
57
151
|
for (const key of ENV_PASSTHROUGH_KEYS) {
|
|
58
152
|
const val = process.env[key];
|
|
@@ -62,6 +156,11 @@ function buildPtyEnv() {
|
|
|
62
156
|
// Always set TERM for proper terminal behavior
|
|
63
157
|
if (!env.TERM)
|
|
64
158
|
env.TERM = 'xterm-256color';
|
|
159
|
+
// Signal to hooks that this is an editor Build session.
|
|
160
|
+
// Without this, editor hooks fire in ALL Claude sessions in the project.
|
|
161
|
+
if (options?.editorMode) {
|
|
162
|
+
env.CODEYAM_EDITOR_ACTIVE = '1';
|
|
163
|
+
}
|
|
65
164
|
return env;
|
|
66
165
|
}
|
|
67
166
|
/**
|
|
@@ -190,7 +289,7 @@ function writeDevModeContext(ctx) {
|
|
|
190
289
|
// Server
|
|
191
290
|
const serverPort = process.env.CODEYAM_PORT || '3111';
|
|
192
291
|
lines.push('## Server');
|
|
193
|
-
lines.push(`- **Refresh preview:** \`curl -X POST http://localhost:${serverPort}/api/dev-mode-preview
|
|
292
|
+
lines.push(`- **Refresh preview:** \`curl -X POST http://localhost:${serverPort}/api/dev-mode-preview -H 'Content-Type: application/json' -d '{"dimension":"Desktop"}'\` (dimension is REQUIRED)`);
|
|
194
293
|
lines.push('');
|
|
195
294
|
fs.writeFileSync(contextPath, lines.join('\n'), 'utf8');
|
|
196
295
|
return true;
|
|
@@ -227,9 +326,15 @@ function writeEditorModeContext(ctx) {
|
|
|
227
326
|
`- **Proxy:** http://localhost:${proxyPort} (used by the browser iframe only — do NOT use for health checks)`,
|
|
228
327
|
'',
|
|
229
328
|
'## Workflow',
|
|
230
|
-
'- **Guided steps:** Run `codeyam editor` for the next step (plan → prototype → confirm → deconstruct → extract → glossary → analyze → app scenarios → user scenarios → verify → review)',
|
|
231
|
-
'- Each feature follows
|
|
232
|
-
'-
|
|
329
|
+
'- **Guided steps:** Run `codeyam editor steps` for the next step (plan → prepare → prototype → verify prototype → confirm → deconstruct → extract → glossary → analyze → app scenarios → user scenarios → verify → journal → review → present → commit → finalize → push)',
|
|
330
|
+
'- Each feature follows 18 steps — run `codeyam editor steps` to see what to do next. Never expose `codeyam editor` commands to the user.',
|
|
331
|
+
'- **Run ONE step at a time.** Read the FULL output, complete every checklist item, then advance. NEVER batch-run steps in a loop or delegate them to a subagent.',
|
|
332
|
+
'- Steps 1, 5, 15, and 18 require user confirmation before proceeding',
|
|
333
|
+
'',
|
|
334
|
+
'## Preview Updates',
|
|
335
|
+
'- **Refresh the preview frequently** — the user watches the preview as you work. Refresh after every meaningful change (new page, UI section, data seeding, styling), not just at the end.',
|
|
336
|
+
`- **Refresh command:** \`curl -s -X POST http://localhost:${serverPort}/api/dev-mode-preview -H 'Content-Type: application/json' -d '{"dimension":"Desktop"}'\` (dimension is REQUIRED)`,
|
|
337
|
+
'- Aim for 4-8+ preview updates during a typical building session.',
|
|
233
338
|
'',
|
|
234
339
|
'## Verifying the Dev Server',
|
|
235
340
|
'- Get the dev server URL: `curl -s http://localhost:' +
|
|
@@ -242,9 +347,9 @@ function writeEditorModeContext(ctx) {
|
|
|
242
347
|
' for health** — the proxy returns 200 even when the app is broken',
|
|
243
348
|
'',
|
|
244
349
|
'## API Endpoints',
|
|
245
|
-
`- **Register scenario (auto-captures screenshot):** \`codeyam editor register '{"name":"...","
|
|
350
|
+
`- **Register scenario (auto-captures screenshot):** \`codeyam editor register '{"name":"...","url":"/page-to-screenshot","type":"application","seed":{...}}'\` — ALWAYS include "url" for the page to screenshot. For large payloads, write JSON to a file and use @ prefix: \`codeyam editor register @/tmp/scenario.json\``,
|
|
246
351
|
`- **Get active scenario data:** \`curl http://localhost:${serverPort}/api/editor-scenario-data\``,
|
|
247
|
-
`- **Refresh/navigate preview:** \`curl -X POST http://localhost:${serverPort}/api/dev-mode-preview\` (
|
|
352
|
+
`- **Refresh/navigate/switch preview:** \`curl -X POST http://localhost:${serverPort}/api/dev-mode-preview -H 'Content-Type: application/json' -d '{"dimension":"Desktop"}'\` (dimension is REQUIRED in every call; add \`"path":"/route"\` to navigate; add \`"scenarioId":"..."\` to switch scenario). Clears logs, waits for HMR, checks SSR health.`,
|
|
248
353
|
`- **Refresh config:** \`curl -X POST http://localhost:${serverPort}/api/editor-refresh\` (also starts dev server if a webapp is detected)`,
|
|
249
354
|
`- **Dev server status:** \`curl http://localhost:${serverPort}/api/editor-dev-server\``,
|
|
250
355
|
`- **Start dev server:** \`curl -X POST http://localhost:${serverPort}/api/editor-dev-server -H 'Content-Type: application/json' -d '{"action":"start"}'\``,
|
|
@@ -261,17 +366,19 @@ function writeEditorModeContext(ctx) {
|
|
|
261
366
|
'- POST/PUT/DELETE always go through to the real dev server',
|
|
262
367
|
'',
|
|
263
368
|
'## Component Isolation Routes',
|
|
264
|
-
'-
|
|
265
|
-
' -
|
|
266
|
-
'
|
|
369
|
+
'- Create isolation route dirs: `codeyam editor isolate ComponentA ComponentB ...`',
|
|
370
|
+
' - This creates the layout guard and a directory per component under `app/isolated-components/`',
|
|
371
|
+
'- Create ONE isolation route page per component:',
|
|
372
|
+
' - **Remix:** `app/routes/isolated-components.ComponentName.tsx` → `/isolated-components/ComponentName`',
|
|
373
|
+
' - **Next.js:** `app/isolated-components/ComponentName/page.tsx` → `/isolated-components/ComponentName`',
|
|
267
374
|
'- The route defines a `scenarios` object mapping scenario names to props, reads `?s=ScenarioName` from the URL, and renders the component',
|
|
268
|
-
'- Wrap the component in a centered container: `<div style="display:flex;justify-content:center;align-items:center;min-height:100vh
|
|
375
|
+
'- Wrap the component in a centered container: `<div style="display:flex;justify-content:center;align-items:center;min-height:100vh"><div style="width:100%;max-width:...">` — set max-width to match the component\'s real container (e.g. card in 3-col grid → 24rem)',
|
|
269
376
|
'- **Create multiple scenarios per component** (like tests): default/happy path, edge cases (empty data, long text, max items), different visual states (loading, error, disabled)',
|
|
270
|
-
'- Register each scenario: `codeyam editor register \'{"name":"ComponentName - Scenario","componentName":"ComponentName","componentPath":"path/to/file.tsx","url":"/
|
|
377
|
+
'- Register each scenario: `codeyam editor register \'{"name":"ComponentName - Scenario","componentName":"ComponentName","componentPath":"path/to/file.tsx","url":"/isolated-components/ComponentName?s=Scenario","mockData":{"routes":{"/api/...":{"body":[...]}}}}\'`',
|
|
271
378
|
'- The url is a PATH, not a full URL — the proxy appends it and intercepts API calls the component makes',
|
|
272
379
|
'- `mockData.routes` provides data for any API calls the component makes internally (omit if none)',
|
|
273
380
|
'- Isolation routes stay in the project so the editor preview can display them',
|
|
274
|
-
'- Ensure `.gitignore` includes `**/
|
|
381
|
+
'- Ensure `.gitignore` includes `**/isolated-components*` so they are not committed',
|
|
275
382
|
'',
|
|
276
383
|
'## Files',
|
|
277
384
|
'- **Scenario data:** .codeyam/editor-scenarios/{scenario-id}.json',
|
|
@@ -285,7 +392,7 @@ function writeEditorModeContext(ctx) {
|
|
|
285
392
|
const hasPackageJson = fs.existsSync(path.join(codeyamRoot, 'package.json'));
|
|
286
393
|
if (!hasPackageJson) {
|
|
287
394
|
lines.push('## Status');
|
|
288
|
-
lines.push('- **Empty project** — no package.json found.
|
|
395
|
+
lines.push('- **Empty project** — no package.json found. Run `codeyam editor steps` to begin.');
|
|
289
396
|
lines.push('');
|
|
290
397
|
}
|
|
291
398
|
fs.writeFileSync(contextPath, lines.join('\n'), 'utf8');
|
|
@@ -325,6 +432,12 @@ export function attachTerminalServer(httpServer) {
|
|
|
325
432
|
}
|
|
326
433
|
}, PING_INTERVAL_MS);
|
|
327
434
|
globalThis.__codeyamPingInterval = pingInterval;
|
|
435
|
+
// Subscribe to mock state events and broadcast to all terminal clients
|
|
436
|
+
mockStateEventEmitter.on('event', (event) => {
|
|
437
|
+
if (event.type === 'data-mutation-forwarded') {
|
|
438
|
+
broadcastDataMutationForwarded(event.method, event.pathname);
|
|
439
|
+
}
|
|
440
|
+
});
|
|
328
441
|
wss.on('connection', (ws, req) => {
|
|
329
442
|
// Parse entity context from query params
|
|
330
443
|
const url = new URL(req.url || '', `http://${req.headers.host}`);
|
|
@@ -338,6 +451,9 @@ export function attachTerminalServer(httpServer) {
|
|
|
338
451
|
const projectSlug = url.searchParams.get('projectSlug') || '';
|
|
339
452
|
const editorMode = url.searchParams.get('editorMode') === 'true';
|
|
340
453
|
const reconnectId = url.searchParams.get('reconnectId') || '';
|
|
454
|
+
const claudeStartMode = url.searchParams.get('claudeStartMode') || '';
|
|
455
|
+
const claudeSessionId = url.searchParams.get('claudeSessionId') || '';
|
|
456
|
+
const editorStepLabel = url.searchParams.get('editorStepLabel') || '';
|
|
341
457
|
// --- Reconnection: reattach to a detached PTY ---
|
|
342
458
|
if (reconnectId && detachedPtys.has(reconnectId)) {
|
|
343
459
|
const detached = detachedPtys.get(reconnectId);
|
|
@@ -364,13 +480,27 @@ export function attachTerminalServer(httpServer) {
|
|
|
364
480
|
let detachedFlag = false;
|
|
365
481
|
const reconnectPort = process.env.CODEYAM_PORT || '3111';
|
|
366
482
|
const reconnectTransformMarkers = createMarkerTransformer(reconnectPort);
|
|
483
|
+
const reconnectIdleDetector = new IdleDetector({
|
|
484
|
+
onIdle: () => {
|
|
485
|
+
if (ws.readyState === WebSocket.OPEN) {
|
|
486
|
+
console.log('[terminalServer] Sending claude-idle (reconnected)');
|
|
487
|
+
ws.send(JSON.stringify({ type: 'claude-idle' }));
|
|
488
|
+
}
|
|
489
|
+
},
|
|
490
|
+
onActive: () => {
|
|
491
|
+
if (ws.readyState === WebSocket.OPEN) {
|
|
492
|
+
console.log('[terminalServer] Sending claude-active (reconnected)');
|
|
493
|
+
ws.send(JSON.stringify({ type: 'claude-active' }));
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
}, { activeOutputPattern: /[✶✢·◼]/ });
|
|
367
497
|
detached.ptyProcess.onData((data) => {
|
|
368
498
|
if (detachedFlag)
|
|
369
499
|
return; // Superseded by a newer listener
|
|
370
500
|
if (ws.readyState === WebSocket.OPEN) {
|
|
371
501
|
if (!detached.hasClearedScreen &&
|
|
372
502
|
detached.hasContext &&
|
|
373
|
-
data
|
|
503
|
+
isBannerChunk(data)) {
|
|
374
504
|
detached.hasClearedScreen = true;
|
|
375
505
|
ws.send(JSON.stringify({ type: 'output', data: '\x1b[2J\x1b[H' }));
|
|
376
506
|
}
|
|
@@ -378,14 +508,12 @@ export function attachTerminalServer(httpServer) {
|
|
|
378
508
|
if (transformed.length > 0) {
|
|
379
509
|
ws.send(JSON.stringify({ type: 'output', data: transformed }));
|
|
380
510
|
}
|
|
381
|
-
|
|
382
|
-
if (stripped.includes('Editor Mode \u2014')) {
|
|
383
|
-
console.log('[terminalServer] Detected claude-idle signal (reconnect)');
|
|
384
|
-
ws.send(JSON.stringify({ type: 'claude-idle' }));
|
|
385
|
-
}
|
|
511
|
+
reconnectIdleDetector.onPtyOutput(data);
|
|
386
512
|
}
|
|
387
513
|
});
|
|
388
514
|
detached.ptyProcess.onExit(() => {
|
|
515
|
+
console.log('[terminalServer] PTY exited (reconnected), flushing idle state');
|
|
516
|
+
reconnectIdleDetector.disposeAndFlush();
|
|
389
517
|
sessions.delete(session);
|
|
390
518
|
if (ws.readyState === WebSocket.OPEN) {
|
|
391
519
|
ws.close();
|
|
@@ -396,6 +524,7 @@ export function attachTerminalServer(httpServer) {
|
|
|
396
524
|
try {
|
|
397
525
|
const msg = JSON.parse(raw.toString());
|
|
398
526
|
if (msg.type === 'input') {
|
|
527
|
+
reconnectIdleDetector.onUserInput();
|
|
399
528
|
detached.ptyProcess.write(msg.data);
|
|
400
529
|
}
|
|
401
530
|
else if (msg.type === 'resize' && msg.cols && msg.rows) {
|
|
@@ -428,7 +557,7 @@ export function attachTerminalServer(httpServer) {
|
|
|
428
557
|
cols: 120,
|
|
429
558
|
rows: 30,
|
|
430
559
|
cwd: safeCwd,
|
|
431
|
-
env: buildPtyEnv(),
|
|
560
|
+
env: buildPtyEnv({ editorMode }),
|
|
432
561
|
});
|
|
433
562
|
}
|
|
434
563
|
catch (error) {
|
|
@@ -468,9 +597,41 @@ export function attachTerminalServer(httpServer) {
|
|
|
468
597
|
projectSlug,
|
|
469
598
|
});
|
|
470
599
|
let hasClearedScreen = false;
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
600
|
+
const filterStartup = shouldFilterStartup({ hasContext, editorMode });
|
|
601
|
+
const startupFilter = filterStartup ? new StartupOutputFilter() : null;
|
|
602
|
+
// Safety timeout: stop suppressing output after 5s even if ╭ never arrives.
|
|
603
|
+
// Prevents "Starting Claude..." hanging forever if the banner format changes.
|
|
604
|
+
if (filterStartup) {
|
|
605
|
+
setTimeout(() => {
|
|
606
|
+
const output = startupFilter.getTimeoutOutput();
|
|
607
|
+
if (output !== null) {
|
|
608
|
+
hasClearedScreen = true;
|
|
609
|
+
console.log('[terminalServer] Suppression timeout — showing output');
|
|
610
|
+
if (ws.readyState === WebSocket.OPEN) {
|
|
611
|
+
// Clear the "Starting Claude..." message
|
|
612
|
+
ws.send(JSON.stringify({ type: 'output', data: '\x1b[2J\x1b[H' }));
|
|
613
|
+
const transformed = transformMarkers(output);
|
|
614
|
+
if (transformed.length > 0) {
|
|
615
|
+
ws.send(JSON.stringify({ type: 'output', data: transformed }));
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
}, 5000);
|
|
620
|
+
}
|
|
621
|
+
const idleDetector = new IdleDetector({
|
|
622
|
+
onIdle: () => {
|
|
623
|
+
if (ws.readyState === WebSocket.OPEN) {
|
|
624
|
+
console.log('[terminalServer] Sending claude-idle');
|
|
625
|
+
ws.send(JSON.stringify({ type: 'claude-idle' }));
|
|
626
|
+
}
|
|
627
|
+
},
|
|
628
|
+
onActive: () => {
|
|
629
|
+
if (ws.readyState === WebSocket.OPEN) {
|
|
630
|
+
console.log('[terminalServer] Sending claude-active');
|
|
631
|
+
ws.send(JSON.stringify({ type: 'claude-active' }));
|
|
632
|
+
}
|
|
633
|
+
},
|
|
634
|
+
}, { activeOutputPattern: /[✶✢·◼]/ });
|
|
474
635
|
// PTY output -> WebSocket
|
|
475
636
|
const serverPort = process.env.CODEYAM_PORT || '3111';
|
|
476
637
|
// Stateful transformer that buffers partial {{scenario:...}} markers
|
|
@@ -478,35 +639,37 @@ export function attachTerminalServer(httpServer) {
|
|
|
478
639
|
const transformMarkers = createMarkerTransformer(serverPort);
|
|
479
640
|
ptyProcess.onData((data) => {
|
|
480
641
|
if (ws.readyState === WebSocket.OPEN) {
|
|
481
|
-
//
|
|
482
|
-
// clear
|
|
483
|
-
if (
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
const combined = idleDetectBuffer + stripped;
|
|
498
|
-
if (combined.includes(IDLE_MARKER)) {
|
|
499
|
-
console.log('[terminalServer] Detected claude-idle signal');
|
|
500
|
-
ws.send(JSON.stringify({ type: 'claude-idle' }));
|
|
501
|
-
idleDetectBuffer = '';
|
|
642
|
+
// During startup, suppress output until Claude's welcome banner (╭)
|
|
643
|
+
// arrives, then clear screen and strip the raw command from the chunk.
|
|
644
|
+
if (startupFilter && !hasClearedScreen) {
|
|
645
|
+
const result = startupFilter.processChunk(data);
|
|
646
|
+
if (result.type === 'clear-and-send') {
|
|
647
|
+
hasClearedScreen = true;
|
|
648
|
+
ws.send(JSON.stringify({ type: 'output', data: '\x1b[2J\x1b[H' }));
|
|
649
|
+
if (result.data.length > 0) {
|
|
650
|
+
const transformed = transformMarkers(result.data);
|
|
651
|
+
if (transformed.length > 0) {
|
|
652
|
+
ws.send(JSON.stringify({ type: 'output', data: transformed }));
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
idleDetector.onPtyOutput(data);
|
|
656
|
+
}
|
|
657
|
+
// type === 'suppress': skip sending and idle detection
|
|
502
658
|
}
|
|
503
659
|
else {
|
|
504
|
-
//
|
|
505
|
-
|
|
660
|
+
// Transform {{scenario:Name:ID}} markers into OSC 8 clickable hyperlinks.
|
|
661
|
+
// Uses stateful buffering to handle markers split across PTY chunks.
|
|
662
|
+
const transformed = transformMarkers(data);
|
|
663
|
+
if (transformed.length > 0) {
|
|
664
|
+
ws.send(JSON.stringify({ type: 'output', data: transformed }));
|
|
665
|
+
}
|
|
666
|
+
idleDetector.onPtyOutput(data);
|
|
506
667
|
}
|
|
507
668
|
}
|
|
508
669
|
});
|
|
509
670
|
ptyProcess.onExit(() => {
|
|
671
|
+
console.log('[terminalServer] PTY exited, flushing idle state');
|
|
672
|
+
idleDetector.disposeAndFlush();
|
|
510
673
|
sessions.delete(session);
|
|
511
674
|
// Also clean up from detachedPtys if it was detached
|
|
512
675
|
if (detachedPtys.has(sessionId)) {
|
|
@@ -522,6 +685,7 @@ export function attachTerminalServer(httpServer) {
|
|
|
522
685
|
try {
|
|
523
686
|
const msg = JSON.parse(raw.toString());
|
|
524
687
|
if (msg.type === 'input') {
|
|
688
|
+
idleDetector.onUserInput();
|
|
525
689
|
ptyProcess.write(msg.data);
|
|
526
690
|
}
|
|
527
691
|
else if (msg.type === 'resize' && msg.cols && msg.rows) {
|
|
@@ -539,11 +703,54 @@ export function attachTerminalServer(httpServer) {
|
|
|
539
703
|
ws.on('close', () => {
|
|
540
704
|
detachSession(session, hasContext, hasClearedScreen);
|
|
541
705
|
});
|
|
706
|
+
// Show a loading indicator while Claude Code starts up.
|
|
707
|
+
// PTY output is suppressed until Claude's welcome banner (╭) appears
|
|
708
|
+
// and triggers a screen clear, so the user never sees the raw command.
|
|
709
|
+
if (filterStartup) {
|
|
710
|
+
ws.send(JSON.stringify({
|
|
711
|
+
type: 'output',
|
|
712
|
+
data: '\x1b[2J\x1b[H\r\n\x1b[90m Starting Claude...\x1b[0m\r\n',
|
|
713
|
+
}));
|
|
714
|
+
}
|
|
542
715
|
// Start Claude Code with the appropriate skill.
|
|
543
716
|
// Using a skill avoids shell escaping issues and multi-line paste detection.
|
|
717
|
+
//
|
|
718
|
+
// Session recovery modes (editor only):
|
|
719
|
+
// resume + sessionId → claude --resume <uuid> (resumes exact conversation)
|
|
720
|
+
// resume, no sessionId → claude --continue (fallback for pre-existing sessions)
|
|
721
|
+
// fresh → generate UUID, write to .codeyam/claude-session-id.txt,
|
|
722
|
+
// launch claude --session-id <uuid> '/codeyam-editor'
|
|
723
|
+
//
|
|
724
|
+
// The UUID is generated HERE (not in printStep1) so it's available before
|
|
725
|
+
// Claude launches. printStep1 runs inside the session — too late.
|
|
544
726
|
setTimeout(() => {
|
|
545
727
|
if (editorMode && hasContext) {
|
|
546
|
-
|
|
728
|
+
if (claudeStartMode === 'resume' && claudeSessionId) {
|
|
729
|
+
const resumePrompt = editorStepLabel === 'Present'
|
|
730
|
+
? 'The session was interrupted. Please rerun show-results.'
|
|
731
|
+
: 'The session was interrupted. Please continue where you left off.';
|
|
732
|
+
ptyProcess.write(`claude --resume '${claudeSessionId}' '${resumePrompt}'\r`);
|
|
733
|
+
}
|
|
734
|
+
else if (claudeStartMode === 'resume') {
|
|
735
|
+
// No session ID available — fall back to most recent session
|
|
736
|
+
const resumePrompt = editorStepLabel === 'Present'
|
|
737
|
+
? 'The session was interrupted. Please rerun show-results.'
|
|
738
|
+
: 'The session was interrupted. Please continue where you left off.';
|
|
739
|
+
ptyProcess.write(`claude --continue '${resumePrompt}'\r`);
|
|
740
|
+
}
|
|
741
|
+
else {
|
|
742
|
+
// Fresh session: generate a trackable UUID
|
|
743
|
+
const newSessionId = crypto.randomUUID();
|
|
744
|
+
const sessionIdPath = path.join(cwd, '.codeyam', 'claude-session-id.txt');
|
|
745
|
+
try {
|
|
746
|
+
fs.mkdirSync(path.dirname(sessionIdPath), { recursive: true });
|
|
747
|
+
fs.writeFileSync(sessionIdPath, newSessionId, 'utf8');
|
|
748
|
+
}
|
|
749
|
+
catch (err) {
|
|
750
|
+
console.error('[terminalServer] Failed to write claude-session-id.txt:', err);
|
|
751
|
+
}
|
|
752
|
+
ptyProcess.write(`claude --session-id '${newSessionId}' '/codeyam-editor'\r`);
|
|
753
|
+
}
|
|
547
754
|
}
|
|
548
755
|
else if (hasContext) {
|
|
549
756
|
ptyProcess.write("claude '/codeyam-dev-mode'\r");
|
|
@@ -599,10 +806,36 @@ function detachSession(session, hasContext = false, hasClearedScreen = false) {
|
|
|
599
806
|
* Send a refresh-preview message to all connected terminal WebSocket clients.
|
|
600
807
|
* The Terminal component relays this to the parent page to reload the iframe.
|
|
601
808
|
*/
|
|
602
|
-
export function broadcastPreviewRefresh(path) {
|
|
809
|
+
export function broadcastPreviewRefresh(path, scenarioId) {
|
|
603
810
|
const msg = JSON.stringify({
|
|
604
811
|
type: 'refresh-preview',
|
|
605
812
|
...(path && { path }),
|
|
813
|
+
...(scenarioId && { scenarioId }),
|
|
814
|
+
});
|
|
815
|
+
let count = 0;
|
|
816
|
+
for (const session of sessions) {
|
|
817
|
+
try {
|
|
818
|
+
if (session.ws.readyState === WebSocket.OPEN) {
|
|
819
|
+
session.ws.send(msg);
|
|
820
|
+
count++;
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
catch {
|
|
824
|
+
// Ignore send errors
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
return count;
|
|
828
|
+
}
|
|
829
|
+
/**
|
|
830
|
+
* Notify all connected terminal WebSocket clients that a data mutation
|
|
831
|
+
* was forwarded to the real dev server (seed-based scenario).
|
|
832
|
+
* The Terminal component relays this to editor.tsx to show a save banner.
|
|
833
|
+
*/
|
|
834
|
+
export function broadcastDataMutationForwarded(method, pathname) {
|
|
835
|
+
const msg = JSON.stringify({
|
|
836
|
+
type: 'data-mutation-forwarded',
|
|
837
|
+
method,
|
|
838
|
+
pathname,
|
|
606
839
|
});
|
|
607
840
|
let count = 0;
|
|
608
841
|
for (const session of sessions) {
|
|
@@ -638,6 +871,45 @@ export function broadcastShowResults() {
|
|
|
638
871
|
}
|
|
639
872
|
return count;
|
|
640
873
|
}
|
|
874
|
+
/**
|
|
875
|
+
* Hide the results panel (e.g. after Save & Commit).
|
|
876
|
+
*/
|
|
877
|
+
export function broadcastHideResults() {
|
|
878
|
+
const msg = JSON.stringify({ type: 'hide-results' });
|
|
879
|
+
let count = 0;
|
|
880
|
+
for (const session of sessions) {
|
|
881
|
+
try {
|
|
882
|
+
if (session.ws.readyState === WebSocket.OPEN) {
|
|
883
|
+
session.ws.send(msg);
|
|
884
|
+
count++;
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
catch {
|
|
888
|
+
// Ignore send errors
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
return count;
|
|
892
|
+
}
|
|
893
|
+
/**
|
|
894
|
+
* Send a set-viewport message to all connected terminal WebSocket clients.
|
|
895
|
+
* The Terminal component relays this to the parent page to update the preview viewport.
|
|
896
|
+
*/
|
|
897
|
+
export function broadcastSetViewport(viewport) {
|
|
898
|
+
const msg = JSON.stringify({ type: 'set-viewport', ...viewport });
|
|
899
|
+
let count = 0;
|
|
900
|
+
for (const session of sessions) {
|
|
901
|
+
try {
|
|
902
|
+
if (session.ws.readyState === WebSocket.OPEN) {
|
|
903
|
+
session.ws.send(msg);
|
|
904
|
+
count++;
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
catch {
|
|
908
|
+
// Ignore send errors
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
return count;
|
|
912
|
+
}
|
|
641
913
|
/**
|
|
642
914
|
* Kill all active PTY sessions and detached PTYs. Call during shutdown.
|
|
643
915
|
*/
|