@oneuptime/common 11.3.25 → 11.3.28
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/AIConversation.ts +322 -0
- package/Models/DatabaseModels/AIConversationMessage.ts +495 -0
- package/Models/DatabaseModels/AIRun.ts +584 -0
- package/Models/DatabaseModels/AIRunEvent.ts +443 -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 +11 -0
- package/Models/DatabaseModels/LlmLog.ts +26 -0
- package/Models/DatabaseModels/LlmProvider.ts +2 -2
- 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/Server/API/AIChatAPI.ts +693 -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 +170 -0
- package/Server/API/MicrosoftTeamsAPI.ts +5 -0
- package/Server/API/ScheduledMaintenanceAPI.ts +1 -1
- package/Server/API/SlackAPI.ts +663 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783363279075-AddAIChatModels.ts +245 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783443471795-AddLlmProviderToAIConversation.ts +36 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783453297388-AddAIChatWriteActionsAndWidgets.ts +46 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1783461767405-MigrationName.ts +119 -0
- 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/Index.ts +16 -0
- package/Server/Infrastructure/PostgresDatabase.ts +11 -0
- package/Server/Services/AIConversationMessageService.ts +39 -0
- package/Server/Services/AIConversationService.ts +63 -0
- package/Server/Services/AIRunEventService.ts +39 -0
- package/Server/Services/AIRunService.ts +39 -0
- package/Server/Services/AIService.ts +127 -33
- package/Server/Services/AnalyticsDatabaseService.ts +10 -1
- package/Server/Services/DatabaseService.ts +29 -1
- package/Server/Services/IncidentService.ts +1 -1
- package/Server/Services/IncomingCallPolicyEscalationRuleService.ts +75 -2
- package/Server/Services/IncomingCallPolicyService.ts +42 -1
- package/Server/Services/Index.ts +2 -0
- package/Server/Services/LlmProviderService.ts +110 -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/ProjectService.ts +24 -0
- 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/AnalyticsDatabase/ModelPermission.ts +74 -9
- package/Server/Types/Database/QueryUtil.ts +57 -0
- package/Server/Utils/AI/AIChatPrivacyFilter.ts +28 -0
- package/Server/Utils/AI/AlertAIContextBuilder.ts +6 -1
- package/Server/Utils/AI/Chat/ChatAgentRunner.ts +1066 -0
- package/Server/Utils/AI/Chat/ObservabilityAssistant.ts +239 -0
- package/Server/Utils/AI/Chat/ObservabilityChatPrompt.ts +51 -0
- 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/Toolbox/AlertTools.ts +201 -0
- package/Server/Utils/AI/Toolbox/AlertWriteTools.ts +174 -0
- package/Server/Utils/AI/Toolbox/ContextTools.ts +189 -0
- package/Server/Utils/AI/Toolbox/ExceptionTools.ts +149 -0
- package/Server/Utils/AI/Toolbox/IncidentTools.ts +386 -0
- package/Server/Utils/AI/Toolbox/IncidentWriteTools.ts +350 -0
- package/Server/Utils/AI/Toolbox/Index.ts +231 -0
- package/Server/Utils/AI/Toolbox/LogTools.ts +339 -0
- package/Server/Utils/AI/Toolbox/MetricTools.ts +179 -0
- package/Server/Utils/AI/Toolbox/MonitorTools.ts +193 -0
- package/Server/Utils/AI/Toolbox/RecentChangesTools.ts +208 -0
- package/Server/Utils/AI/Toolbox/Serializer.ts +299 -0
- package/Server/Utils/AI/Toolbox/ToolTypes.ts +249 -0
- package/Server/Utils/AI/Toolbox/TraceTools.ts +402 -0
- package/Server/Utils/AI/Toolbox/WidgetBuilder.ts +189 -0
- package/Server/Utils/Database/MigrationFailureLog.ts +240 -0
- package/Server/Utils/IncomingCallPhoneNumber.ts +41 -0
- package/Server/Utils/LLM/LLMService.ts +605 -96
- package/Server/Utils/Telemetry/IoTSnapshotScan.ts +12 -9
- package/Server/Utils/Telemetry/ProxmoxCephSnapshotScan.ts +12 -9
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +512 -19
- package/Server/Utils/Workspace/Slack/Slack.ts +80 -0
- package/Server/Utils/Workspace/Slack/app-manifest.json +16 -1
- 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/AIChatModelACL.test.ts +42 -0
- package/Tests/Server/Utils/AI/ChatAgentHelpers.test.ts +89 -0
- package/Tests/Server/Utils/AI/LLMServiceBaseUrl.test.ts +139 -0
- package/Tests/Server/Utils/AI/LLMServiceToolCalling.test.ts +386 -0
- package/Tests/Server/Utils/AI/ToolArgsGetTimeRange.test.ts +62 -0
- package/Tests/Server/Utils/AI/ToolArgsScopeServiceIds.test.ts +79 -0
- package/Tests/Server/Utils/AI/ToolResultSerializer.test.ts +223 -0
- package/Tests/Types/Billing/SubscriptionStatus.test.ts +127 -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/Metrics/RecordingRuleDefinition.test.ts +213 -0
- 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/UserOverrideUtil.test.ts +255 -0
- package/Tests/Types/OnCallDutyPolicy/UserOverrideUtilExhaustive.test.ts +1126 -0
- package/Types/AI/AIChatMessageRole.ts +6 -0
- package/Types/AI/AIChatMessageStatus.ts +32 -0
- package/Types/AI/AIChatPermissionMode.ts +69 -0
- package/Types/AI/AIChatTypes.ts +231 -0
- package/Types/AI/AIRunEventType.ts +17 -0
- package/Types/AI/AIRunStatus.ts +28 -0
- package/Types/AI/AIRunType.ts +6 -0
- package/Types/Date.ts +200 -15
- package/Types/LLM/LlmType.ts +6 -0
- package/Types/OnCallDutyPolicy/Layer.ts +790 -260
- package/Types/OnCallDutyPolicy/RestrictionTimes.ts +39 -13
- package/Types/OnCallDutyPolicy/UserOverrideUtil.ts +21 -5
- package/UI/Components/Events/RecurringFieldElement.tsx +16 -0
- package/UI/Components/Header/HeaderIconDropdownButton.tsx +22 -12
- package/UI/Components/Markdown.tsx/MarkdownViewer.tsx +35 -3
- package/UI/Components/ModelFormModal/ModelFormModal.tsx +8 -0
- package/UI/Components/Page/Page.tsx +14 -0
- package/UI/Components/RadioButtons/BasicRadioButtons.tsx +1 -1
- package/UI/Utils/LlmTypeDropdownOptions.ts +40 -0
- package/UI/Utils/TestLLMProvider.ts +59 -0
- package/build/dist/Models/DatabaseModels/AIConversation.js +345 -0
- package/build/dist/Models/DatabaseModels/AIConversation.js.map +1 -0
- package/build/dist/Models/DatabaseModels/AIConversationMessage.js +521 -0
- package/build/dist/Models/DatabaseModels/AIConversationMessage.js.map +1 -0
- package/build/dist/Models/DatabaseModels/AIRun.js +619 -0
- package/build/dist/Models/DatabaseModels/AIRun.js.map +1 -0
- package/build/dist/Models/DatabaseModels/AIRunEvent.js +469 -0
- package/build/dist/Models/DatabaseModels/AIRunEvent.js.map +1 -0
- 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 +10 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/LlmLog.js +28 -0
- package/build/dist/Models/DatabaseModels/LlmLog.js.map +1 -1
- package/build/dist/Models/DatabaseModels/LlmProvider.js +2 -2
- package/build/dist/Models/DatabaseModels/LlmProvider.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/Server/API/AIChatAPI.js +498 -0
- package/build/dist/Server/API/AIChatAPI.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 +108 -1
- package/build/dist/Server/API/LlmProviderAPI.js.map +1 -1
- package/build/dist/Server/API/MicrosoftTeamsAPI.js +4 -0
- package/build/dist/Server/API/MicrosoftTeamsAPI.js.map +1 -1
- package/build/dist/Server/API/ScheduledMaintenanceAPI.js +1 -1
- package/build/dist/Server/API/SlackAPI.js +442 -0
- package/build/dist/Server/API/SlackAPI.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783363279075-AddAIChatModels.js +96 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783363279075-AddAIChatModels.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783443471795-AddLlmProviderToAIConversation.js +25 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783443471795-AddLlmProviderToAIConversation.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783453297388-AddAIChatWriteActionsAndWidgets.js +31 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783453297388-AddAIChatWriteActionsAndWidgets.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783461767405-MigrationName.js +46 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783461767405-MigrationName.js.map +1 -0
- 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/Index.js +16 -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/AIConversationMessageService.js +34 -0
- package/build/dist/Server/Services/AIConversationMessageService.js.map +1 -0
- package/build/dist/Server/Services/AIConversationService.js +42 -0
- package/build/dist/Server/Services/AIConversationService.js.map +1 -0
- package/build/dist/Server/Services/AIRunEventService.js +34 -0
- package/build/dist/Server/Services/AIRunEventService.js.map +1 -0
- package/build/dist/Server/Services/AIRunService.js +34 -0
- package/build/dist/Server/Services/AIRunService.js.map +1 -0
- package/build/dist/Server/Services/AIService.js +84 -25
- package/build/dist/Server/Services/AIService.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 +20 -1
- package/build/dist/Server/Services/DatabaseService.js.map +1 -1
- package/build/dist/Server/Services/IncidentService.js +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/LlmProviderService.js +108 -0
- package/build/dist/Server/Services/LlmProviderService.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/ProjectService.js +25 -0
- package/build/dist/Server/Services/ProjectService.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/AnalyticsDatabase/ModelPermission.js +50 -7
- package/build/dist/Server/Types/AnalyticsDatabase/ModelPermission.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/AIChatPrivacyFilter.js +18 -0
- package/build/dist/Server/Utils/AI/AIChatPrivacyFilter.js.map +1 -0
- 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 +756 -0
- package/build/dist/Server/Utils/AI/Chat/ChatAgentRunner.js.map +1 -0
- package/build/dist/Server/Utils/AI/Chat/ObservabilityAssistant.js +165 -0
- package/build/dist/Server/Utils/AI/Chat/ObservabilityAssistant.js.map +1 -0
- package/build/dist/Server/Utils/AI/Chat/ObservabilityChatPrompt.js +44 -0
- package/build/dist/Server/Utils/AI/Chat/ObservabilityChatPrompt.js.map +1 -0
- 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/Toolbox/AlertTools.js +167 -0
- package/build/dist/Server/Utils/AI/Toolbox/AlertTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/AlertWriteTools.js +136 -0
- package/build/dist/Server/Utils/AI/Toolbox/AlertWriteTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/ContextTools.js +141 -0
- package/build/dist/Server/Utils/AI/Toolbox/ContextTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/ExceptionTools.js +117 -0
- package/build/dist/Server/Utils/AI/Toolbox/ExceptionTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/IncidentTools.js +318 -0
- package/build/dist/Server/Utils/AI/Toolbox/IncidentTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/IncidentWriteTools.js +280 -0
- package/build/dist/Server/Utils/AI/Toolbox/IncidentWriteTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/Index.js +153 -0
- package/build/dist/Server/Utils/AI/Toolbox/Index.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/LogTools.js +246 -0
- package/build/dist/Server/Utils/AI/Toolbox/LogTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/MetricTools.js +120 -0
- package/build/dist/Server/Utils/AI/Toolbox/MetricTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/MonitorTools.js +158 -0
- package/build/dist/Server/Utils/AI/Toolbox/MonitorTools.js.map +1 -0
- 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/Serializer.js +228 -0
- package/build/dist/Server/Utils/AI/Toolbox/Serializer.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/ToolTypes.js +142 -0
- package/build/dist/Server/Utils/AI/Toolbox/ToolTypes.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/TraceTools.js +309 -0
- package/build/dist/Server/Utils/AI/Toolbox/TraceTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/WidgetBuilder.js +120 -0
- package/build/dist/Server/Utils/AI/Toolbox/WidgetBuilder.js.map +1 -0
- 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 +452 -92
- 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/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +378 -15
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Slack.js +59 -0
- package/build/dist/Server/Utils/Workspace/Slack/Slack.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/app-manifest.json +16 -1
- package/build/dist/Types/AI/AIChatMessageRole.js +7 -0
- package/build/dist/Types/AI/AIChatMessageRole.js.map +1 -0
- package/build/dist/Types/AI/AIChatMessageStatus.js +27 -0
- package/build/dist/Types/AI/AIChatMessageStatus.js.map +1 -0
- package/build/dist/Types/AI/AIChatPermissionMode.js +53 -0
- package/build/dist/Types/AI/AIChatPermissionMode.js.map +1 -0
- package/build/dist/Types/AI/AIChatTypes.js +74 -0
- package/build/dist/Types/AI/AIChatTypes.js.map +1 -0
- package/build/dist/Types/AI/AIRunEventType.js +18 -0
- package/build/dist/Types/AI/AIRunEventType.js.map +1 -0
- package/build/dist/Types/AI/AIRunStatus.js +26 -0
- package/build/dist/Types/AI/AIRunStatus.js.map +1 -0
- package/build/dist/Types/AI/AIRunType.js +7 -0
- package/build/dist/Types/AI/AIRunType.js.map +1 -0
- package/build/dist/Types/Date.js +153 -15
- package/build/dist/Types/Date.js.map +1 -1
- package/build/dist/Types/LLM/LlmType.js +6 -0
- package/build/dist/Types/LLM/LlmType.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/UserOverrideUtil.js +20 -5
- package/build/dist/Types/OnCallDutyPolicy/UserOverrideUtil.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/Header/HeaderIconDropdownButton.js +10 -5
- package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js.map +1 -1
- package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js +18 -4
- package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js.map +1 -1
- package/build/dist/UI/Components/ModelFormModal/ModelFormModal.js.map +1 -1
- package/build/dist/UI/Components/Page/Page.js +3 -1
- package/build/dist/UI/Components/Page/Page.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/build/dist/UI/Utils/LlmTypeDropdownOptions.js +38 -0
- package/build/dist/UI/Utils/LlmTypeDropdownOptions.js.map +1 -0
- package/build/dist/UI/Utils/TestLLMProvider.js +37 -0
- package/build/dist/UI/Utils/TestLLMProvider.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
enum AIChatMessageStatus {
|
|
2
|
+
Pending = "Pending",
|
|
3
|
+
InProgress = "InProgress",
|
|
4
|
+
/*
|
|
5
|
+
* The turn paused because the agent wants to run one or more mutating tools
|
|
6
|
+
* and the conversation is in "Ask for approval" mode. The message carries the
|
|
7
|
+
* pending tool actions; the user approves or denies them to resume the turn.
|
|
8
|
+
*/
|
|
9
|
+
WaitingForApproval = "WaitingForApproval",
|
|
10
|
+
Completed = "Completed",
|
|
11
|
+
Error = "Error",
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default AIChatMessageStatus;
|
|
15
|
+
|
|
16
|
+
export class AIChatMessageStatusHelper {
|
|
17
|
+
public static isTerminalStatus(status: AIChatMessageStatus): boolean {
|
|
18
|
+
return (
|
|
19
|
+
status === AIChatMessageStatus.Completed ||
|
|
20
|
+
status === AIChatMessageStatus.Error
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Statuses in which a run is still in flight (spinner or approval card shown).
|
|
25
|
+
public static isActiveStatus(status: AIChatMessageStatus): boolean {
|
|
26
|
+
return (
|
|
27
|
+
status === AIChatMessageStatus.Pending ||
|
|
28
|
+
status === AIChatMessageStatus.InProgress ||
|
|
29
|
+
status === AIChatMessageStatus.WaitingForApproval
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* How the AI chat agent is allowed to run tools that MUTATE project data
|
|
3
|
+
* (create/acknowledge/resolve incidents and alerts, etc). Read-only tools are
|
|
4
|
+
* never gated by this — they always run. This is stored per-conversation on
|
|
5
|
+
* AIConversation.permissionMode and enforced in ChatAgentRunner.
|
|
6
|
+
*/
|
|
7
|
+
enum AIChatPermissionMode {
|
|
8
|
+
/*
|
|
9
|
+
* The agent pauses before every mutating tool and asks the user to approve
|
|
10
|
+
* it. This is the safe default.
|
|
11
|
+
*/
|
|
12
|
+
AskForApproval = "AskForApproval",
|
|
13
|
+
/*
|
|
14
|
+
* The agent runs mutating tools immediately (still gated by the user's RBAC
|
|
15
|
+
* permissions). "Bypass permissions" / YOLO mode.
|
|
16
|
+
*/
|
|
17
|
+
AutoRun = "AutoRun",
|
|
18
|
+
// Mutating tools are not even offered to the model. The agent can only read.
|
|
19
|
+
ReadOnly = "ReadOnly",
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default AIChatPermissionMode;
|
|
23
|
+
|
|
24
|
+
export interface AIChatPermissionModeOption {
|
|
25
|
+
value: AIChatPermissionMode;
|
|
26
|
+
title: string;
|
|
27
|
+
description: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export class AIChatPermissionModeHelper {
|
|
31
|
+
public static getDefault(): AIChatPermissionMode {
|
|
32
|
+
return AIChatPermissionMode.AskForApproval;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
public static isValid(
|
|
36
|
+
value: string | undefined,
|
|
37
|
+
): value is AIChatPermissionMode {
|
|
38
|
+
return Object.values(AIChatPermissionMode).includes(
|
|
39
|
+
value as AIChatPermissionMode,
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public static parse(value: string | undefined): AIChatPermissionMode {
|
|
44
|
+
return this.isValid(value) ? value : this.getDefault();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public static getOptions(): Array<AIChatPermissionModeOption> {
|
|
48
|
+
return [
|
|
49
|
+
{
|
|
50
|
+
value: AIChatPermissionMode.AskForApproval,
|
|
51
|
+
title: "Ask for approval",
|
|
52
|
+
description:
|
|
53
|
+
"The copilot pauses and asks before it changes anything (creating incidents, acknowledging alerts, etc).",
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
value: AIChatPermissionMode.AutoRun,
|
|
57
|
+
title: "Auto-run (bypass approvals)",
|
|
58
|
+
description:
|
|
59
|
+
"The copilot performs actions immediately, still limited to what your role can do.",
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
value: AIChatPermissionMode.ReadOnly,
|
|
63
|
+
title: "Read-only",
|
|
64
|
+
description:
|
|
65
|
+
"The copilot can investigate and answer questions but can never change anything.",
|
|
66
|
+
},
|
|
67
|
+
];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { JSONObject } from "../JSON";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Shared types for the AI observability chat feature. These shapes are
|
|
5
|
+
* persisted as JSON columns on AIConversationMessage / AIRun / AIRunEvent and
|
|
6
|
+
* rendered by the dashboard, so they must stay JSON-serializable.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
* Where a citation chip should deep-link to in the dashboard. The dashboard
|
|
11
|
+
* maps each target type onto its own RouteMap entry.
|
|
12
|
+
*/
|
|
13
|
+
export enum AIChatCitationTargetType {
|
|
14
|
+
Logs = "Logs",
|
|
15
|
+
Traces = "Traces",
|
|
16
|
+
TraceView = "TraceView",
|
|
17
|
+
Metrics = "Metrics",
|
|
18
|
+
Exceptions = "Exceptions",
|
|
19
|
+
Incidents = "Incidents",
|
|
20
|
+
IncidentView = "IncidentView",
|
|
21
|
+
Alerts = "Alerts",
|
|
22
|
+
AlertView = "AlertView",
|
|
23
|
+
Monitors = "Monitors",
|
|
24
|
+
MonitorView = "MonitorView",
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface AIChatCitationTarget {
|
|
28
|
+
type: AIChatCitationTargetType;
|
|
29
|
+
// Route params keyed by param name (e.g. { traceId: "abc" }).
|
|
30
|
+
params?: { [key: string]: string };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/*
|
|
34
|
+
* Citations are minted server-side from validated tool arguments — never by
|
|
35
|
+
* the model. rowCount 0 is meaningful: it is proof of absence ("checked,
|
|
36
|
+
* found nothing").
|
|
37
|
+
*/
|
|
38
|
+
export interface AIChatCitation {
|
|
39
|
+
id: string; // "C1", "C2" — sequential per message
|
|
40
|
+
toolName: string;
|
|
41
|
+
label: string;
|
|
42
|
+
queryArguments: JSONObject; // validated tool args as executed — replayable
|
|
43
|
+
rowCount: number;
|
|
44
|
+
target?: AIChatCitationTarget | undefined;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/*
|
|
48
|
+
* ---------------------------------------------------------------------------
|
|
49
|
+
* Inline widgets
|
|
50
|
+
* ---------------------------------------------------------------------------
|
|
51
|
+
* A tool can attach a widget to its result. The widget is persisted on the
|
|
52
|
+
* assistant message (AIConversationMessage.widgets) and rendered inline in the
|
|
53
|
+
* chat by the dashboard. Widget `data` is type-specific and MUST stay
|
|
54
|
+
* JSON-serializable. Unlike the text sent to the LLM, widget data is built from
|
|
55
|
+
* the RAW rows (not the redacted/truncated LLM payload) because it is rendered
|
|
56
|
+
* back to the same user who already has RBAC access to it.
|
|
57
|
+
*/
|
|
58
|
+
export enum AIChatWidgetType {
|
|
59
|
+
// A time-series line chart (e.g. a metric aggregated over time).
|
|
60
|
+
TimeSeriesChart = "TimeSeriesChart",
|
|
61
|
+
// A bar chart, optionally stacked (e.g. log volume by severity over time).
|
|
62
|
+
BarChart = "BarChart",
|
|
63
|
+
// A generic sortable table.
|
|
64
|
+
Table = "Table",
|
|
65
|
+
// A trace waterfall (span tree with durations).
|
|
66
|
+
TraceWaterfall = "TraceWaterfall",
|
|
67
|
+
// A list of incident cards.
|
|
68
|
+
IncidentList = "IncidentList",
|
|
69
|
+
// A list of alert cards.
|
|
70
|
+
AlertList = "AlertList",
|
|
71
|
+
// A list of exception cards.
|
|
72
|
+
ExceptionList = "ExceptionList",
|
|
73
|
+
// KPI stat tiles.
|
|
74
|
+
StatCards = "StatCards",
|
|
75
|
+
// A single created/updated resource (e.g. the incident the agent just made).
|
|
76
|
+
ResourceCard = "ResourceCard",
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/*
|
|
80
|
+
* One point in a chart series. x is an ISO timestamp (time charts) or a
|
|
81
|
+
* category label (categorical charts); y is the numeric value.
|
|
82
|
+
*/
|
|
83
|
+
export interface AIChatWidgetPoint {
|
|
84
|
+
x: string;
|
|
85
|
+
y: number | null;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface AIChatWidgetSeries {
|
|
89
|
+
name: string;
|
|
90
|
+
points: Array<AIChatWidgetPoint>;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface AIChatWidgetColumn {
|
|
94
|
+
key: string;
|
|
95
|
+
title: string;
|
|
96
|
+
// Rough hint for alignment/formatting in the renderer.
|
|
97
|
+
type?: "text" | "number" | "date" | undefined;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface AIChatWidgetStat {
|
|
101
|
+
label: string;
|
|
102
|
+
value: string | number;
|
|
103
|
+
unit?: string | undefined;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface AIChatWidgetSpan {
|
|
107
|
+
spanId: string;
|
|
108
|
+
parentSpanId?: string | undefined;
|
|
109
|
+
name: string;
|
|
110
|
+
// Offset of the span start from the trace start, in milliseconds.
|
|
111
|
+
startOffsetMs: number;
|
|
112
|
+
durationMs: number;
|
|
113
|
+
isError: boolean;
|
|
114
|
+
serviceName?: string | undefined;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/*
|
|
118
|
+
* Type-specific widget payload. Only the fields relevant to `type` are set:
|
|
119
|
+
* - TimeSeriesChart / BarChart: `series` (+ `stacked`, `unit`, `xIsTime`)
|
|
120
|
+
* - Table: `columns` + `rows`
|
|
121
|
+
* - TraceWaterfall: `spans` + `totalDurationMs`
|
|
122
|
+
* - IncidentList / AlertList / ExceptionList: `items`
|
|
123
|
+
* - StatCards: `stats`
|
|
124
|
+
* - ResourceCard: `resourceType`, `heading`, `subheading`, `fields`, `link`
|
|
125
|
+
*/
|
|
126
|
+
export interface AIChatWidgetData {
|
|
127
|
+
series?: Array<AIChatWidgetSeries> | undefined;
|
|
128
|
+
stacked?: boolean | undefined;
|
|
129
|
+
xIsTime?: boolean | undefined;
|
|
130
|
+
unit?: string | undefined;
|
|
131
|
+
valueLabel?: string | undefined;
|
|
132
|
+
columns?: Array<AIChatWidgetColumn> | undefined;
|
|
133
|
+
rows?: Array<JSONObject> | undefined;
|
|
134
|
+
spans?: Array<AIChatWidgetSpan> | undefined;
|
|
135
|
+
totalDurationMs?: number | undefined;
|
|
136
|
+
items?: Array<JSONObject> | undefined;
|
|
137
|
+
stats?: Array<AIChatWidgetStat> | undefined;
|
|
138
|
+
resourceType?: string | undefined;
|
|
139
|
+
heading?: string | undefined;
|
|
140
|
+
subheading?: string | undefined;
|
|
141
|
+
fields?: Array<{ label: string; value: string }> | undefined;
|
|
142
|
+
link?: AIChatCitationTarget | undefined;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export interface AIChatWidget {
|
|
146
|
+
id: string; // "W1", "W2" — sequential per message
|
|
147
|
+
citationId?: string | undefined; // correlates to the citation of the same tool call
|
|
148
|
+
type: AIChatWidgetType;
|
|
149
|
+
title: string;
|
|
150
|
+
description?: string | undefined;
|
|
151
|
+
data: AIChatWidgetData;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/*
|
|
155
|
+
* ---------------------------------------------------------------------------
|
|
156
|
+
* Tool actions (mutations + approvals)
|
|
157
|
+
* ---------------------------------------------------------------------------
|
|
158
|
+
* When the agent wants to run a mutating tool it records an AIChatToolAction on
|
|
159
|
+
* the assistant message. In "Ask for approval" mode the action starts Pending
|
|
160
|
+
* and the run pauses until the user approves/denies it; the resumed run then
|
|
161
|
+
* executes approved actions and marks them Executed/Failed.
|
|
162
|
+
*/
|
|
163
|
+
export enum AIChatToolActionStatus {
|
|
164
|
+
Pending = "Pending", // awaiting the user's decision
|
|
165
|
+
Approved = "Approved", // user approved; not yet executed
|
|
166
|
+
Denied = "Denied", // user declined
|
|
167
|
+
Executed = "Executed", // ran successfully
|
|
168
|
+
Failed = "Failed", // ran but failed
|
|
169
|
+
Skipped = "Skipped", // not run (e.g. budget exhausted)
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export interface AIChatToolAction {
|
|
173
|
+
id: string; // equals the LLM tool call id
|
|
174
|
+
toolName: string;
|
|
175
|
+
title: string; // human label, e.g. "Create incident: Checkout is down"
|
|
176
|
+
description?: string | undefined;
|
|
177
|
+
arguments: JSONObject;
|
|
178
|
+
isMutation: boolean;
|
|
179
|
+
requiresApproval: boolean;
|
|
180
|
+
status: AIChatToolActionStatus;
|
|
181
|
+
resultSummary?: string | undefined;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export interface AIRunEventResultSummary {
|
|
185
|
+
rowCount?: number | undefined;
|
|
186
|
+
durationInMs?: number | undefined;
|
|
187
|
+
isTruncated?: boolean | undefined;
|
|
188
|
+
bytesSentToLlm?: number | undefined;
|
|
189
|
+
errorMessage?: string | undefined;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// What was sent to which LLM during a run — the per-run egress manifest.
|
|
193
|
+
export interface AIRunEgressManifestToolEntry {
|
|
194
|
+
toolName: string;
|
|
195
|
+
rowCount: number;
|
|
196
|
+
bytesSentToLlm: number;
|
|
197
|
+
redactionCount: number;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/*
|
|
201
|
+
* The serialized in-flight state of a turn that paused to wait for tool
|
|
202
|
+
* approval. Persisted on AIRun.pausedState so ChatAgentRunner.resumeTurn can
|
|
203
|
+
* rehydrate the exact conversation and continue the loop. `messages` and
|
|
204
|
+
* `pendingToolCalls` are JSON projections of the runner's internal
|
|
205
|
+
* LLMMessage / LLMToolCall types (kept as JSONObject here so this shared type
|
|
206
|
+
* does not depend on server code).
|
|
207
|
+
*/
|
|
208
|
+
export interface AIRunPausedState {
|
|
209
|
+
messages: Array<JSONObject>;
|
|
210
|
+
pendingToolCalls: Array<JSONObject>;
|
|
211
|
+
llmCallCount: number;
|
|
212
|
+
toolCallCount: number;
|
|
213
|
+
totalTokens: number;
|
|
214
|
+
totalCostInUSDCents: number;
|
|
215
|
+
eventSequence: number;
|
|
216
|
+
citations: Array<AIChatCitation>;
|
|
217
|
+
widgets: Array<AIChatWidget>;
|
|
218
|
+
toolActions: Array<AIChatToolAction>;
|
|
219
|
+
egressToolEntries: Array<AIRunEgressManifestToolEntry>;
|
|
220
|
+
startedAtMs: number;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export interface AIRunEgressManifest {
|
|
224
|
+
llmProviderName?: string | undefined;
|
|
225
|
+
llmType?: string | undefined;
|
|
226
|
+
modelName?: string | undefined;
|
|
227
|
+
isGlobalProvider?: boolean | undefined;
|
|
228
|
+
llmCallCount: number;
|
|
229
|
+
totalTokens: number;
|
|
230
|
+
toolDataSentToLlm: Array<AIRunEgressManifestToolEntry>;
|
|
231
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
enum AIRunEventType {
|
|
2
|
+
RunStarted = "RunStarted",
|
|
3
|
+
LlmCallStarted = "LlmCallStarted",
|
|
4
|
+
LlmCallCompleted = "LlmCallCompleted",
|
|
5
|
+
ToolCallStarted = "ToolCallStarted",
|
|
6
|
+
ToolCallCompleted = "ToolCallCompleted",
|
|
7
|
+
ToolCallFailed = "ToolCallFailed",
|
|
8
|
+
// The run paused to ask the user to approve one or more mutating actions.
|
|
9
|
+
ApprovalRequested = "ApprovalRequested",
|
|
10
|
+
// A mutating action the user approved was executed (or denied and skipped).
|
|
11
|
+
ActionExecuted = "ActionExecuted",
|
|
12
|
+
ActionDenied = "ActionDenied",
|
|
13
|
+
RunCompleted = "RunCompleted",
|
|
14
|
+
RunFailed = "RunFailed",
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default AIRunEventType;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
enum AIRunStatus {
|
|
2
|
+
Running = "Running",
|
|
3
|
+
/*
|
|
4
|
+
* The run paused mid-turn to wait for the user to approve pending tool
|
|
5
|
+
* actions (see AIChatPermissionMode.AskForApproval). It is not terminal — it
|
|
6
|
+
* resumes when the user responds — but it is also not actively consuming
|
|
7
|
+
* compute, so the stale-run sweeper (which only touches Running runs) leaves
|
|
8
|
+
* it alone.
|
|
9
|
+
*/
|
|
10
|
+
WaitingForApproval = "WaitingForApproval",
|
|
11
|
+
Completed = "Completed",
|
|
12
|
+
Error = "Error",
|
|
13
|
+
Cancelled = "Cancelled",
|
|
14
|
+
Stale = "Stale",
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default AIRunStatus;
|
|
18
|
+
|
|
19
|
+
export class AIRunStatusHelper {
|
|
20
|
+
public static isTerminalStatus(status: AIRunStatus): boolean {
|
|
21
|
+
return (
|
|
22
|
+
status === AIRunStatus.Completed ||
|
|
23
|
+
status === AIRunStatus.Error ||
|
|
24
|
+
status === AIRunStatus.Cancelled ||
|
|
25
|
+
status === AIRunStatus.Stale
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
}
|