@oneuptime/common 11.5.4 → 11.5.6
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/Models/DatabaseModels/AIAgentTaskPullRequest.ts +56 -45
- package/Models/DatabaseModels/AIInsight.ts +748 -0
- package/Models/DatabaseModels/AIRun.ts +262 -0
- package/Models/DatabaseModels/CodeRepository.ts +42 -0
- package/Models/DatabaseModels/GlobalConfig.ts +105 -0
- package/Models/DatabaseModels/Index.ts +4 -8
- package/Models/DatabaseModels/InstanceHealthLog.ts +277 -0
- package/Models/DatabaseModels/LlmLog.ts +33 -0
- package/Models/DatabaseModels/Project.ts +123 -6
- package/Models/DatabaseModels/Runbook.ts +1 -1
- package/Models/DatabaseModels/User.ts +47 -0
- package/Server/API/AIAgentDataAPI.ts +802 -140
- package/Server/API/AIAgentTaskAPI.ts +132 -69
- package/Server/API/AIAgentTaskLogAPI.ts +65 -41
- package/Server/API/AIAgentTaskPullRequestAPI.ts +41 -0
- package/Server/API/AIInsightAPI.ts +220 -0
- package/Server/API/AIInvestigationAPI.ts +363 -1
- package/Server/API/CodeFixRunAPI.ts +251 -0
- package/Server/API/GitHubAPI.ts +246 -3
- package/Server/API/TelemetryExceptionAPI.ts +193 -48
- package/Server/EnvironmentConfig.ts +1 -1
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783943300000-DropServiceCodeRepository.ts +26 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783947444597-CodeFixRunsOnAIRun.ts +73 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783950962813-AddCodeFixTaskType.ts +29 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783954040984-AddInstrumentationFixTasksFlag.ts +31 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783957160597-MigrationName.ts +51 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783958542237-AddTaskContextToAIRun.ts +25 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783965945957-AddInvestigationVerdictAndGrade.ts +47 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783970619301-AddFixGuardrailColumns.ts +53 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783970619302-DropLegacyAIAgentTaskTables.ts +31 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783977781677-AddCiStatusToFixPullRequests.ts +37 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783990000000-AddCompletionTokensToLlmLog.ts +25 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784010274993-AddSentinelInsight.ts +75 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784010274994-AddSentinelInsightFlags.ts +37 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784030612266-RenameSentinelToAI.ts +203 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784033837629-MigrationName.ts +163 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1784048917994-AddCreatedByUserToUser.ts +23 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +32 -0
- package/Server/Infrastructure/Queue.ts +82 -4
- package/Server/Infrastructure/Semaphore.ts +62 -1
- package/Server/Middleware/MasterAdminAuthorization.ts +37 -0
- package/Server/Middleware/ProjectAuthorization.ts +40 -15
- package/Server/Services/AIAgentService.ts +32 -0
- package/Server/Services/AIAgentTaskPullRequestService.ts +117 -0
- package/Server/Services/AIInsightService.ts +174 -0
- package/Server/Services/AIRunEventService.ts +63 -0
- package/Server/Services/AIRunService.ts +259 -1
- package/Server/Services/AIService.ts +249 -7
- package/Server/Services/AlertService.ts +4 -4
- package/Server/Services/CodeRepositoryService.ts +209 -0
- package/Server/Services/GlobalConfigService.ts +148 -0
- package/Server/Services/IncidentService.ts +183 -38
- package/Server/Services/IncidentStateTimelineService.ts +24 -4
- package/Server/Services/Index.ts +4 -4
- package/Server/Services/{AIAgentTaskLogService.ts → InstanceHealthLogService.ts} +1 -1
- package/Server/Services/LlmLogService.ts +27 -0
- package/Server/Services/LlmProviderService.ts +108 -0
- package/Server/Services/MetricBaselineService.ts +123 -0
- package/Server/Services/MonitorService.ts +15 -0
- package/Server/Services/TeamMemberService.ts +2 -0
- package/Server/Services/TelemetryExceptionService.ts +323 -116
- package/Server/Services/TraceAggregationService.ts +176 -0
- package/Server/Services/UserService.ts +10 -0
- package/Server/Types/Workflow/ComponentCode.ts +6 -0
- package/Server/Types/Workflow/Components/AI/GenerateText.ts +326 -0
- package/Server/Types/Workflow/Components/Index.ts +2 -0
- package/Server/Utils/AI/Chat/ObservabilityAssistant.ts +1 -1
- package/Server/Utils/AI/CodeFix/CodeAgentWorkspaceGuard.ts +71 -0
- package/Server/Utils/AI/CodeFix/CodeFixAgentCompletion.ts +243 -0
- package/Server/Utils/AI/CodeFix/CodeFixRunQueue.ts +131 -0
- package/Server/Utils/AI/CodeFix/FixRunBudget.ts +148 -0
- package/Server/Utils/AI/CodeFix/OpenPullRequestCap.ts +117 -0
- package/Server/Utils/AI/Eval/EvalCorpus.ts +369 -0
- package/Server/Utils/AI/Eval/EvalScores.ts +172 -0
- package/Server/Utils/AI/Eval/ReplayInvestigation.ts +87 -0
- package/Server/Utils/AI/PerfEvidence/SpanTreeAnalyzer.ts +676 -0
- package/Server/Utils/AI/{Sentinel/SentinelInvestigationEngine.ts → SRE/AIInvestigationEngine.ts} +58 -37
- package/Server/Utils/AI/{Sentinel/SentinelMemory.ts → SRE/AIMemory.ts} +3 -3
- package/Server/Utils/AI/{Sentinel → SRE}/AlertInvestigationRunner.ts +50 -20
- package/Server/Utils/AI/SRE/ConfidenceSignal.ts +293 -0
- package/Server/Utils/AI/SRE/FixFromIncidentTaskTrigger.ts +115 -0
- package/Server/Utils/AI/SRE/FixPerformanceTaskTrigger.ts +223 -0
- package/Server/Utils/AI/{Sentinel → SRE}/IncidentInvestigationRunner.ts +71 -21
- package/Server/Utils/AI/{Sentinel → SRE}/IncidentPostmortemRunner.ts +8 -8
- package/Server/Utils/AI/SRE/Insights/Detectors/ErrorLogSpikeDetector.ts +364 -0
- package/Server/Utils/AI/SRE/Insights/Detectors/ExceptionSpikeDetector.ts +317 -0
- package/Server/Utils/AI/SRE/Insights/Detectors/Index.ts +27 -0
- package/Server/Utils/AI/SRE/Insights/Detectors/MetricDriftDetector.ts +221 -0
- package/Server/Utils/AI/SRE/Insights/Detectors/NewExceptionDetector.ts +238 -0
- package/Server/Utils/AI/SRE/Insights/Detectors/TraceLatencyRegressionDetector.ts +521 -0
- package/Server/Utils/AI/SRE/Insights/FixRouting.ts +242 -0
- package/Server/Utils/AI/SRE/Insights/InsightScanner.ts +290 -0
- package/Server/Utils/AI/SRE/Insights/InsightStore.ts +283 -0
- package/Server/Utils/AI/SRE/Insights/InsightTriageRunner.ts +242 -0
- package/Server/Utils/AI/SRE/Insights/Triage.ts +162 -0
- package/Server/Utils/AI/SRE/Insights/Types.ts +49 -0
- package/Server/Utils/AI/SRE/InstrumentationTaskTrigger.ts +212 -0
- package/Server/Utils/AI/SRE/InvestigationGrader.ts +282 -0
- package/Server/Utils/AI/{Sentinel → SRE}/InvestigationQueue.ts +114 -19
- package/Server/Utils/AI/{Sentinel → SRE}/README.md +4 -4
- package/Server/Utils/AI/SRE/SubjectCodeFixRun.ts +172 -0
- package/Server/Utils/AI/Toolbox/{SentinelActionTools.ts → AIActionTools.ts} +22 -1
- package/Server/Utils/AI/Toolbox/Index.ts +2 -2
- package/Server/Utils/AnalyticsDatabase/ClickhouseCapacity.ts +526 -0
- package/Server/Utils/CodeRepository/GitHub/GitHub.ts +319 -1
- package/Server/Utils/CodeRepository/ServiceRepoLinkSuggester.ts +221 -0
- package/Server/Utils/CodeRepository/StackTraceRepoResolver.ts +571 -0
- package/Server/Utils/Execute.ts +2 -1
- package/Server/Utils/LLM/LLMService.ts +160 -30
- package/Server/Utils/Monitor/Criteria/SqlMonitorCriteria.ts +152 -0
- package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +29 -0
- package/Server/Utils/Monitor/MonitorCriteriaExpectationBuilder.ts +16 -6
- package/Server/Utils/Monitor/MonitorCriteriaMessageBuilder.ts +14 -0
- package/Server/Utils/Monitor/MonitorCriteriaMessageFormatter.ts +14 -3
- package/Server/Utils/Monitor/MonitorCriteriaObservationBuilder.ts +130 -12
- package/Tests/Server/Infrastructure/Queue.test.ts +227 -0
- package/Tests/Server/Infrastructure/SemaphorePermit.test.ts +159 -0
- package/Tests/Server/Services/AIAgentTaskPullRequestOutcomeStats.test.ts +154 -0
- package/Tests/Server/Services/AIInsightService.test.ts +324 -0
- package/Tests/Server/Services/AIRunCodeFixClaim.test.ts +401 -0
- package/Tests/Server/Services/AIRunHumanVerdict.test.ts +161 -0
- package/Tests/Server/Services/AIServiceDailyBudget.test.ts +95 -5
- package/Tests/Server/Services/AIServiceProjectAccess.test.ts +259 -0
- package/Tests/Server/Services/FixFromIncidentTaskTrigger.test.ts +249 -0
- package/Tests/Server/Services/FixPerformanceTaskTrigger.test.ts +274 -0
- package/Tests/Server/Services/GlobalConfigService.test.ts +80 -0
- package/Tests/Server/Services/IncidentInternalNoteAnnouncement.test.ts +1 -1
- package/Tests/Server/Services/InstrumentationTaskTrigger.test.ts +313 -0
- package/Tests/Server/Services/LlmProviderProjectOwned.test.ts +132 -0
- package/Tests/Server/Services/TelemetryExceptionAIFixReadiness.test.ts +405 -0
- package/Tests/Server/Services/TelemetryExceptionCodeFixRun.test.ts +322 -0
- package/Tests/Server/Services/TraceServiceLatencyProfile.test.ts +278 -0
- package/Tests/Server/Types/Workflow/Components/AIGenerateText.test.ts +722 -0
- package/Tests/Server/Utils/AI/{SentinelAlertGating.test.ts → AIAlertGating.test.ts} +19 -19
- package/Tests/Server/Utils/AI/AIConfidenceSignal.test.ts +362 -0
- package/Tests/Server/Utils/AI/{SentinelInvestigationQueue.test.ts → AIInvestigationQueue.test.ts} +19 -19
- package/Tests/Server/Utils/AI/CodeAgentWorkspaceGuard.test.ts +138 -0
- package/Tests/Server/Utils/AI/CodeFixAgentCompletion.test.ts +335 -0
- package/Tests/Server/Utils/AI/CodeFixRunQueue.test.ts +134 -0
- package/Tests/Server/Utils/AI/EvalCorpus.test.ts +209 -0
- package/Tests/Server/Utils/AI/EvalScores.test.ts +343 -0
- package/Tests/Server/Utils/AI/FixRunBudget.test.ts +218 -0
- package/Tests/Server/Utils/AI/Insights/ErrorLogSpikeDetector.test.ts +437 -0
- package/Tests/Server/Utils/AI/Insights/ExceptionSpikeDetector.test.ts +287 -0
- package/Tests/Server/Utils/AI/Insights/InsightDetectorsIndex.test.ts +34 -0
- package/Tests/Server/Utils/AI/Insights/InsightFixRouting.test.ts +572 -0
- package/Tests/Server/Utils/AI/Insights/InsightNeverThrowsHardening.test.ts +344 -0
- package/Tests/Server/Utils/AI/Insights/InsightScanner.test.ts +720 -0
- package/Tests/Server/Utils/AI/Insights/InsightStore.test.ts +467 -0
- package/Tests/Server/Utils/AI/Insights/InsightStoreHardening.test.ts +370 -0
- package/Tests/Server/Utils/AI/Insights/InsightTriage.test.ts +210 -0
- package/Tests/Server/Utils/AI/Insights/InsightTriageRunner.test.ts +221 -0
- package/Tests/Server/Utils/AI/Insights/InvestigationQueueInsightSubject.test.ts +328 -0
- package/Tests/Server/Utils/AI/Insights/MetricBaselineDrift.test.ts +182 -0
- package/Tests/Server/Utils/AI/Insights/MetricDriftDetector.test.ts +280 -0
- package/Tests/Server/Utils/AI/Insights/NewExceptionDetector.test.ts +259 -0
- package/Tests/Server/Utils/AI/Insights/TraceLatencyRegressionDetector.test.ts +770 -0
- package/Tests/Server/Utils/AI/InvestigationGrader.test.ts +343 -0
- package/Tests/Server/Utils/AI/LLMServiceRequestPolicy.test.ts +307 -0
- package/Tests/Server/Utils/AI/OpenPullRequestCap.test.ts +170 -0
- package/Tests/Server/Utils/AI/SpanTreeAnalyzer.test.ts +559 -0
- package/Tests/Server/Utils/AnalyticsDatabase/ClickhouseCapacity.test.ts +158 -0
- package/Tests/Server/Utils/GitHubCheckRunsConclusion.test.ts +100 -0
- package/Tests/Server/Utils/GitHubPullRequestStateMapping.test.ts +50 -0
- package/Tests/Server/Utils/Monitor/Criteria/SqlMonitorCriteria.test.ts +266 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaExpectationBuilderUnits.test.ts +553 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaMessageBuilderUnits.test.ts +590 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaMessageFormatterUnits.test.ts +254 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaObservationBuilderUnits.test.ts +821 -0
- package/Tests/Server/Utils/ServiceRepoLinkSuggester.test.ts +167 -0
- package/Tests/Server/Utils/StackTraceRepoResolver.test.ts +527 -0
- package/Tests/Types/AI/AIChatPermissionMode.test.ts +112 -0
- package/Tests/Types/AI/CodeFixTaskType.test.ts +152 -0
- package/Tests/Types/AI/FixPullRequestCiStatus.test.ts +181 -0
- package/Tests/Types/Monitor/MonitorStepSqlMonitor.test.ts +110 -0
- package/Tests/Types/Monitor/SqlDatabaseType.test.ts +55 -0
- package/Tests/Types/Workflow/AIGenerateTextMetadata.test.ts +180 -0
- package/Tests/UI/Components/TableBulkCsvExport.test.tsx +168 -0
- package/Tests/UI/Utils/TableColumnsToCsv.test.ts +523 -0
- package/Types/AI/AIChatTypes.ts +8 -0
- package/Types/AI/AIInsightEvidence.ts +77 -0
- package/Types/AI/AIInsightHumanVerdict.ts +15 -0
- package/Types/AI/AIInsightSeverity.ts +13 -0
- package/Types/AI/AIInsightStatus.ts +38 -0
- package/Types/AI/AIInsightType.ts +41 -0
- package/Types/AI/AIRunAutoGrade.ts +18 -0
- package/Types/AI/AIRunEventType.ts +5 -0
- package/Types/AI/AIRunHumanVerdict.ts +17 -0
- package/Types/AI/AIRunType.ts +6 -0
- package/Types/AI/CodeFixTaskContext.ts +88 -0
- package/Types/AI/CodeFixTaskType.ts +132 -0
- package/Types/AI/FixPullRequestCiStatus.ts +132 -0
- package/Types/BaseDatabase/AggregationIntervalUtil.ts +67 -0
- package/Types/Incident/IncidentMetricType.ts +7 -0
- package/Types/Monitor/CriteriaFilter.ts +8 -0
- package/Types/Monitor/MonitorCriteriaInstance.ts +67 -0
- package/Types/Monitor/MonitorStep.ts +38 -0
- package/Types/Monitor/MonitorStepSqlMonitor.ts +141 -0
- package/Types/Monitor/MonitorType.ts +17 -0
- package/Types/Monitor/SqlDatabaseType.ts +49 -0
- package/Types/Monitor/SqlMonitor/SqlMonitorResponse.ts +28 -0
- package/Types/Permission.ts +11 -95
- package/Types/Probe/ProbeMonitorResponse.ts +2 -0
- package/Types/Runbook/RunbookStep.ts +26 -2
- package/Types/Runbook/RunbookStepType.ts +1 -0
- package/Types/Workflow/Component.ts +13 -0
- package/Types/Workflow/ComponentID.ts +1 -0
- package/Types/Workflow/Components/AI.ts +148 -0
- package/Types/Workflow/Components.ts +8 -0
- package/UI/Components/AI/GenerateFromAIModal.tsx +1 -1
- package/UI/Components/Markdown.tsx/MarkdownViewer.tsx +11 -0
- package/UI/Components/MoreMenu/MoreMenu.tsx +1 -1
- package/UI/Components/Table/Table.tsx +38 -2
- package/UI/Utils/TableColumnsToCsv.ts +385 -0
- package/Utils/Monitor/MonitorMetricType.ts +1 -0
- package/build/dist/Models/DatabaseModels/AIAgentTaskPullRequest.js +59 -45
- package/build/dist/Models/DatabaseModels/AIAgentTaskPullRequest.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AIInsight.js +795 -0
- package/build/dist/Models/DatabaseModels/AIInsight.js.map +1 -0
- package/build/dist/Models/DatabaseModels/AIRun.js +274 -0
- package/build/dist/Models/DatabaseModels/AIRun.js.map +1 -1
- package/build/dist/Models/DatabaseModels/CodeRepository.js +43 -0
- package/build/dist/Models/DatabaseModels/CodeRepository.js.map +1 -1
- package/build/dist/Models/DatabaseModels/GlobalConfig.js +110 -0
- package/build/dist/Models/DatabaseModels/GlobalConfig.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +4 -8
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/InstanceHealthLog.js +304 -0
- package/build/dist/Models/DatabaseModels/InstanceHealthLog.js.map +1 -0
- package/build/dist/Models/DatabaseModels/LlmLog.js +35 -0
- package/build/dist/Models/DatabaseModels/LlmLog.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Project.js +127 -6
- package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Runbook.js +1 -1
- package/build/dist/Models/DatabaseModels/Runbook.js.map +1 -1
- package/build/dist/Models/DatabaseModels/User.js +46 -0
- package/build/dist/Models/DatabaseModels/User.js.map +1 -1
- package/build/dist/Server/API/AIAgentDataAPI.js +568 -85
- package/build/dist/Server/API/AIAgentDataAPI.js.map +1 -1
- package/build/dist/Server/API/AIAgentTaskAPI.js +100 -44
- package/build/dist/Server/API/AIAgentTaskAPI.js.map +1 -1
- package/build/dist/Server/API/AIAgentTaskLogAPI.js +49 -25
- package/build/dist/Server/API/AIAgentTaskLogAPI.js.map +1 -1
- package/build/dist/Server/API/AIAgentTaskPullRequestAPI.js +27 -0
- package/build/dist/Server/API/AIAgentTaskPullRequestAPI.js.map +1 -1
- package/build/dist/Server/API/AIInsightAPI.js +140 -0
- package/build/dist/Server/API/AIInsightAPI.js.map +1 -0
- package/build/dist/Server/API/AIInvestigationAPI.js +257 -1
- package/build/dist/Server/API/AIInvestigationAPI.js.map +1 -1
- package/build/dist/Server/API/CodeFixRunAPI.js +181 -0
- package/build/dist/Server/API/CodeFixRunAPI.js.map +1 -0
- package/build/dist/Server/API/GitHubAPI.js +164 -2
- package/build/dist/Server/API/GitHubAPI.js.map +1 -1
- package/build/dist/Server/API/TelemetryExceptionAPI.js +148 -43
- package/build/dist/Server/API/TelemetryExceptionAPI.js.map +1 -1
- package/build/dist/Server/EnvironmentConfig.js +1 -1
- package/build/dist/Server/EnvironmentConfig.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783943300000-DropServiceCodeRepository.js +23 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783943300000-DropServiceCodeRepository.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783947444597-CodeFixRunsOnAIRun.js +32 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783947444597-CodeFixRunsOnAIRun.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783950962813-AddCodeFixTaskType.js +16 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783950962813-AddCodeFixTaskType.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783954040984-AddInstrumentationFixTasksFlag.js +16 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783954040984-AddInstrumentationFixTasksFlag.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783957160597-MigrationName.js +24 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783957160597-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783958542237-AddTaskContextToAIRun.js +16 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783958542237-AddTaskContextToAIRun.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783965945957-AddInvestigationVerdictAndGrade.js +24 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783965945957-AddInvestigationVerdictAndGrade.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783970619301-AddFixGuardrailColumns.js +24 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783970619301-AddFixGuardrailColumns.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783970619302-DropLegacyAIAgentTaskTables.js +24 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783970619302-DropLegacyAIAgentTaskTables.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783977781677-AddCiStatusToFixPullRequests.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783977781677-AddCiStatusToFixPullRequests.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783990000000-AddCompletionTokensToLlmLog.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783990000000-AddCompletionTokensToLlmLog.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784010274993-AddSentinelInsight.js +32 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784010274993-AddSentinelInsight.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784010274994-AddSentinelInsightFlags.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784010274994-AddSentinelInsightFlags.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784030612266-RenameSentinelToAI.js +125 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784030612266-RenameSentinelToAI.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784033837629-MigrationName.js +62 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784033837629-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784048917994-AddCreatedByUserToUser.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784048917994-AddCreatedByUserToUser.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +32 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Infrastructure/Queue.js +73 -3
- package/build/dist/Server/Infrastructure/Queue.js.map +1 -1
- package/build/dist/Server/Infrastructure/Semaphore.js +44 -1
- package/build/dist/Server/Infrastructure/Semaphore.js.map +1 -1
- package/build/dist/Server/Middleware/MasterAdminAuthorization.js +26 -0
- package/build/dist/Server/Middleware/MasterAdminAuthorization.js.map +1 -1
- package/build/dist/Server/Middleware/ProjectAuthorization.js +40 -14
- package/build/dist/Server/Middleware/ProjectAuthorization.js.map +1 -1
- package/build/dist/Server/Services/AIAgentService.js +29 -0
- package/build/dist/Server/Services/AIAgentService.js.map +1 -1
- package/build/dist/Server/Services/AIAgentTaskPullRequestService.js +78 -0
- package/build/dist/Server/Services/AIAgentTaskPullRequestService.js.map +1 -1
- package/build/dist/Server/Services/AIInsightService.js +164 -0
- package/build/dist/Server/Services/AIInsightService.js.map +1 -0
- package/build/dist/Server/Services/AIRunEventService.js +49 -0
- package/build/dist/Server/Services/AIRunEventService.js.map +1 -1
- package/build/dist/Server/Services/AIRunService.js +221 -0
- package/build/dist/Server/Services/AIRunService.js.map +1 -1
- package/build/dist/Server/Services/AIService.js +198 -11
- package/build/dist/Server/Services/AIService.js.map +1 -1
- package/build/dist/Server/Services/AlertService.js +4 -4
- package/build/dist/Server/Services/AlertService.js.map +1 -1
- package/build/dist/Server/Services/CodeRepositoryService.js +180 -0
- package/build/dist/Server/Services/CodeRepositoryService.js.map +1 -1
- package/build/dist/Server/Services/GlobalConfigService.js +84 -0
- package/build/dist/Server/Services/GlobalConfigService.js.map +1 -1
- package/build/dist/Server/Services/IncidentService.js +149 -37
- package/build/dist/Server/Services/IncidentService.js.map +1 -1
- package/build/dist/Server/Services/IncidentStateTimelineService.js +24 -4
- package/build/dist/Server/Services/IncidentStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +4 -4
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/{AIAgentTaskLogService.js → InstanceHealthLogService.js} +2 -2
- package/build/dist/Server/Services/InstanceHealthLogService.js.map +1 -0
- package/build/dist/Server/Services/LlmLogService.js +23 -0
- package/build/dist/Server/Services/LlmLogService.js.map +1 -1
- package/build/dist/Server/Services/LlmProviderService.js +96 -0
- package/build/dist/Server/Services/LlmProviderService.js.map +1 -1
- package/build/dist/Server/Services/MetricBaselineService.js +65 -0
- package/build/dist/Server/Services/MetricBaselineService.js.map +1 -1
- package/build/dist/Server/Services/MonitorService.js +9 -1
- package/build/dist/Server/Services/MonitorService.js.map +1 -1
- package/build/dist/Server/Services/TeamMemberService.js +2 -0
- package/build/dist/Server/Services/TeamMemberService.js.map +1 -1
- package/build/dist/Server/Services/TelemetryExceptionService.js +243 -82
- package/build/dist/Server/Services/TelemetryExceptionService.js.map +1 -1
- package/build/dist/Server/Services/TraceAggregationService.js +124 -0
- package/build/dist/Server/Services/TraceAggregationService.js.map +1 -1
- package/build/dist/Server/Services/UserService.js +8 -0
- package/build/dist/Server/Services/UserService.js.map +1 -1
- package/build/dist/Server/Types/Workflow/ComponentCode.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/AI/GenerateText.js +240 -0
- package/build/dist/Server/Types/Workflow/Components/AI/GenerateText.js.map +1 -0
- package/build/dist/Server/Types/Workflow/Components/Index.js +2 -0
- package/build/dist/Server/Types/Workflow/Components/Index.js.map +1 -1
- package/build/dist/Server/Utils/AI/CodeFix/CodeAgentWorkspaceGuard.js +48 -0
- package/build/dist/Server/Utils/AI/CodeFix/CodeAgentWorkspaceGuard.js.map +1 -0
- package/build/dist/Server/Utils/AI/CodeFix/CodeFixAgentCompletion.js +174 -0
- package/build/dist/Server/Utils/AI/CodeFix/CodeFixAgentCompletion.js.map +1 -0
- package/build/dist/Server/Utils/AI/CodeFix/CodeFixRunQueue.js +126 -0
- package/build/dist/Server/Utils/AI/CodeFix/CodeFixRunQueue.js.map +1 -0
- package/build/dist/Server/Utils/AI/CodeFix/FixRunBudget.js +131 -0
- package/build/dist/Server/Utils/AI/CodeFix/FixRunBudget.js.map +1 -0
- package/build/dist/Server/Utils/AI/CodeFix/OpenPullRequestCap.js +99 -0
- package/build/dist/Server/Utils/AI/CodeFix/OpenPullRequestCap.js.map +1 -0
- package/build/dist/Server/Utils/AI/Eval/EvalCorpus.js +245 -0
- package/build/dist/Server/Utils/AI/Eval/EvalCorpus.js.map +1 -0
- package/build/dist/Server/Utils/AI/Eval/EvalScores.js +83 -0
- package/build/dist/Server/Utils/AI/Eval/EvalScores.js.map +1 -0
- package/build/dist/Server/Utils/AI/Eval/ReplayInvestigation.js +12 -0
- package/build/dist/Server/Utils/AI/Eval/ReplayInvestigation.js.map +1 -0
- package/build/dist/Server/Utils/AI/PerfEvidence/SpanTreeAnalyzer.js +439 -0
- package/build/dist/Server/Utils/AI/PerfEvidence/SpanTreeAnalyzer.js.map +1 -0
- package/build/dist/Server/Utils/AI/{Sentinel/SentinelInvestigationEngine.js → SRE/AIInvestigationEngine.js} +47 -31
- package/build/dist/Server/Utils/AI/SRE/AIInvestigationEngine.js.map +1 -0
- package/build/dist/Server/Utils/AI/{Sentinel/SentinelMemory.js → SRE/AIMemory.js} +5 -5
- package/build/dist/Server/Utils/AI/SRE/AIMemory.js.map +1 -0
- package/build/dist/Server/Utils/AI/{Sentinel → SRE}/AlertInvestigationRunner.js +42 -19
- package/build/dist/Server/Utils/AI/SRE/AlertInvestigationRunner.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/ConfidenceSignal.js +226 -0
- package/build/dist/Server/Utils/AI/SRE/ConfidenceSignal.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/FixFromIncidentTaskTrigger.js +100 -0
- package/build/dist/Server/Utils/AI/SRE/FixFromIncidentTaskTrigger.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/FixPerformanceTaskTrigger.js +174 -0
- package/build/dist/Server/Utils/AI/SRE/FixPerformanceTaskTrigger.js.map +1 -0
- package/build/dist/Server/Utils/AI/{Sentinel → SRE}/IncidentInvestigationRunner.js +60 -22
- package/build/dist/Server/Utils/AI/SRE/IncidentInvestigationRunner.js.map +1 -0
- package/build/dist/Server/Utils/AI/{Sentinel → SRE}/IncidentPostmortemRunner.js +9 -9
- package/build/dist/Server/Utils/AI/SRE/IncidentPostmortemRunner.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Detectors/ErrorLogSpikeDetector.js +268 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Detectors/ErrorLogSpikeDetector.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Detectors/ExceptionSpikeDetector.js +226 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Detectors/ExceptionSpikeDetector.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Detectors/Index.js +26 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Detectors/Index.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Detectors/MetricDriftDetector.js +159 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Detectors/MetricDriftDetector.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Detectors/NewExceptionDetector.js +177 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Detectors/NewExceptionDetector.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Detectors/TraceLatencyRegressionDetector.js +384 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Detectors/TraceLatencyRegressionDetector.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/FixRouting.js +180 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/FixRouting.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/InsightScanner.js +269 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/InsightScanner.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/InsightStore.js +231 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/InsightStore.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/InsightTriageRunner.js +206 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/InsightTriageRunner.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Triage.js +121 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Triage.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Types.js +2 -0
- package/build/dist/Server/Utils/AI/SRE/Insights/Types.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/InstrumentationTaskTrigger.js +148 -0
- package/build/dist/Server/Utils/AI/SRE/InstrumentationTaskTrigger.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/InvestigationGrader.js +231 -0
- package/build/dist/Server/Utils/AI/SRE/InvestigationGrader.js.map +1 -0
- package/build/dist/Server/Utils/AI/{Sentinel → SRE}/InvestigationQueue.js +102 -23
- package/build/dist/Server/Utils/AI/SRE/InvestigationQueue.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/SubjectCodeFixRun.js +167 -0
- package/build/dist/Server/Utils/AI/SRE/SubjectCodeFixRun.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/{SentinelActionTools.js → AIActionTools.js} +18 -2
- package/build/dist/Server/Utils/AI/Toolbox/AIActionTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/Index.js +2 -2
- package/build/dist/Server/Utils/AI/Toolbox/Index.js.map +1 -1
- package/build/dist/Server/Utils/AnalyticsDatabase/ClickhouseCapacity.js +301 -0
- package/build/dist/Server/Utils/AnalyticsDatabase/ClickhouseCapacity.js.map +1 -0
- package/build/dist/Server/Utils/CodeRepository/GitHub/GitHub.js +240 -2
- package/build/dist/Server/Utils/CodeRepository/GitHub/GitHub.js.map +1 -1
- package/build/dist/Server/Utils/CodeRepository/ServiceRepoLinkSuggester.js +127 -0
- package/build/dist/Server/Utils/CodeRepository/ServiceRepoLinkSuggester.js.map +1 -0
- package/build/dist/Server/Utils/CodeRepository/StackTraceRepoResolver.js +336 -0
- package/build/dist/Server/Utils/CodeRepository/StackTraceRepoResolver.js.map +1 -0
- package/build/dist/Server/Utils/Execute.js.map +1 -1
- package/build/dist/Server/Utils/LLM/LLMService.js +125 -25
- package/build/dist/Server/Utils/LLM/LLMService.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/SqlMonitorCriteria.js +120 -0
- package/build/dist/Server/Utils/Monitor/Criteria/SqlMonitorCriteria.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +21 -0
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaExpectationBuilder.js +15 -7
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaExpectationBuilder.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaMessageBuilder.js +12 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaMessageBuilder.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaMessageFormatter.js +8 -3
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaMessageFormatter.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaObservationBuilder.js +96 -12
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaObservationBuilder.js.map +1 -1
- package/build/dist/Types/AI/AIInsightEvidence.js +2 -0
- package/build/dist/Types/AI/AIInsightEvidence.js.map +1 -0
- package/build/dist/Types/AI/AIInsightHumanVerdict.js +16 -0
- package/build/dist/Types/AI/AIInsightHumanVerdict.js.map +1 -0
- package/build/dist/Types/AI/AIInsightSeverity.js +14 -0
- package/build/dist/Types/AI/AIInsightSeverity.js.map +1 -0
- package/build/dist/Types/AI/AIInsightStatus.js +36 -0
- package/build/dist/Types/AI/AIInsightStatus.js.map +1 -0
- package/build/dist/Types/AI/AIInsightType.js +42 -0
- package/build/dist/Types/AI/AIInsightType.js.map +1 -0
- package/build/dist/Types/AI/AIRunAutoGrade.js +19 -0
- package/build/dist/Types/AI/AIRunAutoGrade.js.map +1 -0
- package/build/dist/Types/AI/AIRunEventType.js +5 -0
- package/build/dist/Types/AI/AIRunEventType.js.map +1 -1
- package/build/dist/Types/AI/AIRunHumanVerdict.js +18 -0
- package/build/dist/Types/AI/AIRunHumanVerdict.js.map +1 -0
- package/build/dist/Types/AI/AIRunType.js +6 -0
- package/build/dist/Types/AI/AIRunType.js.map +1 -1
- package/build/dist/Types/AI/CodeFixTaskContext.js +29 -0
- package/build/dist/Types/AI/CodeFixTaskContext.js.map +1 -0
- package/build/dist/Types/AI/CodeFixTaskType.js +122 -0
- package/build/dist/Types/AI/CodeFixTaskType.js.map +1 -0
- package/build/dist/Types/AI/FixPullRequestCiStatus.js +102 -0
- package/build/dist/Types/AI/FixPullRequestCiStatus.js.map +1 -0
- package/build/dist/Types/BaseDatabase/AggregationIntervalUtil.js +55 -0
- package/build/dist/Types/BaseDatabase/AggregationIntervalUtil.js.map +1 -1
- package/build/dist/Types/Incident/IncidentMetricType.js +7 -0
- package/build/dist/Types/Incident/IncidentMetricType.js.map +1 -1
- package/build/dist/Types/Monitor/CriteriaFilter.js +7 -0
- package/build/dist/Types/Monitor/CriteriaFilter.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorCriteriaInstance.js +62 -0
- package/build/dist/Types/Monitor/MonitorCriteriaInstance.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStep.js +28 -0
- package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStepSqlMonitor.js +93 -0
- package/build/dist/Types/Monitor/MonitorStepSqlMonitor.js.map +1 -0
- package/build/dist/Types/Monitor/MonitorType.js +15 -0
- package/build/dist/Types/Monitor/MonitorType.js.map +1 -1
- package/build/dist/Types/Monitor/SqlDatabaseType.js +47 -0
- package/build/dist/Types/Monitor/SqlDatabaseType.js.map +1 -0
- package/build/dist/Types/Monitor/SqlMonitor/SqlMonitorResponse.js +2 -0
- package/build/dist/Types/Monitor/SqlMonitor/SqlMonitorResponse.js.map +1 -0
- package/build/dist/Types/Permission.js +10 -84
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/Runbook/RunbookStepType.js +1 -0
- package/build/dist/Types/Runbook/RunbookStepType.js.map +1 -1
- package/build/dist/Types/Workflow/ComponentID.js +1 -0
- package/build/dist/Types/Workflow/ComponentID.js.map +1 -1
- package/build/dist/Types/Workflow/Components/AI.js +135 -0
- package/build/dist/Types/Workflow/Components/AI.js.map +1 -0
- package/build/dist/Types/Workflow/Components.js +7 -0
- package/build/dist/Types/Workflow/Components.js.map +1 -1
- package/build/dist/UI/Components/AI/GenerateFromAIModal.js +1 -1
- package/build/dist/UI/Components/AI/GenerateFromAIModal.js.map +1 -1
- package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js +9 -0
- package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js.map +1 -1
- package/build/dist/UI/Components/MoreMenu/MoreMenu.js +1 -1
- package/build/dist/UI/Components/Table/Table.js +28 -2
- package/build/dist/UI/Components/Table/Table.js.map +1 -1
- package/build/dist/UI/Utils/TableColumnsToCsv.js +291 -0
- package/build/dist/UI/Utils/TableColumnsToCsv.js.map +1 -0
- package/build/dist/Utils/Monitor/MonitorMetricType.js +1 -0
- package/build/dist/Utils/Monitor/MonitorMetricType.js.map +1 -1
- package/package.json +1 -1
- package/Models/DatabaseModels/AIAgentTask.ts +0 -660
- package/Models/DatabaseModels/AIAgentTaskLog.ts +0 -426
- package/Models/DatabaseModels/AIAgentTaskTelemetryException.ts +0 -399
- package/Models/DatabaseModels/ServiceCodeRepository.ts +0 -647
- package/Server/Services/AIAgentTaskService.ts +0 -240
- package/Server/Services/AIAgentTaskTelemetryExceptionService.ts +0 -39
- package/Server/Services/ServiceCodeRepositoryService.ts +0 -55
- package/Tests/Server/Services/AIAgentTaskServiceClaim.test.ts +0 -146
- package/Types/AI/AIAgentTaskMetadata.ts +0 -25
- package/Types/AI/AIAgentTaskType.ts +0 -40
- package/build/dist/Models/DatabaseModels/AIAgentTask.js +0 -691
- package/build/dist/Models/DatabaseModels/AIAgentTask.js.map +0 -1
- package/build/dist/Models/DatabaseModels/AIAgentTaskLog.js +0 -447
- package/build/dist/Models/DatabaseModels/AIAgentTaskLog.js.map +0 -1
- package/build/dist/Models/DatabaseModels/AIAgentTaskTelemetryException.js +0 -415
- package/build/dist/Models/DatabaseModels/AIAgentTaskTelemetryException.js.map +0 -1
- package/build/dist/Models/DatabaseModels/ServiceCodeRepository.js +0 -665
- package/build/dist/Models/DatabaseModels/ServiceCodeRepository.js.map +0 -1
- package/build/dist/Server/Services/AIAgentTaskLogService.js.map +0 -1
- package/build/dist/Server/Services/AIAgentTaskService.js +0 -217
- package/build/dist/Server/Services/AIAgentTaskService.js.map +0 -1
- package/build/dist/Server/Services/AIAgentTaskTelemetryExceptionService.js +0 -36
- package/build/dist/Server/Services/AIAgentTaskTelemetryExceptionService.js.map +0 -1
- package/build/dist/Server/Services/ServiceCodeRepositoryService.js +0 -54
- package/build/dist/Server/Services/ServiceCodeRepositoryService.js.map +0 -1
- package/build/dist/Server/Utils/AI/Sentinel/AlertInvestigationRunner.js.map +0 -1
- package/build/dist/Server/Utils/AI/Sentinel/IncidentInvestigationRunner.js.map +0 -1
- package/build/dist/Server/Utils/AI/Sentinel/IncidentPostmortemRunner.js.map +0 -1
- package/build/dist/Server/Utils/AI/Sentinel/InvestigationQueue.js.map +0 -1
- package/build/dist/Server/Utils/AI/Sentinel/SentinelInvestigationEngine.js.map +0 -1
- package/build/dist/Server/Utils/AI/Sentinel/SentinelMemory.js.map +0 -1
- package/build/dist/Server/Utils/AI/Toolbox/SentinelActionTools.js.map +0 -1
- package/build/dist/Types/AI/AIAgentTaskMetadata.js +0 -6
- package/build/dist/Types/AI/AIAgentTaskMetadata.js.map +0 -1
- package/build/dist/Types/AI/AIAgentTaskType.js +0 -29
- package/build/dist/Types/AI/AIAgentTaskType.js.map +0 -1
|
@@ -7,6 +7,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
+
import OneUptimeDate from "../../Types/Date";
|
|
11
|
+
import AIRunStatus from "../../Types/AI/AIRunStatus";
|
|
12
|
+
import AIRunType from "../../Types/AI/AIRunType";
|
|
13
|
+
import BadDataException from "../../Types/Exception/BadDataException";
|
|
14
|
+
import CodeFixTaskType, { CodeFixContextKind, CodeFixTaskTypeHelper, } from "../../Types/AI/CodeFixTaskType";
|
|
15
|
+
import SortOrder from "../../Types/BaseDatabase/SortOrder";
|
|
16
|
+
import QueryHelper from "../Types/Database/QueryHelper";
|
|
10
17
|
import DatabaseService from "./DatabaseService";
|
|
11
18
|
import Model from "../../Models/DatabaseModels/AIRun";
|
|
12
19
|
import { pinQueryToRequestingUser } from "../Utils/AI/AIChatPrivacyFilter";
|
|
@@ -42,6 +49,202 @@ export class Service extends DatabaseService {
|
|
|
42
49
|
const result = await queryBuilder.execute();
|
|
43
50
|
return result.affected || 0;
|
|
44
51
|
}
|
|
52
|
+
/*
|
|
53
|
+
* Atomically claim the oldest Queued code-fix run for an external agent
|
|
54
|
+
* worker (the /ai-agent-task/get-pending-task route). The Queued -> Running
|
|
55
|
+
* transition is the same status+attemptCount-guarded CAS the investigation
|
|
56
|
+
* queue uses, so concurrent agents can never receive the same run. The
|
|
57
|
+
* returned run is already Running, heartbeated, and owned by the agent.
|
|
58
|
+
*
|
|
59
|
+
* A claimed run missing its recipe's trigger record cannot be executed —
|
|
60
|
+
* it is finalized as Error and the loop moves on to the next candidate.
|
|
61
|
+
* Which record that is depends on the recipe's context kind:
|
|
62
|
+
* exception-based recipes need triggeredByTelemetryExceptionId,
|
|
63
|
+
* ImproveInstrumentation / FixFromIncident run against the incident/alert
|
|
64
|
+
* whose investigation triggered them, and FixPerformance carries its
|
|
65
|
+
* trace evidence in taskContext (no subject row at all).
|
|
66
|
+
*/
|
|
67
|
+
async claimNextQueuedCodeFixRun(data) {
|
|
68
|
+
var _a;
|
|
69
|
+
const maxClaimAttempts = 5;
|
|
70
|
+
for (let attempt = 0; attempt < maxClaimAttempts; attempt++) {
|
|
71
|
+
const run = await this.findOneBy({
|
|
72
|
+
query: {
|
|
73
|
+
runType: AIRunType.CodeFix,
|
|
74
|
+
status: AIRunStatus.Queued,
|
|
75
|
+
},
|
|
76
|
+
sort: {
|
|
77
|
+
createdAt: SortOrder.Ascending,
|
|
78
|
+
},
|
|
79
|
+
select: {
|
|
80
|
+
_id: true,
|
|
81
|
+
projectId: true,
|
|
82
|
+
triggeredByTelemetryExceptionId: true,
|
|
83
|
+
triggeredByIncidentId: true,
|
|
84
|
+
triggeredByAlertId: true,
|
|
85
|
+
attemptCount: true,
|
|
86
|
+
codeFixTaskType: true,
|
|
87
|
+
taskContext: true,
|
|
88
|
+
},
|
|
89
|
+
props: {
|
|
90
|
+
isRoot: true,
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
if (!run || !run.id) {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
const claimedCount = await this.attemptStatusTransition({
|
|
97
|
+
aiRunId: run.id,
|
|
98
|
+
fromStatus: AIRunStatus.Queued,
|
|
99
|
+
expectedAttemptCount: run.attemptCount || 0,
|
|
100
|
+
set: {
|
|
101
|
+
status: AIRunStatus.Running,
|
|
102
|
+
startedAt: OneUptimeDate.getCurrentDate(),
|
|
103
|
+
lastHeartbeatAt: OneUptimeDate.getCurrentDate(),
|
|
104
|
+
attemptCount: (run.attemptCount || 0) + 1,
|
|
105
|
+
aiAgentId: data.aiAgentId.toString(),
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
if (claimedCount === 0) {
|
|
109
|
+
// Another agent won this run — try the next candidate.
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
/*
|
|
113
|
+
* Normalize the task recipe BEFORE the executability guard: a null
|
|
114
|
+
* codeFixTaskType means FixException (rows created before task
|
|
115
|
+
* recipes existed), the worker dispatches on this value, and the
|
|
116
|
+
* guard below is recipe-dependent.
|
|
117
|
+
*/
|
|
118
|
+
run.codeFixTaskType = CodeFixTaskTypeHelper.fromDatabaseValue(run.codeFixTaskType);
|
|
119
|
+
/*
|
|
120
|
+
* Recipe-dependent executability guard, grouped by the recipe's
|
|
121
|
+
* context kind: exception-based recipes are unexecutable without
|
|
122
|
+
* their telemetry exception; recipes whose subject is an
|
|
123
|
+
* incident/alert (ImproveInstrumentation, FixFromIncident)
|
|
124
|
+
* legitimately carry NO exception id; and FixPerformance carries
|
|
125
|
+
* neither — its trace evidence lives in taskContext. Rejecting a
|
|
126
|
+
* kind for lacking another kind's record would Error every run its
|
|
127
|
+
* trigger enqueues.
|
|
128
|
+
*/
|
|
129
|
+
const contextKind = CodeFixTaskTypeHelper.getContextKind(run.codeFixTaskType);
|
|
130
|
+
let missingContextMessage = null;
|
|
131
|
+
if (contextKind === CodeFixContextKind.TelemetryException) {
|
|
132
|
+
missingContextMessage = run.triggeredByTelemetryExceptionId
|
|
133
|
+
? null
|
|
134
|
+
: "Queued code-fix run has no telemetry exception to fix.";
|
|
135
|
+
}
|
|
136
|
+
else if (contextKind === CodeFixContextKind.IncidentOrAlertSubject) {
|
|
137
|
+
missingContextMessage =
|
|
138
|
+
run.triggeredByIncidentId || run.triggeredByAlertId
|
|
139
|
+
? null
|
|
140
|
+
: "Queued code-fix run has no incident or alert subject.";
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
missingContextMessage = ((_a = run.taskContext) === null || _a === void 0 ? void 0 : _a.traceId)
|
|
144
|
+
? null
|
|
145
|
+
: "Queued code-fix run has no trace evidence in its task context.";
|
|
146
|
+
}
|
|
147
|
+
if (missingContextMessage) {
|
|
148
|
+
await this.attemptStatusTransition({
|
|
149
|
+
aiRunId: run.id,
|
|
150
|
+
fromStatus: AIRunStatus.Running,
|
|
151
|
+
set: {
|
|
152
|
+
status: AIRunStatus.Error,
|
|
153
|
+
completedAt: OneUptimeDate.getCurrentDate(),
|
|
154
|
+
errorMessage: missingContextMessage,
|
|
155
|
+
},
|
|
156
|
+
});
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
return run;
|
|
160
|
+
}
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
/*
|
|
164
|
+
* The latest CodeFix run of EACH task recipe for an exception — at most
|
|
165
|
+
* one run per CodeFixTaskType, newest first (so the first element is the
|
|
166
|
+
* latest run overall). Backs /telemetry-exception/get-ai-agent-task: the
|
|
167
|
+
* exception page must show a FixException run and a WriteRegressionTest
|
|
168
|
+
* run side by side, not just whichever was created last.
|
|
169
|
+
*
|
|
170
|
+
* codeFixTaskType is normalized on the returned models: legacy null rows
|
|
171
|
+
* come back as FixException.
|
|
172
|
+
*/
|
|
173
|
+
async getLatestCodeFixRunPerTaskType(data) {
|
|
174
|
+
const taskTypes = Object.values(CodeFixTaskType);
|
|
175
|
+
const latestRuns = await Promise.all(taskTypes.map((taskType) => {
|
|
176
|
+
return this.findOneBy({
|
|
177
|
+
query: {
|
|
178
|
+
runType: AIRunType.CodeFix,
|
|
179
|
+
triggeredByTelemetryExceptionId: data.telemetryExceptionId,
|
|
180
|
+
// Null means FixException — see the class comment above.
|
|
181
|
+
codeFixTaskType: taskType === CodeFixTaskType.FixException
|
|
182
|
+
? QueryHelper.equalToOrNull(CodeFixTaskType.FixException)
|
|
183
|
+
: taskType,
|
|
184
|
+
},
|
|
185
|
+
select: {
|
|
186
|
+
_id: true,
|
|
187
|
+
status: true,
|
|
188
|
+
errorMessage: true,
|
|
189
|
+
createdAt: true,
|
|
190
|
+
codeFixTaskType: true,
|
|
191
|
+
},
|
|
192
|
+
sort: {
|
|
193
|
+
createdAt: SortOrder.Descending,
|
|
194
|
+
},
|
|
195
|
+
props: {
|
|
196
|
+
isRoot: true,
|
|
197
|
+
},
|
|
198
|
+
});
|
|
199
|
+
}));
|
|
200
|
+
const runs = latestRuns.filter((run) => {
|
|
201
|
+
return Boolean(run);
|
|
202
|
+
});
|
|
203
|
+
for (const run of runs) {
|
|
204
|
+
run.codeFixTaskType = CodeFixTaskTypeHelper.fromDatabaseValue(run.codeFixTaskType);
|
|
205
|
+
}
|
|
206
|
+
runs.sort((a, b) => {
|
|
207
|
+
var _a, _b;
|
|
208
|
+
return (((_a = b.createdAt) === null || _a === void 0 ? void 0 : _a.getTime()) || 0) - (((_b = a.createdAt) === null || _b === void 0 ? void 0 : _b.getTime()) || 0);
|
|
209
|
+
});
|
|
210
|
+
return runs;
|
|
211
|
+
}
|
|
212
|
+
/*
|
|
213
|
+
* Measurement layer (Phase 2): record a human's one-click verdict
|
|
214
|
+
* (Confirmed / Rejected) on the LATEST COMPLETED investigation run for an
|
|
215
|
+
* incident or alert. Overwriting an existing verdict is deliberate — a
|
|
216
|
+
* user may change their mind; the verdict is per-run state, not an audit
|
|
217
|
+
* trail. Throws when no completed investigation exists for the subject.
|
|
218
|
+
* Callers must have already access-checked the subject under the USER's
|
|
219
|
+
* permissions — this method reads and writes as root (investigation runs
|
|
220
|
+
* are system-authored, so the per-user privacy pin would hide them).
|
|
221
|
+
*/
|
|
222
|
+
async applyHumanVerdictToLatestInvestigation(data) {
|
|
223
|
+
if (!data.incidentId && !data.alertId) {
|
|
224
|
+
throw new BadDataException("An incident or alert subject is required to record a verdict.");
|
|
225
|
+
}
|
|
226
|
+
const run = await this.findOneBy({
|
|
227
|
+
query: Object.assign({ runType: AIRunType.Investigation, status: AIRunStatus.Completed }, (data.incidentId
|
|
228
|
+
? { triggeredByIncidentId: data.incidentId }
|
|
229
|
+
: { triggeredByAlertId: data.alertId })),
|
|
230
|
+
select: { _id: true },
|
|
231
|
+
sort: { createdAt: SortOrder.Descending },
|
|
232
|
+
props: { isRoot: true },
|
|
233
|
+
});
|
|
234
|
+
if (!run || !run.id) {
|
|
235
|
+
throw new BadDataException("No completed AI investigation exists for this subject yet — a verdict can only be recorded on a completed investigation.");
|
|
236
|
+
}
|
|
237
|
+
await this.updateOneById({
|
|
238
|
+
id: run.id,
|
|
239
|
+
data: {
|
|
240
|
+
humanVerdict: data.verdict,
|
|
241
|
+
humanVerdictAt: OneUptimeDate.getCurrentDate(),
|
|
242
|
+
humanVerdictByUserId: data.verdictByUserId,
|
|
243
|
+
},
|
|
244
|
+
props: { isRoot: true },
|
|
245
|
+
});
|
|
246
|
+
return { runId: run.id, verdict: data.verdict };
|
|
247
|
+
}
|
|
45
248
|
async onBeforeFind(findBy) {
|
|
46
249
|
findBy.query = pinQueryToRequestingUser(findBy.query, findBy.props, "userId");
|
|
47
250
|
return { findBy, carryForward: null };
|
|
@@ -57,6 +260,24 @@ __decorate([
|
|
|
57
260
|
__metadata("design:paramtypes", [Object]),
|
|
58
261
|
__metadata("design:returntype", Promise)
|
|
59
262
|
], Service.prototype, "attemptStatusTransition", null);
|
|
263
|
+
__decorate([
|
|
264
|
+
CaptureSpan(),
|
|
265
|
+
__metadata("design:type", Function),
|
|
266
|
+
__metadata("design:paramtypes", [Object]),
|
|
267
|
+
__metadata("design:returntype", Promise)
|
|
268
|
+
], Service.prototype, "claimNextQueuedCodeFixRun", null);
|
|
269
|
+
__decorate([
|
|
270
|
+
CaptureSpan(),
|
|
271
|
+
__metadata("design:type", Function),
|
|
272
|
+
__metadata("design:paramtypes", [Object]),
|
|
273
|
+
__metadata("design:returntype", Promise)
|
|
274
|
+
], Service.prototype, "getLatestCodeFixRunPerTaskType", null);
|
|
275
|
+
__decorate([
|
|
276
|
+
CaptureSpan(),
|
|
277
|
+
__metadata("design:type", Function),
|
|
278
|
+
__metadata("design:paramtypes", [Object]),
|
|
279
|
+
__metadata("design:returntype", Promise)
|
|
280
|
+
], Service.prototype, "applyHumanVerdictToLatestInvestigation", null);
|
|
60
281
|
__decorate([
|
|
61
282
|
CaptureSpan(),
|
|
62
283
|
__metadata("design:type", Function),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AIRunService.js","sourceRoot":"","sources":["../../../../Server/Services/AIRunService.ts"],"names":[],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"AIRunService.js","sourceRoot":"","sources":["../../../../Server/Services/AIRunService.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,aAAa,MAAM,kBAAk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V,IAAI,EAAE;gBACJ,YAAY,EAAE,IAAI,CAAC,OAAO;gBAC1B,cAAc,EAAE,aAAa,CAAC,cAAc,EAAE;gBAC9C,oBAAoB,EAAE,IAAI,CAAC,eAAe;aAC3C;YACD,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;SACxB,CAAC,CAAC;QAEH,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;IAClD,CAAC;IAEkB,KAAK,CAAC,YAAY,CACnC,MAAqB;QAErB,MAAM,CAAC,KAAK,GAAG,wBAAwB,CACrC,MAAM,CAAC,KAAK,EACZ,MAAM,CAAC,KAAK,EACZ,QAAQ,CACT,CAAC;QACF,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;IACxC,CAAC;IAGqB,AAAN,KAAK,CAAC,OAAO,CAC3B,OAAuB;QAEvB,OAAO,CAAC,KAAK,GAAG,wBAAwB,CACtC,OAAO,CAAC,KAAK,EACb,OAAO,CAAC,KAAK,EACb,QAAQ,CACT,CAAC;QACF,OAAO,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;CACF;AApSc;IADZ,WAAW,EAAE;;;;sDAwBb;AAkBY;IADZ,WAAW,EAAE;;;;wDA6Gb;AAaY;IADZ,WAAW,EAAE;;;;6DAoDb;AAaY;IADZ,WAAW,EAAE;;;;qEA2Cb;AAcqB;IADrB,WAAW,EAAE;;;;sCAUb;AAGH,eAAe,IAAI,OAAO,EAAE,CAAC"}
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { IsBillingEnabled } from "../EnvironmentConfig";
|
|
10
|
+
import { getAllEnvVars, IsBillingEnabled } from "../EnvironmentConfig";
|
|
11
11
|
import BaseService from "./BaseService";
|
|
12
12
|
import LlmProviderService from "./LlmProviderService";
|
|
13
13
|
import LlmLogService from "./LlmLogService";
|
|
@@ -20,23 +20,197 @@ import LlmLogStatus from "../../Types/LlmLogStatus";
|
|
|
20
20
|
import ObjectID from "../../Types/ObjectID";
|
|
21
21
|
import OneUptimeDate from "../../Types/Date";
|
|
22
22
|
import BadDataException from "../../Types/Exception/BadDataException";
|
|
23
|
+
import PaymentRequiredException from "../../Types/Exception/PaymentRequiredException";
|
|
24
|
+
import SubscriptionPlan, { PlanType, } from "../../Types/Billing/SubscriptionPlan";
|
|
23
25
|
import CaptureSpan from "../Utils/Telemetry/CaptureSpan";
|
|
24
26
|
import logger from "../Utils/Logger";
|
|
27
|
+
/*
|
|
28
|
+
* ============================ LlmLog feature labels ==========================
|
|
29
|
+
*
|
|
30
|
+
* EVERY constant below is a PERSISTED VALUE, not just a display string. Each
|
|
31
|
+
* one is written verbatim into LlmLog.feature by the call site that owns it,
|
|
32
|
+
* and the G4 daily autonomous token budget reads it back by matching those
|
|
33
|
+
* PERSISTED STRINGS against AUTONOMOUS_AI_FEATURES:
|
|
34
|
+
*
|
|
35
|
+
* SELECT SUM("totalTokens") FROM "LlmLog"
|
|
36
|
+
* WHERE "projectId" = $1 AND "createdAt" >= $2 AND "feature" = ANY($3)
|
|
37
|
+
* -- LlmLogService.getTotalTokensUsedSince, $3 = AUTONOMOUS_AI_FEATURES
|
|
38
|
+
*
|
|
39
|
+
* So a label is a piece of the budget's ledger. Renaming one rewrites history:
|
|
40
|
+
* rows written under the old label stop matching, usedTokensToday collapses
|
|
41
|
+
* toward zero, and a project that had already exhausted its daily budget
|
|
42
|
+
* silently gets a fresh full one — unbounded overspend, with no error anywhere.
|
|
43
|
+
*
|
|
44
|
+
* RENAMING A LABEL THEREFORE REQUIRES BOTH:
|
|
45
|
+
* 1. a backfill migration rewriting LlmLog.feature on existing rows, and
|
|
46
|
+
* 2. an entry in LEGACY_AUTONOMOUS_AI_FEATURES (below), so rows written
|
|
47
|
+
* under the old label during the deploy window still count.
|
|
48
|
+
* Changing a value on its own is never safe.
|
|
49
|
+
*
|
|
50
|
+
* Every autonomous write site imports its label from here — no call site may
|
|
51
|
+
* hardcode the literal. The list and the writers cannot drift apart, which
|
|
52
|
+
* would otherwise leave a feature permanently outside the budget.
|
|
53
|
+
*/
|
|
54
|
+
/*
|
|
55
|
+
* The LlmLog feature name for incident investigations (AIInvestigationEngine,
|
|
56
|
+
* driven by IncidentInvestigationRunner) — fired automatically when an incident
|
|
57
|
+
* is declared, so a monitor storm is a run storm.
|
|
58
|
+
*/
|
|
59
|
+
export const AI_INCIDENT_INVESTIGATION_FEATURE = "AI Incident Investigation";
|
|
60
|
+
/*
|
|
61
|
+
* The LlmLog feature name for alert investigations (AlertInvestigationRunner).
|
|
62
|
+
* Same engine as incidents, fired on alert creation.
|
|
63
|
+
*/
|
|
64
|
+
export const AI_ALERT_INVESTIGATION_FEATURE = "AI Alert Investigation";
|
|
65
|
+
/*
|
|
66
|
+
* The LlmLog feature name for on-resolve investigation grading
|
|
67
|
+
* (InvestigationGrader) — one constrained call per resolved incident, but
|
|
68
|
+
* autonomous, so the budget covers it.
|
|
69
|
+
*/
|
|
70
|
+
export const AI_INVESTIGATION_GRADING_FEATURE = "AI Investigation Grading";
|
|
71
|
+
/*
|
|
72
|
+
* The LlmLog feature name for the G6 structured confidence signal
|
|
73
|
+
* (ConfidenceSignal) — one constrained call per completed investigation,
|
|
74
|
+
* outside the per-run caps but inside this daily budget. A budget rejection
|
|
75
|
+
* degrades the signal to "classification-failed" (per-consumer fail
|
|
76
|
+
* directions), never a run failure.
|
|
77
|
+
*/
|
|
78
|
+
export const AI_CONFIDENCE_CLASSIFICATION_FEATURE = "AI Confidence Classification";
|
|
79
|
+
/*
|
|
80
|
+
* The LlmLog feature name for server-mediated code-fix agent completions
|
|
81
|
+
* (B4 Tier 0) — the in-house coding agent's tool loop routes every LLM call
|
|
82
|
+
* through /ai-agent-data/llm-completion, which executes under this feature.
|
|
83
|
+
*/
|
|
84
|
+
export const AI_CODE_FIX_FEATURE = "AI Code Fix";
|
|
85
|
+
/** Metering and autonomous-budget feature name for workflow AI components. */
|
|
86
|
+
export const WORKFLOW_AI_FEATURE = "Workflow AI";
|
|
87
|
+
/*
|
|
88
|
+
* The LlmLog feature name for AI runbook steps. Runbooks are triggered by
|
|
89
|
+
* incident/alert/maintenance rules, so these calls are storm-shaped: one
|
|
90
|
+
* flapping monitor can start many executions.
|
|
91
|
+
*/
|
|
92
|
+
export const RUNBOOK_AI_STEP_FEATURE = "Runbook AI Step";
|
|
93
|
+
/*
|
|
94
|
+
* The LlmLog feature name for per-insight triage: the budgeted, read-only
|
|
95
|
+
* Investigation AIRun a newly filed AIInsight enqueues. Insights are filed by
|
|
96
|
+
* deterministic detectors on a scheduled scan, so these runs are storm-shaped
|
|
97
|
+
* by construction and fully autonomous.
|
|
98
|
+
*/
|
|
99
|
+
export const AI_INSIGHT_TRIAGE_FEATURE = "AI Insight Triage";
|
|
100
|
+
/*
|
|
101
|
+
* The pre-rename values of the six labels that carried the "Sentinel" codename.
|
|
102
|
+
* These are NOT written by anything any more — they exist only so the daily
|
|
103
|
+
* budget keeps counting rows that ALREADY carry them:
|
|
104
|
+
*
|
|
105
|
+
* - rows written by the old code during the deploy window (old and new pods
|
|
106
|
+
* serve traffic side by side, and the budget is a UTC-day sum, so the same
|
|
107
|
+
* day contains both labels); and
|
|
108
|
+
* - any row the backfill migration missed (it runs once, and rows can be
|
|
109
|
+
* written between the migration and the last old pod draining).
|
|
110
|
+
*
|
|
111
|
+
* Without them, the first deploy day hands every project a second full budget.
|
|
112
|
+
*
|
|
113
|
+
* SAFE TO DELETE once no LlmLog row carries an old label. Retention is the
|
|
114
|
+
* clock: LlmLogService hard-deletes rows older than 3 days by createdAt — but
|
|
115
|
+
* ONLY when billing is enabled. So on OneUptime cloud these entries are dead
|
|
116
|
+
* weight 3 days after the deploy; on a self-hosted instance (no billing, no
|
|
117
|
+
* retention sweep) LlmLog rows live forever, so they must stay until the
|
|
118
|
+
* backfill migration has demonstrably rewritten every row.
|
|
119
|
+
*
|
|
120
|
+
* Carrying them costs nothing: AUTONOMOUS_AI_FEATURES is a pure match-list
|
|
121
|
+
* (SQL `= ANY`, and an `.includes()` gate on the write path that no writer can
|
|
122
|
+
* trip because no writer emits these strings any more).
|
|
123
|
+
*/
|
|
124
|
+
export const LEGACY_AUTONOMOUS_AI_FEATURES = [
|
|
125
|
+
"Sentinel Incident Investigation",
|
|
126
|
+
"Sentinel Alert Investigation",
|
|
127
|
+
"Sentinel Investigation Grading",
|
|
128
|
+
"Sentinel Confidence Classification",
|
|
129
|
+
"Sentinel Code Fix",
|
|
130
|
+
"Sentinel Insight Triage",
|
|
131
|
+
];
|
|
25
132
|
/*
|
|
26
133
|
* Features that run WITHOUT a human in the loop. The per-project daily token
|
|
27
134
|
* budget (Project.aiDailyAutonomousTokenLimit, G4) applies only to these —
|
|
28
135
|
* interactive chat and explicitly user-triggered AI are never budget-blocked.
|
|
29
136
|
* Auto-postmortem is deliberately excluded for now: it is one call per
|
|
30
137
|
* resolved incident, not storm-shaped; include it when it moves to the queue.
|
|
138
|
+
*
|
|
139
|
+
* THE ENTRIES ARE PERSISTED STRINGS — see the header comment above before
|
|
140
|
+
* touching any of them. Built from the constants (never raw literals) so the
|
|
141
|
+
* budget list and the write sites cannot drift.
|
|
31
142
|
*/
|
|
32
143
|
export const AUTONOMOUS_AI_FEATURES = [
|
|
33
|
-
|
|
34
|
-
|
|
144
|
+
// Investigations: fired by incident/alert creation, fully unattended.
|
|
145
|
+
AI_INCIDENT_INVESTIGATION_FEATURE,
|
|
146
|
+
AI_ALERT_INVESTIGATION_FEATURE,
|
|
147
|
+
// One constrained call per resolved incident (InvestigationGrader).
|
|
148
|
+
AI_INVESTIGATION_GRADING_FEATURE,
|
|
149
|
+
// One constrained call per completed investigation (ConfidenceSignal).
|
|
150
|
+
AI_CONFIDENCE_CLASSIFICATION_FEATURE,
|
|
151
|
+
/*
|
|
152
|
+
* Server-mediated code-fix agent completions (B4 Tier 0). Fix runs are
|
|
153
|
+
* user-triggered, but the tool loop then runs unattended for up to ~40
|
|
154
|
+
* calls — storm-shaped enough that the daily budget must cover it. The
|
|
155
|
+
* per-run loop budgets (CodeFixAgentCompletion) cap a single run; this
|
|
156
|
+
* daily pool caps all of them together.
|
|
157
|
+
*/
|
|
158
|
+
AI_CODE_FIX_FEATURE,
|
|
159
|
+
/*
|
|
160
|
+
* AI runbook steps run unattended once the runbook starts, and rule
|
|
161
|
+
* triggers make them storm-shaped (see the constant above) — even
|
|
162
|
+
* manually started runs proceed without a human approving each LLM call.
|
|
163
|
+
*/
|
|
164
|
+
RUNBOOK_AI_STEP_FEATURE,
|
|
165
|
+
// Workflow components also execute without per-request human approval.
|
|
166
|
+
WORKFLOW_AI_FEATURE,
|
|
167
|
+
/*
|
|
168
|
+
* Per-insight preventive triage (InsightTriageRunner). One read-only
|
|
169
|
+
* Investigation run per new AIInsight, with no human in the loop —
|
|
170
|
+
* a noisy scan tick can file several insights at once, so the daily
|
|
171
|
+
* budget must cover these runs too.
|
|
172
|
+
*/
|
|
173
|
+
AI_INSIGHT_TRIAGE_FEATURE,
|
|
174
|
+
/*
|
|
175
|
+
* Pre-rename labels. Keeps the budget honest for rows already persisted
|
|
176
|
+
* under the old names — read the LEGACY_AUTONOMOUS_AI_FEATURES comment
|
|
177
|
+
* before removing.
|
|
178
|
+
*/
|
|
179
|
+
...LEGACY_AUTONOMOUS_AI_FEATURES,
|
|
35
180
|
];
|
|
36
181
|
export class Service extends BaseService {
|
|
37
182
|
constructor() {
|
|
38
183
|
super();
|
|
39
184
|
}
|
|
185
|
+
/**
|
|
186
|
+
* Assert the project-level feature, subscription, and payment gates shared by
|
|
187
|
+
* background AI entry points. Provider availability, balance, and token
|
|
188
|
+
* budgets are checked later by executeWithLogging so those failures are
|
|
189
|
+
* captured in the metered LLM log.
|
|
190
|
+
*/
|
|
191
|
+
async assertProjectCanUseAI(projectId) {
|
|
192
|
+
const [project, planStatus] = await Promise.all([
|
|
193
|
+
ProjectService.findOneById({
|
|
194
|
+
id: projectId,
|
|
195
|
+
select: { enableAi: true },
|
|
196
|
+
props: { isRoot: true },
|
|
197
|
+
}),
|
|
198
|
+
ProjectService.getCurrentPlan(projectId),
|
|
199
|
+
]);
|
|
200
|
+
if (!project) {
|
|
201
|
+
throw new BadDataException("Project not found.");
|
|
202
|
+
}
|
|
203
|
+
if (project.enableAi === false) {
|
|
204
|
+
throw new BadDataException("AI features are disabled for this project. Enable AI in Project Settings before running this workflow.");
|
|
205
|
+
}
|
|
206
|
+
if (planStatus.isSubscriptionUnpaid) {
|
|
207
|
+
throw new PaymentRequiredException("Your subscription is unpaid. Please update your payment method to use AI in workflows.");
|
|
208
|
+
}
|
|
209
|
+
if (planStatus.plan &&
|
|
210
|
+
!SubscriptionPlan.isFeatureAccessibleOnCurrentPlan(PlanType.Growth, planStatus.plan, getAllEnvVars())) {
|
|
211
|
+
throw new PaymentRequiredException("Please upgrade your plan to Growth to use AI in workflows.");
|
|
212
|
+
}
|
|
213
|
+
}
|
|
40
214
|
/*
|
|
41
215
|
* G4 daily budget: has this project consumed its daily autonomous-token
|
|
42
216
|
* allowance (UTC day)? Counts only AUTONOMOUS_AI_FEATURES tokens, so chat
|
|
@@ -72,7 +246,7 @@ export class Service extends BaseService {
|
|
|
72
246
|
};
|
|
73
247
|
}
|
|
74
248
|
async executeWithLogging(request) {
|
|
75
|
-
var _a, _b, _c, _d, _e;
|
|
249
|
+
var _a, _b, _c, _d, _e, _f;
|
|
76
250
|
const startTime = new Date();
|
|
77
251
|
// Get LLM provider for the project (honoring an explicit per-chat choice).
|
|
78
252
|
const llmProvider = await LlmProviderService.getProviderForChat({
|
|
@@ -167,7 +341,7 @@ export class Service extends BaseService {
|
|
|
167
341
|
if (AUTONOMOUS_AI_FEATURES.includes(request.feature)) {
|
|
168
342
|
const budget = await this.getAutonomousDailyBudgetStatus(request.projectId);
|
|
169
343
|
if (budget.exhausted) {
|
|
170
|
-
const budgetMessage = `Daily autonomous AI token budget exhausted (${budget.usedTokensToday.toLocaleString()} of ${(_a = budget.limitInTokens) === null || _a === void 0 ? void 0 : _a.toLocaleString()} tokens used today). Autonomous
|
|
344
|
+
const budgetMessage = `Daily autonomous AI token budget exhausted (${budget.usedTokensToday.toLocaleString()} of ${(_a = budget.limitInTokens) === null || _a === void 0 ? void 0 : _a.toLocaleString()} tokens used today). Autonomous AI requests resume tomorrow (UTC) — raise or unset the limit in the AI settings pages.`;
|
|
171
345
|
logEntry.status = LlmLogStatus.BudgetExceeded;
|
|
172
346
|
logEntry.statusMessage = budgetMessage.substring(0, 490);
|
|
173
347
|
logEntry.requestCompletedAt = new Date();
|
|
@@ -194,15 +368,16 @@ export class Service extends BaseService {
|
|
|
194
368
|
llmConfig.modelName = llmProvider.modelName;
|
|
195
369
|
}
|
|
196
370
|
// Execute LLM call
|
|
197
|
-
const response = await LLMService.getCompletion(Object.assign({ llmProviderConfig: llmConfig, messages: request.messages, temperature: (_b = request.temperature) !== null && _b !== void 0 ? _b : 0.7, maxTokens: request.maxTokens, tools: request.tools }, (llmProvider.additionalParams
|
|
371
|
+
const response = await LLMService.getCompletion(Object.assign({ llmProviderConfig: llmConfig, messages: request.messages, temperature: (_b = request.temperature) !== null && _b !== void 0 ? _b : 0.7, maxTokens: request.maxTokens, tools: request.tools, requestTimeoutInMs: request.requestTimeoutInMs, requestRetries: request.requestRetries, protectRequestParameters: request.protectRequestParameters, includeProviderErrorDetails: request.storeErrorDetails !== false }, (llmProvider.additionalParams
|
|
198
372
|
? { additionalParams: llmProvider.additionalParams }
|
|
199
373
|
: {})));
|
|
200
374
|
const endTime = new Date();
|
|
201
375
|
// Update log with success info
|
|
202
376
|
logEntry.status = LlmLogStatus.Success;
|
|
203
377
|
logEntry.totalTokens = ((_c = response.usage) === null || _c === void 0 ? void 0 : _c.totalTokens) || 0;
|
|
204
|
-
logEntry.
|
|
205
|
-
logEntry.
|
|
378
|
+
logEntry.completionTokens = ((_d = response.usage) === null || _d === void 0 ? void 0 : _d.completionTokens) || 0;
|
|
379
|
+
logEntry.cachedInputTokens = ((_e = response.usage) === null || _e === void 0 ? void 0 : _e.cachedInputTokens) || 0;
|
|
380
|
+
logEntry.cacheCreationTokens = ((_f = response.usage) === null || _f === void 0 ? void 0 : _f.cacheCreationTokens) || 0;
|
|
206
381
|
logEntry.responsePreview = storeContentPreviews
|
|
207
382
|
? response.content.substring(0, 2000) // Store first 2000 chars
|
|
208
383
|
: "[Redacted — this content is private to the requesting user]";
|
|
@@ -262,16 +437,22 @@ export class Service extends BaseService {
|
|
|
262
437
|
};
|
|
263
438
|
}
|
|
264
439
|
catch (error) {
|
|
265
|
-
|
|
440
|
+
const rawErrorMessage = error instanceof Error ? error.message : String(error);
|
|
441
|
+
const errorMessage = request.storeErrorDetails === false
|
|
442
|
+
? "The AI provider request failed. Review the provider configuration and try again."
|
|
443
|
+
: rawErrorMessage;
|
|
444
|
+
// Log the error without persisting private provider details when asked.
|
|
266
445
|
logEntry.status = LlmLogStatus.Error;
|
|
267
|
-
logEntry.statusMessage =
|
|
268
|
-
error instanceof Error ? error.message : String(error);
|
|
446
|
+
logEntry.statusMessage = errorMessage;
|
|
269
447
|
logEntry.requestCompletedAt = new Date();
|
|
270
448
|
logEntry.durationMs = new Date().getTime() - startTime.getTime();
|
|
271
449
|
await LlmLogService.create({
|
|
272
450
|
data: logEntry,
|
|
273
451
|
props: { isRoot: true },
|
|
274
452
|
});
|
|
453
|
+
if (request.storeErrorDetails === false) {
|
|
454
|
+
throw new BadDataException(errorMessage);
|
|
455
|
+
}
|
|
275
456
|
throw error;
|
|
276
457
|
}
|
|
277
458
|
}
|
|
@@ -307,6 +488,12 @@ export class Service extends BaseService {
|
|
|
307
488
|
}
|
|
308
489
|
}
|
|
309
490
|
}
|
|
491
|
+
__decorate([
|
|
492
|
+
CaptureSpan(),
|
|
493
|
+
__metadata("design:type", Function),
|
|
494
|
+
__metadata("design:paramtypes", [ObjectID]),
|
|
495
|
+
__metadata("design:returntype", Promise)
|
|
496
|
+
], Service.prototype, "assertProjectCanUseAI", null);
|
|
310
497
|
__decorate([
|
|
311
498
|
CaptureSpan(),
|
|
312
499
|
__metadata("design:type", Function),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AIService.js","sourceRoot":"","sources":["../../../../Server/Services/AIService.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,UAON,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAQ,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,MAAM,MAAM,oCAAoC,CAAC;AACxD,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,gBAAgB,MAAM,wCAAwC,CAAC;AACtE,OAAO,WAAW,MAAM,gCAAgC,CAAC;AACzD,OAAO,MAAyB,MAAM,iBAAiB,CAAC;AAExD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAkB;IACnD,iCAAiC;IACjC,8BAA8B;CAC/B,CAAC;AAwCF,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED;;;;OAIG;IAEU,AAAN,KAAK,CAAC,8BAA8B,CACzC,SAAmB;;QAEnB,MAAM,OAAO,GAAmB,MAAM,cAAc,CAAC,WAAW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AW,EAAE;;;;iDAgRb;AAoDH,eAAe,IAAI,OAAO,EAAE,CAAC"}
|
|
@@ -55,7 +55,7 @@ import AlertLabelRuleEngineService from "./AlertLabelRuleEngineService";
|
|
|
55
55
|
import AlertOnCallRuleEngineService from "./AlertOnCallRuleEngineService";
|
|
56
56
|
import AlertOwnerRuleEngineService from "./AlertOwnerRuleEngineService";
|
|
57
57
|
import RunbookRuleEngineService from "./RunbookRuleEngineService";
|
|
58
|
-
import
|
|
58
|
+
import AIAlertInvestigationRunner from "../Utils/AI/SRE/AlertInvestigationRunner";
|
|
59
59
|
import AlertPrivacyRuleEngineService from "./AlertPrivacyRuleEngineService";
|
|
60
60
|
import ProjectService from "./ProjectService";
|
|
61
61
|
export class Service extends DatabaseService {
|
|
@@ -436,21 +436,21 @@ export class Service extends DatabaseService {
|
|
|
436
436
|
.then(async () => {
|
|
437
437
|
var _a, _b;
|
|
438
438
|
/*
|
|
439
|
-
*
|
|
439
|
+
* AI (AI SRE): automatically investigate the new alert and post a
|
|
440
440
|
* cited root cause analysis to the alert timeline + Slack/Teams. Runs
|
|
441
441
|
* last, is gated per project (opt-in) + requires an LLM provider, and is
|
|
442
442
|
* read-only.
|
|
443
443
|
*/
|
|
444
444
|
try {
|
|
445
445
|
if (createdItem.projectId && createdItem.id) {
|
|
446
|
-
await
|
|
446
|
+
await AIAlertInvestigationRunner.investigateNewAlert({
|
|
447
447
|
alertId: createdItem.id,
|
|
448
448
|
projectId: createdItem.projectId,
|
|
449
449
|
});
|
|
450
450
|
}
|
|
451
451
|
}
|
|
452
452
|
catch (error) {
|
|
453
|
-
logger.error(`
|
|
453
|
+
logger.error(`AI alert investigation failed in AlertService.onCreateSuccess: ${error}`, {
|
|
454
454
|
projectId: (_a = createdItem.projectId) === null || _a === void 0 ? void 0 : _a.toString(),
|
|
455
455
|
alertId: (_b = createdItem.id) === null || _b === void 0 ? void 0 : _b.toString(),
|
|
456
456
|
});
|