@oneuptime/common 14.0.9 → 14.0.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.
- package/Models/DatabaseModels/AutoRemediationSuggestion.ts +60 -0
- package/Models/DatabaseModels/CephCluster.ts +213 -0
- package/Models/DatabaseModels/DatabaseServer.ts +213 -0
- package/Models/DatabaseModels/DockerHost.ts +213 -0
- package/Models/DatabaseModels/DockerSwarmCluster.ts +213 -0
- package/Models/DatabaseModels/GlobalConfig.ts +1 -1
- package/Models/DatabaseModels/Host.ts +213 -0
- package/Models/DatabaseModels/Index.ts +2 -0
- package/Models/DatabaseModels/PodmanHost.ts +213 -0
- package/Models/DatabaseModels/ProxmoxCluster.ts +213 -0
- package/Models/DatabaseModels/ResourceAiAgent.ts +419 -0
- package/Models/DatabaseModels/RunnerJob.ts +144 -0
- package/Models/DatabaseModels/VMwareVCenter.ts +213 -0
- package/Server/API/AutoRemediationAPI.ts +392 -1
- package/Server/API/ResourceAiAccessAPI.ts +1669 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1796300000000-AddResourceAiAgents.ts +423 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +2 -0
- package/Server/Infrastructure/Semaphore.ts +22 -0
- package/Server/Middleware/TelemetryIngest.ts +15 -5
- package/Server/Services/AnalyticsDatabaseService.ts +45 -1
- package/Server/Services/AutoRemediationRuleEngineService.ts +940 -112
- package/Server/Services/CephClusterService.ts +109 -1
- package/Server/Services/DatabaseServerService.ts +116 -1
- package/Server/Services/DockerHostService.ts +109 -1
- package/Server/Services/DockerSwarmClusterService.ts +113 -1
- package/Server/Services/HostService.ts +126 -4
- package/Server/Services/MetricRecordingRuleService.ts +47 -0
- package/Server/Services/PodmanHostService.ts +109 -1
- package/Server/Services/ProxmoxClusterService.ts +110 -1
- package/Server/Services/ResourceAiAccessService.ts +1439 -0
- package/Server/Services/ResourceAiAgentJobService.ts +202 -0
- package/Server/Services/ResourceAiAgentService.ts +2432 -0
- package/Server/Services/RunnerJobService.ts +611 -4
- package/Server/Services/TelemetryUsageBillingService.ts +28 -0
- package/Server/Services/TraceRecordingRuleService.ts +33 -0
- package/Server/Services/VMwareVCenterService.ts +110 -1
- package/Server/Utils/AI/Remediation/RemediationCommandTools.ts +1434 -32
- package/Server/Utils/AI/Remediation/RemediationExecutionRunner.ts +935 -21
- package/Server/Utils/AI/Remediation/RemediationPlanRunner.ts +25 -1
- package/Server/Utils/AI/ResourceAccess/InfrastructureInvestigationToolkit.ts +577 -0
- package/Server/Utils/AI/ResourceAccess/ResourceAccessContext.ts +271 -0
- package/Server/Utils/AI/ResourceAccess/ResourceAccessToolNames.ts +45 -0
- package/Server/Utils/AI/ResourceAccess/ResourceAiAccessSettings.ts +964 -0
- package/Server/Utils/AI/ResourceAccess/ResourceAiDeleteCleanup.ts +333 -0
- package/Server/Utils/AI/ResourceAccess/ResourceCommandJobRunner.ts +873 -0
- package/Server/Utils/AI/SRE/AIInvestigationEngine.ts +72 -2
- package/Server/Utils/AI/SRE/AlertInvestigationRunner.ts +72 -5
- package/Server/Utils/AI/SRE/IncidentInvestigationRunner.ts +72 -5
- package/Server/Utils/AutoRemediation/CommandPlanExecutor.ts +396 -13
- package/Server/Utils/AutoRemediation/RemediationVerifier.ts +35 -2
- package/Server/Utils/Database/ProjectScopedReferenceValidator.ts +9 -1
- package/Server/Utils/SessionReplay/SessionReplayBudgetMetrics.ts +920 -0
- package/Server/Utils/SessionReplay/SessionReplayUsage.ts +84 -6
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.ts +35 -15
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/AlertEpisode.ts +33 -15
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.ts +21 -1
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.ts +298 -224
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/IncidentEpisode.ts +35 -15
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.ts +389 -175
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +366 -143
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsActivityDeduplicator.ts +163 -0
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsCardChoices.ts +396 -0
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsCreateCommands.ts +418 -0
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsMessageSize.ts +152 -0
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsReplies.ts +251 -0
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsTimezone.ts +214 -0
- package/Tests/App/Dashboard/ClusterAccessNotice.test.tsx +93 -0
- package/Tests/App/Dashboard/DatabaseDocumentationMarkdown.test.ts +18 -6
- package/Tests/App/Dashboard/InvestigationInfrastructureTools.test.tsx +506 -0
- package/Tests/App/Dashboard/RemediationSuggestionCardDescription.test.tsx +209 -0
- package/Tests/App/Dashboard/RemediationSuggestionCardResource.test.tsx +317 -0
- package/Tests/App/Dashboard/ResourceAiAccessSettingsUtil.test.ts +921 -0
- package/Tests/App/Dashboard/ResourceAiAgentInstall.test.ts +860 -0
- package/Tests/App/Dashboard/ResourceAiAgentPage.test.tsx +1721 -0
- package/Tests/App/Dashboard/ResourceAiAgentStatus.test.ts +1002 -0
- package/Tests/App/Dashboard/ResourceAiInsightsPage.test.tsx +931 -0
- package/Tests/App/Dashboard/ResourceAiNavigation.test.tsx +575 -0
- package/Tests/App/Dashboard/RunbookStepTypeMaps.test.ts +38 -7
- package/Tests/Models/DatabaseModels/DatabaseServerModels.test.ts +33 -1
- package/Tests/Models/DatabaseModels/ResourceAiAccessColumns.test.ts +738 -0
- package/Tests/Models/DatabaseModels/ResourceAiAgentModel.test.ts +842 -0
- package/Tests/Server/API/AutoRemediationApproveResourceRound.test.ts +835 -0
- package/Tests/Server/API/ResourceAiAccessAPI.test.ts +2730 -0
- package/Tests/Server/Infrastructure/Postgres/AddDatabaseServerTablesMigration.test.ts +60 -0
- package/Tests/Server/Infrastructure/Postgres/AddResourceAiAgentsMigration.test.ts +659 -0
- package/Tests/Server/Infrastructure/SemaphoreMutex.test.ts +31 -0
- package/Tests/Server/Middleware/TelemetryIngestBrowserKey.test.ts +63 -5
- package/Tests/Server/Middleware/TelemetryIngestKubernetesAgentRunnerPinnedKey.test.ts +103 -5
- package/Tests/Server/Middleware/TelemetryIngestKubernetesAgentRunnerRateLimit.test.ts +19 -1
- package/Tests/Server/Services/AutoRemediationResourceRuleEngine.test.ts +1279 -0
- package/Tests/Server/Services/DatabaseServerService.test.ts +55 -0
- package/Tests/Server/Services/GroupTelemetryUsageExcludeNames.test.ts +299 -0
- package/Tests/Server/Services/HostServiceFindOrCreateMemo.test.ts +44 -0
- package/Tests/Server/Services/MonitorProbeServiceIntervalScheduling.test.ts +45 -6
- package/Tests/Server/Services/RecordingRuleReservedMetricName.test.ts +171 -0
- package/Tests/Server/Services/ResourceAiAccessChangeAuthorization.test.ts +256 -0
- package/Tests/Server/Services/ResourceAiAccessService.test.ts +1373 -0
- package/Tests/Server/Services/ResourceAiAgentJobService.test.ts +375 -0
- package/Tests/Server/Services/ResourceAiAgentServiceHelpers.test.ts +1114 -0
- package/Tests/Server/Services/ResourceAiAgentServiceLifecycle.test.ts +1050 -0
- package/Tests/Server/Services/ResourceAiAgentServiceRegister.test.ts +2251 -0
- package/Tests/Server/Services/ResourceAiSettingsCreate.test.ts +373 -0
- package/Tests/Server/Services/ResourceAiSettingsPermission.test.ts +1042 -0
- package/Tests/Server/Services/ResourceServiceDeleteCleansUpAi.test.ts +319 -0
- package/Tests/Server/Services/RunnerJobEnqueueKubectl.test.ts +105 -0
- package/Tests/Server/Services/RunnerJobEnqueueResourceCommand.test.ts +986 -0
- package/Tests/Server/Services/RunnerJobResourceCommandLane.test.ts +211 -0
- package/Tests/Server/Services/RunnerJobResourceCommandTimeoutAndRedaction.test.ts +352 -0
- package/Tests/Server/Services/TelemetryUsageBillingSloExclusion.test.ts +218 -0
- package/Tests/Server/TestingUtils/Services/FakeRunnerJobCount.ts +145 -0
- package/Tests/Server/Utils/AI/InvestigationInfrastructureAccessWiring.test.ts +453 -0
- package/Tests/Server/Utils/AI/InvestigationInfrastructureReport.test.ts +721 -0
- package/Tests/Server/Utils/AI/RemediationCommandTools.test.ts +94 -1
- package/Tests/Server/Utils/AI/RemediationCommandToolsResource.test.ts +1530 -0
- package/Tests/Server/Utils/AI/RemediationExecutionRunnerResourceMode.test.ts +1249 -0
- package/Tests/Server/Utils/AI/RemediationPlanRunner.test.ts +117 -0
- package/Tests/Server/Utils/AI/RemediationResourceCopyParity.test.ts +463 -0
- package/Tests/Server/Utils/AI/ResourceAccess/InfrastructureInvestigationToolkit.test.ts +722 -0
- package/Tests/Server/Utils/AI/ResourceAccess/ResourceAccessContext.test.ts +266 -0
- package/Tests/Server/Utils/AI/ResourceAccess/ResourceAiAccessSettings.test.ts +1220 -0
- package/Tests/Server/Utils/AI/ResourceAccess/ResourceAiDeleteCleanup.test.ts +569 -0
- package/Tests/Server/Utils/AI/ResourceAccess/ResourceCommandJobRunner.test.ts +830 -0
- package/Tests/Server/Utils/AutoRemediation/CommandPlanExecutorResource.test.ts +717 -0
- package/Tests/Server/Utils/AutoRemediation/RemediationVerifierResourceFollowUp.test.ts +338 -0
- package/Tests/Server/Utils/Monitor/Criteria/SessionReplayBudgetTemplateCriteria.test.ts +422 -0
- package/Tests/Server/Utils/SessionReplay/SessionReplayBudgetMetrics.test.ts +1647 -0
- package/Tests/Server/Utils/SessionReplay/SessionReplayUsage.test.ts +143 -1
- package/Tests/Server/Utils/Telemetry/TelemetryIngestionKeyGuard.test.ts +33 -3
- package/Tests/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsAccountNotLinked.test.ts +1093 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsActivityDeduplicator.test.ts +1049 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsCardChoices.test.ts +1676 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsCreateCards.test.ts +2884 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsCreateCommands.test.ts +2490 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsCreateSubmit.test.ts +2293 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsCreateSubmitServerTimezone.test.ts +386 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsMessageSize.test.ts +1477 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsReplies.test.ts +1967 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsStripHtmlTags.test.ts +92 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsSubmittedFormRemoval.test.ts +1819 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsTimezone.test.ts +1033 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsTimezoneServerZone.test.ts +610 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeamsBotMessageHandling.test.ts +2610 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeamsCreateCommandsEndToEnd.test.ts +4672 -0
- package/Tests/Server/Utils/Workspace/WorkspaceCreateProjectReferences.test.ts +190 -65
- package/Tests/Types/AutoRemediation/AiRemediationCommandPlan.test.ts +10 -4
- package/Tests/Types/AutoRemediation/AiRemediationCommandPlanResourceCommand.test.ts +305 -0
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationCatalog.test.ts +277 -13
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationUtil.test.ts +113 -0
- package/Tests/Types/Monitor/RumAlertTemplates.test.ts +773 -2
- package/Tests/Types/ResourceAiAgent/AiResourceType.test.ts +419 -0
- package/Tests/Types/ResourceAiAgent/ResourceAiAccess.test.ts +517 -0
- package/Tests/Types/Runbook/RunbookStepType.test.ts +147 -8
- package/Tests/UI/Rum/RecordingHealthDashboard.test.tsx +769 -1
- package/Tests/Utils/AiRemediation/Resource/CephCommandPolicy.test.ts +1653 -0
- package/Tests/Utils/AiRemediation/Resource/CephOutputRedaction.test.ts +204 -0
- package/Tests/Utils/AiRemediation/Resource/DatabaseCommandPolicy.test.ts +1077 -0
- package/Tests/Utils/AiRemediation/Resource/DatabaseDiagnosticCatalog.test.ts +558 -0
- package/Tests/Utils/AiRemediation/Resource/DatabaseQueryRedactor.test.ts +834 -0
- package/Tests/Utils/AiRemediation/Resource/DockerCliGrammar.test.ts +747 -0
- package/Tests/Utils/AiRemediation/Resource/DockerEngineCommandPolicy.test.ts +1259 -0
- package/Tests/Utils/AiRemediation/Resource/DockerOutputRedaction.test.ts +386 -0
- package/Tests/Utils/AiRemediation/Resource/DockerSwarmCommandPolicy.test.ts +782 -0
- package/Tests/Utils/AiRemediation/Resource/GovcCommandPolicy.test.ts +2259 -0
- package/Tests/Utils/AiRemediation/Resource/HostCommandPolicy.test.ts +2019 -0
- package/Tests/Utils/AiRemediation/Resource/ProxmoxCommandPolicy.test.ts +2497 -0
- package/Tests/Utils/AiRemediation/Resource/ResourceCommandPolicy.test.ts +1305 -0
- package/Tests/Utils/AiRemediation/Resource/ResourceCommandPolicyCore.test.ts +585 -0
- package/Tests/Utils/AiRemediation/Resource/ResourceOutputRedactor.test.ts +334 -0
- package/Tests/Utils/AiRemediation/Resource/ResourceOutputRedactorCopyParity.test.ts +98 -0
- package/Tests/Utils/AiRemediation/Resource/ResourcePolicyImportClosure.test.ts +391 -0
- package/Tests/Utils/AiRemediation/ResourceAiAgentPolicyCopyParity.test.ts +497 -0
- package/Tests/Utils/SessionReplay/SessionReplayBudgetMetricType.test.ts +383 -0
- package/Types/AI/ResourceAiAccessApi.ts +140 -0
- package/Types/AI/ResourceAiAccessPermissions.ts +126 -0
- package/Types/AutoRemediation/AiRemediationCommandPlan.ts +183 -2
- package/Types/Monitor/Recommendation/MonitorRecommendationCatalog.ts +55 -22
- package/Types/Monitor/Recommendation/MonitorRecommendationTypes.ts +35 -3
- package/Types/Monitor/RumAlertTemplates.ts +351 -4
- package/Types/ResourceAiAgent/AiResourceType.ts +310 -0
- package/Types/ResourceAiAgent/ResourceAiAccess.ts +574 -0
- package/Types/Rum/SessionReplayBudgetMetricType.ts +47 -0
- package/Types/Runbook/RunbookStepType.ts +29 -0
- package/Types/Telemetry/TelemetryIngestSurface.ts +14 -2
- package/Utils/AI/InvestigationReport.ts +121 -15
- package/Utils/AiRemediation/Resource/CephCommandPolicy.ts +1936 -0
- package/Utils/AiRemediation/Resource/DatabaseCommandPolicy.ts +166 -0
- package/Utils/AiRemediation/Resource/DatabaseDiagnosticCatalog.ts +1532 -0
- package/Utils/AiRemediation/Resource/DatabaseQueryRedactor.ts +1394 -0
- package/Utils/AiRemediation/Resource/DockerCliGrammar.ts +1839 -0
- package/Utils/AiRemediation/Resource/DockerEngineCommandPolicy.ts +490 -0
- package/Utils/AiRemediation/Resource/DockerSwarmCommandPolicy.ts +687 -0
- package/Utils/AiRemediation/Resource/GovcCommandPolicy.ts +2096 -0
- package/Utils/AiRemediation/Resource/HostCommandPolicy.ts +2982 -0
- package/Utils/AiRemediation/Resource/ProxmoxCommandPolicy.ts +1679 -0
- package/Utils/AiRemediation/Resource/ResourceCommandPolicy.ts +851 -0
- package/Utils/AiRemediation/Resource/ResourceCommandPolicyCore.ts +593 -0
- package/Utils/AiRemediation/Resource/ResourceOutputRedactor.ts +2812 -0
- package/Utils/SessionReplay/SessionReplayBudgetMetricType.ts +184 -0
- package/build/dist/Models/DatabaseModels/AutoRemediationSuggestion.js +62 -0
- package/build/dist/Models/DatabaseModels/AutoRemediationSuggestion.js.map +1 -1
- package/build/dist/Models/DatabaseModels/CephCluster.js +219 -0
- package/build/dist/Models/DatabaseModels/CephCluster.js.map +1 -1
- package/build/dist/Models/DatabaseModels/DatabaseServer.js +219 -0
- package/build/dist/Models/DatabaseModels/DatabaseServer.js.map +1 -1
- package/build/dist/Models/DatabaseModels/DockerHost.js +219 -0
- package/build/dist/Models/DatabaseModels/DockerHost.js.map +1 -1
- package/build/dist/Models/DatabaseModels/DockerSwarmCluster.js +219 -0
- package/build/dist/Models/DatabaseModels/DockerSwarmCluster.js.map +1 -1
- package/build/dist/Models/DatabaseModels/GlobalConfig.js +1 -1
- package/build/dist/Models/DatabaseModels/GlobalConfig.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Host.js +219 -0
- package/build/dist/Models/DatabaseModels/Host.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +2 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/PodmanHost.js +219 -0
- package/build/dist/Models/DatabaseModels/PodmanHost.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ProxmoxCluster.js +219 -0
- package/build/dist/Models/DatabaseModels/ProxmoxCluster.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ResourceAiAgent.js +439 -0
- package/build/dist/Models/DatabaseModels/ResourceAiAgent.js.map +1 -0
- package/build/dist/Models/DatabaseModels/RunnerJob.js +145 -0
- package/build/dist/Models/DatabaseModels/RunnerJob.js.map +1 -1
- package/build/dist/Models/DatabaseModels/VMwareVCenter.js +219 -0
- package/build/dist/Models/DatabaseModels/VMwareVCenter.js.map +1 -1
- package/build/dist/Server/API/AutoRemediationAPI.js +231 -1
- package/build/dist/Server/API/AutoRemediationAPI.js.map +1 -1
- package/build/dist/Server/API/ResourceAiAccessAPI.js +1119 -0
- package/build/dist/Server/API/ResourceAiAccessAPI.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1796300000000-AddResourceAiAgents.js +168 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1796300000000-AddResourceAiAgents.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +2 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Infrastructure/Semaphore.js +6 -0
- package/build/dist/Server/Infrastructure/Semaphore.js.map +1 -1
- package/build/dist/Server/Middleware/TelemetryIngest.js +12 -5
- package/build/dist/Server/Middleware/TelemetryIngest.js.map +1 -1
- package/build/dist/Server/Services/AnalyticsDatabaseService.js +26 -1
- package/build/dist/Server/Services/AnalyticsDatabaseService.js.map +1 -1
- package/build/dist/Server/Services/AutoRemediationRuleEngineService.js +601 -3
- package/build/dist/Server/Services/AutoRemediationRuleEngineService.js.map +1 -1
- package/build/dist/Server/Services/CephClusterService.js +104 -0
- package/build/dist/Server/Services/CephClusterService.js.map +1 -1
- package/build/dist/Server/Services/DatabaseServerService.js +99 -0
- package/build/dist/Server/Services/DatabaseServerService.js.map +1 -1
- package/build/dist/Server/Services/DockerHostService.js +104 -0
- package/build/dist/Server/Services/DockerHostService.js.map +1 -1
- package/build/dist/Server/Services/DockerSwarmClusterService.js +104 -0
- package/build/dist/Server/Services/DockerSwarmClusterService.js.map +1 -1
- package/build/dist/Server/Services/HostService.js +114 -2
- package/build/dist/Server/Services/HostService.js.map +1 -1
- package/build/dist/Server/Services/MetricRecordingRuleService.js +46 -0
- package/build/dist/Server/Services/MetricRecordingRuleService.js.map +1 -1
- package/build/dist/Server/Services/PodmanHostService.js +104 -0
- package/build/dist/Server/Services/PodmanHostService.js.map +1 -1
- package/build/dist/Server/Services/ProxmoxClusterService.js +104 -0
- package/build/dist/Server/Services/ProxmoxClusterService.js.map +1 -1
- package/build/dist/Server/Services/ResourceAiAccessService.js +1028 -0
- package/build/dist/Server/Services/ResourceAiAccessService.js.map +1 -0
- package/build/dist/Server/Services/ResourceAiAgentJobService.js +173 -0
- package/build/dist/Server/Services/ResourceAiAgentJobService.js.map +1 -0
- package/build/dist/Server/Services/ResourceAiAgentService.js +1687 -0
- package/build/dist/Server/Services/ResourceAiAgentService.js.map +1 -0
- package/build/dist/Server/Services/RunnerJobService.js +344 -5
- package/build/dist/Server/Services/RunnerJobService.js.map +1 -1
- package/build/dist/Server/Services/TelemetryUsageBillingService.js +26 -0
- package/build/dist/Server/Services/TelemetryUsageBillingService.js.map +1 -1
- package/build/dist/Server/Services/TraceRecordingRuleService.js +37 -0
- package/build/dist/Server/Services/TraceRecordingRuleService.js.map +1 -1
- package/build/dist/Server/Services/VMwareVCenterService.js +104 -0
- package/build/dist/Server/Services/VMwareVCenterService.js.map +1 -1
- package/build/dist/Server/Utils/AI/Remediation/RemediationCommandTools.js +1029 -30
- package/build/dist/Server/Utils/AI/Remediation/RemediationCommandTools.js.map +1 -1
- package/build/dist/Server/Utils/AI/Remediation/RemediationExecutionRunner.js +633 -28
- package/build/dist/Server/Utils/AI/Remediation/RemediationExecutionRunner.js.map +1 -1
- package/build/dist/Server/Utils/AI/Remediation/RemediationPlanRunner.js +21 -1
- package/build/dist/Server/Utils/AI/Remediation/RemediationPlanRunner.js.map +1 -1
- package/build/dist/Server/Utils/AI/ResourceAccess/InfrastructureInvestigationToolkit.js +330 -0
- package/build/dist/Server/Utils/AI/ResourceAccess/InfrastructureInvestigationToolkit.js.map +1 -0
- package/build/dist/Server/Utils/AI/ResourceAccess/ResourceAccessContext.js +160 -0
- package/build/dist/Server/Utils/AI/ResourceAccess/ResourceAccessContext.js.map +1 -0
- package/build/dist/Server/Utils/AI/ResourceAccess/ResourceAccessToolNames.js +33 -0
- package/build/dist/Server/Utils/AI/ResourceAccess/ResourceAccessToolNames.js.map +1 -0
- package/build/dist/Server/Utils/AI/ResourceAccess/ResourceAiAccessSettings.js +640 -0
- package/build/dist/Server/Utils/AI/ResourceAccess/ResourceAiAccessSettings.js.map +1 -0
- package/build/dist/Server/Utils/AI/ResourceAccess/ResourceAiDeleteCleanup.js +226 -0
- package/build/dist/Server/Utils/AI/ResourceAccess/ResourceAiDeleteCleanup.js.map +1 -0
- package/build/dist/Server/Utils/AI/ResourceAccess/ResourceCommandJobRunner.js +600 -0
- package/build/dist/Server/Utils/AI/ResourceAccess/ResourceCommandJobRunner.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/AIInvestigationEngine.js +50 -4
- package/build/dist/Server/Utils/AI/SRE/AIInvestigationEngine.js.map +1 -1
- package/build/dist/Server/Utils/AI/SRE/AlertInvestigationRunner.js +55 -4
- package/build/dist/Server/Utils/AI/SRE/AlertInvestigationRunner.js.map +1 -1
- package/build/dist/Server/Utils/AI/SRE/IncidentInvestigationRunner.js +55 -4
- package/build/dist/Server/Utils/AI/SRE/IncidentInvestigationRunner.js.map +1 -1
- package/build/dist/Server/Utils/AutoRemediation/CommandPlanExecutor.js +290 -13
- package/build/dist/Server/Utils/AutoRemediation/CommandPlanExecutor.js.map +1 -1
- package/build/dist/Server/Utils/AutoRemediation/RemediationVerifier.js +29 -1
- package/build/dist/Server/Utils/AutoRemediation/RemediationVerifier.js.map +1 -1
- package/build/dist/Server/Utils/Database/ProjectScopedReferenceValidator.js +9 -1
- package/build/dist/Server/Utils/Database/ProjectScopedReferenceValidator.js.map +1 -1
- package/build/dist/Server/Utils/SessionReplay/SessionReplayBudgetMetrics.js +627 -0
- package/build/dist/Server/Utils/SessionReplay/SessionReplayBudgetMetrics.js.map +1 -0
- package/build/dist/Server/Utils/SessionReplay/SessionReplayUsage.js +60 -5
- package/build/dist/Server/Utils/SessionReplay/SessionReplayUsage.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.js +19 -15
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/AlertEpisode.js +19 -15
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/AlertEpisode.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.js +17 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.js +183 -209
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/IncidentEpisode.js +19 -15
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/IncidentEpisode.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.js +233 -167
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +263 -110
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsActivityDeduplicator.js +129 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsActivityDeduplicator.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsCardChoices.js +266 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsCardChoices.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsCreateCommands.js +258 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsCreateCommands.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsMessageSize.js +104 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsMessageSize.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsReplies.js +183 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsReplies.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsTimezone.js +123 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsTimezone.js.map +1 -0
- package/build/dist/Types/AI/ResourceAiAccessApi.js +30 -0
- package/build/dist/Types/AI/ResourceAiAccessApi.js.map +1 -0
- package/build/dist/Types/AI/ResourceAiAccessPermissions.js +98 -0
- package/build/dist/Types/AI/ResourceAiAccessPermissions.js.map +1 -0
- package/build/dist/Types/AutoRemediation/AiRemediationCommandPlan.js +116 -29
- package/build/dist/Types/AutoRemediation/AiRemediationCommandPlan.js.map +1 -1
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js +47 -21
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js.map +1 -1
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationTypes.js +5 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationTypes.js.map +1 -1
- package/build/dist/Types/Monitor/RumAlertTemplates.js +199 -3
- package/build/dist/Types/Monitor/RumAlertTemplates.js.map +1 -1
- package/build/dist/Types/ResourceAiAgent/AiResourceType.js +242 -0
- package/build/dist/Types/ResourceAiAgent/AiResourceType.js.map +1 -0
- package/build/dist/Types/ResourceAiAgent/ResourceAiAccess.js +275 -0
- package/build/dist/Types/ResourceAiAgent/ResourceAiAccess.js.map +1 -0
- package/build/dist/Types/Rum/SessionReplayBudgetMetricType.js +45 -0
- package/build/dist/Types/Rum/SessionReplayBudgetMetricType.js.map +1 -0
- package/build/dist/Types/Runbook/RunbookStepType.js +27 -0
- package/build/dist/Types/Runbook/RunbookStepType.js.map +1 -1
- package/build/dist/Types/Telemetry/TelemetryIngestSurface.js +13 -2
- package/build/dist/Types/Telemetry/TelemetryIngestSurface.js.map +1 -1
- package/build/dist/Utils/AI/InvestigationReport.js +71 -11
- package/build/dist/Utils/AI/InvestigationReport.js.map +1 -1
- package/build/dist/Utils/AiRemediation/Resource/CephCommandPolicy.js +1462 -0
- package/build/dist/Utils/AiRemediation/Resource/CephCommandPolicy.js.map +1 -0
- package/build/dist/Utils/AiRemediation/Resource/DatabaseCommandPolicy.js +122 -0
- package/build/dist/Utils/AiRemediation/Resource/DatabaseCommandPolicy.js.map +1 -0
- package/build/dist/Utils/AiRemediation/Resource/DatabaseDiagnosticCatalog.js +1139 -0
- package/build/dist/Utils/AiRemediation/Resource/DatabaseDiagnosticCatalog.js.map +1 -0
- package/build/dist/Utils/AiRemediation/Resource/DatabaseQueryRedactor.js +1060 -0
- package/build/dist/Utils/AiRemediation/Resource/DatabaseQueryRedactor.js.map +1 -0
- package/build/dist/Utils/AiRemediation/Resource/DockerCliGrammar.js +1301 -0
- package/build/dist/Utils/AiRemediation/Resource/DockerCliGrammar.js.map +1 -0
- package/build/dist/Utils/AiRemediation/Resource/DockerEngineCommandPolicy.js +370 -0
- package/build/dist/Utils/AiRemediation/Resource/DockerEngineCommandPolicy.js.map +1 -0
- package/build/dist/Utils/AiRemediation/Resource/DockerSwarmCommandPolicy.js +498 -0
- package/build/dist/Utils/AiRemediation/Resource/DockerSwarmCommandPolicy.js.map +1 -0
- package/build/dist/Utils/AiRemediation/Resource/GovcCommandPolicy.js +1565 -0
- package/build/dist/Utils/AiRemediation/Resource/GovcCommandPolicy.js.map +1 -0
- package/build/dist/Utils/AiRemediation/Resource/HostCommandPolicy.js +2206 -0
- package/build/dist/Utils/AiRemediation/Resource/HostCommandPolicy.js.map +1 -0
- package/build/dist/Utils/AiRemediation/Resource/ProxmoxCommandPolicy.js +1129 -0
- package/build/dist/Utils/AiRemediation/Resource/ProxmoxCommandPolicy.js.map +1 -0
- package/build/dist/Utils/AiRemediation/Resource/ResourceCommandPolicy.js +565 -0
- package/build/dist/Utils/AiRemediation/Resource/ResourceCommandPolicy.js.map +1 -0
- package/build/dist/Utils/AiRemediation/Resource/ResourceCommandPolicyCore.js +408 -0
- package/build/dist/Utils/AiRemediation/Resource/ResourceCommandPolicyCore.js.map +1 -0
- package/build/dist/Utils/AiRemediation/Resource/ResourceOutputRedactor.js +1910 -0
- package/build/dist/Utils/AiRemediation/Resource/ResourceOutputRedactor.js.map +1 -0
- package/build/dist/Utils/SessionReplay/SessionReplayBudgetMetricType.js +160 -0
- package/build/dist/Utils/SessionReplay/SessionReplayBudgetMetricType.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* OneUptime AI access to an infrastructure resource through its resource AI
|
|
3
|
+
* agent: the command tiers and remediation modes, the agent's posture, the
|
|
4
|
+
* access status the dashboard and the AI runs read, the agent <-> server
|
|
5
|
+
* wire protocol and the shared caps.
|
|
6
|
+
*
|
|
7
|
+
* The tier and mode enums carry exactly the string values of the Kubernetes
|
|
8
|
+
* ones (KubectlCommandTier, KubernetesAiRemediationMode — a Common test
|
|
9
|
+
* asserts it), so stored strings are interchangeable and every prompt,
|
|
10
|
+
* card and ladder that reads a tier or a mode means the same thing for a
|
|
11
|
+
* cluster and for any other resource.
|
|
12
|
+
*
|
|
13
|
+
* Imports only ./AiResourceType on purpose: the resource AI agent
|
|
14
|
+
* (agents/ResourceAIAgent) carries a byte-identical copy of this directory
|
|
15
|
+
* and must compile without the rest of Common.
|
|
16
|
+
*/
|
|
17
|
+
import { isAiResourceType } from "./AiResourceType";
|
|
18
|
+
/*
|
|
19
|
+
* The tier the resource command policy assigns to one command. Tiers are the
|
|
20
|
+
* whole safety model: what a run may execute is a function of (tier, mode),
|
|
21
|
+
* never of prose in a prompt.
|
|
22
|
+
*
|
|
23
|
+
* Read: inspects the resource and changes nothing (docker ps, pvesh
|
|
24
|
+
* get, govc vm.info, ceph health, systemctl status, ...).
|
|
25
|
+
* Investigations only ever run these.
|
|
26
|
+
* SafeWrite: a reversible change to exactly ONE named object (restart one
|
|
27
|
+
* container, start one VM, restart one unit, ...). Automatic mode
|
|
28
|
+
* runs these without a human.
|
|
29
|
+
* RiskyWrite: a change that can take something down or alter what runs
|
|
30
|
+
* (stop, kill, update, migrate, ...). Needs a human unless the
|
|
31
|
+
* operator allowlisted the exact shape on the resource or the
|
|
32
|
+
* resource bypasses approvals.
|
|
33
|
+
* Denied: never runs, even with human approval (exec, run, rm, prune,
|
|
34
|
+
* anything reading credentials, anything the policy does not
|
|
35
|
+
* know).
|
|
36
|
+
*/
|
|
37
|
+
export var ResourceCommandTier;
|
|
38
|
+
(function (ResourceCommandTier) {
|
|
39
|
+
ResourceCommandTier["Read"] = "Read";
|
|
40
|
+
ResourceCommandTier["SafeWrite"] = "SafeWrite";
|
|
41
|
+
ResourceCommandTier["RiskyWrite"] = "RiskyWrite";
|
|
42
|
+
ResourceCommandTier["Denied"] = "Denied";
|
|
43
|
+
})(ResourceCommandTier || (ResourceCommandTier = {}));
|
|
44
|
+
/*
|
|
45
|
+
* How OneUptime AI may change a resource once it has diagnosed a signal —
|
|
46
|
+
* the same four modes a Kubernetes cluster has.
|
|
47
|
+
*
|
|
48
|
+
* Disabled: AI never proposes or runs a change on this resource.
|
|
49
|
+
* RequireApproval: AI composes a command plan and a human approves it with
|
|
50
|
+
* one click before anything runs.
|
|
51
|
+
* Automatic: safe changes (SafeWrite) run without a human; a riskier
|
|
52
|
+
* change is proposed for approval unless the resource's
|
|
53
|
+
* allowlist names its exact shape.
|
|
54
|
+
* BypassApproval: every change the policy allows — safe AND riskier — runs
|
|
55
|
+
* on its own, except what always needs a human.
|
|
56
|
+
*
|
|
57
|
+
* In EVERY mode: Denied commands never run, commands the policy marks
|
|
58
|
+
* requiresHuman always ask, and the agent itself refuses every write unless
|
|
59
|
+
* it was started with RESOURCE_AI_ALLOW_WRITES_ENV=true (and then only on
|
|
60
|
+
* the targets RESOURCE_AI_WRITE_TARGETS_ENV allows, never its protected
|
|
61
|
+
* targets).
|
|
62
|
+
*/
|
|
63
|
+
export var ResourceAiRemediationMode;
|
|
64
|
+
(function (ResourceAiRemediationMode) {
|
|
65
|
+
ResourceAiRemediationMode["Disabled"] = "Disabled";
|
|
66
|
+
ResourceAiRemediationMode["RequireApproval"] = "RequireApproval";
|
|
67
|
+
ResourceAiRemediationMode["Automatic"] = "Automatic";
|
|
68
|
+
ResourceAiRemediationMode["BypassApproval"] = "BypassApproval";
|
|
69
|
+
})(ResourceAiRemediationMode || (ResourceAiRemediationMode = {}));
|
|
70
|
+
// The modes in which OneUptime AI executes changes without a human.
|
|
71
|
+
export const UNATTENDED_RESOURCE_REMEDIATION_MODES = [
|
|
72
|
+
ResourceAiRemediationMode.Automatic,
|
|
73
|
+
ResourceAiRemediationMode.BypassApproval,
|
|
74
|
+
];
|
|
75
|
+
export function isUnattendedResourceRemediationMode(mode) {
|
|
76
|
+
return (mode !== undefined &&
|
|
77
|
+
mode !== null &&
|
|
78
|
+
UNATTENDED_RESOURCE_REMEDIATION_MODES.includes(mode));
|
|
79
|
+
}
|
|
80
|
+
/*
|
|
81
|
+
* A stored or submitted mode, exactly as spelled. Anything unknown is
|
|
82
|
+
* Disabled: a value this build cannot read must never widen what AI may do.
|
|
83
|
+
*/
|
|
84
|
+
export function parseResourceAiRemediationMode(value) {
|
|
85
|
+
if (typeof value === "string" &&
|
|
86
|
+
Object.values(ResourceAiRemediationMode).includes(value)) {
|
|
87
|
+
return value;
|
|
88
|
+
}
|
|
89
|
+
return ResourceAiRemediationMode.Disabled;
|
|
90
|
+
}
|
|
91
|
+
// The agent heartbeats every 30 seconds; it counts as online this long after.
|
|
92
|
+
export const RESOURCE_AI_AGENT_ALIVE_WINDOW_IN_MINUTES = 5;
|
|
93
|
+
// Every agent route (register, heartbeat, claim-next-job, ...) lives under it.
|
|
94
|
+
export const RESOURCE_AI_AGENT_INGEST_PATH = "/resource-ai-agent-ingest";
|
|
95
|
+
export const RESOURCE_AI_AGENT_IMAGE_REPOSITORY = "oneuptime/resource-ai-agent";
|
|
96
|
+
// The Kubernetes AI agent uses 3876; both can run on one host.
|
|
97
|
+
export const RESOURCE_AI_AGENT_DEFAULT_HEALTH_PORT = 3877;
|
|
98
|
+
/*
|
|
99
|
+
* Environment the resource AI agent reads. The single source of truth: the
|
|
100
|
+
* agent's Config imports these from its copy of this file, and the install
|
|
101
|
+
* docs are pinned against them.
|
|
102
|
+
*
|
|
103
|
+
* RESOURCE_TYPE: which resource the agent serves (an agentAlias or an enum
|
|
104
|
+
* value, read with parseAiResourceType).
|
|
105
|
+
* RESOURCE_NAME: overrides the identity otherwise read from the type's
|
|
106
|
+
* identityEnvVars (the collector's own variables).
|
|
107
|
+
* ALLOW_WRITES: "true" lets the agent run writes at all. Anything else —
|
|
108
|
+
* unset included — keeps it read-only, whatever the dashboard
|
|
109
|
+
* says.
|
|
110
|
+
* WRITE_TARGETS: comma-separated globs of the targets (container, service,
|
|
111
|
+
* VM, unit, ... names) a write may touch. Empty or unset means
|
|
112
|
+
* any target except the agent's protected ones.
|
|
113
|
+
* API_KEY: the first non-empty of these authenticates registration
|
|
114
|
+
* (the collectors already set one of them).
|
|
115
|
+
*/
|
|
116
|
+
export const RESOURCE_AI_AGENT_RESOURCE_TYPE_ENV = "ONEUPTIME_AI_AGENT_RESOURCE_TYPE";
|
|
117
|
+
export const RESOURCE_AI_AGENT_RESOURCE_NAME_ENV = "ONEUPTIME_AI_AGENT_RESOURCE_NAME";
|
|
118
|
+
export const RESOURCE_AI_ALLOW_WRITES_ENV = "ONEUPTIME_AI_ALLOW_WRITES";
|
|
119
|
+
export const RESOURCE_AI_WRITE_TARGETS_ENV = "ONEUPTIME_AI_WRITE_TARGETS";
|
|
120
|
+
export const RESOURCE_AI_AGENT_API_KEY_ENVS = [
|
|
121
|
+
"ONEUPTIME_API_KEY",
|
|
122
|
+
"ONEUPTIME_TELEMETRY_INGESTION_KEY",
|
|
123
|
+
"ONEUPTIME_SERVICE_TOKEN",
|
|
124
|
+
];
|
|
125
|
+
// Bounds parseResourceAiAgentPosture holds every posture to.
|
|
126
|
+
export const MAX_POSTURE_LIST_ENTRIES = 64;
|
|
127
|
+
export const MAX_POSTURE_STRING_LENGTH = 256;
|
|
128
|
+
// Keys that would reach an object's prototype if assigned.
|
|
129
|
+
const UNSAFE_OBJECT_KEYS = [
|
|
130
|
+
"__proto__",
|
|
131
|
+
"constructor",
|
|
132
|
+
"prototype",
|
|
133
|
+
];
|
|
134
|
+
// A display-only string: kept (trimmed, capped) when it is one, else null.
|
|
135
|
+
function readDisplayString(value) {
|
|
136
|
+
if (typeof value !== "string") {
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
const trimmed = value.trim();
|
|
140
|
+
if (!trimmed) {
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
return trimmed.slice(0, MAX_POSTURE_STRING_LENGTH);
|
|
144
|
+
}
|
|
145
|
+
/*
|
|
146
|
+
* A list the write scope depends on. Absent reads as []; anything else must
|
|
147
|
+
* be an array of at most MAX_POSTURE_LIST_ENTRIES non-empty strings of at
|
|
148
|
+
* most MAX_POSTURE_STRING_LENGTH characters. A list that breaks the rules is
|
|
149
|
+
* reported as malformed (never partially trusted): dropping one entry of a
|
|
150
|
+
* protected list, or one of an allowlist, would change what a write may
|
|
151
|
+
* touch.
|
|
152
|
+
*/
|
|
153
|
+
function readTargetList(value) {
|
|
154
|
+
if (value === undefined || value === null) {
|
|
155
|
+
return { list: [], malformed: false };
|
|
156
|
+
}
|
|
157
|
+
if (!Array.isArray(value) || value.length > MAX_POSTURE_LIST_ENTRIES) {
|
|
158
|
+
return { list: [], malformed: true };
|
|
159
|
+
}
|
|
160
|
+
const list = [];
|
|
161
|
+
for (const entry of value) {
|
|
162
|
+
if (typeof entry !== "string") {
|
|
163
|
+
return { list: [], malformed: true };
|
|
164
|
+
}
|
|
165
|
+
const trimmed = entry.trim();
|
|
166
|
+
if (!trimmed || trimmed.length > MAX_POSTURE_STRING_LENGTH) {
|
|
167
|
+
return { list: [], malformed: true };
|
|
168
|
+
}
|
|
169
|
+
if (!list.includes(trimmed)) {
|
|
170
|
+
list.push(trimmed);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return { list, malformed: false };
|
|
174
|
+
}
|
|
175
|
+
function readDetails(value) {
|
|
176
|
+
const details = {};
|
|
177
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
178
|
+
return details;
|
|
179
|
+
}
|
|
180
|
+
let count = 0;
|
|
181
|
+
for (const key of Object.keys(value)) {
|
|
182
|
+
if (count >= MAX_POSTURE_LIST_ENTRIES) {
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
if (!key ||
|
|
186
|
+
key.length > MAX_POSTURE_STRING_LENGTH ||
|
|
187
|
+
UNSAFE_OBJECT_KEYS.includes(key)) {
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
const entry = value[key];
|
|
191
|
+
if (typeof entry === "string") {
|
|
192
|
+
details[key] = entry.slice(0, MAX_POSTURE_STRING_LENGTH);
|
|
193
|
+
}
|
|
194
|
+
else if (typeof entry === "number" && Number.isFinite(entry)) {
|
|
195
|
+
details[key] = entry;
|
|
196
|
+
}
|
|
197
|
+
else if (typeof entry === "boolean" || entry === null) {
|
|
198
|
+
details[key] = entry;
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
count++;
|
|
204
|
+
}
|
|
205
|
+
return details;
|
|
206
|
+
}
|
|
207
|
+
/*
|
|
208
|
+
* Read a posture from an agent's request body or the ResourceAiAgent.posture
|
|
209
|
+
* column. Strict and fail-closed:
|
|
210
|
+
* - null unless resourceType is exactly an AiResourceType value and
|
|
211
|
+
* resourceIdentifier a non-empty string of at most 256 characters;
|
|
212
|
+
* - allowWrites is true only for the boolean true;
|
|
213
|
+
* - a malformed writeTargets or protectedTargets list (not an array of
|
|
214
|
+
* non-empty strings, over 64 entries, an entry over 256 characters)
|
|
215
|
+
* forces allowWrites to false rather than being partly trusted;
|
|
216
|
+
* - display strings are trimmed and capped at 256 characters, details keep
|
|
217
|
+
* only scalar values (at most 64 of them), and reportedAt only a
|
|
218
|
+
* parseable date.
|
|
219
|
+
*/
|
|
220
|
+
export function parseResourceAiAgentPosture(value) {
|
|
221
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
222
|
+
return null;
|
|
223
|
+
}
|
|
224
|
+
const raw = value;
|
|
225
|
+
const resourceType = raw["resourceType"];
|
|
226
|
+
if (!isAiResourceType(resourceType)) {
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
const identifierRaw = raw["resourceIdentifier"];
|
|
230
|
+
if (typeof identifierRaw !== "string") {
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
const resourceIdentifier = identifierRaw.trim();
|
|
234
|
+
if (!resourceIdentifier ||
|
|
235
|
+
resourceIdentifier.length > MAX_POSTURE_STRING_LENGTH) {
|
|
236
|
+
return null;
|
|
237
|
+
}
|
|
238
|
+
const writeTargets = readTargetList(raw["writeTargets"]);
|
|
239
|
+
const protectedTargets = readTargetList(raw["protectedTargets"]);
|
|
240
|
+
const posture = {
|
|
241
|
+
resourceType,
|
|
242
|
+
resourceIdentifier,
|
|
243
|
+
agentVersion: readDisplayString(raw["agentVersion"]),
|
|
244
|
+
allowWrites: raw["allowWrites"] === true &&
|
|
245
|
+
!writeTargets.malformed &&
|
|
246
|
+
!protectedTargets.malformed,
|
|
247
|
+
allowWritesSetting: readDisplayString(raw["allowWritesSetting"]),
|
|
248
|
+
writeTargets: writeTargets.list,
|
|
249
|
+
protectedTargets: protectedTargets.list,
|
|
250
|
+
toolVersion: readDisplayString(raw["toolVersion"]),
|
|
251
|
+
reachable: raw["reachable"] === true,
|
|
252
|
+
reachError: readDisplayString(raw["reachError"]),
|
|
253
|
+
details: readDetails(raw["details"]),
|
|
254
|
+
};
|
|
255
|
+
const reportedAt = raw["reportedAt"];
|
|
256
|
+
if (typeof reportedAt === "string" &&
|
|
257
|
+
reportedAt.length <= 64 &&
|
|
258
|
+
!Number.isNaN(Date.parse(reportedAt))) {
|
|
259
|
+
posture.reportedAt = reportedAt;
|
|
260
|
+
}
|
|
261
|
+
return posture;
|
|
262
|
+
}
|
|
263
|
+
// The refusals that clear without anyone doing anything; retrying is right.
|
|
264
|
+
export const TRANSIENT_RESOURCE_AI_AGENT_REGISTRATION_REFUSALS = ["previous_instance_online"];
|
|
265
|
+
export function isTransientResourceAiAgentRegistrationRefusal(reason) {
|
|
266
|
+
return (typeof reason === "string" &&
|
|
267
|
+
TRANSIENT_RESOURCE_AI_AGENT_REGISTRATION_REFUSALS.includes(reason));
|
|
268
|
+
}
|
|
269
|
+
// Caps shared by the investigation tool, the remediation toolkit and the agent.
|
|
270
|
+
export const MAX_RESOURCE_COMMANDS_PER_INVESTIGATION = 8;
|
|
271
|
+
export const DEFAULT_RESOURCE_COMMAND_TIMEOUT_MS = 30 * 1000;
|
|
272
|
+
export const MAX_RESOURCE_COMMAND_TIMEOUT_MS = 2 * 60 * 1000;
|
|
273
|
+
export const MAX_RESOURCE_COMMAND_OUTPUT_CHARS_FOR_LLM = 8000;
|
|
274
|
+
export const MAX_RESOURCE_AGENT_OUTPUT_BYTES = 50 * 1024;
|
|
275
|
+
//# sourceMappingURL=ResourceAiAccess.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceAiAccess.js","sourceRoot":"","sources":["../../../../Types/ResourceAiAgent/ResourceAiAccess.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAuB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAN,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC7B,oCAAa,CAAA;IACb,8CAAuB,CAAA;IACvB,gDAAyB,CAAA;IACzB,wCAAiB,CAAA;AACnB,CAAC,EALW,mBAAmB,KAAnB,mBAAmB,QAK9B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAN,IAAY,yBAKX;AALD,WAAY,yBAAyB;IACnC,kDAAqB,CAAA;IACrB,gEAAmC,CAAA;IACnC,oDAAuB,CAAA;IACvB,8DAAiC,CAAA;AACnC,CAAC,EALW,yBAAyB,KAAzB,yBAAyB,QAKpC;AAED,oEAAoE;AACpE,MAA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AAI,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Metric names the session replay budget sweep posts every five minutes
|
|
3
|
+
* (Common/Server/Utils/SessionReplay/SessionReplayBudgetMetrics.ts), so the
|
|
4
|
+
* two storage budgets on the Replay Health page can be charted and alerted on
|
|
5
|
+
* like any other metric - the same way monitors post `oneuptime.monitor.*`
|
|
6
|
+
* and SLOs post `oneuptime.slo.*`. Without them a spent budget was only ever
|
|
7
|
+
* visible to someone looking at the Health page: recorders are told to stop,
|
|
8
|
+
* quietly, and recordings simply stop appearing.
|
|
9
|
+
*
|
|
10
|
+
* The values are stored verbatim as metric names in ClickHouse. Renaming one
|
|
11
|
+
* orphans every point already written under the old name and silences every
|
|
12
|
+
* monitor watching it, so treat them as a public, append-only contract.
|
|
13
|
+
*
|
|
14
|
+
* Every row is keyed to a RUM application (primaryEntityId = its id, type
|
|
15
|
+
* RealUserMonitor), which is what lets a monitor scoped to that application
|
|
16
|
+
* see it. The project series carry only a `projectId` attribute: the daily
|
|
17
|
+
* limit belongs to the project, and the same value is posted under each
|
|
18
|
+
* application that records, so nothing about the row may read as that
|
|
19
|
+
* application's own usage. The application series also carry
|
|
20
|
+
* `rumApplicationId` and `rumApplicationName`.
|
|
21
|
+
*/
|
|
22
|
+
var SessionReplayBudgetMetricType;
|
|
23
|
+
(function (SessionReplayBudgetMetricType) {
|
|
24
|
+
/*
|
|
25
|
+
* Replay upload bytes the gate has charged since 00:00 UTC, for the whole
|
|
26
|
+
* project (every application together). Unit "By".
|
|
27
|
+
*/
|
|
28
|
+
SessionReplayBudgetMetricType["ProjectDailyUsedBytes"] = "oneuptime.rum.session.replay.budget.project.daily.used.bytes";
|
|
29
|
+
/*
|
|
30
|
+
* The above as a percent of the deployment's daily limit, rounded down to
|
|
31
|
+
* 0.01 so ">= 100" means exactly what the gate means by "spent". Not
|
|
32
|
+
* capped: the request that crosses the limit stays charged. Unit "%".
|
|
33
|
+
*/
|
|
34
|
+
SessionReplayBudgetMetricType["ProjectDailyUsedPercent"] = "oneuptime.rum.session.replay.budget.project.daily.used.percent";
|
|
35
|
+
/*
|
|
36
|
+
* Replay upload bytes charged to one application's monthly budget since the
|
|
37
|
+
* 1st (UTC). Only counted, and only posted, while the application has a
|
|
38
|
+
* monthly budget. Unit "By".
|
|
39
|
+
*/
|
|
40
|
+
SessionReplayBudgetMetricType["ApplicationMonthlyUsedBytes"] = "oneuptime.rum.session.replay.budget.application.monthly.used.bytes";
|
|
41
|
+
// The above as a percent of the application's monthly budget. Unit "%".
|
|
42
|
+
SessionReplayBudgetMetricType["ApplicationMonthlyUsedPercent"] = "oneuptime.rum.session.replay.budget.application.monthly.used.percent";
|
|
43
|
+
})(SessionReplayBudgetMetricType || (SessionReplayBudgetMetricType = {}));
|
|
44
|
+
export default SessionReplayBudgetMetricType;
|
|
45
|
+
//# sourceMappingURL=SessionReplayBudgetMetricType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SessionReplayBudgetMetricType.js","sourceRoot":"","sources":["../../../../Types/Rum/SessionReplayBudgetMetricType.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,IAAK,6BAuBJ;AAvBD,WAAK,6BAA6B;IAChC;;;OAGG;IACH,uHAAsF,CAAA;IAEtF;;;;OAIG;IACH,2HAA0F,CAAA;IAE1F;;;;OAIG;IACH,mIAAkG,CAAA;IAElG,wEAAwE;IACxE,uIAAsG,CAAA;AACxG,CAAC,EAvBI,6BAA6B,KAA7B,6BAA6B,QAuBjC;AAED,eAAe,6BAA6B,CAAC"}
|
|
@@ -15,6 +15,15 @@ var RunbookStepType;
|
|
|
15
15
|
* commands, remediations run policy-tiered writes); not authored in runbooks.
|
|
16
16
|
*/
|
|
17
17
|
RunbookStepType["Kubectl"] = "Kubectl";
|
|
18
|
+
/*
|
|
19
|
+
* A single command for an infrastructure resource's AI agent (Docker,
|
|
20
|
+
* Podman, Docker Swarm, Proxmox, VMware, Ceph, a database server or a
|
|
21
|
+
* host), dispatched as an argv (never a shell line) to that resource's
|
|
22
|
+
* online ResourceAiAgent — never claimed by a Runner, never run by the
|
|
23
|
+
* Worker. Composed only by OneUptime AI and tiered by the resource command
|
|
24
|
+
* policy (Utils/AiRemediation/Resource); not authored in runbooks.
|
|
25
|
+
*/
|
|
26
|
+
RunbookStepType["ResourceCommand"] = "ResourceCommand";
|
|
18
27
|
})(RunbookStepType || (RunbookStepType = {}));
|
|
19
28
|
export default RunbookStepType;
|
|
20
29
|
/*
|
|
@@ -62,4 +71,22 @@ export const PAYLOAD_CARRYING_STEP_TYPES = [
|
|
|
62
71
|
export function isPayloadCarryingStepType(type) {
|
|
63
72
|
return PAYLOAD_CARRYING_STEP_TYPES.includes(type);
|
|
64
73
|
}
|
|
74
|
+
/*
|
|
75
|
+
* Step types executed by an infrastructure resource's AI agent (a
|
|
76
|
+
* ResourceAiAgent row), a third lane beside the Runner and the Worker. Such
|
|
77
|
+
* a job is written with targetResourceAiAgentId and no targetAgentId, so no
|
|
78
|
+
* Runner can claim it: RunnerJobService.enqueue refuses these types (they
|
|
79
|
+
* are not in RUNNER_EXECUTED_STEP_TYPES), a Runner may not ask for them on a
|
|
80
|
+
* claim, and the Worker's step switch has no case for them.
|
|
81
|
+
*
|
|
82
|
+
* Deliberately NOT in PAYLOAD_CARRYING_STEP_TYPES, which is the payload half
|
|
83
|
+
* of the Runner lane (a test asserts the two Runner halves are
|
|
84
|
+
* complementary); these jobs still carry their argv in RunnerJob.payload.
|
|
85
|
+
*/
|
|
86
|
+
export const AI_AGENT_EXECUTED_STEP_TYPES = [
|
|
87
|
+
RunbookStepType.ResourceCommand,
|
|
88
|
+
];
|
|
89
|
+
export function isAiAgentExecutedStepType(type) {
|
|
90
|
+
return AI_AGENT_EXECUTED_STEP_TYPES.includes(type);
|
|
91
|
+
}
|
|
65
92
|
//# sourceMappingURL=RunbookStepType.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RunbookStepType.js","sourceRoot":"","sources":["../../../../Types/Runbook/RunbookStepType.ts"],"names":[],"mappings":"AAAA,IAAK,
|
|
1
|
+
{"version":3,"file":"RunbookStepType.js","sourceRoot":"","sources":["../../../../Types/Runbook/RunbookStepType.ts"],"names":[],"mappings":"AAAA,IAAK,eAyBJ;AAzBD,WAAK,eAAe;IAClB,oCAAiB,CAAA;IACjB,4CAAyB,CAAA;IACzB,8CAA2B,CAAA;IAC3B,gCAAa,CAAA;IACb,4BAAS,CAAA;IACT,8BAAW,CAAA;IACX,4CAAyB,CAAA;IACzB;;;;;;OAMG;IACH,sCAAmB,CAAA;IACnB;;;;;;;OAOG;IACH,sDAAmC,CAAA;AACrC,CAAC,EAzBI,eAAe,KAAf,eAAe,QAyBnB;AAED,eAAe,eAAe,CAAC;AAE/B;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAA2B;IAChE,eAAe,CAAC,UAAU;IAC1B,eAAe,CAAC,IAAI;IACpB,eAAe,CAAC,GAAG;IACnB,eAAe,CAAC,UAAU;IAC1B,eAAe,CAAC,OAAO;CACxB,CAAC;AAEF,MAAM,UAAU,wBAAwB,CAAC,IAAqB;IAC5D,OAAO,0BAA0B,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACnD,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAA2B;IACjE,eAAe,CAAC,GAAG;IACnB,eAAe,CAAC,UAAU;IAC1B,eAAe,CAAC,OAAO;CACxB,CAAC;AAEF,MAAM,UAAU,yBAAyB,CAAC,IAAqB;IAC7D,OAAO,2BAA2B,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACpD,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAA2B;IAClE,eAAe,CAAC,eAAe;CAChC,CAAC;AAEF,MAAM,UAAU,yBAAyB,CAAC,IAAqB;IAC7D,OAAO,4BAA4B,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -42,10 +42,19 @@ var TelemetryIngestSurface;
|
|
|
42
42
|
* with. Server keys only, for the same reason as the Runner above.
|
|
43
43
|
*/
|
|
44
44
|
TelemetryIngestSurface["KubernetesAiAgent"] = "kubernetes-ai-agent";
|
|
45
|
+
/*
|
|
46
|
+
* A resource AI agent (Docker, Podman, Docker Swarm, Proxmox, VMware,
|
|
47
|
+
* Ceph, a database server or a host) registers itself with the same
|
|
48
|
+
* project ingestion key its collector uses, and receives an agent key
|
|
49
|
+
* that every command for its resource is claimed with. Server keys only,
|
|
50
|
+
* for the same reason as the two above.
|
|
51
|
+
*/
|
|
52
|
+
TelemetryIngestSurface["ResourceAiAgent"] = "resource-ai-agent";
|
|
45
53
|
})(TelemetryIngestSurface || (TelemetryIngestSurface = {}));
|
|
46
54
|
/*
|
|
47
|
-
* Surfaces that mint an IDENTITY (a key that kubectl jobs for a cluster
|
|
48
|
-
*
|
|
55
|
+
* Surfaces that mint an IDENTITY (a key that kubectl jobs for a cluster, or
|
|
56
|
+
* commands for another infrastructure resource, are targeted at) rather
|
|
57
|
+
* than accept telemetry. The ingest middleware holds
|
|
49
58
|
* every one of them to the same two extra rules, keyed on this set so a new
|
|
50
59
|
* identity surface cannot quietly miss one:
|
|
51
60
|
*
|
|
@@ -59,6 +68,7 @@ var TelemetryIngestSurface;
|
|
|
59
68
|
export const IDENTITY_REGISTRATION_SURFACES = new Set([
|
|
60
69
|
TelemetryIngestSurface.KubernetesAgentRunner,
|
|
61
70
|
TelemetryIngestSurface.KubernetesAiAgent,
|
|
71
|
+
TelemetryIngestSurface.ResourceAiAgent,
|
|
62
72
|
]);
|
|
63
73
|
/*
|
|
64
74
|
* The only surfaces a Browser key may write to. This is an ALLOWLIST, not a
|
|
@@ -103,6 +113,7 @@ const INGEST_SURFACE_READABLE_NAMES = {
|
|
|
103
113
|
[TelemetryIngestSurface.Mqtt]: "MQTT ingest",
|
|
104
114
|
[TelemetryIngestSurface.KubernetesAgentRunner]: "Kubernetes agent Runner registration",
|
|
105
115
|
[TelemetryIngestSurface.KubernetesAiAgent]: "Kubernetes AI agent registration",
|
|
116
|
+
[TelemetryIngestSurface.ResourceAiAgent]: "infrastructure AI agent registration",
|
|
106
117
|
};
|
|
107
118
|
export const getIngestSurfaceReadableName = (surface) => {
|
|
108
119
|
/*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TelemetryIngestSurface.js","sourceRoot":"","sources":["../../../../Types/Telemetry/TelemetryIngestSurface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,IAAK,
|
|
1
|
+
{"version":3,"file":"TelemetryIngestSurface.js","sourceRoot":"","sources":["../../../../Types/Telemetry/TelemetryIngestSurface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,IAAK,sBAqCJ;AArCD,WAAK,sBAAsB;IACzB,oDAA0B,CAAA;IAC1B,gDAAsB,CAAA;IACtB,sDAA4B,CAAA;IAC5B,wDAA8B,CAAA;IAC9B,0DAAgC,CAAA;IAChC,kDAAwB,CAAA;IACxB,2CAAiB,CAAA;IACjB,2CAAiB,CAAA;IACjB,iDAAuB,CAAA;IACvB,4DAAkC,CAAA;IAClC,wDAA8B,CAAA;IAC9B,4DAAkC,CAAA;IAClC,uCAAa,CAAA;IACb,uCAAa,CAAA;IACb;;;;;OAKG;IACH,2EAAiD,CAAA;IACjD;;;;;OAKG;IACH,mEAAyC,CAAA;IACzC;;;;;;OAMG;IACH,+DAAqC,CAAA;AACvC,CAAC,EArCI,sBAAsB,KAAtB,sBAAsB,QAqC1B;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,8BAA8B,GACzC,IAAI,GAAG,CAAyB;IAC9B,sBAAsB,CAAC,qBAAqB;IAC5C,sBAAsB,CAAC,iBAAiB;IACxC,sBAAsB,CAAC,eAAe;CACvC,CAAC,CAAC;AAEL;;;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;IAC1C;;;;;OAKG;IACH,MAAM,YAAY,GAChB,6BAA6B,CAAC,OAAO,CAAC,CAAC;IAEzC,OAAO,YAAY,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;AACzC,CAAC,CAAC;AAEJ,eAAe,sBAAsB,CAAC"}
|
|
@@ -99,16 +99,20 @@ const LEADING_WHITESPACE_REGEX = /^[ \t]/;
|
|
|
99
99
|
* "- **[C1]** label — 7 row(s)", or a cluster tool's line, which says what
|
|
100
100
|
* the call did instead of counting rows: "— succeeded", "— kubectl returned
|
|
101
101
|
* an error", "— 2 cluster(s)" (and "— never ran" / "— result unknown" for a
|
|
102
|
-
* kubectl command that gave no result).
|
|
103
|
-
*
|
|
102
|
+
* kubectl command that gave no result). An infrastructure tool's line says
|
|
103
|
+
* "— succeeded", "— command returned an error" or "— 3 resource(s)". The
|
|
104
|
+
* label is greedy so a label that itself contains " — " keeps everything
|
|
105
|
+
* up to the LAST " — <outcome>".
|
|
104
106
|
*/
|
|
105
|
-
const EVIDENCE_CHECKED_ENTRY_REGEX = /^[ \t]*(?:[-*+]|\d{1,3}[.)])[ \t]+(?:\*\*|__)?\[(C\d{1,3})\](?:\*\*|__)?(.+)[ \t][—–-][ \t]+(\d+[ \t]+(?:rows?|clusters?)(?:\(s\))?|succeeded|kubectl[ \t]+returned[ \t]+an[ \t]+error|never[ \t]+ran|did[ \t]+not[ \t]+run|(?:kubectl[ \t]+)?result[ \t]+unknown|unknown)[ \t]*$/i;
|
|
107
|
+
const EVIDENCE_CHECKED_ENTRY_REGEX = /^[ \t]*(?:[-*+]|\d{1,3}[.)])[ \t]+(?:\*\*|__)?\[(C\d{1,3})\](?:\*\*|__)?(.+)[ \t][—–-][ \t]+(\d+[ \t]+(?:rows?|clusters?|resources?)(?:\(s\))?|succeeded|kubectl[ \t]+returned[ \t]+an[ \t]+error|command[ \t]+returned[ \t]+an[ \t]+error|never[ \t]+ran|did[ \t]+not[ \t]+run|(?:kubectl[ \t]+)?result[ \t]+unknown|unknown)[ \t]*$/i;
|
|
106
108
|
// The entry regex backtracks over the label; never feed it a runaway line.
|
|
107
109
|
const MAX_EVIDENCE_CHECKED_LINE_LENGTH = 2000;
|
|
108
110
|
// How one entry's outcome (group 3 of the entry regex) reads.
|
|
109
111
|
const EVIDENCE_ROWS_OUTCOME_REGEX = /^(\d+)[ \t]+rows?(?:\(s\))?$/i;
|
|
110
112
|
const EVIDENCE_CLUSTERS_OUTCOME_REGEX = /^(\d+)[ \t]+clusters?(?:\(s\))?$/i;
|
|
111
113
|
const EVIDENCE_KUBECTL_SUCCEEDED_REGEX = /^succeeded$/i;
|
|
114
|
+
const EVIDENCE_RESOURCES_OUTCOME_REGEX = /^(\d+)[ \t]+resources?(?:\(s\))?$/i;
|
|
115
|
+
const EVIDENCE_INFRASTRUCTURE_ERROR_REGEX = /^command[ \t]+returned[ \t]+an[ \t]+error$/i;
|
|
112
116
|
const FOOTER_EMPHASIS_REGEX = /^(\*\*|__|\*|_)([\s\S]+)\1$/;
|
|
113
117
|
const FOOTER_USING_REGEX = /\busing[ \t]+/;
|
|
114
118
|
const FOOTER_QUERIES_RUN_REGEX = /\bquer(?:y|ies)[ \t]+run\b/i;
|
|
@@ -116,6 +120,15 @@ const FOOTER_QUERIES_RUN_REGEX = /\bquer(?:y|ies)[ \t]+run\b/i;
|
|
|
116
120
|
const FOOTER_KUBECTL_COMMANDS_RUN_REGEX = /\b(\d{1,9})[ \t]+kubectl[ \t]+commands?[ \t]+run\b/i;
|
|
117
121
|
// A run that used cluster tools but cited no query and no kubectl command.
|
|
118
122
|
const FOOTER_NOTHING_RUN_REGEX = /\bno[ \t]+telemetry[ \t]+queries[ \t]+or[ \t]+kubectl[ \t]+commands[ \t]+run\b/i;
|
|
123
|
+
// "... and 3 infrastructure commands run on your infrastructure" -> 3.
|
|
124
|
+
const FOOTER_INFRASTRUCTURE_COMMANDS_RUN_REGEX = /\b(\d{1,9})[ \t]+infrastructure[ \t]+commands?[ \t]+run\b/i;
|
|
125
|
+
/*
|
|
126
|
+
* A run that used the infrastructure tools (and maybe the cluster ones) but
|
|
127
|
+
* cited no query and no command: "no telemetry queries or infrastructure
|
|
128
|
+
* commands run", "no telemetry queries, kubectl commands or infrastructure
|
|
129
|
+
* commands run".
|
|
130
|
+
*/
|
|
131
|
+
const FOOTER_NOTHING_RUN_WITH_INFRASTRUCTURE_REGEX = /\bno[ \t]+telemetry[ \t]+queries(,[ \t]+kubectl[ \t]+commands)?[ \t]+or[ \t]+infrastructure[ \t]+commands[ \t]+run\b/i;
|
|
119
132
|
const DIGIT_REGEX = /\d/;
|
|
120
133
|
const EVENT_REFERENCE_PATTERN = "#(\\d{1,9})(?!\\w)";
|
|
121
134
|
const WORD_CHARACTER_REGEX = /\w/;
|
|
@@ -588,20 +601,33 @@ function findFooter(lines, fenced) {
|
|
|
588
601
|
footer.modelName = modelName;
|
|
589
602
|
}
|
|
590
603
|
const nothingRun = FOOTER_NOTHING_RUN_REGEX.test(text);
|
|
591
|
-
const
|
|
592
|
-
|
|
593
|
-
: readFooterQueryCount(text);
|
|
604
|
+
const nothingRunWithInfrastructure = FOOTER_NOTHING_RUN_WITH_INFRASTRUCTURE_REGEX.exec(text);
|
|
605
|
+
const queryCount = nothingRun || nothingRunWithInfrastructure ? 0 : readFooterQueryCount(text);
|
|
594
606
|
if (queryCount !== undefined) {
|
|
595
607
|
footer.queryCount = queryCount;
|
|
596
608
|
}
|
|
597
|
-
const kubectlCommandCount = nothingRun
|
|
609
|
+
const kubectlCommandCount = nothingRun || (nothingRunWithInfrastructure === null || nothingRunWithInfrastructure === void 0 ? void 0 : nothingRunWithInfrastructure[1])
|
|
598
610
|
? 0
|
|
599
611
|
: readFooterKubectlCommandCount(text);
|
|
600
612
|
if (kubectlCommandCount !== undefined) {
|
|
601
613
|
footer.kubectlCommandCount = kubectlCommandCount;
|
|
602
614
|
}
|
|
615
|
+
const infrastructureCommandCount = nothingRunWithInfrastructure
|
|
616
|
+
? 0
|
|
617
|
+
: readFooterInfrastructureCommandCount(text);
|
|
618
|
+
if (infrastructureCommandCount !== undefined) {
|
|
619
|
+
footer.infrastructureCommandCount = infrastructureCommandCount;
|
|
620
|
+
}
|
|
603
621
|
return { breakIndex, footer };
|
|
604
622
|
}
|
|
623
|
+
/*
|
|
624
|
+
* "... and 3 infrastructure commands run on ..." / "1 infrastructure
|
|
625
|
+
* command run" -> 3 / 1.
|
|
626
|
+
*/
|
|
627
|
+
function readFooterInfrastructureCommandCount(text) {
|
|
628
|
+
const commands = FOOTER_INFRASTRUCTURE_COMMANDS_RUN_REGEX.exec(text);
|
|
629
|
+
return commands ? parseInt(commands[1] || "0", 10) : undefined;
|
|
630
|
+
}
|
|
605
631
|
// "... and 2 kubectl commands run on ..." / "1 kubectl command run" -> 2 / 1.
|
|
606
632
|
function readFooterKubectlCommandCount(text) {
|
|
607
633
|
const commands = FOOTER_KUBECTL_COMMANDS_RUN_REGEX.exec(text);
|
|
@@ -698,6 +724,18 @@ function readEvidenceCheckedOutcome(outcomeText) {
|
|
|
698
724
|
outcome,
|
|
699
725
|
};
|
|
700
726
|
}
|
|
727
|
+
const resources = EVIDENCE_RESOURCES_OUTCOME_REGEX.exec(outcome);
|
|
728
|
+
if (resources) {
|
|
729
|
+
return {
|
|
730
|
+
kind: "resources",
|
|
731
|
+
rowCount: parseInt(resources[1] || "0", 10),
|
|
732
|
+
outcome,
|
|
733
|
+
};
|
|
734
|
+
}
|
|
735
|
+
// An infrastructure command that ran and returned an error counts as 0.
|
|
736
|
+
if (EVIDENCE_INFRASTRUCTURE_ERROR_REGEX.test(outcome)) {
|
|
737
|
+
return { kind: "infrastructure", rowCount: 0, outcome };
|
|
738
|
+
}
|
|
701
739
|
/*
|
|
702
740
|
* The engine counts a kubectl command that succeeded as 1 and one that
|
|
703
741
|
* returned an error as 0; a command with no result has nothing to count.
|
|
@@ -750,15 +788,25 @@ function parseEvidenceCheckedEntries(lines) {
|
|
|
750
788
|
* the one run whose only citations are listings. A footer saying "0
|
|
751
789
|
* queries run" never goes with a block. Without a readable count (no
|
|
752
790
|
* footer, an older format) the block is trusted.
|
|
791
|
+
*
|
|
792
|
+
* Infrastructure commands follow the same rule against the footer's
|
|
793
|
+
* infrastructure count, and a resource listing like a cluster listing. A
|
|
794
|
+
* line the two command tools share ("succeeded") fits their counts
|
|
795
|
+
* together; a footer that says nothing about infrastructure reads as 0 of
|
|
796
|
+
* them, so every older report is judged exactly as it was.
|
|
753
797
|
*/
|
|
754
798
|
function isServerEvidenceCheckedBlock(entries, footer) {
|
|
755
799
|
const queryCount = footer === null || footer === void 0 ? void 0 : footer.queryCount;
|
|
756
800
|
const kubectlCommandCount = footer === null || footer === void 0 ? void 0 : footer.kubectlCommandCount;
|
|
757
|
-
|
|
801
|
+
const infrastructureCommandCount = footer === null || footer === void 0 ? void 0 : footer.infrastructureCommandCount;
|
|
802
|
+
if (queryCount === undefined &&
|
|
803
|
+
kubectlCommandCount === undefined &&
|
|
804
|
+
infrastructureCommandCount === undefined) {
|
|
758
805
|
return true;
|
|
759
806
|
}
|
|
760
807
|
let queryLines = 0;
|
|
761
808
|
let kubectlLines = 0;
|
|
809
|
+
let infrastructureLines = 0;
|
|
762
810
|
let clusterLines = 0;
|
|
763
811
|
for (const parsed of entries) {
|
|
764
812
|
if (parsed.kind === "query") {
|
|
@@ -767,6 +815,9 @@ function isServerEvidenceCheckedBlock(entries, footer) {
|
|
|
767
815
|
else if (parsed.kind === "kubectl") {
|
|
768
816
|
kubectlLines++;
|
|
769
817
|
}
|
|
818
|
+
else if (parsed.kind === "infrastructure") {
|
|
819
|
+
infrastructureLines++;
|
|
820
|
+
}
|
|
770
821
|
else {
|
|
771
822
|
clusterLines++;
|
|
772
823
|
}
|
|
@@ -774,13 +825,22 @@ function isServerEvidenceCheckedBlock(entries, footer) {
|
|
|
774
825
|
if (queryLines > (queryCount !== null && queryCount !== void 0 ? queryCount : 0)) {
|
|
775
826
|
return false;
|
|
776
827
|
}
|
|
777
|
-
if (
|
|
828
|
+
if (infrastructureLines > (infrastructureCommandCount !== null && infrastructureCommandCount !== void 0 ? infrastructureCommandCount : 0)) {
|
|
829
|
+
return false;
|
|
830
|
+
}
|
|
831
|
+
if (kubectlLines + infrastructureLines >
|
|
832
|
+
(kubectlCommandCount !== null && kubectlCommandCount !== void 0 ? kubectlCommandCount : 0) + (infrastructureCommandCount !== null && infrastructureCommandCount !== void 0 ? infrastructureCommandCount : 0)) {
|
|
778
833
|
return false;
|
|
779
834
|
}
|
|
780
|
-
if ((queryCount !== null && queryCount !== void 0 ? queryCount : 0) +
|
|
835
|
+
if ((queryCount !== null && queryCount !== void 0 ? queryCount : 0) +
|
|
836
|
+
(kubectlCommandCount !== null && kubectlCommandCount !== void 0 ? kubectlCommandCount : 0) +
|
|
837
|
+
(infrastructureCommandCount !== null && infrastructureCommandCount !== void 0 ? infrastructureCommandCount : 0) >
|
|
838
|
+
0) {
|
|
781
839
|
return true;
|
|
782
840
|
}
|
|
783
|
-
return kubectlCommandCount !== undefined
|
|
841
|
+
return ((kubectlCommandCount !== undefined ||
|
|
842
|
+
infrastructureCommandCount !== undefined) &&
|
|
843
|
+
clusterLines > 0);
|
|
784
844
|
}
|
|
785
845
|
function createEmptyReport() {
|
|
786
846
|
return {
|