@codeyam/codeyam-cli 0.1.0-staging.2a88920 → 0.1.0-staging.4813bf3
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 +3 -3
- package/analyzer-template/packages/ai/index.ts +1 -0
- package/analyzer-template/packages/ai/package.json +2 -2
- package/analyzer-template/packages/ai/src/lib/analyzeScope.ts +23 -1
- package/analyzer-template/packages/ai/src/lib/astScopes/patterns/forInStatementHandler.ts +10 -17
- package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +101 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/sharedPatterns.ts +28 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/types.ts +6 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +330 -9
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.ts +5 -1
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.ts +11 -2
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.ts +2 -2
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/coerceObjectsToPrimitivesBySchema.ts +70 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.ts +126 -11
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.ts +20 -1
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.ts +84 -19
- package/analyzer-template/packages/ai/src/lib/dataStructureChunking.ts +33 -15
- package/analyzer-template/packages/ai/src/lib/generateEntityDataStructure.ts +58 -3
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +299 -5
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +38 -2
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionals.ts +359 -142
- 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/promptGenerators/collapseNullableObjects.ts +118 -0
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.ts +24 -4
- package/analyzer-template/packages/analyze/index.ts +2 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +69 -3
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +5 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/TransformationTracer.ts +1315 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.ts +4 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.ts +9 -1
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +194 -15
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +260 -22
- package/analyzer-template/packages/analyze/src/lib/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 +6 -0
- package/analyzer-template/packages/database/src/lib/kysely/tables/debugReportsTable.ts +1 -1
- package/analyzer-template/packages/database/src/lib/kysely/tables/labsRequestsTable.ts +52 -0
- 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/userScenarioToDb.ts +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/analysisBranchToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/analysisBranchToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/analysisToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/analysisToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/branchToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/branchToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/commitBranchToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/commitBranchToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/commitToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/commitToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/fileToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/fileToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts +2 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js +3 -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/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/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/types/src/types/ProjectMetadata.d.ts +7 -0
- package/analyzer-template/packages/github/dist/types/src/types/ProjectMetadata.d.ts.map +1 -1
- package/analyzer-template/packages/types/src/types/ProjectMetadata.ts +7 -0
- package/analyzer-template/packages/utils/dist/types/src/types/ProjectMetadata.d.ts +7 -0
- package/analyzer-template/packages/utils/dist/types/src/types/ProjectMetadata.d.ts.map +1 -1
- package/analyzer-template/project/constructMockCode.ts +36 -1
- package/analyzer-template/project/writeMockDataTsx.ts +174 -12
- package/analyzer-template/project/writeScenarioComponents.ts +60 -12
- package/analyzer-template/project/writeSimpleRoot.ts +21 -11
- 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 +30 -1
- package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
- package/background/src/lib/virtualized/project/writeMockDataTsx.js +156 -8
- package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
- package/background/src/lib/virtualized/project/writeScenarioComponents.js +60 -15
- 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 +180 -0
- package/codeyam-cli/scripts/apply-setup.js.map +1 -1
- package/codeyam-cli/src/cli.js +2 -0
- 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 +4 -2
- package/codeyam-cli/src/commands/analyze.js.map +1 -1
- package/codeyam-cli/src/commands/baseline.js +2 -0
- package/codeyam-cli/src/commands/baseline.js.map +1 -1
- package/codeyam-cli/src/commands/debug.js +2 -0
- package/codeyam-cli/src/commands/debug.js.map +1 -1
- package/codeyam-cli/src/commands/default.js +31 -20
- package/codeyam-cli/src/commands/default.js.map +1 -1
- package/codeyam-cli/src/commands/detect-universal-mocks.js +2 -0
- package/codeyam-cli/src/commands/detect-universal-mocks.js.map +1 -1
- package/codeyam-cli/src/commands/init.js +49 -257
- package/codeyam-cli/src/commands/init.js.map +1 -1
- package/codeyam-cli/src/commands/memory.js +17 -26
- 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__/setupClaudeCodeSettings.test.js +128 -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 +5 -0
- package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/utils/generateReport.js +2 -2
- package/codeyam-cli/src/utils/install-skills.js +57 -54
- package/codeyam-cli/src/utils/install-skills.js.map +1 -1
- package/codeyam-cli/src/utils/labsAutoCheck.js +19 -0
- package/codeyam-cli/src/utils/labsAutoCheck.js.map +1 -0
- 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/job.js +4 -0
- package/codeyam-cli/src/utils/queue/job.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 +230 -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 +75 -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 +378 -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 +115 -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__/ruleState.test.js +293 -0
- package/codeyam-cli/src/utils/rules/__tests__/ruleState.test.js.map +1 -0
- package/codeyam-cli/src/utils/rules/index.js +1 -0
- package/codeyam-cli/src/utils/rules/index.js.map +1 -1
- package/codeyam-cli/src/utils/rules/parser.js +2 -25
- package/codeyam-cli/src/utils/rules/parser.js.map +1 -1
- 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/staleness.js +16 -11
- package/codeyam-cli/src/utils/rules/staleness.js.map +1 -1
- package/codeyam-cli/src/utils/serverState.js +37 -10
- package/codeyam-cli/src/utils/serverState.js.map +1 -1
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +21 -44
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
- 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/backgroundServer.js +24 -0
- package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/CopyButton-CA3JxPb7.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-DsN1wKrm.js → EntityItem-B86KKU7e.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-DLqD3qNt.js → EntityTypeBadge-B5ctlSYt.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-Ba2JVPzP.js → EntityTypeIcon-BqY8gDAW.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{InlineSpinner-C8lyxW9k.js → InlineSpinner-ClaLpuOo.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-aht4aafF.js → InteractivePreview-BDhPilK7.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-CVtiBnY5.js → LibraryFunctionPreview-VeqEBv9v.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-B0GLXMsr.js → LoadingDots-Bs7Nn1Jr.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-xgeCVgSM.js → LogViewer-Bm3PmcCz.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-OApQuNyq.js → ReportIssueModal-CgMEzchJ.js} +3 -8
- package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-DuDvi0jm.js → SafeScreenshot-Gq3Ocjo6.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-DzccYyI8.js → ScenarioViewer-CBui0id_.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-DyFZkK0l.js → TruncatedFilePath-CiwXDxLh.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{_index-BwqWJOgH.js → _index-B3TDXxnk.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-BwavGCpm.js → activity.(_tab)-BtBFH820.js} +6 -11
- package/codeyam-cli/src/webserver/build/client/assets/agent-transcripts-CN61MOMa.js +11 -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.labs-unlock-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-PttOB2SF.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-Cx24_aWc.js → chevron-down-TJp6ofnp.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{chunk-EPOLDU6W-CXRTFQ3F.js → chunk-JZWAC4HX-JE9ZIoBl.js} +12 -12
- package/codeyam-cli/src/webserver/build/client/assets/{circle-check-BOARzkeR.js → circle-check-CXhHQYrI.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/copy-6y9ALfGT.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-BdhJEx6B.js → createLucideIcon-Ca9fAY46.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{dev.empty-BBnGWYga.js → dev.empty-C0epRiVn.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-BJUiQqZF.js → entity._sha._-BVnB8a9L.js} +10 -10
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha.scenarios._scenarioId.fullscreen-DavjRmOY.js → entity._sha.scenarios._scenarioId.fullscreen-CBoafmVs.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.create-scenario-D1T4TGjf.js → entity._sha_.create-scenario-DGgZjdFg.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-CTBG2mmz.js → entity._sha_.edit._scenarioId-38yPijoD.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entry.client-CS2cb_eZ.js → entry.client-BSHEfydn.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{fileTableUtils-DMJ7zii9.js → fileTableUtils-DCPhhSMo.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{files-CJ6lTdTA.js → files-0N0YJQv7.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{git-CPTZZ-JZ.js → git-DXnyr8uP.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/globals-CKT08Djd.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{index-lzqtyFU8.js → index-CcsFv748.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{index-B1h680n5.js → index-ChN9-fAY.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/labs-BLJ7HxOC.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-B7B9V-bu.js → loader-circle-CTqLEAGU.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-b171b9d3.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/memory-CCQd4aZA.js +78 -0
- package/codeyam-cli/src/webserver/build/client/assets/pause-D6vreykR.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/root-CHhiHoo_.js +62 -0
- package/codeyam-cli/src/webserver/build/client/assets/{search-CxXUmBSd.js → search-B8VUL8nl.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/settings-BejnUJ6R.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{simulations-DwFIBT09.js → simulations-CPoAg7Zo.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/terminal-BrCP7uQo.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-B6LgvRJg.js → triangle-alert-BZz2NjYa.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useCustomSizes-C1v1PQzo.js → useCustomSizes-DNwUduNu.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-aSv48UbS.js → useLastLogLine-COky1GVF.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useReportContext-DYxHZQuP.js → useReportContext-CpZgwliL.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useToast-mBRpZPiu.js → useToast-Bv9JFvUO.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/{index-BM6TDT1Y.js → index-8Fv-lH1-.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-Akn3iYFP.js +257 -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/templates/{codeyam:debug.md → codeyam-debug.md} +1 -1
- package/codeyam-cli/templates/codeyam-diagnose.md +481 -0
- package/codeyam-cli/templates/codeyam-memory-hook.sh +19 -20
- package/codeyam-cli/templates/codeyam-memory.md +392 -0
- package/codeyam-cli/templates/{codeyam:new-rule.md → codeyam-new-rule.md} +2 -2
- 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/rule-notification-hook.py +56 -0
- package/codeyam-cli/templates/rule-reflection-hook.py +554 -87
- package/codeyam-cli/templates/rules-instructions.md +63 -24
- package/package.json +2 -2
- package/packages/ai/index.js +1 -1
- package/packages/ai/index.js.map +1 -1
- package/packages/ai/src/lib/analyzeScope.js +21 -1
- package/packages/ai/src/lib/analyzeScope.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 +78 -1
- package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
- package/packages/ai/src/lib/astScopes/sharedPatterns.js +25 -0
- package/packages/ai/src/lib/astScopes/sharedPatterns.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +262 -8
- 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/cleanKnownObjectFunctions.js +11 -2
- package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js +2 -2
- 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/convertDotNotation.js +113 -11
- package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.js +15 -1
- package/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js +78 -17
- package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js.map +1 -1
- package/packages/ai/src/lib/dataStructureChunking.js +26 -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 +212 -3
- package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
- package/packages/ai/src/lib/generateExecutionFlows.js +16 -2
- package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -1
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js +242 -81
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js.map +1 -1
- package/packages/ai/src/lib/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/promptGenerators/collapseNullableObjects.js +97 -0
- package/packages/ai/src/lib/promptGenerators/collapseNullableObjects.js.map +1 -0
- package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js +17 -2
- package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js.map +1 -1
- package/packages/analyze/index.js +1 -0
- package/packages/analyze/index.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +52 -2
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +3 -0
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js +880 -0
- package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js.map +1 -0
- package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js +5 -1
- package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js +9 -1
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +116 -13
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +231 -22
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.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/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 +3 -0
- package/packages/database/src/lib/kysely/db.js.map +1 -1
- 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/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/scripts/finalize-analyzer.cjs +8 -76
- package/codeyam-cli/src/webserver/build/client/assets/copy-Bb-80kDT.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-a78b90a2.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/memory--GCbFsBE.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/server/assets/server-build-dYC34MHw.js +0 -257
- package/codeyam-cli/templates/codeyam:diagnose.md +0 -803
- package/codeyam-cli/templates/codeyam:memory.md +0 -341
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"buildTimestamp": "2026-02-
|
|
3
|
-
"buildTime":
|
|
4
|
-
"gitCommit": "
|
|
2
|
+
"buildTimestamp": "2026-02-13T01:38:56.786Z",
|
|
3
|
+
"buildTime": 1770946736786,
|
|
4
|
+
"gitCommit": "4813bf378afaa4d6bd7fdada47260541fb7ba13a",
|
|
5
5
|
"nodeVersion": "v20.20.0",
|
|
6
|
-
"contentHash": "
|
|
7
|
-
"buildNumber":
|
|
8
|
-
"semanticVersion": "0.1.
|
|
9
|
-
"version": "0.1.
|
|
6
|
+
"contentHash": "137e331d30c083a78ae7f8a1b9366f0cbefd882b8f0f7858cb3fb8501bf391ad",
|
|
7
|
+
"buildNumber": 618,
|
|
8
|
+
"semanticVersion": "0.1.618",
|
|
9
|
+
"version": "0.1.618 (2026-02-13T01:38+137e331)"
|
|
10
10
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
[2/
|
|
3
|
-
[2/
|
|
2
|
+
[2/13/2026, 1:38:56 AM] > codeyam-combo@1.0.0 mergeDependencies
|
|
3
|
+
[2/13/2026, 1:38:56 AM] > node ./scripts/mergePackageJsonFiles.cjs
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
[2/
|
|
6
|
+
[2/13/2026, 1:38:56 AM] Merged dependencies into root package.json
|
|
7
7
|
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"jest": "^30.2.0",
|
|
31
31
|
"jsdom": "^27.4.0",
|
|
32
32
|
"jsonc-parser": "^3.2.1",
|
|
33
|
-
"lru-cache": "^11.2.
|
|
33
|
+
"lru-cache": "^11.2.5",
|
|
34
34
|
"openai": "^6.16.0",
|
|
35
35
|
"p-queue": "^8.1.0",
|
|
36
36
|
"p-retry": "^7.1.1",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"pluralize": "^8.0.0",
|
|
45
45
|
"yargs": "^18.0.0",
|
|
46
46
|
"json5": "^2.2.3",
|
|
47
|
-
"@anthropic-ai/sdk": "^0.
|
|
47
|
+
"@anthropic-ai/sdk": "^0.74.0",
|
|
48
48
|
"@aws-sdk/s3-request-presigner": "^3.940.0",
|
|
49
49
|
"better-sqlite3": "^12.4.1",
|
|
50
50
|
"fetch-retry": "^6.0.0",
|
|
51
|
-
"kysely": "^0.28.
|
|
51
|
+
"kysely": "^0.28.11",
|
|
52
52
|
"pg": "^8.16.3",
|
|
53
53
|
"@octokit/request": "^10.0.3",
|
|
54
54
|
"lucide-react": "^0.556.0",
|
|
@@ -43,6 +43,7 @@ export { default as isolateScopes } from './src/lib/isolateScopes';
|
|
|
43
43
|
export {
|
|
44
44
|
default as analyzeScope,
|
|
45
45
|
destroyWorkerPool,
|
|
46
|
+
skipWorkerPool,
|
|
46
47
|
} from './src/lib/analyzeScope';
|
|
47
48
|
export { default as logOrderedMap } from './src/lib/logOrderedMap';
|
|
48
49
|
export {
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
"author": "",
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@anthropic-ai/sdk": "^0.
|
|
12
|
+
"@anthropic-ai/sdk": "^0.74.0",
|
|
13
13
|
"jsdom": "^27.4.0",
|
|
14
14
|
"p-queue": "^8.1.0",
|
|
15
15
|
"p-retry": "^7.1.1",
|
|
16
16
|
"piscina": "^5.1.4",
|
|
17
|
-
"lru-cache": "^11.2.
|
|
17
|
+
"lru-cache": "^11.2.5"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@types/jsdom": "^27.0.0"
|
|
@@ -50,6 +50,19 @@ let workerPool: Piscina<
|
|
|
50
50
|
AnalyzeScopeWorkerOutput
|
|
51
51
|
> | null = null;
|
|
52
52
|
let workerPoolDestroyed = false;
|
|
53
|
+
let workerPoolSkipped = false;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Skip worker pool initialization for the current session.
|
|
57
|
+
*
|
|
58
|
+
* The worker thread creates its own ProjectAnalyzer (ts.Program), which takes
|
|
59
|
+
* 50-70s — far longer than the actual entity processing (<2s for typical batches).
|
|
60
|
+
* When the entity count is small, running analyzeScopeLocal on the main thread
|
|
61
|
+
* reuses the existing ProjectAnalyzer and avoids this overhead entirely.
|
|
62
|
+
*/
|
|
63
|
+
export function skipWorkerPool() {
|
|
64
|
+
workerPoolSkipped = true;
|
|
65
|
+
}
|
|
53
66
|
|
|
54
67
|
/**
|
|
55
68
|
* Check if we're in Node.js main thread
|
|
@@ -108,6 +121,7 @@ function ensureWorkerPool() {
|
|
|
108
121
|
'analyzeScope should not be called after data structure preparation completes.',
|
|
109
122
|
);
|
|
110
123
|
}
|
|
124
|
+
if (workerPoolSkipped) return;
|
|
111
125
|
if (workerPool !== null) return;
|
|
112
126
|
|
|
113
127
|
// Only initialize worker pool in Node.js environment
|
|
@@ -123,10 +137,17 @@ function ensureWorkerPool() {
|
|
|
123
137
|
// Note: WORKER_PATH is null when __mocks__/analyzeScope.ts is active
|
|
124
138
|
const { WORKER_PATH } = analyzeScopeWorkerPaths();
|
|
125
139
|
|
|
140
|
+
// Disable workers when tracing is enabled - we need access to ScopeDataStructure
|
|
141
|
+
// instance in the main thread to capture pre-serialization state
|
|
142
|
+
const tracingEnabled =
|
|
143
|
+
process.env.CODEYAM_TRACE_TRANSFORMS === '1' ||
|
|
144
|
+
process.env.CODEYAM_TRACE_TRANSFORMS === 'true';
|
|
145
|
+
|
|
126
146
|
if (
|
|
127
147
|
process.env.USE_WORKER_THREADS &&
|
|
128
148
|
WORKER_PATH &&
|
|
129
|
-
fs.existsSync(WORKER_PATH)
|
|
149
|
+
fs.existsSync(WORKER_PATH) &&
|
|
150
|
+
!tracingEnabled
|
|
130
151
|
) {
|
|
131
152
|
console.log('CodeYam: Using worker threads for analyzeScope', {
|
|
132
153
|
WORKER_PATH,
|
|
@@ -159,6 +180,7 @@ function ensureWorkerPool() {
|
|
|
159
180
|
WORKER_PATH,
|
|
160
181
|
workerExists: WORKER_PATH ? fs.existsSync(WORKER_PATH) : false,
|
|
161
182
|
USE_WORKER_THREADS: process.env.USE_WORKER_THREADS,
|
|
183
|
+
tracingEnabled,
|
|
162
184
|
});
|
|
163
185
|
workerPool = null; // Explicitly set to indicate "no workers"
|
|
164
186
|
}
|
|
@@ -22,11 +22,8 @@ export class ForInStatementHandler implements PatternHandler {
|
|
|
22
22
|
// Process the expression being iterated over first (e.g., object)
|
|
23
23
|
context.processExpression(node.expression);
|
|
24
24
|
|
|
25
|
-
//
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
// If the initializer is a variable declaration with an identifier, establish equivalence
|
|
29
|
-
// to indicate it's iterating over the keys of the expression
|
|
25
|
+
// If the initializer is a variable declaration with an identifier,
|
|
26
|
+
// type it as 'string' since for-in keys are always strings
|
|
30
27
|
if (ts.isVariableDeclarationList(node.initializer)) {
|
|
31
28
|
const declarations = node.initializer.declarations;
|
|
32
29
|
if (
|
|
@@ -36,25 +33,21 @@ export class ForInStatementHandler implements PatternHandler {
|
|
|
36
33
|
) {
|
|
37
34
|
const variableName = StructuredPath.fromBase(declarations[0].name.text);
|
|
38
35
|
|
|
39
|
-
//
|
|
36
|
+
// Type the key variable as 'string' — for-in keys are always strings.
|
|
37
|
+
// Note: We intentionally do NOT equivalence the key variable to
|
|
38
|
+
// expressionPath[*key*]. The key variable is the KEY (a string),
|
|
39
|
+
// while [*key*] in the schema represents the VALUE at a dynamic key.
|
|
40
|
+
// Creating that equivalence would cause the 'string' type to propagate
|
|
41
|
+
// to the value path. The value access (e.g., obj[key]) is handled
|
|
42
|
+
// correctly by the element access handler in processExpression.
|
|
40
43
|
context.addType(variableName, 'string');
|
|
41
|
-
|
|
42
|
-
if (expressionPath) {
|
|
43
|
-
// For for...in loops, the variable is equivalent to the keys of the object
|
|
44
|
-
// We represent this with a *key* suffix to indicate it's a key, not a value
|
|
45
|
-
context.addEquivalence(variableName, expressionPath.withKey('key'));
|
|
46
|
-
}
|
|
47
44
|
}
|
|
48
45
|
} else if (ts.isIdentifier(node.initializer)) {
|
|
49
46
|
// If the initializer is directly an identifier (rare but possible)
|
|
50
47
|
const variableName = StructuredPath.fromBase(node.initializer.text);
|
|
51
48
|
|
|
52
|
-
//
|
|
49
|
+
// See comment above — type as string but don't equivalence to value path
|
|
53
50
|
context.addType(variableName, 'string');
|
|
54
|
-
|
|
55
|
-
if (expressionPath) {
|
|
56
|
-
context.addEquivalence(variableName, expressionPath.withKey('key'));
|
|
57
|
-
}
|
|
58
51
|
} else {
|
|
59
52
|
context.processExpression(node.initializer);
|
|
60
53
|
}
|
|
@@ -9,6 +9,7 @@ import { StructuredPath } from './paths';
|
|
|
9
9
|
import { nodeToSource } from './nodeToSource';
|
|
10
10
|
import { methodRegistry, ArrayPushSemantics } from './methodSemantics';
|
|
11
11
|
import {
|
|
12
|
+
getComparisonOperatorString,
|
|
12
13
|
isArithmeticOperator,
|
|
13
14
|
isAssignmentOperator,
|
|
14
15
|
isBitwiseCompoundOperator,
|
|
@@ -25,6 +26,74 @@ import {
|
|
|
25
26
|
} from './conditionalEffectsExtractor';
|
|
26
27
|
import { detectArrayDerivedPattern } from './arrayDerivationDetector';
|
|
27
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Recursively extracts root variable names from an expression AST node.
|
|
31
|
+
* Used to identify which variables flow into JSX expression children,
|
|
32
|
+
* so we can link them to the return value schema.
|
|
33
|
+
*
|
|
34
|
+
* Examples:
|
|
35
|
+
* - `filteredTopPaths.map(...)` → ['filteredTopPaths']
|
|
36
|
+
* - `a && b` → ['a', 'b']
|
|
37
|
+
* - `condition ? x : y` → ['condition', 'x', 'y']
|
|
38
|
+
*/
|
|
39
|
+
function extractRootVariableNames(node: ts.Expression): string[] {
|
|
40
|
+
const ignoredIdentifiers = new Set([
|
|
41
|
+
'undefined',
|
|
42
|
+
'null',
|
|
43
|
+
'true',
|
|
44
|
+
'false',
|
|
45
|
+
'NaN',
|
|
46
|
+
'Infinity',
|
|
47
|
+
]);
|
|
48
|
+
|
|
49
|
+
if (ts.isIdentifier(node)) {
|
|
50
|
+
const name = node.text;
|
|
51
|
+
return ignoredIdentifiers.has(name) ? [] : [name];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (ts.isPropertyAccessExpression(node)) {
|
|
55
|
+
return extractRootVariableNames(node.expression);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (ts.isCallExpression(node)) {
|
|
59
|
+
return extractRootVariableNames(node.expression);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (ts.isBinaryExpression(node)) {
|
|
63
|
+
return [
|
|
64
|
+
...extractRootVariableNames(node.left),
|
|
65
|
+
...extractRootVariableNames(node.right),
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (ts.isPrefixUnaryExpression(node)) {
|
|
70
|
+
return extractRootVariableNames(node.operand);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (ts.isConditionalExpression(node)) {
|
|
74
|
+
return [
|
|
75
|
+
...extractRootVariableNames(node.condition),
|
|
76
|
+
...extractRootVariableNames(node.whenTrue),
|
|
77
|
+
...extractRootVariableNames(node.whenFalse),
|
|
78
|
+
];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (ts.isParenthesizedExpression(node)) {
|
|
82
|
+
return extractRootVariableNames(node.expression);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Stop recursion at JSX elements and other terminal nodes
|
|
86
|
+
if (
|
|
87
|
+
ts.isJsxElement(node) ||
|
|
88
|
+
ts.isJsxFragment(node) ||
|
|
89
|
+
ts.isJsxSelfClosingElement(node)
|
|
90
|
+
) {
|
|
91
|
+
return [];
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return [];
|
|
95
|
+
}
|
|
96
|
+
|
|
28
97
|
/**
|
|
29
98
|
* Checks if a JSX element has props that reference variables from the parent scope.
|
|
30
99
|
* This is used to detect unconditionally-rendered children that should have their
|
|
@@ -1294,6 +1363,11 @@ export function extractConditionalUsage(
|
|
|
1294
1363
|
return literalValue;
|
|
1295
1364
|
};
|
|
1296
1365
|
|
|
1366
|
+
// Get the comparison operator string for the compound condition
|
|
1367
|
+
const comparisonOperator = getComparisonOperatorString(
|
|
1368
|
+
unwrapped.operatorToken.kind,
|
|
1369
|
+
);
|
|
1370
|
+
|
|
1297
1371
|
// Helper to add a condition
|
|
1298
1372
|
const addCondition = (
|
|
1299
1373
|
path: string,
|
|
@@ -1338,6 +1412,7 @@ export function extractConditionalUsage(
|
|
|
1338
1412
|
comparedValues,
|
|
1339
1413
|
isNegated,
|
|
1340
1414
|
requiredValue,
|
|
1415
|
+
...(comparisonOperator && { comparisonOperator }),
|
|
1341
1416
|
...(chainInfo.currentOrGroupId && {
|
|
1342
1417
|
orGroupId: chainInfo.currentOrGroupId,
|
|
1343
1418
|
}),
|
|
@@ -3334,6 +3409,19 @@ export function processExpression({
|
|
|
3334
3409
|
for (const child of unwrappedNode.children) {
|
|
3335
3410
|
// Process expressions in JSX children: <div>{expr}</div>
|
|
3336
3411
|
if (ts.isJsxExpression(child) && child.expression) {
|
|
3412
|
+
// When processing return value JSX, link root variables to return value schema
|
|
3413
|
+
if (targetPath && targetPath.base !== '') {
|
|
3414
|
+
const varNames = [
|
|
3415
|
+
...new Set(extractRootVariableNames(child.expression)),
|
|
3416
|
+
];
|
|
3417
|
+
for (const varName of varNames) {
|
|
3418
|
+
context.addEquivalence(
|
|
3419
|
+
targetPath.withProperty(varName),
|
|
3420
|
+
StructuredPath.fromBase(varName),
|
|
3421
|
+
);
|
|
3422
|
+
}
|
|
3423
|
+
}
|
|
3424
|
+
|
|
3337
3425
|
// Process the expression with StructuredPath.empty() as targetPath
|
|
3338
3426
|
// to trigger type registration without imposing prefix
|
|
3339
3427
|
processExpression({
|
|
@@ -3368,6 +3456,19 @@ export function processExpression({
|
|
|
3368
3456
|
for (const child of unwrappedNode.children) {
|
|
3369
3457
|
// Process expressions in JSX children: <>{expr}</>
|
|
3370
3458
|
if (ts.isJsxExpression(child) && child.expression) {
|
|
3459
|
+
// When processing return value JSX, link root variables to return value schema
|
|
3460
|
+
if (targetPath && targetPath.base !== '') {
|
|
3461
|
+
const varNames = [
|
|
3462
|
+
...new Set(extractRootVariableNames(child.expression)),
|
|
3463
|
+
];
|
|
3464
|
+
for (const varName of varNames) {
|
|
3465
|
+
context.addEquivalence(
|
|
3466
|
+
targetPath.withProperty(varName),
|
|
3467
|
+
StructuredPath.fromBase(varName),
|
|
3468
|
+
);
|
|
3469
|
+
}
|
|
3470
|
+
}
|
|
3471
|
+
|
|
3371
3472
|
// Process the expression to extract structure
|
|
3372
3473
|
processExpression({
|
|
3373
3474
|
node: child.expression,
|
|
@@ -71,6 +71,34 @@ export function isComparisonOperator(kind: ts.SyntaxKind): boolean {
|
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
/**
|
|
75
|
+
* Returns the string representation of a comparison operator token.
|
|
76
|
+
*/
|
|
77
|
+
export function getComparisonOperatorString(
|
|
78
|
+
kind: ts.SyntaxKind,
|
|
79
|
+
): string | undefined {
|
|
80
|
+
switch (kind) {
|
|
81
|
+
case ts.SyntaxKind.EqualsEqualsToken:
|
|
82
|
+
return '==';
|
|
83
|
+
case ts.SyntaxKind.EqualsEqualsEqualsToken:
|
|
84
|
+
return '===';
|
|
85
|
+
case ts.SyntaxKind.ExclamationEqualsToken:
|
|
86
|
+
return '!=';
|
|
87
|
+
case ts.SyntaxKind.ExclamationEqualsEqualsToken:
|
|
88
|
+
return '!==';
|
|
89
|
+
case ts.SyntaxKind.LessThanToken:
|
|
90
|
+
return '<';
|
|
91
|
+
case ts.SyntaxKind.LessThanEqualsToken:
|
|
92
|
+
return '<=';
|
|
93
|
+
case ts.SyntaxKind.GreaterThanToken:
|
|
94
|
+
return '>';
|
|
95
|
+
case ts.SyntaxKind.GreaterThanEqualsToken:
|
|
96
|
+
return '>=';
|
|
97
|
+
default:
|
|
98
|
+
return undefined;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
74
102
|
/**
|
|
75
103
|
* Checks if an operator is an arithmetic operator
|
|
76
104
|
*/
|
|
@@ -433,6 +433,12 @@ export interface CompoundConditional {
|
|
|
433
433
|
isNegated: boolean;
|
|
434
434
|
/** Required value for this condition to be true */
|
|
435
435
|
requiredValue?: string | boolean;
|
|
436
|
+
/**
|
|
437
|
+
* The comparison operator used (e.g., '>', '<', '>=', '<=', '===', '!==').
|
|
438
|
+
* Preserves the original operator so flow generation can distinguish
|
|
439
|
+
* `length > 0` from `length === 0`.
|
|
440
|
+
*/
|
|
441
|
+
comparisonOperator?: string;
|
|
436
442
|
/**
|
|
437
443
|
* When conditions are part of an OR expression within an && chain,
|
|
438
444
|
* they share the same orGroupId. Conditions with the same orGroupId
|