@codeyam/codeyam-cli 0.1.0-staging.1 → 0.1.0-staging.28f73cf
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 +8 -7
- package/analyzer-template/packages/ai/index.ts +2 -1
- package/analyzer-template/packages/ai/package.json +2 -2
- package/analyzer-template/packages/ai/scripts/ai-test-matrix.mjs +424 -0
- package/analyzer-template/packages/ai/src/lib/analyzeScope.ts +24 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/astScopeAnalyzer.ts +6 -16
- package/analyzer-template/packages/ai/src/lib/astScopes/methodSemantics.ts +197 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/paths.ts +28 -2
- package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +127 -4
- package/analyzer-template/packages/ai/src/lib/checkAllAttributes.ts +1 -3
- package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +1821 -542
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/FunctionCallManager.ts +138 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.ts +1 -1
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.ts +139 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/DebugTracer.ts +224 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/PathManager.ts +203 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/README.md +294 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.ts +161 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/VisitedTracker.ts +235 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.ts +14 -6
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/selectBestValue.ts +70 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/uniqueIdUtils.ts +113 -0
- package/analyzer-template/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.ts +36 -0
- package/analyzer-template/packages/ai/src/lib/generateChangesEntityDocumentation.ts +20 -2
- package/analyzer-template/packages/ai/src/lib/generateChangesEntityKeyAttributes.ts +51 -107
- package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarioData.ts +56 -160
- package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarios.ts +79 -265
- package/analyzer-template/packages/ai/src/lib/generateEntityDocumentation.ts +16 -2
- package/analyzer-template/packages/ai/src/lib/generateEntityKeyAttributes.ts +53 -176
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +53 -154
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarios.ts +84 -254
- package/analyzer-template/packages/ai/src/lib/generateStatementAnalysis.ts +48 -71
- package/analyzer-template/packages/ai/src/lib/getConditionalUsagesFromCode.ts +27 -6
- package/analyzer-template/packages/ai/src/lib/getLLMCallStats.ts +0 -14
- package/analyzer-template/packages/ai/src/lib/modelInfo.ts +15 -0
- package/analyzer-template/packages/ai/src/lib/promptGenerators/gatherAttributesMap.ts +42 -4
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChangesEntityDocumentationGenerator.ts +8 -33
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.ts +54 -62
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.ts +93 -109
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityDocumentationGenerator.ts +8 -27
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.ts +33 -38
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.ts +30 -30
- package/analyzer-template/packages/ai/src/lib/types/index.ts +2 -0
- package/analyzer-template/packages/ai/src/lib/worker/SerializableDataStructure.ts +39 -0
- package/analyzer-template/packages/analyze/src/lib/FileAnalyzer.ts +52 -6
- package/analyzer-template/packages/analyze/src/lib/asts/nodes/index.ts +2 -1
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.ts +238 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getDeclaredEntityNode.ts +25 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/index.ts +2 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +8 -10
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +6 -1
- package/analyzer-template/packages/analyze/src/lib/files/analyze/gatherEntityMap.ts +8 -6
- package/analyzer-template/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.ts +5 -13
- package/analyzer-template/packages/analyze/src/lib/files/analyzeChange.ts +34 -15
- package/analyzer-template/packages/analyze/src/lib/files/analyzeEntity.ts +17 -3
- package/analyzer-template/packages/analyze/src/lib/files/analyzeInitial.ts +35 -16
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +7 -1
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.ts +9 -1
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarioData.ts +6 -1
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarios.ts +9 -1
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +15 -7
- package/analyzer-template/packages/aws/dist/src/lib/s3/getPresignedUrl.d.ts +23 -0
- package/analyzer-template/packages/aws/dist/src/lib/s3/getPresignedUrl.d.ts.map +1 -0
- package/analyzer-template/packages/aws/dist/src/lib/s3/getPresignedUrl.js +30 -0
- package/analyzer-template/packages/aws/dist/src/lib/s3/getPresignedUrl.js.map +1 -0
- package/analyzer-template/packages/aws/package.json +5 -4
- package/analyzer-template/packages/aws/s3/index.ts +4 -0
- package/analyzer-template/packages/aws/src/lib/s3/getPresignedUrl.ts +62 -0
- package/analyzer-template/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.ts +28 -21
- package/analyzer-template/packages/generate/src/lib/componentScenarioPage/componentScenarioPageRemix.ts +18 -11
- package/analyzer-template/packages/generate/src/lib/scenarioComponent.ts +6 -3
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js +28 -21
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageRemix.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageRemix.js +18 -11
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageRemix.js.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponent.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponent.js +5 -3
- package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponent.js.map +1 -1
- package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/db.d.ts +2 -0
- package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/db.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/db.js +3 -0
- package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/db.js.map +1 -1
- package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tableRelations.d.ts +2 -0
- package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tableRelations.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tables/debugReportsTable.d.ts +37 -0
- package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tables/debugReportsTable.d.ts.map +1 -0
- package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tables/debugReportsTable.js +27 -0
- package/analyzer-template/packages/github/dist/supabase/src/lib/kysely/tables/debugReportsTable.js.map +1 -0
- package/analyzer-template/packages/github/dist/utils/index.d.ts +2 -0
- package/analyzer-template/packages/github/dist/utils/index.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/utils/index.js +2 -0
- package/analyzer-template/packages/github/dist/utils/index.js.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/Semaphore.d.ts +25 -0
- package/analyzer-template/packages/github/dist/utils/src/lib/Semaphore.d.ts.map +1 -0
- package/analyzer-template/packages/github/dist/utils/src/lib/Semaphore.js +40 -0
- package/analyzer-template/packages/github/dist/utils/src/lib/Semaphore.js.map +1 -0
- package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getNextRoutePath.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getNextRoutePath.js +5 -3
- package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getNextRoutePath.js.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getRemixRoutePath.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getRemixRoutePath.js +2 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getRemixRoutePath.js.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/nextRouteFileNameToRoute.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/nextRouteFileNameToRoute.js +2 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/nextRouteFileNameToRoute.js.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.js +1 -0
- package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.js.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/sanitizeNextRouteSegments.d.ts +12 -0
- package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/sanitizeNextRouteSegments.d.ts.map +1 -0
- package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/sanitizeNextRouteSegments.js +32 -0
- package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/sanitizeNextRouteSegments.js.map +1 -0
- package/analyzer-template/packages/supabase/src/lib/kysely/db.ts +6 -0
- package/analyzer-template/packages/supabase/src/lib/kysely/tableRelations.ts +3 -0
- package/analyzer-template/packages/supabase/src/lib/kysely/tables/debugReportsTable.ts +61 -0
- package/analyzer-template/packages/ui-components/src/scenario-editor/components/DataItemEditor.tsx +1 -1
- package/analyzer-template/packages/utils/dist/utils/index.d.ts +2 -0
- package/analyzer-template/packages/utils/dist/utils/index.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/index.js +2 -0
- package/analyzer-template/packages/utils/dist/utils/index.js.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/Semaphore.d.ts +25 -0
- package/analyzer-template/packages/utils/dist/utils/src/lib/Semaphore.d.ts.map +1 -0
- package/analyzer-template/packages/utils/dist/utils/src/lib/Semaphore.js +40 -0
- package/analyzer-template/packages/utils/dist/utils/src/lib/Semaphore.js.map +1 -0
- package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getNextRoutePath.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getNextRoutePath.js +5 -3
- package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getNextRoutePath.js.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getRemixRoutePath.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getRemixRoutePath.js +2 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getRemixRoutePath.js.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/nextRouteFileNameToRoute.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/nextRouteFileNameToRoute.js +2 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/nextRouteFileNameToRoute.js.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.js +1 -0
- package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/remixRouteFileNameToRoute.js.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/sanitizeNextRouteSegments.d.ts +12 -0
- package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/sanitizeNextRouteSegments.d.ts.map +1 -0
- package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/sanitizeNextRouteSegments.js +32 -0
- package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/sanitizeNextRouteSegments.js.map +1 -0
- package/analyzer-template/packages/utils/index.ts +2 -0
- package/analyzer-template/packages/utils/src/lib/Semaphore.ts +42 -0
- package/analyzer-template/packages/utils/src/lib/frameworks/getNextRoutePath.ts +8 -3
- package/analyzer-template/packages/utils/src/lib/frameworks/getRemixRoutePath.ts +2 -1
- package/analyzer-template/packages/utils/src/lib/frameworks/nextRouteFileNameToRoute.ts +2 -1
- package/analyzer-template/packages/utils/src/lib/frameworks/remixRouteFileNameToRoute.ts +1 -0
- package/analyzer-template/packages/utils/src/lib/frameworks/sanitizeNextRouteSegments.ts +33 -0
- package/analyzer-template/project/constructMockCode.ts +170 -6
- package/analyzer-template/project/reconcileMockDataKeys.ts +13 -0
- package/analyzer-template/project/start.ts +1 -11
- package/analyzer-template/project/startScenarioCapture.ts +24 -0
- package/analyzer-template/project/trackGeneratedFiles.ts +41 -0
- package/analyzer-template/project/writeMockDataTsx.ts +125 -4
- package/analyzer-template/project/writeScenarioComponents.ts +199 -45
- package/analyzer-template/project/writeUniversalMocks.ts +72 -10
- package/background/src/lib/virtualized/project/constructMockCode.js +158 -7
- package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
- package/background/src/lib/virtualized/project/reconcileMockDataKeys.js +12 -0
- package/background/src/lib/virtualized/project/reconcileMockDataKeys.js.map +1 -1
- package/background/src/lib/virtualized/project/start.js +1 -8
- package/background/src/lib/virtualized/project/start.js.map +1 -1
- package/background/src/lib/virtualized/project/startScenarioCapture.js +18 -0
- package/background/src/lib/virtualized/project/startScenarioCapture.js.map +1 -1
- package/background/src/lib/virtualized/project/trackGeneratedFiles.js +30 -0
- package/background/src/lib/virtualized/project/trackGeneratedFiles.js.map +1 -0
- package/background/src/lib/virtualized/project/writeMockDataTsx.js +95 -3
- package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
- package/background/src/lib/virtualized/project/writeScenarioComponents.js +144 -28
- package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
- package/background/src/lib/virtualized/project/writeUniversalMocks.js +59 -9
- package/background/src/lib/virtualized/project/writeUniversalMocks.js.map +1 -1
- package/codeyam-cli/scripts/apply-setup.js +288 -0
- package/codeyam-cli/scripts/apply-setup.js.map +1 -0
- package/codeyam-cli/scripts/extract-setup.js +130 -0
- package/codeyam-cli/scripts/extract-setup.js.map +1 -0
- package/codeyam-cli/scripts/fixtures/cal.com/universal-mocks/packages/prisma/index.js +238 -0
- package/codeyam-cli/scripts/fixtures/cal.com/universal-mocks/packages/prisma/index.js.map +1 -0
- package/codeyam-cli/src/cli.js +6 -0
- package/codeyam-cli/src/cli.js.map +1 -1
- package/codeyam-cli/src/codeyam-cli.js +0 -0
- package/codeyam-cli/src/commands/debug.js +221 -0
- package/codeyam-cli/src/commands/debug.js.map +1 -0
- package/codeyam-cli/src/commands/init.js +4 -23
- package/codeyam-cli/src/commands/init.js.map +1 -1
- package/codeyam-cli/src/commands/report.js +102 -0
- package/codeyam-cli/src/commands/report.js.map +1 -0
- package/codeyam-cli/src/commands/setup-sandbox.js +164 -0
- package/codeyam-cli/src/commands/setup-sandbox.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/cleanupAnalysisFiles.test.js +6 -6
- package/codeyam-cli/src/utils/__tests__/cleanupAnalysisFiles.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +8 -0
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
- package/codeyam-cli/src/utils/analysisRunner.js +4 -3
- package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
- package/codeyam-cli/src/utils/analyzer.js +30 -0
- package/codeyam-cli/src/utils/analyzer.js.map +1 -1
- package/codeyam-cli/src/utils/backgroundServer.js +25 -5
- package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/utils/cleanupAnalysisFiles.js +2 -2
- package/codeyam-cli/src/utils/cleanupAnalysisFiles.js.map +1 -1
- package/codeyam-cli/src/utils/fileWatcher.js +75 -5
- package/codeyam-cli/src/utils/fileWatcher.js.map +1 -1
- package/codeyam-cli/src/utils/generateReport.js +219 -0
- package/codeyam-cli/src/utils/generateReport.js.map +1 -0
- package/codeyam-cli/src/utils/install-skills.js +7 -0
- package/codeyam-cli/src/utils/install-skills.js.map +1 -1
- package/codeyam-cli/src/utils/queue/__tests__/job.pidTracking.test.js +1 -0
- package/codeyam-cli/src/utils/queue/__tests__/job.pidTracking.test.js.map +1 -1
- package/codeyam-cli/src/utils/queue/job.js +8 -3
- package/codeyam-cli/src/utils/queue/job.js.map +1 -1
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +4 -0
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
- package/codeyam-cli/src/utils/webappDetection.js +2 -1
- package/codeyam-cli/src/utils/webappDetection.js.map +1 -1
- package/codeyam-cli/src/webserver/app/lib/database.js +63 -2
- package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
- package/codeyam-cli/src/webserver/backgroundServer.js +15 -35
- package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-D5ZHFomX.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-Dh-FldQK.js → InteractivePreview-XDSzQLOY.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-BYVx9KFp.js +3 -0
- package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-Dp6DC845.js → LogViewer-CRcT5fOZ.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-BORLgi0X.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-Bual6h18.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/ScenarioPreview-Bi-YUMa-.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-4D2vLLJz.js +5 -0
- package/codeyam-cli/src/webserver/build/client/assets/_index-BC200mfN.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-CxvZPkCv.js +10 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.generate-report-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{chart-column-B2I7jQx2.js → chart-column-B8fb6wnw.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/chunk-WWGJGFF6-De6i8FUT.js +26 -0
- package/codeyam-cli/src/webserver/build/client/assets/{circle-alert-GwwOAbhw.js → circle-alert-IdsgAK39.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/circle-check-BACUUf75.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/clock-vWeoCemX.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-CS7XDrKv.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-DIOEw_3i.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-1Z6D0fLM.js → entity._sha._-8Els_3Wb.js} +10 -10
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-C3FZJx1w.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.edit._scenarioId-YJz_igar.js +5 -0
- package/codeyam-cli/src/webserver/build/client/assets/entityStatus-BEqj2qBy.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entityVersioning-DO2gCvXv.js → entityVersioning-Bk_YB1jM.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/entry.client-DiP0q291.js +5 -0
- package/codeyam-cli/src/webserver/build/client/assets/file-text-LM0mgxXE.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/files-Dxh9CcaV.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/git-BXmqrWCH.js +12 -0
- package/codeyam-cli/src/webserver/build/client/assets/globals-BGS74ED-.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/html2canvas-pro.esm-XQCGvadH.js +5 -0
- package/codeyam-cli/src/webserver/build/client/assets/index-D-zYbzFZ.js +8 -0
- package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-DN7Vr40D.js → loader-circle-BXPKbHEb.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-1af162d4.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/root-DB7VgjCY.js +16 -0
- package/codeyam-cli/src/webserver/build/client/assets/{settings-MZc4XdmE.js → settings-5zF_GOcS.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/settings-Dc4MlMpK.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/simulations-BQ-02-jB.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/triangle-alert-D7k-ArFa.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-BBlyqxij.js → useLastLogLine-AlhS7g5F.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/useToast-Ddo4UQv7.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{zap-B4gsLUZQ.js → zap-_jw-9DCp.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/index-D4JpXSIO.js +1 -0
- package/codeyam-cli/src/webserver/build/server/assets/server-build-vwbN7n65.js +169 -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/server.js +1 -1
- package/codeyam-cli/src/webserver/server.js.map +1 -1
- package/codeyam-cli/templates/codeyam-setup-skill.md +85 -94
- package/codeyam-cli/templates/debug-command.md +125 -0
- package/package.json +9 -11
- package/packages/ai/index.js +1 -2
- package/packages/ai/index.js.map +1 -1
- package/packages/ai/src/lib/analyzeScope.js +13 -0
- package/packages/ai/src/lib/analyzeScope.js.map +1 -1
- package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js +6 -15
- package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js.map +1 -1
- package/packages/ai/src/lib/astScopes/methodSemantics.js +134 -0
- package/packages/ai/src/lib/astScopes/methodSemantics.js.map +1 -1
- package/packages/ai/src/lib/astScopes/paths.js +28 -3
- package/packages/ai/src/lib/astScopes/paths.js.map +1 -1
- package/packages/ai/src/lib/astScopes/processExpression.js +111 -3
- package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
- package/packages/ai/src/lib/checkAllAttributes.js +1 -3
- package/packages/ai/src/lib/checkAllAttributes.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +1320 -396
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/FunctionCallManager.js +137 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/FunctionCallManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js +1 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.js +112 -0
- package/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.js.map +1 -0
- package/packages/ai/src/lib/dataStructure/helpers/DebugTracer.js +176 -0
- package/packages/ai/src/lib/dataStructure/helpers/DebugTracer.js.map +1 -0
- package/packages/ai/src/lib/dataStructure/helpers/PathManager.js +178 -0
- package/packages/ai/src/lib/dataStructure/helpers/PathManager.js.map +1 -0
- package/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.js +138 -0
- package/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.js.map +1 -0
- package/packages/ai/src/lib/dataStructure/helpers/VisitedTracker.js +199 -0
- package/packages/ai/src/lib/dataStructure/helpers/VisitedTracker.js.map +1 -0
- package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js +14 -6
- package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/selectBestValue.js +62 -0
- package/packages/ai/src/lib/dataStructure/helpers/selectBestValue.js.map +1 -0
- package/packages/ai/src/lib/dataStructure/helpers/uniqueIdUtils.js +90 -0
- package/packages/ai/src/lib/dataStructure/helpers/uniqueIdUtils.js.map +1 -0
- package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js +22 -0
- package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js.map +1 -1
- package/packages/ai/src/lib/generateChangesEntityDocumentation.js +19 -1
- package/packages/ai/src/lib/generateChangesEntityDocumentation.js.map +1 -1
- package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js +51 -107
- package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js.map +1 -1
- package/packages/ai/src/lib/generateChangesEntityScenarioData.js +55 -156
- package/packages/ai/src/lib/generateChangesEntityScenarioData.js.map +1 -1
- package/packages/ai/src/lib/generateChangesEntityScenarios.js +79 -262
- package/packages/ai/src/lib/generateChangesEntityScenarios.js.map +1 -1
- package/packages/ai/src/lib/generateEntityDocumentation.js +15 -1
- package/packages/ai/src/lib/generateEntityDocumentation.js.map +1 -1
- package/packages/ai/src/lib/generateEntityKeyAttributes.js +53 -176
- package/packages/ai/src/lib/generateEntityKeyAttributes.js.map +1 -1
- package/packages/ai/src/lib/generateEntityScenarioData.js +52 -152
- package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
- package/packages/ai/src/lib/generateEntityScenarios.js +88 -258
- package/packages/ai/src/lib/generateEntityScenarios.js.map +1 -1
- package/packages/ai/src/lib/generateStatementAnalysis.js +46 -71
- package/packages/ai/src/lib/generateStatementAnalysis.js.map +1 -1
- package/packages/ai/src/lib/getConditionalUsagesFromCode.js +13 -8
- package/packages/ai/src/lib/getConditionalUsagesFromCode.js.map +1 -1
- package/packages/ai/src/lib/getLLMCallStats.js +0 -14
- package/packages/ai/src/lib/getLLMCallStats.js.map +1 -1
- package/packages/ai/src/lib/modelInfo.js +15 -0
- package/packages/ai/src/lib/modelInfo.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js +36 -3
- package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityDocumentationGenerator.js +8 -33
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityDocumentationGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.js +35 -41
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js +59 -72
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateEntityDocumentationGenerator.js +8 -27
- package/packages/ai/src/lib/promptGenerators/generateEntityDocumentationGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js +24 -27
- package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.js +21 -22
- package/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.js.map +1 -1
- package/packages/ai/src/lib/types/index.js +2 -0
- package/packages/ai/src/lib/types/index.js.map +1 -1
- package/packages/ai/src/lib/worker/SerializableDataStructure.js +7 -0
- package/packages/ai/src/lib/worker/SerializableDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/FileAnalyzer.js +45 -5
- package/packages/analyze/src/lib/FileAnalyzer.js.map +1 -1
- package/packages/analyze/src/lib/asts/nodes/index.js +2 -1
- package/packages/analyze/src/lib/asts/nodes/index.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.js +191 -0
- package/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.js.map +1 -0
- package/packages/analyze/src/lib/asts/sourceFiles/getDeclaredEntityNode.js +16 -0
- package/packages/analyze/src/lib/asts/sourceFiles/getDeclaredEntityNode.js.map +1 -0
- package/packages/analyze/src/lib/asts/sourceFiles/index.js +2 -0
- package/packages/analyze/src/lib/asts/sourceFiles/index.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +6 -8
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +5 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js +8 -2
- package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.js +5 -8
- package/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeChange.js +21 -9
- package/packages/analyze/src/lib/files/analyzeChange.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeEntity.js +10 -4
- package/packages/analyze/src/lib/files/analyzeEntity.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeInitial.js +21 -9
- package/packages/analyze/src/lib/files/analyzeInitial.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +6 -1
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.js +9 -1
- package/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js +5 -1
- package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateScenarios.js +9 -1
- package/packages/analyze/src/lib/files/scenarios/generateScenarios.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +16 -7
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
- package/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js +28 -21
- package/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js.map +1 -1
- package/packages/generate/src/lib/componentScenarioPage/componentScenarioPageRemix.js +18 -11
- package/packages/generate/src/lib/componentScenarioPage/componentScenarioPageRemix.js.map +1 -1
- package/packages/generate/src/lib/scenarioComponent.js +5 -3
- package/packages/generate/src/lib/scenarioComponent.js.map +1 -1
- package/packages/supabase/src/lib/kysely/db.js +3 -0
- package/packages/supabase/src/lib/kysely/db.js.map +1 -1
- package/packages/supabase/src/lib/kysely/tables/debugReportsTable.js +27 -0
- package/packages/supabase/src/lib/kysely/tables/debugReportsTable.js.map +1 -0
- package/packages/utils/index.js +2 -0
- package/packages/utils/index.js.map +1 -1
- package/packages/utils/src/lib/Semaphore.js +40 -0
- package/packages/utils/src/lib/Semaphore.js.map +1 -0
- package/packages/utils/src/lib/frameworks/getNextRoutePath.js +5 -3
- package/packages/utils/src/lib/frameworks/getNextRoutePath.js.map +1 -1
- package/packages/utils/src/lib/frameworks/getRemixRoutePath.js +2 -1
- package/packages/utils/src/lib/frameworks/getRemixRoutePath.js.map +1 -1
- package/packages/utils/src/lib/frameworks/nextRouteFileNameToRoute.js +2 -1
- package/packages/utils/src/lib/frameworks/nextRouteFileNameToRoute.js.map +1 -1
- package/packages/utils/src/lib/frameworks/remixRouteFileNameToRoute.js +1 -0
- package/packages/utils/src/lib/frameworks/remixRouteFileNameToRoute.js.map +1 -1
- package/packages/utils/src/lib/frameworks/sanitizeNextRouteSegments.js +32 -0
- package/packages/utils/src/lib/frameworks/sanitizeNextRouteSegments.js.map +1 -0
- package/analyzer-template/packages/ai/src/lib/generateEntityDataMap.ts +0 -375
- package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-GqWwt5wG.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-p0fuyqGQ.js +0 -3
- package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-xwuhwsZH.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/ScenarioPreview-Bl2IRh55.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-M2QuSHKC.js +0 -5
- package/codeyam-cli/src/webserver/build/client/assets/_index-CAVtep9Q.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-CLmzsLsT.js +0 -10
- package/codeyam-cli/src/webserver/build/client/assets/components-CAx5ONX_.js +0 -40
- package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-CgyOwWip.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-DGy3zrli.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-ChAdTrrU.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.edit._scenarioId-D9L7267w.js +0 -5
- package/codeyam-cli/src/webserver/build/client/assets/entry.client-C6FRgjPr.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/files-C3-cQjgv.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/git-Dp4EB9nv.js +0 -12
- package/codeyam-cli/src/webserver/build/client/assets/globals-Da3jt49-.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-172a4629.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/root-COyVTsPq.js +0 -16
- package/codeyam-cli/src/webserver/build/client/assets/search-CvyP_1Lo.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/settings-Hbf8b7J_.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/simulations-BMBi0VzO.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useToast-C_VxoXTh.js +0 -1
- package/codeyam-cli/src/webserver/build/client/cy-logo-cli.svg +0 -13
- package/codeyam-cli/src/webserver/build/server/assets/index-eAULANMV.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-lutv16q5.js +0 -161
- package/codeyam-cli/src/webserver/public/cy-logo-cli.svg +0 -13
- package/packages/ai/src/lib/generateEntityDataMap.js +0 -335
- package/packages/ai/src/lib/generateEntityDataMap.js.map +0 -1
- package/packages/ai/src/lib/promptGenerators/generateEntityDataMapGenerator.js +0 -17
- package/packages/ai/src/lib/promptGenerators/generateEntityDataMapGenerator.js.map +0 -1
|
@@ -259,8 +259,16 @@ function getLiteralValue(expr: ts.Expression): string | undefined {
|
|
|
259
259
|
/**
|
|
260
260
|
* Format conditional usages into a string for the LLM prompt
|
|
261
261
|
*/
|
|
262
|
+
/**
|
|
263
|
+
* Interface for conditional usages that may have source tracing information.
|
|
264
|
+
* This is a superset of ConditionalUsage that includes optional sourceDataPath.
|
|
265
|
+
*/
|
|
266
|
+
interface EnrichedConditionalUsageInput extends ConditionalUsage {
|
|
267
|
+
sourceDataPath?: string;
|
|
268
|
+
}
|
|
269
|
+
|
|
262
270
|
export function formatConditionalUsagesForPrompt(
|
|
263
|
-
conditionalUsages: Record<string,
|
|
271
|
+
conditionalUsages: Record<string, EnrichedConditionalUsageInput[]>,
|
|
264
272
|
): string {
|
|
265
273
|
const entries = Object.entries(conditionalUsages);
|
|
266
274
|
if (entries.length === 0) {
|
|
@@ -270,7 +278,7 @@ export function formatConditionalUsagesForPrompt(
|
|
|
270
278
|
const lines: string[] = [
|
|
271
279
|
'\n## Static Analysis: Attributes Used in Conditionals',
|
|
272
280
|
'',
|
|
273
|
-
'The following attributes were found to be used in conditional statements, making them
|
|
281
|
+
'The following attributes were found to be used in conditional statements, making them very likely key attributes:',
|
|
274
282
|
'',
|
|
275
283
|
];
|
|
276
284
|
|
|
@@ -281,20 +289,30 @@ export function formatConditionalUsagesForPrompt(
|
|
|
281
289
|
.flatMap((u) => u.comparedValues || []);
|
|
282
290
|
const uniqueValues = [...new Set(allComparedValues)];
|
|
283
291
|
|
|
284
|
-
|
|
292
|
+
// Get the source data path if available (traced back to data source)
|
|
293
|
+
const sourceDataPath = usages.find((u) => u.sourceDataPath)?.sourceDataPath;
|
|
294
|
+
|
|
295
|
+
let description = `- "${path}"`;
|
|
296
|
+
|
|
297
|
+
// If we have a source data path, show that the local variable derives from a data source
|
|
298
|
+
if (sourceDataPath) {
|
|
299
|
+
description += `\n - Source: "${sourceDataPath}"`;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
description += '\n - ';
|
|
285
303
|
|
|
286
304
|
if (uniqueTypes.includes('switch')) {
|
|
287
|
-
description += '
|
|
305
|
+
description += 'Used as switch discriminant';
|
|
288
306
|
if (uniqueValues.length > 0) {
|
|
289
307
|
description += ` with cases: ${uniqueValues.map((v) => `"${v}"`).join(', ')}`;
|
|
290
308
|
}
|
|
291
309
|
} else if (uniqueTypes.includes('comparison')) {
|
|
292
|
-
description += '
|
|
310
|
+
description += 'Used in comparison';
|
|
293
311
|
if (uniqueValues.length > 0) {
|
|
294
312
|
description += ` against values: ${uniqueValues.map((v) => `"${v}"`).join(', ')}`;
|
|
295
313
|
}
|
|
296
314
|
} else {
|
|
297
|
-
description += '
|
|
315
|
+
description += 'Used in truthiness check (presence/absence matters)';
|
|
298
316
|
}
|
|
299
317
|
|
|
300
318
|
lines.push(description);
|
|
@@ -304,6 +322,9 @@ export function formatConditionalUsagesForPrompt(
|
|
|
304
322
|
lines.push(
|
|
305
323
|
'Consider these attributes as candidates for key attributes, especially those with specific comparison values.',
|
|
306
324
|
);
|
|
325
|
+
lines.push(
|
|
326
|
+
'When a local variable derives from a data source, the data source is the key attribute.',
|
|
327
|
+
);
|
|
307
328
|
|
|
308
329
|
return lines.join('\n');
|
|
309
330
|
}
|
|
@@ -2,13 +2,6 @@ import OpenAI from 'openai';
|
|
|
2
2
|
import { getLLMCallCost } from './getLLMCallCost';
|
|
3
3
|
import { AI, LlmCallStats } from './types';
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* It looks like this function can be massively simplified, and I (AG) think
|
|
7
|
-
* that we aren't using openrouter anymore. But, until this is figured out, it
|
|
8
|
-
* might not be worth refactoring and messing something subtle up. Ideally
|
|
9
|
-
* whatever implicit functionality is in here can be represented in the new
|
|
10
|
-
* `getLLMCallStats` such that this get replaced by it.
|
|
11
|
-
*/
|
|
12
5
|
export function getLLMCallStats({
|
|
13
6
|
chatRequest,
|
|
14
7
|
chatCompletion,
|
|
@@ -28,13 +21,6 @@ export function getLLMCallStats({
|
|
|
28
21
|
error: JSON.stringify(chatCompletion.error),
|
|
29
22
|
};
|
|
30
23
|
}
|
|
31
|
-
if (!chatRequest.model) {
|
|
32
|
-
// this was previously used to indicate openrouter calls, but we aren't
|
|
33
|
-
// doing that anymore and anyway it was a pretty obscure way to indicate
|
|
34
|
-
// that state of affairs. if we bring multi-provider back, we will want
|
|
35
|
-
// to rewrite a fair bit of this.
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
24
|
|
|
39
25
|
const usage = chatCompletion.usage || {
|
|
40
26
|
prompt_tokens: 0,
|
|
@@ -27,6 +27,14 @@ export interface ModelInfo {
|
|
|
27
27
|
|
|
28
28
|
export const MODEL_INFO: Record<AI.Model, ModelInfo> = {
|
|
29
29
|
// OpenAI models - served directly by OpenAI
|
|
30
|
+
[AI.Model.OPENAI_GPT5_1]: {
|
|
31
|
+
id: AI.Model.OPENAI_GPT5_1,
|
|
32
|
+
provider: OPENAI_PROVIDER,
|
|
33
|
+
apiModelName: 'gpt-5.1',
|
|
34
|
+
maxCompletionTokens: 128000,
|
|
35
|
+
pricing: { input: 1.25, output: 10.0 },
|
|
36
|
+
reasoningEffort: 'none',
|
|
37
|
+
},
|
|
30
38
|
[AI.Model.OPENAI_GPT5]: {
|
|
31
39
|
id: AI.Model.OPENAI_GPT5,
|
|
32
40
|
provider: OPENAI_PROVIDER,
|
|
@@ -175,6 +183,13 @@ export const MODEL_INFO: Record<AI.Model, ModelInfo> = {
|
|
|
175
183
|
maxCompletionTokens: 200000,
|
|
176
184
|
pricing: { input: 3.0, output: 15.0 },
|
|
177
185
|
},
|
|
186
|
+
[AI.Model.ANTHROPIC_CLAUDE_4_5_OPUS]: {
|
|
187
|
+
id: AI.Model.ANTHROPIC_CLAUDE_4_5_OPUS,
|
|
188
|
+
provider: ANTHROPIC_PROVIDER,
|
|
189
|
+
apiModelName: 'claude-opus-4-5',
|
|
190
|
+
maxCompletionTokens: 200000,
|
|
191
|
+
pricing: { input: 5.0, output: 25.0 },
|
|
192
|
+
},
|
|
178
193
|
|
|
179
194
|
// Deprecated models (kept for backward compatibility)
|
|
180
195
|
[AI.Model.PHIND_CODELLAMA]: {
|
|
@@ -5,9 +5,44 @@ import {
|
|
|
5
5
|
splitOutsideParenthesesAndArrays,
|
|
6
6
|
} from '../splitOutsideParentheses';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Checks if a bracket-only path is a valid string key access (not just an index).
|
|
10
|
+
* Valid: ['*'], ['someKey'] - string key access
|
|
11
|
+
* Invalid: [0], [1] - numeric index only (meaningless without parent path)
|
|
12
|
+
*/
|
|
13
|
+
function isValidBracketStringKey(attribute: string): boolean {
|
|
14
|
+
// Match ['string'] or ["string"] patterns
|
|
15
|
+
return /^\[['"][^'"]+['"]\]$/.test(attribute);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Extracts the string key from a bracket notation like ['*'] or ["key"]
|
|
20
|
+
* Returns the key without quotes and brackets, e.g., '*' or 'key'
|
|
21
|
+
*/
|
|
22
|
+
function extractBracketStringKey(attribute: string): string | null {
|
|
23
|
+
const match = attribute.match(/^\[['"]([^'"]+)['"]\]$/);
|
|
24
|
+
return match ? match[1] : null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Normalizes a path by extracting string keys from bracket notation.
|
|
29
|
+
* If the path is a single bracket string key like ['*'], returns the key ('*').
|
|
30
|
+
* Otherwise returns the path unchanged.
|
|
31
|
+
*/
|
|
32
|
+
function normalizePathForInternalUse(path: string): string {
|
|
33
|
+
const extracted = extractBracketStringKey(path);
|
|
34
|
+
return extracted !== null ? extracted : path;
|
|
35
|
+
}
|
|
36
|
+
|
|
8
37
|
function validAttribute(attribute: string) {
|
|
9
|
-
if (!attribute || attribute.length === 0
|
|
10
|
-
|
|
38
|
+
if (!attribute || attribute.length === 0) return false;
|
|
39
|
+
|
|
40
|
+
// Allow string-key bracket access like ['*'] or ['someKey']
|
|
41
|
+
// These are valid data paths from objects with dynamic/special keys
|
|
42
|
+
if (attribute.startsWith('[')) {
|
|
43
|
+
return isValidBracketStringKey(attribute);
|
|
44
|
+
}
|
|
45
|
+
|
|
11
46
|
const attributeParts = splitOutsideParenthesesAndArrays(attribute);
|
|
12
47
|
if (
|
|
13
48
|
attributeParts.some((part) =>
|
|
@@ -153,8 +188,11 @@ export function gatherAttributesMap(
|
|
|
153
188
|
// Fall through to normal processing for other return value properties
|
|
154
189
|
}
|
|
155
190
|
|
|
156
|
-
const
|
|
157
|
-
if (!validAttribute(
|
|
191
|
+
const rawRelativePath = joinParenthesesAndArrays(pathParts.slice(2));
|
|
192
|
+
if (!validAttribute(rawRelativePath)) continue;
|
|
193
|
+
|
|
194
|
+
// Normalize the path for internal use (e.g., ['*'] -> '*')
|
|
195
|
+
const relativePath = normalizePathForInternalUse(rawRelativePath);
|
|
158
196
|
|
|
159
197
|
attributesMap[relativePath] = returnValueDataStructure[path];
|
|
160
198
|
associationMap[reverse ? relativePath : path] = reverse
|
|
@@ -4,44 +4,19 @@ export default function generateChangesEntityDocumentationGenerator(
|
|
|
4
4
|
entity: Entity,
|
|
5
5
|
previousDocumentation: string,
|
|
6
6
|
) {
|
|
7
|
-
return
|
|
7
|
+
return `## Task
|
|
8
|
+
Review if the existing documentation is still accurate after code changes. If accurate, respond "No changes needed". Otherwise, provide updated documentation.
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
## Current Documentation
|
|
10
11
|
${previousDocumentation}
|
|
11
|
-
"""
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"""
|
|
13
|
+
## Updated Code
|
|
14
|
+
\`\`\`typescript
|
|
16
15
|
${entity.code}
|
|
17
|
-
"""
|
|
18
|
-
|
|
19
|
-
If the existing documentation is still accurate please respond with "No changes needed".
|
|
20
|
-
|
|
21
|
-
Otherwise, please update the documentation to reflect the changes in the code. Using these instructions:
|
|
22
|
-
|
|
23
|
-
- Start with an overview that describes the overall intent of the code. Be concise in your language. Immediately start with the intent of the code. Here is an example Overview:
|
|
24
|
-
|
|
25
|
-
\`\`\` Overview
|
|
26
|
-
Displays details about a specific Git commit. It shows the commit message, author, date, and provides a link to the commit on GitHub. Users can copy the commit SHA to their clipboard, with a visual indication of the copy action.
|
|
27
16
|
\`\`\`
|
|
28
17
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
- Next, specify the inputs (with details about types, how the input is used, and examples) and expected outputs (with details about types and examples).
|
|
32
|
-
|
|
33
|
-
- Finally, provide examples of how the code can be used with clear inputs and outputs for each example. Provide diverse examples (there's no need to include repetitive examples).
|
|
34
|
-
|
|
35
|
-
Write the documentation as markdown. Be concise. Use bullets when possible. No one wants to read long paragraphs of text.
|
|
36
|
-
|
|
37
|
-
Provide no other text than the documentation in proper markdown using the headers below.
|
|
38
|
-
|
|
39
|
-
## Overview
|
|
40
|
-
|
|
41
|
-
## Inputs
|
|
42
|
-
|
|
43
|
-
## Output
|
|
18
|
+
## Overview Example
|
|
19
|
+
Good: "Displays details about a specific Git commit. Shows the commit message, author, date, and provides a link to GitHub."
|
|
44
20
|
|
|
45
|
-
|
|
46
|
-
`;
|
|
21
|
+
Bad: "The CommitDetails function takes a commit object..." (mentions the function name)`;
|
|
47
22
|
}
|
|
@@ -52,77 +52,69 @@ export default function generateChangesEntityScenarioDataGenerator(
|
|
|
52
52
|
defaultScenarioData?: ScenarioData,
|
|
53
53
|
incompleteResponse?: string,
|
|
54
54
|
) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
Here is the incomplete response. Please use this and the following data to complete the response, only returning the missing data.
|
|
60
|
-
|
|
61
|
-
Just pick up where this response left off. It will be improper json but we will combine the responses into proper json.
|
|
62
|
-
|
|
63
|
-
\`\`\` START INCOMPLETE RESPONSE \`\`\`
|
|
55
|
+
const incompleteSection = incompleteResponse
|
|
56
|
+
? `## Incomplete Response
|
|
57
|
+
Continue from where this left off (combine for valid JSON):
|
|
58
|
+
\`\`\`
|
|
64
59
|
${incompleteResponse}
|
|
65
|
-
\`\`\`
|
|
60
|
+
\`\`\`
|
|
66
61
|
|
|
67
62
|
`
|
|
68
|
-
|
|
69
|
-
}## Scenario
|
|
70
|
-
|
|
71
|
-
This scenario needs mock data to support it. Here are the keyAttributeInstructions for generating this scenario:
|
|
72
|
-
\`\`\`
|
|
73
|
-
${JSON.stringify(
|
|
74
|
-
{
|
|
75
|
-
name: scenario.name,
|
|
76
|
-
description: scenario.description,
|
|
77
|
-
keyAttributeInstructions: scenario.metadata.keyAttributeInstructions,
|
|
78
|
-
},
|
|
79
|
-
null,
|
|
80
|
-
2,
|
|
81
|
-
)}
|
|
82
|
-
\`\`\`
|
|
63
|
+
: '';
|
|
83
64
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
null,
|
|
94
|
-
2,
|
|
95
|
-
)}
|
|
96
|
-
\`\`\`
|
|
97
|
-
${
|
|
98
|
-
defaultScenarioData
|
|
99
|
-
? `
|
|
100
|
-
## Default Scenario
|
|
65
|
+
const scenarioJson = JSON.stringify(
|
|
66
|
+
{
|
|
67
|
+
name: scenario.name,
|
|
68
|
+
description: scenario.description,
|
|
69
|
+
keyAttributeInstructions: scenario.metadata.keyAttributeInstructions,
|
|
70
|
+
},
|
|
71
|
+
null,
|
|
72
|
+
2,
|
|
73
|
+
);
|
|
101
74
|
|
|
102
|
-
|
|
103
|
-
|
|
75
|
+
const existingJson = JSON.stringify(
|
|
76
|
+
{
|
|
77
|
+
name: existingScenario.name,
|
|
78
|
+
data: filterData(structure, existingScenario.metadata.data),
|
|
79
|
+
},
|
|
80
|
+
null,
|
|
81
|
+
2,
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
const defaultSection = defaultScenarioData
|
|
85
|
+
? `
|
|
86
|
+
## Default Scenario Data (merge base, do not modify)
|
|
87
|
+
\`\`\`json
|
|
104
88
|
${JSON.stringify(defaultScenarioData.data, null, 2)}
|
|
105
89
|
\`\`\`
|
|
106
90
|
`
|
|
107
|
-
: ''
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
\`\`\`
|
|
91
|
+
: '';
|
|
92
|
+
|
|
93
|
+
const mockDataSection = structure.dataForMocks
|
|
94
|
+
? `## mockData Structure
|
|
95
|
+
\`\`\`json
|
|
113
96
|
${JSON.stringify(structure.dataForMocks, null, 2)}
|
|
114
|
-
|
|
115
|
-
`
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
structure.arguments
|
|
121
|
-
? `The argumentsData structure (for the default scenario provide robust values for the entire structure):
|
|
122
|
-
\`\`\`
|
|
97
|
+
\`\`\``
|
|
98
|
+
: '## mockData Structure\nNone—return `{}` for mockData.';
|
|
99
|
+
|
|
100
|
+
const argumentsSection = structure.arguments
|
|
101
|
+
? `## argumentsData Structure
|
|
102
|
+
\`\`\`json
|
|
123
103
|
${JSON.stringify(structure.arguments, null, 2)}
|
|
104
|
+
\`\`\``
|
|
105
|
+
: '## argumentsData Structure\nNone—return `[]` for argumentsData.';
|
|
106
|
+
|
|
107
|
+
return `${incompleteSection}## Scenario (new instructions)
|
|
108
|
+
\`\`\`json
|
|
109
|
+
${scenarioJson}
|
|
124
110
|
\`\`\`
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
111
|
+
|
|
112
|
+
## Existing Scenario (preserve where possible)
|
|
113
|
+
\`\`\`json
|
|
114
|
+
${existingJson}
|
|
115
|
+
\`\`\`
|
|
116
|
+
${defaultSection}
|
|
117
|
+
${mockDataSection}
|
|
118
|
+
|
|
119
|
+
${argumentsSection}`;
|
|
128
120
|
}
|
|
@@ -41,7 +41,7 @@ export default function generateChangesEntityScenariosGenerator({
|
|
|
41
41
|
const filePath = (attr as any).filePath;
|
|
42
42
|
const entityName = (attr as any).originalEntityName;
|
|
43
43
|
|
|
44
|
-
if (!filePath || !entityName) continue;
|
|
44
|
+
if (!filePath || !entityName) continue;
|
|
45
45
|
|
|
46
46
|
if (!relevantDependentKeyAttributes[filePath]) {
|
|
47
47
|
relevantDependentKeyAttributes[filePath] = {};
|
|
@@ -52,128 +52,112 @@ export default function generateChangesEntityScenariosGenerator({
|
|
|
52
52
|
relevantDependentKeyAttributes[filePath][entityName].push(attr);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
\`\`\`
|
|
79
|
-
|
|
80
|
-
${
|
|
81
|
-
changedDataStructureFields.length > 0
|
|
82
|
-
? `Changed Data Structure Fields:
|
|
83
|
-
|
|
84
|
-
The following fields in the data structure have changed (type changed, added, or removed):
|
|
85
|
-
|
|
86
|
-
\`\`\`
|
|
55
|
+
const formatKeyAttrs = (attrs: Analysis['metadata']['keyAttributes']) =>
|
|
56
|
+
attrs.map((ka) => ({
|
|
57
|
+
dataStructurePath: ka.dataStructurePath,
|
|
58
|
+
localVariable: ka.internalPath,
|
|
59
|
+
description: ka.description,
|
|
60
|
+
validValueOptions: ka.validValueOptions,
|
|
61
|
+
}));
|
|
62
|
+
|
|
63
|
+
const addedSection =
|
|
64
|
+
addedKeyAttributes?.length > 0
|
|
65
|
+
? JSON.stringify(formatKeyAttrs(addedKeyAttributes), null, 2)
|
|
66
|
+
: 'None';
|
|
67
|
+
|
|
68
|
+
const removedSection =
|
|
69
|
+
removedKeyAttributes?.length > 0
|
|
70
|
+
? JSON.stringify(removedKeyAttributes, null, 2)
|
|
71
|
+
: 'None';
|
|
72
|
+
|
|
73
|
+
const changedFieldsSection =
|
|
74
|
+
changedDataStructureFields.length > 0
|
|
75
|
+
? `
|
|
76
|
+
## Changed Data Structure Fields
|
|
77
|
+
Fields that changed type, were added, or removed:
|
|
78
|
+
\`\`\`json
|
|
87
79
|
${JSON.stringify(changedDataStructureFields, null, 2)}
|
|
88
80
|
\`\`\`
|
|
89
81
|
|
|
90
|
-
**
|
|
91
|
-
- If "stats.visualEntities" changed from an array to a number, update keyAttributeInstructions from "Array of 10 objects" to "10 (count of visual entities)"
|
|
92
|
-
- If a field was removed, remove it from keyAttributeInstructions
|
|
93
|
-
- If a field was added, you may add it to keyAttributeInstructions if relevant for the scenario
|
|
94
|
-
|
|
95
|
-
Fields that did NOT change can retain their existing keyAttributeInstructions.
|
|
96
|
-
|
|
82
|
+
**Update keyAttributeInstructions for affected scenarios** (e.g., if "stats.visualEntities" changed from array to number).
|
|
97
83
|
`
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
84
|
+
: '';
|
|
85
|
+
|
|
86
|
+
const existingScenariosJson = JSON.stringify(
|
|
87
|
+
existingScenarios
|
|
88
|
+
.filter((s) => (error ? !!s.metadata.error : !s.metadata.error))
|
|
89
|
+
.map((s) => ({
|
|
90
|
+
name: s.name,
|
|
91
|
+
description: s.description,
|
|
92
|
+
keyAttributeInstructions: s.metadata.keyAttributeInstructions,
|
|
93
|
+
playwrightInstructions: s.metadata.playwrightInstructions,
|
|
94
|
+
})),
|
|
95
|
+
null,
|
|
96
|
+
2,
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
const diffSection = commitDiff
|
|
100
|
+
? `
|
|
101
|
+
## Code Change (Diff)
|
|
102
|
+
\`\`\`diff
|
|
103
|
+
${commitDiff}
|
|
104
|
+
\`\`\``
|
|
105
|
+
: '';
|
|
106
|
+
|
|
107
|
+
const dependencySection =
|
|
108
|
+
!error &&
|
|
109
|
+
relevantDependentKeyAttributes &&
|
|
110
|
+
Object.keys(relevantDependentKeyAttributes).length > 0
|
|
111
|
+
? `
|
|
112
|
+
## Dependency Key Attributes
|
|
113
|
+
\`\`\`json
|
|
103
114
|
${JSON.stringify(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
115
|
+
Object.keys(relevantDependentKeyAttributes).reduce((acc: any, path) => {
|
|
116
|
+
acc[path] = Object.keys(relevantDependentKeyAttributes[path]).reduce(
|
|
117
|
+
(entityAcc: any, entityName) => {
|
|
118
|
+
entityAcc[entityName] = relevantDependentKeyAttributes[path][
|
|
119
|
+
entityName
|
|
120
|
+
].map((ka: any) => ({
|
|
121
|
+
dataStructurePath: ka.dataStructurePath,
|
|
122
|
+
localVariable: ka.path || ka.internalPath,
|
|
123
|
+
description: ka.description,
|
|
124
|
+
validValueOptions: ka.validValueOptions,
|
|
125
|
+
}));
|
|
126
|
+
return entityAcc;
|
|
127
|
+
},
|
|
128
|
+
{},
|
|
129
|
+
);
|
|
130
|
+
return acc;
|
|
131
|
+
}, {}),
|
|
110
132
|
null,
|
|
111
133
|
2,
|
|
112
134
|
)}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
Existing Scenarios:
|
|
135
|
+
\`\`\``
|
|
136
|
+
: '';
|
|
116
137
|
|
|
138
|
+
return `## Added Key Attributes
|
|
139
|
+
\`\`\`json
|
|
140
|
+
${addedSection}
|
|
117
141
|
\`\`\`
|
|
118
|
-
${JSON.stringify(
|
|
119
|
-
existingScenarios
|
|
120
|
-
.filter((s) => (error ? !!s.metadata.error : !s.metadata.error))
|
|
121
|
-
.map((s) => ({
|
|
122
|
-
name: s.name,
|
|
123
|
-
description: s.description,
|
|
124
|
-
keyAttributeInstructions: s.metadata.keyAttributeInstructions,
|
|
125
|
-
playwrightInstructions: s.metadata.playwrightInstructions,
|
|
126
|
-
})),
|
|
127
|
-
null,
|
|
128
|
-
2,
|
|
129
|
-
)}
|
|
130
|
-
\`\`\`
|
|
131
|
-
|
|
132
|
-
${
|
|
133
|
-
commitDiff
|
|
134
|
-
? `
|
|
135
|
-
Code Change:
|
|
136
142
|
|
|
143
|
+
## Removed Key Attributes
|
|
144
|
+
\`\`\`json
|
|
145
|
+
${removedSection}
|
|
137
146
|
\`\`\`
|
|
138
|
-
${
|
|
147
|
+
${changedFieldsSection}
|
|
148
|
+
## Current Key Attributes
|
|
149
|
+
\`\`\`json
|
|
150
|
+
${JSON.stringify(formatKeyAttrs(keyAttributes), null, 2)}
|
|
139
151
|
\`\`\`
|
|
140
|
-
`
|
|
141
|
-
: ''
|
|
142
|
-
}
|
|
143
|
-
Function Code:
|
|
144
152
|
|
|
153
|
+
## Existing Scenarios
|
|
154
|
+
\`\`\`json
|
|
155
|
+
${existingScenariosJson}
|
|
145
156
|
\`\`\`
|
|
146
|
-
${
|
|
147
|
-
\`\`\`
|
|
157
|
+
${diffSection}
|
|
148
158
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
? `Key Attributes for Dependencies:
|
|
154
|
-
\`\`\`
|
|
155
|
-
${JSON.stringify(
|
|
156
|
-
Object.keys(relevantDependentKeyAttributes).reduce((acc: any, path) => {
|
|
157
|
-
acc[path] = Object.keys(
|
|
158
|
-
(relevantDependentKeyAttributes as any)[path],
|
|
159
|
-
).reduce((entityAcc: any, entityName) => {
|
|
160
|
-
entityAcc[entityName] = (relevantDependentKeyAttributes as any)[path][
|
|
161
|
-
entityName
|
|
162
|
-
].map((ka: any) => ({
|
|
163
|
-
dataStructurePath: ka.dataStructurePath, // Full path in mockData
|
|
164
|
-
localVariable: ka.path || ka.internalPath, // Local variable name
|
|
165
|
-
description: ka.description,
|
|
166
|
-
validValueOptions: ka.validValueOptions,
|
|
167
|
-
}));
|
|
168
|
-
return entityAcc;
|
|
169
|
-
}, {});
|
|
170
|
-
return acc;
|
|
171
|
-
}, {}),
|
|
172
|
-
null,
|
|
173
|
-
2,
|
|
174
|
-
)}
|
|
175
|
-
\`\`\``
|
|
176
|
-
: ''
|
|
177
|
-
}
|
|
178
|
-
`;
|
|
159
|
+
## Current Code
|
|
160
|
+
\`\`\`typescript
|
|
161
|
+
${entity.code}
|
|
162
|
+
\`\`\`${dependencySection}`;
|
|
179
163
|
}
|
|
@@ -1,35 +1,16 @@
|
|
|
1
1
|
import { Entity } from '~codeyam/types';
|
|
2
2
|
|
|
3
3
|
export default function generateEntityDocumentationGenerator(entity: Entity) {
|
|
4
|
-
return
|
|
5
|
-
|
|
6
|
-
"""
|
|
7
|
-
${entity.code}
|
|
8
|
-
"""
|
|
9
|
-
|
|
10
|
-
What does this code do? Please create documentation for this code.
|
|
11
|
-
|
|
12
|
-
- Start with an overview that describes the overall intent of the code. Be concise in your language. Immediately start with the intent of the code. Here is an example Overview:
|
|
4
|
+
return `## Task
|
|
5
|
+
Document the following code.
|
|
13
6
|
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
## Code
|
|
8
|
+
\`\`\`typescript
|
|
9
|
+
${entity.code}
|
|
16
10
|
\`\`\`
|
|
17
11
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- Next, specify the inputs (with details about types, how the input is used, and examples) and expected outputs (with details about types and examples).
|
|
21
|
-
|
|
22
|
-
- Finally, provide examples of how the code can be used with clear inputs and outputs for each example. Provide diverse examples (there's no need to include repetitive examples).
|
|
23
|
-
|
|
24
|
-
Write the documentation as markdown. Be concise. Use bullets when possible. No one wants to read long paragraphs of text.
|
|
25
|
-
|
|
26
|
-
Provide no other text than the documentation in proper markdown using the headers below.
|
|
27
|
-
|
|
28
|
-
## Overview
|
|
29
|
-
|
|
30
|
-
## Inputs
|
|
31
|
-
|
|
32
|
-
## Output
|
|
12
|
+
## Overview Example
|
|
13
|
+
Good: "Displays details about a specific Git commit. Shows the commit message, author, date, and provides a link to GitHub. Users can copy the commit SHA to clipboard."
|
|
33
14
|
|
|
34
|
-
|
|
15
|
+
Bad: "The CommitDetails function takes a commit object..." (mentions the function name)`;
|
|
35
16
|
}
|