@oneuptime/common 11.3.26 → 11.4.0
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/AIRun.ts +50 -0
- package/Models/DatabaseModels/IncidentEpisodeRoleMember.ts +1 -1
- package/Models/DatabaseModels/IncidentMember.ts +1 -1
- package/Models/DatabaseModels/IncomingCallPolicy.ts +13 -0
- package/Models/DatabaseModels/Index.ts +3 -0
- package/Models/DatabaseModels/MigrationFailure.ts +170 -0
- package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.ts +51 -2
- package/Models/DatabaseModels/OnCallDutyPolicySchedule.ts +44 -0
- package/Models/DatabaseModels/OnCallDutyPolicyScheduleLayer.ts +6 -0
- package/Models/DatabaseModels/OnCallDutyPolicyScheduleLayerUser.ts +6 -0
- package/Models/DatabaseModels/OnCallDutyPolicyTimeLog.ts +1 -1
- package/Models/DatabaseModels/OnCallDutyPolicyUserOverride.ts +2 -2
- package/Models/DatabaseModels/Project.ts +60 -0
- package/Server/API/AIInvestigationAPI.ts +148 -0
- package/Server/API/AlertAPI.ts +1 -1
- package/Server/API/IncidentAPI.ts +2 -2
- package/Server/API/IncidentEpisodeAPI.ts +1 -1
- package/Server/API/LlmProviderAPI.ts +1 -0
- package/Server/API/ScheduledMaintenanceAPI.ts +1 -1
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783470000000-AddIncomingCallPolicyRoutingPhoneNumberUnique.ts +25 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783510935686-FixNotNullForeignKeysOnDelete.ts +81 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783515836148-MigrationName.ts +25 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783523076215-AddMigrationFailureTable.ts +35 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783598145111-AddEnableAutomaticIncidentInvestigationToProject.ts +19 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783615884106-AddInvestigationSubjectToAIRun.ts +33 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783632447975-AddEnableAutomaticAlertInvestigationToProject.ts +19 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +14 -0
- package/Server/Infrastructure/PostgresDatabase.ts +11 -0
- package/Server/Services/AIService.ts +74 -2
- package/Server/Services/AlertService.ts +25 -0
- package/Server/Services/AnalyticsDatabaseService.ts +10 -1
- package/Server/Services/DatabaseService.ts +10 -1
- package/Server/Services/IncidentService.ts +26 -1
- package/Server/Services/IncidentStateTimelineService.ts +19 -0
- package/Server/Services/IncomingCallPolicyEscalationRuleService.ts +75 -2
- package/Server/Services/IncomingCallPolicyService.ts +42 -1
- package/Server/Services/Index.ts +2 -0
- package/Server/Services/MigrationFailureService.ts +9 -0
- package/Server/Services/MonitorProbeService.ts +33 -7
- package/Server/Services/MonitorService.ts +19 -7
- package/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.ts +65 -0
- package/Server/Services/OnCallDutyPolicyEscalationRuleService.ts +185 -41
- package/Server/Services/OnCallDutyPolicyEscalationRuleUserService.ts +23 -15
- package/Server/Services/OnCallDutyPolicyExecutionLogService.ts +39 -0
- package/Server/Services/OnCallDutyPolicyScheduleLayerService.ts +148 -0
- package/Server/Services/OnCallDutyPolicyScheduleLayerUserService.ts +11 -2
- package/Server/Services/OnCallDutyPolicyScheduleService.ts +502 -26
- package/Server/Services/OnCallDutyPolicyTimeLogService.ts +49 -7
- package/Server/Services/OnCallDutyPolicyUserOverrideService.ts +218 -4
- package/Server/Services/ProjectCallSMSConfigService.ts +82 -1
- package/Server/Services/TeamMemberService.ts +6 -0
- package/Server/Services/UserNotificationRuleService.ts +13 -42
- package/Server/Services/UserOnCallLogService.ts +90 -0
- package/Server/Services/UserOnCallLogTimelineService.ts +43 -1
- package/Server/Types/Database/QueryUtil.ts +57 -0
- package/Server/Utils/AI/AlertAIContextBuilder.ts +6 -1
- package/Server/Utils/AI/Chat/ChatAgentRunner.ts +14 -2
- package/Server/Utils/AI/Chat/ObservabilityAssistant.ts +119 -11
- package/Server/Utils/AI/IncidentAIContextBuilder.ts +18 -3
- package/Server/Utils/AI/IncidentEpisodeAIContextBuilder.ts +6 -1
- package/Server/Utils/AI/ScheduledMaintenanceAIContextBuilder.ts +12 -2
- package/Server/Utils/AI/Sentinel/AlertInvestigationRunner.ts +141 -0
- package/Server/Utils/AI/Sentinel/IncidentInvestigationRunner.ts +178 -0
- package/Server/Utils/AI/Sentinel/IncidentPostmortemRunner.ts +105 -0
- package/Server/Utils/AI/Sentinel/SentinelInvestigationEngine.ts +405 -0
- package/Server/Utils/AI/Sentinel/SentinelMemory.ts +167 -0
- package/Server/Utils/AI/Toolbox/IncidentTools.ts +183 -1
- package/Server/Utils/AI/Toolbox/Index.ts +15 -1
- package/Server/Utils/AI/Toolbox/RecentChangesTools.ts +208 -0
- package/Server/Utils/AI/Toolbox/SentinelActionTools.ts +577 -0
- package/Server/Utils/AI/Toolbox/Serializer.ts +42 -0
- package/Server/Utils/Database/MigrationFailureLog.ts +240 -0
- package/Server/Utils/IncomingCallPhoneNumber.ts +41 -0
- package/Server/Utils/LLM/LLMService.ts +110 -11
- package/Server/Utils/Telemetry/IoTSnapshotScan.ts +12 -9
- package/Server/Utils/Telemetry/ProxmoxCephSnapshotScan.ts +12 -9
- package/Tests/Server/API/BaseAPI.test.ts +1 -0
- package/Tests/Server/Services/AnalyticsDatabaseService.test.ts +0 -8
- package/Tests/Server/Services/OnCallDutyPolicyScheduleLayerUserReorder.test.ts +233 -0
- package/Tests/Server/Services/OnCallDutyPolicyTimeLogServiceScoping.test.ts +242 -0
- package/Tests/Server/Services/OnCallDutyPolicyUserOverrideEdit.test.ts +198 -0
- package/Tests/Server/Services/UserOnCallLogClaimNotificationRule.test.ts +495 -0
- package/Tests/Server/Types/Database/QueryUtil.test.ts +74 -0
- package/Tests/Server/Utils/AI/LLMServiceToolCalling.test.ts +78 -0
- package/Tests/Server/Utils/AI/ToolResultSerializer.test.ts +68 -0
- package/Tests/Types/DateExhaustiveTimezone.test.ts +700 -0
- package/Tests/Types/DateTimezoneWallClock.test.ts +99 -0
- package/Tests/Types/Events/Recurring.test.ts +22 -9
- package/Tests/Types/OnCallDutyPolicy/LayerUtilAuditFixes.test.ts +291 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilAuditFixesRound2.test.ts +398 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilDSTWeekendGap.test.ts +114 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilDSTWeeklyDayShift.test.ts +76 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilDailyMutation.test.ts +128 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilDailyProbe.test.ts +203 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilDiffFuzz.test.ts +322 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilEdgeCases.test.ts +280 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilExhaustiveCurrentUser.test.ts +863 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilExhaustiveDaily.test.ts +900 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilExhaustiveMultiLayer.test.ts +1104 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilExhaustiveRotation.test.ts +957 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilExhaustiveWeekly.test.ts +1095 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilInvariants.test.ts +232 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilMergeAudit.test.ts +227 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilMonthYearAudit.test.ts +255 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilMultiLayerAudit.test.ts +388 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilMultiLayerEdge.test.ts +300 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilOvernightDSTAudit.test.ts +158 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilRestrictedGapFix.test.ts +253 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilRestrictedGapRepro.test.ts +157 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilRotationFixes.test.ts +414 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilTimezone.test.ts +243 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilWeekendGapRepro.test.ts +112 -0
- package/Tests/Types/OnCallDutyPolicy/OverrideLensAudit.test.ts +117 -0
- package/Tests/Types/OnCallDutyPolicy/RestrictionTimes.test.ts +8 -6
- package/Tests/Types/OnCallDutyPolicy/RestrictionTimesDefaultDayAudit.test.ts +112 -0
- package/Tests/Types/OnCallDutyPolicy/RestrictionTimesExhaustive.test.ts +821 -0
- package/Tests/Types/OnCallDutyPolicy/RestrictionTimesMutationInvariant.test.ts +886 -0
- package/Tests/Types/OnCallDutyPolicy/ScheduleShiftUtil.test.ts +260 -0
- package/Tests/Types/OnCallDutyPolicy/UserOverrideUtil.test.ts +255 -0
- package/Tests/Types/OnCallDutyPolicy/UserOverrideUtilExhaustive.test.ts +1126 -0
- package/Types/Date.ts +246 -15
- package/Types/OnCallDutyPolicy/Layer.ts +790 -260
- package/Types/OnCallDutyPolicy/RestrictionTimes.ts +39 -13
- package/Types/OnCallDutyPolicy/ScheduleShiftUtil.ts +257 -0
- package/Types/OnCallDutyPolicy/UserOverrideUtil.ts +21 -5
- package/UI/Components/Calendar/Calendar.tsx +8 -2
- package/UI/Components/Charts/ChartGroup/ChartGroup.tsx +5 -5
- package/UI/Components/Events/RecurringFieldElement.tsx +16 -0
- package/UI/Components/ModelFormModal/ModelFormModal.tsx +8 -0
- package/UI/Components/RadioButtons/BasicRadioButtons.tsx +1 -1
- package/build/dist/Models/DatabaseModels/AIRun.js +52 -0
- package/build/dist/Models/DatabaseModels/AIRun.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentEpisodeRoleMember.js +1 -1
- package/build/dist/Models/DatabaseModels/IncidentEpisodeRoleMember.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentMember.js +1 -1
- package/build/dist/Models/DatabaseModels/IncidentMember.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncomingCallPolicy.js +10 -0
- package/build/dist/Models/DatabaseModels/IncomingCallPolicy.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +2 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/MigrationFailure.js +196 -0
- package/build/dist/Models/DatabaseModels/MigrationFailure.js.map +1 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.js +52 -2
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.js.map +1 -1
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicySchedule.js +45 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicySchedule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyScheduleLayer.js +6 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyScheduleLayer.js.map +1 -1
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyScheduleLayerUser.js +6 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyScheduleLayerUser.js.map +1 -1
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyTimeLog.js +1 -1
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyTimeLog.js.map +1 -1
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyUserOverride.js +2 -2
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyUserOverride.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Project.js +62 -0
- package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
- package/build/dist/Server/API/AIInvestigationAPI.js +107 -0
- package/build/dist/Server/API/AIInvestigationAPI.js.map +1 -0
- package/build/dist/Server/API/AlertAPI.js +1 -1
- package/build/dist/Server/API/IncidentAPI.js +2 -2
- package/build/dist/Server/API/IncidentEpisodeAPI.js +1 -1
- package/build/dist/Server/API/LlmProviderAPI.js +1 -0
- package/build/dist/Server/API/LlmProviderAPI.js.map +1 -1
- package/build/dist/Server/API/ScheduledMaintenanceAPI.js +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783470000000-AddIncomingCallPolicyRoutingPhoneNumberUnique.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783470000000-AddIncomingCallPolicyRoutingPhoneNumberUnique.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783510935686-FixNotNullForeignKeysOnDelete.js +38 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783510935686-FixNotNullForeignKeysOnDelete.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783515836148-MigrationName.js +16 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783515836148-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783523076215-AddMigrationFailureTable.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783523076215-AddMigrationFailureTable.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783598145111-AddEnableAutomaticIncidentInvestigationToProject.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783598145111-AddEnableAutomaticIncidentInvestigationToProject.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783615884106-AddInvestigationSubjectToAIRun.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783615884106-AddInvestigationSubjectToAIRun.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783632447975-AddEnableAutomaticAlertInvestigationToProject.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783632447975-AddEnableAutomaticAlertInvestigationToProject.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +14 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Infrastructure/PostgresDatabase.js +9 -0
- package/build/dist/Server/Infrastructure/PostgresDatabase.js.map +1 -1
- package/build/dist/Server/Services/AIService.js +53 -2
- package/build/dist/Server/Services/AIService.js.map +1 -1
- package/build/dist/Server/Services/AlertService.js +24 -0
- package/build/dist/Server/Services/AlertService.js.map +1 -1
- package/build/dist/Server/Services/AnalyticsDatabaseService.js +10 -1
- package/build/dist/Server/Services/AnalyticsDatabaseService.js.map +1 -1
- package/build/dist/Server/Services/DatabaseService.js +10 -1
- package/build/dist/Server/Services/DatabaseService.js.map +1 -1
- package/build/dist/Server/Services/IncidentService.js +25 -1
- package/build/dist/Server/Services/IncidentService.js.map +1 -1
- package/build/dist/Server/Services/IncidentStateTimelineService.js +19 -0
- package/build/dist/Server/Services/IncidentStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/IncomingCallPolicyEscalationRuleService.js +55 -2
- package/build/dist/Server/Services/IncomingCallPolicyEscalationRuleService.js.map +1 -1
- package/build/dist/Server/Services/IncomingCallPolicyService.js +40 -0
- package/build/dist/Server/Services/IncomingCallPolicyService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +2 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/MigrationFailureService.js +9 -0
- package/build/dist/Server/Services/MigrationFailureService.js.map +1 -0
- package/build/dist/Server/Services/MonitorProbeService.js +33 -7
- package/build/dist/Server/Services/MonitorProbeService.js.map +1 -1
- package/build/dist/Server/Services/MonitorService.js +12 -5
- package/build/dist/Server/Services/MonitorService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.js +81 -22
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleService.js +134 -31
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleUserService.js +21 -13
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleUserService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogService.js +36 -0
- package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleLayerService.js +121 -0
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleLayerService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleLayerUserService.js +11 -2
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleLayerUserService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js +409 -36
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyTimeLogService.js +52 -8
- package/build/dist/Server/Services/OnCallDutyPolicyTimeLogService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyUserOverrideService.js +170 -3
- package/build/dist/Server/Services/OnCallDutyPolicyUserOverrideService.js.map +1 -1
- package/build/dist/Server/Services/ProjectCallSMSConfigService.js +72 -0
- package/build/dist/Server/Services/ProjectCallSMSConfigService.js.map +1 -1
- package/build/dist/Server/Services/TeamMemberService.js +6 -0
- package/build/dist/Server/Services/TeamMemberService.js.map +1 -1
- package/build/dist/Server/Services/UserNotificationRuleService.js +12 -30
- package/build/dist/Server/Services/UserNotificationRuleService.js.map +1 -1
- package/build/dist/Server/Services/UserOnCallLogService.js +75 -0
- package/build/dist/Server/Services/UserOnCallLogService.js.map +1 -1
- package/build/dist/Server/Services/UserOnCallLogTimelineService.js +31 -1
- package/build/dist/Server/Services/UserOnCallLogTimelineService.js.map +1 -1
- package/build/dist/Server/Types/Database/QueryUtil.js +45 -0
- package/build/dist/Server/Types/Database/QueryUtil.js.map +1 -1
- package/build/dist/Server/Utils/AI/AlertAIContextBuilder.js +6 -1
- package/build/dist/Server/Utils/AI/AlertAIContextBuilder.js.map +1 -1
- package/build/dist/Server/Utils/AI/Chat/ChatAgentRunner.js +13 -2
- package/build/dist/Server/Utils/AI/Chat/ChatAgentRunner.js.map +1 -1
- package/build/dist/Server/Utils/AI/Chat/ObservabilityAssistant.js +59 -11
- package/build/dist/Server/Utils/AI/Chat/ObservabilityAssistant.js.map +1 -1
- package/build/dist/Server/Utils/AI/IncidentAIContextBuilder.js +18 -3
- package/build/dist/Server/Utils/AI/IncidentAIContextBuilder.js.map +1 -1
- package/build/dist/Server/Utils/AI/IncidentEpisodeAIContextBuilder.js +6 -1
- package/build/dist/Server/Utils/AI/IncidentEpisodeAIContextBuilder.js.map +1 -1
- package/build/dist/Server/Utils/AI/ScheduledMaintenanceAIContextBuilder.js +12 -2
- package/build/dist/Server/Utils/AI/ScheduledMaintenanceAIContextBuilder.js.map +1 -1
- package/build/dist/Server/Utils/AI/Sentinel/AlertInvestigationRunner.js +119 -0
- package/build/dist/Server/Utils/AI/Sentinel/AlertInvestigationRunner.js.map +1 -0
- package/build/dist/Server/Utils/AI/Sentinel/IncidentInvestigationRunner.js +147 -0
- package/build/dist/Server/Utils/AI/Sentinel/IncidentInvestigationRunner.js.map +1 -0
- package/build/dist/Server/Utils/AI/Sentinel/IncidentPostmortemRunner.js +93 -0
- package/build/dist/Server/Utils/AI/Sentinel/IncidentPostmortemRunner.js.map +1 -0
- package/build/dist/Server/Utils/AI/Sentinel/SentinelInvestigationEngine.js +311 -0
- package/build/dist/Server/Utils/AI/Sentinel/SentinelInvestigationEngine.js.map +1 -0
- package/build/dist/Server/Utils/AI/Sentinel/SentinelMemory.js +143 -0
- package/build/dist/Server/Utils/AI/Sentinel/SentinelMemory.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/IncidentTools.js +152 -1
- package/build/dist/Server/Utils/AI/Toolbox/IncidentTools.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/Index.js +10 -1
- package/build/dist/Server/Utils/AI/Toolbox/Index.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/RecentChangesTools.js +165 -0
- package/build/dist/Server/Utils/AI/Toolbox/RecentChangesTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/SentinelActionTools.js +451 -0
- package/build/dist/Server/Utils/AI/Toolbox/SentinelActionTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/Serializer.js +40 -0
- package/build/dist/Server/Utils/AI/Toolbox/Serializer.js.map +1 -1
- package/build/dist/Server/Utils/Database/MigrationFailureLog.js +174 -0
- package/build/dist/Server/Utils/Database/MigrationFailureLog.js.map +1 -0
- package/build/dist/Server/Utils/IncomingCallPhoneNumber.js +30 -0
- package/build/dist/Server/Utils/IncomingCallPhoneNumber.js.map +1 -0
- package/build/dist/Server/Utils/LLM/LLMService.js +81 -5
- package/build/dist/Server/Utils/LLM/LLMService.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/IoTSnapshotScan.js +11 -8
- package/build/dist/Server/Utils/Telemetry/IoTSnapshotScan.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/ProxmoxCephSnapshotScan.js +11 -8
- package/build/dist/Server/Utils/Telemetry/ProxmoxCephSnapshotScan.js.map +1 -1
- package/build/dist/Types/Date.js +185 -15
- package/build/dist/Types/Date.js.map +1 -1
- package/build/dist/Types/OnCallDutyPolicy/Layer.js +602 -171
- package/build/dist/Types/OnCallDutyPolicy/Layer.js.map +1 -1
- package/build/dist/Types/OnCallDutyPolicy/RestrictionTimes.js +27 -13
- package/build/dist/Types/OnCallDutyPolicy/RestrictionTimes.js.map +1 -1
- package/build/dist/Types/OnCallDutyPolicy/ScheduleShiftUtil.js +159 -0
- package/build/dist/Types/OnCallDutyPolicy/ScheduleShiftUtil.js.map +1 -0
- package/build/dist/Types/OnCallDutyPolicy/UserOverrideUtil.js +20 -5
- package/build/dist/Types/OnCallDutyPolicy/UserOverrideUtil.js.map +1 -1
- package/build/dist/UI/Components/Calendar/Calendar.js +2 -2
- package/build/dist/UI/Components/Calendar/Calendar.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js +2 -2
- package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js.map +1 -1
- package/build/dist/UI/Components/Events/RecurringFieldElement.js +13 -0
- package/build/dist/UI/Components/Events/RecurringFieldElement.js.map +1 -1
- package/build/dist/UI/Components/ModelFormModal/ModelFormModal.js.map +1 -1
- package/build/dist/UI/Components/RadioButtons/BasicRadioButtons.js +1 -1
- package/build/dist/UI/Components/RadioButtons/BasicRadioButtons.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
import Incident from "../../../../Models/DatabaseModels/Incident";
|
|
2
|
+
import IncidentPublicNote from "../../../../Models/DatabaseModels/IncidentPublicNote";
|
|
3
|
+
import Runbook from "../../../../Models/DatabaseModels/Runbook";
|
|
4
|
+
import BadDataException from "../../../../Types/Exception/BadDataException";
|
|
5
|
+
import SortOrder from "../../../../Types/BaseDatabase/SortOrder";
|
|
6
|
+
import OneUptimeDate from "../../../../Types/Date";
|
|
7
|
+
import UserNotificationEventType from "../../../../Types/UserNotification/UserNotificationEventType";
|
|
8
|
+
import { AIChatCitationTargetType } from "../../../../Types/AI/AIChatTypes";
|
|
9
|
+
import IncidentService from "../../../Services/IncidentService";
|
|
10
|
+
import IncidentSeverityService from "../../../Services/IncidentSeverityService";
|
|
11
|
+
import IncidentPublicNoteService from "../../../Services/IncidentPublicNoteService";
|
|
12
|
+
import OnCallDutyPolicyService from "../../../Services/OnCallDutyPolicyService";
|
|
13
|
+
import RunbookService from "../../../Services/RunbookService";
|
|
14
|
+
import RunbookRuleEngineService from "../../../Services/RunbookRuleEngineService";
|
|
15
|
+
import ToolResultSerializer from "./Serializer";
|
|
16
|
+
import WidgetBuilder from "./WidgetBuilder";
|
|
17
|
+
import { ToolArgs, } from "./ToolTypes";
|
|
18
|
+
/*
|
|
19
|
+
* Sentinel "action belt" — Phase 0.
|
|
20
|
+
*
|
|
21
|
+
* Mutating tools that let the copilot OPERATE the platform (not just answer
|
|
22
|
+
* questions), each a thin wrapper over an already-RBAC-tested service method.
|
|
23
|
+
* They are gated twice: by the tool's requiredPermissions (RBAC) and by the
|
|
24
|
+
* conversation's permission mode (approval / auto-run / hidden in read-only).
|
|
25
|
+
* The acting user is always ctx.props.userId — never a tool argument.
|
|
26
|
+
*
|
|
27
|
+
* Permissions are resolved lazily (not at module load) because this module is
|
|
28
|
+
* pulled in through the service import graph before the model classes are fully
|
|
29
|
+
* wired up — calling a model method at import time throws a circular-dependency
|
|
30
|
+
* TypeError. By the time a tool executes, every module is loaded.
|
|
31
|
+
*/
|
|
32
|
+
let cachedIncidentUpdatePermissions = null;
|
|
33
|
+
const resolveIncidentUpdatePermissions = () => {
|
|
34
|
+
if (!cachedIncidentUpdatePermissions) {
|
|
35
|
+
cachedIncidentUpdatePermissions = new Incident().getUpdatePermissions();
|
|
36
|
+
}
|
|
37
|
+
return cachedIncidentUpdatePermissions;
|
|
38
|
+
};
|
|
39
|
+
let cachedPublicNoteCreatePermissions = null;
|
|
40
|
+
const resolvePublicNoteCreatePermissions = () => {
|
|
41
|
+
if (!cachedPublicNoteCreatePermissions) {
|
|
42
|
+
cachedPublicNoteCreatePermissions =
|
|
43
|
+
new IncidentPublicNote().getCreatePermissions();
|
|
44
|
+
}
|
|
45
|
+
return cachedPublicNoteCreatePermissions;
|
|
46
|
+
};
|
|
47
|
+
let cachedRunbookUpdatePermissions = null;
|
|
48
|
+
const resolveRunbookUpdatePermissions = () => {
|
|
49
|
+
if (!cachedRunbookUpdatePermissions) {
|
|
50
|
+
cachedRunbookUpdatePermissions = new Runbook().getUpdatePermissions();
|
|
51
|
+
}
|
|
52
|
+
return cachedRunbookUpdatePermissions;
|
|
53
|
+
};
|
|
54
|
+
/*
|
|
55
|
+
* ---------------------------------------------------------------------------
|
|
56
|
+
* page_on_call_policy — escalate an incident to its responders.
|
|
57
|
+
* ---------------------------------------------------------------------------
|
|
58
|
+
*/
|
|
59
|
+
export const PageOnCallPolicyTool = {
|
|
60
|
+
name: "page_on_call_policy",
|
|
61
|
+
description: "Page (trigger) an on-call duty policy so its responders are notified about an incident. Provide the on-call policy id and the incident id it relates to. Use query tools to find the on-call policy id and incident id first. This notifies real people — only do it when clearly asked.",
|
|
62
|
+
inputSchema: {
|
|
63
|
+
type: "object",
|
|
64
|
+
properties: {
|
|
65
|
+
onCallDutyPolicyId: {
|
|
66
|
+
type: "string",
|
|
67
|
+
description: "The on-call duty policy's ID to trigger (required).",
|
|
68
|
+
},
|
|
69
|
+
incidentId: {
|
|
70
|
+
type: "string",
|
|
71
|
+
description: "The incident's ID this page relates to (required). Find it with query_incidents first.",
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
required: ["onCallDutyPolicyId", "incidentId"],
|
|
75
|
+
},
|
|
76
|
+
get requiredPermissions() {
|
|
77
|
+
return resolveIncidentUpdatePermissions();
|
|
78
|
+
},
|
|
79
|
+
isMutation: true,
|
|
80
|
+
buildActionTitle: (args) => {
|
|
81
|
+
return `Page on-call policy ${ToolArgs.getString(args, "onCallDutyPolicyId") || ""}`.trim();
|
|
82
|
+
},
|
|
83
|
+
execute: async (args, ctx) => {
|
|
84
|
+
var _a;
|
|
85
|
+
const policyId = ToolArgs.getObjectID(args, "onCallDutyPolicyId");
|
|
86
|
+
if (!policyId) {
|
|
87
|
+
throw new BadDataException("onCallDutyPolicyId is required. Use query tools to find it first.");
|
|
88
|
+
}
|
|
89
|
+
const incidentId = ToolArgs.getObjectID(args, "incidentId");
|
|
90
|
+
if (!incidentId) {
|
|
91
|
+
throw new BadDataException("incidentId is required. Use query_incidents to find it first.");
|
|
92
|
+
}
|
|
93
|
+
// Visibility checks under the user's RBAC (execution runs as root inside the service).
|
|
94
|
+
const policy = await OnCallDutyPolicyService.findOneById({
|
|
95
|
+
id: policyId,
|
|
96
|
+
select: { _id: true, name: true },
|
|
97
|
+
props: ctx.props,
|
|
98
|
+
});
|
|
99
|
+
if (!policy) {
|
|
100
|
+
throw new BadDataException("On-call duty policy not found (or you do not have access to it).");
|
|
101
|
+
}
|
|
102
|
+
const incident = await IncidentService.findOneById({
|
|
103
|
+
id: incidentId,
|
|
104
|
+
select: { _id: true, incidentNumber: true, title: true },
|
|
105
|
+
props: ctx.props,
|
|
106
|
+
});
|
|
107
|
+
if (!incident) {
|
|
108
|
+
throw new BadDataException("Incident not found (or you do not have access to it).");
|
|
109
|
+
}
|
|
110
|
+
await OnCallDutyPolicyService.executePolicy(policyId, {
|
|
111
|
+
triggeredByIncidentId: incidentId,
|
|
112
|
+
userNotificationEventType: UserNotificationEventType.IncidentCreated,
|
|
113
|
+
});
|
|
114
|
+
const incidentIdString = incidentId.toString();
|
|
115
|
+
const serialized = ToolResultSerializer.serializeRows([
|
|
116
|
+
{
|
|
117
|
+
onCallPolicy: policy.name,
|
|
118
|
+
incidentNumber: incident.incidentNumber,
|
|
119
|
+
incidentTitle: incident.title,
|
|
120
|
+
},
|
|
121
|
+
]);
|
|
122
|
+
return {
|
|
123
|
+
dataForLlm: `Paged on-call policy "${policy.name}" for incident #${incident.incidentNumber} ("${incident.title}"). Responders are being notified.\n${serialized.text}`,
|
|
124
|
+
rowCount: 1,
|
|
125
|
+
citationLabel: `Paged "${policy.name}" for incident #${incident.incidentNumber}`,
|
|
126
|
+
citationTarget: {
|
|
127
|
+
type: AIChatCitationTargetType.IncidentView,
|
|
128
|
+
params: { incidentId: incidentIdString },
|
|
129
|
+
},
|
|
130
|
+
redactionCount: serialized.redactionCount,
|
|
131
|
+
isTruncated: false,
|
|
132
|
+
widget: WidgetBuilder.resourceCard({
|
|
133
|
+
title: "On-call paged",
|
|
134
|
+
resourceType: "OnCallDutyPolicy",
|
|
135
|
+
heading: policy.name || "On-call policy",
|
|
136
|
+
subheading: `Incident #${incident.incidentNumber}`,
|
|
137
|
+
fields: [
|
|
138
|
+
{ label: "Policy", value: policy.name || "—" },
|
|
139
|
+
{ label: "Incident", value: `#${(_a = incident.incidentNumber) !== null && _a !== void 0 ? _a : ""}` },
|
|
140
|
+
],
|
|
141
|
+
link: {
|
|
142
|
+
type: AIChatCitationTargetType.IncidentView,
|
|
143
|
+
params: { incidentId: incidentIdString },
|
|
144
|
+
},
|
|
145
|
+
}),
|
|
146
|
+
};
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
/*
|
|
150
|
+
* ---------------------------------------------------------------------------
|
|
151
|
+
* run_runbook — start an automated runbook.
|
|
152
|
+
* ---------------------------------------------------------------------------
|
|
153
|
+
*/
|
|
154
|
+
export const RunRunbookTool = {
|
|
155
|
+
name: "run_runbook",
|
|
156
|
+
description: "Start (execute) a runbook by its id, optionally linked to an incident. Use this to run a predefined remediation or diagnostic automation. Find the runbook id with query tools first.",
|
|
157
|
+
inputSchema: {
|
|
158
|
+
type: "object",
|
|
159
|
+
properties: {
|
|
160
|
+
runbookId: {
|
|
161
|
+
type: "string",
|
|
162
|
+
description: "The runbook's ID to execute (required).",
|
|
163
|
+
},
|
|
164
|
+
incidentId: {
|
|
165
|
+
type: "string",
|
|
166
|
+
description: "Optional incident ID to link this runbook execution to. Find it with query_incidents first.",
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
required: ["runbookId"],
|
|
170
|
+
},
|
|
171
|
+
get requiredPermissions() {
|
|
172
|
+
return resolveRunbookUpdatePermissions();
|
|
173
|
+
},
|
|
174
|
+
isMutation: true,
|
|
175
|
+
buildActionTitle: (args) => {
|
|
176
|
+
return `Run runbook ${ToolArgs.getString(args, "runbookId") || ""}`.trim();
|
|
177
|
+
},
|
|
178
|
+
execute: async (args, ctx) => {
|
|
179
|
+
var _a;
|
|
180
|
+
const runbookId = ToolArgs.getObjectID(args, "runbookId");
|
|
181
|
+
if (!runbookId) {
|
|
182
|
+
throw new BadDataException("runbookId is required. Use query tools to find it first.");
|
|
183
|
+
}
|
|
184
|
+
const userId = ctx.props.userId;
|
|
185
|
+
if (!userId) {
|
|
186
|
+
throw new BadDataException("No authenticated user in context; cannot run a runbook.");
|
|
187
|
+
}
|
|
188
|
+
const incidentId = ToolArgs.getObjectID(args, "incidentId");
|
|
189
|
+
// Visibility check under the user's RBAC.
|
|
190
|
+
const runbook = await RunbookService.findOneById({
|
|
191
|
+
id: runbookId,
|
|
192
|
+
select: { _id: true, name: true },
|
|
193
|
+
props: ctx.props,
|
|
194
|
+
});
|
|
195
|
+
if (!runbook) {
|
|
196
|
+
throw new BadDataException("Runbook not found (or you do not have access to it).");
|
|
197
|
+
}
|
|
198
|
+
const execution = await RunbookRuleEngineService.startRunbookFor({
|
|
199
|
+
projectId: ctx.projectId,
|
|
200
|
+
runbookId: runbookId,
|
|
201
|
+
linkage: incidentId ? { incidentId: incidentId } : {},
|
|
202
|
+
triggeredByUserId: userId,
|
|
203
|
+
});
|
|
204
|
+
if (!execution) {
|
|
205
|
+
throw new BadDataException(`Runbook "${runbook.name}" could not be started. It may be disabled, empty, or not part of this project.`);
|
|
206
|
+
}
|
|
207
|
+
const serialized = ToolResultSerializer.serializeRows([
|
|
208
|
+
{
|
|
209
|
+
runbook: runbook.name,
|
|
210
|
+
executionId: (_a = execution.id) === null || _a === void 0 ? void 0 : _a.toString(),
|
|
211
|
+
},
|
|
212
|
+
]);
|
|
213
|
+
const result = {
|
|
214
|
+
dataForLlm: `Started runbook "${runbook.name}". Execution is scheduled.\n${serialized.text}`,
|
|
215
|
+
rowCount: 1,
|
|
216
|
+
citationLabel: `Started runbook "${runbook.name}"`,
|
|
217
|
+
redactionCount: serialized.redactionCount,
|
|
218
|
+
isTruncated: false,
|
|
219
|
+
widget: WidgetBuilder.resourceCard({
|
|
220
|
+
title: "Runbook started",
|
|
221
|
+
resourceType: "Runbook",
|
|
222
|
+
heading: runbook.name || "Runbook",
|
|
223
|
+
subheading: "Execution scheduled",
|
|
224
|
+
fields: [{ label: "Runbook", value: runbook.name || "—" }],
|
|
225
|
+
}),
|
|
226
|
+
};
|
|
227
|
+
if (incidentId) {
|
|
228
|
+
result.citationTarget = {
|
|
229
|
+
type: AIChatCitationTargetType.IncidentView,
|
|
230
|
+
params: { incidentId: incidentId.toString() },
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
return result;
|
|
234
|
+
},
|
|
235
|
+
};
|
|
236
|
+
/*
|
|
237
|
+
* ---------------------------------------------------------------------------
|
|
238
|
+
* post_incident_status_update — customer-facing update on an incident.
|
|
239
|
+
* ---------------------------------------------------------------------------
|
|
240
|
+
*/
|
|
241
|
+
export const PostIncidentStatusUpdateTool = {
|
|
242
|
+
name: "post_incident_status_update",
|
|
243
|
+
description: "Post a customer-facing status update (public note) on an incident. It appears on the status page and, by default, notifies subscribers. Provide the incident id and the update text.",
|
|
244
|
+
inputSchema: {
|
|
245
|
+
type: "object",
|
|
246
|
+
properties: {
|
|
247
|
+
incidentId: {
|
|
248
|
+
type: "string",
|
|
249
|
+
description: "The incident's ID (required).",
|
|
250
|
+
},
|
|
251
|
+
note: {
|
|
252
|
+
type: "string",
|
|
253
|
+
description: "The customer-facing update text in markdown (required).",
|
|
254
|
+
},
|
|
255
|
+
notifySubscribers: {
|
|
256
|
+
type: "boolean",
|
|
257
|
+
description: "Whether to notify status page subscribers. Defaults to true.",
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
required: ["incidentId", "note"],
|
|
261
|
+
},
|
|
262
|
+
get requiredPermissions() {
|
|
263
|
+
return resolvePublicNoteCreatePermissions();
|
|
264
|
+
},
|
|
265
|
+
isMutation: true,
|
|
266
|
+
buildActionTitle: (args) => {
|
|
267
|
+
return `Post public status update on incident ${ToolArgs.getString(args, "incidentId") || ""}`.trim();
|
|
268
|
+
},
|
|
269
|
+
execute: async (args, ctx) => {
|
|
270
|
+
var _a;
|
|
271
|
+
const incidentId = ToolArgs.getObjectID(args, "incidentId");
|
|
272
|
+
if (!incidentId) {
|
|
273
|
+
throw new BadDataException("incidentId is required. Use query_incidents to find it first.");
|
|
274
|
+
}
|
|
275
|
+
const note = ToolArgs.getString(args, "note");
|
|
276
|
+
if (!note) {
|
|
277
|
+
throw new BadDataException("note is required (the update text).");
|
|
278
|
+
}
|
|
279
|
+
const userId = ctx.props.userId;
|
|
280
|
+
if (!userId) {
|
|
281
|
+
throw new BadDataException("No authenticated user in context; cannot post a status update.");
|
|
282
|
+
}
|
|
283
|
+
const notifySubscribers = (_a = ToolArgs.getBoolean(args, "notifySubscribers")) !== null && _a !== void 0 ? _a : true;
|
|
284
|
+
const incident = await IncidentService.findOneById({
|
|
285
|
+
id: incidentId,
|
|
286
|
+
select: { _id: true, incidentNumber: true, title: true },
|
|
287
|
+
props: ctx.props,
|
|
288
|
+
});
|
|
289
|
+
if (!incident) {
|
|
290
|
+
throw new BadDataException("Incident not found (or you do not have access to it).");
|
|
291
|
+
}
|
|
292
|
+
const publicNote = new IncidentPublicNote();
|
|
293
|
+
publicNote.incidentId = incidentId;
|
|
294
|
+
publicNote.projectId = ctx.projectId;
|
|
295
|
+
publicNote.note = note;
|
|
296
|
+
publicNote.postedAt = OneUptimeDate.getCurrentDate();
|
|
297
|
+
publicNote.createdByUserId = userId;
|
|
298
|
+
publicNote.shouldStatusPageSubscribersBeNotifiedOnNoteCreated =
|
|
299
|
+
notifySubscribers;
|
|
300
|
+
await IncidentPublicNoteService.create({
|
|
301
|
+
data: publicNote,
|
|
302
|
+
props: ctx.props,
|
|
303
|
+
});
|
|
304
|
+
const incidentIdString = incidentId.toString();
|
|
305
|
+
const serialized = ToolResultSerializer.serializeRows([
|
|
306
|
+
{
|
|
307
|
+
incidentNumber: incident.incidentNumber,
|
|
308
|
+
notifySubscribers: notifySubscribers,
|
|
309
|
+
},
|
|
310
|
+
]);
|
|
311
|
+
return {
|
|
312
|
+
dataForLlm: `Posted a public status update on incident #${incident.incidentNumber}${notifySubscribers ? " and notified subscribers" : ""}.\n${serialized.text}`,
|
|
313
|
+
rowCount: 1,
|
|
314
|
+
citationLabel: `Status update on incident #${incident.incidentNumber}`,
|
|
315
|
+
citationTarget: {
|
|
316
|
+
type: AIChatCitationTargetType.IncidentView,
|
|
317
|
+
params: { incidentId: incidentIdString },
|
|
318
|
+
},
|
|
319
|
+
redactionCount: serialized.redactionCount,
|
|
320
|
+
isTruncated: false,
|
|
321
|
+
widget: WidgetBuilder.resourceCard({
|
|
322
|
+
title: "Status update posted",
|
|
323
|
+
resourceType: "Incident",
|
|
324
|
+
heading: `#${incident.incidentNumber} · ${incident.title}`,
|
|
325
|
+
subheading: notifySubscribers
|
|
326
|
+
? "Subscribers notified"
|
|
327
|
+
: "Subscribers not notified",
|
|
328
|
+
fields: [
|
|
329
|
+
{
|
|
330
|
+
label: "Update",
|
|
331
|
+
value: note.length > 200 ? `${note.substring(0, 200)}…` : note,
|
|
332
|
+
},
|
|
333
|
+
],
|
|
334
|
+
link: {
|
|
335
|
+
type: AIChatCitationTargetType.IncidentView,
|
|
336
|
+
params: { incidentId: incidentIdString },
|
|
337
|
+
},
|
|
338
|
+
}),
|
|
339
|
+
};
|
|
340
|
+
},
|
|
341
|
+
};
|
|
342
|
+
/*
|
|
343
|
+
* ---------------------------------------------------------------------------
|
|
344
|
+
* change_incident_severity — re-classify an incident.
|
|
345
|
+
* ---------------------------------------------------------------------------
|
|
346
|
+
*/
|
|
347
|
+
export const ChangeIncidentSeverityTool = {
|
|
348
|
+
name: "change_incident_severity",
|
|
349
|
+
description: "Change the severity of an existing incident. Provide the incident id and the new severity name (must match an existing incident severity in this project, e.g. 'SEV1', 'Critical').",
|
|
350
|
+
inputSchema: {
|
|
351
|
+
type: "object",
|
|
352
|
+
properties: {
|
|
353
|
+
incidentId: {
|
|
354
|
+
type: "string",
|
|
355
|
+
description: "The incident's ID (required).",
|
|
356
|
+
},
|
|
357
|
+
severityName: {
|
|
358
|
+
type: "string",
|
|
359
|
+
description: "Name of an existing incident severity (required).",
|
|
360
|
+
},
|
|
361
|
+
},
|
|
362
|
+
required: ["incidentId", "severityName"],
|
|
363
|
+
},
|
|
364
|
+
get requiredPermissions() {
|
|
365
|
+
return resolveIncidentUpdatePermissions();
|
|
366
|
+
},
|
|
367
|
+
isMutation: true,
|
|
368
|
+
buildActionTitle: (args) => {
|
|
369
|
+
return `Change incident ${ToolArgs.getString(args, "incidentId") || ""} severity to ${ToolArgs.getString(args, "severityName") || ""}`.trim();
|
|
370
|
+
},
|
|
371
|
+
execute: async (args, ctx) => {
|
|
372
|
+
var _a;
|
|
373
|
+
const incidentId = ToolArgs.getObjectID(args, "incidentId");
|
|
374
|
+
if (!incidentId) {
|
|
375
|
+
throw new BadDataException("incidentId is required. Use query_incidents to find it first.");
|
|
376
|
+
}
|
|
377
|
+
const severityName = ToolArgs.getString(args, "severityName");
|
|
378
|
+
if (!severityName) {
|
|
379
|
+
throw new BadDataException("severityName is required.");
|
|
380
|
+
}
|
|
381
|
+
const incident = await IncidentService.findOneById({
|
|
382
|
+
id: incidentId,
|
|
383
|
+
select: { _id: true, incidentNumber: true, title: true },
|
|
384
|
+
props: ctx.props,
|
|
385
|
+
});
|
|
386
|
+
if (!incident) {
|
|
387
|
+
throw new BadDataException("Incident not found (or you do not have access to it).");
|
|
388
|
+
}
|
|
389
|
+
const severities = await IncidentSeverityService.findBy({
|
|
390
|
+
query: {},
|
|
391
|
+
select: { _id: true, name: true, order: true },
|
|
392
|
+
sort: { order: SortOrder.Ascending },
|
|
393
|
+
limit: 50,
|
|
394
|
+
skip: 0,
|
|
395
|
+
props: ctx.props,
|
|
396
|
+
});
|
|
397
|
+
const severity = severities.find((item) => {
|
|
398
|
+
var _a;
|
|
399
|
+
return ((_a = item.name) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === severityName.toLowerCase();
|
|
400
|
+
});
|
|
401
|
+
if (!severity) {
|
|
402
|
+
const available = severities
|
|
403
|
+
.map((s) => {
|
|
404
|
+
return s.name;
|
|
405
|
+
})
|
|
406
|
+
.filter(Boolean)
|
|
407
|
+
.join(", ");
|
|
408
|
+
throw new BadDataException(`No incident severity named "${severityName}". Available severities: ${available || "none configured"}.`);
|
|
409
|
+
}
|
|
410
|
+
await IncidentService.updateOneById({
|
|
411
|
+
id: incidentId,
|
|
412
|
+
data: {
|
|
413
|
+
incidentSeverityId: severity.id,
|
|
414
|
+
},
|
|
415
|
+
props: ctx.props,
|
|
416
|
+
});
|
|
417
|
+
const incidentIdString = incidentId.toString();
|
|
418
|
+
const serialized = ToolResultSerializer.serializeRows([
|
|
419
|
+
{
|
|
420
|
+
incidentNumber: incident.incidentNumber,
|
|
421
|
+
newSeverity: severity.name,
|
|
422
|
+
},
|
|
423
|
+
]);
|
|
424
|
+
return {
|
|
425
|
+
dataForLlm: `Changed incident #${incident.incidentNumber} severity to ${severity.name}.\n${serialized.text}`,
|
|
426
|
+
rowCount: 1,
|
|
427
|
+
citationLabel: `Incident #${incident.incidentNumber} → ${severity.name}`,
|
|
428
|
+
citationTarget: {
|
|
429
|
+
type: AIChatCitationTargetType.IncidentView,
|
|
430
|
+
params: { incidentId: incidentIdString },
|
|
431
|
+
},
|
|
432
|
+
redactionCount: serialized.redactionCount,
|
|
433
|
+
isTruncated: false,
|
|
434
|
+
widget: WidgetBuilder.resourceCard({
|
|
435
|
+
title: "Severity changed",
|
|
436
|
+
resourceType: "Incident",
|
|
437
|
+
heading: `#${incident.incidentNumber} · ${incident.title}`,
|
|
438
|
+
subheading: `Severity: ${severity.name}`,
|
|
439
|
+
fields: [
|
|
440
|
+
{ label: "Number", value: `#${(_a = incident.incidentNumber) !== null && _a !== void 0 ? _a : ""}` },
|
|
441
|
+
{ label: "New severity", value: severity.name || "—" },
|
|
442
|
+
],
|
|
443
|
+
link: {
|
|
444
|
+
type: AIChatCitationTargetType.IncidentView,
|
|
445
|
+
params: { incidentId: incidentIdString },
|
|
446
|
+
},
|
|
447
|
+
}),
|
|
448
|
+
};
|
|
449
|
+
},
|
|
450
|
+
};
|
|
451
|
+
//# sourceMappingURL=SentinelActionTools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file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ole
|
|
28
|
+
* BEGIN…END block, including newlines, so no key material leaks.
|
|
29
|
+
*/
|
|
30
|
+
name: "private-key",
|
|
31
|
+
regex: /-----BEGIN (?:[A-Z0-9]+ )*PRIVATE KEY-----[\s\S]*?-----END (?:[A-Z0-9]+ )*PRIVATE KEY-----/g,
|
|
32
|
+
replacement: "[redacted-private-key]",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "aws-access-key-id",
|
|
36
|
+
regex: /\b(?:AKIA|ASIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASCA)[0-9A-Z]{16}\b/g,
|
|
37
|
+
replacement: "[redacted-aws-key]",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "github-token",
|
|
41
|
+
regex: /\b(?:ghp|gho|ghu|ghs|ghr)_[A-Za-z0-9]{36,}\b|\bgithub_pat_[A-Za-z0-9_]{22,}\b/g,
|
|
42
|
+
replacement: "[redacted-github-token]",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "slack-token",
|
|
46
|
+
regex: /\bxox[baprs]-[A-Za-z0-9-]{10,}\b/g,
|
|
47
|
+
replacement: "[redacted-slack-token]",
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "google-api-key",
|
|
51
|
+
regex: /\bAIza[0-9A-Za-z_-]{35}\b/g,
|
|
52
|
+
replacement: "[redacted-google-api-key]",
|
|
53
|
+
},
|
|
25
54
|
{
|
|
26
55
|
name: "email",
|
|
27
56
|
regex: /[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,
|
|
@@ -32,6 +61,17 @@ const REDACTION_RULES = [
|
|
|
32
61
|
regex: /\b(?:\d{1,3}\.){3}\d{1,3}\b/g,
|
|
33
62
|
replacement: "[redacted-ip]",
|
|
34
63
|
},
|
|
64
|
+
{
|
|
65
|
+
/*
|
|
66
|
+
* Payment card numbers in the classic space/dash-separated grouping
|
|
67
|
+
* (e.g. "4111 1111 1111 1111"). Deliberately NOT matching bare 16-digit
|
|
68
|
+
* runs: an all-numeric 16-char OTel span id would collide with those and
|
|
69
|
+
* break the search_logs → get_trace pivot.
|
|
70
|
+
*/
|
|
71
|
+
name: "credit-card",
|
|
72
|
+
regex: /\b\d{4}[ -]\d{4}[ -]\d{4}[ -]\d{4}\b/g,
|
|
73
|
+
replacement: "[redacted-card]",
|
|
74
|
+
},
|
|
35
75
|
{
|
|
36
76
|
/*
|
|
37
77
|
* Long hex blobs are usually secrets (SHA-256 digests, 40+ char API
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Serializer.js","sourceRoot":"","sources":["../../../../../../Server/Utils/AI/Toolbox/Serializer.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,MAAM,QAAQ,GAAW,EAAE,CAAC;AAC5B,MAAM,gBAAgB,GAAW,GAAG,CAAC;AACrC,MAAM,iBAAiB,GAAW,EAAE,GAAG,IAAI,CAAC;AAQ5C;;;GAGG;AACH,MAAM,eAAe,GAAyB;IAC5C;QACE,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,+DAA+D;QACtE,WAAW,EAAE,gBAAgB;KAC9B;IACD;QACE,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,qCAAqC;QAC5C,WAAW,EAAE,yBAAyB;KACvC;IACD;QACE,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,iDAAiD;QACxD,WAAW,EAAE,kBAAkB;KAChC;IACD;QACE,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,8BAA8B;QACrC,WAAW,EAAE,eAAe;KAC7B;IACD;QACE;;;;;;;;;WASG;QACH,IAAI,EAAE,YAAY;QAClB,KAAK,EAAE,uBAAuB;QAC9B,WAAW,EAAE,gBAAgB;KAC9B;IACD;QACE,IAAI,EAAE,kBAAkB;QACxB,KAAK,EACH,2HAA2H;QAC7H,WAAW,EAAE,gBAAgB;KAC9B;CACF,CAAC;AAUF,MAAM,CAAC,OAAO,OAAO,oBAAoB;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
|
+
{"version":3,"file":"Serializer.js","sourceRoot":"","sources":["../../../../../../Server/Utils/AI/Toolbox/Serializer.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,MAAM,QAAQ,GAAW,EAAE,CAAC;AAC5B,MAAM,gBAAgB,GAAW,GAAG,CAAC;AACrC,MAAM,iBAAiB,GAAW,EAAE,GAAG,IAAI,CAAC;AAQ5C;;;GAGG;AACH,MAAM,eAAe,GAAyB;IAC5C;QACE,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,+DAA+D;QACtE,WAAW,EAAE,gBAAgB;KAC9B;IACD;QACE,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,qCAAqC;QAC5C,WAAW,EAAE,yBAAyB;KACvC;IACD;QACE;;;WAGG;QACH,IAAI,EAAE,aAAa;QACnB,KAAK,EACH,6FAA6F;QAC/F,WAAW,EAAE,wBAAwB;KACtC;IACD;QACE,IAAI,EAAE,mBAAmB;QACzB,KAAK,EAAE,mEAAmE;QAC1E,WAAW,EAAE,oBAAoB;KAClC;IACD;QACE,IAAI,EAAE,cAAc;QACpB,KAAK,EACH,gFAAgF;QAClF,WAAW,EAAE,yBAAyB;KACvC;IACD;QACE,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,mCAAmC;QAC1C,WAAW,EAAE,wBAAwB;KACtC;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,KAAK,EAAE,4BAA4B;QACnC,WAAW,EAAE,2BAA2B;KACzC;IACD;QACE,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,iDAAiD;QACxD,WAAW,EAAE,kBAAkB;KAChC;IACD;QACE,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,8BAA8B;QACrC,WAAW,EAAE,eAAe;KAC7B;IACD;QACE;;;;;WAKG;QACH,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,uCAAuC;QAC9C,WAAW,EAAE,iBAAiB;KAC/B;IACD;QACE;;;;;;;;;WASG;QACH,IAAI,EAAE,YAAY;QA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