@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
|
@@ -111,8 +111,15 @@ export default class RestrictionTimes extends DatabaseProperty {
|
|
|
111
111
|
"dayRestrictionTimes"
|
|
112
112
|
] as StartAndEndTime | null;
|
|
113
113
|
|
|
114
|
+
/*
|
|
115
|
+
* Fall back to an empty ARRAY, not an object. `|| {}` produced a non-array
|
|
116
|
+
* `{}` when the field was absent, which is truthy with an `undefined`
|
|
117
|
+
* `.length`, so Layer.getEventsByWeeklyRestriction's
|
|
118
|
+
* `!x || x.length === 0` guard passed through and `for (const w of {})`
|
|
119
|
+
* threw "not iterable", aborting event expansion for the layer (audit F20).
|
|
120
|
+
*/
|
|
114
121
|
const weeklyRestrictionTimes: Array<WeeklyResctriction> =
|
|
115
|
-
(data["weeklyRestrictionTimes"] as Array<WeeklyResctriction>) ||
|
|
122
|
+
(data["weeklyRestrictionTimes"] as Array<WeeklyResctriction>) || [];
|
|
116
123
|
|
|
117
124
|
restrictionTimes.weeklyRestrictionTimes = weeklyRestrictionTimes;
|
|
118
125
|
|
|
@@ -151,19 +158,38 @@ export default class RestrictionTimes extends DatabaseProperty {
|
|
|
151
158
|
}
|
|
152
159
|
|
|
153
160
|
public static getDefaultWeeklyRestrictionTIme(): WeeklyResctriction {
|
|
161
|
+
const startDay: DayOfWeek = DayOfWeek.Sunday;
|
|
162
|
+
const endDay: DayOfWeek = DayOfWeek.Monday;
|
|
163
|
+
|
|
164
|
+
/*
|
|
165
|
+
* Build the timestamps ON the named weekday. The rotation engine derives the
|
|
166
|
+
* ENFORCED weekday purely from the timestamp (getDayOfWeek(startTime)), NOT
|
|
167
|
+
* from startDay/endDay — so stamping TODAY's date (getDateWithCustomTime uses
|
|
168
|
+
* the current date) made an untouched default enforce coverage on TODAY's
|
|
169
|
+
* weekday while the dropdown still displayed Sunday -> Monday, i.e. the
|
|
170
|
+
* displayed config never matched who was actually on call (audit M4).
|
|
171
|
+
* moveDateToTheDayOfWeek keeps the time-of-day and moves to the target
|
|
172
|
+
* weekday, so timestamp, dropdown enum, preview and summary all agree.
|
|
173
|
+
*/
|
|
174
|
+
const now: Date = OneUptimeDate.getCurrentDate();
|
|
175
|
+
|
|
176
|
+
const startTime: Date = OneUptimeDate.moveDateToTheDayOfWeek(
|
|
177
|
+
OneUptimeDate.getDateWithCustomTime({ hours: 0, minutes: 0, seconds: 0 }),
|
|
178
|
+
now,
|
|
179
|
+
startDay,
|
|
180
|
+
);
|
|
181
|
+
|
|
182
|
+
const endTime: Date = OneUptimeDate.moveDateToTheDayOfWeek(
|
|
183
|
+
OneUptimeDate.getDateWithCustomTime({ hours: 1, minutes: 0, seconds: 0 }),
|
|
184
|
+
now,
|
|
185
|
+
endDay,
|
|
186
|
+
);
|
|
187
|
+
|
|
154
188
|
return {
|
|
155
|
-
startDay
|
|
156
|
-
endDay
|
|
157
|
-
startTime
|
|
158
|
-
|
|
159
|
-
minutes: 0,
|
|
160
|
-
seconds: 0,
|
|
161
|
-
}),
|
|
162
|
-
endTime: OneUptimeDate.getDateWithCustomTime({
|
|
163
|
-
hours: 1,
|
|
164
|
-
minutes: 0,
|
|
165
|
-
seconds: 0,
|
|
166
|
-
}),
|
|
189
|
+
startDay,
|
|
190
|
+
endDay,
|
|
191
|
+
startTime,
|
|
192
|
+
endTime,
|
|
167
193
|
};
|
|
168
194
|
}
|
|
169
195
|
|
|
@@ -92,16 +92,32 @@ export default class UserOverrideUtil {
|
|
|
92
92
|
event: CalendarEvent,
|
|
93
93
|
override: UserOverrideRecord,
|
|
94
94
|
): Array<CalendarEvent> {
|
|
95
|
+
/*
|
|
96
|
+
* Overrides are non-transitive: an override must never act on a segment
|
|
97
|
+
* that is itself the RESULT of a previous override. Otherwise a chain
|
|
98
|
+
* (global A->B applied first, then B->C) would double-substitute the same
|
|
99
|
+
* window, and the resolved user would depend on override ordering. A
|
|
100
|
+
* segment produced by a prior override carries OVERRIDE_META_KEY, so we
|
|
101
|
+
* leave it untouched here.
|
|
102
|
+
*/
|
|
103
|
+
if (UserOverrideUtil.getOverrideMeta(event)) {
|
|
104
|
+
return [event];
|
|
105
|
+
}
|
|
106
|
+
|
|
95
107
|
if (event.title !== override.overrideUserId) {
|
|
96
108
|
return [event];
|
|
97
109
|
}
|
|
98
110
|
|
|
99
|
-
|
|
111
|
+
/*
|
|
112
|
+
* Override window doesn't overlap event window at all. Use second-precision
|
|
113
|
+
* comparisons consistently (isOnOrAfter / isOnOrBefore) so a sub-second
|
|
114
|
+
* offset cannot slip past as "overlapping" and produce an inverted segment
|
|
115
|
+
* (previously isSame used millisecond precision while isAfter/isBefore used
|
|
116
|
+
* seconds, an inconsistent mix).
|
|
117
|
+
*/
|
|
100
118
|
if (
|
|
101
|
-
OneUptimeDate.
|
|
102
|
-
OneUptimeDate.
|
|
103
|
-
OneUptimeDate.isBefore(override.endsAt, event.start) ||
|
|
104
|
-
OneUptimeDate.isSame(override.endsAt, event.start)
|
|
119
|
+
OneUptimeDate.isOnOrAfter(override.startsAt, event.end) ||
|
|
120
|
+
OneUptimeDate.isOnOrBefore(override.endsAt, event.start)
|
|
105
121
|
) {
|
|
106
122
|
return [event];
|
|
107
123
|
}
|
|
@@ -45,6 +45,22 @@ const RecurringFieldElement: FunctionComponent<ComponentProps> = (
|
|
|
45
45
|
valueNumber = parseInt(valueNumber.toString());
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
/*
|
|
49
|
+
* Ignore transient invalid input (e.g. an empty field mid-edit) so
|
|
50
|
+
* we never persist NaN as the rotation interval, and enforce a
|
|
51
|
+
* whole-number minimum of 1. A 0 / NaN interval count previously
|
|
52
|
+
* broke the rotation handoff math.
|
|
53
|
+
*/
|
|
54
|
+
if (!Number.isFinite(valueNumber) || isNaN(valueNumber)) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (valueNumber < 1) {
|
|
59
|
+
valueNumber = 1;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
valueNumber = Math.floor(valueNumber);
|
|
63
|
+
|
|
48
64
|
let tempRecurring: Recurring | undefined = recurring;
|
|
49
65
|
|
|
50
66
|
if (!tempRecurring) {
|
|
@@ -37,21 +37,28 @@ const HeaderIconDropdownButton: FunctionComponent<ComponentProps> = (
|
|
|
37
37
|
setIsComponentVisible(Boolean(props.showDropdown));
|
|
38
38
|
}, [props.showDropdown]);
|
|
39
39
|
|
|
40
|
+
const hasLabel: boolean = Boolean(props.title);
|
|
41
|
+
const hasDropdown: boolean = Boolean(props.children);
|
|
42
|
+
|
|
43
|
+
const sizeClassName: string = hasLabel
|
|
44
|
+
? "h-9 gap-1.5 pl-2.5 pr-3"
|
|
45
|
+
: "h-9 w-9 justify-center";
|
|
46
|
+
|
|
40
47
|
return (
|
|
41
|
-
<div className="relative ml-
|
|
48
|
+
<div className="relative ml-2 flex-shrink-0">
|
|
42
49
|
<div>
|
|
43
50
|
<button
|
|
44
51
|
type="button"
|
|
45
|
-
className=
|
|
46
|
-
id="user-menu-button"
|
|
47
|
-
aria-expanded=
|
|
48
|
-
aria-haspopup="true"
|
|
52
|
+
className={`flex items-center rounded-lg border border-gray-200 bg-gray-50 hover:bg-gray-100 hover:border-gray-300 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-1 transition-all duration-150 ${sizeClassName}`}
|
|
53
|
+
id={hasDropdown ? "user-menu-button" : undefined}
|
|
54
|
+
aria-expanded={hasDropdown ? isDropdownVisible : undefined}
|
|
55
|
+
aria-haspopup={hasDropdown ? "true" : undefined}
|
|
49
56
|
onClick={() => {
|
|
50
57
|
props.onClick?.();
|
|
51
58
|
setIsComponentVisible(!isDropdownVisible);
|
|
52
59
|
}}
|
|
53
60
|
>
|
|
54
|
-
<span className="sr-only">{props.name}</span>
|
|
61
|
+
{!hasLabel && <span className="sr-only">{props.name}</span>}
|
|
55
62
|
{props.iconImageUrl && (
|
|
56
63
|
<Image
|
|
57
64
|
className="h-7 w-7 rounded-md object-cover"
|
|
@@ -63,14 +70,17 @@ const HeaderIconDropdownButton: FunctionComponent<ComponentProps> = (
|
|
|
63
70
|
/>
|
|
64
71
|
)}
|
|
65
72
|
{props.icon && (
|
|
66
|
-
<Icon
|
|
73
|
+
<Icon
|
|
74
|
+
className={`${hasLabel ? "h-4 w-4" : "h-5 w-5"} text-gray-500`}
|
|
75
|
+
icon={props.icon}
|
|
76
|
+
/>
|
|
77
|
+
)}
|
|
78
|
+
{hasLabel && (
|
|
79
|
+
<span className="text-sm font-medium text-gray-700 whitespace-nowrap">
|
|
80
|
+
{props.title}
|
|
81
|
+
</span>
|
|
67
82
|
)}
|
|
68
83
|
</button>
|
|
69
|
-
{props.title && (
|
|
70
|
-
<span className="ml-2 text-sm font-medium text-gray-700">
|
|
71
|
-
{props.title}
|
|
72
|
-
</span>
|
|
73
|
-
)}
|
|
74
84
|
{props.badge && props.badge > 0 && (
|
|
75
85
|
<span className="absolute -top-1 -right-1 flex h-5 w-5 items-center justify-center rounded-full bg-red-500 text-xs font-semibold text-white ring-2 ring-white">
|
|
76
86
|
{props.badge}
|
|
@@ -144,6 +144,14 @@ const MermaidDiagram: FunctionComponent<{ chart: string }> = ({
|
|
|
144
144
|
|
|
145
145
|
export interface ComponentProps {
|
|
146
146
|
text: string;
|
|
147
|
+
/*
|
|
148
|
+
* Hardened rendering for untrusted / LLM-generated content. When true, links
|
|
149
|
+
* render as non-clickable text and images are never fetched — both are
|
|
150
|
+
* neutralized on react-markdown's PARSED tree, so (unlike pre-processing the
|
|
151
|
+
* raw markdown with regexes) no CommonMark syntax trick can smuggle a
|
|
152
|
+
* clickable exfil link or a zero-click tracking pixel through.
|
|
153
|
+
*/
|
|
154
|
+
safeMode?: boolean;
|
|
147
155
|
}
|
|
148
156
|
|
|
149
157
|
// Language display names
|
|
@@ -348,6 +356,9 @@ const extractTextFromChildren: (children: unknown) => string = (
|
|
|
348
356
|
const MarkdownViewer: FunctionComponent<ComponentProps> = (
|
|
349
357
|
props: ComponentProps,
|
|
350
358
|
): ReactElement => {
|
|
359
|
+
// Captured here because the component overrides below shadow `props`.
|
|
360
|
+
const safeMode: boolean = props.safeMode === true;
|
|
361
|
+
|
|
351
362
|
return (
|
|
352
363
|
<div className="max-w-none">
|
|
353
364
|
<ReactMarkdown
|
|
@@ -409,19 +420,40 @@ const MarkdownViewer: FunctionComponent<ComponentProps> = (
|
|
|
409
420
|
/>
|
|
410
421
|
);
|
|
411
422
|
},
|
|
412
|
-
a: ({ ...props }: any) => {
|
|
423
|
+
a: ({ children, ...props }: any) => {
|
|
424
|
+
if (safeMode) {
|
|
425
|
+
// Keep the link text, drop the href: no navigation, no exfil.
|
|
426
|
+
return (
|
|
427
|
+
<span className="underline decoration-dotted text-gray-700 font-medium">
|
|
428
|
+
{children}
|
|
429
|
+
</span>
|
|
430
|
+
);
|
|
431
|
+
}
|
|
413
432
|
return (
|
|
414
433
|
<a
|
|
415
434
|
className="underline text-blue-600 hover:text-blue-800 font-medium transition-colors"
|
|
416
435
|
{...props}
|
|
417
|
-
|
|
436
|
+
>
|
|
437
|
+
{children}
|
|
438
|
+
</a>
|
|
418
439
|
);
|
|
419
440
|
},
|
|
420
|
-
img: ({ ...props }: any) => {
|
|
441
|
+
img: ({ alt, ...props }: any) => {
|
|
442
|
+
if (safeMode) {
|
|
443
|
+
/*
|
|
444
|
+
* Never emit an <img> for untrusted content — the browser would
|
|
445
|
+
* fetch its src on render (a zero-click exfil channel). Show the
|
|
446
|
+
* alt text (already plain, React-escaped) instead.
|
|
447
|
+
*/
|
|
448
|
+
return alt ? (
|
|
449
|
+
<span className="text-gray-500 italic">{`[image: ${alt}]`}</span>
|
|
450
|
+
) : null;
|
|
451
|
+
}
|
|
421
452
|
return (
|
|
422
453
|
<img
|
|
423
454
|
className="max-w-full h-auto rounded-md border border-gray-200 my-3"
|
|
424
455
|
loading="lazy"
|
|
456
|
+
alt={alt}
|
|
425
457
|
{...props}
|
|
426
458
|
/>
|
|
427
459
|
);
|
|
@@ -7,8 +7,10 @@ import ModelForm, {
|
|
|
7
7
|
ComponentProps as ModelFormComponentProps,
|
|
8
8
|
} from "../Forms/ModelForm";
|
|
9
9
|
import FormValues from "../Forms/Types/FormValues";
|
|
10
|
+
import { IconType } from "../Icon/Icon";
|
|
10
11
|
import Modal, { ModalWidth } from "../Modal/Modal";
|
|
11
12
|
import BaseModel from "../../../Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel";
|
|
13
|
+
import IconProp from "../../../Types/Icon/IconProp";
|
|
12
14
|
import { JSONObject } from "../../../Types/JSON";
|
|
13
15
|
import ObjectID from "../../../Types/ObjectID";
|
|
14
16
|
import React, { MutableRefObject, ReactElement, useRef, useState } from "react";
|
|
@@ -31,6 +33,12 @@ export interface ComponentProps<TBaseModel extends BaseModel> {
|
|
|
31
33
|
| ((item: TBaseModel, miscDataProps: JSONObject) => Promise<TBaseModel>)
|
|
32
34
|
| undefined;
|
|
33
35
|
footer?: ReactElement | undefined;
|
|
36
|
+
/*
|
|
37
|
+
* A header icon (rendered in a colored circle) to make the modal feel
|
|
38
|
+
* purpose-built. Forwarded to the underlying <Modal> via the props spread.
|
|
39
|
+
*/
|
|
40
|
+
icon?: IconProp | undefined;
|
|
41
|
+
iconType?: IconType | undefined;
|
|
34
42
|
formRef?: undefined | MutableRefObject<FormProps<FormValues<TBaseModel>>>;
|
|
35
43
|
}
|
|
36
44
|
|
|
@@ -10,6 +10,12 @@ import React, { FunctionComponent, ReactElement, useEffect } from "react";
|
|
|
10
10
|
|
|
11
11
|
export interface ComponentProps {
|
|
12
12
|
title?: string | undefined;
|
|
13
|
+
/*
|
|
14
|
+
* Optional one-line subtitle rendered under the title. Use it to say what the
|
|
15
|
+
* page is for when the title alone is not self-explanatory. Kept optional so
|
|
16
|
+
* existing pages that carry their description in a content card are unchanged.
|
|
17
|
+
*/
|
|
18
|
+
description?: string | undefined;
|
|
13
19
|
breadcrumbLinks?: Array<Link> | undefined;
|
|
14
20
|
children: Array<ReactElement> | ReactElement;
|
|
15
21
|
sideMenu?: undefined | ReactElement;
|
|
@@ -25,6 +31,9 @@ const Page: FunctionComponent<ComponentProps> = (
|
|
|
25
31
|
): ReactElement => {
|
|
26
32
|
const { translateString } = useTranslateValue();
|
|
27
33
|
const translatedTitle: string | undefined = translateString(props.title);
|
|
34
|
+
const translatedDescription: string | undefined = translateString(
|
|
35
|
+
props.description,
|
|
36
|
+
);
|
|
28
37
|
|
|
29
38
|
useEffect(() => {
|
|
30
39
|
if (props.breadcrumbLinks && props.breadcrumbLinks.length > 0) {
|
|
@@ -92,6 +101,11 @@ const Page: FunctionComponent<ComponentProps> = (
|
|
|
92
101
|
<h1 className="text-xl font-semibold leading-7 text-gray-900 sm:text-xl sm:tracking-tight sm:truncate">
|
|
93
102
|
{translatedTitle}
|
|
94
103
|
</h1>
|
|
104
|
+
{translatedDescription && (
|
|
105
|
+
<p className="max-w-3xl text-sm leading-6 text-gray-500">
|
|
106
|
+
{translatedDescription}
|
|
107
|
+
</p>
|
|
108
|
+
)}
|
|
95
109
|
</div>
|
|
96
110
|
{props.headerRight && (
|
|
97
111
|
<div className="flex flex-wrap items-center sm:justify-end gap-3">
|
|
@@ -60,7 +60,7 @@ const BasicRadioButton: FunctionComponent<ComponentProps> = (
|
|
|
60
60
|
type="radio"
|
|
61
61
|
name={id}
|
|
62
62
|
checked={checked}
|
|
63
|
-
|
|
63
|
+
onChange={() => {
|
|
64
64
|
handleChange(radioButton.value);
|
|
65
65
|
}}
|
|
66
66
|
className="h-4 w-4 border-gray-300 text-indigo-600 focus:ring-indigo-600"
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { DropdownOption } from "../Components/Dropdown/Dropdown";
|
|
2
|
+
import LlmType from "../../Types/LLM/LlmType";
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* Human-friendly display labels for each LLM provider. The dropdown `value`
|
|
6
|
+
* remains the raw LlmType enum value (which is persisted in the database), so
|
|
7
|
+
* only the label shown to the user changes.
|
|
8
|
+
*/
|
|
9
|
+
const LlmTypeDropdownOptions: Array<DropdownOption> = [
|
|
10
|
+
{
|
|
11
|
+
label: "OpenAI",
|
|
12
|
+
value: LlmType.OpenAI,
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
label: "Azure OpenAI",
|
|
16
|
+
value: LlmType.AzureOpenAI,
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
label: "Anthropic",
|
|
20
|
+
value: LlmType.Anthropic,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
label: "Groq",
|
|
24
|
+
value: LlmType.Groq,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
label: "Mistral",
|
|
28
|
+
value: LlmType.Mistral,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: "Ollama",
|
|
32
|
+
value: LlmType.Ollama,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: "OpenAI-Compatible (vLLM, LocalAI, etc.)",
|
|
36
|
+
value: LlmType.OpenAICompatible,
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
export default LlmTypeDropdownOptions;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import URL from "../../Types/API/URL";
|
|
2
|
+
import Dictionary from "../../Types/Dictionary";
|
|
3
|
+
import HTTPErrorResponse from "../../Types/API/HTTPErrorResponse";
|
|
4
|
+
import HTTPResponse from "../../Types/API/HTTPResponse";
|
|
5
|
+
import { JSONObject } from "../../Types/JSON";
|
|
6
|
+
import { APP_API_URL } from "../Config";
|
|
7
|
+
import API from "./API/API";
|
|
8
|
+
|
|
9
|
+
export interface LLMProviderTestResult {
|
|
10
|
+
success: boolean;
|
|
11
|
+
message: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default class TestLLMProvider {
|
|
15
|
+
/*
|
|
16
|
+
* Sends a small test prompt to an LLM provider (by id) via the
|
|
17
|
+
* /llm-provider/test endpoint and returns a friendly success/failure result.
|
|
18
|
+
* Callers pass the appropriate common headers (project tenant header for
|
|
19
|
+
* project providers, or none for admin/global providers).
|
|
20
|
+
*/
|
|
21
|
+
public static async test(data: {
|
|
22
|
+
llmProviderId: string;
|
|
23
|
+
headers?: Dictionary<string> | undefined;
|
|
24
|
+
}): Promise<LLMProviderTestResult> {
|
|
25
|
+
try {
|
|
26
|
+
const response: HTTPResponse<JSONObject> | HTTPErrorResponse =
|
|
27
|
+
await API.post({
|
|
28
|
+
url: URL.fromString(APP_API_URL.toString()).addRoute(
|
|
29
|
+
"/llm-provider/test",
|
|
30
|
+
),
|
|
31
|
+
data: {
|
|
32
|
+
llmProviderId: data.llmProviderId,
|
|
33
|
+
},
|
|
34
|
+
...(data.headers ? { headers: data.headers } : {}),
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
if (response.isFailure()) {
|
|
38
|
+
return {
|
|
39
|
+
success: false,
|
|
40
|
+
message: API.getFriendlyMessage(response),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const responseData: JSONObject = response.data as JSONObject;
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
success: true,
|
|
48
|
+
message:
|
|
49
|
+
(responseData["message"] as string) ||
|
|
50
|
+
"Connection successful. The LLM provider responded to a test prompt.",
|
|
51
|
+
};
|
|
52
|
+
} catch (err) {
|
|
53
|
+
return {
|
|
54
|
+
success: false,
|
|
55
|
+
message: API.getFriendlyMessage(err),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|