@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,419 @@
|
|
|
1
|
+
import AiResourceType, {
|
|
2
|
+
AI_RESOURCE_TYPE_INFO,
|
|
3
|
+
ALL_AI_RESOURCE_TYPES,
|
|
4
|
+
AiResourceTypeInfo,
|
|
5
|
+
getAiResourceTypeInfo,
|
|
6
|
+
isAiResourceType,
|
|
7
|
+
isDefaultIdentityPlaceholder,
|
|
8
|
+
parseAiResourceType,
|
|
9
|
+
} from "../../../Types/ResourceAiAgent/AiResourceType";
|
|
10
|
+
import { describe, expect, test } from "@jest/globals";
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* Contract under test — the closed list of infrastructure resources a
|
|
14
|
+
* resource AI agent serves, and what each one's agent runs.
|
|
15
|
+
*
|
|
16
|
+
* The enum values are stored (ResourceAiAgent.resourceType, RunnerJob and
|
|
17
|
+
* suggestion rows, job payloads), so they are pinned member by member. The
|
|
18
|
+
* order of ALL_AI_RESOURCE_TYPES is the remediation priority order. The info
|
|
19
|
+
* table is what every other unit reads: display names, the agent alias an
|
|
20
|
+
* operator sets, the programs a command may start with, the "Test
|
|
21
|
+
* connection" commands, the collector identity variables and their default
|
|
22
|
+
* placeholders.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
describe("AiResourceType enum", () => {
|
|
26
|
+
test("has exactly the eight resource types, each value equal to its name", () => {
|
|
27
|
+
expect(Object.values(AiResourceType)).toEqual([
|
|
28
|
+
"DockerHost",
|
|
29
|
+
"PodmanHost",
|
|
30
|
+
"DockerSwarmCluster",
|
|
31
|
+
"ProxmoxCluster",
|
|
32
|
+
"VMwareVCenter",
|
|
33
|
+
"CephCluster",
|
|
34
|
+
"DatabaseServer",
|
|
35
|
+
"Host",
|
|
36
|
+
]);
|
|
37
|
+
|
|
38
|
+
for (const [name, value] of Object.entries(AiResourceType)) {
|
|
39
|
+
expect(value).toBe(name);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
test("ALL_AI_RESOURCE_TYPES lists every member once, in declaration (priority) order", () => {
|
|
44
|
+
expect(ALL_AI_RESOURCE_TYPES).toEqual([
|
|
45
|
+
AiResourceType.DockerHost,
|
|
46
|
+
AiResourceType.PodmanHost,
|
|
47
|
+
AiResourceType.DockerSwarmCluster,
|
|
48
|
+
AiResourceType.ProxmoxCluster,
|
|
49
|
+
AiResourceType.VMwareVCenter,
|
|
50
|
+
AiResourceType.CephCluster,
|
|
51
|
+
AiResourceType.DatabaseServer,
|
|
52
|
+
AiResourceType.Host,
|
|
53
|
+
]);
|
|
54
|
+
expect(new Set(ALL_AI_RESOURCE_TYPES).size).toBe(
|
|
55
|
+
ALL_AI_RESOURCE_TYPES.length,
|
|
56
|
+
);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
test("Kubernetes is not a resource type — clusters keep their own agent", () => {
|
|
60
|
+
expect(ALL_AI_RESOURCE_TYPES as ReadonlyArray<string>).not.toContain(
|
|
61
|
+
"KubernetesCluster",
|
|
62
|
+
);
|
|
63
|
+
expect(parseAiResourceType("kubernetes")).toBeNull();
|
|
64
|
+
expect(parseAiResourceType("KubernetesCluster")).toBeNull();
|
|
65
|
+
expect(parseAiResourceType("k8s")).toBeNull();
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
describe("isAiResourceType", () => {
|
|
70
|
+
test.each(
|
|
71
|
+
ALL_AI_RESOURCE_TYPES.map((type: AiResourceType) => {
|
|
72
|
+
return [type];
|
|
73
|
+
}),
|
|
74
|
+
)("%s is a resource type", (type: AiResourceType) => {
|
|
75
|
+
expect(isAiResourceType(type)).toBe(true);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
test.each([
|
|
79
|
+
["dockerhost"],
|
|
80
|
+
["DOCKERHOST"],
|
|
81
|
+
[" DockerHost"],
|
|
82
|
+
["DockerHost "],
|
|
83
|
+
["docker"],
|
|
84
|
+
[""],
|
|
85
|
+
[null],
|
|
86
|
+
[undefined],
|
|
87
|
+
[42],
|
|
88
|
+
[{}],
|
|
89
|
+
[["DockerHost"]],
|
|
90
|
+
])("%p is not exactly a stored value", (value: unknown) => {
|
|
91
|
+
// A stored row must hold the enum value itself; aliases are for config.
|
|
92
|
+
expect(isAiResourceType(value)).toBe(false);
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
describe("parseAiResourceType", () => {
|
|
97
|
+
test.each(
|
|
98
|
+
ALL_AI_RESOURCE_TYPES.map((type: AiResourceType) => {
|
|
99
|
+
return [type];
|
|
100
|
+
}),
|
|
101
|
+
)("reads the enum value %s in any case", (type: AiResourceType) => {
|
|
102
|
+
expect(parseAiResourceType(type)).toBe(type);
|
|
103
|
+
expect(parseAiResourceType(type.toLowerCase())).toBe(type);
|
|
104
|
+
expect(parseAiResourceType(type.toUpperCase())).toBe(type);
|
|
105
|
+
expect(parseAiResourceType(` ${type}\t`)).toBe(type);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
test.each([
|
|
109
|
+
["docker", AiResourceType.DockerHost],
|
|
110
|
+
["podman", AiResourceType.PodmanHost],
|
|
111
|
+
["docker-swarm", AiResourceType.DockerSwarmCluster],
|
|
112
|
+
["swarm", AiResourceType.DockerSwarmCluster],
|
|
113
|
+
["docker_swarm", AiResourceType.DockerSwarmCluster],
|
|
114
|
+
["proxmox", AiResourceType.ProxmoxCluster],
|
|
115
|
+
["vmware", AiResourceType.VMwareVCenter],
|
|
116
|
+
["vcenter", AiResourceType.VMwareVCenter],
|
|
117
|
+
["ceph", AiResourceType.CephCluster],
|
|
118
|
+
["database", AiResourceType.DatabaseServer],
|
|
119
|
+
["db", AiResourceType.DatabaseServer],
|
|
120
|
+
["host", AiResourceType.Host],
|
|
121
|
+
["DOCKER", AiResourceType.DockerHost],
|
|
122
|
+
[" Docker-Swarm ", AiResourceType.DockerSwarmCluster],
|
|
123
|
+
["VCenter", AiResourceType.VMwareVCenter],
|
|
124
|
+
])(
|
|
125
|
+
"reads the agent alias %p as %s",
|
|
126
|
+
(alias: string, expected: AiResourceType) => {
|
|
127
|
+
expect(parseAiResourceType(alias)).toBe(expected);
|
|
128
|
+
},
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
test("every agentAlias in the info table parses back to its own type", () => {
|
|
132
|
+
for (const type of ALL_AI_RESOURCE_TYPES) {
|
|
133
|
+
expect(parseAiResourceType(AI_RESOURCE_TYPE_INFO[type].agentAlias)).toBe(
|
|
134
|
+
type,
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
test.each([
|
|
140
|
+
[""],
|
|
141
|
+
[" "],
|
|
142
|
+
["dockers"],
|
|
143
|
+
["docker host"],
|
|
144
|
+
["docker-host"],
|
|
145
|
+
["podman-host"],
|
|
146
|
+
["mysql"],
|
|
147
|
+
["postgres"],
|
|
148
|
+
["server"],
|
|
149
|
+
["vm"],
|
|
150
|
+
["__proto__"],
|
|
151
|
+
["constructor"],
|
|
152
|
+
["toString"],
|
|
153
|
+
[null],
|
|
154
|
+
[undefined],
|
|
155
|
+
[1],
|
|
156
|
+
[true],
|
|
157
|
+
[{}],
|
|
158
|
+
[["docker"]],
|
|
159
|
+
])("refuses %p rather than guessing", (value: unknown) => {
|
|
160
|
+
expect(parseAiResourceType(value)).toBeNull();
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
describe("AI_RESOURCE_TYPE_INFO", () => {
|
|
165
|
+
test("has one entry per type, each naming its own type", () => {
|
|
166
|
+
expect(Object.keys(AI_RESOURCE_TYPE_INFO).sort()).toEqual(
|
|
167
|
+
[...ALL_AI_RESOURCE_TYPES].sort(),
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
for (const type of ALL_AI_RESOURCE_TYPES) {
|
|
171
|
+
expect(AI_RESOURCE_TYPE_INFO[type].type).toBe(type);
|
|
172
|
+
expect(getAiResourceTypeInfo(type)).toBe(AI_RESOURCE_TYPE_INFO[type]);
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
test("pins the display names, agent names and aliases", () => {
|
|
177
|
+
const rows: Array<[string, string, string]> = ALL_AI_RESOURCE_TYPES.map(
|
|
178
|
+
(type: AiResourceType): [string, string, string] => {
|
|
179
|
+
const info: AiResourceTypeInfo = AI_RESOURCE_TYPE_INFO[type];
|
|
180
|
+
return [info.displayName, info.agentDisplayName, info.agentAlias];
|
|
181
|
+
},
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
expect(rows).toEqual([
|
|
185
|
+
["Docker host", "Docker AI agent", "docker"],
|
|
186
|
+
["Podman host", "Podman AI agent", "podman"],
|
|
187
|
+
["Docker Swarm cluster", "Docker Swarm AI agent", "docker-swarm"],
|
|
188
|
+
["Proxmox cluster", "Proxmox AI agent", "proxmox"],
|
|
189
|
+
["VMware vCenter", "VMware AI agent", "vmware"],
|
|
190
|
+
["Ceph cluster", "Ceph AI agent", "ceph"],
|
|
191
|
+
["Database server", "Database AI agent", "database"],
|
|
192
|
+
["Host", "Host AI agent", "host"],
|
|
193
|
+
]);
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
test("aliases and agent names are unique", () => {
|
|
197
|
+
const aliases: Array<string> = ALL_AI_RESOURCE_TYPES.map(
|
|
198
|
+
(type: AiResourceType): string => {
|
|
199
|
+
return AI_RESOURCE_TYPE_INFO[type].agentAlias;
|
|
200
|
+
},
|
|
201
|
+
);
|
|
202
|
+
const agentNames: Array<string> = ALL_AI_RESOURCE_TYPES.map(
|
|
203
|
+
(type: AiResourceType): string => {
|
|
204
|
+
return AI_RESOURCE_TYPE_INFO[type].agentDisplayName;
|
|
205
|
+
},
|
|
206
|
+
);
|
|
207
|
+
|
|
208
|
+
expect(new Set(aliases).size).toBe(aliases.length);
|
|
209
|
+
expect(new Set(agentNames).size).toBe(agentNames.length);
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
test("pins the programs each type's commands may start with", () => {
|
|
213
|
+
expect(AI_RESOURCE_TYPE_INFO[AiResourceType.DockerHost].programs).toEqual([
|
|
214
|
+
"docker",
|
|
215
|
+
]);
|
|
216
|
+
expect(AI_RESOURCE_TYPE_INFO[AiResourceType.PodmanHost].programs).toEqual([
|
|
217
|
+
"docker",
|
|
218
|
+
]);
|
|
219
|
+
expect(
|
|
220
|
+
AI_RESOURCE_TYPE_INFO[AiResourceType.DockerSwarmCluster].programs,
|
|
221
|
+
).toEqual(["docker"]);
|
|
222
|
+
expect(
|
|
223
|
+
AI_RESOURCE_TYPE_INFO[AiResourceType.ProxmoxCluster].programs,
|
|
224
|
+
).toEqual(["pvesh"]);
|
|
225
|
+
expect(
|
|
226
|
+
AI_RESOURCE_TYPE_INFO[AiResourceType.VMwareVCenter].programs,
|
|
227
|
+
).toEqual(["govc"]);
|
|
228
|
+
expect(AI_RESOURCE_TYPE_INFO[AiResourceType.CephCluster].programs).toEqual([
|
|
229
|
+
"ceph",
|
|
230
|
+
]);
|
|
231
|
+
expect(
|
|
232
|
+
AI_RESOURCE_TYPE_INFO[AiResourceType.DatabaseServer].programs,
|
|
233
|
+
).toEqual(["db"]);
|
|
234
|
+
expect(AI_RESOURCE_TYPE_INFO[AiResourceType.Host].programs).toEqual([
|
|
235
|
+
"systemctl",
|
|
236
|
+
"journalctl",
|
|
237
|
+
"df",
|
|
238
|
+
"free",
|
|
239
|
+
"uptime",
|
|
240
|
+
"ps",
|
|
241
|
+
"ss",
|
|
242
|
+
"ip",
|
|
243
|
+
"dmesg",
|
|
244
|
+
"lsblk",
|
|
245
|
+
"cat",
|
|
246
|
+
"top",
|
|
247
|
+
"uname",
|
|
248
|
+
"hostnamectl",
|
|
249
|
+
"timedatectl",
|
|
250
|
+
"kill",
|
|
251
|
+
]);
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
test("no type lets a command start with a shell, an interpreter or a privilege switch", () => {
|
|
255
|
+
const forbidden: Array<string> = [
|
|
256
|
+
"sh",
|
|
257
|
+
"bash",
|
|
258
|
+
"zsh",
|
|
259
|
+
"env",
|
|
260
|
+
"sudo",
|
|
261
|
+
"su",
|
|
262
|
+
"doas",
|
|
263
|
+
"nsenter",
|
|
264
|
+
"python",
|
|
265
|
+
"python3",
|
|
266
|
+
"node",
|
|
267
|
+
"perl",
|
|
268
|
+
"kubectl",
|
|
269
|
+
"rm",
|
|
270
|
+
"dd",
|
|
271
|
+
"curl",
|
|
272
|
+
"wget",
|
|
273
|
+
"psql",
|
|
274
|
+
"mysql",
|
|
275
|
+
"redis-cli",
|
|
276
|
+
];
|
|
277
|
+
|
|
278
|
+
for (const type of ALL_AI_RESOURCE_TYPES) {
|
|
279
|
+
for (const program of forbidden) {
|
|
280
|
+
expect(AI_RESOURCE_TYPE_INFO[type].programs).not.toContain(program);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
test("program names are bare words (no paths, no spaces, lowercase)", () => {
|
|
286
|
+
for (const type of ALL_AI_RESOURCE_TYPES) {
|
|
287
|
+
const programs: ReadonlyArray<string> =
|
|
288
|
+
AI_RESOURCE_TYPE_INFO[type].programs;
|
|
289
|
+
|
|
290
|
+
expect(programs.length).toBeGreaterThan(0);
|
|
291
|
+
expect(new Set(programs).size).toBe(programs.length);
|
|
292
|
+
|
|
293
|
+
for (const program of programs) {
|
|
294
|
+
expect(program).toMatch(/^[a-z][a-z0-9.-]*$/);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
test("pins the Test connection commands", () => {
|
|
300
|
+
const testCommands: Record<string, ReadonlyArray<string>> = {};
|
|
301
|
+
|
|
302
|
+
for (const type of ALL_AI_RESOURCE_TYPES) {
|
|
303
|
+
testCommands[type] = AI_RESOURCE_TYPE_INFO[type].testCommands;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
expect(testCommands).toEqual({
|
|
307
|
+
DockerHost: ["docker version", "docker info"],
|
|
308
|
+
PodmanHost: ["docker version", "docker info"],
|
|
309
|
+
DockerSwarmCluster: ["docker version", "docker node ls"],
|
|
310
|
+
ProxmoxCluster: ["pvesh get /version", "pvesh get /cluster/status"],
|
|
311
|
+
VMwareVCenter: ["govc about"],
|
|
312
|
+
CephCluster: ["ceph health", "ceph versions"],
|
|
313
|
+
DatabaseServer: ["db ping", "db version"],
|
|
314
|
+
Host: ["uptime", "systemctl list-units --failed --no-pager"],
|
|
315
|
+
});
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
test("every Test connection command starts with one of its type's programs", () => {
|
|
319
|
+
for (const type of ALL_AI_RESOURCE_TYPES) {
|
|
320
|
+
const info: AiResourceTypeInfo = AI_RESOURCE_TYPE_INFO[type];
|
|
321
|
+
|
|
322
|
+
expect(info.testCommands.length).toBeGreaterThan(0);
|
|
323
|
+
|
|
324
|
+
for (const command of info.testCommands) {
|
|
325
|
+
const program: string = command.split(" ")[0] || "";
|
|
326
|
+
expect(info.programs).toContain(program);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
test("pins the collector identity variables", () => {
|
|
332
|
+
const identity: Record<string, ReadonlyArray<string>> = {};
|
|
333
|
+
|
|
334
|
+
for (const type of ALL_AI_RESOURCE_TYPES) {
|
|
335
|
+
identity[type] = AI_RESOURCE_TYPE_INFO[type].identityEnvVars;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
expect(identity).toEqual({
|
|
339
|
+
DockerHost: ["DOCKER_HOST_NAME"],
|
|
340
|
+
PodmanHost: ["PODMAN_HOST_NAME"],
|
|
341
|
+
DockerSwarmCluster: ["DOCKER_SWARM_CLUSTER_NAME"],
|
|
342
|
+
ProxmoxCluster: ["PROXMOX_CLUSTER_NAME"],
|
|
343
|
+
VMwareVCenter: ["VMWARE_VCENTER_NAME"],
|
|
344
|
+
CephCluster: ["CEPH_CLUSTER_NAME"],
|
|
345
|
+
DatabaseServer: [
|
|
346
|
+
"DATABASE_SERVER_ID",
|
|
347
|
+
"DATABASE_SYSTEM",
|
|
348
|
+
"DATABASE_SERVER_ADDRESS",
|
|
349
|
+
"DATABASE_SERVER_PORT",
|
|
350
|
+
],
|
|
351
|
+
Host: ["HOST_NAME"],
|
|
352
|
+
});
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
test("pins the collector default identities the agent warns about", () => {
|
|
356
|
+
const placeholders: Record<string, ReadonlyArray<string>> = {};
|
|
357
|
+
|
|
358
|
+
for (const type of ALL_AI_RESOURCE_TYPES) {
|
|
359
|
+
placeholders[type] =
|
|
360
|
+
AI_RESOURCE_TYPE_INFO[type].defaultIdentityPlaceholders;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
expect(placeholders).toEqual({
|
|
364
|
+
DockerHost: ["docker-host"],
|
|
365
|
+
PodmanHost: ["podman-host"],
|
|
366
|
+
DockerSwarmCluster: ["docker-swarm", "my-swarm"],
|
|
367
|
+
ProxmoxCluster: ["proxmox-cluster"],
|
|
368
|
+
VMwareVCenter: ["vmware-vcenter"],
|
|
369
|
+
CephCluster: ["ceph"],
|
|
370
|
+
DatabaseServer: [],
|
|
371
|
+
Host: [],
|
|
372
|
+
});
|
|
373
|
+
});
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
describe("isDefaultIdentityPlaceholder", () => {
|
|
377
|
+
test.each([
|
|
378
|
+
[AiResourceType.DockerHost, "docker-host"],
|
|
379
|
+
[AiResourceType.DockerHost, " Docker-Host "],
|
|
380
|
+
[AiResourceType.PodmanHost, "PODMAN-HOST"],
|
|
381
|
+
[AiResourceType.DockerSwarmCluster, "docker-swarm"],
|
|
382
|
+
[AiResourceType.DockerSwarmCluster, "my-swarm"],
|
|
383
|
+
[AiResourceType.ProxmoxCluster, "proxmox-cluster"],
|
|
384
|
+
[AiResourceType.VMwareVCenter, "vmware-vcenter"],
|
|
385
|
+
[AiResourceType.CephCluster, "ceph"],
|
|
386
|
+
])(
|
|
387
|
+
"%s identity %p is the collector default",
|
|
388
|
+
(type: AiResourceType, identifier: string) => {
|
|
389
|
+
expect(isDefaultIdentityPlaceholder(type, identifier)).toBe(true);
|
|
390
|
+
},
|
|
391
|
+
);
|
|
392
|
+
|
|
393
|
+
test.each([
|
|
394
|
+
[AiResourceType.DockerHost, "prod-web-1"],
|
|
395
|
+
[AiResourceType.DockerHost, "podman-host"],
|
|
396
|
+
[AiResourceType.PodmanHost, "docker-host"],
|
|
397
|
+
[AiResourceType.CephCluster, "ceph-prod"],
|
|
398
|
+
[AiResourceType.DatabaseServer, "database"],
|
|
399
|
+
[AiResourceType.Host, "localhost"],
|
|
400
|
+
[AiResourceType.DockerHost, ""],
|
|
401
|
+
])(
|
|
402
|
+
"%s identity %p is not a default",
|
|
403
|
+
(type: AiResourceType, identifier: string) => {
|
|
404
|
+
expect(isDefaultIdentityPlaceholder(type, identifier)).toBe(false);
|
|
405
|
+
},
|
|
406
|
+
);
|
|
407
|
+
|
|
408
|
+
test("non-strings and unknown types are never a default", () => {
|
|
409
|
+
expect(isDefaultIdentityPlaceholder(AiResourceType.DockerHost, null)).toBe(
|
|
410
|
+
false,
|
|
411
|
+
);
|
|
412
|
+
expect(
|
|
413
|
+
isDefaultIdentityPlaceholder(AiResourceType.DockerHost, undefined),
|
|
414
|
+
).toBe(false);
|
|
415
|
+
expect(
|
|
416
|
+
isDefaultIdentityPlaceholder("Nope" as AiResourceType, "docker-host"),
|
|
417
|
+
).toBe(false);
|
|
418
|
+
});
|
|
419
|
+
});
|