@oneuptime/common 11.5.8 → 11.5.10

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 (542) hide show
  1. package/Models/AnalyticsModels/Index.ts +13 -0
  2. package/Models/AnalyticsModels/MetricItemAggMV1mByContainer.ts +178 -0
  3. package/Models/AnalyticsModels/MetricItemAggMV1mByK8sCluster.ts +179 -0
  4. package/Models/AnalyticsModels/MetricItemAggMV1mByService.ts +179 -0
  5. package/Models/AnalyticsModels/NetworkFlow.ts +397 -0
  6. package/Models/DatabaseModels/AIAgentTaskPullRequest.ts +15 -6
  7. package/Models/DatabaseModels/AIRun.ts +37 -0
  8. package/Models/DatabaseModels/AIRunEvent.ts +34 -1
  9. package/Models/DatabaseModels/EnterpriseLicenseInstance.ts +18 -0
  10. package/Models/DatabaseModels/GlobalConfig.ts +36 -0
  11. package/Models/DatabaseModels/Index.ts +2 -0
  12. package/Models/DatabaseModels/MarketingConversion.ts +198 -0
  13. package/Models/DatabaseModels/MetricSavedView.ts +34 -0
  14. package/Models/DatabaseModels/MetricType.ts +74 -0
  15. package/Models/DatabaseModels/NetworkDevice.ts +332 -0
  16. package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.ts +328 -0
  17. package/Models/DatabaseModels/NetworkInterface.ts +58 -0
  18. package/Models/DatabaseModels/Project.ts +62 -0
  19. package/Models/DatabaseModels/StatusPage.ts +42 -0
  20. package/Models/DatabaseModels/User.ts +37 -0
  21. package/Server/API/AIAgentTaskAPI.ts +38 -12
  22. package/Server/API/AIAgentTaskLogAPI.ts +49 -0
  23. package/Server/API/AIChatAPI.ts +16 -0
  24. package/Server/API/AIReadinessAPI.ts +84 -0
  25. package/Server/API/BaseAnalyticsAPI.ts +23 -0
  26. package/Server/API/CodeFixRunAPI.ts +182 -0
  27. package/Server/API/EnterpriseLicenseAPI.ts +14 -0
  28. package/Server/API/TelemetryExceptionAPI.ts +6 -1
  29. package/Server/EnvironmentConfig.ts +84 -0
  30. package/Server/Infrastructure/Postgres/SchemaMigrations/1784124919694-AddAITaskNumberAndRunTranscript.ts +95 -0
  31. package/Server/Infrastructure/Postgres/SchemaMigrations/1784135099754-AllowNullAiAgentOnPullRequest.ts +52 -0
  32. package/Server/Infrastructure/Postgres/SchemaMigrations/1784137457184-AddEnableMcpServerToStatusPage.ts +30 -0
  33. package/Server/Infrastructure/Postgres/SchemaMigrations/1784191414522-AddCounterSemanticsToMetricType.ts +38 -0
  34. package/Server/Infrastructure/Postgres/SchemaMigrations/1784191414600-AddViewTypeToMetricSavedView.ts +28 -0
  35. package/Server/Infrastructure/Postgres/SchemaMigrations/1784200000000-AddSnmpV3ColumnsToNetworkDeviceDiscoveryScan.ts +49 -0
  36. package/Server/Infrastructure/Postgres/SchemaMigrations/1784211212164-AddNetworkDeviceInventoryAndDiscoverySchedule.ts +108 -0
  37. package/Server/Infrastructure/Postgres/SchemaMigrations/1784218257664-AddEnterpriseLicenseNotificationColumns.ts +31 -0
  38. package/Server/Infrastructure/Postgres/SchemaMigrations/1784293516000-AddAttributionColumnsToUserAndProject.ts +29 -0
  39. package/Server/Infrastructure/Postgres/SchemaMigrations/1784298000000-AddMarketingConversionTable.ts +35 -0
  40. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +20 -0
  41. package/Server/Services/AIRunEventService.ts +15 -1
  42. package/Server/Services/AIRunService.ts +38 -1
  43. package/Server/Services/AnalyticsDatabaseService.ts +70 -1
  44. package/Server/Services/IncidentService.ts +13 -0
  45. package/Server/Services/Index.ts +10 -0
  46. package/Server/Services/LlmProviderService.ts +2 -0
  47. package/Server/Services/MarketingConversionService.ts +10 -0
  48. package/Server/Services/MetricItemAggMV1mByContainerService.ts +31 -0
  49. package/Server/Services/MetricItemAggMV1mByK8sClusterService.ts +31 -0
  50. package/Server/Services/MetricItemAggMV1mByServiceService.ts +31 -0
  51. package/Server/Services/MetricService.ts +970 -122
  52. package/Server/Services/MonitorService.ts +14 -0
  53. package/Server/Services/NetworkDeviceOwnerTeamService.ts +42 -0
  54. package/Server/Services/NetworkDeviceOwnerUserService.ts +106 -0
  55. package/Server/Services/NetworkFlowService.ts +11 -0
  56. package/Server/Services/OnCallDutyPolicyService.ts +11 -1
  57. package/Server/Services/ProjectService.ts +178 -0
  58. package/Server/Services/SpanService.ts +13 -9
  59. package/Server/Services/StatusPageService.ts +97 -0
  60. package/Server/Services/TeamMemberService.ts +11 -0
  61. package/Server/Services/TelemetryExceptionService.ts +19 -90
  62. package/Server/Services/UserService.ts +59 -0
  63. package/Server/Types/AnalyticsDatabase/AggregateBy.ts +37 -7
  64. package/Server/Types/Markdown.ts +9 -9
  65. package/Server/Types/MarkdownSlugify.ts +47 -0
  66. package/Server/Utils/AI/AIRunTranscript.ts +240 -0
  67. package/Server/Utils/AI/Chat/ChatAgentRunner.ts +9 -0
  68. package/Server/Utils/AI/Chat/ObservabilityChatPrompt.ts +119 -5
  69. package/Server/Utils/AI/CodeFix/CodeFixAgentCompletion.ts +75 -0
  70. package/Server/Utils/AI/CodeFix/CodeFixReadiness.ts +235 -0
  71. package/Server/Utils/AI/SRE/Insights/FixRouting.ts +2 -3
  72. package/Server/Utils/AI/Toolbox/CodeTools.ts +883 -0
  73. package/Server/Utils/AI/Toolbox/CodeWriteTools.ts +519 -0
  74. package/Server/Utils/AI/Toolbox/Index.ts +27 -0
  75. package/Server/Utils/AI/Toolbox/ScheduledMaintenanceTools.ts +279 -0
  76. package/Server/Utils/AnalyticsDatabase/ClickhouseCapacity.ts +19 -1
  77. package/Server/Utils/Attribution.ts +99 -0
  78. package/Server/Utils/CodeRepository/GitHub/GitHub.ts +600 -0
  79. package/Server/Utils/CodeRepository/StackTraceRepoResolver.ts +7 -2
  80. package/Server/Utils/LLM/LLMService.ts +397 -18
  81. package/Server/Utils/Marketing/ConversionUploadProvider.ts +103 -0
  82. package/Server/Utils/Marketing/ConversionUploadProviders.ts +22 -0
  83. package/Server/Utils/Marketing/Providers/GoogleAds.ts +270 -0
  84. package/Server/Utils/Marketing/Providers/LinkedIn.ts +147 -0
  85. package/Server/Utils/Marketing/Providers/Meta.ts +148 -0
  86. package/Server/Utils/Marketing/Providers/MicrosoftAds.ts +196 -0
  87. package/Server/Utils/Marketing/Providers/Reddit.ts +178 -0
  88. package/Server/Utils/Monitor/MonitorAlert.ts +71 -7
  89. package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +31 -19
  90. package/Server/Utils/Monitor/MonitorIncident.ts +71 -7
  91. package/Server/Utils/Monitor/MonitorMetricUtil.ts +57 -0
  92. package/Server/Utils/Monitor/MonitorTemplateUtil.ts +94 -0
  93. package/Server/Utils/Monitor/NetworkDeviceHydrationUtil.ts +19 -11
  94. package/Server/Utils/Monitor/NetworkInventoryUtil.ts +125 -14
  95. package/Server/Utils/ProductAnalytics.ts +133 -0
  96. package/Server/Utils/Telemetry/Telemetry.ts +39 -0
  97. package/Server/Utils/Telemetry/TelemetryEntity.ts +21 -0
  98. package/Tests/Models/StatusPageEnableMcpServer.test.ts +125 -0
  99. package/Tests/Server/API/BaseAnalyticsAPI.test.ts +72 -0
  100. package/Tests/Server/Infrastructure/SemaphorePermit.test.ts +9 -1
  101. package/Tests/Server/Services/AnalyticsDatabaseService.test.ts +21 -2
  102. package/Tests/Server/Services/MetricEntityMVKeyParity.test.ts +173 -0
  103. package/Tests/Server/Services/MetricServiceAggregate.test.ts +1391 -0
  104. package/Tests/Server/Services/NetworkDeviceOwnerServices.test.ts +260 -0
  105. package/Tests/Server/Services/StatusPageServiceMcp.test.ts +223 -0
  106. package/Tests/Server/Services/TelemetryExceptionAIFixReadiness.test.ts +26 -3
  107. package/Tests/Server/Services/TelemetryExceptionCodeFixRun.test.ts +12 -0
  108. package/Tests/Server/Types/Markdown.test.ts +106 -0
  109. package/Tests/Server/Utils/AI/AIRunTranscript.test.ts +182 -0
  110. package/Tests/Server/Utils/AI/CodeFixReadiness.test.ts +411 -0
  111. package/Tests/Server/Utils/AI/CodeTools.test.ts +596 -0
  112. package/Tests/Server/Utils/AI/CodeWriteTools.test.ts +475 -0
  113. package/Tests/Server/Utils/AI/LLMServiceModelCompatibility.test.ts +548 -0
  114. package/Tests/Server/Utils/AI/ObservabilityChatPrompt.test.ts +142 -0
  115. package/Tests/Server/Utils/AI/ScheduledMaintenanceTools.test.ts +176 -0
  116. package/Tests/Server/Utils/AnalyticsDatabase/ClickhouseCapacity.test.ts +63 -0
  117. package/Tests/Server/Utils/GitHubGetFileContent.test.ts +197 -0
  118. package/Tests/Server/Utils/Monitor/MonitorTemplateUtilNetworkDevice.test.ts +389 -0
  119. package/Tests/Server/Utils/Monitor/NetworkDeviceHydrationUtil.test.ts +502 -0
  120. package/Tests/Server/Utils/Monitor/NetworkInventoryUtil.test.ts +764 -0
  121. package/Tests/Types/AI/AIAgentTaskStatus.test.ts +7 -6
  122. package/Tests/Types/AI/AIChatPageContext.test.ts +0 -0
  123. package/Tests/Types/AI/AIRunStatus.test.ts +42 -0
  124. package/Tests/Types/BaseDatabase/AggregationIntervalUtil.test.ts +111 -2
  125. package/Tests/Types/Database/EndsWith.test.ts +64 -0
  126. package/Tests/Types/Database/GreaterThan.test.ts +62 -0
  127. package/Tests/Types/Database/GreaterThanOrEqual.test.ts +65 -0
  128. package/Tests/Types/Database/GreaterThanOrNull.test.ts +63 -0
  129. package/Tests/Types/Database/Includes.test.ts +65 -0
  130. package/Tests/Types/Database/IncludesAll.test.ts +65 -0
  131. package/Tests/Types/Database/IncludesNone.test.ts +65 -0
  132. package/Tests/Types/Database/IsNull.test.ts +44 -0
  133. package/Tests/Types/Database/LessThan.test.ts +62 -0
  134. package/Tests/Types/Database/LessThanOrEqual.test.ts +62 -0
  135. package/Tests/Types/Database/LessThanOrNull.test.ts +62 -0
  136. package/Tests/Types/Database/MultiSearch.test.ts +81 -0
  137. package/Tests/Types/Database/NotContains.test.ts +64 -0
  138. package/Tests/Types/Database/NotNull.test.ts +44 -0
  139. package/Tests/Types/Database/StartsWith.test.ts +64 -0
  140. package/Tests/Types/Log/LogSeverity.test.ts +78 -0
  141. package/Tests/Types/Monitor/MonitorStepSqlMonitor.test.ts +83 -1
  142. package/Tests/Types/Monitor/SnmpV3EnumParsing.test.ts +247 -0
  143. package/Tests/Types/Monitor/SnmpVendorTemplate.test.ts +263 -0
  144. package/Tests/UI/Components/BasicFormDropdownNormalization.test.tsx +167 -0
  145. package/Tests/UI/Components/Charts/AxisTickColor.test.tsx +66 -0
  146. package/Tests/UI/Components/XAxis.test.ts +5 -3
  147. package/Tests/UI/Utils/AIChatExport/ChatWidgetData.test.ts +319 -0
  148. package/Tests/UI/Utils/AIChatExport/ChatWidgetMarkdown.test.ts +188 -0
  149. package/Tests/Utils/EnterpriseLicenseUsage.test.ts +76 -0
  150. package/Tests/Utils/Metrics/MetricExplorerUrl.test.ts +622 -0
  151. package/Tests/Utils/Metrics/MetricFormulaEvaluator.test.ts +474 -0
  152. package/Tests/Utils/Telemetry/HeartbeatAvailability.test.ts +52 -4
  153. package/Types/AI/AIAgentTaskStatus.ts +13 -0
  154. package/Types/AI/AIChatPageContext.ts +137 -0
  155. package/Types/AI/AIChatTypes.ts +44 -0
  156. package/Types/AI/AIFixReadiness.ts +46 -0
  157. package/Types/AI/AIRunStatus.ts +11 -0
  158. package/Types/AnalyticsDatabase/AnalyticsTableName.ts +11 -0
  159. package/Types/BaseDatabase/AggregateBy.ts +31 -2
  160. package/Types/BaseDatabase/AggregatedResult.ts +22 -0
  161. package/Types/BaseDatabase/AggregationInterval.ts +11 -0
  162. package/Types/BaseDatabase/AggregationIntervalUtil.ts +30 -5
  163. package/Types/Dashboard/DashboardComponents/DashboardTraceChartComponent.ts +16 -0
  164. package/Types/Email/EmailTemplateType.ts +3 -0
  165. package/Types/Log/LogSeverity.ts +61 -0
  166. package/Types/Marketing/MarketingConversion.ts +11 -0
  167. package/Types/Metrics/MetricQueryConfigData.ts +21 -0
  168. package/Types/Metrics/MetricQueryData.ts +8 -0
  169. package/Types/Metrics/MetricViewData.ts +8 -0
  170. package/Types/Monitor/MonitorMetricType.ts +8 -0
  171. package/Types/Monitor/MonitorStep.ts +9 -0
  172. package/Types/Monitor/MonitorStepSqlMonitor.ts +12 -0
  173. package/Types/Monitor/MonitorType.ts +2 -1
  174. package/Types/Monitor/SSLMonitor/SslMonitorResponse.ts +17 -12
  175. package/Types/Monitor/SnmpMonitor/CdpNeighbor.ts +13 -0
  176. package/Types/Monitor/SnmpMonitor/NetworkTopology.ts +37 -3
  177. package/Types/Monitor/SnmpMonitor/SnmpAuthProtocol.ts +46 -0
  178. package/Types/Monitor/SnmpMonitor/SnmpEntityInfo.ts +15 -0
  179. package/Types/Monitor/SnmpMonitor/SnmpInterface.ts +8 -0
  180. package/Types/Monitor/SnmpMonitor/SnmpMonitorResponse.ts +17 -8
  181. package/Types/Monitor/SnmpMonitor/SnmpPrivProtocol.ts +53 -0
  182. package/Types/Monitor/SnmpMonitor/SnmpSecurityLevel.ts +43 -0
  183. package/Types/Monitor/SnmpMonitor/SnmpSystemInfo.ts +16 -0
  184. package/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.ts +119 -3
  185. package/Types/Monitor/SnmpMonitor/SnmpVersion.ts +40 -0
  186. package/Types/NetFlow/NetworkFlowRecord.ts +25 -0
  187. package/Types/Syslog/SyslogMessage.ts +18 -0
  188. package/Types/Telemetry/TelemetrySavedViewState.ts +9 -0
  189. package/Types/Telemetry/TelemetrySavedViewType.ts +12 -0
  190. package/UI/Components/Charts/Area/AreaChart.tsx +51 -0
  191. package/UI/Components/Charts/Bar/BarChart.tsx +51 -1
  192. package/UI/Components/Charts/ChartGroup/ChartGroup.tsx +97 -26
  193. package/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.tsx +336 -3
  194. package/UI/Components/Charts/ChartLibrary/BarChart/BarChart.tsx +118 -1
  195. package/UI/Components/Charts/ChartLibrary/LineChart/LineChart.tsx +336 -3
  196. package/UI/Components/Charts/ChartLibrary/Types/ChartDataPoint.ts +7 -0
  197. package/UI/Components/Charts/ChartLibrary/Types/FormattedReferenceRegion.ts +15 -0
  198. package/UI/Components/Charts/ChartLibrary/Types/FormattedTimeReferenceLine.ts +13 -0
  199. package/UI/Components/Charts/Line/LineChart.tsx +51 -0
  200. package/UI/Components/Charts/Types/ReferenceRegionProps.ts +12 -0
  201. package/UI/Components/Charts/Types/TimeReferenceLineProps.ts +12 -0
  202. package/UI/Components/Charts/Types/XAxis/XAxisPrecision.ts +1 -0
  203. package/UI/Components/Charts/Utils/DataPoint.ts +0 -0
  204. package/UI/Components/Charts/Utils/TimeAnnotation.ts +169 -0
  205. package/UI/Components/Charts/Utils/XAxis.ts +28 -4
  206. package/UI/Components/Forms/BasicForm.tsx +26 -8
  207. package/UI/Components/Icon/Icon.tsx +33 -13
  208. package/UI/Components/Markdown.tsx/MarkdownViewer.tsx +9 -0
  209. package/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.ts +67 -0
  210. package/UI/Components/Page/ModelPage.tsx +6 -1
  211. package/UI/Components/TelemetryViewer/components/SavedViewsDropdown.tsx +33 -4
  212. package/UI/Styles/Theme.css +1324 -0
  213. package/UI/Utils/AIChatExport/ChatWidgetData.ts +316 -0
  214. package/UI/Utils/AIChatExport/ChatWidgetMarkdown.ts +349 -0
  215. package/UI/Utils/AIChatExport/ConversationMarkdown.ts +177 -0
  216. package/UI/Utils/AIChatExport/MarkdownBlocks.ts +327 -0
  217. package/UI/Utils/AIChatExport/MarkdownSafety.ts +215 -0
  218. package/UI/Utils/DownloadFile.ts +54 -0
  219. package/UI/Utils/User.ts +41 -2
  220. package/Utils/Analytics.ts +8 -6
  221. package/Utils/EnterpriseLicense/EnterpriseLicenseUsage.ts +74 -0
  222. package/Utils/Metrics/MetricExplorerUrl.ts +771 -0
  223. package/Utils/Metrics/MetricFormulaEvaluator.ts +410 -46
  224. package/Utils/Monitor/NetworkTopologyUtil.ts +261 -49
  225. package/Utils/ValueFormatter.ts +22 -1
  226. package/build/dist/Models/AnalyticsModels/Index.js +13 -0
  227. package/build/dist/Models/AnalyticsModels/Index.js.map +1 -1
  228. package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByContainer.js +159 -0
  229. package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByContainer.js.map +1 -0
  230. package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByK8sCluster.js +158 -0
  231. package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByK8sCluster.js.map +1 -0
  232. package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByService.js +160 -0
  233. package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByService.js.map +1 -0
  234. package/build/dist/Models/AnalyticsModels/NetworkFlow.js +351 -0
  235. package/build/dist/Models/AnalyticsModels/NetworkFlow.js.map +1 -0
  236. package/build/dist/Models/DatabaseModels/AIAgentTaskPullRequest.js +15 -7
  237. package/build/dist/Models/DatabaseModels/AIAgentTaskPullRequest.js.map +1 -1
  238. package/build/dist/Models/DatabaseModels/AIRun.js +38 -0
  239. package/build/dist/Models/DatabaseModels/AIRun.js.map +1 -1
  240. package/build/dist/Models/DatabaseModels/AIRunEvent.js +31 -0
  241. package/build/dist/Models/DatabaseModels/AIRunEvent.js.map +1 -1
  242. package/build/dist/Models/DatabaseModels/EnterpriseLicenseInstance.js +19 -0
  243. package/build/dist/Models/DatabaseModels/EnterpriseLicenseInstance.js.map +1 -1
  244. package/build/dist/Models/DatabaseModels/GlobalConfig.js +38 -0
  245. package/build/dist/Models/DatabaseModels/GlobalConfig.js.map +1 -1
  246. package/build/dist/Models/DatabaseModels/Index.js +2 -0
  247. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  248. package/build/dist/Models/DatabaseModels/MarketingConversion.js +219 -0
  249. package/build/dist/Models/DatabaseModels/MarketingConversion.js.map +1 -0
  250. package/build/dist/Models/DatabaseModels/MetricSavedView.js +35 -0
  251. package/build/dist/Models/DatabaseModels/MetricSavedView.js.map +1 -1
  252. package/build/dist/Models/DatabaseModels/MetricType.js +76 -0
  253. package/build/dist/Models/DatabaseModels/MetricType.js.map +1 -1
  254. package/build/dist/Models/DatabaseModels/NetworkDevice.js +341 -0
  255. package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -1
  256. package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +341 -0
  257. package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js.map +1 -1
  258. package/build/dist/Models/DatabaseModels/NetworkInterface.js +60 -0
  259. package/build/dist/Models/DatabaseModels/NetworkInterface.js.map +1 -1
  260. package/build/dist/Models/DatabaseModels/Project.js +65 -0
  261. package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
  262. package/build/dist/Models/DatabaseModels/StatusPage.js +43 -0
  263. package/build/dist/Models/DatabaseModels/StatusPage.js.map +1 -1
  264. package/build/dist/Models/DatabaseModels/User.js +38 -0
  265. package/build/dist/Models/DatabaseModels/User.js.map +1 -1
  266. package/build/dist/Server/API/AIAgentTaskAPI.js +37 -11
  267. package/build/dist/Server/API/AIAgentTaskAPI.js.map +1 -1
  268. package/build/dist/Server/API/AIAgentTaskLogAPI.js +32 -7
  269. package/build/dist/Server/API/AIAgentTaskLogAPI.js.map +1 -1
  270. package/build/dist/Server/API/AIChatAPI.js +9 -0
  271. package/build/dist/Server/API/AIChatAPI.js.map +1 -1
  272. package/build/dist/Server/API/AIReadinessAPI.js +57 -0
  273. package/build/dist/Server/API/AIReadinessAPI.js.map +1 -0
  274. package/build/dist/Server/API/BaseAnalyticsAPI.js +19 -0
  275. package/build/dist/Server/API/BaseAnalyticsAPI.js.map +1 -1
  276. package/build/dist/Server/API/CodeFixRunAPI.js +142 -0
  277. package/build/dist/Server/API/CodeFixRunAPI.js.map +1 -1
  278. package/build/dist/Server/API/EnterpriseLicenseAPI.js +8 -0
  279. package/build/dist/Server/API/EnterpriseLicenseAPI.js.map +1 -1
  280. package/build/dist/Server/API/TelemetryExceptionAPI.js +4 -0
  281. package/build/dist/Server/API/TelemetryExceptionAPI.js.map +1 -1
  282. package/build/dist/Server/EnvironmentConfig.js +51 -0
  283. package/build/dist/Server/EnvironmentConfig.js.map +1 -1
  284. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784124919694-AddAITaskNumberAndRunTranscript.js +80 -0
  285. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784124919694-AddAITaskNumberAndRunTranscript.js.map +1 -0
  286. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784135099754-AllowNullAiAgentOnPullRequest.js +37 -0
  287. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784135099754-AllowNullAiAgentOnPullRequest.js.map +1 -0
  288. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784137457184-AddEnableMcpServerToStatusPage.js +23 -0
  289. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784137457184-AddEnableMcpServerToStatusPage.js.map +1 -0
  290. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784191414522-AddCounterSemanticsToMetricType.js +27 -0
  291. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784191414522-AddCounterSemanticsToMetricType.js.map +1 -0
  292. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784191414600-AddViewTypeToMetricSavedView.js +21 -0
  293. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784191414600-AddViewTypeToMetricSavedView.js.map +1 -0
  294. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784200000000-AddSnmpV3ColumnsToNetworkDeviceDiscoveryScan.js +22 -0
  295. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784200000000-AddSnmpV3ColumnsToNetworkDeviceDiscoveryScan.js.map +1 -0
  296. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784211212164-AddNetworkDeviceInventoryAndDiscoverySchedule.js +47 -0
  297. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784211212164-AddNetworkDeviceInventoryAndDiscoverySchedule.js.map +1 -0
  298. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784218257664-AddEnterpriseLicenseNotificationColumns.js +16 -0
  299. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784218257664-AddEnterpriseLicenseNotificationColumns.js.map +1 -0
  300. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784293516000-AddAttributionColumnsToUserAndProject.js +18 -0
  301. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784293516000-AddAttributionColumnsToUserAndProject.js.map +1 -0
  302. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784298000000-AddMarketingConversionTable.js +20 -0
  303. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1784298000000-AddMarketingConversionTable.js.map +1 -0
  304. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +20 -0
  305. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  306. package/build/dist/Server/Services/AIRunEventService.js +8 -0
  307. package/build/dist/Server/Services/AIRunEventService.js.map +1 -1
  308. package/build/dist/Server/Services/AIRunService.js +29 -0
  309. package/build/dist/Server/Services/AIRunService.js.map +1 -1
  310. package/build/dist/Server/Services/AnalyticsDatabaseService.js +58 -4
  311. package/build/dist/Server/Services/AnalyticsDatabaseService.js.map +1 -1
  312. package/build/dist/Server/Services/IncidentService.js +12 -0
  313. package/build/dist/Server/Services/IncidentService.js.map +1 -1
  314. package/build/dist/Server/Services/Index.js +10 -0
  315. package/build/dist/Server/Services/Index.js.map +1 -1
  316. package/build/dist/Server/Services/LlmProviderService.js +2 -0
  317. package/build/dist/Server/Services/LlmProviderService.js.map +1 -1
  318. package/build/dist/Server/Services/MarketingConversionService.js +9 -0
  319. package/build/dist/Server/Services/MarketingConversionService.js.map +1 -0
  320. package/build/dist/Server/Services/MetricItemAggMV1mByContainerService.js +29 -0
  321. package/build/dist/Server/Services/MetricItemAggMV1mByContainerService.js.map +1 -0
  322. package/build/dist/Server/Services/MetricItemAggMV1mByK8sClusterService.js +29 -0
  323. package/build/dist/Server/Services/MetricItemAggMV1mByK8sClusterService.js.map +1 -0
  324. package/build/dist/Server/Services/MetricItemAggMV1mByServiceService.js +29 -0
  325. package/build/dist/Server/Services/MetricItemAggMV1mByServiceService.js.map +1 -0
  326. package/build/dist/Server/Services/MetricService.js +761 -125
  327. package/build/dist/Server/Services/MetricService.js.map +1 -1
  328. package/build/dist/Server/Services/MonitorService.js +18 -5
  329. package/build/dist/Server/Services/MonitorService.js.map +1 -1
  330. package/build/dist/Server/Services/NetworkDeviceOwnerTeamService.js +44 -0
  331. package/build/dist/Server/Services/NetworkDeviceOwnerTeamService.js.map +1 -1
  332. package/build/dist/Server/Services/NetworkDeviceOwnerUserService.js +88 -0
  333. package/build/dist/Server/Services/NetworkDeviceOwnerUserService.js.map +1 -1
  334. package/build/dist/Server/Services/NetworkFlowService.js +9 -0
  335. package/build/dist/Server/Services/NetworkFlowService.js.map +1 -0
  336. package/build/dist/Server/Services/OnCallDutyPolicyService.js +15 -6
  337. package/build/dist/Server/Services/OnCallDutyPolicyService.js.map +1 -1
  338. package/build/dist/Server/Services/ProjectService.js +146 -6
  339. package/build/dist/Server/Services/ProjectService.js.map +1 -1
  340. package/build/dist/Server/Services/SpanService.js +8 -6
  341. package/build/dist/Server/Services/SpanService.js.map +1 -1
  342. package/build/dist/Server/Services/StatusPageService.js +91 -0
  343. package/build/dist/Server/Services/StatusPageService.js.map +1 -1
  344. package/build/dist/Server/Services/TeamMemberService.js +11 -0
  345. package/build/dist/Server/Services/TeamMemberService.js.map +1 -1
  346. package/build/dist/Server/Services/TelemetryExceptionService.js +14 -61
  347. package/build/dist/Server/Services/TelemetryExceptionService.js.map +1 -1
  348. package/build/dist/Server/Services/UserService.js +52 -0
  349. package/build/dist/Server/Services/UserService.js.map +1 -1
  350. package/build/dist/Server/Types/AnalyticsDatabase/AggregateBy.js +33 -7
  351. package/build/dist/Server/Types/AnalyticsDatabase/AggregateBy.js.map +1 -1
  352. package/build/dist/Server/Types/Markdown.js +8 -8
  353. package/build/dist/Server/Types/Markdown.js.map +1 -1
  354. package/build/dist/Server/Types/MarkdownSlugify.js +47 -0
  355. package/build/dist/Server/Types/MarkdownSlugify.js.map +1 -0
  356. package/build/dist/Server/Utils/AI/AIRunTranscript.js +180 -0
  357. package/build/dist/Server/Utils/AI/AIRunTranscript.js.map +1 -0
  358. package/build/dist/Server/Utils/AI/Chat/ChatAgentRunner.js +1 -0
  359. package/build/dist/Server/Utils/AI/Chat/ChatAgentRunner.js.map +1 -1
  360. package/build/dist/Server/Utils/AI/Chat/ObservabilityChatPrompt.js +103 -5
  361. package/build/dist/Server/Utils/AI/Chat/ObservabilityChatPrompt.js.map +1 -1
  362. package/build/dist/Server/Utils/AI/CodeFix/CodeFixAgentCompletion.js +55 -0
  363. package/build/dist/Server/Utils/AI/CodeFix/CodeFixAgentCompletion.js.map +1 -1
  364. package/build/dist/Server/Utils/AI/CodeFix/CodeFixReadiness.js +211 -0
  365. package/build/dist/Server/Utils/AI/CodeFix/CodeFixReadiness.js.map +1 -0
  366. package/build/dist/Server/Utils/AI/SRE/Insights/FixRouting.js.map +1 -1
  367. package/build/dist/Server/Utils/AI/Toolbox/CodeTools.js +654 -0
  368. package/build/dist/Server/Utils/AI/Toolbox/CodeTools.js.map +1 -0
  369. package/build/dist/Server/Utils/AI/Toolbox/CodeWriteTools.js +389 -0
  370. package/build/dist/Server/Utils/AI/Toolbox/CodeWriteTools.js.map +1 -0
  371. package/build/dist/Server/Utils/AI/Toolbox/Index.js +19 -0
  372. package/build/dist/Server/Utils/AI/Toolbox/Index.js.map +1 -1
  373. package/build/dist/Server/Utils/AI/Toolbox/ScheduledMaintenanceTools.js +239 -0
  374. package/build/dist/Server/Utils/AI/Toolbox/ScheduledMaintenanceTools.js.map +1 -0
  375. package/build/dist/Server/Utils/AnalyticsDatabase/ClickhouseCapacity.js +19 -1
  376. package/build/dist/Server/Utils/AnalyticsDatabase/ClickhouseCapacity.js.map +1 -1
  377. package/build/dist/Server/Utils/Attribution.js +74 -0
  378. package/build/dist/Server/Utils/Attribution.js.map +1 -0
  379. package/build/dist/Server/Utils/CodeRepository/GitHub/GitHub.js +439 -0
  380. package/build/dist/Server/Utils/CodeRepository/GitHub/GitHub.js.map +1 -1
  381. package/build/dist/Server/Utils/CodeRepository/StackTraceRepoResolver.js +1 -1
  382. package/build/dist/Server/Utils/CodeRepository/StackTraceRepoResolver.js.map +1 -1
  383. package/build/dist/Server/Utils/LLM/LLMService.js +275 -19
  384. package/build/dist/Server/Utils/LLM/LLMService.js.map +1 -1
  385. package/build/dist/Server/Utils/Marketing/ConversionUploadProvider.js +40 -0
  386. package/build/dist/Server/Utils/Marketing/ConversionUploadProvider.js.map +1 -0
  387. package/build/dist/Server/Utils/Marketing/ConversionUploadProviders.js +20 -0
  388. package/build/dist/Server/Utils/Marketing/ConversionUploadProviders.js.map +1 -0
  389. package/build/dist/Server/Utils/Marketing/Providers/GoogleAds.js +177 -0
  390. package/build/dist/Server/Utils/Marketing/Providers/GoogleAds.js.map +1 -0
  391. package/build/dist/Server/Utils/Marketing/Providers/LinkedIn.js +113 -0
  392. package/build/dist/Server/Utils/Marketing/Providers/LinkedIn.js.map +1 -0
  393. package/build/dist/Server/Utils/Marketing/Providers/Meta.js +109 -0
  394. package/build/dist/Server/Utils/Marketing/Providers/Meta.js.map +1 -0
  395. package/build/dist/Server/Utils/Marketing/Providers/MicrosoftAds.js +130 -0
  396. package/build/dist/Server/Utils/Marketing/Providers/MicrosoftAds.js.map +1 -0
  397. package/build/dist/Server/Utils/Marketing/Providers/Reddit.js +126 -0
  398. package/build/dist/Server/Utils/Marketing/Providers/Reddit.js.map +1 -0
  399. package/build/dist/Server/Utils/Monitor/MonitorAlert.js +53 -9
  400. package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
  401. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +21 -10
  402. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
  403. package/build/dist/Server/Utils/Monitor/MonitorIncident.js +54 -11
  404. package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
  405. package/build/dist/Server/Utils/Monitor/MonitorMetricUtil.js +43 -3
  406. package/build/dist/Server/Utils/Monitor/MonitorMetricUtil.js.map +1 -1
  407. package/build/dist/Server/Utils/Monitor/MonitorTemplateUtil.js +68 -0
  408. package/build/dist/Server/Utils/Monitor/MonitorTemplateUtil.js.map +1 -1
  409. package/build/dist/Server/Utils/Monitor/NetworkDeviceHydrationUtil.js +17 -11
  410. package/build/dist/Server/Utils/Monitor/NetworkDeviceHydrationUtil.js.map +1 -1
  411. package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js +100 -15
  412. package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js.map +1 -1
  413. package/build/dist/Server/Utils/ProductAnalytics.js +111 -0
  414. package/build/dist/Server/Utils/ProductAnalytics.js.map +1 -0
  415. package/build/dist/Server/Utils/Telemetry/Telemetry.js +32 -5
  416. package/build/dist/Server/Utils/Telemetry/Telemetry.js.map +1 -1
  417. package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js +17 -0
  418. package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js.map +1 -1
  419. package/build/dist/Types/AI/AIAgentTaskStatus.js +12 -0
  420. package/build/dist/Types/AI/AIAgentTaskStatus.js.map +1 -1
  421. package/build/dist/Types/AI/AIChatPageContext.js +101 -0
  422. package/build/dist/Types/AI/AIChatPageContext.js.map +1 -0
  423. package/build/dist/Types/AI/AIChatTypes.js +2 -0
  424. package/build/dist/Types/AI/AIChatTypes.js.map +1 -1
  425. package/build/dist/Types/AI/AIFixReadiness.js +9 -0
  426. package/build/dist/Types/AI/AIFixReadiness.js.map +1 -0
  427. package/build/dist/Types/AI/AIRunStatus.js +11 -0
  428. package/build/dist/Types/AI/AIRunStatus.js.map +1 -1
  429. package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js +11 -0
  430. package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js.map +1 -1
  431. package/build/dist/Types/BaseDatabase/AggregationInterval.js +11 -0
  432. package/build/dist/Types/BaseDatabase/AggregationInterval.js.map +1 -1
  433. package/build/dist/Types/BaseDatabase/AggregationIntervalUtil.js +33 -5
  434. package/build/dist/Types/BaseDatabase/AggregationIntervalUtil.js.map +1 -1
  435. package/build/dist/Types/Email/EmailTemplateType.js +2 -0
  436. package/build/dist/Types/Email/EmailTemplateType.js.map +1 -1
  437. package/build/dist/Types/Log/LogSeverity.js +56 -0
  438. package/build/dist/Types/Log/LogSeverity.js.map +1 -1
  439. package/build/dist/Types/Marketing/MarketingConversion.js +13 -0
  440. package/build/dist/Types/Marketing/MarketingConversion.js.map +1 -0
  441. package/build/dist/Types/Monitor/MonitorMetricType.js +7 -0
  442. package/build/dist/Types/Monitor/MonitorMetricType.js.map +1 -1
  443. package/build/dist/Types/Monitor/MonitorStep.js +6 -0
  444. package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
  445. package/build/dist/Types/Monitor/MonitorStepSqlMonitor.js +3 -0
  446. package/build/dist/Types/Monitor/MonitorStepSqlMonitor.js.map +1 -1
  447. package/build/dist/Types/Monitor/MonitorType.js +2 -1
  448. package/build/dist/Types/Monitor/MonitorType.js.map +1 -1
  449. package/build/dist/Types/Monitor/SnmpMonitor/CdpNeighbor.js +2 -0
  450. package/build/dist/Types/Monitor/SnmpMonitor/CdpNeighbor.js.map +1 -0
  451. package/build/dist/Types/Monitor/SnmpMonitor/SnmpAuthProtocol.js +41 -0
  452. package/build/dist/Types/Monitor/SnmpMonitor/SnmpAuthProtocol.js.map +1 -1
  453. package/build/dist/Types/Monitor/SnmpMonitor/SnmpEntityInfo.js +2 -0
  454. package/build/dist/Types/Monitor/SnmpMonitor/SnmpEntityInfo.js.map +1 -0
  455. package/build/dist/Types/Monitor/SnmpMonitor/SnmpPrivProtocol.js +48 -0
  456. package/build/dist/Types/Monitor/SnmpMonitor/SnmpPrivProtocol.js.map +1 -1
  457. package/build/dist/Types/Monitor/SnmpMonitor/SnmpSecurityLevel.js +38 -0
  458. package/build/dist/Types/Monitor/SnmpMonitor/SnmpSecurityLevel.js.map +1 -1
  459. package/build/dist/Types/Monitor/SnmpMonitor/SnmpSystemInfo.js +2 -0
  460. package/build/dist/Types/Monitor/SnmpMonitor/SnmpSystemInfo.js.map +1 -0
  461. package/build/dist/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.js +96 -3
  462. package/build/dist/Types/Monitor/SnmpMonitor/SnmpVendorTemplate.js.map +1 -1
  463. package/build/dist/Types/Monitor/SnmpMonitor/SnmpVersion.js +38 -0
  464. package/build/dist/Types/Monitor/SnmpMonitor/SnmpVersion.js.map +1 -1
  465. package/build/dist/Types/NetFlow/NetworkFlowRecord.js +2 -0
  466. package/build/dist/Types/NetFlow/NetworkFlowRecord.js.map +1 -0
  467. package/build/dist/Types/Syslog/SyslogMessage.js +2 -0
  468. package/build/dist/Types/Syslog/SyslogMessage.js.map +1 -0
  469. package/build/dist/Types/Telemetry/TelemetrySavedViewState.js +0 -7
  470. package/build/dist/Types/Telemetry/TelemetrySavedViewState.js.map +1 -1
  471. package/build/dist/Types/Telemetry/TelemetrySavedViewType.js +13 -0
  472. package/build/dist/Types/Telemetry/TelemetrySavedViewType.js.map +1 -0
  473. package/build/dist/UI/Components/Charts/Area/AreaChart.js +25 -1
  474. package/build/dist/UI/Components/Charts/Area/AreaChart.js.map +1 -1
  475. package/build/dist/UI/Components/Charts/Bar/BarChart.js +26 -2
  476. package/build/dist/UI/Components/Charts/Bar/BarChart.js.map +1 -1
  477. package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js +36 -12
  478. package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js.map +1 -1
  479. package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js +217 -8
  480. package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js.map +1 -1
  481. package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js +55 -4
  482. package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js.map +1 -1
  483. package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js +217 -8
  484. package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js.map +1 -1
  485. package/build/dist/UI/Components/Charts/ChartLibrary/Types/ChartDataPoint.js +6 -1
  486. package/build/dist/UI/Components/Charts/ChartLibrary/Types/ChartDataPoint.js.map +1 -1
  487. package/build/dist/UI/Components/Charts/ChartLibrary/Types/FormattedReferenceRegion.js +2 -0
  488. package/build/dist/UI/Components/Charts/ChartLibrary/Types/FormattedReferenceRegion.js.map +1 -0
  489. package/build/dist/UI/Components/Charts/ChartLibrary/Types/FormattedTimeReferenceLine.js +2 -0
  490. package/build/dist/UI/Components/Charts/ChartLibrary/Types/FormattedTimeReferenceLine.js.map +1 -0
  491. package/build/dist/UI/Components/Charts/Line/LineChart.js +25 -1
  492. package/build/dist/UI/Components/Charts/Line/LineChart.js.map +1 -1
  493. package/build/dist/UI/Components/Charts/Types/ReferenceRegionProps.js +2 -0
  494. package/build/dist/UI/Components/Charts/Types/ReferenceRegionProps.js.map +1 -0
  495. package/build/dist/UI/Components/Charts/Types/TimeReferenceLineProps.js +2 -0
  496. package/build/dist/UI/Components/Charts/Types/TimeReferenceLineProps.js.map +1 -0
  497. package/build/dist/UI/Components/Charts/Types/XAxis/XAxisPrecision.js +1 -0
  498. package/build/dist/UI/Components/Charts/Types/XAxis/XAxisPrecision.js.map +1 -1
  499. package/build/dist/UI/Components/Charts/Utils/DataPoint.js +0 -0
  500. package/build/dist/UI/Components/Charts/Utils/DataPoint.js.map +1 -1
  501. package/build/dist/UI/Components/Charts/Utils/TimeAnnotation.js +121 -0
  502. package/build/dist/UI/Components/Charts/Utils/TimeAnnotation.js.map +1 -0
  503. package/build/dist/UI/Components/Charts/Utils/XAxis.js +27 -4
  504. package/build/dist/UI/Components/Charts/Utils/XAxis.js.map +1 -1
  505. package/build/dist/UI/Components/Forms/BasicForm.js +24 -6
  506. package/build/dist/UI/Components/Forms/BasicForm.js.map +1 -1
  507. package/build/dist/UI/Components/Icon/Icon.js +15 -8
  508. package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
  509. package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js.map +1 -1
  510. package/build/dist/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.js +58 -0
  511. package/build/dist/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.js.map +1 -1
  512. package/build/dist/UI/Components/Page/ModelPage.js +7 -1
  513. package/build/dist/UI/Components/Page/ModelPage.js.map +1 -1
  514. package/build/dist/UI/Components/TelemetryViewer/components/SavedViewsDropdown.js +10 -4
  515. package/build/dist/UI/Components/TelemetryViewer/components/SavedViewsDropdown.js.map +1 -1
  516. package/build/dist/UI/Utils/AIChatExport/ChatWidgetData.js +217 -0
  517. package/build/dist/UI/Utils/AIChatExport/ChatWidgetData.js.map +1 -0
  518. package/build/dist/UI/Utils/AIChatExport/ChatWidgetMarkdown.js +234 -0
  519. package/build/dist/UI/Utils/AIChatExport/ChatWidgetMarkdown.js.map +1 -0
  520. package/build/dist/UI/Utils/AIChatExport/ConversationMarkdown.js +111 -0
  521. package/build/dist/UI/Utils/AIChatExport/ConversationMarkdown.js.map +1 -0
  522. package/build/dist/UI/Utils/AIChatExport/MarkdownBlocks.js +233 -0
  523. package/build/dist/UI/Utils/AIChatExport/MarkdownBlocks.js.map +1 -0
  524. package/build/dist/UI/Utils/AIChatExport/MarkdownSafety.js +134 -0
  525. package/build/dist/UI/Utils/AIChatExport/MarkdownSafety.js.map +1 -0
  526. package/build/dist/UI/Utils/DownloadFile.js +41 -0
  527. package/build/dist/UI/Utils/DownloadFile.js.map +1 -0
  528. package/build/dist/UI/Utils/User.js +35 -2
  529. package/build/dist/UI/Utils/User.js.map +1 -1
  530. package/build/dist/Utils/Analytics.js +8 -5
  531. package/build/dist/Utils/Analytics.js.map +1 -1
  532. package/build/dist/Utils/EnterpriseLicense/EnterpriseLicenseUsage.js +57 -0
  533. package/build/dist/Utils/EnterpriseLicense/EnterpriseLicenseUsage.js.map +1 -1
  534. package/build/dist/Utils/Metrics/MetricExplorerUrl.js +418 -0
  535. package/build/dist/Utils/Metrics/MetricExplorerUrl.js.map +1 -0
  536. package/build/dist/Utils/Metrics/MetricFormulaEvaluator.js +296 -37
  537. package/build/dist/Utils/Metrics/MetricFormulaEvaluator.js.map +1 -1
  538. package/build/dist/Utils/Monitor/NetworkTopologyUtil.js +176 -40
  539. package/build/dist/Utils/Monitor/NetworkTopologyUtil.js.map +1 -1
  540. package/build/dist/Utils/ValueFormatter.js +20 -1
  541. package/build/dist/Utils/ValueFormatter.js.map +1 -1
  542. package/package.json +6 -2
@@ -13,20 +13,18 @@ import CodeFixTaskType, {
13
13
  import DatabaseCommonInteractionProps from "../../Types/BaseDatabase/DatabaseCommonInteractionProps";
14
14
  import AIRunService from "./AIRunService";
15
15
  import FixRunBudget from "../Utils/AI/CodeFix/FixRunBudget";
16
- import AIAgentService from "./AIAgentService";
17
- import LlmProviderService from "./LlmProviderService";
18
- import ProjectService from "./ProjectService";
16
+ import CodeFixReadiness from "../Utils/AI/CodeFix/CodeFixReadiness";
19
17
  import ServiceService from "./ServiceService";
20
18
  import CodeRepositoryService from "./CodeRepositoryService";
21
19
  import { RepoResolution } from "../Utils/CodeRepository/StackTraceRepoResolver";
22
- import AIAgent from "../../Models/DatabaseModels/AIAgent";
23
- import LlmProvider from "../../Models/DatabaseModels/LlmProvider";
24
- import Project from "../../Models/DatabaseModels/Project";
20
+ import {
21
+ AIFixReadiness,
22
+ AIFixReadinessCheck,
23
+ } from "../../Types/AI/AIFixReadiness";
25
24
  import TelemetryService from "../../Models/DatabaseModels/Service";
26
25
  import QueryHelper from "../Types/Database/QueryHelper";
27
26
  import ModelPermission from "../Types/Database/Permissions/Index";
28
27
  import CaptureSpan from "../Utils/Telemetry/CaptureSpan";
29
- import { IsBillingEnabled } from "../EnvironmentConfig";
30
28
  import Query from "../Types/Database/Query";
31
29
  import Includes from "../../Types/BaseDatabase/Includes";
32
30
  import logger from "../Utils/Logger";
@@ -46,24 +44,6 @@ export interface CreateCodeFixRunForExceptionParams {
46
44
  taskType?: CodeFixTaskType | undefined;
47
45
  }
48
46
 
49
- export type AIFixReadinessCheckId =
50
- | "llmProvider"
51
- | "repositoryResolved"
52
- | "agentAvailable";
53
-
54
- export interface AIFixReadinessCheck {
55
- id: AIFixReadinessCheckId;
56
- ok: boolean;
57
- title: string;
58
- // Shown to the user when ok is false — says exactly what to do next.
59
- detail: string;
60
- }
61
-
62
- export interface AIFixReadiness {
63
- ready: boolean;
64
- checks: Array<AIFixReadinessCheck>;
65
- }
66
-
67
47
  export interface DashboardServiceSummary {
68
48
  /*
69
49
  * Polymorphic: a real Service, a Host/DockerHost/KubernetesCluster id, or
@@ -124,55 +104,16 @@ export class Service extends DatabaseService<Model> {
124
104
  const projectId: ObjectID = telemetryException.projectId;
125
105
 
126
106
  /*
127
- * 1. An LLM provider the agent may use. Agent completions are
128
- * server-mediated and metered (B4 Tier 0), so the shared global
129
- * provider is a valid fallback on cloud too — a project-owned provider
130
- * simply wins when one exists.
131
- */
132
- const llmProvider: LlmProvider | null =
133
- await LlmProviderService.getLlmProviderForMeteredAgentPath(projectId);
134
-
135
- let llmOk: boolean = Boolean(llmProvider);
136
- let llmDetail: string = llmOk
137
- ? ""
138
- : "AI fix tasks need an LLM provider. Add one in Project Settings > AI > LLM Providers. Self-hosted instances can alternatively set the GLOBAL_LLM_PROVIDER_* environment variables to register a global provider for every project.";
139
-
140
- /*
141
- * A resolved provider must also be PAYABLE, or the run passes readiness
142
- * here and dies at its first completion call instead. Mirrors the
143
- * billing gate in AIService.executeWithLogging: only a COSTED global
144
- * provider on cloud bills the project's AI balance per call —
145
- * project-owned and free-global providers consume no balance and must
146
- * not require one.
107
+ * 1. An LLM provider the agent may use the same gate the project-wide
108
+ * AI Tasks page renders, so the two surfaces can never disagree about
109
+ * whether this project has a usable provider.
147
110
  */
148
- const billingEnabled: boolean = params.billingEnabled ?? IsBillingEnabled;
149
-
150
- if (
151
- llmProvider &&
152
- billingEnabled &&
153
- (llmProvider.isGlobalLlm || false) &&
154
- (llmProvider.costPerMillionTokensInUSDCents || 0) > 0
155
- ) {
156
- const project: Project | null = await ProjectService.findOneById({
157
- id: projectId,
158
- select: { aiCurrentBalanceInUSDCents: true },
159
- props: { isRoot: true },
111
+ const llmCheck: AIFixReadinessCheck =
112
+ await CodeFixReadiness.getLlmProviderCheck({
113
+ projectId,
114
+ billingEnabled: params.billingEnabled,
160
115
  });
161
116
 
162
- if (!project || (project.aiCurrentBalanceInUSDCents || 0) <= 0) {
163
- llmOk = false;
164
- llmDetail =
165
- "AI fix tasks would use the OneUptime-hosted LLM provider, which is billed against your AI balance — and the project's balance is empty. Recharge it in Project Settings > AI Credits, or add your own LLM provider in Project Settings > AI > LLM Providers.";
166
- }
167
- }
168
-
169
- const llmCheck: AIFixReadinessCheck = {
170
- id: "llmProvider",
171
- ok: llmOk,
172
- title: "LLM provider",
173
- detail: llmDetail,
174
- };
175
-
176
117
  /*
177
118
  * 2. A repository must RESOLVE for this exception — computed at runtime
178
119
  * from the stack trace (path matching over connected repos), falling
@@ -223,25 +164,11 @@ export class Service extends DatabaseService<Model> {
223
164
  };
224
165
  }
225
166
 
226
- // 4. An agent must be alive to pick the task up.
227
- const anyAgent: AIAgent | null =
228
- await AIAgentService.getAIAgentForProject(projectId);
229
- const connectedAgent: AIAgent | null = anyAgent
230
- ? AIAgentService.isAgentAlive(anyAgent)
231
- ? anyAgent
232
- : null
233
- : null;
234
-
235
- const agentCheck: AIFixReadinessCheck = {
236
- id: "agentAvailable",
237
- ok: Boolean(connectedAgent),
238
- title: "AI agent online",
239
- detail: connectedAgent
240
- ? ""
241
- : anyAgent
242
- ? `The AI agent "${anyAgent.name || "agent"}" has not reported in — check that its container is running.`
243
- : "No AI agent is available for this project. Self-hosted: create an agent under Settings > AI > AI Agents and run its container. Cloud: the shared fleet appears here automatically once enabled.",
244
- };
167
+ // 3. An agent must be alive to pick the task up.
168
+ const agentCheck: AIFixReadinessCheck =
169
+ await CodeFixReadiness.getAgentCheck({
170
+ projectId,
171
+ });
245
172
 
246
173
  const checks: Array<AIFixReadinessCheck> = [
247
174
  llmCheck,
@@ -387,8 +314,10 @@ export class Service extends DatabaseService<Model> {
387
314
  taskType === CodeFixTaskType.FixException
388
315
  ? QueryHelper.equalToOrNull(CodeFixTaskType.FixException)
389
316
  : taskType,
317
+ // Every terminal status — see AIRunStatusHelper.isTerminalStatus.
390
318
  status: QueryHelper.notIn([
391
319
  AIRunStatus.Completed,
320
+ AIRunStatus.NoFixFound,
392
321
  AIRunStatus.Error,
393
322
  AIRunStatus.Cancelled,
394
323
  AIRunStatus.Stale,
@@ -4,8 +4,10 @@ import {
4
4
  NotificationSlackWebhookOnCreateUser,
5
5
  } from "../EnvironmentConfig";
6
6
  import { OnCreate, OnDelete, OnUpdate } from "../Types/Database/Hooks";
7
+ import CreateBy from "../Types/Database/CreateBy";
7
8
  import UpdateBy from "../Types/Database/UpdateBy";
8
9
  import DeleteBy from "../Types/Database/DeleteBy";
10
+ import Attribution from "../Utils/Attribution";
9
11
  import logger, { LogAttributes } from "../Utils/Logger";
10
12
  import DatabaseService from "./DatabaseService";
11
13
  import EmailVerificationTokenService from "./EmailVerificationTokenService";
@@ -25,12 +27,14 @@ import OneUptimeDate from "../../Types/Date";
25
27
  import Email from "../../Types/Email";
26
28
  import EmailTemplateType from "../../Types/Email/EmailTemplateType";
27
29
  import HashedString from "../../Types/HashedString";
30
+ import { JSONObject, JSONValue } from "../../Types/JSON";
28
31
  import ObjectID from "../../Types/ObjectID";
29
32
  import Text from "../../Types/Text";
30
33
  import EmailVerificationToken from "../../Models/DatabaseModels/EmailVerificationToken";
31
34
  import TeamMember from "../../Models/DatabaseModels/TeamMember";
32
35
  import Model from "../../Models/DatabaseModels/User";
33
36
  import SlackUtil from "../Utils/Workspace/Slack/Slack";
37
+ import ProductAnalytics from "../Utils/ProductAnalytics";
34
38
  import UserTotpAuth from "../../Models/DatabaseModels/UserTotpAuth";
35
39
  import UserTotpAuthService from "./UserTotpAuthService";
36
40
  import UserWebAuthn from "../../Models/DatabaseModels/UserWebAuthn";
@@ -120,6 +124,38 @@ export class Service extends DatabaseService<Model> {
120
124
  );
121
125
  }
122
126
 
127
+ @CaptureSpan()
128
+ protected override async onBeforeCreate(
129
+ createBy: CreateBy<Model>,
130
+ ): Promise<OnCreate<Model>> {
131
+ /*
132
+ * clickIds / firstTouchAttribution are publicly creatable jsonb columns
133
+ * (set during signup). Unlike the varchar(500) utm columns they have no
134
+ * DB-level size bound, so whitelist keys and cap value lengths here.
135
+ */
136
+ const sanitizedClickIds: JSONObject | undefined =
137
+ Attribution.sanitizeClickIds(createBy.data.clickIds as JSONValue);
138
+
139
+ if (sanitizedClickIds) {
140
+ createBy.data.clickIds = sanitizedClickIds;
141
+ } else {
142
+ delete createBy.data.clickIds;
143
+ }
144
+
145
+ const sanitizedFirstTouchAttribution: JSONObject | undefined =
146
+ Attribution.sanitizeFirstTouchAttribution(
147
+ createBy.data.firstTouchAttribution as JSONValue,
148
+ );
149
+
150
+ if (sanitizedFirstTouchAttribution) {
151
+ createBy.data.firstTouchAttribution = sanitizedFirstTouchAttribution;
152
+ } else {
153
+ delete createBy.data.firstTouchAttribution;
154
+ }
155
+
156
+ return { createBy, carryForward: null };
157
+ }
158
+
123
159
  @CaptureSpan()
124
160
  protected override async onCreateSuccess(
125
161
  _onCreate: OnCreate<Model>,
@@ -141,6 +177,29 @@ export class Service extends DatabaseService<Model> {
141
177
  });
142
178
  }
143
179
 
180
+ /*
181
+ * Server-side signup event (ad blockers eat the client-side one). Also
182
+ * fires for users created via team invites — has_password separates
183
+ * direct signups (true) from invited users (false).
184
+ */
185
+ if (createdItem.email) {
186
+ ProductAnalytics.capture({
187
+ event: "server/user_created",
188
+ distinctId: createdItem.email.toString(),
189
+ properties: {
190
+ has_password: Boolean(createdItem.password),
191
+ utm_source: createdItem.utmSource || "",
192
+ utm_medium: createdItem.utmMedium || "",
193
+ utm_campaign: createdItem.utmCampaign || "",
194
+ utm_term: createdItem.utmTerm || "",
195
+ utm_content: createdItem.utmContent || "",
196
+ utm_url: createdItem.utmUrl || "",
197
+ click_ids: createdItem.clickIds || {},
198
+ first_touch: createdItem.firstTouchAttribution || {},
199
+ },
200
+ });
201
+ }
202
+
144
203
  // A place holder method used for overriding.
145
204
  return Promise.resolve(createdItem);
146
205
  }
@@ -38,19 +38,50 @@ export class AggregateUtil {
38
38
  return interval === AggregationInterval.Total;
39
39
  }
40
40
 
41
+ /**
42
+ * The single source of truth for "which ClickHouse expression buckets
43
+ * a timestamp at this interval". Every aggregate SQL builder (raw
44
+ * table, minute MV, per-host MV, span projections) must go through
45
+ * this instead of lowercasing the enum value into the statement:
46
+ * the calendar units happen to double as SQL unit names
47
+ * (`date_trunc('hour', ...)`), but the sub-hour tiers
48
+ * (FiveMinutes/...) are not valid units and compile to
49
+ * `toStartOfInterval(col, INTERVAL 5 MINUTE)` instead — which
50
+ * ClickHouse counts in whole intervals since the epoch, so the
51
+ * 5/15/30-minute grids are exact on the client's epoch-ms grid too.
52
+ *
53
+ * `timestampExpression` is a model-validated identifier or a builder-
54
+ * owned expression, so raw interpolation here is consistent with the
55
+ * surrounding builders. `Total` has no bucket expression (the window
56
+ * collapses into `min(col)` — see buildBucketTimestampSelect).
57
+ */
58
+ public static buildBucketTimestampExpression(
59
+ resolvedInterval: AggregationInterval,
60
+ timestampExpression: string,
61
+ ): string {
62
+ switch (resolvedInterval) {
63
+ case AggregationInterval.FiveMinutes:
64
+ return `toStartOfInterval(${timestampExpression}, INTERVAL 5 MINUTE)`;
65
+ case AggregationInterval.FifteenMinutes:
66
+ return `toStartOfInterval(${timestampExpression}, INTERVAL 15 MINUTE)`;
67
+ case AggregationInterval.ThirtyMinutes:
68
+ return `toStartOfInterval(${timestampExpression}, INTERVAL 30 MINUTE)`;
69
+ default: {
70
+ const interval: string = resolvedInterval.toLowerCase();
71
+ return `date_trunc('${interval}', toStartOfInterval(${timestampExpression}, INTERVAL 1 ${interval}))`;
72
+ }
73
+ }
74
+ }
75
+
41
76
  /**
42
77
  * The SELECT fragment that produces the bucket timestamp column,
43
78
  * already aliased to `timestampColumn`. Shared by every aggregate SQL
44
79
  * builder so the `Total` (whole-window) shape stays identical across
45
80
  * paths:
46
81
  *
47
- * - normal interval → `date_trunc('<i>', toStartOfInterval(col, INTERVAL 1 <i>)) as col`
82
+ * - normal interval → buildBucketTimestampExpression(...) `as col`
48
83
  * - Total → `min(col) as col` (one row per group; the
49
84
  * earliest sample timestamp in the window is the bucket label)
50
- *
51
- * `timestampColumn` is a model-validated identifier (see
52
- * AnalyticsDatabaseService._aggregateBy), so raw interpolation here is
53
- * consistent with the surrounding builders.
54
85
  */
55
86
  public static buildBucketTimestampSelect(
56
87
  resolvedInterval: AggregationInterval,
@@ -60,7 +91,6 @@ export class AggregateUtil {
60
91
  return `min(${timestampColumn}) as ${timestampColumn}`;
61
92
  }
62
93
 
63
- const interval: string = resolvedInterval.toLowerCase();
64
- return `date_trunc('${interval}', toStartOfInterval(${timestampColumn}, INTERVAL 1 ${interval})) as ${timestampColumn}`;
94
+ return `${AggregateUtil.buildBucketTimestampExpression(resolvedInterval, timestampColumn)} as ${timestampColumn}`;
65
95
  }
66
96
  }
@@ -1,5 +1,6 @@
1
1
  import { Renderer, marked } from "marked";
2
2
  import CaptureSpan from "../Utils/Telemetry/CaptureSpan";
3
+ import markdownSlugify from "./MarkdownSlugify";
3
4
 
4
5
  export type MarkdownRenderer = Renderer;
5
6
 
@@ -235,15 +236,14 @@ export default class Markdown {
235
236
  return renderer;
236
237
  }
237
238
 
238
- private static slugify(text: string): string {
239
- return text
240
- .toLowerCase()
241
- .replace(/<[^>]*>/g, "")
242
- .replace(/&[^;]+;/g, "")
243
- .replace(/[^\w\s-]/g, "")
244
- .replace(/\s+/g, "-")
245
- .replace(/-+/g, "-")
246
- .replace(/^-|-$/g, "");
239
+ /*
240
+ * Heading text -> the `id` used for in-page anchors. The rules live in
241
+ * MarkdownSlugify.ts, a dependency-free module, so the docs anchor scripts
242
+ * (Scripts/Docs/CheckAnchors.ts, FixAnchors.ts) can share them without
243
+ * pulling in marked or the telemetry stack — see the comment there.
244
+ */
245
+ public static slugify(text: string): string {
246
+ return markdownSlugify(text);
247
247
  }
248
248
 
249
249
  private static getDocsRenderer(): Renderer {
@@ -0,0 +1,47 @@
1
+ /*
2
+ * Heading text -> the `id` used for in-page anchors.
3
+ *
4
+ * This is the single source of truth for anchor ids. The docs renderer
5
+ * (Common/Server/Types/Markdown.ts) exposes it as Markdown.slugify, and the
6
+ * docs anchor scripts (Scripts/Docs/CheckAnchors.ts, Scripts/Docs/FixAnchors.ts)
7
+ * import it directly; a second copy of these rules would drift and then pass a
8
+ * link the renderer serves as a 404.
9
+ *
10
+ * It lives in its own module with ZERO imports on purpose: Markdown.ts pulls in
11
+ * marked and the telemetry stack, which only resolve inside a fully installed
12
+ * package. The scripts run in CI with nothing but the root npm install, so they
13
+ * must be able to load the slugify rules without any of that.
14
+ *
15
+ * The character class keeps letters and numbers in ANY script, via \p{L} and
16
+ * \p{N} with the /u flag. It used to be `\w`, which is ASCII-only — so every
17
+ * Cyrillic, CJK and Devanagari heading was stripped to nothing and rendered
18
+ * as id="", breaking every anchor in those locales. Accented Latin lost the
19
+ * accented letter alone ("gravité" -> "gravit").
20
+ *
21
+ * \p{M} (combining marks) is required alongside \p{L}: Devanagari matras and
22
+ * Arabic/Thai vowel signs are marks, not letters, so without it Hindi headings
23
+ * come out mangled rather than merely transliterated ("लॉग" -> "लग"). It also
24
+ * covers decomposed (NFD) Latin, where "é" is "e" + a combining accent.
25
+ *
26
+ * Variation selectors are dropped first. They are marks too, so \p{M} would
27
+ * otherwise keep them — and an emoji heading like "⚠️ Important" carries an
28
+ * invisible U+FE0F that would survive its emoji and lead the id.
29
+ *
30
+ * `_` is listed explicitly because \p{L}/\p{N} do not cover it but the old
31
+ * `\w` did, and real headings depend on it — e.g. "`ceph_health_status` is 1
32
+ * but no incident fires". Dropping it would silently renumber existing
33
+ * English anchors and break inbound deep links.
34
+ */
35
+ const slugify: (text: string) => string = (text: string): string => {
36
+ return text
37
+ .toLowerCase()
38
+ .replace(/<[^>]*>/g, "")
39
+ .replace(/&[^;]+;/g, "")
40
+ .replace(/[\uFE00-\uFE0F\u{E0100}-\u{E01EF}]/gu, "")
41
+ .replace(/[^\p{L}\p{N}\p{M}_\s-]/gu, "")
42
+ .replace(/\s+/g, "-")
43
+ .replace(/-+/g, "-")
44
+ .replace(/^-|-$/g, "");
45
+ };
46
+
47
+ export default slugify;
@@ -0,0 +1,240 @@
1
+ import { AIRunEventContentPayload } from "../../../Types/AI/AIChatTypes";
2
+ import { JSONObject } from "../../../Types/JSON";
3
+
4
+ /*
5
+ * Write-time caps for AIRunEvent.contentPayload — the run transcript.
6
+ *
7
+ * The transcript exists to debug a bad run, so it stores content verbatim
8
+ * rather than summarized. That makes bounding it a storage requirement, not a
9
+ * nicety: a code-fix agent may read large files and run test suites that emit
10
+ * megabytes, and it does so up to 40 times per run.
11
+ *
12
+ * Only NEW messages are recorded per call (never the whole replayed history),
13
+ * so a run's transcript grows linearly with its turns rather than
14
+ * quadratically. These caps then bound each turn.
15
+ */
16
+ export const MAX_MESSAGE_CONTENT_CHARS: number = 20000;
17
+ export const MAX_RESPONSE_CONTENT_CHARS: number = 20000;
18
+ export const MAX_TOOL_RESULT_CHARS: number = 20000;
19
+ export const MAX_TOOL_ARGUMENT_CHARS: number = 10000;
20
+ // Belt and braces: a hard ceiling on the serialized payload.
21
+ export const MAX_PAYLOAD_CHARS: number = 200000;
22
+
23
+ const TRUNCATION_SUFFIX: string = "\n… [truncated]";
24
+
25
+ export default class AIRunTranscript {
26
+ /*
27
+ * Clip one string to a cap. Returns the value and whether it was clipped,
28
+ * so the payload can honestly report truncation to the reader rather than
29
+ * silently presenting a partial prompt as complete.
30
+ */
31
+ public static clip(
32
+ value: string | undefined,
33
+ maxChars: number,
34
+ ): { value: string | undefined; isTruncated: boolean } {
35
+ if (value === undefined || value === null) {
36
+ return { value: undefined, isTruncated: false };
37
+ }
38
+
39
+ if (value.length <= maxChars) {
40
+ return { value, isTruncated: false };
41
+ }
42
+
43
+ return {
44
+ value: value.substring(0, maxChars) + TRUNCATION_SUFFIX,
45
+ isTruncated: true,
46
+ };
47
+ }
48
+
49
+ /*
50
+ * Clip tool arguments by serializing them, so a single huge argument (a
51
+ * write_file `content`, say) cannot blow the row up. Unparseable or
52
+ * oversized arguments degrade to a marker object rather than being dropped
53
+ * — knowing a tool was called with arguments too big to store is itself a
54
+ * useful debugging signal.
55
+ */
56
+ public static clipArguments(args: JSONObject | undefined): {
57
+ value: JSONObject | undefined;
58
+ isTruncated: boolean;
59
+ } {
60
+ if (!args) {
61
+ return { value: undefined, isTruncated: false };
62
+ }
63
+
64
+ let serialized: string = "";
65
+
66
+ try {
67
+ serialized = JSON.stringify(args);
68
+ } catch {
69
+ return {
70
+ value: { _note: "Arguments could not be serialized." },
71
+ isTruncated: true,
72
+ };
73
+ }
74
+
75
+ if (serialized.length <= MAX_TOOL_ARGUMENT_CHARS) {
76
+ return { value: args, isTruncated: false };
77
+ }
78
+
79
+ return {
80
+ value: {
81
+ _note: `Arguments omitted — ${serialized.length} characters exceeds the ${MAX_TOOL_ARGUMENT_CHARS} character cap.`,
82
+ _preview: serialized.substring(0, 2000),
83
+ },
84
+ isTruncated: true,
85
+ };
86
+ }
87
+
88
+ /*
89
+ * Apply every cap to a payload and stamp isTruncated if anything was
90
+ * clipped. The final MAX_PAYLOAD_CHARS check is a backstop for a payload
91
+ * that is under the per-field caps but still large in aggregate (many
92
+ * messages); it drops the request messages first, since the response and
93
+ * tool result are the more valuable half when debugging.
94
+ */
95
+ public static clampPayload(
96
+ payload: AIRunEventContentPayload,
97
+ ): AIRunEventContentPayload {
98
+ let isTruncated: boolean = payload.isTruncated === true;
99
+
100
+ const clamped: AIRunEventContentPayload = { ...payload };
101
+
102
+ if (payload.requestMessages) {
103
+ clamped.requestMessages = payload.requestMessages.map(
104
+ (message: { role: string; content: string }) => {
105
+ const clipped: { value: string | undefined; isTruncated: boolean } =
106
+ this.clip(message.content, MAX_MESSAGE_CONTENT_CHARS);
107
+
108
+ if (clipped.isTruncated) {
109
+ isTruncated = true;
110
+ }
111
+
112
+ return { role: message.role, content: clipped.value || "" };
113
+ },
114
+ );
115
+ }
116
+
117
+ if (payload.responseContent !== undefined) {
118
+ const clipped: { value: string | undefined; isTruncated: boolean } =
119
+ this.clip(payload.responseContent, MAX_RESPONSE_CONTENT_CHARS);
120
+ clamped.responseContent = clipped.value;
121
+ isTruncated = isTruncated || clipped.isTruncated;
122
+ }
123
+
124
+ if (payload.toolResult !== undefined) {
125
+ const clipped: { value: string | undefined; isTruncated: boolean } =
126
+ this.clip(payload.toolResult, MAX_TOOL_RESULT_CHARS);
127
+ clamped.toolResult = clipped.value;
128
+ isTruncated = isTruncated || clipped.isTruncated;
129
+ }
130
+
131
+ if (payload.responseToolCalls) {
132
+ clamped.responseToolCalls = payload.responseToolCalls.map(
133
+ (toolCall: {
134
+ id?: string | undefined;
135
+ name: string;
136
+ arguments?: JSONObject | undefined;
137
+ }) => {
138
+ const clipped: {
139
+ value: JSONObject | undefined;
140
+ isTruncated: boolean;
141
+ } = this.clipArguments(toolCall.arguments);
142
+
143
+ if (clipped.isTruncated) {
144
+ isTruncated = true;
145
+ }
146
+
147
+ return {
148
+ ...(toolCall.id ? { id: toolCall.id } : {}),
149
+ name: toolCall.name,
150
+ ...(clipped.value ? { arguments: clipped.value } : {}),
151
+ };
152
+ },
153
+ );
154
+ }
155
+
156
+ /*
157
+ * Sacrifice whole fields, largest-payoff first, RE-CHECKING after each —
158
+ * a single pass that drops only requestMessages cannot bound a payload
159
+ * whose bulk is elsewhere. A model that emits 30 write_file calls puts
160
+ * ~10k of arguments each into responseToolCalls, blowing the ceiling while
161
+ * the pass "succeeds" by deleting a two-character user message.
162
+ *
163
+ * Order is by debugging value, cheapest to lose first: the replayed
164
+ * request messages, then the tool arguments (their paths survive in the
165
+ * message), then the tool output. Each step reports what it dropped rather
166
+ * than leaving the reader to wonder.
167
+ */
168
+ const sacrifices: Array<() => void> = [
169
+ () => {
170
+ const messageCount: number = clamped.requestMessages?.length || 0;
171
+ clamped.requestMessages = [
172
+ {
173
+ role: "system",
174
+ content: `[${messageCount} request message(s) omitted — this step's transcript exceeded the ${MAX_PAYLOAD_CHARS} character cap.]`,
175
+ },
176
+ ];
177
+ },
178
+ () => {
179
+ if (!clamped.responseToolCalls) {
180
+ return;
181
+ }
182
+
183
+ clamped.responseToolCalls = clamped.responseToolCalls.map(
184
+ (toolCall: {
185
+ id?: string | undefined;
186
+ name: string;
187
+ arguments?: JSONObject | undefined;
188
+ }) => {
189
+ return {
190
+ ...(toolCall.id ? { id: toolCall.id } : {}),
191
+ name: toolCall.name,
192
+ arguments: {
193
+ _note: `Arguments omitted — this step's transcript exceeded the ${MAX_PAYLOAD_CHARS} character cap.`,
194
+ },
195
+ };
196
+ },
197
+ );
198
+ },
199
+ () => {
200
+ clamped.toolResult = `[Tool output omitted — this step's transcript exceeded the ${MAX_PAYLOAD_CHARS} character cap.]`;
201
+ },
202
+ () => {
203
+ clamped.responseContent = `[Model response omitted — this step's transcript exceeded the ${MAX_PAYLOAD_CHARS} character cap.]`;
204
+ },
205
+ /*
206
+ * Last resort: responseToolCalls has no bounded LENGTH, only bounded
207
+ * entries, so a response with enough calls stays over cap even with every
208
+ * argument already dropped. Collapse it to a count.
209
+ */
210
+ () => {
211
+ const toolCallCount: number = clamped.responseToolCalls?.length || 0;
212
+ delete clamped.responseToolCalls;
213
+ clamped.responseContent = `[${toolCallCount} tool call(s) and this step's content omitted — the transcript exceeded the ${MAX_PAYLOAD_CHARS} character cap.]`;
214
+ },
215
+ ];
216
+
217
+ for (const sacrifice of sacrifices) {
218
+ if (this.serializedLength(clamped) <= MAX_PAYLOAD_CHARS) {
219
+ break;
220
+ }
221
+
222
+ sacrifice();
223
+ isTruncated = true;
224
+ }
225
+
226
+ if (isTruncated) {
227
+ clamped.isTruncated = true;
228
+ }
229
+
230
+ return clamped;
231
+ }
232
+
233
+ private static serializedLength(payload: AIRunEventContentPayload): number {
234
+ try {
235
+ return JSON.stringify(payload).length;
236
+ } catch {
237
+ return Number.MAX_SAFE_INTEGER;
238
+ }
239
+ }
240
+ }
@@ -7,6 +7,7 @@ import { JSONObject } from "../../../../Types/JSON";
7
7
  import ObjectID from "../../../../Types/ObjectID";
8
8
  import AIChatMessageRole from "../../../../Types/AI/AIChatMessageRole";
9
9
  import AIChatMessageStatus from "../../../../Types/AI/AIChatMessageStatus";
10
+ import { AIChatPageContext } from "../../../../Types/AI/AIChatPageContext";
10
11
  import AIChatPermissionMode from "../../../../Types/AI/AIChatPermissionMode";
11
12
  import AIRunEventType from "../../../../Types/AI/AIRunEventType";
12
13
  import AIRunStatus from "../../../../Types/AI/AIRunStatus";
@@ -43,6 +44,13 @@ export interface ChatTurnRequest {
43
44
  llmProviderId?: ObjectID | undefined;
44
45
  // How much autonomy the agent has to run mutating tools in this conversation.
45
46
  permissionMode: AIChatPermissionMode;
47
+ /*
48
+ * What the user was looking at in the dashboard when they sent this message
49
+ * (already sanitized by the API). Folded into the system prompt so "this
50
+ * incident" resolves to the entity on screen. Per-turn: not persisted, and
51
+ * not needed on resume (the paused state already contains the built prompt).
52
+ */
53
+ pageContext?: AIChatPageContext | undefined;
46
54
  // The requesting user's real permission props, captured at request time.
47
55
  props: DatabaseCommonInteractionProps;
48
56
  }
@@ -891,6 +899,7 @@ export default class ChatAgentRunner {
891
899
  content: buildObservabilityChatSystemPrompt({
892
900
  currentTime: OneUptimeDate.getCurrentDate(),
893
901
  permissionMode: request.permissionMode,
902
+ pageContext: request.pageContext,
894
903
  }),
895
904
  },
896
905
  ];