@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.
Files changed (397) hide show
  1. package/Models/DatabaseModels/AIConversation.ts +322 -0
  2. package/Models/DatabaseModels/AIConversationMessage.ts +495 -0
  3. package/Models/DatabaseModels/AIRun.ts +584 -0
  4. package/Models/DatabaseModels/AIRunEvent.ts +443 -0
  5. package/Models/DatabaseModels/IncidentEpisodeRoleMember.ts +1 -1
  6. package/Models/DatabaseModels/IncidentMember.ts +1 -1
  7. package/Models/DatabaseModels/IncomingCallPolicy.ts +13 -0
  8. package/Models/DatabaseModels/Index.ts +11 -0
  9. package/Models/DatabaseModels/LlmLog.ts +26 -0
  10. package/Models/DatabaseModels/LlmProvider.ts +2 -2
  11. package/Models/DatabaseModels/MigrationFailure.ts +170 -0
  12. package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.ts +51 -2
  13. package/Models/DatabaseModels/OnCallDutyPolicySchedule.ts +44 -0
  14. package/Models/DatabaseModels/OnCallDutyPolicyScheduleLayer.ts +6 -0
  15. package/Models/DatabaseModels/OnCallDutyPolicyScheduleLayerUser.ts +6 -0
  16. package/Models/DatabaseModels/OnCallDutyPolicyTimeLog.ts +1 -1
  17. package/Models/DatabaseModels/OnCallDutyPolicyUserOverride.ts +2 -2
  18. package/Server/API/AIChatAPI.ts +693 -0
  19. package/Server/API/AlertAPI.ts +1 -1
  20. package/Server/API/IncidentAPI.ts +2 -2
  21. package/Server/API/IncidentEpisodeAPI.ts +1 -1
  22. package/Server/API/LlmProviderAPI.ts +170 -0
  23. package/Server/API/MicrosoftTeamsAPI.ts +5 -0
  24. package/Server/API/ScheduledMaintenanceAPI.ts +1 -1
  25. package/Server/API/SlackAPI.ts +663 -0
  26. package/Server/Infrastructure/Postgres/SchemaMigrations/1783363279075-AddAIChatModels.ts +245 -0
  27. package/Server/Infrastructure/Postgres/SchemaMigrations/1783443471795-AddLlmProviderToAIConversation.ts +36 -0
  28. package/Server/Infrastructure/Postgres/SchemaMigrations/1783453297388-AddAIChatWriteActionsAndWidgets.ts +46 -0
  29. package/Server/Infrastructure/Postgres/SchemaMigrations/1783461767405-MigrationName.ts +119 -0
  30. package/Server/Infrastructure/Postgres/SchemaMigrations/1783470000000-AddIncomingCallPolicyRoutingPhoneNumberUnique.ts +25 -0
  31. package/Server/Infrastructure/Postgres/SchemaMigrations/1783510935686-FixNotNullForeignKeysOnDelete.ts +81 -0
  32. package/Server/Infrastructure/Postgres/SchemaMigrations/1783515836148-MigrationName.ts +25 -0
  33. package/Server/Infrastructure/Postgres/SchemaMigrations/1783523076215-AddMigrationFailureTable.ts +35 -0
  34. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +16 -0
  35. package/Server/Infrastructure/PostgresDatabase.ts +11 -0
  36. package/Server/Services/AIConversationMessageService.ts +39 -0
  37. package/Server/Services/AIConversationService.ts +63 -0
  38. package/Server/Services/AIRunEventService.ts +39 -0
  39. package/Server/Services/AIRunService.ts +39 -0
  40. package/Server/Services/AIService.ts +127 -33
  41. package/Server/Services/AnalyticsDatabaseService.ts +10 -1
  42. package/Server/Services/DatabaseService.ts +29 -1
  43. package/Server/Services/IncidentService.ts +1 -1
  44. package/Server/Services/IncomingCallPolicyEscalationRuleService.ts +75 -2
  45. package/Server/Services/IncomingCallPolicyService.ts +42 -1
  46. package/Server/Services/Index.ts +2 -0
  47. package/Server/Services/LlmProviderService.ts +110 -0
  48. package/Server/Services/MigrationFailureService.ts +9 -0
  49. package/Server/Services/MonitorProbeService.ts +33 -7
  50. package/Server/Services/MonitorService.ts +19 -7
  51. package/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.ts +65 -0
  52. package/Server/Services/OnCallDutyPolicyEscalationRuleService.ts +185 -41
  53. package/Server/Services/OnCallDutyPolicyEscalationRuleUserService.ts +23 -15
  54. package/Server/Services/OnCallDutyPolicyExecutionLogService.ts +39 -0
  55. package/Server/Services/OnCallDutyPolicyScheduleLayerService.ts +148 -0
  56. package/Server/Services/OnCallDutyPolicyScheduleLayerUserService.ts +11 -2
  57. package/Server/Services/OnCallDutyPolicyScheduleService.ts +502 -26
  58. package/Server/Services/OnCallDutyPolicyTimeLogService.ts +49 -7
  59. package/Server/Services/OnCallDutyPolicyUserOverrideService.ts +218 -4
  60. package/Server/Services/ProjectCallSMSConfigService.ts +82 -1
  61. package/Server/Services/ProjectService.ts +24 -0
  62. package/Server/Services/TeamMemberService.ts +6 -0
  63. package/Server/Services/UserNotificationRuleService.ts +13 -42
  64. package/Server/Services/UserOnCallLogService.ts +90 -0
  65. package/Server/Services/UserOnCallLogTimelineService.ts +43 -1
  66. package/Server/Types/AnalyticsDatabase/ModelPermission.ts +74 -9
  67. package/Server/Types/Database/QueryUtil.ts +57 -0
  68. package/Server/Utils/AI/AIChatPrivacyFilter.ts +28 -0
  69. package/Server/Utils/AI/AlertAIContextBuilder.ts +6 -1
  70. package/Server/Utils/AI/Chat/ChatAgentRunner.ts +1066 -0
  71. package/Server/Utils/AI/Chat/ObservabilityAssistant.ts +239 -0
  72. package/Server/Utils/AI/Chat/ObservabilityChatPrompt.ts +51 -0
  73. package/Server/Utils/AI/IncidentAIContextBuilder.ts +18 -3
  74. package/Server/Utils/AI/IncidentEpisodeAIContextBuilder.ts +6 -1
  75. package/Server/Utils/AI/ScheduledMaintenanceAIContextBuilder.ts +12 -2
  76. package/Server/Utils/AI/Toolbox/AlertTools.ts +201 -0
  77. package/Server/Utils/AI/Toolbox/AlertWriteTools.ts +174 -0
  78. package/Server/Utils/AI/Toolbox/ContextTools.ts +189 -0
  79. package/Server/Utils/AI/Toolbox/ExceptionTools.ts +149 -0
  80. package/Server/Utils/AI/Toolbox/IncidentTools.ts +386 -0
  81. package/Server/Utils/AI/Toolbox/IncidentWriteTools.ts +350 -0
  82. package/Server/Utils/AI/Toolbox/Index.ts +231 -0
  83. package/Server/Utils/AI/Toolbox/LogTools.ts +339 -0
  84. package/Server/Utils/AI/Toolbox/MetricTools.ts +179 -0
  85. package/Server/Utils/AI/Toolbox/MonitorTools.ts +193 -0
  86. package/Server/Utils/AI/Toolbox/RecentChangesTools.ts +208 -0
  87. package/Server/Utils/AI/Toolbox/Serializer.ts +299 -0
  88. package/Server/Utils/AI/Toolbox/ToolTypes.ts +249 -0
  89. package/Server/Utils/AI/Toolbox/TraceTools.ts +402 -0
  90. package/Server/Utils/AI/Toolbox/WidgetBuilder.ts +189 -0
  91. package/Server/Utils/Database/MigrationFailureLog.ts +240 -0
  92. package/Server/Utils/IncomingCallPhoneNumber.ts +41 -0
  93. package/Server/Utils/LLM/LLMService.ts +605 -96
  94. package/Server/Utils/Telemetry/IoTSnapshotScan.ts +12 -9
  95. package/Server/Utils/Telemetry/ProxmoxCephSnapshotScan.ts +12 -9
  96. package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +512 -19
  97. package/Server/Utils/Workspace/Slack/Slack.ts +80 -0
  98. package/Server/Utils/Workspace/Slack/app-manifest.json +16 -1
  99. package/Tests/Server/Services/AnalyticsDatabaseService.test.ts +0 -8
  100. package/Tests/Server/Services/OnCallDutyPolicyScheduleLayerUserReorder.test.ts +233 -0
  101. package/Tests/Server/Services/OnCallDutyPolicyTimeLogServiceScoping.test.ts +242 -0
  102. package/Tests/Server/Services/OnCallDutyPolicyUserOverrideEdit.test.ts +198 -0
  103. package/Tests/Server/Services/UserOnCallLogClaimNotificationRule.test.ts +495 -0
  104. package/Tests/Server/Types/Database/QueryUtil.test.ts +74 -0
  105. package/Tests/Server/Utils/AI/AIChatModelACL.test.ts +42 -0
  106. package/Tests/Server/Utils/AI/ChatAgentHelpers.test.ts +89 -0
  107. package/Tests/Server/Utils/AI/LLMServiceBaseUrl.test.ts +139 -0
  108. package/Tests/Server/Utils/AI/LLMServiceToolCalling.test.ts +386 -0
  109. package/Tests/Server/Utils/AI/ToolArgsGetTimeRange.test.ts +62 -0
  110. package/Tests/Server/Utils/AI/ToolArgsScopeServiceIds.test.ts +79 -0
  111. package/Tests/Server/Utils/AI/ToolResultSerializer.test.ts +223 -0
  112. package/Tests/Types/Billing/SubscriptionStatus.test.ts +127 -0
  113. package/Tests/Types/DateExhaustiveTimezone.test.ts +700 -0
  114. package/Tests/Types/DateTimezoneWallClock.test.ts +99 -0
  115. package/Tests/Types/Events/Recurring.test.ts +22 -9
  116. package/Tests/Types/Metrics/RecordingRuleDefinition.test.ts +213 -0
  117. package/Tests/Types/OnCallDutyPolicy/LayerUtilAuditFixes.test.ts +291 -0
  118. package/Tests/Types/OnCallDutyPolicy/LayerUtilAuditFixesRound2.test.ts +398 -0
  119. package/Tests/Types/OnCallDutyPolicy/LayerUtilDSTWeekendGap.test.ts +114 -0
  120. package/Tests/Types/OnCallDutyPolicy/LayerUtilDSTWeeklyDayShift.test.ts +76 -0
  121. package/Tests/Types/OnCallDutyPolicy/LayerUtilDailyMutation.test.ts +128 -0
  122. package/Tests/Types/OnCallDutyPolicy/LayerUtilDailyProbe.test.ts +203 -0
  123. package/Tests/Types/OnCallDutyPolicy/LayerUtilDiffFuzz.test.ts +322 -0
  124. package/Tests/Types/OnCallDutyPolicy/LayerUtilEdgeCases.test.ts +280 -0
  125. package/Tests/Types/OnCallDutyPolicy/LayerUtilExhaustiveCurrentUser.test.ts +863 -0
  126. package/Tests/Types/OnCallDutyPolicy/LayerUtilExhaustiveDaily.test.ts +900 -0
  127. package/Tests/Types/OnCallDutyPolicy/LayerUtilExhaustiveMultiLayer.test.ts +1104 -0
  128. package/Tests/Types/OnCallDutyPolicy/LayerUtilExhaustiveRotation.test.ts +957 -0
  129. package/Tests/Types/OnCallDutyPolicy/LayerUtilExhaustiveWeekly.test.ts +1095 -0
  130. package/Tests/Types/OnCallDutyPolicy/LayerUtilInvariants.test.ts +232 -0
  131. package/Tests/Types/OnCallDutyPolicy/LayerUtilMergeAudit.test.ts +227 -0
  132. package/Tests/Types/OnCallDutyPolicy/LayerUtilMonthYearAudit.test.ts +255 -0
  133. package/Tests/Types/OnCallDutyPolicy/LayerUtilMultiLayerAudit.test.ts +388 -0
  134. package/Tests/Types/OnCallDutyPolicy/LayerUtilMultiLayerEdge.test.ts +300 -0
  135. package/Tests/Types/OnCallDutyPolicy/LayerUtilOvernightDSTAudit.test.ts +158 -0
  136. package/Tests/Types/OnCallDutyPolicy/LayerUtilRestrictedGapFix.test.ts +253 -0
  137. package/Tests/Types/OnCallDutyPolicy/LayerUtilRestrictedGapRepro.test.ts +157 -0
  138. package/Tests/Types/OnCallDutyPolicy/LayerUtilRotationFixes.test.ts +414 -0
  139. package/Tests/Types/OnCallDutyPolicy/LayerUtilTimezone.test.ts +243 -0
  140. package/Tests/Types/OnCallDutyPolicy/LayerUtilWeekendGapRepro.test.ts +112 -0
  141. package/Tests/Types/OnCallDutyPolicy/OverrideLensAudit.test.ts +117 -0
  142. package/Tests/Types/OnCallDutyPolicy/RestrictionTimes.test.ts +8 -6
  143. package/Tests/Types/OnCallDutyPolicy/RestrictionTimesDefaultDayAudit.test.ts +112 -0
  144. package/Tests/Types/OnCallDutyPolicy/RestrictionTimesExhaustive.test.ts +821 -0
  145. package/Tests/Types/OnCallDutyPolicy/RestrictionTimesMutationInvariant.test.ts +886 -0
  146. package/Tests/Types/OnCallDutyPolicy/UserOverrideUtil.test.ts +255 -0
  147. package/Tests/Types/OnCallDutyPolicy/UserOverrideUtilExhaustive.test.ts +1126 -0
  148. package/Types/AI/AIChatMessageRole.ts +6 -0
  149. package/Types/AI/AIChatMessageStatus.ts +32 -0
  150. package/Types/AI/AIChatPermissionMode.ts +69 -0
  151. package/Types/AI/AIChatTypes.ts +231 -0
  152. package/Types/AI/AIRunEventType.ts +17 -0
  153. package/Types/AI/AIRunStatus.ts +28 -0
  154. package/Types/AI/AIRunType.ts +6 -0
  155. package/Types/Date.ts +200 -15
  156. package/Types/LLM/LlmType.ts +6 -0
  157. package/Types/OnCallDutyPolicy/Layer.ts +790 -260
  158. package/Types/OnCallDutyPolicy/RestrictionTimes.ts +39 -13
  159. package/Types/OnCallDutyPolicy/UserOverrideUtil.ts +21 -5
  160. package/UI/Components/Events/RecurringFieldElement.tsx +16 -0
  161. package/UI/Components/Header/HeaderIconDropdownButton.tsx +22 -12
  162. package/UI/Components/Markdown.tsx/MarkdownViewer.tsx +35 -3
  163. package/UI/Components/ModelFormModal/ModelFormModal.tsx +8 -0
  164. package/UI/Components/Page/Page.tsx +14 -0
  165. package/UI/Components/RadioButtons/BasicRadioButtons.tsx +1 -1
  166. package/UI/Utils/LlmTypeDropdownOptions.ts +40 -0
  167. package/UI/Utils/TestLLMProvider.ts +59 -0
  168. package/build/dist/Models/DatabaseModels/AIConversation.js +345 -0
  169. package/build/dist/Models/DatabaseModels/AIConversation.js.map +1 -0
  170. package/build/dist/Models/DatabaseModels/AIConversationMessage.js +521 -0
  171. package/build/dist/Models/DatabaseModels/AIConversationMessage.js.map +1 -0
  172. package/build/dist/Models/DatabaseModels/AIRun.js +619 -0
  173. package/build/dist/Models/DatabaseModels/AIRun.js.map +1 -0
  174. package/build/dist/Models/DatabaseModels/AIRunEvent.js +469 -0
  175. package/build/dist/Models/DatabaseModels/AIRunEvent.js.map +1 -0
  176. package/build/dist/Models/DatabaseModels/IncidentEpisodeRoleMember.js +1 -1
  177. package/build/dist/Models/DatabaseModels/IncidentEpisodeRoleMember.js.map +1 -1
  178. package/build/dist/Models/DatabaseModels/IncidentMember.js +1 -1
  179. package/build/dist/Models/DatabaseModels/IncidentMember.js.map +1 -1
  180. package/build/dist/Models/DatabaseModels/IncomingCallPolicy.js +10 -0
  181. package/build/dist/Models/DatabaseModels/IncomingCallPolicy.js.map +1 -1
  182. package/build/dist/Models/DatabaseModels/Index.js +10 -0
  183. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  184. package/build/dist/Models/DatabaseModels/LlmLog.js +28 -0
  185. package/build/dist/Models/DatabaseModels/LlmLog.js.map +1 -1
  186. package/build/dist/Models/DatabaseModels/LlmProvider.js +2 -2
  187. package/build/dist/Models/DatabaseModels/LlmProvider.js.map +1 -1
  188. package/build/dist/Models/DatabaseModels/MigrationFailure.js +196 -0
  189. package/build/dist/Models/DatabaseModels/MigrationFailure.js.map +1 -0
  190. package/build/dist/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.js +52 -2
  191. package/build/dist/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.js.map +1 -1
  192. package/build/dist/Models/DatabaseModels/OnCallDutyPolicySchedule.js +45 -0
  193. package/build/dist/Models/DatabaseModels/OnCallDutyPolicySchedule.js.map +1 -1
  194. package/build/dist/Models/DatabaseModels/OnCallDutyPolicyScheduleLayer.js +6 -0
  195. package/build/dist/Models/DatabaseModels/OnCallDutyPolicyScheduleLayer.js.map +1 -1
  196. package/build/dist/Models/DatabaseModels/OnCallDutyPolicyScheduleLayerUser.js +6 -0
  197. package/build/dist/Models/DatabaseModels/OnCallDutyPolicyScheduleLayerUser.js.map +1 -1
  198. package/build/dist/Models/DatabaseModels/OnCallDutyPolicyTimeLog.js +1 -1
  199. package/build/dist/Models/DatabaseModels/OnCallDutyPolicyTimeLog.js.map +1 -1
  200. package/build/dist/Models/DatabaseModels/OnCallDutyPolicyUserOverride.js +2 -2
  201. package/build/dist/Models/DatabaseModels/OnCallDutyPolicyUserOverride.js.map +1 -1
  202. package/build/dist/Server/API/AIChatAPI.js +498 -0
  203. package/build/dist/Server/API/AIChatAPI.js.map +1 -0
  204. package/build/dist/Server/API/AlertAPI.js +1 -1
  205. package/build/dist/Server/API/IncidentAPI.js +2 -2
  206. package/build/dist/Server/API/IncidentEpisodeAPI.js +1 -1
  207. package/build/dist/Server/API/LlmProviderAPI.js +108 -1
  208. package/build/dist/Server/API/LlmProviderAPI.js.map +1 -1
  209. package/build/dist/Server/API/MicrosoftTeamsAPI.js +4 -0
  210. package/build/dist/Server/API/MicrosoftTeamsAPI.js.map +1 -1
  211. package/build/dist/Server/API/ScheduledMaintenanceAPI.js +1 -1
  212. package/build/dist/Server/API/SlackAPI.js +442 -0
  213. package/build/dist/Server/API/SlackAPI.js.map +1 -1
  214. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783363279075-AddAIChatModels.js +96 -0
  215. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783363279075-AddAIChatModels.js.map +1 -0
  216. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783443471795-AddLlmProviderToAIConversation.js +25 -0
  217. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783443471795-AddLlmProviderToAIConversation.js.map +1 -0
  218. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783453297388-AddAIChatWriteActionsAndWidgets.js +31 -0
  219. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783453297388-AddAIChatWriteActionsAndWidgets.js.map +1 -0
  220. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783461767405-MigrationName.js +46 -0
  221. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783461767405-MigrationName.js.map +1 -0
  222. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783470000000-AddIncomingCallPolicyRoutingPhoneNumberUnique.js +18 -0
  223. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783470000000-AddIncomingCallPolicyRoutingPhoneNumberUnique.js.map +1 -0
  224. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783510935686-FixNotNullForeignKeysOnDelete.js +38 -0
  225. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783510935686-FixNotNullForeignKeysOnDelete.js.map +1 -0
  226. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783515836148-MigrationName.js +16 -0
  227. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783515836148-MigrationName.js.map +1 -0
  228. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783523076215-AddMigrationFailureTable.js +18 -0
  229. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1783523076215-AddMigrationFailureTable.js.map +1 -0
  230. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +16 -0
  231. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  232. package/build/dist/Server/Infrastructure/PostgresDatabase.js +9 -0
  233. package/build/dist/Server/Infrastructure/PostgresDatabase.js.map +1 -1
  234. package/build/dist/Server/Services/AIConversationMessageService.js +34 -0
  235. package/build/dist/Server/Services/AIConversationMessageService.js.map +1 -0
  236. package/build/dist/Server/Services/AIConversationService.js +42 -0
  237. package/build/dist/Server/Services/AIConversationService.js.map +1 -0
  238. package/build/dist/Server/Services/AIRunEventService.js +34 -0
  239. package/build/dist/Server/Services/AIRunEventService.js.map +1 -0
  240. package/build/dist/Server/Services/AIRunService.js +34 -0
  241. package/build/dist/Server/Services/AIRunService.js.map +1 -0
  242. package/build/dist/Server/Services/AIService.js +84 -25
  243. package/build/dist/Server/Services/AIService.js.map +1 -1
  244. package/build/dist/Server/Services/AnalyticsDatabaseService.js +10 -1
  245. package/build/dist/Server/Services/AnalyticsDatabaseService.js.map +1 -1
  246. package/build/dist/Server/Services/DatabaseService.js +20 -1
  247. package/build/dist/Server/Services/DatabaseService.js.map +1 -1
  248. package/build/dist/Server/Services/IncidentService.js +1 -1
  249. package/build/dist/Server/Services/IncomingCallPolicyEscalationRuleService.js +55 -2
  250. package/build/dist/Server/Services/IncomingCallPolicyEscalationRuleService.js.map +1 -1
  251. package/build/dist/Server/Services/IncomingCallPolicyService.js +40 -0
  252. package/build/dist/Server/Services/IncomingCallPolicyService.js.map +1 -1
  253. package/build/dist/Server/Services/Index.js +2 -0
  254. package/build/dist/Server/Services/Index.js.map +1 -1
  255. package/build/dist/Server/Services/LlmProviderService.js +108 -0
  256. package/build/dist/Server/Services/LlmProviderService.js.map +1 -1
  257. package/build/dist/Server/Services/MigrationFailureService.js +9 -0
  258. package/build/dist/Server/Services/MigrationFailureService.js.map +1 -0
  259. package/build/dist/Server/Services/MonitorProbeService.js +33 -7
  260. package/build/dist/Server/Services/MonitorProbeService.js.map +1 -1
  261. package/build/dist/Server/Services/MonitorService.js +12 -5
  262. package/build/dist/Server/Services/MonitorService.js.map +1 -1
  263. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.js +81 -22
  264. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.js.map +1 -1
  265. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleService.js +134 -31
  266. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleService.js.map +1 -1
  267. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleUserService.js +21 -13
  268. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleUserService.js.map +1 -1
  269. package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogService.js +36 -0
  270. package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogService.js.map +1 -1
  271. package/build/dist/Server/Services/OnCallDutyPolicyScheduleLayerService.js +121 -0
  272. package/build/dist/Server/Services/OnCallDutyPolicyScheduleLayerService.js.map +1 -1
  273. package/build/dist/Server/Services/OnCallDutyPolicyScheduleLayerUserService.js +11 -2
  274. package/build/dist/Server/Services/OnCallDutyPolicyScheduleLayerUserService.js.map +1 -1
  275. package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js +409 -36
  276. package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js.map +1 -1
  277. package/build/dist/Server/Services/OnCallDutyPolicyTimeLogService.js +52 -8
  278. package/build/dist/Server/Services/OnCallDutyPolicyTimeLogService.js.map +1 -1
  279. package/build/dist/Server/Services/OnCallDutyPolicyUserOverrideService.js +170 -3
  280. package/build/dist/Server/Services/OnCallDutyPolicyUserOverrideService.js.map +1 -1
  281. package/build/dist/Server/Services/ProjectCallSMSConfigService.js +72 -0
  282. package/build/dist/Server/Services/ProjectCallSMSConfigService.js.map +1 -1
  283. package/build/dist/Server/Services/ProjectService.js +25 -0
  284. package/build/dist/Server/Services/ProjectService.js.map +1 -1
  285. package/build/dist/Server/Services/TeamMemberService.js +6 -0
  286. package/build/dist/Server/Services/TeamMemberService.js.map +1 -1
  287. package/build/dist/Server/Services/UserNotificationRuleService.js +12 -30
  288. package/build/dist/Server/Services/UserNotificationRuleService.js.map +1 -1
  289. package/build/dist/Server/Services/UserOnCallLogService.js +75 -0
  290. package/build/dist/Server/Services/UserOnCallLogService.js.map +1 -1
  291. package/build/dist/Server/Services/UserOnCallLogTimelineService.js +31 -1
  292. package/build/dist/Server/Services/UserOnCallLogTimelineService.js.map +1 -1
  293. package/build/dist/Server/Types/AnalyticsDatabase/ModelPermission.js +50 -7
  294. package/build/dist/Server/Types/AnalyticsDatabase/ModelPermission.js.map +1 -1
  295. package/build/dist/Server/Types/Database/QueryUtil.js +45 -0
  296. package/build/dist/Server/Types/Database/QueryUtil.js.map +1 -1
  297. package/build/dist/Server/Utils/AI/AIChatPrivacyFilter.js +18 -0
  298. package/build/dist/Server/Utils/AI/AIChatPrivacyFilter.js.map +1 -0
  299. package/build/dist/Server/Utils/AI/AlertAIContextBuilder.js +6 -1
  300. package/build/dist/Server/Utils/AI/AlertAIContextBuilder.js.map +1 -1
  301. package/build/dist/Server/Utils/AI/Chat/ChatAgentRunner.js +756 -0
  302. package/build/dist/Server/Utils/AI/Chat/ChatAgentRunner.js.map +1 -0
  303. package/build/dist/Server/Utils/AI/Chat/ObservabilityAssistant.js +165 -0
  304. package/build/dist/Server/Utils/AI/Chat/ObservabilityAssistant.js.map +1 -0
  305. package/build/dist/Server/Utils/AI/Chat/ObservabilityChatPrompt.js +44 -0
  306. package/build/dist/Server/Utils/AI/Chat/ObservabilityChatPrompt.js.map +1 -0
  307. package/build/dist/Server/Utils/AI/IncidentAIContextBuilder.js +18 -3
  308. package/build/dist/Server/Utils/AI/IncidentAIContextBuilder.js.map +1 -1
  309. package/build/dist/Server/Utils/AI/IncidentEpisodeAIContextBuilder.js +6 -1
  310. package/build/dist/Server/Utils/AI/IncidentEpisodeAIContextBuilder.js.map +1 -1
  311. package/build/dist/Server/Utils/AI/ScheduledMaintenanceAIContextBuilder.js +12 -2
  312. package/build/dist/Server/Utils/AI/ScheduledMaintenanceAIContextBuilder.js.map +1 -1
  313. package/build/dist/Server/Utils/AI/Toolbox/AlertTools.js +167 -0
  314. package/build/dist/Server/Utils/AI/Toolbox/AlertTools.js.map +1 -0
  315. package/build/dist/Server/Utils/AI/Toolbox/AlertWriteTools.js +136 -0
  316. package/build/dist/Server/Utils/AI/Toolbox/AlertWriteTools.js.map +1 -0
  317. package/build/dist/Server/Utils/AI/Toolbox/ContextTools.js +141 -0
  318. package/build/dist/Server/Utils/AI/Toolbox/ContextTools.js.map +1 -0
  319. package/build/dist/Server/Utils/AI/Toolbox/ExceptionTools.js +117 -0
  320. package/build/dist/Server/Utils/AI/Toolbox/ExceptionTools.js.map +1 -0
  321. package/build/dist/Server/Utils/AI/Toolbox/IncidentTools.js +318 -0
  322. package/build/dist/Server/Utils/AI/Toolbox/IncidentTools.js.map +1 -0
  323. package/build/dist/Server/Utils/AI/Toolbox/IncidentWriteTools.js +280 -0
  324. package/build/dist/Server/Utils/AI/Toolbox/IncidentWriteTools.js.map +1 -0
  325. package/build/dist/Server/Utils/AI/Toolbox/Index.js +153 -0
  326. package/build/dist/Server/Utils/AI/Toolbox/Index.js.map +1 -0
  327. package/build/dist/Server/Utils/AI/Toolbox/LogTools.js +246 -0
  328. package/build/dist/Server/Utils/AI/Toolbox/LogTools.js.map +1 -0
  329. package/build/dist/Server/Utils/AI/Toolbox/MetricTools.js +120 -0
  330. package/build/dist/Server/Utils/AI/Toolbox/MetricTools.js.map +1 -0
  331. package/build/dist/Server/Utils/AI/Toolbox/MonitorTools.js +158 -0
  332. package/build/dist/Server/Utils/AI/Toolbox/MonitorTools.js.map +1 -0
  333. package/build/dist/Server/Utils/AI/Toolbox/RecentChangesTools.js +165 -0
  334. package/build/dist/Server/Utils/AI/Toolbox/RecentChangesTools.js.map +1 -0
  335. package/build/dist/Server/Utils/AI/Toolbox/Serializer.js +228 -0
  336. package/build/dist/Server/Utils/AI/Toolbox/Serializer.js.map +1 -0
  337. package/build/dist/Server/Utils/AI/Toolbox/ToolTypes.js +142 -0
  338. package/build/dist/Server/Utils/AI/Toolbox/ToolTypes.js.map +1 -0
  339. package/build/dist/Server/Utils/AI/Toolbox/TraceTools.js +309 -0
  340. package/build/dist/Server/Utils/AI/Toolbox/TraceTools.js.map +1 -0
  341. package/build/dist/Server/Utils/AI/Toolbox/WidgetBuilder.js +120 -0
  342. package/build/dist/Server/Utils/AI/Toolbox/WidgetBuilder.js.map +1 -0
  343. package/build/dist/Server/Utils/Database/MigrationFailureLog.js +174 -0
  344. package/build/dist/Server/Utils/Database/MigrationFailureLog.js.map +1 -0
  345. package/build/dist/Server/Utils/IncomingCallPhoneNumber.js +30 -0
  346. package/build/dist/Server/Utils/IncomingCallPhoneNumber.js.map +1 -0
  347. package/build/dist/Server/Utils/LLM/LLMService.js +452 -92
  348. package/build/dist/Server/Utils/LLM/LLMService.js.map +1 -1
  349. package/build/dist/Server/Utils/Telemetry/IoTSnapshotScan.js +11 -8
  350. package/build/dist/Server/Utils/Telemetry/IoTSnapshotScan.js.map +1 -1
  351. package/build/dist/Server/Utils/Telemetry/ProxmoxCephSnapshotScan.js +11 -8
  352. package/build/dist/Server/Utils/Telemetry/ProxmoxCephSnapshotScan.js.map +1 -1
  353. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +378 -15
  354. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
  355. package/build/dist/Server/Utils/Workspace/Slack/Slack.js +59 -0
  356. package/build/dist/Server/Utils/Workspace/Slack/Slack.js.map +1 -1
  357. package/build/dist/Server/Utils/Workspace/Slack/app-manifest.json +16 -1
  358. package/build/dist/Types/AI/AIChatMessageRole.js +7 -0
  359. package/build/dist/Types/AI/AIChatMessageRole.js.map +1 -0
  360. package/build/dist/Types/AI/AIChatMessageStatus.js +27 -0
  361. package/build/dist/Types/AI/AIChatMessageStatus.js.map +1 -0
  362. package/build/dist/Types/AI/AIChatPermissionMode.js +53 -0
  363. package/build/dist/Types/AI/AIChatPermissionMode.js.map +1 -0
  364. package/build/dist/Types/AI/AIChatTypes.js +74 -0
  365. package/build/dist/Types/AI/AIChatTypes.js.map +1 -0
  366. package/build/dist/Types/AI/AIRunEventType.js +18 -0
  367. package/build/dist/Types/AI/AIRunEventType.js.map +1 -0
  368. package/build/dist/Types/AI/AIRunStatus.js +26 -0
  369. package/build/dist/Types/AI/AIRunStatus.js.map +1 -0
  370. package/build/dist/Types/AI/AIRunType.js +7 -0
  371. package/build/dist/Types/AI/AIRunType.js.map +1 -0
  372. package/build/dist/Types/Date.js +153 -15
  373. package/build/dist/Types/Date.js.map +1 -1
  374. package/build/dist/Types/LLM/LlmType.js +6 -0
  375. package/build/dist/Types/LLM/LlmType.js.map +1 -1
  376. package/build/dist/Types/OnCallDutyPolicy/Layer.js +602 -171
  377. package/build/dist/Types/OnCallDutyPolicy/Layer.js.map +1 -1
  378. package/build/dist/Types/OnCallDutyPolicy/RestrictionTimes.js +27 -13
  379. package/build/dist/Types/OnCallDutyPolicy/RestrictionTimes.js.map +1 -1
  380. package/build/dist/Types/OnCallDutyPolicy/UserOverrideUtil.js +20 -5
  381. package/build/dist/Types/OnCallDutyPolicy/UserOverrideUtil.js.map +1 -1
  382. package/build/dist/UI/Components/Events/RecurringFieldElement.js +13 -0
  383. package/build/dist/UI/Components/Events/RecurringFieldElement.js.map +1 -1
  384. package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js +10 -5
  385. package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js.map +1 -1
  386. package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js +18 -4
  387. package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js.map +1 -1
  388. package/build/dist/UI/Components/ModelFormModal/ModelFormModal.js.map +1 -1
  389. package/build/dist/UI/Components/Page/Page.js +3 -1
  390. package/build/dist/UI/Components/Page/Page.js.map +1 -1
  391. package/build/dist/UI/Components/RadioButtons/BasicRadioButtons.js +1 -1
  392. package/build/dist/UI/Components/RadioButtons/BasicRadioButtons.js.map +1 -1
  393. package/build/dist/UI/Utils/LlmTypeDropdownOptions.js +38 -0
  394. package/build/dist/UI/Utils/LlmTypeDropdownOptions.js.map +1 -0
  395. package/build/dist/UI/Utils/TestLLMProvider.js +37 -0
  396. package/build/dist/UI/Utils/TestLLMProvider.js.map +1 -0
  397. package/package.json +1 -1
@@ -0,0 +1,443 @@
1
+ import AIRun from "./AIRun";
2
+ import Project from "./Project";
3
+ import User from "./User";
4
+ import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
5
+ import Route from "../../Types/API/Route";
6
+ import { PlanType } from "../../Types/Billing/SubscriptionPlan";
7
+ import ColumnAccessControl from "../../Types/Database/AccessControl/ColumnAccessControl";
8
+ import TableAccessControl from "../../Types/Database/AccessControl/TableAccessControl";
9
+ import TableBillingAccessControl from "../../Types/Database/AccessControl/TableBillingAccessControl";
10
+ import ColumnLength from "../../Types/Database/ColumnLength";
11
+ import ColumnType from "../../Types/Database/ColumnType";
12
+ import CrudApiEndpoint from "../../Types/Database/CrudApiEndpoint";
13
+ import TableColumn from "../../Types/Database/TableColumn";
14
+ import TableColumnType from "../../Types/Database/TableColumnType";
15
+ import TableMetadata from "../../Types/Database/TableMetadata";
16
+ import TenantColumn from "../../Types/Database/TenantColumn";
17
+ import IconProp from "../../Types/Icon/IconProp";
18
+ import ObjectID from "../../Types/ObjectID";
19
+ import Permission from "../../Types/Permission";
20
+ import { JSONObject } from "../../Types/JSON";
21
+ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
22
+ import EnableDocumentation from "../../Types/Database/EnableDocumentation";
23
+ import AIRunEventType from "../../Types/AI/AIRunEventType";
24
+ import { AIRunEventResultSummary } from "../../Types/AI/AIChatTypes";
25
+
26
+ /*
27
+ * One event in an AI run: an LLM call, a tool call with its validated
28
+ * arguments, or a lifecycle transition. This is both the live progress feed
29
+ * and the tool-invocation audit trail. Server-only writes.
30
+ */
31
+ @EnableDocumentation()
32
+ @TableBillingAccessControl({
33
+ create: PlanType.Growth,
34
+ read: PlanType.Free,
35
+ update: PlanType.Growth,
36
+ delete: PlanType.Free,
37
+ })
38
+ @TenantColumn("projectId")
39
+ @CrudApiEndpoint(new Route("/ai-run-event"))
40
+ @Entity({
41
+ name: "AIRunEvent",
42
+ })
43
+ @TableMetadata({
44
+ tableName: "AIRunEvent",
45
+ singularName: "AI Run Event",
46
+ pluralName: "AI Run Events",
47
+ icon: IconProp.List,
48
+ tableDescription:
49
+ "An event in an AI run: LLM calls, tool calls with validated arguments, and lifecycle transitions.",
50
+ enableRealtimeEventsOn: {
51
+ create: true,
52
+ },
53
+ })
54
+ @TableAccessControl({
55
+ create: [],
56
+ read: [
57
+ Permission.ProjectOwner,
58
+ Permission.ProjectAdmin,
59
+ Permission.ProjectMember,
60
+ ],
61
+ delete: [],
62
+ update: [],
63
+ })
64
+ export default class AIRunEvent extends BaseModel {
65
+ @ColumnAccessControl({
66
+ create: [],
67
+ read: [
68
+ Permission.ProjectOwner,
69
+ Permission.ProjectAdmin,
70
+ Permission.ProjectMember,
71
+ ],
72
+ update: [],
73
+ })
74
+ @TableColumn({
75
+ type: TableColumnType.Entity,
76
+ required: true,
77
+ modelType: Project,
78
+ manyToOneRelationColumn: "projectId",
79
+ title: "Project",
80
+ description: "Project this event belongs to.",
81
+ })
82
+ @ManyToOne(
83
+ () => {
84
+ return Project;
85
+ },
86
+ {
87
+ cascade: false,
88
+ eager: false,
89
+ nullable: false,
90
+ onDelete: "CASCADE",
91
+ orphanedRowAction: "nullify",
92
+ },
93
+ )
94
+ @JoinColumn({ name: "projectId" })
95
+ public project?: Project = undefined;
96
+
97
+ @ColumnAccessControl({
98
+ create: [],
99
+ read: [
100
+ Permission.ProjectOwner,
101
+ Permission.ProjectAdmin,
102
+ Permission.ProjectMember,
103
+ ],
104
+ update: [],
105
+ })
106
+ @Index()
107
+ @TableColumn({
108
+ type: TableColumnType.ObjectID,
109
+ required: true,
110
+ canReadOnRelationQuery: true,
111
+ title: "Project ID",
112
+ description: "ID of the project this event belongs to.",
113
+ })
114
+ @Column({
115
+ type: ColumnType.ObjectID,
116
+ nullable: false,
117
+ transformer: ObjectID.getDatabaseTransformer(),
118
+ })
119
+ public projectId?: ObjectID = undefined;
120
+
121
+ @ColumnAccessControl({
122
+ create: [],
123
+ read: [
124
+ Permission.ProjectOwner,
125
+ Permission.ProjectAdmin,
126
+ Permission.ProjectMember,
127
+ ],
128
+ update: [],
129
+ })
130
+ @TableColumn({
131
+ type: TableColumnType.Entity,
132
+ required: true,
133
+ modelType: AIRun,
134
+ manyToOneRelationColumn: "aiRunId",
135
+ title: "AI Run",
136
+ description: "Run this event belongs to.",
137
+ })
138
+ @ManyToOne(
139
+ () => {
140
+ return AIRun;
141
+ },
142
+ {
143
+ cascade: false,
144
+ eager: false,
145
+ nullable: false,
146
+ onDelete: "CASCADE",
147
+ orphanedRowAction: "nullify",
148
+ },
149
+ )
150
+ @JoinColumn({ name: "aiRunId" })
151
+ public aiRun?: AIRun = undefined;
152
+
153
+ @ColumnAccessControl({
154
+ create: [],
155
+ read: [
156
+ Permission.ProjectOwner,
157
+ Permission.ProjectAdmin,
158
+ Permission.ProjectMember,
159
+ ],
160
+ update: [],
161
+ })
162
+ @Index()
163
+ @TableColumn({
164
+ type: TableColumnType.ObjectID,
165
+ required: true,
166
+ canReadOnRelationQuery: true,
167
+ title: "AI Run ID",
168
+ description: "ID of the run this event belongs to.",
169
+ })
170
+ @Column({
171
+ type: ColumnType.ObjectID,
172
+ nullable: false,
173
+ transformer: ObjectID.getDatabaseTransformer(),
174
+ })
175
+ public aiRunId?: ObjectID = undefined;
176
+
177
+ @ColumnAccessControl({
178
+ create: [],
179
+ read: [
180
+ Permission.ProjectOwner,
181
+ Permission.ProjectAdmin,
182
+ Permission.ProjectMember,
183
+ ],
184
+ update: [],
185
+ })
186
+ @TableColumn({
187
+ type: TableColumnType.Entity,
188
+ required: false,
189
+ modelType: User,
190
+ manyToOneRelationColumn: "userId",
191
+ title: "User",
192
+ description: "User whose run this event belongs to.",
193
+ })
194
+ @ManyToOne(
195
+ () => {
196
+ return User;
197
+ },
198
+ {
199
+ cascade: false,
200
+ eager: false,
201
+ nullable: true,
202
+ onDelete: "SET NULL",
203
+ orphanedRowAction: "nullify",
204
+ },
205
+ )
206
+ @JoinColumn({ name: "userId" })
207
+ public user?: User = undefined;
208
+
209
+ @ColumnAccessControl({
210
+ create: [],
211
+ read: [
212
+ Permission.ProjectOwner,
213
+ Permission.ProjectAdmin,
214
+ Permission.ProjectMember,
215
+ ],
216
+ update: [],
217
+ })
218
+ @Index()
219
+ @TableColumn({
220
+ type: TableColumnType.ObjectID,
221
+ required: false,
222
+ canReadOnRelationQuery: true,
223
+ title: "User ID",
224
+ description: "ID of the user whose run this event belongs to.",
225
+ })
226
+ @Column({
227
+ type: ColumnType.ObjectID,
228
+ nullable: true,
229
+ transformer: ObjectID.getDatabaseTransformer(),
230
+ })
231
+ public userId?: ObjectID = undefined;
232
+
233
+ @ColumnAccessControl({
234
+ create: [],
235
+ read: [
236
+ Permission.ProjectOwner,
237
+ Permission.ProjectAdmin,
238
+ Permission.ProjectMember,
239
+ ],
240
+ update: [],
241
+ })
242
+ @TableColumn({
243
+ required: true,
244
+ type: TableColumnType.Number,
245
+ title: "Sequence",
246
+ description: "Order of this event within the run.",
247
+ })
248
+ @Column({
249
+ type: ColumnType.Number,
250
+ nullable: false,
251
+ default: 0,
252
+ })
253
+ public sequence?: number = undefined;
254
+
255
+ @ColumnAccessControl({
256
+ create: [],
257
+ read: [
258
+ Permission.ProjectOwner,
259
+ Permission.ProjectAdmin,
260
+ Permission.ProjectMember,
261
+ ],
262
+ update: [],
263
+ })
264
+ @Index()
265
+ @TableColumn({
266
+ required: true,
267
+ type: TableColumnType.ShortText,
268
+ title: "Event Type",
269
+ description: "Type of event.",
270
+ canReadOnRelationQuery: true,
271
+ })
272
+ @Column({
273
+ nullable: false,
274
+ type: ColumnType.ShortText,
275
+ length: ColumnLength.ShortText,
276
+ })
277
+ public eventType?: AIRunEventType = undefined;
278
+
279
+ @ColumnAccessControl({
280
+ create: [],
281
+ read: [
282
+ Permission.ProjectOwner,
283
+ Permission.ProjectAdmin,
284
+ Permission.ProjectMember,
285
+ ],
286
+ update: [],
287
+ })
288
+ @TableColumn({
289
+ required: false,
290
+ type: TableColumnType.ShortText,
291
+ title: "Tool Name",
292
+ description: "Name of the tool for tool-call events.",
293
+ })
294
+ @Column({
295
+ nullable: true,
296
+ type: ColumnType.ShortText,
297
+ length: ColumnLength.ShortText,
298
+ })
299
+ public toolName?: string = undefined;
300
+
301
+ @ColumnAccessControl({
302
+ create: [],
303
+ read: [
304
+ Permission.ProjectOwner,
305
+ Permission.ProjectAdmin,
306
+ Permission.ProjectMember,
307
+ ],
308
+ update: [],
309
+ })
310
+ @TableColumn({
311
+ required: false,
312
+ type: TableColumnType.JSON,
313
+ title: "Tool Arguments",
314
+ description: "Validated tool arguments as executed.",
315
+ })
316
+ @Column({
317
+ nullable: true,
318
+ type: ColumnType.JSON,
319
+ })
320
+ public toolArguments?: JSONObject = undefined;
321
+
322
+ @ColumnAccessControl({
323
+ create: [],
324
+ read: [
325
+ Permission.ProjectOwner,
326
+ Permission.ProjectAdmin,
327
+ Permission.ProjectMember,
328
+ ],
329
+ update: [],
330
+ })
331
+ @TableColumn({
332
+ required: false,
333
+ type: TableColumnType.JSON,
334
+ title: "Result Summary",
335
+ description:
336
+ "Summary of the result: row count, duration, truncation and bytes sent to the LLM.",
337
+ })
338
+ @Column({
339
+ nullable: true,
340
+ type: ColumnType.JSON,
341
+ })
342
+ public resultSummary?: AIRunEventResultSummary = undefined;
343
+
344
+ @ColumnAccessControl({
345
+ create: [],
346
+ read: [
347
+ Permission.ProjectOwner,
348
+ Permission.ProjectAdmin,
349
+ Permission.ProjectMember,
350
+ ],
351
+ update: [],
352
+ })
353
+ @TableColumn({
354
+ required: false,
355
+ type: TableColumnType.ShortText,
356
+ title: "Citation ID",
357
+ description:
358
+ "ID of the citation this event minted (e.g. C1), if it produced one.",
359
+ })
360
+ @Column({
361
+ nullable: true,
362
+ type: ColumnType.ShortText,
363
+ length: ColumnLength.ShortText,
364
+ })
365
+ public citationId?: string = undefined;
366
+
367
+ @ColumnAccessControl({
368
+ create: [],
369
+ read: [],
370
+ update: [],
371
+ })
372
+ @TableColumn({ type: TableColumnType.Entity, modelType: User })
373
+ @ManyToOne(
374
+ () => {
375
+ return User;
376
+ },
377
+ {
378
+ cascade: false,
379
+ eager: false,
380
+ nullable: true,
381
+ onDelete: "SET NULL",
382
+ orphanedRowAction: "nullify",
383
+ },
384
+ )
385
+ @JoinColumn({ name: "deletedByUserId" })
386
+ public deletedByUser?: User = undefined;
387
+
388
+ @ColumnAccessControl({
389
+ create: [],
390
+ read: [],
391
+ update: [],
392
+ })
393
+ @TableColumn({
394
+ type: TableColumnType.ObjectID,
395
+ title: "Deleted by User ID",
396
+ description:
397
+ "User ID who deleted this object (if this object was deleted by a User)",
398
+ })
399
+ @Column({
400
+ type: ColumnType.ObjectID,
401
+ nullable: true,
402
+ transformer: ObjectID.getDatabaseTransformer(),
403
+ })
404
+ public deletedByUserId?: ObjectID = undefined;
405
+
406
+ @ColumnAccessControl({
407
+ create: [],
408
+ read: [],
409
+ update: [],
410
+ })
411
+ @TableColumn({ type: TableColumnType.Entity, modelType: User })
412
+ @ManyToOne(
413
+ () => {
414
+ return User;
415
+ },
416
+ {
417
+ eager: false,
418
+ nullable: true,
419
+ onDelete: "SET NULL",
420
+ orphanedRowAction: "nullify",
421
+ },
422
+ )
423
+ @JoinColumn({ name: "createdByUserId" })
424
+ public createdByUser?: User = undefined;
425
+
426
+ @ColumnAccessControl({
427
+ create: [],
428
+ read: [],
429
+ update: [],
430
+ })
431
+ @TableColumn({
432
+ type: TableColumnType.ObjectID,
433
+ title: "Created by User ID",
434
+ description:
435
+ "User ID who created this object (if this object was created by a User)",
436
+ })
437
+ @Column({
438
+ type: ColumnType.ObjectID,
439
+ nullable: true,
440
+ transformer: ObjectID.getDatabaseTransformer(),
441
+ })
442
+ public createdByUserId?: ObjectID = undefined;
443
+ }
@@ -356,7 +356,7 @@ export default class IncidentEpisodeRoleMember extends BaseModel {
356
356
  {
357
357
  eager: false,
358
358
  nullable: true,
359
- onDelete: "SET NULL",
359
+ onDelete: "CASCADE",
360
360
  orphanedRowAction: "nullify",
361
361
  },
362
362
  )
@@ -364,7 +364,7 @@ export default class IncidentMember extends BaseModel {
364
364
  {
365
365
  eager: false,
366
366
  nullable: true,
367
- onDelete: "SET NULL",
367
+ onDelete: "CASCADE",
368
368
  orphanedRowAction: "nullify",
369
369
  },
370
370
  )
@@ -89,6 +89,19 @@ import EnableWorkflow from "../../Types/Database/EnableWorkflow";
89
89
  tableDescription:
90
90
  "Manage incoming call routing policies with escalation rules for on-call teams",
91
91
  })
92
+ /*
93
+ * A routing phone number may belong to at most one active policy. The inbound
94
+ * /voice webhook looks up the policy by routingPhoneNumber and assumes a single
95
+ * match, so this uniqueness is enforced at the DB level (partial index in the
96
+ * migration; NULLs are allowed for policies without a number yet).
97
+ */
98
+ @Index(
99
+ "IDX_INCOMING_CALL_POLICY_ROUTING_PHONE_UNIQUE",
100
+ ["routingPhoneNumber"],
101
+ {
102
+ unique: true,
103
+ },
104
+ )
92
105
  export default class IncomingCallPolicy extends BaseModel {
93
106
  @ColumnAccessControl({
94
107
  create: [
@@ -58,6 +58,7 @@ import BillingPaymentMethods from "./BillingPaymentMethod";
58
58
  import CallLog from "./CallLog";
59
59
  // Date migration
60
60
  import DataMigration from "./DataMigration";
61
+ import MigrationFailure from "./MigrationFailure";
61
62
  import Domain from "./Domain";
62
63
  import EmailLog from "./EmailLog";
63
64
  import EmailVerificationToken from "./EmailVerificationToken";
@@ -166,6 +167,10 @@ import AIAgentTask from "./AIAgentTask";
166
167
  import AIAgentTaskLog from "./AIAgentTaskLog";
167
168
  import AIAgentTaskPullRequest from "./AIAgentTaskPullRequest";
168
169
  import AIAgentTaskTelemetryException from "./AIAgentTaskTelemetryException";
170
+ import AIConversation from "./AIConversation";
171
+ import AIConversationMessage from "./AIConversationMessage";
172
+ import AIRun from "./AIRun";
173
+ import AIRunEvent from "./AIRunEvent";
169
174
  import LlmProvider from "./LlmProvider";
170
175
  import LlmLog from "./LlmLog";
171
176
  import Project from "./Project";
@@ -646,6 +651,8 @@ const AllModelTypes: Array<{
646
651
 
647
652
  DataMigration,
648
653
 
654
+ MigrationFailure,
655
+
649
656
  ShortLink,
650
657
 
651
658
  ScheduledMaintenanceTemplate,
@@ -713,6 +720,10 @@ const AllModelTypes: Array<{
713
720
  AIAgentTaskLog,
714
721
  AIAgentTaskPullRequest,
715
722
  AIAgentTaskTelemetryException,
723
+ AIConversation,
724
+ AIConversationMessage,
725
+ AIRun,
726
+ AIRunEvent,
716
727
 
717
728
  LlmProvider,
718
729
  LlmLog,
@@ -604,6 +604,32 @@ export default class LlmLog extends BaseModel {
604
604
  })
605
605
  public alertId?: ObjectID = undefined;
606
606
 
607
+ @ColumnAccessControl({
608
+ create: [],
609
+ read: [
610
+ Permission.ProjectOwner,
611
+ Permission.ProjectAdmin,
612
+ Permission.ProjectMember,
613
+ Permission.Viewer,
614
+ Permission.ReadLlmLog,
615
+ ],
616
+ update: [],
617
+ })
618
+ @Index()
619
+ @TableColumn({
620
+ type: TableColumnType.ObjectID,
621
+ required: false,
622
+ canReadOnRelationQuery: true,
623
+ title: "AI Run ID",
624
+ description: "ID of the AI run this LLM call was part of (if any)",
625
+ })
626
+ @Column({
627
+ type: ColumnType.ObjectID,
628
+ nullable: true,
629
+ transformer: ObjectID.getDatabaseTransformer(),
630
+ })
631
+ public aiRunId?: ObjectID = undefined;
632
+
607
633
  @ColumnAccessControl({
608
634
  create: [],
609
635
  read: [
@@ -42,7 +42,7 @@ import LlmType from "../../Types/LLM/LlmType";
42
42
  pluralName: "LLM Providers",
43
43
  icon: IconProp.Bolt,
44
44
  tableDescription:
45
- "Manage LLM Provider configurations. Connect to OpenAI, Azure OpenAI, Anthropic, Groq, Mistral, Ollama, or other LLM providers to enable AI features.",
45
+ "Manage LLM Provider configurations. Connect to OpenAI, Azure OpenAI, Anthropic, Groq, Mistral, Ollama, OpenAI-compatible servers (e.g. vLLM, LocalAI), or other LLM providers to enable AI features.",
46
46
  })
47
47
  @TableAccessControl({
48
48
  create: [
@@ -190,7 +190,7 @@ export default class LlmProvider extends BaseModel {
190
190
  type: TableColumnType.ShortText,
191
191
  title: "LLM Type",
192
192
  description:
193
- "The type of LLM provider (OpenAI, Azure OpenAI, Anthropic, Groq, Mistral, Ollama, etc.)",
193
+ "The type of LLM provider (OpenAI, Azure OpenAI, Anthropic, Groq, Mistral, Ollama, OpenAICompatible, etc.)",
194
194
  })
195
195
  @Column({
196
196
  nullable: false,